x_ite 4.7.5 → 4.7.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.vscode/launch.json +15 -0
- package/.vscode/settings.json +1 -3
- package/README.md +1 -1
- package/dist/example.html +2 -2
- package/dist/x_ite.css +2 -2
- package/dist/x_ite.js +66 -18
- package/dist/x_ite.min.js +13 -13
- package/dist/x_ite.zip +0 -0
- package/docs/Custom-Shaders.md +165 -174
- package/docs/What's-New.md +38 -6
- package/docs/_config.yml +1 -1
- package/docs/index.md +3 -3
- package/package.json +9 -4
- package/src/tests.js +1 -0
- package/src/x_ite/Browser/VERSION.js +1 -1
- package/src/x_ite/Components/Grouping/Switch.js +1 -1
- package/src/x_ite/Components/Lighting/DirectionalLight.js +1 -1
- package/src/x_ite/Components/Navigation/Collision.js +1 -1
- package/src/x_ite/Components/Navigation/LOD.js +1 -1
- package/src/x_ite/Components/Rendering/X3DGeometryNode.js +25 -11
- package/src/x_ite/Components/Rendering/X3DLineGeometryNode.js +35 -1
package/dist/x_ite.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* X_ITE X3D v4.7.
|
|
1
|
+
/* X_ITE X3D v4.7.6-1127
|
|
2
2
|
* See LICENSE.txt for a detailed listing of used licences. */
|
|
3
3
|
!function(){var x_iteNoConfict={sprintf:window.sprintf,vsprintf:window.vsprintf},module={},requirejs,require,define;!function(global,setTimeout){function commentReplace(t,e){return e||""}function isFunction(t){return"[object Function]"===ostring.call(t)}function isArray(t){return"[object Array]"===ostring.call(t)}function each(t,e){if(t){var i;for(i=0;i<t.length&&(!t[i]||!e(t[i],i,t));i+=1);}}function eachReverse(t,e){if(t){var i;for(i=t.length-1;i>-1&&(!t[i]||!e(t[i],i,t));i-=1);}}function hasProp(t,e){return hasOwn.call(t,e)}function getOwn(t,e){return hasProp(t,e)&&t[e]}function eachProp(t,e){var i;for(i in t)if(hasProp(t,i)&&e(t[i],i))break}function mixin(t,e,i,n){return e&&eachProp(e,function(e,r){!i&&hasProp(t,r)||(!n||"object"!=typeof e||!e||isArray(e)||isFunction(e)||e instanceof RegExp?t[r]=e:(t[r]||(t[r]={}),mixin(t[r],e,i,n)))}),t}function bind(t,e){return function(){return e.apply(t,arguments)}}function scripts(){return document.getElementsByTagName("script")}function defaultOnError(t){throw t}function getGlobal(t){if(!t)return t;var e=global;return each(t.split("."),function(t){e=e[t]}),e}function makeError(t,e,i,n){var r=new Error(e+"\nhttps://requirejs.org/docs/errors.html#"+t);return r.requireType=t,r.requireModules=n,i&&(r.originalError=i),r}function newContext(t){function e(t){var e,i;for(e=0;e<t.length;e++)if("."===(i=t[e]))t.splice(e,1),e-=1;else if(".."===i){if(0===e||1===e&&".."===t[2]||".."===t[e-1])continue;e>0&&(t.splice(e-1,2),e-=2)}}function i(t,i,n){var r,s,o,a,u,l,c,h,d,p,f,g,m=i&&i.split("/"),_=S.map,x=_&&_["*"];if(t&&(t=t.split("/"),c=t.length-1,S.nodeIdCompat&&jsSuffixRegExp.test(t[c])&&(t[c]=t[c].replace(jsSuffixRegExp,"")),"."===t[0].charAt(0)&&m&&(g=m.slice(0,m.length-1),t=g.concat(t)),e(t),t=t.join("/")),n&&_&&(m||x)){o=t.split("/");t:for(a=o.length;a>0;a-=1){if(l=o.slice(0,a).join("/"),m)for(u=m.length;u>0;u-=1)if((s=getOwn(_,m.slice(0,u).join("/")))&&(s=getOwn(s,l))){h=s,d=a;break t}!p&&x&&getOwn(x,l)&&(p=getOwn(x,l),f=a)}!h&&p&&(h=p,d=f),h&&(o.splice(0,d,h),t=o.join("/"))}return r=getOwn(S.pkgs,t),r?r:t}function n(t){isBrowser&&each(scripts(),function(e){if(e.getAttribute("data-requiremodule")===t&&e.getAttribute("data-requirecontext")===v.contextName)return e.parentNode.removeChild(e),!0})}function r(t){var e=getOwn(S.paths,t);if(e&&isArray(e)&&e.length>1)return e.shift(),v.require.undef(t),v.makeRequire(null,{skipMap:!0})([t]),!0}function s(t){var e,i=t?t.indexOf("!"):-1;return i>-1&&(e=t.substring(0,i),t=t.substring(i+1,t.length)),[e,t]}function o(t,e,n,r){var o,a,u,l,c=null,h=e?e.name:null,d=t,p=!0,f="";return t||(p=!1,t="_@r"+(D+=1)),l=s(t),c=l[0],t=l[1],c&&(c=i(c,h,r),a=getOwn(N,c)),t&&(c?f=n?t:a&&a.normalize?a.normalize(t,function(t){return i(t,h,r)}):t.indexOf("!")===-1?i(t,h,r):t:(f=i(t,h,r),l=s(f),c=l[0],f=l[1],n=!0,o=v.nameToUrl(f))),u=!c||a||n?"":"_unnormalized"+(V+=1),{prefix:c,name:f,parentMap:e,unnormalized:!!u,url:o,originalName:d,isDefine:p,id:(c?c+"!"+f:f)+u}}function a(t){var e=t.id,i=getOwn(C,e);return i||(i=C[e]=new v.Module(t)),i}function u(t,e,i){var n=t.id,r=getOwn(C,n);!hasProp(N,n)||r&&!r.defineEmitComplete?(r=a(t),r.error&&"error"===e?i(r.error):r.on(e,i)):"defined"===e&&i(N[n])}function l(t,e){var i=t.requireModules,n=!1;e?e(t):(each(i,function(e){var i=getOwn(C,e);i&&(i.error=t,i.events.error&&(n=!0,i.emit("error",t)))}),n||req.onError(t))}function c(){globalDefQueue.length&&(each(globalDefQueue,function(t){var e=t[0];"string"==typeof e&&(v.defQueueMap[e]=!0),O.push(t)}),globalDefQueue=[])}function h(t){delete C[t],delete T[t]}function d(t,e,i){var n=t.map.id;t.error?t.emit("error",t.error):(e[n]=!0,each(t.depMaps,function(n,r){var s=n.id,o=getOwn(C,s);!o||t.depMatched[r]||i[s]||(getOwn(e,s)?(t.defineDep(r,N[s]),t.check()):d(o,e,i))}),i[n]=!0)}function p(){var t,e,i=1e3*S.waitSeconds,s=i&&v.startTime+i<(new Date).getTime(),o=[],a=[],u=!1,c=!0;if(!x){if(x=!0,eachProp(T,function(t){var i=t.map,l=i.id;if(t.enabled&&(i.isDefine||a.push(t),!t.error))if(!t.inited&&s)r(l)?(e=!0,u=!0):(o.push(l),n(l));else if(!t.inited&&t.fetched&&i.isDefine&&(u=!0,!i.prefix))return c=!1}),s&&o.length)return t=makeError("timeout","Load timeout for modules: "+o,null,o),t.contextName=v.contextName,l(t);c&&each(a,function(t){d(t,{},{})}),s&&!e||!u||!isBrowser&&!isWebWorker||b||(b=setTimeout(function(){b=0,p()},50)),x=!1}}function f(t){hasProp(N,t[0])||a(o(t[0],null,!0)).init(t[1],t[2])}function g(t,e,i,n){t.detachEvent&&!isOpera?n&&t.detachEvent(n,e):t.removeEventListener(i,e,!1)}function m(t){var e=t.currentTarget||t.srcElement;return g(e,v.onScriptLoad,"load","onreadystatechange"),g(e,v.onScriptError,"error"),{node:e,id:e&&e.getAttribute("data-requiremodule")}}function _(){var t;for(c();O.length;){if(t=O.shift(),null===t[0])return l(makeError("mismatch","Mismatched anonymous define() module: "+t[t.length-1]));f(t)}v.defQueueMap={}}var x,y,v,w,b,S={waitSeconds:7,baseUrl:"./",paths:{},bundles:{},pkgs:{},shim:{},config:{}},C={},T={},F={},O=[],N={},E={},M={},D=1,V=1;return w={require:function(t){return t.require?t.require:t.require=v.makeRequire(t.map)},exports:function(t){if(t.usingExports=!0,t.map.isDefine)return t.exports?N[t.map.id]=t.exports:t.exports=N[t.map.id]={}},module:function(t){return t.module?t.module:t.module={id:t.map.id,uri:t.map.url,config:function(){return getOwn(S.config,t.map.id)||{}},exports:t.exports||(t.exports={})}}},y=function(t){this.events=getOwn(F,t.id)||{},this.map=t,this.shim=getOwn(S.shim,t.id),this.depExports=[],this.depMaps=[],this.depMatched=[],this.pluginMaps={},this.depCount=0},y.prototype={init:function(t,e,i,n){n=n||{},this.inited||(this.factory=e,i?this.on("error",i):this.events.error&&(i=bind(this,function(t){this.emit("error",t)})),this.depMaps=t&&t.slice(0),this.errback=i,this.inited=!0,this.ignore=n.ignore,n.enabled||this.enabled?this.enable():this.check())},defineDep:function(t,e){this.depMatched[t]||(this.depMatched[t]=!0,this.depCount-=1,this.depExports[t]=e)},fetch:function(){if(!this.fetched){this.fetched=!0,v.startTime=(new Date).getTime();var t=this.map;if(!this.shim)return t.prefix?this.callPlugin():this.load();v.makeRequire(this.map,{enableBuildCallback:!0})(this.shim.deps||[],bind(this,function(){return t.prefix?this.callPlugin():this.load()}))}},load:function(){var t=this.map.url;E[t]||(E[t]=!0,v.load(this.map.id,t))},check:function(){if(this.enabled&&!this.enabling){var t,e,i=this.map.id,n=this.depExports,r=this.exports,s=this.factory;if(this.inited){if(this.error)this.emit("error",this.error);else if(!this.defining){if(this.defining=!0,this.depCount<1&&!this.defined){if(isFunction(s)){if(this.events.error&&this.map.isDefine||req.onError!==defaultOnError)try{r=v.execCb(i,s,n,r)}catch(e){t=e}else r=v.execCb(i,s,n,r);if(this.map.isDefine&&void 0===r&&(e=this.module,e?r=e.exports:this.usingExports&&(r=this.exports)),t)return t.requireMap=this.map,t.requireModules=this.map.isDefine?[this.map.id]:null,t.requireType=this.map.isDefine?"define":"require",l(this.error=t)}else r=s;if(this.exports=r,this.map.isDefine&&!this.ignore&&(N[i]=r,req.onResourceLoad)){var o=[];each(this.depMaps,function(t){o.push(t.normalizedMap||t)}),req.onResourceLoad(v,this.map,o)}h(i),this.defined=!0}this.defining=!1,this.defined&&!this.defineEmitted&&(this.defineEmitted=!0,this.emit("defined",this.exports),this.defineEmitComplete=!0)}}else hasProp(v.defQueueMap,i)||this.fetch()}},callPlugin:function(){var t=this.map,e=t.id,n=o(t.prefix);this.depMaps.push(n),u(n,"defined",bind(this,function(n){var r,s,c,d=getOwn(M,this.map.id),p=this.map.name,f=this.map.parentMap?this.map.parentMap.name:null,g=v.makeRequire(t.parentMap,{enableBuildCallback:!0});return this.map.unnormalized?(n.normalize&&(p=n.normalize(p,function(t){return i(t,f,!0)})||""),s=o(t.prefix+"!"+p,this.map.parentMap,!0),u(s,"defined",bind(this,function(t){this.map.normalizedMap=s,this.init([],function(){return t},null,{enabled:!0,ignore:!0})})),void((c=getOwn(C,s.id))&&(this.depMaps.push(s),this.events.error&&c.on("error",bind(this,function(t){this.emit("error",t)})),c.enable()))):d?(this.map.url=v.nameToUrl(d),void this.load()):(r=bind(this,function(t){this.init([],function(){return t},null,{enabled:!0})}),r.error=bind(this,function(t){this.inited=!0,this.error=t,t.requireModules=[e],eachProp(C,function(t){0===t.map.id.indexOf(e+"_unnormalized")&&h(t.map.id)}),l(t)}),r.fromText=bind(this,function(i,n){var s=t.name,u=o(s),c=useInteractive;n&&(i=n),c&&(useInteractive=!1),a(u),hasProp(S.config,e)&&(S.config[s]=S.config[e]);try{req.exec(i)}catch(t){return l(makeError("fromtexteval","fromText eval for "+e+" failed: "+t,t,[e]))}c&&(useInteractive=!0),this.depMaps.push(u),v.completeLoad(s),g([s],r)}),void n.load(t.name,g,r,S))})),v.enable(n,this),this.pluginMaps[n.id]=n},enable:function(){T[this.map.id]=this,this.enabled=!0,this.enabling=!0,each(this.depMaps,bind(this,function(t,e){var i,n,r;if("string"==typeof t){if(t=o(t,this.map.isDefine?this.map:this.map.parentMap,!1,!this.skipMap),this.depMaps[e]=t,r=getOwn(w,t.id))return void(this.depExports[e]=r(this));this.depCount+=1,u(t,"defined",bind(this,function(t){this.undefed||(this.defineDep(e,t),this.check())})),this.errback?u(t,"error",bind(this,this.errback)):this.events.error&&u(t,"error",bind(this,function(t){this.emit("error",t)}))}i=t.id,n=C[i],hasProp(w,i)||!n||n.enabled||v.enable(t,this)})),eachProp(this.pluginMaps,bind(this,function(t){var e=getOwn(C,t.id);e&&!e.enabled&&v.enable(t,this)})),this.enabling=!1,this.check()},on:function(t,e){var i=this.events[t];i||(i=this.events[t]=[]),i.push(e)},emit:function(t,e){each(this.events[t],function(t){t(e)}),"error"===t&&delete this.events[t]}},v={config:S,contextName:t,registry:C,defined:N,urlFetched:E,defQueue:O,defQueueMap:{},Module:y,makeModuleMap:o,nextTick:req.nextTick,onError:l,configure:function(t){if(t.baseUrl&&"/"!==t.baseUrl.charAt(t.baseUrl.length-1)&&(t.baseUrl+="/"),"string"==typeof t.urlArgs){var e=t.urlArgs;t.urlArgs=function(t,i){return(i.indexOf("?")===-1?"?":"&")+e}}var i=S.shim,n={paths:!0,bundles:!0,config:!0,map:!0};eachProp(t,function(t,e){n[e]?(S[e]||(S[e]={}),mixin(S[e],t,!0,!0)):S[e]=t}),t.bundles&&eachProp(t.bundles,function(t,e){each(t,function(t){t!==e&&(M[t]=e)})}),t.shim&&(eachProp(t.shim,function(t,e){isArray(t)&&(t={deps:t}),!t.exports&&!t.init||t.exportsFn||(t.exportsFn=v.makeShimExports(t)),i[e]=t}),S.shim=i),t.packages&&each(t.packages,function(t){var e,i;t="string"==typeof t?{name:t}:t,i=t.name,e=t.location,e&&(S.paths[i]=t.location),S.pkgs[i]=t.name+"/"+(t.main||"main").replace(currDirRegExp,"").replace(jsSuffixRegExp,"")}),eachProp(C,function(t,e){t.inited||t.map.unnormalized||(t.map=o(e,null,!0))}),(t.deps||t.callback)&&v.require(t.deps||[],t.callback)},makeShimExports:function(t){function e(){var e;return t.init&&(e=t.init.apply(global,arguments)),e||t.exports&&getGlobal(t.exports)}return e},makeRequire:function(e,r){function s(i,n,u){var c,h,d;return r.enableBuildCallback&&n&&isFunction(n)&&(n.__requireJsBuild=!0),"string"==typeof i?isFunction(n)?l(makeError("requireargs","Invalid require call"),u):e&&hasProp(w,i)?w[i](C[e.id]):req.get?req.get(v,i,e,s):(h=o(i,e,!1,!0),c=h.id,hasProp(N,c)?N[c]:l(makeError("notloaded",'Module name "'+c+'" has not been loaded yet for context: '+t+(e?"":". Use require([])")))):(_(),v.nextTick(function(){_(),d=a(o(null,e)),d.skipMap=r.skipMap,d.init(i,n,u,{enabled:!0}),p()}),s)}return r=r||{},mixin(s,{isBrowser:isBrowser,toUrl:function(t){var n,r=t.lastIndexOf("."),s=t.split("/")[0],o="."===s||".."===s;return r!==-1&&(!o||r>1)&&(n=t.substring(r,t.length),t=t.substring(0,r)),v.nameToUrl(i(t,e&&e.id,!0),n,!0)},defined:function(t){return hasProp(N,o(t,e,!1,!0).id)},specified:function(t){return t=o(t,e,!1,!0).id,hasProp(N,t)||hasProp(C,t)}}),e||(s.undef=function(t){c();var i=o(t,e,!0),r=getOwn(C,t);r.undefed=!0,n(t),delete N[t],delete E[i.url],delete F[t],eachReverse(O,function(e,i){e[0]===t&&O.splice(i,1)}),delete v.defQueueMap[t],r&&(r.events.defined&&(F[t]=r.events),h(t))}),s},enable:function(t){getOwn(C,t.id)&&a(t).enable()},completeLoad:function(t){var e,i,n,s=getOwn(S.shim,t)||{},o=s.exports;for(c();O.length;){if(i=O.shift(),null===i[0]){if(i[0]=t,e)break;e=!0}else i[0]===t&&(e=!0);f(i)}if(v.defQueueMap={},n=getOwn(C,t),!e&&!hasProp(N,t)&&n&&!n.inited){if(!(!S.enforceDefine||o&&getGlobal(o)))return r(t)?void 0:l(makeError("nodefine","No define call for "+t,null,[t]));f([t,s.deps||[],s.exportsFn])}p()},nameToUrl:function(t,e,i){var n,r,s,o,a,u,l,c=getOwn(S.pkgs,t);if(c&&(t=c),l=getOwn(M,t))return v.nameToUrl(l,e,i);if(req.jsExtRegExp.test(t))a=t+(e||"");else{for(n=S.paths,r=t.split("/"),s=r.length;s>0;s-=1)if(o=r.slice(0,s).join("/"),u=getOwn(n,o)){isArray(u)&&(u=u[0]),r.splice(0,s,u);break}a=r.join("/"),a+=e||(/^data\:|^blob\:|\?/.test(a)||i?"":".js"),a=("/"===a.charAt(0)||a.match(/^[\w\+\.\-]+:/)?"":S.baseUrl)+a}return S.urlArgs&&!/^blob\:/.test(a)?a+S.urlArgs(t,a):a},load:function(t,e){req.load(v,t,e)},execCb:function(t,e,i,n){return e.apply(n,i)},onScriptLoad:function(t){if("load"===t.type||readyRegExp.test((t.currentTarget||t.srcElement).readyState)){interactiveScript=null;var e=m(t);v.completeLoad(e.id)}},onScriptError:function(t){var e=m(t);if(!r(e.id)){var i=[];return eachProp(C,function(t,n){0!==n.indexOf("_@r")&&each(t.depMaps,function(t){if(t.id===e.id)return i.push(n),!0})}),l(makeError("scripterror",'Script error for "'+e.id+(i.length?'", needed by: '+i.join(", "):'"'),t,[e.id]))}}},v.require=v.makeRequire(),v}function getInteractiveScript(){return interactiveScript&&"interactive"===interactiveScript.readyState?interactiveScript:(eachReverse(scripts(),function(t){if("interactive"===t.readyState)return interactiveScript=t}),interactiveScript)}var req,s,head,baseElement,dataMain,src,interactiveScript,currentlyAddingScript,mainScript,subPath,version="2.3.6",commentRegExp=/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/gm,cjsRequireRegExp=/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,jsSuffixRegExp=/\.js$/,currDirRegExp=/^\.\//,op=Object.prototype,ostring=op.toString,hasOwn=op.hasOwnProperty,isBrowser=!("undefined"==typeof window||"undefined"==typeof navigator||!window.document),isWebWorker=!isBrowser&&"undefined"!=typeof importScripts,readyRegExp=isBrowser&&"PLAYSTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/,defContextName="_",isOpera="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),contexts={},cfg={},globalDefQueue=[],useInteractive=!1;if(void 0===define){if(void 0!==requirejs){if(isFunction(requirejs))return;cfg=requirejs,requirejs=void 0}void 0===require||isFunction(require)||(cfg=require,require=void 0),req=requirejs=function(t,e,i,n){var r,s,o="_";return isArray(t)||"string"==typeof t||(s=t,isArray(e)?(t=e,e=i,i=n):t=[]),s&&s.context&&(o=s.context),r=getOwn(contexts,o),r||(r=contexts[o]=req.s.newContext(o)),s&&r.configure(s),r.require(t,e,i)},req.config=function(t){return req(t)},req.nextTick=void 0!==setTimeout?function(t){setTimeout(t,4)}:function(t){t()},require||(require=req),req.version="2.3.6",req.jsExtRegExp=/^\/|:|\?|\.js$/,req.isBrowser=isBrowser,s=req.s={contexts:contexts,newContext:newContext},req({}),each(["toUrl","undef","defined","specified"],function(t){req[t]=function(){var e=contexts._;return e.require[t].apply(e,arguments)}}),isBrowser&&(head=s.head=document.getElementsByTagName("head")[0],(baseElement=document.getElementsByTagName("base")[0])&&(head=s.head=baseElement.parentNode)),req.onError=defaultOnError,req.createNode=function(t,e,i){var n=t.xhtml?document.createElementNS("http://www.w3.org/1999/xhtml","html:script"):document.createElement("script");return n.type=t.scriptType||"text/javascript",n.charset="utf-8",n.async=!0,n},req.load=function(t,e,i){var n,r=t&&t.config||{};if(isBrowser)return n=req.createNode(r,e,i),n.setAttribute("data-requirecontext",t.contextName),n.setAttribute("data-requiremodule",e),!n.attachEvent||n.attachEvent.toString&&n.attachEvent.toString().indexOf("[native code")<0||isOpera?(n.addEventListener("load",t.onScriptLoad,!1),n.addEventListener("error",t.onScriptError,!1)):(useInteractive=!0,n.attachEvent("onreadystatechange",t.onScriptLoad)),n.src=i,r.onNodeCreated&&r.onNodeCreated(n,r,e,i),currentlyAddingScript=n,baseElement?head.insertBefore(n,baseElement):head.appendChild(n),currentlyAddingScript=null,n;if(isWebWorker)try{setTimeout(function(){},0),importScripts(i),t.completeLoad(e)}catch(n){t.onError(makeError("importscripts","importScripts failed for "+e+" at "+i,n,[e]))}},isBrowser&&!cfg.skipDataMain&&eachReverse(scripts(),function(t){if(head||(head=t.parentNode),dataMain=t.getAttribute("data-main"))return mainScript=dataMain,cfg.baseUrl||mainScript.indexOf("!")!==-1||(src=mainScript.split("/"),mainScript=src.pop(),subPath=src.length?src.join("/")+"/":"./",cfg.baseUrl=subPath),mainScript=mainScript.replace(jsSuffixRegExp,""),req.jsExtRegExp.test(mainScript)&&(mainScript=dataMain),cfg.deps=cfg.deps?cfg.deps.concat(mainScript):[mainScript],!0}),define=function(t,e,i){var n,r;"string"!=typeof t&&(i=e,e=t,t=null),isArray(e)||(i=e,e=null),!e&&isFunction(i)&&(e=[],i.length&&(i.toString().replace(/\/\*[\s\S]*?\*\/|([^:"'=]|^)\/\/.*$/gm,commentReplace).replace(/[^.]\s*require\s*\(\s*["']([^'"\s]+)["']\s*\)/g,function(t,i){e.push(i)}),e=(1===i.length?["require"]:["require","exports","module"]).concat(e))),useInteractive&&(n=currentlyAddingScript||getInteractiveScript())&&(t||(t=n.getAttribute("data-requiremodule")),r=contexts[n.getAttribute("data-requirecontext")]),r?(r.defQueue.push([t,e,i]),r.defQueueMap[t]=!0):globalDefQueue.push([t,e,i])},define.amd={jQuery:!0},req.exec=function(text){return eval(text)},req(cfg)}}(this,"undefined"==typeof setTimeout?void 0:setTimeout),define("../node_modules/requirejs/require.js",function(){}),function(t,e){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=t.document?e(t,!0):function(t){if(!t.document)throw new Error("jQuery requires a window with a document");return e(t)}:e(t)}("undefined"!=typeof window?window:this,function(t,e){function i(t,e,i){i=i||wt;var n,r,s=i.createElement("script");if(s.text=t,e)for(n in bt)(r=e[n]||e.getAttribute&&e.getAttribute(n))&&s.setAttribute(n,r);i.head.appendChild(s).parentNode.removeChild(s)}function n(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?pt[ft.call(t)]||"object":typeof t}function r(t){var e=!!t&&"length"in t&&t.length,i=n(t);return!yt(t)&&!vt(t)&&("array"===i||0===e||"number"==typeof e&&e>0&&e-1 in t)}function s(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}function o(t,e,i){return yt(e)?St.grep(t,function(t,n){return!!e.call(t,n,t)!==i}):e.nodeType?St.grep(t,function(t){return t===e!==i}):"string"!=typeof e?St.grep(t,function(t){return dt.call(e,t)>-1!==i}):St.filter(e,t,i)}function a(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}function u(t){var e={};return St.each(t.match(It)||[],function(t,i){e[i]=!0}),e}function l(t){return t}function c(t){throw t}function h(t,e,i,n){var r;try{t&&yt(r=t.promise)?r.call(t).done(e).fail(i):t&&yt(r=t.then)?r.call(t,e,i):e.apply(void 0,[t].slice(n))}catch(t){i.apply(void 0,[t])}}function d(){wt.removeEventListener("DOMContentLoaded",d),t.removeEventListener("load",d),St.ready()}function p(t,e){return e.toUpperCase()}function f(t){return t.replace(Lt,"ms-").replace(Rt,p)}function g(){this.expando=St.expando+g.uid++}function m(t){return"true"===t||"false"!==t&&("null"===t?null:t===+t+""?+t:jt.test(t)?JSON.parse(t):t)}function _(t,e,i){var n;if(void 0===i&&1===t.nodeType)if(n="data-"+e.replace(zt,"-$&").toLowerCase(),"string"==typeof(i=t.getAttribute(n))){try{i=m(i)}catch(t){}Xt.set(t,e,i)}else i=void 0;return i}function x(t,e,i,n){var r,s,o=20,a=n?function(){return n.cur()}:function(){return St.css(t,e,"")},u=a(),l=i&&i[3]||(St.cssNumber[e]?"":"px"),c=t.nodeType&&(St.cssNumber[e]||"px"!==l&&+u)&&Ht.exec(St.css(t,e));if(c&&c[3]!==l){for(u/=2,l=l||c[3],c=+u||1;o--;)St.style(t,e,c+l),(1-s)*(1-(s=a()/u||.5))<=0&&(o=0),c/=s;c*=2,St.style(t,e,c+l),i=i||[]}return i&&(c=+c||+u||0,r=i[1]?c+(i[1]+1)*i[2]:+i[2],n&&(n.unit=l,n.start=c,n.end=r)),r}function y(t){var e,i=t.ownerDocument,n=t.nodeName,r=Qt[n];return r?r:(e=i.body.appendChild(i.createElement(n)),r=St.css(e,"display"),e.parentNode.removeChild(e),"none"===r&&(r="block"),Qt[n]=r,r)}function v(t,e){for(var i,n,r=[],s=0,o=t.length;s<o;s++)n=t[s],n.style&&(i=n.style.display,e?("none"===i&&(r[s]=Ut.get(n,"display")||null,r[s]||(n.style.display="")),""===n.style.display&&Zt(n)&&(r[s]=y(n))):"none"!==i&&(r[s]="none",Ut.set(n,"display",i)));for(s=0;s<o;s++)null!=r[s]&&(t[s].style.display=r[s]);return t}function w(t,e){var i;return i=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&s(t,e)?St.merge([t],i):i}function b(t,e){for(var i=0,n=t.length;i<n;i++)Ut.set(t[i],"globalEval",!e||Ut.get(e[i],"globalEval"))}function S(t,e,i,r,s){for(var o,a,u,l,c,h,d=e.createDocumentFragment(),p=[],f=0,g=t.length;f<g;f++)if((o=t[f])||0===o)if("object"===n(o))St.merge(p,o.nodeType?[o]:o);else if(ie.test(o)){for(a=a||d.appendChild(e.createElement("div")),u=(Jt.exec(o)||["",""])[1].toLowerCase(),l=ee[u]||ee._default,a.innerHTML=l[1]+St.htmlPrefilter(o)+l[2],h=l[0];h--;)a=a.lastChild;St.merge(p,a.childNodes),a=d.firstChild,a.textContent=""}else p.push(e.createTextNode(o));for(d.textContent="",f=0;o=p[f++];)if(r&&St.inArray(o,r)>-1)s&&s.push(o);else if(c=Yt(o),a=w(d.appendChild(o),"script"),c&&b(a),i)for(h=0;o=a[h++];)te.test(o.type||"")&&i.push(o);return d}function C(){return!0}function T(){return!1}function F(t,e){return t===O()==("focus"===e)}function O(){try{return wt.activeElement}catch(t){}}function N(t,e,i,n,r,s){var o,a;if("object"==typeof e){"string"!=typeof i&&(n=n||i,i=void 0);for(a in e)N(t,a,i,n,e[a],s);return t}if(null==n&&null==r?(r=i,n=i=void 0):null==r&&("string"==typeof i?(r=n,n=void 0):(r=n,n=i,i=void 0)),r===!1)r=T;else if(!r)return t;return 1===s&&(o=r,r=function(t){return St().off(t),o.apply(this,arguments)},r.guid=o.guid||(o.guid=St.guid++)),t.each(function(){St.event.add(this,e,r,n,i)})}function E(t,e,i){if(!i)return void(void 0===Ut.get(t,e)&&St.event.add(t,e,C));Ut.set(t,e,!1),St.event.add(t,e,{namespace:!1,handler:function(t){var n,r,s=Ut.get(this,e);if(1&t.isTrigger&&this[e]){if(s.length)(St.event.special[e]||{}).delegateType&&t.stopPropagation();else if(s=lt.call(arguments),Ut.set(this,e,s),n=i(this,e),this[e](),r=Ut.get(this,e),s!==r||n?Ut.set(this,e,!1):r={},s!==r)return t.stopImmediatePropagation(),t.preventDefault(),r&&r.value}else s.length&&(Ut.set(this,e,{value:St.event.trigger(St.extend(s[0],St.Event.prototype),s.slice(1),this)}),t.stopImmediatePropagation())}})}function M(t,e){return s(t,"table")&&s(11!==e.nodeType?e:e.firstChild,"tr")?St(t).children("tbody")[0]||t:t}function D(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function V(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function I(t,e){var i,n,r,s,o,a,u;if(1===e.nodeType){if(Ut.hasData(t)&&(s=Ut.get(t),u=s.events)){Ut.remove(e,"handle events");for(r in u)for(i=0,n=u[r].length;i<n;i++)St.event.add(e,r,u[r][i])}Xt.hasData(t)&&(o=Xt.access(t),a=St.extend({},o),Xt.set(e,a))}}function B(t,e){var i=e.nodeName.toLowerCase();"input"===i&&Kt.test(t.type)?e.checked=t.checked:"input"!==i&&"textarea"!==i||(e.defaultValue=t.defaultValue)}function A(t,e,n,r){e=ct(e);var s,o,a,u,l,c,h=0,d=t.length,p=d-1,f=e[0],g=yt(f);if(g||d>1&&"string"==typeof f&&!xt.checkClone&&se.test(f))return t.each(function(i){var s=t.eq(i);g&&(e[0]=f.call(this,i,s.html())),A(s,e,n,r)});if(d&&(s=S(e,t[0].ownerDocument,!1,t,r),o=s.firstChild,1===s.childNodes.length&&(s=o),o||r)){for(a=St.map(w(s,"script"),D),u=a.length;h<d;h++)l=s,h!==p&&(l=St.clone(l,!0,!0),u&&St.merge(a,w(l,"script"))),n.call(t[h],l,h);if(u)for(c=a[a.length-1].ownerDocument,St.map(a,V),h=0;h<u;h++)l=a[h],te.test(l.type||"")&&!Ut.access(l,"globalEval")&&St.contains(c,l)&&(l.src&&"module"!==(l.type||"").toLowerCase()?St._evalUrl&&!l.noModule&&St._evalUrl(l.src,{nonce:l.nonce||l.getAttribute("nonce")},c):i(l.textContent.replace(oe,""),l,c))}return t}function P(t,e,i){for(var n,r=e?St.filter(e,t):t,s=0;null!=(n=r[s]);s++)i||1!==n.nodeType||St.cleanData(w(n)),n.parentNode&&(i&&Yt(n)&&b(w(n,"script")),n.parentNode.removeChild(n));return t}function L(t,e,i){var n,r,s,o,a=t.style;return i=i||ue(t),i&&(o=i.getPropertyValue(e)||i[e],""!==o||Yt(t)||(o=St.style(t,e)),!xt.pixelBoxStyles()&&ae.test(o)&&ce.test(e)&&(n=a.width,r=a.minWidth,s=a.maxWidth,a.minWidth=a.maxWidth=a.width=o,o=i.width,a.width=n,a.minWidth=r,a.maxWidth=s)),void 0!==o?o+"":o}function R(t,e){return{get:function(){return t()?void delete this.get:(this.get=e).apply(this,arguments)}}}function k(t){for(var e=t[0].toUpperCase()+t.slice(1),i=he.length;i--;)if((t=he[i]+e)in de)return t}function U(t){var e=St.cssProps[t]||pe[t];return e?e:t in de?t:pe[t]=k(t)||t}function X(t,e,i){var n=Ht.exec(e);return n?Math.max(0,n[2]-(i||0))+(n[3]||"px"):e}function j(t,e,i,n,r,s){var o="width"===e?1:0,a=0,u=0;if(i===(n?"border":"content"))return 0;for(;o<4;o+=2)"margin"===i&&(u+=St.css(t,i+qt[o],!0,r)),n?("content"===i&&(u-=St.css(t,"padding"+qt[o],!0,r)),"margin"!==i&&(u-=St.css(t,"border"+qt[o]+"Width",!0,r))):(u+=St.css(t,"padding"+qt[o],!0,r),"padding"!==i?u+=St.css(t,"border"+qt[o]+"Width",!0,r):a+=St.css(t,"border"+qt[o]+"Width",!0,r));return!n&&s>=0&&(u+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-s-u-a-.5))||0),u}function z(t,e,i){var n=ue(t),r=!xt.boxSizingReliable()||i,o=r&&"border-box"===St.css(t,"boxSizing",!1,n),a=o,u=L(t,e,n),l="offset"+e[0].toUpperCase()+e.slice(1);if(ae.test(u)){if(!i)return u;u="auto"}return(!xt.boxSizingReliable()&&o||!xt.reliableTrDimensions()&&s(t,"tr")||"auto"===u||!parseFloat(u)&&"inline"===St.css(t,"display",!1,n))&&t.getClientRects().length&&(o="border-box"===St.css(t,"boxSizing",!1,n),(a=l in t)&&(u=t[l])),(u=parseFloat(u)||0)+j(t,e,i||(o?"border":"content"),a,n,u)+"px"}function G(t,e,i,n,r){return new G.prototype.init(t,e,i,n,r)}function H(){ye&&(wt.hidden===!1&&t.requestAnimationFrame?t.requestAnimationFrame(H):t.setTimeout(H,St.fx.interval),St.fx.tick())}function q(){return t.setTimeout(function(){xe=void 0}),xe=Date.now()}function W(t,e){var i,n=0,r={height:t};for(e=e?1:0;n<4;n+=2-e)i=qt[n],r["margin"+i]=r["padding"+i]=t;return e&&(r.opacity=r.width=t),r}function Y(t,e,i){for(var n,r=(Q.tweeners[e]||[]).concat(Q.tweeners["*"]),s=0,o=r.length;s<o;s++)if(n=r[s].call(i,e,t))return n}function $(t,e,i){var n,r,s,o,a,u,l,c,h="width"in e||"height"in e,d=this,p={},f=t.style,g=t.nodeType&&Zt(t),m=Ut.get(t,"fxshow");i.queue||(o=St._queueHooks(t,"fx"),null==o.unqueued&&(o.unqueued=0,a=o.empty.fire,o.empty.fire=function(){o.unqueued||a()}),o.unqueued++,d.always(function(){d.always(function(){o.unqueued--,St.queue(t,"fx").length||o.empty.fire()})}));for(n in e)if(r=e[n],ve.test(r)){if(delete e[n],s=s||"toggle"===r,r===(g?"hide":"show")){if("show"!==r||!m||void 0===m[n])continue;g=!0}p[n]=m&&m[n]||St.style(t,n)}if((u=!St.isEmptyObject(e))||!St.isEmptyObject(p)){h&&1===t.nodeType&&(i.overflow=[f.overflow,f.overflowX,f.overflowY],l=m&&m.display,null==l&&(l=Ut.get(t,"display")),c=St.css(t,"display"),"none"===c&&(l?c=l:(v([t],!0),l=t.style.display||l,c=St.css(t,"display"),v([t]))),("inline"===c||"inline-block"===c&&null!=l)&&"none"===St.css(t,"float")&&(u||(d.done(function(){f.display=l}),null==l&&(c=f.display,l="none"===c?"":c)),f.display="inline-block")),i.overflow&&(f.overflow="hidden",d.always(function(){f.overflow=i.overflow[0],f.overflowX=i.overflow[1],f.overflowY=i.overflow[2]})),u=!1;for(n in p)u||(m?"hidden"in m&&(g=m.hidden):m=Ut.access(t,"fxshow",{display:l}),s&&(m.hidden=!g),g&&v([t],!0),d.done(function(){g||v([t]),Ut.remove(t,"fxshow");for(n in p)St.style(t,n,p[n])})),u=Y(g?m[n]:0,n,d),n in m||(m[n]=u.start,g&&(u.end=u.start,u.start=0))}}function Z(t,e){var i,n,r,s,o;for(i in t)if(n=f(i),r=e[n],s=t[i],Array.isArray(s)&&(r=s[1],s=t[i]=s[0]),i!==n&&(t[n]=s,delete t[i]),(o=St.cssHooks[n])&&"expand"in o){s=o.expand(s),delete t[n];for(i in s)i in t||(t[i]=s[i],e[i]=r)}else e[n]=r}function Q(t,e,i){var n,r,s=0,o=Q.prefilters.length,a=St.Deferred().always(function(){delete u.elem}),u=function(){if(r)return!1;for(var e=xe||q(),i=Math.max(0,l.startTime+l.duration-e),n=i/l.duration||0,s=1-n,o=0,u=l.tweens.length;o<u;o++)l.tweens[o].run(s);return a.notifyWith(t,[l,s,i]),s<1&&u?i:(u||a.notifyWith(t,[l,1,0]),a.resolveWith(t,[l]),!1)},l=a.promise({elem:t,props:St.extend({},e),opts:St.extend(!0,{specialEasing:{},easing:St.easing._default},i),originalProperties:e,originalOptions:i,startTime:xe||q(),duration:i.duration,tweens:[],createTween:function(e,i){var n=St.Tween(t,l.opts,e,i,l.opts.specialEasing[e]||l.opts.easing);return l.tweens.push(n),n},stop:function(e){var i=0,n=e?l.tweens.length:0;if(r)return this;for(r=!0;i<n;i++)l.tweens[i].run(1);return e?(a.notifyWith(t,[l,1,0]),a.resolveWith(t,[l,e])):a.rejectWith(t,[l,e]),this}}),c=l.props;for(Z(c,l.opts.specialEasing);s<o;s++)if(n=Q.prefilters[s].call(l,t,c,l.opts))return yt(n.stop)&&(St._queueHooks(l.elem,l.opts.queue).stop=n.stop.bind(n)),n;return St.map(c,Y,l),yt(l.opts.start)&&l.opts.start.call(t,l),l.progress(l.opts.progress).done(l.opts.done,l.opts.complete).fail(l.opts.fail).always(l.opts.always),St.fx.timer(St.extend(u,{elem:t,anim:l,queue:l.opts.queue})),l}function K(t){return(t.match(It)||[]).join(" ")}function J(t){return t.getAttribute&&t.getAttribute("class")||""}function tt(t){return Array.isArray(t)?t:"string"==typeof t?t.match(It)||[]:[]}function et(t,e,i,r){var s;if(Array.isArray(e))St.each(e,function(e,n){i||De.test(t)?r(t,n):et(t+"["+("object"==typeof n&&null!=n?e:"")+"]",n,i,r)});else if(i||"object"!==n(e))r(t,e);else for(s in e)et(t+"["+s+"]",e[s],i,r)}function it(t){return function(e,i){"string"!=typeof e&&(i=e,e="*");var n,r=0,s=e.toLowerCase().match(It)||[];if(yt(i))for(;n=s[r++];)"+"===n[0]?(n=n.slice(1)||"*",(t[n]=t[n]||[]).unshift(i)):(t[n]=t[n]||[]).push(i)}}function nt(t,e,i,n){function r(a){var u;return s[a]=!0,St.each(t[a]||[],function(t,a){var l=a(e,i,n);return"string"!=typeof l||o||s[l]?o?!(u=l):void 0:(e.dataTypes.unshift(l),r(l),!1)}),u}var s={},o=t===Re;return r(e.dataTypes[0])||!s["*"]&&r("*")}function rt(t,e){var i,n,r=St.ajaxSettings.flatOptions||{};for(i in e)void 0!==e[i]&&((r[i]?t:n||(n={}))[i]=e[i]);return n&&St.extend(!0,t,n),t}function st(t,e,i){for(var n,r,s,o,a=t.contents,u=t.dataTypes;"*"===u[0];)u.shift(),void 0===n&&(n=t.mimeType||e.getResponseHeader("Content-Type"));if(n)for(r in a)if(a[r]&&a[r].test(n)){u.unshift(r);break}if(u[0]in i)s=u[0];else{for(r in i){if(!u[0]||t.converters[r+" "+u[0]]){s=r;break}o||(o=r)}s=s||o}if(s)return s!==u[0]&&u.unshift(s),i[s]}function ot(t,e,i,n){var r,s,o,a,u,l={},c=t.dataTypes.slice();if(c[1])for(o in t.converters)l[o.toLowerCase()]=t.converters[o];for(s=c.shift();s;)if(t.responseFields[s]&&(i[t.responseFields[s]]=e),!u&&n&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),u=s,s=c.shift())if("*"===s)s=u;else if("*"!==u&&u!==s){if(!(o=l[u+" "+s]||l["* "+s]))for(r in l)if(a=r.split(" "),a[1]===s&&(o=l[u+" "+a[0]]||l["* "+a[0]])){o===!0?o=l[r]:l[r]!==!0&&(s=a[0],c.unshift(a[1]));break}if(o!==!0)if(o&&t.throws)e=o(e);else try{e=o(e)}catch(t){return{state:"parsererror",error:o?t:"No conversion from "+u+" to "+s}}}return{state:"success",data:e}}var at=[],ut=Object.getPrototypeOf,lt=at.slice,ct=at.flat?function(t){return at.flat.call(t)}:function(t){return at.concat.apply([],t)},ht=at.push,dt=at.indexOf,pt={},ft=pt.toString,gt=pt.hasOwnProperty,mt=gt.toString,_t=mt.call(Object),xt={},yt=function(t){return"function"==typeof t&&"number"!=typeof t.nodeType&&"function"!=typeof t.item},vt=function(t){return null!=t&&t===t.window},wt=t.document,bt={type:!0,src:!0,nonce:!0,noModule:!0},St=function(t,e){return new St.fn.init(t,e)};St.fn=St.prototype={jquery:"3.6.0",constructor:St,length:0,toArray:function(){return lt.call(this)},
|
|
4
4
|
get:function(t){return null==t?lt.call(this):t<0?this[t+this.length]:this[t]},pushStack:function(t){var e=St.merge(this.constructor(),t);return e.prevObject=this,e},each:function(t){return St.each(this,t)},map:function(t){return this.pushStack(St.map(this,function(e,i){return t.call(e,i,e)}))},slice:function(){return this.pushStack(lt.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(St.grep(this,function(t,e){return(e+1)%2}))},odd:function(){return this.pushStack(St.grep(this,function(t,e){return e%2}))},eq:function(t){var e=this.length,i=+t+(t<0?e:0);return this.pushStack(i>=0&&i<e?[this[i]]:[])},end:function(){return this.prevObject||this.constructor()},push:ht,sort:at.sort,splice:at.splice},St.extend=St.fn.extend=function(){var t,e,i,n,r,s,o=arguments[0]||{},a=1,u=arguments.length,l=!1;for("boolean"==typeof o&&(l=o,o=arguments[a]||{},a++),"object"==typeof o||yt(o)||(o={}),a===u&&(o=this,a--);a<u;a++)if(null!=(t=arguments[a]))for(e in t)n=t[e],"__proto__"!==e&&o!==n&&(l&&n&&(St.isPlainObject(n)||(r=Array.isArray(n)))?(i=o[e],s=r&&!Array.isArray(i)?[]:r||St.isPlainObject(i)?i:{},r=!1,o[e]=St.extend(l,s,n)):void 0!==n&&(o[e]=n));return o},St.extend({expando:"jQuery"+("3.6.0"+Math.random()).replace(/\D/g,""),isReady:!0,error:function(t){throw new Error(t)},noop:function(){},isPlainObject:function(t){var e,i;return!(!t||"[object Object]"!==ft.call(t))&&(!(e=ut(t))||"function"==typeof(i=gt.call(e,"constructor")&&e.constructor)&&mt.call(i)===_t)},isEmptyObject:function(t){var e;for(e in t)return!1;return!0},globalEval:function(t,e,n){i(t,{nonce:e&&e.nonce},n)},each:function(t,e){var i,n=0;if(r(t))for(i=t.length;n<i&&e.call(t[n],n,t[n])!==!1;n++);else for(n in t)if(e.call(t[n],n,t[n])===!1)break;return t},makeArray:function(t,e){var i=e||[];return null!=t&&(r(Object(t))?St.merge(i,"string"==typeof t?[t]:t):ht.call(i,t)),i},inArray:function(t,e,i){return null==e?-1:dt.call(e,t,i)},merge:function(t,e){for(var i=+e.length,n=0,r=t.length;n<i;n++)t[r++]=e[n];return t.length=r,t},grep:function(t,e,i){for(var n=[],r=0,s=t.length,o=!i;r<s;r++)!e(t[r],r)!==o&&n.push(t[r]);return n},map:function(t,e,i){var n,s,o=0,a=[];if(r(t))for(n=t.length;o<n;o++)null!=(s=e(t[o],o,i))&&a.push(s);else for(o in t)null!=(s=e(t[o],o,i))&&a.push(s);return ct(a)},guid:1,support:xt}),"function"==typeof Symbol&&(St.fn[Symbol.iterator]=at[Symbol.iterator]),St.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "),function(t,e){pt["[object "+e+"]"]=e.toLowerCase()});var Ct=function(t){function e(t,e,i,n){var r,s,o,a,u,c,d,p=e&&e.ownerDocument,f=e?e.nodeType:9;if(i=i||[],"string"!=typeof t||!t||1!==f&&9!==f&&11!==f)return i;if(!n&&(M(e),e=e||D,I)){if(11!==f&&(u=_t.exec(t)))if(r=u[1]){if(9===f){if(!(o=e.getElementById(r)))return i;if(o.id===r)return i.push(o),i}else if(p&&(o=p.getElementById(r))&&L(e,o)&&o.id===r)return i.push(o),i}else{if(u[2])return Q.apply(i,e.getElementsByTagName(t)),i;if((r=u[3])&&v.getElementsByClassName&&e.getElementsByClassName)return Q.apply(i,e.getElementsByClassName(r)),i}if(v.qsa&&!H[t+" "]&&(!B||!B.test(t))&&(1!==f||"object"!==e.nodeName.toLowerCase())){if(d=t,p=e,1===f&&(lt.test(t)||ut.test(t))){for(p=xt.test(t)&&l(e.parentNode)||e,p===e&&v.scope||((a=e.getAttribute("id"))?a=a.replace(wt,bt):e.setAttribute("id",a=R)),c=C(t),s=c.length;s--;)c[s]=(a?"#"+a:":scope")+" "+h(c[s]);d=c.join(",")}try{return Q.apply(i,p.querySelectorAll(d)),i}catch(e){H(t,!0)}finally{a===R&&e.removeAttribute("id")}}}return F(t.replace(ot,"$1"),e,i,n)}function i(){function t(i,n){return e.push(i+" ")>w.cacheLength&&delete t[e.shift()],t[i+" "]=n}var e=[];return t}function n(t){return t[R]=!0,t}function r(t){var e=D.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function s(t,e){for(var i=t.split("|"),n=i.length;n--;)w.attrHandle[i[n]]=e}function o(t,e){var i=e&&t,n=i&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(n)return n;if(i)for(;i=i.nextSibling;)if(i===e)return-1;return t?1:-1}function a(t){return function(e){return"form"in e?e.parentNode&&e.disabled===!1?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&Ct(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function u(t){return n(function(e){return e=+e,n(function(i,n){for(var r,s=t([],i.length,e),o=s.length;o--;)i[r=s[o]]&&(i[r]=!(n[r]=i[r]))})})}function l(t){return t&&void 0!==t.getElementsByTagName&&t}function c(){}function h(t){for(var e=0,i=t.length,n="";e<i;e++)n+=t[e].value;return n}function d(t,e,i){var n=e.dir,r=e.next,s=r||n,o=i&&"parentNode"===s,a=X++;return e.first?function(e,i,r){for(;e=e[n];)if(1===e.nodeType||o)return t(e,i,r);return!1}:function(e,i,u){var l,c,h,d=[U,a];if(u){for(;e=e[n];)if((1===e.nodeType||o)&&t(e,i,u))return!0}else for(;e=e[n];)if(1===e.nodeType||o)if(h=e[R]||(e[R]={}),c=h[e.uniqueID]||(h[e.uniqueID]={}),r&&r===e.nodeName.toLowerCase())e=e[n]||e;else{if((l=c[s])&&l[0]===U&&l[1]===a)return d[2]=l[2];if(c[s]=d,d[2]=t(e,i,u))return!0}return!1}}function p(t){return t.length>1?function(e,i,n){for(var r=t.length;r--;)if(!t[r](e,i,n))return!1;return!0}:t[0]}function f(t,i,n){for(var r=0,s=i.length;r<s;r++)e(t,i[r],n);return n}function g(t,e,i,n,r){for(var s,o=[],a=0,u=t.length,l=null!=e;a<u;a++)(s=t[a])&&(i&&!i(s,n,r)||(o.push(s),l&&e.push(a)));return o}function m(t,e,i,r,s,o){return r&&!r[R]&&(r=m(r)),s&&!s[R]&&(s=m(s,o)),n(function(n,o,a,u){var l,c,h,d=[],p=[],m=o.length,_=n||f(e||"*",a.nodeType?[a]:a,[]),x=!t||!n&&e?_:g(_,d,t,a,u),y=i?s||(n?t:m||r)?[]:o:x;if(i&&i(x,y,a,u),r)for(l=g(y,p),r(l,[],a,u),c=l.length;c--;)(h=l[c])&&(y[p[c]]=!(x[p[c]]=h));if(n){if(s||t){if(s){for(l=[],c=y.length;c--;)(h=y[c])&&l.push(x[c]=h);s(null,y=[],l,u)}for(c=y.length;c--;)(h=y[c])&&(l=s?J(n,h):d[c])>-1&&(n[l]=!(o[l]=h))}}else y=g(y===o?y.splice(m,y.length):y),s?s(null,o,y,u):Q.apply(o,y)})}function _(t){for(var e,i,n,r=t.length,s=w.relative[t[0].type],o=s||w.relative[" "],a=s?1:0,u=d(function(t){return t===e},o,!0),l=d(function(t){return J(e,t)>-1},o,!0),c=[function(t,i,n){var r=!s&&(n||i!==O)||((e=i).nodeType?u(t,i,n):l(t,i,n));return e=null,r}];a<r;a++)if(i=w.relative[t[a].type])c=[d(p(c),i)];else{if(i=w.filter[t[a].type].apply(null,t[a].matches),i[R]){for(n=++a;n<r&&!w.relative[t[n].type];n++);return m(a>1&&p(c),a>1&&h(t.slice(0,a-1).concat({value:" "===t[a-2].type?"*":""})).replace(ot,"$1"),i,a<n&&_(t.slice(a,n)),n<r&&_(t=t.slice(n)),n<r&&h(t))}c.push(i)}return p(c)}function x(t,i){var r=i.length>0,s=t.length>0,o=function(n,o,a,u,l){var c,h,d,p=0,f="0",m=n&&[],_=[],x=O,y=n||s&&w.find.TAG("*",l),v=U+=null==x?1:Math.random()||.1,b=y.length;for(l&&(O=o==D||o||l);f!==b&&null!=(c=y[f]);f++){if(s&&c){for(h=0,o||c.ownerDocument==D||(M(c),a=!I);d=t[h++];)if(d(c,o||D,a)){u.push(c);break}l&&(U=v)}r&&((c=!d&&c)&&p--,n&&m.push(c))}if(p+=f,r&&f!==p){for(h=0;d=i[h++];)d(m,_,o,a);if(n){if(p>0)for(;f--;)m[f]||_[f]||(_[f]=$.call(u));_=g(_)}Q.apply(u,_),l&&!n&&_.length>0&&p+i.length>1&&e.uniqueSort(u)}return l&&(U=v,O=x),m};return r?n(o):o}var y,v,w,b,S,C,T,F,O,N,E,M,D,V,I,B,A,P,L,R="sizzle"+1*new Date,k=t.document,U=0,X=0,j=i(),z=i(),G=i(),H=i(),q=function(t,e){return t===e&&(E=!0),0},W={}.hasOwnProperty,Y=[],$=Y.pop,Z=Y.push,Q=Y.push,K=Y.slice,J=function(t,e){for(var i=0,n=t.length;i<n;i++)if(t[i]===e)return i;return-1},tt="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",et="[\\x20\\t\\r\\n\\f]",it="(?:\\\\[\\da-fA-F]{1,6}"+et+"?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+",nt="\\["+et+"*("+it+")(?:"+et+"*([*^$|!~]?=)"+et+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+it+"))|)"+et+"*\\]",rt=":("+it+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+nt+")*)|.*)\\)|)",st=new RegExp(et+"+","g"),ot=new RegExp("^"+et+"+|((?:^|[^\\\\])(?:\\\\.)*)"+et+"+$","g"),at=new RegExp("^"+et+"*,"+et+"*"),ut=new RegExp("^"+et+"*([>+~]|"+et+")"+et+"*"),lt=new RegExp(et+"|>"),ct=new RegExp(rt),ht=new RegExp("^"+it+"$"),dt={ID:new RegExp("^#("+it+")"),CLASS:new RegExp("^\\.("+it+")"),TAG:new RegExp("^("+it+"|[*])"),ATTR:new RegExp("^"+nt),PSEUDO:new RegExp("^"+rt),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+et+"*(even|odd|(([+-]|)(\\d*)n|)"+et+"*(?:([+-]|)"+et+"*(\\d+)|))"+et+"*\\)|)","i"),bool:new RegExp("^(?:"+tt+")$","i"),needsContext:new RegExp("^"+et+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+et+"*((?:-\\d)?\\d*)"+et+"*\\)|)(?=[^-]|$)","i")},pt=/HTML$/i,ft=/^(?:input|select|textarea|button)$/i,gt=/^h\d$/i,mt=/^[^{]+\{\s*\[native \w/,_t=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,xt=/[+~]/,yt=new RegExp("\\\\[\\da-fA-F]{1,6}"+et+"?|\\\\([^\\r\\n\\f])","g"),vt=function(t,e){var i="0x"+t.slice(1)-65536;return e?e:i<0?String.fromCharCode(i+65536):String.fromCharCode(i>>10|55296,1023&i|56320)},wt=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,bt=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},St=function(){M()},Ct=d(function(t){return t.disabled===!0&&"fieldset"===t.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{Q.apply(Y=K.call(k.childNodes),k.childNodes),Y[k.childNodes.length].nodeType}catch(t){Q={apply:Y.length?function(t,e){Z.apply(t,K.call(e))}:function(t,e){for(var i=t.length,n=0;t[i++]=e[n++];);t.length=i-1}}}v=e.support={},S=e.isXML=function(t){var e=t&&t.namespaceURI,i=t&&(t.ownerDocument||t).documentElement;return!pt.test(e||i&&i.nodeName||"HTML")},M=e.setDocument=function(t){var e,i,n=t?t.ownerDocument||t:k;return n!=D&&9===n.nodeType&&n.documentElement?(D=n,V=D.documentElement,I=!S(D),k!=D&&(i=D.defaultView)&&i.top!==i&&(i.addEventListener?i.addEventListener("unload",St,!1):i.attachEvent&&i.attachEvent("onunload",St)),v.scope=r(function(t){return V.appendChild(t).appendChild(D.createElement("div")),void 0!==t.querySelectorAll&&!t.querySelectorAll(":scope fieldset div").length}),v.attributes=r(function(t){return t.className="i",!t.getAttribute("className")}),v.getElementsByTagName=r(function(t){return t.appendChild(D.createComment("")),!t.getElementsByTagName("*").length}),v.getElementsByClassName=mt.test(D.getElementsByClassName),v.getById=r(function(t){return V.appendChild(t).id=R,!D.getElementsByName||!D.getElementsByName(R).length}),v.getById?(w.filter.ID=function(t){var e=t.replace(yt,vt);return function(t){return t.getAttribute("id")===e}},w.find.ID=function(t,e){if(void 0!==e.getElementById&&I){var i=e.getElementById(t);return i?[i]:[]}}):(w.filter.ID=function(t){var e=t.replace(yt,vt);return function(t){var i=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return i&&i.value===e}},w.find.ID=function(t,e){if(void 0!==e.getElementById&&I){var i,n,r,s=e.getElementById(t);if(s){if((i=s.getAttributeNode("id"))&&i.value===t)return[s];for(r=e.getElementsByName(t),n=0;s=r[n++];)if((i=s.getAttributeNode("id"))&&i.value===t)return[s]}return[]}}),w.find.TAG=v.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):v.qsa?e.querySelectorAll(t):void 0}:function(t,e){var i,n=[],r=0,s=e.getElementsByTagName(t);if("*"===t){for(;i=s[r++];)1===i.nodeType&&n.push(i);return n}return s},w.find.CLASS=v.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&I)return e.getElementsByClassName(t)},A=[],B=[],(v.qsa=mt.test(D.querySelectorAll))&&(r(function(t){var e;V.appendChild(t).innerHTML="<a id='"+R+"'></a><select id='"+R+"-\r\\' msallowcapture=''><option selected=''></option></select>",t.querySelectorAll("[msallowcapture^='']").length&&B.push("[*^$]="+et+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||B.push("\\["+et+"*(?:value|"+tt+")"),t.querySelectorAll("[id~="+R+"-]").length||B.push("~="),e=D.createElement("input"),e.setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||B.push("\\["+et+"*name"+et+"*="+et+"*(?:''|\"\")"),t.querySelectorAll(":checked").length||B.push(":checked"),t.querySelectorAll("a#"+R+"+*").length||B.push(".#.+[+~]"),t.querySelectorAll("\\\f"),B.push("[\\r\\n\\f]")}),r(function(t){t.innerHTML="<a href='' disabled='disabled'></a><select disabled='disabled'><option/></select>";var e=D.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&B.push("name"+et+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&B.push(":enabled",":disabled"),V.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&B.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),B.push(",.*:")})),(v.matchesSelector=mt.test(P=V.matches||V.webkitMatchesSelector||V.mozMatchesSelector||V.oMatchesSelector||V.msMatchesSelector))&&r(function(t){v.disconnectedMatch=P.call(t,"*"),P.call(t,"[s!='']:x"),A.push("!=",rt)}),B=B.length&&new RegExp(B.join("|")),A=A.length&&new RegExp(A.join("|")),e=mt.test(V.compareDocumentPosition),L=e||mt.test(V.contains)?function(t,e){var i=9===t.nodeType?t.documentElement:t,n=e&&e.parentNode;return t===n||!(!n||1!==n.nodeType||!(i.contains?i.contains(n):t.compareDocumentPosition&&16&t.compareDocumentPosition(n)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},q=e?function(t,e){if(t===e)return E=!0,0;var i=!t.compareDocumentPosition-!e.compareDocumentPosition;return i?i:(i=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1,1&i||!v.sortDetached&&e.compareDocumentPosition(t)===i?t==D||t.ownerDocument==k&&L(k,t)?-1:e==D||e.ownerDocument==k&&L(k,e)?1:N?J(N,t)-J(N,e):0:4&i?-1:1)}:function(t,e){if(t===e)return E=!0,0;var i,n=0,r=t.parentNode,s=e.parentNode,a=[t],u=[e];if(!r||!s)return t==D?-1:e==D?1:r?-1:s?1:N?J(N,t)-J(N,e):0;if(r===s)return o(t,e);for(i=t;i=i.parentNode;)a.unshift(i);for(i=e;i=i.parentNode;)u.unshift(i);for(;a[n]===u[n];)n++;return n?o(a[n],u[n]):a[n]==k?-1:u[n]==k?1:0},D):D},e.matches=function(t,i){return e(t,null,null,i)},e.matchesSelector=function(t,i){if(M(t),v.matchesSelector&&I&&!H[i+" "]&&(!A||!A.test(i))&&(!B||!B.test(i)))try{var n=P.call(t,i);if(n||v.disconnectedMatch||t.document&&11!==t.document.nodeType)return n}catch(t){H(i,!0)}return e(i,D,null,[t]).length>0},e.contains=function(t,e){return(t.ownerDocument||t)!=D&&M(t),L(t,e)},e.attr=function(t,e){(t.ownerDocument||t)!=D&&M(t);var i=w.attrHandle[e.toLowerCase()],n=i&&W.call(w.attrHandle,e.toLowerCase())?i(t,e,!I):void 0;return void 0!==n?n:v.attributes||!I?t.getAttribute(e):(n=t.getAttributeNode(e))&&n.specified?n.value:null},e.escape=function(t){return(t+"").replace(wt,bt)},e.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},e.uniqueSort=function(t){var e,i=[],n=0,r=0;if(E=!v.detectDuplicates,N=!v.sortStable&&t.slice(0),t.sort(q),E){for(;e=t[r++];)e===t[r]&&(n=i.push(r));for(;n--;)t.splice(i[n],1)}return N=null,t},b=e.getText=function(t){var e,i="",n=0,r=t.nodeType;if(r){if(1===r||9===r||11===r){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)i+=b(t)}else if(3===r||4===r)return t.nodeValue}else for(;e=t[n++];)i+=b(e);return i},w=e.selectors={cacheLength:50,createPseudo:n,match:dt,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(yt,vt),t[3]=(t[3]||t[4]||t[5]||"").replace(yt,vt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||e.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&e.error(t[0]),t},PSEUDO:function(t){var e,i=!t[6]&&t[2];return dt.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":i&&ct.test(i)&&(e=C(i,!0))&&(e=i.indexOf(")",i.length-e)-i.length)&&(t[0]=t[0].slice(0,e),t[2]=i.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(yt,vt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=j[t+" "];return e||(e=new RegExp("(^|"+et+")"+t+"("+et+"|$)"))&&j(t,function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")})},ATTR:function(t,i,n){return function(r){var s=e.attr(r,t);return null==s?"!="===i:!i||(s+="","="===i?s===n:"!="===i?s!==n:"^="===i?n&&0===s.indexOf(n):"*="===i?n&&s.indexOf(n)>-1:"$="===i?n&&s.slice(-n.length)===n:"~="===i?(" "+s.replace(st," ")+" ").indexOf(n)>-1:"|="===i&&(s===n||s.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,i,n,r){var s="nth"!==t.slice(0,3),o="last"!==t.slice(-4),a="of-type"===e;return 1===n&&0===r?function(t){return!!t.parentNode}:function(e,i,u){var l,c,h,d,p,f,g=s!==o?"nextSibling":"previousSibling",m=e.parentNode,_=a&&e.nodeName.toLowerCase(),x=!u&&!a,y=!1;if(m){if(s){for(;g;){for(d=e;d=d[g];)if(a?d.nodeName.toLowerCase()===_:1===d.nodeType)return!1;f=g="only"===t&&!f&&"nextSibling"}return!0}if(f=[o?m.firstChild:m.lastChild],o&&x){for(d=m,h=d[R]||(d[R]={}),c=h[d.uniqueID]||(h[d.uniqueID]={}),l=c[t]||[],p=l[0]===U&&l[1],y=p&&l[2],d=p&&m.childNodes[p];d=++p&&d&&d[g]||(y=p=0)||f.pop();)if(1===d.nodeType&&++y&&d===e){c[t]=[U,p,y];break}}else if(x&&(d=e,h=d[R]||(d[R]={}),c=h[d.uniqueID]||(h[d.uniqueID]={}),l=c[t]||[],p=l[0]===U&&l[1],y=p),y===!1)for(;(d=++p&&d&&d[g]||(y=p=0)||f.pop())&&((a?d.nodeName.toLowerCase()!==_:1!==d.nodeType)||!++y||(x&&(h=d[R]||(d[R]={}),c=h[d.uniqueID]||(h[d.uniqueID]={}),c[t]=[U,y]),d!==e)););return(y-=r)===n||y%n==0&&y/n>=0}}},PSEUDO:function(t,i){var r,s=w.pseudos[t]||w.setFilters[t.toLowerCase()]||e.error("unsupported pseudo: "+t);return s[R]?s(i):s.length>1?(r=[t,t,"",i],w.setFilters.hasOwnProperty(t.toLowerCase())?n(function(t,e){for(var n,r=s(t,i),o=r.length;o--;)n=J(t,r[o]),t[n]=!(e[n]=r[o])}):function(t){return s(t,0,r)}):s}},pseudos:{not:n(function(t){var e=[],i=[],r=T(t.replace(ot,"$1"));return r[R]?n(function(t,e,i,n){for(var s,o=r(t,null,n,[]),a=t.length;a--;)(s=o[a])&&(t[a]=!(e[a]=s))}):function(t,n,s){return e[0]=t,r(e,null,s,i),e[0]=null,!i.pop()}}),has:n(function(t){return function(i){return e(t,i).length>0}}),contains:n(function(t){return t=t.replace(yt,vt),function(e){return(e.textContent||b(e)).indexOf(t)>-1}}),lang:n(function(t){return ht.test(t||"")||e.error("unsupported lang: "+t),t=t.replace(yt,vt).toLowerCase(),function(e){var i;do if(i=I?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(i=i.toLowerCase())===t||0===i.indexOf(t+"-");while((e=e.parentNode)&&1===e.nodeType)return!1}}),target:function(e){var i=t.location&&t.location.hash;return i&&i.slice(1)===e.id},root:function(t){return t===V},focus:function(t){return t===D.activeElement&&(!D.hasFocus||D.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:a(!1),disabled:a(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,t.selected===!0},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!w.pseudos.empty(t)},header:function(t){return gt.test(t.nodeName)},input:function(t){return ft.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:u(function(){return[0]}),last:u(function(t,e){return[e-1]}),eq:u(function(t,e,i){return[i<0?i+e:i]}),even:u(function(t,e){for(var i=0;i<e;i+=2)t.push(i);return t}),odd:u(function(t,e){for(var i=1;i<e;i+=2)t.push(i);return t}),lt:u(function(t,e,i){for(var n=i<0?i+e:i>e?e:i;--n>=0;)t.push(n);return t}),gt:u(function(t,e,i){for(var n=i<0?i+e:i;++n<e;)t.push(n);return t})}},w.pseudos.nth=w.pseudos.eq;for(y in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})w.pseudos[y]=function(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}(y);for(y in{submit:!0,reset:!0})w.pseudos[y]=function(t){return function(e){var i=e.nodeName.toLowerCase();return("input"===i||"button"===i)&&e.type===t}}(y);return c.prototype=w.filters=w.pseudos,w.setFilters=new c,C=e.tokenize=function(t,i){var n,r,s,o,a,u,l,c=z[t+" "];if(c)return i?0:c.slice(0);for(a=t,u=[],l=w.preFilter;a;){n&&!(r=at.exec(a))||(r&&(a=a.slice(r[0].length)||a),u.push(s=[])),n=!1,(r=ut.exec(a))&&(n=r.shift(),s.push({value:n,type:r[0].replace(ot," ")}),a=a.slice(n.length));for(o in w.filter)!(r=dt[o].exec(a))||l[o]&&!(r=l[o](r))||(n=r.shift(),s.push({value:n,type:o,matches:r}),a=a.slice(n.length));if(!n)break}return i?a.length:a?e.error(t):z(t,u).slice(0)},T=e.compile=function(t,e){var i,n=[],r=[],s=G[t+" "];if(!s){for(e||(e=C(t)),i=e.length;i--;)s=_(e[i]),s[R]?n.push(s):r.push(s);s=G(t,x(r,n)),s.selector=t}return s},F=e.select=function(t,e,i,n){var r,s,o,a,u,c="function"==typeof t&&t,d=!n&&C(t=c.selector||t);if(i=i||[],1===d.length){if(s=d[0]=d[0].slice(0),s.length>2&&"ID"===(o=s[0]).type&&9===e.nodeType&&I&&w.relative[s[1].type]){if(!(e=(w.find.ID(o.matches[0].replace(yt,vt),e)||[])[0]))return i;c&&(e=e.parentNode),t=t.slice(s.shift().value.length)}for(r=dt.needsContext.test(t)?0:s.length;r--&&(o=s[r],!w.relative[a=o.type]);)if((u=w.find[a])&&(n=u(o.matches[0].replace(yt,vt),xt.test(s[0].type)&&l(e.parentNode)||e))){if(s.splice(r,1),!(t=n.length&&h(s)))return Q.apply(i,n),i;break}}return(c||T(t,d))(n,e,!I,i,!e||xt.test(t)&&l(e.parentNode)||e),i},v.sortStable=R.split("").sort(q).join("")===R,v.detectDuplicates=!!E,M(),v.sortDetached=r(function(t){return 1&t.compareDocumentPosition(D.createElement("fieldset"))}),r(function(t){return t.innerHTML="<a href='#'></a>","#"===t.firstChild.getAttribute("href")})||s("type|href|height|width",function(t,e,i){if(!i)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)}),v.attributes&&r(function(t){return t.innerHTML="<input/>",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")})||s("value",function(t,e,i){if(!i&&"input"===t.nodeName.toLowerCase())return t.defaultValue}),r(function(t){return null==t.getAttribute("disabled")})||s(tt,function(t,e,i){var n;if(!i)return t[e]===!0?e.toLowerCase():(n=t.getAttributeNode(e))&&n.specified?n.value:null}),e}(t);St.find=Ct,St.expr=Ct.selectors,St.expr[":"]=St.expr.pseudos,St.uniqueSort=St.unique=Ct.uniqueSort,St.text=Ct.getText,St.isXMLDoc=Ct.isXML,St.contains=Ct.contains,St.escapeSelector=Ct.escape;var Tt=function(t,e,i){for(var n=[],r=void 0!==i;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(r&&St(t).is(i))break;n.push(t)}return n},Ft=function(t,e){for(var i=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&i.push(t);return i},Ot=St.expr.match.needsContext,Nt=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;St.filter=function(t,e,i){var n=e[0];return i&&(t=":not("+t+")"),1===e.length&&1===n.nodeType?St.find.matchesSelector(n,t)?[n]:[]:St.find.matches(t,St.grep(e,function(t){return 1===t.nodeType}))},St.fn.extend({find:function(t){var e,i,n=this.length,r=this;if("string"!=typeof t)return this.pushStack(St(t).filter(function(){for(e=0;e<n;e++)if(St.contains(r[e],this))return!0}));for(i=this.pushStack([]),e=0;e<n;e++)St.find(t,r[e],i);return n>1?St.uniqueSort(i):i},filter:function(t){return this.pushStack(o(this,t||[],!1))},not:function(t){return this.pushStack(o(this,t||[],!0))},is:function(t){return!!o(this,"string"==typeof t&&Ot.test(t)?St(t):t||[],!1).length}});var Et,Mt=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(St.fn.init=function(t,e,i){var n,r;if(!t)return this;if(i=i||Et,"string"==typeof t){if(!(n="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:Mt.exec(t))||!n[1]&&e)return!e||e.jquery?(e||i).find(t):this.constructor(e).find(t);if(n[1]){if(e=e instanceof St?e[0]:e,St.merge(this,St.parseHTML(n[1],e&&e.nodeType?e.ownerDocument||e:wt,!0)),Nt.test(n[1])&&St.isPlainObject(e))for(n in e)yt(this[n])?this[n](e[n]):this.attr(n,e[n]);return this}return r=wt.getElementById(n[2]),r&&(this[0]=r,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):yt(t)?void 0!==i.ready?i.ready(t):t(St):St.makeArray(t,this)}).prototype=St.fn,Et=St(wt);var Dt=/^(?:parents|prev(?:Until|All))/,Vt={children:!0,contents:!0,next:!0,prev:!0};St.fn.extend({has:function(t){var e=St(t,this),i=e.length;return this.filter(function(){for(var t=0;t<i;t++)if(St.contains(this,e[t]))return!0})},closest:function(t,e){var i,n=0,r=this.length,s=[],o="string"!=typeof t&&St(t);if(!Ot.test(t))for(;n<r;n++)for(i=this[n];i&&i!==e;i=i.parentNode)if(i.nodeType<11&&(o?o.index(i)>-1:1===i.nodeType&&St.find.matchesSelector(i,t))){s.push(i);break}return this.pushStack(s.length>1?St.uniqueSort(s):s)},index:function(t){return t?"string"==typeof t?dt.call(St(t),this[0]):dt.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(St.uniqueSort(St.merge(this.get(),St(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),St.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return Tt(t,"parentNode")},parentsUntil:function(t,e,i){return Tt(t,"parentNode",i)},next:function(t){return a(t,"nextSibling")},prev:function(t){return a(t,"previousSibling")},nextAll:function(t){return Tt(t,"nextSibling")},prevAll:function(t){return Tt(t,"previousSibling")},nextUntil:function(t,e,i){return Tt(t,"nextSibling",i)},prevUntil:function(t,e,i){return Tt(t,"previousSibling",i)},siblings:function(t){return Ft((t.parentNode||{}).firstChild,t)},children:function(t){return Ft(t.firstChild)},contents:function(t){return null!=t.contentDocument&&ut(t.contentDocument)?t.contentDocument:(s(t,"template")&&(t=t.content||t),St.merge([],t.childNodes))}},function(t,e){St.fn[t]=function(i,n){var r=St.map(this,e,i);return"Until"!==t.slice(-5)&&(n=i),n&&"string"==typeof n&&(r=St.filter(n,r)),this.length>1&&(Vt[t]||St.uniqueSort(r),Dt.test(t)&&r.reverse()),this.pushStack(r)}});var It=/[^\x20\t\r\n\f]+/g;St.Callbacks=function(t){t="string"==typeof t?u(t):St.extend({},t);var e,i,r,s,o=[],a=[],l=-1,c=function(){for(s=s||t.once,r=e=!0;a.length;l=-1)for(i=a.shift();++l<o.length;)o[l].apply(i[0],i[1])===!1&&t.stopOnFalse&&(l=o.length,i=!1);t.memory||(i=!1),e=!1,s&&(o=i?[]:"")},h={add:function(){return o&&(i&&!e&&(l=o.length-1,a.push(i)),function e(i){St.each(i,function(i,r){yt(r)?t.unique&&h.has(r)||o.push(r):r&&r.length&&"string"!==n(r)&&e(r)})}(arguments),i&&!e&&c()),this},remove:function(){return St.each(arguments,function(t,e){for(var i;(i=St.inArray(e,o,i))>-1;)o.splice(i,1),i<=l&&l--}),this},has:function(t){return t?St.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return s=a=[],o=i="",this},disabled:function(){return!o},lock:function(){return s=a=[],i||e||(o=i=""),this},locked:function(){return!!s},fireWith:function(t,i){return s||(i=i||[],i=[t,i.slice?i.slice():i],a.push(i),e||c()),this},fire:function(){return h.fireWith(this,arguments),this},fired:function(){return!!r}};return h},St.extend({Deferred:function(e){var i=[["notify","progress",St.Callbacks("memory"),St.Callbacks("memory"),2],["resolve","done",St.Callbacks("once memory"),St.Callbacks("once memory"),0,"resolved"],["reject","fail",St.Callbacks("once memory"),St.Callbacks("once memory"),1,"rejected"]],n="pending",r={state:function(){return n},always:function(){return s.done(arguments).fail(arguments),this},catch:function(t){return r.then(null,t)},pipe:function(){var t=arguments;return St.Deferred(function(e){St.each(i,function(i,n){var r=yt(t[n[4]])&&t[n[4]];s[n[1]](function(){var t=r&&r.apply(this,arguments);t&&yt(t.promise)?t.promise().progress(e.notify).done(e.resolve).fail(e.reject):e[n[0]+"With"](this,r?[t]:arguments)})}),t=null}).promise()},then:function(e,n,r){function s(e,i,n,r){return function(){var a=this,u=arguments,h=function(){var t,h;if(!(e<o)){if((t=n.apply(a,u))===i.promise())throw new TypeError("Thenable self-resolution");h=t&&("object"==typeof t||"function"==typeof t)&&t.then,yt(h)?r?h.call(t,s(o,i,l,r),s(o,i,c,r)):(o++,h.call(t,s(o,i,l,r),s(o,i,c,r),s(o,i,l,i.notifyWith))):(n!==l&&(a=void 0,u=[t]),(r||i.resolveWith)(a,u))}},d=r?h:function(){try{h()}catch(t){St.Deferred.exceptionHook&&St.Deferred.exceptionHook(t,d.stackTrace),e+1>=o&&(n!==c&&(a=void 0,u=[t]),i.rejectWith(a,u))}};e?d():(St.Deferred.getStackHook&&(d.stackTrace=St.Deferred.getStackHook()),t.setTimeout(d))}}var o=0;return St.Deferred(function(t){i[0][3].add(s(0,t,yt(r)?r:l,t.notifyWith)),i[1][3].add(s(0,t,yt(e)?e:l)),i[2][3].add(s(0,t,yt(n)?n:c))}).promise()},promise:function(t){return null!=t?St.extend(t,r):r}},s={};return St.each(i,function(t,e){var o=e[2],a=e[5];r[e[1]]=o.add,a&&o.add(function(){n=a},i[3-t][2].disable,i[3-t][3].disable,i[0][2].lock,i[0][3].lock),o.add(e[3].fire),s[e[0]]=function(){return s[e[0]+"With"](this===s?void 0:this,arguments),this},s[e[0]+"With"]=o.fireWith}),r.promise(s),e&&e.call(s,s),s},when:function(t){var e=arguments.length,i=e,n=Array(i),r=lt.call(arguments),s=St.Deferred(),o=function(t){return function(i){n[t]=this,r[t]=arguments.length>1?lt.call(arguments):i,--e||s.resolveWith(n,r)}};if(e<=1&&(h(t,s.done(o(i)).resolve,s.reject,!e),"pending"===s.state()||yt(r[i]&&r[i].then)))return s.then();for(;i--;)h(r[i],o(i),s.reject);return s.promise()}});var Bt=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;St.Deferred.exceptionHook=function(e,i){t.console&&t.console.warn&&e&&Bt.test(e.name)&&t.console.warn("jQuery.Deferred exception: "+e.message,e.stack,i)},St.readyException=function(e){t.setTimeout(function(){throw e})};var At=St.Deferred();St.fn.ready=function(t){return At.then(t).catch(function(t){St.readyException(t)}),this},St.extend({isReady:!1,readyWait:1,ready:function(t){(t===!0?--St.readyWait:St.isReady)||(St.isReady=!0,t!==!0&&--St.readyWait>0||At.resolveWith(wt,[St]))}}),St.ready.then=At.then,"complete"===wt.readyState||"loading"!==wt.readyState&&!wt.documentElement.doScroll?t.setTimeout(St.ready):(wt.addEventListener("DOMContentLoaded",d),t.addEventListener("load",d));var Pt=function(t,e,i,r,s,o,a){var u=0,l=t.length,c=null==i;if("object"===n(i)){s=!0;for(u in i)Pt(t,e,u,i[u],!0,o,a)}else if(void 0!==r&&(s=!0,yt(r)||(a=!0),c&&(a?(e.call(t,r),e=null):(c=e,e=function(t,e,i){return c.call(St(t),i)})),e))for(;u<l;u++)e(t[u],i,a?r:r.call(t[u],u,e(t[u],i)));return s?t:c?e.call(t):l?e(t[0],i):o},Lt=/^-ms-/,Rt=/-([a-z])/g,kt=function(t){return 1===t.nodeType||9===t.nodeType||!+t.nodeType};g.uid=1,g.prototype={cache:function(t){var e=t[this.expando];return e||(e={},kt(t)&&(t.nodeType?t[this.expando]=e:Object.defineProperty(t,this.expando,{value:e,configurable:!0}))),e},set:function(t,e,i){var n,r=this.cache(t);if("string"==typeof e)r[f(e)]=i;else for(n in e)r[f(n)]=e[n];return r},get:function(t,e){return void 0===e?this.cache(t):t[this.expando]&&t[this.expando][f(e)]},access:function(t,e,i){return void 0===e||e&&"string"==typeof e&&void 0===i?this.get(t,e):(this.set(t,e,i),void 0!==i?i:e)},remove:function(t,e){var i,n=t[this.expando];if(void 0!==n){if(void 0!==e){Array.isArray(e)?e=e.map(f):(e=f(e),e=e in n?[e]:e.match(It)||[]),i=e.length;for(;i--;)delete n[e[i]]}(void 0===e||St.isEmptyObject(n))&&(t.nodeType?t[this.expando]=void 0:delete t[this.expando])}},hasData:function(t){var e=t[this.expando];return void 0!==e&&!St.isEmptyObject(e)}};var Ut=new g,Xt=new g,jt=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,zt=/[A-Z]/g;St.extend({hasData:function(t){return Xt.hasData(t)||Ut.hasData(t)},data:function(t,e,i){return Xt.access(t,e,i)},removeData:function(t,e){Xt.remove(t,e)},_data:function(t,e,i){return Ut.access(t,e,i)},_removeData:function(t,e){Ut.remove(t,e)}}),St.fn.extend({data:function(t,e){var i,n,r,s=this[0],o=s&&s.attributes;if(void 0===t){if(this.length&&(r=Xt.get(s),
|
|
@@ -6,7 +6,7 @@ get:function(t){return null==t?lt.call(this):t<0?this[t+this.length]:this[t]},pu
|
|
|
6
6
|
if(!a)for(a={};e=Be.exec(o);)a[e[1].toLowerCase()+" "]=(a[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=a[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return c?o:null},setRequestHeader:function(t,e){return null==c&&(t=w[t.toLowerCase()]=w[t.toLowerCase()]||t,v[t]=e),this},overrideMimeType:function(t){return null==c&&(f.mimeType=t),this},statusCode:function(t){var e;if(t)if(c)S.always(t[S.status]);else for(e in t)y[e]=[y[e],t[e]];return this},abort:function(t){var e=t||b;return r&&r.abort(e),n(0,e),this}};if(_.promise(S),f.url=((e||f.url||Ne.href)+"").replace(/^\/\//,Ne.protocol+"//"),f.type=i.method||i.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(It)||[""],null==f.crossDomain){l=wt.createElement("a");try{l.href=f.url,l.href=l.href,f.crossDomain=Ue.protocol+"//"+Ue.host!=l.protocol+"//"+l.host}catch(t){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=St.param(f.data,f.traditional)),nt(Le,f,i,S),c)return S;h=St.event&&f.global,h&&0==St.active++&&St.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Pe.test(f.type),s=f.url.replace(/#.*$/,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(/%20/g,"+")):(p=f.url.slice(s.length),f.data&&(f.processData||"string"==typeof f.data)&&(s+=(Me.test(s)?"&":"?")+f.data,delete f.data),f.cache===!1&&(s=s.replace(/([?&])_=[^&]*/,"$1"),p=(Me.test(s)?"&":"?")+"_="+Ee.guid+++p),f.url=s+p),f.ifModified&&(St.lastModified[s]&&S.setRequestHeader("If-Modified-Since",St.lastModified[s]),St.etag[s]&&S.setRequestHeader("If-None-Match",St.etag[s])),(f.data&&f.hasContent&&f.contentType!==!1||i.contentType)&&S.setRequestHeader("Content-Type",f.contentType),S.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+ke+"; q=0.01":""):f.accepts["*"]);for(d in f.headers)S.setRequestHeader(d,f.headers[d]);if(f.beforeSend&&(f.beforeSend.call(g,S,f)===!1||c))return S.abort();if(b="abort",x.add(f.complete),S.done(f.success),S.fail(f.error),r=nt(Re,f,i,S)){if(S.readyState=1,h&&m.trigger("ajaxSend",[S,f]),c)return S;f.async&&f.timeout>0&&(u=t.setTimeout(function(){S.abort("timeout")},f.timeout));try{c=!1,r.send(v,n)}catch(t){if(c)throw t;n(-1,t)}}else n(-1,"No Transport");return S},getJSON:function(t,e,i){return St.get(t,e,i,"json")},getScript:function(t,e){return St.get(t,void 0,e,"script")}}),St.each(["get","post"],function(t,e){St[e]=function(t,i,n,r){return yt(i)&&(r=r||n,n=i,i=void 0),St.ajax(St.extend({url:t,type:e,dataType:r,data:i,success:n},St.isPlainObject(t)&&t))}}),St.ajaxPrefilter(function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")}),St._evalUrl=function(t,e,i){return St.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){St.globalEval(t,e,i)}})},St.fn.extend({wrapAll:function(t){var e;return this[0]&&(yt(t)&&(t=t.call(this[0])),e=St(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map(function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t}).append(this)),this},wrapInner:function(t){return yt(t)?this.each(function(e){St(this).wrapInner(t.call(this,e))}):this.each(function(){var e=St(this),i=e.contents();i.length?i.wrapAll(t):e.append(t)})},wrap:function(t){var e=yt(t);return this.each(function(i){St(this).wrapAll(e?t.call(this,i):t)})},unwrap:function(t){return this.parent(t).not("body").each(function(){St(this).replaceWith(this.childNodes)}),this}}),St.expr.pseudos.hidden=function(t){return!St.expr.pseudos.visible(t)},St.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},St.ajaxSettings.xhr=function(){try{return new t.XMLHttpRequest}catch(t){}};var Xe={0:200,1223:204},je=St.ajaxSettings.xhr();xt.cors=!!je&&"withCredentials"in je,xt.ajax=je=!!je,St.ajaxTransport(function(e){var i,n;if(xt.cors||je&&!e.crossDomain)return{send:function(r,s){var o,a=e.xhr();if(a.open(e.type,e.url,e.async,e.username,e.password),e.xhrFields)for(o in e.xhrFields)a[o]=e.xhrFields[o];e.mimeType&&a.overrideMimeType&&a.overrideMimeType(e.mimeType),e.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest");for(o in r)a.setRequestHeader(o,r[o]);i=function(t){return function(){i&&(i=n=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===t?a.abort():"error"===t?"number"!=typeof a.status?s(0,"error"):s(a.status,a.statusText):s(Xe[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=i(),n=a.onerror=a.ontimeout=i("error"),void 0!==a.onabort?a.onabort=n:a.onreadystatechange=function(){4===a.readyState&&t.setTimeout(function(){i&&n()})},i=i("abort");try{a.send(e.hasContent&&e.data||null)}catch(t){if(i)throw t}},abort:function(){i&&i()}}}),St.ajaxPrefilter(function(t){t.crossDomain&&(t.contents.script=!1)}),St.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return St.globalEval(t),t}}}),St.ajaxPrefilter("script",function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")}),St.ajaxTransport("script",function(t){if(t.crossDomain||t.scriptAttrs){var e,i;return{send:function(n,r){e=St("<script>").attr(t.scriptAttrs||{}).prop({charset:t.scriptCharset,src:t.url}).on("load error",i=function(t){e.remove(),i=null,t&&r("error"===t.type?404:200,t.type)}),wt.head.appendChild(e[0])},abort:function(){i&&i()}}}});var ze=[],Ge=/(=)\?(?=&|$)|\?\?/;St.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var t=ze.pop()||St.expando+"_"+Ee.guid++;return this[t]=!0,t}}),St.ajaxPrefilter("json jsonp",function(e,i,n){var r,s,o,a=e.jsonp!==!1&&(Ge.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ge.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=yt(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ge,"$1"+r):e.jsonp!==!1&&(e.url+=(Me.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||St.error(r+" was not called"),o[0]},e.dataTypes[0]="json",s=t[r],t[r]=function(){o=arguments},n.always(function(){void 0===s?St(t).removeProp(r):t[r]=s,e[r]&&(e.jsonpCallback=i.jsonpCallback,ze.push(r)),o&&yt(s)&&s(o[0]),o=s=void 0}),"script"}),xt.createHTMLDocument=function(){var t=wt.implementation.createHTMLDocument("").body;return t.innerHTML="<form></form><form></form>",2===t.childNodes.length}(),St.parseHTML=function(t,e,i){if("string"!=typeof t)return[];"boolean"==typeof e&&(i=e,e=!1);var n,r,s;return e||(xt.createHTMLDocument?(e=wt.implementation.createHTMLDocument(""),n=e.createElement("base"),n.href=wt.location.href,e.head.appendChild(n)):e=wt),r=Nt.exec(t),s=!i&&[],r?[e.createElement(r[1])]:(r=S([t],e,s),s&&s.length&&St(s).remove(),St.merge([],r.childNodes))},St.fn.load=function(t,e,i){var n,r,s,o=this,a=t.indexOf(" ");return a>-1&&(n=K(t.slice(a)),t=t.slice(0,a)),yt(e)?(i=e,e=void 0):e&&"object"==typeof e&&(r="POST"),o.length>0&&St.ajax({url:t,type:r||"GET",dataType:"html",data:e}).done(function(t){s=arguments,o.html(n?St("<div>").append(St.parseHTML(t)).find(n):t)}).always(i&&function(t,e){o.each(function(){i.apply(this,s||[t.responseText,e,t])})}),this},St.expr.pseudos.animated=function(t){return St.grep(St.timers,function(e){return t===e.elem}).length},St.offset={setOffset:function(t,e,i){var n,r,s,o,a,u,l,c=St.css(t,"position"),h=St(t),d={};"static"===c&&(t.style.position="relative"),a=h.offset(),s=St.css(t,"top"),u=St.css(t,"left"),l=("absolute"===c||"fixed"===c)&&(s+u).indexOf("auto")>-1,l?(n=h.position(),o=n.top,r=n.left):(o=parseFloat(s)||0,r=parseFloat(u)||0),yt(e)&&(e=e.call(t,i,St.extend({},a))),null!=e.top&&(d.top=e.top-a.top+o),null!=e.left&&(d.left=e.left-a.left+r),"using"in e?e.using.call(t,d):h.css(d)}},St.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){St.offset.setOffset(this,t,e)});var e,i,n=this[0];if(n)return n.getClientRects().length?(e=n.getBoundingClientRect(),i=n.ownerDocument.defaultView,{top:e.top+i.pageYOffset,left:e.left+i.pageXOffset}):{top:0,left:0}},position:function(){if(this[0]){var t,e,i,n=this[0],r={top:0,left:0};if("fixed"===St.css(n,"position"))e=n.getBoundingClientRect();else{for(e=this.offset(),i=n.ownerDocument,t=n.offsetParent||i.documentElement;t&&(t===i.body||t===i.documentElement)&&"static"===St.css(t,"position");)t=t.parentNode;t&&t!==n&&1===t.nodeType&&(r=St(t).offset(),r.top+=St.css(t,"borderTopWidth",!0),r.left+=St.css(t,"borderLeftWidth",!0))}return{top:e.top-r.top-St.css(n,"marginTop",!0),left:e.left-r.left-St.css(n,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent;t&&"static"===St.css(t,"position");)t=t.offsetParent;return t||Wt})}}),St.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,e){var i="pageYOffset"===e;St.fn[t]=function(n){return Pt(this,function(t,n,r){var s;if(vt(t)?s=t:9===t.nodeType&&(s=t.defaultView),void 0===r)return s?s[e]:t[n];s?s.scrollTo(i?s.pageXOffset:r,i?r:s.pageYOffset):t[n]=r},t,n,arguments.length)}}),St.each(["top","left"],function(t,e){St.cssHooks[e]=R(xt.pixelPosition,function(t,i){if(i)return i=L(t,e),ae.test(i)?St(t).position()[e]+"px":i})}),St.each({Height:"height",Width:"width"},function(t,e){St.each({padding:"inner"+t,content:e,"":"outer"+t},function(i,n){St.fn[n]=function(r,s){var o=arguments.length&&(i||"boolean"!=typeof r),a=i||(r===!0||s===!0?"margin":"border");return Pt(this,function(e,i,r){var s;return vt(e)?0===n.indexOf("outer")?e["inner"+t]:e.document.documentElement["client"+t]:9===e.nodeType?(s=e.documentElement,Math.max(e.body["scroll"+t],s["scroll"+t],e.body["offset"+t],s["offset"+t],s["client"+t])):void 0===r?St.css(e,i,a):St.style(e,i,r,a)},e,o?r:void 0,o)}})}),St.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(t,e){St.fn[e]=function(t){return this.on(e,t)}}),St.fn.extend({bind:function(t,e,i){return this.on(t,null,e,i)},unbind:function(t,e){return this.off(t,null,e)},delegate:function(t,e,i,n){return this.on(e,t,i,n)},undelegate:function(t,e,i){return 1===arguments.length?this.off(t,"**"):this.off(e,t||"**",i)},hover:function(t,e){return this.mouseenter(t).mouseleave(e||t)}}),St.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(t,e){St.fn[e]=function(t,i){return arguments.length>0?this.on(e,null,t,i):this.trigger(e)}});St.proxy=function(t,e){var i,n,r;if("string"==typeof e&&(i=t[e],e=t,t=i),yt(t))return n=lt.call(arguments,2),r=function(){return t.apply(e||this,n.concat(lt.call(arguments)))},r.guid=t.guid=t.guid||St.guid++,r},St.holdReady=function(t){t?St.readyWait++:St.ready(!0)},St.isArray=Array.isArray,St.parseJSON=JSON.parse,St.nodeName=s,St.isFunction=yt,St.isWindow=vt,St.camelCase=f,St.type=n,St.now=Date.now,St.isNumeric=function(t){var e=St.type(t);return("number"===e||"string"===e)&&!isNaN(t-parseFloat(t))},St.trim=function(t){return null==t?"":(t+"").replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")},"function"==typeof define&&define.amd&&define("jquery",[],function(){return St});var He=t.jQuery,qe=t.$;return St.noConflict=function(e){return t.$===St&&(t.$=qe),e&&t.jQuery===St&&(t.jQuery=He),St},void 0===e&&(t.jQuery=t.$=St),St}),define("jquery/dist/jquery",function(){}),define("x_ite/Fallback",["jquery"],function(t){"use strict";return{error:function(e,i){t(function(){const n=t("X3DCanvas");this.show(n,e);for(const t of i)"function"==typeof t&&t(n,e)}.bind(this))},show:function(e,i){console.log(i);const n=t(".x_ite-console");n.length&&n.append(document.createTextNode(i)),e.addClass("x_ite-browser-fallback"),e.children(".x_ite-private-browser").hide(),e.children(":not(.x_ite-private-browser)").addClass("x_ite-fallback"),e.children(":not(.x_ite-private-browser)").show()}}}),define("x_ite/Basic/X3DFieldDefinition",[],function(){"use strict";function t(t,e,i){this.accessType=t,this.dataType=i.getType(),this.name=e,this.value=i}return t.prototype.constructor=t,t}),define("x_ite/Basic/FieldDefinitionArray",[],function(){"use strict";function t(t){this.array=t,this.index={};for(const e of t)this.index[e.name]=e;return new Proxy(this,e)}const e={get:function(t,e){const i=t[e];return void 0!==i?i:t.array[e]},set:function(t,e,i){return!1},has:function(t,e){return Number.isInteger(+e)?e<t.array.length:e in t}};return Object.assign(t.prototype,{constructor:t,add:function(t){this.array.push(t),this.index[t.name]=t},get:function(t){return this.index[t]},getValue:function(){return this.array}}),Object.defineProperty(t.prototype,"length",{get:function(){return this.array.length},enumerable:!1,configurable:!1}),t}),define("x_ite/Bits/X3DConstants",[],function(){"use strict";var t=0,e=0,i=0;return{CONNECTION_ERROR:t++,BROWSER_EVENT:t++,INITIALIZED_EVENT:t++,SHUTDOWN_EVENT:t++,INITIALIZED_ERROR:t++,NOT_STARTED_STATE:e++,IN_PROGRESS_STATE:e++,COMPLETE_STATE:e++,FAILED_STATE:e++,initializeOnly:parseInt("001",2),inputOnly:parseInt("010",2),outputOnly:parseInt("100",2),inputOutput:parseInt("111",2),SFBool:i++,SFColor:i++,SFColorRGBA:i++,SFDouble:i++,SFFloat:i++,SFImage:i++,SFInt32:i++,SFMatrix3d:i++,SFMatrix3f:i++,SFMatrix4d:i++,SFMatrix4f:i++,SFNode:i++,SFRotation:i++,SFString:i++,SFTime:i++,SFVec2d:i++,SFVec2f:i++,SFVec3d:i++,SFVec3f:i++,SFVec4d:i++,SFVec4f:i++,VrmlMatrix:i++,MFBool:i++,MFColor:i++,MFColorRGBA:i++,MFDouble:i++,MFFloat:i++,MFImage:i++,MFInt32:i++,MFMatrix3d:i++,MFMatrix3f:i++,MFMatrix4d:i++,MFMatrix4f:i++,MFNode:i++,MFRotation:i++,MFString:i++,MFTime:i++,MFVec2d:i++,MFVec2f:i++,MFVec3d:i++,MFVec3f:i++,MFVec4d:i++,MFVec4f:i++,X3DBaseNode:0}}),define("x_ite/InputOutput/Generator",["x_ite/Bits/X3DConstants"],function(t){"use strict";function e(){this.indent="",this.indentChar=" ",this.executionContextStack=[null],this.importedNodesIndex=new Map,this.exportedNodesIndex=new Map,this.nodes=new Set,this.names=new Map,this.namesByNode=new Map,this.importedNames=new Map,this.routeNodes=new Set,this.level=0,this.newName=0,this.containerFields=[],this.units=!0,this.unitCategories=[],this.names.set(null,new Map)}return e.prototype={constructor:e,Indent:function(){return this.indent},IncIndent:function(){this.indent+=this.indentChar},DecIndent:function(){this.indent=this.indent.substr(0,this.indent.length-this.indentChar.length)},PadRight:function(t,e){for(var i=0,n=e-t.length;i<n;++i)t+=" ";return t},PushExecutionContext:function(t){this.executionContextStack.push(t),this.names.has(t)||this.names.set(t,new Map),this.importedNodesIndex.has(t)||this.importedNodesIndex.set(t,new Set),this.exportedNodesIndex.has(t)||this.exportedNodesIndex.set(t,new Set)},PopExecutionContext:function(){this.executionContextStack.pop(),this.ExecutionContext()||(this.importedNodesIndex.clear(),this.exportedNodesIndex.clear())},ExecutionContext:function(){return this.executionContextStack.at(-1)},EnterScope:function(){0===this.level&&(this.newName=0),++this.level},LeaveScope:function(){0===--this.level&&(this.nodes.clear(),this.namesByNode.clear(),this.importedNames.clear())},ExportedNodes:function(t){var e=this.exportedNodesIndex.get(this.ExecutionContext());t.forEach(function(t){try{e.add(t.getLocalNode())}catch(t){}})},ImportedNodes:function(t){var e=this.importedNodesIndex.get(this.ExecutionContext());t.forEach(function(t){try{e.add(t.getInlineNode())}catch(t){}})},AddImportedNode:function(t,e){this.importedNames.set(t,e)},AddRouteNode:function(t){this.routeNodes.add(t)},ExistsRouteNode:function(t){return this.routeNodes.has(t)},IsSharedNode:function(t){return!1},AddNode:function(t){this.nodes.add(t),this.AddRouteNode(t)},ExistsNode:function(t){return this.nodes.has(t)},Name:function(t){var e=this.namesByNode.get(t);if(void 0!==e)return e;var i=this.names.get(this.ExecutionContext());if(0===t.getName().length){if(this.NeedsName(t)){var e=this.UniqueName();return i.set(e,t),this.namesByNode.set(t,e),e}return t.getName()}var e=t.getName(),n=null!==e.match(/(_\d+$)/);if(e=e.replace(/(_\d+$)/,""),0===e.length){if(!this.NeedsName(t))return"";e=this.UniqueName()}else{for(var r=0,s=n?e+"_"+ ++r:e;i.has(s);)s=e+"_"+ ++r;e=s}return i.set(e,t),this.namesByNode.set(t,e),e},NeedsName:function(t){if(t.getCloneCount()>1)return!0;if(t.hasRoutes())return!0;var e=t.getExecutionContext(),i=this.importedNodesIndex.get(e);if(i&&i.has(t))return!0;var i=this.exportedNodesIndex.get(e);return!(!i||!i.has(t))},UniqueName:function(){for(var t=this.names.get(this.ExecutionContext());;){var e="_"+ ++this.newName;if(!t.has(e))return e}},LocalName:function(t){var e=this.importedNames.get(t);if(void 0!==e)return e;if(this.ExistsNode(t))return this.Name(t);throw new Error("Couldn't get local name for node '"+t.getTypeName()+"'.")},PushContainerField:function(t){this.containerFields.push(t)},PopContainerField:function(){this.containerFields.pop()},ContainerField:function(){return this.containerFields.length?this.containerFields[this.containerFields.length-1]:null},AccessType:function(e){switch(e){case t.initializeOnly:return"initializeOnly";case t.inputOnly:return"inputOnly";case t.outputOnly:return"outputOnly";case t.inputOutput:return"inputOutput"}},SetUnits:function(t){this.units=t},GetUnits:function(){return this.units},PushUnitCategory:function(t){this.unitCategories.push(t)},PopUnitCategory:function(){this.unitCategories.pop()},Unit:function(t){return 0==this.unitCategories.length?t:this.unitCategories.at(-1)},ToUnit:function(t,e){if(this.units){var i=this.ExecutionContext();if(i)return i.toUnit(t,e)}return e},XMLEncode:function(t){return t.replace(/&/g,"&").replace(/\\/g,"\").replace(/\t/g,"	").replace(/\n/g,"
").replace(/\r/g,"
").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,'\\"')},escapeCDATA:function(t){return t.replace(/\]\]\>/g,"\\]\\]\\>")}},e.Get=function(t){return t.generator||(t.generator=new e),t.generator},e}),define("x_ite/Base/X3DObject",["x_ite/InputOutput/Generator"],function(t){"use strict";function e(){}return e.prototype={constructor:e,_id:0,_name:"",_interests:new Map,getId:function(){function t(){return this._id}var e=0;return function(){return this.getId=t,this._id=++e}}(),setName:function(t){this._name=t},getName:function(){return this._name},hasInterest:function(t,e){return this._interests.has(e.getId()+t)},addInterest:function(t,e){this.hasOwnProperty("_interests")||(this._interests=new Map);const i=e[t];if(arguments.length>2){const n=Array.prototype.slice.call(arguments,0);n[0]=e,n[1]=this,this._interests.set(e.getId()+t,Function.prototype.bind.apply(i,n))}else{const n=this;this._interests.set(e.getId()+t,function(){i.call(e,n)})}},removeInterest:function(t,e){this._interests.delete(e.getId()+t)},getInterests:function(){return this._interests},processInterests:function(){function t(t){t()}return function(){this._interests.forEach(t)}}(),toString:function(e){const i={string:""};return e&&t.Get(i).PushExecutionContext(e),this.toStream(i),i.string},toVRMLString:function(){const t={string:""};return this.toVRMLStream(t),t.string},toXMLString:function(){const t={string:""};return this.toXMLStream(t),t.string},dispose:function(){}},e}),define("x_ite/Base/X3DChildObject",["x_ite/Base/X3DObject"],function(t){"use strict";function e(){t.call(this)}return e.prototype=Object.assign(Object.create(t.prototype),{constructor:e,_modificationTime:0,_tainted:!1,_parents:new Set,setModificationTime:function(t){this._modificationTime=t},getModificationTime:function(){return this._modificationTime},setTainted:function(t){this._tainted=t},getTainted:function(){return this._tainted},addEvent:function(){this.setModificationTime(performance.now());for(const t of this._parents)t.addEvent(this)},addEventObject:function(t,e){this.setModificationTime(performance.now());for(const t of this._parents)t.addEventObject(this,e)},addParent:function(t){this.hasOwnProperty("_parents")||(this._parents=new Set),this._parents.add(t)},removeParent:function(t){this._parents.delete(t)},getParents:function(){return this._parents},addCloneCount:Function.prototype,removeCloneCount:Function.prototype,dispose:function(){this._parents.clear(),t.prototype.dispose.call(this)}}),e}),define("x_ite/Base/Events",[],function(){"use strict";return{stack:[],create:function(t){if(this.stack.length){const e=this.stack.pop();return e.field=t,e.clear(),e}const e=new Set;return e.field=t,e},copy:function(t){if(this.stack.length){const e=this.stack.pop();e.field=t.field,e.clear();for(const i of t)e.add(i);return e}const e=new Set(t);return e.field=t.field,e},push:function(t){this.stack.push(t)},clear:function(){this.stack.length=0}}}),define("standard/Utility/MapUtilities",["require"],function(t){"use strict";return{assign:function(t,e){return t.clear(),e.forEach(function(e,i){t.set(i,e)}),t}}}),define("x_ite/Basic/X3DField",["jquery","x_ite/Base/X3DChildObject","x_ite/Bits/X3DConstants","x_ite/Base/Events","standard/Utility/MapUtilities"],function(t,e,i,n,r){"use strict";function s(t){return e.call(this),this._value=t,this}return s.prototype=Object.assign(Object.create(e.prototype),{constructor:s,_value:null,_accessType:i.initializeOnly,_unit:null,_uniformLocation:null,_references:new Map,_fieldInterests:new Map,_fieldCallbacks:new Map,_inputRoutes:new Map,_outputRoutes:new Map,_routeCallbacks:new Map,clone:function(){return this.copy()},equals:function(t){return this._value===t.valueOf()},assign:function(t){this.set(t.getValue()),this.addEvent()},set:function(t){this._value=t},setValue:function(t){this.set(t instanceof this.constructor?t.getValue():t),this.addEvent()},getValue:function(){return this._value},setAccessType:function(t){this._accessType=t},getAccessType:function(){return this._accessType},isInitializable:function(){return this.getAccessType()&i.initializeOnly},isInput:function(){return this.getAccessType()&i.inputOnly},isOutput:function(){return this.getAccessType()&i.outputOnly},isReadable:function(){return this.getAccessType()!==i.inputOnly},isWritable:function(){return this.getAccessType()!==i.initializeOnly},setUnit:function(t){this._unit=t},getUnit:function(){return this._unit},hasReferences:function(){return!!this.hasOwnProperty("_references")&&0!==this._references.size},isReference:function(t){return t===this.getAccessType()||t===i.inputOutput},addReference:function(t){const e=this.getReferences();if(!e.has(t.getId()))switch(e.set(t.getId(),t),this.getAccessType()&t.getAccessType()){case i.initializeOnly:return t.addFieldInterest(this),void this.set(t.getValue(),t.length);case i.inputOnly:return void t.addFieldInterest(this);case i.outputOnly:return void this.addFieldInterest(t);case i.inputOutput:return t.addFieldInterest(this),this.addFieldInterest(t),void this.set(t.getValue(),t.length)}},getReferences:function(){return this.hasOwnProperty("_references")||(this._references=new Map),this._references},addFieldInterest:function(t){this.hasOwnProperty("_fieldInterests")||(this._fieldInterests=new Map),this._fieldInterests.set(t.getId(),t)},removeFieldInterest:function(t){this._fieldInterests.delete(t.getId())},getFieldInterests:function(){return this._fieldInterests},addFieldCallback:function(t,e){this.hasOwnProperty("_fieldCallbacks")||(this._fieldCallbacks=new Map),this._fieldCallbacks.set(t,e)},removeFieldCallback:function(t){this._fieldCallbacks.delete(t)},getFieldCallbacks:function(){return this._fieldCallbacks},addInputRoute:function(t){this.hasOwnProperty("_inputRoutes")||(this._inputRoutes=new Map),this._inputRoutes.set(t.getId(),t),this.processRouteCallbacks()},removeInputRoute:function(t){this._inputRoutes.delete(t.getId()),this.processRouteCallbacks()},getInputRoutes:function(){return this._inputRoutes},addOutputRoute:function(t){this.hasOwnProperty("_outputRoutes")||(this._outputRoutes=new Map),this._outputRoutes.set(t.getId(),t),this.processRouteCallbacks()},removeOutputRoute:function(t){this._outputRoutes.delete(t.getId()),this.processRouteCallbacks()},getOutputRoutes:function(){return this._outputRoutes},addRouteCallback:function(t,e){this.hasOwnProperty("_routeCallbacks")||(this._routeCallbacks=new Map),this._routeCallbacks.set(t,e)},removeRouteCallback:function(t){this._routeCallbacks.delete(t)},getRouteCallbacks:function(){return this._routeCallbacks},processRouteCallbacks:function(){this._routeCallbacks.size&&this._routeCallbacks.forEach(function(t){t()})},processEvent:function(){function t(t){t(this.valueOf())}const e=new Map;return function(i){if(!i.has(this.getId())){i.add(this.getId()),this.setTainted(!1);const s=i.field;s!==this&&this.set(s.getValue(),s.length),this.processInterests();let o=!0;this._fieldInterests.forEach(function(t){o?(o=!1,t.addEventObject(this,i)):t.addEventObject(this,n.copy(i))},this),o&&n.push(i),this._fieldCallbacks.size&&r.assign(e,this._fieldCallbacks).forEach(t,this)}}}(),valueOf:function(){return this},fromString:function(t,e){const i=require("x_ite/Parser/Parser"),n=new i(e);n.setUnits(!!e),n.setInput(t),n.fieldValue(this),this.addEvent()}}),s}),define("x_ite/Basic/X3DArrayField",["x_ite/Basic/X3DField"],function(t){"use strict";function e(e){t.call(this,e)}return e.prototype=Object.assign(Object.create(t.prototype),{constructor:e}),e}),define("x_ite/Fields/SFBool",["x_ite/Basic/X3DField","x_ite/Bits/X3DConstants"],function(t,e){"use strict";function i(e){return t.call(this,!!e)}return i.prototype=Object.assign(Object.create(t.prototype),{constructor:i,copy:function(){return new i(this.getValue())},isDefaultValue:function(){return this.getValue()===!1},set:function(e){t.prototype.set.call(this,!!e)},getTypeName:function(){return"SFBool"},getType:function(){return e.SFBool},valueOf:function(){return this.getValue()},toStream:function(t){t.string+=this.getValue()?"TRUE":"FALSE"},toVRMLStream:function(t){this.toStream(t)},toXMLStream:function(t){t.string+=this.getValue()?"true":"false"}}),i}),define("standard/Math/Algorithm",[],function(){"use strict";function t(){}return t.prototype={constructor:t,radians:function(t){return t*(Math.PI/180)},degrees:function(t){return t*(180/Math.PI)},random:function(t,e){return t+Math.random()*(e-t)},fract:function(t){return t>0?t-Math.floor(t):t-Math.ceil(t)},clamp:function(t,e,i){return Math.min(Math.max(t,e),i)},interval:function(t,e,i){return t>=i?(t-e)%(i-e)+e:t<e?(t-i)%(i-e)+i:t},lerp:function(t,e,i){return t+i*(e-t)},slerp:function(t,e,i){let n=t.dot(e);if(n<=-1)throw new Error("slerp is not possible: vectors are inverse collinear.");if(n>=1)return t;n<0&&(n=-n,e.negate());const r=Math.acos(n),s=Math.sin(r),o=Math.sin((1-i)*r)/s,a=Math.sin(i*r)/s;return t.x=t.x*o+e.x*a,t.y=t.y*o+e.y*a,t.z=t.z*o+e.z*a,t.w=t.w*o+e.w*a,t},simpleSlerp:function(t,e,i){const n=t.dot(e);if(n<=-1)throw new Error("slerp is not possible: vectors are inverse collinear.");if(n>=1)return t;const r=Math.acos(n),s=Math.sin(r),o=Math.sin((1-i)*r)/s,a=Math.sin(i*r)/s;return t.x=t.x*o+e.x*a,t.y=t.y*o+e.y*a,t.z=t.z*o+e.z*a,t.w=t.w*o+e.w*a,t},isPowerOfTwo:function(t){return 0==(t-1&t)},nextPowerOfTwo:function(t){return this.isPowerOfTwo(t)?t:1<<32-Math.clz32(t)},cmp:function(t,e){return t>e?1:t<e?-1:0},less:function(t,e){return t<e},greater:function(t,e){return t>e},lowerBound:function(t,e,i,n,r){let s=0,o=0,a=i-e;for(;a>0;)o=a>>>1,s=e+o,r(t[s],n)?(e=++s,a-=o+1):a=o;return e},upperBound:function(t,e,i,n,r){let s=0,o=0,a=i-e;for(;a>0;)o=a>>>1,s=e+o,r(n,t[s])?a=o:(e=++s,a-=o+1);return e},set_difference:function(t,e,i){for(const n in t)n in e||(i[n]=t[n]);return i}},new t}),define("standard/Math/Numbers/Color3",["standard/Math/Algorithm"],function(t){"use strict";function e(t,e,n){arguments.length?(this.r_=i(t,0,1),this.g_=i(e,0,1),this.b_=i(n,0,1)):(this.r_=0,this.g_=0,this.b_=0)}const i=t.clamp;e.prototype={constructor:e,length:3,copy:function(){const t=Object.create(e.prototype);return t.r_=this.r_,t.g_=this.g_,t.b_=this.b_,t},assign:function(t){this.r_=t.r_,this.g_=t.g_,this.b_=t.b_},set:function(t,e,n){this.r_=i(t,0,1),this.g_=i(e,0,1),this.b_=i(n,0,1)},equals:function(t){return this.r_===t.r_&&this.g_===t.g_&&this.b_===t.b_},getHSV:function(t){let e,i,n;const r=Math.min(this.r_,this.g_,this.b_),s=Math.max(this.r_,this.g_,this.b_);n=s;const o=s-r;return 0!==s&&0!==o?(i=o/s,e=this.r_===s?(this.g_-this.b_)/o:this.g_===s?2+(this.b_-this.r_)/o:4+(this.r_-this.g_)/o,(e*=Math.PI/3)<0&&(e+=2*Math.PI)):i=e=0,t[0]=e,t[1]=i,t[2]=n,t},setHSV:function(e,n,r){if(n=i(n,0,1),r=i(r,0,1),0===n)this.r_=this.g_=this.b_=r;else{const i=t.degrees(t.interval(e,0,2*Math.PI))/60,s=Math.floor(i),o=i-s,a=r*(1-n),u=r*(1-n*o),l=r*(1-n*(1-o));switch(s%6){case 0:this.r_=r,this.g_=l,this.b_=a;break;case 1:this.r_=u,this.g_=r,this.b_=a;break;case 2:this.r_=a,this.g_=r,this.b_=l;break;case 3:this.r_=a,this.g_=u,this.b_=r;break;case 4:this.r_=l,this.g_=a,this.b_=r;break;default:this.r_=r,this.g_=a,this.b_=u}}},toString:function(){return this.r_+" "+this.g_+" "+this.b_}};const n={get:function(){return this.r_},set:function(t){this.r_=i(t,0,1)},enumerable:!0,configurable:!1},r={get:function(){return this.g_},set:function(t){this.g_=i(t,0,1)},enumerable:!0,configurable:!1},s={get:function(){return this.b_},set:function(t){this.b_=i(t,0,1)},enumerable:!0,configurable:!1};return Object.defineProperty(e.prototype,"r",n),Object.defineProperty(e.prototype,"g",r),Object.defineProperty(e.prototype,"b",s),n.enumerable=!1,r.enumerable=!1,s.enumerable=!1,Object.defineProperty(e.prototype,"0",n),Object.defineProperty(e.prototype,"1",r),Object.defineProperty(e.prototype,"2",s),Object.assign(e,{HSV:function(t,e,i){const n=Object.create(this.prototype);return n.setHSV(t,e,i),n},lerp:function(t,e,i,n){let r=t[0],s=e[0];const o=t[1],a=e[1],u=t[2],l=e[2];0===o&&(r=s),0===a&&(s=r);const c=Math.abs(s-r);if(c<=Math.PI)return n[0]=r+i*(s-r),n[1]=o+i*(a-o),n[2]=u+i*(l-u),n;const h=2*Math.PI,d=(h-c)*i;let p=r<s?r-d:r+d;return p<0?p+=h:p>h&&(p-=h),n[0]=p,n[1]=o+i*(a-o),n[2]=u+i*(l-u),n}}),e}),define("x_ite/Fields/SFColor",["standard/Math/Numbers/Color3","x_ite/Basic/X3DField","x_ite/Bits/X3DConstants"],function(t,e,i){"use strict";function n(i,n,r){switch(arguments.length){case 0:return e.call(this,new t);case 1:return e.call(this,arguments[0]);case 3:return e.call(this,new t(1*i,1*n,1*r))}throw new Error("Invalid arguments.")}n.prototype=Object.assign(Object.create(e.prototype),{constructor:n,copy:function(){return new n(this.getValue().copy())},getTypeName:function(){return"SFColor"},getType:function(){return i.SFColor},equals:function(t){return this.getValue().equals(t.getValue())},isDefaultValue:function(){return 0===this.getValue().r&&0===this.getValue().g&&0===this.getValue().b},set:function(t){this.getValue().assign(t)},getHSV:function(){return this.getValue().getHSV([])},setHSV:function(t,e,i){this.getValue().setHSV(t,e,i),this.addEvent()},lerp:function(){var e=[],i=[],r=[];return function(s,o){var a=new n;return this.getValue().getHSV(e),s.getValue().getHSV(i),t.lerp(e,i,o,r),a.setHSV(r[0],r[1],r[2],r[3]),a}}(),toStream:function(t){t.string+=this.getValue().toString()},toVRMLStream:function(t){this.toStream(t)},toXMLStream:function(t){this.toStream(t)}});var r={get:function(){return this.getValue().r},set:function(t){this.getValue().r=1*t,this.addEvent()},enumerable:!0,configurable:!1},s={get:function(){return this.getValue().g},set:function(t){this.getValue().g=1*t,this.addEvent()},enumerable:!0,configurable:!1},o={get:function(){return this.getValue().b},set:function(t){this.getValue().b=1*t,this.addEvent()},enumerable:!0,configurable:!1}
|
|
7
7
|
;return Object.defineProperty(n.prototype,"r",r),Object.defineProperty(n.prototype,"g",s),Object.defineProperty(n.prototype,"b",o),r.enumerable=!1,s.enumerable=!1,o.enumerable=!1,Object.defineProperty(n.prototype,"0",r),Object.defineProperty(n.prototype,"1",s),Object.defineProperty(n.prototype,"2",o),n}),define("standard/Math/Numbers/Color4",["standard/Math/Numbers/Color3","standard/Math/Algorithm"],function(t,e){"use strict";function i(t,e,i,r){arguments.length?(this.r_=n(t,0,1),this.g_=n(e,0,1),this.b_=n(i,0,1),this.a_=n(r,0,1)):(this.r_=0,this.g_=0,this.b_=0,this.a_=0)}const n=e.clamp;i.prototype={constructor:i,length:4,copy:function(){const t=Object.create(i.prototype);return t.r_=this.r_,t.g_=this.g_,t.b_=this.b_,t.a_=this.a_,t},assign:function(t){this.r_=t.r_,this.g_=t.g_,this.b_=t.b_,this.a_=t.a_},set:function(t,e,i,r){this.r_=n(t,0,1),this.g_=n(e,0,1),this.b_=n(i,0,1),this.a_=n(r,0,1)},equals:function(t){return this.r_===t.r_&&this.g_===t.g_&&this.b_===t.b_&&this.a_===t.a_},getHSVA:function(e){return t.prototype.getHSV.call(this,e),e[3]=this.a_,e},setHSVA:function(e,i,r,s){t.prototype.setHSV.call(this,e,i,r),this.a_=n(s,0,1)},toString:function(){return this.r_+" "+this.g_+" "+this.b_+" "+this.a_}};const r={get:function(){return this.r_},set:function(t){this.r_=n(t,0,1)},enumerable:!0,configurable:!1},s={get:function(){return this.g_},set:function(t){this.g_=n(t,0,1)},enumerable:!0,configurable:!1},o={get:function(){return this.b_},set:function(t){this.b_=n(t,0,1)},enumerable:!0,configurable:!1},a={get:function(){return this.a_},set:function(t){this.a_=n(t,0,1)},enumerable:!0,configurable:!1};return Object.defineProperty(i.prototype,"r",r),Object.defineProperty(i.prototype,"g",s),Object.defineProperty(i.prototype,"b",o),Object.defineProperty(i.prototype,"a",a),r.enumerable=!1,s.enumerable=!1,o.enumerable=!1,a.enumerable=!1,Object.defineProperty(i.prototype,"0",r),Object.defineProperty(i.prototype,"1",s),Object.defineProperty(i.prototype,"2",o),Object.defineProperty(i.prototype,"3",a),Object.assign(i,{HSVA:function(t,e,i,n){const r=Object.create(this.prototype);return r.setHSVA(t,e,i,n),r},lerp:function(e,i,n,r){const s=e[3];return t.lerp(e,i,n,r),r[3]=s+n*(i[3]-s),r}}),i}),define("x_ite/Fields/SFColorRGBA",["x_ite/Basic/X3DField","x_ite/Fields/SFColor","x_ite/Bits/X3DConstants","standard/Math/Numbers/Color4"],function(t,e,i,n){"use strict";function r(e,i,r,s){switch(arguments.length){case 0:return t.call(this,new n);case 1:return t.call(this,arguments[0]);case 4:return t.call(this,new n(1*e,1*i,1*r,1*s))}throw new Error("Invalid arguments.")}r.prototype=Object.assign(Object.create(t.prototype),{constructor:r,copy:function(){return new r(this.getValue().copy())},getTypeName:function(){return"SFColorRGBA"},getType:function(){return i.SFColorRGBA},equals:e.prototype.equals,isDefaultValue:function(){return 0===this.getValue().r&&0===this.getValue().g&&0===this.getValue().b&&0===this.getValue().a},set:e.prototype.set,getHSVA:function(){return this.getValue().getHSVA([])},setHSVA:function(t,e,i,n){this.getValue().setHSVA(t,e,i,n),this.addEvent()},lerp:function(){var t=[],e=[],i=[];return function(s,o){var a=new r;return this.getValue().getHSVA(t),s.getValue().getHSVA(e),n.lerp(t,e,o,i),a.setHSVA(i[0],i[1],i[2],i[3]),a}}(),toStream:e.prototype.toStream,toVRMLStream:e.prototype.toVRMLStream,toXMLStream:e.prototype.toXMLStream});var s={get:function(){return this.getValue().r},set:function(t){this.getValue().r=1*t,this.addEvent()},enumerable:!0,configurable:!1},o={get:function(){return this.getValue().g},set:function(t){this.getValue().g=1*t,this.addEvent()},enumerable:!0,configurable:!1},a={get:function(){return this.getValue().b},set:function(t){this.getValue().b=1*t,this.addEvent()},enumerable:!0,configurable:!1},u={get:function(){return this.getValue().a},set:function(t){this.getValue().a=1*t,this.addEvent()},enumerable:!0,configurable:!1};return Object.defineProperty(r.prototype,"r",s),Object.defineProperty(r.prototype,"g",o),Object.defineProperty(r.prototype,"b",a),Object.defineProperty(r.prototype,"a",u),s.enumerable=!1,o.enumerable=!1,a.enumerable=!1,u.enumerable=!1,Object.defineProperty(r.prototype,"0",s),Object.defineProperty(r.prototype,"1",o),Object.defineProperty(r.prototype,"2",a),Object.defineProperty(r.prototype,"3",u),r}),define("x_ite/Fields/SFDouble",["x_ite/Basic/X3DField","x_ite/Bits/X3DConstants","x_ite/InputOutput/Generator"],function(t,e,i){"use strict";function n(e){return t.call(this,arguments.length?1*e:0)}return n.prototype=Object.assign(Object.create(t.prototype),{constructor:n,copy:function(){return new n(this.getValue())},getTypeName:function(){return"SFDouble"},getType:function(){return e.SFDouble},isDefaultValue:function(){return 0===this.getValue()},set:function(e){t.prototype.set.call(this,+e)},valueOf:t.prototype.getValue,toStream:function(t){var e=i.Get(t),n=e.Unit(this.getUnit());t.string+=String(e.ToUnit(n,this.getValue()))},toVRMLStream:function(t){this.toStream(t)},toXMLStream:function(t){this.toStream(t)}}),n}),define("x_ite/Fields/SFFloat",["x_ite/Basic/X3DField","x_ite/Bits/X3DConstants","x_ite/InputOutput/Generator"],function(t,e,i){"use strict";function n(e){return t.call(this,arguments.length?1*e:0)}return n.prototype=Object.assign(Object.create(t.prototype),{constructor:n,copy:function(){return new n(this.getValue())},getTypeName:function(){return"SFFloat"},getType:function(){return e.SFFloat},isDefaultValue:function(){return 0===this.getValue()},set:function(e){t.prototype.set.call(this,1*e)},valueOf:t.prototype.getValue,toStream:function(t){var e=i.Get(t),n=e.Unit(this.getUnit());t.string+=String(e.ToUnit(n,this.getValue()))},toVRMLStream:function(t){this.toStream(t)},toXMLStream:function(t){this.toStream(t)}}),n}),define("x_ite/Fields/SFInt32",["x_ite/Basic/X3DField","x_ite/Bits/X3DConstants"],function(t,e){"use strict";function i(e){return t.call(this,~~e)}return i.prototype=Object.assign(Object.create(t.prototype),{constructor:i,copy:function(){return new i(this.getValue())},getTypeName:function(){return"SFInt32"},getType:function(){return e.SFInt32},isDefaultValue:function(){return 0===this.getValue()},set:function(e){t.prototype.set.call(this,~~e)},valueOf:t.prototype.getValue,toStream:function(t,e){t.string+=this.getValue().toString(e)},toVRMLStream:function(t){this.toStream(t)},toXMLStream:function(t){t.string+=this.getValue().toString()}}),i}),define("x_ite/Fields/SFImage",["x_ite/Basic/X3DField","x_ite/Fields/SFInt32","x_ite/Bits/X3DConstants"],function(t,e,i){"use strict";function n(t,e,i,n){var r=require("x_ite/Fields/ArrayFields").MFInt32;this.width=~~t,this.height=~~e,this.comp=~~i,this.array=new r,this.array.setValue(n),this.array.length=this.width*this.height}function r(e,i,r,s){var o=require("x_ite/Fields/ArrayFields").MFInt32;return arguments[0]instanceof n?t.call(this,arguments[0]):4===arguments.length?t.call(this,new n(e,i,r,s)):t.call(this,new n(0,0,0,new o)),this.getValue().getArray().addParent(this),this.addInterest("set_size__",this),this}n.prototype={constructor:n,copy:function(){return new n(this.width,this.height,this.comp,this.array)},equals:function(t){return this.width===t.width&&this.height===t.height&&this.comp===t.comp&&this.array.equals(t.array)},assign:function(t){this.width=t.width,this.height=t.height,this.comp=t.comp,this.array.assign(t.array)},set:function(t,e,i,n){this.width=~~t,this.height=~~e,this.comp=~~i,this.array.assign(n)},setWidth:function(t){this.width=~~t,this.array.length=this.width*this.height},getWidth:function(){return this.width},setHeight:function(t){this.height=~~t,this.array.length=this.width*this.height},getHeight:function(){return this.height},setComp:function(t){this.comp=~~t},getComp:function(){return this.comp},setArray:function(t){this.array.assign(t),this.array.length=this.width*this.height},getArray:function(){return this.array}},r.prototype=Object.assign(Object.create(t.prototype),{constructor:r,set_size__:function(){this.getValue().getArray().length=this.width*this.height},copy:function(){return new r(this.getValue().copy())},equals:function(t){return this.getValue().equals(t.getValue())},isDefaultValue:function(){return 0===this.width&&0===this.height&&0===this.comp},set:function(t){this.getValue().assign(t)},getTypeName:function(){return"SFImage"},getType:function(){return i.SFImage},toStream:function(t){var i=this.array,n=new e;t.string+=this.width+" "+this.height+" "+this.comp;for(var r=0,s=this.width*this.height;r<s;++r)t.string+=" 0x",n.set(i[r]),n.toXMLStream(t)},toVRMLStream:function(t){this.toStream(t)},toXMLStream:function(t){this.toStream(t)}});var s={get:function(){return this.getValue().getWidth()},set:function(t){this.getValue().setWidth(t),this.addEvent()},enumerable:!0,configurable:!1},o={get:function(){return this.getValue().getHeight()},set:function(t){this.getValue().setHeight(t),this.addEvent()},enumerable:!0,configurable:!1},a={get:function(){return this.getValue().getComp()},set:function(t){this.getValue().setComp(t),this.addEvent()},enumerable:!0,configurable:!1},u={get:function(){return this.getValue().getArray()},set:function(t){this.getValue().setArray(t),this.addEvent()},enumerable:!0,configurable:!1};return Object.defineProperty(r.prototype,"width",s),Object.defineProperty(r.prototype,"height",o),Object.defineProperty(r.prototype,"comp",a),Object.defineProperty(r.prototype,"array",u),s.enumerable=!1,o.enumerable=!1,Object.defineProperty(r.prototype,"x",s),Object.defineProperty(r.prototype,"y",o),r}),define("x_ite/Fields/SFMatrixPrototypeTemplate",["x_ite/Basic/X3DField"],function(t){"use strict";return function(e,i){return Object.assign(Object.create(t.prototype),{copy:function(){return new this.constructor(this.getValue().copy())},equals:function(t){return this.getValue().equals(t.getValue())},isDefaultValue:function(){return this.getValue().equals(e.Identity)},set:function(t){this.getValue().assign(t)},setTransform:function(t,e,i,n,r){t=t?t.getValue():null,e=e?e.getValue():null,i=i?i.getValue():null,n=n?n.getValue():null,r=r?r.getValue():null,this.getValue().set(t,e,i,n,r)},getTransform:function(t,e,i,n,r){t=t?t.getValue():null,e=e?e.getValue():null,i=i?i.getValue():null,n=n?n.getValue():null,r=r?r.getValue():null,this.getValue().get(t,e,i,n,r)},determinant:function(){return this.getValue().determinant()},transpose:function(){return new this.constructor(e.transpose(this.getValue()))},inverse:function(){return new this.constructor(e.inverse(this.getValue()))},multLeft:function(t){return new this.constructor(e.multLeft(this.getValue(),t.getValue()))},multRight:function(t){return new this.constructor(e.multRight(this.getValue(),t.getValue()))},multVecMatrix:function(t){return new i(this.getValue().multVecMatrix(t.getValue().copy()))},multMatrixVec:function(t){return new i(this.getValue().multMatrixVec(t.getValue().copy()))},multDirMatrix:function(t){return new i(this.getValue().multDirMatrix(t.getValue().copy()))},multMatrixDir:function(t){return new i(this.getValue().multMatrixDir(t.getValue().copy()))},toStream:function(t){t.string+=this.getValue().toString()},toVRMLStream:function(t){this.toStream(t)},toXMLStream:function(t){this.toStream(t)}})}}),define("x_ite/Fields/SFVecPrototypeTemplate",["x_ite/Basic/X3DField","x_ite/InputOutput/Generator"],function(t,e){"use strict";return function(i){return Object.assign(Object.create(t.prototype),{copy:function(){return new this.constructor(this.getValue().copy())},equals:function(t){return this.getValue().equals(t.getValue())},isDefaultValue:function(){return this.getValue().equals(i.Zero)},set:function(t){this.getValue().assign(t)},add:function(t){return new this.constructor(i.add(this.getValue(),t.getValue()))},distance:function(t){return this.getValue().distance(t.getValue())},divide:function(t){return new this.constructor(i.divide(this.getValue(),t))},divVec:function(t){return new this.constructor(i.divVec(this.getValue(),t.getValue()))},dot:function(t){return this.getValue().dot(t.getValue())},length:function(){return this.getValue().abs()},lerp:function(t,e){return new this.constructor(i.lerp(this.getValue(),t,e))},multiply:function(t){return new this.constructor(i.multiply(this.getValue(),t))},multVec:function(t){return new this.constructor(i.multVec(this.getValue(),t.getValue()))},negate:function(){return new this.constructor(i.negate(this.getValue().copy()))},normalize:function(t){return new this.constructor(i.normalize(this.getValue()))},subtract:function(t){return new this.constructor(i.subtract(this.getValue(),t.getValue()))},toStream:function(t){for(var i=e.Get(t),n=this.getValue(),r=i.Unit(this.getUnit()),s=0,o=n.length-1;s<o;++s)t.string+=String(i.ToUnit(r,n[s])),t.string+=" ";t.string+=String(i.ToUnit(r,n[s]))},toVRMLStream:function(t){this.toStream(t)},toXMLStream:function(t){this.toStream(t)}})}}),define("standard/Math/Numbers/Vector2",["standard/Math/Algorithm"],function(t){"use strict";function e(t,e){this.x=t,this.y=e}return e.prototype={constructor:e,length:2,copy:function(){const t=Object.create(e.prototype);return t.x=this.x,t.y=this.y,t},assign:function(t){return this.x=t.x,this.y=t.y,this},set:function(t,e){return this.x=t,this.y=e,this},equals:function(t){return this.x===t.x&&this.y===t.y},negate:function(){return this.x=-this.x,this.y=-this.y,this},add:function(t){return this.x+=t.x,this.y+=t.y,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this},multiply:function(t){return this.x*=t,this.y*=t,this},multVec:function(t){return this.x*=t.x,this.y*=t.y,this},divide:function(t){return this.x/=t,this.y/=t,this},divVec:function(t){return this.x/=t.x,this.y/=t.y,this},normalize:function(){let t=Math.hypot(this.x,this.y);return t&&(t=1/t,this.x*=t,this.y*=t),this},dot:function(t){return this.x*t.x+this.y*t.y},norm:function(){const t=this.x,e=this.y;return t*t+e*e},abs:function(){return Math.hypot(this.x,this.y)},distance:function(t){return Math.hypot(this.x-t.x,this.y-t.y)},lerp:function(t,e){const i=this.x,n=this.y;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this},min:function(t){let e=this.x,i=this.y;for(const t of arguments)e=Math.min(e,t.x),i=Math.min(i,t.y);return this.x=e,this.y=i,this},max:function(t){let e=this.x,i=this.y;for(const t of arguments)e=Math.max(e,t.x),i=Math.max(i,t.y);return this.x=e,this.y=i,this},toString:function(){return this.x+" "+this.y}},Object.defineProperty(e.prototype,"0",{get:function(){return this.x},set:function(t){this.x=t},enumerable:!1,configurable:!1}),Object.defineProperty(e.prototype,"1",{get:function(){return this.y},set:function(t){this.y=t},enumerable:!1,configurable:!1}),Object.assign(e,{Zero:new e(0,0),One:new e(1,1),negate:function(t){return t.copy().negate()},add:function(t,e){return t.copy().add(e)},subtract:function(t,e){return t.copy().subtract(e)},multiply:function(t,e){return t.copy().multiply(e)},multVec:function(t,e){return t.copy().multVec(e)},divide:function(t,e){return t.copy().divide(e)},divVec:function(t,e){return t.copy().divVec(e)},normalize:function(t){return t.copy().normalize()},dot:function(t,e){return t.copy().dot(e)},lerp:function(t,e,i){return t.copy().lerp(e,i)},min:function(t,i){return e.prototype.min.apply(t.copy(),arguments)},max:function(t,i){return e.prototype.max.apply(t.copy(),arguments)}}),e}),define("x_ite/Fields/SFVec2",["x_ite/Basic/X3DField","x_ite/Fields/SFVecPrototypeTemplate","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector2"],function(t,e,i,n){"use strict";function r(i,r){function s(e,i){switch(arguments.length){case 0:return t.call(this,new n(0,0));case 1:return t.call(this,arguments[0]);case 2:return t.call(this,new n(1*e,1*i))}throw new Error("Invalid arguments.")}s.prototype=Object.assign(Object.create(t.prototype),e(n),{constructor:s,getTypeName:function(){return i},getType:function(){return r}});var o={get:function(){return this.getValue().x},set:function(t){this.getValue().x=1*t,this.addEvent()},enumerable:!0,configurable:!1},a={get:function(){return this.getValue().y},set:function(t){this.getValue().y=1*t,this.addEvent()},enumerable:!0,configurable:!1};return Object.defineProperty(s.prototype,"x",o),Object.defineProperty(s.prototype,"y",a),o.enumerable=!1,a.enumerable=!1,Object.defineProperty(s.prototype,"0",o),Object.defineProperty(s.prototype,"1",a),s}return{SFVec2d:r("SFVec2d",i.SFVec2d),SFVec2f:r("SFVec2f",i.SFVec2f)}}),define("standard/Math/Numbers/Vector3",["standard/Math/Algorithm"],function(t){"use strict";function e(t,e,i){this.x=t,this.y=e,this.z=i}return e.prototype={constructor:e,length:3,copy:function(){const t=Object.create(e.prototype);return t.x=this.x,t.y=this.y,t.z=this.z,t},assign:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this},set:function(t,e,i){return this.x=t,this.y=e,this.z=i,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this},multiply:function(t){return this.x*=t,this.y*=t,this.z*=t,this},multVec:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this},divide:function(t){return this.x/=t,this.y/=t,this.z/=t,this},divVec:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this},cross:function(t){const e=this.x,i=this.y,n=this.z;return this.x=i*t.z-n*t.y,this.y=n*t.x-e*t.z,this.z=e*t.y-i*t.x,this},normalize:function(){let t=Math.hypot(this.x,this.y,this.z);return t&&(t=1/t,this.x*=t,this.y*=t,this.z*=t),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z},norm:function(){let t=this.x,e=this.y,i=this.z;return t*t+e*e+i*i},abs:function(){return Math.hypot(this.x,this.y,this.z)},distance:function(t){return Math.hypot(this.x-t.x,this.y-t.y,this.z-t.z)},lerp:function(t,e){const i=this.x,n=this.y,r=this.z;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=r+e*(t.z-r),this},slerp:function(){const i=new e(0,0,0);return function(e,n){return t.simpleSlerp(this,i.assign(e),n)}}(),min:function(t){let e=this.x,i=this.y,n=this.z;for(const t of arguments)e=Math.min(e,t.x),i=Math.min(i,t.y),n=Math.min(n,t.z);return this.x=e,this.y=i,this.z=n,this},max:function(t){let e=this.x,i=this.y,n=this.z;for(const t of arguments)e=Math.max(e,t.x),i=Math.max(i,t.y),n=Math.max(n,t.z);return this.x=e,this.y=i,this.z=n,this},toString:function(){return this.x+" "+this.y+" "+this.z}},Object.defineProperty(e.prototype,"0",{get:function(){return this.x},set:function(t){this.x=t},enumerable:!1,configurable:!1}),Object.defineProperty(e.prototype,"1",{get:function(){return this.y},set:function(t){this.y=t},enumerable:!1,configurable:!1}),Object.defineProperty(e.prototype,"2",{get:function(){return this.z},set:function(t){this.z=t},enumerable:!1,configurable:!1}),Object.assign(e,{Zero:new e(0,0,0),One:new e(1,1,1),xAxis:new e(1,0,0),yAxis:new e(0,1,0),zAxis:new e(0,0,1),negate:function(t){return t.copy().negate()},add:function(t,e){return t.copy().add(e)},subtract:function(t,e){return t.copy().subtract(e)},multiply:function(t,e){return t.copy().multiply(e)},multVec:function(t,e){return t.copy().multVec(e)},divide:function(t,e){return t.copy().divide(e)},divVec:function(t,e){return t.copy().divVec(e)},cross:function(t,e){return t.copy().cross(e)},normalize:function(t){return t.copy().normalize()},dot:function(t,e){return t.copy().dot(e)},lerp:function(t,e,i){return t.copy().lerp(e,i)},slerp:function(t,e,i){return t.copy().slerp(e,i)},min:function(t,i){return e.prototype.min.apply(t.copy(),arguments)},max:function(t,i){return e.prototype.max.apply(t.copy(),arguments)}}),e}),define("standard/Math/Numbers/Matrix2",["standard/Math/Numbers/Vector2","standard/Math/Algorithm"],function(t,e){"use strict";function i(){arguments.length?(this[0]=arguments[0],this[1]=arguments[1],this[2]=arguments[2],this[3]=arguments[3]):this.identity()}return i.prototype={constructor:i,order:2,length:4,copy:function(){const t=Object.create(i.prototype);return t[0]=this[0],t[1]=this[1],t[2]=this[2],t[3]=this[3],t},assign:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this},equals:function(t){return this[0]===t[0]&&this[1]===t[1]&&this[2]===t[2]&&this[3]===t[3]},set1:function(t,e,i){this[t*this.order+e]=i},get1:function(t,e){return this[t*this.order+e]},set:function(){switch(arguments.length){case 0:this.identity();break;case 4:this[0]=arguments[0],this[1]=arguments[1],this[2]=arguments[2],this[3]=arguments[3]}},determinant1:function(){return this[0]},determinant:function(){return this[0]*this[3]-this[1]*this[2]},transpose:function(){const t=this[1];return this[1]=this[2],this[2]=t,this},inverse:function(){const t=this[0],e=this[1],i=this[2],n=this[3],r=t*n-e*i;if(0===r)throw new Error("Matrix2 .inverse: determinant is 0.");return this[0]=n/r,this[1]=-e/r,this[2]=-i/r,this[3]=t/r,this},multLeft:function(t){const e=this[0],i=this[1],n=this[2],r=this[3],s=t[0],o=t[1],a=t[2],u=t[3];return this[0]=e*s+n*o,this[1]=i*s+r*o,this[2]=e*a+n*u,this[3]=i*a+r*u,this},multRight:function(t){const e=this[0],i=this[1],n=this[2],r=this[3],s=t[0],o=t[1],a=t[2],u=t[3];return this[0]=s*e+a*i,this[1]=o*e+u*i,this[2]=s*n+a*r,this[3]=o*n+u*r,this},identity:function(){this[0]=1,this[1]=0,this[2]=0,this[3]=1},toString:function(){return this[0]+" "+this[1]+" "+this[2]+" "+this[3]}},Object.defineProperty(i.prototype,"x",{get:function(){const e=new t(0,0);return function(){return e.set(this[0],this[1])}}(),enumerable:!1,configurable:!1}),Object.defineProperty(i.prototype,"xAxis",{get:function(){return this[0]},enumerable:!1,configurable:!1}),Object.defineProperty(i.prototype,"origin",{get:function(){return this[2]},enumerable:!1,configurable:!1}),Object.defineProperty(i.prototype,"submatrix",{get:function(){return this[0]},enumerable:!1,configurable:!1}),Object.assign(i,{Identity:new i}),i}),define("standard/Math/Algorithms/eigendecomposition",[],function(){"use strict";const t=[],e=[],i=[];return function(n,r){const s=n.order,o=r.values,a=r.vectors;let u,l,c,h,d,p,f,g,m,_,x,y,v,w=n.length;for(y=0;y<s;++y)for(t[y]=t[y]||new Array(s),e[y]=o[y]=n.get1(y,y),i[y]=0,v=0;v<s;++v)a[y][v]=y===v?1:0,t[y][v]=n.get1(v,y);for(y=0;y<50;++y){for(u=0,_=0;_<s-1;++_)for(x=_+1;x<s;++x)u+=Math.abs(t[_][x]);if(0===u)break;for(m=y<3?.2*u/w:0,_=0;_<s-1;++_)for(x=_+1;x<s;++x)if(g=100*Math.abs(t[_][x]),y>3&&Math.abs(o[_])+g===Math.abs(o[_])&&Math.abs(o[x])+g===Math.abs(o[x]))t[_][x]=0;else if(Math.abs(t[_][x])>m){for(f=o[x]-o[_],Math.abs(f)+g===Math.abs(f)?d=t[_][x]/f:(l=.5*f/t[_][x],d=1/(Math.abs(l)+Math.sqrt(1+l*l)),l<0&&(d=-d)),c=1/Math.sqrt(1+d*d),h=d*c,p=h/(1+c),f=d*t[_][x],i[_]-=f,i[x]+=f,o[_]-=f,o[x]+=f,t[_][x]=0,v=0;v<_;++v)g=t[v][_],f=t[v][x],t[v][_]=g-h*(f+g*p),t[v][x]=f+h*(g-f*p);for(v=_+1;v<x;++v)g=t[_][v],f=t[v][x],t[_][v]=g-h*(f+g*p),t[v][x]=f+h*(g-f*p);for(v=x+1;v<s;++v)g=t[_][v],f=t[x][v],t[_][v]=g-h*(f+g*p),t[x][v]=f+h*(g-f*p);for(v=0;v<s;++v)g=a[v][_],f=a[v][x],a[v][_]=g-h*(f+g*p),a[v][x]=f+h*(g-f*p)}for(_=0;_<s;++_)o[_]=e[_]+=i[_],i[_]=0}return r}}),define("standard/Math/Numbers/Matrix3",["standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3","standard/Math/Numbers/Matrix2","standard/Math/Algorithms/eigendecomposition"],function(t,e,i,n){"use strict";function r(){arguments.length?(this[0]=arguments[0],this[1]=arguments[1],this[2]=arguments[2],this[3]=arguments[3],this[4]=arguments[4],this[5]=arguments[5],this[6]=arguments[6],this[7]=arguments[7],this[8]=arguments[8]):this.identity()}return r.prototype={constructor:r,order:3,length:9,copy:function(){const t=Object.create(r.prototype);return t[0]=this[0],t[1]=this[1],t[2]=this[2],t[3]=this[3],t[4]=this[4],t[5]=this[5],t[6]=this[6],t[7]=this[7],t[8]=this[8],t},assign:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this},equals:function(t){return this[0]===t[0]&&this[1]===t[1]&&this[2]===t[2]&&this[3]===t[3]&&this[4]===t[4]&&this[5]===t[5]&&this[6]===t[6]&&this[7]===t[7]&&this[8]===t[8]},rotation:function(){return math.atan2(this[1],this[0])},set1:function(t,e,i){return this[t*this.order+e]=i,this},get1:function(t,e){return this[t*this.order+e]},set:function(e,i,n,r,s){switch(arguments.length){case 0:this.identity();break;case 1:null===e&&(e=t.Zero),this.identity(),this.translate(e);break;case 2:null===e&&(e=t.Zero),null===i&&(i=0),this.identity(),this.translate(e),0!==i&&this.rotate(i);break;case 3:null===e&&(e=t.Zero),null===i&&(i=0),null===n&&(n=t.One),this.identity(),this.translate(e),0!==i&&this.rotate(i),n.equals(t.One)||this.scale(n);break;case 4:if(null===e&&(e=t.Zero),null===i&&(i=0),null===n&&(n=t.One),null===r&&(r=0),this.identity(),this.translate(e),0!==i&&this.rotate(i),!n.equals(t.One)){const t=0!==r;t?(this.rotate(r),this.scale(n),this.rotate(-r)):this.scale(n)}break;case 5:{null===e&&(e=t.Zero),null===i&&(i=0),null===n&&(n=t.One),null===r&&(r=0),null===s&&(s=t.Zero),this.identity(),this.translate(e);const o=!s.equals(t.Zero);o&&this.translate(s),0!==i&&this.rotate(i),n.equals(t.One)||(0!==r?(this.rotate(r),this.scale(n),this.rotate(-r)):this.scale(n)),o&&this.translate(t.negate(s));break}case 9:this[0]=arguments[0],this[1]=arguments[1],this[2]=arguments[2],this[3]=arguments[3],this[4]=arguments[4],this[5]=arguments[5],this[6]=arguments[6],this[7]=arguments[7],this[8]=arguments[8]}return this},get:function(){const n=new t(0,0),s=new e(0,0,0),o=new t(0,0),a=new e(0,0,0),u=new t(0,0),l=new i,c=new i,h=new t(0,0);return function(t,e,i,d,p){switch(null===t&&(t=n),null===e&&(e=s),null===i&&(i=o),null===d&&(d=a),null===p&&(p=u),arguments.length){case 1:t.set(this[6],this[7]);break;case 2:this.factor(t,l,o,c),e[0]=l[0],e[1]=l[1],e[2]=Math.atan2(l[1],l[0]);break;case 3:this.factor(t,l,i,c),e[0]=l[0],e[1]=l[1],e[2]=Math.atan2(l[1],l[0]);break;case 4:this.factor(t,l,i,c),e[0]=l[0],e[1]=l[1],e[2]=Math.atan2(l[1],l[0]),d[0]=c[0],d[1]=c[1],d[2]=Math.atan2(c[1],c[0]);break;case 5:{const n=new r;n.set(h.assign(p).negate()),n.multLeft(this),n.translate(p),n.get(t,e,i,d);break}}}}(),factor:function(){const t=new i,e=new i,r=new i,s={values:[],vectors:[[],[]]};return function(i,o,a,u){i.set(this[6],this[7]);const l=this.submatrix,c=l.determinant(),h=c<0?-1:1;if(0===c)throw new Error("Matrix3 .factor: determinant is 0.");r.assign(l).transpose().multLeft(l);const d=n(r,s);u.set(d.vectors[0][0],d.vectors[1][0],d.vectors[0][1],d.vectors[1][1]),a.x=h*Math.sqrt(d.values[0]),a.y=h*Math.sqrt(d.values[1]),t[0]=1/a.x,t[3]=1/a.y,o.assign(e.assign(u).transpose().multRight(t).multRight(u).multRight(l))}}(),determinant2:function(){return this[0]*this[4]-this[1]*this[3]},determinant:function(){const t=this[0],e=this[1],i=this[2],n=this[3],r=this[4],s=this[5],o=this[6],a=this[7],u=this[8];return t*(r*u-s*a)-e*(n*u-s*o)+i*(n*a-r*o)},transpose:function(){let t;return t=this[1],this[1]=this[3],this[3]=t,t=this[2],this[2]=this[6],this[6]=t,t=this[5],this[5]=this[7],this[7]=t,this},inverse:function(){const t=this[0],e=this[1],i=this[2],n=this[3],r=this[4],s=this[5],o=this[6],a=this[7],u=this[8],l=t*r,c=t*a,h=n*e,d=n*a,p=o*e,f=o*r;let g=l*u-c*s-h*u+d*i+p*s-f*i;if(0===g)throw new Error("Matrix3 .inverse: determinant is 0.");g=1/g;const m=(r*u-a*s)*g,_=-(e*u-a*i)*g,x=(e*s-r*i)*g,y=-(n*u-o*s)*g,v=(t*u-o*i)*g,w=-(t*s-n*i)*g;return this[0]=m,this[1]=_,this[2]=x,this[3]=y,this[4]=v,this[5]=w,this[6]=(d-f)*g,this[7]=-(c-p)*g,this[8]=(l-h)*g,this},multLeft:function(t){const e=this[0],i=this[1],n=this[2],r=this[3],s=this[4],o=this[5],a=this[6],u=this[7],l=this[8],c=t[0],h=t[1],d=t[2],p=t[3],f=t[4],g=t[5],m=t[6],_=t[7],x=t[8];return this[0]=e*c+r*h+a*d,this[1]=i*c+s*h+u*d,this[2]=n*c+o*h+l*d,this[3]=e*p+r*f+a*g,this[4]=i*p+s*f+u*g,this[5]=n*p+o*f+l*g,this[6]=e*m+r*_+a*x,this[7]=i*m+s*_+u*x,this[8]=n*m+o*_+l*x,this},multRight:function(t){const e=this[0],i=this[1],n=this[2],r=this[3],s=this[4],o=this[5],a=this[6],u=this[7],l=this[8],c=t[0],h=t[1],d=t[2],p=t[3],f=t[4],g=t[5],m=t[6],_=t[7],x=t[8];return this[0]=e*c+i*p+n*m,this[1]=e*h+i*f+n*_,this[2]=e*d+i*g+n*x,this[3]=r*c+s*p+o*m,this[4]=r*h+s*f+o*_,this[5]=r*d+s*g+o*x,this[6]=a*c+u*p+l*m,this[7]=a*h+u*f+l*_,this[8]=a*d+u*g+l*x,this},multVecMatrix:function(t){if(2===t.length){const e=t.x,i=t.y,n=e*this[2]+i*this[5]+this[8];return t.x=(e*this[0]+i*this[3]+this[6])/n,t.y=(e*this[1]+i*this[4]+this[7])/n,t}const e=t.x,i=t.y,n=t.z;return t.x=e*this[0]+i*this[3]+n*this[6],t.y=e*this[1]+i*this[4]+n*this[7],t.z=e*this[2]+i*this[5]+n*this[8],t},multMatrixVec:function(t){if(2===t.length){const e=t.x,i=t.y,n=e*this[6]+i*this[7]+this[8];return t.x=(e*this[0]+i*this[1]+this[2])/n,t.y=(e*this[3]+i*this[4]+this[5])/n,t}const e=t.x,i=t.y,n=t.z;return t.x=e*this[0]+i*this[1]+n*this[2],t.y=e*this[3]+i*this[4]+n*this[5],t.z=e*this[6]+i*this[7]+n*this[8],t},multDirMatrix:function(t){const e=t.x,i=t.y;return t.x=e*this[0]+i*this[3],t.y=e*this[1]+i*this[4],t},multMatrixDir:function(t){const e=t.x,i=t.y;return t.x=e*this[0]+i*this[1],t.y=e*this[3]+i*this[4],t},identity:function(){this[0]=1,this[1]=0,this[2]=0,this[3]=0,this[4]=1,this[5]=0,this[6]=0,this[7]=0,this[8]=1},translate:function(t){const e=t.x,i=t.y;return this[6]+=this[0]*e+this[3]*i,this[7]+=this[1]*e+this[4]*i,this},rotate:function(t){return this.multLeft(r.Rotation(t)),this},scale:function(t){const e=t.x,i=t.y;return this[0]*=e,this[3]*=i,this[1]*=e,this[4]*=i,this},toString:function(){return this[0]+" "+this[1]+" "+this[2]+" "+this[3]+" "+this[4]+" "+this[5]+" "+this[6]+" "+this[7]+" "+this[8]}},Object.defineProperty(r.prototype,"x",{get:function(){const t=new e(0,0,0);return function(){return t.set(this[0],this[1],this[2])}}(),enumerable:!1,configurable:!1}),Object.defineProperty(r.prototype,"y",{get:function(){const t=new e(0,0,0);return function(){return t.set(this[3],this[4],this[5])}}(),enumerable:!1,configurable:!1}),Object.defineProperty(r.prototype,"xAxis",{get:function(){const e=new t(0,0);return function(){return e.set(this[0],this[1])}}(),enumerable:!1,configurable:!1}),Object.defineProperty(r.prototype,"yAxis",{get:function(){const e=new t(0,0);return function(){return e.set(this[3],this[4])}}(),enumerable:!1,configurable:!1}),Object.defineProperty(r.prototype,"origin",{get:function(){const e=new t(0,0);return function(){return e.set(this[6],this[7])}}(),enumerable:!1,configurable:!1}),Object.defineProperty(r.prototype,"submatrix",{get:function(){const t=new i;return function(){return t[0]=this[0],t[1]=this[1],t[2]=this[3],t[3]=this[4],t}}(),enumerable:!1,configurable:!1}),Object.assign(r,{Identity:new r,Rotation:function(t){const e=Math.sin(t),i=Math.cos(t);return new r(i,e,0,-e,i,0,0,0,1)},Matrix2:function(t){return new r(t[0],t[1],0,t[2],t[3],0,0,0,1)},transpose:function(t){return t.copy().transpose()},inverse:function(t){return t.copy().inverse()},multLeft:function(t,e){return t.copy().multLeft(e)},multRight:function(t,e){return t.copy().multRight(e)}}),r}),define("x_ite/Fields/SFMatrix3",["x_ite/Basic/X3DField","x_ite/Fields/SFMatrixPrototypeTemplate","x_ite/Fields/SFVec2","x_ite/Bits/X3DConstants","standard/Math/Numbers/Matrix3"],function(t,e,i,n,r){"use strict";function s(i,n,s){function o(e,i,n,s,o,a,u,l,c){switch(arguments.length){case 0:return t.call(this,new r);case 1:return t.call(this,arguments[0]);case 9:return t.call(this,new r(1*e,1*i,1*n,1*s,1*o,1*a,1*u,1*l,1*c))}throw new Error("Invalid arguments.")}o.prototype=Object.assign(Object.create(t.prototype),e(r,s),{constructor:o,getTypeName:function(){return i},getType:function(){return n},setTransform:function(t,e,i,n,r){t=t?t.getValue():null,e=e?e:0,i=i?i.getValue():null,n=n?n:0,r=r?r.getValue():null,this.getValue().set(t,e,i,n,r)}});for(var a=0;a<r.prototype.length;++a)!function(t){Object.defineProperty(o.prototype,t,{get:function(){return this.getValue()[t]},set:function(e){this.getValue()[t]=1*e,this.addEvent()},enumerable:!1,configurable:!1})}(a);return o}return{SFMatrix3d:s("SFMatrix3d",n.SFMatrix3d,i.SFVec2d),SFMatrix3f:s("SFMatrix3f",n.SFMatrix3f,i.SFVec2f)}}),
|
|
8
8
|
define("x_ite/Fields/SFVec3",["x_ite/Basic/X3DField","x_ite/Fields/SFVecPrototypeTemplate","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(t,e,i,n){"use strict";function r(i,r){function s(e,i,r){switch(arguments.length){case 0:return t.call(this,new n(0,0,0));case 1:return t.call(this,arguments[0]);case 3:return t.call(this,new n(1*e,1*i,1*r))}throw new Error("Invalid arguments.")}s.prototype=Object.assign(Object.create(t.prototype),e(n),{constructor:s,getTypeName:function(){return i},getType:function(){return r},cross:function(t){return new this.constructor(n.cross(this.getValue(),t.getValue()))}});var o={get:function(){return this.getValue().x},set:function(t){this.getValue().x=1*t,this.addEvent()},enumerable:!0,configurable:!1},a={get:function(){return this.getValue().y},set:function(t){this.getValue().y=1*t,this.addEvent()},enumerable:!0,configurable:!1},u={get:function(){return this.getValue().z},set:function(t){this.getValue().z=1*t,this.addEvent()},enumerable:!0,configurable:!1};return Object.defineProperty(s.prototype,"x",o),Object.defineProperty(s.prototype,"y",a),Object.defineProperty(s.prototype,"z",u),o.enumerable=!1,a.enumerable=!1,u.enumerable=!1,Object.defineProperty(s.prototype,"0",o),Object.defineProperty(s.prototype,"1",a),Object.defineProperty(s.prototype,"2",u),s}return{SFVec3d:r("SFVec3d",i.SFVec3d),SFVec3f:r("SFVec3f",i.SFVec3f)}}),define("standard/Math/Numbers/Vector4",["standard/Math/Algorithm"],function(t){"use strict";function e(t,e,i,n){this.x=t,this.y=e,this.z=i,this.w=n}return e.prototype={constructor:e,length:4,copy:function(){const t=Object.create(e.prototype);return t.x=this.x,t.y=this.y,t.z=this.z,t.w=this.w,t},assign:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},set:function(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,this},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},getReal:function(t){t.x=this.x/this.w,t.y=this.y/this.w,t.z=this.z/this.w},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this},multiply:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},multVec:function(t){return this.x*=t.x,this.y*=t.y,this.z*=t.z,this.w*=t.w,this},divide:function(t){return this.x/=t,this.y/=t,this.z/=t,this.w/=t,this},divVec:function(t){return this.x/=t.x,this.y/=t.y,this.z/=t.z,this.w/=t.w,this},normalize:function(){let t=Math.hypot(this.x,this.y,this.z,this.w);return t&&(t=1/t,this.x*=t,this.y*=t,this.z*=t,this.w*=t),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},norm:function(){const t=this.x,e=this.y,i=this.z,n=this.w;return t*t+e*e+i*i+n*n},abs:function(){return Math.hypot(this.x,this.y,this.z,this.w)},distance:function(t){return Math.hypot(this.x-t.x,this.y-t.y,this.z-t.z,this.w-t.w)},lerp:function(t,e){const i=this.x,n=this.y,r=this.z,s=this.w;return this.x=i+e*(t.x-i),this.y=n+e*(t.y-n),this.z=r+e*(t.z-r),this.w=s+e*(t.w-s),this},min:function(t){let e=this.x,i=this.y,n=this.z,r=this.w;for(const t of arguments)e=Math.min(e,t.x),i=Math.min(i,t.y),n=Math.min(n,t.z),r=Math.min(r,t.w);return this.x=e,this.y=i,this.z=n,this.w=r,this},max:function(t){let e=this.x,i=this.y,n=this.z,r=this.w;for(const t of arguments)e=Math.max(e,t.x),i=Math.max(i,t.y),n=Math.max(n,t.z),r=Math.max(r,t.w);return this.x=e,this.y=i,this.z=n,this.w=r,this},toString:function(){return this.x+" "+this.y+" "+this.z+" "+this.w}},Object.defineProperty(e.prototype,"0",{get:function(){return this.x},set:function(t){this.x=t},enumerable:!1,configurable:!1}),Object.defineProperty(e.prototype,"1",{get:function(){return this.y},set:function(t){this.y=t},enumerable:!1,configurable:!1}),Object.defineProperty(e.prototype,"2",{get:function(){return this.z},set:function(t){this.z=t},enumerable:!1,configurable:!1}),Object.defineProperty(e.prototype,"3",{get:function(){return this.w},set:function(t){this.w=t},enumerable:!1,configurable:!1}),Object.assign(e,{Zero:new e(0,0,0,0),One:new e(1,1,1,1),xAxis:new e(1,0,0,0),yAxis:new e(0,1,0,0),zAxis:new e(0,0,1,0),wAxis:new e(0,0,0,1),negate:function(t){return t.copy().negate()},add:function(t,e){return t.copy().add(e)},subtract:function(t,e){return t.copy().subtract(e)},multiply:function(t,e){return t.copy().multiply(e)},multVec:function(t,e){return t.copy().multVec(e)},divide:function(t,e){return t.copy().divide(e)},divVec:function(t,e){return t.copy().divVec(e)},normalize:function(t){return t.copy().normalize()},dot:function(t,e){return t.copy().dot(e)},lerp:function(t,e,i){return t.copy().lerp(e,i)},min:function(t,i){return e.prototype.min.apply(t.copy(),arguments)},max:function(t,i){return e.prototype.max.apply(t.copy(),arguments)}}),e}),define("standard/Math/Numbers/Quaternion",["standard/Math/Numbers/Vector3","standard/Math/Algorithm"],function(t,i){"use strict";function n(t,e,i,n){this.x=t,this.y=e,this.z=i,this.w=n}n.prototype={constructor:n,length:4,copy:function(){const t=Object.create(n.prototype);return t.x=this.x,t.y=this.y,t.z=this.z,t.w=this.w,t},assign:function(t){return this.x=t.x,this.y=t.y,this.z=t.z,this.w=t.w,this},set:function(t,e,i,n){return this.x=t,this.y=e,this.z=i,this.w=n,this},setMatrix:function(t){let e;e=t[0]>t[4]?t[0]>t[8]?0:2:t[4]>t[8]?1:2;const i=t[0]+t[4]+t[8];if(i>t[3*e+e]){this[3]=Math.sqrt(i+1)/2;const e=4*this[3];this[0]=(t[5]-t[7])/e,this[1]=(t[6]-t[2])/e,this[2]=(t[1]-t[3])/e}else{const i=(e+1)%3,n=(e+2)%3;this[e]=Math.sqrt(t[3*e+e]-t[3*i+i]-t[3*n+n]+1)/2;const r=4*this[e];this[i]=(t[3*e+i]+t[3*i+e])/r,this[n]=(t[3*e+n]+t[3*n+e])/r,this[3]=(t[3*i+n]-t[3*n+i])/r}return this},getMatrix:function(t){const e=this.x,i=this.y,n=this.z,r=this.w,s=e*e,o=e*i,a=i*i,u=i*n,l=n*e,c=n*n,h=r*e,d=r*i,p=r*n;return t[0]=1-2*(a+c),t[1]=2*(o+p),t[2]=2*(l-d),t[3]=2*(o-p),t[4]=1-2*(c+s),t[5]=2*(u+h),t[6]=2*(l+d),t[7]=2*(u-h),t[8]=1-2*(a+s),t},isReal:function(){return!(this.x||this.y||this.z)},isImag:function(){return!this.w},equals:function(t){return this.x===t.x&&this.y===t.y&&this.z===t.z&&this.w===t.w},negate:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this},inverse:function(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this},add:function(t){return this.x+=t.x,this.y+=t.y,this.z+=t.z,this.w+=t.w,this},subtract:function(t){return this.x-=t.x,this.y-=t.y,this.z-=t.z,this.w-=t.w,this},multiply:function(t){return this.x*=t,this.y*=t,this.z*=t,this.w*=t,this},multLeft:function(t){const e=this.x,i=this.y,n=this.z,r=this.w,s=t.x,o=t.y,a=t.z,u=t.w;return this.x=r*s+e*u+i*a-n*o,this.y=r*o+i*u+n*s-e*a,this.z=r*a+n*u+e*o-i*s,this.w=r*u-e*s-i*o-n*a,this},multRight:function(t){const e=this.x,i=this.y,n=this.z,r=this.w,s=t.x,o=t.y,a=t.z,u=t.w;return this.x=u*e+s*r+o*n-a*i,this.y=u*i+o*r+a*e-s*n,this.z=u*n+a*r+s*i-o*e,this.w=u*r-s*e-o*i-a*n,this},divide:function(t){return this.x/=t,this.y/=t,this.z/=t,this.w/=t,this},multVecQuat:function(t){const e=this.x,i=this.y,n=this.z,r=this.w,s=t.x,o=t.y,a=t.z,u=r*r-e*e-i*i-n*n,l=2*(s*e+o*i+a*n),c=2*r;return t.x=u*s+l*e+c*(i*a-n*o),t.y=u*o+l*i+c*(n*s-e*a),t.z=u*a+l*n+c*(e*o-i*s),t},multQuatVec:function(t){const e=this.x,i=this.y,n=this.z,r=this.w,s=t.x,o=t.y,a=t.z,u=r*r-e*e-i*i-n*n,l=2*(s*e+o*i+a*n),c=2*r;return t.x=u*s+l*e-c*(i*a-n*o),t.y=u*o+l*i-c*(n*s-e*a),t.z=u*a+l*n-c*(e*o-i*s),t},normalize:function(){let t=Math.hypot(this.x,this.y,this.z,this.w);return t&&(t=1/t,this.x*=t,this.y*=t,this.z*=t,this.w*=t),this},dot:function(t){return this.x*t.x+this.y*t.y+this.z*t.z+this.w*t.w},norm:function(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w},abs:function(){return Math.hypot(this.x,this.y,this.z,this.w)},pow:function(t){if(t instanceof n)return this.assign(e.assign(t).multRight(this.log()).exp());if(this.isReal())return this.set(0,0,0,Math.pow(this.w,t));const i=this.abs(),r=Math.acos(this.w/i),s=this.imag.abs(),o=Math.pow(i,t),a=t*r,u=o/s*Math.sin(a);return this.x*=u,this.y*=u,this.z*=u,this.w=o*Math.cos(a),this},log:function(){if(this.isReal())return this.w>0?this.set(0,0,0,Math.log(this.w)):this.set(Math.PI,0,0,Math.log(-this.w));const t=this.abs(),e=this.imag.normalize().multiply(Math.acos(this.w/t)),i=Math.log(t);return this.x=e.x,this.y=e.y,this.z=e.z,this.w=i,this},exp:function(){if(this.isReal())return this.set(0,0,0,Math.exp(this.w));const t=this.imag,e=t.abs(),i=Math.exp(this.w),n=i*Math.cos(e),r=t.multiply(i*Math.sin(e)/e);return this.x=r.x,this.y=r.y,this.z=r.z,this.w=n,this},slerp:function(t,e){return i.slerp(this,r.assign(t),e)},squad:function(t,e,n,a){return i.slerp(i.slerp(this,r.assign(n),a),i.slerp(s.assign(t),o.assign(e),a),2*a*(1-a))},toString:function(){return this.x+" "+this.y+" "+this.z+" "+this.w}},Object.defineProperty(n.prototype,"0",{get:function(){return this.x},set:function(t){this.x=t},enumerable:!1,configurable:!1}),Object.defineProperty(n.prototype,"1",{get:function(){return this.y},set:function(t){this.y=t},enumerable:!1,configurable:!1}),Object.defineProperty(n.prototype,"2",{get:function(){return this.z},set:function(t){this.z=t},enumerable:!1,configurable:!1}),Object.defineProperty(n.prototype,"3",{get:function(){return this.w},set:function(t){this.w=t},enumerable:!1,configurable:!1}),Object.defineProperty(n.prototype,"real",{get:function(){return this.w},enumerable:!1,configurable:!1}),Object.defineProperty(n.prototype,"imag",{get:function(){const e=new t(0,0,0);return function(){return e.set(this.x,this.y,this.z)}}(),enumerable:!1,configurable:!1}),Object.assign(n,{negate:function(t){return t.copy().negate()},inverse:function(t){return t.copy().inverse()},add:function(t,e){return t.copy().add(e)},subtract:function(t,e){return t.copy().subtract(e)},multiply:function(t,e){return t.copy().multiply(e)},multLeft:function(t,e){return t.copy().multLeft(e)},multRight:function(t,e){return t.copy().multRight(e)},divide:function(t,e){return t.copy().divide(e)},normalize:function(t){return t.copy().normalize()},slerp:function(t,e,i){return t.copy().slerp(e,i)},squad:function(t,e,i,n,r){return t.copy().squad(e,i,n,r)},spline:function(t,e,i){return a.assign(t),u.assign(e),l.assign(i),a.dot(u)<0&&a.negate(),l.dot(u)<0&&l.negate(),c.assign(u).inverse(),u.multRight(r.assign(c).multRight(a).log().add(s.assign(c).multRight(l).log()).divide(-4).exp()).normalize().copy()}});const r=new n(0,0,0,1),s=new n(0,0,0,1),o=new n(0,0,0,1),a=new n(0,0,0,1),u=new n(0,0,0,1),l=new n(0,0,0,1),c=new n(0,0,0,1);return n}),define("standard/Math/Numbers/Rotation4",["standard/Math/Numbers/Quaternion","standard/Math/Numbers/Vector3","standard/Math/Numbers/Vector4","standard/Math/Algorithm"],function(t,e,i,n){"use strict";function r(i,n,r,s){switch(this.x_=0,this.y_=0,this.z_=1,this.angle_=0,arguments.length){case 0:return void(this.value=new t(0,0,0,1));case 1:return this.value=arguments[0],void this.update();case 2:{const i=arguments[0],n=arguments[1];return this.value=new t(0,0,0,1),n instanceof e?this.setFromToVec(i,n):void this.set(i.x,i.y,i.z,n)}case 4:return this.value=new t(0,0,0,1),void this.set(i,n,r,s)}}r.prototype={constructor:r,length:4,update:function(){const t=this.get();return this.x_=t.x,this.y_=t.y,this.z_=t.z,this.angle_=t.w,this},copy:function(){const t=Object.create(r.prototype);return t.x_=this.x_,t.y_=this.y_,t.z_=this.z_,t.angle_=this.angle_,t.value=this.value.copy(),t},assign:function(t){return this.x_=t.x_,this.y_=t.y_,this.z_=t.z_,this.angle_=t.angle_,this.value.assign(t.value),this},set:function(t,e,i,r){this.x_=t,this.y_=e,this.z_=i,this.angle_=r;const s=Math.hypot(t,e,i);if(0===s)return this.value.set(0,0,0,1),this;const o=n.interval(r/2,0,Math.PI),a=Math.sin(o)/s;return this.value.set(t*a,e*a,i*a,Math.cos(o)),this},get:function(){const t=new i(0,0,0,0);return function(){const e=this.value;if(Math.abs(e.w)>1)return i.zAxis;{const n=2*Math.acos(e.w),r=Math.sin(n/2);if(0===r)return i.zAxis;{const i=e.imag.divide(r);return t.set(i.x,i.y,i.z,n)}}}}(),setAxisAngle:function(t,e){return this.set(t.x,t.y,t.z,e)},setFromToVec:function(){const t=new e(0,0,0),i=new e(0,0,0),r=new e(0,0,0),s=new e(0,0,0);return function(o,a){t.assign(o).normalize(),i.assign(a).normalize();const u=n.clamp(t.dot(i),-1,1),l=r.assign(t).cross(i).normalize();return 0===l.abs()?u>0?this.value.set(0,0,0,1):(s.assign(t).cross(e.xAxis),0===s.norm()&&s.assign(t).cross(e.yAxis),s.normalize(),this.value.set(s.x,s.y,s.z,0)):(l.multiply(Math.sqrt(Math.abs(1-u)/2)),this.value.set(l.x,l.y,l.z,Math.sqrt(Math.abs(1+u)/2))),this.update(),this}}(),setAxis:function(t){this.set(t.x,t.y,t.z,this.angle_)},getAxis:function(){const t=new e(0,0,0);return function(){return t.set(this.x_,this.y_,this.z_)}}(),setMatrix:function(t){return this.value.setMatrix(t).normalize(),this.update(),this},getMatrix:function(t){return this.value.getMatrix(t)},equals:function(t){return this.value.equals(t.value)},inverse:function(){return this.value.inverse(),this.update(),this},multLeft:function(t){return this.value.multLeft(t.value).normalize(),this.update(),this},multRight:function(t){return this.value.multRight(t.value).normalize(),this.update(),this},multVecRot:function(t){return this.value.multVecQuat(t)},multRotVec:function(t){return this.value.multQuatVec(t)},normalize:function(){return this.value.normalize(),this.update(),this},pow:function(t){return this.value.pow(t),this.update(),this},slerp:function(t,e){return this.value.slerp(t.value,e),this.update(),this},squad:function(t,e,i,n){return this.value.squad(t.value,e.value,i.value,n),this.update(),this},toString:function(){return this.x_+" "+this.y_+" "+this.z_+" "+this.angle_}};const s={get:function(){return this.x_},set:function(t){this.x_=t,this.set(t,this.y_,this.z_,this.angle_)},enumerable:!0,configurable:!1},o={get:function(){return this.y_},set:function(t){this.y_=t,this.set(this.x_,t,this.z_,this.angle_)},enumerable:!0,configurable:!1},a={get:function(){return this.z_},set:function(t){this.z_=t,this.set(this.x_,this.y_,t,this.angle_)},enumerable:!0,configurable:!1},u={get:function(){return this.angle_},set:function(t){this.angle_=t,this.set(this.x_,this.y_,this.z_,t)},enumerable:!0,configurable:!1};return Object.defineProperty(r.prototype,"x",s),Object.defineProperty(r.prototype,"y",o),Object.defineProperty(r.prototype,"z",a),Object.defineProperty(r.prototype,"angle",u),s.enumerable=!1,o.enumerable=!1,a.enumerable=!1,u.enumerable=!1,Object.defineProperty(r.prototype,"0",s),Object.defineProperty(r.prototype,"1",o),Object.defineProperty(r.prototype,"2",a),Object.defineProperty(r.prototype,"3",u),Object.assign(r,{Identity:new r,inverse:function(t){return t.copy().inverse()},multRight:function(t,e){return t.copy().multRight(e)},normalize:function(t){return t.copy().normalize()},slerp:function(t,e,i){return t.copy().slerp(e,i)},squad:function(t,e,i,n,r){return t.copy().squad(e,i,n,r)},spline:function(e,i,n){const r=Object.create(this.prototype);return r.value=t.spline(e.value,i.value,n.value),r.update(),r}}),r}),define("standard/Math/Numbers/Matrix4",["standard/Math/Numbers/Vector3","standard/Math/Numbers/Vector4","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix3","standard/Math/Algorithms/eigendecomposition"],function(t,e,i,n,r){"use strict";function s(){arguments.length?(this[0]=arguments[0],this[1]=arguments[1],this[2]=arguments[2],this[3]=arguments[3],this[4]=arguments[4],this[5]=arguments[5],this[6]=arguments[6],this[7]=arguments[7],this[8]=arguments[8],this[9]=arguments[9],this[10]=arguments[10],this[11]=arguments[11],this[12]=arguments[12],this[13]=arguments[13],this[14]=arguments[14],this[15]=arguments[15]):this.identity()}s.prototype={constructor:s,order:4,length:16,copy:function(){const t=Object.create(s.prototype);return t[0]=this[0],t[1]=this[1],t[2]=this[2],t[3]=this[3],t[4]=this[4],t[5]=this[5],t[6]=this[6],t[7]=this[7],t[8]=this[8],t[9]=this[9],t[10]=this[10],t[11]=this[11],t[12]=this[12],t[13]=this[13],t[14]=this[14],t[15]=this[15],t},assign:function(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this[9]=t[9],this[10]=t[10],this[11]=t[11],this[12]=t[12],this[13]=t[13],this[14]=t[14],this[15]=t[15],this},equals:function(t){return this[0]===t[0]&&this[1]===t[1]&&this[2]===t[2]&&this[3]===t[3]&&this[4]===t[4]&&this[5]===t[5]&&this[6]===t[6]&&this[7]===t[7]&&this[8]===t[8]&&this[9]===t[9]&&this[10]===t[10]&&this[11]===t[11]&&this[12]===t[12]&&this[13]===t[13]&&this[14]===t[14]&&this[15]===t[15]},set1:function(t,e,i){return this[t*this.order+e]=i,this},get1:function(t,e){return this[t*this.order+e]},set:function(e,n,r,s,o){switch(arguments.length){case 0:this.identity();break;case 1:null===e&&(e=t.Zero),this.identity(),this.translate(e);break;case 2:null===e&&(e=t.Zero),null===n&&(n=i.Identity),this.identity(),this.translate(e),n.equals(i.Identity)||this.rotate(n);break;case 3:null===e&&(e=t.Zero),null===n&&(n=i.Identity),null===r&&(r=t.One),this.identity(),this.translate(e),n.equals(i.Identity)||this.rotate(n),r.equals(t.One)||this.scale(r);break;case 4:if(null===e&&(e=t.Zero),null===n&&(n=i.Identity),null===r&&(r=t.One),null===s&&(s=i.Identity),this.identity(),this.translate(e),n.equals(i.Identity)||this.rotate(n),!r.equals(t.One)){const t=!s.equals(i.Identity);t?(this.rotate(s),this.scale(r),this.rotate(i.inverse(s))):this.scale(r)}break;case 5:{null===e&&(e=t.Zero),null===n&&(n=i.Identity),null===r&&(r=t.One),null===s&&(s=i.Identity),null===o&&(o=t.Zero),this.identity(),this.translate(e);const a=!o.equals(t.Zero);a&&this.translate(o),n.equals(i.Identity)||this.rotate(n),r.equals(t.One)||(s.equals(i.Identity)?this.scale(r):(this.rotate(s),this.scale(r),this.rotate(i.inverse(s)))),a&&this.translate(t.negate(o));break}case 16:this[0]=arguments[0],this[1]=arguments[1],this[2]=arguments[2],this[3]=arguments[3],this[4]=arguments[4],this[5]=arguments[5],this[6]=arguments[6],this[7]=arguments[7],this[8]=arguments[8],this[9]=arguments[9],this[10]=arguments[10],this[11]=arguments[11],this[12]=arguments[12],this[13]=arguments[13],this[14]=arguments[14],this[15]=arguments[15]}return this},get:function(){const e=new t(0,0,0),r=new i,o=new t(0,0,0),a=new i,u=new t(0,0,0),l=new n,c=new n,h=new t(0,0,0);return function(t,i,n,d,p){switch(null===t&&(t=e),null===i&&(i=r),null===n&&(n=o),null===d&&(d=a),null===p&&(p=u),arguments.length){case 1:t.set(this[12],this[13],this[14]);break;case 2:this.factor(t,l,o,c),i.setMatrix(l);break;case 3:this.factor(t,l,n,c),i.setMatrix(l);break;case 4:this.factor(t,l,n,c),i.setMatrix(l),d.setMatrix(c);break;case 5:{const e=new s;e.set(h.assign(p).negate()),e.multLeft(this),e.translate(p),e.get(t,i,n,d);break}}}}(),setRotation:function(t){return this.setQuaternion(t.value)},setQuaternion:function(t){const e=t.x,i=t.y,n=t.z,r=t.w,s=i*i,o=n*n,a=e*i,u=n*r,l=n*e,c=i*r,h=e*e,d=i*n,p=e*r;return this[0]=1-2*(s+o),this[1]=2*(a+u),this[2]=2*(l-c),this[3]=0,this[4]=2*(a-u),this[5]=1-2*(o+h),this[6]=2*(d+p),this[7]=0,this[8]=2*(l+c),this[9]=2*(d-p),this[10]=1-2*(s+h),this[11]=0,this[12]=0,this[13]=0,this[14]=0,this[15]=1,this},factor:function(){const t=new n,e=new n,i=new n,s={values:[],vectors:[[],[],[]]};return function(n,o,a,u){n.set(this[12],this[13],this[14]);const l=this.submatrix,c=l.determinant(),h=c<0?-1:1;if(0===c)throw new Error("Matrix4 .factor: determinant is 0.");i.assign(l).transpose().multLeft(l);const d=r(i,s);u.set(d.vectors[0][0],d.vectors[1][0],d.vectors[2][0],d.vectors[0][1],d.vectors[1][1],d.vectors[2][1],d.vectors[0][2],d.vectors[1][2],d.vectors[2][2]),a.x=h*Math.sqrt(d.values[0]),a.y=h*Math.sqrt(d.values[1]),a.z=h*Math.sqrt(d.values[2]),t[0]=1/a.x,t[4]=1/a.y,t[8]=1/a.z,o.assign(e.assign(u).transpose().multRight(t).multRight(u).multRight(l))}}(),determinant3:function(){const t=this[0],e=this[1],i=this[2],n=this[4],r=this[5],s=this[6],o=this[8],a=this[9],u=this[10];return t*(r*u-s*a)-e*(n*u-s*o)+i*(n*a-r*o)},determinant:function(){const t=this[0],e=this[1],i=this[2],n=this[3],r=this[4],s=this[5],o=this[6],a=this[7],u=this[8],l=this[9],c=this[10],h=this[11],d=this[12],p=this[13],f=this[14],g=this[15],m=c*g,_=f*h,x=o*g,y=f*a,v=o*h,w=c*a,b=i*g,S=f*n,C=i*h,T=c*n,F=i*a,O=o*n;return t*(m*s+y*l+v*p-_*s-x*l-w*p)+r*(_*e+b*l+T*p-m*e-S*l-C*p)+u*(x*e+S*s+F*p-y*e-b*s-O*p)+d*(w*e+C*s+O*l-v*e-T*s-F*l)},transpose:function(){let t;return t=this[1],this[1]=this[4],this[4]=t,t=this[2],this[2]=this[8],this[8]=t,t=this[3],this[3]=this[12],this[12]=t,t=this[6],this[6]=this[9],this[9]=t,t=this[7],this[7]=this[13],this[13]=t,t=this[11],this[11]=this[14],this[14]=t,this},inverse:function(){const t=this[0],e=this[1],i=this[2],n=this[3],r=this[4],s=this[5],o=this[6],a=this[7],u=this[8],l=this[9],c=this[10],h=this[11],d=this[12],p=this[13],f=this[14],g=this[15],m=c*g,_=f*h,x=o*g,y=f*a,v=o*h,w=c*a,b=i*g,S=f*n,C=i*h,T=c*n,F=i*a,O=o*n,N=u*p,E=d*l,M=r*p,D=d*s,V=r*l,I=u*s,B=t*p,A=d*e,P=t*l,L=u*e,R=t*s,k=r*e,U=m*s+y*l+v*p-(_*s+x*l+w*p),X=_*e+b*l+T*p-(m*e+S*l+C*p),j=x*e+S*s+F*p-(y*e+b*s+O*p),z=w*e+C*s+O*l-(v*e+T*s+F*l);let G=t*U+r*X+u*j+d*z;if(0===G)throw new Error("Matrix4 .inverse: determinant is 0.");return G=1/G,this[0]=G*U,this[1]=G*X,this[2]=G*j,this[3]=G*z,this[4]=G*(_*r+x*u+w*d-m*r-y*u-v*d),this[5]=G*(m*t+S*u+C*d-_*t-b*u-T*d),this[6]=G*(y*t+b*r+O*d-x*t-S*r-F*d),this[7]=G*(v*t+T*r+F*u-w*t-C*r-O*u),this[8]=G*(N*a+D*h+V*g-E*a-M*h-I*g),this[9]=G*(E*n+B*h+L*g-N*n-A*h-P*g),this[10]=G*(M*n+A*a+R*g-D*n-B*a-k*g),this[11]=G*(I*n+P*a+k*h-V*n-L*a-R*h),this[12]=G*(M*c+I*f+E*o-V*f-N*o-D*c),this[13]=G*(P*f+N*i+A*c-B*c-L*f-E*i),this[14]=G*(B*o+k*f+D*i-R*f-M*i-A*o),this[15]=G*(R*c+V*i+L*o-P*o-k*c-I*i),this},multLeft:function(t){const e=this[0],i=this[1],n=this[2],r=this[3],s=this[4],o=this[5],a=this[6],u=this[7],l=this[8],c=this[9],h=this[10],d=this[11],p=this[12],f=this[13],g=this[14],m=this[15],_=t[0],x=t[1],y=t[2],v=t[3],w=t[4],b=t[5],S=t[6],C=t[7],T=t[8],F=t[9],O=t[10],N=t[11],E=t[12],M=t[13],D=t[14],V=t[15];return this[0]=e*_+s*x+l*y+p*v,this[1]=i*_+o*x+c*y+f*v,this[2]=n*_+a*x+h*y+g*v,this[3]=r*_+u*x+d*y+m*v,this[4]=e*w+s*b+l*S+p*C,this[5]=i*w+o*b+c*S+f*C,this[6]=n*w+a*b+h*S+g*C,this[7]=r*w+u*b+d*S+m*C,this[8]=e*T+s*F+l*O+p*N,this[9]=i*T+o*F+c*O+f*N,this[10]=n*T+a*F+h*O+g*N,this[11]=r*T+u*F+d*O+m*N,this[12]=e*E+s*M+l*D+p*V,this[13]=i*E+o*M+c*D+f*V,this[14]=n*E+a*M+h*D+g*V,this[15]=r*E+u*M+d*D+m*V,this},multRight:function(t){const e=this[0],i=this[1],n=this[2],r=this[3],s=this[4],o=this[5],a=this[6],u=this[7],l=this[8],c=this[9],h=this[10],d=this[11],p=this[12],f=this[13],g=this[14],m=this[15],_=t[0],x=t[1],y=t[2],v=t[3],w=t[4],b=t[5],S=t[6],C=t[7],T=t[8],F=t[9],O=t[10],N=t[11],E=t[12],M=t[13],D=t[14],V=t[15];return this[0]=e*_+i*w+n*T+r*E,this[1]=e*x+i*b+n*F+r*M,this[2]=e*y+i*S+n*O+r*D,this[3]=e*v+i*C+n*N+r*V,this[4]=s*_+o*w+a*T+u*E,this[5]=s*x+o*b+a*F+u*M,this[6]=s*y+o*S+a*O+u*D,this[7]=s*v+o*C+a*N+u*V,this[8]=l*_+c*w+h*T+d*E,this[9]=l*x+c*b+h*F+d*M,this[10]=l*y+c*S+h*O+d*D,this[11]=l*v+c*C+h*N+d*V,this[12]=p*_+f*w+g*T+m*E,this[13]=p*x+f*b+g*F+m*M,this[14]=p*y+f*S+g*O+m*D,this[15]=p*v+f*C+g*N+m*V,this},multVecMatrix:function(t){if(3===t.length){const e=t.x,i=t.y,n=t.z,r=1/(e*this[3]+i*this[7]+n*this[11]+this[15]);return t.x=(e*this[0]+i*this[4]+n*this[8]+this[12])*r,t.y=(e*this[1]+i*this[5]+n*this[9]+this[13])*r,t.z=(e*this[2]+i*this[6]+n*this[10]+this[14])*r,t}const e=t.x,i=t.y,n=t.z,r=t.w;return t.x=e*this[0]+i*this[4]+n*this[8]+r*this[12],t.y=e*this[1]+i*this[5]+n*this[9]+r*this[13],t.z=e*this[2]+i*this[6]+n*this[10]+r*this[14],t.w=e*this[3]+i*this[7]+n*this[11]+r*this[15],t},multMatrixVec:function(t){if(3===t.length){const e=t.x,i=t.y,n=t.z,r=1/(e*this[12]+i*this[13]+n*this[14]+this[15]);return t.x=(e*this[0]+i*this[1]+n*this[2]+this[3])*r,t.y=(e*this[4]+i*this[5]+n*this[6]+this[7])*r,t.z=(e*this[8]+i*this[9]+n*this[10]+this[11])*r,t}const e=t.x,i=t.y,n=t.z,r=t.w;return t.x=e*this[0]+i*this[1]+n*this[2]+r*this[3],t.y=e*this[4]+i*this[5]+n*this[6]+r*this[7],t.z=e*this[8]+i*this[9]+n*this[10]+r*this[11],t.w=e*this[12]+i*this[13]+n*this[14]+r*this[15],t},multDirMatrix:function(t){const e=t.x,i=t.y,n=t.z;return t.x=e*this[0]+i*this[4]+n*this[8],t.y=e*this[1]+i*this[5]+n*this[9],t.z=e*this[2]+i*this[6]+n*this[10],t},multMatrixDir:function(t){const e=t.x,i=t.y,n=t.z;return t.x=e*this[0]+i*this[1]+n*this[2],t.y=e*this[4]+i*this[5]+n*this[6],t.z=e*this[8]+i*this[9]+n*this[10],t},identity:function(){this[0]=1,this[1]=0,this[2]=0,this[3]=0,this[4]=0,this[5]=1,this[6]=0,this[7]=0,this[8]=0,this[9]=0,this[10]=1,this[11]=0,this[12]=0,this[13]=0,this[14]=0,this[15]=1},translate:function(t){const e=t.x,i=t.y,n=t.z;return this[12]+=this[0]*e+this[4]*i+this[8]*n,this[13]+=this[1]*e+this[5]*i+this[9]*n,this[14]+=this[2]*e+this[6]*i+this[10]*n,this},rotate:function(t){return this.multLeft(o.setQuaternion(t.value)),this},scale:function(t){const e=t.x,i=t.y,n=t.z;return this[0]*=e,this[4]*=i,this[8]*=n,this[1]*=e,this[5]*=i,this[9]*=n,this[2]*=e,this[6]*=i,this[10]*=n,this},getDepth:function(t){const e=t.x,i=t.y,n=t.z,r=1/(e*this[3]+i*this[7]+n*this[11]+this[15]);return(e*this[2]+i*this[6]+n*this[10]+this[14])*r},toString:function(){return this[0]+" "+this[1]+" "+this[2]+" "+this[3]+" "+this[4]+" "+this[5]+" "+this[6]+" "+this[7]+" "+this[8]+" "+this[9]+" "+this[10]+" "+this[11]+" "+this[12]+" "+this[13]+" "+this[14]+" "+this[15]}},Object.defineProperty(s.prototype,"x",{get:function(){const t=new e(0,0,0,0);return function(){return t.set(this[0],this[1],this[2],this[3])}}(),enumerable:!1,configurable:!1}),Object.defineProperty(s.prototype,"y",{get:function(){const t=new e(0,0,0,0);return function(){return t.set(this[4],this[5],this[6],this[7])}}(),enumerable:!1,configurable:!1}),Object.defineProperty(s.prototype,"z",{get:function(){const t=new e(0,0,0,0);return function(){return t.set(this[8],this[9],this[10],this[11])}}(),enumerable:!1,configurable:!1}),Object.defineProperty(s.prototype,"xAxis",{get:function(){const e=new t(0,0,0);return function(){return e.set(this[0],this[1],this[2])}}(),enumerable:!1,configurable:!1}),Object.defineProperty(s.prototype,"yAxis",{get:function(){const e=new t(0,0,0);return function(){return e.set(this[4],this[5],this[6])}}(),enumerable:!1,configurable:!1}),Object.defineProperty(s.prototype,"zAxis",{get:function(){const e=new t(0,0,0);return function(){return e.set(this[8],this[9],this[10])}}(),enumerable:!1,configurable:!1}),Object.defineProperty(s.prototype,"origin",{get:function(){const e=new t(0,0,0);return function(){return e.set(this[12],this[13],this[14])}}(),enumerable:!1,configurable:!1}),Object.defineProperty(s.prototype,"submatrix",{get:function(){const t=new n;return function(){return t[0]=this[0],t[1]=this[1],t[2]=this[2],t[3]=this[4],t[4]=this[5],t[5]=this[6],t[6]=this[8],t[7]=this[9],t[8]=this[10],t}}(),enumerable:!1,configurable:!1}),Object.assign(s,{Identity:new s,Rotation:function(t){return Object.create(this.prototype).setQuaternion(t.value)},Quaternion:function(t){return Object.create(this.prototype).setQuaternion(t)},Matrix3:function(t){return new s(t[0],t[1],t[2],0,t[3],t[4],t[5],0,t[6],t[7],t[8],0,0,0,0,1)},transpose:function(t){return t.copy().transpose()},inverse:function(t){return t.copy().inverse()},multLeft:function(t,e){return t.copy().multLeft(e)},multRight:function(t,e){return t.copy().multRight(e)}});const o=new s;return s}),define("x_ite/Fields/SFMatrix4",["x_ite/Basic/X3DField","x_ite/Fields/SFMatrixPrototypeTemplate","x_ite/Fields/SFVec3","x_ite/Bits/X3DConstants","standard/Math/Numbers/Matrix4"],function(t,e,i,n,r){"use strict";function s(i,n,s){function o(e,i,n,s,o,a,u,l,c,h,d,p,f,g,m,_){switch(arguments.length){case 0:return t.call(this,new r);case 1:return t.call(this,arguments[0]);case 16:return t.call(this,new r(1*e,1*i,1*n,1*s,1*o,1*a,1*u,1*l,1*c,1*h,1*d,1*p,1*f,1*g,1*m,1*_))}throw new Error("Invalid arguments.")}o.prototype=Object.assign(Object.create(t.prototype),e(r,s),{constructor:o,getTypeName:function(){return i},getType:function(){return n}});for(var a=0;a<r.prototype.length;++a)!function(t){Object.defineProperty(o.prototype,t,{get:function(){return this.getValue()[t]},set:function(e){this.getValue()[t]=e,this.addEvent()},enumerable:!1,configurable:!1})}(a);return o}return{SFMatrix4d:s("SFMatrix4d",n.SFMatrix4d,i.SFVec3d),SFMatrix4f:s("SFMatrix4f",n.SFMatrix4f,i.SFVec3f),VrmlMatrix:s("VrmlMatrix",n.VrmlMatrix,i.SFVec3f)}}),define("x_ite/Fields/SFNodeCache",["x_ite/Fields/SFNode","x_ite/Fields/SFNode"],function(){"use strict";function t(){}var e=new WeakMap;return t.prototype={add:function(t,i){var n=require("x_ite/Fields/SFNode"),i=i?n.call(i,t):new n(t);return e.set(t,i),i},get:function(t){var i=e.get(t);return i?i:(i=new(require("x_ite/Fields/SFNode"))(t),e.set(t,i),i)}},new t}),define("x_ite/Fields/SFNode",["x_ite/Basic/X3DField","x_ite/Bits/X3DConstants","x_ite/InputOutput/Generator","x_ite/Fields/SFNodeCache"],function(t,e,i,n){"use strict";function r(e){return e?(e.addParent(this),t.call(this,e)):t.call(this,null),new Proxy(this,s)}var s={get:function(t,i){try{var n=t[i];if(void 0!==n)return n;var r=t.getValue().getField(i);if(r.getAccessType()===e.inputOnly)return;return r.valueOf()}catch(t){return}},set:function(t,i,n){if(i in t)return t[i]=n,!0;try{var r=t.getValue().getField(i);return r.getAccessType()!==e.outputOnly&&r.setValue(n),!0}catch(e){return console.error(t,i,e),!1}},has:function(t,e){try{return Boolean(t.getValue().getField(e))}catch(i){return e in t}}};return r.prototype=Object.assign(Object.create(t.prototype),{constructor:r,_cloneCount:0,clone:function(){return new r(this.getValue())},copy:function(t){var e=this.getValue();return e?new r(e.copy(t)):new r},getTypeName:function(){return"SFNode"},getType:function(){return e.SFNode},equals:function(t){return t?this.getValue()===t.getValue():null===this.getValue()},isDefaultValue:function(){return null===this.getValue()},set:function(e){var i=this.getValue();i&&(i.removeCloneCount(this._cloneCount),i.removeParent(this)),e?(e.addParent(this),e.addCloneCount(this._cloneCount),t.prototype.set.call(this,e)):t.prototype.set.call(this,null)},getNodeTypeName:function(){var t=this.getValue();if(t)return t.getTypeName();throw new Error("SFNode.getNodeTypeName: node is null.")},getNodeName:function(){var t=this.getValue();if(t)return t.getName();throw new Error("SFNode.getNodeName: node is null.")},getNodeType:function(){var t=this.getValue();if(t)return t.getType().slice();throw new Error("SFNode.getNodeType: node is null.")},getFieldDefinitions:function(){var t=this.getValue();if(t)return t.getFieldDefinitions();throw new Error("SFNode.getFieldDefinitions: node is null.")},addFieldCallback:function(e,i,n){switch(arguments.length){case 2:return t.prototype.addFieldCallback.apply(this,arguments);case 3:var r=this.getValue();if(r)return r.getField(e).addFieldCallback(i,n);throw new Error("SFNode.addFieldCallback: node is null.")}},removeFieldCallback:function(e,i){switch(arguments.length){case 1:return t.prototype.removeFieldCallback.apply(this,arguments);case 2:var n=this.getValue();if(n)return n.getField(e).removeFieldCallback(i);throw new Error("SFNode.removeFieldCallback: node is null.")}},addCloneCount:function(t){var e=this.getValue();this._cloneCount+=t,e&&e.addCloneCount(t)},removeCloneCount:function(t){var e=this.getValue();this._cloneCount-=t,e&&e.removeCloneCount(t)},valueOf:function(){var t=this.getValue();return t?n.get(t):null},toStream:function(t){var e=this.getValue();e?e.toStream(t):t.string+="NULL"},toVRMLStream:function(t){var e=this.getValue();e?e.toVRMLStream(t):t.string+="NULL"},toXMLString:function(){var t={string:""},e=i.Get(t),n=this.getValue();return e.PushExecutionContext(n.getExecutionContext()),this.toXMLStream(t),e.PopExecutionContext(),t.string},toXMLStream:function(t){var e=this.getValue();e?e.toXMLStream(t):t.string+="<!-- NULL -->"},dispose:function(){this.set(null),t.prototype.dispose.call(this)}}),r}),
|
|
9
|
-
define("x_ite/Fields/SFRotation",["x_ite/Fields/SFVec3","x_ite/Basic/X3DField","x_ite/Bits/X3DConstants","x_ite/InputOutput/Generator","standard/Math/Numbers/Rotation4"],function(t,e,i,n,r){"use strict";function s(t,i,n,s){switch(arguments.length){case 0:return e.call(this,new r);case 1:return e.call(this,arguments[0]);case 2:return arguments[1]instanceof o?e.call(this,new r(arguments[0].getValue(),arguments[1].getValue())):e.call(this,new r(arguments[0].getValue(),1*arguments[1]));case 4:return e.call(this,new r(1*t,1*i,1*n,1*s))}throw new Error("Invalid arguments.")}var o=t.SFVec3f;s.prototype=Object.assign(Object.create(e.prototype),{constructor:s,copy:function(){return new s(this.getValue().copy())},equals:function(t){return this.getValue().equals(t.getValue())},isDefaultValue:function(){return this.getValue().equals(r.Identity)},getTypeName:function(){return"SFRotation"},getType:function(){return i.SFRotation},set:function(t){this.getValue().assign(t)},setAxis:function(t){this.getValue().setAxis(t.getValue()),this.addEvent()},getAxis:function(){return new o(this.getValue().getAxis().copy())},inverse:function(){return new s(r.inverse(this.getValue()))},multiply:function(t){return new s(r.multRight(this.getValue(),t.getValue()))},multVec:function(t){return new o(this.getValue().multVecRot(t.getValue().copy()))},slerp:function(t,e){return new s(r.slerp(this.getValue(),t.getValue(),e))},toStream:function(t){var e=n.Get(t),i=this.getValue();t.string+=i.x+" "+i.y+" "+i.z+" "+e.ToUnit("angle",i.angle)},toVRMLStream:function(t){this.toStream(t)},toXMLStream:function(t){this.toStream(t)}});var a={get:function(){return this.getValue().x},set:function(t){this.getValue().x=1*t,this.addEvent()},enumerable:!0,configurable:!1},u={get:function(){return this.getValue().y},set:function(t){this.getValue().y=1*t,this.addEvent()},enumerable:!0,configurable:!1},l={get:function(){return this.getValue().z},set:function(t){this.getValue().z=1*t,this.addEvent()},enumerable:!0,configurable:!1},c={get:function(){return this.getValue().angle},set:function(t){this.getValue().angle=1*t,this.addEvent()},enumerable:!0,configurable:!1};return Object.defineProperty(s.prototype,"x",a),Object.defineProperty(s.prototype,"y",u),Object.defineProperty(s.prototype,"z",l),Object.defineProperty(s.prototype,"angle",c),a.enumerable=!1,u.enumerable=!1,l.enumerable=!1,c.enumerable=!1,Object.defineProperty(s.prototype,"0",a),Object.defineProperty(s.prototype,"1",u),Object.defineProperty(s.prototype,"2",l),Object.defineProperty(s.prototype,"3",c),s}),define("x_ite/Fields/SFString",["x_ite/Basic/X3DField","x_ite/Bits/X3DConstants","x_ite/InputOutput/Generator"],function(t,e,i){"use strict";function n(e){return t.call(this,arguments.length?""+e:"")}return Object.assign(n,{unescape:function(t){return t.replace(/\\(.)/g,"$1")},escape:function(t){return t.replace(/([\\"])/g,"\\$1")}}),n.prototype=Object.assign(Object.create(t.prototype),{constructor:n,copy:function(){return new n(this.getValue())},getTypeName:function(){return"SFString"},getType:function(){return e.SFString},isDefaultValue:function(){return""===this.getValue()},set:function(e){t.prototype.set.call(this,""+e)},valueOf:t.prototype.getValue,toStream:function(t){t.string+='"'+n.escape(this.getValue())+'"'},toVRMLStream:function(t){this.toStream(t)},toXMLStream:function(t){t.string+=i.Get(t).XMLEncode(this.getValue())}}),Object.defineProperty(n.prototype,"length",{get:function(){return this.getValue().length},enumerable:!0,configurable:!1}),n}),define("x_ite/Fields/SFTime",["x_ite/Basic/X3DField","x_ite/Bits/X3DConstants"],function(t,e){"use strict";function i(e){return t.call(this,arguments.length?1*e:0)}return i.prototype=Object.assign(Object.create(t.prototype),{constructor:i,copy:function(){return new i(this.getValue())},getTypeName:function(){return"SFTime"},getType:function(){return e.SFTime},isDefaultValue:function(){return 0===this.getValue()},set:function(e){t.prototype.set.call(this,1*e)},valueOf:t.prototype.getValue,toStream:function(t){t.string+=String(this.getValue())},toVRMLStream:function(t){this.toStream(t)},toXMLStream:function(t){this.toStream(t)}}),i}),define("x_ite/Fields/SFVec4",["x_ite/Basic/X3DField","x_ite/Fields/SFVecPrototypeTemplate","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector4"],function(t,e,i,n){"use strict";function r(i,r){function s(e,i,r,s){switch(arguments.length){case 0:return t.call(this,new n(0,0,0,0));case 1:return t.call(this,arguments[0]);case 4:return t.call(this,new n(1*e,1*i,1*r,1*s))}throw new Error("Invalid arguments.")}s.prototype=Object.assign(Object.create(t.prototype),e(n),{constructor:s,getTypeName:function(){return i},getType:function(){return r}});var o={get:function(){return this.getValue().x},set:function(t){this.getValue().x=1*t,this.addEvent()},enumerable:!0,configurable:!1},a={get:function(){return this.getValue().y},set:function(t){this.getValue().y=1*t,this.addEvent()},enumerable:!0,configurable:!1},u={get:function(){return this.getValue().z},set:function(t){this.getValue().z=1*t,this.addEvent()},enumerable:!0,configurable:!1},l={get:function(){return this.getValue().w},set:function(t){this.getValue().w=1*t,this.addEvent()},enumerable:!0,configurable:!1};return Object.defineProperty(s.prototype,"x",o),Object.defineProperty(s.prototype,"y",a),Object.defineProperty(s.prototype,"z",u),Object.defineProperty(s.prototype,"w",l),o.enumerable=!1,a.enumerable=!1,u.enumerable=!1,l.enumerable=!1,Object.defineProperty(s.prototype,"0",o),Object.defineProperty(s.prototype,"1",a),Object.defineProperty(s.prototype,"2",u),Object.defineProperty(s.prototype,"3",l),s}return{SFVec4d:r("SFVec4d",i.SFVec4d),SFVec4f:r("SFVec4f",i.SFVec4f)}}),define("x_ite/Basic/X3DObjectArrayField",["jquery","x_ite/Basic/X3DField","x_ite/Basic/X3DArrayField","x_ite/Bits/X3DConstants","x_ite/InputOutput/Generator"],function(t,e,i,n,r){"use strict";function s(t){return i.call(this,[]),this._target=this,t[0]instanceof Array&&(t=t[0]),s.prototype.push.apply(this,t),new Proxy(this,o)}const o={get:function(t,e){const i=t[e];if(void 0!==i)return i;if("string"==typeof e){const i=t.getValue(),n=1*e;return Number.isInteger(n)?(n>=i.length&&t.resize(n+1),i[n].valueOf()):t[e]}const n=t.getValue();return e===Symbol.iterator?n[e]:void 0},set:function(t,e,i){if(e in t)return t[e]=i,!0;const n=t.getValue(),r=1*e;return r>=n.length&&t.resize(r+1),n[r].setValue(i),!0},has:function(t,e){return Number.isInteger(+e)?e<t.getValue().length:e in t}};return s.prototype=Object.assign(Object.create(i.prototype),{constructor:s,getTarget:function(){return this._target},copy:function(){const t=this._target,e=new t.constructor,i=t.getValue();return s.prototype.push.apply(e,i),e.setModificationTime(0),e},equals:function(t){const e=this._target,i=e.getValue(),n=t.getValue(),r=i.length;if(i===n)return!0;if(r!==n.length)return!1;for(let t=0;t<r;++t)if(!i[t].equals(n[t]))return!1;return!0},set:function(t){const i=this._target;i.resize(t.length,void 0,!0);const n=i.getValue();for(let i=0,r=t.length;i<r;++i)n[i].set(t[i]instanceof e?t[i].getValue():t[i])},isDefaultValue:function(){return 0===this.length},setValue:function(t){const e=this._target;e.set(t instanceof s?t.getValue():t),e.addEvent()},unshift:function(t){const e=this._target,i=e.getValue();for(let t=arguments.length-1;t>=0;--t){const n=new(e.getSingleType());n.setValue(arguments[t]),e.addChildObject(n),i.unshift(n)}return e.addEvent(),i.length},shift:function(){const t=this._target,e=t.getValue();if(e.length){const i=e.shift();return t.removeChildObject(i),t.addEvent(),i.valueOf()}},push:function(t){const e=this._target,i=e.getValue();for(const t of arguments){const n=new(e.getSingleType());n.setValue(t),e.addChildObject(n),i.push(n)}return e.addEvent(),i.length},pop:function(){const t=this._target,e=t.getValue();if(e.length){const i=e.pop();return t.removeChildObject(i),t.addEvent(),i.valueOf()}},splice:function(t,e){const i=this._target,n=i.getValue();t>n.length&&(t=n.length),t+e>n.length&&(e=n.length-t);const r=i.erase(t,t+e);return arguments.length>2&&i.insert(t,arguments,2,arguments.length),r},insert:function(t,e,i,n){const r=this._target,s=[t,0];for(let t=i;t<n;++t){const i=new(r.getSingleType());i.setValue(e[t]),r.addChildObject(i),s.push(i)}Array.prototype.splice.apply(r.getValue(),s),r.addEvent()},find:function(e,i,n){const r=this._target,s=r.getValue();if(t.isFunction(n)){for(let t=e;t<i;++t)if(n(s[t].valueOf()))return t;return i}for(let t=e;t<i;++t)if(s[t].equals(n))return t;return i},remove:function(e,i,n){const r=this._target,s=r.getValue();if(t.isFunction(n)){if((e=r.find(e,i,n))!==i)for(let t=e;++t<i;){const i=s[t];if(!n(i.valueOf())){const n=s[e];s[e++]=i,s[t]=n}}return e!==i&&r.addEvent(),e}if((e=r.find(e,i,n))!==i)for(let t=e;++t<i;){const i=s[t];if(!i.equals(n)){const n=s[e];s[e++]=i,s[t]=n}}return e!==i&&r.addEvent(),e},erase:function(t,e){const i=this._target,n=i.getValue().splice(t,e-t);for(const t of n)i.removeChildObject(t);return i.addEvent(),new i.constructor(n)},resize:function(t,e,i){const n=this._target,r=n.getValue();if(t<r.length){for(let e=t,i=r.length;e<i;++e)n.removeChildObject(r[e]);r.length=t,i||n.addEvent()}else if(t>r.length){for(let i=r.length;i<t;++i){const t=new(n.getSingleType());void 0!==e&&t.setValue(e),n.addChildObject(t),r.push(t)}i||n.addEvent()}},addChildObject:function(t){t.addParent(this._target)},removeChildObject:function(t){t.removeParent(this._target)},toStream:function(t){const e=this._target,i=e.getValue(),n=r.Get(t);switch(i.length){case 0:t.string+="[ ]";break;case 1:n.PushUnitCategory(e.getUnit()),i[0].toStream(t),n.PopUnitCategory();break;default:n.PushUnitCategory(e.getUnit()),t.string+="[\n",n.IncIndent();for(let e=0,r=i.length-1;e<r;++e)t.string+=n.Indent(),i[e].toStream(t),t.string+=",\n";t.string+=n.Indent(),i.at(-1).toStream(t),t.string+="\n",n.DecIndent(),t.string+=n.Indent(),t.string+="]",n.PopUnitCategory()}},toVRMLStream:function(t){this.toStream(t)},toXMLStream:function(t){const e=this._target;if(e.length){const i=r.Get(t),n=e.getValue();i.PushUnitCategory(e.getUnit());for(const e of n)e.toXMLStream(t),t.string+=", ";n.at(-1).toXMLStream(t),i.PopUnitCategory()}},dispose:function(){const t=this._target,e=t.getValue();for(const i of e)t.removeChildObject(i);e.length=0,i.prototype.dispose.call(t)}}),Object.defineProperty(s.prototype,"length",{get:function(){return this._target.getValue().length},set:function(t){this._target.resize(t)},enumerable:!1,configurable:!1}),s}),define("x_ite/Basic/X3DTypedArrayField",["x_ite/Basic/X3DArrayField","x_ite/Bits/X3DConstants","x_ite/InputOutput/Generator","standard/Math/Algorithm"],function(t,e,i,n){"use strict";function r(e){return t.call(this,new(this.getArrayType())(2)),this._target=this,this._tmp=[],e[0]instanceof Array&&(e=e[0]),r.prototype.push.apply(this,e),new Proxy(this,a)}function s(t,e,i){const n=this.getValue(),r=this._tmp;for(let e=0;e<i;++e,++t)r[e]=n[t];return e.set.apply(e,r),e}function o(t,e,i){const n=this.getValue();for(let r=0;r<i;++r,++t)n[t]=e[r];this.addEvent()}const a={get:function(t,e){const i=t[e];if(void 0!==i)return i;if("string"==typeof e){const i=1*e;if(Number.isInteger(i)){const e=t.getComponents(),n=t.getValueType();let r=t.getValue();if(i>=t._length&&(r=t.resize(i+1)),1===e)return n(r[i]);{const r=new n,a=r.getValue(),u=i*e;return r.addEvent=o.bind(t,u,a,e),r.getValue=s.bind(t,u,a,e),r}}return t[e]}return e===Symbol.iterator?function*(){const e=t.getValue(),i=t.getComponents(),n=t.getValueType();if(1===i)for(let i=0;i<t._length;++i)yield n(e[i]);else for(let e=0;e<t._length;++e){const r=new n,a=r.getValue(),u=e*i;r.addEvent=o.bind(t,u,a,i),r.getValue=s.bind(t,u,a,i),yield r}}:void 0},set:function(t,e,i){if(e in t)return t[e]=i,!0;const n=t.getComponents();let r=1*e,s=t.getValue();if(r>=t._length&&(s=t.resize(r+1)),1===n)s[r]=i;else{r*=n;for(let t=0;t<n;++t,++r)s[r]=i[t]}return t.addEvent(),!0},has:function(t,e){return Number.isInteger(+e)?e<t._length:e in t}};return r.prototype=Object.assign(Object.create(t.prototype),{constructor:r,_length:0,getTarget:function(){return this._target},copy:function(){const e=this._target,i=e.getValue(),n=new e.constructor,r=new(e.getArrayType())(i);return n._length=e._length,t.prototype.set.call(n,r,e._length),n.setModificationTime(0),n},equals:function(t){if(this===t)return!0;const e=this._target,i=e._length;if(i!==t._length)return!1;const n=e.getValue(),r=t.getValue();for(let t=0,s=i*e.getComponents();t<s;++t)if(n[t]!==r[t])return!1;return!0},assign:function(t){const e=this._target;e.set(t.getValue(),t.length),e.addEvent()},set:function(t,e){const i=this._target,n=i.getComponents(),r=i._length;let s=i.getValue(),o=void 0!==e?e*n:t.length;const a=o%n;a&&(o-=a,console.warn("Array length must be multiple of components size, which is "+n+".")),o/=n,s.length<t.length?(s=i.grow(t.length),s.set(t),a&&s.fill(0,o*n,o*n+a)):(s.set(t),o<r&&s.fill(0,o*n,r*n)),i._length=o},isDefaultValue:function(){return 0===this._length},setValue:function(t){const e=this._target;t instanceof e.constructor?e.assign(t):(e.set(t),e.addEvent())},unshift:function(t){const e=this._target,i=e.getComponents(),n=e._length,r=arguments.length,s=e.grow((n+r)*i);if(s.copyWithin(r*i,0,n*i),1===i)s.set(arguments,0);else for(let t=0,e=0;e<r;++e){const n=arguments[e];for(let e=0;e<i;++e,++t)s[t]=n[e]}return e._length+=r,e.addEvent(),s.length},shift:function(){const t=this._target,e=t._length;if(e){const n=t.getValue(),r=t.getComponents(),s=t.getValueType(),o=e-1;if(1===r)var i=s(n[0]);else{const e=t._tmp;for(let t=0;t<r;++t)e[t]=n[t];var i=Object.create(s.prototype);s.apply(i,e)}return n.copyWithin(0,r,e*r),n.fill(0,r*o,e*r),t._length=o,t.addEvent(),i}},push:function(t){const e=this._target,i=e.getComponents(),n=e._length,r=arguments.length,s=e.grow((n+r)*i);if(1===i)s.set(arguments,n);else for(let t=n*i,e=0;e<r;++e){const n=arguments[e];for(let e=0;e<i;++e,++t)s[t]=n[e]}return e._length+=r,e.addEvent(),e._length},pop:function(){const t=this._target,e=t._length;if(e){const n=t.getValue(),r=t.getComponents(),s=t.getValueType(),o=e-1;if(1===r)var i=s(n[e-1]);else{const e=t._tmp;for(let t=0,i=o*r;t<r;++t,++i)e[t]=n[i];var i=Object.create(s.prototype);s.apply(i,e)}return n.fill(0,o*r,e*r),t._length=o,t.addEvent(),i}},splice:function(t,e){const i=this._target,n=i._length;t>n&&(t=n),t+e>n&&(e=n-t);const r=i.erase(t,t+e);return arguments.length>2&&i.spliceInsert(t,Array.prototype.splice.call(arguments,2)),i.addEvent(),r},spliceInsert:function(t,e){const i=this._target,n=i.getComponents(),r=i._length,s=e.length,o=i.grow((r+s)*n);if(t*=n,o.copyWithin(t+s*n,t,r*n),1===n)o.set(e,t);else for(let i=0,r=t;i<s;++i){const t=e[i];for(let e=0;e<n;++e,++r)o[r]=t[e]}i._length+=s},insert:function(t,e,i,n){const r=this._target,s=r._length,o=e.getValue(),a=r.getComponents(),u=n-i,l=r.grow((s+u)*a);for(t*=a,i*=a,n*=a,l.copyWithin(t+u*a,t,s*a);i<n;++t,++i)l[t]=o[i];r._length+=u,r.addEvent()},erase:function(t,e){const i=this._target,n=i.getValue(),r=i.getComponents(),s=e-t,o=i._length,a=o-s,u=new i.constructor,l=u.grow(s*r);t*=r,e*=r;for(let i=0,r=t;r<e;++i,++r)l[i]=n[r];return n.copyWithin(t,e,o*r),n.fill(0,a*r,o*r),i._length=a,u._length=s,i.addEvent(),u},resize:function(t,e,i){const n=this._target,r=n._length,s=n.getComponents();let o=n.getValue();if(t<r)o.fill(0,t*s,r*s),i||n.addEvent();else if(t>r){if(o=n.grow(t*s),void 0!==e)if(1===s)o.fill(e,r*s,t*s);else for(let i=r*s,n=t*s;i<n;)for(let t=0;t<s;++t,++i)o[i]=e[t];i||n.addEvent()}return n._length=t,o},grow:function(e){const i=this._target,r=i.getValue();if(e<r.length)return r;const s=n.nextPowerOfTwo(e),o=new(i.getArrayType())(s);return o.set(r),t.prototype.set.call(i,o),o},shrinkToFit:function(){const e=this._target,i=e.getValue(),n=e._length*e.getComponents();if(i.length==n)return i;const r=i.subarray(0,n);return t.prototype.set.call(e,r),r},toStream:function(t){const e=this._target,n=i.Get(t),r=e.getValue(),s=e._length,o=e.getComponents(),a=new(e.getSingleType());switch(s){case 0:t.string+="[ ]";break;case 1:if(n.PushUnitCategory(e.getUnit()),1===o)a.set(r[0]),a.toStream(t);else{for(let t=0,e=0;t<o;++t,++e)a[t]=r[e];a.toStream(t)}n.PopUnitCategory();break;default:if(n.PushUnitCategory(e.getUnit()),t.string+="[\n",n.IncIndent(),1===o){for(let e=0,i=s-1;e<i;++e)t.string+=n.Indent(),a.set(r[e*o]),a.toStream(t),t.string+=",\n";t.string+=n.Indent(),a.set(r[(s-1)*o]),a.toStream(t),t.string+="\n"}else{for(let e=0,i=s-1;e<i;++e){t.string+=n.Indent();for(let t=0,i=e*o;t<o;++t,++i)a[t]=r[i];a.toStream(t),t.string+=",\n"}t.string+=n.Indent();for(let t=0,e=(s-1)*o;t<o;++t,++e)a[t]=r[e];a.toStream(t),t.string+="\n"}n.DecIndent(),t.string+=n.Indent(),t.string+="]",n.PopUnitCategory()}},toVRMLStream:function(t){this.toStream(t)},toXMLStream:function(t){const e=this._target,n=e._length;if(n){const r=i.Get(t),s=e.getValue(),o=e.getComponents(),a=new(e.getSingleType());if(r.PushUnitCategory(e.getUnit()),1===o){for(let e=0,i=n-1;e<i;++e)a.set(s[e*o]),a.toXMLStream(t),t.string+=", ";a.set(s[(n-1)*o]),a.toXMLStream(t)}else{for(let e=0,i=n-1;e<i;++e){for(let t=0,i=e*o;t<o;++t,++i)a[t]=s[i];a.toXMLStream(t),t.string+=", "}for(let t=0,e=(n-1)*o;t<o;++t,++e)a[t]=s[e];a.toXMLStream(t)}r.PopUnitCategory()}},dispose:function(){t.prototype.dispose.call(this._target)}}),Object.defineProperty(r.prototype,"length",{get:function(){return this._length},set:function(t){this._target.resize(t)},enumerable:!1,configurable:!1}),r}),define("x_ite/Fields/ArrayFields",["x_ite/Fields/SFBool","x_ite/Fields/SFColor","x_ite/Fields/SFColorRGBA","x_ite/Fields/SFDouble","x_ite/Fields/SFFloat","x_ite/Fields/SFImage","x_ite/Fields/SFInt32","x_ite/Fields/SFMatrix3","x_ite/Fields/SFMatrix4","x_ite/Fields/SFNode","x_ite/Fields/SFRotation","x_ite/Fields/SFString","x_ite/Fields/SFTime","x_ite/Fields/SFVec2","x_ite/Fields/SFVec3","x_ite/Fields/SFVec4","x_ite/Basic/X3DObjectArrayField","x_ite/Basic/X3DTypedArrayField","x_ite/Bits/X3DConstants","x_ite/InputOutput/Generator"],function(t,e,i,n,r,s,o,a,u,l,c,h,d,p,f,g,m,_,x,y){"use strict";function v(t){return m.call(this,arguments)}function w(t){return m.call(this,arguments)}function b(t,e,i,n,r,s){function o(t){return _.call(this,arguments)}return o.prototype=Object.assign(Object.create(_.prototype),{constructor:o,getSingleType:function(){return i},getValueType:function(){return n},getArrayType:function(){return r},getComponents:function(){return s},getTypeName:function(){return t},getType:function(){return e}}),o}function S(t){return t}const C=a.SFMatrix3d,T=a.SFMatrix3f,F=u.SFMatrix4d,O=u.SFMatrix4f,N=p.SFVec2d,E=p.SFVec2f,M=f.SFVec3d,D=f.SFVec3f,V=g.SFVec4d,I=g.SFVec4f;return v.prototype=Object.assign(Object.create(m.prototype),{constructor:v,_cloneCount:0,getSingleType:function(){return l},getValueType:function(){return l},getArrayType:function(){return Array},getComponents:function(){return 1},getTypeName:function(){return"MFNode"},getType:function(){return x.MFNode},clone:function(){const t=new v;return t.setValue(this),t.setModificationTime(0),t},copy:function(t){const e=new v;for(const i of this.getValue())e.push(i.copy(t));return e.setModificationTime(0),e},addCloneCount:function(t){this._cloneCount+=t;for(const e of this.getValue())e.addCloneCount(t)},removeCloneCount:function(t){this._cloneCount+=t;for(const e of this.getValue())e.removeCloneCount(t)},addChildObject:function(t){m.prototype.addChildObject.call(this,t),t.addCloneCount(this._cloneCount)},removeChildObject:function(t){m.prototype.removeChildObject.call(this,t),t.removeCloneCount(this._cloneCount)},toStream:function(t){const e=this._target,i=e.getValue(),n=y.Get(t);switch(i.length){case 0:t.string+="[ ]";break;case 1:n.PushUnitCategory(e.getUnit()),i[0].toStream(t),n.PopUnitCategory();break;default:n.PushUnitCategory(e.getUnit()),t.string+="[\n",n.IncIndent();for(let e=0,r=i.length;e<r;++e)t.string+=n.Indent(),i[e].toStream(t),t.string+="\n";n.DecIndent(),t.string+=n.Indent(),t.string+="]",n.PopUnitCategory()}},toVRMLString:function(){this.addCloneCount(1);const t=m.prototype.toVRMLString.call(this);return this.removeCloneCount(1),t},toVRMLStream:function(t){const e=this._target,i=e.getValue(),n=y.Get(t);switch(i.length){case 0:t.string+="[ ]";break;case 1:n.EnterScope(),i[0].toVRMLStream(t),n.LeaveScope();break;default:n.EnterScope(),t.string+="[\n",n.IncIndent();for(const e of i)t.string+=n.Indent(),e.toVRMLStream(t),t.string+="\n";n.DecIndent(),t.string+=n.Indent(),t.string+="]",n.LeaveScope()}},toXMLString:function(){this.addCloneCount(1);const t=m.prototype.toXMLString.call(this);return this.removeCloneCount(1),t},toXMLStream:function(t){const e=y.Get(t),i=this.length;if(i){e.EnterScope();const n=this.getValue();for(let r=0,s=i-1;r<s;++r){const i=n[r].getValue();if(i)i.toXMLStream(t),t.string+="\n";else{t.string+=e.Indent(),t.string+="<",t.string+="NULL";const i=e.ContainerField();i&&(t.string+=" ",t.string+="containerField='",t.string+=e.XMLEncode(i.getName()),t.string+="'"),t.string+="/>"}}const r=n.at(-1).getValue();if(r)r.toXMLStream(t);else{t.string+=e.Indent(),t.string+="<",t.string+="NULL";const i=e.ContainerField();i&&(t.string+=" ",t.string+="containerField='",t.string+=e.XMLEncode(i.getName()),t.string+="'")}e.LeaveScope()}}}),w.prototype=Object.assign(Object.create(m.prototype),{constructor:w,getValueType:function(){return String},getSingleType:function(){return h},getArrayType:function(){return Array},getComponents:function(){return 1},getTypeName:function(){return"MFString"},getType:function(){return x.MFString},toXMLStream:function(t){const e=this.length;if(e){const i=this.getValue();for(let n=0,r=e-1;n<r;++n)t.string+='"',i[n].toXMLStream(t),t.string+='"',t.string+=", ";t.string+='"',i.at(-1).toXMLStream(t),t.string+='"'}}}),{MFBool:b("MFBool",x.MFBool,t,Boolean,Uint8Array,1),MFColor:b("MFColor",x.MFColor,e,e,Float32Array,3),MFColorRGBA:b("MFColorRGBA",x.MFColorRGBA,i,i,Float32Array,4),MFDouble:b("MFDouble",x.MFDouble,n,S,Float64Array,1),MFFloat:b("MFFloat",x.MFFloat,r,S,Float32Array,1),MFImage:function(t,e,i,n,r,s){function o(t){return m.call(this,arguments)}return o.prototype=Object.assign(Object.create(m.prototype),{constructor:o,getSingleType:function(){return i},getValueType:function(){return n},getArrayType:function(){return r},getComponents:function(){return s},getTypeName:function(){return t},getType:function(){return e}}),o}("MFImage",x.MFImage,s,s,Array,1),MFInt32:b("MFInt32",x.MFInt32,o,S,Int32Array,1),MFMatrix3d:b("MFMatrix3d",x.MFMatrix3d,C,C,Float64Array,9),MFMatrix3f:b("MFMatrix3f",x.MFMatrix3f,T,T,Float32Array,9),MFMatrix4d:b("MFMatrix4d",x.MFMatrix4d,F,F,Float64Array,16),MFMatrix4f:b("MFMatrix4f",x.MFMatrix4f,O,O,Float32Array,16),MFNode:v,MFRotation:b("MFRotation",x.MFRotation,c,c,Float64Array,4),MFString:w,MFTime:b("MFTime",x.MFTime,d,S,Float64Array,1),MFVec2d:b("MFVec2d",x.MFVec2d,N,N,Float64Array,2),MFVec2f:b("MFVec2f",x.MFVec2f,E,E,Float32Array,2),MFVec3d:b("MFVec3d",x.MFVec3d,M,M,Float64Array,3),MFVec3f:b("MFVec3f",x.MFVec3f,D,D,Float32Array,3),MFVec4d:b("MFVec4d",x.MFVec4d,V,V,Float64Array,4),MFVec4f:b("MFVec4f",x.MFVec4f,I,I,Float32Array,4)}}),define("x_ite/Fields",["x_ite/Fields/SFBool","x_ite/Fields/SFColor","x_ite/Fields/SFColorRGBA","x_ite/Fields/SFDouble","x_ite/Fields/SFFloat","x_ite/Fields/SFImage","x_ite/Fields/SFInt32","x_ite/Fields/SFMatrix3","x_ite/Fields/SFMatrix4","x_ite/Fields/SFNode","x_ite/Fields/SFRotation","x_ite/Fields/SFString","x_ite/Fields/SFTime","x_ite/Fields/SFVec2","x_ite/Fields/SFVec3","x_ite/Fields/SFVec4","x_ite/Fields/ArrayFields"],function(t,e,i,n,r,s,o,a,u,l,c,h,d,p,f,g,m){"use strict";return Object.assign({SFBool:t,SFColor:e,SFColorRGBA:i,SFDouble:n,SFFloat:r,SFImage:s,SFInt32:o,SFMatrix3d:a.SFMatrix3d,SFMatrix3f:a.SFMatrix3f,SFMatrix4d:u.SFMatrix4d,SFMatrix4f:u.SFMatrix4f,SFNode:l,SFRotation:c,SFString:h,SFTime:d,SFVec2d:p.SFVec2d,SFVec2f:p.SFVec2f,SFVec3d:f.SFVec3d,SFVec3f:f.SFVec3f,SFVec4d:g.SFVec4d,SFVec4f:g.SFVec4f,VrmlMatrix:u.VrmlMatrix},m)}),define("x_ite/Browser/VERSION",[],function(){return"4.7.5"}),define("x_ite/DEBUG",[],function(){"use strict";return!1}),define("x_ite/Base/X3DEventObject",["x_ite/Base/X3DChildObject","x_ite/Base/Events"],function(t,e){"use strict";function i(e){t.call(this),this._browser=e}return i.prototype=Object.assign(Object.create(t.prototype),{constructor:i,getBrowser:function(){return this._browser},getExtendedEventHandling:function(){return!0},addEvent:function(t){t.getTainted()||(t.setTainted(!0),this.addEventObject(t,e.create(t)))},addEventObject:function(t,e){const i=this.getBrowser();i.addBrowserEvent(),i.addTaintedField(t,e),this.getTainted()||(t.isInput()||this.getExtendedEventHandling()&&!t.isOutput())&&this.addNodeEvent()},addNodeEvent:function(){if(!this.getTainted()){const t=this.getBrowser();this.setTainted(!0),t.addTaintedNode(this),t.addBrowserEvent()}},processEvents:function(){this.setTainted(!1),this.processInterests()}}),i}),define("x_ite/Basic/X3DBaseNode",["x_ite/Base/X3DEventObject","x_ite/Base/Events","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Fields","x_ite/Bits/X3DConstants","x_ite/InputOutput/Generator"],function(t,e,i,n,r,s,o){"use strict";function a(e){if(!this.hasOwnProperty("_executionContext")){t.call(this,e.getBrowser()),this._executionContext=e,this._type=[s.X3DBaseNode],this._fields=new Map,this._predefinedFields=new Map,this._aliases=new Map,this._userDefinedFields=new Map,this._cloneCount=0,this.hasUserDefinedFields()&&(this.fieldDefinitions=new n(this.fieldDefinitions.getValue().slice()));for(const t of this.fieldDefinitions)this.addField(t)}}return a.prototype=Object.assign(Object.create(t.prototype),{constructor:a,fieldDefinitions:new n([]),_private:!1,_live:!0,_initialized:!1,setExecutionContext:function(t){this._executionContext=t},getExecutionContext:function(){return this._executionContext},getScene:function(){let t=this._executionContext;for(;!t.isRootContext();)t=t.getExecutionContext();return t},getMainScene:function(){let t=this._executionContext.getScene();for(;!t.isMainContext();)t=t.getScene();return t},addType:function(t){this._type.push(t)},getType:function(){return this._type},isType:function(t){for(const e of this._type)if(t.has(e))return!0;return!1},getInnerNode:function(){return this},isLive:function(){function t(){return this.isLive_}return function(){return this.isLive=t,this.addChildObjects("isLive",new r.SFBool(this.getLiveState())),this.isLive_.removeParent(this),this._executionContext!==this&&this._executionContext.isLive().addInterest("_set_live__",this),this.isLive()}}(),setLive:function(t){this._live=t.valueOf(),this._set_live__()},getLive:function(){return this._live},getLiveState:function(){return this!==this._executionContext?this.getLive()&&this._executionContext.isLive().getValue():this.getLive()},_set_live__:function(){const t=this.getLiveState(),i=this.isLive();if(t){if(i.getValue())return;i.setValue(!0),i.processEvent(e.create(i))}else i.getValue()&&(i.setValue(!1),i.processEvent(e.create(i)))},setInitialized:function(t){this._initialized=t},isInitialized:function(){return this._initialized},setup:function(){this._initialized||(this._initialized=!0,this._fields.forEach(t=>t.setTainted(!1)),this.initialize())},initialize:function(){},create:function(t){return new this.constructor(t)},copy:function(t){const e=t.getBody(),i=this.getName();if(i.length){const t=e.getNamedNodes().get(i);if(t)return t}const n=this.create(e);return i.length&&e.updateNamedNode(i,n),this.getPredefinedFields().forEach(function(e){try{const i=n.getField(e.getName());if(e.hasReferences())e.getReferences().forEach(function(e){try{i.addReference(t.getField(e.getName()))}catch(t){console.error(t.message)}});else if(e.getAccessType()&s.initializeOnly)switch(e.getType()){case s.SFNode:case s.MFNode:i.set(e.copy(t).getValue());break;default:i.set(e.getValue(),e.length)}i.setModificationTime(e.getModificationTime())}catch(t){console.log(t.message)}},this),this.getUserDefinedFields().forEach(function(e){const i=e.copy(t);n.addUserDefinedField(e.getAccessType(),e.getName(),i),e.hasReferences()&&e.getReferences().forEach(function(e){try{i.addReference(t.getField(e.getName()))}catch(i){console.error("No reference '"+e.getName()+"' inside execution context "+t.getTypeName()+" '"+t.getName()+"'.")}}),i.setModificationTime(e.getModificationTime())}),n.setup(),n},flatCopy:function(t){const e=this.create(t||this.getExecutionContext());return this._fields.forEach(function(t){e._fields.get(t.getName()).assign(t)}),e.setup(),e},addChildObjects:function(t,e){for(let t=0,e=arguments.length;t<e;t+=2)this.addChildObject(arguments[t],arguments[t+1])},addChildObject:function(t,e){e.addParent(this),e.setName(t),Object.defineProperty(this,t+"_",{get:function(){return e},set:function(t){e.setValue(t)},enumerable:!0,configurable:!1})},addField:function(t){const e=t.accessType,i=t.name,n=t.value.clone();n.setTainted(!0),n.addParent(this),n.setName(i),n.setAccessType(e),this.setField(i,n)},setField:function(t,e,i){this._fields.set(t,e),this.getPrivate()||e.addCloneCount(1),i?this._userDefinedFields.set(t,e):(this._predefinedFields.set(t,e),Object.defineProperty(this,t+"_",{get:function(){return e},set:function(t){e.setValue(t)},enumerable:!0,configurable:!0}))},removeField:function(t){const e=this._fields.get(t);if(e){this._fields.delete(t),this._userDefinedFields.delete(t);const i=this.fieldDefinitions.getValue();for(let e=0,n=i.length;e<n;++e)if(i[e].name===t){i.splice(e,1);break}this.getPrivate()||e.removeCloneCount(1)}},getField:function(){return function(t){const e=this._fields.get(t)||this._aliases.get(t);if(e)return e;const i=t.match(/^set_(.*?)$/);if(i){const t=this._fields.get(i[1])||this._aliases.get(i[1]);if(t&&t.getAccessType()===s.inputOutput)return t}else{const e=t.match(/^(.*?)_changed$/);if(e){const t=this._fields.get(e[1])||this._aliases.get(e[1]);if(t&&t.getAccessType()===s.inputOutput)return t}}throw new Error("Unknown field '"+t+"' in node class "+this.getTypeName()+".")}}(),addAlias:function(t,e){this._aliases.set(t,e)},getFieldDefinitions:function(){return this.fieldDefinitions},hasUserDefinedFields:function(){return!1},addUserDefinedField:function(t,e,n){this._fields.has(e)&&this.removeField(e),n.setTainted(!0),n.addParent(this),n.setName(e),n.setAccessType(t),this.fieldDefinitions.add(new i(t,e,n)),this.setField(e,n,!0)},getUserDefinedFields:function(){return this._userDefinedFields},getPredefinedFields:function(){return this._predefinedFields},getChangedFields:function(t){const e=[],i=this.getPredefinedFields();if(t){const t=this.getUserDefinedFields();t.forEach(function(t){e.push(t)})}return i.forEach(function(i){if(t&&(i.getInputRoutes().size||i.getOutputRoutes().size))return void e.push(i);if(0===i.getReferences().size){if(!i.isInitializable())return;if(this.isDefaultValue(i))return}e.push(i)},this),e},isDefaultValue:function(t){const e=this.getFieldDefinitions().get(t.getName());return e?e.value.equals(t):!t.getModificationTime()},getFields:function(){return this._fields},getSourceText:function(){return null},hasRoutes:function(){for(const t of this._fields.values()){if(t.getInputRoutes().size)return!0;if(t.getOutputRoutes().size)return!0}return!1},getPrivate:function(){return this._private},setPrivate:function(t){this._private=t,t?this._fields.forEach(function(t){t.removeCloneCount(1)}):this._fields.forEach(function(t){t.addCloneCount(1)})},getCloneCount:function(){return this._cloneCount},addCloneCount:function(t){0!==t&&(this._cloneCount+=t)},removeCloneCount:function(t){0!==t&&(this._cloneCount-=t)},traverse:function(){},toStream:function(t){t.string+=this.getTypeName()+" { }"},toVRMLStream:function(t){const e=o.Get(t);if(e.IsSharedNode(this))return void(t.string+="NULL");e.EnterScope();const i=e.Name(this);if(i.length&&e.ExistsNode(this))return t.string+="USE",t.string+=" ",t.string+=i,void e.LeaveScope();i.length&&(e.AddNode(this),t.string+="DEF",t.string+=" ",t.string+=i,t.string+=" "),
|
|
9
|
+
define("x_ite/Fields/SFRotation",["x_ite/Fields/SFVec3","x_ite/Basic/X3DField","x_ite/Bits/X3DConstants","x_ite/InputOutput/Generator","standard/Math/Numbers/Rotation4"],function(t,e,i,n,r){"use strict";function s(t,i,n,s){switch(arguments.length){case 0:return e.call(this,new r);case 1:return e.call(this,arguments[0]);case 2:return arguments[1]instanceof o?e.call(this,new r(arguments[0].getValue(),arguments[1].getValue())):e.call(this,new r(arguments[0].getValue(),1*arguments[1]));case 4:return e.call(this,new r(1*t,1*i,1*n,1*s))}throw new Error("Invalid arguments.")}var o=t.SFVec3f;s.prototype=Object.assign(Object.create(e.prototype),{constructor:s,copy:function(){return new s(this.getValue().copy())},equals:function(t){return this.getValue().equals(t.getValue())},isDefaultValue:function(){return this.getValue().equals(r.Identity)},getTypeName:function(){return"SFRotation"},getType:function(){return i.SFRotation},set:function(t){this.getValue().assign(t)},setAxis:function(t){this.getValue().setAxis(t.getValue()),this.addEvent()},getAxis:function(){return new o(this.getValue().getAxis().copy())},inverse:function(){return new s(r.inverse(this.getValue()))},multiply:function(t){return new s(r.multRight(this.getValue(),t.getValue()))},multVec:function(t){return new o(this.getValue().multVecRot(t.getValue().copy()))},slerp:function(t,e){return new s(r.slerp(this.getValue(),t.getValue(),e))},toStream:function(t){var e=n.Get(t),i=this.getValue();t.string+=i.x+" "+i.y+" "+i.z+" "+e.ToUnit("angle",i.angle)},toVRMLStream:function(t){this.toStream(t)},toXMLStream:function(t){this.toStream(t)}});var a={get:function(){return this.getValue().x},set:function(t){this.getValue().x=1*t,this.addEvent()},enumerable:!0,configurable:!1},u={get:function(){return this.getValue().y},set:function(t){this.getValue().y=1*t,this.addEvent()},enumerable:!0,configurable:!1},l={get:function(){return this.getValue().z},set:function(t){this.getValue().z=1*t,this.addEvent()},enumerable:!0,configurable:!1},c={get:function(){return this.getValue().angle},set:function(t){this.getValue().angle=1*t,this.addEvent()},enumerable:!0,configurable:!1};return Object.defineProperty(s.prototype,"x",a),Object.defineProperty(s.prototype,"y",u),Object.defineProperty(s.prototype,"z",l),Object.defineProperty(s.prototype,"angle",c),a.enumerable=!1,u.enumerable=!1,l.enumerable=!1,c.enumerable=!1,Object.defineProperty(s.prototype,"0",a),Object.defineProperty(s.prototype,"1",u),Object.defineProperty(s.prototype,"2",l),Object.defineProperty(s.prototype,"3",c),s}),define("x_ite/Fields/SFString",["x_ite/Basic/X3DField","x_ite/Bits/X3DConstants","x_ite/InputOutput/Generator"],function(t,e,i){"use strict";function n(e){return t.call(this,arguments.length?""+e:"")}return Object.assign(n,{unescape:function(t){return t.replace(/\\(.)/g,"$1")},escape:function(t){return t.replace(/([\\"])/g,"\\$1")}}),n.prototype=Object.assign(Object.create(t.prototype),{constructor:n,copy:function(){return new n(this.getValue())},getTypeName:function(){return"SFString"},getType:function(){return e.SFString},isDefaultValue:function(){return""===this.getValue()},set:function(e){t.prototype.set.call(this,""+e)},valueOf:t.prototype.getValue,toStream:function(t){t.string+='"'+n.escape(this.getValue())+'"'},toVRMLStream:function(t){this.toStream(t)},toXMLStream:function(t){t.string+=i.Get(t).XMLEncode(this.getValue())}}),Object.defineProperty(n.prototype,"length",{get:function(){return this.getValue().length},enumerable:!0,configurable:!1}),n}),define("x_ite/Fields/SFTime",["x_ite/Basic/X3DField","x_ite/Bits/X3DConstants"],function(t,e){"use strict";function i(e){return t.call(this,arguments.length?1*e:0)}return i.prototype=Object.assign(Object.create(t.prototype),{constructor:i,copy:function(){return new i(this.getValue())},getTypeName:function(){return"SFTime"},getType:function(){return e.SFTime},isDefaultValue:function(){return 0===this.getValue()},set:function(e){t.prototype.set.call(this,1*e)},valueOf:t.prototype.getValue,toStream:function(t){t.string+=String(this.getValue())},toVRMLStream:function(t){this.toStream(t)},toXMLStream:function(t){this.toStream(t)}}),i}),define("x_ite/Fields/SFVec4",["x_ite/Basic/X3DField","x_ite/Fields/SFVecPrototypeTemplate","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector4"],function(t,e,i,n){"use strict";function r(i,r){function s(e,i,r,s){switch(arguments.length){case 0:return t.call(this,new n(0,0,0,0));case 1:return t.call(this,arguments[0]);case 4:return t.call(this,new n(1*e,1*i,1*r,1*s))}throw new Error("Invalid arguments.")}s.prototype=Object.assign(Object.create(t.prototype),e(n),{constructor:s,getTypeName:function(){return i},getType:function(){return r}});var o={get:function(){return this.getValue().x},set:function(t){this.getValue().x=1*t,this.addEvent()},enumerable:!0,configurable:!1},a={get:function(){return this.getValue().y},set:function(t){this.getValue().y=1*t,this.addEvent()},enumerable:!0,configurable:!1},u={get:function(){return this.getValue().z},set:function(t){this.getValue().z=1*t,this.addEvent()},enumerable:!0,configurable:!1},l={get:function(){return this.getValue().w},set:function(t){this.getValue().w=1*t,this.addEvent()},enumerable:!0,configurable:!1};return Object.defineProperty(s.prototype,"x",o),Object.defineProperty(s.prototype,"y",a),Object.defineProperty(s.prototype,"z",u),Object.defineProperty(s.prototype,"w",l),o.enumerable=!1,a.enumerable=!1,u.enumerable=!1,l.enumerable=!1,Object.defineProperty(s.prototype,"0",o),Object.defineProperty(s.prototype,"1",a),Object.defineProperty(s.prototype,"2",u),Object.defineProperty(s.prototype,"3",l),s}return{SFVec4d:r("SFVec4d",i.SFVec4d),SFVec4f:r("SFVec4f",i.SFVec4f)}}),define("x_ite/Basic/X3DObjectArrayField",["jquery","x_ite/Basic/X3DField","x_ite/Basic/X3DArrayField","x_ite/Bits/X3DConstants","x_ite/InputOutput/Generator"],function(t,e,i,n,r){"use strict";function s(t){return i.call(this,[]),this._target=this,t[0]instanceof Array&&(t=t[0]),s.prototype.push.apply(this,t),new Proxy(this,o)}const o={get:function(t,e){const i=t[e];if(void 0!==i)return i;if("string"==typeof e){const i=t.getValue(),n=1*e;return Number.isInteger(n)?(n>=i.length&&t.resize(n+1),i[n].valueOf()):t[e]}const n=t.getValue();return e===Symbol.iterator?n[e]:void 0},set:function(t,e,i){if(e in t)return t[e]=i,!0;const n=t.getValue(),r=1*e;return r>=n.length&&t.resize(r+1),n[r].setValue(i),!0},has:function(t,e){return Number.isInteger(+e)?e<t.getValue().length:e in t}};return s.prototype=Object.assign(Object.create(i.prototype),{constructor:s,getTarget:function(){return this._target},copy:function(){const t=this._target,e=new t.constructor,i=t.getValue();return s.prototype.push.apply(e,i),e.setModificationTime(0),e},equals:function(t){const e=this._target,i=e.getValue(),n=t.getValue(),r=i.length;if(i===n)return!0;if(r!==n.length)return!1;for(let t=0;t<r;++t)if(!i[t].equals(n[t]))return!1;return!0},set:function(t){const i=this._target;i.resize(t.length,void 0,!0);const n=i.getValue();for(let i=0,r=t.length;i<r;++i)n[i].set(t[i]instanceof e?t[i].getValue():t[i])},isDefaultValue:function(){return 0===this.length},setValue:function(t){const e=this._target;e.set(t instanceof s?t.getValue():t),e.addEvent()},unshift:function(t){const e=this._target,i=e.getValue();for(let t=arguments.length-1;t>=0;--t){const n=new(e.getSingleType());n.setValue(arguments[t]),e.addChildObject(n),i.unshift(n)}return e.addEvent(),i.length},shift:function(){const t=this._target,e=t.getValue();if(e.length){const i=e.shift();return t.removeChildObject(i),t.addEvent(),i.valueOf()}},push:function(t){const e=this._target,i=e.getValue();for(const t of arguments){const n=new(e.getSingleType());n.setValue(t),e.addChildObject(n),i.push(n)}return e.addEvent(),i.length},pop:function(){const t=this._target,e=t.getValue();if(e.length){const i=e.pop();return t.removeChildObject(i),t.addEvent(),i.valueOf()}},splice:function(t,e){const i=this._target,n=i.getValue();t>n.length&&(t=n.length),t+e>n.length&&(e=n.length-t);const r=i.erase(t,t+e);return arguments.length>2&&i.insert(t,arguments,2,arguments.length),r},insert:function(t,e,i,n){const r=this._target,s=[t,0];for(let t=i;t<n;++t){const i=new(r.getSingleType());i.setValue(e[t]),r.addChildObject(i),s.push(i)}Array.prototype.splice.apply(r.getValue(),s),r.addEvent()},find:function(e,i,n){const r=this._target,s=r.getValue();if(t.isFunction(n)){for(let t=e;t<i;++t)if(n(s[t].valueOf()))return t;return i}for(let t=e;t<i;++t)if(s[t].equals(n))return t;return i},remove:function(e,i,n){const r=this._target,s=r.getValue();if(t.isFunction(n)){if((e=r.find(e,i,n))!==i)for(let t=e;++t<i;){const i=s[t];if(!n(i.valueOf())){const n=s[e];s[e++]=i,s[t]=n}}return e!==i&&r.addEvent(),e}if((e=r.find(e,i,n))!==i)for(let t=e;++t<i;){const i=s[t];if(!i.equals(n)){const n=s[e];s[e++]=i,s[t]=n}}return e!==i&&r.addEvent(),e},erase:function(t,e){const i=this._target,n=i.getValue().splice(t,e-t);for(const t of n)i.removeChildObject(t);return i.addEvent(),new i.constructor(n)},resize:function(t,e,i){const n=this._target,r=n.getValue();if(t<r.length){for(let e=t,i=r.length;e<i;++e)n.removeChildObject(r[e]);r.length=t,i||n.addEvent()}else if(t>r.length){for(let i=r.length;i<t;++i){const t=new(n.getSingleType());void 0!==e&&t.setValue(e),n.addChildObject(t),r.push(t)}i||n.addEvent()}},addChildObject:function(t){t.addParent(this._target)},removeChildObject:function(t){t.removeParent(this._target)},toStream:function(t){const e=this._target,i=e.getValue(),n=r.Get(t);switch(i.length){case 0:t.string+="[ ]";break;case 1:n.PushUnitCategory(e.getUnit()),i[0].toStream(t),n.PopUnitCategory();break;default:n.PushUnitCategory(e.getUnit()),t.string+="[\n",n.IncIndent();for(let e=0,r=i.length-1;e<r;++e)t.string+=n.Indent(),i[e].toStream(t),t.string+=",\n";t.string+=n.Indent(),i.at(-1).toStream(t),t.string+="\n",n.DecIndent(),t.string+=n.Indent(),t.string+="]",n.PopUnitCategory()}},toVRMLStream:function(t){this.toStream(t)},toXMLStream:function(t){const e=this._target;if(e.length){const i=r.Get(t),n=e.getValue();i.PushUnitCategory(e.getUnit());for(const e of n)e.toXMLStream(t),t.string+=", ";n.at(-1).toXMLStream(t),i.PopUnitCategory()}},dispose:function(){const t=this._target,e=t.getValue();for(const i of e)t.removeChildObject(i);e.length=0,i.prototype.dispose.call(t)}}),Object.defineProperty(s.prototype,"length",{get:function(){return this._target.getValue().length},set:function(t){this._target.resize(t)},enumerable:!1,configurable:!1}),s}),define("x_ite/Basic/X3DTypedArrayField",["x_ite/Basic/X3DArrayField","x_ite/Bits/X3DConstants","x_ite/InputOutput/Generator","standard/Math/Algorithm"],function(t,e,i,n){"use strict";function r(e){return t.call(this,new(this.getArrayType())(2)),this._target=this,this._tmp=[],e[0]instanceof Array&&(e=e[0]),r.prototype.push.apply(this,e),new Proxy(this,a)}function s(t,e,i){const n=this.getValue(),r=this._tmp;for(let e=0;e<i;++e,++t)r[e]=n[t];return e.set.apply(e,r),e}function o(t,e,i){const n=this.getValue();for(let r=0;r<i;++r,++t)n[t]=e[r];this.addEvent()}const a={get:function(t,e){const i=t[e];if(void 0!==i)return i;if("string"==typeof e){const i=1*e;if(Number.isInteger(i)){const e=t.getComponents(),n=t.getValueType();let r=t.getValue();if(i>=t._length&&(r=t.resize(i+1)),1===e)return n(r[i]);{const r=new n,a=r.getValue(),u=i*e;return r.addEvent=o.bind(t,u,a,e),r.getValue=s.bind(t,u,a,e),r}}return t[e]}return e===Symbol.iterator?function*(){const e=t.getValue(),i=t.getComponents(),n=t.getValueType();if(1===i)for(let i=0;i<t._length;++i)yield n(e[i]);else for(let e=0;e<t._length;++e){const r=new n,a=r.getValue(),u=e*i;r.addEvent=o.bind(t,u,a,i),r.getValue=s.bind(t,u,a,i),yield r}}:void 0},set:function(t,e,i){if(e in t)return t[e]=i,!0;const n=t.getComponents();let r=1*e,s=t.getValue();if(r>=t._length&&(s=t.resize(r+1)),1===n)s[r]=i;else{r*=n;for(let t=0;t<n;++t,++r)s[r]=i[t]}return t.addEvent(),!0},has:function(t,e){return Number.isInteger(+e)?e<t._length:e in t}};return r.prototype=Object.assign(Object.create(t.prototype),{constructor:r,_length:0,getTarget:function(){return this._target},copy:function(){const e=this._target,i=e.getValue(),n=new e.constructor,r=new(e.getArrayType())(i);return n._length=e._length,t.prototype.set.call(n,r,e._length),n.setModificationTime(0),n},equals:function(t){if(this===t)return!0;const e=this._target,i=e._length;if(i!==t._length)return!1;const n=e.getValue(),r=t.getValue();for(let t=0,s=i*e.getComponents();t<s;++t)if(n[t]!==r[t])return!1;return!0},assign:function(t){const e=this._target;e.set(t.getValue(),t.length),e.addEvent()},set:function(t,e){const i=this._target,n=i.getComponents(),r=i._length;let s=i.getValue(),o=void 0!==e?e*n:t.length;const a=o%n;a&&(o-=a,console.warn("Array length must be multiple of components size, which is "+n+".")),o/=n,s.length<t.length?(s=i.grow(t.length),s.set(t),a&&s.fill(0,o*n,o*n+a)):(s.set(t),o<r&&s.fill(0,o*n,r*n)),i._length=o},isDefaultValue:function(){return 0===this._length},setValue:function(t){const e=this._target;t instanceof e.constructor?e.assign(t):(e.set(t),e.addEvent())},unshift:function(t){const e=this._target,i=e.getComponents(),n=e._length,r=arguments.length,s=e.grow((n+r)*i);if(s.copyWithin(r*i,0,n*i),1===i)s.set(arguments,0);else for(let t=0,e=0;e<r;++e){const n=arguments[e];for(let e=0;e<i;++e,++t)s[t]=n[e]}return e._length+=r,e.addEvent(),s.length},shift:function(){const t=this._target,e=t._length;if(e){const n=t.getValue(),r=t.getComponents(),s=t.getValueType(),o=e-1;if(1===r)var i=s(n[0]);else{const e=t._tmp;for(let t=0;t<r;++t)e[t]=n[t];var i=Object.create(s.prototype);s.apply(i,e)}return n.copyWithin(0,r,e*r),n.fill(0,r*o,e*r),t._length=o,t.addEvent(),i}},push:function(t){const e=this._target,i=e.getComponents(),n=e._length,r=arguments.length,s=e.grow((n+r)*i);if(1===i)s.set(arguments,n);else for(let t=n*i,e=0;e<r;++e){const n=arguments[e];for(let e=0;e<i;++e,++t)s[t]=n[e]}return e._length+=r,e.addEvent(),e._length},pop:function(){const t=this._target,e=t._length;if(e){const n=t.getValue(),r=t.getComponents(),s=t.getValueType(),o=e-1;if(1===r)var i=s(n[e-1]);else{const e=t._tmp;for(let t=0,i=o*r;t<r;++t,++i)e[t]=n[i];var i=Object.create(s.prototype);s.apply(i,e)}return n.fill(0,o*r,e*r),t._length=o,t.addEvent(),i}},splice:function(t,e){const i=this._target,n=i._length;t>n&&(t=n),t+e>n&&(e=n-t);const r=i.erase(t,t+e);return arguments.length>2&&i.spliceInsert(t,Array.prototype.splice.call(arguments,2)),i.addEvent(),r},spliceInsert:function(t,e){const i=this._target,n=i.getComponents(),r=i._length,s=e.length,o=i.grow((r+s)*n);if(t*=n,o.copyWithin(t+s*n,t,r*n),1===n)o.set(e,t);else for(let i=0,r=t;i<s;++i){const t=e[i];for(let e=0;e<n;++e,++r)o[r]=t[e]}i._length+=s},insert:function(t,e,i,n){const r=this._target,s=r._length,o=e.getValue(),a=r.getComponents(),u=n-i,l=r.grow((s+u)*a);for(t*=a,i*=a,n*=a,l.copyWithin(t+u*a,t,s*a);i<n;++t,++i)l[t]=o[i];r._length+=u,r.addEvent()},erase:function(t,e){const i=this._target,n=i.getValue(),r=i.getComponents(),s=e-t,o=i._length,a=o-s,u=new i.constructor,l=u.grow(s*r);t*=r,e*=r;for(let i=0,r=t;r<e;++i,++r)l[i]=n[r];return n.copyWithin(t,e,o*r),n.fill(0,a*r,o*r),i._length=a,u._length=s,i.addEvent(),u},resize:function(t,e,i){const n=this._target,r=n._length,s=n.getComponents();let o=n.getValue();if(t<r)o.fill(0,t*s,r*s),i||n.addEvent();else if(t>r){if(o=n.grow(t*s),void 0!==e)if(1===s)o.fill(e,r*s,t*s);else for(let i=r*s,n=t*s;i<n;)for(let t=0;t<s;++t,++i)o[i]=e[t];i||n.addEvent()}return n._length=t,o},grow:function(e){const i=this._target,r=i.getValue();if(e<r.length)return r;const s=n.nextPowerOfTwo(e),o=new(i.getArrayType())(s);return o.set(r),t.prototype.set.call(i,o),o},shrinkToFit:function(){const e=this._target,i=e.getValue(),n=e._length*e.getComponents();if(i.length==n)return i;const r=i.subarray(0,n);return t.prototype.set.call(e,r),r},toStream:function(t){const e=this._target,n=i.Get(t),r=e.getValue(),s=e._length,o=e.getComponents(),a=new(e.getSingleType());switch(s){case 0:t.string+="[ ]";break;case 1:if(n.PushUnitCategory(e.getUnit()),1===o)a.set(r[0]),a.toStream(t);else{for(let t=0,e=0;t<o;++t,++e)a[t]=r[e];a.toStream(t)}n.PopUnitCategory();break;default:if(n.PushUnitCategory(e.getUnit()),t.string+="[\n",n.IncIndent(),1===o){for(let e=0,i=s-1;e<i;++e)t.string+=n.Indent(),a.set(r[e*o]),a.toStream(t),t.string+=",\n";t.string+=n.Indent(),a.set(r[(s-1)*o]),a.toStream(t),t.string+="\n"}else{for(let e=0,i=s-1;e<i;++e){t.string+=n.Indent();for(let t=0,i=e*o;t<o;++t,++i)a[t]=r[i];a.toStream(t),t.string+=",\n"}t.string+=n.Indent();for(let t=0,e=(s-1)*o;t<o;++t,++e)a[t]=r[e];a.toStream(t),t.string+="\n"}n.DecIndent(),t.string+=n.Indent(),t.string+="]",n.PopUnitCategory()}},toVRMLStream:function(t){this.toStream(t)},toXMLStream:function(t){const e=this._target,n=e._length;if(n){const r=i.Get(t),s=e.getValue(),o=e.getComponents(),a=new(e.getSingleType());if(r.PushUnitCategory(e.getUnit()),1===o){for(let e=0,i=n-1;e<i;++e)a.set(s[e*o]),a.toXMLStream(t),t.string+=", ";a.set(s[(n-1)*o]),a.toXMLStream(t)}else{for(let e=0,i=n-1;e<i;++e){for(let t=0,i=e*o;t<o;++t,++i)a[t]=s[i];a.toXMLStream(t),t.string+=", "}for(let t=0,e=(n-1)*o;t<o;++t,++e)a[t]=s[e];a.toXMLStream(t)}r.PopUnitCategory()}},dispose:function(){t.prototype.dispose.call(this._target)}}),Object.defineProperty(r.prototype,"length",{get:function(){return this._length},set:function(t){this._target.resize(t)},enumerable:!1,configurable:!1}),r}),define("x_ite/Fields/ArrayFields",["x_ite/Fields/SFBool","x_ite/Fields/SFColor","x_ite/Fields/SFColorRGBA","x_ite/Fields/SFDouble","x_ite/Fields/SFFloat","x_ite/Fields/SFImage","x_ite/Fields/SFInt32","x_ite/Fields/SFMatrix3","x_ite/Fields/SFMatrix4","x_ite/Fields/SFNode","x_ite/Fields/SFRotation","x_ite/Fields/SFString","x_ite/Fields/SFTime","x_ite/Fields/SFVec2","x_ite/Fields/SFVec3","x_ite/Fields/SFVec4","x_ite/Basic/X3DObjectArrayField","x_ite/Basic/X3DTypedArrayField","x_ite/Bits/X3DConstants","x_ite/InputOutput/Generator"],function(t,e,i,n,r,s,o,a,u,l,c,h,d,p,f,g,m,_,x,y){"use strict";function v(t){return m.call(this,arguments)}function w(t){return m.call(this,arguments)}function b(t,e,i,n,r,s){function o(t){return _.call(this,arguments)}return o.prototype=Object.assign(Object.create(_.prototype),{constructor:o,getSingleType:function(){return i},getValueType:function(){return n},getArrayType:function(){return r},getComponents:function(){return s},getTypeName:function(){return t},getType:function(){return e}}),o}function S(t){return t}const C=a.SFMatrix3d,T=a.SFMatrix3f,F=u.SFMatrix4d,O=u.SFMatrix4f,N=p.SFVec2d,E=p.SFVec2f,M=f.SFVec3d,D=f.SFVec3f,V=g.SFVec4d,I=g.SFVec4f;return v.prototype=Object.assign(Object.create(m.prototype),{constructor:v,_cloneCount:0,getSingleType:function(){return l},getValueType:function(){return l},getArrayType:function(){return Array},getComponents:function(){return 1},getTypeName:function(){return"MFNode"},getType:function(){return x.MFNode},clone:function(){const t=new v;return t.setValue(this),t.setModificationTime(0),t},copy:function(t){const e=new v;for(const i of this.getValue())e.push(i.copy(t));return e.setModificationTime(0),e},addCloneCount:function(t){this._cloneCount+=t;for(const e of this.getValue())e.addCloneCount(t)},removeCloneCount:function(t){this._cloneCount+=t;for(const e of this.getValue())e.removeCloneCount(t)},addChildObject:function(t){m.prototype.addChildObject.call(this,t),t.addCloneCount(this._cloneCount)},removeChildObject:function(t){m.prototype.removeChildObject.call(this,t),t.removeCloneCount(this._cloneCount)},toStream:function(t){const e=this._target,i=e.getValue(),n=y.Get(t);switch(i.length){case 0:t.string+="[ ]";break;case 1:n.PushUnitCategory(e.getUnit()),i[0].toStream(t),n.PopUnitCategory();break;default:n.PushUnitCategory(e.getUnit()),t.string+="[\n",n.IncIndent();for(let e=0,r=i.length;e<r;++e)t.string+=n.Indent(),i[e].toStream(t),t.string+="\n";n.DecIndent(),t.string+=n.Indent(),t.string+="]",n.PopUnitCategory()}},toVRMLString:function(){this.addCloneCount(1);const t=m.prototype.toVRMLString.call(this);return this.removeCloneCount(1),t},toVRMLStream:function(t){const e=this._target,i=e.getValue(),n=y.Get(t);switch(i.length){case 0:t.string+="[ ]";break;case 1:n.EnterScope(),i[0].toVRMLStream(t),n.LeaveScope();break;default:n.EnterScope(),t.string+="[\n",n.IncIndent();for(const e of i)t.string+=n.Indent(),e.toVRMLStream(t),t.string+="\n";n.DecIndent(),t.string+=n.Indent(),t.string+="]",n.LeaveScope()}},toXMLString:function(){this.addCloneCount(1);const t=m.prototype.toXMLString.call(this);return this.removeCloneCount(1),t},toXMLStream:function(t){const e=y.Get(t),i=this.length;if(i){e.EnterScope();const n=this.getValue();for(let r=0,s=i-1;r<s;++r){const i=n[r].getValue();if(i)i.toXMLStream(t),t.string+="\n";else{t.string+=e.Indent(),t.string+="<",t.string+="NULL";const i=e.ContainerField();i&&(t.string+=" ",t.string+="containerField='",t.string+=e.XMLEncode(i.getName()),t.string+="'"),t.string+="/>"}}const r=n.at(-1).getValue();if(r)r.toXMLStream(t);else{t.string+=e.Indent(),t.string+="<",t.string+="NULL";const i=e.ContainerField();i&&(t.string+=" ",t.string+="containerField='",t.string+=e.XMLEncode(i.getName()),t.string+="'")}e.LeaveScope()}}}),w.prototype=Object.assign(Object.create(m.prototype),{constructor:w,getValueType:function(){return String},getSingleType:function(){return h},getArrayType:function(){return Array},getComponents:function(){return 1},getTypeName:function(){return"MFString"},getType:function(){return x.MFString},toXMLStream:function(t){const e=this.length;if(e){const i=this.getValue();for(let n=0,r=e-1;n<r;++n)t.string+='"',i[n].toXMLStream(t),t.string+='"',t.string+=", ";t.string+='"',i.at(-1).toXMLStream(t),t.string+='"'}}}),{MFBool:b("MFBool",x.MFBool,t,Boolean,Uint8Array,1),MFColor:b("MFColor",x.MFColor,e,e,Float32Array,3),MFColorRGBA:b("MFColorRGBA",x.MFColorRGBA,i,i,Float32Array,4),MFDouble:b("MFDouble",x.MFDouble,n,S,Float64Array,1),MFFloat:b("MFFloat",x.MFFloat,r,S,Float32Array,1),MFImage:function(t,e,i,n,r,s){function o(t){return m.call(this,arguments)}return o.prototype=Object.assign(Object.create(m.prototype),{constructor:o,getSingleType:function(){return i},getValueType:function(){return n},getArrayType:function(){return r},getComponents:function(){return s},getTypeName:function(){return t},getType:function(){return e}}),o}("MFImage",x.MFImage,s,s,Array,1),MFInt32:b("MFInt32",x.MFInt32,o,S,Int32Array,1),MFMatrix3d:b("MFMatrix3d",x.MFMatrix3d,C,C,Float64Array,9),MFMatrix3f:b("MFMatrix3f",x.MFMatrix3f,T,T,Float32Array,9),MFMatrix4d:b("MFMatrix4d",x.MFMatrix4d,F,F,Float64Array,16),MFMatrix4f:b("MFMatrix4f",x.MFMatrix4f,O,O,Float32Array,16),MFNode:v,MFRotation:b("MFRotation",x.MFRotation,c,c,Float64Array,4),MFString:w,MFTime:b("MFTime",x.MFTime,d,S,Float64Array,1),MFVec2d:b("MFVec2d",x.MFVec2d,N,N,Float64Array,2),MFVec2f:b("MFVec2f",x.MFVec2f,E,E,Float32Array,2),MFVec3d:b("MFVec3d",x.MFVec3d,M,M,Float64Array,3),MFVec3f:b("MFVec3f",x.MFVec3f,D,D,Float32Array,3),MFVec4d:b("MFVec4d",x.MFVec4d,V,V,Float64Array,4),MFVec4f:b("MFVec4f",x.MFVec4f,I,I,Float32Array,4)}}),define("x_ite/Fields",["x_ite/Fields/SFBool","x_ite/Fields/SFColor","x_ite/Fields/SFColorRGBA","x_ite/Fields/SFDouble","x_ite/Fields/SFFloat","x_ite/Fields/SFImage","x_ite/Fields/SFInt32","x_ite/Fields/SFMatrix3","x_ite/Fields/SFMatrix4","x_ite/Fields/SFNode","x_ite/Fields/SFRotation","x_ite/Fields/SFString","x_ite/Fields/SFTime","x_ite/Fields/SFVec2","x_ite/Fields/SFVec3","x_ite/Fields/SFVec4","x_ite/Fields/ArrayFields"],function(t,e,i,n,r,s,o,a,u,l,c,h,d,p,f,g,m){"use strict";return Object.assign({SFBool:t,SFColor:e,SFColorRGBA:i,SFDouble:n,SFFloat:r,SFImage:s,SFInt32:o,SFMatrix3d:a.SFMatrix3d,SFMatrix3f:a.SFMatrix3f,SFMatrix4d:u.SFMatrix4d,SFMatrix4f:u.SFMatrix4f,SFNode:l,SFRotation:c,SFString:h,SFTime:d,SFVec2d:p.SFVec2d,SFVec2f:p.SFVec2f,SFVec3d:f.SFVec3d,SFVec3f:f.SFVec3f,SFVec4d:g.SFVec4d,SFVec4f:g.SFVec4f,VrmlMatrix:u.VrmlMatrix},m)}),define("x_ite/Browser/VERSION",[],function(){return"4.7.6"}),define("x_ite/DEBUG",[],function(){"use strict";return!1}),define("x_ite/Base/X3DEventObject",["x_ite/Base/X3DChildObject","x_ite/Base/Events"],function(t,e){"use strict";function i(e){t.call(this),this._browser=e}return i.prototype=Object.assign(Object.create(t.prototype),{constructor:i,getBrowser:function(){return this._browser},getExtendedEventHandling:function(){return!0},addEvent:function(t){t.getTainted()||(t.setTainted(!0),this.addEventObject(t,e.create(t)))},addEventObject:function(t,e){const i=this.getBrowser();i.addBrowserEvent(),i.addTaintedField(t,e),this.getTainted()||(t.isInput()||this.getExtendedEventHandling()&&!t.isOutput())&&this.addNodeEvent()},addNodeEvent:function(){if(!this.getTainted()){const t=this.getBrowser();this.setTainted(!0),t.addTaintedNode(this),t.addBrowserEvent()}},processEvents:function(){this.setTainted(!1),this.processInterests()}}),i}),define("x_ite/Basic/X3DBaseNode",["x_ite/Base/X3DEventObject","x_ite/Base/Events","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Fields","x_ite/Bits/X3DConstants","x_ite/InputOutput/Generator"],function(t,e,i,n,r,s,o){"use strict";function a(e){if(!this.hasOwnProperty("_executionContext")){t.call(this,e.getBrowser()),this._executionContext=e,this._type=[s.X3DBaseNode],this._fields=new Map,this._predefinedFields=new Map,this._aliases=new Map,this._userDefinedFields=new Map,this._cloneCount=0,this.hasUserDefinedFields()&&(this.fieldDefinitions=new n(this.fieldDefinitions.getValue().slice()));for(const t of this.fieldDefinitions)this.addField(t)}}return a.prototype=Object.assign(Object.create(t.prototype),{constructor:a,fieldDefinitions:new n([]),_private:!1,_live:!0,_initialized:!1,setExecutionContext:function(t){this._executionContext=t},getExecutionContext:function(){return this._executionContext},getScene:function(){let t=this._executionContext;for(;!t.isRootContext();)t=t.getExecutionContext();return t},getMainScene:function(){let t=this._executionContext.getScene();for(;!t.isMainContext();)t=t.getScene();return t},addType:function(t){this._type.push(t)},getType:function(){return this._type},isType:function(t){for(const e of this._type)if(t.has(e))return!0;return!1},getInnerNode:function(){return this},isLive:function(){function t(){return this.isLive_}return function(){return this.isLive=t,this.addChildObjects("isLive",new r.SFBool(this.getLiveState())),this.isLive_.removeParent(this),this._executionContext!==this&&this._executionContext.isLive().addInterest("_set_live__",this),this.isLive()}}(),setLive:function(t){this._live=t.valueOf(),this._set_live__()},getLive:function(){return this._live},getLiveState:function(){return this!==this._executionContext?this.getLive()&&this._executionContext.isLive().getValue():this.getLive()},_set_live__:function(){const t=this.getLiveState(),i=this.isLive();if(t){if(i.getValue())return;i.setValue(!0),i.processEvent(e.create(i))}else i.getValue()&&(i.setValue(!1),i.processEvent(e.create(i)))},setInitialized:function(t){this._initialized=t},isInitialized:function(){return this._initialized},setup:function(){this._initialized||(this._initialized=!0,this._fields.forEach(t=>t.setTainted(!1)),this.initialize())},initialize:function(){},create:function(t){return new this.constructor(t)},copy:function(t){const e=t.getBody(),i=this.getName();if(i.length){const t=e.getNamedNodes().get(i);if(t)return t}const n=this.create(e);return i.length&&e.updateNamedNode(i,n),this.getPredefinedFields().forEach(function(e){try{const i=n.getField(e.getName());if(e.hasReferences())e.getReferences().forEach(function(e){try{i.addReference(t.getField(e.getName()))}catch(t){console.error(t.message)}});else if(e.getAccessType()&s.initializeOnly)switch(e.getType()){case s.SFNode:case s.MFNode:i.set(e.copy(t).getValue());break;default:i.set(e.getValue(),e.length)}i.setModificationTime(e.getModificationTime())}catch(t){console.log(t.message)}},this),this.getUserDefinedFields().forEach(function(e){const i=e.copy(t);n.addUserDefinedField(e.getAccessType(),e.getName(),i),e.hasReferences()&&e.getReferences().forEach(function(e){try{i.addReference(t.getField(e.getName()))}catch(i){console.error("No reference '"+e.getName()+"' inside execution context "+t.getTypeName()+" '"+t.getName()+"'.")}}),i.setModificationTime(e.getModificationTime())}),n.setup(),n},flatCopy:function(t){const e=this.create(t||this.getExecutionContext());return this._fields.forEach(function(t){e._fields.get(t.getName()).assign(t)}),e.setup(),e},addChildObjects:function(t,e){for(let t=0,e=arguments.length;t<e;t+=2)this.addChildObject(arguments[t],arguments[t+1])},addChildObject:function(t,e){e.addParent(this),e.setName(t),Object.defineProperty(this,t+"_",{get:function(){return e},set:function(t){e.setValue(t)},enumerable:!0,configurable:!1})},addField:function(t){const e=t.accessType,i=t.name,n=t.value.clone();n.setTainted(!0),n.addParent(this),n.setName(i),n.setAccessType(e),this.setField(i,n)},setField:function(t,e,i){this._fields.set(t,e),this.getPrivate()||e.addCloneCount(1),i?this._userDefinedFields.set(t,e):(this._predefinedFields.set(t,e),Object.defineProperty(this,t+"_",{get:function(){return e},set:function(t){e.setValue(t)},enumerable:!0,configurable:!0}))},removeField:function(t){const e=this._fields.get(t);if(e){this._fields.delete(t),this._userDefinedFields.delete(t);const i=this.fieldDefinitions.getValue();for(let e=0,n=i.length;e<n;++e)if(i[e].name===t){i.splice(e,1);break}this.getPrivate()||e.removeCloneCount(1)}},getField:function(){return function(t){const e=this._fields.get(t)||this._aliases.get(t);if(e)return e;const i=t.match(/^set_(.*?)$/);if(i){const t=this._fields.get(i[1])||this._aliases.get(i[1]);if(t&&t.getAccessType()===s.inputOutput)return t}else{const e=t.match(/^(.*?)_changed$/);if(e){const t=this._fields.get(e[1])||this._aliases.get(e[1]);if(t&&t.getAccessType()===s.inputOutput)return t}}throw new Error("Unknown field '"+t+"' in node class "+this.getTypeName()+".")}}(),addAlias:function(t,e){this._aliases.set(t,e)},getFieldDefinitions:function(){return this.fieldDefinitions},hasUserDefinedFields:function(){return!1},addUserDefinedField:function(t,e,n){this._fields.has(e)&&this.removeField(e),n.setTainted(!0),n.addParent(this),n.setName(e),n.setAccessType(t),this.fieldDefinitions.add(new i(t,e,n)),this.setField(e,n,!0)},getUserDefinedFields:function(){return this._userDefinedFields},getPredefinedFields:function(){return this._predefinedFields},getChangedFields:function(t){const e=[],i=this.getPredefinedFields();if(t){const t=this.getUserDefinedFields();t.forEach(function(t){e.push(t)})}return i.forEach(function(i){if(t&&(i.getInputRoutes().size||i.getOutputRoutes().size))return void e.push(i);if(0===i.getReferences().size){if(!i.isInitializable())return;if(this.isDefaultValue(i))return}e.push(i)},this),e},isDefaultValue:function(t){const e=this.getFieldDefinitions().get(t.getName());return e?e.value.equals(t):!t.getModificationTime()},getFields:function(){return this._fields},getSourceText:function(){return null},hasRoutes:function(){for(const t of this._fields.values()){if(t.getInputRoutes().size)return!0;if(t.getOutputRoutes().size)return!0}return!1},getPrivate:function(){return this._private},setPrivate:function(t){this._private=t,t?this._fields.forEach(function(t){t.removeCloneCount(1)}):this._fields.forEach(function(t){t.addCloneCount(1)})},getCloneCount:function(){return this._cloneCount},addCloneCount:function(t){0!==t&&(this._cloneCount+=t)},removeCloneCount:function(t){0!==t&&(this._cloneCount-=t)},traverse:function(){},toStream:function(t){t.string+=this.getTypeName()+" { }"},toVRMLStream:function(t){const e=o.Get(t);if(e.IsSharedNode(this))return void(t.string+="NULL");e.EnterScope();const i=e.Name(this);if(i.length&&e.ExistsNode(this))return t.string+="USE",t.string+=" ",t.string+=i,void e.LeaveScope();i.length&&(e.AddNode(this),t.string+="DEF",t.string+=" ",t.string+=i,t.string+=" "),
|
|
10
10
|
t.string+=this.getTypeName(),t.string+=" ",t.string+="{";const n=this.getChangedFields(),r=this.getUserDefinedFields();let s=0,a=0;this.hasUserDefinedFields()&&(r.forEach(function(t){s=Math.max(s,t.getTypeName().length),a=Math.max(a,e.AccessType(t.getAccessType()).length)}),r.size&&(t.string+="\n",e.IncIndent(),r.forEach(function(e){this.toVRMLStreamUserDefinedField(t,e,s,a),t.string+="\n"},this),e.DecIndent(),0!==n.length&&(t.string+="\n"))),0===n.length?r.size?t.string+=e.Indent():t.string+=" ":(0===r.size&&(t.string+="\n"),e.IncIndent(),n.forEach(function(e){this.toVRMLStreamField(t,e,s,a),t.string+="\n"},this),e.DecIndent(),t.string+=e.Indent()),t.string+="}",e.LeaveScope()},toVRMLStreamField:function(t,e,i,n){const r=o.Get(t);if(0!==e.getReferences().size&&r.ExecutionContext()){let i=0,n=!1;e.getReferences().forEach(function(s){n=n||s.isInitializable(),t.string+=r.Indent(),t.string+=e.getName(),t.string+=" ",t.string+="IS",t.string+=" ",t.string+=s.getName(),++i!==e.getReferences().size&&(t.string+="\n")}),e.getAccessType()!==s.inputOutput||n||this.isDefaultValue(e)||(t.string+="\n",t.string+=r.Indent(),t.string+=e.getName(),t.string+=" ",e.toVRMLStream(t))}else e.isInitializable()&&(t.string+=r.Indent(),t.string+=e.getName(),t.string+=" ",e.toVRMLStream(t))},toVRMLStreamUserDefinedField:function(t,e,i,n){const r=o.Get(t);if(0!==e.getReferences().size&&r.ExecutionContext()){let o=0,a=!1;e.getReferences().forEach(function(s){a=a||s.isInitializable(),t.string+=r.Indent(),t.string+=r.PadRight(r.AccessType(e.getAccessType()),n),t.string+=" ",t.string+=r.PadRight(e.getTypeName(),i),t.string+=" ",t.string+=e.getName(),t.string+=" ",t.string+="IS",t.string+=" ",t.string+=s.getName(),++o!==e.getReferences().size&&(t.string+="\n")}),e.getAccessType()!==s.inputOutput||a||e.isDefaultValue()||(t.string+="\n",t.string+=r.Indent(),t.string+=r.PadRight(r.AccessType(e.getAccessType()),n),t.string+=" ",t.string+=r.PadRight(e.getTypeName(),i),t.string+=" ",t.string+=e.getName(),e.isInitializable()&&(t.string+=" ",e.toVRMLStream(t)))}else t.string+=r.Indent(),t.string+=r.PadRight(r.AccessType(e.getAccessType()),n),t.string+=" ",t.string+=r.PadRight(e.getTypeName(),i),t.string+=" ",t.string+=e.getName(),e.isInitializable()&&(t.string+=" ",e.toVRMLStream(t))},toXMLStream:function(t){const e=o.Get(t);if(e.IsSharedNode(this))return t.string+=e.Indent(),void(t.string+="<!-- NULL -->");e.EnterScope();const i=e.Name(this);if(i.length&&e.ExistsNode(this)){t.string+=e.Indent(),t.string+="<",t.string+=this.getTypeName(),t.string+=" ",t.string+="USE='",t.string+=e.XMLEncode(i),t.string+="'";const n=e.ContainerField();return n&&n.getName()!==this.getContainerField()&&(t.string+=" ",t.string+="containerField='",t.string+=e.XMLEncode(n.getName()),t.string+="'"),t.string+="/>",void e.LeaveScope()}t.string+=e.Indent(),t.string+="<",t.string+=this.getTypeName(),i.length&&(e.AddNode(this),t.string+=" ",t.string+="DEF='",t.string+=e.XMLEncode(i),t.string+="'");const n=e.ContainerField();n&&n.getName()!==this.getContainerField()&&(t.string+=" ",t.string+="containerField='",t.string+=e.XMLEncode(n.getName()),t.string+="'");const r=this.getChangedFields(),a=this.getUserDefinedFields(),u=[],l=[],c=this.getSourceText();c&&0===c.length&&(c=null),e.IncIndent(),e.IncIndent();for(const i of r){let n=!1;if(e.ExecutionContext()&&i.getAccessType()===s.inputOutput&&0!==i.getReferences().size){let t=!1;i.getReferences().forEach(function(e){t=t||e.isInitializable()}),t||(n=!this.isDefaultValue(i))}if(0===i.getReferences().size||!e.ExecutionContext()||n){if(n&&u.push(i),i.isInitializable())switch(i.getType()){case s.SFNode:case s.MFNode:l.push(i);break;default:if(i===c)break;t.string+="\n",t.string+=e.Indent(),t.string+=i.getName(),t.string+="='",i.toXMLStream(t),t.string+="'"}}else u.push(i)}if(e.DecIndent(),e.DecIndent(),this.hasUserDefinedFields()&&0!==a.size||0!==u.length||0!==l.length||c){if(t.string+=">\n",e.IncIndent(),this.hasUserDefinedFields()&&a.forEach(function(i){t.string+=e.Indent(),t.string+="<field",t.string+=" ",t.string+="accessType='",t.string+=e.AccessType(i.getAccessType()),t.string+="'",t.string+=" ",t.string+="type='",t.string+=i.getTypeName(),t.string+="'",t.string+=" ",t.string+="name='",t.string+=e.XMLEncode(i.getName()),t.string+="'";let n=!1;if(i.getAccessType()===s.inputOutput&&0!==i.getReferences().size){let t=!1;i.getReferences().forEach(function(e){t=t||e.isInitializable()}),t||(n=!0)}if(0===i.getReferences().size||!e.ExecutionContext()||n)if(n&&e.ExecutionContext()&&u.push(i),!i.isInitializable()||i.isDefaultValue())t.string+="/>\n";else switch(i.getType()){case s.SFNode:case s.MFNode:e.PushContainerField(i),t.string+=">\n",e.IncIndent(),i.toXMLStream(t),t.string+="\n",e.DecIndent(),t.string+=e.Indent(),t.string+="</field>\n",e.PopContainerField();break;default:t.string+=" ",t.string+="value='",i.toXMLStream(t),t.string+="'",t.string+="/>\n"}else e.ExecutionContext()&&u.push(i),t.string+="/>\n"}),u.length){t.string+=e.Indent(),t.string+="<IS>",t.string+="\n",e.IncIndent();for(const i of u){const n=i.getReferences();n.forEach(function(n){t.string+=e.Indent(),t.string+="<connect",t.string+=" ",t.string+="nodeField='",t.string+=e.XMLEncode(i.getName()),t.string+="'",t.string+=" ",t.string+="protoField='",t.string+=e.XMLEncode(n.getName()),t.string+="'",t.string+="/>\n"})}e.DecIndent(),t.string+=e.Indent(),t.string+="</IS>\n"}for(const i of l)e.PushContainerField(i),i.toXMLStream(t),t.string+="\n",e.PopContainerField();if(c)for(const i of c)t.string+="<![CDATA[",t.string+=e.escapeCDATA(i),t.string+="]]>\n";e.DecIndent(),t.string+=e.Indent(),t.string+="</",t.string+=this.getTypeName(),t.string+=">"}else t.string+="/>";e.LeaveScope()},dispose:function(){const t=this.getPredefinedFields(),e=this.getUserDefinedFields();t.forEach(function(t){t.dispose()}),e.forEach(function(t){t.dispose()}),new Set(this.getParents()).forEach(function(t){if(t instanceof r.SFNode){const e=new Set(t.getParents());e.forEach(function(e){if(e instanceof r.MFNode){const i=e.length;e.erase(e.remove(0,i,t),i)}}),t.setValue(null)}})}}),a}),define("x_ite/Browser/Core/PrimitiveQuality",[],function(){"use strict";let t=0;return{LOW:t++,MEDIUM:t++,HIGH:t++}}),define("x_ite/Browser/Core/Shading",[],function(){"use strict";let t=0;return{POINT:t++,WIREFRAME:t++,FLAT:t++,GOURAUD:t++,PHONG:t++}}),define("x_ite/Browser/Core/TextureQuality",[],function(){"use strict";let t=0;return{LOW:t++,MEDIUM:t++,HIGH:t++}}),define("x_ite/Components/Core/X3DNode",["x_ite/Basic/X3DBaseNode","x_ite/Bits/X3DConstants"],function(t,e){"use strict";function i(i){t.call(this,i),this.addType(e.X3DNode)}return i.prototype=Object.assign(Object.create(t.prototype),{constructor:i}),i}),define("x_ite/Components/Core/X3DChildNode",["x_ite/Fields","x_ite/Components/Core/X3DNode","x_ite/Bits/X3DConstants"],function(t,e,i){"use strict";function n(n){this.getExecutionContext()||(e.call(this,n),this.addType(i.X3DChildNode),this.addChildObjects("isCameraObject",new t.SFBool),this.addChildObjects("isPickableObject",new t.SFBool),this.isCameraObject_.setAccessType(i.outputOnly),this.isPickableObject_.setAccessType(i.outputOnly))}return n.prototype=Object.assign(Object.create(e.prototype),{constructor:n,setCameraObject:function(t){t!==this.isCameraObject_.getValue()&&(this.isCameraObject_=t)},getCameraObject:function(){return this.isCameraObject_.getValue()},setPickableObject:function(t){t!==this.isPickableObject_.getValue()&&(this.isPickableObject_=t)},getPickableObject:function(){return this.isPickableObject_.getValue()}}),n}),define("x_ite/Components/Core/X3DBindableNode",["x_ite/Fields","x_ite/Components/Core/X3DChildNode","x_ite/Bits/X3DConstants"],function(t,e,i){"use strict";function n(n){e.call(this,n),this.addType(i.X3DBindableNode),this.addChildObjects("transitionActive",new t.SFBool)}return n.prototype=Object.assign(Object.create(e.prototype),{constructor:n,getCameraObject:function(){return!0},transitionStart:function(){}}),n}),define("x_ite/Components/Core/X3DSensorNode",["x_ite/Components/Core/X3DChildNode","x_ite/Bits/X3DConstants"],function(t,e){"use strict";function i(i){t.call(this,i),this.addType(e.X3DSensorNode)}return i.prototype=Object.assign(Object.create(t.prototype),{constructor:i}),i}),define("x_ite/Components/Time/X3DTimeDependentNode",["x_ite/Fields","x_ite/Components/Core/X3DChildNode","x_ite/Bits/X3DConstants"],function(t,e,i){"use strict";function n(e){this.addType(i.X3DTimeDependentNode),this.addChildObjects("initialized",new t.SFTime,"isEvenLive",new t.SFBool),this.startTimeValue=0,this.pauseTimeValue=0,this.resumeTimeValue=0,this.stopTimeValue=0,this.start=0,this.pause=0,this.pauseInterval=0,this.startTimeout=null,this.pauseTimeout=null,this.resumeTimeout=null,this.stopTimeout=null,this.disabled=!1}return n.prototype=Object.assign(Object.create(e.prototype),{constructor:n,initialize:function(){e.prototype.initialize.call(this),this.isLive().addInterest("set_live__",this),this.isEvenLive_.addInterest("_set_live__",this),this.initialized_.addInterest("set_loop__",this),this.enabled_.addInterest("set_enabled__",this),this.loop_.addInterest("set_loop__",this),this.startTime_.addInterest("set_startTime__",this),this.pauseTime_.addInterest("set_pauseTime__",this),this.resumeTime_.addInterest("set_resumeTime__",this),this.stopTime_.addInterest("set_stopTime__",this),this.startTimeValue=this.startTime_.getValue(),this.pauseTimeValue=this.pauseTime_.getValue(),this.resumeTimeValue=this.resumeTime_.getValue(),this.stopTimeValue=this.stopTime_.getValue(),this.initialized_=this.getBrowser().getCurrentTime()},getDisabled:function(){return this.disabled},getLiveState:function(){return this.getLive()&&(this.getExecutionContext().isLive().getValue()||this.isEvenLive_.getValue())},getElapsedTime:function(){return this.getBrowser().getCurrentTime()-this.start-this.pauseInterval},resetElapsedTime:function(){this.start=this.getBrowser().getCurrentTime(),this.pause=this.getBrowser().getCurrentTime(),this.pauseInterval=0},set_live__:function(){this.isLive().getValue()?this.disabled&&(this.disabled=!1,this.isActive_.getValue()&&!this.isPaused_.getValue()&&this.real_resume()):this.disabled||!this.isActive_.getValue()||this.isPaused_.getValue()||(this.disabled=!0,this.real_pause())},set_enabled__:function(){this.enabled_.getValue()?this.set_loop__():this.stop()},set_loop__:function(){this.enabled_.getValue()&&this.loop_.getValue()&&this.stopTimeValue<=this.startTimeValue&&this.startTimeValue<=this.getBrowser().getCurrentTime()&&this.do_start()},set_startTime__:function(){this.startTimeValue=this.startTime_.getValue(),this.enabled_.getValue()&&(this.removeTimeout("startTimeout"),this.startTimeValue<=this.getBrowser().getCurrentTime()?this.do_start():this.addTimeout("startTimeout","do_start",this.startTimeValue))},set_pauseTime__:function(){if(this.pauseTimeValue=this.pauseTime_.getValue(),this.enabled_.getValue()){if(this.removeTimeout("pauseTimeout"),this.pauseTimeValue<=this.resumeTimeValue)return;this.pauseTimeValue<=this.getBrowser().getCurrentTime()?this.do_pause():this.addTimeout("pauseTimeout","do_pause",this.pauseTimeValue)}},set_resumeTime__:function(){if(this.resumeTimeValue=this.resumeTime_.getValue(),this.enabled_.getValue()){if(this.removeTimeout("resumeTimeout"),this.resumeTimeValue<=this.pauseTimeValue)return;this.resumeTimeValue<=this.getBrowser().getCurrentTime()?this.do_resume():this.addTimeout("resumeTimeout","do_resume",this.resumeTimeValue)}},set_stopTime__:function(){if(this.stopTimeValue=this.stopTime_.getValue(),this.enabled_.getValue()){if(this.removeTimeout("stopTimeout"),this.stopTimeValue<=this.startTimeValue)return;this.stopTimeValue<=this.getBrowser().getCurrentTime()?this.do_stop():this.addTimeout("stopTimeout","do_stop",this.stopTimeValue)}},do_start:function(){this.isActive_.getValue()||(this.resetElapsedTime(),this.isActive_=!0,this.set_start(),this.isLive().getValue()?this.getBrowser().timeEvents().addInterest("set_time",this):(this.disabled=!0,this.real_pause()),this.elapsedTime_=0)},do_pause:function(){this.isActive_.getValue()&&!this.isPaused_.getValue()&&(this.isPaused_=!0,this.pauseTimeValue!==this.getBrowser().getCurrentTime()&&(this.pauseTimeValue=this.getBrowser().getCurrentTime()),this.isLive().getValue()&&this.real_pause())},real_pause:function(){this.pause=performance.now(),this.set_pause(),this.getBrowser().timeEvents().removeInterest("set_time",this)},do_resume:function(){this.isActive_.getValue()&&this.isPaused_.getValue()&&(this.isPaused_=!1,this.resumeTimeValue!==this.getBrowser().getCurrentTime()&&(this.resumeTimeValue=this.getBrowser().getCurrentTime()),this.isLive().getValue()&&this.real_resume())},real_resume:function(){var t=(performance.now()-this.pause)/1e3;this.pauseInterval+=t,this.set_resume(t),this.getBrowser().timeEvents().addInterest("set_time",this),this.getBrowser().addBrowserEvent()},do_stop:function(){this.stop()},stop:function(){this.isActive_.getValue()&&(this.set_stop(),this.elapsedTime_=this.getElapsedTime(),this.isPaused_.getValue()&&(this.isPaused_=!1),this.isActive_=!1,this.isLive().getValue()&&this.getBrowser().timeEvents().removeInterest("set_time",this))},timeout:function(t){this.enabled_.getValue()&&(this.getBrowser().advanceTime(performance.now()),this[t]())},addTimeout:function(t,e,i){this.removeTimeout(t),this[t]=setTimeout(this.timeout.bind(this,e),1e3*(i-this.getBrowser().getCurrentTime()))},removeTimeout:function(t){clearTimeout(this[t]),this[t]=null},set_start:function(){},set_pause:function(){},set_resume:function(){},set_stop:function(){},set_time:function(){}}),n}),define("x_ite/Components/Time/TimeSensor",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Core/X3DSensorNode","x_ite/Components/Time/X3DTimeDependentNode","x_ite/Bits/X3DConstants","standard/Math/Algorithm"],function(t,e,i,n,r,s,o){"use strict";function a(e){n.call(this,e),r.call(this,e),this.addType(s.TimeSensor),this.addChildObjects("range",new t.MFFloat(0,0,1)),this.cycle=0,this.interval=0,this.fraction=0,this.first=0,this.last=1,this.scale=1}return a.prototype=Object.assign(Object.create(n.prototype),r.prototype,{constructor:a,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOutput,"enabled",new t.SFBool(!0)),new e(s.inputOutput,"cycleInterval",new t.SFTime(1)),new e(s.inputOutput,"loop",new t.SFBool),new e(s.inputOutput,"startTime",new t.SFTime),new e(s.inputOutput,"resumeTime",new t.SFTime),new e(s.inputOutput,"pauseTime",new t.SFTime),new e(s.inputOutput,"stopTime",new t.SFTime),new e(s.outputOnly,"isPaused",new t.SFBool),new e(s.outputOnly,"isActive",new t.SFBool),new e(s.outputOnly,"cycleTime",new t.SFTime),new e(s.outputOnly,"elapsedTime",new t.SFTime),new e(s.outputOnly,"fraction_changed",new t.SFFloat),new e(s.outputOnly,"time",new t.SFTime)]),getTypeName:function(){return"TimeSensor"},getComponentName:function(){return"Time"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),r.prototype.initialize.call(this),this.cycleInterval_.addInterest("set_cycleInterval__",this),this.range_.addInterest("set_range__",this)},setRange:function(t,e,i){var n=this.getBrowser().getCurrentTime(),r=this.startTime_.getValue(),s=this.cycleInterval_.getValue();this.first=e,this.last=i,this.scale=this.last-this.first,this.interval=s*this.scale,this.fraction=o.fract((t>=1?0:t)+(this.interval?(n-r)/this.interval:0)),this.cycle=n-(this.fraction-this.first)*s},set_cycleInterval__:function(){this.isActive_.getValue()&&this.setRange(this.fraction,this.range_[1],this.range_[2])},set_range__:function(){this.isActive_.getValue()&&(this.setRange(this.range_[0],this.range_[1],this.range_[2]),this.isPaused_.getValue()||this.set_fraction(this.getBrowser().getCurrentTime()))},set_start:function(){this.setRange(this.range_[0],this.range_[1],this.range_[2]),this.fraction_changed_=this.fraction,this.time_=this.getBrowser().getCurrentTime()},set_resume:function(t){var e=this.getBrowser().getCurrentTime(),i=this.startTime_.getValue();this.setRange(this.interval?o.fract(this.fraction-(e-i)/this.interval):0,this.range_[1],this.range_[2])},set_fraction:function(t){this.fraction_changed_=this.fraction=this.first+(this.interval?o.fract((t-this.cycle)/this.interval):0)*this.scale},set_time:function(){var t=this.getBrowser().getCurrentTime();t-this.cycle>=this.interval?this.loop_.getValue()?this.interval&&(this.cycle+=this.interval*Math.floor((t-this.cycle)/this.interval),this.elapsedTime_=this.getElapsedTime(),this.cycleTime_=t,this.set_fraction(t)):(this.fraction_changed_=this.fraction=this.last,this.stop()):(this.elapsedTime_=this.getElapsedTime(),this.set_fraction(t)),this.time_=t}}),a}),define("x_ite/Components/Interpolation/X3DInterpolatorNode",["x_ite/Components/Core/X3DChildNode","x_ite/Bits/X3DConstants","standard/Math/Algorithm"],function(t,e,i){"use strict";function n(i){t.call(this,i),this.addType(e.X3DInterpolatorNode)}return n.prototype=Object.assign(Object.create(t.prototype),{constructor:n,setup:function(){this.set_key__(),this.key_.length&&this.interpolate(0,0,0),t.prototype.setup.call(this)},initialize:function(){t.prototype.initialize.call(this),this.set_fraction_.addInterest("set_fraction__",this),this.key_.addInterest("set_key__",this)},set_fraction__:function(){var t=this.key_,e=t.length,n=this.set_fraction_.getValue();switch(e){case 0:return;case 1:return this.interpolate(0,0,0);default:if(n<=t[0])return this.interpolate(0,1,0);var r=i.upperBound(t,0,e,n,i.less);if(r!==e){var s=r-1,o=(n-t[s])/(t[r]-t[s]);this.interpolate(s,r,i.clamp(o,0,1))}else this.interpolate(e-2,e-1,1)}},set_key__:function(){this.set_keyValue__()},set_keyValue__:function(){},interpolate:function(){}}),n}),define("x_ite/Components/Interpolation/EaseInEaseOut",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Interpolation/X3DInterpolatorNode","x_ite/Bits/X3DConstants"],function(t,e,i,n,r){"use strict";function s(t){n.call(this,t),this.addType(r.EaseInEaseOut)}return s.prototype=Object.assign(Object.create(n.prototype),{constructor:s,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOnly,"set_fraction",new t.SFFloat),new e(r.inputOutput,"key",new t.MFFloat),new e(r.inputOutput,"easeInEaseOut",new t.MFVec2f),new e(r.outputOnly,"modifiedFraction_changed",new t.SFFloat)]),getTypeName:function(){return"EaseInEaseOut"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.easeInEaseOut_.addInterest("set_keyValue__",this)},set_keyValue__:function(){this.easeInEaseOut_.length<this.key_.length&&this.easeInEaseOut_.resize(this.key_.length,this.easeInEaseOut_.length?this.easeInEaseOut_[this.easeInEaseOut_.length-1]:new t.SFVec2f)},interpolate:function(t,e,i){var n=this.easeInEaseOut_[t].y,r=this.easeInEaseOut_[e].x,s=n+r;if(s<0)this.modifiedFraction_changed_=i;else{s>1&&(r/=s,n/=s);var o=1/(2-n-r);if(i<n)this.modifiedFraction_changed_=o/n*i*i;else if(i<=1-r)this.modifiedFraction_changed_=o*(2*i-n);else{var a=1-i;this.modifiedFraction_changed_=1-o*a*a/r}}}}),s}),define("x_ite/Components/Interpolation/PositionInterpolator",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Interpolation/X3DInterpolatorNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.PositionInterpolator)}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOnly,"set_fraction",new t.SFFloat),new e(r.inputOutput,"key",new t.MFFloat),new e(r.inputOutput,"keyValue",new t.MFVec3f),new e(r.outputOnly,"value_changed",new t.SFVec3f)]),getTypeName:function(){return"PositionInterpolator"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.keyValue_.addInterest("set_keyValue__",this)},set_keyValue__:function(){var e=this.key_,i=this.keyValue_;i.length<e.length&&i.resize(e.length,i.length?i[i.length-1]:new t.SFVec3f)},interpolate:function(){var t=new s(0,0,0);return function(e,i,n){this.value_changed_=t.assign(this.keyValue_[e].getValue()).lerp(this.keyValue_[i].getValue(),n)}}()}),o}),define("x_ite/Components/Interpolation/OrientationInterpolator",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Interpolation/X3DInterpolatorNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Rotation4"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.OrientationInterpolator),this.keyValue_.setUnit("angle"),this.value_changed_.setUnit("angle")}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOnly,"set_fraction",new t.SFFloat),new e(r.inputOutput,"key",new t.MFFloat),new e(r.inputOutput,"keyValue",new t.MFRotation),new e(r.outputOnly,"value_changed",new t.SFRotation)]),getTypeName:function(){return"OrientationInterpolator"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.keyValue_.addInterest("set_keyValue__",this)},set_keyValue__:function(){const e=this.key_,i=this.keyValue_;i.length<e.length&&i.resize(e.length,i.length?i[i.length-1]:new t.SFRotation)},interpolate:function(){const t=new s(0,0,1,0),e=new s(0,0,1,0);return function(i,n,r){try{t.assign(this.keyValue_[i].getValue()),e.assign(this.keyValue_[n].getValue()),this.value_changed_=t.slerp(e,r)}catch(t){}}}()}),o}),define("x_ite/Bits/TraverseType",[],function(){"use strict";var t=0;return{POINTER:t++,CAMERA:t++,PICKING:t++,COLLISION:t++,SHADOW:t++,DISPLAY:t++}}),define("x_ite/Components/Navigation/X3DViewpointNode",["x_ite/Fields","x_ite/Components/Core/X3DBindableNode","x_ite/Components/Time/TimeSensor","x_ite/Components/Interpolation/EaseInEaseOut","x_ite/Components/Interpolation/PositionInterpolator","x_ite/Components/Interpolation/OrientationInterpolator","x_ite/Bits/TraverseType","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4"],function(t,e,i,n,r,s,o,a,u,l,c){"use strict";function h(o){e.call(this,o),this.addType(a.X3DViewpointNode),this.addChildObjects("positionOffset",new t.SFVec3f,"orientationOffset",new t.SFRotation,"scaleOffset",new t.SFVec3f(1,1,1),"scaleOrientationOffset",new t.SFRotation,"centerOfRotationOffset",new t.SFVec3f,"fieldOfViewScale",new t.SFFloat(1)),this.userPosition=new u(0,1,0),this.userOrientation=new l(0,0,1,0),this.userCenterOfRotation=new u(0,0,0),this.modelMatrix=new c,this.cameraSpaceMatrix=new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,10,1),this.viewMatrix=new c(1,0,0,0,0,1,0,0,0,0,1,0,0,0,-10,1);const h=this.getBrowser();this.timeSensor=new i(h.getPrivateScene()),this.easeInEaseOut=new n(h.getPrivateScene()),this.positionInterpolator=new r(h.getPrivateScene()),this.orientationInterpolator=new s(h.getPrivateScene()),this.scaleInterpolator=new r(h.getPrivateScene()),this.scaleOrientationInterpolator=new s(h.getPrivateScene())}return h.prototype=Object.assign(Object.create(e.prototype),{constructor:h,initialize:function(){e.prototype.initialize.call(this),this.timeSensor.stopTime_=1,this.timeSensor.setup(),this.easeInEaseOut.key_=new t.MFFloat(0,1),this.easeInEaseOut.easeInEaseOut_=new t.MFVec2f(new t.SFVec2f(0,0),new t.SFVec2f(0,0)),this.easeInEaseOut.setup(),this.positionInterpolator.key_=new t.MFFloat(0,1),this.orientationInterpolator.key_=new t.MFFloat(0,1),this.scaleInterpolator.key_=new t.MFFloat(0,1),this.scaleOrientationInterpolator.key_=new t.MFFloat(0,1),this.positionInterpolator.setup(),this.orientationInterpolator.setup(),this.scaleInterpolator.setup(),this.scaleOrientationInterpolator.setup(),this.timeSensor.isActive_.addFieldInterest(this.transitionActive_),this.timeSensor.fraction_changed_.addFieldInterest(this.easeInEaseOut.set_fraction_),this.easeInEaseOut.modifiedFraction_changed_.addFieldInterest(this.positionInterpolator.set_fraction_),this.easeInEaseOut.modifiedFraction_changed_.addFieldInterest(this.orientationInterpolator.set_fraction_),this.easeInEaseOut.modifiedFraction_changed_.addFieldInterest(this.scaleInterpolator.set_fraction_),this.easeInEaseOut.modifiedFraction_changed_.addFieldInterest(this.scaleOrientationInterpolator.set_fraction_),this.positionInterpolator.value_changed_.addFieldInterest(this.positionOffset_),this.orientationInterpolator.value_changed_.addFieldInterest(this.orientationOffset_),this.scaleInterpolator.value_changed_.addFieldInterest(this.scaleOffset_),this.scaleOrientationInterpolator.value_changed_.addFieldInterest(this.scaleOrientationOffset_),this.isBound_.addInterest("set_bound__",this)},getEaseInEaseOut:function(){return this.easeInEaseOut},setInterpolators:function(){},getPosition:function(){return this.position_.getValue()},getUserPosition:function(){return this.userPosition.assign(this.getPosition()).add(this.positionOffset_.getValue())},getOrientation:function(){return this.orientation_.getValue()},getUserOrientation:function(){return this.userOrientation.assign(this.getOrientation()).multRight(this.orientationOffset_.getValue())},getCenterOfRotation:function(){return this.centerOfRotation_.getValue()},getUserCenterOfRotation:function(){return this.userCenterOfRotation.assign(this.getCenterOfRotation()).add(this.centerOfRotationOffset_.getValue())},getProjectionMatrix:function(t){const e=t.getNavigationInfo();return this.getProjectionMatrixWithLimits(e.getNearValue(),e.getFarValue(this),t.getLayer().getViewport().getRectangle(t.getBrowser()))},getCameraSpaceMatrix:function(){return this.cameraSpaceMatrix},getViewMatrix:function(){return this.viewMatrix},getModelMatrix:function(){return this.modelMatrix},getMaxFarValue:function(){return this.getBrowser().getRenderingProperty("LogarithmicDepthBuffer")?1e10:1e5},getUpVector:function(){return u.yAxis},getSpeedFactor:function(){return 1},setVRMLTransition:function(t){this.VRMLTransition=t},getVRMLTransition:function(){return this.VRMLTransition},transitionStart:function(){const e=new u(0,0,0),i=new l(0,0,1,0),n=new u(0,0,0),r=new l(0,0,1,0);return function(s,o,a){try{if(this.to=a,a.jump_.getValue()){a.retainUserOffsets_.getValue()||a.resetUserOffsets(),this!==a&&a.getFields().forEach(function(t){this.getFields().get(t.getName()).assign(t)}.bind(this));const u=s.getNavigationInfo(),l=u.transitionTime_.getValue();let c=u.getTransitionType();switch("2.0"==this.getExecutionContext().getSpecificationVersion()&&(c=a.getVRMLTransition()?"LINEAR":"TELEPORT"),a.setVRMLTransition(!1),l<=0&&(c="TELEPORT"),c){case"TELEPORT":return void(u.transitionComplete_=!0);case"ANIMATE":this.easeInEaseOut.easeInEaseOut_=new t.MFVec2f(new t.SFVec2f(0,1),new t.SFVec2f(1,0));break;default:this.easeInEaseOut.easeInEaseOut_=new t.MFVec2f(new t.SFVec2f(0,0),new t.SFVec2f(0,0))}this.timeSensor.cycleInterval_=l,this.timeSensor.stopTime_=this.getBrowser().getCurrentTime(),this.timeSensor.startTime_=this.getBrowser().getCurrentTime(),this.timeSensor.isActive_.addInterest("set_active__",this,u),a.getRelativeTransformation(o,e,i,n,r),this.positionInterpolator.keyValue_=new t.MFVec3f(e,a.positionOffset_),this.orientationInterpolator.keyValue_=new t.MFRotation(i,a.orientationOffset_),this.scaleInterpolator.keyValue_=new t.MFVec3f(n,a.scaleOffset_),this.scaleOrientationInterpolator.keyValue_=new t.MFRotation(r,a.scaleOrientationOffset_),this.positionOffset_=e,this.orientationOffset_=i,this.scaleOffset_=n,this.scaleOrientationOffset_=r,this.setInterpolators(o,a),this.transitionActive_=!0}else a.getRelativeTransformation(o,e,i,n,r),a.positionOffset_=e,a.orientationOffset_=i,a.scaleOffset_=n,a.scaleOrientationOffset_=r,a.setInterpolators(o,a)}catch(t){console.log(t)}}}(),transitionStop:function(){this.timeSensor.stopTime_=this.getBrowser().getCurrentTime(),this.timeSensor.isActive_.removeInterest("set_active__",this)},resetUserOffsets:function(){this.positionOffset_=u.Zero,this.orientationOffset_=l.Identity,this.scaleOffset_=u.One,this.scaleOrientationOffset_=l.Identity,this.centerOfRotationOffset_=u.Zero,this.fieldOfViewScale_=1},getRelativeTransformation:function(t,e,i,n,r){this.modelMatrix.copy().multRight(t.getViewMatrix()).inverse().get(e,i,n,r),e.subtract(this.getPosition()),i.assign(this.getOrientation().copy().inverse().multRight(i))},lookAtPoint:function(t,e,i,n){try{this.getCameraSpaceMatrix().multVecMatrix(e),c.inverse(this.getModelMatrix()).multVecMatrix(e);const r=2*t.getNavigationInfo().getNearValue();this.lookAt(t,e,r,i,n)}catch(t){console.error(t)}},lookAtBBox:function(t,e,i,n){try{e=e.copy().multRight(c.inverse(this.getModelMatrix()));const r=2*t.getNavigationInfo().getNearValue();this.lookAt(t,e.center,r,i,n)}catch(t){console.log(t)}},lookAt:function(e,i,n,r,s){const o=i.copy().add(this.getUserOrientation().multVecRot(new u(0,0,n))).subtract(this.getPosition());e.getNavigationInfo().transitionStart_=!0,this.timeSensor.cycleInterval_=.2,this.timeSensor.stopTime_=this.getBrowser().getCurrentTime(),this.timeSensor.startTime_=this.getBrowser().getCurrentTime(),this.timeSensor.isActive_.addInterest("set_active__",this,e.getNavigationInfo()),this.easeInEaseOut.easeInEaseOut_=new t.MFVec2f(new t.SFVec2f(0,1),new t.SFVec2f(1,0));const a=u.lerp(this.positionOffset_.getValue(),o,r),c=u.add(this.getPosition(),a).subtract(i);let h=l.multRight(this.orientationOffset_.getValue(),new l(this.getUserOrientation().multVecRot(new u(0,0,1)),c));s&&(h=l.inverse(this.getOrientation()).multRight(this.straightenHorizon(l.multRight(this.getOrientation(),h)))),this.positionInterpolator.keyValue_=new t.MFVec3f(this.positionOffset_,a),this.orientationInterpolator.keyValue_=new t.MFRotation(this.orientationOffset_,h),this.scaleInterpolator.keyValue_=new t.MFVec3f(this.scaleOffset_,this.scaleOffset_),this.scaleOrientationInterpolator.keyValue_=new t.MFRotation(this.scaleOrientationOffset_,this.scaleOrientationOffset_),this.setInterpolators(this,this),this.centerOfRotationOffset_=u.subtract(i,this.getCenterOfRotation()),this.set_bind_=!0},straighten:function(e,i){e.getNavigationInfo().transitionStart_=!0,this.timeSensor.cycleInterval_=.4,this.timeSensor.stopTime_=this.getBrowser().getCurrentTime(),this.timeSensor.startTime_=this.getBrowser().getCurrentTime(),this.timeSensor.isActive_.addInterest("set_active__",this,e.getNavigationInfo()),this.easeInEaseOut.easeInEaseOut_=new t.MFVec2f(new t.SFVec2f(0,1),new t.SFVec2f(1,0));const n=l.multRight(l.inverse(this.getOrientation()),this.straightenHorizon(this.getUserOrientation()));this.positionInterpolator.keyValue_=new t.MFVec3f(this.positionOffset_,this.positionOffset_),this.orientationInterpolator.keyValue_=new t.MFRotation(this.orientationOffset_,n),this.scaleInterpolator.keyValue_=new t.MFVec3f(this.scaleOffset_,this.scaleOffset_),this.scaleOrientationInterpolator.keyValue_=new t.MFRotation(this.scaleOrientationOffset_,this.scaleOrientationOffset_),this.setInterpolators(this,this),this.set_bind_=!0},straightenHorizon:function(){const t=new u(0,0,0),e=new u(0,0,0),i=new l(0,0,1,0);return function(n){n.multVecRot(t.assign(u.xAxis).negate()),n.multVecRot(e.assign(u.zAxis));const r=this.getUpVector(),s=e.cross(r);return Math.abs(e.dot(r))>=1?n:Math.abs(s.dot(t))>=1?n:(i.setFromToVec(t,s),n.multRight(i))}}(),set_active__:function(t,e){this.isBound_.getValue()&&!t.getValue()&&1===this.timeSensor.fraction_changed_.getValue()&&(e.transitionComplete_=!0)},set_bound__:function(){this.isBound_.getValue()?this.getBrowser().getNotification().string_=this.description_:this.timeSensor.stopTime_=this.getBrowser().getCurrentTime()},
|
|
11
11
|
traverse:function(t,e){t===o.CAMERA&&(e.getLayer().getViewpoints().push(this),this.modelMatrix.assign(e.getModelViewMatrix().get()))},update:function(){try{this.cameraSpaceMatrix.set(this.getUserPosition(),this.getUserOrientation(),this.scaleOffset_.getValue(),this.scaleOrientationOffset_.getValue()),this.cameraSpaceMatrix.multRight((this.to||this).modelMatrix),this.viewMatrix.assign(this.cameraSpaceMatrix).inverse()}catch(t){console.log(t)}}}),h}),define("x_ite/Components/Interpolation/ScalarInterpolator",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Interpolation/X3DInterpolatorNode","x_ite/Bits/X3DConstants","standard/Math/Algorithm"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.ScalarInterpolator)}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOnly,"set_fraction",new t.SFFloat),new e(r.inputOutput,"key",new t.MFFloat),new e(r.inputOutput,"keyValue",new t.MFFloat),new e(r.outputOnly,"value_changed",new t.SFFloat)]),getTypeName:function(){return"ScalarInterpolator"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.keyValue_.addInterest("set_keyValue__",this)},set_keyValue__:function(){var t=this.key_,e=this.keyValue_;e.length<t.length&&e.resize(t.length,e.length?e[e.length-1]:0)},interpolate:function(t,e,i){this.value_changed_=s.lerp(this.keyValue_[t],this.keyValue_[e],i)}}),o}),define("standard/Math/Geometry/Camera",["standard/Math/Numbers/Vector3"],function(t){"use strict";return{frustum:function(t,e,i,n,r,s,o){const a=e-t,u=n-i,l=s-r,c=2*r,h=(e+t)/a,d=(n+i)/u,p=-(s+r)/l,f=-(c*s)/l,g=c/a,m=c/u;return o.set(g,0,0,0,0,m,0,0,h,d,p,-1,0,0,f,0)},perspective:function(t,e,i,n,r,s){const o=Math.tan(t/2)*e;if(n>r){const t=n*o/r;return this.frustum(-t,t,-o,o,e,i,s)}{const t=r*o/n;return this.frustum(-o,o,-t,t,e,i,s)}},perspective2:function(t,e,i,n,r,s){const o=Math.tan(t/2)*e;return this.frustum(-o,o,-o,o,e,i,s)},ortho:function(t,e,i,n,r,s,o){const a=e-t,u=n-i,l=s-r,c=2/a,h=2/u,d=-2/l,p=-(e+t)/a,f=-(n+i)/u,g=-(s+r)/l;return o.set(c,0,0,0,0,h,0,0,0,0,d,0,p,f,g,1)},orthoBox:function(){const e=new t(0,0,0),i=new t(0,0,0);return function(t,n){return t.getExtents(e,i),this.ortho(e.x,i.x,e.y,i.y,-i.z,-e.z,n)}}()}}),define("x_ite/Components/Navigation/OrthoViewpoint",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Navigation/X3DViewpointNode","x_ite/Components/Interpolation/ScalarInterpolator","x_ite/Bits/X3DConstants","standard/Math/Geometry/Camera","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3","standard/Math/Numbers/Matrix4"],function(t,e,i,n,r,s,o,a,u,l){"use strict";function c(e){n.call(this,e),this.addType(s.OrthoViewpoint),this.addChildObjects("fieldOfViewOffset",new t.MFFloat(0,0,0,0)),this.position_.setUnit("length"),this.centerOfRotation_.setUnit("length"),this.fieldOfView_.setUnit("length"),this.projectionMatrix=new l,this.fieldOfViewOffsetInterpolator0=new r(this.getBrowser().getPrivateScene()),this.fieldOfViewOffsetInterpolator1=new r(this.getBrowser().getPrivateScene()),this.fieldOfViewOffsetInterpolator2=new r(this.getBrowser().getPrivateScene()),this.fieldOfViewOffsetInterpolator3=new r(this.getBrowser().getPrivateScene()),this.fieldOfViewScaleInterpolator=new r(this.getBrowser().getPrivateScene())}return c.prototype=Object.assign(Object.create(n.prototype),{constructor:c,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOnly,"set_bind",new t.SFBool),new e(s.inputOutput,"description",new t.SFString),new e(s.inputOutput,"position",new t.SFVec3f(0,0,10)),new e(s.inputOutput,"orientation",new t.SFRotation),new e(s.inputOutput,"centerOfRotation",new t.SFVec3f),new e(s.inputOutput,"fieldOfView",new t.MFFloat(-1,-1,1,1)),new e(s.inputOutput,"jump",new t.SFBool(!0)),new e(s.inputOutput,"retainUserOffsets",new t.SFBool),new e(s.outputOnly,"isBound",new t.SFBool),new e(s.outputOnly,"bindTime",new t.SFTime)]),getTypeName:function(){return"OrthoViewpoint"},getComponentName:function(){return"Navigation"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.fieldOfView_.addInterest("set_fieldOfView__",this),this.fieldOfViewOffset_.addInterest("set_fieldOfView__",this),this.fieldOfViewScale_.addInterest("set_fieldOfView__",this),this.fieldOfViewOffsetInterpolator0.key_=new t.MFFloat(0,1),this.fieldOfViewOffsetInterpolator1.key_=new t.MFFloat(0,1),this.fieldOfViewOffsetInterpolator2.key_=new t.MFFloat(0,1),this.fieldOfViewOffsetInterpolator3.key_=new t.MFFloat(0,1),this.fieldOfViewScaleInterpolator.key_=new t.MFFloat(0,1),this.fieldOfViewOffsetInterpolator0.setup(),this.fieldOfViewOffsetInterpolator1.setup(),this.fieldOfViewOffsetInterpolator2.setup(),this.fieldOfViewOffsetInterpolator3.setup(),this.fieldOfViewScaleInterpolator.setup(),this.getEaseInEaseOut().modifiedFraction_changed_.addFieldInterest(this.fieldOfViewOffsetInterpolator0.set_fraction_),this.getEaseInEaseOut().modifiedFraction_changed_.addFieldInterest(this.fieldOfViewOffsetInterpolator1.set_fraction_),this.getEaseInEaseOut().modifiedFraction_changed_.addFieldInterest(this.fieldOfViewOffsetInterpolator2.set_fraction_),this.getEaseInEaseOut().modifiedFraction_changed_.addFieldInterest(this.fieldOfViewOffsetInterpolator3.set_fraction_),this.getEaseInEaseOut().modifiedFraction_changed_.addFieldInterest(this.fieldOfViewScaleInterpolator.set_fraction_),this.fieldOfViewOffsetInterpolator0.value_changed_.addInterest("set_fieldOfViewOffset__",this),this.fieldOfViewOffsetInterpolator1.value_changed_.addInterest("set_fieldOfViewOffset__",this),this.fieldOfViewOffsetInterpolator2.value_changed_.addInterest("set_fieldOfViewOffset__",this),this.fieldOfViewOffsetInterpolator3.value_changed_.addInterest("set_fieldOfViewOffset__",this),this.fieldOfViewScaleInterpolator.value_changed_.addFieldInterest(this.fieldOfViewScale_),this.set_fieldOfView__()},set_fieldOfView__:function(){var t=this.fieldOfView_.length,e=this.fieldOfViewScale_.getValue();this.minimumX=((t>0?this.fieldOfView_[0]:-1)+this.fieldOfViewOffset_[0])*e,this.minimumY=((t>1?this.fieldOfView_[1]:-1)+this.fieldOfViewOffset_[1])*e,this.maximumX=((t>2?this.fieldOfView_[2]:1)+this.fieldOfViewOffset_[2])*e,this.maximumY=((t>3?this.fieldOfView_[3]:1)+this.fieldOfViewOffset_[3])*e,this.sizeX=this.maximumX-this.minimumX,this.sizeY=this.maximumY-this.minimumY},set_fieldOfViewOffset__:function(){this.fieldOfViewOffset_[0]=this.fieldOfViewOffsetInterpolator0.value_changed_.getValue(),this.fieldOfViewOffset_[1]=this.fieldOfViewOffsetInterpolator1.value_changed_.getValue(),this.fieldOfViewOffset_[2]=this.fieldOfViewOffsetInterpolator2.value_changed_.getValue(),this.fieldOfViewOffset_[3]=this.fieldOfViewOffsetInterpolator3.value_changed_.getValue()},setInterpolators:function(e,i){if(e.getType().indexOf(s.OrthoViewpoint)>=0){const n=i.fieldOfView_.length,r=e.fieldOfView_.length,s=(r>0?e.fieldOfView_[0]:-1)-(n>0?i.fieldOfView_[0]:-1),o=(r>1?e.fieldOfView_[1]:-1)-(n>1?i.fieldOfView_[1]:-1),a=(r>2?e.fieldOfView_[2]:1)-(n>2?i.fieldOfView_[2]:1),u=(r>3?e.fieldOfView_[3]:1)-(n>3?i.fieldOfView_[3]:1);this.fieldOfViewOffsetInterpolator0.keyValue_=new t.MFFloat(s,i.fieldOfViewOffset_[0]),this.fieldOfViewOffsetInterpolator1.keyValue_=new t.MFFloat(o,i.fieldOfViewOffset_[1]),this.fieldOfViewOffsetInterpolator2.keyValue_=new t.MFFloat(a,i.fieldOfViewOffset_[2]),this.fieldOfViewOffsetInterpolator3.keyValue_=new t.MFFloat(u,i.fieldOfViewOffset_[3]),this.fieldOfViewScaleInterpolator.keyValue_=new t.MFFloat(e.fieldOfViewScale_.getValue(),i.fieldOfViewScale_.getValue()),this.fieldOfViewOffset_[0]=s,this.fieldOfViewOffset_[1]=o,this.fieldOfViewOffset_[2]=a,this.fieldOfViewOffset_[3]=u,this.fieldOfViewScale_=e.fieldOfViewScale_.getValue()}else this.fieldOfViewOffsetInterpolator0.keyValue_=new t.MFFloat(i.fieldOfViewOffset_[0],i.fieldOfViewOffset_[0]),this.fieldOfViewOffsetInterpolator1.keyValue_=new t.MFFloat(i.fieldOfViewOffset_[1],i.fieldOfViewOffset_[1]),this.fieldOfViewOffsetInterpolator2.keyValue_=new t.MFFloat(i.fieldOfViewOffset_[2],i.fieldOfViewOffset_[2]),this.fieldOfViewOffsetInterpolator3.keyValue_=new t.MFFloat(i.fieldOfViewOffset_[3],i.fieldOfViewOffset_[3]),this.fieldOfViewScaleInterpolator.keyValue_=new t.MFFloat(i.fieldOfViewScale_.getValue(),i.fieldOfViewScale_.getValue()),this.fieldOfViewOffset_=i.fieldOfViewOffset_.getValue(),this.fieldOfViewScale_=i.fieldOfViewScale_.getValue()},getMinimumX:function(){return this.minimumX},getMinimumY:function(){return this.minimumY},getMaximumX:function(){return this.maximumX},getMaximumY:function(){return this.maximumY},getSizeX:function(){return this.sizeX},getSizeY:function(){return this.sizeY},getMaxFarValue:function(){return 1e5},getScreenScale:function(){var t=new u(0,0,0);return function(e,i){var n=i[2],r=i[3],s=this.sizeX,o=this.sizeY;if(n/r>s/o){var a=o/r;return t.set(a,a,a)}var a=s/n;return t.set(a,a,a)}}(),getViewportSize:function(){var t=new a(0,0);return function(e,i){var n=e[2],r=e[3],s=this.sizeX,o=this.sizeY,a=n/r;return a>s/o?t.set(o*a,o):t.set(s,s/a)}}(),getLookAtDistance:function(t){return t.size.abs()/2+10},getProjectionMatrixWithLimits:function(t,e,i){var n=i[2],r=i[3],s=n/r,a=this.sizeX,u=this.sizeY;if(s>a/u){var l=(this.minimumX+this.maximumX)/2,c=u*s/2;return o.ortho(l-c,l+c,this.minimumY,this.maximumY,t,e,this.projectionMatrix)}var l=(this.minimumY+this.maximumY)/2,c=a/s/2;return o.ortho(this.minimumX,this.maximumX,l-c,l+c,t,e,this.projectionMatrix)}}),c});var libtess={};if(libtess.DEBUG=!1,libtess.assert=function(t,e){if(libtess.DEBUG&&!t)throw new Error("Assertion failed"+(e?": "+e:""))},libtess.GLU_TESS_MAX_COORD=1e150,libtess.TRUE_PROJECT=!1,libtess.GLU_TESS_DEFAULT_TOLERANCE=0,libtess.windingRule={GLU_TESS_WINDING_ODD:100130,GLU_TESS_WINDING_NONZERO:100131,GLU_TESS_WINDING_POSITIVE:100132,GLU_TESS_WINDING_NEGATIVE:100133,GLU_TESS_WINDING_ABS_GEQ_TWO:100134},libtess.primitiveType={GL_LINE_LOOP:2,GL_TRIANGLES:4,GL_TRIANGLE_STRIP:5,GL_TRIANGLE_FAN:6},libtess.errorType={GLU_TESS_MISSING_BEGIN_POLYGON:100151,GLU_TESS_MISSING_END_POLYGON:100153,GLU_TESS_MISSING_BEGIN_CONTOUR:100152,GLU_TESS_MISSING_END_CONTOUR:100154,GLU_TESS_COORD_TOO_LARGE:100155,GLU_TESS_NEED_COMBINE_CALLBACK:100156},libtess.gluEnum={GLU_TESS_BEGIN:100100,GLU_TESS_VERTEX:100101,GLU_TESS_END:100102,GLU_TESS_ERROR:100103,GLU_TESS_EDGE_FLAG:100104,GLU_TESS_COMBINE:100105,GLU_TESS_BEGIN_DATA:100106,GLU_TESS_VERTEX_DATA:100107,GLU_TESS_END_DATA:100108,GLU_TESS_ERROR_DATA:100109,GLU_TESS_EDGE_FLAG_DATA:100110,GLU_TESS_COMBINE_DATA:100111,GLU_TESS_MESH:100112,GLU_TESS_TOLERANCE:100142,GLU_TESS_WINDING_RULE:100140,GLU_TESS_BOUNDARY_ONLY:100141,GLU_INVALID_ENUM:100900,GLU_INVALID_VALUE:100901},libtess.PQHandle,libtess.geom={},libtess.geom.vertEq=function(t,e){return t.s===e.s&&t.t===e.t},libtess.geom.vertLeq=function(t,e){return t.s<e.s||t.s===e.s&&t.t<=e.t},libtess.geom.edgeEval=function(t,e,i){var n=e.s-t.s,r=i.s-e.s;return n+r>0?n<r?e.t-t.t+(t.t-i.t)*(n/(n+r)):e.t-i.t+(i.t-t.t)*(r/(n+r)):0},libtess.geom.edgeSign=function(t,e,i){var n=e.s-t.s,r=i.s-e.s;return n+r>0?(e.t-i.t)*n+(e.t-t.t)*r:0},libtess.geom.transLeq=function(t,e){return t.t<e.t||t.t===e.t&&t.s<=e.s},libtess.geom.transEval=function(t,e,i){var n=e.t-t.t,r=i.t-e.t;return n+r>0?n<r?e.s-t.s+(t.s-i.s)*(n/(n+r)):e.s-i.s+(i.s-t.s)*(r/(n+r)):0},libtess.geom.transSign=function(t,e,i){var n=e.t-t.t,r=i.t-e.t;return n+r>0?(e.s-i.s)*n+(e.s-t.s)*r:0},libtess.geom.edgeGoesLeft=function(t){return libtess.geom.vertLeq(t.dst(),t.org)},libtess.geom.edgeGoesRight=function(t){return libtess.geom.vertLeq(t.org,t.dst())},libtess.geom.vertL1dist=function(t,e){return Math.abs(t.s-e.s)+Math.abs(t.t-e.t)},libtess.geom.vertCCW=function(t,e,i){return t.s*(e.t-i.t)+e.s*(i.t-t.t)+i.s*(t.t-e.t)>=0},libtess.geom.interpolate_=function(t,e,i,n){return t=t<0?0:t,i=i<0?0:i,t<=i?0===i?(e+n)/2:e+t/(t+i)*(n-e):n+i/(t+i)*(e-n)},libtess.geom.edgeIntersect=function(t,e,i,n,r){var s,o,a;libtess.geom.vertLeq(t,e)||(a=t,t=e,e=a),libtess.geom.vertLeq(i,n)||(a=i,i=n,n=a),libtess.geom.vertLeq(t,i)||(a=t,t=i,i=a,a=e,e=n,n=a),libtess.geom.vertLeq(i,e)?libtess.geom.vertLeq(e,n)?(s=libtess.geom.edgeEval(t,i,e),o=libtess.geom.edgeEval(i,e,n),s+o<0&&(s=-s,o=-o),r.s=libtess.geom.interpolate_(s,i.s,o,e.s)):(s=libtess.geom.edgeSign(t,i,e),o=-libtess.geom.edgeSign(t,n,e),s+o<0&&(s=-s,o=-o),r.s=libtess.geom.interpolate_(s,i.s,o,n.s)):r.s=(i.s+e.s)/2,libtess.geom.transLeq(t,e)||(a=t,t=e,e=a),libtess.geom.transLeq(i,n)||(a=i,i=n,n=a),libtess.geom.transLeq(t,i)||(a=t,t=i,i=a,a=e,e=n,n=a),libtess.geom.transLeq(i,e)?libtess.geom.transLeq(e,n)?(s=libtess.geom.transEval(t,i,e),o=libtess.geom.transEval(i,e,n),s+o<0&&(s=-s,o=-o),r.t=libtess.geom.interpolate_(s,i.t,o,e.t)):(s=libtess.geom.transSign(t,i,e),o=-libtess.geom.transSign(t,n,e),s+o<0&&(s=-s,o=-o),r.t=libtess.geom.interpolate_(s,i.t,o,n.t)):r.t=(i.t+e.t)/2},libtess.mesh={},libtess.mesh.makeEdge=function(t){var e=libtess.mesh.makeEdgePair_(t.eHead);return libtess.mesh.makeVertex_(e,t.vHead),libtess.mesh.makeVertex_(e.sym,t.vHead),libtess.mesh.makeFace_(e,t.fHead),e},libtess.mesh.meshSplice=function(t,e){var i=!1,n=!1;t!==e&&(e.org!==t.org&&(n=!0,libtess.mesh.killVertex_(e.org,t.org)),e.lFace!==t.lFace&&(i=!0,libtess.mesh.killFace_(e.lFace,t.lFace)),libtess.mesh.splice_(e,t),n||(libtess.mesh.makeVertex_(e,t.org),t.org.anEdge=t),i||(libtess.mesh.makeFace_(e,t.lFace),t.lFace.anEdge=t))},libtess.mesh.deleteEdge=function(t){var e=t.sym,i=!1;t.lFace!==t.rFace()&&(i=!0,libtess.mesh.killFace_(t.lFace,t.rFace())),t.oNext===t?libtess.mesh.killVertex_(t.org,null):(t.rFace().anEdge=t.oPrev(),t.org.anEdge=t.oNext,libtess.mesh.splice_(t,t.oPrev()),i||libtess.mesh.makeFace_(t,t.lFace)),e.oNext===e?(libtess.mesh.killVertex_(e.org,null),libtess.mesh.killFace_(e.lFace,null)):(t.lFace.anEdge=e.oPrev(),e.org.anEdge=e.oNext,libtess.mesh.splice_(e,e.oPrev())),libtess.mesh.killEdge_(t)},libtess.mesh.addEdgeVertex=function(t){var e=libtess.mesh.makeEdgePair_(t),i=e.sym;return libtess.mesh.splice_(e,t.lNext),e.org=t.dst(),libtess.mesh.makeVertex_(i,e.org),e.lFace=i.lFace=t.lFace,e},libtess.mesh.splitEdge=function(t){var e=libtess.mesh.addEdgeVertex(t),i=e.sym;return libtess.mesh.splice_(t.sym,t.sym.oPrev()),libtess.mesh.splice_(t.sym,i),t.sym.org=i.org,i.dst().anEdge=i.sym,i.sym.lFace=t.rFace(),i.winding=t.winding,i.sym.winding=t.sym.winding,i},libtess.mesh.connect=function(t,e){var i=!1,n=libtess.mesh.makeEdgePair_(t),r=n.sym;return e.lFace!==t.lFace&&(i=!0,libtess.mesh.killFace_(e.lFace,t.lFace)),libtess.mesh.splice_(n,t.lNext),libtess.mesh.splice_(r,e),n.org=t.dst(),r.org=e.org,n.lFace=r.lFace=t.lFace,t.lFace.anEdge=r,i||libtess.mesh.makeFace_(n,t.lFace),n},libtess.mesh.zapFace=function(t){var e,i=t.anEdge,n=i.lNext;do if(e=n,n=e.lNext,e.lFace=null,null===e.rFace()){e.oNext===e?libtess.mesh.killVertex_(e.org,null):(e.org.anEdge=e.oNext,libtess.mesh.splice_(e,e.oPrev()));var r=e.sym;r.oNext===r?libtess.mesh.killVertex_(r.org,null):(r.org.anEdge=r.oNext,libtess.mesh.splice_(r,r.oPrev())),libtess.mesh.killEdge_(e)}while(e!==i)var s=t.prev,o=t.next;o.prev=s,s.next=o},libtess.mesh.meshUnion=function(t,e){var i=t.fHead,n=t.vHead,r=t.eHead,s=e.fHead,o=e.vHead,a=e.eHead;return s.next!==s&&(i.prev.next=s.next,s.next.prev=i.prev,s.prev.next=i,i.prev=s.prev),o.next!==o&&(n.prev.next=o.next,o.next.prev=n.prev,o.prev.next=n,n.prev=o.prev),a.next!==a&&(r.sym.next.sym.next=a.next,a.next.sym.next=r.sym.next,a.sym.next.sym.next=r,r.sym.next=a.sym.next),t},libtess.mesh.deleteMesh=function(t){},libtess.mesh.makeEdgePair_=function(t){var e=new libtess.GluHalfEdge,i=new libtess.GluHalfEdge,n=t.sym.next;return i.next=n,n.sym.next=e,e.next=t,t.sym.next=i,e.sym=i,e.oNext=e,e.lNext=i,i.sym=e,i.oNext=i,i.lNext=e,e},libtess.mesh.splice_=function(t,e){var i=t.oNext,n=e.oNext;i.sym.lNext=e,n.sym.lNext=t,t.oNext=n,e.oNext=i},libtess.mesh.makeVertex_=function(t,e){var i=e.prev,n=new libtess.GluVertex(e,i);i.next=n,e.prev=n,n.anEdge=t;var r=t;do r.org=n,r=r.oNext;while(r!==t)},libtess.mesh.makeFace_=function(t,e){var i=e.prev,n=new libtess.GluFace(e,i);i.next=n,e.prev=n,n.anEdge=t,n.inside=e.inside;var r=t;do r.lFace=n,r=r.lNext;while(r!==t)},libtess.mesh.killEdge_=function(t){var e=t.next,i=t.sym.next;e.sym.next=i,i.sym.next=e},libtess.mesh.killVertex_=function(t,e){var i=t.anEdge,n=i;do n.org=e,n=n.oNext;while(n!==i)var r=t.prev,s=t.next;s.prev=r,r.next=s},libtess.mesh.killFace_=function(t,e){var i=t.anEdge,n=i;do n.lFace=e,n=n.lNext;while(n!==i)var r=t.prev,s=t.next;s.prev=r,r.next=s},libtess.normal={},libtess.normal.S_UNIT_X_=1,libtess.normal.S_UNIT_Y_=0,libtess.normal.projectPolygon=function(t,e,i,n){var r=!1,s=[e,i,n];0===e&&0===i&&0===n&&(libtess.normal.computeNormal_(t,s),r=!0);var o,a=libtess.normal.longAxis_(s),u=t.mesh.vHead;if(libtess.TRUE_PROJECT){libtess.normal.normalize_(s);var l=[0,0,0],c=[0,0,0];l[a]=0,l[(a+1)%3]=libtess.normal.S_UNIT_X_,l[(a+2)%3]=libtess.normal.S_UNIT_Y_;var h=libtess.normal.dot_(l,s);for(l[0]-=h*s[0],l[1]-=h*s[1],l[2]-=h*s[2],libtess.normal.normalize_(l),c[0]=s[1]*l[2]-s[2]*l[1],c[1]=s[2]*l[0]-s[0]*l[2],c[2]=s[0]*l[1]-s[1]*l[0],libtess.normal.normalize_(c),o=u.next;o!==u;o=o.next)o.s=libtess.normal.dot_(o.coords,l),o.t=libtess.normal.dot_(o.coords,c)}else{var d=(a+1)%3,p=(a+2)%3,f=s[a]>0?1:-1;for(o=u.next;o!==u;o=o.next)o.s=o.coords[d],o.t=f*o.coords[p]}r&&libtess.normal.checkOrientation_(t)},libtess.normal.dot_=function(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]},libtess.normal.normalize_=function(t){var e=t[0]*t[0]+t[1]*t[1]+t[2]*t[2];e=Math.sqrt(e),t[0]/=e,t[1]/=e,t[2]/=e},libtess.normal.longAxis_=function(t){var e=0;return Math.abs(t[1])>Math.abs(t[0])&&(e=1),Math.abs(t[2])>Math.abs(t[e])&&(e=2),e},libtess.normal.computeNormal_=function(t,e){var i,n=[-2*libtess.GLU_TESS_MAX_COORD,-2*libtess.GLU_TESS_MAX_COORD,-2*libtess.GLU_TESS_MAX_COORD],r=[2*libtess.GLU_TESS_MAX_COORD,2*libtess.GLU_TESS_MAX_COORD,2*libtess.GLU_TESS_MAX_COORD],s=[],o=[],a=t.mesh.vHead;for(i=a.next;i!==a;i=i.next)for(var u=0;u<3;++u){var l=i.coords[u];l<r[u]&&(r[u]=l,o[u]=i),l>n[u]&&(n[u]=l,s[u]=i)}var c=0;if(n[1]-r[1]>n[0]-r[0]&&(c=1),n[2]-r[2]>n[c]-r[c]&&(c=2),r[c]>=n[c])return e[0]=0,e[1]=0,void(e[2]=1);var h=0,d=o[c],p=s[c],f=[0,0,0],g=[d.coords[0]-p.coords[0],d.coords[1]-p.coords[1],d.coords[2]-p.coords[2]],m=[0,0,0];for(i=a.next;i!==a;i=i.next){m[0]=i.coords[0]-p.coords[0],m[1]=i.coords[1]-p.coords[1],m[2]=i.coords[2]-p.coords[2],f[0]=g[1]*m[2]-g[2]*m[1],f[1]=g[2]*m[0]-g[0]*m[2],f[2]=g[0]*m[1]-g[1]*m[0];var _=f[0]*f[0]+f[1]*f[1]+f[2]*f[2];_>h&&(h=_,e[0]=f[0],e[1]=f[1],e[2]=f[2])}h<=0&&(e[0]=e[1]=e[2]=0,e[libtess.normal.longAxis_(g)]=1)},libtess.normal.checkOrientation_=function(t){for(var e=0,i=t.mesh.fHead,n=i.next;n!==i;n=n.next){var r=n.anEdge;if(!(r.winding<=0))do e+=(r.org.s-r.dst().s)*(r.org.t+r.dst().t),r=r.lNext;while(r!==n.anEdge)}if(e<0)for(var s=t.mesh.vHead,o=s.next;o!==s;o=o.next)o.t=-o.t},libtess.render={},libtess.render.renderMesh=function(t,e,i){for(var n=!1,r=-1,s=e.fHead.prev;s!==e.fHead;s=s.prev)if(s.inside){n||(t.callBeginCallback(libtess.primitiveType.GL_TRIANGLES),n=!0);var o=s.anEdge;do{if(i){var a=o.rFace().inside?0:1;r!==a&&(r=a,t.callEdgeFlagCallback(!!r))}t.callVertexCallback(o.org.data),o=o.lNext}while(o!==s.anEdge)}n&&t.callEndCallback()},libtess.render.renderBoundary=function(t,e){for(var i=e.fHead.next;i!==e.fHead;i=i.next)if(i.inside){t.callBeginCallback(libtess.primitiveType.GL_LINE_LOOP);var n=i.anEdge;do t.callVertexCallback(n.org.data),n=n.lNext;while(n!==i.anEdge)t.callEndCallback()}},libtess.sweep={},libtess.sweep.SENTINEL_COORD_=4*libtess.GLU_TESS_MAX_COORD,libtess.sweep.TOLERANCE_NONZERO_=!1,libtess.sweep.computeInterior=function(t){t.fatalError=!1,libtess.sweep.removeDegenerateEdges_(t),libtess.sweep.initPriorityQ_(t),libtess.sweep.initEdgeDict_(t);for(var e;null!==(e=t.pq.extractMin());){for(;;){var i=t.pq.minimum();if(null===i||!libtess.geom.vertEq(i,e))break;i=t.pq.extractMin(),libtess.sweep.spliceMergeVertices_(t,e.anEdge,i.anEdge)}libtess.sweep.sweepEvent_(t,e)}var n=t.dict.getMin().getKey();t.event=n.eUp.org,libtess.sweep.doneEdgeDict_(t),libtess.sweep.donePriorityQ_(t),libtess.sweep.removeDegenerateFaces_(t.mesh),t.mesh.checkMesh()},libtess.sweep.addWinding_=function(t,e){t.winding+=e.winding,t.sym.winding+=e.sym.winding},libtess.sweep.edgeLeq_=function(t,e,i){var n=t.event,r=e.eUp,s=i.eUp;return r.dst()===n?s.dst()===n?libtess.geom.vertLeq(r.org,s.org)?libtess.geom.edgeSign(s.dst(),r.org,s.org)<=0:libtess.geom.edgeSign(r.dst(),s.org,r.org)>=0:libtess.geom.edgeSign(s.dst(),n,s.org)<=0:s.dst()===n?libtess.geom.edgeSign(r.dst(),n,r.org)>=0:libtess.geom.edgeEval(r.dst(),n,r.org)>=libtess.geom.edgeEval(s.dst(),n,s.org)},libtess.sweep.deleteRegion_=function(t,e){e.fixUpperEdge,e.eUp.activeRegion=null,t.dict.deleteNode(e.nodeUp),e.nodeUp=null},libtess.sweep.fixUpperEdge_=function(t,e){libtess.mesh.deleteEdge(t.eUp),t.fixUpperEdge=!1,t.eUp=e,e.activeRegion=t},libtess.sweep.topLeftRegion_=function(t){var e=t.eUp.org;do t=t.regionAbove();while(t.eUp.org===e)if(t.fixUpperEdge){var i=libtess.mesh.connect(t.regionBelow().eUp.sym,t.eUp.lNext);libtess.sweep.fixUpperEdge_(t,i),t=t.regionAbove()}return t},libtess.sweep.topRightRegion_=function(t){var e=t.eUp.dst();do t=t.regionAbove();while(t.eUp.dst()===e)return t},libtess.sweep.addRegionBelow_=function(t,e,i){var n=new libtess.ActiveRegion;return n.eUp=i,n.nodeUp=t.dict.insertBefore(e.nodeUp,n),i.activeRegion=n,n},libtess.sweep.isWindingInside_=function(t,e){switch(t.windingRule){case libtess.windingRule.GLU_TESS_WINDING_ODD:return 0!=(1&e);case libtess.windingRule.GLU_TESS_WINDING_NONZERO:return 0!==e;case libtess.windingRule.GLU_TESS_WINDING_POSITIVE:return e>0;case libtess.windingRule.GLU_TESS_WINDING_NEGATIVE:return e<0;case libtess.windingRule.GLU_TESS_WINDING_ABS_GEQ_TWO:return e>=2||e<=-2}return!1},libtess.sweep.computeWinding_=function(t,e){e.windingNumber=e.regionAbove().windingNumber+e.eUp.winding,e.inside=libtess.sweep.isWindingInside_(t,e.windingNumber)},libtess.sweep.finishRegion_=function(t,e){var i=e.eUp,n=i.lFace;n.inside=e.inside,n.anEdge=i,libtess.sweep.deleteRegion_(t,e)},libtess.sweep.finishLeftRegions_=function(t,e,i){for(var n=e,r=e.eUp;n!==i;){n.fixUpperEdge=!1;var s=n.regionBelow(),o=s.eUp;if(o.org!==r.org){if(!s.fixUpperEdge){libtess.sweep.finishRegion_(t,n);break}o=libtess.mesh.connect(r.lPrev(),o.sym),libtess.sweep.fixUpperEdge_(s,o)}r.oNext!==o&&(libtess.mesh.meshSplice(o.oPrev(),o),libtess.mesh.meshSplice(r,o)),libtess.sweep.finishRegion_(t,n),r=s.eUp,n=s}return r},libtess.sweep.addRightEdges_=function(t,e,i,n,r,s){var o=!0,a=i;do libtess.sweep.addRegionBelow_(t,e,a.sym),a=a.oNext;while(a!==n)null===r&&(r=e.regionBelow().eUp.rPrev());for(var u,l=e,c=r;u=l.regionBelow(),a=u.eUp.sym,a.org===c.org;)a.oNext!==c&&(libtess.mesh.meshSplice(a.oPrev(),a),libtess.mesh.meshSplice(c.oPrev(),a)),u.windingNumber=l.windingNumber-a.winding,u.inside=libtess.sweep.isWindingInside_(t,u.windingNumber),l.dirty=!0,!o&&libtess.sweep.checkForRightSplice_(t,l)&&(libtess.sweep.addWinding_(a,c),libtess.sweep.deleteRegion_(t,l),libtess.mesh.deleteEdge(c)),o=!1,l=u,c=a;l.dirty=!0,s&&libtess.sweep.walkDirtyRegions_(t,l)},libtess.sweep.callCombine_=function(t,e,i,n,r){var s=[e.coords[0],e.coords[1],e.coords[2]];e.data=null,e.data=t.callCombineCallback(s,i,n),null===e.data&&(r?t.fatalError||(t.callErrorCallback(libtess.errorType.GLU_TESS_NEED_COMBINE_CALLBACK),t.fatalError=!0):e.data=i[0])},libtess.sweep.spliceMergeVertices_=function(t,e,i){var n=[null,null,null,null],r=[.5,.5,0,0];n[0]=e.org.data,n[1]=i.org.data,libtess.sweep.callCombine_(t,e.org,n,r,!1),libtess.mesh.meshSplice(e,i)},libtess.sweep.vertexWeights_=function(t,e,i,n,r){var s=libtess.geom.vertL1dist(e,t),o=libtess.geom.vertL1dist(i,t),a=r,u=r+1;n[a]=.5*o/(s+o),n[u]=.5*s/(s+o),t.coords[0]+=n[a]*e.coords[0]+n[u]*i.coords[0],t.coords[1]+=n[a]*e.coords[1]+n[u]*i.coords[1],t.coords[2]+=n[a]*e.coords[2]+n[u]*i.coords[2]},libtess.sweep.getIntersectData_=function(t,e,i,n,r,s){var o=[0,0,0,0],a=[i.data,n.data,r.data,s.data];e.coords[0]=e.coords[1]=e.coords[2]=0,libtess.sweep.vertexWeights_(e,i,n,o,0),libtess.sweep.vertexWeights_(e,r,s,o,2),libtess.sweep.callCombine_(t,e,a,o,!0)},libtess.sweep.checkForRightSplice_=function(t,e){var i=e.regionBelow(),n=e.eUp,r=i.eUp;if(libtess.geom.vertLeq(n.org,r.org)){if(libtess.geom.edgeSign(r.dst(),n.org,r.org)>0)return!1;libtess.geom.vertEq(n.org,r.org)?n.org!==r.org&&(t.pq.remove(n.org.pqHandle),libtess.sweep.spliceMergeVertices_(t,r.oPrev(),n)):(libtess.mesh.splitEdge(r.sym),libtess.mesh.meshSplice(n,r.oPrev()),e.dirty=i.dirty=!0)}else{if(libtess.geom.edgeSign(n.dst(),r.org,n.org)<0)return!1;e.regionAbove().dirty=e.dirty=!0,libtess.mesh.splitEdge(n.sym),libtess.mesh.meshSplice(r.oPrev(),n)}return!0},libtess.sweep.checkForLeftSplice_=function(t,e){var i,n=e.regionBelow(),r=e.eUp,s=n.eUp;if(libtess.geom.vertLeq(r.dst(),s.dst())){if(libtess.geom.edgeSign(r.dst(),s.dst(),r.org)<0)return!1;e.regionAbove().dirty=e.dirty=!0,i=libtess.mesh.splitEdge(r),libtess.mesh.meshSplice(s.sym,i),i.lFace.inside=e.inside}else{if(libtess.geom.edgeSign(s.dst(),r.dst(),s.org)>0)return!1;e.dirty=n.dirty=!0,i=libtess.mesh.splitEdge(s),libtess.mesh.meshSplice(r.lNext,s.sym),i.rFace().inside=e.inside}return!0},libtess.sweep.checkForIntersect_=function(t,e){var i=e.regionBelow(),n=e.eUp,r=i.eUp,s=n.org,o=r.org,a=n.dst(),u=r.dst(),l=new libtess.GluVertex;if(s===o)return!1;if(Math.min(s.t,a.t)>Math.max(o.t,u.t))return!1;if(libtess.geom.vertLeq(s,o)){if(libtess.geom.edgeSign(u,s,o)>0)return!1}else if(libtess.geom.edgeSign(a,o,s)<0)return!1;libtess.geom.edgeIntersect(a,s,u,o,l),libtess.geom.vertLeq(l,t.event)&&(l.s=t.event.s,l.t=t.event.t);var c=libtess.geom.vertLeq(s,o)?s:o;if(libtess.geom.vertLeq(c,l)&&(l.s=c.s,l.t=c.t),libtess.geom.vertEq(l,s)||libtess.geom.vertEq(l,o))return libtess.sweep.checkForRightSplice_(t,e),!1;if(!libtess.geom.vertEq(a,t.event)&&libtess.geom.edgeSign(a,t.event,l)>=0||!libtess.geom.vertEq(u,t.event)&&libtess.geom.edgeSign(u,t.event,l)<=0){if(u===t.event)return libtess.mesh.splitEdge(n.sym),libtess.mesh.meshSplice(r.sym,n),e=libtess.sweep.topLeftRegion_(e),n=e.regionBelow().eUp,libtess.sweep.finishLeftRegions_(t,e.regionBelow(),i),libtess.sweep.addRightEdges_(t,e,n.oPrev(),n,n,!0),!0;if(a===t.event){libtess.mesh.splitEdge(r.sym),libtess.mesh.meshSplice(n.lNext,r.oPrev()),i=e,e=libtess.sweep.topRightRegion_(e);var h=e.regionBelow().eUp.rPrev();return i.eUp=r.oPrev(),r=libtess.sweep.finishLeftRegions_(t,i,null),libtess.sweep.addRightEdges_(t,e,r.oNext,n.rPrev(),h,!0),!0}return libtess.geom.edgeSign(a,t.event,l)>=0&&(e.regionAbove().dirty=e.dirty=!0,libtess.mesh.splitEdge(n.sym),n.org.s=t.event.s,n.org.t=t.event.t),libtess.geom.edgeSign(u,t.event,l)<=0&&(e.dirty=i.dirty=!0,libtess.mesh.splitEdge(r.sym),r.org.s=t.event.s,r.org.t=t.event.t),!1}return libtess.mesh.splitEdge(n.sym),libtess.mesh.splitEdge(r.sym),libtess.mesh.meshSplice(r.oPrev(),n),n.org.s=l.s,n.org.t=l.t,n.org.pqHandle=t.pq.insert(n.org),libtess.sweep.getIntersectData_(t,n.org,s,a,o,u),e.regionAbove().dirty=e.dirty=i.dirty=!0,!1},libtess.sweep.walkDirtyRegions_=function(t,e){for(var i=e.regionBelow();;){for(;i.dirty;)e=i,i=i.regionBelow();if(!e.dirty&&(i=e,null===(e=e.regionAbove())||!e.dirty))return;e.dirty=!1;var n=e.eUp,r=i.eUp;if(n.dst()!==r.dst()&&libtess.sweep.checkForLeftSplice_(t,e)&&(i.fixUpperEdge?(libtess.sweep.deleteRegion_(t,i),libtess.mesh.deleteEdge(r),i=e.regionBelow(),r=i.eUp):e.fixUpperEdge&&(libtess.sweep.deleteRegion_(t,e),libtess.mesh.deleteEdge(n),e=i.regionAbove(),n=e.eUp)),n.org!==r.org)if(n.dst()===r.dst()||e.fixUpperEdge||i.fixUpperEdge||n.dst()!==t.event&&r.dst()!==t.event)libtess.sweep.checkForRightSplice_(t,e);else if(libtess.sweep.checkForIntersect_(t,e))return;n.org===r.org&&n.dst()===r.dst()&&(libtess.sweep.addWinding_(r,n),libtess.sweep.deleteRegion_(t,e),libtess.mesh.deleteEdge(n),e=i.regionAbove())}},libtess.sweep.connectRightVertex_=function(t,e,i){var n=i.oNext,r=e.regionBelow(),s=e.eUp,o=r.eUp,a=!1;if(s.dst()!==o.dst()&&libtess.sweep.checkForIntersect_(t,e),libtess.geom.vertEq(s.org,t.event)&&(libtess.mesh.meshSplice(n.oPrev(),s),e=libtess.sweep.topLeftRegion_(e),n=e.regionBelow().eUp,libtess.sweep.finishLeftRegions_(t,e.regionBelow(),r),a=!0),libtess.geom.vertEq(o.org,t.event)&&(libtess.mesh.meshSplice(i,o.oPrev()),i=libtess.sweep.finishLeftRegions_(t,r,null),a=!0),a)return void libtess.sweep.addRightEdges_(t,e,i.oNext,n,n,!0);var u;u=libtess.geom.vertLeq(o.org,s.org)?o.oPrev():s,u=libtess.mesh.connect(i.lPrev(),u),libtess.sweep.addRightEdges_(t,e,u,u.oNext,u.oNext,!1),u.sym.activeRegion.fixUpperEdge=!0,libtess.sweep.walkDirtyRegions_(t,e)},libtess.sweep.connectLeftDegenerate_=function(t,e,i){var n=e.eUp;if(libtess.geom.vertEq(n.org,i))return void(libtess.sweep.TOLERANCE_NONZERO_&&libtess.sweep.spliceMergeVertices_(t,n,i.anEdge));if(!libtess.geom.vertEq(n.dst(),i))return libtess.mesh.splitEdge(n.sym),e.fixUpperEdge&&(libtess.mesh.deleteEdge(n.oNext),e.fixUpperEdge=!1),libtess.mesh.meshSplice(i.anEdge,n),void libtess.sweep.sweepEvent_(t,i);if(libtess.sweep.TOLERANCE_NONZERO_){e=libtess.sweep.topRightRegion_(e);var r=e.regionBelow(),s=r.eUp.sym,o=s.oNext,a=o;r.fixUpperEdge&&(libtess.sweep.deleteRegion_(t,r),libtess.mesh.deleteEdge(s),s=o.oPrev()),libtess.mesh.meshSplice(i.anEdge,s),libtess.geom.edgeGoesLeft(o)||(o=null),libtess.sweep.addRightEdges_(t,e,s.oNext,a,o,!0)}},libtess.sweep.connectLeftVertex_=function(t,e){var i=new libtess.ActiveRegion;i.eUp=e.anEdge.sym;var n=t.dict.search(i).getKey(),r=n.regionBelow(),s=n.eUp,o=r.eUp;if(0===libtess.geom.edgeSign(s.dst(),e,s.org))return void libtess.sweep.connectLeftDegenerate_(t,n,e);var a,u=libtess.geom.vertLeq(o.dst(),s.dst())?n:r;if(n.inside||u.fixUpperEdge){if(u===n)a=libtess.mesh.connect(e.anEdge.sym,s.lNext);else{a=libtess.mesh.connect(o.dNext(),e.anEdge).sym}u.fixUpperEdge?libtess.sweep.fixUpperEdge_(u,a):libtess.sweep.computeWinding_(t,libtess.sweep.addRegionBelow_(t,n,a)),libtess.sweep.sweepEvent_(t,e)}else libtess.sweep.addRightEdges_(t,n,e.anEdge,e.anEdge,null,!0)},libtess.sweep.sweepEvent_=function(t,e){t.event=e;for(var i=e.anEdge;null===i.activeRegion;)if((i=i.oNext)===e.anEdge)return void libtess.sweep.connectLeftVertex_(t,e);var n=libtess.sweep.topLeftRegion_(i.activeRegion),r=n.regionBelow(),s=r.eUp,o=libtess.sweep.finishLeftRegions_(t,r,null);o.oNext===s?libtess.sweep.connectRightVertex_(t,n,o):libtess.sweep.addRightEdges_(t,n,o.oNext,s,s,!0)},libtess.sweep.addSentinel_=function(t,e){var i=new libtess.ActiveRegion,n=libtess.mesh.makeEdge(t.mesh);n.org.s=libtess.sweep.SENTINEL_COORD_,n.org.t=e,n.dst().s=-libtess.sweep.SENTINEL_COORD_,n.dst().t=e,t.event=n.dst(),i.eUp=n,i.windingNumber=0,i.inside=!1,i.fixUpperEdge=!1,i.sentinel=!0,i.dirty=!1,i.nodeUp=t.dict.insert(i)},libtess.sweep.initEdgeDict_=function(t){t.dict=new libtess.Dict(t,libtess.sweep.edgeLeq_),libtess.sweep.addSentinel_(t,-libtess.sweep.SENTINEL_COORD_),libtess.sweep.addSentinel_(t,libtess.sweep.SENTINEL_COORD_)},libtess.sweep.doneEdgeDict_=function(t){for(var e;null!==(e=t.dict.getMin().getKey());)e.sentinel,libtess.sweep.deleteRegion_(t,e);t.dict=null},libtess.sweep.removeDegenerateEdges_=function(t){for(var e,i=t.mesh.eHead,n=i.next;n!==i;n=e){e=n.next;var r=n.lNext;libtess.geom.vertEq(n.org,n.dst())&&n.lNext.lNext!==n&&(libtess.sweep.spliceMergeVertices_(t,r,n),libtess.mesh.deleteEdge(n),n=r,r=n.lNext),r.lNext===n&&(r!==n&&(r!==e&&r!==e.sym||(e=e.next),libtess.mesh.deleteEdge(r)),n!==e&&n!==e.sym||(e=e.next),libtess.mesh.deleteEdge(n))}},libtess.sweep.initPriorityQ_=function(t){var e=new libtess.PriorityQ;t.pq=e;var i,n=t.mesh.vHead;for(i=n.next;i!==n;i=i.next)i.pqHandle=e.insert(i);e.init()},
|
|
12
12
|
libtess.sweep.donePriorityQ_=function(t){t.pq.deleteQ(),t.pq=null},libtess.sweep.removeDegenerateFaces_=function(t){for(var e,i=t.fHead.next;i!==t.fHead;i=e){e=i.next;var n=i.anEdge;n.lNext.lNext===n&&(libtess.sweep.addWinding_(n.oNext,n),libtess.mesh.deleteEdge(n))}},libtess.tessmono={},libtess.tessmono.tessellateMonoRegion_=function(t){for(var e=t.anEdge;libtess.geom.vertLeq(e.dst(),e.org);e=e.lPrev());for(;libtess.geom.vertLeq(e.org,e.dst());e=e.lNext);for(var i,n=e.lPrev();e.lNext!==n;)if(libtess.geom.vertLeq(e.dst(),n.org)){for(;n.lNext!==e&&(libtess.geom.edgeGoesLeft(n.lNext)||libtess.geom.edgeSign(n.org,n.dst(),n.lNext.dst())<=0);)i=libtess.mesh.connect(n.lNext,n),n=i.sym;n=n.lPrev()}else{for(;n.lNext!==e&&(libtess.geom.edgeGoesRight(e.lPrev())||libtess.geom.edgeSign(e.dst(),e.org,e.lPrev().org)>=0);)i=libtess.mesh.connect(e,e.lPrev()),e=i.sym;e=e.lNext}for(;n.lNext.lNext!==e;)i=libtess.mesh.connect(n.lNext,n),n=i.sym},libtess.tessmono.tessellateInterior=function(t){for(var e,i=t.fHead.next;i!==t.fHead;i=e)e=i.next,i.inside&&libtess.tessmono.tessellateMonoRegion_(i)},libtess.tessmono.discardExterior=function(t){for(var e,i=t.fHead.next;i!==t.fHead;i=e)e=i.next,i.inside||libtess.mesh.zapFace(i)},libtess.tessmono.setWindingNumber=function(t,e,i){for(var n,r=t.eHead.next;r!==t.eHead;r=n)n=r.next,r.rFace().inside!==r.lFace.inside?r.winding=r.lFace.inside?e:-e:i?libtess.mesh.deleteEdge(r):r.winding=0},libtess.Dict=function(t,e){this.head_=new libtess.DictNode,this.frame_=t,this.leq_=e},libtess.Dict.prototype.deleteDict_=function(){},libtess.Dict.prototype.insertBefore=function(t,e){do t=t.prev;while(null!==t.key&&!this.leq_(this.frame_,t.key,e))var i=new libtess.DictNode(e,t.next,t);return t.next.prev=i,t.next=i,i},libtess.Dict.prototype.insert=function(t){return this.insertBefore(this.head_,t)},libtess.Dict.prototype.deleteNode=function(t){t.next.prev=t.prev,t.prev.next=t.next},libtess.Dict.prototype.search=function(t){var e=this.head_;do e=e.next;while(null!==e.key&&!this.leq_(this.frame_,t,e.key))return e},libtess.Dict.prototype.getMin=function(){return this.head_.next},libtess.Dict.prototype.getMax=function(){return this.head_.prev},libtess.DictNode=function(t,e,i){this.key=t||null,this.next=e||this,this.prev=i||this},libtess.DictNode.prototype.getKey=function(){return this.key},libtess.DictNode.prototype.getSuccessor=function(){return this.next},libtess.DictNode.prototype.getPredecessor=function(){return this.prev},libtess.GluTesselator=function(){this.state_=libtess.GluTesselator.tessState_.T_DORMANT,this.lastEdge_=null,this.mesh=null,this.errorCallback_=null,this.normal_=[0,0,0],this.windingRule=libtess.windingRule.GLU_TESS_WINDING_ODD,this.fatalError=!1,this.dict=null,this.pq=null,this.event=null,this.combineCallback_=null,this.boundaryOnly_=!1,this.beginCallback_=null,this.edgeFlagCallback_=null,this.vertexCallback_=null,this.endCallback_=null,this.meshCallback_=null,this.polygonData_=null},libtess.GluTesselator.tessState_={T_DORMANT:0,T_IN_POLYGON:1,T_IN_CONTOUR:2},libtess.GluTesselator.prototype.gluDeleteTess=function(){this.requireState_(libtess.GluTesselator.tessState_.T_DORMANT)},libtess.GluTesselator.prototype.gluTessProperty=function(t,e){switch(t){case libtess.gluEnum.GLU_TESS_TOLERANCE:return;case libtess.gluEnum.GLU_TESS_WINDING_RULE:var i=e;switch(i){case libtess.windingRule.GLU_TESS_WINDING_ODD:case libtess.windingRule.GLU_TESS_WINDING_NONZERO:case libtess.windingRule.GLU_TESS_WINDING_POSITIVE:case libtess.windingRule.GLU_TESS_WINDING_NEGATIVE:case libtess.windingRule.GLU_TESS_WINDING_ABS_GEQ_TWO:return void(this.windingRule=i)}break;case libtess.gluEnum.GLU_TESS_BOUNDARY_ONLY:return void(this.boundaryOnly_=!!e);default:return void this.callErrorCallback(libtess.gluEnum.GLU_INVALID_ENUM)}this.callErrorCallback(libtess.gluEnum.GLU_INVALID_VALUE)},libtess.GluTesselator.prototype.gluGetTessProperty=function(t){switch(t){case libtess.gluEnum.GLU_TESS_TOLERANCE:return 0;case libtess.gluEnum.GLU_TESS_WINDING_RULE:return this.windingRule;case libtess.gluEnum.GLU_TESS_BOUNDARY_ONLY:return this.boundaryOnly_;default:this.callErrorCallback(libtess.gluEnum.GLU_INVALID_ENUM)}return!1},libtess.GluTesselator.prototype.gluTessNormal=function(t,e,i){this.normal_[0]=t,this.normal_[1]=e,this.normal_[2]=i},libtess.GluTesselator.prototype.gluTessCallback=function(t,e){var i=e?e:null;switch(t){case libtess.gluEnum.GLU_TESS_BEGIN:case libtess.gluEnum.GLU_TESS_BEGIN_DATA:return void(this.beginCallback_=i);case libtess.gluEnum.GLU_TESS_EDGE_FLAG:case libtess.gluEnum.GLU_TESS_EDGE_FLAG_DATA:return void(this.edgeFlagCallback_=i);case libtess.gluEnum.GLU_TESS_VERTEX:case libtess.gluEnum.GLU_TESS_VERTEX_DATA:return void(this.vertexCallback_=i);case libtess.gluEnum.GLU_TESS_END:case libtess.gluEnum.GLU_TESS_END_DATA:return void(this.endCallback_=i);case libtess.gluEnum.GLU_TESS_ERROR:case libtess.gluEnum.GLU_TESS_ERROR_DATA:return void(this.errorCallback_=i);case libtess.gluEnum.GLU_TESS_COMBINE:case libtess.gluEnum.GLU_TESS_COMBINE_DATA:return void(this.combineCallback_=i);case libtess.gluEnum.GLU_TESS_MESH:return void(this.meshCallback_=i);default:return void this.callErrorCallback(libtess.gluEnum.GLU_INVALID_ENUM)}},libtess.GluTesselator.prototype.gluTessVertex=function(t,e){var i=!1,n=[0,0,0];this.requireState_(libtess.GluTesselator.tessState_.T_IN_CONTOUR);for(var r=0;r<3;++r){var s=t[r];s<-libtess.GLU_TESS_MAX_COORD&&(s=-libtess.GLU_TESS_MAX_COORD,i=!0),s>libtess.GLU_TESS_MAX_COORD&&(s=libtess.GLU_TESS_MAX_COORD,i=!0),n[r]=s}i&&this.callErrorCallback(libtess.errorType.GLU_TESS_COORD_TOO_LARGE),this.addVertex_(n,e)},libtess.GluTesselator.prototype.gluTessBeginPolygon=function(t){this.requireState_(libtess.GluTesselator.tessState_.T_DORMANT),this.state_=libtess.GluTesselator.tessState_.T_IN_POLYGON,this.mesh=new libtess.GluMesh,this.polygonData_=t},libtess.GluTesselator.prototype.gluTessBeginContour=function(){this.requireState_(libtess.GluTesselator.tessState_.T_IN_POLYGON),this.state_=libtess.GluTesselator.tessState_.T_IN_CONTOUR,this.lastEdge_=null},libtess.GluTesselator.prototype.gluTessEndContour=function(){this.requireState_(libtess.GluTesselator.tessState_.T_IN_CONTOUR),this.state_=libtess.GluTesselator.tessState_.T_IN_POLYGON},libtess.GluTesselator.prototype.gluTessEndPolygon=function(){if(this.requireState_(libtess.GluTesselator.tessState_.T_IN_POLYGON),this.state_=libtess.GluTesselator.tessState_.T_DORMANT,libtess.normal.projectPolygon(this,this.normal_[0],this.normal_[1],this.normal_[2]),libtess.sweep.computeInterior(this),!this.fatalError){var t=this.mesh;if(this.boundaryOnly_?libtess.tessmono.setWindingNumber(t,1,!0):libtess.tessmono.tessellateInterior(t),this.mesh.checkMesh(),this.beginCallback_||this.endCallback_||this.vertexCallback_||this.edgeFlagCallback_)if(this.boundaryOnly_)libtess.render.renderBoundary(this,this.mesh);else{var e=!!this.edgeFlagCallback_;libtess.render.renderMesh(this,this.mesh,e)}if(this.meshCallback_)return libtess.tessmono.discardExterior(this.mesh),this.meshCallback_(this.mesh),this.mesh=null,void(this.polygonData_=null)}libtess.mesh.deleteMesh(this.mesh),this.polygonData_=null,this.mesh=null},libtess.GluTesselator.prototype.requireState_=function(t){this.state_!==t&&this.gotoState_(t)},libtess.GluTesselator.prototype.gotoState_=function(t){for(;this.state_!==t;)if(this.state_<t)switch(this.state_){case libtess.GluTesselator.tessState_.T_DORMANT:this.callErrorCallback(libtess.errorType.GLU_TESS_MISSING_BEGIN_POLYGON),this.gluTessBeginPolygon(null);break;case libtess.GluTesselator.tessState_.T_IN_POLYGON:this.callErrorCallback(libtess.errorType.GLU_TESS_MISSING_BEGIN_CONTOUR),this.gluTessBeginContour()}else switch(this.state_){case libtess.GluTesselator.tessState_.T_IN_CONTOUR:this.callErrorCallback(libtess.errorType.GLU_TESS_MISSING_END_CONTOUR),this.gluTessEndContour();break;case libtess.GluTesselator.tessState_.T_IN_POLYGON:this.callErrorCallback(libtess.errorType.GLU_TESS_MISSING_END_POLYGON),this.gluTessEndPolygon()}},libtess.GluTesselator.prototype.addVertex_=function(t,e){var i=this.lastEdge_;null===i?(i=libtess.mesh.makeEdge(this.mesh),libtess.mesh.meshSplice(i,i.sym)):(libtess.mesh.splitEdge(i),i=i.lNext),i.org.data=e,i.org.coords[0]=t[0],i.org.coords[1]=t[1],i.org.coords[2]=t[2],i.winding=1,i.sym.winding=-1,this.lastEdge_=i},libtess.GluTesselator.prototype.callBeginCallback=function(t){this.beginCallback_&&this.beginCallback_(t,this.polygonData_)},libtess.GluTesselator.prototype.callVertexCallback=function(t){this.vertexCallback_&&this.vertexCallback_(t,this.polygonData_)},libtess.GluTesselator.prototype.callEdgeFlagCallback=function(t){this.edgeFlagCallback_&&this.edgeFlagCallback_(t,this.polygonData_)},libtess.GluTesselator.prototype.callEndCallback=function(){this.endCallback_&&this.endCallback_(this.polygonData_)},libtess.GluTesselator.prototype.callCombineCallback=function(t,e,i){return this.combineCallback_?this.combineCallback_(t,e,i,this.polygonData_)||null:null},libtess.GluTesselator.prototype.callErrorCallback=function(t){this.errorCallback_&&this.errorCallback_(t,this.polygonData_)},libtess.GluFace=function(t,e){this.next=t||this,this.prev=e||this,this.anEdge=null,this.data=null,this.inside=!1},libtess.GluHalfEdge=function(t){this.next=t||this,this.sym=null,this.oNext=null,this.lNext=null,this.org=null,this.lFace=null,this.activeRegion=null,this.winding=0},libtess.GluHalfEdge.prototype.rFace=function(){return this.sym.lFace},libtess.GluHalfEdge.prototype.dst=function(){return this.sym.org},libtess.GluHalfEdge.prototype.oPrev=function(){return this.sym.lNext},libtess.GluHalfEdge.prototype.lPrev=function(){return this.oNext.sym},libtess.GluHalfEdge.prototype.dPrev=function(){return this.lNext.sym},libtess.GluHalfEdge.prototype.rPrev=function(){return this.sym.oNext},libtess.GluHalfEdge.prototype.dNext=function(){return this.rPrev().sym},libtess.GluHalfEdge.prototype.rNext=function(){return this.oPrev().sym},libtess.GluMesh=function(){this.vHead=new libtess.GluVertex,this.fHead=new libtess.GluFace,this.eHead=new libtess.GluHalfEdge,this.eHeadSym=new libtess.GluHalfEdge,this.eHead.sym=this.eHeadSym,this.eHeadSym.sym=this.eHead},libtess.GluMesh.prototype.checkMesh=function(){if(libtess.DEBUG){var t,e,i=this.fHead,n=this.vHead,r=this.eHead,s=i;for(s=i;(e=s.next)!==i;s=e){t=e.anEdge;do t=t.lNext;while(t!==e.anEdge)}var o,a=n;for(a=n;(o=a.next)!==n;a=o){t=o.anEdge;do t=t.oNext;while(t!==o.anEdge)}var u=r;for(u=r;(t=u.next)!==r;u=t);}},libtess.GluVertex=function(t,e){this.next=t||this,this.prev=e||this,this.anEdge=null,this.data=null,this.coords=[0,0,0],this.s=0,this.t=0,this.pqHandle=0},libtess.PriorityQ=function(){this.verts_=[],this.order_=null,this.size_=0,this.initialized_=!1,this.heap_=new libtess.PriorityQHeap},libtess.PriorityQ.prototype.deleteQ=function(){this.heap_=null,this.order_=null,this.verts_=null},libtess.PriorityQ.prototype.init=function(){this.order_=[];for(var t=0;t<this.size_;t++)this.order_[t]=t;var e=function(t){return function(e,i){return libtess.geom.vertLeq(t[e],t[i])?1:-1}}(this.verts_);if(this.order_.sort(e),this.initialized_=!0,this.heap_.init(),libtess.DEBUG){var i=0+this.size_-1;for(t=0;t<i;++t);}},libtess.PriorityQ.prototype.insert=function(t){if(this.initialized_)return this.heap_.insert(t);var e=this.size_++;return this.verts_[e]=t,-(e+1)},libtess.PriorityQ.prototype.extractMin=function(){if(0===this.size_)return this.heap_.extractMin();var t=this.verts_[this.order_[this.size_-1]];if(!this.heap_.isEmpty()){var e=this.heap_.minimum();if(libtess.geom.vertLeq(e,t))return this.heap_.extractMin()}do--this.size_;while(this.size_>0&&null===this.verts_[this.order_[this.size_-1]])return t},libtess.PriorityQ.prototype.minimum=function(){if(0===this.size_)return this.heap_.minimum();var t=this.verts_[this.order_[this.size_-1]];if(!this.heap_.isEmpty()){var e=this.heap_.minimum();if(libtess.geom.vertLeq(e,t))return e}return t},libtess.PriorityQ.prototype.remove=function(t){if(t>=0)return void this.heap_.remove(t);for(t=-(t+1),this.verts_[t]=null;this.size_>0&&null===this.verts_[this.order_[this.size_-1]];)--this.size_},libtess.PriorityQHeap=function(){this.heap_=libtess.PriorityQHeap.reallocNumeric_([0],libtess.PriorityQHeap.INIT_SIZE_+1),this.verts_=[null,null],this.handles_=[0,0],this.size_=0,this.max_=libtess.PriorityQHeap.INIT_SIZE_,this.freeList_=0,this.initialized_=!1,this.heap_[1]=1},libtess.PriorityQHeap.INIT_SIZE_=32,libtess.PriorityQHeap.reallocNumeric_=function(t,e){for(var i=new Array(e),n=0;n<t.length;n++)i[n]=t[n];for(;n<e;n++)i[n]=0;return i},libtess.PriorityQHeap.prototype.init=function(){for(var t=this.size_;t>=1;--t)this.floatDown_(t);this.initialized_=!0},libtess.PriorityQHeap.prototype.insert=function(t){var e=++this.size_;2*e>this.max_&&(this.max_*=2,this.handles_=libtess.PriorityQHeap.reallocNumeric_(this.handles_,this.max_+1));var i;return 0===this.freeList_?i=e:(i=this.freeList_,this.freeList_=this.handles_[this.freeList_]),this.verts_[i]=t,this.handles_[i]=e,this.heap_[e]=i,this.initialized_&&this.floatUp_(e),i},libtess.PriorityQHeap.prototype.isEmpty=function(){return 0===this.size_},libtess.PriorityQHeap.prototype.minimum=function(){return this.verts_[this.heap_[1]]},libtess.PriorityQHeap.prototype.extractMin=function(){var t=this.heap_,e=this.verts_,i=this.handles_,n=t[1],r=e[n];return this.size_>0&&(t[1]=t[this.size_],i[t[1]]=1,e[n]=null,i[n]=this.freeList_,this.freeList_=n,--this.size_>0&&this.floatDown_(1)),r},libtess.PriorityQHeap.prototype.remove=function(t){var e=this.heap_,i=this.verts_,n=this.handles_,r=n[t];if(e[r]=e[this.size_],n[e[r]]=r,r<=--this.size_)if(r<=1)this.floatDown_(r);else{var s=i[e[r]],o=i[e[r>>1]];libtess.geom.vertLeq(o,s)?this.floatDown_(r):this.floatUp_(r)}i[t]=null,n[t]=this.freeList_,this.freeList_=t},libtess.PriorityQHeap.prototype.floatDown_=function(t){for(var e=this.heap_,i=this.verts_,n=this.handles_,r=t,s=e[r];;){var o=r<<1;o<this.size_&&libtess.geom.vertLeq(i[e[o+1]],i[e[o]])&&(o+=1);var a=e[o];if(o>this.size_||libtess.geom.vertLeq(i[s],i[a]))return e[r]=s,void(n[s]=r);e[r]=a,n[a]=r,r=o}},libtess.PriorityQHeap.prototype.floatUp_=function(t){for(var e=this.heap_,i=this.verts_,n=this.handles_,r=t,s=e[r];;){var o=r>>1,a=e[o];if(0===o||libtess.geom.vertLeq(i[a],i[s]))return e[r]=s,void(n[s]=r);e[r]=a,n[a]=r,r=o}},libtess.ActiveRegion=function(){this.eUp=null,this.nodeUp=null,this.windingNumber=0,this.inside=!1,this.sentinel=!1,this.dirty=!1,this.fixUpperEdge=!1},libtess.ActiveRegion.prototype.regionBelow=function(){return this.nodeUp.getPredecessor().getKey()},libtess.ActiveRegion.prototype.regionAbove=function(){return this.nodeUp.getSuccessor().getKey()},void 0!==module&&(module.exports=libtess),define("libtess",["libtess/libtess.cat"],function(t){return t}),define("libtess/libtess.cat",function(){}),define("standard/Math/Geometry/Triangle3",["standard/Math/Numbers/Vector3","standard/Math/Numbers/Matrix4","libtess"],function(t,e){"use strict";return{area:function(){const e=new t(0,0,0),i=new t(0,0,0);return function(t,n,r){return e.assign(n).subtract(t).cross(i.assign(r).subtract(t)).abs()/2}}(),normal:function(t,e,i,n){const r=i.x-e.x,s=i.y-e.y,o=i.z-e.z,a=t.x-e.x,u=t.y-e.y,l=t.z-e.z;return n.set(s*l-o*u,o*a-r*l,r*u-s*a),n.normalize()},quadNormal:function(t,e,i,n,r){const s=i.x-t.x,o=i.y-t.y,a=i.z-t.z,u=n.x-e.x,l=n.y-e.y,c=n.z-e.z;return r.set(o*c-a*l,a*u-s*c,s*l-o*u),r.normalize()},triangulatePolygon:function(){const t=function(){function t(t,e){e[e.length]=t}function e(t){t!==libtess.primitiveType.GL_TRIANGLES&&console.log("expected TRIANGLES but got type: "+t)}function i(t){console.log("error callback"),console.log("error number: "+t)}function n(t,e,i){return e[0]}function r(t){}const s=new libtess.GluTesselator;return s.gluTessCallback(libtess.gluEnum.GLU_TESS_VERTEX_DATA,t),s.gluTessCallback(libtess.gluEnum.GLU_TESS_BEGIN,e),s.gluTessCallback(libtess.gluEnum.GLU_TESS_ERROR,i),s.gluTessCallback(libtess.gluEnum.GLU_TESS_COMBINE,n),s.gluTessCallback(libtess.gluEnum.GLU_TESS_EDGE_FLAG,r),s.gluTessProperty(libtess.gluEnum.GLU_TESS_TOLERANCE,0),s.gluTessProperty(libtess.gluEnum.GLU_TESS_WINDING_RULE,libtess.windingRule.GLU_TESS_WINDING_ODD),s}();return function(){const e=arguments[arguments.length-1];t.gluTessBeginPolygon(e);for(let e=0,i=arguments.length-1;e<i;++e){t.gluTessBeginContour();for(const i of arguments[e])t.gluTessVertex(i,i);t.gluTessEndContour()}return t.gluTessEndPolygon(),e}}(),triangulateConvexPolygon:function(t,e){for(let i=1,n=t.length-1;i<n;++i)e.push(t[0],t[i],t[i+1])},getPolygonNormal:function(t,e){e.set(0,0,0);var i=t[0];for(let r=0,s=t.length;r<s;++r){var n=i,i=t[(r+1)%s];e.x+=(n.y-i.y)*(n.z+i.z),e.y+=(n.z-i.z)*(n.x+i.x),e.z+=(n.x-i.x)*(n.y+i.y)}return e.normalize()}}}),define("standard/Math/Algorithms/SAT",[],function(){"use strict";function t(){}function e(t,e,i){i.min=Number.POSITIVE_INFINITY,i.max=Number.NEGATIVE_INFINITY;for(const n of t){const t=n.dot(e);t<i.min&&(i.min=t),t>i.max&&(i.max=t)}}function i(t,e,i,r){return n(i,t,e)||n(t,i,r)}function n(t,e,i){return e<=t&&t<=i}const r={min:0,max:0},s={min:0,max:0};return t.isSeparated=function(t,n,o){for(const a of t)if(e(n,a,r),e(o,a,s),!i(r.min,r.max,s.min,s.max))return!0;return!1},t}),define("standard/Math/Geometry/Box3",["standard/Math/Geometry/Triangle3","standard/Math/Numbers/Matrix4","standard/Math/Numbers/Vector3","standard/Math/Algorithms/SAT"],function(t,e,i,n){"use strict";function r(t,i){switch(arguments.length){case 0:return void(this.matrix=new e(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0));case 2:return void(this.matrix=new e(t.x/2,0,0,0,0,t.y/2,0,0,0,0,t.z/2,0,i.x,i.y,i.z,1));case 3:{const t=arguments[0],i=arguments[1],n=(i.x-t.x)/2,r=(i.y-t.y)/2,s=(i.z-t.z)/2,o=(i.x+t.x)/2,a=(i.y+t.y)/2,u=(i.z+t.z)/2;return void(this.matrix=new e(n,0,0,0,0,r,0,0,0,0,s,0,o,a,u,1))}}}return r.prototype={constructor:r,copy:function(){const t=Object.create(r.prototype);return t.matrix=this.matrix.copy(),t},assign:function(t){return this.matrix.assign(t.matrix),this},equals:function(t){return this.matrix.equals(t.matrix)},getMatrix:function(){return this.matrix},set:function(t,e){const i=this.matrix;switch(arguments.length){case 0:return i[0]=.5,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=.5,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=.5,i[11]=0,i[12]=0,i[13]=0,i[14]=0,i[15]=0,this;case 2:return i[0]=t.x/2,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=t.y/2,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=t.z/2,i[11]=0,i[12]=e.x,i[13]=e.y,i[14]=e.z,i[15]=1,this;case 3:{const t=arguments[0],e=arguments[1],i=(e.x-t.x)/2,n=(e.y-t.y)/2,r=(e.z-t.z)/2,s=(e.x+t.x)/2,o=(e.y+t.y)/2,a=(e.z+t.z)/2;return this.matrix.set(i,0,0,0,0,n,0,0,0,0,r,0,s,o,a,1),this}}},setExtents:function(t,e){const i=this.matrix,n=(e.x-t.x)/2,r=(e.y-t.y)/2,s=(e.z-t.z)/2,o=(e.x+t.x)/2,a=(e.y+t.y)/2,u=(e.z+t.z)/2;return i[0]=n,i[1]=0,i[2]=0,i[3]=0,i[4]=0,i[5]=r,i[6]=0,i[7]=0,i[8]=0,i[9]=0,i[10]=s,i[11]=0,i[12]=o,i[13]=a,i[14]=u,i[15]=1,this},getExtents:function(t,e){this.getAbsoluteExtents(t,e),t.add(this.center),e.add(this.center)},getAbsoluteExtents:function(){const t=new i(0,0,0),e=new i(0,0,0),n=new i(0,0,0);return function(i,r){const s=this.matrix,o=s.xAxis,a=s.yAxis,u=s.zAxis;t.assign(a).add(u);const l=u.subtract(a);e.assign(o).add(t),n.assign(o).add(l);const c=t.subtract(o),h=l.subtract(o);i.assign(e),r.assign(e),i.min(c,h,n),r.max(c,h,n),e.negate(),c.negate(),h.negate(),n.negate(),i.min(e,c,h,n),r.max(e,c,h,n)}}(),getPoints:function(){const t=new i(0,0,0),e=new i(0,0,0),n=new i(0,0,0),r=new i(0,0,0);return function(i){const s=this.matrix;t.assign(s.xAxis),e.assign(s.yAxis),n.assign(s.zAxis),r.assign(e).add(n);const o=n.subtract(e);i[0].assign(t).add(r),i[1].assign(r).subtract(t),i[2].assign(o).subtract(t),i[3].assign(t).add(o),i[4].assign(i[2]).negate(),i[5].assign(i[3]).negate(),i[6].assign(i[0]).negate(),i[7].assign(i[1]).negate();const a=this.center;return i[0].add(a),i[1].add(a),i[2].add(a),i[3].add(a),i[4].add(a),i[5].add(a),i[6].add(a),i[7].add(a),i}}(),getAxes:function(t){const e=this.matrix;return t[0].assign(e.xAxis),t[1].assign(e.yAxis),t[2].assign(e.zAxis),t},getNormals:function(){const t=new i(0,0,0),e=new i(0,0,0),n=new i(0,0,0),r=[i.xAxis,i.yAxis,i.zAxis];return function(s){const o=this.matrix;if(t.assign(o.xAxis),e.assign(o.yAxis),n.assign(o.zAxis),0===t.norm()&&(t.assign(e).cross(n),0===t.norm())){for(const i of r)if(t.assign(i).cross(e),0!==t.norm())break;if(0===t.norm()){for(const e of r)if(t.assign(e).cross(n),0!==t.norm())break;0===t.norm()&&t.assign(i.xAxis)}}if(0===e.norm()&&(e.assign(n).cross(t),0===e.norm())){for(const t of r)if(e.assign(t).cross(n),0!==e.norm())break;if(0===e.norm()){for(const i of r)if(e.assign(i).cross(t),0!==e.norm())break;0===e.norm()&&e.assign(i.yAxis)}}if(0===n.norm()&&(n.assign(t).cross(e),0===n.norm())){for(const e of r)if(n.assign(e).cross(t),0!==n.norm())break;if(0===n.norm()){for(const t of r)if(n.assign(t).cross(e),0!==n.norm())break;0===n.norm()&&n.assign(i.zAxis)}}return s[0].assign(e).cross(n).normalize(),s[1].assign(n).cross(t).normalize(),s[2].assign(t).cross(e).normalize(),s}}(),isEmpty:function(){return 0===this.matrix[15]},add:function(){const t=new i(0,0,0),e=new i(0,0,0),n=new i(0,0,0),r=new i(0,0,0);return function(i){return this.isEmpty()?this.assign(i):i.isEmpty()?this:(this.getExtents(t,e),i.getExtents(n,r),this.set(t.min(n),e.max(r),!0))}}(),multLeft:function(t){return this.matrix.multLeft(t),this},multRight:function(t){return this.matrix.multRight(t),this},containsPoint:function(){const t=new i(0,0,0),e=new i(0,0,0);return function(i){return this.getExtents(t,e),t.x<=i.x&&e.x>=i.x&&t.y<=i.y&&e.y>=i.y&&t.z<=i.z&&e.z>=i.z}}(),intersectsBox:function(){const t=[new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0)],e=[new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0)],r=[new i(0,0,0),new i(0,0,0),new i(0,0,0)],s=[new i(0,0,0),new i(0,0,0),new i(0,0,0)],o=[new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0)],a=[new i(0,0,0),new i(0,0,0),new i(0,0,0)];return function(i){if(this.isEmpty())return!1;if(i.isEmpty())return!1;if(this.getPoints(t),i.getPoints(e),n.isSeparated(this.getNormals(a),t,e))return!1;if(n.isSeparated(i.getNormals(a),t,e))return!1;this.getAxes(r),i.getAxes(s);for(let t=0;t<3;++t)for(let e=0;e<3;++e)o[3*t+e].assign(r[t]).cross(s[e]);return!n.isSeparated(o,t,e)}}(),intersectsTriangle:function(){const e=[new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0)],r=[new i(0,0,0),new i(0,0,0),new i(0,0,0)],s=[new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0)],o=[new i(0,0,0),new i(0,0,0),new i(0,0,0)],a=[],u=[new i(0,0,0)],l=[new i(0,0,0),new i(0,0,0),new i(0,0,0)];return function(i,c,h){if(this.isEmpty())return!1;if(this.getPoints(e),a[0]=i,a[1]=c,a[2]=h,n.isSeparated(this.getNormals(o),e,a))return!1;if(t.normal(i,c,h,u[0]),n.isSeparated(u,e,a))return!1;this.getAxes(r),l[0].assign(i).subtract(c),l[1].assign(c).subtract(h),l[2].assign(h).subtract(i);for(let t=0;t<3;++t)for(let e=0;e<3;++e)s[3*t+e].assign(r[t]).cross(l[e]);return!n.isSeparated(s,e,a)}}(),toString:function(){return this.size+", "+this.center}},Object.defineProperty(r.prototype,"size",{get:function(){const t=new i(0,0,0),e=new i(0,0,0);return function(){return this.getAbsoluteExtents(t,e),e.subtract(t)}}(),enumerable:!0,configurable:!1}),Object.defineProperty(r.prototype,"center",{get:function(){return this.matrix.origin},enumerable:!0,configurable:!1}),r}),define("standard/Math/Geometry/Plane3",["standard/Math/Numbers/Vector3","standard/Math/Numbers/Matrix4"],function(t,e){"use strict";function i(t,e){this.normal=e.copy(),this.distanceFromOrigin=e.dot(t)}const n=new t(0,0,0),r=new t(0,0,0),s=new e;return i.prototype={constructor:i,copy:function(){const t=Object.create(i.prototype);return t.normal=this.normal.copy(),t.distanceFromOrigin=this.distanceFromOrigin,t},assign:function(t){return this.normal.assign(t.normal),this.distanceFromOrigin=t.distanceFromOrigin,this},set:function(t,e){return this.normal.assign(e),this.distanceFromOrigin=e.dot(t),this},multRight:function(t){return r.assign(this.normal).multiply(this.distanceFromOrigin),s.assign(t).inverse(),s.multMatrixDir(n.assign(this.normal)).normalize(),t.multVecMatrix(r),this.normal.assign(n),this.distanceFromOrigin=n.dot(r),this},multLeft:function(t){return r.assign(this.normal).multiply(this.distanceFromOrigin),s.assign(t).inverse(),s.multDirMatrix(n.assign(this.normal)).normalize(),t.multMatrixVec(r),this.normal.assign(n),this.distanceFromOrigin=n.dot(r),this},getDistanceToPoint:function(e){return t.dot(e,this.normal)-this.distanceFromOrigin},intersectsLine:function(t,e){const i=t.point,n=t.direction,r=n.dot(this.normal);if(0===r)return!1;const s=(this.distanceFromOrigin-this.normal.dot(i))/r;return e.x=i.x+n.x*s,e.y=i.y+n.y*s,e.z=i.z+n.z*s,!0},toString:function(){return this.normal.toString()+" "+this.distanceFromOrigin}},i}),define("standard/Math/Geometry/ViewVolume",["standard/Math/Geometry/Plane3","standard/Math/Geometry/Triangle3","standard/Math/Numbers/Vector3","standard/Math/Numbers/Vector4","standard/Math/Numbers/Matrix4","standard/Math/Algorithms/SAT"],function(t,e,i,n,r,s){"use strict";function o(e,r,s){this.viewport=new n(0,0,0,0),this.scissor=new n(0,0,0,0),this.points=[new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0)],this.normals=[new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0)],this.edges=[new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0)],this.planes=[new t(i.Zero,i.Zero),new t(i.Zero,i.Zero),new t(i.Zero,i.Zero),new t(i.Zero,i.Zero),new t(i.Zero,i.Zero),new t(i.Zero,i.Zero)],arguments.length&&this.set(e,r,s)}return o.prototype={constructor:o,set:function(){const t=new r;return function(i,n,r){try{this.viewport.assign(n),this.scissor.assign(r);const s=this.points,a=s[0],u=s[1],l=s[2],c=s[3],h=s[4],d=s[5],p=s[6],f=s[7],g=r[0],m=g+r[2],_=r[1],x=_+r[3];t.assign(i).inverse(),o.unProjectPointMatrix(g,_,0,t,n,a),o.unProjectPointMatrix(m,_,0,t,n,u),o.unProjectPointMatrix(m,x,0,t,n,l),o.unProjectPointMatrix(g,x,0,t,n,c),o.unProjectPointMatrix(g,_,1,t,n,h),o.unProjectPointMatrix(m,_,1,t,n,d),o.unProjectPointMatrix(m,x,1,t,n,p),o.unProjectPointMatrix(g,x,1,t,n,f);const y=this.normals;e.normal(a,u,l,y[0]),e.normal(f,h,a,y[1]),e.normal(p,l,u,y[2]),e.normal(l,p,f,y[3]),e.normal(u,a,h,y[4]),e.normal(h,f,p,y[5]);const v=this.planes;v[0].set(u,y[0]),v[1].set(h,y[1]),v[2].set(l,y[2]),v[3].set(p,y[3]),v[4].set(a,y[4]),v[5].set(f,y[5]),this.edges.tainted=!0,this.valid=!0}catch(t){this.valid=!1}return this}}(),getViewport:function(){return this.viewport},getScissor:function(){return this.scissor},getEdges:function(){const t=this.edges;if(t.tainted){const e=this.points;t[0].assign(e[0]).subtract(e[1]),t[1].assign(e[1]).subtract(e[2]),t[2].assign(e[2]).subtract(e[3]),t[3].assign(e[3]).subtract(e[0]),t[4].assign(e[0]).subtract(e[4]),t[5].assign(e[1]).subtract(e[5]),t[6].assign(e[2]).subtract(e[6]),t[7].assign(e[3]).subtract(e[7]),t.tainted=!1}return t},intersectsSphere:function(t,e){if(this.valid){const i=this.planes;if(i[0].getDistanceToPoint(e)>t)return!1;if(i[1].getDistanceToPoint(e)>t)return!1;if(i[2].getDistanceToPoint(e)>t)return!1;if(i[3].getDistanceToPoint(e)>t)return!1;if(i[4].getDistanceToPoint(e)>t)return!1;if(i[5].getDistanceToPoint(e)>t)return!1}return!0},intersectsBox:function(){const t=[new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0),new i(0,0,0)],e=[new i(0,0,0),new i(0,0,0),new i(0,0,0)],n=[new i(0,0,0),new i(0,0,0),new i(0,0,0)],r=[];for(let t=0;t<24;++t)r.push(new i(0,0,0));return function(i){i.getPoints(t);const o=this.points;if(s.isSeparated(i.getNormals(e),t,o))return!1;if(s.isSeparated(this.normals,t,o))return!1;i.getAxes(n);const a=this.getEdges();for(let t=0;t<3;++t)for(let e=0;e<8;++e)r[3*t+e].assign(n[t]).cross(a[e]);return!s.isSeparated(r,t,o)}}()},Object.assign(o,{unProjectPoint:function(){const t=new r;return function(e,i,n,r,s,o,a){return t.assign(r).multRight(s).inverse(),this.unProjectPointMatrix(e,i,n,t,o,a)}}(),unProjectPointMatrix:function(){const t=new n(0,0,0,0);return function(e,i,n,r,s,o){if(t.set((e-s[0])/s[2]*2-1,(i-s[1])/s[3]*2-1,2*n-1,1),r.multVecMatrix(t),0===t.w)throw new Error("Couldn't unproject point: divisor is 0.");const a=1/t.w;return o.set(t.x*a,t.y*a,t.z*a)}}(),unProjectRay:function(){const t=new i(0,0,0),e=new i(0,0,0),n=new r;return function(i,r,s,a,u,l){return n.assign(s).multRight(a).inverse(),o.unProjectPointMatrix(i,r,0,n,u,t),o.unProjectPointMatrix(i,r,.9,n,u,e),l.setPoints(t,e)}}(),projectPoint:function(){const t=new n(0,0,0,0);return function(e,i,n,r,s){if(t.set(e.x,e.y,e.z,1),n.multVecMatrix(i.multVecMatrix(t)),0===t.w)throw new Error("Couldn't project point: divisor is 0.");const o=1/(2*t.w);return s.set((t.x*o+.5)*r[2]+r[0],(t.y*o+.5)*r[3]+r[1],t.z*o+.5)}}(),projectLine:function(){const t=new i(0,0,0),e=new i(0,0,0);return function(n,r,s,a,u){return o.projectPoint(n.point,r,s,a,t),o.projectPoint(i.multiply(n.direction,1e9).add(n.point),r,s,a,e),t.z=0,e.z=0,u.setPoints(t,e)}}()}),o}),define("x_ite/Browser/Navigation/X3DViewer",["x_ite/Basic/X3DBaseNode","x_ite/Components/Navigation/OrthoViewpoint","standard/Math/Numbers/Vector3","standard/Math/Numbers/Matrix4","standard/Math/Geometry/Box3","standard/Math/Geometry/ViewVolume"],function(t,e,i,n,r,s){"use strict";function o(e){t.call(this,e)}function a(t,e,i){const n=Math.hypot(e,i);if(n<t*Math.sqrt(.5))return Math.sqrt(t*t-n*n);const r=t/Math.sqrt(2);return r*r/n}return o.prototype=Object.assign(Object.create(t.prototype),{constructor:o,getTypeName:function(){return"X3DViewer"},initialize:function(){},initShaders:function(){},getActiveLayer:function(){return this.getBrowser().getActiveLayer()},getViewport:function(){return this.getBrowser().getActiveLayer().getViewport()},getNavigationInfo:function(){return this.getBrowser().getActiveLayer().getNavigationInfo()},getActiveViewpoint:function(){return this.getBrowser().getActiveLayer().getViewpoint()},getStraightenHorizon:function(){return this.getBrowser().getBrowserOption("StraightenHorizon")},getButton:function(t){return 0===t&&this.getBrowser().getAltKey()?1:t},getPointOnCenterPlane:function(){const t=new i(0,0,-1),r=new i(0,0,0),o=new i(0,0,0);return function(i,a,u){try{const l=this.getNavigationInfo(),c=this.getActiveViewpoint(),h=this.getViewport().getRectangle(this.getBrowser()),d=c.getProjectionMatrixWithLimits(l.getNearValue(),l.getFarValue(c),h);if(s.unProjectPoint(i,this.getBrowser().getViewport()[3]-a,.9,n.Identity,d,h,o),c instanceof e)return u.set(o.x,o.y,-this.getDistanceToCenter(r).abs());const p=o.normalize();return u.assign(p).multiply(this.getDistanceToCenter(r).abs()/p.dot(t))}catch(t){return console.log(t),u.set(0,0,0)}}}(),getDistanceToCenter:function(t,e){const i=this.getActiveViewpoint();return t.assign(i.getPosition()).add(e||i.positionOffset_.getValue()).subtract(i.getUserCenterOfRotation())},trackballProjectToSphere:function(t,e,i){const n=this.getViewport().getRectangle(this.getBrowser());return e=this.getBrowser().getViewport()[3]-e,t=(t-n[0])/n[2]-.5,e=(e-n[1])/n[3]-.5,i.set(t,e,a(.5,t,e))},lookAtPoint:function(t,e,i){if(this.touch(t,e)){const t=this.getBrowser().getNearestHit();this.getActiveViewpoint().lookAtPoint(this.getActiveLayer(),t.intersection.point,.381966,i)}},lookAtBBox:function(){const t=new r;return function(e,i,n){if(this.touch(e,i)){const e=this.getBrowser().getNearestHit();e.shape.getBBox(t).multRight(e.modelViewMatrix),this.getActiveViewpoint().lookAtBBox(this.getActiveLayer(),t,.381966,n)}}}(),touch:function(t,e){return this.getBrowser().touch(t,e),this.getBrowser().getHits().length},dispose:function(){}}),o}),
|
|
@@ -23,19 +23,19 @@ this.avatarSize_.setUnit("length"),this.speed_.setUnit("speed"),this.visibilityL
|
|
|
23
23
|
this.getViewpoint().lookAtBBox(this.getBBox(new d),t,e)},set_viewport__:function(){this.currentViewport=u(c.X3DViewportNode,this.viewport_),this.currentViewport||(this.currentViewport=this.getBrowser().getDefaultViewport())},bind:function(t){this.traverse(l.CAMERA,this);const e=this.navigationInfos.getBound(),i=this.backgrounds.getBound(),n=this.fogs.getBound(),r=this.viewpoints.getBound(t);this.navigationInfoStack.pushOnTop(e),this.viewpointStack.pushOnTop(r),this.backgroundStack.pushOnTop(i),this.fogStack.pushOnTop(n),r.resetUserOffsets()},traverse:function(t,e){e=e||this;var i=this.getViewpoint();switch(this.getProjectionMatrix().pushMatrix(i.getProjectionMatrix(this)),this.getCameraSpaceMatrix().pushMatrix(i.getCameraSpaceMatrix()),this.getViewMatrix().pushMatrix(i.getViewMatrix()),t){case l.POINTER:this.pointer(t,e);break;case l.CAMERA:this.camera(t,e);break;case l.PICKING:this.picking(t,e);break;case l.COLLISION:this.collision(t,e);break;case l.SHADOW:case l.DISPLAY:this.display(t,e)}this.getViewMatrix().pop(),this.getCameraSpaceMatrix().pop(),this.getProjectionMatrix().pop()},pointer:function(t,e){if(this.isPickable_.getValue()){var i=this.getBrowser(),n=this.currentViewport.getRectangle(i);if(i.getSelectedLayer()){if(i.getSelectedLayer()!==this)return}else if(!i.isPointerInRectangle(n))return;i.setHitRay(this.getProjectionMatrix().get(),n),this.getModelViewMatrix().pushMatrix(this.getViewMatrix().get()),this.currentViewport.push(this),this.groupNode.traverse(t,e),this.currentViewport.pop(this),this.getModelViewMatrix().pop()}},camera:function(t,e){this.getModelViewMatrix().pushMatrix(f.Identity),this.currentViewport.push(this),this.groupNode.traverse(t,e),this.currentViewport.pop(this),this.getModelViewMatrix().pop(),this.navigationInfos.update(this,this.navigationInfoStack),this.viewpoints.update(this,this.viewpointStack),this.backgrounds.update(this,this.backgroundStack),this.fogs.update(this,this.fogStack),this.getViewpoint().update()},picking:function(t,e){this.getModelViewMatrix().pushMatrix(f.Identity),this.currentViewport.push(this),this.groupNode.traverse(t,e),this.currentViewport.pop(this),this.getModelViewMatrix().pop()},collision:function(t,e){var i=this.getNavigationInfo();if(!i.transitionActive_.getValue()){var n=i.getCollisionRadius(),r=i.getAvatarHeight(),s=Math.max(2*n,2*r);this.collisionTime=0,h.ortho(-s,s,-s,s,-s,s,m),this.getProjectionMatrix().pushMatrix(m),this.getModelViewMatrix().pushMatrix(this.getViewMatrix().get()),this.currentViewport.push(this),e.render(t,this.groupNode.traverse,this.groupNode),this.currentViewport.pop(this),this.getModelViewMatrix().pop(),this.getProjectionMatrix().pop()}},display:function(t,e){this.getNavigationInfo().enable(t,e),this.getModelViewMatrix().pushMatrix(this.getViewMatrix().get()),this.currentViewport.push(this),e.render(t,this.groupNode.traverse,this.groupNode),this.currentViewport.pop(this),this.getModelViewMatrix().pop()}}),g}),define("x_ite/Components/Navigation/Viewpoint",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Navigation/X3DViewpointNode","x_ite/Components/Interpolation/ScalarInterpolator","x_ite/Bits/X3DConstants","standard/Math/Geometry/Camera","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3","standard/Math/Numbers/Matrix4"],function(t,e,i,n,r,s,o,a,u,l){"use strict";function c(t){n.call(this,t),this.addType(s.Viewpoint),this.position_.setUnit("length"),this.centerOfRotation_.setUnit("length"),this.fieldOfView_.setUnit("angle"),this.projectionMatrix=new l,this.fieldOfViewInterpolator=new r(this.getBrowser().getPrivateScene())}return c.prototype=Object.assign(Object.create(n.prototype),{constructor:c,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOnly,"set_bind",new t.SFBool),new e(s.inputOutput,"description",new t.SFString),new e(s.inputOutput,"position",new t.SFVec3f(0,0,10)),new e(s.inputOutput,"orientation",new t.SFRotation),new e(s.inputOutput,"centerOfRotation",new t.SFVec3f),new e(s.inputOutput,"fieldOfView",new t.SFFloat(.7854)),new e(s.inputOutput,"jump",new t.SFBool(!0)),new e(s.inputOutput,"retainUserOffsets",new t.SFBool),new e(s.outputOnly,"isBound",new t.SFBool),new e(s.outputOnly,"bindTime",new t.SFTime)]),getTypeName:function(){return"Viewpoint"},getComponentName:function(){return"Navigation"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.fieldOfViewInterpolator.key_=new t.MFFloat(0,1),this.fieldOfViewInterpolator.setup(),this.getEaseInEaseOut().modifiedFraction_changed_.addFieldInterest(this.fieldOfViewInterpolator.set_fraction_),this.fieldOfViewInterpolator.value_changed_.addFieldInterest(this.fieldOfViewScale_)},setInterpolators:function(e,i){if(e.getType().indexOf(s.Viewpoint)>=0){const n=e.getFieldOfView()/i.getFieldOfView();this.fieldOfViewInterpolator.keyValue_=new t.MFFloat(n,i.fieldOfViewScale_.getValue()),this.fieldOfViewScale_=n}else this.fieldOfViewInterpolator.keyValue_=new t.MFFloat(i.fieldOfViewScale_.getValue(),i.fieldOfViewScale_.getValue()),this.fieldOfViewScale_=i.fieldOfViewScale_.getValue()},getFieldOfView:function(){var t=this.fieldOfView_.getValue()*this.fieldOfViewScale_.getValue();return t>0&&t<Math.PI?t:Math.PI/4},getScreenScale:function(){var t=new u(0,0,0);return function(e,i){var n=i[2],r=i[3],s=Math.abs(e.z)*Math.tan(this.getFieldOfView()/2)*2;return s/=n>r?r:n,t.set(s,s,s)}}(),getViewportSize:function(){var t=new a(0,0);return function(e,i){var n=e[2],r=e[3],s=i*Math.tan(this.getFieldOfView()/2)*2,o=n/r;return o>1?t.set(s*o,s):t.set(s,s/o)}}(),getLookAtDistance:function(t){return t.size.abs()/2/Math.tan(this.getFieldOfView()/2)},getProjectionMatrixWithLimits:function(t,e,i){return o.perspective(this.getFieldOfView(),t,e,i[2],i[3],this.projectionMatrix)}}),c}),define("x_ite/Components/Grouping/Group",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Grouping/X3DGroupingNode","x_ite/Bits/X3DConstants"],function(t,e,i,n,r){"use strict";function s(t){n.call(this,t),this.addType(r.Group)}return s.prototype=Object.assign(Object.create(n.prototype),{constructor:s,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"visible",new t.SFBool(!0)),new e(r.inputOutput,"bboxDisplay",new t.SFBool),new e(r.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new e(r.initializeOnly,"bboxCenter",new t.SFVec3f),new e(r.inputOnly,"addChildren",new t.MFNode),new e(r.inputOnly,"removeChildren",new t.MFNode),new e(r.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"Group"},getComponentName:function(){return"Grouping"},getContainerField:function(){return"children"}}),s}),define("x_ite/Components/Layering/Layer",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Layering/X3DLayerNode","x_ite/Components/Navigation/Viewpoint","x_ite/Components/Grouping/Group","x_ite/Bits/X3DConstants"],function(t,e,i,n,r,s,o){"use strict";function a(t){n.call(this,t,new r(t),new s(t)),this.addType(o.Layer)}return a.prototype=Object.assign(Object.create(n.prototype),{constructor:a,fieldDefinitions:new i([new e(o.inputOutput,"metadata",new t.SFNode),new e(o.inputOutput,"isPickable",new t.SFBool(!0)),new e(o.inputOutput,"viewport",new t.SFNode),new e(o.inputOnly,"addChildren",new t.MFNode),new e(o.inputOnly,"removeChildren",new t.MFNode),new e(o.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"Layer"},getComponentName:function(){return"Layering"},getContainerField:function(){return"layers"},initialize:function(){n.prototype.initialize.call(this),this.addChildren_.addFieldInterest(this.getGroup().addChildren_),this.removeChildren_.addFieldInterest(this.getGroup().removeChildren_),this.children_.addFieldInterest(this.getGroup().children_),this.getGroup().children_=this.children_,this.getGroup().setPrivate(!0),this.getGroup().setup()}}),a}),define("x_ite/Components/Layering/LayerSet",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Core/X3DNode","x_ite/Components/Layering/Layer","x_ite/Bits/X3DCast","x_ite/Bits/TraverseType","x_ite/Bits/X3DConstants"],function(t,e,i,n,r,s,o,a){"use strict";function u(t){n.call(this,t),this.addType(a.LayerSet),this.layerNodes=[new r(t)],this.layerNode0=this.layerNodes[0],this.activeLayerNode=null}return u.prototype=Object.assign(Object.create(n.prototype),{constructor:u,fieldDefinitions:new i([new e(a.inputOutput,"metadata",new t.SFNode),new e(a.inputOutput,"activeLayer",new t.SFInt32),new e(a.inputOutput,"order",new t.MFInt32(0)),new e(a.inputOutput,"layers",new t.MFNode)]),getTypeName:function(){return"LayerSet"},getComponentName:function(){return"Layering"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.layerNode0.setPrivate(!0),this.layerNode0.setup(),this.layerNode0.isLayer0(!0),this.activeLayer_.addInterest("set_activeLayer",this),this.order_.addInterest("set_layers",this),this.layers_.addInterest("set_layers",this),this.set_layers()},getActiveLayer:function(){return this.activeLayerNode},setLayer0:function(t){this.layerNode0=t,this.set_layers()},getLayer0:function(){return this.layerNode0},getLayers:function(){return this.layerNodes},set_activeLayer:function(){if(0===this.activeLayer_.getValue())this.activeLayerNode!==this.layerNode0&&(this.activeLayerNode=this.layerNode0);else{var t=this.activeLayer_-1;t>=0&&t<this.layers_.length?this.activeLayerNode!==this.layers_[t].getValue()&&(this.activeLayerNode=s(a.X3DLayerNode,this.layers_[t])):null!==this.activeLayerNode&&(this.activeLayerNode=null)}},set_layers:function(){var t=this.layers_.getValue();this.layerNodes.length=0;for(var e=0;e<this.order_.length;++e){var i=this.order_[e];if(0===i)this.layerNodes.push(this.layerNode0);else if(--i>=0&&i<t.length){var n=s(a.X3DLayerNode,t[i]);n&&this.layerNodes.push(n)}}this.set_activeLayer()},bind:function(t){const e=this.layers_.getValue();this.layerNode0.bind(t);for(let i=0,n=e.length;i<n;++i){const n=s(a.X3DLayerNode,e[i]);n&&n.bind(t)}},traverse:function(t,e){var i=this.layerNodes;if(t===o.POINTER)for(var n=0,r=i.length;n<r;++n)this.getBrowser().setLayerNumber(n),i[n].traverse(t,e);else for(var n=0,r=i.length;n<r;++n)i[n].traverse(t,e)}}),u}),define("x_ite/Execution/World",["x_ite/Fields/SFNode","x_ite/Basic/X3DBaseNode","x_ite/Components/Layering/LayerSet","x_ite/Components/Layering/Layer","x_ite/Bits/X3DCast","x_ite/Bits/X3DConstants"],function(t,e,i,n,r,s){"use strict";function o(r){e.call(this,r),this.addChildObjects("activeLayer",new t(this.layer0)),this.layerSet=new i(r),this.defaultLayerSet=this.layerSet,this.layer0=new n(r)}return o.prototype=Object.assign(Object.create(e.prototype),{constructor:o,getTypeName:function(){return"World"},initialize:function(){e.prototype.initialize.call(this),this.layerSet.setPrivate(!0),this.layerSet.setup(),this.layerSet.setLayer0(this.layer0),this.layerSet.activeLayer_.addInterest("set_rootNodes__",this),this.getExecutionContext().getRootNodes().addInterest("set_rootNodes__",this),this.set_rootNodes__(),this.layer0.setPrivate(!0),this.layer0.isLayer0(!0),this.layer0.setup(),this.set_activeLayer__()},getCache:function(){return!0},getLayerSet:function(){return this.layerSet},getActiveLayer:function(){return this.activeLayer_.getValue()},set_rootNodes__:function(){const t=this.layerSet,e=this.getExecutionContext().getRootNodes();this.layerSet=this.defaultLayerSet,this.layer0.children_=e;for(const t of e){const e=r(s.LayerSet,t);e&&(this.layerSet=e)}this.layerSet.setLayer0(this.layer0),this.layerSet!==t&&(t.activeLayer_.removeInterest("set_activeLayer__",this),this.layerSet.activeLayer_.addInterest("set_activeLayer__",this),this.set_activeLayer__())},set_activeLayer__:function(){this.activeLayer_=this.layerSet.getActiveLayer()},bind:function(){const t=this.getExecutionContext().getWorldURL();this.layerSet.bind(new URL(t,t).hash.substr(1))},traverse:function(t,e){this.layerSet.traverse(t,e)}}),o}),define("standard/Networking/BinaryTransport",[],function(){"use strict";return function(t){t.ajaxTransport("+binary",function(t,e,i){if(t.dataType&&"binary"==t.dataType)return{send:function(e,i){const n=t.xhr();if(n.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(const e in t.xhrFields)n[e]=t.xhrFields[e];t.mimeType&&n.overrideMimeType&&n.overrideMimeType(t.mimeType);for(const t in e)n.setRequestHeader(t,e[t]);n.onload=function(){n.onload=n.onerror=null;const e={};e[t.dataType]=n.response,i(n.status,n.statusText,e,n.getAllResponseHeaders())},n.onerror=function(){n.onload=n.onerror=null,i(n.status||404,n.statusText)},n.responseType=t.responseType||"blob",n.send(t.hasContent&&t.data||null)},abort:function(){const e=t.xhr();e.onload=e.onerror=null,e.abort()}}})}}),function(t,e){"object"==typeof exports&&void 0!==module?e(exports):"function"==typeof define&&define.amd?define("pako_inflate/dist/pako_inflate",["exports"],e):(t="undefined"!=typeof globalThis?globalThis:t||self,e(t.pako={}))}(this,function(t){"use strict";function e(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function i(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}function n(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}function r(t){this.options=$.assign({chunkSize:65536,windowBits:15,to:""},t||{});const e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new rt,this.strm.avail_out=0;let i=H.inflateInit2(this.strm,e.windowBits);if(i!==Z_OK)throw new Error(nt[i]);if(this.header=new st,H.inflateGetHeader(this.strm,this.header),e.dictionary&&("string"==typeof e.dictionary?e.dictionary=it.string2buf(e.dictionary):"[object ArrayBuffer]"===ot.call(e.dictionary)&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(i=H.inflateSetDictionary(this.strm,e.dictionary))!==Z_OK))throw new Error(nt[i])}function s(t,e){const i=new r(e);if(i.push(t),i.err)throw i.msg||nt[i.err];return i.result}function o(t,e){return e=e||{},e.raw=!0,s(t,e)}const a=(t,e,i,n)=>{let r=65535&t|0,s=t>>>16&65535|0,o=0;for(;0!==i;){o=i>2e3?2e3:i,i-=o;do r=r+e[n++]|0,s=s+r|0;while(--o)r%=65521,s%=65521}return r|s<<16|0};var u=a;const l=()=>{let t,e=[];for(var i=0;i<256;i++){t=i;for(var n=0;n<8;n++)t=1&t?3988292384^t>>>1:t>>>1;e[i]=t}return e},c=new Uint32Array(l()),h=(t,e,i,n)=>{const r=c,s=n+i;t^=-1;for(let i=n;i<s;i++)t=t>>>8^r[255&(t^e[i])];return t^-1};var d=h;var p=function(t,e){let i,n,r,s,o,a,u,l,c,h,d,p,f,g,m,_,x,y,v,w,b,S,C,T;const F=t.state;i=t.next_in,C=t.input,n=i+(t.avail_in-5),r=t.next_out,T=t.output,s=r-(e-t.avail_out),o=r+(t.avail_out-257),a=F.dmax,u=F.wsize,l=F.whave,c=F.wnext,h=F.window,d=F.hold,p=F.bits,f=F.lencode,g=F.distcode,m=(1<<F.lenbits)-1,_=(1<<F.distbits)-1;t:do{p<15&&(d+=C[i++]<<p,p+=8,d+=C[i++]<<p,p+=8),x=f[d&m];e:for(;;){if(y=x>>>24,d>>>=y,p-=y,0===(y=x>>>16&255))T[r++]=65535&x;else{if(!(16&y)){if(0==(64&y)){x=f[(65535&x)+(d&(1<<y)-1)];continue e}if(32&y){F.mode=12;break t}t.msg="invalid literal/length code",F.mode=30;break t}v=65535&x,y&=15,y&&(p<y&&(d+=C[i++]<<p,p+=8),v+=d&(1<<y)-1,d>>>=y,p-=y),p<15&&(d+=C[i++]<<p,p+=8,d+=C[i++]<<p,p+=8),x=g[d&_];i:for(;;){if(y=x>>>24,d>>>=y,p-=y,!(16&(y=x>>>16&255))){if(0==(64&y)){x=g[(65535&x)+(d&(1<<y)-1)];continue i}t.msg="invalid distance code",F.mode=30;break t}if(w=65535&x,y&=15,p<y&&(d+=C[i++]<<p,(p+=8)<y&&(d+=C[i++]<<p,p+=8)),(w+=d&(1<<y)-1)>a){t.msg="invalid distance too far back",F.mode=30;break t}if(d>>>=y,p-=y,y=r-s,w>y){if((y=w-y)>l&&F.sane){t.msg="invalid distance too far back",F.mode=30;break t}if(b=0,S=h,0===c){if(b+=u-y,y<v){v-=y;do T[r++]=h[b++];while(--y)b=r-w,S=T}}else if(c<y){if(b+=u+c-y,(y-=c)<v){v-=y;do T[r++]=h[b++];while(--y)if(b=0,c<v){y=c,v-=y;do T[r++]=h[b++];while(--y)b=r-w,S=T}}}else if(b+=c-y,y<v){v-=y;do T[r++]=h[b++];while(--y)b=r-w,S=T}for(;v>2;)T[r++]=S[b++],T[r++]=S[b++],T[r++]=S[b++],v-=3;v&&(T[r++]=S[b++],v>1&&(T[r++]=S[b++]))}else{b=r-w;do T[r++]=T[b++],T[r++]=T[b++],T[r++]=T[b++],v-=3;while(v>2)v&&(T[r++]=T[b++],v>1&&(T[r++]=T[b++]))}break}}break}}while(i<n&&r<o)v=p>>3,i-=v,p-=v<<3,d&=(1<<p)-1,t.next_in=i,t.next_out=r,t.avail_in=i<n?n-i+5:5-(i-n),t.avail_out=r<o?o-r+257:257-(r-o),F.hold=d,F.bits=p};const f=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),g=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),m=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),_=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),x=(t,e,i,n,r,s,o,a)=>{const u=a.bits;let l,c,h,d,p,x,y=0,v=0,w=0,b=0,S=0,C=0,T=0,F=0,O=0,N=0,E=null,M=0;const D=new Uint16Array(16),V=new Uint16Array(16);let I,B,A,P=null,L=0;for(y=0;y<=15;y++)D[y]=0;for(v=0;v<n;v++)D[e[i+v]]++;for(S=u,b=15;b>=1&&0===D[b];b--);if(S>b&&(S=b),0===b)return r[s++]=20971520,r[s++]=20971520,a.bits=1,0;for(w=1;w<b&&0===D[w];w++);for(S<w&&(S=w),F=1,y=1;y<=15;y++)if(F<<=1,(F-=D[y])<0)return-1;if(F>0&&(0===t||1!==b))return-1;for(V[1]=0,y=1;y<15;y++)V[y+1]=V[y]+D[y];for(v=0;v<n;v++)0!==e[i+v]&&(o[V[e[i+v]]++]=v);if(0===t?(E=P=o,x=19):1===t?(E=f,M-=257,P=g,L-=257,x=256):(E=m,P=_,x=-1),N=0,v=0,y=w,p=s,C=S,T=0,h=-1,O=1<<S,d=O-1,1===t&&O>852||2===t&&O>592)return 1;for(;;){I=y-T,o[v]<x?(B=0,A=o[v]):o[v]>x?(B=P[L+o[v]],A=E[M+o[v]]):(B=96,A=0),l=1<<y-T,c=1<<C,w=c;do c-=l,r[p+(N>>T)+c]=I<<24|B<<16|A|0;while(0!==c)for(l=1<<y-1;N&l;)l>>=1;if(0!==l?(N&=l-1,N+=l):N=0,v++,0==--D[y]){if(y===b)break;y=e[i+o[v]]}if(y>S&&(N&d)!==h){for(0===T&&(T=S),p+=w,C=y-T,F=1<<C;C+T<b&&!((F-=D[C+T])<=0);)C++,F<<=1;if(O+=1<<C,1===t&&O>852||2===t&&O>592)return 1;h=N&d,r[h]=S<<24|C<<16|p-s|0}}return 0!==N&&(r[p+N]=y-T<<24|64<<16|0),a.bits=S,0};var y=x,v={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{Z_FINISH:Z_FINISH$1,Z_BLOCK:Z_BLOCK,Z_TREES:Z_TREES,Z_OK:Z_OK$1,Z_STREAM_END:Z_STREAM_END$1,Z_NEED_DICT:Z_NEED_DICT$1,Z_STREAM_ERROR:Z_STREAM_ERROR$1,Z_DATA_ERROR:Z_DATA_ERROR$1,Z_MEM_ERROR:Z_MEM_ERROR$1,Z_BUF_ERROR:Z_BUF_ERROR,Z_DEFLATED:Z_DEFLATED}=v,w=t=>{return(t>>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)},b=t=>{if(!t||!t.state)return Z_STREAM_ERROR$1;const e=t.state;return t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=1,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Int32Array(852),e.distcode=e.distdyn=new Int32Array(592),e.sane=1,e.back=-1,Z_OK$1},S=t=>{if(!t||!t.state)return Z_STREAM_ERROR$1;const e=t.state;return e.wsize=0,e.whave=0,e.wnext=0,b(t)},C=(t,e)=>{let i;if(!t||!t.state)return Z_STREAM_ERROR$1;const n=t.state;return e<0?(i=0,e=-e):(i=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?Z_STREAM_ERROR$1:(null!==n.window&&n.wbits!==e&&(n.window=null),n.wrap=i,n.wbits=e,S(t))},T=(t,i)=>{if(!t)return Z_STREAM_ERROR$1;const n=new e;t.state=n,n.window=null;const r=C(t,i);return r!==Z_OK$1&&(t.state=null),r},F=t=>{return T(t,15)};let O,N,E=!0;const M=t=>{if(E){O=new Int32Array(512),N=new Int32Array(32);let e=0;for(;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(y(1,t.lens,0,288,O,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;y(2,t.lens,0,32,N,0,t.work,{bits:5}),E=!1}t.lencode=O,t.lenbits=9,t.distcode=N,t.distbits=5},D=(t,e,i,n)=>{let r;const s=t.state;return null===s.window&&(s.wsize=1<<s.wbits,s.wnext=0,s.whave=0,s.window=new Uint8Array(s.wsize)),n>=s.wsize?(s.window.set(e.subarray(i-s.wsize,i),0),s.wnext=0,s.whave=s.wsize):(r=s.wsize-s.wnext,r>n&&(r=n),s.window.set(e.subarray(i-n,i-n+r),s.wnext),n-=r,n?(s.window.set(e.subarray(i-n,i),0),s.wnext=n,s.whave=s.wsize):(s.wnext+=r,s.wnext===s.wsize&&(s.wnext=0),s.whave<s.wsize&&(s.whave+=r))),0},V=(t,e)=>{let i,n,r,s,o,a,l,c,h,f,g,m,_,x,v,b,S,C,T,F,O,N,E=0;const V=new Uint8Array(4);let I,B;const A=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!t||!t.state||!t.output||!t.input&&0!==t.avail_in)return Z_STREAM_ERROR$1;i=t.state,12===i.mode&&(i.mode=13),o=t.next_out,r=t.output,l=t.avail_out,s=t.next_in,n=t.input,a=t.avail_in,c=i.hold,h=i.bits,f=a,g=l,N=Z_OK$1;t:for(;;)switch(i.mode){case 1:if(0===i.wrap){i.mode=13;break}for(;h<16;){if(0===a)break t;a--,c+=n[s++]<<h,h+=8}if(2&i.wrap&&35615===c){i.check=0,V[0]=255&c,V[1]=c>>>8&255,i.check=d(i.check,V,2,0),c=0,h=0,i.mode=2;break}if(i.flags=0,i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&c)<<8)+(c>>8))%31){t.msg="incorrect header check",i.mode=30;break}if((15&c)!==Z_DEFLATED){t.msg="unknown compression method",i.mode=30;break}if(c>>>=4,h-=4,O=8+(15&c),0===i.wbits)i.wbits=O;else if(O>i.wbits){t.msg="invalid window size",i.mode=30;break}i.dmax=1<<i.wbits,t.adler=i.check=1,i.mode=512&c?10:12,c=0,h=0;break;case 2:for(;h<16;){if(0===a)break t;a--,c+=n[s++]<<h,h+=8}if(i.flags=c,(255&i.flags)!==Z_DEFLATED){t.msg="unknown compression method",i.mode=30;break}if(57344&i.flags){t.msg="unknown header flags set",i.mode=30;break}i.head&&(i.head.text=c>>8&1),512&i.flags&&(V[0]=255&c,V[1]=c>>>8&255,i.check=d(i.check,V,2,0)),c=0,h=0,i.mode=3;case 3:for(;h<32;){if(0===a)break t;a--,c+=n[s++]<<h,h+=8}i.head&&(i.head.time=c),512&i.flags&&(V[0]=255&c,V[1]=c>>>8&255,V[2]=c>>>16&255,V[3]=c>>>24&255,i.check=d(i.check,V,4,0)),c=0,h=0,i.mode=4;case 4:for(;h<16;){if(0===a)break t;a--,c+=n[s++]<<h,h+=8}i.head&&(i.head.xflags=255&c,i.head.os=c>>8),512&i.flags&&(V[0]=255&c,V[1]=c>>>8&255,i.check=d(i.check,V,2,0)),c=0,h=0,i.mode=5;case 5:if(1024&i.flags){for(;h<16;){if(0===a)break t;a--,c+=n[s++]<<h,h+=8}i.length=c,i.head&&(i.head.extra_len=c),512&i.flags&&(V[0]=255&c,V[1]=c>>>8&255,i.check=d(i.check,V,2,0)),c=0,h=0}else i.head&&(i.head.extra=null);i.mode=6;case 6:if(1024&i.flags&&(m=i.length,m>a&&(m=a),m&&(i.head&&(O=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Uint8Array(i.head.extra_len)),i.head.extra.set(n.subarray(s,s+m),O)),512&i.flags&&(i.check=d(i.check,n,m,s)),a-=m,s+=m,i.length-=m),i.length))break t;i.length=0,i.mode=7;case 7:if(2048&i.flags){if(0===a)break t;m=0;do O=n[s+m++],i.head&&O&&i.length<65536&&(i.head.name+=String.fromCharCode(O));while(O&&m<a)if(512&i.flags&&(i.check=d(i.check,n,m,s)),a-=m,s+=m,O)break t}else i.head&&(i.head.name=null);i.length=0,i.mode=8;case 8:if(4096&i.flags){if(0===a)break t;m=0;do O=n[s+m++],i.head&&O&&i.length<65536&&(i.head.comment+=String.fromCharCode(O));while(O&&m<a)if(512&i.flags&&(i.check=d(i.check,n,m,s)),a-=m,s+=m,O)break t}else i.head&&(i.head.comment=null);i.mode=9;case 9:if(512&i.flags){for(;h<16;){if(0===a)break t;a--,c+=n[s++]<<h,h+=8}if(c!==(65535&i.check)){t.msg="header crc mismatch",i.mode=30;break}c=0,h=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),t.adler=i.check=0,i.mode=12;break;case 10:for(;h<32;){if(0===a)break t;a--,c+=n[s++]<<h,h+=8}t.adler=i.check=w(c),c=0,h=0,i.mode=11;case 11:if(0===i.havedict)return t.next_out=o,t.avail_out=l,t.next_in=s,t.avail_in=a,i.hold=c,i.bits=h,Z_NEED_DICT$1;t.adler=i.check=1,i.mode=12;case 12:if(e===Z_BLOCK||e===Z_TREES)break t;case 13:if(i.last){c>>>=7&h,h-=7&h,i.mode=27;break}for(;h<3;){if(0===a)break t;a--,c+=n[s++]<<h,h+=8}switch(i.last=1&c,c>>>=1,h-=1,3&c){case 0:i.mode=14;break;case 1:if(M(i),i.mode=20,e===Z_TREES){c>>>=2,h-=2;break t}break;case 2:i.mode=17;break;case 3:t.msg="invalid block type",i.mode=30}c>>>=2,h-=2;break;case 14:for(c>>>=7&h,h-=7&h;h<32;){if(0===a)break t;a--,c+=n[s++]<<h,h+=8}if((65535&c)!=(c>>>16^65535)){t.msg="invalid stored block lengths",i.mode=30;break}if(i.length=65535&c,c=0,h=0,i.mode=15,e===Z_TREES)break t;case 15:i.mode=16;case 16:if(m=i.length){if(m>a&&(m=a),m>l&&(m=l),0===m)break t;r.set(n.subarray(s,s+m),o),a-=m,s+=m,l-=m,o+=m,i.length-=m;break}i.mode=12;break;case 17:for(;h<14;){if(0===a)break t;a--,c+=n[s++]<<h,h+=8}if(i.nlen=257+(31&c),c>>>=5,h-=5,i.ndist=1+(31&c),c>>>=5,h-=5,i.ncode=4+(15&c),c>>>=4,h-=4,i.nlen>286||i.ndist>30){t.msg="too many length or distance symbols",i.mode=30;break}i.have=0,i.mode=18;case 18:for(;i.have<i.ncode;){for(;h<3;){if(0===a)break t;a--,c+=n[s++]<<h,h+=8}i.lens[A[i.have++]]=7&c,c>>>=3,h-=3}for(;i.have<19;)i.lens[A[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,I={bits:i.lenbits},N=y(0,i.lens,0,19,i.lencode,0,i.work,I),i.lenbits=I.bits,N){t.msg="invalid code lengths set",i.mode=30;break}i.have=0,i.mode=19;case 19:for(;i.have<i.nlen+i.ndist;){for(;E=i.lencode[c&(1<<i.lenbits)-1],v=E>>>24,b=E>>>16&255,S=65535&E,!(v<=h);){if(0===a)break t;a--,c+=n[s++]<<h,h+=8}if(S<16)c>>>=v,h-=v,i.lens[i.have++]=S;else{if(16===S){for(B=v+2;h<B;){if(0===a)break t;a--,c+=n[s++]<<h,h+=8}if(c>>>=v,h-=v,0===i.have){t.msg="invalid bit length repeat",i.mode=30;break}O=i.lens[i.have-1],m=3+(3&c),c>>>=2,h-=2}else if(17===S){for(B=v+3;h<B;){if(0===a)break t;a--,c+=n[s++]<<h,h+=8}c>>>=v,h-=v,O=0,m=3+(7&c),c>>>=3,h-=3}else{for(B=v+7;h<B;){if(0===a)break t;a--,c+=n[s++]<<h,h+=8}c>>>=v,h-=v,O=0,m=11+(127&c),c>>>=7,h-=7}if(i.have+m>i.nlen+i.ndist){t.msg="invalid bit length repeat",i.mode=30;break}for(;m--;)i.lens[i.have++]=O}}if(30===i.mode)break;if(0===i.lens[256]){t.msg="invalid code -- missing end-of-block",i.mode=30;break}if(i.lenbits=9,I={bits:i.lenbits},N=y(1,i.lens,0,i.nlen,i.lencode,0,i.work,I),i.lenbits=I.bits,N){t.msg="invalid literal/lengths set",i.mode=30;break}if(i.distbits=6,i.distcode=i.distdyn,I={bits:i.distbits},N=y(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,I),i.distbits=I.bits,N){t.msg="invalid distances set",i.mode=30;break}if(i.mode=20,e===Z_TREES)break t;case 20:i.mode=21;case 21:if(a>=6&&l>=258){t.next_out=o,t.avail_out=l,t.next_in=s,t.avail_in=a,i.hold=c,i.bits=h,p(t,g),o=t.next_out,r=t.output,l=t.avail_out,s=t.next_in,n=t.input,a=t.avail_in,c=i.hold,h=i.bits,12===i.mode&&(i.back=-1);break}for(i.back=0;E=i.lencode[c&(1<<i.lenbits)-1],v=E>>>24,b=E>>>16&255,S=65535&E,!(v<=h);){if(0===a)break t;a--,c+=n[s++]<<h,h+=8}if(b&&0==(240&b)){for(C=v,T=b,F=S;E=i.lencode[F+((c&(1<<C+T)-1)>>C)],v=E>>>24,b=E>>>16&255,S=65535&E,!(C+v<=h);){if(0===a)break t;a--,c+=n[s++]<<h,h+=8}c>>>=C,h-=C,i.back+=C}if(c>>>=v,h-=v,i.back+=v,i.length=S,0===b){i.mode=26;break}if(32&b){i.back=-1,i.mode=12;break}if(64&b){t.msg="invalid literal/length code",i.mode=30;break}i.extra=15&b,i.mode=22;case 22:if(i.extra){for(B=i.extra;h<B;){if(0===a)break t;a--,c+=n[s++]<<h,h+=8}i.length+=c&(1<<i.extra)-1,c>>>=i.extra,h-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=23;case 23:for(;E=i.distcode[c&(1<<i.distbits)-1],v=E>>>24,b=E>>>16&255,S=65535&E,!(v<=h);){if(0===a)break t;a--,c+=n[s++]<<h,h+=8}if(0==(240&b)){for(C=v,T=b,F=S;E=i.distcode[F+((c&(1<<C+T)-1)>>C)],v=E>>>24,b=E>>>16&255,S=65535&E,!(C+v<=h);){if(0===a)break t;a--,c+=n[s++]<<h,h+=8}c>>>=C,h-=C,i.back+=C}if(c>>>=v,h-=v,i.back+=v,64&b){t.msg="invalid distance code",i.mode=30;break}i.offset=S,i.extra=15&b,i.mode=24;case 24:if(i.extra){for(B=i.extra;h<B;){if(0===a)break t;a--,c+=n[s++]<<h,h+=8}i.offset+=c&(1<<i.extra)-1,c>>>=i.extra,h-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){t.msg="invalid distance too far back",i.mode=30;break}i.mode=25;case 25:if(0===l)break t;if(m=g-l,i.offset>m){if((m=i.offset-m)>i.whave&&i.sane){t.msg="invalid distance too far back",i.mode=30;break}m>i.wnext?(m-=i.wnext,_=i.wsize-m):_=i.wnext-m,m>i.length&&(m=i.length),x=i.window}else x=r,_=o-i.offset,m=i.length;m>l&&(m=l),l-=m,i.length-=m;do r[o++]=x[_++];while(--m)0===i.length&&(i.mode=21);break;case 26:if(0===l)break t;r[o++]=i.length,l--,i.mode=21;break;case 27:if(i.wrap){for(;h<32;){if(0===a)break t;a--,c|=n[s++]<<h,h+=8}if(g-=l,t.total_out+=g,i.total+=g,g&&(t.adler=i.check=i.flags?d(i.check,r,g,o-g):u(i.check,r,g,o-g)),g=l,(i.flags?c:w(c))!==i.check){t.msg="incorrect data check",i.mode=30;break}c=0,h=0}i.mode=28;case 28:if(i.wrap&&i.flags){for(;h<32;){if(0===a)break t;a--,c+=n[s++]<<h,h+=8}if(c!==(4294967295&i.total)){t.msg="incorrect length check",i.mode=30;break}c=0,h=0}i.mode=29;case 29:N=Z_STREAM_END$1;break t;case 30:N=Z_DATA_ERROR$1;break t;case 31:return Z_MEM_ERROR$1;case 32:default:return Z_STREAM_ERROR$1}return t.next_out=o,t.avail_out=l,t.next_in=s,t.avail_in=a,i.hold=c,i.bits=h,(i.wsize||g!==t.avail_out&&i.mode<30&&(i.mode<27||e!==Z_FINISH$1))&&D(t,t.output,t.next_out,g-t.avail_out),f-=t.avail_in,g-=t.avail_out,t.total_in+=f,t.total_out+=g,i.total+=g,i.wrap&&g&&(t.adler=i.check=i.flags?d(i.check,r,g,t.next_out-g):u(i.check,r,g,t.next_out-g)),t.data_type=i.bits+(i.last?64:0)+(12===i.mode?128:0)+(20===i.mode||15===i.mode?256:0),(0===f&&0===g||e===Z_FINISH$1)&&N===Z_OK$1&&(N=Z_BUF_ERROR),N},I=t=>{if(!t||!t.state)return Z_STREAM_ERROR$1;let e=t.state;return e.window&&(e.window=null),t.state=null,Z_OK$1},B=(t,e)=>{if(!t||!t.state)return Z_STREAM_ERROR$1;const i=t.state;return 0==(2&i.wrap)?Z_STREAM_ERROR$1:(i.head=e,e.done=!1,Z_OK$1)},A=(t,e)=>{const i=e.length;let n,r;return t&&t.state?(n=t.state,0!==n.wrap&&11!==n.mode?Z_STREAM_ERROR$1:11===n.mode&&(r=1,(r=u(r,e,i,0))!==n.check)?Z_DATA_ERROR$1:D(t,e,i,i)?(n.mode=31,Z_MEM_ERROR$1):(n.havedict=1,Z_OK$1)):Z_STREAM_ERROR$1};var P=S,L=C,R=b,k=F,U=T,X=V,j=I,z=B,G=A,H={inflateReset:P,inflateReset2:L,inflateResetKeep:R,inflateInit:k,inflateInit2:U,inflate:X,inflateEnd:j,inflateGetHeader:z,inflateSetDictionary:G,inflateInfo:"pako inflate (from Nodeca project)"};const q=(t,e)=>{return Object.prototype.hasOwnProperty.call(t,e)};var W=function(t){const e=Array.prototype.slice.call(arguments,1);for(;e.length;){const i=e.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(const e in i)q(i,e)&&(t[e]=i[e])}}return t},Y=t=>{let e=0;for(let i=0,n=t.length;i<n;i++)e+=t[i].length;const i=new Uint8Array(e);for(let e=0,n=0,r=t.length;e<r;e++){let r=t[e];i.set(r,n),n+=r.length}return i},$={assign:W,flattenChunks:Y};let Z=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){Z=!1}const Q=new Uint8Array(256);for(let t=0;t<256;t++)Q[t]=t>=252?6:t>=248?5:t>=240?4:t>=224?3:t>=192?2:1;Q[254]=Q[254]=1;var K=t=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(t);let e,i,n,r,s,o=t.length,a=0;for(r=0;r<o;r++)i=t.charCodeAt(r),55296==(64512&i)&&r+1<o&&56320==(64512&(n=t.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(n-56320),r++),a+=i<128?1:i<2048?2:i<65536?3:4;for(e=new Uint8Array(a),s=0,r=0;s<a;r++)i=t.charCodeAt(r),55296==(64512&i)&&r+1<o&&56320==(64512&(n=t.charCodeAt(r+1)))&&(i=65536+(i-55296<<10)+(n-56320),r++),i<128?e[s++]=i:i<2048?(e[s++]=192|i>>>6,e[s++]=128|63&i):i<65536?(e[s++]=224|i>>>12,e[s++]=128|i>>>6&63,e[s++]=128|63&i):(e[s++]=240|i>>>18,e[s++]=128|i>>>12&63,e[s++]=128|i>>>6&63,e[s++]=128|63&i);return e};const J=(t,e)=>{
|
|
24
24
|
if(e<65534&&t.subarray&&Z)return String.fromCharCode.apply(null,t.length===e?t:t.subarray(0,e));let i="";for(let n=0;n<e;n++)i+=String.fromCharCode(t[n]);return i};var tt=(t,e)=>{const i=e||t.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(t.subarray(0,e));let n,r;const s=new Array(2*i);for(r=0,n=0;n<i;){let e=t[n++];if(e<128)s[r++]=e;else{let o=Q[e];if(o>4)s[r++]=65533,n+=o-1;else{for(e&=2===o?31:3===o?15:7;o>1&&n<i;)e=e<<6|63&t[n++],o--;o>1?s[r++]=65533:e<65536?s[r++]=e:(e-=65536,s[r++]=55296|e>>10&1023,s[r++]=56320|1023&e)}}}return J(s,r)},et=(t,e)=>{(e=e||t.length)>t.length&&(e=t.length);let i=e-1;for(;i>=0&&128==(192&t[i]);)i--;return i<0?e:0===i?e:i+Q[t[i]]>e?i:e},it={string2buf:K,buf2string:tt,utf8border:et},nt={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},rt=i,st=n;const ot=Object.prototype.toString,{Z_NO_FLUSH:Z_NO_FLUSH,Z_FINISH:Z_FINISH,Z_OK:Z_OK,Z_STREAM_END:Z_STREAM_END,Z_NEED_DICT:Z_NEED_DICT,Z_STREAM_ERROR:Z_STREAM_ERROR,Z_DATA_ERROR:Z_DATA_ERROR,Z_MEM_ERROR:Z_MEM_ERROR}=v;r.prototype.push=function(t,e){const i=this.strm,n=this.options.chunkSize,r=this.options.dictionary;let s,o,a;if(this.ended)return!1;for(o=e===~~e?e:e===!0?Z_FINISH:Z_NO_FLUSH,"[object ArrayBuffer]"===ot.call(t)?i.input=new Uint8Array(t):i.input=t,i.next_in=0,i.avail_in=i.input.length;;){for(0===i.avail_out&&(i.output=new Uint8Array(n),i.next_out=0,i.avail_out=n),s=H.inflate(i,o),s===Z_NEED_DICT&&r&&(s=H.inflateSetDictionary(i,r),s===Z_OK?s=H.inflate(i,o):s===Z_DATA_ERROR&&(s=Z_NEED_DICT));i.avail_in>0&&s===Z_STREAM_END&&i.state.wrap>0&&0!==t[i.next_in];)H.inflateReset(i),s=H.inflate(i,o);switch(s){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(s),this.ended=!0,!1}if(a=i.avail_out,i.next_out&&(0===i.avail_out||s===Z_STREAM_END))if("string"===this.options.to){let t=it.utf8border(i.output,i.next_out),e=i.next_out-t,r=it.buf2string(i.output,t);i.next_out=e,i.avail_out=n-e,e&&i.output.set(i.output.subarray(t,t+e),0),this.onData(r)}else this.onData(i.output.length===i.next_out?i.output:i.output.subarray(0,i.next_out));if(s!==Z_OK||0!==a){if(s===Z_STREAM_END)return s=H.inflateEnd(this.strm),this.onEnd(s),this.ended=!0,!0;if(0===i.avail_in)break}}return!0},r.prototype.onData=function(t){this.chunks.push(t)},r.prototype.onEnd=function(t){t===Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=$.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};var at=r,ut=s,lt=o,ct=s,ht=v,dt={Inflate:at,inflate:ut,inflateRaw:lt,ungzip:ct,constants:ht};t.Inflate=at,t.constants=ht,t.default=dt,t.inflate=ut,t.inflateRaw=lt,t.ungzip=ct,Object.defineProperty(t,"__esModule",{value:!0})}),define("pako_inflate",["pako_inflate/dist/pako_inflate"],function(t){return t}),define("x_ite/InputOutput/FileLoader",["jquery","x_ite/Base/X3DObject","x_ite/Fields","x_ite/Parser/Parser","x_ite/Parser/XMLParser","x_ite/Parser/JSONParser","x_ite/Execution/World","standard/Networking/BinaryTransport","pako_inflate","x_ite/DEBUG"],function(t,e,i,n,r,s,o,a,u,l){"use strict";function c(t,i){e.call(this),this.node=t,this.browser=t.getBrowser(),this.external=void 0===i?this.browser.isExternal():i,this.executionContext=this.external?t.getExecutionContext():this.browser.currentScene,this.userAgent=this.browser.getName()+"/"+this.browser.getVersion()+" (X3D Browser; +"+this.browser.getProviderUrl()+")",this.target="",this.url=[],this.URL=new URL(this.getReferer(),this.getReferer()),this.fileReader=new FileReader,this.text=!0}a(t);const h=/^\s*(?:vrmlscript|javascript|ecmascript)\:([^]*)$/,d=/^data:(.*?)(?:;charset=(.*?))?(?:;(base64))?,([^]*)$/,p=/^(?:(.*?);(.*?)$)/,f=new RegExp(".(?:html|xhtml)$"),g={"text/html":!0,"application/xhtml+xml":!0},m=new i.MFString;return c.prototype=Object.assign(Object.create(e.prototype),{constructor:c,abort:function(){this.callback=Function.prototype,this.bindViewpoint=Function.prototype,this.foreign=Function.prototype},getWorldURL:function(){return this.URL},createX3DFromString:function(e,i,r,s){const a=this.browser.createScene();if(this.node instanceof o?a.loader=this:a.setExecutionContext(this.executionContext),a.setWorldURL(new URL(e,this.getReferer()).href),r){const o=[function(e,i,n,r){this.importDocument(e,t.parseXML(i),n,r)},function(t,e,i,n){this.importJS(t,JSON.parse(e),i,n)},function(t,e,i,r){i&&(i=this.setScene.bind(this,t,i,r)),new n(t).parseIntoScene(e,i,r)}],u=[];for(const t of o)try{return void t.call(this,a,i,r,s)}catch(t){u.push(t)}throw console.error(u),new Error("Couldn't parse X3D. No suitable file handler found for '"+e+"'.")}{const e=[function(e,i){this.importDocument(e,t.parseXML(i))},function(t,e){this.importJS(t,JSON.parse(e))},function(t,e){new n(t).parseIntoScene(e)}],r=[];for(const t of e)try{return t.call(this,a,i),a}catch(t){r.push(t)}throw console.error(r),new Error("Couldn't parse x3d syntax.")}},importDocument:function(t,e,i,n){try{i&&(i=this.setScene.bind(this,t,i,n)),new r(t).parseIntoScene(e,i,n),this.node.dom=e}catch(t){if(!n)throw t;n(t)}},importJS:function(t,e,i,n){try{i&&(i=this.setScene.bind(this,t,i,n)),this.node.dom=new s(t).parseIntoScene(e,i,n)}catch(t){if(!n)throw t;n(t)}},setScene:function(t,e,i){t.initLoadCount_.addInterest("set_initLoadCount__",this,t,e,i),t.initLoadCount_.addEvent()},set_initLoadCount__:function(t,e,i,n){if(!t.getValue()){e.initLoadCount_.removeInterest("set_initLoadCount__",this),delete e.loader;try{i(e)}catch(t){if(!n)throw t;n(t)}l&&"data:"!==this.URL.protocol&&console.info("Done loading scene "+this.URL.href)}},createX3DFromURL:function(t,e,i,n,r){return this.bindViewpoint=n,this.foreign=r,this.target=this.getTarget(e||m),i?this.loadDocument(t,this.createX3DFromURLAsync.bind(this,i)):this.createX3DFromURLSync(t)},createX3DFromURLAsync:function(t,e){null===e?t(null):this.createX3DFromString(this.URL,e,t,this.loadDocumentError.bind(this))},createX3DFromURLSync:function(e){if(0===e.length)throw new Error("No URL given.");let i=null,n=!1;for(const r of e)if(this.URL=new URL(r,this.getReferer()),t.ajax({url:this.URL.href,dataType:"text",async:!1,cache:this.browser.getBrowserOptions().getCache()&&this.node.getCache(),global:!1,context:this,success:function(t){try{i=this.createX3DFromString(this.URL,t),n=!0}catch(t){this.error(t)}},error:function(t,e,i){}}),n)return i;throw new Error("Couldn't load any url of '"+Array.prototype.join.call(e,", ")+"'.")},loadScript:function(t,e){this.script=!0,this.loadDocument(t,e)},loadDocument:function(t,e){if(this.url=t.copy(),this.callback=e,0===t.length)return this.loadDocumentError(new Error("No URL given."));this.loadDocumentAsync(this.url.shift())},loadBinaryDocument:function(t,e){if(this.url=t.copy(),this.callback=e,this.text=!1,0===t.length)return this.loadDocumentError(new Error("No URL given."));this.loadDocumentAsync(this.url.shift())},getTarget:function(t){for(const e of t){const t=e.split("=");if(2===t.length&&"target"===t[0])return t[1]}return""},loadDocumentAsync:function(e){try{if(0===e.length)return void this.loadDocumentError(new Error("URL is empty."));if(this.script){const t=h.exec(e);if(t)return void this.callback(t[1])}{const t=d.exec(e);if(t){let e=t[4];return e="base64"===t[3]?atob(e):unescape(e),void this.callback(e)}}if(this.URL=new URL(e,this.getReferer()),this.bindViewpoint&&this.URL.href.substr(0,this.getReferer().length)===this.getReferer())return void this.bindViewpoint(this.URL.hash.substr(1));if(this.foreign){if(this.target.length&&"_self"!==this.target)return this.foreign(this.URL.href,this.target);if(this.URL.href.match(f))return this.foreign(this.URL.href,this.target)}t.ajax({url:this.URL.href,dataType:"binary",async:!0,cache:this.browser.getBrowserOptions().getCache()&&this.node.getCache(),global:!1,context:this,success:function(t,e,i){if(this.foreign&&g[this.getContentType(i)])return this.foreign(this.URL.href,this.target);this.text?(this.fileReader.onload=this.readAsArrayBuffer.bind(this,t),this.fileReader.readAsArrayBuffer(t)):(this.fileReader.onload=this.readAsBinaryString.bind(this),this.fileReader.readAsBinaryString(t))},error:function(t,e,i){this.loadDocumentError(new Error(i))}})}catch(t){return void this.loadDocumentError(t)}},readAsArrayBuffer:function(t){try{this.callback(u.ungzip(this.fileReader.result,{to:"string"}))}catch(e){this.fileReader.onload=this.readAsText.bind(this,t),this.fileReader.readAsText(t)}},readAsText:function(t){try{this.callback(this.fileReader.result)}catch(t){this.loadDocumentError(t)}},readAsBinaryString:function(){try{this.callback(this.fileReader.result)}catch(t){this.loadDocumentError(t)}},loadDocumentError:function(t){this.error(t),this.url.length?this.loadDocumentAsync(this.url.shift()):this.callback(null)},error:function(t){"data:"===this.URL.protocol?console.warn("Couldn't load URL 'data':",t.message):console.warn("Couldn't load URL '"+this.URL.href+"':",t.message),l&&console.log(t)},getReferer:function(){return"World"===this.node.getTypeName()&&this.external?this.browser.getLocation():this.executionContext.getWorldURL()},getContentType:function(t){const e=t.getResponseHeader("Content-Type"),i=p.exec(e);return i?i[1]:""}}),c}),define("x_ite/Components/Shaders/ShaderPart",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Browser/Shaders/Shader","x_ite/Components/Core/X3DNode","x_ite/Components/Networking/X3DUrlObject","x_ite/InputOutput/FileLoader","x_ite/Bits/X3DConstants","x_ite/DEBUG"],function(t,e,i,n,r,s,o,a,u){"use strict";function l(e){r.call(this,e),s.call(this,e),this.addType(a.ShaderPart),this.addChildObjects("buffer",new t.MFString),this.valid=!1}var c={VERTEX:"VERTEX_SHADER",TESS_CONTROL:"TESS_CONTROL_SHADER",TESS_EVALUATION:"TESS_EVALUATION_SHADER",GEOMETRY:"GEOMETRY_SHADER",FRAGMENT:"FRAGMENT_SHADER",COMPUTE:"COMPUTE_SHADER"};return l.prototype=Object.assign(Object.create(r.prototype),s.prototype,{constructor:l,fieldDefinitions:new i([new e(a.inputOutput,"metadata",new t.SFNode),new e(a.initializeOnly,"type",new t.SFString("VERTEX")),new e(a.inputOutput,"url",new t.MFString),new e(a.inputOutput,"autoRefresh",new t.SFTime),new e(a.inputOutput,"autoRefreshTimeLimit",new t.SFTime(3600))]),getTypeName:function(){return"ShaderPart"},getComponentName:function(){return"Shaders"},getContainerField:function(){return"parts"},initialize:function(){r.prototype.initialize.call(this),s.prototype.initialize.call(this);var t=this.getBrowser().getContext();this.shader=t.createShader(t[this.getShaderType()]),this.url_.addInterest("set_url__",this),this.buffer_.addInterest("set_buffer__",this),this.set_url__()},set_url__:function(){this.setLoadState(a.NOT_STARTED_STATE),this.requestImmediateLoad()},isValid:function(){return this.valid},getShader:function(){return this.shader},getShaderType:function(){var t=c[this.type_.getValue()];return t?t:"VERTEX_SHADER"},getSourceText:function(){return this.url_},setShadow:function(t){this.shadow=t},getShadow:function(){return this.shadow},requestImmediateLoad:function(t=!0){this.checkLoadState()!=a.COMPLETE_STATE&&this.checkLoadState()!=a.IN_PROGRESS_STATE&&(this.setCache(t),this.setLoadState(a.IN_PROGRESS_STATE),this.buffer_=this.url_)},set_buffer__:function(){this.valid=!1,new o(this).loadDocument(this.buffer_,function(t){if(null===t)this.setLoadState(a.FAILED_STATE);else{var e=this.getBrowser().getContext(),i=n.getShaderSource(this.getBrowser(),this.getName(),t,this.shadow);if(e.shaderSource(this.shader,i),e.compileShader(this.shader),this.valid=e.getShaderParameter(this.shader,e.COMPILE_STATUS),!this.valid)throw new Error(this.getTypeName()+" '"+this.getName()+"': "+e.getShaderInfoLog(this.shader));this.setLoadState(a.COMPLETE_STATE)}}.bind(this))}}),l}),define("x_ite/Browser/Shaders/ShaderTest",["x_ite/Rendering/TextureBuffer","standard/Math/Numbers/Vector4","standard/Math/Numbers/Matrix3","standard/Math/Numbers/Matrix4","standard/Math/Geometry/Camera"],function(t,e,i,n,r){"use strict";return{verify:function(){const e=[0,0,1,0,0,1,0,0,1,0,0,1,0,0,1,0,0,1],s=[2,2,0,1,-2,2,0,1,-2,-2,0,1,2,2,0,1,-2,-2,0,1,2,-2,0,1];return function(o,a){const u=o.getContext(),l=new t(o,16,16),c=u.createBuffer(),h=u.createBuffer();l.bind(),a.enable(u),a.setLocalObjects(u,[]),u.bindBuffer(u.ARRAY_BUFFER,h),u.bufferData(u.ARRAY_BUFFER,new Float32Array(s),u.STATIC_DRAW),u.bindBuffer(u.ARRAY_BUFFER,c),u.bufferData(u.ARRAY_BUFFER,new Float32Array(e),u.STATIC_DRAW),u.uniformMatrix4fv(a.x3d_ProjectionMatrix,!1,new Float32Array(r.ortho(-1,1,-1,1,-1,1,new n))),u.uniformMatrix4fv(a.x3d_ModelViewMatrix,!1,new Float32Array(new n)),u.uniformMatrix3fv(a.x3d_NormalMatrix,!1,new Float32Array(new i)),u.uniform1i(a.x3d_FogType,0),u.uniform1f(a.x3d_AlphaCutoff,0),u.uniform1i(a.x3d_FillPropertiesFilled,!0),u.uniform1i(a.x3d_FillPropertiesHatched,!1),u.uniform1i(a.x3d_ColorMaterial,!1),u.uniform1i(a.x3d_NumLights,0),u.uniform1i(a.x3d_NumTextures,0),u.uniform1i(a.x3d_NumProjectiveTextures,0),u.uniform1i(a.x3d_NumClipPlanes,0),u.uniform1f(a.x3d_AmbientIntensity,0),u.uniform3f(a.x3d_DiffuseColor,1,0,0),u.uniform3f(a.x3d_SpecularColor,1,0,0),u.uniform3f(a.x3d_EmissiveColor,1,0,0),u.uniform1f(a.x3d_Shininess,0),u.uniform1f(a.x3d_Transparency,0),u.viewport(0,0,16,16),u.clearColor(0,0,0,0),u.clear(u.COLOR_BUFFER_BIT),u.disable(u.DEPTH_TEST),u.disable(u.BLEND),u.frontFace(u.CCW),u.enable(u.CULL_FACE),u.cullFace(u.BACK),a.enableNormalAttribute(u,c),a.enableVertexAttribute(u,h),u.drawArrays(u.TRIANGLES,0,6),a.disableNormalAttribute(u,c),a.disable(u);const d=l.readPixels();return l.unbind(),255==d[0]&&0==d[1]&&0==d[2]&&255==d[3]}}()}}),define("x_ite/Browser/Shaders/X3DShadersContext",["x_ite/Browser/Core/Shading","x_ite/Components/Shaders/ComposedShader","x_ite/Components/Shaders/ShaderPart","x_ite/Browser/Shaders/ShaderTest","x_ite/Browser/Networking/urls"],function(t,e,i,n,r){"use strict";function s(){this.shaders=new Set}return s.prototype={initialize:function(){this.setShading(this.getBrowserOptions().getShading())},getShadingLanguageVersion:function(){return this.getContext().getParameter(this.getContext().SHADING_LANGUAGE_VERSION)},getMaxVertexUniformVectors:function(){return this.getContext().getParameter(this.getContext().MAX_VERTEX_UNIFORM_VECTORS)},getMaxFragmentUniformVectors:function(){return this.getContext().getParameter(this.getContext().MAX_FRAGMENT_UNIFORM_VECTORS)},getMaxVertexAttribs:function(){return this.getContext().getParameter(this.getContext().MAX_VERTEX_ATTRIBS)},addShader:function(t){this.shaders.add(t),t.setShading(this.getBrowserOptions().getShading())},removeShader:function(t){this.shaders.delete(t)},getShaders:function(){return this.shaders},getDefaultShader:function(){return this.defaultShader},hasPointShader:function(){return!!this.pointShader},getPointShader:function(){return this.pointShader=this.createShader("PointShader","PointSet"),this.getPointShader=function(){return this.pointShader},this.pointShader},hasLineShader:function(){return!!this.lineShader},getLineShader:function(){return this.lineShader=this.createShader("WireframeShader","Wireframe"),this.getLineShader=function(){return this.lineShader},this.lineShader},hasUnlitShader:function(){return!!this.unlitShader},getUnlitShader:function(){return this.unlitShader=this.createShader("UnlitShader","Unlit"),this.unlitShader.isValid_.addInterest("set_unlit_shader_valid__",this),this.getUnlitShader=function(){return this.unlitShader},this.unlitShader},hasGouraudShader:function(){return!!this.gouraudShader},getGouraudShader:function(){return this.gouraudShader=this.createShader("GouraudShader","Gouraud",!1),this.gouraudShader.isValid_.addInterest("set_gouraud_shader_valid__",this),this.getGouraudShader=function(){return this.gouraudShader},this.gouraudShader},hasPhongShader:function(){return!!this.phongShader},getPhongShader:function(){return this.phongShader=this.createShader("PhongShader","Phong",!1),this.phongShader.isValid_.addInterest("set_phong_shader_valid__",this),this.getPhongShader=function(){return this.phongShader},this.phongShader},hasShadowShader:function(){return!!this.shadowShader},getShadowShader:function(){return this.shadowShader=this.createShader("ShadowShader","Phong",!0),this.shadowShader.isValid_.addInterest("set_shadow_shader_valid__",this),this.getShadowShader=function(){return this.shadowShader},this.shadowShader},hasDepthShader:function(){return!!this.depthShader},getDepthShader:function(){return this.depthShader=this.createShader("DepthShader","Depth"),this.getDepthShader=function(){return this.depthShader},this.depthShader},setShading:function(e){switch(e){case t.PHONG:this.defaultShader=this.getPhongShader();break;default:this.defaultShader=this.getGouraudShader()}for(const t of this.getShaders())t.setShading(e)},createShader:function(t,n,s=!1){this.getDebug()&&console.log("Initializing "+t);const o=this.getContext().getVersion(),a=new i(this.getPrivateScene());a.setName(t+"Vertex"),a.url_.push(r.getShaderUrl("webgl"+o+"/"+n+".vs")),a.setShadow(s),a.setup();const u=new i(this.getPrivateScene());u.setName(t+"Fragment"),u.type_="FRAGMENT",u.url_.push(r.getShaderUrl("webgl"+o+"/"+n+".fs")),u.setShadow(s),u.setup();const l=new e(this.getPrivateScene());return l.setName(t),l.language_="GLSL",l.parts_.push(a),l.parts_.push(u),l.setCustom(!1),l.setShading(this.getBrowserOptions().getShading()),l.setup(),this.addShader(l),l},set_unlit_shader_valid__:function(t){this.unlitShader.isValid_.removeInterest("set_unlit_shader_valid__",this),t.getValue()&&n.verify(this,this.unlitShader)||(console.error("X_ITE: Unlit shading is not available, using fallback VRML shader."),this.unlitShader.parts_[0].url=[r.getShaderUrl("webgl1/FallbackUnlit.vs")],this.unlitShader.parts_[1].url=[r.getShaderUrl("webgl1/FallbackUnlit.fs")])},set_gouraud_shader_valid__:function(t){this.gouraudShader.isValid_.removeInterest("set_gouraud_shader_valid__",this),t.getValue()&&n.verify(this,this.gouraudShader)||(console.warn("X_ITE: All else fails, using fallback VRML shader."),this.gouraudShader.parts_[0].url=[r.getShaderUrl("webgl1/Fallback.vs")],this.gouraudShader.parts_[1].url=[r.getShaderUrl("webgl1/Fallback.fs")])},set_phong_shader_valid__:function(t){this.phongShader.isValid_.removeInterest("set_phong_shader_valid__",this),t.getValue()&&n.verify(this,this.phongShader)||(console.warn("X_ITE: Phong shading is not available, using Gouraud shading."),this.phongShader=this.getGouraudShader(),this.setShading(this.getBrowserOptions().getShading()))},set_shadow_shader_valid__:function(t){this.shadowShader.isValid_.removeInterest("set_shadow_shader_valid__",this),t.getValue()&&n.verify(this,this.shadowShader)||(console.warn("X_ITE: Shadow shading is not available, using Gouraud shading."),this.shadowShader=this.getGouraudShader())}},s}),function(t,e){"function"==typeof define&&define.amd?define("ResizeSensor/src/ResizeSensor",e):"object"==typeof exports?module.exports=e():t.ResizeSensor=e()}("undefined"!=typeof window?window:this,function(){function t(t,e){var i=Object.prototype.toString.call(t),n="[object Array]"===i||"[object NodeList]"===i||"[object HTMLCollection]"===i||"[object Object]"===i||"undefined"!=typeof jQuery&&t instanceof jQuery||"undefined"!=typeof Elements&&t instanceof Elements,r=0,s=t.length;if(n)for(;r<s;r++)e(t[r]);else e(t)}function e(t){if(!t.getBoundingClientRect)return{width:t.offsetWidth,height:t.offsetHeight};var e=t.getBoundingClientRect();return{width:Math.round(e.width),height:Math.round(e.height)}}function i(t,e){Object.keys(e).forEach(function(i){t.style[i]=e[i]})}if("undefined"==typeof window)return null;var n="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),r=n.requestAnimationFrame||n.mozRequestAnimationFrame||n.webkitRequestAnimationFrame||function(t){return n.setTimeout(t,20)},s=n.cancelAnimationFrame||n.mozCancelAnimationFrame||n.webkitCancelAnimationFrame||function(t){n.clearTimeout(t)},o=function(n,a){function u(){var t=[];this.add=function(e){t.push(e)};var e,i;this.call=function(n){for(e=0,i=t.length;e<i;e++)t[e].call(this,n)},this.remove=function(n){var r=[];for(e=0,i=t.length;e<i;e++)t[e]!==n&&r.push(t[e]);t=r},this.length=function(){return t.length}}function l(t,n){if(t){if(t.resizedAttached)return void t.resizedAttached.add(n);t.resizedAttached=new u,t.resizedAttached.add(n),t.resizeSensor=document.createElement("div"),t.resizeSensor.dir="ltr",t.resizeSensor.className="resize-sensor";var s={pointerEvents:"none",position:"absolute",left:"0px",top:"0px",right:"0px",bottom:"0px",overflow:"hidden",zIndex:"-1",visibility:"hidden",maxWidth:"100%"},o={position:"absolute",left:"0px",top:"0px",transition:"0s"};i(t.resizeSensor,s);var a=document.createElement("div");a.className="resize-sensor-expand",i(a,s);var l=document.createElement("div");i(l,o),a.appendChild(l);var h=document.createElement("div");h.className="resize-sensor-shrink",i(h,s);var d=document.createElement("div");i(d,o),i(d,{width:"200%",height:"200%"}),h.appendChild(d),t.resizeSensor.appendChild(a),t.resizeSensor.appendChild(h),t.appendChild(t.resizeSensor);var p=window.getComputedStyle(t),f=p?p.getPropertyValue("position"):null;"absolute"!==f&&"relative"!==f&&"fixed"!==f&&"sticky"!==f&&(t.style.position="relative");var g=!1,m=0,_=e(t),x=0,y=0,v=!0;c=0;var w=function(){var e=t.offsetWidth,i=t.offsetHeight;l.style.width=e+10+"px",l.style.height=i+10+"px",a.scrollLeft=e+10,a.scrollTop=i+10,h.scrollLeft=e+10,h.scrollTop=i+10},b=function(){if(v){if(0===t.offsetWidth&&0===t.offsetHeight)return void(c||(c=r(function(){c=0,b()})));v=!1}w()};t.resizeSensor.resetSensor=b;var S=function(){m=0,g&&(x=_.width,y=_.height,t.resizedAttached&&t.resizedAttached.call(_))},C=function(){_=e(t),g=_.width!==x||_.height!==y,g&&!m&&(m=r(S)),b()},T=function(t,e,i){t.attachEvent?t.attachEvent("on"+e,i):t.addEventListener(e,i)};T(a,"scroll",C),T(h,"scroll",C),c=r(function(){c=0,b()})}}var c=0;t(n,function(t){l(t,a)}),this.detach=function(t){c||(s(c),c=0),o.detach(n,t)},this.reset=function(){n.resizeSensor.resetSensor()}};if(o.reset=function(e){t(e,function(t){t.resizeSensor.resetSensor()})},o.detach=function(e,i){t(e,function(t){t&&(t.resizedAttached&&"function"==typeof i&&(t.resizedAttached.remove(i),t.resizedAttached.length())||t.resizeSensor&&(t.contains(t.resizeSensor)&&t.removeChild(t.resizeSensor),delete t.resizeSensor,delete t.resizedAttached))})},"undefined"!=typeof MutationObserver){var a=new MutationObserver(function(t){for(var e in t)if(t.hasOwnProperty(e))for(var i=t[e].addedNodes,n=0;n<i.length;n++)i[n].resizeSensor&&o.reset(i[n])});document.addEventListener("DOMContentLoaded",function(t){a.observe(document.body,{childList:!0,subtree:!0})})}return o}),define("ResizeSensor",["ResizeSensor/src/ResizeSensor"],function(t){return t}),define("x_ite/Browser/Rendering/X3DRenderingContext",["jquery","x_ite/Fields","ResizeSensor"],function(t,e,i){"use strict";function n(){this.viewport=[0,0,300,150],this.localObjects=[]}return n.prototype={initialize:function(){const e=this.getContext();e.enable(e.SCISSOR_TEST),e.cullFace(e.BACK),e.enable(e.DEPTH_TEST),e.depthFunc(e.LEQUAL),e.clearDepth(1),e.blendFuncSeparate(e.SRC_ALPHA,e.ONE_MINUS_SRC_ALPHA,e.ONE,e.ONE_MINUS_SRC_ALPHA),e.blendEquationSeparate(e.FUNC_ADD,e.FUNC_ADD),e.enable(e.BLEND),t(document).on("webkitfullscreenchange mozfullscreenchange fullscreenchange MSFullscreenChange",this.onfullscreen.bind(this)),this.resizer=new i(this.getSurface(),this.reshape.bind(this)),this.reshape()},getRenderer:function(){const t=this.getExtension("WEBGL_debug_renderer_info");return t?this.getContext().getParameter(t.UNMASKED_RENDERER_WEBGL):this.getContext().getParameter(this.getContext().RENDERER)},getVendor:function(){const t=this.getExtension("WEBGL_debug_renderer_info");return t?this.getContext().getParameter(t.UNMASKED_VENDOR_WEBGL):this.getContext().getParameter(this.getContext().VENDOR)},getWebGLVersion:function(){return this.getContext().getParameter(this.getContext().VERSION)},getAntialiased:function(){return this.getContext().getParameter(this.getContext().SAMPLES)>0},getMaxClipPlanes:function(){return 6},getDepthSize:function(){const t=this.context;return t.getParameter(t.DEPTH_BITS)},getColorDepth:function(){const t=this.context;return t.getParameter(t.RED_BITS)+t.getParameter(t.BLUE_BITS)+t.getParameter(t.GREEN_BITS)+t.getParameter(t.ALPHA_BITS)},getViewport:function(){return this.viewport},getLocalObjects:function(){return this.localObjects},reshape:function(){const t=this.getContext(),e=this.getCanvas(),i=e.width(),n=e.height(),r=e[0];r.width=i,r.height=n,this.viewport[2]=i,this.viewport[3]=n,t.viewport(0,0,i,n),t.scissor(0,0,i,n),this.addBrowserEvent()},onfullscreen:function(){this.getElement().fullScreen()?this.getElement().addClass("x_ite-fullscreen"):this.getElement().removeClass("x_ite-fullscreen")}},n}),define("x_ite/Components/Shape/X3DAppearanceNode",["x_ite/Fields","x_ite/Components/Core/X3DNode","x_ite/Bits/X3DConstants"],function(t,e,i){"use strict";function n(n){e.call(this,n),this.addType(i.X3DAppearanceNode),this.addChildObjects("transparent",new t.SFBool),this.transparent_.setAccessType(i.outputOnly)}return n.prototype=Object.assign(Object.create(e.prototype),{constructor:n,setTransparent:function(t){t!==this.transparent_.getValue()&&(this.transparent_=t)},getTransparent:function(){return this.transparent_.getValue()}}),n}),define("x_ite/Browser/Shape/AlphaMode",[],function(){"use strict";var t=0;return{AUTO:t++,OPAQUE:t++,MASK:t++,BLEND:t++}}),define("x_ite/Components/Shape/Appearance",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Shape/X3DAppearanceNode","x_ite/Bits/X3DCast","x_ite/Bits/X3DConstants","x_ite/Browser/Shape/AlphaMode"],function(t,e,i,n,r,s,o){"use strict";function a(t){n.call(this,t),this.addType(s.Appearance),this.stylePropertiesNode=[],this.materialNode=null,this.backMaterialNode=null,this.textureNode=null,this.textureTransformNode=null,this.shaderNodes=[],this.shaderNode=null,this.blendModeNode=null}return a.prototype=Object.assign(Object.create(n.prototype),{constructor:a,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOutput,"alphaMode",new t.SFString("AUTO")),new e(s.inputOutput,"alphaCutoff",new t.SFFloat(.5)),new e(s.inputOutput,"pointProperties",new t.SFNode),new e(s.inputOutput,"lineProperties",new t.SFNode),new e(s.inputOutput,"fillProperties",new t.SFNode),new e(s.inputOutput,"material",new t.SFNode),new e(s.inputOutput,"backMaterial",new t.SFNode),new e(s.inputOutput,"texture",new t.SFNode),new e(s.inputOutput,"textureTransform",new t.SFNode),new e(s.inputOutput,"shaders",new t.MFNode),new e(s.inputOutput,"blendMode",new t.SFNode)]),getTypeName:function(){return"Appearance"},getComponentName:function(){return"Shape"},getContainerField:function(){return"appearance"},initialize:function(){n.prototype.initialize.call(this),this.isLive().addInterest("set_live__",this),this.alphaMode_.addInterest("set_alphaMode__",this),this.alphaCutoff_.addInterest("set_alphaCutoff__",this),this.pointProperties_.addInterest("set_pointProperties__",this),this.lineProperties_.addInterest("set_lineProperties__",this),this.fillProperties_.addInterest("set_fillProperties__",this),this.material_.addInterest("set_material__",this),this.backMaterial_.addInterest("set_backMaterial__",this),this.texture_.addInterest("set_texture__",this),this.textureTransform_.addInterest("set_textureTransform__",this),this.shaders_.addInterest("set_shaders__",this),this.blendMode_.addInterest("set_blendMode__",this),this.alphaMode_.addInterest("set_transparent__",this),this.fillProperties_.addInterest("set_transparent__",this),this.material_.addInterest("set_transparent__",this),this.texture_.addInterest("set_transparent__",this),this.blendMode_.addInterest("set_transparent__",this),this.set_live__(),this.set_alphaMode__(),this.set_pointProperties__(),this.set_lineProperties__(),this.set_fillProperties__(),this.set_material__(),this.set_backMaterial__(),this.set_texture__(),this.set_textureTransform__(),this.set_shaders__(),this.set_blendMode__(),this.set_transparent__()},getAlphaMode:function(){return this.alphaMode},set_live__:function(){this.isLive().getValue()?(this.getBrowser().getBrowserOptions().Shading_.addInterest("set_shading__",this),this.shaderNode&&this.getBrowser().addShader(this.shaderNode)):(this.getBrowser().getBrowserOptions().Shading_.removeInterest("set_shading__",this),this.shaderNode&&this.getBrowser().removeShader(this.shaderNode))},set_alphaMode__:function(){this.alphaMode=o[this.alphaMode_.getValue()]||o.AUTO,this.set_alphaCutoff__()},set_alphaCutoff__:function(){this.alphaCutoff=this.alphaMode===o.MASK?this.alphaCutoff_.getValue():0},set_pointProperties__:function(){this.stylePropertiesNode[0]=r(s.PointProperties,this.pointProperties_),this.stylePropertiesNode[0]||(this.stylePropertiesNode[0]=this.getBrowser().getDefaultPointProperties())},set_lineProperties__:function(){this.stylePropertiesNode[1]=r(s.LineProperties,this.lineProperties_),this.stylePropertiesNode[1]||(this.stylePropertiesNode[1]=this.getBrowser().getDefaultLineProperties())},set_fillProperties__:function(){this.stylePropertiesNode[2]&&this.stylePropertiesNode[2].transparent_.removeInterest("set_transparent__",this),this.stylePropertiesNode[2]=r(s.FillProperties,this.fillProperties_),this.stylePropertiesNode[2]||(this.stylePropertiesNode[2]=this.getBrowser().getDefaultFillProperties()),this.stylePropertiesNode[2]&&this.stylePropertiesNode[2].transparent_.addInterest("set_transparent__",this),this.stylePropertiesNode[3]=this.stylePropertiesNode[2]},set_material__:function(){this.materialNode&&this.materialNode.transparent_.removeInterest("set_transparent__",this),this.materialNode=r(s.X3DMaterialNode,this.material_),this.materialNode||(this.materialNode=this.getBrowser().getDefaultMaterial()),this.materialNode&&this.materialNode.transparent_.addInterest("set_transparent__",this),"TwoSidedMaterial"===this.materialNode.getTypeName()&&(console.warn("TwoSidedMaterial is depreciated, please use Appearance backMaterial."),this.set_backMaterial__())},set_backMaterial__:function(){this.backMaterialNode&&this.backMaterialNode.transparent_.removeInterest("set_transparent__",this),this.backMaterialNode=r(s.X3DOneSidedMaterialNode,this.backMaterial_),this.backMaterialNode&&this.backMaterialNode.transparent_.addInterest("set_transparent__",this),this.backMaterialNode||"TwoSidedMaterial"!==this.materialNode.getTypeName()||(this.backMaterialNode=this.materialNode)},set_texture__:function(){this.textureNode&&this.textureNode.transparent_.removeInterest("set_transparent__",this),this.textureNode=r(s.X3DTextureNode,this.texture_),this.textureNode&&this.textureNode.transparent_.addInterest("set_transparent__",this)},set_textureTransform__:function(){this.textureTransformNode=r(s.X3DTextureTransformNode,this.textureTransform_),this.textureTransformNode||(this.textureTransformNode=this.getBrowser().getDefaultTextureTransform())},set_shaders__:function(){const t=this.shaderNodes;for(const e of t)e.isValid_.removeInterest("set_shader__",this),e.activationTime_.removeInterest("set_shader__",this);t.length=0;for(const e of this.shaders_){const i=r(s.X3DShaderNode,e);i&&(t.push(i),i.isValid_.addInterest("set_shader__",this),i.activationTime_.addInterest("set_shader__",this))}this.set_shader__()},set_shader__:function(){const t=this.shaderNodes;this.shaderNode&&(this.getBrowser().removeShader(this.shaderNode),this.shaderNode.deselect()),this.shaderNode=null;for(const e of t)if(e.isValid_.getValue()&&e.activationTime_.getValue()===this.getBrowser().getCurrentTime()){this.shaderNode=e;break}if(!this.shaderNode)for(const e of t)if(e.isValid_.getValue()){this.shaderNode=e;break}
|
|
25
25
|
this.isLive().getValue()&&this.shaderNode&&(this.getBrowser().addShader(this.shaderNode),this.shaderNode.select())},set_shading__:function(){this.set_shader__()},set_blendMode__:function(){this.blendModeNode=r(s.BlendMode,this.blendMode_)},set_transparent__:function(){switch(this.alphaMode){case o.AUTO:this.setTransparent(Boolean(this.stylePropertiesNode[3].getTransparent()||this.materialNode&&this.materialNode.getTransparent()||this.backMaterialNode&&this.backMaterialNode.getTransparent()||this.textureNode&&this.textureNode.getTransparent()||this.blendModeNode));break;case o.OPAQUE:this.setTransparent(!1);break;case o.MASK:this.setTransparent(!1);break;case o.BLEND:this.setTransparent(!0)}},traverse:function(t,e){this.textureNode&&this.textureNode.traverse(t,e),this.shaderNode&&this.shaderNode.traverse(t,e)}}),a}),define("x_ite/Components/Shape/PointProperties",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Shape/X3DAppearanceChildNode","x_ite/Bits/X3DConstants"],function(t,e,i,n,r){"use strict";function s(t){n.call(this,t),this.addType(r.PointProperties),this.pointSizeAttenuation=new Float32Array(3)}return s.prototype=Object.assign(Object.create(n.prototype),{constructor:s,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"pointSizeScaleFactor",new t.SFFloat(1)),new e(r.inputOutput,"pointSizeMinValue",new t.SFFloat(1)),new e(r.inputOutput,"pointSizeMaxValue",new t.SFFloat(1)),new e(r.inputOutput,"pointSizeAttenuation",new t.MFFloat(1,0,0)),new e(r.inputOutput,"colorMode",new t.SFString("TEXTURE_AND_POINT_COLOR"))]),getTypeName:function(){return"PointProperties"},getComponentName:function(){return"Shape"},getContainerField:function(){return"pointProperties"},initialize:function(){n.prototype.initialize.call(this),this.pointSizeScaleFactor_.addInterest("set_pointSizeScaleFactor__",this),this.pointSizeMinValue_.addInterest("set_pointSizeMinValue__",this),this.pointSizeMaxValue_.addInterest("set_pointSizeMaxValue__",this),this.pointSizeAttenuation_.addInterest("set_pointSizeAttenuation__",this),this.colorMode_.addInterest("set_colorMode__",this),this.set_pointSizeScaleFactor__(),this.set_pointSizeMinValue__(),this.set_pointSizeMaxValue__(),this.set_pointSizeAttenuation__(),this.set_colorMode__()},set_pointSizeScaleFactor__:function(){this.pointSizeScaleFactor=Math.max(1,this.pointSizeScaleFactor_.getValue())},set_pointSizeMinValue__:function(){this.pointSizeMinValue=Math.max(0,this.pointSizeMinValue_.getValue())},set_pointSizeMaxValue__:function(){this.pointSizeMaxValue=Math.max(0,this.pointSizeMaxValue_.getValue())},set_pointSizeAttenuation__:function(){const t=this.pointSizeAttenuation_.length;this.pointSizeAttenuation[0]=t>0?Math.max(0,this.pointSizeAttenuation_[0]):1,this.pointSizeAttenuation[1]=t>1?Math.max(0,this.pointSizeAttenuation_[1]):0,this.pointSizeAttenuation[2]=t>2?Math.max(0,this.pointSizeAttenuation_[2]):0},set_colorMode__:function(){const t=new Map([["POINT_COLOR",0],["TEXTURE_COLOR",1],["TEXTURE_AND_POINT_COLOR",2]]);return function(){const e=t.get(this.colorMode_.getValue());this.colorMode=void 0!==e?e:t.get("TEXTURE_AND_POINT_COLOR")}}(),setShaderUniforms:function(t,e){t.uniform1f(e.x3d_PointPropertiesPointSizeScaleFactor,this.pointSizeScaleFactor),t.uniform1f(e.x3d_PointPropertiesPointSizeMinValue,this.pointSizeMinValue),t.uniform1f(e.x3d_PointPropertiesPointSizeMaxValue,this.pointSizeMaxValue),t.uniform3fv(e.x3d_PointPropertiesPointSizeAttenuation,this.pointSizeAttenuation),t.uniform1i(e.x3d_PointPropertiesColorMode,this.colorMode)}}),s}),define("x_ite/Components/Shape/LineProperties",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Shape/X3DAppearanceChildNode","x_ite/Bits/X3DConstants"],function(t,e,i,n,r){"use strict";function s(t){n.call(this,t),this.addType(r.LineProperties)}return s.prototype=Object.assign(Object.create(n.prototype),{constructor:s,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"applied",new t.SFBool(!0)),new e(r.inputOutput,"linetype",new t.SFInt32(1)),new e(r.inputOutput,"linewidthScaleFactor",new t.SFFloat)]),getTypeName:function(){return"LineProperties"},getComponentName:function(){return"Shape"},getContainerField:function(){return"lineProperties"},initialize:function(){n.prototype.initialize.call(this),this.applied_.addInterest("set_applied__",this),this.linewidthScaleFactor_.addInterest("set_linewidthScaleFactor__",this),this.set_applied__(),this.set_linewidthScaleFactor__()},set_applied__:function(){this.applied=this.applied_.getValue()},set_linewidthScaleFactor__:function(){this.linewidthScaleFactor=Math.max(1,this.linewidthScaleFactor_.getValue())},setShaderUniforms:function(t,e){if(this.applied){const i=e.getBrowser(),n=i.getLinetype(this.linetype_.getValue());t.lineWidth(this.linewidthScaleFactor),t.uniform1i(e.x3d_LinePropertiesApplied,!0),t.uniform1f(e.x3d_LinePropertiesLinewidthScaleFactor,this.linewidthScaleFactor),t.activeTexture(t.TEXTURE0+i.getLinetypeUnit()),t.bindTexture(t.TEXTURE_2D,n.getTexture())}else t.lineWidth(1),t.uniform1i(e.x3d_LinePropertiesApplied,!1),t.uniform1f(e.x3d_LinePropertiesLinewidthScaleFactor,1)}}),s}),define("x_ite/Components/Shape/FillProperties",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Shape/X3DAppearanceChildNode","x_ite/Bits/X3DConstants"],function(t,e,i,n,r){"use strict";function s(e){n.call(this,e),this.addType(r.FillProperties),this.addChildObjects("transparent",new t.SFBool),this.transparent_.setAccessType(r.outputOnly),this.hatchColor=new Float32Array(3)}return s.prototype=Object.assign(Object.create(n.prototype),{constructor:s,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"filled",new t.SFBool(!0)),new e(r.inputOutput,"hatched",new t.SFBool(!0)),new e(r.inputOutput,"hatchColor",new t.SFColor(1,1,1)),new e(r.inputOutput,"hatchStyle",new t.SFInt32(1))]),getTypeName:function(){return"FillProperties"},getComponentName:function(){return"Shape"},getContainerField:function(){return"fillProperties"},initialize:function(){n.prototype.initialize.call(this),this.filled_.addInterest("set_filled__",this),this.hatched_.addInterest("set_hatched__",this),this.hatchColor_.addInterest("set_hatchColor__",this),this.set_filled__(),this.set_hatched__(),this.set_hatchColor__()},set_filled__:function(){this.filled=this.filled_.getValue(),this.setTransparent(!this.filled)},set_hatched__:function(){this.hatched=this.hatched_.getValue()},set_hatchColor__:function(){this.hatchColor[0]=this.hatchColor_[0],this.hatchColor[1]=this.hatchColor_[1],this.hatchColor[2]=this.hatchColor_[2]},setTransparent:function(t){t!==this.transparent_.getValue()&&(this.transparent_=t)},getTransparent:function(){return this.transparent_.getValue()},setShaderUniforms:function(t,e){const i=this.hatched;if(t.uniform1i(e.x3d_FillPropertiesFilled,this.filled),t.uniform1i(e.x3d_FillPropertiesHatched,i),i){const i=e.getBrowser(),n=i.getHatchStyle(this.hatchStyle_.getValue());t.uniform3fv(e.x3d_FillPropertiesHatchColor,this.hatchColor),t.activeTexture(t.TEXTURE0+i.getHatchStyleUnit()),t.bindTexture(t.TEXTURE_2D,n.getTexture())}}}),s}),define("x_ite/Components/Shape/X3DMaterialNode",["x_ite/Fields","x_ite/Components/Shape/X3DAppearanceChildNode","x_ite/Bits/X3DConstants"],function(t,e,i){"use strict";function n(n){e.call(this,n),this.addType(i.X3DMaterialNode),this.addChildObjects("transparent",new t.SFBool),this.transparent_.setAccessType(i.outputOnly)}return n.prototype=Object.assign(Object.create(e.prototype),{constructor:n,setTransparent:function(t){t!==this.transparent_.getValue()&&(this.transparent_=t)},getTransparent:function(){return this.transparent_.getValue()}}),n}),define("x_ite/Components/Shape/X3DOneSidedMaterialNode",["x_ite/Components/Shape/X3DMaterialNode","x_ite/Bits/X3DConstants","standard/Math/Algorithm"],function(t,e,i){"use strict";function n(i){t.call(this,i),this.addType(e.X3DOneSidedMaterialNode),this.emissiveColor=new Float32Array(3)}return n.prototype=Object.assign(Object.create(t.prototype),{constructor:n,initialize:function(){t.prototype.initialize.call(this),this.emissiveColor_.addInterest("set_emissiveColor__",this),this.transparency_.addInterest("set_transparency__",this),this.set_emissiveColor__(),this.set_transparency__()},set_emissiveColor__:function(){const t=this.emissiveColor,e=this.emissiveColor_.getValue();t[0]=e.r,t[1]=e.g,t[2]=e.b},set_shininess__:function(){this.shininess=i.clamp(this.shininess_.getValue(),0,1)},set_transparency__:function(){const t=i.clamp(this.transparency_.getValue(),0,1);this.transparency=t,this.setTransparent(Boolean(t))}}),n}),define("x_ite/Components/Shape/UnlitMaterial",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Shape/X3DOneSidedMaterialNode","x_ite/Bits/X3DConstants"],function(t,e,i,n,r){"use strict";function s(t){n.call(this,t),this.addType(r.UnlitMaterial)}return s.prototype=Object.assign(Object.create(n.prototype),{constructor:s,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"emissiveColor",new t.SFColor(1,1,1)),new e(r.inputOutput,"emissiveTexture",new t.SFNode),new e(r.inputOutput,"emissiveTextureMapping",new t.SFString),new e(r.inputOutput,"normalScale",new t.SFFloat(1)),new e(r.inputOutput,"normalTexture",new t.SFNode),new e(r.inputOutput,"normalTextureMapping",new t.SFString),new e(r.inputOutput,"transparency",new t.SFFloat)]),getTypeName:function(){return"UnlitMaterial"},getComponentName:function(){return"Shape"},getContainerField:function(){return"material"},getShader:function(t,e){return t.getUnlitShader()},setShaderUniforms:function(t,e){t.uniform3fv(e.x3d_EmissiveColor,this.emissiveColor),t.uniform1f(e.x3d_Transparency,this.transparency)}}),s}),define("x_ite/Components/Texturing/TextureProperties",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Core/X3DNode","x_ite/Bits/X3DConstants","standard/Math/Algorithm"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.TextureProperties)}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"borderColor",new t.SFColorRGBA),new e(r.inputOutput,"borderWidth",new t.SFInt32),new e(r.inputOutput,"anisotropicDegree",new t.SFFloat(1)),new e(r.initializeOnly,"generateMipMaps",new t.SFBool),new e(r.inputOutput,"minificationFilter",new t.SFString("FASTEST")),new e(r.inputOutput,"magnificationFilter",new t.SFString("FASTEST")),new e(r.inputOutput,"boundaryModeS",new t.SFString("REPEAT")),new e(r.inputOutput,"boundaryModeT",new t.SFString("REPEAT")),new e(r.inputOutput,"boundaryModeR",new t.SFString("REPEAT")),new e(r.inputOutput,"textureCompression",new t.SFString("FASTEST")),new e(r.inputOutput,"texturePriority",new t.SFFloat)]),getTypeName:function(){return"TextureProperties"},getComponentName:function(){return"Texturing"},getContainerField:function(){return"textureProperties"},getBorderWidth:function(){return s.clamp(this.borderWidth_.getValue(),0,1)},getBoundaryMode:function(){var t=new Map([["CLAMP","CLAMP_TO_EDGE"],["CLAMP_TO_EDGE","CLAMP_TO_EDGE"],["CLAMP_TO_BOUNDARY","CLAMP_TO_EDGE"],["MIRRORED_REPEAT","MIRRORED_REPEAT"],["REPEAT","REPEAT"]]);return function(e){var i=t.get(e);return void 0!==i?i:"REPEAT"}}(),getBoundaryModeS:function(){return this.getBoundaryMode(this.boundaryModeS_.getValue())},getBoundaryModeT:function(){return this.getBoundaryMode(this.boundaryModeT_.getValue())},getBoundaryModeR:function(){return this.getBoundaryMode(this.boundaryModeR_.getValue())},getMinificationFilter:function(){var t=new Map([["AVG_PIXEL_AVG_MIPMAP","LINEAR_MIPMAP_LINEAR"],["AVG_PIXEL","LINEAR"],["AVG_PIXEL_NEAREST_MIPMAP","LINEAR_MIPMAP_NEAREST"],["NEAREST_PIXEL_AVG_MIPMAP","NEAREST_MIPMAP_LINEAR"],["NEAREST_PIXEL_NEAREST_MIPMAP","NEAREST_MIPMAP_NEAREST"],["NEAREST_PIXEL","NEAREST"],["NICEST","LINEAR_MIPMAP_LINEAR"],["FASTEST","NEAREST"]]);return function(){if(this.generateMipMaps_.getValue()){var e=t.get(this.minificationFilter_.getValue());return void 0!==e?e:this.getBrowser().getDefaultTextureProperties().getMinificationFilter()}return"LINEAR"}}(),getMagnificationFilter:function(){var t=new Map([["AVG_PIXEL","LINEAR"],["NEAREST_PIXEL","NEAREST"],["NICEST","LINEAR"],["FASTEST","NEAREST"]]);return function(){var e=t.get(this.magnificationFilter_.getValue());return void 0!==e?e:this.getBrowser().getDefaultTextureProperties().getMagnificationFilter()}}(),getTextureCompression:function(){var t=new Map([["DEFAULT","RGBA"],["NICEST","RGBA"],["FASTEST","RGBA"],["LOW","RGBA"],["MEDIUM","RGBA"],["HIGH","RGBA"]]);return function(){var e=this.getBrowser(),i=e.getContext(),n=e.getExtension("WEBGL_compressed_texture_etc"),r=n?n[t.get(this.textureCompression_.getValue())]:void 0;return void 0!==r?r:i.RGBA}}()}),o}),define("x_ite/Browser/Shape/X3DShapeContext",["x_ite/Components/Shape/Appearance","x_ite/Components/Shape/PointProperties","x_ite/Components/Shape/LineProperties","x_ite/Components/Shape/FillProperties","x_ite/Components/Shape/UnlitMaterial","x_ite/Components/Texturing/ImageTexture","x_ite/Components/Texturing/TextureProperties","x_ite/Browser/Networking/urls"],function(t,e,i,n,r,s,o,a){"use strict";function u(){this.linetypeTextures=[],this.hatchStyleTextures=[]}return u.prototype={initialize:function(){},getDefaultAppearance:function(){return this.defaultAppearance=new t(this.getPrivateScene()),this.defaultAppearance.setup(),this.getDefaultAppearance=function(){return this.defaultAppearance},this.defaultAppearance},getDefaultPointProperties:function(){return this.defaultPointProperties=new e(this.getPrivateScene()),this.defaultPointProperties.setup(),this.getDefaultPointProperties=function(){return this.defaultPointProperties},this.defaultPointProperties},getDefaultLineProperties:function(){return this.defaultLineProperties=new i(this.getPrivateScene()),this.defaultLineProperties.applied_=!1,this.defaultLineProperties.setup(),this.getDefaultLineProperties=function(){return this.defaultLineProperties},this.defaultLineProperties},getDefaultFillProperties:function(){return this.defaultFillProperties=new n(this.getPrivateScene()),this.defaultFillProperties.hatched_=!1,this.defaultFillProperties.setup(),this.getDefaultFillProperties=function(){return this.defaultFillProperties},this.defaultFillProperties},getDefaultMaterial:function(){return this.defaultMaterial=new r(this.getPrivateScene()),this.defaultMaterial.setup(),this.getDefaultMaterial=function(){return this.defaultMaterial},this.defaultMaterial},getLinetype:function(t){(t<1||t>15)&&(t=1);var e=this.linetypeTextures[t];return e?e:(e=this.linetypeTextures[t]=new s(this.getPrivateScene()),e.url_[0]=a.getLinetypeUrl(t),e.textureProperties_=this.getLineFillTextureProperties(),e.setup(),e)},getHatchStyle:function(t){(t<1||t>19)&&(t=1);var e=this.hatchStyleTextures[t];return e?e:(e=this.hatchStyleTextures[t]=new s(this.getPrivateScene()),e.url_[0]=a.getHatchingUrl(t),e.textureProperties_=this.getLineFillTextureProperties(),e.setup(),e)},getLineFillTextureProperties:function(){return this.lineFillTextureProperties=new o(this.getPrivateScene()),this.lineFillTextureProperties.setup(),this.getLineFillTextureProperties=function(){return this.lineFillTextureProperties},this.lineFillTextureProperties}},u}),define("x_ite/Components/Shape/X3DShapeNode",["x_ite/Components/Core/X3DChildNode","x_ite/Components/Grouping/X3DBoundedObject","x_ite/Bits/X3DCast","x_ite/Bits/X3DConstants","x_ite/Browser/Shape/AlphaMode","standard/Math/Geometry/Box3","standard/Math/Numbers/Vector3"],function(t,e,i,n,r,s,o){"use strict";function a(i){t.call(this,i),e.call(this,i),this.addType(n.X3DShapeNode),this.bbox=new s,this.bboxSize=new o(0,0,0),this.bboxCenter=new o(0,0,0)}return a.prototype=Object.assign(Object.create(t.prototype),e.prototype,{constructor:a,initialize:function(){t.prototype.initialize.call(this),e.prototype.initialize.call(this),this.bboxSize_.addInterest("set_bbox__",this),this.bboxCenter_.addInterest("set_bbox__",this),this.appearance_.addInterest("set_apparance__",this),this.geometry_.addInterest("set_geometry__",this),this.appearance_.addInterest("set_transparent__",this),this.geometry_.addInterest("set_transparent__",this),this.set_apparance__(),this.set_geometry__(),this.set_transparent__()},getBBox:function(t,e){return e?this.castShadow_.getValue()?t.assign(this.bbox):t.set():t.assign(this.bbox)},getBBoxSize:function(){return this.bboxSize},getBBoxCenter:function(){return this.bboxCenter},getAppearance:function(){return this.apparanceNode},getGeometry:function(){return this.geometryNode},setTransparent:function(t){this.transparent=t},getTransparent:function(){return this.transparent},set_bbox__:function(){this.bboxSize_.getValue().equals(this.getDefaultBBoxSize())?this.getGeometry()?this.bbox.assign(this.getGeometry().getBBox()):this.bbox.set():this.bbox.set(this.bboxSize_.getValue(),this.bboxCenter_.getValue()),this.bboxSize.assign(this.bbox.size),this.bboxCenter.assign(this.bbox.center)},set_apparance__:function(){this.apparanceNode&&this.apparanceNode.transparent_.removeInterest("set_transparent__",this),this.apparanceNode=i(n.X3DAppearanceNode,this.appearance_),this.apparanceNode?(this.apparanceNode.alphaMode_.addInterest("set_transparent__",this),this.apparanceNode.transparent_.addInterest("set_transparent__",this)):this.apparanceNode=this.getBrowser().getDefaultAppearance()},set_geometry__:function(){this.geometryNode&&(this.geometryNode.transparent_.addInterest("set_transparent__",this),this.geometryNode.bbox_changed_.addInterest("set_bbox__",this)),this.geometryNode=i(n.X3DGeometryNode,this.geometry_),this.geometryNode&&(this.geometryNode.transparent_.addInterest("set_transparent__",this),this.geometryNode.bbox_changed_.addInterest("set_bbox__",this)),this.set_bbox__()},set_transparent__:function(){this.apparanceNode.getAlphaMode()===r.AUTO?this.transparent=this.apparanceNode.getTransparent()||this.geometryNode&&this.geometryNode.getTransparent():this.transparent=this.apparanceNode.getTransparent()}}),a}),define("standard/Math/Geometry/Line3",["standard/Math/Numbers/Vector3"],function(t){"use strict";function e(t,e){this.point=t.copy(),this.direction=e.copy()}return e.prototype={constructor:e,copy:function(){const t=Object.create(e.prototype);return t.point=this.point.copy(),t.direction=this.direction.copy(),t},assign:function(t){return this.point.assign(t.point),this.direction.assign(t.direction),this},set:function(t,e){return this.point.assign(t),this.direction.assign(e),this},setPoints:function(t,e){return this.point.assign(t),this.direction.assign(e).subtract(t).normalize(),this},multMatrixLine:function(t){return t.multMatrixVec(this.point),t.multMatrixDir(this.direction).normalize(),this},multLineMatrix:function(t){return t.multVecMatrix(this.point),t.multDirMatrix(this.direction).normalize(),this},getClosestPointToPoint:function(t,e){const i=e.assign(t).subtract(this.point),n=i.dot(this.direction);return e.assign(this.direction).multiply(n).add(this.point)},getClosestPointToLine:function(){const e=new t(0,0,0);return function(i,n){const r=this.point,s=i.point,o=this.direction,a=i.direction;let u=t.dot(o,a);return!(Math.abs(u)>=1)&&(e.assign(s).subtract(r),u=(e.dot(o)-u*e.dot(a))/(1-u*u),n.assign(o).multiply(u).add(r),!0)}}(),getPerpendicularVector:function(e){const i=t.subtract(this.point,e);return i.subtract(this.direction.copy().multiply(t.dot(i,this.direction)))},intersectsTriangle:function(){const e=new t(0,0,0),i=new t(0,0,0);return function(t,n,r,s){const o=n.subtract(t),a=r.subtract(t);e.assign(this.direction).cross(a);const u=o.dot(e);if(0===u)return!1;const l=1/u;i.assign(this.point).subtract(t);const c=i.dot(e)*l;if(c<0||c>1)return!1;const h=i.cross(o),d=this.direction.dot(h)*l;return!(d<0||c+d>1)&&(s.u=c,s.v=d,s.t=1-c-d,!0)}}(),toString:function(){return this.point+", "+this.direction}},e.Points=function(i,n){const r=Object.create(e.prototype);return r.point=i.copy(),r.direction=t.subtract(n,i).normalize(),r},e}),define("standard/Math/Algorithms/QuickSort",[],function(){"use strict";function t(t,e){this.array=t,e&&(this.compare=e)}return t.prototype={compare:function(t,e){return t<e},sort:function(t,e){e-t>1&&this.quicksort(t,e-1)},quicksort:function(t,e){let i=t,n=e;const r=this.array,s=this.compare,o=r[t+e>>>1];for(;;){for(;s(r[i],o);)++i;for(;s(o,r[n]);)--n;if(!(i<n)){i===n&&(++i,--n);break}{const t=r[i];r[i]=r[n],r[n]=t,i++,n--}}t<n&&this.quicksort(t,n),i<e&&this.quicksort(i,e)}},t}),define("x_ite/Components/Shape/Shape",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Shape/X3DShapeNode","x_ite/Bits/TraverseType","x_ite/Bits/X3DConstants","standard/Math/Algorithm","standard/Math/Numbers/Vector3","standard/Math/Numbers/Matrix4","standard/Math/Geometry/Box3","standard/Math/Geometry/Line3","standard/Math/Algorithms/QuickSort"],function(t,e,i,n,r,s,o,a,u,l,c,h){"use strict";function d(t){n.call(this,t),this.addType(s.Shape)}return d.prototype=Object.assign(Object.create(n.prototype),{constructor:d,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOutput,"visible",new t.SFBool(!0)),new e(s.inputOutput,"castShadow",new t.SFBool(!0)),new e(s.inputOutput,"bboxDisplay",new t.SFBool),new e(s.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new e(s.initializeOnly,"bboxCenter",new t.SFVec3f),new e(s.inputOutput,"appearance",new t.SFNode),new e(s.inputOutput,"geometry",new t.SFNode)]),getTypeName:function(){return"Shape"},getComponentName:function(){return"Shape"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.transformSensors_changed_.addInterest("set_transformSensors__",this),this.set_transformSensors__()},set_geometry__:function(){n.prototype.set_geometry__.call(this),this.getGeometry()?delete this.traverse:this.traverse=Function.prototype},set_transformSensors__:function(){this.setPickableObject(this.getTransformSensors().size)},intersectsBox:function(t,e,i){return this.getGeometry().intersectsBox(t,e,i)},traverse:function(t,e){switch(t){case r.POINTER:this.pointer(e);break;case r.PICKING:this.picking(e);break;case r.COLLISION:e.addCollisionShape(this);break;case r.SHADOW:this.castShadow_.getValue()&&e.addDepthShape(this);break;case r.DISPLAY:e.addDisplayShape(this)&&this.getAppearance().traverse(t,e)}this.getGeometry().traverse(t,e)},pointer:function(){const t=new u,e=new u,i=new c(new a(0,0,0),new a(0,0,0)),n=[],r=new h(n,function(t,e){return t.point.z>e.point.z});return function(s){try{const a=this.getGeometry();if(a.getGeometryType()<2)return;const u=s.getBrowser();if(t.assign(s.getModelViewMatrix().get()),e.assign(t).inverse(),i.assign(u.getHitRay()).multLineMatrix(e),a.intersectsLine(i,s.getLocalObjects(),t,n)){for(const e of n)t.multVecMatrix(e.point);r.sort(0,n.length);const i=o.lowerBound(n,0,n.length,-s.getNavigationInfo().getNearValue(),function(t,e){return t.point.z>e});i!==n.length&&(e.multMatrixDir(n[i].normal).normalize(),u.addHit(n[i],s.getLayer(),this,t.multRight(s.getCameraSpaceMatrix().get()))),n.length=0}}catch(t){console.log(t)}}}(),picking:function(t){if(this.getTransformSensors().size){const e=t.getModelViewMatrix().get();for(const t of this.getTransformSensors())t.collect(e)}const e=t.getBrowser(),i=e.getPickSensors(),n=e.getPickingHierarchy();n.push(this);for(const n of i.at(-1))n.collect(this.getGeometry(),t.getModelViewMatrix().get(),e.getPickingHierarchy());n.pop()},depth:function(t,e,i){this.getGeometry().depth(t,e,i)},display:function(t,e){this.getGeometry().display(t,e)}}),d}),define("x_ite/Components/Rendering/X3DGeometryNode",["x_ite/Fields","x_ite/Components/Core/X3DNode","x_ite/Bits/X3DConstants","x_ite/Browser/Core/Shading","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3","standard/Math/Numbers/Matrix4","standard/Math/Geometry/Box3","standard/Math/Geometry/Plane3","standard/Math/Geometry/Triangle3","standard/Math/Algorithm"],function(t,e,i,n,r,s,o,a,u,l,c){"use strict";function h(n){e.call(this,n),this.addType(i.X3DGeometryNode),this.addChildObjects("transparent",new t.SFBool,"bbox_changed",new t.SFTime,"rebuild",new t.SFTime),this.transparent_.setAccessType(i.outputOnly),this.bbox_changed_.setAccessType(i.outputOnly),this.rebuild_.setAccessType(i.outputOnly),this.min=new s(0,0,0),this.max=new s(0,0,0),this.bbox=new a(this.min,this.max,!0),this.solid=!0,this.geometryType=3,this.flatShading=void 0,this.colorMaterial=!1,this.attribNodes=[],this.attribs=[],this.textureCoordinateNode=this.getBrowser().getDefaultTextureCoordinate(),this.multiTexCoords=[],this.texCoords=h.createArray(),this.fogDepths=h.createArray(),this.colors=h.createArray(),this.normals=h.createArray(),this.flatNormals=h.createArray(),this.vertices=h.createArray(),this.vertexCount=0,this.depth=Function.prototype,this.display=Function.prototype,this.displayParticles=Function.prototype}const d=[new s(0,0,1),new s(0,0,-1),new s(0,1,0),new s(0,-1,0),new s(1,0,0)];return h.createArray=function(){const t=[];return t.typedArray=new Float32Array,t.assign=function(t){for(var e=0,i=t.length;e<i;++e)this[e]=t[e];this.length=i},t.getValue=function(){return this.typedArray},t.shrinkToFit=function(){this.length!==this.typedArray.length?this.typedArray=new Float32Array(this):this.typedArray.set(this)},t},h.prototype=Object.assign(Object.create(e.prototype),{constructor:h,setup:function(){e.prototype.setup.call(this),this.rebuild()},initialize:function(){e.prototype.initialize.call(this),this.isLive().addInterest("set_live__",this),this.addInterest("requestRebuild",this),this.rebuild_.addInterest("rebuild",this);const t=this.getBrowser().getContext();if(this.primitiveMode=t.TRIANGLES,this.frontFace=t.CCW,this.attribBuffers=[],this.texCoordBuffers=[],this.fogDepthBuffer=t.createBuffer(),this.colorBuffer=t.createBuffer(),this.normalBuffer=t.createBuffer(),this.vertexBuffer=t.createBuffer(),this.planes=[],this.geometryType>1)for(let t=0;t<5;++t)this.planes[t]=new u(s.Zero,s.zAxis);this.set_live__()},setGeometryType:function(t){this.geometryType=t},getGeometryType:function(){return this.geometryType},setTransparent:function(t){t!==this.transparent_.getValue()&&(this.transparent_=t)},getTransparent:function(){return this.transparent_.getValue()},getBBox:function(){return this.bbox},setBBox:function(t){if(!t.equals(this.bbox)){t.getExtents(this.min,this.max),this.bbox.assign(t);for(let t=0;t<5;++t)this.planes[t].set(t%2?this.min:this.max,d[t]);this.bbox_changed_.addEvent()}},getMin:function(){return this.min},getMax:function(){return this.max},getMatrix:function(){return o.Identity},setPrimitiveMode:function(t){this.primitiveMode=t},getPrimitiveMode:function(){return this.primitiveMode},setSolid:function(t){this.solid=t},setCCW:function(t){this.frontFace=t?this.getBrowser().getContext().CCW:this.getBrowser().getContext().CW},getAttrib:function(){return this.attribNodes},getAttribs:function(){return this.attribs},setFogDepths:function(t){this.fogDepths.assign(t)},getFogDepths:function(){return this.fogDepths},setColors:function(t){this.colors.assign(t)},getColors:function(){return this.colors},setMultiTexCoords:function(t){const e=this.multiTexCoords;for(var i=0,n=t.length;i<n;++i)e[i]=t[i];e.length=n},getMultiTexCoords:function(){return this.multiTexCoords},getTexCoords:function(){return this.texCoords},setTextureCoordinate:function(t){this.textureCoordinateNode=t?t:this.getBrowser().getDefaultTextureCoordinate()},setNormals:function(t){this.normals.assign(t)},getNormals:function(){return this.normals},setVertices:function(t){this.vertices.assign(t)},getVertices:function(){return this.vertices},buildTexCoords:function(){const t=this.texCoords;if(0===t.length){const e=this.getTexCoordParams(),i=e.min,n=e.Sindex,r=e.Tindex,s=e.Ssize,o=i[n],a=i[r],u=this.vertices.getValue();for(let e=0,i=u.length;e<i;e+=4)t.push((u[e+n]-o)/s,(u[e+r]-a)/s,0,1);t.shrinkToFit()}return t},getTexCoordParams:function(){const t={min:new s(0,0,0),Ssize:0,Sindex:0,Tindex:0};return function(){const e=this.getBBox(),i=e.size,n=i.x,r=i.y,s=i.z;return t.min.assign(e.center).subtract(i.divide(2)),n>=r&&n>=s?(t.Ssize=n,t.Sindex=0,t.Tindex=r>=s?1:2):r>=n&&r>=s?(t.Ssize=r,t.Sindex=1,t.Tindex=n>=s?0:2):(t.Ssize=s,t.Sindex=2,t.Tindex=n>=r?0:1),t}}(),refineNormals:function(t,e,i){if(0===i)return e;const n=Math.cos(c.clamp(i,0,Math.PI)),r=[];for(const i in t){const o=t[i];for(const t of o){const i=e[t],a=new s(0,0,0);for(const t of o){const r=e[t];r.dot(i)>=n&&a.add(r)}r[t]=a.normalize()}}return r},isClipped:function(t,e){return e.some(function(e){return e.isClipped(t)})},transformLine:function(t){},transformMatrix:function(t){},intersectsLine:function(){const t=new o,e={u:0,v:0,t:0},i=new s(0,0,0),n=new s(0,0,0),a=new s(0,0,0),u=new s(0,0,0);return function(o,l,c,h){try{if(this.intersectsBBox(o)){this.transformLine(o),this.transformMatrix(t.assign(c));const d=this.multiTexCoords[0].getValue(),p=this.normals.getValue(),f=this.vertices.getValue();for(let c=0,g=this.vertexCount;c<g;c+=3){const g=4*c;if(i.x=f[g],i.y=f[g+1],i.z=f[g+2],n.x=f[g+4],n.y=f[g+5],n.z=f[g+6],a.x=f[g+8],a.y=f[g+9],a.z=f[g+10],o.intersectsTriangle(i,n,a,e)){const i=e.u,n=e.v,o=e.t,a=new s(o*f[g]+i*f[g+4]+n*f[g+8],o*f[g+1]+i*f[g+5]+n*f[g+9],o*f[g+2]+i*f[g+6]+n*f[g+10]);if(this.isClipped(t.multVecMatrix(u.assign(a)),l))continue;const m=new r(o*d[g]+i*d[g+4]+n*d[g+8],o*d[g+1]+i*d[g+5]+n*d[g+9]),_=3*c,x=new s(o*p[_]+i*p[_+3]+n*p[_+6],o*p[_+1]+i*p[_+4]+n*p[_+7],o*p[_+2]+i*p[_+5]+n*p[_+8]);h.push({texCoord:m,normal:x,point:this.getMatrix().multVecMatrix(a)})}}}return h.length}catch(t){return console.log(t),!1}}}(),intersectsBBox:function(){const t=new s(0,0,0);return function(e){const i=this.planes,n=this.min,r=this.max,s=n.x,o=r.x,a=n.y,u=r.y,l=n.z,c=r.z;return!!(i[0].intersectsLine(e,t)&&t.x>=s&&t.x<=o&&t.y>=a&&t.y<=u)||(!!(i[1].intersectsLine(e,t)&&t.x>=s&&t.x<=o&&t.y>=a&&t.y<=u)||(!!(i[2].intersectsLine(e,t)&&t.x>=s&&t.x<=o&&t.z>=l&&t.z<=c)||(!!(i[3].intersectsLine(e,t)&&t.x>=s&&t.x<=o&&t.z>=l&&t.z<=c)||!!(i[4].intersectsLine(e,t)&&t.y>=a&&t.y<=u&&t.z>=l&&t.z<=c))))}}(),intersectsBox:function(){const t=new s(0,0,0),e=new s(0,0,0),i=new s(0,0,0),n=new o,r=new s(0,0,0);return function(s,o,a){try{if(s.intersectsBox(this.bbox)){s.multRight(n.assign(this.getMatrix()).inverse()),this.transformMatrix(a);const u=this.vertices.getValue();for(let n=0,l=this.vertexCount;n<l;n+=3){const l=4*n;if(t.x=u[l],t.y=u[l+1],t.z=u[l+2],e.x=u[l+4],e.y=u[l+5],e.z=u[l+6],i.x=u[l+8],i.y=u[l+9],i.z=u[l+10],s.intersectsTriangle(t,e,i)){if(o.length){if(this.isClipped(a.multVecMatrix(r.assign(t)),o))continue;if(this.isClipped(a.multVecMatrix(r.assign(e)),o))continue;if(this.isClipped(a.multVecMatrix(r.assign(i)),o))continue}return!0}}}return!1}catch(t){return console.log(t),!1}}}(),set_live__:function(){this.isLive().getValue()?this.getBrowser().getBrowserOptions().Shading_.addInterest("set_shading__",this):this.getBrowser().getBrowserOptions().Shading_.removeInterest("set_shading__",this)},set_shading__:function(){const t=new s(0,0,0),e=new s(0,0,0),i=new s(0,0,0),r=new s(0,0,0);return function(s){if(!(this.geometryType<2)){const s=this.getBrowser().getBrowserOptions().getShading()===n.FLAT;if(s!==this.flatShading){this.flatShading=s;const n=this.getBrowser().getContext();if(s&&!this.flatNormals.length){const s=this.frontFace===n.CW,o=this.flatNormals,a=this.vertices.getValue();for(let n=0,u=a.length;n<u;n+=12)l.normal(t.set(a[n],a[n+1],a[n+2]),e.set(a[n+4],a[n+5],a[n+6]),i.set(a[n+8],a[n+9],a[n+10]),r),s&&r.negate(),o.push(r.x,r.y,r.z,r.x,r.y,r.z,r.x,r.y,r.z);o.shrinkToFit()}n.bindBuffer(n.ARRAY_BUFFER,this.normalBuffer),
|
|
26
|
-
n.bufferData(n.ARRAY_BUFFER,s?this.flatNormals.getValue():this.normals.getValue(),n.STATIC_DRAW)}}}}(),requestRebuild:function(){this.rebuild_.addEvent()},rebuild:function(){const t=new s(0,0,0);return function(){this.clear(),this.build();for(const t of this.attribs)t.shrinkToFit();for(const t of this.multiTexCoords)t.shrinkToFit();this.fogDepths.shrinkToFit(),this.colors.shrinkToFit(),this.normals.shrinkToFit(),this.vertices.shrinkToFit();const e=this.min,i=this.max,n=this.vertices.getValue();if(n.length){if(e.x===Number.POSITIVE_INFINITY)for(let r=0,s=n.length;r<s;r+=4)t.set(n[r],n[r+1],n[r+2]),e.min(t),i.max(t);this.bbox.setExtents(e,i)}else this.bbox.setExtents(e.set(0,0,0),i.set(0,0,0));if(this.bbox_changed_.addEvent(),this.geometryType>1){for(let t=0;t<5;++t)this.planes[t].set(t%2?e:i,d[t]);0===this.multiTexCoords.length&&this.multiTexCoords.push(this.buildTexCoords());const t=this.multiTexCoords.length-1;for(var r=this.multiTexCoords.length,s=this.getBrowser().getMaxTextures();r<s;++r)this.multiTexCoords[r]=this.multiTexCoords[t];this.multiTexCoords.length=s}this.set_shading__(this.getBrowser().getBrowserOptions().Shading_),this.transfer()}}(),clear:function(){this.min.set(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),this.max.set(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);const t=this.attribs;for(var e=0,i=t.length;e<i;++e)t[e].length=0;for(var e=t.length,i=this.attribNodes.length;e<i;++e)t[e]=h.createArray();t.length=i,this.flatShading=void 0,this.fogDepths.length=0,this.colors.length=0,this.multiTexCoords.length=0,this.texCoords.length=0,this.normals.length=0,this.flatNormals.length=0,this.vertices.length=0},transfer:function(){const t=this.getBrowser().getContext(),e=this.vertices.length/4;for(let e=this.attribBuffers.length,i=this.attribs.length;e<i;++e)this.attribBuffers.push(t.createBuffer());for(let e=0,i=this.attribs.length;e<i;++e)t.bindBuffer(t.ARRAY_BUFFER,this.attribBuffers[e]),t.bufferData(t.ARRAY_BUFFER,this.attribs[e].getValue(),t.STATIC_DRAW);t.bindBuffer(t.ARRAY_BUFFER,this.fogDepthBuffer),t.bufferData(t.ARRAY_BUFFER,this.fogDepths.getValue(),t.STATIC_DRAW),this.fogCoords=!!this.fogDepths.length,t.bindBuffer(t.ARRAY_BUFFER,this.colorBuffer),t.bufferData(t.ARRAY_BUFFER,this.colors.getValue(),t.STATIC_DRAW),this.colorMaterial=!!this.colors.length;for(let e=this.texCoordBuffers.length,i=this.multiTexCoords.length;e<i;++e)this.texCoordBuffers.push(t.createBuffer());for(let e=0,i=this.multiTexCoords.length;e<i;++e)t.bindBuffer(t.ARRAY_BUFFER,this.texCoordBuffers[e]),t.bufferData(t.ARRAY_BUFFER,this.multiTexCoords[e].getValue(),t.STATIC_DRAW);t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,this.vertices.getValue(),t.STATIC_DRAW),this.vertexCount=e,this.vertexCount?(delete this.depth,delete this.display,delete this.displayParticles):(this.depth=Function.prototype,this.display=Function.prototype,this.displayParticles=Function.prototype)},traverse:function(t,e){},depth:function(t,e,i){i.enableVertexAttribute(t,this.vertexBuffer),t.drawArrays(this.primitiveMode,0,this.vertexCount)},display:function(t,e){try{const i=e.shapeNode.getAppearance(),n=i.materialNode,r=i.backMaterialNode,s=i.shaderNode||n.getShader(e.browser,e.shadow);if(this.solid||!r||e.wireframe)this.displayGeometry(t,e,i,s,!0,!0);else{const n=i.shaderNode||r.getShader(e.browser,e.shadow);this.displayGeometry(t,e,i,n,!0,!1),this.displayGeometry(t,e,i,s,!1,!0)}}catch(t){console.log(t)}},displayGeometry:function(t,e,i,n,r,s){if(n.getValid()){const a=i.blendModeNode,u=this.attribNodes,l=this.attribBuffers;a&&a.enable(t),n.enable(t),n.setLocalUniforms(t,e,s);for(let e=0,i=u.length;e<i;++e)u[e].enable(t,n,l[e]);if(this.fogCoords&&n.enableFogDepthAttribute(t,this.fogDepthBuffer),this.colorMaterial&&n.enableColorAttribute(t,this.colorBuffer),n.enableTexCoordAttribute(t,this.texCoordBuffers),n.enableNormalAttribute(t,this.normalBuffer),n.enableVertexAttribute(t,this.vertexBuffer),e.wireframe)for(let e=0,i=this.vertexCount;e<i;e+=3)t.drawArrays(n.primitiveMode,e,3);else{const i=o.prototype.determinant3.call(e.modelViewMatrix)>0;t.frontFace(i?this.frontFace:this.frontFace===t.CCW?t.CW:t.CCW),e.transparent||r!==s?(t.enable(t.CULL_FACE),r&&(t.cullFace(t.FRONT),t.drawArrays(n.primitiveMode,0,this.vertexCount)),s&&(t.cullFace(t.BACK),t.drawArrays(n.primitiveMode,0,this.vertexCount))):(this.solid?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),t.drawArrays(n.primitiveMode,0,this.vertexCount))}for(const e of u)e.disable(t,n);this.fogCoords&&n.disableFogDepthAttribute(t),this.colorMaterial&&n.disableColorAttribute(t),n.disableTexCoordAttribute(t),n.disableNormalAttribute(t),n.disable(t),a&&a.disable(t)}},displayParticlesDepth:function(t,e,i,n,r){i.enableVertexAttribute(t,this.vertexBuffer);const s=e.modelViewMatrix,a=s[12],u=s[13],l=s[14];for(let e=0;e<r;++e){const r=n[e];s[12]=a,s[13]=u,s[14]=l,o.prototype.translate.call(s,r.position),i.setParticle(t,r,s),t.drawArrays(i.primitiveMode,0,this.vertexCount)}},displayParticles:function(t,e,i,n){try{const r=e.shapeNode.getAppearance(),s=r.materialNode,o=r.backMaterialNode,a=r.shaderNode||s.getShader(e.browser,e.shadow);if(this.solid||!o||e.wireframe)this.displayParticlesGeometry(t,e,r,a,!0,!0,i,n);else{const s=r.shaderNode||o.getShader(e.browser,e.shadow);this.displayParticlesGeometry(t,e,r,s,!0,!1,i,n),this.displayParticlesGeometry(t,e,r,a,!1,!0,i,n)}}catch(t){console.log(t)}},displayParticlesGeometry:function(t,e,i,n,r,s,a,u){if(n.getValid()){const l=i.blendModeNode,c=this.attribNodes,h=this.attribBuffers;l&&l.enable(t),n.enable(t),n.setLocalUniforms(t,e,s);for(let e=0,i=c.length;e<i;++e)c[e].enable(t,n,h[e]);this.fogCoords&&n.enableFogDepthAttribute(t,this.fogDepthBuffer),this.colorMaterial&&n.enableColorAttribute(t,this.colorBuffer),n.enableTexCoordAttribute(t,this.texCoordBuffers),n.enableNormalAttribute(t,this.normalBuffer),n.enableVertexAttribute(t,this.vertexBuffer);const d=e.modelViewMatrix,p=d[12],f=d[13],g=d[14];if(n.wireframe)for(let e=0;e<u;++e){const i=a[e];d[12]=p,d[13]=f,d[14]=g,o.prototype.translate.call(d,i.position),n.setParticle(t,i,d);for(let e=0,i=this.vertexCount;e<i;e+=3)t.drawArrays(n.primitiveMode,e,3)}else{const i=o.prototype.determinant3.call(e.modelViewMatrix)>0;if(t.frontFace(i?this.frontFace:this.frontFace===t.CCW?t.CW:t.CCW),e.transparent||r!==s)for(let e=0;e<u;++e){const i=a[e];d[12]=p,d[13]=f,d[14]=g,o.prototype.translate.call(d,i.position),n.setParticle(t,i,d),t.enable(t.CULL_FACE),r&&(t.cullFace(t.FRONT),t.drawArrays(n.primitiveMode,0,this.vertexCount)),s&&(t.cullFace(t.BACK),t.drawArrays(n.primitiveMode,0,this.vertexCount))}else{this.solid?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE);for(let e=0;e<u;++e){const i=a[e];d[12]=p,d[13]=f,d[14]=g,o.prototype.translate.call(d,i.position),n.setParticle(t,i,d),t.drawArrays(n.primitiveMode,0,this.vertexCount)}}}for(const e of c)e.disable(t,n);this.fogCoords&&n.disableFogDepthAttribute(t),this.colorMaterial&&n.disableColorAttribute(t),n.disableTexCoordAttribute(t),n.disableNormalAttribute(t),n.disable(t),l&&l.disable(t)}}}),h}),define("x_ite/Components/Rendering/X3DLineGeometryNode",["x_ite/Components/Rendering/X3DGeometryNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Matrix4"],function(t,e,i){"use strict";function n(e){t.call(this,e)}return n.prototype=Object.assign(Object.create(t.prototype),{constructor:n,getShader:function(t){return t.getLineShader()},intersectsLine:function(t,e,i,n){return!1},intersectsBox:function(t,e,i){return!1},display:function(t,e){try{const i=e.browser,n=e.shapeNode.getAppearance(),r=n.shaderNode||this.getShader(i);if(r.getValid()){const i=n.blendModeNode,s=this.attribNodes,o=this.attribBuffers;i&&i.enable(t),r.enable(t),r.setLocalUniforms(t,e);for(let e=0,i=s.length;e<i;++e)s[e].enable(t,r,o[e]);this.fogCoords&&r.enableFogDepthAttribute(t,this.fogDepthBuffer),this.colorMaterial&&r.enableColorAttribute(t,this.colorBuffer),r.enableVertexAttribute(t,this.vertexBuffer),t.drawArrays(r.primitiveMode===t.POINTS?t.POINTS:this.primitiveMode,0,this.vertexCount);for(const e of s)e.disable(t,r);this.fogCoords&&r.disableFogDepthAttribute(t),this.colorMaterial&&r.disableColorAttribute(t),r.disableTexCoordAttribute(t),r.disable(t),i&&i.disable(t)}}catch(t){console.log(t)}},displayParticles:function(t,e,n,r){try{const s=e.browser,o=e.shapeNode.getAppearance(),a=o.shaderNode||this.getShader(s);if(a.getValid()){const s=o.blendModeNode,u=this.attribNodes,l=this.attribBuffers;s&&s.enable(t),a.enable(t),a.setLocalUniforms(t,e);for(let e=0,i=u.length;e<i;++e)u[e].enable(t,a,l[e]);this.fogCoords&&a.enableFogDepthAttribute(t,this.fogDepthBuffer),this.colorMaterial&&a.enableColorAttribute(t,this.colorBuffer),this.getMultiTexCoords().length&&a.enableTexCoordAttribute(t,this.texCoordBuffers),a.enableVertexAttribute(t,this.vertexBuffer);const c=e.modelViewMatrix,h=c[12],d=c[13],p=c[14],f=a.primitiveMode===t.POINTS?t.POINTS:this.primitiveMode;for(let e=0;e<r;++e){const r=n[e];c[12]=h,c[13]=d,c[14]=p,i.prototype.translate.call(c,r.position),a.setParticle(t,r,c),t.drawArrays(f,0,this.vertexCount)}for(const e of u)e.disable(t,a);this.fogCoords&&a.disableFogDepthAttribute(t),this.colorMaterial&&a.disableColorAttribute(t),a.disableTexCoordAttribute(t),a.disable(t),s&&s.disable(t)}}catch(t){console.log(t)}}}),n}),define("x_ite/Components/Rendering/IndexedLineSet",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Rendering/X3DLineGeometryNode","x_ite/Bits/X3DCast","x_ite/Bits/X3DConstants"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(s.IndexedLineSet),this.setGeometryType(1),this.fogCoordNode=null,this.colorNode=null,this.coordNode=null}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOnly,"set_colorIndex",new t.MFInt32),new e(s.inputOnly,"set_coordIndex",new t.MFInt32),new e(s.initializeOnly,"colorPerVertex",new t.SFBool(!0)),new e(s.initializeOnly,"colorIndex",new t.MFInt32),new e(s.initializeOnly,"coordIndex",new t.MFInt32),new e(s.inputOutput,"attrib",new t.MFNode),new e(s.inputOutput,"fogCoord",new t.SFNode),new e(s.inputOutput,"color",new t.SFNode),new e(s.inputOutput,"coord",new t.SFNode)]),getTypeName:function(){return"IndexedLineSet"},getComponentName:function(){return"Rendering"},getContainerField:function(){return"geometry"},initialize:function(){n.prototype.initialize.call(this),this.set_colorIndex_.addFieldInterest(this.colorIndex_),this.set_coordIndex_.addFieldInterest(this.coordIndex_),this.attrib_.addInterest("set_attrib__",this),this.fogCoord_.addInterest("set_fogCoord__",this),this.color_.addInterest("set_color__",this),this.coord_.addInterest("set_coord__",this),this.setPrimitiveMode(this.getBrowser().getContext().LINES),this.setSolid(!1),this.set_attrib__(),this.set_fogCoord__(),this.set_color__(),this.set_coord__()},set_attrib__:function(){const t=this.getAttrib();for(var e=0,i=t.length;e<i;++e)t[e].removeInterest("requestRebuild",this);t.length=0;for(var e=0,i=this.attrib_.length;e<i;++e){const i=r(s.X3DVertexAttributeNode,this.attrib_[e]);i&&t.push(i)}for(var e=0;e<this.attribNodes.length;++e)t[e].addInterest("requestRebuild",this)},set_fogCoord__:function(){this.fogCoordNode&&this.fogCoordNode.removeInterest("requestRebuild",this),this.fogCoordNode=r(s.FogCoordinate,this.fogCoord_),this.fogCoordNode&&this.fogCoordNode.addInterest("requestRebuild",this)},set_color__:function(){this.colorNode&&(this.colorNode.removeInterest("requestRebuild",this),this.colorNode.transparent_.removeInterest("set_transparent__",this)),this.colorNode=r(s.X3DColorNode,this.color_),this.colorNode?(this.colorNode.addInterest("requestRebuild",this),this.colorNode.transparent_.addInterest("set_transparent__",this),this.set_transparent__()):this.setTransparent(!1)},set_transparent__:function(){this.setTransparent(this.colorNode.getTransparent())},set_coord__:function(){this.coordNode&&this.coordNode.removeInterest("requestRebuild",this),this.coordNode=r(s.X3DCoordinateNode,this.coord_),this.coordNode&&this.coordNode.addInterest("requestRebuild",this)},getColorPerVertexIndex:function(t){return t<this.colorIndex_.length?this.colorIndex_[t]:this.coordIndex_[t]},getColorIndex:function(t){return t<this.colorIndex_.length?this.colorIndex_[t]:t},getPolylineIndices:function(){const t=this.coordIndex_,e=[];var i=[];if(t.length){for(var n=0,r=t.length;n<r;++n){const r=t[n];r>=0?i.push(n):(e.push(i),i=[])}t[t.length-1]>=0&&e.push(i)}return e},build:function(){if(this.coordNode&&!this.coordNode.isEmpty()){const u=this.coordIndex_,l=this.getPolylineIndices(),c=this.colorPerVertex_.getValue(),h=this.getAttrib(),d=h.length,p=this.getAttribs(),f=this.fogCoordNode,g=this.colorNode,m=this.coordNode,_=this.getFogDepths(),x=this.getColors(),y=this.getVertices();for(var t=0,e=0,i=l.length;e<i;++e){const i=l[e];if(i.length>1)for(var n=0,r=i.length-1;n<r;++n)for(var s=n,o=n+2;s<o;++s){const e=i[s],n=u[e];for(var a=0;a<d;++a)h[a].addValue(n,p[a]);f&&f.addDepth(n,_),g&&(c?g.addColor(this.getColorPerVertexIndex(e),x):g.addColor(this.getColorIndex(t),x)),m.addPoint(n,y)}++t}}}}),o}),define("x_ite/Components/Rendering/X3DGeometricPropertyNode",["x_ite/Components/Core/X3DNode","x_ite/Bits/X3DConstants"],function(t,e){"use strict";function i(i){t.call(this,i),this.addType(e.X3DGeometricPropertyNode)}return i.prototype=Object.assign(Object.create(t.prototype),{constructor:i}),i}),define("x_ite/Components/Rendering/X3DColorNode",["x_ite/Fields","x_ite/Components/Rendering/X3DGeometricPropertyNode","x_ite/Bits/X3DConstants"],function(t,e,i){"use strict";function n(n){e.call(this,n),this.addType(i.X3DColorNode),this.addChildObjects("transparent",new t.SFBool),this.transparent_.setAccessType(i.outputOnly)}return n.prototype=Object.assign(Object.create(e.prototype),{constructor:n,setTransparent:function(t){t!==this.transparent_.getValue()&&(this.transparent_=t)},getTransparent:function(){return this.transparent_.getValue()}}),n}),define("x_ite/Components/Rendering/Color",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Rendering/X3DColorNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector4"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.Color)}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"color",new t.MFColor)]),getTypeName:function(){return"Color"},getComponentName:function(){return"Rendering"},getContainerField:function(){return"color"},initialize:function(){n.prototype.initialize.call(this),this.color_.addInterest("set_color__",this),this.set_color__()},set_color__:function(){this.color=this.color_.getValue(),this.length=this.color_.length},addColor:function(t,e){if(t>=0&&t<this.length){const i=this.color;t*=3,e.push(i[t],i[t+1],i[t+2],1)}else if(this.length){const i=this.color;t=3*(this.length-1),e.push(i[t],i[t+1],i[t+2],1)}else e.push(1,1,1,1)},addColors:function(t,e){if(this.length){const r=this.color;for(var i=0,n=3*this.length;i<n;i+=3)t.push(r[i],r[i+1],r[i+2],1);var i=3*(this.length-1);const s=r[i],o=r[i+1],a=r[i+2];for(var i=n,n=3*e;i<n;i+=3)t.push(s,o,a,1)}else for(var i=0;i<e;++i)t.push(1,1,1,1)},getVectors:function(t){const e=this.color_;for(var i=0,n=e.length;i<n;++i){var r=e[i];t[i]=new s(r.r,r.g,r.b,1)}return t.length=n,t}}),o}),define("x_ite/Components/Rendering/X3DCoordinateNode",["x_ite/Components/Rendering/X3DGeometricPropertyNode","x_ite/Bits/X3DConstants","standard/Math/Geometry/Triangle3","standard/Math/Numbers/Vector3"],function(t,e,i,n){"use strict";function r(i){t.call(this,i),this.addType(e.X3DCoordinateNode)}return r.prototype=Object.assign(Object.create(t.prototype),{constructor:r,initialize:function(){t.prototype.initialize.call(this),this.point_.addInterest("set_point__",this),this.set_point__()},set_point__:function(){this.point=this.point_.getValue(),this.length=this.point_.length},isEmpty:function(){return 0===this.length},getSize:function(){return this.length},set1Point:function(t,e){this.point_[t]=e},get1Point:function(t,e){if(t<this.length){const i=this.point;return t*=3,e.set(i[t],i[t+1],i[t+2])}return e.set(0,0,0)},addPoint:function(t,e){if(t<this.length){const i=this.point;t*=3,e.push(i[t],i[t+1],i[t+2],1)}else e.push(0,0,0,1)},addPoints:function(t,e){const i=this.point;for(var n=0,r=3*this.length;n<r;n+=3)t.push(i[n],i[n+1],i[n+2],1);for(var n=r,r=3*e;n<r;n+=3)t.push(0,0,0,1)},getNormal:function(){const t=new n(0,0,0),e=new n(0,0,0),r=new n(0,0,0);return function(s,o,a){const u=this.length;return s<u&&o<u&&a<u?i.normal(this.get1Point(s,t),this.get1Point(o,e),this.get1Point(a,r),new n(0,0,0)):new n(0,0,0)}}(),getQuadNormal:function(){const t=new n(0,0,0),e=new n(0,0,0),r=new n(0,0,0),s=new n(0,0,0);return function(o,a,u,l){const c=this.length;return o<c&&a<c&&u<c&&l<c?i.quadNormal(this.get1Point(o,t),this.get1Point(a,e),this.get1Point(u,r),this.get1Point(l,s),new n(0,0,0)):new n(0,0,0)}}()}),r}),define("x_ite/Components/Rendering/Coordinate",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Rendering/X3DCoordinateNode","x_ite/Bits/X3DConstants"],function(t,e,i,n,r){"use strict";function s(t){n.call(this,t),this.addType(r.Coordinate),this.point_.setUnit("length")}return s.prototype=Object.assign(Object.create(n.prototype),{constructor:s,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"point",new t.MFVec3f)]),getTypeName:function(){return"Coordinate"},getComponentName:function(){return"Rendering"},getContainerField:function(){return"coord"}}),s}),define("x_ite/Browser/Grouping/X3DGroupingContext",["x_ite/Fields","x_ite/Components/Shape/Shape","x_ite/Components/Rendering/IndexedLineSet","x_ite/Components/Rendering/Color","x_ite/Components/Rendering/Coordinate"],function(t,e,i,n,r){"use strict";function s(){}return s.prototype={initialize:function(){},getBBoxNode:function(){const s=new e(this.getPrivateScene()),o=new i(this.getPrivateScene()),a=new n(this.getPrivateScene()),u=new r(this.getPrivateScene());return s.geometry_=o,o.coordIndex_=new t.MFFloat(0,1,2,3,0,-1,4,5,6,7,4,-1,0,4,-1,1,5,-1,2,6,-1,3,7,-1),o.color_=a,o.coord_=u,a.color_=new t.MFColor(new t.SFColor(1,1,1)),u.point_=new t.MFVec3f(new t.SFVec3f(.5,.5,.5),new t.SFVec3f(-.5,.5,.5),new t.SFVec3f(-.5,-.5,.5),new t.SFVec3f(.5,-.5,.5),new t.SFVec3f(.5,.5,-.5),new t.SFVec3f(-.5,.5,-.5),new t.SFVec3f(-.5,-.5,-.5),new t.SFVec3f(.5,-.5,-.5)),u.setup(),a.setup(),o.setup(),s.setup(),this.bboxNode=s,this.getBBoxNode=function(){return this.bboxNode},s}},s}),define("x_ite/Components/Rendering/X3DComposedGeometryNode",["x_ite/Components/Rendering/X3DGeometryNode","x_ite/Bits/X3DCast","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(t,e,i,n){"use strict";function r(e){t.call(this,e),this.addType(i.X3DComposedGeometryNode),this.fogCoordNode=null,this.colorNode=null,this.texCoordNode=null,this.normalNode=null,this.coordNode=null}return r.prototype=Object.assign(Object.create(t.prototype),{constructor:r,initialize:function(){t.prototype.initialize.call(this),this.attrib_.addInterest("set_attrib__",this),this.fogCoord_.addInterest("set_fogCoord__",this),this.color_.addInterest("set_color__",this),this.texCoord_.addInterest("set_texCoord__",this),this.normal_.addInterest("set_normal__",this),this.coord_.addInterest("set_coord__",this),this.set_attrib__(),this.set_fogCoord__(),this.set_color__(),this.set_texCoord__(),this.set_normal__(),this.set_coord__()},getFogCoord:function(){return this.fogCoordNode},getColor:function(){return this.colorNode},getTexCoord:function(){return this.texCoordNode},getNormal:function(){return this.normalNode},getCoord:function(){return this.coordNode},set_attrib__:function(){for(var t=this.getAttrib(),n=0,r=t.length;n<r;++n)t[n].removeInterest("requestRebuild",this);t.length=0;for(var n=0,r=this.attrib_.length;n<r;++n){var s=e(i.X3DVertexAttributeNode,this.attrib_[n]);s&&t.push(s)}for(var n=0;n<this.attribNodes.length;++n)t[n].addInterest("requestRebuild",this)},set_fogCoord__:function(){this.fogCoordNode&&this.fogCoordNode.removeInterest("requestRebuild",this),this.fogCoordNode=e(i.FogCoordinate,this.fogCoord_),this.fogCoordNode&&this.fogCoordNode.addInterest("requestRebuild",this)},set_color__:function(){this.colorNode&&(this.colorNode.removeInterest("requestRebuild",this),this.colorNode.transparent_.removeInterest("set_transparent__",this)),this.colorNode=e(i.X3DColorNode,this.color_),this.colorNode?(this.colorNode.addInterest("requestRebuild",this),this.colorNode.transparent_.addInterest("set_transparent__",this),this.set_transparent__()):this.setTransparent(!1)},set_transparent__:function(){this.setTransparent(this.colorNode.getTransparent())},set_texCoord__:function(){this.texCoordNode&&this.texCoordNode.removeInterest("requestRebuild",this),this.texCoordNode=e(i.X3DTextureCoordinateNode,this.texCoord_),this.texCoordNode&&this.texCoordNode.addInterest("requestRebuild",this),this.setTextureCoordinate(this.texCoordNode)},set_normal__:function(){this.normalNode&&this.normalNode.removeInterest("requestRebuild",this),this.normalNode=e(i.X3DNormalNode,this.normal_),this.normalNode&&this.normalNode.addInterest("requestRebuild",this)},set_coord__:function(){this.coordNode&&this.coordNode.removeInterest("requestRebuild",this),this.coordNode=e(i.X3DCoordinateNode,this.coord_),this.coordNode&&this.coordNode.addInterest("requestRebuild",this)},getPolygonIndex:function(t){return t},getTriangleIndex:function(t){return t},build:function(t,e,i,n){if(this.coordNode&&!this.coordNode.isEmpty()){e-=e%t,n-=n%i;const a=this.colorPerVertex_.getValue(),u=this.normalPerVertex_.getValue(),l=this.getAttrib(),c=l.length,h=this.getAttribs(),d=this.getFogCoord(),p=this.getColor(),f=this.getTexCoord(),g=this.getNormal(),m=this.getCoord(),_=this.getFogDepths(),x=this.getColors(),y=this.getMultiTexCoords(),v=this.getNormals(),w=this.getVertices();var r=0;f&&f.init(y);for(var s=0;s<n;++s){r=Math.floor(s/i);const t=this.getPolygonIndex(this.getTriangleIndex(s));for(var o=0;o<c;++o)l[o].addValue(t,h[o]);d&&d.addDepth(t,_),p&&(a?p.addColor(t,x):p.addColor(r,x)),f&&f.addTexCoord(t,y),g&&(u?g.addVector(t,v):g.addVector(r,v)),m.addPoint(t,w)}this.getNormal()||this.buildNormals(t,e,n),this.setSolid(this.solid_.getValue()),this.setCCW(this.ccw_.getValue())}},buildNormals:function(t,e,i){const n=this.createNormals(t,e),r=this.getNormals();for(var s=0;s<i;++s){const t=n[this.getTriangleIndex(s)];r.push(t.x,t.y,t.z)}},createNormals:function(t,e){const i=this.createFaceNormals(t,e);if(this.normalPerVertex_.getValue()){const t=[];for(var n=0;n<e;++n){const e=this.getPolygonIndex(n);var r=t[e];r||(r=t[e]=[]),r.push(n)}return this.refineNormals(t,i,Math.PI)}return i},createFaceNormals:function(t,e){const i=!this.ccw_.getValue(),n=this.coordNode,r=[];for(var s=0;s<e;s+=t){const e=this.getPolygonNormal(s,t,n);i&&e.negate();for(var o=0;o<t;++o)r.push(e)}return r},getPolygonNormal:function(){var t=new n(0,0,0),e=new n(0,0,0);return function(i,r,s){const o=new n(0,0,0);s.get1Point(this.getPolygonIndex(i),e);for(var a=0;a<r;++a){const n=t;t=e,e=n,s.get1Point(this.getPolygonIndex(i+(a+1)%r),e),o.x+=(t.y-e.y)*(t.z+e.z),o.y+=(t.z-e.z)*(t.x+e.x),o.z+=(t.x-e.x)*(t.y+e.y)}return o.normalize()}}()}),r}),define("x_ite/Components/Geometry3D/IndexedFaceSet",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Rendering/X3DComposedGeometryNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector3","standard/Math/Numbers/Matrix4","standard/Math/Geometry/Triangle3"],function(t,e,i,n,r,s,o,a){"use strict";function u(t){n.call(this,t),this.addType(r.IndexedFaceSet),this.creaseAngle_.setUnit("angle")}return u.prototype=Object.assign(Object.create(n.prototype),{constructor:u,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOnly,"set_colorIndex",new t.MFInt32),new e(r.inputOnly,"set_texCoordIndex",new t.MFInt32),new e(r.inputOnly,"set_normalIndex",new t.MFInt32),new e(r.inputOnly,"set_coordIndex",new t.MFInt32),new e(r.initializeOnly,"solid",new t.SFBool(!0)),new e(r.initializeOnly,"ccw",new t.SFBool(!0)),new e(r.initializeOnly,"convex",new t.SFBool(!0)),new e(r.initializeOnly,"creaseAngle",new t.SFFloat),new e(r.initializeOnly,"colorPerVertex",new t.SFBool(!0)),new e(r.initializeOnly,"normalPerVertex",new t.SFBool(!0)),new e(r.initializeOnly,"colorIndex",new t.MFInt32),new e(r.initializeOnly,"texCoordIndex",new t.MFInt32),new e(r.initializeOnly,"normalIndex",new t.MFInt32),new e(r.initializeOnly,"coordIndex",new t.MFInt32),new e(r.inputOutput,"attrib",new t.MFNode),new e(r.inputOutput,"fogCoord",new t.SFNode),new e(r.inputOutput,"color",new t.SFNode),new e(r.inputOutput,"texCoord",new t.SFNode),new e(r.inputOutput,"normal",new t.SFNode),new e(r.inputOutput,"coord",new t.SFNode)]),getTypeName:function(){return"IndexedFaceSet"},getComponentName:function(){return"Geometry3D"},getContainerField:function(){return"geometry"},initialize:function(){n.prototype.initialize.call(this),this.set_colorIndex_.addFieldInterest(this.colorIndex_),this.set_texCoordIndex_.addFieldInterest(this.texCoordIndex_),this.set_normalIndex_.addFieldInterest(this.normalIndex_),this.set_coordIndex_.addFieldInterest(this.coordIndex_)},getTexCoordPerVertexIndex:function(t){return t<this.texCoordIndex_.length?this.texCoordIndex_[t]:this.coordIndex_[t]},getColorPerVertexIndex:function(t){return t<this.colorIndex_.length?this.colorIndex_[t]:this.coordIndex_[t]},getColorIndex:function(t){return t<this.colorIndex_.length?this.colorIndex_[t]:t},getNormalPerVertexIndex:function(t){return t<this.normalIndex_.length?this.normalIndex_[t]:this.coordIndex_[t]},getNormalIndex:function(t){return t<this.normalIndex_.length?this.normalIndex_[t]:t},build:function(){var t=this.triangulate();if(0!==t.length){var e=this.colorPerVertex_.getValue(),i=this.normalPerVertex_.getValue(),n=this.coordIndex_.getValue(),r=this.getAttrib(),s=r.length,o=this.getAttribs(),a=this.getFogCoord(),u=this.getColor(),l=this.getTexCoord(),c=this.getNormal(),h=this.getCoord(),d=this.getFogDepths(),p=this.getColors(),f=this.getMultiTexCoords(),g=this.getNormals(),m=this.getVertices();l&&l.init(f);for(var _=0,x=t.length;_<x;++_){for(var y=t[_],v=y.triangles,w=y.face,b=0,S=v.length;b<S;++b){for(var C=v[b],T=n[C],F=0;F<s;++F)r[F].addValue(T,o[F]);a&&a.addDepth(T,d),u&&(e?u.addColor(this.getColorPerVertexIndex(C),p):u.addColor(this.getColorIndex(w),p)),l&&l.addTexCoord(this.getTexCoordPerVertexIndex(C),f),c&&(i?c.addVector(this.getNormalPerVertexIndex(C),g):c.addVector(this.getNormalIndex(w),g)),h.addPoint(T,m)}++w}this.getNormal()||this.buildNormals(t),this.setSolid(this.solid_.getValue()),this.setCCW(this.ccw_.getValue())}},triangulate:function(){var t=this.convex_.getValue(),e=this.coordIndex_.length,i=[];if(!this.getCoord())return i;if(e){this.coordIndex_[e-1]>-1&&this.coordIndex_.push(-1);for(var n=this.coordIndex_.getValue(),e=this.coordIndex_.length,r=[],s=0,o=0;o<e;++o){if(n[o]>-1)r.push(o);else{if(r.length)switch(r.length){case 0:case 1:case 2:r.length=0;break;case 3:i.push({vertices:r,triangles:r,face:s}),r=[];break;default:var a=[],u={vertices:r,triangles:a,face:s};t?this.triangulateConvexPolygon(r,a):this.triangulatePolygon(r,a),a.length<3?r.length=0:(i.push(u),r=[])}++s}}}return i},triangulatePolygon:function(){var t=[];return function(e,i){for(var n=this.coordIndex_.getValue(),r=this.getCoord(),o=0,u=e.length;o<u;++o){var l=t[o],c=e[o];l||(l=t[o]=new s(0,0,0)),l.index=c,r.get1Point(n[c],l)}t.length=u,a.triangulatePolygon(t,i);for(var c=0,u=i.length;c<u;++c)i[c]=i[c].index}}(),triangulateConvexPolygon:function(t,e){for(var i=1,n=t.length-1;i<n;++i)e.push(t[0],t[i],t[i+1])},buildNormals:function(t){for(var e=this.createNormals(t),i=this.getNormals(),n=0,r=t.length;n<r;++n)for(var s=t[n].triangles,o=0,a=s.length;o<a;++o){var u=e[s[o]];i.push(u.x,u.y,u.z)}},createNormals:function(){var t=[],e=[];return function(i){var n=!this.ccw_.getValue(),r=this.coordIndex_.getValue(),s=this.getCoord(),o=null;t.length=0,e.length=0;for(var a=0,u=i.length;a<u;++a){var l=i[a],c=l.vertices,h=c.length;switch(h){case 3:o=s.getNormal(r[c[0]],r[c[1]],r[c[2]]);break;case 4:o=s.getQuadNormal(r[c[0]],r[c[1]],r[c[2]],r[c[3]]);break;default:o=this.getPolygonNormal(c,r,s)}for(var d=0;d<h;++d){var p=c[d],f=r[p],g=e[f];g||(g=e[f]=[]),g.push(p)}n&&o.negate();for(var d=0;d<h;++d)t[c[d]]=o}return this.refineNormals(e,t,this.creaseAngle_.getValue())}}(),getPolygonNormal:function(){var t=new s(0,0,0),e=new s(0,0,0);return function(i,n,r){var o=new s(0,0,0);r.get1Point(n[i[0]],e);for(var a=0,u=i.length;a<u;++a){var l=t;t=e,e=l,r.get1Point(n[i[(a+1)%u]],e),o.x+=(t.y-e.y)*(t.z+e.z),o.y+=(t.z-e.z)*(t.x+e.x),o.z+=(t.x-e.x)*(t.y+e.y)}return o.normalize()}}()}),u}),define("x_ite/Components/Texturing/X3DTextureCoordinateNode",["x_ite/Components/Rendering/X3DGeometricPropertyNode","x_ite/Bits/X3DConstants"],function(t,e){"use strict";function i(i){t.call(this,i),this.addType(e.X3DTextureCoordinateNode)}return i.prototype=Object.assign(Object.create(t.prototype),{constructor:i,setShaderUniformsToChannel:function(t,e,i){t.uniform1i(e.x3d_TextureCoordinateGeneratorMode[i],0)}}),i}),define("x_ite/Components/Texturing/X3DSingleTextureCoordinateNode",["x_ite/Components/Texturing/X3DTextureCoordinateNode","x_ite/Components/Rendering/X3DGeometryNode","x_ite/Bits/X3DConstants"],function(t,e,i){"use strict";function n(n){t.call(this,n),this.addType(i.X3DSingleTextureCoordinateNode),this.texCoordArray=e.createArray()}return n.prototype=Object.assign(Object.create(t.prototype),{constructor:n,init:function(t){this.texCoordArray.length=0,t.push(this.texCoordArray)},addTexCoord:function(t,e){this.addTexCoordToChannel(t,e[0])},setShaderUniforms:function(t,e){for(let i=0,n=e.x3d_MaxTextures;i<n;++i)this.setShaderUniformsToChannel(t,e,i)}}),n}),define("x_ite/Components/Texturing/TextureCoordinate",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Texturing/X3DSingleTextureCoordinateNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector4"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.TextureCoordinate)}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"mapping",new t.SFString),new e(r.inputOutput,"point",new t.MFVec2f)]),getTypeName:function(){return"TextureCoordinate"},getComponentName:function(){return"Texturing"},getContainerField:function(){return"texCoord"},initialize:function(){n.prototype.initialize.call(this),this.point_.addInterest("set_point__",this),this.set_point__()},set_point__:function(){this.point=this.point_.getValue(),this.length=this.point_.length},isEmpty:function(){return 0===this.length},getSize:function(){return this.length},get1Point:function(t,e){if(t>=0&&t<this.length){const i=this.point;return t*=2,e.set(i[t],i[t+1],0,1)}if(t>=0&&this.length){const i=this.point;return t%=this.length,t*=2,e.set(i[t],i[t+1],0,1)}return e.set(0,0,0,1)},addTexCoordToChannel:function(t,e){if(t>=0&&t<this.length){const i=this.point;t*=2,e.push(i[t],i[t+1],0,1)}else if(t>=0&&this.length){const i=this.point;t%=this.length,t*=2,e.push(i[t],i[t+1],0,1)}else e.push(0,0,0,1)},getTexCoord:function(t){const e=this.point;for(let i=0,n=0,r=this.length;i<r;++i,n+=2)t[i]=new s(e[n],e[n+1],0,1);return t.length=this.length,t}}),o}),
|
|
27
|
-
define("x_ite/Browser/Geometry3D/BoxOptions",["x_ite/Fields","x_ite/Basic/X3DBaseNode","x_ite/Components/Geometry3D/IndexedFaceSet","x_ite/Components/Rendering/Coordinate","x_ite/Components/Texturing/TextureCoordinate"],function(t,e,i,n,r){"use strict";function s(t){e.call(this,t)}return s.prototype=Object.assign(Object.create(e.prototype),{constructor:s,getTypeName:function(){return"BoxOptions"},getComponentName:function(){return"X_ITE"},getContainerField:function(){return"boxOptions"},initialize:function(){e.prototype.initialize.call(this)},getGeometry:function(){if(this.geometry)return this.geometry;this.geometry=new i(this.getExecutionContext()),this.geometry.texCoord_=new r(this.getExecutionContext()),this.geometry.coord_=new n(this.getExecutionContext());var e=this.geometry,s=this.geometry.texCoord_.getValue(),o=this.geometry.coord_.getValue();return e.texCoordIndex_=new t.MFInt32(0,1,2,3,-1,0,1,2,3,-1,0,1,2,3,-1,0,1,2,3,-1,0,1,2,3,-1,0,1,2,3,-1),e.coordIndex_=new t.MFInt32(0,1,2,3,-1,5,4,7,6,-1,1,5,6,2,-1,4,0,3,7,-1,4,5,1,0,-1,3,2,6,7,-1),s.point_=new t.MFVec2f(new t.SFVec2f(1,1),new t.SFVec2f(0,1),new t.SFVec2f(0,0),new t.SFVec2f(1,0)),o.point_=new t.MFVec3f(new t.SFVec3f(1,1,1),new t.SFVec3f(-1,1,1),new t.SFVec3f(-1,-1,1),new t.SFVec3f(1,-1,1),new t.SFVec3f(1,1,-1),new t.SFVec3f(-1,1,-1),new t.SFVec3f(-1,-1,-1),new t.SFVec3f(1,-1,-1)),s.setup(),o.setup(),e.setup(),this.geometry}}),s}),define("x_ite/Browser/Geometry3D/ConeOptions",["x_ite/Fields","x_ite/Basic/X3DBaseNode"],function(t,e){"use strict";function i(i){e.call(this,i),this.addChildObjects("xDimension",new t.SFInt32(20),"yDimension",new t.SFInt32(1))}return i.prototype=Object.assign(Object.create(e.prototype),{constructor:i,getTypeName:function(){return"ConeOptions"},getComponentName:function(){return"X_ITE"},getContainerField:function(){return"coneOptions"}}),i}),define("x_ite/Browser/Geometry3D/CylinderOptions",["x_ite/Fields","x_ite/Basic/X3DBaseNode"],function(t,e){"use strict";function i(i){e.call(this,i),this.addChildObjects("xDimension",new t.SFInt32(20),"yDimension",new t.SFInt32(1))}return i.prototype=Object.assign(Object.create(e.prototype),{constructor:i,getTypeName:function(){return"CylinderOptions"},getComponentName:function(){return"X_ITE"},getContainerField:function(){return"cylinderOptions"}}),i}),define("x_ite/Browser/Geometry3D/QuadSphereOptions",["x_ite/Fields","x_ite/Basic/X3DBaseNode","x_ite/Components/Geometry3D/IndexedFaceSet","x_ite/Components/Rendering/Coordinate","x_ite/Components/Texturing/TextureCoordinate","standard/Math/Numbers/Complex","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3"],function(t,e,i,n,r,s,o,a){"use strict";function u(i){e.call(this,i),this.addChildObjects("xDimension",new t.SFInt32(32),"yDimension",new t.SFInt32(15))}return u.prototype=Object.assign(Object.create(e.prototype),{constructor:u,getTypeName:function(){return"QuadSphereOptions"},getComponentName:function(){return"X_ITE"},getContainerField:function(){return"quadSphereOptions"},initialize:function(){e.prototype.initialize.call(this),this.addInterest("eventsProcessed",this)},getGeometry:function(){return this.geometry||this.eventsProcessed(),this.geometry},createTexCoordIndex:function(){for(var t=this.xDimension_.getValue()+1,e=this.yDimension_.getValue(),i=this.geometry.texCoordIndex_,n=0,r=t-1;n<r;++n)i.push(n),i.push(n+t-1),i.push(n+t),i.push(-1);for(var s=t-1,o=0,a=e-3;o<a;++o,++s)for(var n=0,r=t-1;n<r;++n,++s)i.push(s),i.push(s+t),i.push(s+t+1),i.push(s+1),i.push(-1);for(var s=(e-2)*t-1,n=0,r=t-1;n<r;++n,++s)i.push(s+t),i.push(s+1),i.push(s),i.push(-1)},createTexCoord:function(){for(var t=this.xDimension_.getValue()+1,e=this.yDimension_.getValue(),i=this.geometry.texCoord_.getValue().point_,n=-.5/(t-1),r=1;r<t;++r){var s=r/(t-1)+n;i.push(new o(s,1))}for(var a=1,u=e-1;a<u;++a)for(var l=1-a/(e-1),r=0;r<t;++r){var s=r/(t-1);i.push(new o(s,l))}for(var r=1;r<t;++r){var s=r/(t-1)+n;i.push(new o(s,0))}},createCoordIndex:function(){for(var t=this.xDimension_.getValue()+1,e=this.yDimension_.getValue(),i=this.geometry.coordIndex_,n=1,r=t-1;n<r;++n)i.push(0),i.push(n),i.push(n+1),i.push(-1);i.push(0),i.push(n),i.push(1),i.push(-1);for(var s=1,o=0,a=e-3;o<a;++o,++s){for(var n=0,r=t-2;n<r;++n,++s)i.push(s),i.push(s+t-1),i.push(s+t),i.push(s+1),i.push(-1);i.push(s),i.push(s+t-1),i.push(s+1),i.push(s-t+2),i.push(-1)}for(var u=s+t-1,n=0,r=t-2;n<r;++n,++s)i.push(u),i.push(s+1),i.push(s),i.push(-1);i.push(u),i.push(u-t+1),i.push(s),i.push(-1)},createPoints:function(){var t=this.xDimension_.getValue()+1,e=this.yDimension_.getValue(),i=this.geometry.coord_.getValue().point_;i.push(new a(0,1,0));for(var n=1,r=e-1;n<r;++n)for(var o=s.Polar(1,-Math.PI*n/r),u=0,l=t-1;u<l;++u){var c=s.Polar(o.imag,2*Math.PI*u/l);i.push(new a(c.imag,o.real,c.real))}i.push(new a(0,-1,0))},eventsProcessed:function(){this.geometry=new i(this.getExecutionContext()),this.geometry.texCoord_=new r(this.getExecutionContext()),this.geometry.coord_=new n(this.getExecutionContext()),this.createTexCoordIndex(),this.createTexCoord(),this.createCoordIndex(),this.createPoints();var t=this.geometry,e=this.geometry.texCoord_.getValue(),s=this.geometry.coord_.getValue();t.creaseAngle_=Math.PI,e.setup(),s.setup(),t.setup()}}),u}),define("x_ite/Browser/Geometry3D/X3DGeometry3DContext",["x_ite/Browser/Geometry3D/BoxOptions","x_ite/Browser/Geometry3D/ConeOptions","x_ite/Browser/Geometry3D/CylinderOptions","x_ite/Browser/Geometry3D/QuadSphereOptions"],function(t,e,i,n){"use strict";function r(t,e,i){return this[e]=new i(this.getPrivateScene()),this[e].setup(),this[t]=function(){return this[e]},this[e]}function s(){}return s.prototype={initialize:function(){},getBoxOptions:function(){return r.call(this,"getBoxOptions","boxOptions",t)},getConeOptions:function(){return r.call(this,"getConeOptions","coneOptions",e)},getCylinderOptions:function(){return r.call(this,"getCylinderOptions","cylinderOptions",i)},getSphereOptions:function(){return r.call(this,"getSphereOptions","sphereOptions",n)}},s}),define("x_ite/Browser/PointingDeviceSensor/PointingDevice",["jquery","x_ite/Basic/X3DBaseNode"],function(t,e){"use strict";function i(t){e.call(this,t),this.cursor="DEFAULT",this.isOver=!1,this.motionTime=0}return i.prototype=Object.assign(Object.create(e.prototype),{constructor:i,getTypeName:function(){return"PointingDevice"},initialize:function(){var t=this.getBrowser().getSurface();t.bind("mousedown.PointingDevice"+this.getId(),this.mousedown.bind(this)),t.bind("mouseup.PointingDevice"+this.getId(),this.mouseup.bind(this)),t.bind("dblclick.PointingDevice"+this.getId(),this.dblclick.bind(this)),t.bind("mousemove.PointingDevice"+this.getId(),this.mousemove.bind(this)),t.bind("mouseout.PointingDevice"+this.getId(),this.onmouseout.bind(this)),t.bind("touchstart.PointingDevice"+this.getId(),this.touchstart.bind(this)),t.bind("touchend.PointingDevice"+this.getId(),this.touchend.bind(this))},mousewheel:function(t){},mousedown:function(e){var i=this.getBrowser();if(i.getElement().focus(),!(i.getShiftKey()&&i.getControlKey()||0!==e.button)){var n=i.getSurface(),r=n.offset(),s=e.pageX-r.left-parseFloat(n.css("borderLeftWidth")),o=n.innerHeight()-(e.pageY-r.top-parseFloat(n.css("borderTopWidth")));n.unbind("mousemove.PointingDevice"+this.getId()),t(document).bind("mouseup.PointingDevice"+this.getId(),this.mouseup.bind(this)),t(document).bind("mousemove.PointingDevice"+this.getId(),this.mousemove.bind(this)),t(document).bind("touchend.PointingDevice"+this.getId(),this.touchend.bind(this)),t(document).bind("touchmove.PointingDevice"+this.getId(),this.touchmove.bind(this)),i.buttonPressEvent(s,o)&&(e.preventDefault(),e.stopImmediatePropagation(),i.setCursor("HAND"),i.finished().addInterest("onverifymotion",this,s,o))}},mouseup:function(e){if(e.preventDefault(),0===e.button){var i=this.getBrowser(),n=i.getSurface(),r=n.offset(),s=e.pageX-r.left-parseFloat(n.css("borderLeftWidth")),o=n.innerHeight()-(e.pageY-r.top-parseFloat(n.css("borderTopWidth")));t(document).unbind(".PointingDevice"+this.getId()),n.bind("mousemove.PointingDevice"+this.getId(),this.mousemove.bind(this)),i.buttonReleaseEvent(),i.setCursor(this.isOver?"HAND":"DEFAULT"),i.finished().addInterest("onverifymotion",this,s,o),i.addBrowserEvent(),this.cursor="DEFAULT"}},dblclick:function(t){this.isOver&&t.stopImmediatePropagation()},mousemove:function(t){t.preventDefault();var e=this.getBrowser();if(this.motionTime!==e.getCurrentTime()){this.motionTime=e.getCurrentTime();var i=e.getSurface(),n=i.offset(),r=t.pageX-n.left-parseFloat(i.css("borderLeftWidth")),s=i.innerHeight()-(t.pageY-n.top-parseFloat(i.css("borderTopWidth")));this.onmotion(r,s)}},touchstart:function(t){var e=t.originalEvent.touches;switch(e.length){case 1:t.button=0,t.pageX=e[0].pageX,t.pageY=e[0].pageY,this.mousedown(t);break;case 2:this.touchend(t)}},touchend:function(t){t.button=0,this.mouseup(t)},touchmove:function(t){var e=t.originalEvent.touches;switch(e.length){case 1:t.button=0,t.pageX=e[0].pageX,t.pageY=e[0].pageY,this.mousemove(t)}},onmotion:function(t,e){var i=this.getBrowser();i.motionNotifyEvent(t,e)?this.isOver||(this.isOver=!0,this.cursor=i.getCursor(),i.setCursor("HAND")):this.isOver&&(this.isOver=!1,i.setCursor(this.cursor))},onmouseout:function(t){this.getBrowser().leaveNotifyEvent()},onverifymotion:function(t,e,i){this.getBrowser().finished().removeInterest("onverifymotion",this),this.onmotion(e,i)}}),i}),define("x_ite/Browser/PointingDeviceSensor/X3DPointingDeviceSensorContext",["jquery","x_ite/Browser/PointingDeviceSensor/PointingDevice","x_ite/Bits/TraverseType","x_ite/Bits/X3DConstants","standard/Math/Geometry/Line3","standard/Math/Geometry/ViewVolume","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3","standard/Math/Numbers/Matrix4","standard/Math/Algorithms/MergeSort","standard/Math/Algorithm"],function(t,e,i,n,r,s,o,a,u,l,c){"use strict";function h(){this.pointingDevice=new e(this),this.pointer=new o(0,0),this.hitRay=new r(a.Zero,a.Zero),this.hits=[],this.enabledSensors=[{}],this.selectedLayer=null,this.overSensors={},this.activeSensors={},this.hitPointSorter=new l(this.hits,function(t,e){return t.intersection.point.z<e.intersection.point.z}),this.layerSorter=new l(this.hits,function(t,e){return t.layerNumber<e.layerNumber}),this.pointerTime=0}var d=new r(a.Zero,a.Zero);return h.prototype={initialize:function(){this.getElement().attr("tabindex",this.getElement().attr("tabindex")||0),this.setCursor("DEFAULT"),this.pointingDevice.setup()},setCursor:function(t){this.cursorType=t;var e=this.getSurface();switch(t){case"HAND":e.css("cursor","pointer");break;case"MOVE":e.css("cursor","move");break;case"CROSSHAIR":e.css("cursor","crosshair");break;default:this.loadCount_.getValue()?e.css("cursor","wait"):this.pointingDevice&&this.pointingDevice.isOver?e.css("cursor","pointer"):e.css("cursor","default")}},getCursor:function(){return this.cursorType},isPointerInRectangle:function(t){return this.pointer.x>t.x&&this.pointer.x<t.x+t.z&&this.pointer.y>t.y&&this.pointer.y<t.y+t.w},setLayerNumber:function(t){this.layerNumber=t},getSelectedLayer:function(){return this.selectedLayer},setHitRay:function(t,e){try{s.unProjectRay(this.pointer.x,this.pointer.y,u.Identity,t,e,this.hitRay)}catch(t){this.hitRay.set(a.Zero,a.Zero)}},getHitRay:function(){return this.hitRay},getSensors:function(){return this.enabledSensors},addHit:function(t,e,i,n){this.hits.push({pointer:this.pointer,hitRay:this.hitRay.copy(),intersection:t,sensors:this.enabledSensors.at(-1),layer:e,layerNumber:this.layerNumber,shape:i,modelViewMatrix:n.copy()})},getHits:function(){return this.hits},getNearestHit:function(){return this.hits.at(-1)},buttonPressEvent:function(e,i){if(this.touch(e,i),0===this.hits.length)return!1;var n=this.getNearestHit();this.selectedLayer=n.layer,this.activeSensors=n.sensors;for(var r in this.activeSensors)this.activeSensors[r].set_active__(!0,n);return!t.isEmptyObject(n.sensors)},buttonReleaseEvent:function(){this.selectedLayer=null;for(var t in this.activeSensors)this.activeSensors[t].set_active__(!1,null);return this.activeSensors={},!0},motionNotifyEvent:function(e,i){return this.touch(e,i),this.motion(),this.hits.length&&!t.isEmptyObject(this.hits.at(-1).sensors)},leaveNotifyEvent:function(){},touch:function(t,e){if(this.getViewer().isActive_.getValue())return void(this.pointerTime=0);var n=performance.now();this.pointer.set(t,e),this.hits.length=0,this.getWorld().traverse(i.POINTER,null),this.hitPointSorter.sort(0,this.hits.length),this.layerSorter.sort(0,this.hits.length),this.addBrowserEvent(),this.pointerTime=performance.now()-n},motion:function(){if(this.hits.length)var t=this.hits.at(-1);else var e=this.selectedLayer?this.hitRay:d,t={pointer:this.pointer,modelViewMatrix:new u,hitRay:e,intersection:null,sensors:{},shape:null,layer:null,layerNumber:0};if(this.hits.length)var i=c.set_difference(this.overSensors,t.sensors,{},function(t,e){return t.getNode()<e.getNode()});else var i=Object.assign({},this.overSensors);for(var n in i)i[n].set_over__(!1,t);if(this.hits.length){this.overSensors=t.sensors;for(var n in this.overSensors)this.overSensors[n].set_over__(!0,t)}else this.overSensors={};for(var n in this.activeSensors)this.activeSensors[n].set_motion__(t)}},h}),define("x_ite/Components/Followers/PositionChaser",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Followers/X3DChaserNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.PositionChaser)}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOnly,"set_value",new t.SFVec3f),new e(r.inputOnly,"set_destination",new t.SFVec3f),new e(r.initializeOnly,"initialValue",new t.SFVec3f),new e(r.initializeOnly,"initialDestination",new t.SFVec3f),new e(r.initializeOnly,"duration",new t.SFTime(1)),new e(r.outputOnly,"isActive",new t.SFBool),new e(r.outputOnly,"value_changed",new t.SFVec3f)]),getTypeName:function(){return"PositionChaser"},getComponentName:function(){return"Followers"},getContainerField:function(){return"children"},getVector:function(){return new s(0,0,0)}}),o}),define("x_ite/Browser/Navigation/ExamineViewer",["jquery","x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Bits/X3DConstants","x_ite/Browser/Navigation/X3DViewer","x_ite/Components/Followers/PositionChaser","x_ite/Components/Followers/OrientationChaser","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","jquery-mousewheel"],function(t,e,i,n,r,s,o,a,u,l,c){"use strict";function h(t){s.call(this,t),this.button=-1,this.orientationOffset=new c(0,0,1,0),this.fromVector=new l(0,0,0),this.toVector=new l(0,0,0),this.fromPoint=new l(0,0,0),this.toPoint=new l(0,0,0),this.rotation=new c(0,0,1,0),this.pressTime=0,this.motionTime=0,this.touchMode=0,this.touch1=new u(0,0),this.touch2=new u(0,0),this.tapStart=0,this.dblTapInterval=.4,this.initialPositionOffset=new l(0,0,0),this.initialOrientationOffset=new c(0,0,1,0),this.positionChaser=new o(t),this.centerOfRotationChaser=new o(t),this.rotationChaser=new a(t)}var d=/Mac OS X/i.test(navigator.userAgent),p=d?1/120:.05;return h.prototype=Object.assign(Object.create(s.prototype),{constructor:h,fieldDefinitions:new n([new i(r.outputOnly,"isActive",new e.SFBool)]),initialize:function(){s.prototype.initialize.call(this);var t=this.getBrowser(),e=t.getSurface();this.getNavigationInfo().transitionStart_.addInterest("disconnect",this),t.activeViewpoint_.addInterest("set_activeViewpoint__",this),e.bind("mousedown.ExamineViewer",this.mousedown.bind(this)),e.bind("mouseup.ExamineViewer",this.mouseup.bind(this)),e.bind("dblclick.ExamineViewer",this.dblclick.bind(this)),e.bind("mousewheel.ExamineViewer",this.mousewheel.bind(this)),e.bind("touchstart.ExamineViewer",this.touchstart.bind(this)),e.bind("touchend.ExamineViewer",this.touchend.bind(this)),this.positionChaser.duration_=.2,this.positionChaser.setPrivate(!0),this.positionChaser.setup(),this.centerOfRotationChaser.duration_=.2,this.centerOfRotationChaser.setPrivate(!0),this.centerOfRotationChaser.setup(),this.rotationChaser.duration_=.2,this.rotationChaser.setPrivate(!0),this.rotationChaser.setup(),this.set_activeViewpoint__()},set_activeViewpoint__:function(){if(this.getStraightenHorizon()){var t=this.getActiveViewpoint();t&&(t.orientationOffset_=this.getOrientationOffset(c.Identity,t.orientationOffset_.getValue(),!1))}this.disconnect()},mousedown:function(e){if(!(this.button>=0)){this.pressTime=performance.now();var i=this.getBrowser().getSurface().offset(),n=e.pageX-i.left,r=e.pageY-i.top;switch(this.getButton(e.button)){case 0:e.preventDefault(),e.stopImmediatePropagation(),this.button=e.button,t(document).bind("mouseup.ExamineViewer"+this.getId(),this.mouseup.bind(this)),t(document).bind("mousemove.ExamineViewer"+this.getId(),this.mousemove.bind(this)),t(document).bind("touchend.ExamineViewer"+this.getId(),this.touchend.bind(this)),t(document).bind("touchmove.ExamineViewer"+this.getId(),this.touchmove.bind(this)),this.disconnect(),this.getActiveViewpoint().transitionStop(),this.getBrowser().setCursor("MOVE"),this.trackballProjectToSphere(n,r,this.fromVector),this.rotation.assign(c.Identity),this.motionTime=0,this.isActive_=!0;break;case 1:e.preventDefault(),e.stopImmediatePropagation(),this.button=e.button,t(document).bind("mouseup.ExamineViewer"+this.getId(),this.mouseup.bind(this)),t(document).bind("mousemove.ExamineViewer"+this.getId(),this.mousemove.bind(this)),t(document).bind("touchend.ExamineViewer"+this.getId(),this.touchend.bind(this)),t(document).bind("touchmove.ExamineViewer"+this.getId(),this.touchmove.bind(this)),this.disconnect(),this.getActiveViewpoint().transitionStop(),this.getBrowser().setCursor("MOVE"),this.getPointOnCenterPlane(n,r,this.fromPoint),this.isActive_=!0}}},mouseup:function(e){if(e.button===this.button)switch(this.button=-1,t(document).unbind(".ExamineViewer"+this.getId()),this.getButton(e.button)){case 0:e.preventDefault(),e.stopImmediatePropagation();var i=this.getActiveViewpoint();this.getBrowser().setCursor("DEFAULT"),Math.abs(this.rotation.angle)>.003&&performance.now()-this.motionTime<40&&(this.getStraightenHorizon()&&"GeoViewpoint"!==i.getTypeName()&&(this.rotation=this.getHorizonRotation(this.rotation)),this.addSpinning(this.rotation)),this.isActive_=!1;break;case 1:e.preventDefault(),e.stopImmediatePropagation(),this.getBrowser().setCursor("DEFAULT"),this.isActive_=!1}},dblclick:function(t){t.preventDefault(),t.stopImmediatePropagation();const e=this.getBrowser().getSurface(),i=e.offset(),n=t.pageX-i.left-parseFloat(e.css("borderLeftWidth")),r=e.innerHeight()-(t.pageY-i.top-parseFloat(e.css("borderTopWidth")));this.disconnect(),this.lookAtBBox(n,r,this.getStraightenHorizon())},mousemove:function(){var t=new l(0,0,0);return function(e){var i=this.getBrowser().getSurface().offset(),n=e.pageX-i.left,r=e.pageY-i.top;switch(this.getButton(this.button)){case 0:e.preventDefault(),e.stopImmediatePropagation();var s=this.trackballProjectToSphere(n,r,this.toVector);if(this.rotation.setFromToVec(s,this.fromVector),Math.abs(this.rotation.angle)<.003&&performance.now()-this.pressTime<50)return;this.addRotate(this.rotation),this.fromVector.assign(s),this.motionTime=performance.now();break;case 1:e.preventDefault(),e.stopImmediatePropagation();var o=this.getActiveViewpoint(),a=this.getPointOnCenterPlane(n,r,this.toPoint),u=o.getUserOrientation().multVecRot(t.assign(this.fromPoint).subtract(a));this.addMove(u,u),this.fromPoint.assign(a)}}}(),mousewheel:function(){var t=new l(0,0,0),e=new l(0,0,0);return function(i){i.preventDefault(),i.stopImmediatePropagation();var n=this.getBrowser(),r=this.getActiveViewpoint();n.prepareEvents().removeInterest("spin",this),r.transitionStop(),t=this.getDistanceToCenter(t).multiply(i.zoomFactor||p),e=r.getUserOrientation().multVecRot(e.set(0,0,t.abs())),i.deltaY>0?this.addMove(e.negate(),l.Zero):i.deltaY<0&&this.addMove(e,l.Zero)}}(),touchstart:function(t){var e=t.originalEvent.touches;switch(e.length){case 1:t.button=0,t.pageX=e[0].pageX,t.pageY=e[0].pageY,this.mousedown(t),this.touch1.set(e[0].pageX,e[0].pageY);break;case 2:this.touchend(t),t.button=1,t.pageX=(e[0].pageX+e[1].pageX)/2,t.pageY=(e[0].pageY+e[1].pageY)/2,this.mousedown(t),this.touch1.set(e[0].pageX,e[0].pageY),this.touch2.set(e[1].pageX,e[1].pageY);break;case 3:this.touchend(t)}},touchend:function(t){switch(this.button){case 0:t.button=0,this.mouseup(t),this.getBrowser().getCurrentTime()-this.tapStart<this.dblTapInterval&&(t.button=0,t.pageX=this.touch1.x,t.pageY=this.touch1.y,this.dblclick(t)),this.tapStart=this.getBrowser().getCurrentTime();break;case 1:this.touchMode=0,t.button=1,this.mouseup(t)}},touchmove:function(){var e=new u(0,0),i=new u(0,0);return function(n){var r=n.originalEvent.touches;switch(r.length){case 1:n.pageX=r[0].pageX,n.pageY=r[0].pageY,this.mousemove(n);break;case 2:e.set(r[0].pageX,r[0].pageY).subtract(this.touch1).normalize(),i.set(r[1].pageX,r[1].pageY).subtract(this.touch2).normalize();var s=e.dot(i)>.7,o=e.dot(i)<-.7;switch(this.touchMode||(s?1:o?2:0)){case 1:this.touchMode=1,n.pageX=(r[0].pageX+r[1].pageX)/2,n.pageY=(r[0].pageY+r[1].pageY)/2,this.mousemove(n);break;case 2:this.touchMode=2;var a=this.touch1.distance(this.touch2);this.touch1.set(r[0].pageX,r[0].pageY),this.touch2.set(r[1].pageX,r[1].pageY);var u=this.touch1.distance(this.touch2),l=u-a;n.deltaY=l,n.zoomFactor=Math.abs(l)/t(window).width(),this.mousewheel(n)}this.touch1.set(r[0].pageX,r[0].pageY),this.touch2.set(r[1].pageX,r[1].pageY)}}}(),spin:function(){var t=this.getActiveViewpoint();this.orientationOffset.assign(t.orientationOffset_.getValue()),t.orientationOffset_=this.getOrientationOffset(this.rotation,this.orientationOffset),t.positionOffset_=this.getPositionOffset(t.positionOffset_.getValue(),this.orientationOffset,t.orientationOffset_.getValue())},set_positionOffset__:function(t){this.getActiveViewpoint().positionOffset_=t},set_centerOfRotationOffset__:function(t){this.getActiveViewpoint().centerOfRotationOffset_=t},set_rotation__:function(t){var e=this.getActiveViewpoint();e.orientationOffset_=this.getOrientationOffset(t.getValue(),this.initialOrientationOffset,!1),e.positionOffset_=this.getPositionOffset(this.initialPositionOffset,this.initialOrientationOffset,e.orientationOffset_.getValue())},addRotate:function(){var t=new c;return function(e){var i=this.getActiveViewpoint();if(this.rotationChaser.isActive_.getValue()&&this.rotationChaser.value_changed_.hasInterest("set_rotation__",this))try{t.assign(this.rotationChaser.set_destination_.getValue()).multLeft(e),this.getOrientationOffset(t,this.initialOrientationOffset,!0),this.rotationChaser.set_destination_=t}catch(i){e=this.getHorizonRotation(e),t.assign(this.rotationChaser.set_destination_.getValue()).multLeft(e),this.rotationChaser.set_destination_=t}else try{this.initialOrientationOffset.assign(i.orientationOffset_.getValue()),this.initialPositionOffset.assign(i.positionOffset_.getValue()),this.getOrientationOffset(e,this.initialOrientationOffset,!0),this.rotationChaser.set_value_=c.Identity,this.rotationChaser.set_destination_=e}catch(t){this.rotationChaser.set_value_=c.Identity,this.rotationChaser.set_destination_=this.getHorizonRotation(e)}this.disconnect(),this.rotationChaser.value_changed_.addInterest("set_rotation__",this)}}(),addSpinning:function(){var t=new c(0,0,1,0);return function(e){try{this.disconnect(),this.getBrowser().prepareEvents().addInterest("spin",this),this.rotation.assign(t.assign(c.Identity).slerp(e,.6))}catch(t){console.log(t)}}}(),addMove:function(){var t=new l(0,0,0),e=new l(0,0,0);return function(i,n){var r=this.getActiveViewpoint();this.positionChaser.isActive_.getValue()&&this.positionChaser.value_changed_.hasInterest("set_positionOffset__",this)?(t.assign(this.positionChaser.set_destination_.getValue()).add(i),this.positionChaser.set_destination_=t):(t.assign(r.positionOffset_.getValue()).add(i),this.positionChaser.set_value_=r.positionOffset_,this.positionChaser.set_destination_=t),this.centerOfRotationChaser.isActive_.getValue()&&this.centerOfRotationChaser.value_changed_.hasInterest("set_centerOfRotationOffset__",this)?(e.assign(this.centerOfRotationChaser.set_destination_.getValue()).add(n),this.centerOfRotationChaser.set_destination_=e):(e.assign(r.centerOfRotationOffset_.getValue()).add(n),this.centerOfRotationChaser.set_value_=r.centerOfRotationOffset_,this.centerOfRotationChaser.set_destination_=e),this.disconnect(),this.positionChaser.value_changed_.addInterest("set_positionOffset__",this),this.centerOfRotationChaser.value_changed_.addInterest("set_centerOfRotationOffset__",this)}}(),getPositionOffset:function(){var t=new l(0,0,0),e=new l(0,0,0),i=new c(0,0,1,0);return function(n,r,s){return this.getDistanceToCenter(t,n),i.assign(r).inverse().multRight(s).multVecRot(e.assign(t)).subtract(t).add(n)}}(),getOrientationOffset:function(){var t=new c(0,0,1,0),e=new c(0,0,1,0),i=new l(0,0,0);return function(n,r,s){var o=this.getActiveViewpoint(),a=this.getStraightenHorizon();t.assign(n).multRight(o.getOrientation()).multRight(r),a&&"GeoViewpoint"!==o.getTypeName()&&o.straightenHorizon(t);var u=e.assign(o.getOrientation()).inverse().multRight(t);if(a&&"GeoViewpoint"!==o.getTypeName()){if(!s)return u;var c=t.multVecRot(i.assign(l.zAxis));if(Math.abs(o.getUpVector().dot(c))<.97)return u;throw new Error("Critical angle")}return u}}(),getHorizonRotation:function(){var t=new l(0,0,0);return function(e){var i=this.getActiveViewpoint(),n=e.multVecRot(t.assign(l.zAxis)).normalize(),r=l.cross(i.getUpVector(),n).normalize(),s=l.cross(r,i.getUpVector()).normalize();return new c(l.zAxis,s)}}(),disconnect:function(){var t=this.getBrowser();this.positionChaser.value_changed_.removeInterest("set_positionOffset__",this),this.centerOfRotationChaser.value_changed_.removeInterest("set_centerOfRotationOffset__",this),this.rotationChaser.value_changed_.removeInterest("set_rotation__",this),t.prepareEvents().removeInterest("spin",this)},dispose:function(){var e=this.getBrowser();this.disconnect(),e.activeViewpoint_.removeInterest("set_activeViewpoint__",this),e.getSurface().unbind(".ExamineViewer"),t(document).unbind(".ExamineViewer"+this.getId())}}),h}),define("x_ite/Browser/Navigation/WalkViewer",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Browser/Navigation/X3DFlyViewer","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4"],function(t,e,i,n,r,s,o){"use strict";function a(t){n.call(this,t)}return a.prototype=Object.assign(Object.create(n.prototype),{constructor:a,fieldDefinitions:new i([new e(r.outputOnly,"isActive",new t.SFBool)]),initialize:function(){n.prototype.initialize.call(this),this.getBrowser().addCollision(this)},getStraightenHorizon:function(){return!0},getFlyDirection:function(t,e,i){return i.assign(e).subtract(t)},getTranslationOffset:function(){var t=new s(0,0,0),e=new o(0,0,1,0),i=new o(0,0,1,0);return function(n){var r=this.getActiveViewpoint(),o=r.getUpVector();return e.assign(r.getUserOrientation()),e.multVecRot(t.assign(s.yAxis)),i.setFromToVec(t,o),e.multRight(i).multVecRot(n)}}(),constrainPanDirection:function(t){return t.y<0&&(t.y=0),t},dispose:function(){this.getBrowser().removeCollision(this),n.prototype.dispose.call(this)}}),a}),define("x_ite/Browser/Navigation/FlyViewer",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Bits/X3DConstants","x_ite/Browser/Navigation/X3DFlyViewer","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4"],function(t,e,i,n,r,s,o){"use strict";function a(t){r.call(this,t)}return a.prototype=Object.assign(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new e(n.outputOnly,"isActive",new t.SFBool)]),addCollision:function(){this.getBrowser().addCollision(this)},removeCollision:function(){this.getBrowser().removeCollision(this)},getFlyDirection:function(t,e,i){return i.assign(e).subtract(t)},getTranslationOffset:function(t){return this.getActiveViewpoint().getUserOrientation().multVecRot(t)},constrainPanDirection:function(t){return t}}),a}),define("x_ite/Browser/Navigation/PlaneViewer",["jquery","x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Bits/X3DConstants","x_ite/Browser/Navigation/X3DViewer","x_ite/Components/Navigation/Viewpoint","standard/Math/Numbers/Vector3","jquery-mousewheel"],function(t,e,i,n,r,s,o,a){"use strict";function u(t){s.call(this,t),this.button=-1,this.fromPoint=new a(0,0,0),this.toPoint=new a(0,0,0)}var l=/Mac OS X/i.test(navigator.userAgent),c=l?1/160:.05,h=new a(0,0,0),d=new a(0,0,0),p=new a(0,0,0);return u.prototype=Object.assign(Object.create(s.prototype),{constructor:u,fieldDefinitions:new n([new i(r.outputOnly,"isActive",new e.SFBool)]),initialize:function(){s.prototype.initialize.call(this);var t=this.getBrowser(),e=t.getSurface();e.bind("mousedown.PlaneViewer",this.mousedown.bind(this)),e.bind("mouseup.PlaneViewer",this.mouseup.bind(this)),e.bind("mousemove.PlaneViewer",this.mousemove.bind(this)),e.bind("mousewheel.PlaneViewer",this.mousewheel.bind(this))},mousedown:function(e){if(!(this.button>=0)){var i=this.getBrowser().getSurface().offset(),n=e.pageX-i.left,r=e.pageY-i.top;switch(this.getButton(e.button)){case 1:e.preventDefault(),e.stopImmediatePropagation(),this.button=e.button,this.getBrowser().getSurface().unbind("mousemove.PlaneViewer"),t(document).bind("mouseup.PlaneViewer"+this.getId(),this.mouseup.bind(this)),t(document).bind("mousemove.PlaneViewer"+this.getId(),this.mousemove.bind(this)),this.getActiveViewpoint().transitionStop(),this.getBrowser().setCursor("MOVE"),this.getPointOnCenterPlane(n,r,this.fromPoint),this.isActive_=!0}}},mouseup:function(e){e.preventDefault(),e.stopImmediatePropagation(),e.button===this.button&&(this.button=-1,t(document).unbind(".PlaneViewer"+this.getId()),this.getBrowser().getSurface().bind("mousemove.PlaneViewer",this.mousemove.bind(this)),this.getBrowser().setCursor("DEFAULT"),this.isActive_=!1)},mousemove:function(t){var e=this.getBrowser().getSurface().offset(),i=t.pageX-e.left,n=t.pageY-e.top;switch(this.getButton(this.button)){case 1:t.preventDefault(),t.stopImmediatePropagation();var r=this.getActiveViewpoint(),s=this.getPointOnCenterPlane(i,n,this.toPoint),o=r.getUserOrientation().multVecRot(this.fromPoint.subtract(s));r.positionOffset_=d.assign(r.positionOffset_.getValue()).add(o),r.centerOfRotationOffset_=p.assign(r.centerOfRotationOffset_.getValue()).add(o),this.fromPoint.assign(s)}},mousewheel:function(t){t.preventDefault(),t.stopImmediatePropagation();var e=this.getBrowser().getSurface().offset(),i=t.pageX-e.left,n=t.pageY-e.top,r=this.getActiveViewpoint(),s=this.getPointOnCenterPlane(i,n,this.fromPoint);r.transitionStop(),t.deltaY>0?r.fieldOfViewScale_=Math.max(1e-5,r.fieldOfViewScale_.getValue()*(1-c)):t.deltaY<0&&(r.fieldOfViewScale_=r.fieldOfViewScale_.getValue()*(1+c),this.constrainFieldOfViewScale()),r.set_fieldOfView___&&r.set_fieldOfView___();var o=this.getPointOnCenterPlane(i,n,this.toPoint),a=r.getUserOrientation().multVecRot(h.assign(s).subtract(o));r.positionOffset_=d.assign(r.positionOffset_.getValue()).add(a),r.centerOfRotationOffset_=p.assign(r.centerOfRotationOffset_.getValue()).add(a)},constrainFieldOfViewScale:function(){var t=this.getActiveViewpoint();(t instanceof o||"GeoViewpoint"===t.getTypeName())&&t.fieldOfView_.getValue()*t.fieldOfViewScale_.getValue()>=Math.PI&&(t.fieldOfViewScale_=(Math.PI-.001)/t.fieldOfView_.getValue())},dispose:function(){this.getBrowser().getSurface().unbind(".PlaneViewer"),t(document).unbind(".PlaneViewer"+this.getId())}}),u}),
|
|
28
|
-
define("x_ite/Browser/Navigation/NoneViewer",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Bits/X3DConstants","x_ite/Browser/Navigation/X3DViewer"],function(t,e,i,n,r){"use strict";function s(t){r.call(this,t)}return s.prototype=Object.assign(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new e(n.outputOnly,"isActive",new t.SFBool)])}),s}),define("x_ite/Browser/Navigation/LookAtViewer",["jquery","x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Bits/X3DConstants","x_ite/Browser/Navigation/X3DViewer","x_ite/Components/Followers/PositionChaser","x_ite/Components/Followers/OrientationChaser","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4"],function(t,e,i,n,r,s,o,a,u,l,c){"use strict";function h(t){s.call(this,t),this.button=-1,this.fromVector=new l(0,0,0),this.toVector=new l(0,0,0),this.touch1=new u(0,0),this.touch2=new u(0,0),this.tapStart=0,this.dblTapInterval=.4,this.positionChaser=new o(t),this.centerOfRotationChaser=new o(t),this.orientationChaser=new a(t)}var d=/Mac OS X/i.test(navigator.userAgent),p=d?1/120:.05;return h.prototype=Object.assign(Object.create(s.prototype),{constructor:h,fieldDefinitions:new n([new i(r.outputOnly,"isActive",new e.SFBool)]),initialize:function(){s.prototype.initialize.call(this);var t=this.getBrowser(),e=t.getSurface();e.bind("mousedown.LookAtViewer",this.mousedown.bind(this)),e.bind("mouseup.LookAtViewer",this.mouseup.bind(this)),e.bind("dblclick.LookAtViewer",this.dblclick.bind(this)),e.bind("mousewheel.LookAtViewer",this.mousewheel.bind(this)),e.bind("touchstart.LookAtViewer",this.touchstart.bind(this)),e.bind("touchend.LookAtViewer",this.touchend.bind(this)),this.positionChaser.duration_=.3,this.positionChaser.setPrivate(!0),this.positionChaser.setup(),this.centerOfRotationChaser.duration_=.3,this.centerOfRotationChaser.setPrivate(!0),this.centerOfRotationChaser.setup(),this.orientationChaser.duration_=.3,this.orientationChaser.setPrivate(!0),this.orientationChaser.setup()},mousedown:function(e){if(!(this.button>=0)){var i=this.getBrowser().getSurface().offset(),n=e.pageX-i.left,r=e.pageY-i.top;switch(e.button){case 0:e.preventDefault(),e.stopImmediatePropagation(),this.button=e.button,t(document).bind("mouseup.LookAtViewer"+this.getId(),this.mouseup.bind(this)),t(document).bind("mousemove.LookAtViewer"+this.getId(),this.mousemove.bind(this)),t(document).bind("touchend.LookAtViewer"+this.getId(),this.mouseup.bind(this)),t(document).bind("touchmove.LookAtViewer"+this.getId(),this.touchmove.bind(this)),this.getActiveViewpoint().transitionStop(),this.trackballProjectToSphere(n,r,this.fromVector),this.isActive_=!0}}},mouseup:function(e){if(e.button===this.button)switch(this.button=-1,t(document).unbind(".LookAtViewer"+this.getId()),e.button){case 0:e.preventDefault(),e.stopImmediatePropagation(),this.isActive_=!1}},dblclick:function(t){t.preventDefault(),t.stopImmediatePropagation();var e=this.getBrowser().getSurface(),i=e.offset(),n=t.pageX-i.left-parseFloat(e.css("borderLeftWidth")),r=e.innerHeight()-(t.pageY-i.top-parseFloat(e.css("borderTopWidth")));this.disconnect(),this.lookAtPoint(n,r,this.getStraightenHorizon())},mousemove:function(t){this.getBrowser().addBrowserEvent(),this.event=t;var e=this.getBrowser().getSurface().offset(),i=t.pageX-e.left,n=t.pageY-e.top;switch(this.button){case 0:t.preventDefault(),t.stopImmediatePropagation();var r=this.trackballProjectToSphere(i,n,this.toVector);this.addRotation(this.fromVector,r),this.fromVector.assign(r)}},mousewheel:function(){var t=new l(0,0,0),e=new l(0,0,0);return function(i){i.preventDefault(),i.stopImmediatePropagation();var n=this.getActiveViewpoint();n.transitionStop(),t=this.getDistanceToCenter(t).multiply(i.zoomFactor||p),e=n.getUserOrientation().multVecRot(e.set(0,0,t.abs())),i.deltaY>0?this.addMove(e.negate(),l.Zero):i.deltaY<0&&this.addMove(e,l.Zero)}}(),touchstart:function(t){var e=t.originalEvent.touches;switch(e.length){case 1:this.touch1.set(e[0].pageX,e[0].pageY);break;case 2:this.touchend(t),t.button=0,t.pageX=(e[0].pageX+e[1].pageX)/2,t.pageY=(e[0].pageY+e[1].pageY)/2,this.mousedown(t),this.touch1.set(e[0].pageX,e[0].pageY),this.touch2.set(e[1].pageX,e[1].pageY);break;case 3:this.touchend(t)}},touchend:function(t){switch(this.button){case 0:this.mouseup(t)}this.getBrowser().getCurrentTime()-this.tapStart<this.dblTapInterval&&(t.button=1,t.pageX=this.touch1.x,t.pageY=this.touch1.y,this.dblclick(t)),this.tapStart=this.getBrowser().getCurrentTime()},touchmove:function(){var e=new u(0,0),i=new u(0,0);return function(n){var r=n.originalEvent.touches;switch(r.length){case 1:break;case 2:e.set(r[0].pageX,r[0].pageY).subtract(this.touch1).normalize(),i.set(r[1].pageX,r[1].pageY).subtract(this.touch2).normalize();var s=e.dot(i)>.7,o=e.dot(i)<-.7;if(s)n.button=0,n.pageX=(r[0].pageX+r[1].pageX)/2,n.pageY=(r[0].pageY+r[1].pageY)/2,this.mousemove(n);else if(o){var a=this.touch1.distance(this.touch2);this.touch1.set(r[0].pageX,r[0].pageY),this.touch2.set(r[1].pageX,r[1].pageY);var u=this.touch1.distance(this.touch2),l=u-a;n.deltaY=l,n.zoomFactor=Math.abs(l)/t(window).width(),this.mousewheel(n)}this.touch1.set(r[0].pageX,r[0].pageY),this.touch2.set(r[1].pageX,r[1].pageY)}}}(),set_positionOffset__:function(t){this.getActiveViewpoint().positionOffset_=t},set_centerOfRotationOffset__:function(t){this.getActiveViewpoint().centerOfRotationOffset_=t},set_orientationOffset__:function(t){this.getActiveViewpoint().orientationOffset_=t},addMove:function(){var t=new l(0,0,0),e=new l(0,0,0);return function(i,n){var r=this.getActiveViewpoint();this.positionChaser.isActive_.getValue()&&this.positionChaser.value_changed_.hasInterest("set_positionOffset__",this)?(t.assign(this.positionChaser.set_destination_.getValue()).add(i),this.positionChaser.set_destination_=t):(t.assign(r.positionOffset_.getValue()).add(i),this.positionChaser.set_value_=r.positionOffset_,this.positionChaser.set_destination_=t),this.centerOfRotationChaser.isActive_.getValue()&&this.centerOfRotationChaser.value_changed_.hasInterest("set_centerOfRotationOffset__",this)?(e.assign(this.centerOfRotationChaser.set_destination_.getValue()).add(n),this.centerOfRotationChaser.set_destination_=e):(e.assign(r.centerOfRotationOffset_.getValue()).add(n),this.centerOfRotationChaser.set_value_=r.centerOfRotationOffset_,this.centerOfRotationChaser.set_destination_=e),this.disconnect(),this.positionChaser.value_changed_.addInterest("set_positionOffset__",this),this.centerOfRotationChaser.value_changed_.addInterest("set_centerOfRotationOffset__",this)}}(),addRotation:function(){var t=new c(0,0,1,0),e=new c(0,0,1,0);return function(i,n){var r=this.getActiveViewpoint();this.orientationChaser.isActive_.getValue()&&this.orientationChaser.value_changed_.hasInterest("set_orientationOffset__",this)?(t.setFromToVec(n,i).multRight(r.getOrientation()).multRight(this.orientationChaser.set_destination_.getValue()),r.straightenHorizon(t),e.assign(r.getOrientation()).inverse().multRight(t),this.orientationChaser.set_destination_=e):(t.setFromToVec(n,i).multRight(r.getUserOrientation()),r.straightenHorizon(t),e.assign(r.getOrientation()).inverse().multRight(t),this.orientationChaser.set_value_=r.orientationOffset_,this.orientationChaser.set_destination_=e),this.disconnect(),this.orientationChaser.value_changed_.addInterest("set_orientationOffset__",this)}}(),disconnect:function(){this.orientationChaser.value_changed_.removeInterest("set_orientationOffset__",this),this.positionChaser.value_changed_.removeInterest("set_positionOffset__",this),this.centerOfRotationChaser.value_changed_.removeInterest("set_centerOfRotationOffset__",this)},dispose:function(){this.getBrowser().getSurface().unbind(".LookAtViewer"),t(document).unbind(".LookAtViewer"+this.getId())}}),h}),define("x_ite/Components/Lighting/X3DLightNode",["x_ite/Components/Core/X3DChildNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Matrix4","standard/Math/Algorithm"],function(t,e,i,n){"use strict";function r(i){t.call(this,i),this.addType(e.X3DLightNode)}return r.prototype=Object.assign(Object.create(t.prototype),{constructor:r,initialize:function(){t.prototype.initialize.call(this),this.on_.addInterest("set_on__",this),this.intensity_.addInterest("set_on__",this),this.set_on__()},set_on__:function(){this.on_.getValue()&&this.getIntensity()>0?(delete this.push,delete this.pop):(this.push=Function.prototype,this.pop=Function.prototype)},getGlobal:function(){return this.global_.getValue()},getColor:function(){return this.color_.getValue()},getIntensity:function(){return Math.max(this.intensity_.getValue(),0)},getAmbientIntensity:function(){return n.clamp(this.ambientIntensity_.getValue(),0,1)},getDirection:function(){return this.direction_.getValue()},getShadows:function(){return this.shadows_.getValue()},getShadowColor:function(){return this.shadowColor_.getValue()},getShadowIntensity:function(){return this.getShadows()?n.clamp(this.shadowIntensity_.getValue(),0,1):0},getShadowBias:function(){return n.clamp(this.shadowBias_.getValue(),0,1)},getShadowMapSize:function(){return Math.min(this.shadowMapSize_.getValue(),this.getBrowser().getMaxTextureSize())},getBiasMatrix:function(){const t=new i(.5,0,0,0,0,.5,0,0,0,0,.5,0,.5,.5,.5,1);return function(){return t}}(),push:function(t,e){if(t.isIndependent()){const i=this.getLights().pop();this.global_.getValue()?(i.set(t.getBrowser(),this,t.getLayer().getGroup(),t.getModelViewMatrix().get()),t.getGlobalObjects().push(i),t.getLights().push(i)):(i.set(t.getBrowser(),this,e,t.getModelViewMatrix().get()),t.getLocalObjects().push(i),t.getLights().push(i))}else{const e=t.getLightContainer();this.global_.getValue()?(e.getModelViewMatrix().pushMatrix(t.getModelViewMatrix().get()),t.getGlobalObjects().push(e),t.getLights().push(e)):(e.getModelViewMatrix().pushMatrix(t.getModelViewMatrix().get()),t.getLocalObjects().push(e),t.getLights().push(e))}t.pushShadow(this.getShadowIntensity())},pop:function(t){this.global_.getValue()||(t.isIndependent()?t.getBrowser().getLocalObjects().push(t.getLocalObjects().pop()):t.getLocalObjects().pop(),t.popShadow())}}),r}),define("x_ite/Components/Lighting/DirectionalLight",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Lighting/X3DLightNode","x_ite/Components/Grouping/X3DGroupingNode","x_ite/Bits/TraverseType","x_ite/Bits/X3DConstants","standard/Math/Geometry/Box3","standard/Math/Geometry/Camera","standard/Math/Geometry/ViewVolume","standard/Math/Numbers/Vector3","standard/Math/Numbers/Vector4","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4","standard/Math/Utility/MatrixStack","standard/Utility/ObjectCache"],function(t,e,i,n,r,s,o,a,u,l,c,h,d,p,f,g){"use strict";function m(){this.direction=new c(0,0,0),this.shadowBuffer=null,this.bbox=new a,this.viewVolume=new l,this.viewport=new h(0,0,0,0),this.projectionMatrix=new p,this.modelViewMatrix=new f(p),this.modelMatrix=new p,this.invLightSpaceMatrix=new p,this.invLightSpaceProjectionMatrix=new p,this.shadowMatrix=new p,this.shadowMatrixArray=new Float32Array(16),this.rotation=new d,this.textureUnit=0}function _(t){n.call(this,t),this.addType(o.DirectionalLight),"2.0"==t.getSpecificationVersion()&&(this.global_=!0)}var x=g(m);return m.prototype={constructor:m,getModelViewMatrix:function(){return this.modelViewMatrix},set:function(t,e,i,n){var r=t.getContext(),s=e.getShadowMapSize();this.browser=t,this.lightNode=e,this.groupNode=i,this.modelViewMatrix.pushMatrix(n),e.getShadowIntensity()>0&&s>0&&(this.shadowBuffer=t.popShadowBuffer(s),this.shadowBuffer?t.getCombinedTextureUnits().length?(this.textureUnit=t.getCombinedTextureUnits().pop(),r.activeTexture(r.TEXTURE0+this.textureUnit),r.getVersion()>=2||t.getExtension("WEBGL_depth_texture")?r.bindTexture(r.TEXTURE_2D,this.shadowBuffer.getDepthTexture()):r.bindTexture(r.TEXTURE_2D,this.shadowBuffer.getColorTexture()),r.activeTexture(r.TEXTURE0)):console.warn("Not enough combined texture units for shadow map available."):console.warn("Couldn't create shadow buffer."))},renderShadowMap:function(t){try{if(!this.shadowBuffer)return;var e=this.lightNode,i=t.getCameraSpaceMatrix().get(),n=this.modelMatrix.assign(this.modelViewMatrix.get()).multRight(i),o=this.invLightSpaceMatrix.assign(e.getGlobal()?n:p.Identity);o.rotate(this.rotation.setFromToVec(c.zAxis,this.direction.assign(e.getDirection()).negate())),o.inverse();var a=this.groupNode.getSubBBox(this.bbox,!0),l=a.multRight(o),h=e.getShadowMapSize(),d=this.viewport.set(0,0,h,h),f=u.orthoBox(l,this.projectionMatrix);this.shadowBuffer.bind(),t.getViewVolumes().push(this.viewVolume.set(f,d,d)),t.getProjectionMatrix().pushMatrix(f),t.getModelViewMatrix().pushMatrix(o),t.render(s.SHADOW,r.prototype.traverse,this.groupNode),t.getModelViewMatrix().pop(),t.getProjectionMatrix().pop(),t.getViewVolumes().pop(),this.shadowBuffer.unbind(),e.getGlobal()||o.multLeft(n.inverse()),this.invLightSpaceProjectionMatrix.assign(o).multRight(f).multRight(e.getBiasMatrix())}catch(t){console.log(t)}},setGlobalVariables:function(t){this.modelViewMatrix.get().multDirMatrix(this.direction.assign(this.lightNode.getDirection())).normalize(),this.shadowMatrix.assign(t.getCameraSpaceMatrix().get()).multRight(this.invLightSpaceProjectionMatrix),this.shadowMatrixArray.set(this.shadowMatrix)},setShaderUniforms:function(t,e){var i=e.numLights++;if(!e.hasLight(i,this)){var n=this.lightNode,r=n.getColor(),s=this.direction;if(t.uniform1i(e.x3d_LightType[i],1),t.uniform3f(e.x3d_LightColor[i],r.r,r.g,r.b),t.uniform1f(e.x3d_LightIntensity[i],n.getIntensity()),t.uniform1f(e.x3d_LightAmbientIntensity[i],n.getAmbientIntensity()),t.uniform3f(e.x3d_LightDirection[i],s.x,s.y,s.z),this.textureUnit){var o=n.getShadowColor();t.uniform3f(e.x3d_ShadowColor[i],o.r,o.g,o.b),t.uniform1f(e.x3d_ShadowIntensity[i],n.getShadowIntensity()),t.uniform1f(e.x3d_ShadowBias[i],n.getShadowBias()),t.uniformMatrix4fv(e.x3d_ShadowMatrix[i],!1,this.shadowMatrixArray),t.uniform1i(e.x3d_ShadowMapSize[i],n.getShadowMapSize()),t.uniform1i(e.x3d_ShadowMap[i],this.textureUnit)}else t.uniform1f(e.x3d_ShadowIntensity[i],0)}},dispose:function(){this.textureUnit&&this.browser.getCombinedTextureUnits().push(this.textureUnit),this.browser.pushShadowBuffer(this.shadowBuffer),this.modelViewMatrix.clear(),this.browser=null,this.lightNode=null,this.groupNode=null,this.shadowBuffer=null,this.textureUnit=0,x.push(this)}},_.prototype=Object.assign(Object.create(n.prototype),{constructor:_,fieldDefinitions:new i([new e(o.inputOutput,"metadata",new t.SFNode),new e(o.inputOutput,"global",new t.SFBool(!1)),new e(o.inputOutput,"on",new t.SFBool(!0)),new e(o.inputOutput,"color",new t.SFColor(1,1,1)),new e(o.inputOutput,"intensity",new t.SFFloat(1)),new e(o.inputOutput,"ambientIntensity",new t.SFFloat),new e(o.inputOutput,"direction",new t.SFVec3f(0,0,-1)),new e(o.inputOutput,"shadows",new t.SFBool),new e(o.inputOutput,"shadowColor",new t.SFColor),new e(o.inputOutput,"shadowIntensity",new t.SFFloat(1)),new e(o.inputOutput,"shadowBias",new t.SFFloat(.005)),new e(o.initializeOnly,"shadowMapSize",new t.SFInt32(1024))]),getTypeName:function(){return"DirectionalLight"},getComponentName:function(){return"Lighting"},getContainerField:function(){return"children"},getLights:function(){return x}}),_}),define("x_ite/Browser/Navigation/X3DNavigationContext",["x_ite/Fields","x_ite/Browser/Navigation/ExamineViewer","x_ite/Browser/Navigation/WalkViewer","x_ite/Browser/Navigation/FlyViewer","x_ite/Browser/Navigation/PlaneViewer","x_ite/Browser/Navigation/NoneViewer","x_ite/Browser/Navigation/LookAtViewer","x_ite/Components/Lighting/DirectionalLight","standard/Math/Numbers/Matrix4"],function(t,e,i,n,r,s,o,a,u){"use strict";function l(t){var e=new a(t.getPrivateScene());e.setup();var i=e.getLights().pop();return i.set(t,e,null,u.Identity),i.dispose=function(){},i}function c(){this.addChildObjects("activeLayer",new t.SFNode,"activeNavigationInfo",new t.SFNode,"activeViewpoint",new t.SFNode,"availableViewers",new t.MFString,"viewer",new t.SFString("EXAMINE")),this.activeCollisions=new Set,this.viewerNode=new s(this)}return c.prototype={initialize:function(){this.viewer_.addInterest("set_viewer__",this),this.initialized().addInterest("set_world__",this),this.shutdown().addInterest("remove_world__",this),this.headlightContainer=l(this),this.viewerNode.setup()},getHeadlight:function(){return this.headlightContainer},getActiveLayer:function(){return this.activeLayer_.getValue()},getActiveNavigationInfo:function(){return this.activeNavigationInfo_.getValue()},getActiveViewpoint:function(){return this.activeViewpoint_.getValue()},getCurrentViewer:function(){return this.viewer_.getValue()},getViewer:function(){return this.viewerNode},addCollision:function(t){this.activeCollisions.add(t)},removeCollision:function(t){this.activeCollisions.delete(t)},getCollisionCount:function(){return this.activeCollisions.size},remove_world__:function(){this.getWorld().activeLayer_.removeInterest("set_activeLayer__",this)},set_world__:function(){this.getWorld().activeLayer_.addInterest("set_activeLayer__",this),this.set_activeLayer__()},set_activeLayer__:function(){this.activeLayer_.getValue()&&(this.activeLayer_.getValue().getNavigationInfoStack().removeInterest("set_activeNavigationInfo__",this),this.activeLayer_.getValue().getViewpointStack().removeInterest("set_activeViewpoint__",this)),this.activeLayer_=this.getWorld().getActiveLayer(),this.activeLayer_.getValue()&&(this.activeLayer_.getValue().getNavigationInfoStack().addInterest("set_activeNavigationInfo__",this),this.activeLayer_.getValue().getViewpointStack().addInterest("set_activeViewpoint__",this)),this.set_activeNavigationInfo__(),this.set_activeViewpoint__()},set_activeNavigationInfo__:function(){this.activeNavigationInfo_.getValue()&&this.activeNavigationInfo_.getValue().viewer_.removeFieldInterest(this.viewer_),this.activeLayer_.getValue()?(this.activeNavigationInfo_=this.activeLayer_.getValue().getNavigationInfo(),this.activeNavigationInfo_.getValue().viewer_.addFieldInterest(this.viewer_),this.viewer_=this.activeNavigationInfo_.getValue().viewer_):(this.activeNavigationInfo_=null,this.viewer_="NONE")},set_activeViewpoint__:function(){this.activeLayer_.getValue()?this.activeViewpoint_=this.activeLayer_.getValue().getViewpoint():this.activeViewpoint_=null},set_viewer__:function(t){switch(this.activeNavigationInfo_.getValue()?this.availableViewers_=this.activeNavigationInfo_.getValue().availableViewers_:this.availableViewers_.length=0,this.viewerNode&&this.viewerNode.dispose(),t.getValue()){case"EXAMINE":this.viewerNode=new e(this);break;case"WALK":this.viewerNode=new i(this);break;case"FLY":this.viewerNode=new n(this);break;case"PLANE":case"PLANE_create3000.de":this.viewerNode=new r(this);break;case"NONE":this.viewerNode=new s(this);break;case"LOOKAT":this.viewerNode=new o(this);break;default:this.viewerNode=new e(this)}this.viewerNode.setup()}},c}),define("x_ite/Components/Layering/Viewport",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Layering/X3DViewportNode","x_ite/Bits/X3DConstants","x_ite/Bits/TraverseType","standard/Utility/ObjectCache","standard/Math/Geometry/ViewVolume","standard/Math/Numbers/Vector4"],function(t,e,i,n,r,s,o,a,u){"use strict";function l(t){n.call(this,t),this.addType(r.Viewport),this.rectangle=new u(0,0,0,0)}const c=o(a);return l.prototype=Object.assign(Object.create(n.prototype),{constructor:l,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"clipBoundary",new t.MFFloat(0,1,0,1)),new e(r.inputOutput,"visible",new t.SFBool(!0)),new e(r.inputOutput,"bboxDisplay",new t.SFBool),new e(r.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new e(r.initializeOnly,"bboxCenter",new t.SFVec3f),new e(r.inputOnly,"addChildren",new t.MFNode),new e(r.inputOnly,"removeChildren",new t.MFNode),new e(r.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"Viewport"},getComponentName:function(){return"Layering"},getContainerField:function(){return"viewport"},getRectangle:function(t){const e=t.getViewport(),i=Math.floor(e[2]*this.getLeft()),n=Math.floor(e[2]*this.getRight()),r=Math.floor(e[3]*this.getBottom()),s=Math.floor(e[3]*this.getTop());return this.rectangle.set(i,r,Math.max(0,n-i),Math.max(0,s-r)),this.rectangle},getLeft:function(){return this.clipBoundary_.length>0?this.clipBoundary_[0]:0},getRight:function(){return this.clipBoundary_.length>1?this.clipBoundary_[1]:1},getBottom:function(){return this.clipBoundary_.length>2?this.clipBoundary_[2]:0},getTop:function(){return this.clipBoundary_.length>3?this.clipBoundary_[3]:1},traverse:function(t,e){switch(this.push(e),t){case s.POINTER:e.getBrowser().isPointerInRectangle(this.rectangle)&&n.prototype.traverse.call(this,t,e);break;default:n.prototype.traverse.call(this,t,e)}this.pop(e)},push:function(t){const e=t.getViewVolumes(),i=this.getRectangle(t.getBrowser()),n=e.length?e.at(-1).getViewport():i,r=c.pop();r.set(t.getProjectionMatrix().get(),n,i),e.push(r)},pop:function(t){c.push(t.getViewVolumes().pop())}}),l}),define("x_ite/Browser/Layering/X3DLayeringContext",["x_ite/Components/Layering/Viewport"],function(t){"use strict";function e(){this.defaultViewport=new t(this.getPrivateScene())}return e.prototype={initialize:function(){this.defaultViewport.setup()},getDefaultViewport:function(){return this.defaultViewport}},e}),define("x_ite/Browser/EnvironmentalEffects/X3DEnvironmentalEffectsContext",["x_ite/Components/Texturing/TextureProperties"],function(t){"use strict";function e(){}return e.prototype={initialize:function(){},getBackgroundSphereShader:function(){return this.backgroundSphereShader=this.createShader("BackgroundSphereShader","Background"),this.getBackgroundSphereShader=function(){return this.backgroundSphereShader},this.backgroundSphereShader},getBackgroundTextureProperties:function(){return this.backgroundTextureProperties=new t(this.getPrivateScene()),this.backgroundTextureProperties.boundaryModeS_="CLAMP_TO_EDGE",this.backgroundTextureProperties.boundaryModeT_="CLAMP_TO_EDGE",this.backgroundTextureProperties.boundaryModeR_="CLAMP_TO_EDGE",this.backgroundTextureProperties.minificationFilter_="NICEST",this.backgroundTextureProperties.magnificationFilter_="NICEST",this.backgroundTextureProperties.setup(),this.getBackgroundTextureProperties=function(){return this.backgroundTextureProperties},this.backgroundTextureProperties}},e}),define("x_ite/Browser/Lighting/X3DLightingContext",["x_ite/Rendering/TextureBuffer"],function(t){"use strict";function e(){var t=this.getContext(),e=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS);this.maxLights=e>16?8:e>8?4:2,this.shadowBuffers=[]}return e.prototype={initialize:function(){},getMaxLights:function(){return this.maxLights},popShadowBuffer:function(e){try{var i=this.shadowBuffers[e];if(i){if(i.length)return i.pop()}else this.shadowBuffers[e]=[];return new t(this,e,e)}catch(t){return console.log(t),null}},pushShadowBuffer:function(t){t&&this.shadowBuffers[t.getWidth()].push(t)}},e}),define("x_ite/Browser/Picking/X3DPickingContext",["x_ite/Bits/TraverseType"],function(t){"use strict";function e(){this.transformSensorNodes=new Set,this.pickSensorNodes=[new Set],this.pickingHierarchy=[],this.pickable=[!1],this.pickingTime=0}return e.prototype={initialize:function(){},addTransformSensor:function(t){this.transformSensorNodes.add(t),this.enablePicking()},removeTransformSensor:function(t){this.transformSensorNodes.delete(t),this.enablePicking()},addPickSensor:function(t){this.pickSensorNodes[0].add(t),this.enablePicking()},removePickSensor:function(t){this.pickSensorNodes[0].delete(t),this.enablePicking()},getPickSensors:function(){return this.pickSensorNodes},getPickingHierarchy:function(){return this.pickingHierarchy},getPickable:function(){return this.pickable},enablePicking:function(){this.transformSensorNodes.size||this.pickSensorNodes[0].size?this.sensorEvents_.addInterest("picking",this):this.sensorEvents_.removeInterest("picking",this)},picking:function(){var e=performance.now();this.getWorld().traverse(t.PICKING,null),this.transformSensorNodes.forEach(function(t){t.process()}),this.pickSensorNodes[0].forEach(function(t){t.process()}),this.pickingTime=performance.now()-e}},e}),define("x_ite/Browser/Sound/X3DSoundContext",["x_ite/Fields"],function(t){"use strict";function e(){this.addChildObjects("volume",new t.SFFloat(1),"mute",new t.SFBool)}return e.prototype={initialize:function(){}},e}),define("x_ite/Browser/Text/TextAlignment",[],function(){"use strict";let t=0;return{BEGIN:++t,FIRST:++t,MIDDLE:++t,END:++t}}),define("x_ite/Components/Text/X3DFontStyleNode",["x_ite/Fields","x_ite/Components/Core/X3DNode","x_ite/Components/Networking/X3DUrlObject","x_ite/Browser/Text/TextAlignment","x_ite/InputOutput/FileLoader","x_ite/Bits/X3DConstants","x_ite/Browser/Networking/urls"],function(t,e,i,n,r,s,o){"use strict";function a(n){e.call(this,n),i.call(this,n),this.addType(s.X3DFontStyleNode),this.addChildObjects("url",new t.MFString,"autoRefresh",new t.SFTime,"autoRefreshTimeLimit",new t.SFTime(3600)),this.familyStack=[],this.alignments=[],this.loader=new r(this)}const u={SERIF:{PLAIN:o.getFontsUrl("DroidSerif-Regular.ttf"),ITALIC:o.getFontsUrl("DroidSerif-Italic.ttf"),BOLD:o.getFontsUrl("DroidSerif-Bold.ttf"),BOLDITALIC:o.getFontsUrl("DroidSerif-BoldItalic.ttf")},SANS:{PLAIN:o.getFontsUrl("Ubuntu-R.ttf"),ITALIC:o.getFontsUrl("Ubuntu-RI.ttf"),BOLD:o.getFontsUrl("Ubuntu-B.ttf"),BOLDITALIC:o.getFontsUrl("Ubuntu-BI.ttf")},TYPEWRITER:{PLAIN:o.getFontsUrl("UbuntuMono-R.ttf"),ITALIC:o.getFontsUrl("UbuntuMono-RI.ttf"),BOLD:o.getFontsUrl("UbuntuMono-B.ttf"),BOLDITALIC:o.getFontsUrl("UbuntuMono-BI.ttf")}};return a.prototype=Object.assign(Object.create(e.prototype),i.prototype,{constructor:a,initialize:function(){e.prototype.initialize.call(this),i.prototype.initialize.call(this),this.style_.addInterest("set_style__",this),this.justify_.addInterest("set_justify__",this),this.font=null,this.familyIndex=0,this.set_justify__(),this.set_style__(),this.requestImmediateLoad()},getMajorAlignment:function(){return this.alignments[0]},getMinorAlignment:function(){return this.alignments[1]},set_style__:function(){this.setLoadState(s.NOT_STARTED_STATE),this.requestImmediateLoad()},set_justify__:function(){const t=this.horizontal_.getValue()?this.leftToRight_.getValue():this.topToBottom_.getValue();this.alignments[0]=this.justify_.length>0?this.getAlignment(0,t):t?n.BEGIN:n.END;const e=this.horizontal_.getValue()?this.topToBottom_.getValue():this.leftToRight_.getValue();this.alignments[1]=this.justify_.length>1?this.getAlignment(1,e):e?n.FIRST:n.END},getAlignment:function(t,e){if(e)switch(this.justify_[t]){case"FIRST":return n.FIRST;case"BEGIN":return n.BEGIN;case"MIDDLE":return n.MIDDLE;case"END":return n.END}else switch(this.justify_[t]){case"FIRST":return n.END;case"BEGIN":return n.END;case"MIDDLE":return n.MIDDLE;case"END":return n.BEGIN}return t?n.FIRST:n.BEGIN},requestImmediateLoad:function(t=!0){if(this.checkLoadState()!==s.COMPLETE_STATE&&this.checkLoadState()!==s.IN_PROGRESS_STATE){this.setCache(t),this.setLoadState(s.IN_PROGRESS_STATE);const e=this.family_.copy();e.push("SERIF"),this.familyStack.length=0;for(const t of e)this.familyStack.push(this.getDefaultFont(t)||t);this.loadNext()}},getDefaultFont:function(t){const e=u[t];if(e)return e[this.style_.getValue()]||e.PLAIN},loadNext:function(){try{if(0===this.familyStack.length)return this.setLoadState(s.FAILED_STATE),void(this.font=null);this.family=this.familyStack.shift(),this.URL=new URL(this.family,this.loader.getReferer()),this.getBrowser().getBrowserOptions().getCache()&&this.getCache()||this.URL.searchParams.set("_",Date.now()),this.getBrowser().getFont(this.URL).done(this.setFont.bind(this)).fail(this.setError.bind(this))}catch(t){this.setError(t.message)}},setError:function(t){"data:"!==this.URL.protocol&&console.warn("Error loading font '"+this.URL.toString()+"':",t),this.loadNext()},setFont:function(t){this.font=t,this.setLoadState(s.COMPLETE_STATE),this.addNodeEvent()},getFont:function(){return this.font}}),a}),define("standard/Math/Geometry/Box2",["standard/Math/Numbers/Matrix3","standard/Math/Numbers/Vector2"],function(t,e){"use strict";function i(e,i){switch(arguments.length){case 0:return void(this.matrix=new t(0,0,0,0,0,0,0,0,0));case 2:return void(this.matrix=new t(e.x/2,0,0,0,e.y/2,0,i.x,i.y,1));case 3:{const e=arguments[0],i=arguments[1],n=(i.x-e.x)/2,r=(i.y-e.y)/2,s=(i.x+e.x)/2,o=(i.y+e.y)/2;return void(this.matrix=new t(n,0,0,0,r,0,s,o,1))}}}return i.prototype={constructor:i,copy:function(){const t=Object.create(i.prototype);return t.matrix=this.matrix.copy(),t},assign:function(t){return this.matrix.assign(t.matrix),this},equals:function(t){return this.matrix.equals(t.matrix)},set:function(t,e){const i=this.matrix;switch(arguments.length){case 0:return i[0]=.5,i[1]=0,i[2]=0,i[3]=0,i[4]=.5,i[5]=0,i[6]=0,i[7]=0,i[8]=0,this;case 2:return i[0]=t.x/2,i[1]=0,i[2]=0,i[3]=0,i[4]=t.y/2,i[5]=0,i[6]=e.x,i[7]=e.y,i[8]=1,this;case 3:{const t=arguments[0],e=arguments[1],i=(e.x-t.x)/2,n=(e.y-t.y)/2,r=(e.x+t.x)/2,s=(e.y+t.y)/2;return this.matrix.set(i,0,0,0,n,0,r,s,1),this}}},setExtents:function(t,e){const i=this.matrix,n=(e.x-t.x)/2,r=(e.y-t.y)/2,s=(e.x+t.x)/2,o=(e.y+t.y)/2;return i[0]=n,i[1]=0,i[2]=0,i[3]=0,i[4]=r,i[5]=0,i[6]=s,i[7]=o,i[8]=1,this},isEmpty:function(){return 0===this.matrix[8]},add:function(){const t=new e(0,0),i=new e(0,0),n=new e(0,0),r=new e(0,0);return function(e){return this.isEmpty()?this.assign(e):e.isEmpty()?this:(this.getExtents(t,i),e.getExtents(n,r),this.set(t.min(n),i.max(r),!0))}}(),multLeft:function(t){return this.matrix.multLeft(t),this},multRight:function(t){return this.matrix.multRight(t),this},getExtents:function(t,e){this.getAbsoluteExtents(t,e),t.add(this.center),e.add(this.center)},getAbsoluteExtents:function(){const t=new e(0,0);return function(e,i){const n=this.matrix,r=n.xAxis,s=n.yAxis;t.assign(r).add(s);const o=s.subtract(r);e.assign(t).min(o),i.assign(t).max(o),t.negate(),o.negate(),e.min(t,o),i.max(t,o)}}(),containsPoint:function(){const t=new e(0,0),i=new e(0,0);return function(e){return this.getExtents(t,i),t.x<=e.x&&i.x>=e.x&&t.y<=e.y&&i.y>=e.y}}(),toString:function(){return this.size+", "+this.center}},Object.defineProperty(i.prototype,"size",{get:function(){const t=new e(0,0),i=new e(0,0);return function(){return this.getAbsoluteExtents(t,i),i.subtract(t)}}(),enumerable:!0,configurable:!1}),Object.defineProperty(i.prototype,"center",{get:function(){return this.matrix.origin},enumerable:!0,configurable:!1}),i}),define("x_ite/Browser/Text/X3DTextGeometry",["x_ite/Browser/Text/TextAlignment","standard/Math/Geometry/Box2","standard/Math/Geometry/Box3","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3"],function(t,e,i,n,r){"use strict";function s(t,e){this.text=t,this.fontStyle=e,this.glyphs=[],this.minorAlignment=new n(0,0),this.translations=[],this.charSpacings=[],this.bearing=new n(0,0),this.yPad=[],this.bbox=new i}var o=new e,a=new e,u=new n(0,0),l=new n(0,0),c=new n(0,0),h=new n(0,0),d=new r(0,0,0),p=new r(0,0,0),f=new n(0,0),g=new n(0,0),m=new n(0,0),_=new n(0,0),x=new n(0,0),y=new r(0,0,0),v=new n(0,0),w=new e,b=new n(0,0),S=new r(0,0,0);return s.prototype={constructor:s,getBrowser:function(){return this.text.getBrowser()},getText:function(){return this.text},getFontStyle:function(){return this.fontStyle},getGlyphs:function(){return this.glyphs},getMinorAlignment:function(){return this.minorAlignment},getTranslations:function(){return this.translations},getCharSpacings:function(){return this.charSpacings},getBearing:function(){return this.bearing},getBBox:function(){return this.bbox},update:function(){var t=this.text,e=this.fontStyle,i=t.string_.length;if(t.lineBounds_.length=i,this.glyphs.length=0,
|
|
29
|
-
0===i||!e.getFont())return t.origin_.setValue(S),t.textBounds_.setValue(b),void this.bbox.set();if(e.horizontal_.getValue())this.resizeArray(this.translations,i),this.resizeArray(this.charSpacings,i),this.horizontal(t,e);else{for(var n=t.string_,r=0,s=0,o=n.length;s<o;++s)r+=n[s].length;this.resizeArray(this.translations,r),this.resizeArray(this.charSpacings,r),this.vertical(t,e)}},resizeArray:function(t,e){for(var i=t.length;i<e;++i)t.push(new n(0,0));t.length=e},horizontal:function(e,i){var n=i.getFont(),r=e.string_,s=r.length,a=Math.max(0,e.maxExtent_.getValue()),c=i.topToBottom_.getValue(),h=i.getScale(),_=i.spacing_.getValue();o.set();for(var v=c?0:s-1,b=c?s:-1,S=c?1:-1,C=v,T=0;C!==b;C+=S,++T){var F=r[C],O=this.getHorizontalLineExtents(i,F,u,l,T);f.assign(l).subtract(u);var N=0,E=e.getLength(C);switch(x.set(f.x*h,0==T?l.y-n.descender/n.unitsPerEm*h:_),a&&(E=E?Math.min(a,E):Math.min(a,f.x*h)),E&&(N=(E-x.x)/(O.length-1),x.x=E,f.x=E/h),this.charSpacings[T]=N,e.lineBounds_[C]=x,i.getMajorAlignment()){case t.BEGIN:case t.FIRST:this.translations[T].set(0,-T*_);break;case t.MIDDLE:this.translations[T].set(-u.x-f.x/2,-T*_);break;case t.END:this.translations[T].set(-u.x-f.x,-T*_)}this.translations[T].multiply(h),g.assign(u).add(m.assign(f).divide(2)),o.add(w.set(f.multiply(h),g.multiply(h).add(this.translations[T])))}switch(o.getExtents(u,l),f.assign(l).subtract(u),e.textBounds_=f,this.bearing.set(0,-l.y),i.getMinorAlignment()){case t.BEGIN:this.minorAlignment.assign(this.bearing);break;case t.FIRST:this.minorAlignment.set(0,0);break;case t.MIDDLE:this.minorAlignment.set(0,f.y/2-l.y);break;case t.END:this.minorAlignment.set(0,(s-1)*_*h)}u.add(this.minorAlignment),l.add(this.minorAlignment),e.origin_.setValue(y.set(u.x,l.y,0)),this.bbox.setExtents(d.set(u.x,u.y,0),p.set(l.x,l.y,0))},vertical:function(e,i){var r=i.getFont(),s=e.string_,h=s.length,b=Math.max(0,e.maxExtent_.getValue()),S=i.leftToRight_.getValue(),C=i.topToBottom_.getValue(),T=i.getScale(),F=i.spacing_.getValue(),O=this.yPad,N=this.getBrowser().getBrowserOptions().getPrimitiveQuality();o.set();for(var E=S?0:h-1,M=S?h:-1,D=S?1:-1,V=0,I=E;I!==M;I+=D){var B=this.stringToGlyphs(r,s[I],!0,I),A=V,P=B.length;a.set();for(var L=C?0:P-1,R=C?P:-1,k=C?1:-1,U=L;U!==R;U+=k,++V){var X=B[U];this.getGlyphExtents(r,X,N,u,l),f.assign(l).subtract(u);var j=C?U:P-U-1;this.translations[V].set((F-f.x-u.x)/2,-j),g.assign(u).add(m.assign(f).divide(2)).add(this.translations[V]),a.add(w.set(f,g))}a.getExtents(u,l),f.assign(l).subtract(u);var z=S?I:h-I-1,G=(F-f.x)/2,H=0,q=e.getLength(I);switch(x.set(0===I?F-G:F,P?f.y:0).multiply(T),b&&(q=q?Math.min(b,q):Math.min(b,f.y*T)),q&&(H=(q-x.y)/(B.length-1)/T,x.y=q,f.y=q/T,u.y=l.y-f.y),e.lineBounds_[I]=x,i.getMajorAlignment()){case t.BEGIN:case t.FIRST:_.set(z*F,-1);break;case t.MIDDLE:_.set(z*F,f.y/2-l.y);break;case t.END:P&&this.getGlyphExtents(r,B[C?P-1:0],N,c.assign(n.Zero),v),_.set(z*F,f.y-l.y+c.y)}for(var W=0,Y=A;Y<V;++Y)this.translations[Y].add(_),this.translations[Y].y-=W,this.translations[Y].multiply(T),W+=H;switch(i.getMajorAlignment()){case t.BEGIN:case t.FIRST:O[I]=l.y+_.y;break;case t.MIDDLE:O[I]=0;break;case t.END:O[I]=u.y+_.y}g.assign(u).add(m.assign(f).divide(2)),o.add(w.set(f.multiply(T),g.add(_).multiply(T)))}switch(o.getExtents(u,l),f.assign(l).subtract(u),i.getMajorAlignment()){case t.BEGIN:case t.FIRST:for(var $=e.lineBounds_,Z=0,q=$.length;Z<q;++Z)$[Z].y+=l.y-O[Z]*T;break;case t.MIDDLE:break;case t.END:for(var $=e.lineBounds_,Z=0,q=$.length;Z<q;++Z)$[Z].y+=O[Z]*T-u.y}switch(e.textBounds_=f,i.getMajorAlignment()){case t.BEGIN:case t.FIRST:this.bearing.set(-u.x,l.y);break;case t.MIDDLE:this.bearing.set(-u.x,0);break;case t.END:this.bearing.set(-u.x,u.y)}switch(i.getMinorAlignment()){case t.BEGIN:case t.FIRST:this.minorAlignment.set(-u.x,0);break;case t.MIDDLE:this.minorAlignment.set(-u.x-f.x/2,0);break;case t.END:this.minorAlignment.set(-u.x-f.x,0)}u.add(this.minorAlignment),l.add(this.minorAlignment),e.origin_.setValue(y.set(u.x,l.y,0)),this.bbox.set(d.set(u.x,u.y,0),p.set(l.x,l.y,0),!0)},stringToGlyphs:function(t,e,i,n){var r=this.glyphs[n];r||(r=this.glyphs[n]=[]),r.length=e.length;for(var s=i?0:e.length-1,o=i?e.length:-1,a=i?1:-1,u=s,l=0;u!==o;u+=a,++l)r[l]=t.charToGlyph(e[u]);return r},getHorizontalLineExtents:function(e,i,n,r,s){for(var o=e.getFont(),a=e.horizontal_.getValue()?e.leftToRight_.getValue():e.topToBottom_.getValue(),u=this.stringToGlyphs(o,i,a,s),l=this.getBrowser().getBrowserOptions().getPrimitiveQuality(),d=0,p=0,f=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY,m=0,_=u.length;m<_;++m){var x=u[m],y=m+1<_?o.getKerningValue(x,u[m+1]):0;this.getGlyphExtents(o,x,l,c,h),p+=x.advanceWidth+y,f=Math.min(f,c.y),g=Math.max(g,h.y)}switch(u.length?(this.getGlyphExtents(o,u[0],l,c,h),d=c.x):(f=0,g=0),n.set(d,f),r.set(p/o.unitsPerEm,g),e.getMajorAlignment()){case t.BEGIN:case t.FIRST:n.x=0}return u},traverse:function(t,e){}},s}),define("standard/Math/Algorithms/Bezier",["standard/Math/Algorithm"],function(t){"use strict";function e(t,e,i,n,r,s,o,a){this.x0=t,this.y0=e,this.x1=i,this.y1=n,this.x2=r,this.y2=s,this.x3=o,this.y3=a,this.order=arguments.length/2-1}function i(t,e,i,n,s,o,a){const u=r(t,i,a),l=r(e,n,a),c=r(i,s,a),h=r(n,o,a);return{x:r(u,c,a),y:r(l,h,a)}}function n(t,e,i,n,s,o,a,u,l){const c=r(t,i,l),h=r(e,n,l),d=r(i,s,l),p=r(n,o,l),f=r(s,a,l),g=r(o,u,l),m=r(c,d,l),_=r(h,p,l),x=r(d,f,l),y=r(p,g,l);return{x:r(m,x,l),y:r(_,y,l)}}const r=t.lerp;return e.prototype={getLUT:function(t){const e=this.x0,r=this.y0,s=this.x1,o=this.y1,a=this.x2,u=this.y2,l=this.x3,c=this.y3,h=[];switch(this.order){case 2:for(let n=0,l=t-1;n<t;++n)h.push(i(e,r,s,o,a,u,n/l));break;case 3:for(let i=0,d=t-1;i<t;++i)h.push(n(e,r,s,o,a,u,l,c,i/d))}return h}},e}),define("x_ite/Browser/Text/PolygonText",["x_ite/Browser/Core/PrimitiveQuality","x_ite/Browser/Text/X3DTextGeometry","x_ite/Components/Rendering/X3DGeometryNode","standard/Math/Numbers/Vector3","standard/Math/Numbers/Matrix4","standard/Math/Geometry/Triangle3","standard/Math/Algorithms/Bezier"],function(t,e,i,n,r,s,o){"use strict";function a(t,n){e.call(this,t,n),t.transparent_=!1,this.texCoordArray=i.createArray()}return a.prototype=Object.assign(Object.create(e.prototype),{constructor:a,getTransparent:function(){return!1},getMatrix:function(){return r.Identity},build:function(){var t=new n(0,0,0),e=new n(0,0,0);return function(){var i=this.getFontStyle(),n=i.getFont();if(n){var r=this.getText(),s=this.getGlyphs(),o=this.getMinorAlignment(),a=this.getTranslations(),u=this.getCharSpacings(),l=i.getScale(),c=i.spacing_.getValue(),h=r.origin_.getValue(),d=l/n.unitsPerEm,p=this.getBrowser().getBrowserOptions().getPrimitiveQuality(),f=this.texCoordArray,g=r.getNormals(),m=r.getVertices();if(r.getMultiTexCoords().push(f),this.getBBox().getExtents(t,e),r.getMin().assign(t),r.getMax().assign(e),i.horizontal_.getValue())for(var _=0,x=s.length;_<x;++_)for(var y=s[_],v=u[_],w=a[_],b=0,S=0,C=y.length;S<C;++S){for(var T=y[S],F=this.getGlyphGeometry(n,T,p),O=o.x+w.x+b+S*v,N=o.y+w.y,E=0,M=F.length;E<M;++E){var D=F[E].x*l+O,V=F[E].y*l+N;f.push((D-h.x)/c,(V-h.y)/c,0,1),g.push(0,0,1),m.push(D,V,0,1)}var I=0;S+1<y.length&&(I=n.getKerningValue(T,y[S+1])),b+=(T.advanceWidth+I)*d}else for(var B=i.leftToRight_.getValue(),A=i.topToBottom_.getValue(),P=B?0:r.string_.length-1,L=B?r.string_.length:-1,R=B?1:-1,_=P,k=0;_!==L;_+=R)for(var y=s[_],U=y.length,X=A?0:U-1,j=A?U:-1,z=A?1:-1,S=X;S!==j;S+=z,++k)for(var w=a[k],F=this.getGlyphGeometry(n,y[S],p),E=0,M=F.length;E<M;++E){var D=F[E].x*l+o.x+w.x,V=F[E].y*l+o.y+w.y;f.push((D-h.x)/c,(V-h.y)/c,0,1),g.push(0,0,1),m.push(D,V,0,1)}}}}(),getGlyphExtents:function(t,e,i,n,r){var s=this.getBrowser().getGlyph(t,i,e.index),o=s.extents;if(o)return n.assign(o.min),void r.assign(o.max);var a=this.getGlyphGeometry(t,e,i);if(a.length){var u=a[0];n.assign(u),r.assign(u);for(var l=1,c=a.length;l<c;++l){var u=a[l];n.min(u),r.max(u)}}else n.set(0,0,0),r.set(0,0,0);var o=s.extents={};o.min=n.copy(),o.max=r.copy()},getGlyphGeometry:function(t,e,i){var n=this.getBrowser().getGlyph(t,i,e.index),r=n.geometry;return r?r:(r=n.geometry=[],this.createGlyphGeometry(e,r,i),r)},createGlyphGeometry:function(){var t=[],e=[],i=new n(0,0,0);return function(r,a,u){var l=this.getBezierDimension(u),c=r.getPath(0,0,1),h=c.commands,d=0,p=0;t.length=0,e.length=0;for(var f=0,g=h.length;f<g;++f){var m=h[f];switch(m.type){case"M":case"Z":t.length>2&&(t[0].x===t.at(-1).x&&t[0].y===t.at(-1).y&&t.pop(),e.push(t)),t=[],"M"===m.type&&t.push(new n(m.x,-m.y,0));break;case"L":t.push(new n(m.x,-m.y,0));break;case"Q":for(var _=new o(d,-p,m.x1,-m.y1,m.x,-m.y),x=_.getLUT(l),y=1,v=x.length;y<v;++y)t.push(new n(x[y].x,x[y].y,0));break;case"C":for(var _=new o(d,-p,m.x1,-m.y1,m.x2,-m.y2,m.x,-m.y),x=_.getLUT(l),y=1,v=x.length;y<v;++y)t.push(new n(x[y].x,x[y].y,0));break;default:continue}d=m.x,p=m.y}e=e.map(function(t){return s.getPolygonNormal(t,i),i.dot(n.zAxis)>0?t:t.reverse()}),e.push(a),s.triangulatePolygon.apply(s,e)}}(),getBezierDimension:function(e){switch(e){case t.LOW:return 3;case t.HIGH:return 7;default:return 5}},display:function(t,e){},transformLine:function(t){},transformMatrix:function(t){}}),a}),define("x_ite/Components/Text/FontStyle",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Text/X3DFontStyleNode","x_ite/Browser/Text/PolygonText","x_ite/Bits/X3DConstants"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(s.FontStyle),this.size_.setUnit("length")}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.initializeOnly,"language",new t.SFString),new e(s.initializeOnly,"family",new t.MFString("SERIF")),new e(s.initializeOnly,"style",new t.SFString("PLAIN")),new e(s.initializeOnly,"size",new t.SFFloat(1)),new e(s.initializeOnly,"spacing",new t.SFFloat(1)),new e(s.initializeOnly,"horizontal",new t.SFBool(!0)),new e(s.initializeOnly,"leftToRight",new t.SFBool(!0)),new e(s.initializeOnly,"topToBottom",new t.SFBool(!0)),new e(s.initializeOnly,"justify",new t.MFString("BEGIN"))]),getTypeName:function(){return"FontStyle"},getComponentName:function(){return"Text"},getContainerField:function(){return"fontStyle"},getTextGeometry:function(t){return new r(t,this)},getScale:function(){return this.size_.getValue()}}),o}),function(t,e){"object"==typeof exports&&void 0!==module?e(exports):"function"==typeof define&&define.amd?define("opentype/dist/opentype",["exports"],e):(t=t||self,e(t.opentype={}))}(this,function(t){"use strict";function e(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function i(t,i){this.source=t,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=i,this.destLen=0,this.ltree=new e,this.dtree=new e}function n(t,e,i,n){var r,s;for(r=0;r<i;++r)t[r]=0;for(r=0;r<30-i;++r)t[r+i]=r/i|0;for(s=n,r=0;r<30;++r)e[r]=s,s+=1<<t[r]}function r(t,e,i,n){var r,s;for(r=0;r<16;++r)t.table[r]=0;for(r=0;r<n;++r)t.table[e[i+r]]++;for(t.table[0]=0,s=0,r=0;r<16;++r)ws[r]=s,s+=t.table[r];for(r=0;r<n;++r)e[i+r]&&(t.trans[ws[e[i+r]]++]=r)}function s(t){t.bitcount--||(t.tag=t.source[t.sourceIndex++],t.bitcount=7);var e=1&t.tag;return t.tag>>>=1,e}function o(t,e,i){if(!e)return i;for(;t.bitcount<24;)t.tag|=t.source[t.sourceIndex++]<<t.bitcount,t.bitcount+=8;var n=t.tag&65535>>>16-e;return t.tag>>>=e,t.bitcount-=e,n+i}function a(t,e){for(;t.bitcount<24;)t.tag|=t.source[t.sourceIndex++]<<t.bitcount,t.bitcount+=8;var i=0,n=0,r=0,s=t.tag;do n=2*n+(1&s),s>>>=1,++r,i+=e.table[r],n-=e.table[r];while(n>=0)return t.tag=s,t.bitcount-=r,e.trans[i+n]}function u(t,e,i){var n,s,u,l,c,h;for(n=o(t,5,257),s=o(t,5,1),u=o(t,4,4),l=0;l<19;++l)vs[l]=0;for(l=0;l<u;++l){var d=o(t,3,0);vs[xs[l]]=d}for(r(ys,vs,0,19),c=0;c<n+s;){var p=a(t,ys);switch(p){case 16:var f=vs[c-1];for(h=o(t,2,3);h;--h)vs[c++]=f;break;case 17:for(h=o(t,3,3);h;--h)vs[c++]=0;break;case 18:for(h=o(t,7,11);h;--h)vs[c++]=0;break;default:vs[c++]=p}}r(e,vs,0,n),r(i,vs,n,s)}function l(t,e,i){for(;;){var n=a(t,e);if(256===n)return cs;if(n<256)t.dest[t.destLen++]=n;else{var r,s,u,l;for(n-=257,r=o(t,fs[n],gs[n]),s=a(t,i),u=t.destLen-o(t,ms[s],_s[s]),l=u;l<u+r;++l)t.dest[t.destLen++]=t.dest[l]}}}function c(t){for(var e,i,n;t.bitcount>8;)t.sourceIndex--,t.bitcount-=8;if(e=t.source[t.sourceIndex+1],e=256*e+t.source[t.sourceIndex],i=t.source[t.sourceIndex+3],i=256*i+t.source[t.sourceIndex+2],e!==(65535&~i))return hs;for(t.sourceIndex+=4,n=e;n;--n)t.dest[t.destLen++]=t.source[t.sourceIndex++];return t.bitcount=0,cs}function h(t,e){var n,r,a=new i(t,e);do{switch(n=s(a),o(a,2,0)){case 0:r=c(a);break;case 1:r=l(a,ds,ps);break;case 2:u(a,a.ltree,a.dtree),r=l(a,a.ltree,a.dtree);break;default:r=hs}if(r!==cs)throw new Error("Data error")}while(!n)return a.destLen<a.dest.length?"function"==typeof a.dest.slice?a.dest.slice(0,a.destLen):a.dest.subarray(0,a.destLen):a.dest}function d(t,e,i,n,r){return Math.pow(1-r,3)*t+3*Math.pow(1-r,2)*r*e+3*(1-r)*Math.pow(r,2)*i+Math.pow(r,3)*n}function p(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}function f(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}function g(t){throw new Error(t)}function m(t,e){t||g(e)}function _(t){return function(){return t}}function x(t){return t>=-128&&t<=127}function y(t,e,i){for(var n=0,r=t.length;e<r&&n<64&&0===t[e];)++e,++n;return i.push(128|n-1),e}function v(t,e,i){for(var n=0,r=t.length,s=e;s<r&&n<64;){var o=t[s];if(!x(o))break;if(0===o&&s+1<r&&0===t[s+1])break;++s,++n}i.push(n-1);for(var a=e;a<s;++a)i.push(t[a]+256&255);return s}function w(t,e,i){for(var n=0,r=t.length,s=e;s<r&&n<64;){var o=t[s];if(0===o)break;if(x(o)&&s+1<r&&x(t[s+1]))break;++s,++n}i.push(64|n-1);for(var a=e;a<s;++a){var u=t[a];i.push(u+65536>>8&255,u+256&255)}return s}function b(t,e,i){if(e.length&&("coverageFormat"!==e[0].name||1===e[0].value))for(var n=0;n<e.length;n+=1){var r=e[n];this[r.name]=r.value}if(this.tableName=t,this.fields=e,i)for(var s=Object.keys(i),o=0;o<s.length;o+=1){var a=s[o],u=i[a];void 0!==this[a]&&(this[a]=u)}}function S(t,e,i){void 0===i&&(i=e.length);var n=new Array(e.length+1);n[0]={name:t+"Count",type:"USHORT",value:i};for(var r=0;r<e.length;r++)n[r+1]={name:t+r,type:"USHORT",value:e[r]};return n}function C(t,e,i){var n=e.length,r=new Array(n+1);r[0]={name:t+"Count",type:"USHORT",value:n};for(var s=0;s<n;s++)r[s+1]={name:t+s,type:"TABLE",value:i(e[s],s)};return r}function T(t,e,i){var n=e.length,r=[];r[0]={name:t+"Count",type:"USHORT",value:n};for(var s=0;s<n;s++)r=r.concat(i(e[s],s));return r}function F(t){1===t.format?b.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:1}].concat(S("glyph",t.glyphs))):2===t.format?b.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:2}].concat(T("rangeRecord",t.ranges,function(t){return[{name:"startGlyphID",type:"USHORT",value:t.start},{name:"endGlyphID",type:"USHORT",value:t.end},{name:"startCoverageIndex",type:"USHORT",value:t.index}]}))):Ss.assert(!1,"Coverage format must be 1 or 2.")}function O(t){b.call(this,"scriptListTable",T("scriptRecord",t,function(t,e){var i=t.script,n=i.defaultLangSys;return Ss.assert(!!n,"Unable to write GSUB: script "+t.tag+" has no default language system."),[{name:"scriptTag"+e,type:"TAG",value:t.tag},{name:"script"+e,type:"TABLE",value:new b("scriptTable",[{name:"defaultLangSys",type:"TABLE",value:new b("defaultLangSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:n.reqFeatureIndex}].concat(S("featureIndex",n.featureIndexes)))}].concat(T("langSys",i.langSysRecords,function(t,e){var i=t.langSys;return[{name:"langSysTag"+e,type:"TAG",value:t.tag},{name:"langSys"+e,type:"TABLE",value:new b("langSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:i.reqFeatureIndex}].concat(S("featureIndex",i.featureIndexes)))}]})))}]}))}function N(t){b.call(this,"featureListTable",T("featureRecord",t,function(t,e){var i=t.feature;return[{name:"featureTag"+e,type:"TAG",value:t.tag},{name:"feature"+e,type:"TABLE",value:new b("featureTable",[{name:"featureParams",type:"USHORT",value:i.featureParams}].concat(S("lookupListIndex",i.lookupListIndexes)))}]}))}function E(t,e){b.call(this,"lookupListTable",C("lookup",t,function(t){var i=e[t.lookupType];return Ss.assert(!!i,"Unable to write GSUB lookup type "+t.lookupType+" tables."),new b("lookupTable",[{name:"lookupType",type:"USHORT",value:t.lookupType},{name:"lookupFlag",type:"USHORT",value:t.lookupFlag}].concat(C("subtable",t.subtables,i)))}))}function M(t,e){return t.getUint8(e)}function D(t,e){return t.getUint16(e,!1)}function V(t,e){return t.getInt16(e,!1)}function I(t,e){return t.getUint32(e,!1)}function B(t,e){return t.getInt16(e,!1)+t.getUint16(e+2,!1)/65535}function A(t,e){for(var i="",n=e;n<e+4;n+=1)i+=String.fromCharCode(t.getInt8(n));return i}function P(t,e,i){for(var n=0,r=0;r<i;r+=1)n<<=8,n+=t.getUint8(e+r);return n}function L(t,e,i){for(var n=[],r=e;r<i;r+=1)n.push(t.getUint8(r));return n}function R(t){for(var e="",i=0;i<t.length;i+=1)e+=String.fromCharCode(t[i]);return e}function k(t,e){this.data=t,this.offset=e,this.relativeOffset=0}function U(t,e){e.parseUShort(),t.length=e.parseULong(),t.language=e.parseULong();var i;t.groupCount=i=e.parseULong(),t.glyphIndexMap={};for(var n=0;n<i;n+=1)for(var r=e.parseULong(),s=e.parseULong(),o=e.parseULong(),a=r;a<=s;a+=1)t.glyphIndexMap[a]=o,o++}function X(t,e,i,n,r){t.length=e.parseUShort(),t.language=e.parseUShort();var s;t.segCount=s=e.parseUShort()>>1,e.skip("uShort",3),t.glyphIndexMap={};for(var o=new As.Parser(i,n+r+14),a=new As.Parser(i,n+r+16+2*s),u=new As.Parser(i,n+r+16+4*s),l=new As.Parser(i,n+r+16+6*s),c=n+r+16+8*s,h=0;h<s-1;h+=1)for(var d=void 0,p=o.parseUShort(),f=a.parseUShort(),g=u.parseShort(),m=l.parseUShort(),_=f;_<=p;_+=1)0!==m?(c=l.offset+l.relativeOffset-2,c+=m,c+=2*(_-f),0!==(d=As.getUShort(i,c))&&(d=d+g&65535)):d=_+g&65535,t.glyphIndexMap[_]=d}function j(t,e){var i={};i.version=As.getUShort(t,e),Ss.argument(0===i.version,"cmap table version should be 0."),i.numTables=As.getUShort(t,e+2);for(var n=-1,r=i.numTables-1;r>=0;r-=1){var s=As.getUShort(t,e+4+8*r),o=As.getUShort(t,e+4+8*r+2);if(3===s&&(0===o||1===o||10===o)||0===s&&(0===o||1===o||2===o||3===o||4===o)){n=As.getULong(t,e+4+8*r+4);break}}if(n===-1)throw new Error("No valid cmap sub-tables found.");var a=new As.Parser(t,e+n);if(i.format=a.parseUShort(),12===i.format)U(i,a);else{if(4!==i.format)throw new Error("Only format 4 and 12 cmap tables are supported (found format "+i.format+").");X(i,a,t,e,n)}return i}function z(t,e,i){t.segments.push({end:e,start:e,delta:-(e-i),offset:0,glyphIndex:i})}function G(t){t.segments.push({end:65535,start:65535,delta:1,offset:0})}function H(t){var e,i=!0;for(e=t.length-1;e>0;e-=1){if(t.get(e).unicode>65535){console.log("Adding CMAP format 12 (needed!)"),i=!1;break}}var n=[{name:"version",type:"USHORT",value:0},{name:"numTables",type:"USHORT",value:i?1:2},{name:"platformID",type:"USHORT",value:3},{name:"encodingID",type:"USHORT",value:1},{name:"offset",type:"ULONG",value:i?12:20}];i||(n=n.concat([{name:"cmap12PlatformID",type:"USHORT",value:3},{name:"cmap12EncodingID",type:"USHORT",value:10},{name:"cmap12Offset",type:"ULONG",value:0}])),n=n.concat([{name:"format",type:"USHORT",value:4},{name:"cmap4Length",type:"USHORT",value:0},{name:"language",type:"USHORT",value:0},{name:"segCountX2",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);var r=new Vs.Table("cmap",n);for(r.segments=[],e=0;e<t.length;e+=1){for(var s=t.get(e),o=0;o<s.unicodes.length;o+=1)z(r,s.unicodes[o],e);r.segments=r.segments.sort(function(t,e){return t.start-e.start})}G(r);var a=r.segments.length,u=0,l=[],c=[],h=[],d=[],p=[],f=[];for(e=0;e<a;e+=1){var g=r.segments[e];g.end<=65535&&g.start<=65535?(l=l.concat({name:"end_"+e,type:"USHORT",value:g.end}),c=c.concat({name:"start_"+e,type:"USHORT",value:g.start}),h=h.concat({name:"idDelta_"+e,type:"SHORT",value:g.delta}),d=d.concat({name:"idRangeOffset_"+e,type:"USHORT",value:g.offset}),void 0!==g.glyphId&&(p=p.concat({name:"glyph_"+e,type:"USHORT",value:g.glyphId}))):u+=1,i||void 0===g.glyphIndex||(f=f.concat({name:"cmap12Start_"+e,type:"ULONG",value:g.start}),f=f.concat({name:"cmap12End_"+e,type:"ULONG",value:g.end}),f=f.concat({name:"cmap12Glyph_"+e,type:"ULONG",value:g.glyphIndex}))}if(r.segCountX2=2*(a-u),r.searchRange=2*Math.pow(2,Math.floor(Math.log(a-u)/Math.log(2))),r.entrySelector=Math.log(r.searchRange/2)/Math.log(2),r.rangeShift=r.segCountX2-r.searchRange,r.fields=r.fields.concat(l),r.fields.push({name:"reservedPad",type:"USHORT",value:0}),r.fields=r.fields.concat(c),r.fields=r.fields.concat(h),r.fields=r.fields.concat(d),r.fields=r.fields.concat(p),r.cmap4Length=14+2*l.length+2+2*c.length+2*h.length+2*d.length+2*p.length,!i){var m=16+4*f.length;r.cmap12Offset=20+r.cmap4Length,r.fields=r.fields.concat([{name:"cmap12Format",type:"USHORT",value:12},{name:"cmap12Reserved",type:"USHORT",value:0},{name:"cmap12Length",type:"ULONG",value:m},{name:"cmap12Language",type:"ULONG",value:0},{name:"cmap12nGroups",type:"ULONG",value:f.length/3}]),r.fields=r.fields.concat(f)}return r}function q(t){this.font=t}function W(t){this.cmap=t}function Y(t,e){this.encoding=t,this.charset=e}function $(t){switch(t.version){case 1:this.names=Us.slice();break;case 2:this.names=new Array(t.numberOfGlyphs);for(var e=0;e<t.numberOfGlyphs;e++)t.glyphNameIndex[e]<Us.length?this.names[e]=Us[t.glyphNameIndex[e]]:this.names[e]=t.names[t.glyphNameIndex[e]-Us.length];break;case 2.5:this.names=new Array(t.numberOfGlyphs);for(var i=0;i<t.numberOfGlyphs;i++)this.names[i]=Us[i+t.glyphNameIndex[i]];break;case 3:this.names=[];break;default:this.names=[]}}function Z(t){for(var e,i=t.tables.cmap.glyphIndexMap,n=Object.keys(i),r=0;r<n.length;r+=1){var s=n[r],o=i[s];e=t.glyphs.get(o),e.addUnicode(parseInt(s))}for(var a=0;a<t.glyphs.length;a+=1)e=t.glyphs.get(a),t.cffEncoding?t.isCIDFont?e.name="gid"+a:e.name=t.cffEncoding.charset[a]:t.glyphNames.names&&(e.name=t.glyphNames.glyphIndexToName(a))}function Q(t){t._IndexToUnicodeMap={};for(var e=t.tables.cmap.glyphIndexMap,i=Object.keys(e),n=0;n<i.length;n+=1){var r=i[n],s=e[r];void 0===t._IndexToUnicodeMap[s]?t._IndexToUnicodeMap[s]={unicodes:[parseInt(r)]}:t._IndexToUnicodeMap[s].unicodes.push(parseInt(r))}}function K(t,e){e.lowMemory?Q(t):Z(t)}function J(t,e,i,n,r){t.beginPath(),t.moveTo(e,i),t.lineTo(n,r),t.stroke()}function tt(t,e){var i=e||new f;return{configurable:!0,get:function(){return"function"==typeof i&&(i=i()),i},set:function(t){i=t}}}function et(t){this.bindConstructorValues(t)}function it(t,e,i){Object.defineProperty(t,e,{get:function(){return t.path,t[i]},set:function(e){t[i]=e},enumerable:!0,configurable:!0})}function nt(t,e){if(this.font=t,this.glyphs={},Array.isArray(e))for(var i=0;i<e.length;i++){var n=e[i];n.path.unitsPerEm=t.unitsPerEm,this.glyphs[i]=n}this.length=e&&e.length||0}function rt(t,e){return new et({index:e,font:t})}function st(t,e,i,n,r,s){return function(){var o=new et({index:e,font:t});return o.path=function(){i(o,n,r);var e=s(t.glyphs,o);return e.unitsPerEm=t.unitsPerEm,e},it(o,"xMin","_xMin"),it(o,"xMax","_xMax"),it(o,"yMin","_yMin"),it(o,"yMax","_yMax"),o}}function ot(t,e,i,n){return function(){var r=new et({index:e,font:t});return r.path=function(){var e=i(t,r,n);return e.unitsPerEm=t.unitsPerEm,e},r}}function at(t,e){if(t===e)return!0;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(var i=0;i<t.length;i+=1)if(!at(t[i],e[i]))return!1;return!0}return!1}function ut(t){return t.length<1240?107:t.length<33900?1131:32768}function lt(t,e,i){var n,r,s=[],o=[],a=As.getCard16(t,e);if(0!==a){var u=As.getByte(t,e+2);n=e+(a+1)*u+2;for(var l=e+3,c=0;c<a+1;c+=1)s.push(As.getOffset(t,l,u)),l+=u;r=n+s[a]}else r=e+2;for(var h=0;h<s.length-1;h+=1){var d=As.getBytes(t,n+s[h],n+s[h+1]);i&&(d=i(d)),o.push(d)}return{objects:o,startOffset:e,endOffset:r}}function ct(t,e){var i,n,r=[],s=As.getCard16(t,e);if(0!==s){var o=As.getByte(t,e+2);i=e+(s+1)*o+2;for(var a=e+3,u=0;u<s+1;u+=1)r.push(As.getOffset(t,a,o)),a+=o;n=i+r[s]}else n=e+2;return{offsets:r,startOffset:e,endOffset:n}}function ht(t,e,i,n,r){var s=As.getCard16(i,n),o=0;if(0!==s){o=n+(s+1)*As.getByte(i,n+2)+2}var a=As.getBytes(i,o+e[t],o+e[t+1]);return r&&(a=r(a)),a}function dt(t){for(var e="",i=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];;){var n=t.parseByte(),r=n>>4,s=15&n;if(15===r)break;if(e+=i[r],15===s)break;e+=i[s]}return parseFloat(e)}function pt(t,e){var i,n,r,s;if(28===e)return i=t.parseByte(),n=t.parseByte(),i<<8|n;if(29===e)return i=t.parseByte(),n=t.parseByte(),r=t.parseByte(),s=t.parseByte(),i<<24|n<<16|r<<8|s;if(30===e)return dt(t);if(e>=32&&e<=246)return e-139;if(e>=247&&e<=250)return i=t.parseByte(),256*(e-247)+i+108;if(e>=251&&e<=254)return i=t.parseByte(),256*-(e-251)-i-108;throw new Error("Invalid b0 "+e)}function ft(t){for(var e={},i=0;i<t.length;i+=1){var n=t[i][0],r=t[i][1],s=void 0;if(s=1===r.length?r[0]:r,e.hasOwnProperty(n)&&!isNaN(e[n]))throw new Error("Object "+e+" already has key "+n);e[n]=s}return e}function gt(t,e,i){e=void 0!==e?e:0;var n=new As.Parser(t,e),r=[],s=[];for(i=void 0!==i?i:t.length;n.relativeOffset<i;){var o=n.parseByte();o<=21?(12===o&&(o=1200+n.parseByte()),r.push([o,s]),s=[]):s.push(pt(n,o))}return ft(r)}function mt(t,e){return e=e<=390?Ls[e]:t[e-391]}function _t(t,e,i){for(var n,r={},s=0;s<e.length;s+=1){var o=e[s];if(Array.isArray(o.type)){var a=[];a.length=o.type.length;for(var u=0;u<o.type.length;u++)n=void 0!==t[o.op]?t[o.op][u]:void 0,void 0===n&&(n=void 0!==o.value&&void 0!==o.value[u]?o.value[u]:null),"SID"===o.type[u]&&(n=mt(i,n)),a[u]=n;r[o.name]=a}else n=t[o.op],void 0===n&&(n=void 0!==o.value?o.value:null),"SID"===o.type&&(n=mt(i,n)),r[o.name]=n}return r}function xt(t,e){var i={};return i.formatMajor=As.getCard8(t,e),i.formatMinor=As.getCard8(t,e+1),i.size=As.getCard8(t,e+2),i.offsetSize=As.getCard8(t,e+3),i.startOffset=e,i.endOffset=e+4,i}function yt(t,e){return _t(gt(t,0,t.byteLength),zs,e)}function vt(t,e,i,n){return _t(gt(t,e,i),Gs,n)}function wt(t,e,i,n){for(var r=[],s=0;s<i.length;s+=1){var o=new DataView(new Uint8Array(i[s]).buffer),a=yt(o,n);a._subrs=[],a._subrsBias=0,a._defaultWidthX=0,a._nominalWidthX=0;var u=a.private[0],l=a.private[1];if(0!==u&&0!==l){var c=vt(t,l+e,u,n);if(a._defaultWidthX=c.defaultWidthX,a._nominalWidthX=c.nominalWidthX,0!==c.subrs){var h=l+c.subrs,d=lt(t,h+e);a._subrs=d.objects,a._subrsBias=ut(a._subrs)}a._privateDict=c}r.push(a)}return r}function bt(t,e,i,n){var r,s,o=new As.Parser(t,e);i-=1;var a=[".notdef"],u=o.parseCard8();if(0===u)for(var l=0;l<i;l+=1)r=o.parseSID(),a.push(mt(n,r));else if(1===u)for(;a.length<=i;){r=o.parseSID(),s=o.parseCard8();for(var c=0;c<=s;c+=1)a.push(mt(n,r)),r+=1}else{if(2!==u)throw new Error("Unknown charset format "+u);for(;a.length<=i;){r=o.parseSID(),s=o.parseCard16();for(var h=0;h<=s;h+=1)a.push(mt(n,r)),r+=1}}return a}function St(t,e,i){var n,r={},s=new As.Parser(t,e),o=s.parseCard8();if(0===o)for(var a=s.parseCard8(),u=0;u<a;u+=1)n=s.parseCard8(),r[n]=u;else{if(1!==o)throw new Error("Unknown encoding format "+o);var l=s.parseCard8();n=1;for(var c=0;c<l;c+=1)for(var h=s.parseCard8(),d=s.parseCard8(),p=h;p<=h+d;p+=1)r[p]=n,n+=1}return new Y(r,i)}function Ct(t,e,i){function n(t,e){y&&g.closePath(),g.moveTo(t,e),y=!0}function r(){var t;t=m.length%2!=0,t&&!x&&(C=m.shift()+p),_+=m.length>>1,m.length=0,x=!0}function s(i){for(var d,f,b,S,T,F,O,N,E,M,D,V,I=0;I<i.length;){var B=i[I];switch(I+=1,B){case 1:r();break;case 3:r();break;case 4:m.length>1&&!x&&(C=m.shift()+p,x=!0),w+=m.pop(),n(v,w);break;case 5:for(;m.length>0;)v+=m.shift(),w+=m.shift(),g.lineTo(v,w);break;case 6:for(;m.length>0&&(v+=m.shift(),g.lineTo(v,w),0!==m.length);)w+=m.shift(),g.lineTo(v,w);break;case 7:for(;m.length>0&&(w+=m.shift(),g.lineTo(v,w),0!==m.length);)v+=m.shift(),g.lineTo(v,w);break;case 8:for(;m.length>0;)o=v+m.shift(),a=w+m.shift(),u=o+m.shift(),l=a+m.shift(),v=u+m.shift(),w=l+m.shift(),g.curveTo(o,a,u,l,v,w);break;case 10:T=m.pop()+h,F=c[T],F&&s(F);break;case 11:return;case 12:switch(B=i[I],I+=1,B){case 35:o=v+m.shift(),a=w+m.shift(),u=o+m.shift(),l=a+m.shift(),O=u+m.shift(),N=l+m.shift(),E=O+m.shift(),M=N+m.shift(),D=E+m.shift(),V=M+m.shift(),v=D+m.shift(),w=V+m.shift(),m.shift(),g.curveTo(o,a,u,l,O,N),g.curveTo(E,M,D,V,v,w);break;case 34:o=v+m.shift(),a=w,u=o+m.shift(),l=a+m.shift(),O=u+m.shift(),N=l,E=O+m.shift(),M=l,D=E+m.shift(),V=w,v=D+m.shift(),g.curveTo(o,a,u,l,O,N),g.curveTo(E,M,D,V,v,w);break;case 36:o=v+m.shift(),a=w+m.shift(),u=o+m.shift(),l=a+m.shift(),O=u+m.shift(),N=l,E=O+m.shift(),M=l,D=E+m.shift(),V=M+m.shift(),v=D+m.shift(),g.curveTo(o,a,u,l,O,N),g.curveTo(E,M,D,V,v,w);break;case 37:o=v+m.shift(),a=w+m.shift(),u=o+m.shift(),l=a+m.shift(),O=u+m.shift(),N=l+m.shift(),E=O+m.shift(),M=N+m.shift(),D=E+m.shift(),V=M+m.shift(),Math.abs(D-v)>Math.abs(V-w)?v=D+m.shift():w=V+m.shift(),g.curveTo(o,a,u,l,O,N),g.curveTo(E,M,D,V,v,w);break;default:console.log("Glyph "+e.index+": unknown operator 1200"+B),m.length=0}break;case 14:m.length>0&&!x&&(C=m.shift()+p,x=!0),y&&(g.closePath(),y=!1);break;case 18:r();break;case 19:case 20:r(),I+=_+7>>3;break;case 21:m.length>2&&!x&&(C=m.shift()+p,x=!0),w+=m.pop(),v+=m.pop(),n(v,w);break;case 22:m.length>1&&!x&&(C=m.shift()+p,x=!0),v+=m.pop(),n(v,w);break;case 23:r();break;case 24:for(;m.length>2;)o=v+m.shift(),a=w+m.shift(),u=o+m.shift(),l=a+m.shift(),v=u+m.shift(),w=l+m.shift(),g.curveTo(o,a,u,l,v,w);v+=m.shift(),w+=m.shift(),g.lineTo(v,w);break;case 25:for(;m.length>6;)v+=m.shift(),w+=m.shift(),g.lineTo(v,w);o=v+m.shift(),a=w+m.shift(),u=o+m.shift(),l=a+m.shift(),v=u+m.shift(),w=l+m.shift(),g.curveTo(o,a,u,l,v,w);break;case 26:for(m.length%2&&(v+=m.shift());m.length>0;)o=v,a=w+m.shift(),u=o+m.shift(),l=a+m.shift(),v=u,w=l+m.shift(),g.curveTo(o,a,u,l,v,w);break;case 27:for(m.length%2&&(w+=m.shift());m.length>0;)o=v+m.shift(),a=w,u=o+m.shift(),l=a+m.shift(),v=u+m.shift(),w=l,g.curveTo(o,a,u,l,v,w);break;case 28:d=i[I],f=i[I+1],m.push((d<<24|f<<16)>>16),I+=2;break;case 29:T=m.pop()+t.gsubrsBias,F=t.gsubrs[T],F&&s(F);break;case 30:for(;m.length>0&&(o=v,a=w+m.shift(),u=o+m.shift(),l=a+m.shift(),v=u+m.shift(),w=l+(1===m.length?m.shift():0),g.curveTo(o,a,u,l,v,w),0!==m.length);)o=v+m.shift(),a=w,u=o+m.shift(),l=a+m.shift(),w=l+m.shift(),v=u+(1===m.length?m.shift():0),g.curveTo(o,a,u,l,v,w);break;case 31:for(;m.length>0&&(o=v+m.shift(),a=w,u=o+m.shift(),l=a+m.shift(),w=l+m.shift(),v=u+(1===m.length?m.shift():0),g.curveTo(o,a,u,l,v,w),0!==m.length);)o=v,a=w+m.shift(),u=o+m.shift(),l=a+m.shift(),v=u+m.shift(),w=l+(1===m.length?m.shift():0),g.curveTo(o,a,u,l,v,w);break;default:B<32?console.log("Glyph "+e.index+": unknown operator "+B):B<247?m.push(B-139):B<251?(d=i[I],I+=1,m.push(256*(B-247)+d+108)):B<255?(d=i[I],I+=1,m.push(256*-(B-251)-d-108)):(d=i[I],f=i[I+1],b=i[I+2],S=i[I+3],I+=4,m.push((d<<24|f<<16|b<<8|S)/65536))}}}var o,a,u,l,c,h,d,p,g=new f,m=[],_=0,x=!1,y=!1,v=0,w=0;if(t.isCIDFont){var b=t.tables.cff.topDict._fdSelect[e.index],S=t.tables.cff.topDict._fdArray[b];c=S._subrs,h=S._subrsBias,d=S._defaultWidthX,p=S._nominalWidthX}else c=t.tables.cff.topDict._subrs,h=t.tables.cff.topDict._subrsBias,d=t.tables.cff.topDict._defaultWidthX,p=t.tables.cff.topDict._nominalWidthX;var C=d;return s(i),e.advanceWidth=C,g}function Tt(t,e,i,n){var r,s=[],o=new As.Parser(t,e),a=o.parseCard8();if(0===a)for(var u=0;u<i;u++){if((r=o.parseCard8())>=n)throw new Error("CFF table CID Font FDSelect has bad FD index value "+r+" (FD count "+n+")");s.push(r)}else{if(3!==a)throw new Error("CFF Table CID Font FDSelect table has unsupported format "+a);var l=o.parseCard16(),c=o.parseCard16();if(0!==c)throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID "+c);for(var h,d=0;d<l;d++){
|
|
30
|
-
if(r=o.parseCard8(),h=o.parseCard16(),r>=n)throw new Error("CFF table CID Font FDSelect has bad FD index value "+r+" (FD count "+n+")");if(h>i)throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID "+h);for(;c<h;c++)s.push(r);c=h}if(h!==i)throw new Error("CFF Table CID Font FDSelect format 3 range has bad final GID "+h)}return s}function Ft(t,e,i,n){i.tables.cff={};var r=xt(t,e),s=lt(t,r.endOffset,As.bytesToString),o=lt(t,s.endOffset),a=lt(t,o.endOffset,As.bytesToString),u=lt(t,a.endOffset);i.gsubrs=u.objects,i.gsubrsBias=ut(i.gsubrs);var l=wt(t,e,o.objects,a.objects);if(1!==l.length)throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = "+l.length);var c=l[0];if(i.tables.cff.topDict=c,c._privateDict&&(i.defaultWidthX=c._privateDict.defaultWidthX,i.nominalWidthX=c._privateDict.nominalWidthX),void 0!==c.ros[0]&&void 0!==c.ros[1]&&(i.isCIDFont=!0),i.isCIDFont){var h=c.fdArray,d=c.fdSelect;if(0===h||0===d)throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");h+=e;var p=lt(t,h),f=wt(t,e,p.objects,a.objects);c._fdArray=f,d+=e,c._fdSelect=Tt(t,d,i.numGlyphs,f.length)}var g=e+c.private[1],m=vt(t,g,c.private[0],a.objects);if(i.defaultWidthX=m.defaultWidthX,i.nominalWidthX=m.nominalWidthX,0!==m.subrs){var _=g+m.subrs,x=lt(t,_);i.subrs=x.objects,i.subrsBias=ut(i.subrs)}else i.subrs=[],i.subrsBias=0;var y;n.lowMemory?(y=ct(t,e+c.charStrings),i.nGlyphs=y.offsets.length):(y=lt(t,e+c.charStrings),i.nGlyphs=y.objects.length);var v=bt(t,e+c.charset,i.nGlyphs,a.objects);if(0===c.encoding?i.cffEncoding=new Y(Rs,v):1===c.encoding?i.cffEncoding=new Y(ks,v):i.cffEncoding=St(t,e+c.encoding,v),i.encoding=i.encoding||i.cffEncoding,i.glyphs=new js.GlyphSet(i),n.lowMemory)i._push=function(n){var r=ht(n,y.offsets,t,e+c.charStrings);i.glyphs.push(n,js.cffGlyphLoader(i,n,Ct,r))};else for(var w=0;w<i.nGlyphs;w+=1){var b=y.objects[w];i.glyphs.push(w,js.cffGlyphLoader(i,w,Ct,b))}}function Ot(t,e){var i,n=Ls.indexOf(t);return n>=0&&(i=n),n=e.indexOf(t),n>=0?i=n+Ls.length:(i=Ls.length+e.length,e.push(t)),i}function Nt(){return new Vs.Record("Header",[{name:"major",type:"Card8",value:1},{name:"minor",type:"Card8",value:0},{name:"hdrSize",type:"Card8",value:4},{name:"major",type:"Card8",value:1}])}function Et(t){var e=new Vs.Record("Name INDEX",[{name:"names",type:"INDEX",value:[]}]);e.names=[];for(var i=0;i<t.length;i+=1)e.names.push({name:"name_"+i,type:"NAME",value:t[i]});return e}function Mt(t,e,i){for(var n={},r=0;r<t.length;r+=1){var s=t[r],o=e[s.name];void 0===o||at(o,s.value)||("SID"===s.type&&(o=Ot(o,i)),n[s.op]={name:s.name,type:s.type,value:o})}return n}function Dt(t,e){var i=new Vs.Record("Top DICT",[{name:"dict",type:"DICT",value:{}}]);return i.dict=Mt(zs,t,e),i}function Vt(t){var e=new Vs.Record("Top DICT INDEX",[{name:"topDicts",type:"INDEX",value:[]}]);return e.topDicts=[{name:"topDict_0",type:"TABLE",value:t}],e}function It(t){var e=new Vs.Record("String INDEX",[{name:"strings",type:"INDEX",value:[]}]);e.strings=[];for(var i=0;i<t.length;i+=1)e.strings.push({name:"string_"+i,type:"STRING",value:t[i]});return e}function Bt(){return new Vs.Record("Global Subr INDEX",[{name:"subrs",type:"INDEX",value:[]}])}function At(t,e){for(var i=new Vs.Record("Charsets",[{name:"format",type:"Card8",value:0}]),n=0;n<t.length;n+=1){var r=t[n],s=Ot(r,e);i.fields.push({name:"glyph_"+n,type:"SID",value:s})}return i}function Pt(t){var e=[],i=t.path;e.push({name:"width",type:"NUMBER",value:t.advanceWidth});for(var n=0,r=0,s=0;s<i.commands.length;s+=1){var o=void 0,a=void 0,u=i.commands[s];if("Q"===u.type){u={type:"C",x:u.x,y:u.y,x1:Math.round(1/3*n+2/3*u.x1),y1:Math.round(1/3*r+2/3*u.y1),x2:Math.round(1/3*u.x+2/3*u.x1),y2:Math.round(1/3*u.y+2/3*u.y1)}}if("M"===u.type)o=Math.round(u.x-n),a=Math.round(u.y-r),e.push({name:"dx",type:"NUMBER",value:o}),e.push({name:"dy",type:"NUMBER",value:a}),e.push({name:"rmoveto",type:"OP",value:21}),n=Math.round(u.x),r=Math.round(u.y);else if("L"===u.type)o=Math.round(u.x-n),a=Math.round(u.y-r),e.push({name:"dx",type:"NUMBER",value:o}),e.push({name:"dy",type:"NUMBER",value:a}),e.push({name:"rlineto",type:"OP",value:5}),n=Math.round(u.x),r=Math.round(u.y);else if("C"===u.type){var l=Math.round(u.x1-n),c=Math.round(u.y1-r),h=Math.round(u.x2-u.x1),d=Math.round(u.y2-u.y1);o=Math.round(u.x-u.x2),a=Math.round(u.y-u.y2),e.push({name:"dx1",type:"NUMBER",value:l}),e.push({name:"dy1",type:"NUMBER",value:c}),e.push({name:"dx2",type:"NUMBER",value:h}),e.push({name:"dy2",type:"NUMBER",value:d}),e.push({name:"dx",type:"NUMBER",value:o}),e.push({name:"dy",type:"NUMBER",value:a}),e.push({name:"rrcurveto",type:"OP",value:8}),n=Math.round(u.x),r=Math.round(u.y)}}return e.push({name:"endchar",type:"OP",value:14}),e}function Lt(t){for(var e=new Vs.Record("CharStrings INDEX",[{name:"charStrings",type:"INDEX",value:[]}]),i=0;i<t.length;i+=1){var n=t.get(i),r=Pt(n);e.charStrings.push({name:n.name,type:"CHARSTRING",value:r})}return e}function Rt(t,e){var i=new Vs.Record("Private DICT",[{name:"dict",type:"DICT",value:{}}]);return i.dict=Mt(Gs,t,e),i}function kt(t,e){for(var i,n=new Vs.Table("CFF ",[{name:"header",type:"RECORD"},{name:"nameIndex",type:"RECORD"},{name:"topDictIndex",type:"RECORD"},{name:"stringIndex",type:"RECORD"},{name:"globalSubrIndex",type:"RECORD"},{name:"charsets",type:"RECORD"},{name:"charStringsIndex",type:"RECORD"},{name:"privateDict",type:"RECORD"}]),r=1/e.unitsPerEm,s={version:e.version,fullName:e.fullName,familyName:e.familyName,weight:e.weightName,fontBBox:e.fontBBox||[0,0,0,0],fontMatrix:[r,0,0,r,0,0],charset:999,encoding:0,charStrings:999,private:[0,999]},o={},a=[],u=1;u<t.length;u+=1)i=t.get(u),a.push(i.name);var l=[];n.header=Nt(),n.nameIndex=Et([e.postScriptName]);var c=Dt(s,l);n.topDictIndex=Vt(c),n.globalSubrIndex=Bt(),n.charsets=At(a,l),n.charStringsIndex=Lt(t),n.privateDict=Rt(o,l),n.stringIndex=It(l);var h=n.header.sizeOf()+n.nameIndex.sizeOf()+n.topDictIndex.sizeOf()+n.stringIndex.sizeOf()+n.globalSubrIndex.sizeOf();return s.charset=h,s.encoding=0,s.charStrings=s.charset+n.charsets.sizeOf(),s.private[1]=s.charStrings+n.charStringsIndex.sizeOf(),c=Dt(s,l),n.topDictIndex=Vt(c),n}function Ut(t,e){var i={},n=new As.Parser(t,e);return i.version=n.parseVersion(),i.fontRevision=Math.round(1e3*n.parseFixed())/1e3,i.checkSumAdjustment=n.parseULong(),i.magicNumber=n.parseULong(),Ss.argument(1594834165===i.magicNumber,"Font header has wrong magic number."),i.flags=n.parseUShort(),i.unitsPerEm=n.parseUShort(),i.created=n.parseLongDateTime(),i.modified=n.parseLongDateTime(),i.xMin=n.parseShort(),i.yMin=n.parseShort(),i.xMax=n.parseShort(),i.yMax=n.parseShort(),i.macStyle=n.parseUShort(),i.lowestRecPPEM=n.parseUShort(),i.fontDirectionHint=n.parseShort(),i.indexToLocFormat=n.parseShort(),i.glyphDataFormat=n.parseShort(),i}function Xt(t){var e=Math.round((new Date).getTime()/1e3)+2082844800,i=e;return t.createdTimestamp&&(i=t.createdTimestamp+2082844800),new Vs.Table("head",[{name:"version",type:"FIXED",value:65536},{name:"fontRevision",type:"FIXED",value:65536},{name:"checkSumAdjustment",type:"ULONG",value:0},{name:"magicNumber",type:"ULONG",value:1594834165},{name:"flags",type:"USHORT",value:0},{name:"unitsPerEm",type:"USHORT",value:1e3},{name:"created",type:"LONGDATETIME",value:i},{name:"modified",type:"LONGDATETIME",value:e},{name:"xMin",type:"SHORT",value:0},{name:"yMin",type:"SHORT",value:0},{name:"xMax",type:"SHORT",value:0},{name:"yMax",type:"SHORT",value:0},{name:"macStyle",type:"USHORT",value:0},{name:"lowestRecPPEM",type:"USHORT",value:0},{name:"fontDirectionHint",type:"SHORT",value:2},{name:"indexToLocFormat",type:"SHORT",value:0},{name:"glyphDataFormat",type:"SHORT",value:0}],t)}function jt(t,e){var i={},n=new As.Parser(t,e);return i.version=n.parseVersion(),i.ascender=n.parseShort(),i.descender=n.parseShort(),i.lineGap=n.parseShort(),i.advanceWidthMax=n.parseUShort(),i.minLeftSideBearing=n.parseShort(),i.minRightSideBearing=n.parseShort(),i.xMaxExtent=n.parseShort(),i.caretSlopeRise=n.parseShort(),i.caretSlopeRun=n.parseShort(),i.caretOffset=n.parseShort(),n.relativeOffset+=8,i.metricDataFormat=n.parseShort(),i.numberOfHMetrics=n.parseUShort(),i}function zt(t){return new Vs.Table("hhea",[{name:"version",type:"FIXED",value:65536},{name:"ascender",type:"FWORD",value:0},{name:"descender",type:"FWORD",value:0},{name:"lineGap",type:"FWORD",value:0},{name:"advanceWidthMax",type:"UFWORD",value:0},{name:"minLeftSideBearing",type:"FWORD",value:0},{name:"minRightSideBearing",type:"FWORD",value:0},{name:"xMaxExtent",type:"FWORD",value:0},{name:"caretSlopeRise",type:"SHORT",value:1},{name:"caretSlopeRun",type:"SHORT",value:0},{name:"caretOffset",type:"SHORT",value:0},{name:"reserved1",type:"SHORT",value:0},{name:"reserved2",type:"SHORT",value:0},{name:"reserved3",type:"SHORT",value:0},{name:"reserved4",type:"SHORT",value:0},{name:"metricDataFormat",type:"SHORT",value:0},{name:"numberOfHMetrics",type:"USHORT",value:0}],t)}function Gt(t,e,i,n,r){for(var s,o,a=new As.Parser(t,e),u=0;u<n;u+=1){u<i&&(s=a.parseUShort(),o=a.parseShort());var l=r.get(u);l.advanceWidth=s,l.leftSideBearing=o}}function Ht(t,e,i,n,r){t._hmtxTableData={};for(var s,o,a=new As.Parser(e,i),u=0;u<r;u+=1)u<n&&(s=a.parseUShort(),o=a.parseShort()),t._hmtxTableData[u]={advanceWidth:s,leftSideBearing:o}}function qt(t,e,i,n,r,s,o){o.lowMemory?Ht(t,e,i,n,r):Gt(e,i,n,r,s)}function Wt(t){for(var e=new Vs.Table("hmtx",[]),i=0;i<t.length;i+=1){var n=t.get(i),r=n.advanceWidth||0,s=n.leftSideBearing||0;e.fields.push({name:"advanceWidth_"+i,type:"USHORT",value:r}),e.fields.push({name:"leftSideBearing_"+i,type:"SHORT",value:s})}return e}function Yt(t){for(var e=new Vs.Table("ltag",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"numTags",type:"ULONG",value:t.length}]),i="",n=12+4*t.length,r=0;r<t.length;++r){var s=i.indexOf(t[r]);s<0&&(s=i.length,i+=t[r]),e.fields.push({name:"offset "+r,type:"USHORT",value:n+s}),e.fields.push({name:"length "+r,type:"USHORT",value:t[r].length})}return e.fields.push({name:"stringPool",type:"CHARARRAY",value:i}),e}function $t(t,e){var i=new As.Parser(t,e),n=i.parseULong();Ss.argument(1===n,"Unsupported ltag table version."),i.skip("uLong",1);for(var r=i.parseULong(),s=[],o=0;o<r;o++){for(var a="",u=e+i.parseUShort(),l=i.parseUShort(),c=u;c<u+l;++c)a+=String.fromCharCode(t.getInt8(c));s.push(a)}return s}function Zt(t,e){var i={},n=new As.Parser(t,e);return i.version=n.parseVersion(),i.numGlyphs=n.parseUShort(),1===i.version&&(i.maxPoints=n.parseUShort(),i.maxContours=n.parseUShort(),i.maxCompositePoints=n.parseUShort(),i.maxCompositeContours=n.parseUShort(),i.maxZones=n.parseUShort(),i.maxTwilightPoints=n.parseUShort(),i.maxStorage=n.parseUShort(),i.maxFunctionDefs=n.parseUShort(),i.maxInstructionDefs=n.parseUShort(),i.maxStackElements=n.parseUShort(),i.maxSizeOfInstructions=n.parseUShort(),i.maxComponentElements=n.parseUShort(),i.maxComponentDepth=n.parseUShort()),i}function Qt(t){return new Vs.Table("maxp",[{name:"version",type:"FIXED",value:20480},{name:"numGlyphs",type:"USHORT",value:t}])}function Kt(t,e,i){switch(t){case 0:if(65535===e)return"und";if(i)return i[e];break;case 1:return Ks[e];case 3:return to[e]}}function Jt(t,e,i){switch(t){case 0:return eo;case 1:return no[i]||io[e];case 3:if(1===e||10===e)return eo}}function te(t,e,i){for(var n={},r=new As.Parser(t,e),s=r.parseUShort(),o=r.parseUShort(),a=r.offset+r.parseUShort(),u=0;u<o;u++){var l=r.parseUShort(),c=r.parseUShort(),h=r.parseUShort(),d=r.parseUShort(),p=Qs[d]||d,f=r.parseUShort(),g=r.parseUShort(),m=Kt(l,h,i),_=Jt(l,c,h);if(void 0!==_&&void 0!==m){var x=void 0;if(x=_===eo?Cs.UTF16(t,a+g,f):Cs.MACSTRING(t,a+g,f,_)){var y=n[p];void 0===y&&(y=n[p]={}),y[m]=x}}}return 1===s&&r.parseUShort(),n}function ee(t){var e={};for(var i in t)e[t[i]]=parseInt(i);return e}function ie(t,e,i,n,r,s){return new Vs.Record("NameRecord",[{name:"platformID",type:"USHORT",value:t},{name:"encodingID",type:"USHORT",value:e},{name:"languageID",type:"USHORT",value:i},{name:"nameID",type:"USHORT",value:n},{name:"length",type:"USHORT",value:r},{name:"offset",type:"USHORT",value:s}])}function ne(t,e){var i=t.length,n=e.length-i+1;t:for(var r=0;r<n;r++)for(;r<n;r++){for(var s=0;s<i;s++)if(e[r+s]!==t[s])continue t;return r}return-1}function re(t,e){var i=ne(t,e);if(i<0){i=e.length;for(var n=0,r=t.length;n<r;++n)e.push(t[n])}return i}function se(t,e){var i,n=[],r={},s=ee(Qs);for(var o in t){var a=s[o];if(void 0===a&&(a=o),i=parseInt(a),isNaN(i))throw new Error('Name table entry "'+o+'" does not exist, see nameTableNames for complete list.');r[i]=t[o],n.push(i)}for(var u=ee(Ks),l=ee(to),c=[],h=[],d=0;d<n.length;d++){i=n[d];var p=r[i];for(var f in p){var g=p[f],m=1,_=u[f],x=Js[_],y=Jt(m,x,_),v=Ts.MACSTRING(g,y);void 0===v&&(m=0,_=e.indexOf(f),_<0&&(_=e.length,e.push(f)),x=4,v=Ts.UTF16(g));var w=re(v,h);c.push(ie(m,x,_,i,v.length,w));var b=l[f];if(void 0!==b){var S=Ts.UTF16(g),C=re(S,h);c.push(ie(3,1,b,i,S.length,C))}}}c.sort(function(t,e){return t.platformID-e.platformID||t.encodingID-e.encodingID||t.languageID-e.languageID||t.nameID-e.nameID});for(var T=new Vs.Table("name",[{name:"format",type:"USHORT",value:0},{name:"count",type:"USHORT",value:c.length},{name:"stringOffset",type:"USHORT",value:6+12*c.length}]),F=0;F<c.length;F++)T.fields.push({name:"record_"+F,type:"RECORD",value:c[F]});return T.fields.push({name:"strings",type:"LITERAL",value:h}),T}function oe(t){for(var e=0;e<so.length;e+=1){var i=so[e];if(t>=i.begin&&t<i.end)return e}return-1}function ae(t,e){var i={},n=new As.Parser(t,e);i.version=n.parseUShort(),i.xAvgCharWidth=n.parseShort(),i.usWeightClass=n.parseUShort(),i.usWidthClass=n.parseUShort(),i.fsType=n.parseUShort(),i.ySubscriptXSize=n.parseShort(),i.ySubscriptYSize=n.parseShort(),i.ySubscriptXOffset=n.parseShort(),i.ySubscriptYOffset=n.parseShort(),i.ySuperscriptXSize=n.parseShort(),i.ySuperscriptYSize=n.parseShort(),i.ySuperscriptXOffset=n.parseShort(),i.ySuperscriptYOffset=n.parseShort(),i.yStrikeoutSize=n.parseShort(),i.yStrikeoutPosition=n.parseShort(),i.sFamilyClass=n.parseShort(),i.panose=[];for(var r=0;r<10;r++)i.panose[r]=n.parseByte();return i.ulUnicodeRange1=n.parseULong(),i.ulUnicodeRange2=n.parseULong(),i.ulUnicodeRange3=n.parseULong(),i.ulUnicodeRange4=n.parseULong(),i.achVendID=String.fromCharCode(n.parseByte(),n.parseByte(),n.parseByte(),n.parseByte()),i.fsSelection=n.parseUShort(),i.usFirstCharIndex=n.parseUShort(),i.usLastCharIndex=n.parseUShort(),i.sTypoAscender=n.parseShort(),i.sTypoDescender=n.parseShort(),i.sTypoLineGap=n.parseShort(),i.usWinAscent=n.parseUShort(),i.usWinDescent=n.parseUShort(),i.version>=1&&(i.ulCodePageRange1=n.parseULong(),i.ulCodePageRange2=n.parseULong()),i.version>=2&&(i.sxHeight=n.parseShort(),i.sCapHeight=n.parseShort(),i.usDefaultChar=n.parseUShort(),i.usBreakChar=n.parseUShort(),i.usMaxContent=n.parseUShort()),i}function ue(t){return new Vs.Table("OS/2",[{name:"version",type:"USHORT",value:3},{name:"xAvgCharWidth",type:"SHORT",value:0},{name:"usWeightClass",type:"USHORT",value:0},{name:"usWidthClass",type:"USHORT",value:0},{name:"fsType",type:"USHORT",value:0},{name:"ySubscriptXSize",type:"SHORT",value:650},{name:"ySubscriptYSize",type:"SHORT",value:699},{name:"ySubscriptXOffset",type:"SHORT",value:0},{name:"ySubscriptYOffset",type:"SHORT",value:140},{name:"ySuperscriptXSize",type:"SHORT",value:650},{name:"ySuperscriptYSize",type:"SHORT",value:699},{name:"ySuperscriptXOffset",type:"SHORT",value:0},{name:"ySuperscriptYOffset",type:"SHORT",value:479},{name:"yStrikeoutSize",type:"SHORT",value:49},{name:"yStrikeoutPosition",type:"SHORT",value:258},{name:"sFamilyClass",type:"SHORT",value:0},{name:"bFamilyType",type:"BYTE",value:0},{name:"bSerifStyle",type:"BYTE",value:0},{name:"bWeight",type:"BYTE",value:0},{name:"bProportion",type:"BYTE",value:0},{name:"bContrast",type:"BYTE",value:0},{name:"bStrokeVariation",type:"BYTE",value:0},{name:"bArmStyle",type:"BYTE",value:0},{name:"bLetterform",type:"BYTE",value:0},{name:"bMidline",type:"BYTE",value:0},{name:"bXHeight",type:"BYTE",value:0},{name:"ulUnicodeRange1",type:"ULONG",value:0},{name:"ulUnicodeRange2",type:"ULONG",value:0},{name:"ulUnicodeRange3",type:"ULONG",value:0},{name:"ulUnicodeRange4",type:"ULONG",value:0},{name:"achVendID",type:"CHARARRAY",value:"XXXX"},{name:"fsSelection",type:"USHORT",value:0},{name:"usFirstCharIndex",type:"USHORT",value:0},{name:"usLastCharIndex",type:"USHORT",value:0},{name:"sTypoAscender",type:"SHORT",value:0},{name:"sTypoDescender",type:"SHORT",value:0},{name:"sTypoLineGap",type:"SHORT",value:0},{name:"usWinAscent",type:"USHORT",value:0},{name:"usWinDescent",type:"USHORT",value:0},{name:"ulCodePageRange1",type:"ULONG",value:0},{name:"ulCodePageRange2",type:"ULONG",value:0},{name:"sxHeight",type:"SHORT",value:0},{name:"sCapHeight",type:"SHORT",value:0},{name:"usDefaultChar",type:"USHORT",value:0},{name:"usBreakChar",type:"USHORT",value:0},{name:"usMaxContext",type:"USHORT",value:0}],t)}function le(t,e){var i={},n=new As.Parser(t,e);switch(i.version=n.parseVersion(),i.italicAngle=n.parseFixed(),i.underlinePosition=n.parseShort(),i.underlineThickness=n.parseShort(),i.isFixedPitch=n.parseULong(),i.minMemType42=n.parseULong(),i.maxMemType42=n.parseULong(),i.minMemType1=n.parseULong(),i.maxMemType1=n.parseULong(),i.version){case 1:i.names=Us.slice();break;case 2:i.numberOfGlyphs=n.parseUShort(),i.glyphNameIndex=new Array(i.numberOfGlyphs);for(var r=0;r<i.numberOfGlyphs;r++)i.glyphNameIndex[r]=n.parseUShort();i.names=[];for(var s=0;s<i.numberOfGlyphs;s++)if(i.glyphNameIndex[s]>=Us.length){var o=n.parseChar();i.names.push(n.parseString(o))}break;case 2.5:i.numberOfGlyphs=n.parseUShort(),i.offset=new Array(i.numberOfGlyphs);for(var a=0;a<i.numberOfGlyphs;a++)i.offset[a]=n.parseChar()}return i}function ce(){return new Vs.Table("post",[{name:"version",type:"FIXED",value:196608},{name:"italicAngle",type:"FIXED",value:0},{name:"underlinePosition",type:"FWORD",value:0},{name:"underlineThickness",type:"FWORD",value:0},{name:"isFixedPitch",type:"ULONG",value:0},{name:"minMemType42",type:"ULONG",value:0},{name:"maxMemType42",type:"ULONG",value:0},{name:"minMemType1",type:"ULONG",value:0},{name:"maxMemType1",type:"ULONG",value:0}])}function he(t,e){e=e||0;var i=new k(t,e),n=i.parseVersion(1);return Ss.argument(1===n||1.1===n,"Unsupported GSUB table version."),1===n?{version:n,scripts:i.parseScriptList(),features:i.parseFeatureList(),lookups:i.parseLookupList(uo)}:{version:n,scripts:i.parseScriptList(),features:i.parseFeatureList(),lookups:i.parseLookupList(uo),variations:i.parseFeatureVariationsList()}}function de(t){return new Vs.Table("GSUB",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new Vs.ScriptList(t.scripts)},{name:"features",type:"TABLE",value:new Vs.FeatureList(t.features)},{name:"lookups",type:"TABLE",value:new Vs.LookupList(t.lookups,co)}])}function pe(t,e){var i=new As.Parser(t,e),n=i.parseULong();Ss.argument(1===n,"Unsupported META table version."),i.parseULong(),i.parseULong();for(var r=i.parseULong(),s={},o=0;o<r;o++){var a=i.parseTag(),u=i.parseULong(),l=i.parseULong(),c=Cs.UTF8(t,e+u,l);s[a]=c}return s}function fe(t){var e=Object.keys(t).length,i="",n=16+12*e,r=new Vs.Table("meta",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"offset",type:"ULONG",value:n},{name:"numTags",type:"ULONG",value:e}]);for(var s in t){var o=i.length;i+=t[s],r.fields.push({name:"tag "+s,type:"TAG",value:s}),r.fields.push({name:"offset "+s,type:"ULONG",value:n+o}),r.fields.push({name:"length "+s,type:"ULONG",value:t[s].length})}return r.fields.push({name:"stringPool",type:"CHARARRAY",value:i}),r}function ge(t){return Math.log(t)/Math.log(2)|0}function me(t){for(;t.length%4!=0;)t.push(0);for(var e=0,i=0;i<t.length;i+=4)e+=(t[i]<<24)+(t[i+1]<<16)+(t[i+2]<<8)+t[i+3];return e%=Math.pow(2,32)}function _e(t,e,i,n){return new Vs.Record("Table Record",[{name:"tag",type:"TAG",value:void 0!==t?t:""},{name:"checkSum",type:"ULONG",value:void 0!==e?e:0},{name:"offset",type:"ULONG",value:void 0!==i?i:0},{name:"length",type:"ULONG",value:void 0!==n?n:0}])}function xe(t){var e=new Vs.Table("sfnt",[{name:"version",type:"TAG",value:"OTTO"},{name:"numTables",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);e.tables=t,e.numTables=t.length;var i=Math.pow(2,ge(e.numTables));e.searchRange=16*i,e.entrySelector=ge(i),e.rangeShift=16*e.numTables-e.searchRange;for(var n=[],r=[],s=e.sizeOf()+_e().sizeOf()*e.numTables;s%4!=0;)s+=1,r.push({name:"padding",type:"BYTE",value:0});for(var o=0;o<t.length;o+=1){var a=t[o];Ss.argument(4===a.tableName.length,"Table name"+a.tableName+" is invalid.");var u=a.sizeOf(),l=_e(a.tableName,me(a.encode()),s,u);for(n.push({name:l.tag+" Table Record",type:"RECORD",value:l}),r.push({name:a.tableName+" table",type:"RECORD",value:a}),s+=u,Ss.argument(!isNaN(s),"Something went wrong calculating the offset.");s%4!=0;)s+=1,r.push({name:"padding",type:"BYTE",value:0})}return n.sort(function(t,e){return t.value.tag>e.value.tag?1:-1}),e.fields=e.fields.concat(n),e.fields=e.fields.concat(r),e}function ye(t,e,i){for(var n=0;n<e.length;n+=1){var r=t.charToGlyphIndex(e[n]);if(r>0){return t.glyphs.get(r).getMetrics()}}return i}function ve(t){for(var e=0,i=0;i<t.length;i+=1)e+=t[i];return e/t.length}function we(t){for(var e,i=[],n=[],r=[],s=[],o=[],a=[],u=[],l=0,c=0,h=0,d=0,p=0,f=0;f<t.glyphs.length;f+=1){var g=t.glyphs.get(f),m=0|g.unicode;if(isNaN(g.advanceWidth))throw new Error("Glyph "+g.name+" ("+f+"): advanceWidth is not a number.");(e>m||void 0===e)&&m>0&&(e=m),l<m&&(l=m);var _=oo.getUnicodeRange(m);if(_<32)c|=1<<_;else if(_<64)h|=1<<_-32;else if(_<96)d|=1<<_-64;else{if(!(_<123))throw new Error("Unicode ranges bits > 123 are reserved for internal usage");p|=1<<_-96}if(".notdef"!==g.name){var x=g.getMetrics();i.push(x.xMin),n.push(x.yMin),r.push(x.xMax),s.push(x.yMax),a.push(x.leftSideBearing),u.push(x.rightSideBearing),o.push(g.advanceWidth)}}var y={xMin:Math.min.apply(null,i),yMin:Math.min.apply(null,n),xMax:Math.max.apply(null,r),yMax:Math.max.apply(null,s),advanceWidthMax:Math.max.apply(null,o),advanceWidthAvg:ve(o),minLeftSideBearing:Math.min.apply(null,a),maxLeftSideBearing:Math.max.apply(null,a),minRightSideBearing:Math.min.apply(null,u)};y.ascender=t.ascender,y.descender=t.descender;var v=qs.make({flags:3,unitsPerEm:t.unitsPerEm,xMin:y.xMin,yMin:y.yMin,xMax:y.xMax,yMax:y.yMax,lowestRecPPEM:3,createdTimestamp:t.createdTimestamp}),w=Ws.make({ascender:y.ascender,descender:y.descender,advanceWidthMax:y.advanceWidthMax,minLeftSideBearing:y.minLeftSideBearing,minRightSideBearing:y.minRightSideBearing,xMaxExtent:y.maxLeftSideBearing+(y.xMax-y.xMin),numberOfHMetrics:t.glyphs.length}),b=Zs.make(t.glyphs.length),S=oo.make(Object.assign({xAvgCharWidth:Math.round(y.advanceWidthAvg),usFirstCharIndex:e,usLastCharIndex:l,ulUnicodeRange1:c,ulUnicodeRange2:h,ulUnicodeRange3:d,ulUnicodeRange4:p,sTypoAscender:y.ascender,sTypoDescender:y.descender,sTypoLineGap:0,usWinAscent:y.yMax,usWinDescent:Math.abs(y.yMin),ulCodePageRange1:1,sxHeight:ye(t,"xyvw",{yMax:Math.round(y.ascender/2)}).yMax,sCapHeight:ye(t,"HIKLEFJMNTZBDPRAGOQSUVWXY",y).yMax,usDefaultChar:t.hasChar(" ")?32:0,usBreakChar:t.hasChar(" ")?32:0},t.tables.os2)),C=Ys.make(t.glyphs),T=Ps.make(t.glyphs),F=t.getEnglishName("fontFamily"),O=t.getEnglishName("fontSubfamily"),N=F+" "+O,E=t.getEnglishName("postScriptName");E||(E=F.replace(/\s/g,"")+"-"+O);var M={};for(var D in t.names)M[D]=t.names[D];M.uniqueID||(M.uniqueID={en:t.getEnglishName("manufacturer")+":"+N}),M.postScriptName||(M.postScriptName={en:E}),M.preferredFamily||(M.preferredFamily=t.names.fontFamily),M.preferredSubfamily||(M.preferredSubfamily=t.names.fontSubfamily);var V=[],I=ro.make(M,V),B=V.length>0?$s.make(V):void 0,A=ao.make(),P=Hs.make(t.glyphs,{version:t.getEnglishName("version"),fullName:N,familyName:F,weightName:O,postScriptName:E,unitsPerEm:t.unitsPerEm,fontBBox:[0,y.yMin,y.ascender,y.advanceWidthMax]}),L=t.metas&&Object.keys(t.metas).length>0?po.make(t.metas):void 0,R=[v,w,b,S,I,T,A,P,C];B&&R.push(B),t.tables.gsub&&R.push(ho.make(t.tables.gsub)),L&&R.push(L);for(var k=xe(R),U=k.encode(),X=me(U),j=k.fields,z=!1,G=0;G<j.length;G+=1)if("head table"===j[G].name){j[G].value.checkSumAdjustment=2981146554-X,z=!0;break}if(!z)throw new Error("Could not find head table with checkSum to adjust.");return k}function be(t,e){for(var i=0,n=t.length-1;i<=n;){var r=i+n>>>1,s=t[r].tag;if(s===e)return r;s<e?i=r+1:n=r-1}return-i-1}function Se(t,e){for(var i=0,n=t.length-1;i<=n;){var r=i+n>>>1,s=t[r];if(s===e)return r;s<e?i=r+1:n=r-1}return-i-1}function Ce(t,e){for(var i,n=0,r=t.length-1;n<=r;){var s=n+r>>>1;i=t[s];var o=i.start;if(o===e)return i;o<e?n=s+1:r=s-1}if(n>0)return i=t[n-1],e>i.end?0:i}function Te(t,e){this.font=t,this.tableName=e}function Fe(t){Te.call(this,t,"gpos")}function Oe(t){Te.call(this,t,"gsub")}function Ne(t,e){var i=t.length;if(i!==e.length)return!1;for(var n=0;n<i;n++)if(t[n]!==e[n])return!1;return!0}function Ee(t,e,i){for(var n=t.subtables,r=0;r<n.length;r++){var s=n[r];if(s.substFormat===e)return s}if(i)return n.push(i),i}function Me(){return"undefined"!=typeof window}function De(t){for(var e=new ArrayBuffer(t.length),i=new Uint8Array(e),n=0;n<t.length;++n)i[n]=t[n];return e}function Ve(t){for(var e=new Buffer(t.byteLength),i=new Uint8Array(t),n=0;n<e.length;++n)e[n]=i[n];return e}function Ie(t,e){if(!t)throw e}function Be(t,e,i,n,r){var s;return(e&n)>0?(s=t.parseByte(),0==(e&r)&&(s=-s),s=i+s):s=(e&r)>0?i:i+t.parseShort(),s}function Ae(t,e,i){var n=new As.Parser(e,i);t.numberOfContours=n.parseShort(),t._xMin=n.parseShort(),t._yMin=n.parseShort(),t._xMax=n.parseShort(),t._yMax=n.parseShort();var r,s;if(t.numberOfContours>0){for(var o=t.endPointIndices=[],a=0;a<t.numberOfContours;a+=1)o.push(n.parseUShort());t.instructionLength=n.parseUShort(),t.instructions=[];for(var u=0;u<t.instructionLength;u+=1)t.instructions.push(n.parseByte());var l=o[o.length-1]+1;r=[];for(var c=0;c<l;c+=1)if(s=n.parseByte(),r.push(s),(8&s)>0)for(var h=n.parseByte(),d=0;d<h;d+=1)r.push(s),c+=1;if(Ss.argument(r.length===l,"Bad flags."),o.length>0){var p,f=[];if(l>0){for(var g=0;g<l;g+=1)s=r[g],p={},p.onCurve=!!(1&s),p.lastPointOfContour=o.indexOf(g)>=0,f.push(p);for(var m=0,_=0;_<l;_+=1)s=r[_],p=f[_],p.x=Be(n,s,m,2,16),m=p.x;for(var x=0,y=0;y<l;y+=1)s=r[y],p=f[y],p.y=Be(n,s,x,4,32),x=p.y}t.points=f}else t.points=[]}else if(0===t.numberOfContours)t.points=[];else{t.isComposite=!0,t.points=[],t.components=[];for(var v=!0;v;){r=n.parseUShort();var w={glyphIndex:n.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(1&r)>0?(2&r)>0?(w.dx=n.parseShort(),w.dy=n.parseShort()):w.matchedPoints=[n.parseUShort(),n.parseUShort()]:(2&r)>0?(w.dx=n.parseChar(),w.dy=n.parseChar()):w.matchedPoints=[n.parseByte(),n.parseByte()],(8&r)>0?w.xScale=w.yScale=n.parseF2Dot14():(64&r)>0?(w.xScale=n.parseF2Dot14(),w.yScale=n.parseF2Dot14()):(128&r)>0&&(w.xScale=n.parseF2Dot14(),w.scale01=n.parseF2Dot14(),w.scale10=n.parseF2Dot14(),w.yScale=n.parseF2Dot14()),t.components.push(w),v=!!(32&r)}if(256&r){t.instructionLength=n.parseUShort(),t.instructions=[];for(var b=0;b<t.instructionLength;b+=1)t.instructions.push(n.parseByte())}}}function Pe(t,e){for(var i=[],n=0;n<t.length;n+=1){var r=t[n],s={x:e.xScale*r.x+e.scale01*r.y+e.dx,y:e.scale10*r.x+e.yScale*r.y+e.dy,onCurve:r.onCurve,lastPointOfContour:r.lastPointOfContour};i.push(s)}return i}function Le(t){for(var e=[],i=[],n=0;n<t.length;n+=1){var r=t[n];i.push(r),r.lastPointOfContour&&(e.push(i),i=[])}return Ss.argument(0===i.length,"There are still points left in the current contour."),e}function Re(t){var e=new f;if(!t)return e;for(var i=Le(t),n=0;n<i.length;++n){var r=i[n],s=null,o=r[r.length-1],a=r[0];if(o.onCurve)e.moveTo(o.x,o.y);else if(a.onCurve)e.moveTo(a.x,a.y);else{var u={x:.5*(o.x+a.x),y:.5*(o.y+a.y)};e.moveTo(u.x,u.y)}for(var l=0;l<r.length;++l)if(s=o,o=a,a=r[(l+1)%r.length],o.onCurve)e.lineTo(o.x,o.y);else{var c=a;s.onCurve||{x:.5*(o.x+s.x),y:.5*(o.y+s.y)},a.onCurve||(c={x:.5*(o.x+a.x),y:.5*(o.y+a.y)}),e.quadraticCurveTo(o.x,o.y,c.x,c.y)}e.closePath()}return e}function ke(t,e){if(e.isComposite)for(var i=0;i<e.components.length;i+=1){var n=e.components[i],r=t.get(n.glyphIndex);if(r.getPath(),r.points){var s=void 0;if(void 0===n.matchedPoints)s=Pe(r.points,n);else{if(n.matchedPoints[0]>e.points.length-1||n.matchedPoints[1]>r.points.length-1)throw Error("Matched points out of range in "+e.name);var o=e.points[n.matchedPoints[0]],a=r.points[n.matchedPoints[1]],u={xScale:n.xScale,scale01:n.scale01,scale10:n.scale10,yScale:n.yScale,dx:0,dy:0};a=Pe([a],u)[0],u.dx=o.x-a.x,u.dy=o.y-a.y,s=Pe(r.points,u)}e.points=e.points.concat(s)}}return Re(e.points)}function Ue(t,e,i,n){for(var r=new js.GlyphSet(n),s=0;s<i.length-1;s+=1){var o=i[s];o!==i[s+1]?r.push(s,js.ttfGlyphLoader(n,s,Ae,t,e+o,ke)):r.push(s,js.glyphLoader(n,s))}return r}function Xe(t,e,i,n){var r=new js.GlyphSet(n);return n._push=function(s){var o=i[s];o!==i[s+1]?r.push(s,js.ttfGlyphLoader(n,s,Ae,t,e+o,ke)):r.push(s,js.glyphLoader(n,s))},r}function je(t,e,i,n,r){return r.lowMemory?Xe(t,e,i,n):Ue(t,e,i,n)}function ze(t){this.font=t,this.getCommands=function(t){return yo.getPath(t).commands},this._fpgmState=this._prepState=void 0,this._errorState=0}function Ge(t){return t}function He(t){return Math.sign(t)*Math.round(Math.abs(t))}function qe(t){return Math.sign(t)*Math.round(Math.abs(2*t))/2}function We(t){return Math.sign(t)*(Math.round(Math.abs(t)+.5)-.5)}function Ye(t){return Math.sign(t)*Math.ceil(Math.abs(t))}function $e(t){return Math.sign(t)*Math.floor(Math.abs(t))}function Ze(t,e){this.x=t,this.y=e,this.axis=void 0,this.slope=e/t,this.normalSlope=-t/e,Object.freeze(this)}function Qe(t,e){var i=Math.sqrt(t*t+e*e);return t/=i,e/=i,1===t&&0===e?wo:0===t&&1===e?bo:new Ze(t,e)}function Ke(t,e,i,n){this.x=this.xo=Math.round(64*t)/64,this.y=this.yo=Math.round(64*e)/64,this.lastPointOfContour=i,this.onCurve=n,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}function Je(t,e){switch(this.env=t,this.stack=[],this.prog=e,t){case"glyf":this.zp0=this.zp1=this.zp2=1,this.rp0=this.rp1=this.rp2=0;case"prep":this.fv=this.pv=this.dpv=wo,this.round=He}}function ti(t){for(var e=t.tZone=new Array(t.gZone.length),i=0;i<e.length;i++)e[i]=new Ke(0,0)}function ei(t,e){var i,n=t.prog,r=t.ip,s=1;do if(88===(i=n[++r]))s++;else if(89===i)s--;else if(64===i)r+=n[r+1]+1;else if(65===i)r+=2*n[r+1]+1;else if(i>=176&&i<=183)r+=i-176+1;else if(i>=184&&i<=191)r+=2*(i-184+1);else if(e&&1===s&&27===i)break;while(s>0)t.ip=r}function ii(e,i){t.DEBUG&&console.log(i.step,"SVTCA["+e.axis+"]"),i.fv=i.pv=i.dpv=e}function ni(e,i){t.DEBUG&&console.log(i.step,"SPVTCA["+e.axis+"]"),i.pv=i.dpv=e}function ri(e,i){t.DEBUG&&console.log(i.step,"SFVTCA["+e.axis+"]"),i.fv=e}function si(e,i){var n=i.stack,r=n.pop(),s=n.pop(),o=i.z2[r],a=i.z1[s];t.DEBUG&&console.log("SPVTL["+e+"]",r,s);var u,l;e?(u=o.y-a.y,l=a.x-o.x):(u=a.x-o.x,l=a.y-o.y),i.pv=i.dpv=Qe(u,l)}function oi(e,i){var n=i.stack,r=n.pop(),s=n.pop(),o=i.z2[r],a=i.z1[s];t.DEBUG&&console.log("SFVTL["+e+"]",r,s);var u,l;e?(u=o.y-a.y,l=a.x-o.x):(u=a.x-o.x,l=a.y-o.y),i.fv=Qe(u,l)}function ai(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"SPVFS[]",n,r),e.pv=e.dpv=Qe(r,n)}function ui(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"SPVFS[]",n,r),e.fv=Qe(r,n)}function li(e){var i=e.stack,n=e.pv;t.DEBUG&&console.log(e.step,"GPV[]"),i.push(16384*n.x),i.push(16384*n.y)}function ci(e){var i=e.stack,n=e.fv;t.DEBUG&&console.log(e.step,"GFV[]"),i.push(16384*n.x),i.push(16384*n.y)}function hi(e){e.fv=e.pv,t.DEBUG&&console.log(e.step,"SFVTPV[]")}function di(e){var i=e.stack,n=i.pop(),r=i.pop(),s=i.pop(),o=i.pop(),a=i.pop(),u=e.z0,l=e.z1,c=u[n],h=u[r],d=l[s],p=l[o],f=e.z2[a]
|
|
31
|
-
;t.DEBUG&&console.log("ISECT[], ",n,r,s,o,a);var g=c.x,m=c.y,_=h.x,x=h.y,y=d.x,v=d.y,w=p.x,b=p.y,S=(g-_)*(v-b)-(m-x)*(y-w),C=g*x-m*_,T=y*b-v*w;f.x=(C*(y-w)-T*(g-_))/S,f.y=(C*(v-b)-T*(m-x))/S}function pi(e){e.rp0=e.stack.pop(),t.DEBUG&&console.log(e.step,"SRP0[]",e.rp0)}function fi(e){e.rp1=e.stack.pop(),t.DEBUG&&console.log(e.step,"SRP1[]",e.rp1)}function gi(e){e.rp2=e.stack.pop(),t.DEBUG&&console.log(e.step,"SRP2[]",e.rp2)}function mi(e){var i=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"SZP0[]",i),e.zp0=i,i){case 0:e.tZone||ti(e),e.z0=e.tZone;break;case 1:e.z0=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function _i(e){var i=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"SZP1[]",i),e.zp1=i,i){case 0:e.tZone||ti(e),e.z1=e.tZone;break;case 1:e.z1=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function xi(e){var i=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"SZP2[]",i),e.zp2=i,i){case 0:e.tZone||ti(e),e.z2=e.tZone;break;case 1:e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function yi(e){var i=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"SZPS[]",i),e.zp0=e.zp1=e.zp2=i,i){case 0:e.tZone||ti(e),e.z0=e.z1=e.z2=e.tZone;break;case 1:e.z0=e.z1=e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function vi(e){e.loop=e.stack.pop(),t.DEBUG&&console.log(e.step,"SLOOP[]",e.loop)}function wi(e){t.DEBUG&&console.log(e.step,"RTG[]"),e.round=He}function bi(e){t.DEBUG&&console.log(e.step,"RTHG[]"),e.round=We}function Si(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"SMD[]",i),e.minDis=i/64}function Ci(e){t.DEBUG&&console.log(e.step,"ELSE[]"),ei(e,!1)}function Ti(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"JMPR[]",i),e.ip+=i-1}function Fi(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"SCVTCI[]",i),e.cvCutIn=i/64}function Oi(e){var i=e.stack;t.DEBUG&&console.log(e.step,"DUP[]"),i.push(i[i.length-1])}function Ni(e){t.DEBUG&&console.log(e.step,"POP[]"),e.stack.pop()}function Ei(e){t.DEBUG&&console.log(e.step,"CLEAR[]"),e.stack.length=0}function Mi(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"SWAP[]"),i.push(n),i.push(r)}function Di(e){var i=e.stack;t.DEBUG&&console.log(e.step,"DEPTH[]"),i.push(i.length)}function Vi(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"LOOPCALL[]",n,r);var s=e.ip,o=e.prog;e.prog=e.funcs[n];for(var a=0;a<r;a++)mo(e),t.DEBUG&&console.log(++e.step,a+1<r?"next loopcall":"done loopcall",a);e.ip=s,e.prog=o}function Ii(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"CALL[]",i);var n=e.ip,r=e.prog;e.prog=e.funcs[i],mo(e),e.ip=n,e.prog=r,t.DEBUG&&console.log(++e.step,"returning from",i)}function Bi(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"CINDEX[]",n),i.push(i[i.length-n])}function Ai(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"MINDEX[]",n),i.push(i.splice(i.length-n,1)[0])}function Pi(e){if("fpgm"!==e.env)throw new Error("FDEF not allowed here");var i=e.stack,n=e.prog,r=e.ip,s=i.pop(),o=r;for(t.DEBUG&&console.log(e.step,"FDEF[]",s);45!==n[++r];);e.ip=r,e.funcs[s]=n.slice(o+1,r)}function Li(e,i){var n=i.stack.pop(),r=i.z0[n],s=i.fv,o=i.pv;t.DEBUG&&console.log(i.step,"MDAP["+e+"]",n);var a=o.distance(r,So);e&&(a=i.round(a)),s.setRelative(r,So,a,o),s.touch(r),i.rp0=i.rp1=n}function Ri(e,i){var n,r,s,o=i.z2,a=o.length-2;t.DEBUG&&console.log(i.step,"IUP["+e.axis+"]");for(var u=0;u<a;u++)n=o[u],e.touched(n)||(r=n.prevTouched(e))!==n&&(s=n.nextTouched(e),r===s&&e.setRelative(n,n,e.distance(r,r,!1,!0),e,!0),e.interpolate(n,r,s,e))}function ki(e,i){for(var n=i.stack,r=e?i.rp1:i.rp2,s=(e?i.z0:i.z1)[r],o=i.fv,a=i.pv,u=i.loop,l=i.z2;u--;){var c=n.pop(),h=l[c],d=a.distance(s,s,!1,!0);o.setRelative(h,h,d,a),o.touch(h),t.DEBUG&&console.log(i.step,(i.loop>1?"loop "+(i.loop-u)+": ":"")+"SHP["+(e?"rp1":"rp2")+"]",c)}i.loop=1}function Ui(e,i){var n=i.stack,r=e?i.rp1:i.rp2,s=(e?i.z0:i.z1)[r],o=i.fv,a=i.pv,u=n.pop(),l=i.z2[i.contours[u]],c=l;t.DEBUG&&console.log(i.step,"SHC["+e+"]",u);var h=a.distance(s,s,!1,!0);do c!==s&&o.setRelative(c,c,h,a),c=c.nextPointOnContour;while(c!==l)}function Xi(e,i){var n=i.stack,r=e?i.rp1:i.rp2,s=(e?i.z0:i.z1)[r],o=i.fv,a=i.pv,u=n.pop();t.DEBUG&&console.log(i.step,"SHZ["+e+"]",u);var l;switch(u){case 0:l=i.tZone;break;case 1:l=i.gZone;break;default:throw new Error("Invalid zone")}for(var c,h=a.distance(s,s,!1,!0),d=l.length-2,p=0;p<d;p++)c=l[p],o.setRelative(c,c,h,a)}function ji(e){for(var i=e.stack,n=e.loop,r=e.fv,s=i.pop()/64,o=e.z2;n--;){var a=i.pop(),u=o[a];t.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-n)+": ":"")+"SHPIX[]",a,s),r.setRelative(u,u,s),r.touch(u)}e.loop=1}function zi(e){for(var i=e.stack,n=e.rp1,r=e.rp2,s=e.loop,o=e.z0[n],a=e.z1[r],u=e.fv,l=e.dpv,c=e.z2;s--;){var h=i.pop(),d=c[h];t.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-s)+": ":"")+"IP[]",h,n,"<->",r),u.interpolate(d,o,a,l),u.touch(d)}e.loop=1}function Gi(e,i){var n=i.stack,r=n.pop()/64,s=n.pop(),o=i.z1[s],a=i.z0[i.rp0],u=i.fv,l=i.pv;u.setRelative(o,a,r,l),u.touch(o),t.DEBUG&&console.log(i.step,"MSIRP["+e+"]",r,s),i.rp1=i.rp0,i.rp2=s,e&&(i.rp0=s)}function Hi(e){for(var i=e.stack,n=e.rp0,r=e.z0[n],s=e.loop,o=e.fv,a=e.pv,u=e.z1;s--;){var l=i.pop(),c=u[l];t.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-s)+": ":"")+"ALIGNRP[]",l),o.setRelative(c,r,0,a),o.touch(c)}e.loop=1}function qi(e){t.DEBUG&&console.log(e.step,"RTDG[]"),e.round=qe}function Wi(e,i){var n=i.stack,r=n.pop(),s=n.pop(),o=i.z0[s],a=i.fv,u=i.pv,l=i.cvt[r];t.DEBUG&&console.log(i.step,"MIAP["+e+"]",r,"(",l,")",s);var c=u.distance(o,So);e&&(Math.abs(c-l)<i.cvCutIn&&(c=l),c=i.round(c)),a.setRelative(o,So,c,u),0===i.zp0&&(o.xo=o.x,o.yo=o.y),a.touch(o),i.rp0=i.rp1=s}function Yi(e){var i=e.prog,n=e.ip,r=e.stack,s=i[++n];t.DEBUG&&console.log(e.step,"NPUSHB[]",s);for(var o=0;o<s;o++)r.push(i[++n]);e.ip=n}function $i(e){var i=e.ip,n=e.prog,r=e.stack,s=n[++i];t.DEBUG&&console.log(e.step,"NPUSHW[]",s);for(var o=0;o<s;o++){var a=n[++i]<<8|n[++i];32768&a&&(a=-(1+(65535^a))),r.push(a)}e.ip=i}function Zi(e){var i=e.stack,n=e.store;n||(n=e.store=[]);var r=i.pop(),s=i.pop();t.DEBUG&&console.log(e.step,"WS",r,s),n[s]=r}function Qi(e){var i=e.stack,n=e.store,r=i.pop();t.DEBUG&&console.log(e.step,"RS",r);var s=n&&n[r]||0;i.push(s)}function Ki(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"WCVTP",n,r),e.cvt[r]=n/64}function Ji(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"RCVT",n),i.push(64*e.cvt[n])}function tn(e,i){var n=i.stack,r=n.pop(),s=i.z2[r];t.DEBUG&&console.log(i.step,"GC["+e+"]",r),n.push(64*i.dpv.distance(s,So,e,!1))}function en(e,i){var n=i.stack,r=n.pop(),s=n.pop(),o=i.z1[r],a=i.z0[s],u=i.dpv.distance(a,o,e,e);t.DEBUG&&console.log(i.step,"MD["+e+"]",r,s,"->",u),i.stack.push(Math.round(64*u))}function nn(e){t.DEBUG&&console.log(e.step,"MPPEM[]"),e.stack.push(e.ppem)}function rn(e){t.DEBUG&&console.log(e.step,"FLIPON[]"),e.autoFlip=!0}function sn(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"LT[]",n,r),i.push(r<n?1:0)}function on(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"LTEQ[]",n,r),i.push(r<=n?1:0)}function an(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"GT[]",n,r),i.push(r>n?1:0)}function un(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"GTEQ[]",n,r),i.push(r>=n?1:0)}function ln(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"EQ[]",n,r),i.push(n===r?1:0)}function cn(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"NEQ[]",n,r),i.push(n!==r?1:0)}function hn(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"ODD[]",n),i.push(Math.trunc(n)%2?1:0)}function dn(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"EVEN[]",n),i.push(Math.trunc(n)%2?0:1)}function pn(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"IF[]",i),i||(ei(e,!0),t.DEBUG&&console.log(e.step,"EIF[]"))}function fn(e){t.DEBUG&&console.log(e.step,"EIF[]")}function gn(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"AND[]",n,r),i.push(n&&r?1:0)}function mn(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"OR[]",n,r),i.push(n||r?1:0)}function _n(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"NOT[]",n),i.push(n?0:1)}function xn(e,i){var n=i.stack,r=n.pop(),s=i.fv,o=i.pv,a=i.ppem,u=i.deltaBase+16*(e-1),l=i.deltaShift,c=i.z0;t.DEBUG&&console.log(i.step,"DELTAP["+e+"]",r,n);for(var h=0;h<r;h++){var d=n.pop(),p=n.pop();if(u+((240&p)>>4)===a){var f=(15&p)-8;f>=0&&f++,t.DEBUG&&console.log(i.step,"DELTAPFIX",d,"by",f*l);var g=c[d];s.setRelative(g,g,f*l,o)}}}function yn(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"SDB[]",n),e.deltaBase=n}function vn(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"SDS[]",n),e.deltaShift=Math.pow(.5,n)}function wn(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"ADD[]",n,r),i.push(r+n)}function bn(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"SUB[]",n,r),i.push(r-n)}function Sn(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"DIV[]",n,r),i.push(64*r/n)}function Cn(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"MUL[]",n,r),i.push(r*n/64)}function Tn(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"ABS[]",n),i.push(Math.abs(n))}function Fn(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"NEG[]",n),i.push(-n)}function On(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"FLOOR[]",n),i.push(64*Math.floor(n/64))}function Nn(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"CEILING[]",n),i.push(64*Math.ceil(n/64))}function En(e,i){var n=i.stack,r=n.pop();t.DEBUG&&console.log(i.step,"ROUND[]"),n.push(64*i.round(r/64))}function Mn(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"WCVTF[]",n,r),e.cvt[r]=n*e.ppem/e.font.unitsPerEm}function Dn(e,i){var n=i.stack,r=n.pop(),s=i.ppem,o=i.deltaBase+16*(e-1),a=i.deltaShift;t.DEBUG&&console.log(i.step,"DELTAC["+e+"]",r,n);for(var u=0;u<r;u++){var l=n.pop(),c=n.pop();if(o+((240&c)>>4)===s){var h=(15&c)-8;h>=0&&h++;var d=h*a;t.DEBUG&&console.log(i.step,"DELTACFIX",l,"by",d),i.cvt[l]+=d}}}function Vn(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"SROUND[]",i),e.round=vo;var n;switch(192&i){case 0:n=.5;break;case 64:n=1;break;case 128:n=2;break;default:throw new Error("invalid SROUND value")}switch(e.srPeriod=n,48&i){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*n;break;case 32:e.srPhase=.5*n;break;case 48:e.srPhase=.75*n;break;default:throw new Error("invalid SROUND value")}i&=15,e.srThreshold=0===i?0:(i/8-.5)*n}function In(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"S45ROUND[]",i),e.round=vo;var n;switch(192&i){case 0:n=Math.sqrt(2)/2;break;case 64:n=Math.sqrt(2);break;case 128:n=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(e.srPeriod=n,48&i){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*n;break;case 32:e.srPhase=.5*n;break;case 48:e.srPhase=.75*n;break;default:throw new Error("invalid S45ROUND value")}i&=15,e.srThreshold=0===i?0:(i/8-.5)*n}function Bn(e){t.DEBUG&&console.log(e.step,"ROFF[]"),e.round=Ge}function An(e){t.DEBUG&&console.log(e.step,"RUTG[]"),e.round=Ye}function Pn(e){t.DEBUG&&console.log(e.step,"RDTG[]"),e.round=$e}function Ln(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"SCANCTRL[]",i)}function Rn(e,i){var n=i.stack,r=n.pop(),s=n.pop(),o=i.z2[r],a=i.z1[s];t.DEBUG&&console.log(i.step,"SDPVTL["+e+"]",r,s);var u,l;e?(u=o.y-a.y,l=a.x-o.x):(u=a.x-o.x,l=a.y-o.y),i.dpv=Qe(u,l)}function kn(e){var i=e.stack,n=i.pop(),r=0;t.DEBUG&&console.log(e.step,"GETINFO[]",n),1&n&&(r=35),32&n&&(r|=4096),i.push(r)}function Un(e){var i=e.stack,n=i.pop(),r=i.pop(),s=i.pop();t.DEBUG&&console.log(e.step,"ROLL[]"),i.push(r),i.push(n),i.push(s)}function Xn(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"MAX[]",n,r),i.push(Math.max(r,n))}function jn(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"MIN[]",n,r),i.push(Math.min(r,n))}function zn(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"SCANTYPE[]",i)}function Gn(e){var i=e.stack.pop(),n=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"INSTCTRL[]",i,n),i){case 1:return void(e.inhibitGridFit=!!n);case 2:return void(e.ignoreCvt=!!n);default:throw new Error("invalid INSTCTRL[] selector")}}function Hn(e,i){var n=i.stack,r=i.prog,s=i.ip;t.DEBUG&&console.log(i.step,"PUSHB["+e+"]");for(var o=0;o<e;o++)n.push(r[++s]);i.ip=s}function qn(e,i){var n=i.ip,r=i.prog,s=i.stack;t.DEBUG&&console.log(i.ip,"PUSHW["+e+"]");for(var o=0;o<e;o++){var a=r[++n]<<8|r[++n];32768&a&&(a=-(1+(65535^a))),s.push(a)}i.ip=n}function Wn(e,i,n,r,s,o){var a,u,l,c,h=o.stack,d=e&&h.pop(),p=h.pop(),f=o.rp0,g=o.z0[f],m=o.z1[p],_=o.minDis,x=o.fv,y=o.dpv;u=a=y.distance(m,g,!0,!0),l=u>=0?1:-1,u=Math.abs(u),e&&(c=o.cvt[d],r&&Math.abs(u-c)<o.cvCutIn&&(u=c)),n&&u<_&&(u=_),r&&(u=o.round(u)),x.setRelative(m,g,l*u,y),x.touch(m),t.DEBUG&&console.log(o.step,(e?"MIRP[":"MDRP[")+(i?"M":"m")+(n?">":"_")+(r?"R":"_")+(0===s?"Gr":1===s?"Bl":2===s?"Wh":"")+"]",e?d+"("+o.cvt[d]+","+c+")":"",p,"(d =",a,"->",l*u,")"),o.rp1=o.rp0,o.rp2=p,i&&(o.rp0=p)}function Yn(t){this.char=t,this.state={},this.activeState=null}function $n(t,e,i){this.contextName=i,this.startIndex=t,this.endOffset=e}function Zn(t,e,i){this.contextName=t,this.openRange=null,this.ranges=[],this.checkStart=e,this.checkEnd=i}function Qn(t,e){this.context=t,this.index=e,this.length=t.length,this.current=t[e],this.backtrack=t.slice(0,e),this.lookahead=t.slice(e+1)}function Kn(t){this.eventId=t,this.subscribers=[]}function Jn(t){var e=this,i=["start","end","next","newToken","contextStart","contextEnd","insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD","updateContextsRanges"];i.forEach(function(t){Object.defineProperty(e.events,t,{value:new Kn(t)})}),t&&i.forEach(function(i){var n=t[i];"function"==typeof n&&e.events[i].subscribe(n)}),["insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD"].forEach(function(t){e.events[t].subscribe(e.updateContextsRanges)})}function tr(t){this.tokens=[],this.registeredContexts={},this.contextCheckers=[],this.events={},this.registeredModifiers=[],Jn.call(this,t)}function er(t){return/[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(t)}function ir(t){return/[\u0630\u0690\u0621\u0631\u0661\u0671\u0622\u0632\u0672\u0692\u06C2\u0623\u0673\u0693\u06C3\u0624\u0694\u06C4\u0625\u0675\u0695\u06C5\u06E5\u0676\u0696\u06C6\u0627\u0677\u0697\u06C7\u0648\u0688\u0698\u06C8\u0689\u0699\u06C9\u068A\u06CA\u066B\u068B\u06CB\u068C\u068D\u06CD\u06FD\u068E\u06EE\u06FE\u062F\u068F\u06CF\u06EF]/.test(t)}function nr(t){return/[\u0600-\u0605\u060C-\u060E\u0610-\u061B\u061E\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED]/.test(t)}function rr(t){return/[A-z]/.test(t)}function sr(t){return/\s/.test(t)}function or(t){this.font=t,this.features={}}function ar(t){this.id=t.id,this.tag=t.tag,this.substitution=t.substitution}function ur(t,e){if(!t)return-1;switch(e.format){case 1:return e.glyphs.indexOf(t);case 2:for(var i=e.ranges,n=0;n<i.length;n++){var r=i[n];if(t>=r.start&&t<=r.end){var s=t-r.start;return r.index+s}}break;default:return-1}return-1}function lr(t,e){return ur(t,e.coverage)===-1?null:t+e.deltaGlyphId}function cr(t,e){var i=ur(t,e.coverage);return i===-1?null:e.substitute[i]}function hr(t,e){for(var i=[],n=0;n<t.length;n++){var r=t[n],s=e.current;s=Array.isArray(s)?s[0]:s;var o=ur(s,r);o!==-1&&i.push(o)}return i.length!==t.length?-1:i}function dr(t,e){var i=e.inputCoverage.length+e.lookaheadCoverage.length+e.backtrackCoverage.length;if(t.context.length<i)return[];var n=hr(e.inputCoverage,t);if(n===-1)return[];var r=e.inputCoverage.length-1;if(t.lookahead.length<e.lookaheadCoverage.length)return[];for(var s=t.lookahead.slice(r);s.length&&nr(s[0].char);)s.shift();var o=new Qn(s,0),a=hr(e.lookaheadCoverage,o),u=[].concat(t.backtrack);for(u.reverse();u.length&&nr(u[0].char);)u.shift();if(u.length<e.backtrackCoverage.length)return[];var l=new Qn(u,0),c=hr(e.backtrackCoverage,l),h=n.length===e.inputCoverage.length&&a.length===e.lookaheadCoverage.length&&c.length===e.backtrackCoverage.length,d=[];if(h)for(var p=0;p<e.lookupRecords.length;p++)for(var f=e.lookupRecords[p],g=f.lookupListIndex,m=this.getLookupByIndex(g),_=0;_<m.subtables.length;_++){var x=m.subtables[_],y=this.getLookupMethod(m,x),v=this.getSubstitutionType(m,x);if("12"===v)for(var w=0;w<n.length;w++){var b=t.get(w),S=y(b);S&&d.push(S)}}return d}function pr(t,e){var i=t.current,n=ur(i,e.coverage);if(n===-1)return null;for(var r,s=e.ligatureSets[n],o=0;o<s.length;o++){r=s[o];for(var a=0;a<r.components.length;a++){if(t.lookahead[a]!==r.components[a])break;if(a===r.components.length-1)return r}}return null}function fr(t,e){var i=ur(t,e.coverage);return i===-1?null:e.sequences[i]}function gr(t){var e=t.current,i=t.get(-1);return null===i&&er(e)||!er(i)&&er(e)}function mr(t){var e=t.get(1);return null===e||!er(e)}function _r(t){var e=t.current,i=t.get(-1);return(er(e)||nr(e))&&!er(i)}function xr(t){var e=t.get(1);switch(!0){case null===e:return!0;case!er(e)&&!nr(e):var i=sr(e);if(!i)return!0;if(i){if(!t.lookahead.some(function(t){return er(t)||nr(t)}))return!0}break;default:return!1}}function yr(t,e,i){e[i].setState(t.tag,t.substitution)}function vr(t,e,i){e[i].setState(t.tag,t.substitution)}function wr(t,e,i){t.substitution.forEach(function(n,r){e[i+r].setState(t.tag,n)})}function br(t,e,i){var n=e[i];n.setState(t.tag,t.substitution.ligGlyph);for(var r=t.substitution.components.length,s=0;s<r;s++)n=e[i+s+1],n.setState("deleted",!0)}function Sr(t,e,i){t instanceof ar&&Oo[t.id]&&Oo[t.id](t,e,i)}function Cr(t){for(var e=[].concat(t.backtrack),i=e.length-1;i>=0;i--){var n=e[i],r=ir(n),s=nr(n);if(!r&&!s)return!0;if(r)return!1}return!1}function Tr(t){if(ir(t.current))return!1;for(var e=0;e<t.lookahead.length;e++){if(!nr(t.lookahead[e]))return!0}return!1}function Fr(t){var e=this,i=this.featuresTags.arab,n=this.tokenizer.getRangeTokens(t);if(1!==n.length){var r=new Qn(n.map(function(t){return t.getState("glyphIndex")}),0),s=new Qn(n.map(function(t){return t.char}),0);n.forEach(function(t,o){if(!nr(t.char)){r.setCurrentIndex(o),s.setCurrentIndex(o);var a=0;Cr(s)&&(a|=1),Tr(s)&&(a|=2);var u;switch(a){case 1:u="fina";break;case 2:u="init";break;case 3:u="medi"}if(i.indexOf(u)!==-1){var l=e.query.lookupFeature({tag:u,script:"arab",contextParams:r});if(l instanceof Error)return console.info(l.message);l.forEach(function(t,e){t instanceof ar&&(Sr(t,n,e),r.context[e]=t.substitution)})}}})}}function Or(t,e){return new Qn(t.map(function(t){return t.activeState.value}),e||0)}function Nr(t){var e=this,i=this.tokenizer.getRangeTokens(t),n=Or(i);n.context.forEach(function(t,r){n.setCurrentIndex(r);var s=e.query.lookupFeature({tag:"rlig",script:"arab",contextParams:n});s.length&&(s.forEach(function(t){return Sr(t,i,r)}),n=Or(i))})}function Er(t){var e=t.current,i=t.get(-1);return null===i&&rr(e)||!rr(i)&&rr(e)}function Mr(t){var e=t.get(1);return null===e||!rr(e)}function Dr(t,e){return new Qn(t.map(function(t){return t.activeState.value}),e||0)}function Vr(t){var e=this,i=this.tokenizer.getRangeTokens(t),n=Dr(i);n.context.forEach(function(t,r){n.setCurrentIndex(r);var s=e.query.lookupFeature({tag:"liga",script:"latn",contextParams:n});s.length&&(s.forEach(function(t){return Sr(t,i,r)}),n=Dr(i))})}function Ir(t){this.baseDir=t||"ltr",this.tokenizer=new tr,this.featuresTags={}}function Br(t){var e=this.contextChecks[t+"Check"];return this.tokenizer.registerContextChecker(t,e.startCheck,e.endCheck)}function Ar(){return Br.call(this,"latinWord"),Br.call(this,"arabicWord"),Br.call(this,"arabicSentence"),this.tokenizer.tokenize(this.text)}function Pr(){var t=this;this.tokenizer.getContextRanges("arabicSentence").forEach(function(e){var i=t.tokenizer.getRangeTokens(e);t.tokenizer.replaceRange(e.startIndex,e.endOffset,i.reverse())})}function Lr(){if(this.tokenizer.registeredModifiers.indexOf("glyphIndex")===-1)throw new Error("glyphIndex modifier is required to apply arabic presentation features.")}function Rr(){var t=this;if(this.featuresTags.hasOwnProperty("arab")){Lr.call(this);this.tokenizer.getContextRanges("arabicWord").forEach(function(e){Fr.call(t,e)})}}function kr(){var t=this;if(this.featuresTags.hasOwnProperty("arab")){if(this.featuresTags.arab.indexOf("rlig")!==-1){Lr.call(this);this.tokenizer.getContextRanges("arabicWord").forEach(function(e){Nr.call(t,e)})}}}function Ur(){var t=this;if(this.featuresTags.hasOwnProperty("latn")){if(this.featuresTags.latn.indexOf("liga")!==-1){Lr.call(this);this.tokenizer.getContextRanges("latinWord").forEach(function(e){Vr.call(t,e)})}}}function Xr(t){t=t||{},t.tables=t.tables||{},t.empty||(Ie(t.familyName,"When creating a new Font object, familyName is required."),Ie(t.styleName,"When creating a new Font object, styleName is required."),Ie(t.unitsPerEm,"When creating a new Font object, unitsPerEm is required."),Ie(t.ascender,"When creating a new Font object, ascender is required."),Ie(t.descender<=0,"When creating a new Font object, negative descender value is required."),this.names={fontFamily:{en:t.familyName||" "},fontSubfamily:{en:t.styleName||" "},fullName:{en:t.fullName||t.familyName+" "+t.styleName},postScriptName:{en:t.postScriptName||(t.familyName+t.styleName).replace(/\s/g,"")},designer:{en:t.designer||" "},designerURL:{en:t.designerURL||" "},manufacturer:{en:t.manufacturer||" "},manufacturerURL:{en:t.manufacturerURL||" "},license:{en:t.license||" "},licenseURL:{en:t.licenseURL||" "},version:{en:t.version||"Version 0.1"},description:{en:t.description||" "},copyright:{en:t.copyright||" "},trademark:{en:t.trademark||" "}},this.unitsPerEm=t.unitsPerEm||1e3,this.ascender=t.ascender,this.descender=t.descender,this.createdTimestamp=t.createdTimestamp,this.tables=Object.assign(t.tables,{os2:Object.assign({usWeightClass:t.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:t.widthClass||this.usWidthClasses.MEDIUM,fsSelection:t.fsSelection||this.fsSelectionValues.REGULAR},t.tables.os2)})),this.supported=!0,this.glyphs=new js.GlyphSet(this,t.glyphs||[]),this.encoding=new q(this),this.position=new Fe(this),this.substitution=new Oe(this),this.tables=this.tables||{},this._push=null,this._hmtxTableData={},Object.defineProperty(this,"hinting",{get:function(){return this._hinting?this._hinting:"truetype"===this.outlinesFormat?this._hinting=new ze(this):void 0}})}function jr(t,e){var i=JSON.stringify(t),n=256;for(var r in e){var s=parseInt(r);if(s&&!(s<256)){if(JSON.stringify(e[r])===i)return s;n<=s&&(n=s+1)}}return e[n]=t,n}function zr(t,e,i){var n=jr(e.name,i);return[{name:"tag_"+t,type:"TAG",value:e.tag},{name:"minValue_"+t,type:"FIXED",value:e.minValue<<16},{name:"defaultValue_"+t,type:"FIXED",value:e.defaultValue<<16},{name:"maxValue_"+t,type:"FIXED",value:e.maxValue<<16},{name:"flags_"+t,type:"USHORT",value:0},{name:"nameID_"+t,type:"USHORT",value:n}]}function Gr(t,e,i){var n={},r=new As.Parser(t,e);return n.tag=r.parseTag(),n.minValue=r.parseFixed(),n.defaultValue=r.parseFixed(),n.maxValue=r.parseFixed(),r.skip("uShort",1),n.name=i[r.parseUShort()]||{},n}function Hr(t,e,i,n){for(var r=jr(e.name,n),s=[{name:"nameID_"+t,type:"USHORT",value:r},{name:"flags_"+t,type:"USHORT",value:0}],o=0;o<i.length;++o){var a=i[o].tag;s.push({name:"axis_"+t+" "+a,type:"FIXED",value:e.coordinates[a]<<16})}return s}function qr(t,e,i,n){var r={},s=new As.Parser(t,e);r.name=n[s.parseUShort()]||{},s.skip("uShort",1),r.coordinates={};for(var o=0;o<i.length;++o)r.coordinates[i[o].tag]=s.parseFixed();return r}function Wr(t,e){var i=new Vs.Table("fvar",[{name:"version",type:"ULONG",value:65536},{name:"offsetToData",type:"USHORT",value:0},{name:"countSizePairs",type:"USHORT",value:2},{name:"axisCount",type:"USHORT",value:t.axes.length},{name:"axisSize",type:"USHORT",value:20},{name:"instanceCount",type:"USHORT",value:t.instances.length},{name:"instanceSize",type:"USHORT",value:4+4*t.axes.length}]);i.offsetToData=i.sizeOf();for(var n=0;n<t.axes.length;n++)i.fields=i.fields.concat(zr(n,t.axes[n],e));for(var r=0;r<t.instances.length;r++)i.fields=i.fields.concat(Hr(r,t.instances[r],t.axes,e));return i}function Yr(t,e,i){var n=new As.Parser(t,e),r=n.parseULong();Ss.argument(65536===r,"Unsupported fvar table version.");var s=n.parseOffset16();n.skip("uShort",1);for(var o=n.parseUShort(),a=n.parseUShort(),u=n.parseUShort(),l=n.parseUShort(),c=[],h=0;h<o;h++)c.push(Gr(t,e+s+h*a,i));for(var d=[],p=e+s+o*a,f=0;f<u;f++)d.push(qr(t,p+f*l,c,i));return{axes:c,instances:d}}function $r(t,e){e=e||0;var i=new k(t,e),n=i.parseVersion(1);Ss.argument(1===n||1.2===n||1.3===n,"Unsupported GDEF table version.");var r={version:n,classDef:i.parsePointer(k.classDef),attachList:i.parsePointer(Mo),ligCaretList:i.parsePointer(Io),markAttachClassDef:i.parsePointer(k.classDef)};return n>=1.2&&(r.markGlyphSets=i.parsePointer(Bo)),r}function Zr(t,e){e=e||0;var i=new k(t,e),n=i.parseVersion(1);return Ss.argument(1===n||1.1===n,"Unsupported GPOS table version "+n),1===n?{version:n,scripts:i.parseScriptList(),features:i.parseFeatureList(),lookups:i.parseLookupList(Po)}:{version:n,scripts:i.parseScriptList(),features:i.parseFeatureList(),lookups:i.parseLookupList(Po),variations:i.parseFeatureVariationsList()}}function Qr(t){return new Vs.Table("GPOS",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new Vs.ScriptList(t.scripts)},{name:"features",type:"TABLE",value:new Vs.FeatureList(t.features)},{name:"lookups",type:"TABLE",value:new Vs.LookupList(t.lookups,Lo)}])}function Kr(t){var e={};t.skip("uShort");var i=t.parseUShort();Ss.argument(0===i,"Unsupported kern sub-table version."),t.skip("uShort",2);var n=t.parseUShort();t.skip("uShort",3);for(var r=0;r<n;r+=1){var s=t.parseUShort(),o=t.parseUShort(),a=t.parseShort();e[s+","+o]=a}return e}function Jr(t){var e={};t.skip("uShort"),t.parseULong()>1&&console.warn("Only the first kern subtable is supported."),t.skip("uLong");var i=t.parseUShort(),n=255&i;if(t.skip("uShort"),0===n){var r=t.parseUShort();t.skip("uShort",3);for(var s=0;s<r;s+=1){var o=t.parseUShort(),a=t.parseUShort(),u=t.parseShort();e[o+","+a]=u}}return e}function ts(t,e){var i=new As.Parser(t,e),n=i.parseUShort();if(0===n)return Kr(i);if(1===n)return Jr(i);throw new Error("Unsupported kern table version ("+n+").")}function es(t,e,i,n){for(var r=new As.Parser(t,e),s=n?r.parseUShort:r.parseULong,o=[],a=0;a<i+1;a+=1){var u=s.call(r);n&&(u*=2),o.push(u)}return o}function is(t,e){require("fs").readFile(t,function(t,i){if(t)return e(t.message);e(null,De(i))})}function ns(t,e){var i=new XMLHttpRequest;i.open("get",t,!0),i.responseType="arraybuffer",i.onload=function(){return i.response?e(null,i.response):e("Font could not be loaded: "+i.statusText)},i.onerror=function(){e("Font could not be loaded")},i.send()}function rs(t,e){for(var i=[],n=12,r=0;r<e;r+=1){var s=As.getTag(t,n),o=As.getULong(t,n+4),a=As.getULong(t,n+8),u=As.getULong(t,n+12);i.push({tag:s,checksum:o,offset:a,length:u,compression:!1}),n+=16}return i}function ss(t,e){for(var i=[],n=44,r=0;r<e;r+=1){var s=As.getTag(t,n),o=As.getULong(t,n+4),a=As.getULong(t,n+8),u=As.getULong(t,n+12),l=void 0;l=a<u&&"WOFF",i.push({tag:s,offset:o,compression:l,compressedLength:a,length:u}),n+=20}return i}function os(t,e){if("WOFF"===e.compression){var i=new Uint8Array(t.buffer,e.offset+2,e.compressedLength-2),n=new Uint8Array(e.length);if(bs(i,n),n.byteLength!==e.length)throw new Error("Decompression error: "+e.tag+" decompressed length doesn't match recorded length");return{data:new DataView(n.buffer,0),offset:0}}return{data:t,offset:e.offset}}function as(t,e){e=void 0===e||null===e?{}:e;var i,n,r,s=new Xr({empty:!0}),o=new DataView(t,0),a=[],u=As.getTag(o,0);if(u===String.fromCharCode(0,1,0,0)||"true"===u||"typ1"===u)s.outlinesFormat="truetype",r=As.getUShort(o,4),a=rs(o,r);else if("OTTO"===u)s.outlinesFormat="cff",r=As.getUShort(o,4),a=rs(o,r);else{if("wOFF"!==u)throw new Error("Unsupported OpenType signature "+u);var l=As.getTag(o,4);if(l===String.fromCharCode(0,1,0,0))s.outlinesFormat="truetype";else{if("OTTO"!==l)throw new Error("Unsupported OpenType flavor "+u);s.outlinesFormat="cff"}r=As.getUShort(o,12),a=ss(o,r)}for(var c,h,d,p,f,g,m,_,x,y,v,w,b=0;b<r;b+=1){var S=a[b],C=void 0;switch(S.tag){case"cmap":C=os(o,S),s.tables.cmap=Ps.parse(C.data,C.offset),s.encoding=new W(s.tables.cmap);break;case"cvt ":C=os(o,S),w=new As.Parser(C.data,C.offset),s.tables.cvt=w.parseShortList(S.length/2);break;case"fvar":h=S;break;case"fpgm":C=os(o,S),w=new As.Parser(C.data,C.offset),s.tables.fpgm=w.parseByteList(S.length);break;case"head":C=os(o,S),s.tables.head=qs.parse(C.data,C.offset),s.unitsPerEm=s.tables.head.unitsPerEm,i=s.tables.head.indexToLocFormat;break;case"hhea":C=os(o,S),s.tables.hhea=Ws.parse(C.data,C.offset),s.ascender=s.tables.hhea.ascender,s.descender=s.tables.hhea.descender,s.numberOfHMetrics=s.tables.hhea.numberOfHMetrics;break;case"hmtx":m=S;break;case"ltag":C=os(o,S),n=$s.parse(C.data,C.offset);break;case"maxp":C=os(o,S),s.tables.maxp=Zs.parse(C.data,C.offset),s.numGlyphs=s.tables.maxp.numGlyphs;break;case"name":y=S;break;case"OS/2":C=os(o,S),s.tables.os2=oo.parse(C.data,C.offset);break;case"post":C=os(o,S),s.tables.post=ao.parse(C.data,C.offset),s.glyphNames=new $(s.tables.post);break;case"prep":C=os(o,S),w=new As.Parser(C.data,C.offset),s.tables.prep=w.parseByteList(S.length);break;case"glyf":d=S;break;case"loca":x=S;break;case"CFF ":c=S;break;case"kern":_=S;break;case"GDEF":p=S;break;case"GPOS":f=S;break;case"GSUB":g=S;break;case"meta":v=S}}var T=os(o,y);if(s.tables.name=ro.parse(T.data,T.offset,n),s.names=s.tables.name,d&&x){var F=0===i,O=os(o,x),N=Uo.parse(O.data,O.offset,s.numGlyphs,F),E=os(o,d);s.glyphs=yo.parse(E.data,E.offset,N,s,e)}else{if(!c)throw new Error("Font doesn't contain TrueType or CFF outlines.");var M=os(o,c);Hs.parse(M.data,M.offset,s,e)}var D=os(o,m);if(Ys.parse(s,D.data,D.offset,s.numberOfHMetrics,s.numGlyphs,s.glyphs,e),K(s,e),_){var V=os(o,_);s.kerningPairs=ko.parse(V.data,V.offset)}else s.kerningPairs={};if(p){var I=os(o,p);s.tables.gdef=Ao.parse(I.data,I.offset)}if(f){var B=os(o,f);s.tables.gpos=Ro.parse(B.data,B.offset),s.position.init()}if(g){var A=os(o,g);s.tables.gsub=ho.parse(A.data,A.offset)}if(h){var P=os(o,h);s.tables.fvar=Eo.parse(P.data,P.offset,s.names)}if(v){var L=os(o,v);s.tables.meta=po.parse(L.data,L.offset),s.metas=s.tables.meta}return s}function us(t,e,i){i=void 0===i||null===i?{}:i;var n="undefined"==typeof window,r=n&&!i.isUrl?is:ns;return new Promise(function(n,s){r(t,function(t,r){if(t){if(e)return e(t);s(t)}var o;try{o=as(r,i)}catch(t){if(e)return e(t,null);s(t)}if(e)return e(null,o);n(o)})})}function ls(t,e){return as(De(require("fs").readFileSync(t)),e)}String.prototype.codePointAt||function(){var t=function(){try{var t={},e=Object.defineProperty,i=e(t,t,t)&&e}catch(t){}return i}(),e=function(t){if(null==this)throw TypeError();var e=String(this),i=e.length,n=t?Number(t):0;if(n!=n&&(n=0),!(n<0||n>=i)){var r,s=e.charCodeAt(n);return s>=55296&&s<=56319&&i>n+1&&(r=e.charCodeAt(n+1))>=56320&&r<=57343?1024*(s-55296)+r-56320+65536:s}};t?t(String.prototype,"codePointAt",{value:e,configurable:!0,writable:!0}):String.prototype.codePointAt=e}();var cs=0,hs=-3,ds=new e,ps=new e,fs=new Uint8Array(30),gs=new Uint16Array(30),ms=new Uint8Array(30),_s=new Uint16Array(30),xs=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ys=new e,vs=new Uint8Array(320),ws=new Uint16Array(16);!function(t,e){var i;for(i=0;i<7;++i)t.table[i]=0;for(t.table[7]=24,t.table[8]=152,t.table[9]=112,i=0;i<24;++i)t.trans[i]=256+i;for(i=0;i<144;++i)t.trans[24+i]=i;for(i=0;i<8;++i)t.trans[168+i]=280+i;for(i=0;i<112;++i)t.trans[176+i]=144+i;for(i=0;i<5;++i)e.table[i]=0;for(e.table[5]=32,i=0;i<32;++i)e.trans[i]=i}(ds,ps),n(fs,gs,4,3),n(ms,_s,2,1),fs[28]=0,gs[28]=258;var bs=h;p.prototype.isEmpty=function(){
|
|
32
|
-
return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)},p.prototype.addPoint=function(t,e){"number"==typeof t&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=t,this.x2=t),t<this.x1&&(this.x1=t),t>this.x2&&(this.x2=t)),"number"==typeof e&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=e,this.y2=e),e<this.y1&&(this.y1=e),e>this.y2&&(this.y2=e))},p.prototype.addX=function(t){this.addPoint(t,null)},p.prototype.addY=function(t){this.addPoint(null,t)},p.prototype.addBezier=function(t,e,i,n,r,s,o,a){var u=[t,e],l=[i,n],c=[r,s],h=[o,a];this.addPoint(t,e),this.addPoint(o,a);for(var p=0;p<=1;p++){var f=6*u[p]-12*l[p]+6*c[p],g=-3*u[p]+9*l[p]-9*c[p]+3*h[p],m=3*l[p]-3*u[p];if(0!==g){var _=Math.pow(f,2)-4*m*g;if(!(_<0)){var x=(-f+Math.sqrt(_))/(2*g);0<x&&x<1&&(0===p&&this.addX(d(u[p],l[p],c[p],h[p],x)),1===p&&this.addY(d(u[p],l[p],c[p],h[p],x)));var y=(-f-Math.sqrt(_))/(2*g);0<y&&y<1&&(0===p&&this.addX(d(u[p],l[p],c[p],h[p],y)),1===p&&this.addY(d(u[p],l[p],c[p],h[p],y)))}}else{if(0===f)continue;var v=-m/f;0<v&&v<1&&(0===p&&this.addX(d(u[p],l[p],c[p],h[p],v)),1===p&&this.addY(d(u[p],l[p],c[p],h[p],v)))}}},p.prototype.addQuad=function(t,e,i,n,r,s){var o=t+2/3*(i-t),a=e+2/3*(n-e),u=o+1/3*(r-t),l=a+1/3*(s-e);this.addBezier(t,e,o,a,u,l,r,s)},f.prototype.moveTo=function(t,e){this.commands.push({type:"M",x:t,y:e})},f.prototype.lineTo=function(t,e){this.commands.push({type:"L",x:t,y:e})},f.prototype.curveTo=f.prototype.bezierCurveTo=function(t,e,i,n,r,s){this.commands.push({type:"C",x1:t,y1:e,x2:i,y2:n,x:r,y:s})},f.prototype.quadTo=f.prototype.quadraticCurveTo=function(t,e,i,n){this.commands.push({type:"Q",x1:t,y1:e,x:i,y:n})},f.prototype.close=f.prototype.closePath=function(){this.commands.push({type:"Z"})},f.prototype.extend=function(t){if(t.commands)t=t.commands;else if(t instanceof p){var e=t;return this.moveTo(e.x1,e.y1),this.lineTo(e.x2,e.y1),this.lineTo(e.x2,e.y2),this.lineTo(e.x1,e.y2),void this.close()}Array.prototype.push.apply(this.commands,t)},f.prototype.getBoundingBox=function(){for(var t=new p,e=0,i=0,n=0,r=0,s=0;s<this.commands.length;s++){var o=this.commands[s];switch(o.type){case"M":t.addPoint(o.x,o.y),e=n=o.x,i=r=o.y;break;case"L":t.addPoint(o.x,o.y),n=o.x,r=o.y;break;case"Q":t.addQuad(n,r,o.x1,o.y1,o.x,o.y),n=o.x,r=o.y;break;case"C":t.addBezier(n,r,o.x1,o.y1,o.x2,o.y2,o.x,o.y),n=o.x,r=o.y;break;case"Z":n=e,r=i;break;default:throw new Error("Unexpected path command "+o.type)}}return t.isEmpty()&&t.addPoint(0,0),t},f.prototype.draw=function(t){t.beginPath();for(var e=0;e<this.commands.length;e+=1){var i=this.commands[e];"M"===i.type?t.moveTo(i.x,i.y):"L"===i.type?t.lineTo(i.x,i.y):"C"===i.type?t.bezierCurveTo(i.x1,i.y1,i.x2,i.y2,i.x,i.y):"Q"===i.type?t.quadraticCurveTo(i.x1,i.y1,i.x,i.y):"Z"===i.type&&t.closePath()}this.fill&&(t.fillStyle=this.fill,t.fill()),this.stroke&&(t.strokeStyle=this.stroke,t.lineWidth=this.strokeWidth,t.stroke())},f.prototype.toPathData=function(t){function e(e){return Math.round(e)===e?""+Math.round(e):e.toFixed(t)}function i(){for(var t=arguments,i="",n=0;n<arguments.length;n+=1){var r=t[n];r>=0&&n>0&&(i+=" "),i+=e(r)}return i}t=void 0!==t?t:2;for(var n="",r=0;r<this.commands.length;r+=1){var s=this.commands[r];"M"===s.type?n+="M"+i(s.x,s.y):"L"===s.type?n+="L"+i(s.x,s.y):"C"===s.type?n+="C"+i(s.x1,s.y1,s.x2,s.y2,s.x,s.y):"Q"===s.type?n+="Q"+i(s.x1,s.y1,s.x,s.y):"Z"===s.type&&(n+="Z")}return n},f.prototype.toSVG=function(t){var e='<path d="';return e+=this.toPathData(t),e+='"',this.fill&&"black"!==this.fill&&(e+=null===this.fill?' fill="none"':' fill="'+this.fill+'"'),this.stroke&&(e+=' stroke="'+this.stroke+'" stroke-width="'+this.strokeWidth+'"'),e+="/>"},f.prototype.toDOMElement=function(t){var e=this.toPathData(t),i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d",e),i};var Ss={fail:g,argument:m,assert:m},Cs={},Ts={},Fs={};Ts.BYTE=function(t){return Ss.argument(t>=0&&t<=255,"Byte value should be between 0 and 255."),[t]},Fs.BYTE=_(1),Ts.CHAR=function(t){return[t.charCodeAt(0)]},Fs.CHAR=_(1),Ts.CHARARRAY=function(t){void 0===t&&(t="",console.warn("Undefined CHARARRAY encountered and treated as an empty string. This is probably caused by a missing glyph name."));for(var e=[],i=0;i<t.length;i+=1)e[i]=t.charCodeAt(i);return e},Fs.CHARARRAY=function(t){return void 0===t?0:t.length},Ts.USHORT=function(t){return[t>>8&255,255&t]},Fs.USHORT=_(2),Ts.SHORT=function(t){return t>=32768&&(t=-(65536-t)),[t>>8&255,255&t]},Fs.SHORT=_(2),Ts.UINT24=function(t){return[t>>16&255,t>>8&255,255&t]},Fs.UINT24=_(3),Ts.ULONG=function(t){return[t>>24&255,t>>16&255,t>>8&255,255&t]},Fs.ULONG=_(4),Ts.LONG=function(t){return t>=2147483648&&(t=-(4294967296-t)),[t>>24&255,t>>16&255,t>>8&255,255&t]},Fs.LONG=_(4),Ts.FIXED=Ts.ULONG,Fs.FIXED=Fs.ULONG,Ts.FWORD=Ts.SHORT,Fs.FWORD=Fs.SHORT,Ts.UFWORD=Ts.USHORT,Fs.UFWORD=Fs.USHORT,Ts.LONGDATETIME=function(t){return[0,0,0,0,t>>24&255,t>>16&255,t>>8&255,255&t]},Fs.LONGDATETIME=_(8),Ts.TAG=function(t){return Ss.argument(4===t.length,"Tag should be exactly 4 ASCII characters."),[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]},Fs.TAG=_(4),Ts.Card8=Ts.BYTE,Fs.Card8=Fs.BYTE,Ts.Card16=Ts.USHORT,Fs.Card16=Fs.USHORT,Ts.OffSize=Ts.BYTE,Fs.OffSize=Fs.BYTE,Ts.SID=Ts.USHORT,Fs.SID=Fs.USHORT,Ts.NUMBER=function(t){return t>=-107&&t<=107?[t+139]:t>=108&&t<=1131?(t-=108,[247+(t>>8),255&t]):t>=-1131&&t<=-108?(t=-t-108,[251+(t>>8),255&t]):t>=-32768&&t<=32767?Ts.NUMBER16(t):Ts.NUMBER32(t)},Fs.NUMBER=function(t){return Ts.NUMBER(t).length},Ts.NUMBER16=function(t){return[28,t>>8&255,255&t]},Fs.NUMBER16=_(3),Ts.NUMBER32=function(t){return[29,t>>24&255,t>>16&255,t>>8&255,255&t]},Fs.NUMBER32=_(5),Ts.REAL=function(t){var e=t.toString(),i=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(e);if(i){var n=parseFloat("1e"+((i[2]?+i[2]:0)+i[1].length));e=(Math.round(t*n)/n).toString()}for(var r="",s=0,o=e.length;s<o;s+=1){var a=e[s];r+="e"===a?"-"===e[++s]?"c":"b":"."===a?"a":"-"===a?"e":a}r+=1&r.length?"f":"ff";for(var u=[30],l=0,c=r.length;l<c;l+=2)u.push(parseInt(r.substr(l,2),16));return u},Fs.REAL=function(t){return Ts.REAL(t).length},Ts.NAME=Ts.CHARARRAY,Fs.NAME=Fs.CHARARRAY,Ts.STRING=Ts.CHARARRAY,Fs.STRING=Fs.CHARARRAY,Cs.UTF8=function(t,e,i){for(var n=[],r=i,s=0;s<r;s++,e+=1)n[s]=t.getUint8(e);return String.fromCharCode.apply(null,n)},Cs.UTF16=function(t,e,i){for(var n=[],r=i/2,s=0;s<r;s++,e+=2)n[s]=t.getUint16(e);return String.fromCharCode.apply(null,n)},Ts.UTF16=function(t){for(var e=[],i=0;i<t.length;i+=1){var n=t.charCodeAt(i);e[e.length]=n>>8&255,e[e.length]=255&n}return e},Fs.UTF16=function(t){return 2*t.length};var Os={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};Cs.MACSTRING=function(t,e,i,n){var r=Os[n];if(void 0!==r){for(var s="",o=0;o<i;o++){var a=t.getUint8(e+o);s+=a<=127?String.fromCharCode(a):r[127&a]}return s}};var Ns,Es="function"==typeof WeakMap&&new WeakMap,Ms=function(t){if(!Ns){Ns={};for(var e in Os)Ns[e]=new String(e)}var i=Ns[t];if(void 0!==i){if(Es){var n=Es.get(i);if(void 0!==n)return n}var r=Os[t];if(void 0!==r){for(var s={},o=0;o<r.length;o++)s[r.charCodeAt(o)]=o+128;return Es&&Es.set(i,s),s}}};Ts.MACSTRING=function(t,e){var i=Ms(e);if(void 0!==i){for(var n=[],r=0;r<t.length;r++){var s=t.charCodeAt(r);if(s>=128&&void 0===(s=i[s]))return;n[r]=s}return n}},Fs.MACSTRING=function(t,e){var i=Ts.MACSTRING(t,e);return void 0!==i?i.length:0},Ts.VARDELTAS=function(t){for(var e=0,i=[];e<t.length;){var n=t[e];e=0===n?y(t,e,i):n>=-128&&n<=127?v(t,e,i):w(t,e,i)}return i},Ts.INDEX=function(t){for(var e=1,i=[e],n=[],r=0;r<t.length;r+=1){var s=Ts.OBJECT(t[r]);Array.prototype.push.apply(n,s),e+=s.length,i.push(e)}if(0===n.length)return[0,0];for(var o=[],a=1+Math.floor(Math.log(e)/Math.log(2))/8|0,u=[void 0,Ts.BYTE,Ts.USHORT,Ts.UINT24,Ts.ULONG][a],l=0;l<i.length;l+=1){var c=u(i[l]);Array.prototype.push.apply(o,c)}return Array.prototype.concat(Ts.Card16(t.length),Ts.OffSize(a),o,n)},Fs.INDEX=function(t){return Ts.INDEX(t).length},Ts.DICT=function(t){for(var e=[],i=Object.keys(t),n=i.length,r=0;r<n;r+=1){var s=parseInt(i[r],0),o=t[s];e=e.concat(Ts.OPERAND(o.value,o.type)),e=e.concat(Ts.OPERATOR(s))}return e},Fs.DICT=function(t){return Ts.DICT(t).length},Ts.OPERATOR=function(t){return t<1200?[t]:[12,t-1200]},Ts.OPERAND=function(t,e){var i=[];if(Array.isArray(e))for(var n=0;n<e.length;n+=1)Ss.argument(t.length===e.length,"Not enough arguments given for type"+e),i=i.concat(Ts.OPERAND(t[n],e[n]));else if("SID"===e)i=i.concat(Ts.NUMBER(t));else if("offset"===e)i=i.concat(Ts.NUMBER32(t));else if("number"===e)i=i.concat(Ts.NUMBER(t));else{if("real"!==e)throw new Error("Unknown operand type "+e);i=i.concat(Ts.REAL(t))}return i},Ts.OP=Ts.BYTE,Fs.OP=Fs.BYTE;var Ds="function"==typeof WeakMap&&new WeakMap;Ts.CHARSTRING=function(t){if(Ds){var e=Ds.get(t);if(void 0!==e)return e}for(var i=[],n=t.length,r=0;r<n;r+=1){var s=t[r];i=i.concat(Ts[s.type](s.value))}return Ds&&Ds.set(t,i),i},Fs.CHARSTRING=function(t){return Ts.CHARSTRING(t).length},Ts.OBJECT=function(t){var e=Ts[t.type];return Ss.argument(void 0!==e,"No encoding function for type "+t.type),e(t.value)},Fs.OBJECT=function(t){var e=Fs[t.type];return Ss.argument(void 0!==e,"No sizeOf function for type "+t.type),e(t.value)},Ts.TABLE=function(t){for(var e=[],i=t.fields.length,n=[],r=[],s=0;s<i;s+=1){var o=t.fields[s],a=Ts[o.type];Ss.argument(void 0!==a,"No encoding function for field type "+o.type+" ("+o.name+")");var u=t[o.name];void 0===u&&(u=o.value);var l=a(u);"TABLE"===o.type?(r.push(e.length),e=e.concat([0,0]),n.push(l)):e=e.concat(l)}for(var c=0;c<n.length;c+=1){var h=r[c],d=e.length;Ss.argument(d<65536,"Table "+t.tableName+" too big."),e[h]=d>>8,e[h+1]=255&d,e=e.concat(n[c])}return e},Fs.TABLE=function(t){for(var e=0,i=t.fields.length,n=0;n<i;n+=1){var r=t.fields[n],s=Fs[r.type];Ss.argument(void 0!==s,"No sizeOf function for field type "+r.type+" ("+r.name+")");var o=t[r.name];void 0===o&&(o=r.value),e+=s(o),"TABLE"===r.type&&(e+=2)}return e},Ts.RECORD=Ts.TABLE,Fs.RECORD=Fs.TABLE,Ts.LITERAL=function(t){return t},Fs.LITERAL=function(t){return t.length},b.prototype.encode=function(){return Ts.TABLE(this)},b.prototype.sizeOf=function(){return Fs.TABLE(this)},F.prototype=Object.create(b.prototype),F.prototype.constructor=F,O.prototype=Object.create(b.prototype),O.prototype.constructor=O,N.prototype=Object.create(b.prototype),N.prototype.constructor=N,E.prototype=Object.create(b.prototype),E.prototype.constructor=E;var Vs={Table:b,Record:b,Coverage:F,ScriptList:O,FeatureList:N,LookupList:E,ushortList:S,tableList:C,recordList:T},Is={byte:1,uShort:2,short:2,uLong:4,fixed:4,longDateTime:8,tag:4};k.prototype.parseByte=function(){var t=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,t},k.prototype.parseChar=function(){var t=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,t},k.prototype.parseCard8=k.prototype.parseByte,k.prototype.parseUShort=function(){var t=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,t},k.prototype.parseCard16=k.prototype.parseUShort,k.prototype.parseSID=k.prototype.parseUShort,k.prototype.parseOffset16=k.prototype.parseUShort,k.prototype.parseShort=function(){var t=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,t},k.prototype.parseF2Dot14=function(){var t=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,t},k.prototype.parseULong=function(){var t=I(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,t},k.prototype.parseOffset32=k.prototype.parseULong,k.prototype.parseFixed=function(){var t=B(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,t},k.prototype.parseString=function(t){var e=this.data,i=this.offset+this.relativeOffset,n="";this.relativeOffset+=t;for(var r=0;r<t;r++)n+=String.fromCharCode(e.getUint8(i+r));return n},k.prototype.parseTag=function(){return this.parseString(4)},k.prototype.parseLongDateTime=function(){var t=I(this.data,this.offset+this.relativeOffset+4);return t-=2082844800,this.relativeOffset+=8,t},k.prototype.parseVersion=function(t){var e=D(this.data,this.offset+this.relativeOffset),i=D(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,void 0===t&&(t=4096),e+i/t/10},k.prototype.skip=function(t,e){void 0===e&&(e=1),this.relativeOffset+=Is[t]*e},k.prototype.parseULongList=function(t){void 0===t&&(t=this.parseULong());for(var e=new Array(t),i=this.data,n=this.offset+this.relativeOffset,r=0;r<t;r++)e[r]=i.getUint32(n),n+=4;return this.relativeOffset+=4*t,e},k.prototype.parseOffset16List=k.prototype.parseUShortList=function(t){void 0===t&&(t=this.parseUShort());for(var e=new Array(t),i=this.data,n=this.offset+this.relativeOffset,r=0;r<t;r++)e[r]=i.getUint16(n),n+=2;return this.relativeOffset+=2*t,e},k.prototype.parseShortList=function(t){for(var e=new Array(t),i=this.data,n=this.offset+this.relativeOffset,r=0;r<t;r++)e[r]=i.getInt16(n),n+=2;return this.relativeOffset+=2*t,e},k.prototype.parseByteList=function(t){for(var e=new Array(t),i=this.data,n=this.offset+this.relativeOffset,r=0;r<t;r++)e[r]=i.getUint8(n++);return this.relativeOffset+=t,e},k.prototype.parseList=function(t,e){e||(e=t,t=this.parseUShort());for(var i=new Array(t),n=0;n<t;n++)i[n]=e.call(this);return i},k.prototype.parseList32=function(t,e){e||(e=t,t=this.parseULong());for(var i=new Array(t),n=0;n<t;n++)i[n]=e.call(this);return i},k.prototype.parseRecordList=function(t,e){e||(e=t,t=this.parseUShort());for(var i=new Array(t),n=Object.keys(e),r=0;r<t;r++){for(var s={},o=0;o<n.length;o++){var a=n[o],u=e[a];s[a]=u.call(this)}i[r]=s}return i},k.prototype.parseRecordList32=function(t,e){e||(e=t,t=this.parseULong());for(var i=new Array(t),n=Object.keys(e),r=0;r<t;r++){for(var s={},o=0;o<n.length;o++){var a=n[o],u=e[a];s[a]=u.call(this)}i[r]=s}return i},k.prototype.parseStruct=function(t){if("function"==typeof t)return t.call(this);for(var e=Object.keys(t),i={},n=0;n<e.length;n++){var r=e[n],s=t[r];i[r]=s.call(this)}return i},k.prototype.parseValueRecord=function(t){if(void 0===t&&(t=this.parseUShort()),0!==t){var e={};return 1&t&&(e.xPlacement=this.parseShort()),2&t&&(e.yPlacement=this.parseShort()),4&t&&(e.xAdvance=this.parseShort()),8&t&&(e.yAdvance=this.parseShort()),16&t&&(e.xPlaDevice=void 0,this.parseShort()),32&t&&(e.yPlaDevice=void 0,this.parseShort()),64&t&&(e.xAdvDevice=void 0,this.parseShort()),128&t&&(e.yAdvDevice=void 0,this.parseShort()),e}},k.prototype.parseValueRecordList=function(){for(var t=this.parseUShort(),e=this.parseUShort(),i=new Array(e),n=0;n<e;n++)i[n]=this.parseValueRecord(t);return i},k.prototype.parsePointer=function(t){var e=this.parseOffset16();if(e>0)return new k(this.data,this.offset+e).parseStruct(t)},k.prototype.parsePointer32=function(t){var e=this.parseOffset32();if(e>0)return new k(this.data,this.offset+e).parseStruct(t)},k.prototype.parseListOfLists=function(t){for(var e=this.parseOffset16List(),i=e.length,n=this.relativeOffset,r=new Array(i),s=0;s<i;s++){var o=e[s];if(0!==o)if(this.relativeOffset=o,t){for(var a=this.parseOffset16List(),u=new Array(a.length),l=0;l<a.length;l++)this.relativeOffset=o+a[l],u[l]=t.call(this);r[s]=u}else r[s]=this.parseUShortList();else r[s]=void 0}return this.relativeOffset=n,r},k.prototype.parseCoverage=function(){var t=this.offset+this.relativeOffset,e=this.parseUShort(),i=this.parseUShort();if(1===e)return{format:1,glyphs:this.parseUShortList(i)};if(2===e){for(var n=new Array(i),r=0;r<i;r++)n[r]={start:this.parseUShort(),end:this.parseUShort(),index:this.parseUShort()};return{format:2,ranges:n}}throw new Error("0x"+t.toString(16)+": Coverage format must be 1 or 2.")},k.prototype.parseClassDef=function(){var t=this.offset+this.relativeOffset,e=this.parseUShort();if(1===e)return{format:1,startGlyph:this.parseUShort(),classes:this.parseUShortList()};if(2===e)return{format:2,ranges:this.parseRecordList({start:k.uShort,end:k.uShort,classId:k.uShort})};throw new Error("0x"+t.toString(16)+": ClassDef format must be 1 or 2.")},k.list=function(t,e){return function(){return this.parseList(t,e)}},k.list32=function(t,e){return function(){return this.parseList32(t,e)}},k.recordList=function(t,e){return function(){return this.parseRecordList(t,e)}},k.recordList32=function(t,e){return function(){return this.parseRecordList32(t,e)}},k.pointer=function(t){return function(){return this.parsePointer(t)}},k.pointer32=function(t){return function(){return this.parsePointer32(t)}},k.tag=k.prototype.parseTag,k.byte=k.prototype.parseByte,k.uShort=k.offset16=k.prototype.parseUShort,k.uShortList=k.prototype.parseUShortList,k.uLong=k.offset32=k.prototype.parseULong,k.uLongList=k.prototype.parseULongList,k.struct=k.prototype.parseStruct,k.coverage=k.prototype.parseCoverage,k.classDef=k.prototype.parseClassDef;var Bs={reserved:k.uShort,reqFeatureIndex:k.uShort,featureIndexes:k.uShortList};k.prototype.parseScriptList=function(){return this.parsePointer(k.recordList({tag:k.tag,script:k.pointer({defaultLangSys:k.pointer(Bs),langSysRecords:k.recordList({tag:k.tag,langSys:k.pointer(Bs)})})}))||[]},k.prototype.parseFeatureList=function(){return this.parsePointer(k.recordList({tag:k.tag,feature:k.pointer({featureParams:k.offset16,lookupListIndexes:k.uShortList})}))||[]},k.prototype.parseLookupList=function(t){return this.parsePointer(k.list(k.pointer(function(){var e=this.parseUShort();Ss.argument(1<=e&&e<=9,"GPOS/GSUB lookup type "+e+" unknown.");var i=this.parseUShort(),n=16&i;return{lookupType:e,lookupFlag:i,subtables:this.parseList(k.pointer(t[e])),markFilteringSet:n?this.parseUShort():void 0}})))||[]},k.prototype.parseFeatureVariationsList=function(){return this.parsePointer32(function(){var t=this.parseUShort(),e=this.parseUShort();return Ss.argument(1===t&&e<1,"GPOS/GSUB feature variations table unknown."),this.parseRecordList32({conditionSetOffset:k.offset32,featureTableSubstitutionOffset:k.offset32})})||[]};var As={getByte:M,getCard8:M,getUShort:D,getCard16:D,getShort:V,getULong:I,getFixed:B,getTag:A,getOffset:P,getBytes:L,bytesToString:R,Parser:k},Ps={parse:j,make:H},Ls=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","266 ff","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],Rs=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls"],ks=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],Us=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];q.prototype.charToGlyphIndex=function(t){var e=t.codePointAt(0),i=this.font.glyphs;if(i)for(var n=0;n<i.length;n+=1)for(var r=i.get(n),s=0;s<r.unicodes.length;s+=1)if(r.unicodes[s]===e)return n;return null},W.prototype.charToGlyphIndex=function(t){return this.cmap.glyphIndexMap[t.codePointAt(0)]||0},Y.prototype.charToGlyphIndex=function(t){var e=t.codePointAt(0),i=this.encoding[e];return this.charset.indexOf(i)},$.prototype.nameToGlyphIndex=function(t){return this.names.indexOf(t)},$.prototype.glyphIndexToName=function(t){return this.names[t]};var Xs={line:J};et.prototype.bindConstructorValues=function(t){this.index=t.index||0,this.name=t.name||null,this.unicode=t.unicode||void 0,this.unicodes=t.unicodes||void 0!==t.unicode?[t.unicode]:[],"xMin"in t&&(this.xMin=t.xMin),"yMin"in t&&(this.yMin=t.yMin),"xMax"in t&&(this.xMax=t.xMax),"yMax"in t&&(this.yMax=t.yMax),"advanceWidth"in t&&(this.advanceWidth=t.advanceWidth),Object.defineProperty(this,"path",tt(this,t.path))},et.prototype.addUnicode=function(t){0===this.unicodes.length&&(this.unicode=t),this.unicodes.push(t)},et.prototype.getBoundingBox=function(){return this.path.getBoundingBox()},et.prototype.getPath=function(t,e,i,n,r){t=void 0!==t?t:0,e=void 0!==e?e:0,i=void 0!==i?i:72;var s,o;n||(n={});var a=n.xScale,u=n.yScale;if(n.hinting&&r&&r.hinting&&(o=this.path&&r.hinting.exec(this,i)),o)s=r.hinting.getCommands(o),t=Math.round(t),e=Math.round(e),a=u=1;else{s=this.path.commands;var l=1/(this.path.unitsPerEm||1e3)*i;void 0===a&&(a=l),void 0===u&&(u=l)}for(var c=new f,h=0;h<s.length;h+=1){var d=s[h];"M"===d.type?c.moveTo(t+d.x*a,e+-d.y*u):"L"===d.type?c.lineTo(t+d.x*a,e+-d.y*u):"Q"===d.type?c.quadraticCurveTo(t+d.x1*a,e+-d.y1*u,t+d.x*a,e+-d.y*u):"C"===d.type?c.curveTo(t+d.x1*a,e+-d.y1*u,t+d.x2*a,e+-d.y2*u,t+d.x*a,e+-d.y*u):"Z"===d.type&&c.closePath()}return c},
|
|
33
|
-
et.prototype.getContours=function(){if(void 0===this.points)return[];for(var t=[],e=[],i=0;i<this.points.length;i+=1){var n=this.points[i];e.push(n),n.lastPointOfContour&&(t.push(e),e=[])}return Ss.argument(0===e.length,"There are still points left in the current contour."),t},et.prototype.getMetrics=function(){for(var t=this.path.commands,e=[],i=[],n=0;n<t.length;n+=1){var r=t[n];"Z"!==r.type&&(e.push(r.x),i.push(r.y)),"Q"!==r.type&&"C"!==r.type||(e.push(r.x1),i.push(r.y1)),"C"===r.type&&(e.push(r.x2),i.push(r.y2))}var s={xMin:Math.min.apply(null,e),yMin:Math.min.apply(null,i),xMax:Math.max.apply(null,e),yMax:Math.max.apply(null,i),leftSideBearing:this.leftSideBearing};return isFinite(s.xMin)||(s.xMin=0),isFinite(s.xMax)||(s.xMax=this.advanceWidth),isFinite(s.yMin)||(s.yMin=0),isFinite(s.yMax)||(s.yMax=0),s.rightSideBearing=this.advanceWidth-s.leftSideBearing-(s.xMax-s.xMin),s},et.prototype.draw=function(t,e,i,n,r){this.getPath(e,i,n,r).draw(t)},et.prototype.drawPoints=function(t,e,i,n){function r(e,i,n,r){t.beginPath();for(var s=0;s<e.length;s+=1)t.moveTo(i+e[s].x*r,n+e[s].y*r),t.arc(i+e[s].x*r,n+e[s].y*r,2,0,2*Math.PI,!1);t.closePath(),t.fill()}e=void 0!==e?e:0,i=void 0!==i?i:0,n=void 0!==n?n:24;for(var s=1/this.path.unitsPerEm*n,o=[],a=[],u=this.path,l=0;l<u.commands.length;l+=1){var c=u.commands[l];void 0!==c.x&&o.push({x:c.x,y:-c.y}),void 0!==c.x1&&a.push({x:c.x1,y:-c.y1}),void 0!==c.x2&&a.push({x:c.x2,y:-c.y2})}t.fillStyle="blue",r(o,e,i,s),t.fillStyle="red",r(a,e,i,s)},et.prototype.drawMetrics=function(t,e,i,n){var r;e=void 0!==e?e:0,i=void 0!==i?i:0,n=void 0!==n?n:24,r=1/this.path.unitsPerEm*n,t.lineWidth=1,t.strokeStyle="black",Xs.line(t,e,-1e4,e,1e4),Xs.line(t,-1e4,i,1e4,i);var s=this.xMin||0,o=this.yMin||0,a=this.xMax||0,u=this.yMax||0,l=this.advanceWidth||0;t.strokeStyle="blue",Xs.line(t,e+s*r,-1e4,e+s*r,1e4),Xs.line(t,e+a*r,-1e4,e+a*r,1e4),Xs.line(t,-1e4,i+-o*r,1e4,i+-o*r),Xs.line(t,-1e4,i+-u*r,1e4,i+-u*r),t.strokeStyle="green",Xs.line(t,e+l*r,-1e4,e+l*r,1e4)},nt.prototype.get=function(t){if(void 0===this.glyphs[t]){this.font._push(t),"function"==typeof this.glyphs[t]&&(this.glyphs[t]=this.glyphs[t]());var e=this.glyphs[t],i=this.font._IndexToUnicodeMap[t];if(i)for(var n=0;n<i.unicodes.length;n++)e.addUnicode(i.unicodes[n]);this.font.cffEncoding?this.font.isCIDFont?e.name="gid"+t:e.name=this.font.cffEncoding.charset[t]:this.font.glyphNames.names&&(e.name=this.font.glyphNames.glyphIndexToName(t)),this.glyphs[t].advanceWidth=this.font._hmtxTableData[t].advanceWidth,this.glyphs[t].leftSideBearing=this.font._hmtxTableData[t].leftSideBearing}else"function"==typeof this.glyphs[t]&&(this.glyphs[t]=this.glyphs[t]());return this.glyphs[t]},nt.prototype.push=function(t,e){this.glyphs[t]=e,this.length++};var js={GlyphSet:nt,glyphLoader:rt,ttfGlyphLoader:st,cffGlyphLoader:ot},zs=[{name:"version",op:0,type:"SID"},{name:"notice",op:1,type:"SID"},{name:"copyright",op:1200,type:"SID"},{name:"fullName",op:2,type:"SID"},{name:"familyName",op:3,type:"SID"},{name:"weight",op:4,type:"SID"},{name:"isFixedPitch",op:1201,type:"number",value:0},{name:"italicAngle",op:1202,type:"number",value:0},{name:"underlinePosition",op:1203,type:"number",value:-100},{name:"underlineThickness",op:1204,type:"number",value:50},{name:"paintType",op:1205,type:"number",value:0},{name:"charstringType",op:1206,type:"number",value:2},{name:"fontMatrix",op:1207,type:["real","real","real","real","real","real"],value:[.001,0,0,.001,0,0]},{name:"uniqueId",op:13,type:"number"},{name:"fontBBox",op:5,type:["number","number","number","number"],value:[0,0,0,0]},{name:"strokeWidth",op:1208,type:"number",value:0},{name:"xuid",op:14,type:[],value:null},{name:"charset",op:15,type:"offset",value:0},{name:"encoding",op:16,type:"offset",value:0},{name:"charStrings",op:17,type:"offset",value:0},{name:"private",op:18,type:["number","offset"],value:[0,0]},{name:"ros",op:1230,type:["SID","SID","number"]},{name:"cidFontVersion",op:1231,type:"number",value:0},{name:"cidFontRevision",op:1232,type:"number",value:0},{name:"cidFontType",op:1233,type:"number",value:0},{name:"cidCount",op:1234,type:"number",value:8720},{name:"uidBase",op:1235,type:"number"},{name:"fdArray",op:1236,type:"offset"},{name:"fdSelect",op:1237,type:"offset"},{name:"fontName",op:1238,type:"SID"}],Gs=[{name:"subrs",op:19,type:"offset",value:0},{name:"defaultWidthX",op:20,type:"number",value:0},{name:"nominalWidthX",op:21,type:"number",value:0}],Hs={parse:Ft,make:kt},qs={parse:Ut,make:Xt},Ws={parse:jt,make:zt},Ys={parse:qt,make:Wt},$s={make:Yt,parse:$t},Zs={parse:Zt,make:Qt},Qs=["copyright","fontFamily","fontSubfamily","uniqueID","fullName","version","postScriptName","trademark","manufacturer","designer","description","manufacturerURL","designerURL","license","licenseURL","reserved","preferredFamily","preferredSubfamily","compatibleFullName","sampleText","postScriptFindFontName","wwsFamily","wwsSubfamily"],Ks={0:"en",1:"fr",2:"de",3:"it",4:"nl",5:"sv",6:"es",7:"da",8:"pt",9:"no",10:"he",11:"ja",12:"ar",13:"fi",14:"el",15:"is",16:"mt",17:"tr",18:"hr",19:"zh-Hant",20:"ur",21:"hi",22:"th",23:"ko",24:"lt",25:"pl",26:"hu",27:"es",28:"lv",29:"se",30:"fo",31:"fa",32:"ru",33:"zh",34:"nl-BE",35:"ga",36:"sq",37:"ro",38:"cz",39:"sk",40:"si",41:"yi",42:"sr",43:"mk",44:"bg",45:"uk",46:"be",47:"uz",48:"kk",49:"az-Cyrl",50:"az-Arab",51:"hy",52:"ka",53:"mo",54:"ky",55:"tg",56:"tk",57:"mn-CN",58:"mn",59:"ps",60:"ks",61:"ku",62:"sd",63:"bo",64:"ne",65:"sa",66:"mr",67:"bn",68:"as",69:"gu",70:"pa",71:"or",72:"ml",73:"kn",74:"ta",75:"te",76:"si",77:"my",78:"km",79:"lo",80:"vi",81:"id",82:"tl",83:"ms",84:"ms-Arab",85:"am",86:"ti",87:"om",88:"so",89:"sw",90:"rw",91:"rn",92:"ny",93:"mg",94:"eo",128:"cy",129:"eu",130:"ca",131:"la",132:"qu",133:"gn",134:"ay",135:"tt",136:"ug",137:"dz",138:"jv",139:"su",140:"gl",141:"af",142:"br",143:"iu",144:"gd",145:"gv",146:"ga",147:"to",148:"el-polyton",149:"kl",150:"az",151:"nn"},Js={0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:5,11:1,12:4,13:0,14:6,15:0,16:0,17:0,18:0,19:2,20:4,21:9,22:21,23:3,24:29,25:29,26:29,27:29,28:29,29:0,30:0,31:4,32:7,33:25,34:0,35:0,36:0,37:0,38:29,39:29,40:0,41:5,42:7,43:7,44:7,45:7,46:7,47:7,48:7,49:7,50:4,51:24,52:23,53:7,54:7,55:7,56:7,57:27,58:7,59:4,60:4,61:4,62:4,63:26,64:9,65:9,66:9,67:13,68:13,69:11,70:10,71:12,72:17,73:16,74:14,75:15,76:18,77:19,78:20,79:22,80:30,81:0,82:0,83:0,84:4,85:28,86:28,87:28,88:0,89:0,90:0,91:0,92:0,93:0,94:0,128:0,129:0,130:0,131:0,132:0,133:0,134:0,135:7,136:4,137:26,138:0,139:0,140:0,141:0,142:0,143:28,144:0,145:0,146:0,147:0,148:6,149:0,150:0,151:0},to={1078:"af",1052:"sq",1156:"gsw",1118:"am",5121:"ar-DZ",15361:"ar-BH",3073:"ar",2049:"ar-IQ",11265:"ar-JO",13313:"ar-KW",12289:"ar-LB",4097:"ar-LY",6145:"ary",8193:"ar-OM",16385:"ar-QA",1025:"ar-SA",10241:"ar-SY",7169:"aeb",14337:"ar-AE",9217:"ar-YE",1067:"hy",1101:"as",2092:"az-Cyrl",1068:"az",1133:"ba",1069:"eu",1059:"be",2117:"bn",1093:"bn-IN",8218:"bs-Cyrl",5146:"bs",1150:"br",1026:"bg",1027:"ca",3076:"zh-HK",5124:"zh-MO",2052:"zh",4100:"zh-SG",1028:"zh-TW",1155:"co",1050:"hr",4122:"hr-BA",1029:"cs",1030:"da",1164:"prs",1125:"dv",2067:"nl-BE",1043:"nl",3081:"en-AU",10249:"en-BZ",4105:"en-CA",9225:"en-029",16393:"en-IN",6153:"en-IE",8201:"en-JM",17417:"en-MY",5129:"en-NZ",13321:"en-PH",18441:"en-SG",7177:"en-ZA",11273:"en-TT",2057:"en-GB",1033:"en",12297:"en-ZW",1061:"et",1080:"fo",1124:"fil",1035:"fi",2060:"fr-BE",3084:"fr-CA",1036:"fr",5132:"fr-LU",6156:"fr-MC",4108:"fr-CH",1122:"fy",1110:"gl",1079:"ka",3079:"de-AT",1031:"de",5127:"de-LI",4103:"de-LU",2055:"de-CH",1032:"el",1135:"kl",1095:"gu",1128:"ha",1037:"he",1081:"hi",1038:"hu",1039:"is",1136:"ig",1057:"id",1117:"iu",2141:"iu-Latn",2108:"ga",1076:"xh",1077:"zu",1040:"it",2064:"it-CH",1041:"ja",1099:"kn",1087:"kk",1107:"km",1158:"quc",1159:"rw",1089:"sw",1111:"kok",1042:"ko",1088:"ky",1108:"lo",1062:"lv",1063:"lt",2094:"dsb",1134:"lb",1071:"mk",2110:"ms-BN",1086:"ms",1100:"ml",1082:"mt",1153:"mi",1146:"arn",1102:"mr",1148:"moh",1104:"mn",2128:"mn-CN",1121:"ne",1044:"nb",2068:"nn",1154:"oc",1096:"or",1123:"ps",1045:"pl",1046:"pt",2070:"pt-PT",1094:"pa",1131:"qu-BO",2155:"qu-EC",3179:"qu",1048:"ro",1047:"rm",1049:"ru",9275:"smn",4155:"smj-NO",5179:"smj",3131:"se-FI",1083:"se",2107:"se-SE",8251:"sms",6203:"sma-NO",7227:"sms",1103:"sa",7194:"sr-Cyrl-BA",3098:"sr",6170:"sr-Latn-BA",2074:"sr-Latn",1132:"nso",1074:"tn",1115:"si",1051:"sk",1060:"sl",11274:"es-AR",16394:"es-BO",13322:"es-CL",9226:"es-CO",5130:"es-CR",7178:"es-DO",12298:"es-EC",17418:"es-SV",4106:"es-GT",18442:"es-HN",2058:"es-MX",19466:"es-NI",6154:"es-PA",15370:"es-PY",10250:"es-PE",20490:"es-PR",3082:"es",1034:"es",21514:"es-US",14346:"es-UY",8202:"es-VE",2077:"sv-FI",1053:"sv",1114:"syr",1064:"tg",2143:"tzm",1097:"ta",1092:"tt",1098:"te",1054:"th",1105:"bo",1055:"tr",1090:"tk",1152:"ug",1058:"uk",1070:"hsb",1056:"ur",2115:"uz-Cyrl",1091:"uz",1066:"vi",1106:"cy",1160:"wo",1157:"sah",1144:"ii",1130:"yo"},eo="utf-16",io={0:"macintosh",1:"x-mac-japanese",2:"x-mac-chinesetrad",3:"x-mac-korean",6:"x-mac-greek",7:"x-mac-cyrillic",9:"x-mac-devanagai",10:"x-mac-gurmukhi",11:"x-mac-gujarati",12:"x-mac-oriya",13:"x-mac-bengali",14:"x-mac-tamil",15:"x-mac-telugu",16:"x-mac-kannada",17:"x-mac-malayalam",18:"x-mac-sinhalese",19:"x-mac-burmese",20:"x-mac-khmer",21:"x-mac-thai",22:"x-mac-lao",23:"x-mac-georgian",24:"x-mac-armenian",25:"x-mac-chinesesimp",26:"x-mac-tibetan",27:"x-mac-mongolian",28:"x-mac-ethiopic",29:"x-mac-ce",30:"x-mac-vietnamese",31:"x-mac-extarabic"},no={15:"x-mac-icelandic",17:"x-mac-turkish",18:"x-mac-croatian",24:"x-mac-ce",25:"x-mac-ce",26:"x-mac-ce",27:"x-mac-ce",28:"x-mac-ce",30:"x-mac-icelandic",37:"x-mac-romanian",38:"x-mac-ce",39:"x-mac-ce",40:"x-mac-ce",143:"x-mac-inuit",146:"x-mac-gaelic"},ro={parse:te,make:se},so=[{begin:0,end:127},{begin:128,end:255},{begin:256,end:383},{begin:384,end:591},{begin:592,end:687},{begin:688,end:767},{begin:768,end:879},{begin:880,end:1023},{begin:11392,end:11519},{begin:1024,end:1279},{begin:1328,end:1423},{begin:1424,end:1535},{begin:42240,end:42559},{begin:1536,end:1791},{begin:1984,end:2047},{begin:2304,end:2431},{begin:2432,end:2559},{begin:2560,end:2687},{begin:2688,end:2815},{begin:2816,end:2943},{begin:2944,end:3071},{begin:3072,end:3199},{begin:3200,end:3327},{begin:3328,end:3455},{begin:3584,end:3711},{begin:3712,end:3839},{begin:4256,end:4351},{begin:6912,end:7039},{begin:4352,end:4607},{begin:7680,end:7935},{begin:7936,end:8191},{begin:8192,end:8303},{begin:8304,end:8351},{begin:8352,end:8399},{begin:8400,end:8447},{begin:8448,end:8527},{begin:8528,end:8591},{begin:8592,end:8703},{begin:8704,end:8959},{begin:8960,end:9215},{begin:9216,end:9279},{begin:9280,end:9311},{begin:9312,end:9471},{begin:9472,end:9599},{begin:9600,end:9631},{begin:9632,end:9727},{begin:9728,end:9983},{begin:9984,end:10175},{begin:12288,end:12351},{begin:12352,end:12447},{begin:12448,end:12543},{begin:12544,end:12591},{begin:12592,end:12687},{begin:43072,end:43135},{begin:12800,end:13055},{begin:13056,end:13311},{begin:44032,end:55215},{begin:55296,end:57343},{begin:67840,end:67871},{begin:19968,end:40959},{begin:57344,end:63743},{begin:12736,end:12783},{begin:64256,end:64335},{begin:64336,end:65023},{begin:65056,end:65071},{begin:65040,end:65055},{begin:65104,end:65135},{begin:65136,end:65279},{begin:65280,end:65519},{begin:65520,end:65535},{begin:3840,end:4095},{begin:1792,end:1871},{begin:1920,end:1983},{begin:3456,end:3583},{begin:4096,end:4255},{begin:4608,end:4991},{begin:5024,end:5119},{begin:5120,end:5759},{begin:5760,end:5791},{begin:5792,end:5887},{begin:6016,end:6143},{begin:6144,end:6319},{begin:10240,end:10495},{begin:40960,end:42127},{begin:5888,end:5919},{begin:66304,end:66351},{begin:66352,end:66383},{begin:66560,end:66639},{begin:118784,end:119039},{begin:119808,end:120831},{begin:1044480,end:1048573},{begin:65024,end:65039},{begin:917504,end:917631},{begin:6400,end:6479},{begin:6480,end:6527},{begin:6528,end:6623},{begin:6656,end:6687},{begin:11264,end:11359},{begin:11568,end:11647},{begin:19904,end:19967},{begin:43008,end:43055},{begin:65536,end:65663},{begin:65856,end:65935},{begin:66432,end:66463},{begin:66464,end:66527},{begin:66640,end:66687},{begin:66688,end:66735},{begin:67584,end:67647},{begin:68096,end:68191},{begin:119552,end:119647},{begin:73728,end:74751},{begin:119648,end:119679},{begin:7040,end:7103},{begin:7168,end:7247},{begin:7248,end:7295},{begin:43136,end:43231},{begin:43264,end:43311},{begin:43312,end:43359},{begin:43520,end:43615},{begin:65936,end:65999},{begin:66e3,end:66047},{begin:66208,end:66271},{begin:127024,end:127135}],oo={parse:ae,make:ue,unicodeRanges:so,getUnicodeRange:oe},ao={parse:le,make:ce},uo=new Array(9);uo[1]=function(){var t=this.offset+this.relativeOffset,e=this.parseUShort();return 1===e?{substFormat:1,coverage:this.parsePointer(k.coverage),deltaGlyphId:this.parseUShort()}:2===e?{substFormat:2,coverage:this.parsePointer(k.coverage),substitute:this.parseOffset16List()}:void Ss.assert(!1,"0x"+t.toString(16)+": lookup type 1 format must be 1 or 2.")},uo[2]=function(){var t=this.parseUShort();return Ss.argument(1===t,"GSUB Multiple Substitution Subtable identifier-format must be 1"),{substFormat:t,coverage:this.parsePointer(k.coverage),sequences:this.parseListOfLists()}},uo[3]=function(){var t=this.parseUShort();return Ss.argument(1===t,"GSUB Alternate Substitution Subtable identifier-format must be 1"),{substFormat:t,coverage:this.parsePointer(k.coverage),alternateSets:this.parseListOfLists()}},uo[4]=function(){var t=this.parseUShort();return Ss.argument(1===t,"GSUB ligature table identifier-format must be 1"),{substFormat:t,coverage:this.parsePointer(k.coverage),ligatureSets:this.parseListOfLists(function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}})}};var lo={sequenceIndex:k.uShort,lookupListIndex:k.uShort};uo[5]=function(){var t=this.offset+this.relativeOffset,e=this.parseUShort();if(1===e)return{substFormat:e,coverage:this.parsePointer(k.coverage),ruleSets:this.parseListOfLists(function(){var t=this.parseUShort(),e=this.parseUShort();return{input:this.parseUShortList(t-1),lookupRecords:this.parseRecordList(e,lo)}})};if(2===e)return{substFormat:e,coverage:this.parsePointer(k.coverage),classDef:this.parsePointer(k.classDef),classSets:this.parseListOfLists(function(){var t=this.parseUShort(),e=this.parseUShort();return{classes:this.parseUShortList(t-1),lookupRecords:this.parseRecordList(e,lo)}})};if(3===e){var i=this.parseUShort(),n=this.parseUShort();return{substFormat:e,coverages:this.parseList(i,k.pointer(k.coverage)),lookupRecords:this.parseRecordList(n,lo)}}Ss.assert(!1,"0x"+t.toString(16)+": lookup type 5 format must be 1, 2 or 3.")},uo[6]=function(){var t=this.offset+this.relativeOffset,e=this.parseUShort();return 1===e?{substFormat:1,coverage:this.parsePointer(k.coverage),chainRuleSets:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(lo)}})}:2===e?{substFormat:2,coverage:this.parsePointer(k.coverage),backtrackClassDef:this.parsePointer(k.classDef),inputClassDef:this.parsePointer(k.classDef),lookaheadClassDef:this.parsePointer(k.classDef),chainClassSet:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(lo)}})}:3===e?{substFormat:3,backtrackCoverage:this.parseList(k.pointer(k.coverage)),inputCoverage:this.parseList(k.pointer(k.coverage)),lookaheadCoverage:this.parseList(k.pointer(k.coverage)),lookupRecords:this.parseRecordList(lo)}:void Ss.assert(!1,"0x"+t.toString(16)+": lookup type 6 format must be 1, 2 or 3.")},uo[7]=function(){var t=this.parseUShort();Ss.argument(1===t,"GSUB Extension Substitution subtable identifier-format must be 1");var e=this.parseUShort(),i=new k(this.data,this.offset+this.parseULong());return{substFormat:1,lookupType:e,extension:uo[e].call(i)}},uo[8]=function(){var t=this.parseUShort();return Ss.argument(1===t,"GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"),{substFormat:t,coverage:this.parsePointer(k.coverage),backtrackCoverage:this.parseList(k.pointer(k.coverage)),lookaheadCoverage:this.parseList(k.pointer(k.coverage)),substitutes:this.parseUShortList()}};var co=new Array(9);co[1]=function(t){return 1===t.substFormat?new Vs.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new Vs.Coverage(t.coverage)},{name:"deltaGlyphID",type:"USHORT",value:t.deltaGlyphId}]):new Vs.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:2},{name:"coverage",type:"TABLE",value:new Vs.Coverage(t.coverage)}].concat(Vs.ushortList("substitute",t.substitute)))},co[2]=function(t){return Ss.assert(1===t.substFormat,"Lookup type 2 substFormat must be 1."),new Vs.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new Vs.Coverage(t.coverage)}].concat(Vs.tableList("seqSet",t.sequences,function(t){return new Vs.Table("sequenceSetTable",Vs.ushortList("sequence",t))})))},co[3]=function(t){return Ss.assert(1===t.substFormat,"Lookup type 3 substFormat must be 1."),new Vs.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new Vs.Coverage(t.coverage)}].concat(Vs.tableList("altSet",t.alternateSets,function(t){return new Vs.Table("alternateSetTable",Vs.ushortList("alternate",t))})))},co[4]=function(t){return Ss.assert(1===t.substFormat,"Lookup type 4 substFormat must be 1."),new Vs.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new Vs.Coverage(t.coverage)}].concat(Vs.tableList("ligSet",t.ligatureSets,function(t){return new Vs.Table("ligatureSetTable",Vs.tableList("ligature",t,function(t){return new Vs.Table("ligatureTable",[{name:"ligGlyph",type:"USHORT",value:t.ligGlyph}].concat(Vs.ushortList("component",t.components,t.components.length+1)))}))})))},co[6]=function(t){if(1===t.substFormat){return new Vs.Table("chainContextTable",[{name:"substFormat",type:"USHORT",value:t.substFormat},{name:"coverage",type:"TABLE",value:new Vs.Coverage(t.coverage)}].concat(Vs.tableList("chainRuleSet",t.chainRuleSets,function(t){return new Vs.Table("chainRuleSetTable",Vs.tableList("chainRule",t,function(t){var e=Vs.ushortList("backtrackGlyph",t.backtrack,t.backtrack.length).concat(Vs.ushortList("inputGlyph",t.input,t.input.length+1)).concat(Vs.ushortList("lookaheadGlyph",t.lookahead,t.lookahead.length)).concat(Vs.ushortList("substitution",[],t.lookupRecords.length));return t.lookupRecords.forEach(function(t,i){e=e.concat({name:"sequenceIndex"+i,type:"USHORT",value:t.sequenceIndex}).concat({name:"lookupListIndex"+i,type:"USHORT",value:t.lookupListIndex})}),new Vs.Table("chainRuleTable",e)}))})))}if(2===t.substFormat)Ss.assert(!1,"lookup type 6 format 2 is not yet supported.");else if(3===t.substFormat){var e=[{name:"substFormat",type:"USHORT",value:t.substFormat}];e.push({name:"backtrackGlyphCount",type:"USHORT",value:t.backtrackCoverage.length}),t.backtrackCoverage.forEach(function(t,i){e.push({name:"backtrackCoverage"+i,type:"TABLE",value:new Vs.Coverage(t)})}),e.push({name:"inputGlyphCount",type:"USHORT",value:t.inputCoverage.length}),t.inputCoverage.forEach(function(t,i){e.push({name:"inputCoverage"+i,type:"TABLE",value:new Vs.Coverage(t)})}),e.push({name:"lookaheadGlyphCount",type:"USHORT",value:t.lookaheadCoverage.length}),t.lookaheadCoverage.forEach(function(t,i){e.push({name:"lookaheadCoverage"+i,type:"TABLE",value:new Vs.Coverage(t)})}),e.push({name:"substitutionCount",type:"USHORT",value:t.lookupRecords.length}),t.lookupRecords.forEach(function(t,i){e=e.concat({name:"sequenceIndex"+i,type:"USHORT",value:t.sequenceIndex}).concat({name:"lookupListIndex"+i,type:"USHORT",value:t.lookupListIndex})});var i=new Vs.Table("chainContextTable",e);return i}Ss.assert(!1,"lookup type 6 format must be 1, 2 or 3.")};var ho={parse:he,make:de},po={parse:pe,make:fe},fo={make:xe,fontToTable:we,computeCheckSum:me};Te.prototype={searchTag:be,binSearch:Se,getTable:function(t){var e=this.font.tables[this.tableName];return!e&&t&&(e=this.font.tables[this.tableName]=this.createDefaultTable()),e},getScriptNames:function(){var t=this.getTable();return t?t.scripts.map(function(t){return t.tag}):[]},getDefaultScriptName:function(){var t=this.getTable();if(t){for(var e=!1,i=0;i<t.scripts.length;i++){var n=t.scripts[i].tag;if("DFLT"===n)return n;"latn"===n&&(e=!0)}return e?"latn":void 0}},getScriptTable:function(t,e){var i=this.getTable(e);if(i){t=t||"DFLT";var n=i.scripts,r=be(i.scripts,t);if(r>=0)return n[r].script;if(e){var s={tag:t,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return n.splice(-1-r,0,s),s.script}}},getLangSysTable:function(t,e,i){var n=this.getScriptTable(t,i);if(n){if(!e||"dflt"===e||"DFLT"===e)return n.defaultLangSys;var r=be(n.langSysRecords,e);if(r>=0)return n.langSysRecords[r].langSys;if(i){var s={tag:e,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return n.langSysRecords.splice(-1-r,0,s),s.langSys}}},getFeatureTable:function(t,e,i,n){var r=this.getLangSysTable(t,e,n);if(r){for(var s,o=r.featureIndexes,a=this.font.tables[this.tableName].features,u=0;u<o.length;u++)if(s=a[o[u]],s.tag===i)return s.feature;if(n){var l=a.length;return Ss.assert(0===l||i>=a[l-1].tag,"Features must be added in alphabetical order."),s={tag:i,feature:{params:0,lookupListIndexes:[]}},a.push(s),o.push(l),s.feature}}},getLookupTables:function(t,e,i,n,r){var s=this.getFeatureTable(t,e,i,r),o=[];if(s){for(var a,u=s.lookupListIndexes,l=this.font.tables[this.tableName].lookups,c=0;c<u.length;c++)a=l[u[c]],a.lookupType===n&&o.push(a);if(0===o.length&&r){a={lookupType:n,lookupFlag:0,subtables:[],markFilteringSet:void 0};var h=l.length;return l.push(a),u.push(h),[a]}}return o},getGlyphClass:function(t,e){switch(t.format){case 1:return t.startGlyph<=e&&e<t.startGlyph+t.classes.length?t.classes[e-t.startGlyph]:0;case 2:var i=Ce(t.ranges,e);return i?i.classId:0}},getCoverageIndex:function(t,e){switch(t.format){case 1:var i=Se(t.glyphs,e);return i>=0?i:-1;case 2:var n=Ce(t.ranges,e);return n?n.index+e-n.start:-1}},expandCoverage:function(t){if(1===t.format)return t.glyphs;for(var e=[],i=t.ranges,n=0;n<i.length;n++)for(var r=i[n],s=r.start,o=r.end,a=s;a<=o;a++)e.push(a);return e}},Fe.prototype=Te.prototype,Fe.prototype.init=function(){var t=this.getDefaultScriptName();this.defaultKerningTables=this.getKerningTables(t)},Fe.prototype.getKerningValue=function(t,e,i){for(var n=0;n<t.length;n++)for(var r=t[n].subtables,s=0;s<r.length;s++){var o=r[s],a=this.getCoverageIndex(o.coverage,e);if(!(a<0))switch(o.posFormat){case 1:for(var u=o.pairSets[a],l=0;l<u.length;l++){var c=u[l];if(c.secondGlyph===i)return c.value1&&c.value1.xAdvance||0}break;case 2:var h=this.getGlyphClass(o.classDef1,e),d=this.getGlyphClass(o.classDef2,i),p=o.classRecords[h][d];return p.value1&&p.value1.xAdvance||0}}return 0},Fe.prototype.getKerningTables=function(t,e){if(this.font.tables.gpos)return this.getLookupTables(t,e,"kern",2)},Oe.prototype=Te.prototype,Oe.prototype.createDefaultTable=function(){return{version:1,scripts:[{tag:"DFLT",script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}],features:[],lookups:[]}},Oe.prototype.getSingle=function(t,e,i){for(var n=[],r=this.getLookupTables(e,i,t,1),s=0;s<r.length;s++)for(var o=r[s].subtables,a=0;a<o.length;a++){var u=o[a],l=this.expandCoverage(u.coverage),c=void 0;if(1===u.substFormat){var h=u.deltaGlyphId;for(c=0;c<l.length;c++){var d=l[c];n.push({sub:d,by:d+h})}}else{var p=u.substitute;for(c=0;c<l.length;c++)n.push({sub:l[c],by:p[c]})}}return n},Oe.prototype.getMultiple=function(t,e,i){for(var n=[],r=this.getLookupTables(e,i,t,2),s=0;s<r.length;s++)for(var o=r[s].subtables,a=0;a<o.length;a++){var u=o[a],l=this.expandCoverage(u.coverage),c=void 0;for(c=0;c<l.length;c++){var h=l[c],d=u.sequences[c];n.push({sub:h,by:d})}}return n},Oe.prototype.getAlternates=function(t,e,i){for(var n=[],r=this.getLookupTables(e,i,t,3),s=0;s<r.length;s++)for(var o=r[s].subtables,a=0;a<o.length;a++)for(var u=o[a],l=this.expandCoverage(u.coverage),c=u.alternateSets,h=0;h<l.length;h++)n.push({sub:l[h],by:c[h]});return n},Oe.prototype.getLigatures=function(t,e,i){for(var n=[],r=this.getLookupTables(e,i,t,4),s=0;s<r.length;s++)for(var o=r[s].subtables,a=0;a<o.length;a++)for(var u=o[a],l=this.expandCoverage(u.coverage),c=u.ligatureSets,h=0;h<l.length;h++)for(var d=l[h],p=c[h],f=0;f<p.length;f++){var g=p[f];n.push({sub:[d].concat(g.components),by:g.ligGlyph})}return n},Oe.prototype.addSingle=function(t,e,i,n){var r=this.getLookupTables(i,n,t,1,!0)[0],s=Ee(r,2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]});Ss.assert(1===s.coverage.format,"Single: unable to modify coverage table format "+s.coverage.format);var o=e.sub,a=this.binSearch(s.coverage.glyphs,o);a<0&&(a=-1-a,s.coverage.glyphs.splice(a,0,o),s.substitute.splice(a,0,0)),s.substitute[a]=e.by},Oe.prototype.addMultiple=function(t,e,i,n){Ss.assert(e.by instanceof Array&&e.by.length>1,'Multiple: "by" must be an array of two or more ids');var r=this.getLookupTables(i,n,t,2,!0)[0],s=Ee(r,1,{substFormat:1,coverage:{format:1,glyphs:[]},sequences:[]});Ss.assert(1===s.coverage.format,"Multiple: unable to modify coverage table format "+s.coverage.format);var o=e.sub,a=this.binSearch(s.coverage.glyphs,o);a<0&&(a=-1-a,s.coverage.glyphs.splice(a,0,o),s.sequences.splice(a,0,0)),s.sequences[a]=e.by},Oe.prototype.addAlternate=function(t,e,i,n){var r=this.getLookupTables(i,n,t,3,!0)[0],s=Ee(r,1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});Ss.assert(1===s.coverage.format,"Alternate: unable to modify coverage table format "+s.coverage.format);var o=e.sub,a=this.binSearch(s.coverage.glyphs,o);a<0&&(a=-1-a,s.coverage.glyphs.splice(a,0,o),s.alternateSets.splice(a,0,0)),s.alternateSets[a]=e.by},Oe.prototype.addLigature=function(t,e,i,n){var r=this.getLookupTables(i,n,t,4,!0)[0],s=r.subtables[0];s||(s={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},r.subtables[0]=s),Ss.assert(1===s.coverage.format,"Ligature: unable to modify coverage table format "+s.coverage.format);var o=e.sub[0],a=e.sub.slice(1),u={ligGlyph:e.by,components:a},l=this.binSearch(s.coverage.glyphs,o);if(l>=0){for(var c=s.ligatureSets[l],h=0;h<c.length;h++)if(Ne(c[h].components,a))return;c.push(u)}else l=-1-l,s.coverage.glyphs.splice(l,0,o),s.ligatureSets.splice(l,0,[u])},Oe.prototype.getFeature=function(t,e,i){if(/ss\d\d/.test(t))return this.getSingle(t,e,i);switch(t){case"aalt":case"salt":return this.getSingle(t,e,i).concat(this.getAlternates(t,e,i));case"dlig":case"liga":case"rlig":return this.getLigatures(t,e,i);case"ccmp":return this.getMultiple(t,e,i).concat(this.getLigatures(t,e,i));case"stch":return this.getMultiple(t,e,i)}},Oe.prototype.add=function(t,e,i,n){if(/ss\d\d/.test(t))return this.addSingle(t,e,i,n);switch(t){case"aalt":case"salt":return"number"==typeof e.by?this.addSingle(t,e,i,n):this.addAlternate(t,e,i,n);case"dlig":case"liga":case"rlig":return this.addLigature(t,e,i,n);case"ccmp":return e.by instanceof Array?this.addMultiple(t,e,i,n):this.addLigature(t,e,i,n)}};var go,mo,_o,xo,yo={getPath:Re,parse:je},vo=function(t){var e=this.srPeriod,i=this.srPhase,n=this.srThreshold,r=1;return t<0&&(t=-t,r=-1),t+=n-i,t=Math.trunc(t/e)*e,t+=i,t<0?i*r:t*r},wo={x:1,y:0,axis:"x",distance:function(t,e,i,n){return(i?t.xo:t.x)-(n?e.xo:e.x)},interpolate:function(t,e,i,n){var r,s,o,a,u,l,c;return n&&n!==this?(r=n.distance(t,e,!0,!0),s=n.distance(t,i,!0,!0),u=n.distance(e,e,!1,!0),l=n.distance(i,i,!1,!0),o=Math.abs(r),a=Math.abs(s),0===(c=o+a)?void wo.setRelative(t,t,(u+l)/2,n,!0):void wo.setRelative(t,t,(u*a+l*o)/c,n,!0)):(r=t.xo-e.xo,s=t.xo-i.xo,u=e.x-e.xo,l=i.x-i.xo,o=Math.abs(r),a=Math.abs(s),0===(c=o+a)?void(t.x=t.xo+(u+l)/2):void(t.x=t.xo+(u*a+l*o)/c))},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(t,e,i,n,r){if(!n||n===this)return void(t.x=(r?e.xo:e.x)+i);var s=r?e.xo:e.x,o=r?e.yo:e.y,a=s+i*n.x,u=o+i*n.y;t.x=a+(t.y-u)/n.normalSlope},slope:0,touch:function(t){t.xTouched=!0},touched:function(t){return t.xTouched},untouch:function(t){t.xTouched=!1}},bo={x:0,y:1,axis:"y",distance:function(t,e,i,n){return(i?t.yo:t.y)-(n?e.yo:e.y)},interpolate:function(t,e,i,n){var r,s,o,a,u,l,c;return n&&n!==this?(r=n.distance(t,e,!0,!0),s=n.distance(t,i,!0,!0),u=n.distance(e,e,!1,!0),l=n.distance(i,i,!1,!0),o=Math.abs(r),a=Math.abs(s),0===(c=o+a)?void bo.setRelative(t,t,(u+l)/2,n,!0):void bo.setRelative(t,t,(u*a+l*o)/c,n,!0)):(r=t.yo-e.yo,s=t.yo-i.yo,u=e.y-e.yo,l=i.y-i.yo,o=Math.abs(r),a=Math.abs(s),0===(c=o+a)?void(t.y=t.yo+(u+l)/2):void(t.y=t.yo+(u*a+l*o)/c))},normalSlope:0,setRelative:function(t,e,i,n,r){if(!n||n===this)return void(t.y=(r?e.yo:e.y)+i);var s=r?e.xo:e.x,o=r?e.yo:e.y,a=s+i*n.x,u=o+i*n.y;t.y=u+n.normalSlope*(t.x-a)},slope:Number.POSITIVE_INFINITY,touch:function(t){t.yTouched=!0},touched:function(t){return t.yTouched},untouch:function(t){t.yTouched=!1}};Object.freeze(wo),Object.freeze(bo),Ze.prototype.distance=function(t,e,i,n){return this.x*wo.distance(t,e,i,n)+this.y*bo.distance(t,e,i,n)},Ze.prototype.interpolate=function(t,e,i,n){var r,s,o,a,u,l,c;if(o=n.distance(t,e,!0,!0),a=n.distance(t,i,!0,!0),r=n.distance(e,e,!1,!0),s=n.distance(i,i,!1,!0),u=Math.abs(o),l=Math.abs(a),0===(c=u+l))return void this.setRelative(t,t,(r+s)/2,n,!0);this.setRelative(t,t,(r*l+s*u)/c,n,!0)},Ze.prototype.setRelative=function(t,e,i,n,r){n=n||this;var s=r?e.xo:e.x,o=r?e.yo:e.y,a=s+i*n.x,u=o+i*n.y,l=n.normalSlope,c=this.slope,h=t.x,d=t.y;t.x=(c*h-l*a+u-d)/(c-l),t.y=c*(t.x-h)+d},Ze.prototype.touch=function(t){t.xTouched=!0,t.yTouched=!0},Ke.prototype.nextTouched=function(t){for(var e=this.nextPointOnContour;!t.touched(e)&&e!==this;)e=e.nextPointOnContour;return e},Ke.prototype.prevTouched=function(t){for(var e=this.prevPointOnContour;!t.touched(e)&&e!==this;)e=e.prevPointOnContour;return e};var So=Object.freeze(new Ke(0,0)),Co={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};ze.prototype.exec=function(e,i){if("number"!=typeof i)throw new Error("Point size is not a number!");if(!(this._errorState>2)){var n=this.font,r=this._prepState;if(!r||r.ppem!==i){var s=this._fpgmState;if(!s){Je.prototype=Co,s=this._fpgmState=new Je("fpgm",n.tables.fpgm),s.funcs=[],s.font=n,t.DEBUG&&(console.log("---EXEC FPGM---"),s.step=-1);try{mo(s)}catch(t){return console.log("Hinting error in FPGM:"+t),void(this._errorState=3)}}Je.prototype=s,r=this._prepState=new Je("prep",n.tables.prep),r.ppem=i;var o=n.tables.cvt;if(o)for(var a=r.cvt=new Array(o.length),u=i/n.unitsPerEm,l=0;l<o.length;l++)a[l]=o[l]*u;else r.cvt=[];t.DEBUG&&(console.log("---EXEC PREP---"),r.step=-1);try{mo(r)}catch(t){this._errorState<2&&console.log("Hinting error in PREP:"+t),this._errorState=2}}if(!(this._errorState>1))try{return _o(e,r)}catch(t){return this._errorState<1&&(console.log("Hinting error:"+t),console.log("Note: further hinting errors are silenced")),void(this._errorState=1)}}},_o=function(e,i){var n,r,s,o=i.ppem/i.font.unitsPerEm,a=o,u=e.components;if(Je.prototype=i,u){var l=i.font;r=[],n=[];for(var c=0;c<u.length;c++){var h=u[c],d=l.glyphs.get(h.glyphIndex);s=new Je("glyf",d.instructions),t.DEBUG&&(console.log("---EXEC COMP "+c+"---"),s.step=-1),xo(d,s,o,a);for(var p=Math.round(h.dx*o),f=Math.round(h.dy*a),g=s.gZone,m=s.contours,_=0;_<g.length;_++){var x=g[_];x.xTouched=x.yTouched=!1,x.xo=x.x=x.x+p,x.yo=x.y=x.y+f}var y=r.length;r.push.apply(r,g);for(var v=0;v<m.length;v++)n.push(m[v]+y)}e.instructions&&!s.inhibitGridFit&&(s=new Je("glyf",e.instructions),s.gZone=s.z0=s.z1=s.z2=r,s.contours=n,r.push(new Ke(0,0),new Ke(Math.round(e.advanceWidth*o),0)),t.DEBUG&&(console.log("---EXEC COMPOSITE---"),
|
|
34
|
-
s.step=-1),mo(s),r.length-=2)}else s=new Je("glyf",e.instructions),t.DEBUG&&(console.log("---EXEC GLYPH---"),s.step=-1),xo(e,s,o,a),r=s.gZone;return r},xo=function(e,i,n,r){for(var s,o=e.points||[],a=o.length,u=i.gZone=i.z0=i.z1=i.z2=[],l=i.contours=[],c=0;c<a;c++)s=o[c],u[c]=new Ke(s.x*n,s.y*r,s.lastPointOfContour,s.onCurve);for(var h,d,p=0;p<a;p++)s=u[p],h||(h=s,l.push(p)),s.lastPointOfContour?(s.nextPointOnContour=h,h.prevPointOnContour=s,h=void 0):(d=u[p+1],s.nextPointOnContour=d,d.prevPointOnContour=s);if(!i.inhibitGridFit){if(t.DEBUG){console.log("PROCESSING GLYPH",i.stack);for(var f=0;f<a;f++)console.log(f,u[f].x,u[f].y)}if(u.push(new Ke(0,0),new Ke(Math.round(e.advanceWidth*n),0)),mo(i),u.length-=2,t.DEBUG){console.log("FINISHED GLYPH",i.stack);for(var g=0;g<a;g++)console.log(g,u[g].x,u[g].y)}}},mo=function(e){var i=e.prog;if(i){var n,r=i.length;for(e.ip=0;e.ip<r;e.ip++){if(t.DEBUG&&e.step++,!(n=go[i[e.ip]]))throw new Error("unknown instruction: 0x"+Number(i[e.ip]).toString(16));n(e)}}},go=[ii.bind(void 0,bo),ii.bind(void 0,wo),ni.bind(void 0,bo),ni.bind(void 0,wo),ri.bind(void 0,bo),ri.bind(void 0,wo),si.bind(void 0,0),si.bind(void 0,1),oi.bind(void 0,0),oi.bind(void 0,1),ai,ui,li,ci,hi,di,pi,fi,gi,mi,_i,xi,yi,vi,wi,bi,Si,Ci,Ti,Fi,void 0,void 0,Oi,Ni,Ei,Mi,Di,Bi,Ai,void 0,void 0,void 0,Vi,Ii,Pi,void 0,Li.bind(void 0,0),Li.bind(void 0,1),Ri.bind(void 0,bo),Ri.bind(void 0,wo),ki.bind(void 0,0),ki.bind(void 0,1),Ui.bind(void 0,0),Ui.bind(void 0,1),Xi.bind(void 0,0),Xi.bind(void 0,1),ji,zi,Gi.bind(void 0,0),Gi.bind(void 0,1),Hi,qi,Wi.bind(void 0,0),Wi.bind(void 0,1),Yi,$i,Zi,Qi,Ki,Ji,tn.bind(void 0,0),tn.bind(void 0,1),void 0,en.bind(void 0,0),en.bind(void 0,1),nn,void 0,rn,void 0,void 0,sn,on,an,un,ln,cn,hn,dn,pn,fn,gn,mn,_n,xn.bind(void 0,1),yn,vn,wn,bn,Sn,Cn,Tn,Fn,On,Nn,En.bind(void 0,0),En.bind(void 0,1),En.bind(void 0,2),En.bind(void 0,3),void 0,void 0,void 0,void 0,Mn,xn.bind(void 0,2),xn.bind(void 0,3),Dn.bind(void 0,1),Dn.bind(void 0,2),Dn.bind(void 0,3),Vn,In,void 0,void 0,Bn,void 0,An,Pn,Ni,Ni,void 0,void 0,void 0,void 0,void 0,Ln,Rn.bind(void 0,0),Rn.bind(void 0,1),kn,void 0,Un,Xn,jn,zn,Gn,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,Hn.bind(void 0,1),Hn.bind(void 0,2),Hn.bind(void 0,3),Hn.bind(void 0,4),Hn.bind(void 0,5),Hn.bind(void 0,6),Hn.bind(void 0,7),Hn.bind(void 0,8),qn.bind(void 0,1),qn.bind(void 0,2),qn.bind(void 0,3),qn.bind(void 0,4),qn.bind(void 0,5),qn.bind(void 0,6),qn.bind(void 0,7),qn.bind(void 0,8),Wn.bind(void 0,0,0,0,0,0),Wn.bind(void 0,0,0,0,0,1),Wn.bind(void 0,0,0,0,0,2),Wn.bind(void 0,0,0,0,0,3),Wn.bind(void 0,0,0,0,1,0),Wn.bind(void 0,0,0,0,1,1),Wn.bind(void 0,0,0,0,1,2),Wn.bind(void 0,0,0,0,1,3),Wn.bind(void 0,0,0,1,0,0),Wn.bind(void 0,0,0,1,0,1),Wn.bind(void 0,0,0,1,0,2),Wn.bind(void 0,0,0,1,0,3),Wn.bind(void 0,0,0,1,1,0),Wn.bind(void 0,0,0,1,1,1),Wn.bind(void 0,0,0,1,1,2),Wn.bind(void 0,0,0,1,1,3),Wn.bind(void 0,0,1,0,0,0),Wn.bind(void 0,0,1,0,0,1),Wn.bind(void 0,0,1,0,0,2),Wn.bind(void 0,0,1,0,0,3),Wn.bind(void 0,0,1,0,1,0),Wn.bind(void 0,0,1,0,1,1),Wn.bind(void 0,0,1,0,1,2),Wn.bind(void 0,0,1,0,1,3),Wn.bind(void 0,0,1,1,0,0),Wn.bind(void 0,0,1,1,0,1),Wn.bind(void 0,0,1,1,0,2),Wn.bind(void 0,0,1,1,0,3),Wn.bind(void 0,0,1,1,1,0),Wn.bind(void 0,0,1,1,1,1),Wn.bind(void 0,0,1,1,1,2),Wn.bind(void 0,0,1,1,1,3),Wn.bind(void 0,1,0,0,0,0),Wn.bind(void 0,1,0,0,0,1),Wn.bind(void 0,1,0,0,0,2),Wn.bind(void 0,1,0,0,0,3),Wn.bind(void 0,1,0,0,1,0),Wn.bind(void 0,1,0,0,1,1),Wn.bind(void 0,1,0,0,1,2),Wn.bind(void 0,1,0,0,1,3),Wn.bind(void 0,1,0,1,0,0),Wn.bind(void 0,1,0,1,0,1),Wn.bind(void 0,1,0,1,0,2),Wn.bind(void 0,1,0,1,0,3),Wn.bind(void 0,1,0,1,1,0),Wn.bind(void 0,1,0,1,1,1),Wn.bind(void 0,1,0,1,1,2),Wn.bind(void 0,1,0,1,1,3),Wn.bind(void 0,1,1,0,0,0),Wn.bind(void 0,1,1,0,0,1),Wn.bind(void 0,1,1,0,0,2),Wn.bind(void 0,1,1,0,0,3),Wn.bind(void 0,1,1,0,1,0),Wn.bind(void 0,1,1,0,1,1),Wn.bind(void 0,1,1,0,1,2),Wn.bind(void 0,1,1,0,1,3),Wn.bind(void 0,1,1,1,0,0),Wn.bind(void 0,1,1,1,0,1),Wn.bind(void 0,1,1,1,0,2),Wn.bind(void 0,1,1,1,0,3),Wn.bind(void 0,1,1,1,1,0),Wn.bind(void 0,1,1,1,1,1),Wn.bind(void 0,1,1,1,1,2),Wn.bind(void 0,1,1,1,1,3)],Yn.prototype.setState=function(t,e){return this.state[t]=e,this.activeState={key:t,value:this.state[t]},this.activeState},Yn.prototype.getState=function(t){return this.state[t]||null},tr.prototype.inboundIndex=function(t){return t>=0&&t<this.tokens.length},tr.prototype.composeRUD=function(t){var e=this,i=t.map(function(t){return e[t[0]].apply(e,t.slice(1).concat(!0))}),n=function(t){return"object"==typeof t&&t.hasOwnProperty("FAIL")};if(i.every(n))return{FAIL:"composeRUD: one or more operations hasn't completed successfully",report:i.filter(n)};this.dispatch("composeRUD",[i.filter(function(t){return!n(t)})])},tr.prototype.replaceRange=function(t,e,i,n){e=null!==e?e:this.tokens.length;var r=i.every(function(t){return t instanceof Yn});if(!isNaN(t)&&this.inboundIndex(t)&&r){var s=this.tokens.splice.apply(this.tokens,[t,e].concat(i));return n||this.dispatch("replaceToken",[t,e,i]),[s,i]}return{FAIL:"replaceRange: invalid tokens or startIndex."}},tr.prototype.replaceToken=function(t,e,i){if(!isNaN(t)&&this.inboundIndex(t)&&e instanceof Yn){var n=this.tokens.splice(t,1,e);return i||this.dispatch("replaceToken",[t,e]),[n[0],e]}return{FAIL:"replaceToken: invalid token or index."}},tr.prototype.removeRange=function(t,e,i){e=isNaN(e)?this.tokens.length:e;var n=this.tokens.splice(t,e);return i||this.dispatch("removeRange",[n,t,e]),n},tr.prototype.removeToken=function(t,e){if(!isNaN(t)&&this.inboundIndex(t)){var i=this.tokens.splice(t,1);return e||this.dispatch("removeToken",[i,t]),i}return{FAIL:"removeToken: invalid token index."}},tr.prototype.insertToken=function(t,e,i){return t.every(function(t){return t instanceof Yn})?(this.tokens.splice.apply(this.tokens,[e,0].concat(t)),i||this.dispatch("insertToken",[t,e]),t):{FAIL:"insertToken: invalid token(s)."}},tr.prototype.registerModifier=function(t,e,i){this.events.newToken.subscribe(function(n,r){var s=[n,r],o=null===e||e.apply(this,s)===!0,a=[n,r];if(o){var u=i.apply(this,a);n.setState(t,u)}}),this.registeredModifiers.push(t)},Kn.prototype.subscribe=function(t){return"function"==typeof t?this.subscribers.push(t)-1:{FAIL:"invalid '"+this.eventId+"' event handler"}},Kn.prototype.unsubscribe=function(t){this.subscribers.splice(t,1)},Qn.prototype.setCurrentIndex=function(t){this.index=t,this.current=this.context[t],this.backtrack=this.context.slice(0,t),this.lookahead=this.context.slice(t+1)},Qn.prototype.get=function(t){switch(!0){case 0===t:return this.current;case t<0&&Math.abs(t)<=this.backtrack.length:return this.backtrack.slice(t)[0];case t>0&&t<=this.lookahead.length:return this.lookahead[t-1];default:return null}},tr.prototype.rangeToText=function(t){if(t instanceof $n)return this.getRangeTokens(t).map(function(t){return t.char}).join("")},tr.prototype.getText=function(){return this.tokens.map(function(t){return t.char}).join("")},tr.prototype.getContext=function(t){var e=this.registeredContexts[t];return e?e:null},tr.prototype.on=function(t,e){var i=this.events[t];return i?i.subscribe(e):null},tr.prototype.dispatch=function(t,e){var i=this,n=this.events[t];n instanceof Kn&&n.subscribers.forEach(function(t){t.apply(i,e||[])})},tr.prototype.registerContextChecker=function(t,e,i){if(this.getContext(t))return{FAIL:"context name '"+t+"' is already registered."};if("function"!=typeof e)return{FAIL:"missing context start check."};if("function"!=typeof i)return{FAIL:"missing context end check."};var n=new Zn(t,e,i);return this.registeredContexts[t]=n,this.contextCheckers.push(n),n},tr.prototype.getRangeTokens=function(t){var e=t.startIndex+t.endOffset;return[].concat(this.tokens.slice(t.startIndex,e))},tr.prototype.getContextRanges=function(t){var e=this.getContext(t);return e?e.ranges:{FAIL:"context checker '"+t+"' is not registered."}},tr.prototype.resetContextsRanges=function(){var t=this.registeredContexts;for(var e in t)if(t.hasOwnProperty(e)){var i=t[e];i.ranges=[]}},tr.prototype.updateContextsRanges=function(){this.resetContextsRanges();for(var t=this.tokens.map(function(t){return t.char}),e=0;e<t.length;e++){var i=new Qn(t,e);this.runContextCheck(i)}this.dispatch("updateContextsRanges",[this.registeredContexts])},tr.prototype.setEndOffset=function(t,e){var i=this.getContext(e).openRange.startIndex,n=new $n(i,t,e),r=this.getContext(e).ranges;return n.rangeId=e+"."+r.length,r.push(n),this.getContext(e).openRange=null,n},tr.prototype.runContextCheck=function(t){var e=this,i=t.index;this.contextCheckers.forEach(function(n){var r=n.contextName,s=e.getContext(r).openRange;if(!s&&n.checkStart(t)&&(s=new $n(i,null,r),e.getContext(r).openRange=s,e.dispatch("contextStart",[r,i])),s&&n.checkEnd(t)){var o=i-s.startIndex+1,a=e.setEndOffset(o,r);e.dispatch("contextEnd",[r,a])}})},tr.prototype.tokenize=function(t){this.tokens=[],this.resetContextsRanges();var e=Array.from(t);this.dispatch("start");for(var i=0;i<e.length;i++){var n=e[i],r=new Qn(e,i);this.dispatch("next",[r]),this.runContextCheck(r);var s=new Yn(n);this.tokens.push(s),this.dispatch("newToken",[s,r])}return this.dispatch("end",[this.tokens]),this.tokens},or.prototype.getDefaultScriptFeaturesIndexes=function(){for(var t=this.font.tables.gsub.scripts,e=0;e<t.length;e++){var i=t[e];if("DFLT"===i.tag)return i.script.defaultLangSys.featureIndexes}return[]},or.prototype.getScriptFeaturesIndexes=function(t){if(!this.font.tables.gsub)return[];if(!t)return this.getDefaultScriptFeaturesIndexes();for(var e=this.font.tables.gsub.scripts,i=0;i<e.length;i++){var n=e[i];if(n.tag===t&&n.script.defaultLangSys)return n.script.defaultLangSys.featureIndexes;var r=n.langSysRecords;if(r)for(var s=0;s<r.length;s++){var o=r[s];if(o.tag===t){var a=o.langSys;return a.featureIndexes}}}return this.getDefaultScriptFeaturesIndexes()},or.prototype.mapTagsToFeatures=function(t,e){for(var i={},n=0;n<t.length;n++){var r=t[n].tag,s=t[n].feature;i[r]=s}this.features[e].tags=i},or.prototype.getScriptFeatures=function(t){var e=this.features[t];if(this.features.hasOwnProperty(t))return e;var i=this.getScriptFeaturesIndexes(t);if(!i)return null;var n=this.font.tables.gsub;return e=i.map(function(t){return n.features[t]}),this.features[t]=e,this.mapTagsToFeatures(e,t),e},or.prototype.getSubstitutionType=function(t,e){return t.lookupType.toString()+e.substFormat.toString()},or.prototype.getLookupMethod=function(t,e){var i=this;switch(this.getSubstitutionType(t,e)){case"11":return function(t){return lr.apply(i,[t,e])};case"12":return function(t){return cr.apply(i,[t,e])};case"63":return function(t){return dr.apply(i,[t,e])};case"41":return function(t){return pr.apply(i,[t,e])};case"21":return function(t){return fr.apply(i,[t,e])};default:throw new Error("lookupType: "+t.lookupType+" - substFormat: "+e.substFormat+" is not yet supported")}},or.prototype.lookupFeature=function(t){var e=t.contextParams,i=e.index,n=this.getFeature({tag:t.tag,script:t.script});if(!n)return new Error("font '"+this.font.names.fullName.en+"' doesn't support feature '"+t.tag+"' for script '"+t.script+"'.");for(var r=this.getFeatureLookups(n),s=[].concat(e.context),o=0;o<r.length;o++)for(var a=r[o],u=this.getLookupSubtables(a),l=0;l<u.length;l++){var c=u[l],h=this.getSubstitutionType(a,c),d=this.getLookupMethod(a,c),p=void 0;switch(h){case"11":p=d(e.current),p&&s.splice(i,1,new ar({id:11,tag:t.tag,substitution:p}));break;case"12":p=d(e.current),p&&s.splice(i,1,new ar({id:12,tag:t.tag,substitution:p}));break;case"63":p=d(e),Array.isArray(p)&&p.length&&s.splice(i,1,new ar({id:63,tag:t.tag,substitution:p}));break;case"41":p=d(e),p&&s.splice(i,1,new ar({id:41,tag:t.tag,substitution:p}));break;case"21":p=d(e.current),p&&s.splice(i,1,new ar({id:21,tag:t.tag,substitution:p}))}e=new Qn(s,i),Array.isArray(p)&&!p.length||(p=null)}return s.length?s:null},or.prototype.supports=function(t){if(!t.script)return!1;this.getScriptFeatures(t.script);var e=this.features.hasOwnProperty(t.script);if(!t.tag)return e;var i=this.features[t.script].some(function(e){return e.tag===t.tag});return e&&i},or.prototype.getLookupSubtables=function(t){return t.subtables||null},or.prototype.getLookupByIndex=function(t){return this.font.tables.gsub.lookups[t]||null},or.prototype.getFeatureLookups=function(t){return t.lookupListIndexes.map(this.getLookupByIndex.bind(this))},or.prototype.getFeature=function(t){if(!this.font)return{FAIL:"No font was found"};this.features.hasOwnProperty(t.script)||this.getScriptFeatures(t.script);var e=this.features[t.script];return e?e.tags[t.tag]?this.features[t.script].tags[t.tag]:null:{FAIL:"No feature for script "+t.script}};var To={startCheck:gr,endCheck:mr},Fo={startCheck:_r,endCheck:xr},Oo={11:yr,12:vr,63:wr,41:br},No={startCheck:Er,endCheck:Mr};Ir.prototype.setText=function(t){this.text=t},Ir.prototype.contextChecks={latinWordCheck:No,arabicWordCheck:To,arabicSentenceCheck:Fo},Ir.prototype.registerFeatures=function(t,e){var i=this,n=e.filter(function(e){return i.query.supports({script:t,tag:e})});this.featuresTags.hasOwnProperty(t)?this.featuresTags[t]=this.featuresTags[t].concat(n):this.featuresTags[t]=n},Ir.prototype.applyFeatures=function(t,e){if(!t)throw new Error("No valid font was provided to apply features");this.query||(this.query=new or(t));for(var i=0;i<e.length;i++){var n=e[i];this.query.supports({script:n.script})&&this.registerFeatures(n.script,n.tags)}},Ir.prototype.registerModifier=function(t,e,i){this.tokenizer.registerModifier(t,e,i)},Ir.prototype.checkContextReady=function(t){return!!this.tokenizer.getContext(t)},Ir.prototype.applyFeaturesToContexts=function(){this.checkContextReady("arabicWord")&&(Rr.call(this),kr.call(this)),this.checkContextReady("latinWord")&&Ur.call(this),this.checkContextReady("arabicSentence")&&Pr.call(this)},Ir.prototype.processText=function(t){this.text&&this.text===t||(this.setText(t),Ar.call(this),this.applyFeaturesToContexts())},Ir.prototype.getBidiText=function(t){return this.processText(t),this.tokenizer.getText()},Ir.prototype.getTextGlyphs=function(t){this.processText(t);for(var e=[],i=0;i<this.tokenizer.tokens.length;i++){var n=this.tokenizer.tokens[i];if(!n.state.deleted){var r=n.activeState.value;e.push(Array.isArray(r)?r[0]:r)}}return e},Xr.prototype.hasChar=function(t){return null!==this.encoding.charToGlyphIndex(t)},Xr.prototype.charToGlyphIndex=function(t){return this.encoding.charToGlyphIndex(t)},Xr.prototype.charToGlyph=function(t){var e=this.charToGlyphIndex(t),i=this.glyphs.get(e);return i||(i=this.glyphs.get(0)),i},Xr.prototype.updateFeatures=function(t){return this.defaultRenderOptions.features.map(function(e){return"latn"===e.script?{script:"latn",tags:e.tags.filter(function(e){return t[e]})}:e})},Xr.prototype.stringToGlyphs=function(t,e){var i=this,n=new Ir,r=function(t){return i.charToGlyphIndex(t.char)};n.registerModifier("glyphIndex",null,r);var s=e?this.updateFeatures(e.features):this.defaultRenderOptions.features;n.applyFeatures(this,s);for(var o=n.getTextGlyphs(t),a=o.length,u=new Array(a),l=this.glyphs.get(0),c=0;c<a;c+=1)u[c]=this.glyphs.get(o[c])||l;return u},Xr.prototype.nameToGlyphIndex=function(t){return this.glyphNames.nameToGlyphIndex(t)},Xr.prototype.nameToGlyph=function(t){var e=this.nameToGlyphIndex(t),i=this.glyphs.get(e);return i||(i=this.glyphs.get(0)),i},Xr.prototype.glyphIndexToName=function(t){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(t):""},Xr.prototype.getKerningValue=function(t,e){t=t.index||t,e=e.index||e;var i=this.position.defaultKerningTables;return i?this.position.getKerningValue(i,t,e):this.kerningPairs[t+","+e]||0},Xr.prototype.defaultRenderOptions={kerning:!0,features:[{script:"arab",tags:["init","medi","fina","rlig"]},{script:"latn",tags:["liga","rlig"]}]},Xr.prototype.forEachGlyph=function(t,e,i,n,r,s){e=void 0!==e?e:0,i=void 0!==i?i:0,n=void 0!==n?n:72,r=Object.assign({},this.defaultRenderOptions,r);var o,a=1/this.unitsPerEm*n,u=this.stringToGlyphs(t,r);if(r.kerning){var l=r.script||this.position.getDefaultScriptName();o=this.position.getKerningTables(l,r.language)}for(var c=0;c<u.length;c+=1){var h=u[c];if(s.call(this,h,e,i,n,r),h.advanceWidth&&(e+=h.advanceWidth*a),r.kerning&&c<u.length-1){e+=(o?this.position.getKerningValue(o,h.index,u[c+1].index):this.getKerningValue(h,u[c+1]))*a}r.letterSpacing?e+=r.letterSpacing*n:r.tracking&&(e+=r.tracking/1e3*n)}return e},Xr.prototype.getPath=function(t,e,i,n,r){var s=new f;return this.forEachGlyph(t,e,i,n,r,function(t,e,i,n){var o=t.getPath(e,i,n,r,this);s.extend(o)}),s},Xr.prototype.getPaths=function(t,e,i,n,r){var s=[];return this.forEachGlyph(t,e,i,n,r,function(t,e,i,n){var o=t.getPath(e,i,n,r,this);s.push(o)}),s},Xr.prototype.getAdvanceWidth=function(t,e,i){return this.forEachGlyph(t,0,0,e,i,function(){})},Xr.prototype.draw=function(t,e,i,n,r,s){this.getPath(e,i,n,r,s).draw(t)},Xr.prototype.drawPoints=function(t,e,i,n,r,s){this.forEachGlyph(e,i,n,r,s,function(e,i,n,r){e.drawPoints(t,i,n,r)})},Xr.prototype.drawMetrics=function(t,e,i,n,r,s){this.forEachGlyph(e,i,n,r,s,function(e,i,n,r){e.drawMetrics(t,i,n,r)})},Xr.prototype.getEnglishName=function(t){var e=this.names[t];if(e)return e.en},Xr.prototype.validate=function(){function t(t,e){}function e(e){var n=i.getEnglishName(e);t(n&&n.trim().length>0)}var i=this;e("fontFamily"),e("weightName"),e("manufacturer"),e("copyright"),e("version"),t(this.unitsPerEm>0)},Xr.prototype.toTables=function(){return fo.fontToTable(this)},Xr.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()},Xr.prototype.toArrayBuffer=function(){for(var t=this.toTables(),e=t.encode(),i=new ArrayBuffer(e.length),n=new Uint8Array(i),r=0;r<e.length;r++)n[r]=e[r];return i},Xr.prototype.download=function(t){var e=this.getEnglishName("fontFamily"),i=this.getEnglishName("fontSubfamily");t=t||e.replace(/\s/g,"")+"-"+i+".otf";var n=this.toArrayBuffer();if(Me())if(window.URL=window.URL||window.webkitURL,window.URL){var r=new DataView(n),s=new Blob([r],{type:"font/opentype"}),o=document.createElement("a");o.href=window.URL.createObjectURL(s),o.download=t;var a=document.createEvent("MouseEvents");a.initEvent("click",!0,!1),o.dispatchEvent(a)}else console.warn("Font file could not be downloaded. Try using a different browser.");else{var u=require("fs"),l=Ve(n);u.writeFileSync(t,l)}},Xr.prototype.fsSelectionValues={ITALIC:1,UNDERSCORE:2,NEGATIVE:4,OUTLINED:8,STRIKEOUT:16,BOLD:32,REGULAR:64,USER_TYPO_METRICS:128,WWS:256,OBLIQUE:512},Xr.prototype.usWidthClasses={ULTRA_CONDENSED:1,EXTRA_CONDENSED:2,CONDENSED:3,SEMI_CONDENSED:4,MEDIUM:5,SEMI_EXPANDED:6,EXPANDED:7,EXTRA_EXPANDED:8,ULTRA_EXPANDED:9},Xr.prototype.usWeightClasses={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900};var Eo={make:Wr,parse:Yr},Mo=function(){return{coverage:this.parsePointer(k.coverage),attachPoints:this.parseList(k.pointer(k.uShortList))}},Do=function(){var t=this.parseUShort();return Ss.argument(1===t||2===t||3===t,"Unsupported CaretValue table version."),1===t?{coordinate:this.parseShort()}:2===t?{pointindex:this.parseShort()}:3===t?{coordinate:this.parseShort()}:void 0},Vo=function(){return this.parseList(k.pointer(Do))},Io=function(){return{coverage:this.parsePointer(k.coverage),ligGlyphs:this.parseList(k.pointer(Vo))}},Bo=function(){return this.parseUShort(),this.parseList(k.pointer(k.coverage))},Ao={parse:$r},Po=new Array(10);Po[1]=function(){var t=this.offset+this.relativeOffset,e=this.parseUShort();return 1===e?{posFormat:1,coverage:this.parsePointer(k.coverage),value:this.parseValueRecord()}:2===e?{posFormat:2,coverage:this.parsePointer(k.coverage),values:this.parseValueRecordList()}:void Ss.assert(!1,"0x"+t.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")},Po[2]=function(){var t=this.offset+this.relativeOffset,e=this.parseUShort();Ss.assert(1===e||2===e,"0x"+t.toString(16)+": GPOS lookup type 2 format must be 1 or 2.");var i=this.parsePointer(k.coverage),n=this.parseUShort(),r=this.parseUShort();if(1===e)return{posFormat:e,coverage:i,valueFormat1:n,valueFormat2:r,pairSets:this.parseList(k.pointer(k.list(function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(n),value2:this.parseValueRecord(r)}})))};if(2===e){var s=this.parsePointer(k.classDef),o=this.parsePointer(k.classDef),a=this.parseUShort(),u=this.parseUShort();return{posFormat:e,coverage:i,valueFormat1:n,valueFormat2:r,classDef1:s,classDef2:o,class1Count:a,class2Count:u,classRecords:this.parseList(a,k.list(u,function(){return{value1:this.parseValueRecord(n),value2:this.parseValueRecord(r)}}))}}},Po[3]=function(){return{error:"GPOS Lookup 3 not supported"}},Po[4]=function(){return{error:"GPOS Lookup 4 not supported"}},Po[5]=function(){return{error:"GPOS Lookup 5 not supported"}},Po[6]=function(){return{error:"GPOS Lookup 6 not supported"}},Po[7]=function(){return{error:"GPOS Lookup 7 not supported"}},Po[8]=function(){return{error:"GPOS Lookup 8 not supported"}},Po[9]=function(){return{error:"GPOS Lookup 9 not supported"}};var Lo=new Array(10),Ro={parse:Zr,make:Qr},ko={parse:ts},Uo={parse:es},Xo=Object.freeze({__proto__:null,Font:Xr,Glyph:et,Path:f,BoundingBox:p,_parse:As,parse:as,load:us,loadSync:ls});t.BoundingBox=p,t.Font=Xr,t.Glyph=et,t.Path=f,t._parse=As,t.default=Xo,t.load=us,t.loadSync=ls,t.parse=as,Object.defineProperty(t,"__esModule",{value:!0})}),define("opentype",["opentype/dist/opentype"],function(t){return t}),define("x_ite/Browser/Text/X3DTextContext",["jquery","x_ite/Components/Text/FontStyle","opentype"],function(t,e,i){"use strict";function n(){this.fontCache=new Map,this.glyphCache=new Map}return n.prototype={initialize:function(){},getDefaultFontStyle:function(){return this.defaultFontStyle=new e(this.getPrivateScene()),this.defaultFontStyle.setup(),this.getDefaultFontStyle=function(){return this.defaultFontStyle},this.defaultFontStyle},getFont:function(e){e=e.toString();var n=this.fontCache.get(e);return void 0===n&&(this.fontCache.set(e,n=t.Deferred()),i.load(e,this.setFont.bind(this,n))),n},setFont:function(t,e,i){e?t.reject(e):t.resolve(i)},getGlyph:function(t,e,i){var n=this.glyphCache.get(t);n||this.glyphCache.set(t,n=[]);var r=n[e];r||(r=n[e]=[]);var s=r[i];return s||(s=r[i]={}),s}},n}),define("x_ite/Components/Texturing/X3DTextureTransformNode",["x_ite/Components/Shape/X3DAppearanceChildNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Matrix4"],function(t,e,i){"use strict";function n(n){t.call(this,n),this.addType(e.X3DTextureTransformNode),this.matrixArray=new Float32Array(i.Identity)}return n.prototype=Object.assign(Object.create(t.prototype),{constructor:n,setMatrix:function(t){this.matrixArray.set(t)},setShaderUniformsToChannel:function(t,e,i){t.uniformMatrix4fv(e.x3d_TextureMatrix[i],!1,this.matrixArray)}}),n}),define("x_ite/Components/Texturing/X3DSingleTextureTransformNode",["x_ite/Components/Texturing/X3DTextureTransformNode","x_ite/Bits/X3DConstants"],function(t,e){"use strict";function i(i){t.call(this,i),this.addType(e.X3DSingleTextureTransformNode)}return i.prototype=Object.assign(Object.create(t.prototype),{constructor:i,setShaderUniforms:function(t,e){for(let i=0,n=e.x3d_MaxTextures;i<n;++i)this.setShaderUniformsToChannel(t,e,i)}}),i}),define("x_ite/Components/Texturing/TextureTransform",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Texturing/X3DSingleTextureTransformNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector2","standard/Math/Numbers/Matrix3","standard/Math/Numbers/Matrix4"],function(t,e,i,n,r,s,o,a){"use strict";function u(t){n.call(this,t),this.addType(r.TextureTransform),this.rotation_.setUnit("angle"),this.matrix=new a}return u.prototype=Object.assign(Object.create(n.prototype),{constructor:u,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"mapping",new t.SFString),new e(r.inputOutput,"translation",new t.SFVec2f),new e(r.inputOutput,"rotation",new t.SFFloat),new e(r.inputOutput,"scale",new t.SFVec2f(1,1)),new e(r.inputOutput,"center",new t.SFVec2f)]),getTypeName:function(){return"TextureTransform"},getComponentName:function(){return"Texturing"},getContainerField:function(){return"textureTransform"},initialize:function(){n.prototype.initialize.call(this),this.addInterest("eventsProcessed",this),this.eventsProcessed()},getMatrix:function(){return this.matrix},eventsProcessed:function(){const t=new s(0,0),e=new o;return function(){const i=this.translation_.getValue(),n=this.rotation_.getValue(),r=this.scale_.getValue(),o=this.center_.getValue(),a=this.matrix;e.identity(),o.equals(s.Zero)||e.translate(t.assign(o).negate()),r.equals(s.One)||e.scale(r),0!==n&&e.rotate(n),o.equals(s.Zero)||e.translate(o),i.equals(s.Zero)||e.translate(i),a[0]=e[0],a[1]=e[1],a[4]=e[3],a[5]=e[4],a[12]=e[6],a[13]=e[7],this.setMatrix(a)}}()}),u}),define("x_ite/Browser/Texturing/X3DTexturingContext",["x_ite/Components/Texturing/TextureProperties","x_ite/Components/Texturing/TextureTransform","x_ite/Components/Texturing/TextureCoordinate"],function(t,e,i){"use strict";function n(){var t=this.getContext(),e=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS);this.maxTextures=e>8?2:1,this.multiTexturing=e>8,this.projectiveTextureMapping=e>8,this.combinedTextureUnits=[]}return n.prototype={initialize:function(){var t=this.getContext();this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),this.maxCombinedTextureUnits=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS),this.textureMemory=NaN;for(var e=this.combinedTextureUnits,i=1,n=this.maxCombinedTextureUnits;i<n;++i)e.push(i);this.shadowTextureUnit=this.getCombinedTextureUnits().pop(),this.linetypeUnit=this.getCombinedTextureUnits().pop(),this.hatchStyleUnit=this.getCombinedTextureUnits().pop(),this.texture2DUnits=new Int32Array(this.getMaxTextures()),this.projectiveTextureUnits=new Int32Array(this.getMaxTextures());for(var i=0,n=this.getMaxTextures();i<n;++i)this.texture2DUnits[i]=this.getCombinedTextureUnits().pop();if(this.getProjectiveTextureMapping())for(var i=0,n=this.getMaxTextures();i<n;++i)this.projectiveTextureUnits[i]=this.getCombinedTextureUnits().pop();var r=new Uint8Array([255,255,255,255]);this.defaultTexture2D=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.defaultTexture2D),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,r),t.activeTexture(t.TEXTURE0+this.shadowTextureUnit),t.bindTexture(t.TEXTURE_2D,this.defaultTexture2D),t.activeTexture(t.TEXTURE0+this.linetypeUnit),t.bindTexture(t.TEXTURE_2D,this.defaultTexture2D),t.activeTexture(t.TEXTURE0+this.hatchStyleUnit),t.bindTexture(t.TEXTURE_2D,this.defaultTexture2D);for(var i=0,n=this.texture2DUnits.length;i<n;++i)t.activeTexture(t.TEXTURE0+this.texture2DUnits[i]),t.bindTexture(t.TEXTURE_2D,this.defaultTexture2D);for(var i=0,n=this.projectiveTextureUnits.length;i<n;++i)t.activeTexture(t.TEXTURE0+this.projectiveTextureUnits[i]),t.bindTexture(t.TEXTURE_2D,this.defaultTexture2D);if(t.getVersion()>=2){this.texture3DUnits=new Int32Array(this.getMaxTextures());for(var i=0,n=this.getMaxTextures();i<n;++i)this.texture3DUnits[i]=this.getCombinedTextureUnits().pop();this.defaultTexture3D=t.createTexture(),t.bindTexture(t.TEXTURE_3D,this.defaultTexture3D),t.texImage3D(t.TEXTURE_3D,0,t.RGBA,1,1,1,0,t.RGBA,t.UNSIGNED_BYTE,r);for(var i=0,n=this.texture3DUnits.length;i<n;++i)t.activeTexture(t.TEXTURE0+this.texture3DUnits[i]),t.bindTexture(t.TEXTURE_3D,this.defaultTexture3D);t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_3D,this.defaultTexture3D)}this.cubeMapTextureUnits=new Int32Array(this.getMaxTextures());for(var i=0,n=this.getMaxTextures();i<n;++i)this.cubeMapTextureUnits[i]=this.getCombinedTextureUnits().pop();this.defaultCubeMapTexture=t.createTexture(),t.bindTexture(t.TEXTURE_CUBE_MAP,this.defaultCubeMapTexture),t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_Z,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,r),t.texImage2D(t.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,r),t.texImage2D(t.TEXTURE_CUBE_MAP_NEGATIVE_X,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,r),t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,r),t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_Y,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,r),t.texImage2D(t.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,r);for(var i=0,n=this.cubeMapTextureUnits.length;i<n;++i)t.activeTexture(t.TEXTURE0+this.cubeMapTextureUnits[i]),t.bindTexture(t.TEXTURE_CUBE_MAP,this.defaultCubeMapTexture);t.activeTexture(t.TEXTURE0)},getMaxTextures:function(){return this.maxTextures},getMinTextureSize:function(){return 16},getMaxTextureSize:function(){return this.maxTextureSize},getMaxCombinedTextureUnits:function(){return this.maxCombinedTextureUnits},getCombinedTextureUnits:function(){return this.combinedTextureUnits},getTexture2DUnits:function(){return this.texture2DUnits},getTexture3DUnits:function(){return this.texture3DUnits},getCubeMapTextureUnits:function(){return this.cubeMapTextureUnits},getProjectiveTextureUnits:function(){return this.projectiveTextureUnits},getShadowTextureUnit:function(){return this.shadowTextureUnit},getLinetypeUnit:function(){return this.linetypeUnit},getHatchStyleUnit:function(){return this.hatchStyleUnit},getTextureMemory:function(){return this.textureMemory},getMultiTexturing:function(){return this.multiTexturing},getProjectiveTextureMapping:function(){return this.projectiveTextureMapping},getDefaultTextureProperties:function(){return this.defaultTextureProperties=new t(this.getPrivateScene()),this.defaultTextureProperties.magnificationFilter_="NICEST",this.defaultTextureProperties.minificationFilter_="AVG_PIXEL_AVG_MIPMAP",this.defaultTextureProperties.textureCompression_="NICEST",this.defaultTextureProperties.generateMipMaps_=!0,this.defaultTextureProperties.setup(),this.getDefaultTextureProperties=function(){return this.defaultTextureProperties},this.defaultTextureProperties},getDefaultTextureTransform:function(){return this.defaultTextureTransform=new e(this.getPrivateScene()),this.defaultTextureTransform.setup(),this.getDefaultTextureTransform=function(){return this.defaultTextureTransform},this.defaultTextureTransform},getDefaultTextureCoordinate:function(){return this.defaultTextureCoordinate=new i(this.getPrivateScene()),this.defaultTextureCoordinate.setup(),this.getDefaultTextureCoordinate=function(){return this.defaultTextureCoordinate},this.defaultTextureCoordinate}},n}),define("x_ite/Browser/Time/X3DTimeContext",["standard/Math/Numbers/Vector3"],function(t){"use strict";function e(){this.currentPosition=new t(0,0,0)}return e.prototype={initialize:function(){this.advanceTime(performance.now())},getCurrentTime:function(){return this.currentTime},advanceTime:function(){const e=new t(0,0,0);return function(t){t=(t+performance.timeOrigin)/1e3;const i=t-this.currentTime;if(this.currentTime=t,this.currentFrameRate=i?1/i:60,this.getWorld()&&this.getActiveLayer()){const t=this.getActiveLayer().getViewpoint().getCameraSpaceMatrix();e.assign(this.currentPosition),this.currentPosition.set(t[12],t[13],t[14]),this.currentSpeed=e.subtract(this.currentPosition).abs()*this.currentFrameRate}else this.currentSpeed=0}}()},e}),
|
|
26
|
+
n.bufferData(n.ARRAY_BUFFER,s?this.flatNormals.getValue():this.normals.getValue(),n.STATIC_DRAW)}}}}(),requestRebuild:function(){this.rebuild_.addEvent()},rebuild:function(){const t=new s(0,0,0);return function(){this.clear(),this.build();for(const t of this.attribs)t.shrinkToFit();for(const t of this.multiTexCoords)t.shrinkToFit();this.fogDepths.shrinkToFit(),this.colors.shrinkToFit(),this.normals.shrinkToFit(),this.vertices.shrinkToFit();const e=this.min,i=this.max,n=this.vertices.getValue();if(n.length){if(e.x===Number.POSITIVE_INFINITY)for(let r=0,s=n.length;r<s;r+=4)t.set(n[r],n[r+1],n[r+2]),e.min(t),i.max(t);this.bbox.setExtents(e,i)}else this.bbox.setExtents(e.set(0,0,0),i.set(0,0,0));if(this.bbox_changed_.addEvent(),this.geometryType>1){for(let t=0;t<5;++t)this.planes[t].set(t%2?e:i,d[t]);0===this.multiTexCoords.length&&this.multiTexCoords.push(this.buildTexCoords());const t=this.multiTexCoords.length-1;for(var r=this.multiTexCoords.length,s=this.getBrowser().getMaxTextures();r<s;++r)this.multiTexCoords[r]=this.multiTexCoords[t];this.multiTexCoords.length=s}this.set_shading__(this.getBrowser().getBrowserOptions().Shading_),this.transfer()}}(),clear:function(){this.min.set(Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),this.max.set(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY);const t=this.attribs;for(var e=0,i=t.length;e<i;++e)t[e].length=0;for(var e=t.length,i=this.attribNodes.length;e<i;++e)t[e]=h.createArray();t.length=i,this.flatShading=void 0,this.fogDepths.length=0,this.colors.length=0,this.multiTexCoords.length=0,this.texCoords.length=0,this.normals.length=0,this.flatNormals.length=0,this.vertices.length=0},transfer:function(){const t=this.getBrowser().getContext(),e=this.vertices.length/4;for(let e=this.attribBuffers.length,i=this.attribs.length;e<i;++e)this.attribBuffers.push(t.createBuffer());for(let e=0,i=this.attribs.length;e<i;++e)t.bindBuffer(t.ARRAY_BUFFER,this.attribBuffers[e]),t.bufferData(t.ARRAY_BUFFER,this.attribs[e].getValue(),t.STATIC_DRAW);t.bindBuffer(t.ARRAY_BUFFER,this.fogDepthBuffer),t.bufferData(t.ARRAY_BUFFER,this.fogDepths.getValue(),t.STATIC_DRAW),this.fogCoords=!!this.fogDepths.length,t.bindBuffer(t.ARRAY_BUFFER,this.colorBuffer),t.bufferData(t.ARRAY_BUFFER,this.colors.getValue(),t.STATIC_DRAW),this.colorMaterial=!!this.colors.length;for(let e=this.texCoordBuffers.length,i=this.multiTexCoords.length;e<i;++e)this.texCoordBuffers.push(t.createBuffer());for(let e=0,i=this.multiTexCoords.length;e<i;++e)t.bindBuffer(t.ARRAY_BUFFER,this.texCoordBuffers[e]),t.bufferData(t.ARRAY_BUFFER,this.multiTexCoords[e].getValue(),t.STATIC_DRAW);t.bindBuffer(t.ARRAY_BUFFER,this.vertexBuffer),t.bufferData(t.ARRAY_BUFFER,this.vertices.getValue(),t.STATIC_DRAW),this.vertexCount=e,this.vertexCount?(delete this.depth,delete this.display,delete this.displayParticles):(this.depth=Function.prototype,this.display=Function.prototype,this.displayParticles=Function.prototype)},traverse:function(t,e){},depth:function(t,e,i){i.enableVertexAttribute(t,this.vertexBuffer),t.drawArrays(this.primitiveMode,0,this.vertexCount)},display:function(t,e){try{const i=e.shapeNode.getAppearance(),n=i.materialNode,r=i.backMaterialNode,s=i.shaderNode||n.getShader(e.browser,e.shadow);if(this.solid||!r||s.wireframe)this.displayGeometry(t,e,i,s,!0,!0);else{const n=i.shaderNode||r.getShader(e.browser,e.shadow);this.displayGeometry(t,e,i,n,!0,!1),this.displayGeometry(t,e,i,s,!1,!0)}}catch(t){console.log(t)}},displayGeometry:function(t,e,i,n,r,s){if(n.getValid()){const a=i.blendModeNode,u=this.attribNodes,l=this.attribBuffers;a&&a.enable(t),n.enable(t),n.setLocalUniforms(t,e,s);for(let e=0,i=u.length;e<i;++e)u[e].enable(t,n,l[e]);if(this.fogCoords&&n.enableFogDepthAttribute(t,this.fogDepthBuffer),this.colorMaterial&&n.enableColorAttribute(t,this.colorBuffer),n.enableTexCoordAttribute(t,this.texCoordBuffers),n.enableNormalAttribute(t,this.normalBuffer),n.enableVertexAttribute(t,this.vertexBuffer),n.wireframe)if(n.primitiveMode===t.POINTS)t.drawArrays(n.primitiveMode,0,this.vertexCount);else for(let e=0,i=this.vertexCount;e<i;e+=3)t.drawArrays(n.primitiveMode,e,3);else{const i=o.prototype.determinant3.call(e.modelViewMatrix)>0;t.frontFace(i?this.frontFace:this.frontFace===t.CCW?t.CW:t.CCW),e.transparent||r!==s?(t.enable(t.CULL_FACE),r&&!this.solid&&(t.cullFace(t.FRONT),t.drawArrays(n.primitiveMode,0,this.vertexCount)),s&&(t.cullFace(t.BACK),t.drawArrays(n.primitiveMode,0,this.vertexCount))):(this.solid?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE),t.drawArrays(n.primitiveMode,0,this.vertexCount))}for(const e of u)e.disable(t,n);this.fogCoords&&n.disableFogDepthAttribute(t),this.colorMaterial&&n.disableColorAttribute(t),n.disableTexCoordAttribute(t),n.disableNormalAttribute(t),n.disable(t),a&&a.disable(t)}},displayParticlesDepth:function(t,e,i,n,r){i.enableVertexAttribute(t,this.vertexBuffer);const s=e.modelViewMatrix,a=s[12],u=s[13],l=s[14];for(let e=0;e<r;++e){const r=n[e];s[12]=a,s[13]=u,s[14]=l,o.prototype.translate.call(s,r.position),i.setParticle(t,r,s),t.drawArrays(i.primitiveMode,0,this.vertexCount)}},displayParticles:function(t,e,i,n){try{const r=e.shapeNode.getAppearance(),s=r.materialNode,o=r.backMaterialNode,a=r.shaderNode||s.getShader(e.browser,e.shadow);if(this.solid||!o||a.wireframe)this.displayParticlesGeometry(t,e,r,a,!0,!0,i,n);else{const s=r.shaderNode||o.getShader(e.browser,e.shadow);this.displayParticlesGeometry(t,e,r,s,!0,!1,i,n),this.displayParticlesGeometry(t,e,r,a,!1,!0,i,n)}}catch(t){console.log(t)}},displayParticlesGeometry:function(t,e,i,n,r,s,a,u){if(n.getValid()){const l=i.blendModeNode,c=this.attribNodes,h=this.attribBuffers;l&&l.enable(t),n.enable(t),n.setLocalUniforms(t,e,s);for(let e=0,i=c.length;e<i;++e)c[e].enable(t,n,h[e]);this.fogCoords&&n.enableFogDepthAttribute(t,this.fogDepthBuffer),this.colorMaterial&&n.enableColorAttribute(t,this.colorBuffer),n.enableTexCoordAttribute(t,this.texCoordBuffers),n.enableNormalAttribute(t,this.normalBuffer),n.enableVertexAttribute(t,this.vertexBuffer);const d=e.modelViewMatrix,p=d[12],f=d[13],g=d[14];if(n.wireframe)for(let e=0;e<u;++e){const i=a[e];if(d[12]=p,d[13]=f,d[14]=g,o.prototype.translate.call(d,i.position),n.setParticle(t,i,d),n.primitiveMode===t.POINTS)t.drawArrays(n.primitiveMode,0,this.vertexCount);else for(let e=0,i=this.vertexCount;e<i;e+=3)t.drawArrays(n.primitiveMode,e,3)}else{const i=o.prototype.determinant3.call(e.modelViewMatrix)>0;if(t.frontFace(i?this.frontFace:this.frontFace===t.CCW?t.CW:t.CCW),e.transparent||r!==s)for(let e=0;e<u;++e){const i=a[e];d[12]=p,d[13]=f,d[14]=g,o.prototype.translate.call(d,i.position),n.setParticle(t,i,d),t.enable(t.CULL_FACE),r&&!this.solid&&(t.cullFace(t.FRONT),t.drawArrays(n.primitiveMode,0,this.vertexCount)),s&&(t.cullFace(t.BACK),t.drawArrays(n.primitiveMode,0,this.vertexCount))}else{this.solid?t.enable(t.CULL_FACE):t.disable(t.CULL_FACE);for(let e=0;e<u;++e){const i=a[e];d[12]=p,d[13]=f,d[14]=g,o.prototype.translate.call(d,i.position),n.setParticle(t,i,d),t.drawArrays(n.primitiveMode,0,this.vertexCount)}}}for(const e of c)e.disable(t,n);this.fogCoords&&n.disableFogDepthAttribute(t),this.colorMaterial&&n.disableColorAttribute(t),n.disableTexCoordAttribute(t),n.disableNormalAttribute(t),n.disable(t),l&&l.disable(t)}}}),h}),define("x_ite/Components/Rendering/X3DLineGeometryNode",["x_ite/Components/Rendering/X3DGeometryNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Matrix4"],function(t,e,i){"use strict";function n(e){t.call(this,e)}return n.prototype=Object.assign(Object.create(t.prototype),{constructor:n,getShader:function(t){return t.getLineShader()},intersectsLine:function(t,e,i,n){return!1},intersectsBox:function(t,e,i){return!1},transfer:function(){if(1===this.getGeometryType()){const t=this.getTexCoords(),e=this.getVertices();this.getMultiTexCoords().push(t);for(let i=0,n=e.length;i<n;i+=8)t.push(e[i],e[i+1],e[i+2],e[i+3],e[i],e[i+1],e[i+2],e[i+3]);t.shrinkToFit()}t.prototype.transfer.call(this)},display:function(t,e){try{const i=e.browser,n=e.shapeNode.getAppearance(),r=n.shaderNode||this.getShader(i);if(r.getValid()){const i=n.blendModeNode,s=this.attribNodes,o=this.attribBuffers;i&&i.enable(t),r.enable(t),r.setLocalUniforms(t,e);for(let e=0,i=s.length;e<i;++e)s[e].enable(t,r,o[e]);this.fogCoords&&r.enableFogDepthAttribute(t,this.fogDepthBuffer),this.colorMaterial&&r.enableColorAttribute(t,this.colorBuffer),this.getMultiTexCoords().length&&r.enableTexCoordAttribute(t,this.texCoordBuffers,!0),r.enableVertexAttribute(t,this.vertexBuffer),t.drawArrays(r.primitiveMode===t.POINTS?t.POINTS:this.primitiveMode,0,this.vertexCount);for(const e of s)e.disable(t,r);this.fogCoords&&r.disableFogDepthAttribute(t),this.colorMaterial&&r.disableColorAttribute(t),this.getMultiTexCoords().length&&r.disableTexCoordAttribute(t),r.disable(t),i&&i.disable(t)}}catch(t){console.log(t)}},displayParticles:function(t,e,n,r){try{const s=e.browser,o=e.shapeNode.getAppearance(),a=o.shaderNode||this.getShader(s);if(a.getValid()){const s=o.blendModeNode,u=this.attribNodes,l=this.attribBuffers;s&&s.enable(t),a.enable(t),a.setLocalUniforms(t,e);for(let e=0,i=u.length;e<i;++e)u[e].enable(t,a,l[e]);this.fogCoords&&a.enableFogDepthAttribute(t,this.fogDepthBuffer),this.colorMaterial&&a.enableColorAttribute(t,this.colorBuffer),this.getMultiTexCoords().length&&a.enableTexCoordAttribute(t,this.texCoordBuffers),a.enableVertexAttribute(t,this.vertexBuffer);const c=e.modelViewMatrix,h=c[12],d=c[13],p=c[14],f=a.primitiveMode===t.POINTS?t.POINTS:this.primitiveMode;for(let e=0;e<r;++e){const r=n[e];c[12]=h,c[13]=d,c[14]=p,i.prototype.translate.call(c,r.position),a.setParticle(t,r,c),t.drawArrays(f,0,this.vertexCount)}for(const e of u)e.disable(t,a);this.fogCoords&&a.disableFogDepthAttribute(t),this.colorMaterial&&a.disableColorAttribute(t),a.disableTexCoordAttribute(t),a.disable(t),s&&s.disable(t)}}catch(t){console.log(t)}}}),n}),define("x_ite/Components/Rendering/IndexedLineSet",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Rendering/X3DLineGeometryNode","x_ite/Bits/X3DCast","x_ite/Bits/X3DConstants"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(s.IndexedLineSet),this.setGeometryType(1),this.fogCoordNode=null,this.colorNode=null,this.coordNode=null}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOnly,"set_colorIndex",new t.MFInt32),new e(s.inputOnly,"set_coordIndex",new t.MFInt32),new e(s.initializeOnly,"colorPerVertex",new t.SFBool(!0)),new e(s.initializeOnly,"colorIndex",new t.MFInt32),new e(s.initializeOnly,"coordIndex",new t.MFInt32),new e(s.inputOutput,"attrib",new t.MFNode),new e(s.inputOutput,"fogCoord",new t.SFNode),new e(s.inputOutput,"color",new t.SFNode),new e(s.inputOutput,"coord",new t.SFNode)]),getTypeName:function(){return"IndexedLineSet"},getComponentName:function(){return"Rendering"},getContainerField:function(){return"geometry"},initialize:function(){n.prototype.initialize.call(this),this.set_colorIndex_.addFieldInterest(this.colorIndex_),this.set_coordIndex_.addFieldInterest(this.coordIndex_),this.attrib_.addInterest("set_attrib__",this),this.fogCoord_.addInterest("set_fogCoord__",this),this.color_.addInterest("set_color__",this),this.coord_.addInterest("set_coord__",this),this.setPrimitiveMode(this.getBrowser().getContext().LINES),this.setSolid(!1),this.set_attrib__(),this.set_fogCoord__(),this.set_color__(),this.set_coord__()},set_attrib__:function(){const t=this.getAttrib();for(var e=0,i=t.length;e<i;++e)t[e].removeInterest("requestRebuild",this);t.length=0;for(var e=0,i=this.attrib_.length;e<i;++e){const i=r(s.X3DVertexAttributeNode,this.attrib_[e]);i&&t.push(i)}for(var e=0;e<this.attribNodes.length;++e)t[e].addInterest("requestRebuild",this)},set_fogCoord__:function(){this.fogCoordNode&&this.fogCoordNode.removeInterest("requestRebuild",this),this.fogCoordNode=r(s.FogCoordinate,this.fogCoord_),this.fogCoordNode&&this.fogCoordNode.addInterest("requestRebuild",this)},set_color__:function(){this.colorNode&&(this.colorNode.removeInterest("requestRebuild",this),this.colorNode.transparent_.removeInterest("set_transparent__",this)),this.colorNode=r(s.X3DColorNode,this.color_),this.colorNode?(this.colorNode.addInterest("requestRebuild",this),this.colorNode.transparent_.addInterest("set_transparent__",this),this.set_transparent__()):this.setTransparent(!1)},set_transparent__:function(){this.setTransparent(this.colorNode.getTransparent())},set_coord__:function(){this.coordNode&&this.coordNode.removeInterest("requestRebuild",this),this.coordNode=r(s.X3DCoordinateNode,this.coord_),this.coordNode&&this.coordNode.addInterest("requestRebuild",this)},getColorPerVertexIndex:function(t){return t<this.colorIndex_.length?this.colorIndex_[t]:this.coordIndex_[t]},getColorIndex:function(t){return t<this.colorIndex_.length?this.colorIndex_[t]:t},getPolylineIndices:function(){const t=this.coordIndex_,e=[];var i=[];if(t.length){for(var n=0,r=t.length;n<r;++n){const r=t[n];r>=0?i.push(n):(e.push(i),i=[])}t[t.length-1]>=0&&e.push(i)}return e},build:function(){if(this.coordNode&&!this.coordNode.isEmpty()){const u=this.coordIndex_,l=this.getPolylineIndices(),c=this.colorPerVertex_.getValue(),h=this.getAttrib(),d=h.length,p=this.getAttribs(),f=this.fogCoordNode,g=this.colorNode,m=this.coordNode,_=this.getFogDepths(),x=this.getColors(),y=this.getVertices();for(var t=0,e=0,i=l.length;e<i;++e){const i=l[e];if(i.length>1)for(var n=0,r=i.length-1;n<r;++n)for(var s=n,o=n+2;s<o;++s){const e=i[s],n=u[e];for(var a=0;a<d;++a)h[a].addValue(n,p[a]);f&&f.addDepth(n,_),g&&(c?g.addColor(this.getColorPerVertexIndex(e),x):g.addColor(this.getColorIndex(t),x)),m.addPoint(n,y)}++t}}}}),o}),define("x_ite/Components/Rendering/X3DGeometricPropertyNode",["x_ite/Components/Core/X3DNode","x_ite/Bits/X3DConstants"],function(t,e){"use strict";function i(i){t.call(this,i),this.addType(e.X3DGeometricPropertyNode)}return i.prototype=Object.assign(Object.create(t.prototype),{constructor:i}),i}),define("x_ite/Components/Rendering/X3DColorNode",["x_ite/Fields","x_ite/Components/Rendering/X3DGeometricPropertyNode","x_ite/Bits/X3DConstants"],function(t,e,i){"use strict";function n(n){e.call(this,n),this.addType(i.X3DColorNode),this.addChildObjects("transparent",new t.SFBool),this.transparent_.setAccessType(i.outputOnly)}return n.prototype=Object.assign(Object.create(e.prototype),{constructor:n,setTransparent:function(t){t!==this.transparent_.getValue()&&(this.transparent_=t)},getTransparent:function(){return this.transparent_.getValue()}}),n}),define("x_ite/Components/Rendering/Color",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Rendering/X3DColorNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector4"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.Color)}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"color",new t.MFColor)]),getTypeName:function(){return"Color"},getComponentName:function(){return"Rendering"},getContainerField:function(){return"color"},initialize:function(){n.prototype.initialize.call(this),this.color_.addInterest("set_color__",this),this.set_color__()},set_color__:function(){this.color=this.color_.getValue(),this.length=this.color_.length},addColor:function(t,e){if(t>=0&&t<this.length){const i=this.color;t*=3,e.push(i[t],i[t+1],i[t+2],1)}else if(this.length){const i=this.color;t=3*(this.length-1),e.push(i[t],i[t+1],i[t+2],1)}else e.push(1,1,1,1)},addColors:function(t,e){if(this.length){const r=this.color;for(var i=0,n=3*this.length;i<n;i+=3)t.push(r[i],r[i+1],r[i+2],1);var i=3*(this.length-1);const s=r[i],o=r[i+1],a=r[i+2];for(var i=n,n=3*e;i<n;i+=3)t.push(s,o,a,1)}else for(var i=0;i<e;++i)t.push(1,1,1,1)},getVectors:function(t){const e=this.color_;for(var i=0,n=e.length;i<n;++i){var r=e[i];t[i]=new s(r.r,r.g,r.b,1)}return t.length=n,t}}),o}),define("x_ite/Components/Rendering/X3DCoordinateNode",["x_ite/Components/Rendering/X3DGeometricPropertyNode","x_ite/Bits/X3DConstants","standard/Math/Geometry/Triangle3","standard/Math/Numbers/Vector3"],function(t,e,i,n){"use strict";function r(i){t.call(this,i),this.addType(e.X3DCoordinateNode)}return r.prototype=Object.assign(Object.create(t.prototype),{constructor:r,initialize:function(){t.prototype.initialize.call(this),this.point_.addInterest("set_point__",this),this.set_point__()},set_point__:function(){this.point=this.point_.getValue(),this.length=this.point_.length},isEmpty:function(){return 0===this.length},getSize:function(){return this.length},set1Point:function(t,e){this.point_[t]=e},get1Point:function(t,e){if(t<this.length){const i=this.point;return t*=3,e.set(i[t],i[t+1],i[t+2])}return e.set(0,0,0)},addPoint:function(t,e){if(t<this.length){const i=this.point;t*=3,e.push(i[t],i[t+1],i[t+2],1)}else e.push(0,0,0,1)},addPoints:function(t,e){const i=this.point;for(var n=0,r=3*this.length;n<r;n+=3)t.push(i[n],i[n+1],i[n+2],1);for(var n=r,r=3*e;n<r;n+=3)t.push(0,0,0,1)},getNormal:function(){const t=new n(0,0,0),e=new n(0,0,0),r=new n(0,0,0);return function(s,o,a){const u=this.length;return s<u&&o<u&&a<u?i.normal(this.get1Point(s,t),this.get1Point(o,e),this.get1Point(a,r),new n(0,0,0)):new n(0,0,0)}}(),getQuadNormal:function(){const t=new n(0,0,0),e=new n(0,0,0),r=new n(0,0,0),s=new n(0,0,0);return function(o,a,u,l){const c=this.length;return o<c&&a<c&&u<c&&l<c?i.quadNormal(this.get1Point(o,t),this.get1Point(a,e),this.get1Point(u,r),this.get1Point(l,s),new n(0,0,0)):new n(0,0,0)}}()}),r}),define("x_ite/Components/Rendering/Coordinate",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Rendering/X3DCoordinateNode","x_ite/Bits/X3DConstants"],function(t,e,i,n,r){"use strict";function s(t){n.call(this,t),this.addType(r.Coordinate),this.point_.setUnit("length")}return s.prototype=Object.assign(Object.create(n.prototype),{constructor:s,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"point",new t.MFVec3f)]),getTypeName:function(){return"Coordinate"},getComponentName:function(){return"Rendering"},getContainerField:function(){return"coord"}}),s}),define("x_ite/Browser/Grouping/X3DGroupingContext",["x_ite/Fields","x_ite/Components/Shape/Shape","x_ite/Components/Rendering/IndexedLineSet","x_ite/Components/Rendering/Color","x_ite/Components/Rendering/Coordinate"],function(t,e,i,n,r){"use strict";function s(){}return s.prototype={initialize:function(){},getBBoxNode:function(){const s=new e(this.getPrivateScene()),o=new i(this.getPrivateScene()),a=new n(this.getPrivateScene()),u=new r(this.getPrivateScene());return s.geometry_=o,o.coordIndex_=new t.MFFloat(0,1,2,3,0,-1,4,5,6,7,4,-1,0,4,-1,1,5,-1,2,6,-1,3,7,-1),o.color_=a,o.coord_=u,a.color_=new t.MFColor(new t.SFColor(1,1,1)),u.point_=new t.MFVec3f(new t.SFVec3f(.5,.5,.5),new t.SFVec3f(-.5,.5,.5),new t.SFVec3f(-.5,-.5,.5),new t.SFVec3f(.5,-.5,.5),new t.SFVec3f(.5,.5,-.5),new t.SFVec3f(-.5,.5,-.5),new t.SFVec3f(-.5,-.5,-.5),new t.SFVec3f(.5,-.5,-.5)),u.setup(),a.setup(),o.setup(),s.setup(),this.bboxNode=s,this.getBBoxNode=function(){return this.bboxNode},s}},s}),define("x_ite/Components/Rendering/X3DComposedGeometryNode",["x_ite/Components/Rendering/X3DGeometryNode","x_ite/Bits/X3DCast","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(t,e,i,n){"use strict";function r(e){t.call(this,e),this.addType(i.X3DComposedGeometryNode),this.fogCoordNode=null,this.colorNode=null,this.texCoordNode=null,this.normalNode=null,this.coordNode=null}return r.prototype=Object.assign(Object.create(t.prototype),{constructor:r,initialize:function(){t.prototype.initialize.call(this),this.attrib_.addInterest("set_attrib__",this),this.fogCoord_.addInterest("set_fogCoord__",this),this.color_.addInterest("set_color__",this),this.texCoord_.addInterest("set_texCoord__",this),this.normal_.addInterest("set_normal__",this),this.coord_.addInterest("set_coord__",this),this.set_attrib__(),this.set_fogCoord__(),this.set_color__(),this.set_texCoord__(),this.set_normal__(),this.set_coord__()},getFogCoord:function(){return this.fogCoordNode},getColor:function(){return this.colorNode},getTexCoord:function(){return this.texCoordNode},getNormal:function(){return this.normalNode},getCoord:function(){return this.coordNode},set_attrib__:function(){for(var t=this.getAttrib(),n=0,r=t.length;n<r;++n)t[n].removeInterest("requestRebuild",this);t.length=0;for(var n=0,r=this.attrib_.length;n<r;++n){var s=e(i.X3DVertexAttributeNode,this.attrib_[n]);s&&t.push(s)}for(var n=0;n<this.attribNodes.length;++n)t[n].addInterest("requestRebuild",this)},set_fogCoord__:function(){this.fogCoordNode&&this.fogCoordNode.removeInterest("requestRebuild",this),this.fogCoordNode=e(i.FogCoordinate,this.fogCoord_),this.fogCoordNode&&this.fogCoordNode.addInterest("requestRebuild",this)},set_color__:function(){this.colorNode&&(this.colorNode.removeInterest("requestRebuild",this),this.colorNode.transparent_.removeInterest("set_transparent__",this)),this.colorNode=e(i.X3DColorNode,this.color_),this.colorNode?(this.colorNode.addInterest("requestRebuild",this),this.colorNode.transparent_.addInterest("set_transparent__",this),this.set_transparent__()):this.setTransparent(!1)},set_transparent__:function(){this.setTransparent(this.colorNode.getTransparent())},set_texCoord__:function(){this.texCoordNode&&this.texCoordNode.removeInterest("requestRebuild",this),this.texCoordNode=e(i.X3DTextureCoordinateNode,this.texCoord_),this.texCoordNode&&this.texCoordNode.addInterest("requestRebuild",this),this.setTextureCoordinate(this.texCoordNode)},set_normal__:function(){this.normalNode&&this.normalNode.removeInterest("requestRebuild",this),this.normalNode=e(i.X3DNormalNode,this.normal_),this.normalNode&&this.normalNode.addInterest("requestRebuild",this)},set_coord__:function(){this.coordNode&&this.coordNode.removeInterest("requestRebuild",this),this.coordNode=e(i.X3DCoordinateNode,this.coord_),this.coordNode&&this.coordNode.addInterest("requestRebuild",this)},getPolygonIndex:function(t){return t},getTriangleIndex:function(t){return t},build:function(t,e,i,n){if(this.coordNode&&!this.coordNode.isEmpty()){e-=e%t,n-=n%i;const a=this.colorPerVertex_.getValue(),u=this.normalPerVertex_.getValue(),l=this.getAttrib(),c=l.length,h=this.getAttribs(),d=this.getFogCoord(),p=this.getColor(),f=this.getTexCoord(),g=this.getNormal(),m=this.getCoord(),_=this.getFogDepths(),x=this.getColors(),y=this.getMultiTexCoords(),v=this.getNormals(),w=this.getVertices();var r=0;f&&f.init(y);for(var s=0;s<n;++s){r=Math.floor(s/i);const t=this.getPolygonIndex(this.getTriangleIndex(s));for(var o=0;o<c;++o)l[o].addValue(t,h[o]);d&&d.addDepth(t,_),p&&(a?p.addColor(t,x):p.addColor(r,x)),f&&f.addTexCoord(t,y),g&&(u?g.addVector(t,v):g.addVector(r,v)),m.addPoint(t,w)}this.getNormal()||this.buildNormals(t,e,n),this.setSolid(this.solid_.getValue()),this.setCCW(this.ccw_.getValue())}},buildNormals:function(t,e,i){const n=this.createNormals(t,e),r=this.getNormals();for(var s=0;s<i;++s){const t=n[this.getTriangleIndex(s)];r.push(t.x,t.y,t.z)}},createNormals:function(t,e){const i=this.createFaceNormals(t,e);if(this.normalPerVertex_.getValue()){const t=[];for(var n=0;n<e;++n){const e=this.getPolygonIndex(n);var r=t[e];r||(r=t[e]=[]),r.push(n)}return this.refineNormals(t,i,Math.PI)}return i},createFaceNormals:function(t,e){const i=!this.ccw_.getValue(),n=this.coordNode,r=[];for(var s=0;s<e;s+=t){const e=this.getPolygonNormal(s,t,n);i&&e.negate();for(var o=0;o<t;++o)r.push(e)}return r},getPolygonNormal:function(){var t=new n(0,0,0),e=new n(0,0,0);return function(i,r,s){const o=new n(0,0,0);s.get1Point(this.getPolygonIndex(i),e);for(var a=0;a<r;++a){const n=t;t=e,e=n,s.get1Point(this.getPolygonIndex(i+(a+1)%r),e),o.x+=(t.y-e.y)*(t.z+e.z),o.y+=(t.z-e.z)*(t.x+e.x),o.z+=(t.x-e.x)*(t.y+e.y)}return o.normalize()}}()}),r}),define("x_ite/Components/Geometry3D/IndexedFaceSet",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Rendering/X3DComposedGeometryNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector3","standard/Math/Numbers/Matrix4","standard/Math/Geometry/Triangle3"],function(t,e,i,n,r,s,o,a){"use strict";function u(t){n.call(this,t),this.addType(r.IndexedFaceSet),this.creaseAngle_.setUnit("angle")}return u.prototype=Object.assign(Object.create(n.prototype),{constructor:u,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOnly,"set_colorIndex",new t.MFInt32),new e(r.inputOnly,"set_texCoordIndex",new t.MFInt32),new e(r.inputOnly,"set_normalIndex",new t.MFInt32),new e(r.inputOnly,"set_coordIndex",new t.MFInt32),new e(r.initializeOnly,"solid",new t.SFBool(!0)),new e(r.initializeOnly,"ccw",new t.SFBool(!0)),new e(r.initializeOnly,"convex",new t.SFBool(!0)),new e(r.initializeOnly,"creaseAngle",new t.SFFloat),new e(r.initializeOnly,"colorPerVertex",new t.SFBool(!0)),new e(r.initializeOnly,"normalPerVertex",new t.SFBool(!0)),new e(r.initializeOnly,"colorIndex",new t.MFInt32),new e(r.initializeOnly,"texCoordIndex",new t.MFInt32),new e(r.initializeOnly,"normalIndex",new t.MFInt32),new e(r.initializeOnly,"coordIndex",new t.MFInt32),new e(r.inputOutput,"attrib",new t.MFNode),new e(r.inputOutput,"fogCoord",new t.SFNode),new e(r.inputOutput,"color",new t.SFNode),new e(r.inputOutput,"texCoord",new t.SFNode),new e(r.inputOutput,"normal",new t.SFNode),new e(r.inputOutput,"coord",new t.SFNode)]),getTypeName:function(){return"IndexedFaceSet"},getComponentName:function(){return"Geometry3D"},getContainerField:function(){return"geometry"},initialize:function(){n.prototype.initialize.call(this),this.set_colorIndex_.addFieldInterest(this.colorIndex_),this.set_texCoordIndex_.addFieldInterest(this.texCoordIndex_),this.set_normalIndex_.addFieldInterest(this.normalIndex_),this.set_coordIndex_.addFieldInterest(this.coordIndex_)},getTexCoordPerVertexIndex:function(t){return t<this.texCoordIndex_.length?this.texCoordIndex_[t]:this.coordIndex_[t]},getColorPerVertexIndex:function(t){return t<this.colorIndex_.length?this.colorIndex_[t]:this.coordIndex_[t]},getColorIndex:function(t){return t<this.colorIndex_.length?this.colorIndex_[t]:t},getNormalPerVertexIndex:function(t){return t<this.normalIndex_.length?this.normalIndex_[t]:this.coordIndex_[t]},getNormalIndex:function(t){return t<this.normalIndex_.length?this.normalIndex_[t]:t},build:function(){var t=this.triangulate();if(0!==t.length){var e=this.colorPerVertex_.getValue(),i=this.normalPerVertex_.getValue(),n=this.coordIndex_.getValue(),r=this.getAttrib(),s=r.length,o=this.getAttribs(),a=this.getFogCoord(),u=this.getColor(),l=this.getTexCoord(),c=this.getNormal(),h=this.getCoord(),d=this.getFogDepths(),p=this.getColors(),f=this.getMultiTexCoords(),g=this.getNormals(),m=this.getVertices();l&&l.init(f);for(var _=0,x=t.length;_<x;++_){for(var y=t[_],v=y.triangles,w=y.face,b=0,S=v.length;b<S;++b){for(var C=v[b],T=n[C],F=0;F<s;++F)r[F].addValue(T,o[F]);a&&a.addDepth(T,d),u&&(e?u.addColor(this.getColorPerVertexIndex(C),p):u.addColor(this.getColorIndex(w),p)),l&&l.addTexCoord(this.getTexCoordPerVertexIndex(C),f),c&&(i?c.addVector(this.getNormalPerVertexIndex(C),g):c.addVector(this.getNormalIndex(w),g)),h.addPoint(T,m)}++w}this.getNormal()||this.buildNormals(t),this.setSolid(this.solid_.getValue()),this.setCCW(this.ccw_.getValue())}},triangulate:function(){var t=this.convex_.getValue(),e=this.coordIndex_.length,i=[];if(!this.getCoord())return i;if(e){this.coordIndex_[e-1]>-1&&this.coordIndex_.push(-1);for(var n=this.coordIndex_.getValue(),e=this.coordIndex_.length,r=[],s=0,o=0;o<e;++o){if(n[o]>-1)r.push(o);else{if(r.length)switch(r.length){case 0:case 1:case 2:r.length=0;break;case 3:i.push({vertices:r,triangles:r,face:s}),r=[];break;default:var a=[],u={vertices:r,triangles:a,face:s};t?this.triangulateConvexPolygon(r,a):this.triangulatePolygon(r,a),a.length<3?r.length=0:(i.push(u),r=[])}++s}}}return i},triangulatePolygon:function(){var t=[];return function(e,i){for(var n=this.coordIndex_.getValue(),r=this.getCoord(),o=0,u=e.length;o<u;++o){var l=t[o],c=e[o];l||(l=t[o]=new s(0,0,0)),l.index=c,r.get1Point(n[c],l)}t.length=u,a.triangulatePolygon(t,i);for(var c=0,u=i.length;c<u;++c)i[c]=i[c].index}}(),triangulateConvexPolygon:function(t,e){for(var i=1,n=t.length-1;i<n;++i)e.push(t[0],t[i],t[i+1])},buildNormals:function(t){for(var e=this.createNormals(t),i=this.getNormals(),n=0,r=t.length;n<r;++n)for(var s=t[n].triangles,o=0,a=s.length;o<a;++o){var u=e[s[o]];i.push(u.x,u.y,u.z)}},createNormals:function(){var t=[],e=[];return function(i){var n=!this.ccw_.getValue(),r=this.coordIndex_.getValue(),s=this.getCoord(),o=null;t.length=0,e.length=0;for(var a=0,u=i.length;a<u;++a){var l=i[a],c=l.vertices,h=c.length;switch(h){case 3:o=s.getNormal(r[c[0]],r[c[1]],r[c[2]]);break;case 4:o=s.getQuadNormal(r[c[0]],r[c[1]],r[c[2]],r[c[3]]);break;default:o=this.getPolygonNormal(c,r,s)}for(var d=0;d<h;++d){var p=c[d],f=r[p],g=e[f];g||(g=e[f]=[]),g.push(p)}n&&o.negate();for(var d=0;d<h;++d)t[c[d]]=o}return this.refineNormals(e,t,this.creaseAngle_.getValue())}}(),getPolygonNormal:function(){var t=new s(0,0,0),e=new s(0,0,0);return function(i,n,r){var o=new s(0,0,0);r.get1Point(n[i[0]],e);for(var a=0,u=i.length;a<u;++a){var l=t;t=e,e=l,r.get1Point(n[i[(a+1)%u]],e),o.x+=(t.y-e.y)*(t.z+e.z),o.y+=(t.z-e.z)*(t.x+e.x),o.z+=(t.x-e.x)*(t.y+e.y)}return o.normalize()}}()}),u}),define("x_ite/Components/Texturing/X3DTextureCoordinateNode",["x_ite/Components/Rendering/X3DGeometricPropertyNode","x_ite/Bits/X3DConstants"],function(t,e){"use strict";function i(i){t.call(this,i),this.addType(e.X3DTextureCoordinateNode)}return i.prototype=Object.assign(Object.create(t.prototype),{constructor:i,setShaderUniformsToChannel:function(t,e,i){t.uniform1i(e.x3d_TextureCoordinateGeneratorMode[i],0)}}),i}),define("x_ite/Components/Texturing/X3DSingleTextureCoordinateNode",["x_ite/Components/Texturing/X3DTextureCoordinateNode","x_ite/Components/Rendering/X3DGeometryNode","x_ite/Bits/X3DConstants"],function(t,e,i){"use strict";function n(n){t.call(this,n),this.addType(i.X3DSingleTextureCoordinateNode),this.texCoordArray=e.createArray()}return n.prototype=Object.assign(Object.create(t.prototype),{constructor:n,init:function(t){this.texCoordArray.length=0,t.push(this.texCoordArray)},addTexCoord:function(t,e){this.addTexCoordToChannel(t,e[0])},setShaderUniforms:function(t,e){for(let i=0,n=e.x3d_MaxTextures;i<n;++i)this.setShaderUniformsToChannel(t,e,i)}}),n}),define("x_ite/Components/Texturing/TextureCoordinate",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Texturing/X3DSingleTextureCoordinateNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector4"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.TextureCoordinate)}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"mapping",new t.SFString),new e(r.inputOutput,"point",new t.MFVec2f)]),getTypeName:function(){return"TextureCoordinate"},getComponentName:function(){return"Texturing"},getContainerField:function(){return"texCoord"},initialize:function(){n.prototype.initialize.call(this),this.point_.addInterest("set_point__",this),this.set_point__()},set_point__:function(){this.point=this.point_.getValue(),this.length=this.point_.length},isEmpty:function(){return 0===this.length},getSize:function(){return this.length},get1Point:function(t,e){if(t>=0&&t<this.length){const i=this.point;return t*=2,e.set(i[t],i[t+1],0,1)}if(t>=0&&this.length){const i=this.point;return t%=this.length,t*=2,e.set(i[t],i[t+1],0,1)}return e.set(0,0,0,1)},
|
|
27
|
+
addTexCoordToChannel:function(t,e){if(t>=0&&t<this.length){const i=this.point;t*=2,e.push(i[t],i[t+1],0,1)}else if(t>=0&&this.length){const i=this.point;t%=this.length,t*=2,e.push(i[t],i[t+1],0,1)}else e.push(0,0,0,1)},getTexCoord:function(t){const e=this.point;for(let i=0,n=0,r=this.length;i<r;++i,n+=2)t[i]=new s(e[n],e[n+1],0,1);return t.length=this.length,t}}),o}),define("x_ite/Browser/Geometry3D/BoxOptions",["x_ite/Fields","x_ite/Basic/X3DBaseNode","x_ite/Components/Geometry3D/IndexedFaceSet","x_ite/Components/Rendering/Coordinate","x_ite/Components/Texturing/TextureCoordinate"],function(t,e,i,n,r){"use strict";function s(t){e.call(this,t)}return s.prototype=Object.assign(Object.create(e.prototype),{constructor:s,getTypeName:function(){return"BoxOptions"},getComponentName:function(){return"X_ITE"},getContainerField:function(){return"boxOptions"},initialize:function(){e.prototype.initialize.call(this)},getGeometry:function(){if(this.geometry)return this.geometry;this.geometry=new i(this.getExecutionContext()),this.geometry.texCoord_=new r(this.getExecutionContext()),this.geometry.coord_=new n(this.getExecutionContext());var e=this.geometry,s=this.geometry.texCoord_.getValue(),o=this.geometry.coord_.getValue();return e.texCoordIndex_=new t.MFInt32(0,1,2,3,-1,0,1,2,3,-1,0,1,2,3,-1,0,1,2,3,-1,0,1,2,3,-1,0,1,2,3,-1),e.coordIndex_=new t.MFInt32(0,1,2,3,-1,5,4,7,6,-1,1,5,6,2,-1,4,0,3,7,-1,4,5,1,0,-1,3,2,6,7,-1),s.point_=new t.MFVec2f(new t.SFVec2f(1,1),new t.SFVec2f(0,1),new t.SFVec2f(0,0),new t.SFVec2f(1,0)),o.point_=new t.MFVec3f(new t.SFVec3f(1,1,1),new t.SFVec3f(-1,1,1),new t.SFVec3f(-1,-1,1),new t.SFVec3f(1,-1,1),new t.SFVec3f(1,1,-1),new t.SFVec3f(-1,1,-1),new t.SFVec3f(-1,-1,-1),new t.SFVec3f(1,-1,-1)),s.setup(),o.setup(),e.setup(),this.geometry}}),s}),define("x_ite/Browser/Geometry3D/ConeOptions",["x_ite/Fields","x_ite/Basic/X3DBaseNode"],function(t,e){"use strict";function i(i){e.call(this,i),this.addChildObjects("xDimension",new t.SFInt32(20),"yDimension",new t.SFInt32(1))}return i.prototype=Object.assign(Object.create(e.prototype),{constructor:i,getTypeName:function(){return"ConeOptions"},getComponentName:function(){return"X_ITE"},getContainerField:function(){return"coneOptions"}}),i}),define("x_ite/Browser/Geometry3D/CylinderOptions",["x_ite/Fields","x_ite/Basic/X3DBaseNode"],function(t,e){"use strict";function i(i){e.call(this,i),this.addChildObjects("xDimension",new t.SFInt32(20),"yDimension",new t.SFInt32(1))}return i.prototype=Object.assign(Object.create(e.prototype),{constructor:i,getTypeName:function(){return"CylinderOptions"},getComponentName:function(){return"X_ITE"},getContainerField:function(){return"cylinderOptions"}}),i}),define("x_ite/Browser/Geometry3D/QuadSphereOptions",["x_ite/Fields","x_ite/Basic/X3DBaseNode","x_ite/Components/Geometry3D/IndexedFaceSet","x_ite/Components/Rendering/Coordinate","x_ite/Components/Texturing/TextureCoordinate","standard/Math/Numbers/Complex","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3"],function(t,e,i,n,r,s,o,a){"use strict";function u(i){e.call(this,i),this.addChildObjects("xDimension",new t.SFInt32(32),"yDimension",new t.SFInt32(15))}return u.prototype=Object.assign(Object.create(e.prototype),{constructor:u,getTypeName:function(){return"QuadSphereOptions"},getComponentName:function(){return"X_ITE"},getContainerField:function(){return"quadSphereOptions"},initialize:function(){e.prototype.initialize.call(this),this.addInterest("eventsProcessed",this)},getGeometry:function(){return this.geometry||this.eventsProcessed(),this.geometry},createTexCoordIndex:function(){for(var t=this.xDimension_.getValue()+1,e=this.yDimension_.getValue(),i=this.geometry.texCoordIndex_,n=0,r=t-1;n<r;++n)i.push(n),i.push(n+t-1),i.push(n+t),i.push(-1);for(var s=t-1,o=0,a=e-3;o<a;++o,++s)for(var n=0,r=t-1;n<r;++n,++s)i.push(s),i.push(s+t),i.push(s+t+1),i.push(s+1),i.push(-1);for(var s=(e-2)*t-1,n=0,r=t-1;n<r;++n,++s)i.push(s+t),i.push(s+1),i.push(s),i.push(-1)},createTexCoord:function(){for(var t=this.xDimension_.getValue()+1,e=this.yDimension_.getValue(),i=this.geometry.texCoord_.getValue().point_,n=-.5/(t-1),r=1;r<t;++r){var s=r/(t-1)+n;i.push(new o(s,1))}for(var a=1,u=e-1;a<u;++a)for(var l=1-a/(e-1),r=0;r<t;++r){var s=r/(t-1);i.push(new o(s,l))}for(var r=1;r<t;++r){var s=r/(t-1)+n;i.push(new o(s,0))}},createCoordIndex:function(){for(var t=this.xDimension_.getValue()+1,e=this.yDimension_.getValue(),i=this.geometry.coordIndex_,n=1,r=t-1;n<r;++n)i.push(0),i.push(n),i.push(n+1),i.push(-1);i.push(0),i.push(n),i.push(1),i.push(-1);for(var s=1,o=0,a=e-3;o<a;++o,++s){for(var n=0,r=t-2;n<r;++n,++s)i.push(s),i.push(s+t-1),i.push(s+t),i.push(s+1),i.push(-1);i.push(s),i.push(s+t-1),i.push(s+1),i.push(s-t+2),i.push(-1)}for(var u=s+t-1,n=0,r=t-2;n<r;++n,++s)i.push(u),i.push(s+1),i.push(s),i.push(-1);i.push(u),i.push(u-t+1),i.push(s),i.push(-1)},createPoints:function(){var t=this.xDimension_.getValue()+1,e=this.yDimension_.getValue(),i=this.geometry.coord_.getValue().point_;i.push(new a(0,1,0));for(var n=1,r=e-1;n<r;++n)for(var o=s.Polar(1,-Math.PI*n/r),u=0,l=t-1;u<l;++u){var c=s.Polar(o.imag,2*Math.PI*u/l);i.push(new a(c.imag,o.real,c.real))}i.push(new a(0,-1,0))},eventsProcessed:function(){this.geometry=new i(this.getExecutionContext()),this.geometry.texCoord_=new r(this.getExecutionContext()),this.geometry.coord_=new n(this.getExecutionContext()),this.createTexCoordIndex(),this.createTexCoord(),this.createCoordIndex(),this.createPoints();var t=this.geometry,e=this.geometry.texCoord_.getValue(),s=this.geometry.coord_.getValue();t.creaseAngle_=Math.PI,e.setup(),s.setup(),t.setup()}}),u}),define("x_ite/Browser/Geometry3D/X3DGeometry3DContext",["x_ite/Browser/Geometry3D/BoxOptions","x_ite/Browser/Geometry3D/ConeOptions","x_ite/Browser/Geometry3D/CylinderOptions","x_ite/Browser/Geometry3D/QuadSphereOptions"],function(t,e,i,n){"use strict";function r(t,e,i){return this[e]=new i(this.getPrivateScene()),this[e].setup(),this[t]=function(){return this[e]},this[e]}function s(){}return s.prototype={initialize:function(){},getBoxOptions:function(){return r.call(this,"getBoxOptions","boxOptions",t)},getConeOptions:function(){return r.call(this,"getConeOptions","coneOptions",e)},getCylinderOptions:function(){return r.call(this,"getCylinderOptions","cylinderOptions",i)},getSphereOptions:function(){return r.call(this,"getSphereOptions","sphereOptions",n)}},s}),define("x_ite/Browser/PointingDeviceSensor/PointingDevice",["jquery","x_ite/Basic/X3DBaseNode"],function(t,e){"use strict";function i(t){e.call(this,t),this.cursor="DEFAULT",this.isOver=!1,this.motionTime=0}return i.prototype=Object.assign(Object.create(e.prototype),{constructor:i,getTypeName:function(){return"PointingDevice"},initialize:function(){var t=this.getBrowser().getSurface();t.bind("mousedown.PointingDevice"+this.getId(),this.mousedown.bind(this)),t.bind("mouseup.PointingDevice"+this.getId(),this.mouseup.bind(this)),t.bind("dblclick.PointingDevice"+this.getId(),this.dblclick.bind(this)),t.bind("mousemove.PointingDevice"+this.getId(),this.mousemove.bind(this)),t.bind("mouseout.PointingDevice"+this.getId(),this.onmouseout.bind(this)),t.bind("touchstart.PointingDevice"+this.getId(),this.touchstart.bind(this)),t.bind("touchend.PointingDevice"+this.getId(),this.touchend.bind(this))},mousewheel:function(t){},mousedown:function(e){var i=this.getBrowser();if(i.getElement().focus(),!(i.getShiftKey()&&i.getControlKey()||0!==e.button)){var n=i.getSurface(),r=n.offset(),s=e.pageX-r.left-parseFloat(n.css("borderLeftWidth")),o=n.innerHeight()-(e.pageY-r.top-parseFloat(n.css("borderTopWidth")));n.unbind("mousemove.PointingDevice"+this.getId()),t(document).bind("mouseup.PointingDevice"+this.getId(),this.mouseup.bind(this)),t(document).bind("mousemove.PointingDevice"+this.getId(),this.mousemove.bind(this)),t(document).bind("touchend.PointingDevice"+this.getId(),this.touchend.bind(this)),t(document).bind("touchmove.PointingDevice"+this.getId(),this.touchmove.bind(this)),i.buttonPressEvent(s,o)&&(e.preventDefault(),e.stopImmediatePropagation(),i.setCursor("HAND"),i.finished().addInterest("onverifymotion",this,s,o))}},mouseup:function(e){if(e.preventDefault(),0===e.button){var i=this.getBrowser(),n=i.getSurface(),r=n.offset(),s=e.pageX-r.left-parseFloat(n.css("borderLeftWidth")),o=n.innerHeight()-(e.pageY-r.top-parseFloat(n.css("borderTopWidth")));t(document).unbind(".PointingDevice"+this.getId()),n.bind("mousemove.PointingDevice"+this.getId(),this.mousemove.bind(this)),i.buttonReleaseEvent(),i.setCursor(this.isOver?"HAND":"DEFAULT"),i.finished().addInterest("onverifymotion",this,s,o),i.addBrowserEvent(),this.cursor="DEFAULT"}},dblclick:function(t){this.isOver&&t.stopImmediatePropagation()},mousemove:function(t){t.preventDefault();var e=this.getBrowser();if(this.motionTime!==e.getCurrentTime()){this.motionTime=e.getCurrentTime();var i=e.getSurface(),n=i.offset(),r=t.pageX-n.left-parseFloat(i.css("borderLeftWidth")),s=i.innerHeight()-(t.pageY-n.top-parseFloat(i.css("borderTopWidth")));this.onmotion(r,s)}},touchstart:function(t){var e=t.originalEvent.touches;switch(e.length){case 1:t.button=0,t.pageX=e[0].pageX,t.pageY=e[0].pageY,this.mousedown(t);break;case 2:this.touchend(t)}},touchend:function(t){t.button=0,this.mouseup(t)},touchmove:function(t){var e=t.originalEvent.touches;switch(e.length){case 1:t.button=0,t.pageX=e[0].pageX,t.pageY=e[0].pageY,this.mousemove(t)}},onmotion:function(t,e){var i=this.getBrowser();i.motionNotifyEvent(t,e)?this.isOver||(this.isOver=!0,this.cursor=i.getCursor(),i.setCursor("HAND")):this.isOver&&(this.isOver=!1,i.setCursor(this.cursor))},onmouseout:function(t){this.getBrowser().leaveNotifyEvent()},onverifymotion:function(t,e,i){this.getBrowser().finished().removeInterest("onverifymotion",this),this.onmotion(e,i)}}),i}),define("x_ite/Browser/PointingDeviceSensor/X3DPointingDeviceSensorContext",["jquery","x_ite/Browser/PointingDeviceSensor/PointingDevice","x_ite/Bits/TraverseType","x_ite/Bits/X3DConstants","standard/Math/Geometry/Line3","standard/Math/Geometry/ViewVolume","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3","standard/Math/Numbers/Matrix4","standard/Math/Algorithms/MergeSort","standard/Math/Algorithm"],function(t,e,i,n,r,s,o,a,u,l,c){"use strict";function h(){this.pointingDevice=new e(this),this.pointer=new o(0,0),this.hitRay=new r(a.Zero,a.Zero),this.hits=[],this.enabledSensors=[{}],this.selectedLayer=null,this.overSensors={},this.activeSensors={},this.hitPointSorter=new l(this.hits,function(t,e){return t.intersection.point.z<e.intersection.point.z}),this.layerSorter=new l(this.hits,function(t,e){return t.layerNumber<e.layerNumber}),this.pointerTime=0}var d=new r(a.Zero,a.Zero);return h.prototype={initialize:function(){this.getElement().attr("tabindex",this.getElement().attr("tabindex")||0),this.setCursor("DEFAULT"),this.pointingDevice.setup()},setCursor:function(t){this.cursorType=t;var e=this.getSurface();switch(t){case"HAND":e.css("cursor","pointer");break;case"MOVE":e.css("cursor","move");break;case"CROSSHAIR":e.css("cursor","crosshair");break;default:this.loadCount_.getValue()?e.css("cursor","wait"):this.pointingDevice&&this.pointingDevice.isOver?e.css("cursor","pointer"):e.css("cursor","default")}},getCursor:function(){return this.cursorType},isPointerInRectangle:function(t){return this.pointer.x>t.x&&this.pointer.x<t.x+t.z&&this.pointer.y>t.y&&this.pointer.y<t.y+t.w},setLayerNumber:function(t){this.layerNumber=t},getSelectedLayer:function(){return this.selectedLayer},setHitRay:function(t,e){try{s.unProjectRay(this.pointer.x,this.pointer.y,u.Identity,t,e,this.hitRay)}catch(t){this.hitRay.set(a.Zero,a.Zero)}},getHitRay:function(){return this.hitRay},getSensors:function(){return this.enabledSensors},addHit:function(t,e,i,n){this.hits.push({pointer:this.pointer,hitRay:this.hitRay.copy(),intersection:t,sensors:this.enabledSensors.at(-1),layer:e,layerNumber:this.layerNumber,shape:i,modelViewMatrix:n.copy()})},getHits:function(){return this.hits},getNearestHit:function(){return this.hits.at(-1)},buttonPressEvent:function(e,i){if(this.touch(e,i),0===this.hits.length)return!1;var n=this.getNearestHit();this.selectedLayer=n.layer,this.activeSensors=n.sensors;for(var r in this.activeSensors)this.activeSensors[r].set_active__(!0,n);return!t.isEmptyObject(n.sensors)},buttonReleaseEvent:function(){this.selectedLayer=null;for(var t in this.activeSensors)this.activeSensors[t].set_active__(!1,null);return this.activeSensors={},!0},motionNotifyEvent:function(e,i){return this.touch(e,i),this.motion(),this.hits.length&&!t.isEmptyObject(this.hits.at(-1).sensors)},leaveNotifyEvent:function(){},touch:function(t,e){if(this.getViewer().isActive_.getValue())return void(this.pointerTime=0);var n=performance.now();this.pointer.set(t,e),this.hits.length=0,this.getWorld().traverse(i.POINTER,null),this.hitPointSorter.sort(0,this.hits.length),this.layerSorter.sort(0,this.hits.length),this.addBrowserEvent(),this.pointerTime=performance.now()-n},motion:function(){if(this.hits.length)var t=this.hits.at(-1);else var e=this.selectedLayer?this.hitRay:d,t={pointer:this.pointer,modelViewMatrix:new u,hitRay:e,intersection:null,sensors:{},shape:null,layer:null,layerNumber:0};if(this.hits.length)var i=c.set_difference(this.overSensors,t.sensors,{},function(t,e){return t.getNode()<e.getNode()});else var i=Object.assign({},this.overSensors);for(var n in i)i[n].set_over__(!1,t);if(this.hits.length){this.overSensors=t.sensors;for(var n in this.overSensors)this.overSensors[n].set_over__(!0,t)}else this.overSensors={};for(var n in this.activeSensors)this.activeSensors[n].set_motion__(t)}},h}),define("x_ite/Components/Followers/PositionChaser",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Followers/X3DChaserNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.PositionChaser)}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOnly,"set_value",new t.SFVec3f),new e(r.inputOnly,"set_destination",new t.SFVec3f),new e(r.initializeOnly,"initialValue",new t.SFVec3f),new e(r.initializeOnly,"initialDestination",new t.SFVec3f),new e(r.initializeOnly,"duration",new t.SFTime(1)),new e(r.outputOnly,"isActive",new t.SFBool),new e(r.outputOnly,"value_changed",new t.SFVec3f)]),getTypeName:function(){return"PositionChaser"},getComponentName:function(){return"Followers"},getContainerField:function(){return"children"},getVector:function(){return new s(0,0,0)}}),o}),define("x_ite/Browser/Navigation/ExamineViewer",["jquery","x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Bits/X3DConstants","x_ite/Browser/Navigation/X3DViewer","x_ite/Components/Followers/PositionChaser","x_ite/Components/Followers/OrientationChaser","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","jquery-mousewheel"],function(t,e,i,n,r,s,o,a,u,l,c){"use strict";function h(t){s.call(this,t),this.button=-1,this.orientationOffset=new c(0,0,1,0),this.fromVector=new l(0,0,0),this.toVector=new l(0,0,0),this.fromPoint=new l(0,0,0),this.toPoint=new l(0,0,0),this.rotation=new c(0,0,1,0),this.pressTime=0,this.motionTime=0,this.touchMode=0,this.touch1=new u(0,0),this.touch2=new u(0,0),this.tapStart=0,this.dblTapInterval=.4,this.initialPositionOffset=new l(0,0,0),this.initialOrientationOffset=new c(0,0,1,0),this.positionChaser=new o(t),this.centerOfRotationChaser=new o(t),this.rotationChaser=new a(t)}var d=/Mac OS X/i.test(navigator.userAgent),p=d?1/120:.05;return h.prototype=Object.assign(Object.create(s.prototype),{constructor:h,fieldDefinitions:new n([new i(r.outputOnly,"isActive",new e.SFBool)]),initialize:function(){s.prototype.initialize.call(this);var t=this.getBrowser(),e=t.getSurface();this.getNavigationInfo().transitionStart_.addInterest("disconnect",this),t.activeViewpoint_.addInterest("set_activeViewpoint__",this),e.bind("mousedown.ExamineViewer",this.mousedown.bind(this)),e.bind("mouseup.ExamineViewer",this.mouseup.bind(this)),e.bind("dblclick.ExamineViewer",this.dblclick.bind(this)),e.bind("mousewheel.ExamineViewer",this.mousewheel.bind(this)),e.bind("touchstart.ExamineViewer",this.touchstart.bind(this)),e.bind("touchend.ExamineViewer",this.touchend.bind(this)),this.positionChaser.duration_=.2,this.positionChaser.setPrivate(!0),this.positionChaser.setup(),this.centerOfRotationChaser.duration_=.2,this.centerOfRotationChaser.setPrivate(!0),this.centerOfRotationChaser.setup(),this.rotationChaser.duration_=.2,this.rotationChaser.setPrivate(!0),this.rotationChaser.setup(),this.set_activeViewpoint__()},set_activeViewpoint__:function(){if(this.getStraightenHorizon()){var t=this.getActiveViewpoint();t&&(t.orientationOffset_=this.getOrientationOffset(c.Identity,t.orientationOffset_.getValue(),!1))}this.disconnect()},mousedown:function(e){if(!(this.button>=0)){this.pressTime=performance.now();var i=this.getBrowser().getSurface().offset(),n=e.pageX-i.left,r=e.pageY-i.top;switch(this.getButton(e.button)){case 0:e.preventDefault(),e.stopImmediatePropagation(),this.button=e.button,t(document).bind("mouseup.ExamineViewer"+this.getId(),this.mouseup.bind(this)),t(document).bind("mousemove.ExamineViewer"+this.getId(),this.mousemove.bind(this)),t(document).bind("touchend.ExamineViewer"+this.getId(),this.touchend.bind(this)),t(document).bind("touchmove.ExamineViewer"+this.getId(),this.touchmove.bind(this)),this.disconnect(),this.getActiveViewpoint().transitionStop(),this.getBrowser().setCursor("MOVE"),this.trackballProjectToSphere(n,r,this.fromVector),this.rotation.assign(c.Identity),this.motionTime=0,this.isActive_=!0;break;case 1:e.preventDefault(),e.stopImmediatePropagation(),this.button=e.button,t(document).bind("mouseup.ExamineViewer"+this.getId(),this.mouseup.bind(this)),t(document).bind("mousemove.ExamineViewer"+this.getId(),this.mousemove.bind(this)),t(document).bind("touchend.ExamineViewer"+this.getId(),this.touchend.bind(this)),t(document).bind("touchmove.ExamineViewer"+this.getId(),this.touchmove.bind(this)),this.disconnect(),this.getActiveViewpoint().transitionStop(),this.getBrowser().setCursor("MOVE"),this.getPointOnCenterPlane(n,r,this.fromPoint),this.isActive_=!0}}},mouseup:function(e){if(e.button===this.button)switch(this.button=-1,t(document).unbind(".ExamineViewer"+this.getId()),this.getButton(e.button)){case 0:e.preventDefault(),e.stopImmediatePropagation();var i=this.getActiveViewpoint();this.getBrowser().setCursor("DEFAULT"),Math.abs(this.rotation.angle)>.003&&performance.now()-this.motionTime<40&&(this.getStraightenHorizon()&&"GeoViewpoint"!==i.getTypeName()&&(this.rotation=this.getHorizonRotation(this.rotation)),this.addSpinning(this.rotation)),this.isActive_=!1;break;case 1:e.preventDefault(),e.stopImmediatePropagation(),this.getBrowser().setCursor("DEFAULT"),this.isActive_=!1}},dblclick:function(t){t.preventDefault(),t.stopImmediatePropagation();const e=this.getBrowser().getSurface(),i=e.offset(),n=t.pageX-i.left-parseFloat(e.css("borderLeftWidth")),r=e.innerHeight()-(t.pageY-i.top-parseFloat(e.css("borderTopWidth")));this.disconnect(),this.lookAtBBox(n,r,this.getStraightenHorizon())},mousemove:function(){var t=new l(0,0,0);return function(e){var i=this.getBrowser().getSurface().offset(),n=e.pageX-i.left,r=e.pageY-i.top;switch(this.getButton(this.button)){case 0:e.preventDefault(),e.stopImmediatePropagation();var s=this.trackballProjectToSphere(n,r,this.toVector);if(this.rotation.setFromToVec(s,this.fromVector),Math.abs(this.rotation.angle)<.003&&performance.now()-this.pressTime<50)return;this.addRotate(this.rotation),this.fromVector.assign(s),this.motionTime=performance.now();break;case 1:e.preventDefault(),e.stopImmediatePropagation();var o=this.getActiveViewpoint(),a=this.getPointOnCenterPlane(n,r,this.toPoint),u=o.getUserOrientation().multVecRot(t.assign(this.fromPoint).subtract(a));this.addMove(u,u),this.fromPoint.assign(a)}}}(),mousewheel:function(){var t=new l(0,0,0),e=new l(0,0,0);return function(i){i.preventDefault(),i.stopImmediatePropagation();var n=this.getBrowser(),r=this.getActiveViewpoint();n.prepareEvents().removeInterest("spin",this),r.transitionStop(),t=this.getDistanceToCenter(t).multiply(i.zoomFactor||p),e=r.getUserOrientation().multVecRot(e.set(0,0,t.abs())),i.deltaY>0?this.addMove(e.negate(),l.Zero):i.deltaY<0&&this.addMove(e,l.Zero)}}(),touchstart:function(t){var e=t.originalEvent.touches;switch(e.length){case 1:t.button=0,t.pageX=e[0].pageX,t.pageY=e[0].pageY,this.mousedown(t),this.touch1.set(e[0].pageX,e[0].pageY);break;case 2:this.touchend(t),t.button=1,t.pageX=(e[0].pageX+e[1].pageX)/2,t.pageY=(e[0].pageY+e[1].pageY)/2,this.mousedown(t),this.touch1.set(e[0].pageX,e[0].pageY),this.touch2.set(e[1].pageX,e[1].pageY);break;case 3:this.touchend(t)}},touchend:function(t){switch(this.button){case 0:t.button=0,this.mouseup(t),this.getBrowser().getCurrentTime()-this.tapStart<this.dblTapInterval&&(t.button=0,t.pageX=this.touch1.x,t.pageY=this.touch1.y,this.dblclick(t)),this.tapStart=this.getBrowser().getCurrentTime();break;case 1:this.touchMode=0,t.button=1,this.mouseup(t)}},touchmove:function(){var e=new u(0,0),i=new u(0,0);return function(n){var r=n.originalEvent.touches;switch(r.length){case 1:n.pageX=r[0].pageX,n.pageY=r[0].pageY,this.mousemove(n);break;case 2:e.set(r[0].pageX,r[0].pageY).subtract(this.touch1).normalize(),i.set(r[1].pageX,r[1].pageY).subtract(this.touch2).normalize();var s=e.dot(i)>.7,o=e.dot(i)<-.7;switch(this.touchMode||(s?1:o?2:0)){case 1:this.touchMode=1,n.pageX=(r[0].pageX+r[1].pageX)/2,n.pageY=(r[0].pageY+r[1].pageY)/2,this.mousemove(n);break;case 2:this.touchMode=2;var a=this.touch1.distance(this.touch2);this.touch1.set(r[0].pageX,r[0].pageY),this.touch2.set(r[1].pageX,r[1].pageY);var u=this.touch1.distance(this.touch2),l=u-a;n.deltaY=l,n.zoomFactor=Math.abs(l)/t(window).width(),this.mousewheel(n)}this.touch1.set(r[0].pageX,r[0].pageY),this.touch2.set(r[1].pageX,r[1].pageY)}}}(),spin:function(){var t=this.getActiveViewpoint();this.orientationOffset.assign(t.orientationOffset_.getValue()),t.orientationOffset_=this.getOrientationOffset(this.rotation,this.orientationOffset),t.positionOffset_=this.getPositionOffset(t.positionOffset_.getValue(),this.orientationOffset,t.orientationOffset_.getValue())},set_positionOffset__:function(t){this.getActiveViewpoint().positionOffset_=t},set_centerOfRotationOffset__:function(t){this.getActiveViewpoint().centerOfRotationOffset_=t},set_rotation__:function(t){var e=this.getActiveViewpoint();e.orientationOffset_=this.getOrientationOffset(t.getValue(),this.initialOrientationOffset,!1),e.positionOffset_=this.getPositionOffset(this.initialPositionOffset,this.initialOrientationOffset,e.orientationOffset_.getValue())},addRotate:function(){var t=new c;return function(e){var i=this.getActiveViewpoint();if(this.rotationChaser.isActive_.getValue()&&this.rotationChaser.value_changed_.hasInterest("set_rotation__",this))try{t.assign(this.rotationChaser.set_destination_.getValue()).multLeft(e),this.getOrientationOffset(t,this.initialOrientationOffset,!0),this.rotationChaser.set_destination_=t}catch(i){e=this.getHorizonRotation(e),t.assign(this.rotationChaser.set_destination_.getValue()).multLeft(e),this.rotationChaser.set_destination_=t}else try{this.initialOrientationOffset.assign(i.orientationOffset_.getValue()),this.initialPositionOffset.assign(i.positionOffset_.getValue()),this.getOrientationOffset(e,this.initialOrientationOffset,!0),this.rotationChaser.set_value_=c.Identity,this.rotationChaser.set_destination_=e}catch(t){this.rotationChaser.set_value_=c.Identity,this.rotationChaser.set_destination_=this.getHorizonRotation(e)}this.disconnect(),this.rotationChaser.value_changed_.addInterest("set_rotation__",this)}}(),addSpinning:function(){var t=new c(0,0,1,0);return function(e){try{this.disconnect(),this.getBrowser().prepareEvents().addInterest("spin",this),this.rotation.assign(t.assign(c.Identity).slerp(e,.6))}catch(t){console.log(t)}}}(),addMove:function(){var t=new l(0,0,0),e=new l(0,0,0);return function(i,n){var r=this.getActiveViewpoint();this.positionChaser.isActive_.getValue()&&this.positionChaser.value_changed_.hasInterest("set_positionOffset__",this)?(t.assign(this.positionChaser.set_destination_.getValue()).add(i),this.positionChaser.set_destination_=t):(t.assign(r.positionOffset_.getValue()).add(i),this.positionChaser.set_value_=r.positionOffset_,this.positionChaser.set_destination_=t),this.centerOfRotationChaser.isActive_.getValue()&&this.centerOfRotationChaser.value_changed_.hasInterest("set_centerOfRotationOffset__",this)?(e.assign(this.centerOfRotationChaser.set_destination_.getValue()).add(n),this.centerOfRotationChaser.set_destination_=e):(e.assign(r.centerOfRotationOffset_.getValue()).add(n),this.centerOfRotationChaser.set_value_=r.centerOfRotationOffset_,this.centerOfRotationChaser.set_destination_=e),this.disconnect(),this.positionChaser.value_changed_.addInterest("set_positionOffset__",this),this.centerOfRotationChaser.value_changed_.addInterest("set_centerOfRotationOffset__",this)}}(),getPositionOffset:function(){var t=new l(0,0,0),e=new l(0,0,0),i=new c(0,0,1,0);return function(n,r,s){return this.getDistanceToCenter(t,n),i.assign(r).inverse().multRight(s).multVecRot(e.assign(t)).subtract(t).add(n)}}(),getOrientationOffset:function(){var t=new c(0,0,1,0),e=new c(0,0,1,0),i=new l(0,0,0);return function(n,r,s){var o=this.getActiveViewpoint(),a=this.getStraightenHorizon();t.assign(n).multRight(o.getOrientation()).multRight(r),a&&"GeoViewpoint"!==o.getTypeName()&&o.straightenHorizon(t);var u=e.assign(o.getOrientation()).inverse().multRight(t);if(a&&"GeoViewpoint"!==o.getTypeName()){if(!s)return u;var c=t.multVecRot(i.assign(l.zAxis));if(Math.abs(o.getUpVector().dot(c))<.97)return u;throw new Error("Critical angle")}return u}}(),getHorizonRotation:function(){var t=new l(0,0,0);return function(e){var i=this.getActiveViewpoint(),n=e.multVecRot(t.assign(l.zAxis)).normalize(),r=l.cross(i.getUpVector(),n).normalize(),s=l.cross(r,i.getUpVector()).normalize();return new c(l.zAxis,s)}}(),disconnect:function(){var t=this.getBrowser();this.positionChaser.value_changed_.removeInterest("set_positionOffset__",this),this.centerOfRotationChaser.value_changed_.removeInterest("set_centerOfRotationOffset__",this),this.rotationChaser.value_changed_.removeInterest("set_rotation__",this),t.prepareEvents().removeInterest("spin",this)},dispose:function(){var e=this.getBrowser();this.disconnect(),e.activeViewpoint_.removeInterest("set_activeViewpoint__",this),e.getSurface().unbind(".ExamineViewer"),t(document).unbind(".ExamineViewer"+this.getId())}}),h}),define("x_ite/Browser/Navigation/WalkViewer",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Browser/Navigation/X3DFlyViewer","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4"],function(t,e,i,n,r,s,o){"use strict";function a(t){n.call(this,t)}return a.prototype=Object.assign(Object.create(n.prototype),{constructor:a,fieldDefinitions:new i([new e(r.outputOnly,"isActive",new t.SFBool)]),initialize:function(){n.prototype.initialize.call(this),this.getBrowser().addCollision(this)},getStraightenHorizon:function(){return!0},getFlyDirection:function(t,e,i){return i.assign(e).subtract(t)},getTranslationOffset:function(){var t=new s(0,0,0),e=new o(0,0,1,0),i=new o(0,0,1,0);return function(n){var r=this.getActiveViewpoint(),o=r.getUpVector();return e.assign(r.getUserOrientation()),e.multVecRot(t.assign(s.yAxis)),i.setFromToVec(t,o),e.multRight(i).multVecRot(n)}}(),constrainPanDirection:function(t){return t.y<0&&(t.y=0),t},dispose:function(){this.getBrowser().removeCollision(this),n.prototype.dispose.call(this)}}),a}),define("x_ite/Browser/Navigation/FlyViewer",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Bits/X3DConstants","x_ite/Browser/Navigation/X3DFlyViewer","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4"],function(t,e,i,n,r,s,o){"use strict";function a(t){r.call(this,t)}return a.prototype=Object.assign(Object.create(r.prototype),{constructor:a,fieldDefinitions:new i([new e(n.outputOnly,"isActive",new t.SFBool)]),addCollision:function(){this.getBrowser().addCollision(this)},removeCollision:function(){this.getBrowser().removeCollision(this)},getFlyDirection:function(t,e,i){return i.assign(e).subtract(t)},getTranslationOffset:function(t){return this.getActiveViewpoint().getUserOrientation().multVecRot(t)},constrainPanDirection:function(t){return t}}),a}),define("x_ite/Browser/Navigation/PlaneViewer",["jquery","x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Bits/X3DConstants","x_ite/Browser/Navigation/X3DViewer","x_ite/Components/Navigation/Viewpoint","standard/Math/Numbers/Vector3","jquery-mousewheel"],function(t,e,i,n,r,s,o,a){"use strict";function u(t){s.call(this,t),this.button=-1,this.fromPoint=new a(0,0,0),this.toPoint=new a(0,0,0)}var l=/Mac OS X/i.test(navigator.userAgent),c=l?1/160:.05,h=new a(0,0,0),d=new a(0,0,0),p=new a(0,0,0);return u.prototype=Object.assign(Object.create(s.prototype),{constructor:u,fieldDefinitions:new n([new i(r.outputOnly,"isActive",new e.SFBool)]),initialize:function(){s.prototype.initialize.call(this);var t=this.getBrowser(),e=t.getSurface();e.bind("mousedown.PlaneViewer",this.mousedown.bind(this)),e.bind("mouseup.PlaneViewer",this.mouseup.bind(this)),e.bind("mousemove.PlaneViewer",this.mousemove.bind(this)),e.bind("mousewheel.PlaneViewer",this.mousewheel.bind(this))},mousedown:function(e){if(!(this.button>=0)){var i=this.getBrowser().getSurface().offset(),n=e.pageX-i.left,r=e.pageY-i.top;switch(this.getButton(e.button)){case 1:e.preventDefault(),e.stopImmediatePropagation(),this.button=e.button,this.getBrowser().getSurface().unbind("mousemove.PlaneViewer"),t(document).bind("mouseup.PlaneViewer"+this.getId(),this.mouseup.bind(this)),t(document).bind("mousemove.PlaneViewer"+this.getId(),this.mousemove.bind(this)),this.getActiveViewpoint().transitionStop(),this.getBrowser().setCursor("MOVE"),this.getPointOnCenterPlane(n,r,this.fromPoint),this.isActive_=!0}}},mouseup:function(e){e.preventDefault(),e.stopImmediatePropagation(),e.button===this.button&&(this.button=-1,t(document).unbind(".PlaneViewer"+this.getId()),this.getBrowser().getSurface().bind("mousemove.PlaneViewer",this.mousemove.bind(this)),this.getBrowser().setCursor("DEFAULT"),this.isActive_=!1)},mousemove:function(t){var e=this.getBrowser().getSurface().offset(),i=t.pageX-e.left,n=t.pageY-e.top;switch(this.getButton(this.button)){case 1:t.preventDefault(),t.stopImmediatePropagation();var r=this.getActiveViewpoint(),s=this.getPointOnCenterPlane(i,n,this.toPoint),o=r.getUserOrientation().multVecRot(this.fromPoint.subtract(s));r.positionOffset_=d.assign(r.positionOffset_.getValue()).add(o),r.centerOfRotationOffset_=p.assign(r.centerOfRotationOffset_.getValue()).add(o),this.fromPoint.assign(s)}},mousewheel:function(t){t.preventDefault(),t.stopImmediatePropagation();var e=this.getBrowser().getSurface().offset(),i=t.pageX-e.left,n=t.pageY-e.top,r=this.getActiveViewpoint(),s=this.getPointOnCenterPlane(i,n,this.fromPoint);r.transitionStop(),t.deltaY>0?r.fieldOfViewScale_=Math.max(1e-5,r.fieldOfViewScale_.getValue()*(1-c)):t.deltaY<0&&(r.fieldOfViewScale_=r.fieldOfViewScale_.getValue()*(1+c),this.constrainFieldOfViewScale()),r.set_fieldOfView___&&r.set_fieldOfView___();var o=this.getPointOnCenterPlane(i,n,this.toPoint),a=r.getUserOrientation().multVecRot(h.assign(s).subtract(o));r.positionOffset_=d.assign(r.positionOffset_.getValue()).add(a),r.centerOfRotationOffset_=p.assign(r.centerOfRotationOffset_.getValue()).add(a)},constrainFieldOfViewScale:function(){var t=this.getActiveViewpoint()
|
|
28
|
+
;(t instanceof o||"GeoViewpoint"===t.getTypeName())&&t.fieldOfView_.getValue()*t.fieldOfViewScale_.getValue()>=Math.PI&&(t.fieldOfViewScale_=(Math.PI-.001)/t.fieldOfView_.getValue())},dispose:function(){this.getBrowser().getSurface().unbind(".PlaneViewer"),t(document).unbind(".PlaneViewer"+this.getId())}}),u}),define("x_ite/Browser/Navigation/NoneViewer",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Bits/X3DConstants","x_ite/Browser/Navigation/X3DViewer"],function(t,e,i,n,r){"use strict";function s(t){r.call(this,t)}return s.prototype=Object.assign(Object.create(r.prototype),{constructor:s,fieldDefinitions:new i([new e(n.outputOnly,"isActive",new t.SFBool)])}),s}),define("x_ite/Browser/Navigation/LookAtViewer",["jquery","x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Bits/X3DConstants","x_ite/Browser/Navigation/X3DViewer","x_ite/Components/Followers/PositionChaser","x_ite/Components/Followers/OrientationChaser","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4"],function(t,e,i,n,r,s,o,a,u,l,c){"use strict";function h(t){s.call(this,t),this.button=-1,this.fromVector=new l(0,0,0),this.toVector=new l(0,0,0),this.touch1=new u(0,0),this.touch2=new u(0,0),this.tapStart=0,this.dblTapInterval=.4,this.positionChaser=new o(t),this.centerOfRotationChaser=new o(t),this.orientationChaser=new a(t)}var d=/Mac OS X/i.test(navigator.userAgent),p=d?1/120:.05;return h.prototype=Object.assign(Object.create(s.prototype),{constructor:h,fieldDefinitions:new n([new i(r.outputOnly,"isActive",new e.SFBool)]),initialize:function(){s.prototype.initialize.call(this);var t=this.getBrowser(),e=t.getSurface();e.bind("mousedown.LookAtViewer",this.mousedown.bind(this)),e.bind("mouseup.LookAtViewer",this.mouseup.bind(this)),e.bind("dblclick.LookAtViewer",this.dblclick.bind(this)),e.bind("mousewheel.LookAtViewer",this.mousewheel.bind(this)),e.bind("touchstart.LookAtViewer",this.touchstart.bind(this)),e.bind("touchend.LookAtViewer",this.touchend.bind(this)),this.positionChaser.duration_=.3,this.positionChaser.setPrivate(!0),this.positionChaser.setup(),this.centerOfRotationChaser.duration_=.3,this.centerOfRotationChaser.setPrivate(!0),this.centerOfRotationChaser.setup(),this.orientationChaser.duration_=.3,this.orientationChaser.setPrivate(!0),this.orientationChaser.setup()},mousedown:function(e){if(!(this.button>=0)){var i=this.getBrowser().getSurface().offset(),n=e.pageX-i.left,r=e.pageY-i.top;switch(e.button){case 0:e.preventDefault(),e.stopImmediatePropagation(),this.button=e.button,t(document).bind("mouseup.LookAtViewer"+this.getId(),this.mouseup.bind(this)),t(document).bind("mousemove.LookAtViewer"+this.getId(),this.mousemove.bind(this)),t(document).bind("touchend.LookAtViewer"+this.getId(),this.mouseup.bind(this)),t(document).bind("touchmove.LookAtViewer"+this.getId(),this.touchmove.bind(this)),this.getActiveViewpoint().transitionStop(),this.trackballProjectToSphere(n,r,this.fromVector),this.isActive_=!0}}},mouseup:function(e){if(e.button===this.button)switch(this.button=-1,t(document).unbind(".LookAtViewer"+this.getId()),e.button){case 0:e.preventDefault(),e.stopImmediatePropagation(),this.isActive_=!1}},dblclick:function(t){t.preventDefault(),t.stopImmediatePropagation();var e=this.getBrowser().getSurface(),i=e.offset(),n=t.pageX-i.left-parseFloat(e.css("borderLeftWidth")),r=e.innerHeight()-(t.pageY-i.top-parseFloat(e.css("borderTopWidth")));this.disconnect(),this.lookAtPoint(n,r,this.getStraightenHorizon())},mousemove:function(t){this.getBrowser().addBrowserEvent(),this.event=t;var e=this.getBrowser().getSurface().offset(),i=t.pageX-e.left,n=t.pageY-e.top;switch(this.button){case 0:t.preventDefault(),t.stopImmediatePropagation();var r=this.trackballProjectToSphere(i,n,this.toVector);this.addRotation(this.fromVector,r),this.fromVector.assign(r)}},mousewheel:function(){var t=new l(0,0,0),e=new l(0,0,0);return function(i){i.preventDefault(),i.stopImmediatePropagation();var n=this.getActiveViewpoint();n.transitionStop(),t=this.getDistanceToCenter(t).multiply(i.zoomFactor||p),e=n.getUserOrientation().multVecRot(e.set(0,0,t.abs())),i.deltaY>0?this.addMove(e.negate(),l.Zero):i.deltaY<0&&this.addMove(e,l.Zero)}}(),touchstart:function(t){var e=t.originalEvent.touches;switch(e.length){case 1:this.touch1.set(e[0].pageX,e[0].pageY);break;case 2:this.touchend(t),t.button=0,t.pageX=(e[0].pageX+e[1].pageX)/2,t.pageY=(e[0].pageY+e[1].pageY)/2,this.mousedown(t),this.touch1.set(e[0].pageX,e[0].pageY),this.touch2.set(e[1].pageX,e[1].pageY);break;case 3:this.touchend(t)}},touchend:function(t){switch(this.button){case 0:this.mouseup(t)}this.getBrowser().getCurrentTime()-this.tapStart<this.dblTapInterval&&(t.button=1,t.pageX=this.touch1.x,t.pageY=this.touch1.y,this.dblclick(t)),this.tapStart=this.getBrowser().getCurrentTime()},touchmove:function(){var e=new u(0,0),i=new u(0,0);return function(n){var r=n.originalEvent.touches;switch(r.length){case 1:break;case 2:e.set(r[0].pageX,r[0].pageY).subtract(this.touch1).normalize(),i.set(r[1].pageX,r[1].pageY).subtract(this.touch2).normalize();var s=e.dot(i)>.7,o=e.dot(i)<-.7;if(s)n.button=0,n.pageX=(r[0].pageX+r[1].pageX)/2,n.pageY=(r[0].pageY+r[1].pageY)/2,this.mousemove(n);else if(o){var a=this.touch1.distance(this.touch2);this.touch1.set(r[0].pageX,r[0].pageY),this.touch2.set(r[1].pageX,r[1].pageY);var u=this.touch1.distance(this.touch2),l=u-a;n.deltaY=l,n.zoomFactor=Math.abs(l)/t(window).width(),this.mousewheel(n)}this.touch1.set(r[0].pageX,r[0].pageY),this.touch2.set(r[1].pageX,r[1].pageY)}}}(),set_positionOffset__:function(t){this.getActiveViewpoint().positionOffset_=t},set_centerOfRotationOffset__:function(t){this.getActiveViewpoint().centerOfRotationOffset_=t},set_orientationOffset__:function(t){this.getActiveViewpoint().orientationOffset_=t},addMove:function(){var t=new l(0,0,0),e=new l(0,0,0);return function(i,n){var r=this.getActiveViewpoint();this.positionChaser.isActive_.getValue()&&this.positionChaser.value_changed_.hasInterest("set_positionOffset__",this)?(t.assign(this.positionChaser.set_destination_.getValue()).add(i),this.positionChaser.set_destination_=t):(t.assign(r.positionOffset_.getValue()).add(i),this.positionChaser.set_value_=r.positionOffset_,this.positionChaser.set_destination_=t),this.centerOfRotationChaser.isActive_.getValue()&&this.centerOfRotationChaser.value_changed_.hasInterest("set_centerOfRotationOffset__",this)?(e.assign(this.centerOfRotationChaser.set_destination_.getValue()).add(n),this.centerOfRotationChaser.set_destination_=e):(e.assign(r.centerOfRotationOffset_.getValue()).add(n),this.centerOfRotationChaser.set_value_=r.centerOfRotationOffset_,this.centerOfRotationChaser.set_destination_=e),this.disconnect(),this.positionChaser.value_changed_.addInterest("set_positionOffset__",this),this.centerOfRotationChaser.value_changed_.addInterest("set_centerOfRotationOffset__",this)}}(),addRotation:function(){var t=new c(0,0,1,0),e=new c(0,0,1,0);return function(i,n){var r=this.getActiveViewpoint();this.orientationChaser.isActive_.getValue()&&this.orientationChaser.value_changed_.hasInterest("set_orientationOffset__",this)?(t.setFromToVec(n,i).multRight(r.getOrientation()).multRight(this.orientationChaser.set_destination_.getValue()),r.straightenHorizon(t),e.assign(r.getOrientation()).inverse().multRight(t),this.orientationChaser.set_destination_=e):(t.setFromToVec(n,i).multRight(r.getUserOrientation()),r.straightenHorizon(t),e.assign(r.getOrientation()).inverse().multRight(t),this.orientationChaser.set_value_=r.orientationOffset_,this.orientationChaser.set_destination_=e),this.disconnect(),this.orientationChaser.value_changed_.addInterest("set_orientationOffset__",this)}}(),disconnect:function(){this.orientationChaser.value_changed_.removeInterest("set_orientationOffset__",this),this.positionChaser.value_changed_.removeInterest("set_positionOffset__",this),this.centerOfRotationChaser.value_changed_.removeInterest("set_centerOfRotationOffset__",this)},dispose:function(){this.getBrowser().getSurface().unbind(".LookAtViewer"),t(document).unbind(".LookAtViewer"+this.getId())}}),h}),define("x_ite/Components/Lighting/X3DLightNode",["x_ite/Components/Core/X3DChildNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Matrix4","standard/Math/Algorithm"],function(t,e,i,n){"use strict";function r(i){t.call(this,i),this.addType(e.X3DLightNode)}return r.prototype=Object.assign(Object.create(t.prototype),{constructor:r,initialize:function(){t.prototype.initialize.call(this),this.on_.addInterest("set_on__",this),this.intensity_.addInterest("set_on__",this),this.set_on__()},set_on__:function(){this.on_.getValue()&&this.getIntensity()>0?(delete this.push,delete this.pop):(this.push=Function.prototype,this.pop=Function.prototype)},getGlobal:function(){return this.global_.getValue()},getColor:function(){return this.color_.getValue()},getIntensity:function(){return Math.max(this.intensity_.getValue(),0)},getAmbientIntensity:function(){return n.clamp(this.ambientIntensity_.getValue(),0,1)},getDirection:function(){return this.direction_.getValue()},getShadows:function(){return this.shadows_.getValue()},getShadowColor:function(){return this.shadowColor_.getValue()},getShadowIntensity:function(){return this.getShadows()?n.clamp(this.shadowIntensity_.getValue(),0,1):0},getShadowBias:function(){return n.clamp(this.shadowBias_.getValue(),0,1)},getShadowMapSize:function(){return Math.min(this.shadowMapSize_.getValue(),this.getBrowser().getMaxTextureSize())},getBiasMatrix:function(){const t=new i(.5,0,0,0,0,.5,0,0,0,0,.5,0,.5,.5,.5,1);return function(){return t}}(),push:function(t,e){if(t.isIndependent()){const i=this.getLights().pop();this.global_.getValue()?(i.set(t.getBrowser(),this,t.getLayer().getGroup(),t.getModelViewMatrix().get()),t.getGlobalObjects().push(i),t.getLights().push(i)):(i.set(t.getBrowser(),this,e,t.getModelViewMatrix().get()),t.getLocalObjects().push(i),t.getLights().push(i))}else{const e=t.getLightContainer();this.global_.getValue()?(e.getModelViewMatrix().pushMatrix(t.getModelViewMatrix().get()),t.getGlobalObjects().push(e),t.getLights().push(e)):(e.getModelViewMatrix().pushMatrix(t.getModelViewMatrix().get()),t.getLocalObjects().push(e),t.getLights().push(e))}t.pushShadow(this.getShadowIntensity())},pop:function(t){this.global_.getValue()||(t.isIndependent()?t.getBrowser().getLocalObjects().push(t.getLocalObjects().pop()):t.getLocalObjects().pop(),t.popShadow())}}),r}),define("x_ite/Components/Lighting/DirectionalLight",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Lighting/X3DLightNode","x_ite/Components/Grouping/X3DGroupingNode","x_ite/Bits/TraverseType","x_ite/Bits/X3DConstants","standard/Math/Geometry/Box3","standard/Math/Geometry/Camera","standard/Math/Geometry/ViewVolume","standard/Math/Numbers/Vector3","standard/Math/Numbers/Vector4","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4","standard/Math/Utility/MatrixStack","standard/Utility/ObjectCache"],function(t,e,i,n,r,s,o,a,u,l,c,h,d,p,f,g){"use strict";function m(){this.direction=new c(0,0,0),this.shadowBuffer=null,this.bbox=new a,this.viewVolume=new l,this.viewport=new h(0,0,0,0),this.projectionMatrix=new p,this.modelViewMatrix=new f(p),this.modelMatrix=new p,this.invLightSpaceMatrix=new p,this.invLightSpaceProjectionMatrix=new p,this.shadowMatrix=new p,this.shadowMatrixArray=new Float32Array(16),this.rotation=new d,this.textureUnit=0}function _(t){n.call(this,t),this.addType(o.DirectionalLight),"2.0"===t.getSpecificationVersion()&&(this.global_=!0)}var x=g(m);return m.prototype={constructor:m,getModelViewMatrix:function(){return this.modelViewMatrix},set:function(t,e,i,n){var r=t.getContext(),s=e.getShadowMapSize();this.browser=t,this.lightNode=e,this.groupNode=i,this.modelViewMatrix.pushMatrix(n),e.getShadowIntensity()>0&&s>0&&(this.shadowBuffer=t.popShadowBuffer(s),this.shadowBuffer?t.getCombinedTextureUnits().length?(this.textureUnit=t.getCombinedTextureUnits().pop(),r.activeTexture(r.TEXTURE0+this.textureUnit),r.getVersion()>=2||t.getExtension("WEBGL_depth_texture")?r.bindTexture(r.TEXTURE_2D,this.shadowBuffer.getDepthTexture()):r.bindTexture(r.TEXTURE_2D,this.shadowBuffer.getColorTexture()),r.activeTexture(r.TEXTURE0)):console.warn("Not enough combined texture units for shadow map available."):console.warn("Couldn't create shadow buffer."))},renderShadowMap:function(t){try{if(!this.shadowBuffer)return;var e=this.lightNode,i=t.getCameraSpaceMatrix().get(),n=this.modelMatrix.assign(this.modelViewMatrix.get()).multRight(i),o=this.invLightSpaceMatrix.assign(e.getGlobal()?n:p.Identity);o.rotate(this.rotation.setFromToVec(c.zAxis,this.direction.assign(e.getDirection()).negate())),o.inverse();var a=this.groupNode.getSubBBox(this.bbox,!0),l=a.multRight(o),h=e.getShadowMapSize(),d=this.viewport.set(0,0,h,h),f=u.orthoBox(l,this.projectionMatrix);this.shadowBuffer.bind(),t.getViewVolumes().push(this.viewVolume.set(f,d,d)),t.getProjectionMatrix().pushMatrix(f),t.getModelViewMatrix().pushMatrix(o),t.render(s.SHADOW,r.prototype.traverse,this.groupNode),t.getModelViewMatrix().pop(),t.getProjectionMatrix().pop(),t.getViewVolumes().pop(),this.shadowBuffer.unbind(),e.getGlobal()||o.multLeft(n.inverse()),this.invLightSpaceProjectionMatrix.assign(o).multRight(f).multRight(e.getBiasMatrix())}catch(t){console.log(t)}},setGlobalVariables:function(t){this.modelViewMatrix.get().multDirMatrix(this.direction.assign(this.lightNode.getDirection())).normalize(),this.shadowMatrix.assign(t.getCameraSpaceMatrix().get()).multRight(this.invLightSpaceProjectionMatrix),this.shadowMatrixArray.set(this.shadowMatrix)},setShaderUniforms:function(t,e){var i=e.numLights++;if(!e.hasLight(i,this)){var n=this.lightNode,r=n.getColor(),s=this.direction;if(t.uniform1i(e.x3d_LightType[i],1),t.uniform3f(e.x3d_LightColor[i],r.r,r.g,r.b),t.uniform1f(e.x3d_LightIntensity[i],n.getIntensity()),t.uniform1f(e.x3d_LightAmbientIntensity[i],n.getAmbientIntensity()),t.uniform3f(e.x3d_LightDirection[i],s.x,s.y,s.z),this.textureUnit){var o=n.getShadowColor();t.uniform3f(e.x3d_ShadowColor[i],o.r,o.g,o.b),t.uniform1f(e.x3d_ShadowIntensity[i],n.getShadowIntensity()),t.uniform1f(e.x3d_ShadowBias[i],n.getShadowBias()),t.uniformMatrix4fv(e.x3d_ShadowMatrix[i],!1,this.shadowMatrixArray),t.uniform1i(e.x3d_ShadowMapSize[i],n.getShadowMapSize()),t.uniform1i(e.x3d_ShadowMap[i],this.textureUnit)}else t.uniform1f(e.x3d_ShadowIntensity[i],0)}},dispose:function(){this.textureUnit&&this.browser.getCombinedTextureUnits().push(this.textureUnit),this.browser.pushShadowBuffer(this.shadowBuffer),this.modelViewMatrix.clear(),this.browser=null,this.lightNode=null,this.groupNode=null,this.shadowBuffer=null,this.textureUnit=0,x.push(this)}},_.prototype=Object.assign(Object.create(n.prototype),{constructor:_,fieldDefinitions:new i([new e(o.inputOutput,"metadata",new t.SFNode),new e(o.inputOutput,"global",new t.SFBool(!1)),new e(o.inputOutput,"on",new t.SFBool(!0)),new e(o.inputOutput,"color",new t.SFColor(1,1,1)),new e(o.inputOutput,"intensity",new t.SFFloat(1)),new e(o.inputOutput,"ambientIntensity",new t.SFFloat),new e(o.inputOutput,"direction",new t.SFVec3f(0,0,-1)),new e(o.inputOutput,"shadows",new t.SFBool),new e(o.inputOutput,"shadowColor",new t.SFColor),new e(o.inputOutput,"shadowIntensity",new t.SFFloat(1)),new e(o.inputOutput,"shadowBias",new t.SFFloat(.005)),new e(o.initializeOnly,"shadowMapSize",new t.SFInt32(1024))]),getTypeName:function(){return"DirectionalLight"},getComponentName:function(){return"Lighting"},getContainerField:function(){return"children"},getLights:function(){return x}}),_}),define("x_ite/Browser/Navigation/X3DNavigationContext",["x_ite/Fields","x_ite/Browser/Navigation/ExamineViewer","x_ite/Browser/Navigation/WalkViewer","x_ite/Browser/Navigation/FlyViewer","x_ite/Browser/Navigation/PlaneViewer","x_ite/Browser/Navigation/NoneViewer","x_ite/Browser/Navigation/LookAtViewer","x_ite/Components/Lighting/DirectionalLight","standard/Math/Numbers/Matrix4"],function(t,e,i,n,r,s,o,a,u){"use strict";function l(t){var e=new a(t.getPrivateScene());e.setup();var i=e.getLights().pop();return i.set(t,e,null,u.Identity),i.dispose=function(){},i}function c(){this.addChildObjects("activeLayer",new t.SFNode,"activeNavigationInfo",new t.SFNode,"activeViewpoint",new t.SFNode,"availableViewers",new t.MFString,"viewer",new t.SFString("EXAMINE")),this.activeCollisions=new Set,this.viewerNode=new s(this)}return c.prototype={initialize:function(){this.viewer_.addInterest("set_viewer__",this),this.initialized().addInterest("set_world__",this),this.shutdown().addInterest("remove_world__",this),this.headlightContainer=l(this),this.viewerNode.setup()},getHeadlight:function(){return this.headlightContainer},getActiveLayer:function(){return this.activeLayer_.getValue()},getActiveNavigationInfo:function(){return this.activeNavigationInfo_.getValue()},getActiveViewpoint:function(){return this.activeViewpoint_.getValue()},getCurrentViewer:function(){return this.viewer_.getValue()},getViewer:function(){return this.viewerNode},addCollision:function(t){this.activeCollisions.add(t)},removeCollision:function(t){this.activeCollisions.delete(t)},getCollisionCount:function(){return this.activeCollisions.size},remove_world__:function(){this.getWorld().activeLayer_.removeInterest("set_activeLayer__",this)},set_world__:function(){this.getWorld().activeLayer_.addInterest("set_activeLayer__",this),this.set_activeLayer__()},set_activeLayer__:function(){this.activeLayer_.getValue()&&(this.activeLayer_.getValue().getNavigationInfoStack().removeInterest("set_activeNavigationInfo__",this),this.activeLayer_.getValue().getViewpointStack().removeInterest("set_activeViewpoint__",this)),this.activeLayer_=this.getWorld().getActiveLayer(),this.activeLayer_.getValue()&&(this.activeLayer_.getValue().getNavigationInfoStack().addInterest("set_activeNavigationInfo__",this),this.activeLayer_.getValue().getViewpointStack().addInterest("set_activeViewpoint__",this)),this.set_activeNavigationInfo__(),this.set_activeViewpoint__()},set_activeNavigationInfo__:function(){this.activeNavigationInfo_.getValue()&&this.activeNavigationInfo_.getValue().viewer_.removeFieldInterest(this.viewer_),this.activeLayer_.getValue()?(this.activeNavigationInfo_=this.activeLayer_.getValue().getNavigationInfo(),this.activeNavigationInfo_.getValue().viewer_.addFieldInterest(this.viewer_),this.viewer_=this.activeNavigationInfo_.getValue().viewer_):(this.activeNavigationInfo_=null,this.viewer_="NONE")},set_activeViewpoint__:function(){this.activeLayer_.getValue()?this.activeViewpoint_=this.activeLayer_.getValue().getViewpoint():this.activeViewpoint_=null},set_viewer__:function(t){switch(this.activeNavigationInfo_.getValue()?this.availableViewers_=this.activeNavigationInfo_.getValue().availableViewers_:this.availableViewers_.length=0,this.viewerNode&&this.viewerNode.dispose(),t.getValue()){case"EXAMINE":this.viewerNode=new e(this);break;case"WALK":this.viewerNode=new i(this);break;case"FLY":this.viewerNode=new n(this);break;case"PLANE":case"PLANE_create3000.de":this.viewerNode=new r(this);break;case"NONE":this.viewerNode=new s(this);break;case"LOOKAT":this.viewerNode=new o(this);break;default:this.viewerNode=new e(this)}this.viewerNode.setup()}},c}),define("x_ite/Components/Layering/Viewport",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Layering/X3DViewportNode","x_ite/Bits/X3DConstants","x_ite/Bits/TraverseType","standard/Utility/ObjectCache","standard/Math/Geometry/ViewVolume","standard/Math/Numbers/Vector4"],function(t,e,i,n,r,s,o,a,u){"use strict";function l(t){n.call(this,t),this.addType(r.Viewport),this.rectangle=new u(0,0,0,0)}const c=o(a);return l.prototype=Object.assign(Object.create(n.prototype),{constructor:l,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"clipBoundary",new t.MFFloat(0,1,0,1)),new e(r.inputOutput,"visible",new t.SFBool(!0)),new e(r.inputOutput,"bboxDisplay",new t.SFBool),new e(r.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new e(r.initializeOnly,"bboxCenter",new t.SFVec3f),new e(r.inputOnly,"addChildren",new t.MFNode),new e(r.inputOnly,"removeChildren",new t.MFNode),new e(r.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"Viewport"},getComponentName:function(){return"Layering"},getContainerField:function(){return"viewport"},getRectangle:function(t){const e=t.getViewport(),i=Math.floor(e[2]*this.getLeft()),n=Math.floor(e[2]*this.getRight()),r=Math.floor(e[3]*this.getBottom()),s=Math.floor(e[3]*this.getTop());return this.rectangle.set(i,r,Math.max(0,n-i),Math.max(0,s-r)),this.rectangle},getLeft:function(){return this.clipBoundary_.length>0?this.clipBoundary_[0]:0},getRight:function(){return this.clipBoundary_.length>1?this.clipBoundary_[1]:1},getBottom:function(){return this.clipBoundary_.length>2?this.clipBoundary_[2]:0},getTop:function(){return this.clipBoundary_.length>3?this.clipBoundary_[3]:1},traverse:function(t,e){switch(this.push(e),t){case s.POINTER:e.getBrowser().isPointerInRectangle(this.rectangle)&&n.prototype.traverse.call(this,t,e);break;default:n.prototype.traverse.call(this,t,e)}this.pop(e)},push:function(t){const e=t.getViewVolumes(),i=this.getRectangle(t.getBrowser()),n=e.length?e.at(-1).getViewport():i,r=c.pop();r.set(t.getProjectionMatrix().get(),n,i),e.push(r)},pop:function(t){c.push(t.getViewVolumes().pop())}}),l}),define("x_ite/Browser/Layering/X3DLayeringContext",["x_ite/Components/Layering/Viewport"],function(t){"use strict";function e(){this.defaultViewport=new t(this.getPrivateScene())}return e.prototype={initialize:function(){this.defaultViewport.setup()},getDefaultViewport:function(){return this.defaultViewport}},e}),define("x_ite/Browser/EnvironmentalEffects/X3DEnvironmentalEffectsContext",["x_ite/Components/Texturing/TextureProperties"],function(t){"use strict";function e(){}return e.prototype={initialize:function(){},getBackgroundSphereShader:function(){return this.backgroundSphereShader=this.createShader("BackgroundSphereShader","Background"),this.getBackgroundSphereShader=function(){return this.backgroundSphereShader},this.backgroundSphereShader},getBackgroundTextureProperties:function(){return this.backgroundTextureProperties=new t(this.getPrivateScene()),this.backgroundTextureProperties.boundaryModeS_="CLAMP_TO_EDGE",this.backgroundTextureProperties.boundaryModeT_="CLAMP_TO_EDGE",this.backgroundTextureProperties.boundaryModeR_="CLAMP_TO_EDGE",this.backgroundTextureProperties.minificationFilter_="NICEST",this.backgroundTextureProperties.magnificationFilter_="NICEST",this.backgroundTextureProperties.setup(),this.getBackgroundTextureProperties=function(){return this.backgroundTextureProperties},this.backgroundTextureProperties}},e}),define("x_ite/Browser/Lighting/X3DLightingContext",["x_ite/Rendering/TextureBuffer"],function(t){"use strict";function e(){var t=this.getContext(),e=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS);this.maxLights=e>16?8:e>8?4:2,this.shadowBuffers=[]}return e.prototype={initialize:function(){},getMaxLights:function(){return this.maxLights},popShadowBuffer:function(e){try{var i=this.shadowBuffers[e];if(i){if(i.length)return i.pop()}else this.shadowBuffers[e]=[];return new t(this,e,e)}catch(t){return console.log(t),null}},pushShadowBuffer:function(t){t&&this.shadowBuffers[t.getWidth()].push(t)}},e}),define("x_ite/Browser/Picking/X3DPickingContext",["x_ite/Bits/TraverseType"],function(t){"use strict";function e(){this.transformSensorNodes=new Set,this.pickSensorNodes=[new Set],this.pickingHierarchy=[],this.pickable=[!1],this.pickingTime=0}return e.prototype={initialize:function(){},addTransformSensor:function(t){this.transformSensorNodes.add(t),this.enablePicking()},removeTransformSensor:function(t){this.transformSensorNodes.delete(t),this.enablePicking()},addPickSensor:function(t){this.pickSensorNodes[0].add(t),this.enablePicking()},removePickSensor:function(t){this.pickSensorNodes[0].delete(t),this.enablePicking()},getPickSensors:function(){return this.pickSensorNodes},getPickingHierarchy:function(){return this.pickingHierarchy},getPickable:function(){return this.pickable},enablePicking:function(){this.transformSensorNodes.size||this.pickSensorNodes[0].size?this.sensorEvents_.addInterest("picking",this):this.sensorEvents_.removeInterest("picking",this)},picking:function(){var e=performance.now();this.getWorld().traverse(t.PICKING,null),this.transformSensorNodes.forEach(function(t){t.process()}),this.pickSensorNodes[0].forEach(function(t){t.process()}),this.pickingTime=performance.now()-e}},e}),define("x_ite/Browser/Sound/X3DSoundContext",["x_ite/Fields"],function(t){"use strict";function e(){this.addChildObjects("volume",new t.SFFloat(1),"mute",new t.SFBool)}return e.prototype={initialize:function(){}},e}),define("x_ite/Browser/Text/TextAlignment",[],function(){"use strict";let t=0;return{BEGIN:++t,FIRST:++t,MIDDLE:++t,END:++t}}),define("x_ite/Components/Text/X3DFontStyleNode",["x_ite/Fields","x_ite/Components/Core/X3DNode","x_ite/Components/Networking/X3DUrlObject","x_ite/Browser/Text/TextAlignment","x_ite/InputOutput/FileLoader","x_ite/Bits/X3DConstants","x_ite/Browser/Networking/urls"],function(t,e,i,n,r,s,o){"use strict";function a(n){e.call(this,n),i.call(this,n),this.addType(s.X3DFontStyleNode),this.addChildObjects("url",new t.MFString,"autoRefresh",new t.SFTime,"autoRefreshTimeLimit",new t.SFTime(3600)),this.familyStack=[],this.alignments=[],this.loader=new r(this)}const u={SERIF:{PLAIN:o.getFontsUrl("DroidSerif-Regular.ttf"),ITALIC:o.getFontsUrl("DroidSerif-Italic.ttf"),BOLD:o.getFontsUrl("DroidSerif-Bold.ttf"),BOLDITALIC:o.getFontsUrl("DroidSerif-BoldItalic.ttf")},SANS:{PLAIN:o.getFontsUrl("Ubuntu-R.ttf"),ITALIC:o.getFontsUrl("Ubuntu-RI.ttf"),BOLD:o.getFontsUrl("Ubuntu-B.ttf"),BOLDITALIC:o.getFontsUrl("Ubuntu-BI.ttf")},TYPEWRITER:{PLAIN:o.getFontsUrl("UbuntuMono-R.ttf"),ITALIC:o.getFontsUrl("UbuntuMono-RI.ttf"),BOLD:o.getFontsUrl("UbuntuMono-B.ttf"),BOLDITALIC:o.getFontsUrl("UbuntuMono-BI.ttf")}};return a.prototype=Object.assign(Object.create(e.prototype),i.prototype,{constructor:a,initialize:function(){e.prototype.initialize.call(this),i.prototype.initialize.call(this),this.style_.addInterest("set_style__",this),this.justify_.addInterest("set_justify__",this),this.font=null,this.familyIndex=0,this.set_justify__(),this.set_style__(),this.requestImmediateLoad()},getMajorAlignment:function(){return this.alignments[0]},getMinorAlignment:function(){return this.alignments[1]},set_style__:function(){this.setLoadState(s.NOT_STARTED_STATE),this.requestImmediateLoad()},set_justify__:function(){const t=this.horizontal_.getValue()?this.leftToRight_.getValue():this.topToBottom_.getValue();this.alignments[0]=this.justify_.length>0?this.getAlignment(0,t):t?n.BEGIN:n.END;const e=this.horizontal_.getValue()?this.topToBottom_.getValue():this.leftToRight_.getValue();this.alignments[1]=this.justify_.length>1?this.getAlignment(1,e):e?n.FIRST:n.END},getAlignment:function(t,e){if(e)switch(this.justify_[t]){case"FIRST":return n.FIRST;case"BEGIN":return n.BEGIN;case"MIDDLE":return n.MIDDLE;case"END":return n.END}else switch(this.justify_[t]){case"FIRST":return n.END;case"BEGIN":return n.END;case"MIDDLE":return n.MIDDLE;case"END":return n.BEGIN}return t?n.FIRST:n.BEGIN},requestImmediateLoad:function(t=!0){if(this.checkLoadState()!==s.COMPLETE_STATE&&this.checkLoadState()!==s.IN_PROGRESS_STATE){this.setCache(t),this.setLoadState(s.IN_PROGRESS_STATE);const e=this.family_.copy();e.push("SERIF"),this.familyStack.length=0;for(const t of e)this.familyStack.push(this.getDefaultFont(t)||t);this.loadNext()}},getDefaultFont:function(t){const e=u[t];if(e)return e[this.style_.getValue()]||e.PLAIN},loadNext:function(){try{if(0===this.familyStack.length)return this.setLoadState(s.FAILED_STATE),void(this.font=null);this.family=this.familyStack.shift(),this.URL=new URL(this.family,this.loader.getReferer()),this.getBrowser().getBrowserOptions().getCache()&&this.getCache()||this.URL.searchParams.set("_",Date.now()),this.getBrowser().getFont(this.URL).done(this.setFont.bind(this)).fail(this.setError.bind(this))}catch(t){this.setError(t.message)}},setError:function(t){"data:"!==this.URL.protocol&&console.warn("Error loading font '"+this.URL.toString()+"':",t),this.loadNext()},setFont:function(t){this.font=t,this.setLoadState(s.COMPLETE_STATE),this.addNodeEvent()},getFont:function(){return this.font}}),a}),define("standard/Math/Geometry/Box2",["standard/Math/Numbers/Matrix3","standard/Math/Numbers/Vector2"],function(t,e){"use strict";function i(e,i){switch(arguments.length){case 0:return void(this.matrix=new t(0,0,0,0,0,0,0,0,0));case 2:return void(this.matrix=new t(e.x/2,0,0,0,e.y/2,0,i.x,i.y,1));case 3:{const e=arguments[0],i=arguments[1],n=(i.x-e.x)/2,r=(i.y-e.y)/2,s=(i.x+e.x)/2,o=(i.y+e.y)/2;return void(this.matrix=new t(n,0,0,0,r,0,s,o,1))}}}return i.prototype={constructor:i,copy:function(){const t=Object.create(i.prototype);return t.matrix=this.matrix.copy(),t},assign:function(t){return this.matrix.assign(t.matrix),this},equals:function(t){return this.matrix.equals(t.matrix)},set:function(t,e){const i=this.matrix;switch(arguments.length){case 0:return i[0]=.5,i[1]=0,i[2]=0,i[3]=0,i[4]=.5,i[5]=0,i[6]=0,i[7]=0,i[8]=0,this;case 2:return i[0]=t.x/2,i[1]=0,i[2]=0,i[3]=0,i[4]=t.y/2,i[5]=0,i[6]=e.x,i[7]=e.y,i[8]=1,this;case 3:{const t=arguments[0],e=arguments[1],i=(e.x-t.x)/2,n=(e.y-t.y)/2,r=(e.x+t.x)/2,s=(e.y+t.y)/2;return this.matrix.set(i,0,0,0,n,0,r,s,1),this}}},setExtents:function(t,e){const i=this.matrix,n=(e.x-t.x)/2,r=(e.y-t.y)/2,s=(e.x+t.x)/2,o=(e.y+t.y)/2;return i[0]=n,i[1]=0,i[2]=0,i[3]=0,i[4]=r,i[5]=0,i[6]=s,i[7]=o,i[8]=1,this},isEmpty:function(){return 0===this.matrix[8]},add:function(){const t=new e(0,0),i=new e(0,0),n=new e(0,0),r=new e(0,0);return function(e){return this.isEmpty()?this.assign(e):e.isEmpty()?this:(this.getExtents(t,i),e.getExtents(n,r),this.set(t.min(n),i.max(r),!0))}}(),multLeft:function(t){return this.matrix.multLeft(t),this},multRight:function(t){return this.matrix.multRight(t),this},getExtents:function(t,e){this.getAbsoluteExtents(t,e),t.add(this.center),e.add(this.center)},getAbsoluteExtents:function(){const t=new e(0,0);return function(e,i){const n=this.matrix,r=n.xAxis,s=n.yAxis;t.assign(r).add(s);const o=s.subtract(r);e.assign(t).min(o),i.assign(t).max(o),t.negate(),o.negate(),e.min(t,o),i.max(t,o)}}(),containsPoint:function(){const t=new e(0,0),i=new e(0,0);return function(e){return this.getExtents(t,i),t.x<=e.x&&i.x>=e.x&&t.y<=e.y&&i.y>=e.y}}(),toString:function(){return this.size+", "+this.center}},Object.defineProperty(i.prototype,"size",{get:function(){const t=new e(0,0),i=new e(0,0);return function(){return this.getAbsoluteExtents(t,i),i.subtract(t)}}(),enumerable:!0,configurable:!1}),Object.defineProperty(i.prototype,"center",{get:function(){return this.matrix.origin},enumerable:!0,configurable:!1}),i}),define("x_ite/Browser/Text/X3DTextGeometry",["x_ite/Browser/Text/TextAlignment","standard/Math/Geometry/Box2","standard/Math/Geometry/Box3","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3"],function(t,e,i,n,r){"use strict";function s(t,e){this.text=t,this.fontStyle=e,this.glyphs=[],this.minorAlignment=new n(0,0),this.translations=[],this.charSpacings=[],this.bearing=new n(0,0),this.yPad=[],this.bbox=new i}var o=new e,a=new e,u=new n(0,0),l=new n(0,0),c=new n(0,0),h=new n(0,0),d=new r(0,0,0),p=new r(0,0,0),f=new n(0,0),g=new n(0,0),m=new n(0,0),_=new n(0,0),x=new n(0,0),y=new r(0,0,0),v=new n(0,0),w=new e,b=new n(0,0),S=new r(0,0,0);return s.prototype={constructor:s,getBrowser:function(){return this.text.getBrowser()},getText:function(){return this.text},getFontStyle:function(){return this.fontStyle},getGlyphs:function(){return this.glyphs},getMinorAlignment:function(){return this.minorAlignment},
|
|
29
|
+
getTranslations:function(){return this.translations},getCharSpacings:function(){return this.charSpacings},getBearing:function(){return this.bearing},getBBox:function(){return this.bbox},update:function(){var t=this.text,e=this.fontStyle,i=t.string_.length;if(t.lineBounds_.length=i,this.glyphs.length=0,0===i||!e.getFont())return t.origin_.setValue(S),t.textBounds_.setValue(b),void this.bbox.set();if(e.horizontal_.getValue())this.resizeArray(this.translations,i),this.resizeArray(this.charSpacings,i),this.horizontal(t,e);else{for(var n=t.string_,r=0,s=0,o=n.length;s<o;++s)r+=n[s].length;this.resizeArray(this.translations,r),this.resizeArray(this.charSpacings,r),this.vertical(t,e)}},resizeArray:function(t,e){for(var i=t.length;i<e;++i)t.push(new n(0,0));t.length=e},horizontal:function(e,i){var n=i.getFont(),r=e.string_,s=r.length,a=Math.max(0,e.maxExtent_.getValue()),c=i.topToBottom_.getValue(),h=i.getScale(),_=i.spacing_.getValue();o.set();for(var v=c?0:s-1,b=c?s:-1,S=c?1:-1,C=v,T=0;C!==b;C+=S,++T){var F=r[C],O=this.getHorizontalLineExtents(i,F,u,l,T);f.assign(l).subtract(u);var N=0,E=e.getLength(C);switch(x.set(f.x*h,0==T?l.y-n.descender/n.unitsPerEm*h:_),a&&(E=E?Math.min(a,E):Math.min(a,f.x*h)),E&&(N=(E-x.x)/(O.length-1),x.x=E,f.x=E/h),this.charSpacings[T]=N,e.lineBounds_[C]=x,i.getMajorAlignment()){case t.BEGIN:case t.FIRST:this.translations[T].set(0,-T*_);break;case t.MIDDLE:this.translations[T].set(-u.x-f.x/2,-T*_);break;case t.END:this.translations[T].set(-u.x-f.x,-T*_)}this.translations[T].multiply(h),g.assign(u).add(m.assign(f).divide(2)),o.add(w.set(f.multiply(h),g.multiply(h).add(this.translations[T])))}switch(o.getExtents(u,l),f.assign(l).subtract(u),e.textBounds_=f,this.bearing.set(0,-l.y),i.getMinorAlignment()){case t.BEGIN:this.minorAlignment.assign(this.bearing);break;case t.FIRST:this.minorAlignment.set(0,0);break;case t.MIDDLE:this.minorAlignment.set(0,f.y/2-l.y);break;case t.END:this.minorAlignment.set(0,(s-1)*_*h)}u.add(this.minorAlignment),l.add(this.minorAlignment),e.origin_.setValue(y.set(u.x,l.y,0)),this.bbox.setExtents(d.set(u.x,u.y,0),p.set(l.x,l.y,0))},vertical:function(e,i){var r=i.getFont(),s=e.string_,h=s.length,b=Math.max(0,e.maxExtent_.getValue()),S=i.leftToRight_.getValue(),C=i.topToBottom_.getValue(),T=i.getScale(),F=i.spacing_.getValue(),O=this.yPad,N=this.getBrowser().getBrowserOptions().getPrimitiveQuality();o.set();for(var E=S?0:h-1,M=S?h:-1,D=S?1:-1,V=0,I=E;I!==M;I+=D){var B=this.stringToGlyphs(r,s[I],!0,I),A=V,P=B.length;a.set();for(var L=C?0:P-1,R=C?P:-1,k=C?1:-1,U=L;U!==R;U+=k,++V){var X=B[U];this.getGlyphExtents(r,X,N,u,l),f.assign(l).subtract(u);var j=C?U:P-U-1;this.translations[V].set((F-f.x-u.x)/2,-j),g.assign(u).add(m.assign(f).divide(2)).add(this.translations[V]),a.add(w.set(f,g))}a.getExtents(u,l),f.assign(l).subtract(u);var z=S?I:h-I-1,G=(F-f.x)/2,H=0,q=e.getLength(I);switch(x.set(0===I?F-G:F,P?f.y:0).multiply(T),b&&(q=q?Math.min(b,q):Math.min(b,f.y*T)),q&&(H=(q-x.y)/(B.length-1)/T,x.y=q,f.y=q/T,u.y=l.y-f.y),e.lineBounds_[I]=x,i.getMajorAlignment()){case t.BEGIN:case t.FIRST:_.set(z*F,-1);break;case t.MIDDLE:_.set(z*F,f.y/2-l.y);break;case t.END:P&&this.getGlyphExtents(r,B[C?P-1:0],N,c.assign(n.Zero),v),_.set(z*F,f.y-l.y+c.y)}for(var W=0,Y=A;Y<V;++Y)this.translations[Y].add(_),this.translations[Y].y-=W,this.translations[Y].multiply(T),W+=H;switch(i.getMajorAlignment()){case t.BEGIN:case t.FIRST:O[I]=l.y+_.y;break;case t.MIDDLE:O[I]=0;break;case t.END:O[I]=u.y+_.y}g.assign(u).add(m.assign(f).divide(2)),o.add(w.set(f.multiply(T),g.add(_).multiply(T)))}switch(o.getExtents(u,l),f.assign(l).subtract(u),i.getMajorAlignment()){case t.BEGIN:case t.FIRST:for(var $=e.lineBounds_,Z=0,q=$.length;Z<q;++Z)$[Z].y+=l.y-O[Z]*T;break;case t.MIDDLE:break;case t.END:for(var $=e.lineBounds_,Z=0,q=$.length;Z<q;++Z)$[Z].y+=O[Z]*T-u.y}switch(e.textBounds_=f,i.getMajorAlignment()){case t.BEGIN:case t.FIRST:this.bearing.set(-u.x,l.y);break;case t.MIDDLE:this.bearing.set(-u.x,0);break;case t.END:this.bearing.set(-u.x,u.y)}switch(i.getMinorAlignment()){case t.BEGIN:case t.FIRST:this.minorAlignment.set(-u.x,0);break;case t.MIDDLE:this.minorAlignment.set(-u.x-f.x/2,0);break;case t.END:this.minorAlignment.set(-u.x-f.x,0)}u.add(this.minorAlignment),l.add(this.minorAlignment),e.origin_.setValue(y.set(u.x,l.y,0)),this.bbox.set(d.set(u.x,u.y,0),p.set(l.x,l.y,0),!0)},stringToGlyphs:function(t,e,i,n){var r=this.glyphs[n];r||(r=this.glyphs[n]=[]),r.length=e.length;for(var s=i?0:e.length-1,o=i?e.length:-1,a=i?1:-1,u=s,l=0;u!==o;u+=a,++l)r[l]=t.charToGlyph(e[u]);return r},getHorizontalLineExtents:function(e,i,n,r,s){for(var o=e.getFont(),a=e.horizontal_.getValue()?e.leftToRight_.getValue():e.topToBottom_.getValue(),u=this.stringToGlyphs(o,i,a,s),l=this.getBrowser().getBrowserOptions().getPrimitiveQuality(),d=0,p=0,f=Number.POSITIVE_INFINITY,g=Number.NEGATIVE_INFINITY,m=0,_=u.length;m<_;++m){var x=u[m],y=m+1<_?o.getKerningValue(x,u[m+1]):0;this.getGlyphExtents(o,x,l,c,h),p+=x.advanceWidth+y,f=Math.min(f,c.y),g=Math.max(g,h.y)}switch(u.length?(this.getGlyphExtents(o,u[0],l,c,h),d=c.x):(f=0,g=0),n.set(d,f),r.set(p/o.unitsPerEm,g),e.getMajorAlignment()){case t.BEGIN:case t.FIRST:n.x=0}return u},traverse:function(t,e){}},s}),define("standard/Math/Algorithms/Bezier",["standard/Math/Algorithm"],function(t){"use strict";function e(t,e,i,n,r,s,o,a){this.x0=t,this.y0=e,this.x1=i,this.y1=n,this.x2=r,this.y2=s,this.x3=o,this.y3=a,this.order=arguments.length/2-1}function i(t,e,i,n,s,o,a){const u=r(t,i,a),l=r(e,n,a),c=r(i,s,a),h=r(n,o,a);return{x:r(u,c,a),y:r(l,h,a)}}function n(t,e,i,n,s,o,a,u,l){const c=r(t,i,l),h=r(e,n,l),d=r(i,s,l),p=r(n,o,l),f=r(s,a,l),g=r(o,u,l),m=r(c,d,l),_=r(h,p,l),x=r(d,f,l),y=r(p,g,l);return{x:r(m,x,l),y:r(_,y,l)}}const r=t.lerp;return e.prototype={getLUT:function(t){const e=this.x0,r=this.y0,s=this.x1,o=this.y1,a=this.x2,u=this.y2,l=this.x3,c=this.y3,h=[];switch(this.order){case 2:for(let n=0,l=t-1;n<t;++n)h.push(i(e,r,s,o,a,u,n/l));break;case 3:for(let i=0,d=t-1;i<t;++i)h.push(n(e,r,s,o,a,u,l,c,i/d))}return h}},e}),define("x_ite/Browser/Text/PolygonText",["x_ite/Browser/Core/PrimitiveQuality","x_ite/Browser/Text/X3DTextGeometry","x_ite/Components/Rendering/X3DGeometryNode","standard/Math/Numbers/Vector3","standard/Math/Numbers/Matrix4","standard/Math/Geometry/Triangle3","standard/Math/Algorithms/Bezier"],function(t,e,i,n,r,s,o){"use strict";function a(t,n){e.call(this,t,n),t.transparent_=!1,this.texCoordArray=i.createArray()}return a.prototype=Object.assign(Object.create(e.prototype),{constructor:a,getTransparent:function(){return!1},getMatrix:function(){return r.Identity},build:function(){var t=new n(0,0,0),e=new n(0,0,0);return function(){var i=this.getFontStyle(),n=i.getFont();if(n){var r=this.getText(),s=this.getGlyphs(),o=this.getMinorAlignment(),a=this.getTranslations(),u=this.getCharSpacings(),l=i.getScale(),c=i.spacing_.getValue(),h=r.origin_.getValue(),d=l/n.unitsPerEm,p=this.getBrowser().getBrowserOptions().getPrimitiveQuality(),f=this.texCoordArray,g=r.getNormals(),m=r.getVertices();if(r.getMultiTexCoords().push(f),this.getBBox().getExtents(t,e),r.getMin().assign(t),r.getMax().assign(e),i.horizontal_.getValue())for(var _=0,x=s.length;_<x;++_)for(var y=s[_],v=u[_],w=a[_],b=0,S=0,C=y.length;S<C;++S){for(var T=y[S],F=this.getGlyphGeometry(n,T,p),O=o.x+w.x+b+S*v,N=o.y+w.y,E=0,M=F.length;E<M;++E){var D=F[E].x*l+O,V=F[E].y*l+N;f.push((D-h.x)/c,(V-h.y)/c,0,1),g.push(0,0,1),m.push(D,V,0,1)}var I=0;S+1<y.length&&(I=n.getKerningValue(T,y[S+1])),b+=(T.advanceWidth+I)*d}else for(var B=i.leftToRight_.getValue(),A=i.topToBottom_.getValue(),P=B?0:r.string_.length-1,L=B?r.string_.length:-1,R=B?1:-1,_=P,k=0;_!==L;_+=R)for(var y=s[_],U=y.length,X=A?0:U-1,j=A?U:-1,z=A?1:-1,S=X;S!==j;S+=z,++k)for(var w=a[k],F=this.getGlyphGeometry(n,y[S],p),E=0,M=F.length;E<M;++E){var D=F[E].x*l+o.x+w.x,V=F[E].y*l+o.y+w.y;f.push((D-h.x)/c,(V-h.y)/c,0,1),g.push(0,0,1),m.push(D,V,0,1)}}}}(),getGlyphExtents:function(t,e,i,n,r){var s=this.getBrowser().getGlyph(t,i,e.index),o=s.extents;if(o)return n.assign(o.min),void r.assign(o.max);var a=this.getGlyphGeometry(t,e,i);if(a.length){var u=a[0];n.assign(u),r.assign(u);for(var l=1,c=a.length;l<c;++l){var u=a[l];n.min(u),r.max(u)}}else n.set(0,0,0),r.set(0,0,0);var o=s.extents={};o.min=n.copy(),o.max=r.copy()},getGlyphGeometry:function(t,e,i){var n=this.getBrowser().getGlyph(t,i,e.index),r=n.geometry;return r?r:(r=n.geometry=[],this.createGlyphGeometry(e,r,i),r)},createGlyphGeometry:function(){var t=[],e=[],i=new n(0,0,0);return function(r,a,u){var l=this.getBezierDimension(u),c=r.getPath(0,0,1),h=c.commands,d=0,p=0;t.length=0,e.length=0;for(var f=0,g=h.length;f<g;++f){var m=h[f];switch(m.type){case"M":case"Z":t.length>2&&(t[0].x===t.at(-1).x&&t[0].y===t.at(-1).y&&t.pop(),e.push(t)),t=[],"M"===m.type&&t.push(new n(m.x,-m.y,0));break;case"L":t.push(new n(m.x,-m.y,0));break;case"Q":for(var _=new o(d,-p,m.x1,-m.y1,m.x,-m.y),x=_.getLUT(l),y=1,v=x.length;y<v;++y)t.push(new n(x[y].x,x[y].y,0));break;case"C":for(var _=new o(d,-p,m.x1,-m.y1,m.x2,-m.y2,m.x,-m.y),x=_.getLUT(l),y=1,v=x.length;y<v;++y)t.push(new n(x[y].x,x[y].y,0));break;default:continue}d=m.x,p=m.y}e=e.map(function(t){return s.getPolygonNormal(t,i),i.dot(n.zAxis)>0?t:t.reverse()}),e.push(a),s.triangulatePolygon.apply(s,e)}}(),getBezierDimension:function(e){switch(e){case t.LOW:return 3;case t.HIGH:return 7;default:return 5}},display:function(t,e){},transformLine:function(t){},transformMatrix:function(t){}}),a}),define("x_ite/Components/Text/FontStyle",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Text/X3DFontStyleNode","x_ite/Browser/Text/PolygonText","x_ite/Bits/X3DConstants"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(s.FontStyle),this.size_.setUnit("length")}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.initializeOnly,"language",new t.SFString),new e(s.initializeOnly,"family",new t.MFString("SERIF")),new e(s.initializeOnly,"style",new t.SFString("PLAIN")),new e(s.initializeOnly,"size",new t.SFFloat(1)),new e(s.initializeOnly,"spacing",new t.SFFloat(1)),new e(s.initializeOnly,"horizontal",new t.SFBool(!0)),new e(s.initializeOnly,"leftToRight",new t.SFBool(!0)),new e(s.initializeOnly,"topToBottom",new t.SFBool(!0)),new e(s.initializeOnly,"justify",new t.MFString("BEGIN"))]),getTypeName:function(){return"FontStyle"},getComponentName:function(){return"Text"},getContainerField:function(){return"fontStyle"},getTextGeometry:function(t){return new r(t,this)},getScale:function(){return this.size_.getValue()}}),o}),function(t,e){"object"==typeof exports&&void 0!==module?e(exports):"function"==typeof define&&define.amd?define("opentype/dist/opentype",["exports"],e):(t=t||self,e(t.opentype={}))}(this,function(t){"use strict";function e(){this.table=new Uint16Array(16),this.trans=new Uint16Array(288)}function i(t,i){this.source=t,this.sourceIndex=0,this.tag=0,this.bitcount=0,this.dest=i,this.destLen=0,this.ltree=new e,this.dtree=new e}function n(t,e,i,n){var r,s;for(r=0;r<i;++r)t[r]=0;for(r=0;r<30-i;++r)t[r+i]=r/i|0;for(s=n,r=0;r<30;++r)e[r]=s,s+=1<<t[r]}function r(t,e,i,n){var r,s;for(r=0;r<16;++r)t.table[r]=0;for(r=0;r<n;++r)t.table[e[i+r]]++;for(t.table[0]=0,s=0,r=0;r<16;++r)ws[r]=s,s+=t.table[r];for(r=0;r<n;++r)e[i+r]&&(t.trans[ws[e[i+r]]++]=r)}function s(t){t.bitcount--||(t.tag=t.source[t.sourceIndex++],t.bitcount=7);var e=1&t.tag;return t.tag>>>=1,e}function o(t,e,i){if(!e)return i;for(;t.bitcount<24;)t.tag|=t.source[t.sourceIndex++]<<t.bitcount,t.bitcount+=8;var n=t.tag&65535>>>16-e;return t.tag>>>=e,t.bitcount-=e,n+i}function a(t,e){for(;t.bitcount<24;)t.tag|=t.source[t.sourceIndex++]<<t.bitcount,t.bitcount+=8;var i=0,n=0,r=0,s=t.tag;do n=2*n+(1&s),s>>>=1,++r,i+=e.table[r],n-=e.table[r];while(n>=0)return t.tag=s,t.bitcount-=r,e.trans[i+n]}function u(t,e,i){var n,s,u,l,c,h;for(n=o(t,5,257),s=o(t,5,1),u=o(t,4,4),l=0;l<19;++l)vs[l]=0;for(l=0;l<u;++l){var d=o(t,3,0);vs[xs[l]]=d}for(r(ys,vs,0,19),c=0;c<n+s;){var p=a(t,ys);switch(p){case 16:var f=vs[c-1];for(h=o(t,2,3);h;--h)vs[c++]=f;break;case 17:for(h=o(t,3,3);h;--h)vs[c++]=0;break;case 18:for(h=o(t,7,11);h;--h)vs[c++]=0;break;default:vs[c++]=p}}r(e,vs,0,n),r(i,vs,n,s)}function l(t,e,i){for(;;){var n=a(t,e);if(256===n)return cs;if(n<256)t.dest[t.destLen++]=n;else{var r,s,u,l;for(n-=257,r=o(t,fs[n],gs[n]),s=a(t,i),u=t.destLen-o(t,ms[s],_s[s]),l=u;l<u+r;++l)t.dest[t.destLen++]=t.dest[l]}}}function c(t){for(var e,i,n;t.bitcount>8;)t.sourceIndex--,t.bitcount-=8;if(e=t.source[t.sourceIndex+1],e=256*e+t.source[t.sourceIndex],i=t.source[t.sourceIndex+3],i=256*i+t.source[t.sourceIndex+2],e!==(65535&~i))return hs;for(t.sourceIndex+=4,n=e;n;--n)t.dest[t.destLen++]=t.source[t.sourceIndex++];return t.bitcount=0,cs}function h(t,e){var n,r,a=new i(t,e);do{switch(n=s(a),o(a,2,0)){case 0:r=c(a);break;case 1:r=l(a,ds,ps);break;case 2:u(a,a.ltree,a.dtree),r=l(a,a.ltree,a.dtree);break;default:r=hs}if(r!==cs)throw new Error("Data error")}while(!n)return a.destLen<a.dest.length?"function"==typeof a.dest.slice?a.dest.slice(0,a.destLen):a.dest.subarray(0,a.destLen):a.dest}function d(t,e,i,n,r){return Math.pow(1-r,3)*t+3*Math.pow(1-r,2)*r*e+3*(1-r)*Math.pow(r,2)*i+Math.pow(r,3)*n}function p(){this.x1=Number.NaN,this.y1=Number.NaN,this.x2=Number.NaN,this.y2=Number.NaN}function f(){this.commands=[],this.fill="black",this.stroke=null,this.strokeWidth=1}function g(t){throw new Error(t)}function m(t,e){t||g(e)}function _(t){return function(){return t}}function x(t){return t>=-128&&t<=127}function y(t,e,i){for(var n=0,r=t.length;e<r&&n<64&&0===t[e];)++e,++n;return i.push(128|n-1),e}function v(t,e,i){for(var n=0,r=t.length,s=e;s<r&&n<64;){var o=t[s];if(!x(o))break;if(0===o&&s+1<r&&0===t[s+1])break;++s,++n}i.push(n-1);for(var a=e;a<s;++a)i.push(t[a]+256&255);return s}function w(t,e,i){for(var n=0,r=t.length,s=e;s<r&&n<64;){var o=t[s];if(0===o)break;if(x(o)&&s+1<r&&x(t[s+1]))break;++s,++n}i.push(64|n-1);for(var a=e;a<s;++a){var u=t[a];i.push(u+65536>>8&255,u+256&255)}return s}function b(t,e,i){if(e.length&&("coverageFormat"!==e[0].name||1===e[0].value))for(var n=0;n<e.length;n+=1){var r=e[n];this[r.name]=r.value}if(this.tableName=t,this.fields=e,i)for(var s=Object.keys(i),o=0;o<s.length;o+=1){var a=s[o],u=i[a];void 0!==this[a]&&(this[a]=u)}}function S(t,e,i){void 0===i&&(i=e.length);var n=new Array(e.length+1);n[0]={name:t+"Count",type:"USHORT",value:i};for(var r=0;r<e.length;r++)n[r+1]={name:t+r,type:"USHORT",value:e[r]};return n}function C(t,e,i){var n=e.length,r=new Array(n+1);r[0]={name:t+"Count",type:"USHORT",value:n};for(var s=0;s<n;s++)r[s+1]={name:t+s,type:"TABLE",value:i(e[s],s)};return r}function T(t,e,i){var n=e.length,r=[];r[0]={name:t+"Count",type:"USHORT",value:n};for(var s=0;s<n;s++)r=r.concat(i(e[s],s));return r}function F(t){1===t.format?b.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:1}].concat(S("glyph",t.glyphs))):2===t.format?b.call(this,"coverageTable",[{name:"coverageFormat",type:"USHORT",value:2}].concat(T("rangeRecord",t.ranges,function(t){return[{name:"startGlyphID",type:"USHORT",value:t.start},{name:"endGlyphID",type:"USHORT",value:t.end},{name:"startCoverageIndex",type:"USHORT",value:t.index}]}))):Ss.assert(!1,"Coverage format must be 1 or 2.")}function O(t){b.call(this,"scriptListTable",T("scriptRecord",t,function(t,e){var i=t.script,n=i.defaultLangSys;return Ss.assert(!!n,"Unable to write GSUB: script "+t.tag+" has no default language system."),[{name:"scriptTag"+e,type:"TAG",value:t.tag},{name:"script"+e,type:"TABLE",value:new b("scriptTable",[{name:"defaultLangSys",type:"TABLE",value:new b("defaultLangSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:n.reqFeatureIndex}].concat(S("featureIndex",n.featureIndexes)))}].concat(T("langSys",i.langSysRecords,function(t,e){var i=t.langSys;return[{name:"langSysTag"+e,type:"TAG",value:t.tag},{name:"langSys"+e,type:"TABLE",value:new b("langSys",[{name:"lookupOrder",type:"USHORT",value:0},{name:"reqFeatureIndex",type:"USHORT",value:i.reqFeatureIndex}].concat(S("featureIndex",i.featureIndexes)))}]})))}]}))}function N(t){b.call(this,"featureListTable",T("featureRecord",t,function(t,e){var i=t.feature;return[{name:"featureTag"+e,type:"TAG",value:t.tag},{name:"feature"+e,type:"TABLE",value:new b("featureTable",[{name:"featureParams",type:"USHORT",value:i.featureParams}].concat(S("lookupListIndex",i.lookupListIndexes)))}]}))}function E(t,e){b.call(this,"lookupListTable",C("lookup",t,function(t){var i=e[t.lookupType];return Ss.assert(!!i,"Unable to write GSUB lookup type "+t.lookupType+" tables."),new b("lookupTable",[{name:"lookupType",type:"USHORT",value:t.lookupType},{name:"lookupFlag",type:"USHORT",value:t.lookupFlag}].concat(C("subtable",t.subtables,i)))}))}function M(t,e){return t.getUint8(e)}function D(t,e){return t.getUint16(e,!1)}function V(t,e){return t.getInt16(e,!1)}function I(t,e){return t.getUint32(e,!1)}function B(t,e){return t.getInt16(e,!1)+t.getUint16(e+2,!1)/65535}function A(t,e){for(var i="",n=e;n<e+4;n+=1)i+=String.fromCharCode(t.getInt8(n));return i}function P(t,e,i){for(var n=0,r=0;r<i;r+=1)n<<=8,n+=t.getUint8(e+r);return n}function L(t,e,i){for(var n=[],r=e;r<i;r+=1)n.push(t.getUint8(r));return n}function R(t){for(var e="",i=0;i<t.length;i+=1)e+=String.fromCharCode(t[i]);return e}function k(t,e){this.data=t,this.offset=e,this.relativeOffset=0}function U(t,e){e.parseUShort(),t.length=e.parseULong(),t.language=e.parseULong();var i;t.groupCount=i=e.parseULong(),t.glyphIndexMap={};for(var n=0;n<i;n+=1)for(var r=e.parseULong(),s=e.parseULong(),o=e.parseULong(),a=r;a<=s;a+=1)t.glyphIndexMap[a]=o,o++}function X(t,e,i,n,r){t.length=e.parseUShort(),t.language=e.parseUShort();var s;t.segCount=s=e.parseUShort()>>1,e.skip("uShort",3),t.glyphIndexMap={};for(var o=new As.Parser(i,n+r+14),a=new As.Parser(i,n+r+16+2*s),u=new As.Parser(i,n+r+16+4*s),l=new As.Parser(i,n+r+16+6*s),c=n+r+16+8*s,h=0;h<s-1;h+=1)for(var d=void 0,p=o.parseUShort(),f=a.parseUShort(),g=u.parseShort(),m=l.parseUShort(),_=f;_<=p;_+=1)0!==m?(c=l.offset+l.relativeOffset-2,c+=m,c+=2*(_-f),0!==(d=As.getUShort(i,c))&&(d=d+g&65535)):d=_+g&65535,t.glyphIndexMap[_]=d}function j(t,e){var i={};i.version=As.getUShort(t,e),Ss.argument(0===i.version,"cmap table version should be 0."),i.numTables=As.getUShort(t,e+2);for(var n=-1,r=i.numTables-1;r>=0;r-=1){var s=As.getUShort(t,e+4+8*r),o=As.getUShort(t,e+4+8*r+2);if(3===s&&(0===o||1===o||10===o)||0===s&&(0===o||1===o||2===o||3===o||4===o)){n=As.getULong(t,e+4+8*r+4);break}}if(n===-1)throw new Error("No valid cmap sub-tables found.");var a=new As.Parser(t,e+n);if(i.format=a.parseUShort(),12===i.format)U(i,a);else{if(4!==i.format)throw new Error("Only format 4 and 12 cmap tables are supported (found format "+i.format+").");X(i,a,t,e,n)}return i}function z(t,e,i){t.segments.push({end:e,start:e,delta:-(e-i),offset:0,glyphIndex:i})}function G(t){t.segments.push({end:65535,start:65535,delta:1,offset:0})}function H(t){var e,i=!0;for(e=t.length-1;e>0;e-=1){if(t.get(e).unicode>65535){console.log("Adding CMAP format 12 (needed!)"),i=!1;break}}var n=[{name:"version",type:"USHORT",value:0},{name:"numTables",type:"USHORT",value:i?1:2},{name:"platformID",type:"USHORT",value:3},{name:"encodingID",type:"USHORT",value:1},{name:"offset",type:"ULONG",value:i?12:20}];i||(n=n.concat([{name:"cmap12PlatformID",type:"USHORT",value:3},{name:"cmap12EncodingID",type:"USHORT",value:10},{name:"cmap12Offset",type:"ULONG",value:0}])),n=n.concat([{name:"format",type:"USHORT",value:4},{name:"cmap4Length",type:"USHORT",value:0},{name:"language",type:"USHORT",value:0},{name:"segCountX2",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);var r=new Vs.Table("cmap",n);for(r.segments=[],e=0;e<t.length;e+=1){for(var s=t.get(e),o=0;o<s.unicodes.length;o+=1)z(r,s.unicodes[o],e);r.segments=r.segments.sort(function(t,e){return t.start-e.start})}G(r);var a=r.segments.length,u=0,l=[],c=[],h=[],d=[],p=[],f=[];for(e=0;e<a;e+=1){var g=r.segments[e];g.end<=65535&&g.start<=65535?(l=l.concat({name:"end_"+e,type:"USHORT",value:g.end}),c=c.concat({name:"start_"+e,type:"USHORT",value:g.start}),h=h.concat({name:"idDelta_"+e,type:"SHORT",value:g.delta}),d=d.concat({name:"idRangeOffset_"+e,type:"USHORT",value:g.offset}),void 0!==g.glyphId&&(p=p.concat({name:"glyph_"+e,type:"USHORT",value:g.glyphId}))):u+=1,i||void 0===g.glyphIndex||(f=f.concat({name:"cmap12Start_"+e,type:"ULONG",value:g.start}),f=f.concat({name:"cmap12End_"+e,type:"ULONG",value:g.end}),f=f.concat({name:"cmap12Glyph_"+e,type:"ULONG",value:g.glyphIndex}))}if(r.segCountX2=2*(a-u),r.searchRange=2*Math.pow(2,Math.floor(Math.log(a-u)/Math.log(2))),r.entrySelector=Math.log(r.searchRange/2)/Math.log(2),r.rangeShift=r.segCountX2-r.searchRange,r.fields=r.fields.concat(l),r.fields.push({name:"reservedPad",type:"USHORT",value:0}),r.fields=r.fields.concat(c),r.fields=r.fields.concat(h),r.fields=r.fields.concat(d),r.fields=r.fields.concat(p),r.cmap4Length=14+2*l.length+2+2*c.length+2*h.length+2*d.length+2*p.length,!i){var m=16+4*f.length;r.cmap12Offset=20+r.cmap4Length,r.fields=r.fields.concat([{name:"cmap12Format",type:"USHORT",value:12},{name:"cmap12Reserved",type:"USHORT",value:0},{name:"cmap12Length",type:"ULONG",value:m},{name:"cmap12Language",type:"ULONG",value:0},{name:"cmap12nGroups",type:"ULONG",value:f.length/3}]),r.fields=r.fields.concat(f)}return r}function q(t){this.font=t}function W(t){this.cmap=t}function Y(t,e){this.encoding=t,this.charset=e}function $(t){switch(t.version){case 1:this.names=Us.slice();break;case 2:this.names=new Array(t.numberOfGlyphs);for(var e=0;e<t.numberOfGlyphs;e++)t.glyphNameIndex[e]<Us.length?this.names[e]=Us[t.glyphNameIndex[e]]:this.names[e]=t.names[t.glyphNameIndex[e]-Us.length];break;case 2.5:this.names=new Array(t.numberOfGlyphs);for(var i=0;i<t.numberOfGlyphs;i++)this.names[i]=Us[i+t.glyphNameIndex[i]];break;case 3:this.names=[];break;default:this.names=[]}}function Z(t){for(var e,i=t.tables.cmap.glyphIndexMap,n=Object.keys(i),r=0;r<n.length;r+=1){var s=n[r],o=i[s];e=t.glyphs.get(o),e.addUnicode(parseInt(s))}for(var a=0;a<t.glyphs.length;a+=1)e=t.glyphs.get(a),t.cffEncoding?t.isCIDFont?e.name="gid"+a:e.name=t.cffEncoding.charset[a]:t.glyphNames.names&&(e.name=t.glyphNames.glyphIndexToName(a))}function Q(t){t._IndexToUnicodeMap={};for(var e=t.tables.cmap.glyphIndexMap,i=Object.keys(e),n=0;n<i.length;n+=1){var r=i[n],s=e[r];void 0===t._IndexToUnicodeMap[s]?t._IndexToUnicodeMap[s]={unicodes:[parseInt(r)]}:t._IndexToUnicodeMap[s].unicodes.push(parseInt(r))}}function K(t,e){e.lowMemory?Q(t):Z(t)}function J(t,e,i,n,r){t.beginPath(),t.moveTo(e,i),t.lineTo(n,r),t.stroke()}function tt(t,e){var i=e||new f;return{configurable:!0,get:function(){return"function"==typeof i&&(i=i()),i},set:function(t){i=t}}}function et(t){this.bindConstructorValues(t)}function it(t,e,i){Object.defineProperty(t,e,{get:function(){return t.path,t[i]},set:function(e){t[i]=e},enumerable:!0,configurable:!0})}function nt(t,e){if(this.font=t,this.glyphs={},Array.isArray(e))for(var i=0;i<e.length;i++){var n=e[i];n.path.unitsPerEm=t.unitsPerEm,this.glyphs[i]=n}this.length=e&&e.length||0}function rt(t,e){return new et({index:e,font:t})}function st(t,e,i,n,r,s){return function(){var o=new et({index:e,font:t});return o.path=function(){i(o,n,r);var e=s(t.glyphs,o);return e.unitsPerEm=t.unitsPerEm,e},it(o,"xMin","_xMin"),it(o,"xMax","_xMax"),it(o,"yMin","_yMin"),it(o,"yMax","_yMax"),o}}function ot(t,e,i,n){return function(){var r=new et({index:e,font:t});return r.path=function(){var e=i(t,r,n);return e.unitsPerEm=t.unitsPerEm,e},r}}function at(t,e){if(t===e)return!0;if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(var i=0;i<t.length;i+=1)if(!at(t[i],e[i]))return!1;return!0}return!1}function ut(t){return t.length<1240?107:t.length<33900?1131:32768}function lt(t,e,i){var n,r,s=[],o=[],a=As.getCard16(t,e);if(0!==a){var u=As.getByte(t,e+2);n=e+(a+1)*u+2;for(var l=e+3,c=0;c<a+1;c+=1)s.push(As.getOffset(t,l,u)),l+=u;r=n+s[a]}else r=e+2;for(var h=0;h<s.length-1;h+=1){var d=As.getBytes(t,n+s[h],n+s[h+1]);i&&(d=i(d)),o.push(d)}return{objects:o,startOffset:e,endOffset:r}}function ct(t,e){var i,n,r=[],s=As.getCard16(t,e);if(0!==s){var o=As.getByte(t,e+2);i=e+(s+1)*o+2;for(var a=e+3,u=0;u<s+1;u+=1)r.push(As.getOffset(t,a,o)),a+=o;n=i+r[s]}else n=e+2;return{offsets:r,startOffset:e,endOffset:n}}function ht(t,e,i,n,r){var s=As.getCard16(i,n),o=0;if(0!==s){o=n+(s+1)*As.getByte(i,n+2)+2}var a=As.getBytes(i,o+e[t],o+e[t+1]);return r&&(a=r(a)),a}function dt(t){for(var e="",i=["0","1","2","3","4","5","6","7","8","9",".","E","E-",null,"-"];;){var n=t.parseByte(),r=n>>4,s=15&n;if(15===r)break;if(e+=i[r],15===s)break;e+=i[s]}return parseFloat(e)}function pt(t,e){var i,n,r,s;if(28===e)return i=t.parseByte(),n=t.parseByte(),i<<8|n;if(29===e)return i=t.parseByte(),n=t.parseByte(),r=t.parseByte(),s=t.parseByte(),i<<24|n<<16|r<<8|s;if(30===e)return dt(t);if(e>=32&&e<=246)return e-139;if(e>=247&&e<=250)return i=t.parseByte(),256*(e-247)+i+108;if(e>=251&&e<=254)return i=t.parseByte(),256*-(e-251)-i-108;throw new Error("Invalid b0 "+e)}function ft(t){for(var e={},i=0;i<t.length;i+=1){var n=t[i][0],r=t[i][1],s=void 0;if(s=1===r.length?r[0]:r,e.hasOwnProperty(n)&&!isNaN(e[n]))throw new Error("Object "+e+" already has key "+n);e[n]=s}return e}function gt(t,e,i){e=void 0!==e?e:0;var n=new As.Parser(t,e),r=[],s=[];for(i=void 0!==i?i:t.length;n.relativeOffset<i;){var o=n.parseByte();o<=21?(12===o&&(o=1200+n.parseByte()),r.push([o,s]),s=[]):s.push(pt(n,o))}return ft(r)}function mt(t,e){return e=e<=390?Ls[e]:t[e-391]}function _t(t,e,i){for(var n,r={},s=0;s<e.length;s+=1){var o=e[s];if(Array.isArray(o.type)){var a=[];a.length=o.type.length;for(var u=0;u<o.type.length;u++)n=void 0!==t[o.op]?t[o.op][u]:void 0,void 0===n&&(n=void 0!==o.value&&void 0!==o.value[u]?o.value[u]:null),"SID"===o.type[u]&&(n=mt(i,n)),a[u]=n;r[o.name]=a}else n=t[o.op],void 0===n&&(n=void 0!==o.value?o.value:null),"SID"===o.type&&(n=mt(i,n)),r[o.name]=n}return r}function xt(t,e){var i={};return i.formatMajor=As.getCard8(t,e),i.formatMinor=As.getCard8(t,e+1),i.size=As.getCard8(t,e+2),i.offsetSize=As.getCard8(t,e+3),i.startOffset=e,i.endOffset=e+4,i}function yt(t,e){return _t(gt(t,0,t.byteLength),zs,e)}function vt(t,e,i,n){return _t(gt(t,e,i),Gs,n)}function wt(t,e,i,n){for(var r=[],s=0;s<i.length;s+=1){var o=new DataView(new Uint8Array(i[s]).buffer),a=yt(o,n);a._subrs=[],a._subrsBias=0,a._defaultWidthX=0,a._nominalWidthX=0;var u=a.private[0],l=a.private[1];if(0!==u&&0!==l){var c=vt(t,l+e,u,n);if(a._defaultWidthX=c.defaultWidthX,a._nominalWidthX=c.nominalWidthX,0!==c.subrs){var h=l+c.subrs,d=lt(t,h+e);a._subrs=d.objects,a._subrsBias=ut(a._subrs)}a._privateDict=c}r.push(a)}return r}function bt(t,e,i,n){var r,s,o=new As.Parser(t,e);i-=1;var a=[".notdef"],u=o.parseCard8();if(0===u)for(var l=0;l<i;l+=1)r=o.parseSID(),a.push(mt(n,r));else if(1===u)for(;a.length<=i;){r=o.parseSID(),s=o.parseCard8();for(var c=0;c<=s;c+=1)a.push(mt(n,r)),r+=1}else{if(2!==u)throw new Error("Unknown charset format "+u);for(;a.length<=i;){r=o.parseSID(),s=o.parseCard16();for(var h=0;h<=s;h+=1)a.push(mt(n,r)),r+=1}}return a}function St(t,e,i){var n,r={},s=new As.Parser(t,e),o=s.parseCard8();if(0===o)for(var a=s.parseCard8(),u=0;u<a;u+=1)n=s.parseCard8(),r[n]=u;else{if(1!==o)throw new Error("Unknown encoding format "+o);var l=s.parseCard8();n=1;for(var c=0;c<l;c+=1)for(var h=s.parseCard8(),d=s.parseCard8(),p=h;p<=h+d;p+=1)r[p]=n,n+=1}return new Y(r,i)}function Ct(t,e,i){function n(t,e){y&&g.closePath(),g.moveTo(t,e),y=!0}function r(){var t;t=m.length%2!=0,t&&!x&&(C=m.shift()+p),_+=m.length>>1,m.length=0,x=!0}function s(i){for(var d,f,b,S,T,F,O,N,E,M,D,V,I=0;I<i.length;){var B=i[I];switch(I+=1,B){case 1:r();break;case 3:r();break;case 4:m.length>1&&!x&&(C=m.shift()+p,x=!0),w+=m.pop(),n(v,w);break;case 5:for(;m.length>0;)v+=m.shift(),w+=m.shift(),g.lineTo(v,w);break;case 6:for(;m.length>0&&(v+=m.shift(),g.lineTo(v,w),0!==m.length);)w+=m.shift(),g.lineTo(v,w);break;case 7:for(;m.length>0&&(w+=m.shift(),g.lineTo(v,w),0!==m.length);)v+=m.shift(),g.lineTo(v,w);break;case 8:for(;m.length>0;)o=v+m.shift(),a=w+m.shift(),u=o+m.shift(),l=a+m.shift(),v=u+m.shift(),w=l+m.shift(),g.curveTo(o,a,u,l,v,w);break;case 10:T=m.pop()+h,F=c[T],F&&s(F);break;case 11:return;case 12:switch(B=i[I],I+=1,B){case 35:o=v+m.shift(),a=w+m.shift(),u=o+m.shift(),l=a+m.shift(),O=u+m.shift(),N=l+m.shift(),E=O+m.shift(),M=N+m.shift(),D=E+m.shift(),V=M+m.shift(),v=D+m.shift(),w=V+m.shift(),m.shift(),g.curveTo(o,a,u,l,O,N),g.curveTo(E,M,D,V,v,w);break;case 34:o=v+m.shift(),a=w,u=o+m.shift(),l=a+m.shift(),O=u+m.shift(),N=l,E=O+m.shift(),M=l,D=E+m.shift(),V=w,v=D+m.shift(),g.curveTo(o,a,u,l,O,N),g.curveTo(E,M,D,V,v,w);break;case 36:o=v+m.shift(),a=w+m.shift(),u=o+m.shift(),l=a+m.shift(),O=u+m.shift(),N=l,E=O+m.shift(),M=l,D=E+m.shift(),V=M+m.shift(),v=D+m.shift(),g.curveTo(o,a,u,l,O,N),g.curveTo(E,M,D,V,v,w);break;case 37:o=v+m.shift(),a=w+m.shift(),u=o+m.shift(),l=a+m.shift(),O=u+m.shift(),N=l+m.shift(),E=O+m.shift(),M=N+m.shift(),D=E+m.shift(),V=M+m.shift(),Math.abs(D-v)>Math.abs(V-w)?v=D+m.shift():w=V+m.shift(),g.curveTo(o,a,u,l,O,N),g.curveTo(E,M,D,V,v,w);break;default:console.log("Glyph "+e.index+": unknown operator 1200"+B),m.length=0}break;case 14:m.length>0&&!x&&(C=m.shift()+p,x=!0),y&&(g.closePath(),y=!1);break;case 18:r();break;case 19:case 20:r(),I+=_+7>>3;break;case 21:m.length>2&&!x&&(C=m.shift()+p,x=!0),w+=m.pop(),v+=m.pop(),n(v,w);break;case 22:m.length>1&&!x&&(C=m.shift()+p,x=!0),v+=m.pop(),n(v,w);break;case 23:r();break;case 24:for(;m.length>2;)o=v+m.shift(),a=w+m.shift(),u=o+m.shift(),l=a+m.shift(),v=u+m.shift(),w=l+m.shift(),g.curveTo(o,a,u,l,v,w);v+=m.shift(),w+=m.shift(),g.lineTo(v,w);break;case 25:for(;m.length>6;)v+=m.shift(),w+=m.shift(),g.lineTo(v,w);o=v+m.shift(),a=w+m.shift(),u=o+m.shift(),l=a+m.shift(),v=u+m.shift(),w=l+m.shift(),g.curveTo(o,a,u,l,v,w);break;case 26:for(m.length%2&&(v+=m.shift());m.length>0;)o=v,a=w+m.shift(),u=o+m.shift(),l=a+m.shift(),v=u,w=l+m.shift(),g.curveTo(o,a,u,l,v,w);break;case 27:for(m.length%2&&(w+=m.shift());m.length>0;)o=v+m.shift(),a=w,u=o+m.shift(),l=a+m.shift(),v=u+m.shift(),w=l,g.curveTo(o,a,u,l,v,w);break;case 28:d=i[I],f=i[I+1],m.push((d<<24|f<<16)>>16),I+=2;break;case 29:T=m.pop()+t.gsubrsBias,F=t.gsubrs[T],F&&s(F);break;case 30:for(;m.length>0&&(o=v,a=w+m.shift(),u=o+m.shift(),l=a+m.shift(),v=u+m.shift(),w=l+(1===m.length?m.shift():0),g.curveTo(o,a,u,l,v,w),0!==m.length);)o=v+m.shift(),a=w,u=o+m.shift(),l=a+m.shift(),w=l+m.shift(),v=u+(1===m.length?m.shift():0),g.curveTo(o,a,u,l,v,w);break;case 31:for(;m.length>0&&(o=v+m.shift(),a=w,u=o+m.shift(),l=a+m.shift(),w=l+m.shift(),v=u+(1===m.length?m.shift():0),g.curveTo(o,a,u,l,v,w),0!==m.length);)o=v,a=w+m.shift(),u=o+m.shift(),l=a+m.shift(),v=u+m.shift(),w=l+(1===m.length?m.shift():0),g.curveTo(o,a,u,l,v,w);break;default:B<32?console.log("Glyph "+e.index+": unknown operator "+B):B<247?m.push(B-139):B<251?(d=i[I],I+=1,m.push(256*(B-247)+d+108)):B<255?(d=i[I],I+=1,m.push(256*-(B-251)-d-108)):(d=i[I],f=i[I+1],b=i[I+2],S=i[I+3],I+=4,m.push((d<<24|f<<16|b<<8|S)/65536))}}}var o,a,u,l,c,h,d,p,g=new f,m=[],_=0,x=!1,y=!1,v=0,w=0;if(t.isCIDFont){var b=t.tables.cff.topDict._fdSelect[e.index],S=t.tables.cff.topDict._fdArray[b];c=S._subrs,h=S._subrsBias,d=S._defaultWidthX,p=S._nominalWidthX}else c=t.tables.cff.topDict._subrs,h=t.tables.cff.topDict._subrsBias,d=t.tables.cff.topDict._defaultWidthX,p=t.tables.cff.topDict._nominalWidthX;var C=d;return s(i),e.advanceWidth=C,g}function Tt(t,e,i,n){var r,s=[],o=new As.Parser(t,e),a=o.parseCard8();if(0===a)for(var u=0;u<i;u++){
|
|
30
|
+
if((r=o.parseCard8())>=n)throw new Error("CFF table CID Font FDSelect has bad FD index value "+r+" (FD count "+n+")");s.push(r)}else{if(3!==a)throw new Error("CFF Table CID Font FDSelect table has unsupported format "+a);var l=o.parseCard16(),c=o.parseCard16();if(0!==c)throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID "+c);for(var h,d=0;d<l;d++){if(r=o.parseCard8(),h=o.parseCard16(),r>=n)throw new Error("CFF table CID Font FDSelect has bad FD index value "+r+" (FD count "+n+")");if(h>i)throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID "+h);for(;c<h;c++)s.push(r);c=h}if(h!==i)throw new Error("CFF Table CID Font FDSelect format 3 range has bad final GID "+h)}return s}function Ft(t,e,i,n){i.tables.cff={};var r=xt(t,e),s=lt(t,r.endOffset,As.bytesToString),o=lt(t,s.endOffset),a=lt(t,o.endOffset,As.bytesToString),u=lt(t,a.endOffset);i.gsubrs=u.objects,i.gsubrsBias=ut(i.gsubrs);var l=wt(t,e,o.objects,a.objects);if(1!==l.length)throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = "+l.length);var c=l[0];if(i.tables.cff.topDict=c,c._privateDict&&(i.defaultWidthX=c._privateDict.defaultWidthX,i.nominalWidthX=c._privateDict.nominalWidthX),void 0!==c.ros[0]&&void 0!==c.ros[1]&&(i.isCIDFont=!0),i.isCIDFont){var h=c.fdArray,d=c.fdSelect;if(0===h||0===d)throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");h+=e;var p=lt(t,h),f=wt(t,e,p.objects,a.objects);c._fdArray=f,d+=e,c._fdSelect=Tt(t,d,i.numGlyphs,f.length)}var g=e+c.private[1],m=vt(t,g,c.private[0],a.objects);if(i.defaultWidthX=m.defaultWidthX,i.nominalWidthX=m.nominalWidthX,0!==m.subrs){var _=g+m.subrs,x=lt(t,_);i.subrs=x.objects,i.subrsBias=ut(i.subrs)}else i.subrs=[],i.subrsBias=0;var y;n.lowMemory?(y=ct(t,e+c.charStrings),i.nGlyphs=y.offsets.length):(y=lt(t,e+c.charStrings),i.nGlyphs=y.objects.length);var v=bt(t,e+c.charset,i.nGlyphs,a.objects);if(0===c.encoding?i.cffEncoding=new Y(Rs,v):1===c.encoding?i.cffEncoding=new Y(ks,v):i.cffEncoding=St(t,e+c.encoding,v),i.encoding=i.encoding||i.cffEncoding,i.glyphs=new js.GlyphSet(i),n.lowMemory)i._push=function(n){var r=ht(n,y.offsets,t,e+c.charStrings);i.glyphs.push(n,js.cffGlyphLoader(i,n,Ct,r))};else for(var w=0;w<i.nGlyphs;w+=1){var b=y.objects[w];i.glyphs.push(w,js.cffGlyphLoader(i,w,Ct,b))}}function Ot(t,e){var i,n=Ls.indexOf(t);return n>=0&&(i=n),n=e.indexOf(t),n>=0?i=n+Ls.length:(i=Ls.length+e.length,e.push(t)),i}function Nt(){return new Vs.Record("Header",[{name:"major",type:"Card8",value:1},{name:"minor",type:"Card8",value:0},{name:"hdrSize",type:"Card8",value:4},{name:"major",type:"Card8",value:1}])}function Et(t){var e=new Vs.Record("Name INDEX",[{name:"names",type:"INDEX",value:[]}]);e.names=[];for(var i=0;i<t.length;i+=1)e.names.push({name:"name_"+i,type:"NAME",value:t[i]});return e}function Mt(t,e,i){for(var n={},r=0;r<t.length;r+=1){var s=t[r],o=e[s.name];void 0===o||at(o,s.value)||("SID"===s.type&&(o=Ot(o,i)),n[s.op]={name:s.name,type:s.type,value:o})}return n}function Dt(t,e){var i=new Vs.Record("Top DICT",[{name:"dict",type:"DICT",value:{}}]);return i.dict=Mt(zs,t,e),i}function Vt(t){var e=new Vs.Record("Top DICT INDEX",[{name:"topDicts",type:"INDEX",value:[]}]);return e.topDicts=[{name:"topDict_0",type:"TABLE",value:t}],e}function It(t){var e=new Vs.Record("String INDEX",[{name:"strings",type:"INDEX",value:[]}]);e.strings=[];for(var i=0;i<t.length;i+=1)e.strings.push({name:"string_"+i,type:"STRING",value:t[i]});return e}function Bt(){return new Vs.Record("Global Subr INDEX",[{name:"subrs",type:"INDEX",value:[]}])}function At(t,e){for(var i=new Vs.Record("Charsets",[{name:"format",type:"Card8",value:0}]),n=0;n<t.length;n+=1){var r=t[n],s=Ot(r,e);i.fields.push({name:"glyph_"+n,type:"SID",value:s})}return i}function Pt(t){var e=[],i=t.path;e.push({name:"width",type:"NUMBER",value:t.advanceWidth});for(var n=0,r=0,s=0;s<i.commands.length;s+=1){var o=void 0,a=void 0,u=i.commands[s];if("Q"===u.type){u={type:"C",x:u.x,y:u.y,x1:Math.round(1/3*n+2/3*u.x1),y1:Math.round(1/3*r+2/3*u.y1),x2:Math.round(1/3*u.x+2/3*u.x1),y2:Math.round(1/3*u.y+2/3*u.y1)}}if("M"===u.type)o=Math.round(u.x-n),a=Math.round(u.y-r),e.push({name:"dx",type:"NUMBER",value:o}),e.push({name:"dy",type:"NUMBER",value:a}),e.push({name:"rmoveto",type:"OP",value:21}),n=Math.round(u.x),r=Math.round(u.y);else if("L"===u.type)o=Math.round(u.x-n),a=Math.round(u.y-r),e.push({name:"dx",type:"NUMBER",value:o}),e.push({name:"dy",type:"NUMBER",value:a}),e.push({name:"rlineto",type:"OP",value:5}),n=Math.round(u.x),r=Math.round(u.y);else if("C"===u.type){var l=Math.round(u.x1-n),c=Math.round(u.y1-r),h=Math.round(u.x2-u.x1),d=Math.round(u.y2-u.y1);o=Math.round(u.x-u.x2),a=Math.round(u.y-u.y2),e.push({name:"dx1",type:"NUMBER",value:l}),e.push({name:"dy1",type:"NUMBER",value:c}),e.push({name:"dx2",type:"NUMBER",value:h}),e.push({name:"dy2",type:"NUMBER",value:d}),e.push({name:"dx",type:"NUMBER",value:o}),e.push({name:"dy",type:"NUMBER",value:a}),e.push({name:"rrcurveto",type:"OP",value:8}),n=Math.round(u.x),r=Math.round(u.y)}}return e.push({name:"endchar",type:"OP",value:14}),e}function Lt(t){for(var e=new Vs.Record("CharStrings INDEX",[{name:"charStrings",type:"INDEX",value:[]}]),i=0;i<t.length;i+=1){var n=t.get(i),r=Pt(n);e.charStrings.push({name:n.name,type:"CHARSTRING",value:r})}return e}function Rt(t,e){var i=new Vs.Record("Private DICT",[{name:"dict",type:"DICT",value:{}}]);return i.dict=Mt(Gs,t,e),i}function kt(t,e){for(var i,n=new Vs.Table("CFF ",[{name:"header",type:"RECORD"},{name:"nameIndex",type:"RECORD"},{name:"topDictIndex",type:"RECORD"},{name:"stringIndex",type:"RECORD"},{name:"globalSubrIndex",type:"RECORD"},{name:"charsets",type:"RECORD"},{name:"charStringsIndex",type:"RECORD"},{name:"privateDict",type:"RECORD"}]),r=1/e.unitsPerEm,s={version:e.version,fullName:e.fullName,familyName:e.familyName,weight:e.weightName,fontBBox:e.fontBBox||[0,0,0,0],fontMatrix:[r,0,0,r,0,0],charset:999,encoding:0,charStrings:999,private:[0,999]},o={},a=[],u=1;u<t.length;u+=1)i=t.get(u),a.push(i.name);var l=[];n.header=Nt(),n.nameIndex=Et([e.postScriptName]);var c=Dt(s,l);n.topDictIndex=Vt(c),n.globalSubrIndex=Bt(),n.charsets=At(a,l),n.charStringsIndex=Lt(t),n.privateDict=Rt(o,l),n.stringIndex=It(l);var h=n.header.sizeOf()+n.nameIndex.sizeOf()+n.topDictIndex.sizeOf()+n.stringIndex.sizeOf()+n.globalSubrIndex.sizeOf();return s.charset=h,s.encoding=0,s.charStrings=s.charset+n.charsets.sizeOf(),s.private[1]=s.charStrings+n.charStringsIndex.sizeOf(),c=Dt(s,l),n.topDictIndex=Vt(c),n}function Ut(t,e){var i={},n=new As.Parser(t,e);return i.version=n.parseVersion(),i.fontRevision=Math.round(1e3*n.parseFixed())/1e3,i.checkSumAdjustment=n.parseULong(),i.magicNumber=n.parseULong(),Ss.argument(1594834165===i.magicNumber,"Font header has wrong magic number."),i.flags=n.parseUShort(),i.unitsPerEm=n.parseUShort(),i.created=n.parseLongDateTime(),i.modified=n.parseLongDateTime(),i.xMin=n.parseShort(),i.yMin=n.parseShort(),i.xMax=n.parseShort(),i.yMax=n.parseShort(),i.macStyle=n.parseUShort(),i.lowestRecPPEM=n.parseUShort(),i.fontDirectionHint=n.parseShort(),i.indexToLocFormat=n.parseShort(),i.glyphDataFormat=n.parseShort(),i}function Xt(t){var e=Math.round((new Date).getTime()/1e3)+2082844800,i=e;return t.createdTimestamp&&(i=t.createdTimestamp+2082844800),new Vs.Table("head",[{name:"version",type:"FIXED",value:65536},{name:"fontRevision",type:"FIXED",value:65536},{name:"checkSumAdjustment",type:"ULONG",value:0},{name:"magicNumber",type:"ULONG",value:1594834165},{name:"flags",type:"USHORT",value:0},{name:"unitsPerEm",type:"USHORT",value:1e3},{name:"created",type:"LONGDATETIME",value:i},{name:"modified",type:"LONGDATETIME",value:e},{name:"xMin",type:"SHORT",value:0},{name:"yMin",type:"SHORT",value:0},{name:"xMax",type:"SHORT",value:0},{name:"yMax",type:"SHORT",value:0},{name:"macStyle",type:"USHORT",value:0},{name:"lowestRecPPEM",type:"USHORT",value:0},{name:"fontDirectionHint",type:"SHORT",value:2},{name:"indexToLocFormat",type:"SHORT",value:0},{name:"glyphDataFormat",type:"SHORT",value:0}],t)}function jt(t,e){var i={},n=new As.Parser(t,e);return i.version=n.parseVersion(),i.ascender=n.parseShort(),i.descender=n.parseShort(),i.lineGap=n.parseShort(),i.advanceWidthMax=n.parseUShort(),i.minLeftSideBearing=n.parseShort(),i.minRightSideBearing=n.parseShort(),i.xMaxExtent=n.parseShort(),i.caretSlopeRise=n.parseShort(),i.caretSlopeRun=n.parseShort(),i.caretOffset=n.parseShort(),n.relativeOffset+=8,i.metricDataFormat=n.parseShort(),i.numberOfHMetrics=n.parseUShort(),i}function zt(t){return new Vs.Table("hhea",[{name:"version",type:"FIXED",value:65536},{name:"ascender",type:"FWORD",value:0},{name:"descender",type:"FWORD",value:0},{name:"lineGap",type:"FWORD",value:0},{name:"advanceWidthMax",type:"UFWORD",value:0},{name:"minLeftSideBearing",type:"FWORD",value:0},{name:"minRightSideBearing",type:"FWORD",value:0},{name:"xMaxExtent",type:"FWORD",value:0},{name:"caretSlopeRise",type:"SHORT",value:1},{name:"caretSlopeRun",type:"SHORT",value:0},{name:"caretOffset",type:"SHORT",value:0},{name:"reserved1",type:"SHORT",value:0},{name:"reserved2",type:"SHORT",value:0},{name:"reserved3",type:"SHORT",value:0},{name:"reserved4",type:"SHORT",value:0},{name:"metricDataFormat",type:"SHORT",value:0},{name:"numberOfHMetrics",type:"USHORT",value:0}],t)}function Gt(t,e,i,n,r){for(var s,o,a=new As.Parser(t,e),u=0;u<n;u+=1){u<i&&(s=a.parseUShort(),o=a.parseShort());var l=r.get(u);l.advanceWidth=s,l.leftSideBearing=o}}function Ht(t,e,i,n,r){t._hmtxTableData={};for(var s,o,a=new As.Parser(e,i),u=0;u<r;u+=1)u<n&&(s=a.parseUShort(),o=a.parseShort()),t._hmtxTableData[u]={advanceWidth:s,leftSideBearing:o}}function qt(t,e,i,n,r,s,o){o.lowMemory?Ht(t,e,i,n,r):Gt(e,i,n,r,s)}function Wt(t){for(var e=new Vs.Table("hmtx",[]),i=0;i<t.length;i+=1){var n=t.get(i),r=n.advanceWidth||0,s=n.leftSideBearing||0;e.fields.push({name:"advanceWidth_"+i,type:"USHORT",value:r}),e.fields.push({name:"leftSideBearing_"+i,type:"SHORT",value:s})}return e}function Yt(t){for(var e=new Vs.Table("ltag",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"numTags",type:"ULONG",value:t.length}]),i="",n=12+4*t.length,r=0;r<t.length;++r){var s=i.indexOf(t[r]);s<0&&(s=i.length,i+=t[r]),e.fields.push({name:"offset "+r,type:"USHORT",value:n+s}),e.fields.push({name:"length "+r,type:"USHORT",value:t[r].length})}return e.fields.push({name:"stringPool",type:"CHARARRAY",value:i}),e}function $t(t,e){var i=new As.Parser(t,e),n=i.parseULong();Ss.argument(1===n,"Unsupported ltag table version."),i.skip("uLong",1);for(var r=i.parseULong(),s=[],o=0;o<r;o++){for(var a="",u=e+i.parseUShort(),l=i.parseUShort(),c=u;c<u+l;++c)a+=String.fromCharCode(t.getInt8(c));s.push(a)}return s}function Zt(t,e){var i={},n=new As.Parser(t,e);return i.version=n.parseVersion(),i.numGlyphs=n.parseUShort(),1===i.version&&(i.maxPoints=n.parseUShort(),i.maxContours=n.parseUShort(),i.maxCompositePoints=n.parseUShort(),i.maxCompositeContours=n.parseUShort(),i.maxZones=n.parseUShort(),i.maxTwilightPoints=n.parseUShort(),i.maxStorage=n.parseUShort(),i.maxFunctionDefs=n.parseUShort(),i.maxInstructionDefs=n.parseUShort(),i.maxStackElements=n.parseUShort(),i.maxSizeOfInstructions=n.parseUShort(),i.maxComponentElements=n.parseUShort(),i.maxComponentDepth=n.parseUShort()),i}function Qt(t){return new Vs.Table("maxp",[{name:"version",type:"FIXED",value:20480},{name:"numGlyphs",type:"USHORT",value:t}])}function Kt(t,e,i){switch(t){case 0:if(65535===e)return"und";if(i)return i[e];break;case 1:return Ks[e];case 3:return to[e]}}function Jt(t,e,i){switch(t){case 0:return eo;case 1:return no[i]||io[e];case 3:if(1===e||10===e)return eo}}function te(t,e,i){for(var n={},r=new As.Parser(t,e),s=r.parseUShort(),o=r.parseUShort(),a=r.offset+r.parseUShort(),u=0;u<o;u++){var l=r.parseUShort(),c=r.parseUShort(),h=r.parseUShort(),d=r.parseUShort(),p=Qs[d]||d,f=r.parseUShort(),g=r.parseUShort(),m=Kt(l,h,i),_=Jt(l,c,h);if(void 0!==_&&void 0!==m){var x=void 0;if(x=_===eo?Cs.UTF16(t,a+g,f):Cs.MACSTRING(t,a+g,f,_)){var y=n[p];void 0===y&&(y=n[p]={}),y[m]=x}}}return 1===s&&r.parseUShort(),n}function ee(t){var e={};for(var i in t)e[t[i]]=parseInt(i);return e}function ie(t,e,i,n,r,s){return new Vs.Record("NameRecord",[{name:"platformID",type:"USHORT",value:t},{name:"encodingID",type:"USHORT",value:e},{name:"languageID",type:"USHORT",value:i},{name:"nameID",type:"USHORT",value:n},{name:"length",type:"USHORT",value:r},{name:"offset",type:"USHORT",value:s}])}function ne(t,e){var i=t.length,n=e.length-i+1;t:for(var r=0;r<n;r++)for(;r<n;r++){for(var s=0;s<i;s++)if(e[r+s]!==t[s])continue t;return r}return-1}function re(t,e){var i=ne(t,e);if(i<0){i=e.length;for(var n=0,r=t.length;n<r;++n)e.push(t[n])}return i}function se(t,e){var i,n=[],r={},s=ee(Qs);for(var o in t){var a=s[o];if(void 0===a&&(a=o),i=parseInt(a),isNaN(i))throw new Error('Name table entry "'+o+'" does not exist, see nameTableNames for complete list.');r[i]=t[o],n.push(i)}for(var u=ee(Ks),l=ee(to),c=[],h=[],d=0;d<n.length;d++){i=n[d];var p=r[i];for(var f in p){var g=p[f],m=1,_=u[f],x=Js[_],y=Jt(m,x,_),v=Ts.MACSTRING(g,y);void 0===v&&(m=0,_=e.indexOf(f),_<0&&(_=e.length,e.push(f)),x=4,v=Ts.UTF16(g));var w=re(v,h);c.push(ie(m,x,_,i,v.length,w));var b=l[f];if(void 0!==b){var S=Ts.UTF16(g),C=re(S,h);c.push(ie(3,1,b,i,S.length,C))}}}c.sort(function(t,e){return t.platformID-e.platformID||t.encodingID-e.encodingID||t.languageID-e.languageID||t.nameID-e.nameID});for(var T=new Vs.Table("name",[{name:"format",type:"USHORT",value:0},{name:"count",type:"USHORT",value:c.length},{name:"stringOffset",type:"USHORT",value:6+12*c.length}]),F=0;F<c.length;F++)T.fields.push({name:"record_"+F,type:"RECORD",value:c[F]});return T.fields.push({name:"strings",type:"LITERAL",value:h}),T}function oe(t){for(var e=0;e<so.length;e+=1){var i=so[e];if(t>=i.begin&&t<i.end)return e}return-1}function ae(t,e){var i={},n=new As.Parser(t,e);i.version=n.parseUShort(),i.xAvgCharWidth=n.parseShort(),i.usWeightClass=n.parseUShort(),i.usWidthClass=n.parseUShort(),i.fsType=n.parseUShort(),i.ySubscriptXSize=n.parseShort(),i.ySubscriptYSize=n.parseShort(),i.ySubscriptXOffset=n.parseShort(),i.ySubscriptYOffset=n.parseShort(),i.ySuperscriptXSize=n.parseShort(),i.ySuperscriptYSize=n.parseShort(),i.ySuperscriptXOffset=n.parseShort(),i.ySuperscriptYOffset=n.parseShort(),i.yStrikeoutSize=n.parseShort(),i.yStrikeoutPosition=n.parseShort(),i.sFamilyClass=n.parseShort(),i.panose=[];for(var r=0;r<10;r++)i.panose[r]=n.parseByte();return i.ulUnicodeRange1=n.parseULong(),i.ulUnicodeRange2=n.parseULong(),i.ulUnicodeRange3=n.parseULong(),i.ulUnicodeRange4=n.parseULong(),i.achVendID=String.fromCharCode(n.parseByte(),n.parseByte(),n.parseByte(),n.parseByte()),i.fsSelection=n.parseUShort(),i.usFirstCharIndex=n.parseUShort(),i.usLastCharIndex=n.parseUShort(),i.sTypoAscender=n.parseShort(),i.sTypoDescender=n.parseShort(),i.sTypoLineGap=n.parseShort(),i.usWinAscent=n.parseUShort(),i.usWinDescent=n.parseUShort(),i.version>=1&&(i.ulCodePageRange1=n.parseULong(),i.ulCodePageRange2=n.parseULong()),i.version>=2&&(i.sxHeight=n.parseShort(),i.sCapHeight=n.parseShort(),i.usDefaultChar=n.parseUShort(),i.usBreakChar=n.parseUShort(),i.usMaxContent=n.parseUShort()),i}function ue(t){return new Vs.Table("OS/2",[{name:"version",type:"USHORT",value:3},{name:"xAvgCharWidth",type:"SHORT",value:0},{name:"usWeightClass",type:"USHORT",value:0},{name:"usWidthClass",type:"USHORT",value:0},{name:"fsType",type:"USHORT",value:0},{name:"ySubscriptXSize",type:"SHORT",value:650},{name:"ySubscriptYSize",type:"SHORT",value:699},{name:"ySubscriptXOffset",type:"SHORT",value:0},{name:"ySubscriptYOffset",type:"SHORT",value:140},{name:"ySuperscriptXSize",type:"SHORT",value:650},{name:"ySuperscriptYSize",type:"SHORT",value:699},{name:"ySuperscriptXOffset",type:"SHORT",value:0},{name:"ySuperscriptYOffset",type:"SHORT",value:479},{name:"yStrikeoutSize",type:"SHORT",value:49},{name:"yStrikeoutPosition",type:"SHORT",value:258},{name:"sFamilyClass",type:"SHORT",value:0},{name:"bFamilyType",type:"BYTE",value:0},{name:"bSerifStyle",type:"BYTE",value:0},{name:"bWeight",type:"BYTE",value:0},{name:"bProportion",type:"BYTE",value:0},{name:"bContrast",type:"BYTE",value:0},{name:"bStrokeVariation",type:"BYTE",value:0},{name:"bArmStyle",type:"BYTE",value:0},{name:"bLetterform",type:"BYTE",value:0},{name:"bMidline",type:"BYTE",value:0},{name:"bXHeight",type:"BYTE",value:0},{name:"ulUnicodeRange1",type:"ULONG",value:0},{name:"ulUnicodeRange2",type:"ULONG",value:0},{name:"ulUnicodeRange3",type:"ULONG",value:0},{name:"ulUnicodeRange4",type:"ULONG",value:0},{name:"achVendID",type:"CHARARRAY",value:"XXXX"},{name:"fsSelection",type:"USHORT",value:0},{name:"usFirstCharIndex",type:"USHORT",value:0},{name:"usLastCharIndex",type:"USHORT",value:0},{name:"sTypoAscender",type:"SHORT",value:0},{name:"sTypoDescender",type:"SHORT",value:0},{name:"sTypoLineGap",type:"SHORT",value:0},{name:"usWinAscent",type:"USHORT",value:0},{name:"usWinDescent",type:"USHORT",value:0},{name:"ulCodePageRange1",type:"ULONG",value:0},{name:"ulCodePageRange2",type:"ULONG",value:0},{name:"sxHeight",type:"SHORT",value:0},{name:"sCapHeight",type:"SHORT",value:0},{name:"usDefaultChar",type:"USHORT",value:0},{name:"usBreakChar",type:"USHORT",value:0},{name:"usMaxContext",type:"USHORT",value:0}],t)}function le(t,e){var i={},n=new As.Parser(t,e);switch(i.version=n.parseVersion(),i.italicAngle=n.parseFixed(),i.underlinePosition=n.parseShort(),i.underlineThickness=n.parseShort(),i.isFixedPitch=n.parseULong(),i.minMemType42=n.parseULong(),i.maxMemType42=n.parseULong(),i.minMemType1=n.parseULong(),i.maxMemType1=n.parseULong(),i.version){case 1:i.names=Us.slice();break;case 2:i.numberOfGlyphs=n.parseUShort(),i.glyphNameIndex=new Array(i.numberOfGlyphs);for(var r=0;r<i.numberOfGlyphs;r++)i.glyphNameIndex[r]=n.parseUShort();i.names=[];for(var s=0;s<i.numberOfGlyphs;s++)if(i.glyphNameIndex[s]>=Us.length){var o=n.parseChar();i.names.push(n.parseString(o))}break;case 2.5:i.numberOfGlyphs=n.parseUShort(),i.offset=new Array(i.numberOfGlyphs);for(var a=0;a<i.numberOfGlyphs;a++)i.offset[a]=n.parseChar()}return i}function ce(){return new Vs.Table("post",[{name:"version",type:"FIXED",value:196608},{name:"italicAngle",type:"FIXED",value:0},{name:"underlinePosition",type:"FWORD",value:0},{name:"underlineThickness",type:"FWORD",value:0},{name:"isFixedPitch",type:"ULONG",value:0},{name:"minMemType42",type:"ULONG",value:0},{name:"maxMemType42",type:"ULONG",value:0},{name:"minMemType1",type:"ULONG",value:0},{name:"maxMemType1",type:"ULONG",value:0}])}function he(t,e){e=e||0;var i=new k(t,e),n=i.parseVersion(1);return Ss.argument(1===n||1.1===n,"Unsupported GSUB table version."),1===n?{version:n,scripts:i.parseScriptList(),features:i.parseFeatureList(),lookups:i.parseLookupList(uo)}:{version:n,scripts:i.parseScriptList(),features:i.parseFeatureList(),lookups:i.parseLookupList(uo),variations:i.parseFeatureVariationsList()}}function de(t){return new Vs.Table("GSUB",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new Vs.ScriptList(t.scripts)},{name:"features",type:"TABLE",value:new Vs.FeatureList(t.features)},{name:"lookups",type:"TABLE",value:new Vs.LookupList(t.lookups,co)}])}function pe(t,e){var i=new As.Parser(t,e),n=i.parseULong();Ss.argument(1===n,"Unsupported META table version."),i.parseULong(),i.parseULong();for(var r=i.parseULong(),s={},o=0;o<r;o++){var a=i.parseTag(),u=i.parseULong(),l=i.parseULong(),c=Cs.UTF8(t,e+u,l);s[a]=c}return s}function fe(t){var e=Object.keys(t).length,i="",n=16+12*e,r=new Vs.Table("meta",[{name:"version",type:"ULONG",value:1},{name:"flags",type:"ULONG",value:0},{name:"offset",type:"ULONG",value:n},{name:"numTags",type:"ULONG",value:e}]);for(var s in t){var o=i.length;i+=t[s],r.fields.push({name:"tag "+s,type:"TAG",value:s}),r.fields.push({name:"offset "+s,type:"ULONG",value:n+o}),r.fields.push({name:"length "+s,type:"ULONG",value:t[s].length})}return r.fields.push({name:"stringPool",type:"CHARARRAY",value:i}),r}function ge(t){return Math.log(t)/Math.log(2)|0}function me(t){for(;t.length%4!=0;)t.push(0);for(var e=0,i=0;i<t.length;i+=4)e+=(t[i]<<24)+(t[i+1]<<16)+(t[i+2]<<8)+t[i+3];return e%=Math.pow(2,32)}function _e(t,e,i,n){return new Vs.Record("Table Record",[{name:"tag",type:"TAG",value:void 0!==t?t:""},{name:"checkSum",type:"ULONG",value:void 0!==e?e:0},{name:"offset",type:"ULONG",value:void 0!==i?i:0},{name:"length",type:"ULONG",value:void 0!==n?n:0}])}function xe(t){var e=new Vs.Table("sfnt",[{name:"version",type:"TAG",value:"OTTO"},{name:"numTables",type:"USHORT",value:0},{name:"searchRange",type:"USHORT",value:0},{name:"entrySelector",type:"USHORT",value:0},{name:"rangeShift",type:"USHORT",value:0}]);e.tables=t,e.numTables=t.length;var i=Math.pow(2,ge(e.numTables));e.searchRange=16*i,e.entrySelector=ge(i),e.rangeShift=16*e.numTables-e.searchRange;for(var n=[],r=[],s=e.sizeOf()+_e().sizeOf()*e.numTables;s%4!=0;)s+=1,r.push({name:"padding",type:"BYTE",value:0});for(var o=0;o<t.length;o+=1){var a=t[o];Ss.argument(4===a.tableName.length,"Table name"+a.tableName+" is invalid.");var u=a.sizeOf(),l=_e(a.tableName,me(a.encode()),s,u);for(n.push({name:l.tag+" Table Record",type:"RECORD",value:l}),r.push({name:a.tableName+" table",type:"RECORD",value:a}),s+=u,Ss.argument(!isNaN(s),"Something went wrong calculating the offset.");s%4!=0;)s+=1,r.push({name:"padding",type:"BYTE",value:0})}return n.sort(function(t,e){return t.value.tag>e.value.tag?1:-1}),e.fields=e.fields.concat(n),e.fields=e.fields.concat(r),e}function ye(t,e,i){for(var n=0;n<e.length;n+=1){var r=t.charToGlyphIndex(e[n]);if(r>0){return t.glyphs.get(r).getMetrics()}}return i}function ve(t){for(var e=0,i=0;i<t.length;i+=1)e+=t[i];return e/t.length}function we(t){for(var e,i=[],n=[],r=[],s=[],o=[],a=[],u=[],l=0,c=0,h=0,d=0,p=0,f=0;f<t.glyphs.length;f+=1){var g=t.glyphs.get(f),m=0|g.unicode;if(isNaN(g.advanceWidth))throw new Error("Glyph "+g.name+" ("+f+"): advanceWidth is not a number.");(e>m||void 0===e)&&m>0&&(e=m),l<m&&(l=m);var _=oo.getUnicodeRange(m);if(_<32)c|=1<<_;else if(_<64)h|=1<<_-32;else if(_<96)d|=1<<_-64;else{if(!(_<123))throw new Error("Unicode ranges bits > 123 are reserved for internal usage");p|=1<<_-96}if(".notdef"!==g.name){var x=g.getMetrics();i.push(x.xMin),n.push(x.yMin),r.push(x.xMax),s.push(x.yMax),a.push(x.leftSideBearing),u.push(x.rightSideBearing),o.push(g.advanceWidth)}}var y={xMin:Math.min.apply(null,i),yMin:Math.min.apply(null,n),xMax:Math.max.apply(null,r),yMax:Math.max.apply(null,s),advanceWidthMax:Math.max.apply(null,o),advanceWidthAvg:ve(o),minLeftSideBearing:Math.min.apply(null,a),maxLeftSideBearing:Math.max.apply(null,a),minRightSideBearing:Math.min.apply(null,u)};y.ascender=t.ascender,y.descender=t.descender;var v=qs.make({flags:3,unitsPerEm:t.unitsPerEm,xMin:y.xMin,yMin:y.yMin,xMax:y.xMax,yMax:y.yMax,lowestRecPPEM:3,createdTimestamp:t.createdTimestamp}),w=Ws.make({ascender:y.ascender,descender:y.descender,advanceWidthMax:y.advanceWidthMax,minLeftSideBearing:y.minLeftSideBearing,minRightSideBearing:y.minRightSideBearing,xMaxExtent:y.maxLeftSideBearing+(y.xMax-y.xMin),numberOfHMetrics:t.glyphs.length}),b=Zs.make(t.glyphs.length),S=oo.make(Object.assign({xAvgCharWidth:Math.round(y.advanceWidthAvg),usFirstCharIndex:e,usLastCharIndex:l,ulUnicodeRange1:c,ulUnicodeRange2:h,ulUnicodeRange3:d,ulUnicodeRange4:p,sTypoAscender:y.ascender,sTypoDescender:y.descender,sTypoLineGap:0,usWinAscent:y.yMax,usWinDescent:Math.abs(y.yMin),ulCodePageRange1:1,sxHeight:ye(t,"xyvw",{yMax:Math.round(y.ascender/2)}).yMax,sCapHeight:ye(t,"HIKLEFJMNTZBDPRAGOQSUVWXY",y).yMax,usDefaultChar:t.hasChar(" ")?32:0,usBreakChar:t.hasChar(" ")?32:0},t.tables.os2)),C=Ys.make(t.glyphs),T=Ps.make(t.glyphs),F=t.getEnglishName("fontFamily"),O=t.getEnglishName("fontSubfamily"),N=F+" "+O,E=t.getEnglishName("postScriptName");E||(E=F.replace(/\s/g,"")+"-"+O);var M={};for(var D in t.names)M[D]=t.names[D];M.uniqueID||(M.uniqueID={en:t.getEnglishName("manufacturer")+":"+N}),M.postScriptName||(M.postScriptName={en:E}),M.preferredFamily||(M.preferredFamily=t.names.fontFamily),M.preferredSubfamily||(M.preferredSubfamily=t.names.fontSubfamily);var V=[],I=ro.make(M,V),B=V.length>0?$s.make(V):void 0,A=ao.make(),P=Hs.make(t.glyphs,{version:t.getEnglishName("version"),fullName:N,familyName:F,weightName:O,postScriptName:E,unitsPerEm:t.unitsPerEm,fontBBox:[0,y.yMin,y.ascender,y.advanceWidthMax]}),L=t.metas&&Object.keys(t.metas).length>0?po.make(t.metas):void 0,R=[v,w,b,S,I,T,A,P,C];B&&R.push(B),t.tables.gsub&&R.push(ho.make(t.tables.gsub)),L&&R.push(L);for(var k=xe(R),U=k.encode(),X=me(U),j=k.fields,z=!1,G=0;G<j.length;G+=1)if("head table"===j[G].name){j[G].value.checkSumAdjustment=2981146554-X,z=!0;break}if(!z)throw new Error("Could not find head table with checkSum to adjust.");return k}function be(t,e){for(var i=0,n=t.length-1;i<=n;){var r=i+n>>>1,s=t[r].tag;if(s===e)return r;s<e?i=r+1:n=r-1}return-i-1}function Se(t,e){for(var i=0,n=t.length-1;i<=n;){var r=i+n>>>1,s=t[r];if(s===e)return r;s<e?i=r+1:n=r-1}return-i-1}function Ce(t,e){for(var i,n=0,r=t.length-1;n<=r;){var s=n+r>>>1;i=t[s];var o=i.start;if(o===e)return i;o<e?n=s+1:r=s-1}if(n>0)return i=t[n-1],e>i.end?0:i}function Te(t,e){this.font=t,this.tableName=e}function Fe(t){Te.call(this,t,"gpos")}function Oe(t){Te.call(this,t,"gsub")}function Ne(t,e){var i=t.length;if(i!==e.length)return!1;for(var n=0;n<i;n++)if(t[n]!==e[n])return!1;return!0}function Ee(t,e,i){for(var n=t.subtables,r=0;r<n.length;r++){var s=n[r];if(s.substFormat===e)return s}if(i)return n.push(i),i}function Me(){return"undefined"!=typeof window}function De(t){for(var e=new ArrayBuffer(t.length),i=new Uint8Array(e),n=0;n<t.length;++n)i[n]=t[n];return e}function Ve(t){for(var e=new Buffer(t.byteLength),i=new Uint8Array(t),n=0;n<e.length;++n)e[n]=i[n];return e}function Ie(t,e){if(!t)throw e}function Be(t,e,i,n,r){var s;return(e&n)>0?(s=t.parseByte(),0==(e&r)&&(s=-s),s=i+s):s=(e&r)>0?i:i+t.parseShort(),s}function Ae(t,e,i){var n=new As.Parser(e,i);t.numberOfContours=n.parseShort(),t._xMin=n.parseShort(),t._yMin=n.parseShort(),t._xMax=n.parseShort(),t._yMax=n.parseShort();var r,s;if(t.numberOfContours>0){for(var o=t.endPointIndices=[],a=0;a<t.numberOfContours;a+=1)o.push(n.parseUShort());t.instructionLength=n.parseUShort(),t.instructions=[];for(var u=0;u<t.instructionLength;u+=1)t.instructions.push(n.parseByte());var l=o[o.length-1]+1;r=[];for(var c=0;c<l;c+=1)if(s=n.parseByte(),r.push(s),(8&s)>0)for(var h=n.parseByte(),d=0;d<h;d+=1)r.push(s),c+=1;if(Ss.argument(r.length===l,"Bad flags."),o.length>0){var p,f=[];if(l>0){for(var g=0;g<l;g+=1)s=r[g],p={},p.onCurve=!!(1&s),p.lastPointOfContour=o.indexOf(g)>=0,f.push(p);for(var m=0,_=0;_<l;_+=1)s=r[_],p=f[_],p.x=Be(n,s,m,2,16),m=p.x;for(var x=0,y=0;y<l;y+=1)s=r[y],p=f[y],p.y=Be(n,s,x,4,32),x=p.y}t.points=f}else t.points=[]}else if(0===t.numberOfContours)t.points=[];else{t.isComposite=!0,t.points=[],t.components=[];for(var v=!0;v;){r=n.parseUShort();var w={glyphIndex:n.parseUShort(),xScale:1,scale01:0,scale10:0,yScale:1,dx:0,dy:0};(1&r)>0?(2&r)>0?(w.dx=n.parseShort(),w.dy=n.parseShort()):w.matchedPoints=[n.parseUShort(),n.parseUShort()]:(2&r)>0?(w.dx=n.parseChar(),w.dy=n.parseChar()):w.matchedPoints=[n.parseByte(),n.parseByte()],(8&r)>0?w.xScale=w.yScale=n.parseF2Dot14():(64&r)>0?(w.xScale=n.parseF2Dot14(),w.yScale=n.parseF2Dot14()):(128&r)>0&&(w.xScale=n.parseF2Dot14(),w.scale01=n.parseF2Dot14(),w.scale10=n.parseF2Dot14(),w.yScale=n.parseF2Dot14()),t.components.push(w),v=!!(32&r)}if(256&r){t.instructionLength=n.parseUShort(),t.instructions=[];for(var b=0;b<t.instructionLength;b+=1)t.instructions.push(n.parseByte())}}}function Pe(t,e){for(var i=[],n=0;n<t.length;n+=1){var r=t[n],s={x:e.xScale*r.x+e.scale01*r.y+e.dx,y:e.scale10*r.x+e.yScale*r.y+e.dy,onCurve:r.onCurve,lastPointOfContour:r.lastPointOfContour};i.push(s)}return i}function Le(t){for(var e=[],i=[],n=0;n<t.length;n+=1){var r=t[n];i.push(r),r.lastPointOfContour&&(e.push(i),i=[])}return Ss.argument(0===i.length,"There are still points left in the current contour."),e}function Re(t){var e=new f;if(!t)return e;for(var i=Le(t),n=0;n<i.length;++n){var r=i[n],s=null,o=r[r.length-1],a=r[0];if(o.onCurve)e.moveTo(o.x,o.y);else if(a.onCurve)e.moveTo(a.x,a.y);else{var u={x:.5*(o.x+a.x),y:.5*(o.y+a.y)};e.moveTo(u.x,u.y)}for(var l=0;l<r.length;++l)if(s=o,o=a,a=r[(l+1)%r.length],o.onCurve)e.lineTo(o.x,o.y);else{var c=a;s.onCurve||{x:.5*(o.x+s.x),y:.5*(o.y+s.y)},a.onCurve||(c={x:.5*(o.x+a.x),y:.5*(o.y+a.y)}),e.quadraticCurveTo(o.x,o.y,c.x,c.y)}e.closePath()}return e}function ke(t,e){if(e.isComposite)for(var i=0;i<e.components.length;i+=1){var n=e.components[i],r=t.get(n.glyphIndex);if(r.getPath(),r.points){var s=void 0;if(void 0===n.matchedPoints)s=Pe(r.points,n);else{if(n.matchedPoints[0]>e.points.length-1||n.matchedPoints[1]>r.points.length-1)throw Error("Matched points out of range in "+e.name);var o=e.points[n.matchedPoints[0]],a=r.points[n.matchedPoints[1]],u={xScale:n.xScale,scale01:n.scale01,scale10:n.scale10,yScale:n.yScale,dx:0,dy:0};a=Pe([a],u)[0],u.dx=o.x-a.x,u.dy=o.y-a.y,s=Pe(r.points,u)}e.points=e.points.concat(s)}}return Re(e.points)}function Ue(t,e,i,n){for(var r=new js.GlyphSet(n),s=0;s<i.length-1;s+=1){var o=i[s];o!==i[s+1]?r.push(s,js.ttfGlyphLoader(n,s,Ae,t,e+o,ke)):r.push(s,js.glyphLoader(n,s))}return r}function Xe(t,e,i,n){var r=new js.GlyphSet(n);return n._push=function(s){var o=i[s];o!==i[s+1]?r.push(s,js.ttfGlyphLoader(n,s,Ae,t,e+o,ke)):r.push(s,js.glyphLoader(n,s))},r}function je(t,e,i,n,r){return r.lowMemory?Xe(t,e,i,n):Ue(t,e,i,n)}function ze(t){this.font=t,this.getCommands=function(t){return yo.getPath(t).commands},this._fpgmState=this._prepState=void 0,this._errorState=0}function Ge(t){return t}function He(t){return Math.sign(t)*Math.round(Math.abs(t))}function qe(t){return Math.sign(t)*Math.round(Math.abs(2*t))/2}function We(t){return Math.sign(t)*(Math.round(Math.abs(t)+.5)-.5)}function Ye(t){return Math.sign(t)*Math.ceil(Math.abs(t))}function $e(t){return Math.sign(t)*Math.floor(Math.abs(t))}function Ze(t,e){this.x=t,this.y=e,this.axis=void 0,this.slope=e/t,this.normalSlope=-t/e,Object.freeze(this)}function Qe(t,e){var i=Math.sqrt(t*t+e*e);return t/=i,e/=i,1===t&&0===e?wo:0===t&&1===e?bo:new Ze(t,e)}function Ke(t,e,i,n){this.x=this.xo=Math.round(64*t)/64,this.y=this.yo=Math.round(64*e)/64,this.lastPointOfContour=i,this.onCurve=n,this.prevPointOnContour=void 0,this.nextPointOnContour=void 0,this.xTouched=!1,this.yTouched=!1,Object.preventExtensions(this)}function Je(t,e){switch(this.env=t,this.stack=[],this.prog=e,t){case"glyf":this.zp0=this.zp1=this.zp2=1,this.rp0=this.rp1=this.rp2=0;case"prep":this.fv=this.pv=this.dpv=wo,this.round=He}}function ti(t){for(var e=t.tZone=new Array(t.gZone.length),i=0;i<e.length;i++)e[i]=new Ke(0,0)}function ei(t,e){var i,n=t.prog,r=t.ip,s=1;do if(88===(i=n[++r]))s++;else if(89===i)s--;else if(64===i)r+=n[r+1]+1;else if(65===i)r+=2*n[r+1]+1;else if(i>=176&&i<=183)r+=i-176+1;else if(i>=184&&i<=191)r+=2*(i-184+1);else if(e&&1===s&&27===i)break;while(s>0)t.ip=r}function ii(e,i){t.DEBUG&&console.log(i.step,"SVTCA["+e.axis+"]"),i.fv=i.pv=i.dpv=e}function ni(e,i){t.DEBUG&&console.log(i.step,"SPVTCA["+e.axis+"]"),i.pv=i.dpv=e}function ri(e,i){t.DEBUG&&console.log(i.step,"SFVTCA["+e.axis+"]"),i.fv=e}function si(e,i){var n=i.stack,r=n.pop(),s=n.pop(),o=i.z2[r],a=i.z1[s];t.DEBUG&&console.log("SPVTL["+e+"]",r,s);var u,l;e?(u=o.y-a.y,l=a.x-o.x):(u=a.x-o.x,l=a.y-o.y),i.pv=i.dpv=Qe(u,l)}function oi(e,i){var n=i.stack,r=n.pop(),s=n.pop(),o=i.z2[r],a=i.z1[s];t.DEBUG&&console.log("SFVTL["+e+"]",r,s);var u,l;e?(u=o.y-a.y,l=a.x-o.x):(u=a.x-o.x,l=a.y-o.y),i.fv=Qe(u,l)}function ai(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"SPVFS[]",n,r),e.pv=e.dpv=Qe(r,n)}function ui(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"SPVFS[]",n,r),e.fv=Qe(r,n)}function li(e){var i=e.stack,n=e.pv
|
|
31
|
+
;t.DEBUG&&console.log(e.step,"GPV[]"),i.push(16384*n.x),i.push(16384*n.y)}function ci(e){var i=e.stack,n=e.fv;t.DEBUG&&console.log(e.step,"GFV[]"),i.push(16384*n.x),i.push(16384*n.y)}function hi(e){e.fv=e.pv,t.DEBUG&&console.log(e.step,"SFVTPV[]")}function di(e){var i=e.stack,n=i.pop(),r=i.pop(),s=i.pop(),o=i.pop(),a=i.pop(),u=e.z0,l=e.z1,c=u[n],h=u[r],d=l[s],p=l[o],f=e.z2[a];t.DEBUG&&console.log("ISECT[], ",n,r,s,o,a);var g=c.x,m=c.y,_=h.x,x=h.y,y=d.x,v=d.y,w=p.x,b=p.y,S=(g-_)*(v-b)-(m-x)*(y-w),C=g*x-m*_,T=y*b-v*w;f.x=(C*(y-w)-T*(g-_))/S,f.y=(C*(v-b)-T*(m-x))/S}function pi(e){e.rp0=e.stack.pop(),t.DEBUG&&console.log(e.step,"SRP0[]",e.rp0)}function fi(e){e.rp1=e.stack.pop(),t.DEBUG&&console.log(e.step,"SRP1[]",e.rp1)}function gi(e){e.rp2=e.stack.pop(),t.DEBUG&&console.log(e.step,"SRP2[]",e.rp2)}function mi(e){var i=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"SZP0[]",i),e.zp0=i,i){case 0:e.tZone||ti(e),e.z0=e.tZone;break;case 1:e.z0=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function _i(e){var i=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"SZP1[]",i),e.zp1=i,i){case 0:e.tZone||ti(e),e.z1=e.tZone;break;case 1:e.z1=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function xi(e){var i=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"SZP2[]",i),e.zp2=i,i){case 0:e.tZone||ti(e),e.z2=e.tZone;break;case 1:e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function yi(e){var i=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"SZPS[]",i),e.zp0=e.zp1=e.zp2=i,i){case 0:e.tZone||ti(e),e.z0=e.z1=e.z2=e.tZone;break;case 1:e.z0=e.z1=e.z2=e.gZone;break;default:throw new Error("Invalid zone pointer")}}function vi(e){e.loop=e.stack.pop(),t.DEBUG&&console.log(e.step,"SLOOP[]",e.loop)}function wi(e){t.DEBUG&&console.log(e.step,"RTG[]"),e.round=He}function bi(e){t.DEBUG&&console.log(e.step,"RTHG[]"),e.round=We}function Si(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"SMD[]",i),e.minDis=i/64}function Ci(e){t.DEBUG&&console.log(e.step,"ELSE[]"),ei(e,!1)}function Ti(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"JMPR[]",i),e.ip+=i-1}function Fi(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"SCVTCI[]",i),e.cvCutIn=i/64}function Oi(e){var i=e.stack;t.DEBUG&&console.log(e.step,"DUP[]"),i.push(i[i.length-1])}function Ni(e){t.DEBUG&&console.log(e.step,"POP[]"),e.stack.pop()}function Ei(e){t.DEBUG&&console.log(e.step,"CLEAR[]"),e.stack.length=0}function Mi(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"SWAP[]"),i.push(n),i.push(r)}function Di(e){var i=e.stack;t.DEBUG&&console.log(e.step,"DEPTH[]"),i.push(i.length)}function Vi(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"LOOPCALL[]",n,r);var s=e.ip,o=e.prog;e.prog=e.funcs[n];for(var a=0;a<r;a++)mo(e),t.DEBUG&&console.log(++e.step,a+1<r?"next loopcall":"done loopcall",a);e.ip=s,e.prog=o}function Ii(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"CALL[]",i);var n=e.ip,r=e.prog;e.prog=e.funcs[i],mo(e),e.ip=n,e.prog=r,t.DEBUG&&console.log(++e.step,"returning from",i)}function Bi(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"CINDEX[]",n),i.push(i[i.length-n])}function Ai(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"MINDEX[]",n),i.push(i.splice(i.length-n,1)[0])}function Pi(e){if("fpgm"!==e.env)throw new Error("FDEF not allowed here");var i=e.stack,n=e.prog,r=e.ip,s=i.pop(),o=r;for(t.DEBUG&&console.log(e.step,"FDEF[]",s);45!==n[++r];);e.ip=r,e.funcs[s]=n.slice(o+1,r)}function Li(e,i){var n=i.stack.pop(),r=i.z0[n],s=i.fv,o=i.pv;t.DEBUG&&console.log(i.step,"MDAP["+e+"]",n);var a=o.distance(r,So);e&&(a=i.round(a)),s.setRelative(r,So,a,o),s.touch(r),i.rp0=i.rp1=n}function Ri(e,i){var n,r,s,o=i.z2,a=o.length-2;t.DEBUG&&console.log(i.step,"IUP["+e.axis+"]");for(var u=0;u<a;u++)n=o[u],e.touched(n)||(r=n.prevTouched(e))!==n&&(s=n.nextTouched(e),r===s&&e.setRelative(n,n,e.distance(r,r,!1,!0),e,!0),e.interpolate(n,r,s,e))}function ki(e,i){for(var n=i.stack,r=e?i.rp1:i.rp2,s=(e?i.z0:i.z1)[r],o=i.fv,a=i.pv,u=i.loop,l=i.z2;u--;){var c=n.pop(),h=l[c],d=a.distance(s,s,!1,!0);o.setRelative(h,h,d,a),o.touch(h),t.DEBUG&&console.log(i.step,(i.loop>1?"loop "+(i.loop-u)+": ":"")+"SHP["+(e?"rp1":"rp2")+"]",c)}i.loop=1}function Ui(e,i){var n=i.stack,r=e?i.rp1:i.rp2,s=(e?i.z0:i.z1)[r],o=i.fv,a=i.pv,u=n.pop(),l=i.z2[i.contours[u]],c=l;t.DEBUG&&console.log(i.step,"SHC["+e+"]",u);var h=a.distance(s,s,!1,!0);do c!==s&&o.setRelative(c,c,h,a),c=c.nextPointOnContour;while(c!==l)}function Xi(e,i){var n=i.stack,r=e?i.rp1:i.rp2,s=(e?i.z0:i.z1)[r],o=i.fv,a=i.pv,u=n.pop();t.DEBUG&&console.log(i.step,"SHZ["+e+"]",u);var l;switch(u){case 0:l=i.tZone;break;case 1:l=i.gZone;break;default:throw new Error("Invalid zone")}for(var c,h=a.distance(s,s,!1,!0),d=l.length-2,p=0;p<d;p++)c=l[p],o.setRelative(c,c,h,a)}function ji(e){for(var i=e.stack,n=e.loop,r=e.fv,s=i.pop()/64,o=e.z2;n--;){var a=i.pop(),u=o[a];t.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-n)+": ":"")+"SHPIX[]",a,s),r.setRelative(u,u,s),r.touch(u)}e.loop=1}function zi(e){for(var i=e.stack,n=e.rp1,r=e.rp2,s=e.loop,o=e.z0[n],a=e.z1[r],u=e.fv,l=e.dpv,c=e.z2;s--;){var h=i.pop(),d=c[h];t.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-s)+": ":"")+"IP[]",h,n,"<->",r),u.interpolate(d,o,a,l),u.touch(d)}e.loop=1}function Gi(e,i){var n=i.stack,r=n.pop()/64,s=n.pop(),o=i.z1[s],a=i.z0[i.rp0],u=i.fv,l=i.pv;u.setRelative(o,a,r,l),u.touch(o),t.DEBUG&&console.log(i.step,"MSIRP["+e+"]",r,s),i.rp1=i.rp0,i.rp2=s,e&&(i.rp0=s)}function Hi(e){for(var i=e.stack,n=e.rp0,r=e.z0[n],s=e.loop,o=e.fv,a=e.pv,u=e.z1;s--;){var l=i.pop(),c=u[l];t.DEBUG&&console.log(e.step,(e.loop>1?"loop "+(e.loop-s)+": ":"")+"ALIGNRP[]",l),o.setRelative(c,r,0,a),o.touch(c)}e.loop=1}function qi(e){t.DEBUG&&console.log(e.step,"RTDG[]"),e.round=qe}function Wi(e,i){var n=i.stack,r=n.pop(),s=n.pop(),o=i.z0[s],a=i.fv,u=i.pv,l=i.cvt[r];t.DEBUG&&console.log(i.step,"MIAP["+e+"]",r,"(",l,")",s);var c=u.distance(o,So);e&&(Math.abs(c-l)<i.cvCutIn&&(c=l),c=i.round(c)),a.setRelative(o,So,c,u),0===i.zp0&&(o.xo=o.x,o.yo=o.y),a.touch(o),i.rp0=i.rp1=s}function Yi(e){var i=e.prog,n=e.ip,r=e.stack,s=i[++n];t.DEBUG&&console.log(e.step,"NPUSHB[]",s);for(var o=0;o<s;o++)r.push(i[++n]);e.ip=n}function $i(e){var i=e.ip,n=e.prog,r=e.stack,s=n[++i];t.DEBUG&&console.log(e.step,"NPUSHW[]",s);for(var o=0;o<s;o++){var a=n[++i]<<8|n[++i];32768&a&&(a=-(1+(65535^a))),r.push(a)}e.ip=i}function Zi(e){var i=e.stack,n=e.store;n||(n=e.store=[]);var r=i.pop(),s=i.pop();t.DEBUG&&console.log(e.step,"WS",r,s),n[s]=r}function Qi(e){var i=e.stack,n=e.store,r=i.pop();t.DEBUG&&console.log(e.step,"RS",r);var s=n&&n[r]||0;i.push(s)}function Ki(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"WCVTP",n,r),e.cvt[r]=n/64}function Ji(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"RCVT",n),i.push(64*e.cvt[n])}function tn(e,i){var n=i.stack,r=n.pop(),s=i.z2[r];t.DEBUG&&console.log(i.step,"GC["+e+"]",r),n.push(64*i.dpv.distance(s,So,e,!1))}function en(e,i){var n=i.stack,r=n.pop(),s=n.pop(),o=i.z1[r],a=i.z0[s],u=i.dpv.distance(a,o,e,e);t.DEBUG&&console.log(i.step,"MD["+e+"]",r,s,"->",u),i.stack.push(Math.round(64*u))}function nn(e){t.DEBUG&&console.log(e.step,"MPPEM[]"),e.stack.push(e.ppem)}function rn(e){t.DEBUG&&console.log(e.step,"FLIPON[]"),e.autoFlip=!0}function sn(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"LT[]",n,r),i.push(r<n?1:0)}function on(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"LTEQ[]",n,r),i.push(r<=n?1:0)}function an(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"GT[]",n,r),i.push(r>n?1:0)}function un(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"GTEQ[]",n,r),i.push(r>=n?1:0)}function ln(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"EQ[]",n,r),i.push(n===r?1:0)}function cn(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"NEQ[]",n,r),i.push(n!==r?1:0)}function hn(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"ODD[]",n),i.push(Math.trunc(n)%2?1:0)}function dn(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"EVEN[]",n),i.push(Math.trunc(n)%2?0:1)}function pn(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"IF[]",i),i||(ei(e,!0),t.DEBUG&&console.log(e.step,"EIF[]"))}function fn(e){t.DEBUG&&console.log(e.step,"EIF[]")}function gn(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"AND[]",n,r),i.push(n&&r?1:0)}function mn(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"OR[]",n,r),i.push(n||r?1:0)}function _n(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"NOT[]",n),i.push(n?0:1)}function xn(e,i){var n=i.stack,r=n.pop(),s=i.fv,o=i.pv,a=i.ppem,u=i.deltaBase+16*(e-1),l=i.deltaShift,c=i.z0;t.DEBUG&&console.log(i.step,"DELTAP["+e+"]",r,n);for(var h=0;h<r;h++){var d=n.pop(),p=n.pop();if(u+((240&p)>>4)===a){var f=(15&p)-8;f>=0&&f++,t.DEBUG&&console.log(i.step,"DELTAPFIX",d,"by",f*l);var g=c[d];s.setRelative(g,g,f*l,o)}}}function yn(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"SDB[]",n),e.deltaBase=n}function vn(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"SDS[]",n),e.deltaShift=Math.pow(.5,n)}function wn(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"ADD[]",n,r),i.push(r+n)}function bn(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"SUB[]",n,r),i.push(r-n)}function Sn(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"DIV[]",n,r),i.push(64*r/n)}function Cn(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"MUL[]",n,r),i.push(r*n/64)}function Tn(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"ABS[]",n),i.push(Math.abs(n))}function Fn(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"NEG[]",n),i.push(-n)}function On(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"FLOOR[]",n),i.push(64*Math.floor(n/64))}function Nn(e){var i=e.stack,n=i.pop();t.DEBUG&&console.log(e.step,"CEILING[]",n),i.push(64*Math.ceil(n/64))}function En(e,i){var n=i.stack,r=n.pop();t.DEBUG&&console.log(i.step,"ROUND[]"),n.push(64*i.round(r/64))}function Mn(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"WCVTF[]",n,r),e.cvt[r]=n*e.ppem/e.font.unitsPerEm}function Dn(e,i){var n=i.stack,r=n.pop(),s=i.ppem,o=i.deltaBase+16*(e-1),a=i.deltaShift;t.DEBUG&&console.log(i.step,"DELTAC["+e+"]",r,n);for(var u=0;u<r;u++){var l=n.pop(),c=n.pop();if(o+((240&c)>>4)===s){var h=(15&c)-8;h>=0&&h++;var d=h*a;t.DEBUG&&console.log(i.step,"DELTACFIX",l,"by",d),i.cvt[l]+=d}}}function Vn(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"SROUND[]",i),e.round=vo;var n;switch(192&i){case 0:n=.5;break;case 64:n=1;break;case 128:n=2;break;default:throw new Error("invalid SROUND value")}switch(e.srPeriod=n,48&i){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*n;break;case 32:e.srPhase=.5*n;break;case 48:e.srPhase=.75*n;break;default:throw new Error("invalid SROUND value")}i&=15,e.srThreshold=0===i?0:(i/8-.5)*n}function In(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"S45ROUND[]",i),e.round=vo;var n;switch(192&i){case 0:n=Math.sqrt(2)/2;break;case 64:n=Math.sqrt(2);break;case 128:n=2*Math.sqrt(2);break;default:throw new Error("invalid S45ROUND value")}switch(e.srPeriod=n,48&i){case 0:e.srPhase=0;break;case 16:e.srPhase=.25*n;break;case 32:e.srPhase=.5*n;break;case 48:e.srPhase=.75*n;break;default:throw new Error("invalid S45ROUND value")}i&=15,e.srThreshold=0===i?0:(i/8-.5)*n}function Bn(e){t.DEBUG&&console.log(e.step,"ROFF[]"),e.round=Ge}function An(e){t.DEBUG&&console.log(e.step,"RUTG[]"),e.round=Ye}function Pn(e){t.DEBUG&&console.log(e.step,"RDTG[]"),e.round=$e}function Ln(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"SCANCTRL[]",i)}function Rn(e,i){var n=i.stack,r=n.pop(),s=n.pop(),o=i.z2[r],a=i.z1[s];t.DEBUG&&console.log(i.step,"SDPVTL["+e+"]",r,s);var u,l;e?(u=o.y-a.y,l=a.x-o.x):(u=a.x-o.x,l=a.y-o.y),i.dpv=Qe(u,l)}function kn(e){var i=e.stack,n=i.pop(),r=0;t.DEBUG&&console.log(e.step,"GETINFO[]",n),1&n&&(r=35),32&n&&(r|=4096),i.push(r)}function Un(e){var i=e.stack,n=i.pop(),r=i.pop(),s=i.pop();t.DEBUG&&console.log(e.step,"ROLL[]"),i.push(r),i.push(n),i.push(s)}function Xn(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"MAX[]",n,r),i.push(Math.max(r,n))}function jn(e){var i=e.stack,n=i.pop(),r=i.pop();t.DEBUG&&console.log(e.step,"MIN[]",n,r),i.push(Math.min(r,n))}function zn(e){var i=e.stack.pop();t.DEBUG&&console.log(e.step,"SCANTYPE[]",i)}function Gn(e){var i=e.stack.pop(),n=e.stack.pop();switch(t.DEBUG&&console.log(e.step,"INSTCTRL[]",i,n),i){case 1:return void(e.inhibitGridFit=!!n);case 2:return void(e.ignoreCvt=!!n);default:throw new Error("invalid INSTCTRL[] selector")}}function Hn(e,i){var n=i.stack,r=i.prog,s=i.ip;t.DEBUG&&console.log(i.step,"PUSHB["+e+"]");for(var o=0;o<e;o++)n.push(r[++s]);i.ip=s}function qn(e,i){var n=i.ip,r=i.prog,s=i.stack;t.DEBUG&&console.log(i.ip,"PUSHW["+e+"]");for(var o=0;o<e;o++){var a=r[++n]<<8|r[++n];32768&a&&(a=-(1+(65535^a))),s.push(a)}i.ip=n}function Wn(e,i,n,r,s,o){var a,u,l,c,h=o.stack,d=e&&h.pop(),p=h.pop(),f=o.rp0,g=o.z0[f],m=o.z1[p],_=o.minDis,x=o.fv,y=o.dpv;u=a=y.distance(m,g,!0,!0),l=u>=0?1:-1,u=Math.abs(u),e&&(c=o.cvt[d],r&&Math.abs(u-c)<o.cvCutIn&&(u=c)),n&&u<_&&(u=_),r&&(u=o.round(u)),x.setRelative(m,g,l*u,y),x.touch(m),t.DEBUG&&console.log(o.step,(e?"MIRP[":"MDRP[")+(i?"M":"m")+(n?">":"_")+(r?"R":"_")+(0===s?"Gr":1===s?"Bl":2===s?"Wh":"")+"]",e?d+"("+o.cvt[d]+","+c+")":"",p,"(d =",a,"->",l*u,")"),o.rp1=o.rp0,o.rp2=p,i&&(o.rp0=p)}function Yn(t){this.char=t,this.state={},this.activeState=null}function $n(t,e,i){this.contextName=i,this.startIndex=t,this.endOffset=e}function Zn(t,e,i){this.contextName=t,this.openRange=null,this.ranges=[],this.checkStart=e,this.checkEnd=i}function Qn(t,e){this.context=t,this.index=e,this.length=t.length,this.current=t[e],this.backtrack=t.slice(0,e),this.lookahead=t.slice(e+1)}function Kn(t){this.eventId=t,this.subscribers=[]}function Jn(t){var e=this,i=["start","end","next","newToken","contextStart","contextEnd","insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD","updateContextsRanges"];i.forEach(function(t){Object.defineProperty(e.events,t,{value:new Kn(t)})}),t&&i.forEach(function(i){var n=t[i];"function"==typeof n&&e.events[i].subscribe(n)}),["insertToken","removeToken","removeRange","replaceToken","replaceRange","composeRUD"].forEach(function(t){e.events[t].subscribe(e.updateContextsRanges)})}function tr(t){this.tokens=[],this.registeredContexts={},this.contextCheckers=[],this.events={},this.registeredModifiers=[],Jn.call(this,t)}function er(t){return/[\u0600-\u065F\u066A-\u06D2\u06FA-\u06FF]/.test(t)}function ir(t){return/[\u0630\u0690\u0621\u0631\u0661\u0671\u0622\u0632\u0672\u0692\u06C2\u0623\u0673\u0693\u06C3\u0624\u0694\u06C4\u0625\u0675\u0695\u06C5\u06E5\u0676\u0696\u06C6\u0627\u0677\u0697\u06C7\u0648\u0688\u0698\u06C8\u0689\u0699\u06C9\u068A\u06CA\u066B\u068B\u06CB\u068C\u068D\u06CD\u06FD\u068E\u06EE\u06FE\u062F\u068F\u06CF\u06EF]/.test(t)}function nr(t){return/[\u0600-\u0605\u060C-\u060E\u0610-\u061B\u061E\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED]/.test(t)}function rr(t){return/[A-z]/.test(t)}function sr(t){return/\s/.test(t)}function or(t){this.font=t,this.features={}}function ar(t){this.id=t.id,this.tag=t.tag,this.substitution=t.substitution}function ur(t,e){if(!t)return-1;switch(e.format){case 1:return e.glyphs.indexOf(t);case 2:for(var i=e.ranges,n=0;n<i.length;n++){var r=i[n];if(t>=r.start&&t<=r.end){var s=t-r.start;return r.index+s}}break;default:return-1}return-1}function lr(t,e){return ur(t,e.coverage)===-1?null:t+e.deltaGlyphId}function cr(t,e){var i=ur(t,e.coverage);return i===-1?null:e.substitute[i]}function hr(t,e){for(var i=[],n=0;n<t.length;n++){var r=t[n],s=e.current;s=Array.isArray(s)?s[0]:s;var o=ur(s,r);o!==-1&&i.push(o)}return i.length!==t.length?-1:i}function dr(t,e){var i=e.inputCoverage.length+e.lookaheadCoverage.length+e.backtrackCoverage.length;if(t.context.length<i)return[];var n=hr(e.inputCoverage,t);if(n===-1)return[];var r=e.inputCoverage.length-1;if(t.lookahead.length<e.lookaheadCoverage.length)return[];for(var s=t.lookahead.slice(r);s.length&&nr(s[0].char);)s.shift();var o=new Qn(s,0),a=hr(e.lookaheadCoverage,o),u=[].concat(t.backtrack);for(u.reverse();u.length&&nr(u[0].char);)u.shift();if(u.length<e.backtrackCoverage.length)return[];var l=new Qn(u,0),c=hr(e.backtrackCoverage,l),h=n.length===e.inputCoverage.length&&a.length===e.lookaheadCoverage.length&&c.length===e.backtrackCoverage.length,d=[];if(h)for(var p=0;p<e.lookupRecords.length;p++)for(var f=e.lookupRecords[p],g=f.lookupListIndex,m=this.getLookupByIndex(g),_=0;_<m.subtables.length;_++){var x=m.subtables[_],y=this.getLookupMethod(m,x),v=this.getSubstitutionType(m,x);if("12"===v)for(var w=0;w<n.length;w++){var b=t.get(w),S=y(b);S&&d.push(S)}}return d}function pr(t,e){var i=t.current,n=ur(i,e.coverage);if(n===-1)return null;for(var r,s=e.ligatureSets[n],o=0;o<s.length;o++){r=s[o];for(var a=0;a<r.components.length;a++){if(t.lookahead[a]!==r.components[a])break;if(a===r.components.length-1)return r}}return null}function fr(t,e){var i=ur(t,e.coverage);return i===-1?null:e.sequences[i]}function gr(t){var e=t.current,i=t.get(-1);return null===i&&er(e)||!er(i)&&er(e)}function mr(t){var e=t.get(1);return null===e||!er(e)}function _r(t){var e=t.current,i=t.get(-1);return(er(e)||nr(e))&&!er(i)}function xr(t){var e=t.get(1);switch(!0){case null===e:return!0;case!er(e)&&!nr(e):var i=sr(e);if(!i)return!0;if(i){if(!t.lookahead.some(function(t){return er(t)||nr(t)}))return!0}break;default:return!1}}function yr(t,e,i){e[i].setState(t.tag,t.substitution)}function vr(t,e,i){e[i].setState(t.tag,t.substitution)}function wr(t,e,i){t.substitution.forEach(function(n,r){e[i+r].setState(t.tag,n)})}function br(t,e,i){var n=e[i];n.setState(t.tag,t.substitution.ligGlyph);for(var r=t.substitution.components.length,s=0;s<r;s++)n=e[i+s+1],n.setState("deleted",!0)}function Sr(t,e,i){t instanceof ar&&Oo[t.id]&&Oo[t.id](t,e,i)}function Cr(t){for(var e=[].concat(t.backtrack),i=e.length-1;i>=0;i--){var n=e[i],r=ir(n),s=nr(n);if(!r&&!s)return!0;if(r)return!1}return!1}function Tr(t){if(ir(t.current))return!1;for(var e=0;e<t.lookahead.length;e++){if(!nr(t.lookahead[e]))return!0}return!1}function Fr(t){var e=this,i=this.featuresTags.arab,n=this.tokenizer.getRangeTokens(t);if(1!==n.length){var r=new Qn(n.map(function(t){return t.getState("glyphIndex")}),0),s=new Qn(n.map(function(t){return t.char}),0);n.forEach(function(t,o){if(!nr(t.char)){r.setCurrentIndex(o),s.setCurrentIndex(o);var a=0;Cr(s)&&(a|=1),Tr(s)&&(a|=2);var u;switch(a){case 1:u="fina";break;case 2:u="init";break;case 3:u="medi"}if(i.indexOf(u)!==-1){var l=e.query.lookupFeature({tag:u,script:"arab",contextParams:r});if(l instanceof Error)return console.info(l.message);l.forEach(function(t,e){t instanceof ar&&(Sr(t,n,e),r.context[e]=t.substitution)})}}})}}function Or(t,e){return new Qn(t.map(function(t){return t.activeState.value}),e||0)}function Nr(t){var e=this,i=this.tokenizer.getRangeTokens(t),n=Or(i);n.context.forEach(function(t,r){n.setCurrentIndex(r);var s=e.query.lookupFeature({tag:"rlig",script:"arab",contextParams:n});s.length&&(s.forEach(function(t){return Sr(t,i,r)}),n=Or(i))})}function Er(t){var e=t.current,i=t.get(-1);return null===i&&rr(e)||!rr(i)&&rr(e)}function Mr(t){var e=t.get(1);return null===e||!rr(e)}function Dr(t,e){return new Qn(t.map(function(t){return t.activeState.value}),e||0)}function Vr(t){var e=this,i=this.tokenizer.getRangeTokens(t),n=Dr(i);n.context.forEach(function(t,r){n.setCurrentIndex(r);var s=e.query.lookupFeature({tag:"liga",script:"latn",contextParams:n});s.length&&(s.forEach(function(t){return Sr(t,i,r)}),n=Dr(i))})}function Ir(t){this.baseDir=t||"ltr",this.tokenizer=new tr,this.featuresTags={}}function Br(t){var e=this.contextChecks[t+"Check"];return this.tokenizer.registerContextChecker(t,e.startCheck,e.endCheck)}function Ar(){return Br.call(this,"latinWord"),Br.call(this,"arabicWord"),Br.call(this,"arabicSentence"),this.tokenizer.tokenize(this.text)}function Pr(){var t=this;this.tokenizer.getContextRanges("arabicSentence").forEach(function(e){var i=t.tokenizer.getRangeTokens(e);t.tokenizer.replaceRange(e.startIndex,e.endOffset,i.reverse())})}function Lr(){if(this.tokenizer.registeredModifiers.indexOf("glyphIndex")===-1)throw new Error("glyphIndex modifier is required to apply arabic presentation features.")}function Rr(){var t=this;if(this.featuresTags.hasOwnProperty("arab")){Lr.call(this);this.tokenizer.getContextRanges("arabicWord").forEach(function(e){Fr.call(t,e)})}}function kr(){var t=this;if(this.featuresTags.hasOwnProperty("arab")){if(this.featuresTags.arab.indexOf("rlig")!==-1){Lr.call(this);this.tokenizer.getContextRanges("arabicWord").forEach(function(e){Nr.call(t,e)})}}}function Ur(){var t=this;if(this.featuresTags.hasOwnProperty("latn")){if(this.featuresTags.latn.indexOf("liga")!==-1){Lr.call(this);this.tokenizer.getContextRanges("latinWord").forEach(function(e){Vr.call(t,e)})}}}function Xr(t){t=t||{},t.tables=t.tables||{},t.empty||(Ie(t.familyName,"When creating a new Font object, familyName is required."),Ie(t.styleName,"When creating a new Font object, styleName is required."),Ie(t.unitsPerEm,"When creating a new Font object, unitsPerEm is required."),Ie(t.ascender,"When creating a new Font object, ascender is required."),Ie(t.descender<=0,"When creating a new Font object, negative descender value is required."),this.names={fontFamily:{en:t.familyName||" "},fontSubfamily:{en:t.styleName||" "},fullName:{en:t.fullName||t.familyName+" "+t.styleName},postScriptName:{en:t.postScriptName||(t.familyName+t.styleName).replace(/\s/g,"")},designer:{en:t.designer||" "},designerURL:{en:t.designerURL||" "},manufacturer:{en:t.manufacturer||" "},manufacturerURL:{en:t.manufacturerURL||" "},license:{en:t.license||" "},licenseURL:{en:t.licenseURL||" "},version:{en:t.version||"Version 0.1"},description:{en:t.description||" "},copyright:{en:t.copyright||" "},trademark:{en:t.trademark||" "}},this.unitsPerEm=t.unitsPerEm||1e3,this.ascender=t.ascender,this.descender=t.descender,this.createdTimestamp=t.createdTimestamp,this.tables=Object.assign(t.tables,{os2:Object.assign({usWeightClass:t.weightClass||this.usWeightClasses.MEDIUM,usWidthClass:t.widthClass||this.usWidthClasses.MEDIUM,fsSelection:t.fsSelection||this.fsSelectionValues.REGULAR},t.tables.os2)})),this.supported=!0,this.glyphs=new js.GlyphSet(this,t.glyphs||[]),this.encoding=new q(this),this.position=new Fe(this),this.substitution=new Oe(this),this.tables=this.tables||{},this._push=null,this._hmtxTableData={},Object.defineProperty(this,"hinting",{get:function(){return this._hinting?this._hinting:"truetype"===this.outlinesFormat?this._hinting=new ze(this):void 0}})}function jr(t,e){var i=JSON.stringify(t),n=256;for(var r in e){var s=parseInt(r);if(s&&!(s<256)){if(JSON.stringify(e[r])===i)return s;n<=s&&(n=s+1)}}return e[n]=t,n}function zr(t,e,i){var n=jr(e.name,i);return[{name:"tag_"+t,type:"TAG",value:e.tag},{name:"minValue_"+t,type:"FIXED",value:e.minValue<<16},{name:"defaultValue_"+t,type:"FIXED",value:e.defaultValue<<16},{name:"maxValue_"+t,type:"FIXED",value:e.maxValue<<16},{name:"flags_"+t,type:"USHORT",value:0},{name:"nameID_"+t,type:"USHORT",value:n}]}function Gr(t,e,i){var n={},r=new As.Parser(t,e);return n.tag=r.parseTag(),n.minValue=r.parseFixed(),n.defaultValue=r.parseFixed(),n.maxValue=r.parseFixed(),r.skip("uShort",1),n.name=i[r.parseUShort()]||{},n}function Hr(t,e,i,n){for(var r=jr(e.name,n),s=[{name:"nameID_"+t,type:"USHORT",value:r},{name:"flags_"+t,type:"USHORT",value:0}],o=0;o<i.length;++o){var a=i[o].tag;s.push({name:"axis_"+t+" "+a,type:"FIXED",value:e.coordinates[a]<<16})}return s}function qr(t,e,i,n){var r={},s=new As.Parser(t,e);r.name=n[s.parseUShort()]||{},s.skip("uShort",1),r.coordinates={};for(var o=0;o<i.length;++o)r.coordinates[i[o].tag]=s.parseFixed();return r}function Wr(t,e){var i=new Vs.Table("fvar",[{name:"version",type:"ULONG",value:65536},{name:"offsetToData",type:"USHORT",value:0},{name:"countSizePairs",type:"USHORT",value:2},{name:"axisCount",type:"USHORT",value:t.axes.length},{name:"axisSize",type:"USHORT",value:20},{name:"instanceCount",type:"USHORT",value:t.instances.length},{name:"instanceSize",type:"USHORT",value:4+4*t.axes.length}]);i.offsetToData=i.sizeOf();for(var n=0;n<t.axes.length;n++)i.fields=i.fields.concat(zr(n,t.axes[n],e));for(var r=0;r<t.instances.length;r++)i.fields=i.fields.concat(Hr(r,t.instances[r],t.axes,e));return i}function Yr(t,e,i){var n=new As.Parser(t,e),r=n.parseULong();Ss.argument(65536===r,"Unsupported fvar table version.");var s=n.parseOffset16();n.skip("uShort",1);for(var o=n.parseUShort(),a=n.parseUShort(),u=n.parseUShort(),l=n.parseUShort(),c=[],h=0;h<o;h++)c.push(Gr(t,e+s+h*a,i));for(var d=[],p=e+s+o*a,f=0;f<u;f++)d.push(qr(t,p+f*l,c,i));return{axes:c,instances:d}}function $r(t,e){e=e||0;var i=new k(t,e),n=i.parseVersion(1);Ss.argument(1===n||1.2===n||1.3===n,"Unsupported GDEF table version.");var r={version:n,classDef:i.parsePointer(k.classDef),attachList:i.parsePointer(Mo),ligCaretList:i.parsePointer(Io),markAttachClassDef:i.parsePointer(k.classDef)};return n>=1.2&&(r.markGlyphSets=i.parsePointer(Bo)),r}function Zr(t,e){e=e||0;var i=new k(t,e),n=i.parseVersion(1);return Ss.argument(1===n||1.1===n,"Unsupported GPOS table version "+n),1===n?{version:n,scripts:i.parseScriptList(),features:i.parseFeatureList(),lookups:i.parseLookupList(Po)}:{version:n,scripts:i.parseScriptList(),features:i.parseFeatureList(),lookups:i.parseLookupList(Po),variations:i.parseFeatureVariationsList()}}function Qr(t){return new Vs.Table("GPOS",[{name:"version",type:"ULONG",value:65536},{name:"scripts",type:"TABLE",value:new Vs.ScriptList(t.scripts)},{name:"features",type:"TABLE",value:new Vs.FeatureList(t.features)},{name:"lookups",type:"TABLE",value:new Vs.LookupList(t.lookups,Lo)}])}function Kr(t){var e={};t.skip("uShort");var i=t.parseUShort();Ss.argument(0===i,"Unsupported kern sub-table version."),t.skip("uShort",2);var n=t.parseUShort();t.skip("uShort",3);for(var r=0;r<n;r+=1){var s=t.parseUShort(),o=t.parseUShort(),a=t.parseShort();e[s+","+o]=a}return e}function Jr(t){var e={};t.skip("uShort"),t.parseULong()>1&&console.warn("Only the first kern subtable is supported."),t.skip("uLong");var i=t.parseUShort(),n=255&i;if(t.skip("uShort"),0===n){var r=t.parseUShort();t.skip("uShort",3);for(var s=0;s<r;s+=1){var o=t.parseUShort(),a=t.parseUShort(),u=t.parseShort();e[o+","+a]=u}}return e}function ts(t,e){var i=new As.Parser(t,e),n=i.parseUShort();if(0===n)return Kr(i);if(1===n)return Jr(i);throw new Error("Unsupported kern table version ("+n+").")}function es(t,e,i,n){for(var r=new As.Parser(t,e),s=n?r.parseUShort:r.parseULong,o=[],a=0;a<i+1;a+=1){var u=s.call(r);n&&(u*=2),o.push(u)}return o}function is(t,e){require("fs").readFile(t,function(t,i){if(t)return e(t.message);e(null,De(i))})}function ns(t,e){var i=new XMLHttpRequest;i.open("get",t,!0),i.responseType="arraybuffer",i.onload=function(){return i.response?e(null,i.response):e("Font could not be loaded: "+i.statusText)},i.onerror=function(){e("Font could not be loaded")},i.send()}function rs(t,e){for(var i=[],n=12,r=0;r<e;r+=1){var s=As.getTag(t,n),o=As.getULong(t,n+4),a=As.getULong(t,n+8),u=As.getULong(t,n+12);i.push({tag:s,checksum:o,offset:a,length:u,compression:!1}),n+=16}return i}function ss(t,e){for(var i=[],n=44,r=0;r<e;r+=1){var s=As.getTag(t,n),o=As.getULong(t,n+4),a=As.getULong(t,n+8),u=As.getULong(t,n+12),l=void 0;l=a<u&&"WOFF",i.push({tag:s,offset:o,compression:l,compressedLength:a,length:u}),n+=20}return i}function os(t,e){if("WOFF"===e.compression){var i=new Uint8Array(t.buffer,e.offset+2,e.compressedLength-2),n=new Uint8Array(e.length);if(bs(i,n),n.byteLength!==e.length)throw new Error("Decompression error: "+e.tag+" decompressed length doesn't match recorded length");return{data:new DataView(n.buffer,0),offset:0}}return{data:t,offset:e.offset}}function as(t,e){e=void 0===e||null===e?{}:e;var i,n,r,s=new Xr({empty:!0}),o=new DataView(t,0),a=[],u=As.getTag(o,0);if(u===String.fromCharCode(0,1,0,0)||"true"===u||"typ1"===u)s.outlinesFormat="truetype",r=As.getUShort(o,4),a=rs(o,r);else if("OTTO"===u)s.outlinesFormat="cff",r=As.getUShort(o,4),a=rs(o,r);else{if("wOFF"!==u)throw new Error("Unsupported OpenType signature "+u);var l=As.getTag(o,4);if(l===String.fromCharCode(0,1,0,0))s.outlinesFormat="truetype";else{if("OTTO"!==l)throw new Error("Unsupported OpenType flavor "+u);s.outlinesFormat="cff"}r=As.getUShort(o,12),a=ss(o,r)}for(var c,h,d,p,f,g,m,_,x,y,v,w,b=0;b<r;b+=1){var S=a[b],C=void 0;switch(S.tag){case"cmap":C=os(o,S),s.tables.cmap=Ps.parse(C.data,C.offset),s.encoding=new W(s.tables.cmap);break;case"cvt ":C=os(o,S),w=new As.Parser(C.data,C.offset),s.tables.cvt=w.parseShortList(S.length/2);break;case"fvar":h=S;break;case"fpgm":C=os(o,S),w=new As.Parser(C.data,C.offset),s.tables.fpgm=w.parseByteList(S.length);break;case"head":C=os(o,S),s.tables.head=qs.parse(C.data,C.offset),s.unitsPerEm=s.tables.head.unitsPerEm,i=s.tables.head.indexToLocFormat;break;case"hhea":C=os(o,S),s.tables.hhea=Ws.parse(C.data,C.offset),s.ascender=s.tables.hhea.ascender,s.descender=s.tables.hhea.descender,s.numberOfHMetrics=s.tables.hhea.numberOfHMetrics;break;case"hmtx":m=S;break;case"ltag":C=os(o,S),n=$s.parse(C.data,C.offset);break;case"maxp":C=os(o,S),s.tables.maxp=Zs.parse(C.data,C.offset),s.numGlyphs=s.tables.maxp.numGlyphs;break;case"name":y=S;break;case"OS/2":C=os(o,S),s.tables.os2=oo.parse(C.data,C.offset);break;case"post":C=os(o,S),s.tables.post=ao.parse(C.data,C.offset),s.glyphNames=new $(s.tables.post);break;case"prep":C=os(o,S),w=new As.Parser(C.data,C.offset),s.tables.prep=w.parseByteList(S.length);break;case"glyf":d=S;break;case"loca":x=S;break;case"CFF ":c=S;break;case"kern":_=S;break;case"GDEF":p=S;break;case"GPOS":f=S;break;case"GSUB":g=S;break;case"meta":v=S}}var T=os(o,y);if(s.tables.name=ro.parse(T.data,T.offset,n),s.names=s.tables.name,d&&x){var F=0===i,O=os(o,x),N=Uo.parse(O.data,O.offset,s.numGlyphs,F),E=os(o,d);s.glyphs=yo.parse(E.data,E.offset,N,s,e)}else{if(!c)throw new Error("Font doesn't contain TrueType or CFF outlines.");var M=os(o,c);Hs.parse(M.data,M.offset,s,e)}var D=os(o,m);if(Ys.parse(s,D.data,D.offset,s.numberOfHMetrics,s.numGlyphs,s.glyphs,e),K(s,e),_){var V=os(o,_);s.kerningPairs=ko.parse(V.data,V.offset)}else s.kerningPairs={};if(p){var I=os(o,p);s.tables.gdef=Ao.parse(I.data,I.offset)}if(f){var B=os(o,f);s.tables.gpos=Ro.parse(B.data,B.offset),s.position.init()}if(g){var A=os(o,g);s.tables.gsub=ho.parse(A.data,A.offset)}if(h){var P=os(o,h);s.tables.fvar=Eo.parse(P.data,P.offset,s.names)}if(v){var L=os(o,v);s.tables.meta=po.parse(L.data,L.offset),s.metas=s.tables.meta}return s}function us(t,e,i){i=void 0===i||null===i?{}:i;var n="undefined"==typeof window,r=n&&!i.isUrl?is:ns;return new Promise(function(n,s){r(t,function(t,r){if(t){if(e)return e(t);s(t)}var o;try{o=as(r,i)}catch(t){if(e)return e(t,null);s(t)}if(e)return e(null,o);n(o)})})}function ls(t,e){return as(De(require("fs").readFileSync(t)),e)}String.prototype.codePointAt||function(){var t=function(){try{var t={},e=Object.defineProperty,i=e(t,t,t)&&e}catch(t){}return i}(),e=function(t){if(null==this)throw TypeError();var e=String(this),i=e.length,n=t?Number(t):0;if(n!=n&&(n=0),!(n<0||n>=i)){var r,s=e.charCodeAt(n);return s>=55296&&s<=56319&&i>n+1&&(r=e.charCodeAt(n+1))>=56320&&r<=57343?1024*(s-55296)+r-56320+65536:s}};t?t(String.prototype,"codePointAt",{value:e,configurable:!0,writable:!0}):String.prototype.codePointAt=e}();var cs=0,hs=-3,ds=new e,ps=new e,fs=new Uint8Array(30),gs=new Uint16Array(30),ms=new Uint8Array(30),_s=new Uint16Array(30),xs=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ys=new e,vs=new Uint8Array(320),ws=new Uint16Array(16);!function(t,e){var i;for(i=0;i<7;++i)t.table[i]=0;for(t.table[7]=24,t.table[8]=152,
|
|
32
|
+
t.table[9]=112,i=0;i<24;++i)t.trans[i]=256+i;for(i=0;i<144;++i)t.trans[24+i]=i;for(i=0;i<8;++i)t.trans[168+i]=280+i;for(i=0;i<112;++i)t.trans[176+i]=144+i;for(i=0;i<5;++i)e.table[i]=0;for(e.table[5]=32,i=0;i<32;++i)e.trans[i]=i}(ds,ps),n(fs,gs,4,3),n(ms,_s,2,1),fs[28]=0,gs[28]=258;var bs=h;p.prototype.isEmpty=function(){return isNaN(this.x1)||isNaN(this.y1)||isNaN(this.x2)||isNaN(this.y2)},p.prototype.addPoint=function(t,e){"number"==typeof t&&((isNaN(this.x1)||isNaN(this.x2))&&(this.x1=t,this.x2=t),t<this.x1&&(this.x1=t),t>this.x2&&(this.x2=t)),"number"==typeof e&&((isNaN(this.y1)||isNaN(this.y2))&&(this.y1=e,this.y2=e),e<this.y1&&(this.y1=e),e>this.y2&&(this.y2=e))},p.prototype.addX=function(t){this.addPoint(t,null)},p.prototype.addY=function(t){this.addPoint(null,t)},p.prototype.addBezier=function(t,e,i,n,r,s,o,a){var u=[t,e],l=[i,n],c=[r,s],h=[o,a];this.addPoint(t,e),this.addPoint(o,a);for(var p=0;p<=1;p++){var f=6*u[p]-12*l[p]+6*c[p],g=-3*u[p]+9*l[p]-9*c[p]+3*h[p],m=3*l[p]-3*u[p];if(0!==g){var _=Math.pow(f,2)-4*m*g;if(!(_<0)){var x=(-f+Math.sqrt(_))/(2*g);0<x&&x<1&&(0===p&&this.addX(d(u[p],l[p],c[p],h[p],x)),1===p&&this.addY(d(u[p],l[p],c[p],h[p],x)));var y=(-f-Math.sqrt(_))/(2*g);0<y&&y<1&&(0===p&&this.addX(d(u[p],l[p],c[p],h[p],y)),1===p&&this.addY(d(u[p],l[p],c[p],h[p],y)))}}else{if(0===f)continue;var v=-m/f;0<v&&v<1&&(0===p&&this.addX(d(u[p],l[p],c[p],h[p],v)),1===p&&this.addY(d(u[p],l[p],c[p],h[p],v)))}}},p.prototype.addQuad=function(t,e,i,n,r,s){var o=t+2/3*(i-t),a=e+2/3*(n-e),u=o+1/3*(r-t),l=a+1/3*(s-e);this.addBezier(t,e,o,a,u,l,r,s)},f.prototype.moveTo=function(t,e){this.commands.push({type:"M",x:t,y:e})},f.prototype.lineTo=function(t,e){this.commands.push({type:"L",x:t,y:e})},f.prototype.curveTo=f.prototype.bezierCurveTo=function(t,e,i,n,r,s){this.commands.push({type:"C",x1:t,y1:e,x2:i,y2:n,x:r,y:s})},f.prototype.quadTo=f.prototype.quadraticCurveTo=function(t,e,i,n){this.commands.push({type:"Q",x1:t,y1:e,x:i,y:n})},f.prototype.close=f.prototype.closePath=function(){this.commands.push({type:"Z"})},f.prototype.extend=function(t){if(t.commands)t=t.commands;else if(t instanceof p){var e=t;return this.moveTo(e.x1,e.y1),this.lineTo(e.x2,e.y1),this.lineTo(e.x2,e.y2),this.lineTo(e.x1,e.y2),void this.close()}Array.prototype.push.apply(this.commands,t)},f.prototype.getBoundingBox=function(){for(var t=new p,e=0,i=0,n=0,r=0,s=0;s<this.commands.length;s++){var o=this.commands[s];switch(o.type){case"M":t.addPoint(o.x,o.y),e=n=o.x,i=r=o.y;break;case"L":t.addPoint(o.x,o.y),n=o.x,r=o.y;break;case"Q":t.addQuad(n,r,o.x1,o.y1,o.x,o.y),n=o.x,r=o.y;break;case"C":t.addBezier(n,r,o.x1,o.y1,o.x2,o.y2,o.x,o.y),n=o.x,r=o.y;break;case"Z":n=e,r=i;break;default:throw new Error("Unexpected path command "+o.type)}}return t.isEmpty()&&t.addPoint(0,0),t},f.prototype.draw=function(t){t.beginPath();for(var e=0;e<this.commands.length;e+=1){var i=this.commands[e];"M"===i.type?t.moveTo(i.x,i.y):"L"===i.type?t.lineTo(i.x,i.y):"C"===i.type?t.bezierCurveTo(i.x1,i.y1,i.x2,i.y2,i.x,i.y):"Q"===i.type?t.quadraticCurveTo(i.x1,i.y1,i.x,i.y):"Z"===i.type&&t.closePath()}this.fill&&(t.fillStyle=this.fill,t.fill()),this.stroke&&(t.strokeStyle=this.stroke,t.lineWidth=this.strokeWidth,t.stroke())},f.prototype.toPathData=function(t){function e(e){return Math.round(e)===e?""+Math.round(e):e.toFixed(t)}function i(){for(var t=arguments,i="",n=0;n<arguments.length;n+=1){var r=t[n];r>=0&&n>0&&(i+=" "),i+=e(r)}return i}t=void 0!==t?t:2;for(var n="",r=0;r<this.commands.length;r+=1){var s=this.commands[r];"M"===s.type?n+="M"+i(s.x,s.y):"L"===s.type?n+="L"+i(s.x,s.y):"C"===s.type?n+="C"+i(s.x1,s.y1,s.x2,s.y2,s.x,s.y):"Q"===s.type?n+="Q"+i(s.x1,s.y1,s.x,s.y):"Z"===s.type&&(n+="Z")}return n},f.prototype.toSVG=function(t){var e='<path d="';return e+=this.toPathData(t),e+='"',this.fill&&"black"!==this.fill&&(e+=null===this.fill?' fill="none"':' fill="'+this.fill+'"'),this.stroke&&(e+=' stroke="'+this.stroke+'" stroke-width="'+this.strokeWidth+'"'),e+="/>"},f.prototype.toDOMElement=function(t){var e=this.toPathData(t),i=document.createElementNS("http://www.w3.org/2000/svg","path");return i.setAttribute("d",e),i};var Ss={fail:g,argument:m,assert:m},Cs={},Ts={},Fs={};Ts.BYTE=function(t){return Ss.argument(t>=0&&t<=255,"Byte value should be between 0 and 255."),[t]},Fs.BYTE=_(1),Ts.CHAR=function(t){return[t.charCodeAt(0)]},Fs.CHAR=_(1),Ts.CHARARRAY=function(t){void 0===t&&(t="",console.warn("Undefined CHARARRAY encountered and treated as an empty string. This is probably caused by a missing glyph name."));for(var e=[],i=0;i<t.length;i+=1)e[i]=t.charCodeAt(i);return e},Fs.CHARARRAY=function(t){return void 0===t?0:t.length},Ts.USHORT=function(t){return[t>>8&255,255&t]},Fs.USHORT=_(2),Ts.SHORT=function(t){return t>=32768&&(t=-(65536-t)),[t>>8&255,255&t]},Fs.SHORT=_(2),Ts.UINT24=function(t){return[t>>16&255,t>>8&255,255&t]},Fs.UINT24=_(3),Ts.ULONG=function(t){return[t>>24&255,t>>16&255,t>>8&255,255&t]},Fs.ULONG=_(4),Ts.LONG=function(t){return t>=2147483648&&(t=-(4294967296-t)),[t>>24&255,t>>16&255,t>>8&255,255&t]},Fs.LONG=_(4),Ts.FIXED=Ts.ULONG,Fs.FIXED=Fs.ULONG,Ts.FWORD=Ts.SHORT,Fs.FWORD=Fs.SHORT,Ts.UFWORD=Ts.USHORT,Fs.UFWORD=Fs.USHORT,Ts.LONGDATETIME=function(t){return[0,0,0,0,t>>24&255,t>>16&255,t>>8&255,255&t]},Fs.LONGDATETIME=_(8),Ts.TAG=function(t){return Ss.argument(4===t.length,"Tag should be exactly 4 ASCII characters."),[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]},Fs.TAG=_(4),Ts.Card8=Ts.BYTE,Fs.Card8=Fs.BYTE,Ts.Card16=Ts.USHORT,Fs.Card16=Fs.USHORT,Ts.OffSize=Ts.BYTE,Fs.OffSize=Fs.BYTE,Ts.SID=Ts.USHORT,Fs.SID=Fs.USHORT,Ts.NUMBER=function(t){return t>=-107&&t<=107?[t+139]:t>=108&&t<=1131?(t-=108,[247+(t>>8),255&t]):t>=-1131&&t<=-108?(t=-t-108,[251+(t>>8),255&t]):t>=-32768&&t<=32767?Ts.NUMBER16(t):Ts.NUMBER32(t)},Fs.NUMBER=function(t){return Ts.NUMBER(t).length},Ts.NUMBER16=function(t){return[28,t>>8&255,255&t]},Fs.NUMBER16=_(3),Ts.NUMBER32=function(t){return[29,t>>24&255,t>>16&255,t>>8&255,255&t]},Fs.NUMBER32=_(5),Ts.REAL=function(t){var e=t.toString(),i=/\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(e);if(i){var n=parseFloat("1e"+((i[2]?+i[2]:0)+i[1].length));e=(Math.round(t*n)/n).toString()}for(var r="",s=0,o=e.length;s<o;s+=1){var a=e[s];r+="e"===a?"-"===e[++s]?"c":"b":"."===a?"a":"-"===a?"e":a}r+=1&r.length?"f":"ff";for(var u=[30],l=0,c=r.length;l<c;l+=2)u.push(parseInt(r.substr(l,2),16));return u},Fs.REAL=function(t){return Ts.REAL(t).length},Ts.NAME=Ts.CHARARRAY,Fs.NAME=Fs.CHARARRAY,Ts.STRING=Ts.CHARARRAY,Fs.STRING=Fs.CHARARRAY,Cs.UTF8=function(t,e,i){for(var n=[],r=i,s=0;s<r;s++,e+=1)n[s]=t.getUint8(e);return String.fromCharCode.apply(null,n)},Cs.UTF16=function(t,e,i){for(var n=[],r=i/2,s=0;s<r;s++,e+=2)n[s]=t.getUint16(e);return String.fromCharCode.apply(null,n)},Ts.UTF16=function(t){for(var e=[],i=0;i<t.length;i+=1){var n=t.charCodeAt(i);e[e.length]=n>>8&255,e[e.length]=255&n}return e},Fs.UTF16=function(t){return 2*t.length};var Os={"x-mac-croatian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®Š™´¨≠ŽØ∞±≤≥∆µ∂∑∏š∫ªºΩžø¿¡¬√ƒ≈ƫȅ ÀÃÕŒœĐ—“”‘’÷◊©⁄€‹›Æ»–·‚„‰ÂćÁčÈÍÎÏÌÓÔđÒÚÛÙıˆ˜¯πË˚¸Êæˇ","x-mac-cyrillic":"АБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯ†°Ґ£§•¶І®©™Ђђ≠Ѓѓ∞±≤≥іµґЈЄєЇїЉљЊњјЅ¬√ƒ≈∆«»… ЋћЌќѕ–—“”‘’÷„ЎўЏџ№Ёёяабвгдежзийклмнопрстуфхцчшщъыьэю","x-mac-gaelic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØḂ±≤≥ḃĊċḊḋḞḟĠġṀæøṁṖṗɼƒſṠ«»… ÀÃÕŒœ–—“”‘’ṡẛÿŸṪ€‹›Ŷŷṫ·Ỳỳ⁊ÂÊÁËÈÍÎÏÌÓÔ♣ÒÚÛÙıÝýŴŵẄẅẀẁẂẃ","x-mac-greek":"Ĺ²É³ÖÜ΅àâä΄¨çéèê룙î‰ôö¦€ùûü†ΓΔΘΛΞΠß®©ΣΪ§≠°·Α±≤≥¥ΒΕΖΗΙΚΜΦΫΨΩάΝ¬ΟΡ≈Τ«»… ΥΧΆΈœ–―“”‘’÷ΉΊΌΎέήίόΏύαβψδεφγηιξκλμνοπώρστθωςχυζϊϋΐΰ","x-mac-icelandic":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûüݰ¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€ÐðÞþý·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-inuit":"ᐃᐄᐅᐆᐊᐋᐱᐲᐳᐴᐸᐹᑉᑎᑏᑐᑑᑕᑖᑦᑭᑮᑯᑰᑲᑳᒃᒋᒌᒍᒎᒐᒑ°ᒡᒥᒦ•¶ᒧ®©™ᒨᒪᒫᒻᓂᓃᓄᓅᓇᓈᓐᓯᓰᓱᓲᓴᓵᔅᓕᓖᓗᓘᓚᓛᓪᔨᔩᔪᔫᔭ… ᔮᔾᕕᕖᕗ–—“”‘’ᕘᕙᕚᕝᕆᕇᕈᕉᕋᕌᕐᕿᖀᖁᖂᖃᖄᖅᖏᖐᖑᖒᖓᖔᖕᙱᙲᙳᙴᙵᙶᖖᖠᖡᖢᖣᖤᖥᖦᕼŁł","x-mac-ce":"ÄĀāÉĄÖÜáąČäčĆć鏟ĎíďĒēĖóėôöõúĚěü†°Ę£§•¶ß®©™ę¨≠ģĮįĪ≤≥īĶ∂∑łĻļĽľĹĺŅņѬ√ńŇ∆«»… ňŐÕőŌ–—“”‘’÷◊ōŔŕŘ‹›řŖŗŠ‚„šŚśÁŤťÍŽžŪÓÔūŮÚůŰűŲųÝýķŻŁżĢˇ",macintosh:"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›fifl‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-romanian":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ĂȘ∞±≤≥¥µ∂∑∏π∫ªºΩăș¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸ⁄€‹›Țț‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙıˆ˜¯˘˙˚¸˝˛ˇ","x-mac-turkish":"ÄÅÇÉÑÖÜáàâäãåçéèêëíìîïñóòôöõúùûü†°¢£§•¶ß®©™´¨≠ÆØ∞±≤≥¥µ∂∑∏π∫ªºΩæø¿¡¬√ƒ≈∆«»… ÀÃÕŒœ–—“”‘’÷◊ÿŸĞğİıŞş‡·‚„‰ÂÊÁËÈÍÎÏÌÓÔÒÚÛÙˆ˜¯˘˙˚¸˝˛ˇ"};Cs.MACSTRING=function(t,e,i,n){var r=Os[n];if(void 0!==r){for(var s="",o=0;o<i;o++){var a=t.getUint8(e+o);s+=a<=127?String.fromCharCode(a):r[127&a]}return s}};var Ns,Es="function"==typeof WeakMap&&new WeakMap,Ms=function(t){if(!Ns){Ns={};for(var e in Os)Ns[e]=new String(e)}var i=Ns[t];if(void 0!==i){if(Es){var n=Es.get(i);if(void 0!==n)return n}var r=Os[t];if(void 0!==r){for(var s={},o=0;o<r.length;o++)s[r.charCodeAt(o)]=o+128;return Es&&Es.set(i,s),s}}};Ts.MACSTRING=function(t,e){var i=Ms(e);if(void 0!==i){for(var n=[],r=0;r<t.length;r++){var s=t.charCodeAt(r);if(s>=128&&void 0===(s=i[s]))return;n[r]=s}return n}},Fs.MACSTRING=function(t,e){var i=Ts.MACSTRING(t,e);return void 0!==i?i.length:0},Ts.VARDELTAS=function(t){for(var e=0,i=[];e<t.length;){var n=t[e];e=0===n?y(t,e,i):n>=-128&&n<=127?v(t,e,i):w(t,e,i)}return i},Ts.INDEX=function(t){for(var e=1,i=[e],n=[],r=0;r<t.length;r+=1){var s=Ts.OBJECT(t[r]);Array.prototype.push.apply(n,s),e+=s.length,i.push(e)}if(0===n.length)return[0,0];for(var o=[],a=1+Math.floor(Math.log(e)/Math.log(2))/8|0,u=[void 0,Ts.BYTE,Ts.USHORT,Ts.UINT24,Ts.ULONG][a],l=0;l<i.length;l+=1){var c=u(i[l]);Array.prototype.push.apply(o,c)}return Array.prototype.concat(Ts.Card16(t.length),Ts.OffSize(a),o,n)},Fs.INDEX=function(t){return Ts.INDEX(t).length},Ts.DICT=function(t){for(var e=[],i=Object.keys(t),n=i.length,r=0;r<n;r+=1){var s=parseInt(i[r],0),o=t[s];e=e.concat(Ts.OPERAND(o.value,o.type)),e=e.concat(Ts.OPERATOR(s))}return e},Fs.DICT=function(t){return Ts.DICT(t).length},Ts.OPERATOR=function(t){return t<1200?[t]:[12,t-1200]},Ts.OPERAND=function(t,e){var i=[];if(Array.isArray(e))for(var n=0;n<e.length;n+=1)Ss.argument(t.length===e.length,"Not enough arguments given for type"+e),i=i.concat(Ts.OPERAND(t[n],e[n]));else if("SID"===e)i=i.concat(Ts.NUMBER(t));else if("offset"===e)i=i.concat(Ts.NUMBER32(t));else if("number"===e)i=i.concat(Ts.NUMBER(t));else{if("real"!==e)throw new Error("Unknown operand type "+e);i=i.concat(Ts.REAL(t))}return i},Ts.OP=Ts.BYTE,Fs.OP=Fs.BYTE;var Ds="function"==typeof WeakMap&&new WeakMap;Ts.CHARSTRING=function(t){if(Ds){var e=Ds.get(t);if(void 0!==e)return e}for(var i=[],n=t.length,r=0;r<n;r+=1){var s=t[r];i=i.concat(Ts[s.type](s.value))}return Ds&&Ds.set(t,i),i},Fs.CHARSTRING=function(t){return Ts.CHARSTRING(t).length},Ts.OBJECT=function(t){var e=Ts[t.type];return Ss.argument(void 0!==e,"No encoding function for type "+t.type),e(t.value)},Fs.OBJECT=function(t){var e=Fs[t.type];return Ss.argument(void 0!==e,"No sizeOf function for type "+t.type),e(t.value)},Ts.TABLE=function(t){for(var e=[],i=t.fields.length,n=[],r=[],s=0;s<i;s+=1){var o=t.fields[s],a=Ts[o.type];Ss.argument(void 0!==a,"No encoding function for field type "+o.type+" ("+o.name+")");var u=t[o.name];void 0===u&&(u=o.value);var l=a(u);"TABLE"===o.type?(r.push(e.length),e=e.concat([0,0]),n.push(l)):e=e.concat(l)}for(var c=0;c<n.length;c+=1){var h=r[c],d=e.length;Ss.argument(d<65536,"Table "+t.tableName+" too big."),e[h]=d>>8,e[h+1]=255&d,e=e.concat(n[c])}return e},Fs.TABLE=function(t){for(var e=0,i=t.fields.length,n=0;n<i;n+=1){var r=t.fields[n],s=Fs[r.type];Ss.argument(void 0!==s,"No sizeOf function for field type "+r.type+" ("+r.name+")");var o=t[r.name];void 0===o&&(o=r.value),e+=s(o),"TABLE"===r.type&&(e+=2)}return e},Ts.RECORD=Ts.TABLE,Fs.RECORD=Fs.TABLE,Ts.LITERAL=function(t){return t},Fs.LITERAL=function(t){return t.length},b.prototype.encode=function(){return Ts.TABLE(this)},b.prototype.sizeOf=function(){return Fs.TABLE(this)},F.prototype=Object.create(b.prototype),F.prototype.constructor=F,O.prototype=Object.create(b.prototype),O.prototype.constructor=O,N.prototype=Object.create(b.prototype),N.prototype.constructor=N,E.prototype=Object.create(b.prototype),E.prototype.constructor=E;var Vs={Table:b,Record:b,Coverage:F,ScriptList:O,FeatureList:N,LookupList:E,ushortList:S,tableList:C,recordList:T},Is={byte:1,uShort:2,short:2,uLong:4,fixed:4,longDateTime:8,tag:4};k.prototype.parseByte=function(){var t=this.data.getUint8(this.offset+this.relativeOffset);return this.relativeOffset+=1,t},k.prototype.parseChar=function(){var t=this.data.getInt8(this.offset+this.relativeOffset);return this.relativeOffset+=1,t},k.prototype.parseCard8=k.prototype.parseByte,k.prototype.parseUShort=function(){var t=this.data.getUint16(this.offset+this.relativeOffset);return this.relativeOffset+=2,t},k.prototype.parseCard16=k.prototype.parseUShort,k.prototype.parseSID=k.prototype.parseUShort,k.prototype.parseOffset16=k.prototype.parseUShort,k.prototype.parseShort=function(){var t=this.data.getInt16(this.offset+this.relativeOffset);return this.relativeOffset+=2,t},k.prototype.parseF2Dot14=function(){var t=this.data.getInt16(this.offset+this.relativeOffset)/16384;return this.relativeOffset+=2,t},k.prototype.parseULong=function(){var t=I(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,t},k.prototype.parseOffset32=k.prototype.parseULong,k.prototype.parseFixed=function(){var t=B(this.data,this.offset+this.relativeOffset);return this.relativeOffset+=4,t},k.prototype.parseString=function(t){var e=this.data,i=this.offset+this.relativeOffset,n="";this.relativeOffset+=t;for(var r=0;r<t;r++)n+=String.fromCharCode(e.getUint8(i+r));return n},k.prototype.parseTag=function(){return this.parseString(4)},k.prototype.parseLongDateTime=function(){var t=I(this.data,this.offset+this.relativeOffset+4);return t-=2082844800,this.relativeOffset+=8,t},k.prototype.parseVersion=function(t){var e=D(this.data,this.offset+this.relativeOffset),i=D(this.data,this.offset+this.relativeOffset+2);return this.relativeOffset+=4,void 0===t&&(t=4096),e+i/t/10},k.prototype.skip=function(t,e){void 0===e&&(e=1),this.relativeOffset+=Is[t]*e},k.prototype.parseULongList=function(t){void 0===t&&(t=this.parseULong());for(var e=new Array(t),i=this.data,n=this.offset+this.relativeOffset,r=0;r<t;r++)e[r]=i.getUint32(n),n+=4;return this.relativeOffset+=4*t,e},k.prototype.parseOffset16List=k.prototype.parseUShortList=function(t){void 0===t&&(t=this.parseUShort());for(var e=new Array(t),i=this.data,n=this.offset+this.relativeOffset,r=0;r<t;r++)e[r]=i.getUint16(n),n+=2;return this.relativeOffset+=2*t,e},k.prototype.parseShortList=function(t){for(var e=new Array(t),i=this.data,n=this.offset+this.relativeOffset,r=0;r<t;r++)e[r]=i.getInt16(n),n+=2;return this.relativeOffset+=2*t,e},k.prototype.parseByteList=function(t){for(var e=new Array(t),i=this.data,n=this.offset+this.relativeOffset,r=0;r<t;r++)e[r]=i.getUint8(n++);return this.relativeOffset+=t,e},k.prototype.parseList=function(t,e){e||(e=t,t=this.parseUShort());for(var i=new Array(t),n=0;n<t;n++)i[n]=e.call(this);return i},k.prototype.parseList32=function(t,e){e||(e=t,t=this.parseULong());for(var i=new Array(t),n=0;n<t;n++)i[n]=e.call(this);return i},k.prototype.parseRecordList=function(t,e){e||(e=t,t=this.parseUShort());for(var i=new Array(t),n=Object.keys(e),r=0;r<t;r++){for(var s={},o=0;o<n.length;o++){var a=n[o],u=e[a];s[a]=u.call(this)}i[r]=s}return i},k.prototype.parseRecordList32=function(t,e){e||(e=t,t=this.parseULong());for(var i=new Array(t),n=Object.keys(e),r=0;r<t;r++){for(var s={},o=0;o<n.length;o++){var a=n[o],u=e[a];s[a]=u.call(this)}i[r]=s}return i},k.prototype.parseStruct=function(t){if("function"==typeof t)return t.call(this);for(var e=Object.keys(t),i={},n=0;n<e.length;n++){var r=e[n],s=t[r];i[r]=s.call(this)}return i},k.prototype.parseValueRecord=function(t){if(void 0===t&&(t=this.parseUShort()),0!==t){var e={};return 1&t&&(e.xPlacement=this.parseShort()),2&t&&(e.yPlacement=this.parseShort()),4&t&&(e.xAdvance=this.parseShort()),8&t&&(e.yAdvance=this.parseShort()),16&t&&(e.xPlaDevice=void 0,this.parseShort()),32&t&&(e.yPlaDevice=void 0,this.parseShort()),64&t&&(e.xAdvDevice=void 0,this.parseShort()),128&t&&(e.yAdvDevice=void 0,this.parseShort()),e}},k.prototype.parseValueRecordList=function(){for(var t=this.parseUShort(),e=this.parseUShort(),i=new Array(e),n=0;n<e;n++)i[n]=this.parseValueRecord(t);return i},k.prototype.parsePointer=function(t){var e=this.parseOffset16();if(e>0)return new k(this.data,this.offset+e).parseStruct(t)},k.prototype.parsePointer32=function(t){var e=this.parseOffset32();if(e>0)return new k(this.data,this.offset+e).parseStruct(t)},k.prototype.parseListOfLists=function(t){for(var e=this.parseOffset16List(),i=e.length,n=this.relativeOffset,r=new Array(i),s=0;s<i;s++){var o=e[s];if(0!==o)if(this.relativeOffset=o,t){for(var a=this.parseOffset16List(),u=new Array(a.length),l=0;l<a.length;l++)this.relativeOffset=o+a[l],u[l]=t.call(this);r[s]=u}else r[s]=this.parseUShortList();else r[s]=void 0}return this.relativeOffset=n,r},k.prototype.parseCoverage=function(){var t=this.offset+this.relativeOffset,e=this.parseUShort(),i=this.parseUShort();if(1===e)return{format:1,glyphs:this.parseUShortList(i)};if(2===e){for(var n=new Array(i),r=0;r<i;r++)n[r]={start:this.parseUShort(),end:this.parseUShort(),index:this.parseUShort()};return{format:2,ranges:n}}throw new Error("0x"+t.toString(16)+": Coverage format must be 1 or 2.")},k.prototype.parseClassDef=function(){var t=this.offset+this.relativeOffset,e=this.parseUShort();if(1===e)return{format:1,startGlyph:this.parseUShort(),classes:this.parseUShortList()};if(2===e)return{format:2,ranges:this.parseRecordList({start:k.uShort,end:k.uShort,classId:k.uShort})};throw new Error("0x"+t.toString(16)+": ClassDef format must be 1 or 2.")},k.list=function(t,e){return function(){return this.parseList(t,e)}},k.list32=function(t,e){return function(){return this.parseList32(t,e)}},k.recordList=function(t,e){return function(){return this.parseRecordList(t,e)}},k.recordList32=function(t,e){return function(){return this.parseRecordList32(t,e)}},k.pointer=function(t){return function(){return this.parsePointer(t)}},k.pointer32=function(t){return function(){return this.parsePointer32(t)}},k.tag=k.prototype.parseTag,k.byte=k.prototype.parseByte,k.uShort=k.offset16=k.prototype.parseUShort,k.uShortList=k.prototype.parseUShortList,k.uLong=k.offset32=k.prototype.parseULong,k.uLongList=k.prototype.parseULongList,k.struct=k.prototype.parseStruct,k.coverage=k.prototype.parseCoverage,k.classDef=k.prototype.parseClassDef;var Bs={reserved:k.uShort,reqFeatureIndex:k.uShort,featureIndexes:k.uShortList};k.prototype.parseScriptList=function(){return this.parsePointer(k.recordList({tag:k.tag,script:k.pointer({defaultLangSys:k.pointer(Bs),langSysRecords:k.recordList({tag:k.tag,langSys:k.pointer(Bs)})})}))||[]},k.prototype.parseFeatureList=function(){return this.parsePointer(k.recordList({tag:k.tag,feature:k.pointer({featureParams:k.offset16,lookupListIndexes:k.uShortList})}))||[]},k.prototype.parseLookupList=function(t){return this.parsePointer(k.list(k.pointer(function(){var e=this.parseUShort();Ss.argument(1<=e&&e<=9,"GPOS/GSUB lookup type "+e+" unknown.");var i=this.parseUShort(),n=16&i;return{lookupType:e,lookupFlag:i,subtables:this.parseList(k.pointer(t[e])),markFilteringSet:n?this.parseUShort():void 0}})))||[]},k.prototype.parseFeatureVariationsList=function(){return this.parsePointer32(function(){var t=this.parseUShort(),e=this.parseUShort();return Ss.argument(1===t&&e<1,"GPOS/GSUB feature variations table unknown."),this.parseRecordList32({conditionSetOffset:k.offset32,featureTableSubstitutionOffset:k.offset32})})||[]};var As={getByte:M,getCard8:M,getUShort:D,getCard16:D,getShort:V,getULong:I,getFixed:B,getTag:A,getOffset:P,getBytes:L,bytesToString:R,Parser:k},Ps={parse:j,make:H},Ls=[".notdef","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","endash","dagger","daggerdbl","periodcentered","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","questiondown","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","ring","cedilla","hungarumlaut","ogonek","caron","emdash","AE","ordfeminine","Lslash","Oslash","OE","ordmasculine","ae","dotlessi","lslash","oslash","oe","germandbls","onesuperior","logicalnot","mu","trademark","Eth","onehalf","plusminus","Thorn","onequarter","divide","brokenbar","degree","thorn","threequarters","twosuperior","registered","minus","eth","multiply","threesuperior","copyright","Aacute","Acircumflex","Adieresis","Agrave","Aring","Atilde","Ccedilla","Eacute","Ecircumflex","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Ntilde","Oacute","Ocircumflex","Odieresis","Ograve","Otilde","Scaron","Uacute","Ucircumflex","Udieresis","Ugrave","Yacute","Ydieresis","Zcaron","aacute","acircumflex","adieresis","agrave","aring","atilde","ccedilla","eacute","ecircumflex","edieresis","egrave","iacute","icircumflex","idieresis","igrave","ntilde","oacute","ocircumflex","odieresis","ograve","otilde","scaron","uacute","ucircumflex","udieresis","ugrave","yacute","ydieresis","zcaron","exclamsmall","Hungarumlautsmall","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","266 ff","onedotenleader","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","commasuperior","threequartersemdash","periodsuperior","questionsmall","asuperior","bsuperior","centsuperior","dsuperior","esuperior","isuperior","lsuperior","msuperior","nsuperior","osuperior","rsuperior","ssuperior","tsuperior","ff","ffi","ffl","parenleftinferior","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","exclamdownsmall","centoldstyle","Lslashsmall","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","Dotaccentsmall","Macronsmall","figuredash","hypheninferior","Ogoneksmall","Ringsmall","Cedillasmall","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","zerosuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall","001.000","001.001","001.002","001.003","Black","Bold","Book","Light","Medium","Regular","Roman","Semibold"],Rs=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quoteright","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","quoteleft","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdown","cent","sterling","fraction","yen","florin","section","currency","quotesingle","quotedblleft","guillemotleft","guilsinglleft","guilsinglright","fi","fl","","endash","dagger","daggerdbl","periodcentered","","paragraph","bullet","quotesinglbase","quotedblbase","quotedblright","guillemotright","ellipsis","perthousand","","questiondown","","grave","acute","circumflex","tilde","macron","breve","dotaccent","dieresis","","ring","cedilla","","hungarumlaut","ogonek","caron","emdash","","","","","","","","","","","","","","","","","AE","","ordfeminine","","","","","Lslash","Oslash","OE","ordmasculine","","","","","","ae","","","","dotlessi","","","lslash","oslash","oe","germandbls"],ks=["","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","space","exclamsmall","Hungarumlautsmall","","dollaroldstyle","dollarsuperior","ampersandsmall","Acutesmall","parenleftsuperior","parenrightsuperior","twodotenleader","onedotenleader","comma","hyphen","period","fraction","zerooldstyle","oneoldstyle","twooldstyle","threeoldstyle","fouroldstyle","fiveoldstyle","sixoldstyle","sevenoldstyle","eightoldstyle","nineoldstyle","colon","semicolon","commasuperior","threequartersemdash","periodsuperior","questionsmall","","asuperior","bsuperior","centsuperior","dsuperior","esuperior","","","isuperior","","","lsuperior","msuperior","nsuperior","osuperior","","","rsuperior","ssuperior","tsuperior","","ff","fi","fl","ffi","ffl","parenleftinferior","","parenrightinferior","Circumflexsmall","hyphensuperior","Gravesmall","Asmall","Bsmall","Csmall","Dsmall","Esmall","Fsmall","Gsmall","Hsmall","Ismall","Jsmall","Ksmall","Lsmall","Msmall","Nsmall","Osmall","Psmall","Qsmall","Rsmall","Ssmall","Tsmall","Usmall","Vsmall","Wsmall","Xsmall","Ysmall","Zsmall","colonmonetary","onefitted","rupiah","Tildesmall","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","exclamdownsmall","centoldstyle","Lslashsmall","","","Scaronsmall","Zcaronsmall","Dieresissmall","Brevesmall","Caronsmall","","Dotaccentsmall","","","Macronsmall","","","figuredash","hypheninferior","","","Ogoneksmall","Ringsmall","Cedillasmall","","","","onequarter","onehalf","threequarters","questiondownsmall","oneeighth","threeeighths","fiveeighths","seveneighths","onethird","twothirds","","","zerosuperior","onesuperior","twosuperior","threesuperior","foursuperior","fivesuperior","sixsuperior","sevensuperior","eightsuperior","ninesuperior","zeroinferior","oneinferior","twoinferior","threeinferior","fourinferior","fiveinferior","sixinferior","seveninferior","eightinferior","nineinferior","centinferior","dollarinferior","periodinferior","commainferior","Agravesmall","Aacutesmall","Acircumflexsmall","Atildesmall","Adieresissmall","Aringsmall","AEsmall","Ccedillasmall","Egravesmall","Eacutesmall","Ecircumflexsmall","Edieresissmall","Igravesmall","Iacutesmall","Icircumflexsmall","Idieresissmall","Ethsmall","Ntildesmall","Ogravesmall","Oacutesmall","Ocircumflexsmall","Otildesmall","Odieresissmall","OEsmall","Oslashsmall","Ugravesmall","Uacutesmall","Ucircumflexsmall","Udieresissmall","Yacutesmall","Thornsmall","Ydieresissmall"],Us=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"];q.prototype.charToGlyphIndex=function(t){var e=t.codePointAt(0),i=this.font.glyphs;if(i)for(var n=0;n<i.length;n+=1)for(var r=i.get(n),s=0;s<r.unicodes.length;s+=1)if(r.unicodes[s]===e)return n;return null},W.prototype.charToGlyphIndex=function(t){return this.cmap.glyphIndexMap[t.codePointAt(0)]||0},Y.prototype.charToGlyphIndex=function(t){var e=t.codePointAt(0),i=this.encoding[e];return this.charset.indexOf(i)},$.prototype.nameToGlyphIndex=function(t){return this.names.indexOf(t)},$.prototype.glyphIndexToName=function(t){return this.names[t]};var Xs={line:J};et.prototype.bindConstructorValues=function(t){this.index=t.index||0,this.name=t.name||null,this.unicode=t.unicode||void 0,this.unicodes=t.unicodes||void 0!==t.unicode?[t.unicode]:[],"xMin"in t&&(this.xMin=t.xMin),"yMin"in t&&(this.yMin=t.yMin),"xMax"in t&&(this.xMax=t.xMax),"yMax"in t&&(this.yMax=t.yMax),"advanceWidth"in t&&(this.advanceWidth=t.advanceWidth),Object.defineProperty(this,"path",tt(this,t.path))},et.prototype.addUnicode=function(t){0===this.unicodes.length&&(this.unicode=t),this.unicodes.push(t)},et.prototype.getBoundingBox=function(){return this.path.getBoundingBox()},et.prototype.getPath=function(t,e,i,n,r){t=void 0!==t?t:0,e=void 0!==e?e:0,i=void 0!==i?i:72;var s,o;n||(n={});var a=n.xScale,u=n.yScale;if(n.hinting&&r&&r.hinting&&(o=this.path&&r.hinting.exec(this,i)),o)s=r.hinting.getCommands(o),t=Math.round(t),e=Math.round(e),a=u=1;else{s=this.path.commands;var l=1/(this.path.unitsPerEm||1e3)*i;void 0===a&&(a=l),void 0===u&&(u=l)}
|
|
33
|
+
for(var c=new f,h=0;h<s.length;h+=1){var d=s[h];"M"===d.type?c.moveTo(t+d.x*a,e+-d.y*u):"L"===d.type?c.lineTo(t+d.x*a,e+-d.y*u):"Q"===d.type?c.quadraticCurveTo(t+d.x1*a,e+-d.y1*u,t+d.x*a,e+-d.y*u):"C"===d.type?c.curveTo(t+d.x1*a,e+-d.y1*u,t+d.x2*a,e+-d.y2*u,t+d.x*a,e+-d.y*u):"Z"===d.type&&c.closePath()}return c},et.prototype.getContours=function(){if(void 0===this.points)return[];for(var t=[],e=[],i=0;i<this.points.length;i+=1){var n=this.points[i];e.push(n),n.lastPointOfContour&&(t.push(e),e=[])}return Ss.argument(0===e.length,"There are still points left in the current contour."),t},et.prototype.getMetrics=function(){for(var t=this.path.commands,e=[],i=[],n=0;n<t.length;n+=1){var r=t[n];"Z"!==r.type&&(e.push(r.x),i.push(r.y)),"Q"!==r.type&&"C"!==r.type||(e.push(r.x1),i.push(r.y1)),"C"===r.type&&(e.push(r.x2),i.push(r.y2))}var s={xMin:Math.min.apply(null,e),yMin:Math.min.apply(null,i),xMax:Math.max.apply(null,e),yMax:Math.max.apply(null,i),leftSideBearing:this.leftSideBearing};return isFinite(s.xMin)||(s.xMin=0),isFinite(s.xMax)||(s.xMax=this.advanceWidth),isFinite(s.yMin)||(s.yMin=0),isFinite(s.yMax)||(s.yMax=0),s.rightSideBearing=this.advanceWidth-s.leftSideBearing-(s.xMax-s.xMin),s},et.prototype.draw=function(t,e,i,n,r){this.getPath(e,i,n,r).draw(t)},et.prototype.drawPoints=function(t,e,i,n){function r(e,i,n,r){t.beginPath();for(var s=0;s<e.length;s+=1)t.moveTo(i+e[s].x*r,n+e[s].y*r),t.arc(i+e[s].x*r,n+e[s].y*r,2,0,2*Math.PI,!1);t.closePath(),t.fill()}e=void 0!==e?e:0,i=void 0!==i?i:0,n=void 0!==n?n:24;for(var s=1/this.path.unitsPerEm*n,o=[],a=[],u=this.path,l=0;l<u.commands.length;l+=1){var c=u.commands[l];void 0!==c.x&&o.push({x:c.x,y:-c.y}),void 0!==c.x1&&a.push({x:c.x1,y:-c.y1}),void 0!==c.x2&&a.push({x:c.x2,y:-c.y2})}t.fillStyle="blue",r(o,e,i,s),t.fillStyle="red",r(a,e,i,s)},et.prototype.drawMetrics=function(t,e,i,n){var r;e=void 0!==e?e:0,i=void 0!==i?i:0,n=void 0!==n?n:24,r=1/this.path.unitsPerEm*n,t.lineWidth=1,t.strokeStyle="black",Xs.line(t,e,-1e4,e,1e4),Xs.line(t,-1e4,i,1e4,i);var s=this.xMin||0,o=this.yMin||0,a=this.xMax||0,u=this.yMax||0,l=this.advanceWidth||0;t.strokeStyle="blue",Xs.line(t,e+s*r,-1e4,e+s*r,1e4),Xs.line(t,e+a*r,-1e4,e+a*r,1e4),Xs.line(t,-1e4,i+-o*r,1e4,i+-o*r),Xs.line(t,-1e4,i+-u*r,1e4,i+-u*r),t.strokeStyle="green",Xs.line(t,e+l*r,-1e4,e+l*r,1e4)},nt.prototype.get=function(t){if(void 0===this.glyphs[t]){this.font._push(t),"function"==typeof this.glyphs[t]&&(this.glyphs[t]=this.glyphs[t]());var e=this.glyphs[t],i=this.font._IndexToUnicodeMap[t];if(i)for(var n=0;n<i.unicodes.length;n++)e.addUnicode(i.unicodes[n]);this.font.cffEncoding?this.font.isCIDFont?e.name="gid"+t:e.name=this.font.cffEncoding.charset[t]:this.font.glyphNames.names&&(e.name=this.font.glyphNames.glyphIndexToName(t)),this.glyphs[t].advanceWidth=this.font._hmtxTableData[t].advanceWidth,this.glyphs[t].leftSideBearing=this.font._hmtxTableData[t].leftSideBearing}else"function"==typeof this.glyphs[t]&&(this.glyphs[t]=this.glyphs[t]());return this.glyphs[t]},nt.prototype.push=function(t,e){this.glyphs[t]=e,this.length++};var js={GlyphSet:nt,glyphLoader:rt,ttfGlyphLoader:st,cffGlyphLoader:ot},zs=[{name:"version",op:0,type:"SID"},{name:"notice",op:1,type:"SID"},{name:"copyright",op:1200,type:"SID"},{name:"fullName",op:2,type:"SID"},{name:"familyName",op:3,type:"SID"},{name:"weight",op:4,type:"SID"},{name:"isFixedPitch",op:1201,type:"number",value:0},{name:"italicAngle",op:1202,type:"number",value:0},{name:"underlinePosition",op:1203,type:"number",value:-100},{name:"underlineThickness",op:1204,type:"number",value:50},{name:"paintType",op:1205,type:"number",value:0},{name:"charstringType",op:1206,type:"number",value:2},{name:"fontMatrix",op:1207,type:["real","real","real","real","real","real"],value:[.001,0,0,.001,0,0]},{name:"uniqueId",op:13,type:"number"},{name:"fontBBox",op:5,type:["number","number","number","number"],value:[0,0,0,0]},{name:"strokeWidth",op:1208,type:"number",value:0},{name:"xuid",op:14,type:[],value:null},{name:"charset",op:15,type:"offset",value:0},{name:"encoding",op:16,type:"offset",value:0},{name:"charStrings",op:17,type:"offset",value:0},{name:"private",op:18,type:["number","offset"],value:[0,0]},{name:"ros",op:1230,type:["SID","SID","number"]},{name:"cidFontVersion",op:1231,type:"number",value:0},{name:"cidFontRevision",op:1232,type:"number",value:0},{name:"cidFontType",op:1233,type:"number",value:0},{name:"cidCount",op:1234,type:"number",value:8720},{name:"uidBase",op:1235,type:"number"},{name:"fdArray",op:1236,type:"offset"},{name:"fdSelect",op:1237,type:"offset"},{name:"fontName",op:1238,type:"SID"}],Gs=[{name:"subrs",op:19,type:"offset",value:0},{name:"defaultWidthX",op:20,type:"number",value:0},{name:"nominalWidthX",op:21,type:"number",value:0}],Hs={parse:Ft,make:kt},qs={parse:Ut,make:Xt},Ws={parse:jt,make:zt},Ys={parse:qt,make:Wt},$s={make:Yt,parse:$t},Zs={parse:Zt,make:Qt},Qs=["copyright","fontFamily","fontSubfamily","uniqueID","fullName","version","postScriptName","trademark","manufacturer","designer","description","manufacturerURL","designerURL","license","licenseURL","reserved","preferredFamily","preferredSubfamily","compatibleFullName","sampleText","postScriptFindFontName","wwsFamily","wwsSubfamily"],Ks={0:"en",1:"fr",2:"de",3:"it",4:"nl",5:"sv",6:"es",7:"da",8:"pt",9:"no",10:"he",11:"ja",12:"ar",13:"fi",14:"el",15:"is",16:"mt",17:"tr",18:"hr",19:"zh-Hant",20:"ur",21:"hi",22:"th",23:"ko",24:"lt",25:"pl",26:"hu",27:"es",28:"lv",29:"se",30:"fo",31:"fa",32:"ru",33:"zh",34:"nl-BE",35:"ga",36:"sq",37:"ro",38:"cz",39:"sk",40:"si",41:"yi",42:"sr",43:"mk",44:"bg",45:"uk",46:"be",47:"uz",48:"kk",49:"az-Cyrl",50:"az-Arab",51:"hy",52:"ka",53:"mo",54:"ky",55:"tg",56:"tk",57:"mn-CN",58:"mn",59:"ps",60:"ks",61:"ku",62:"sd",63:"bo",64:"ne",65:"sa",66:"mr",67:"bn",68:"as",69:"gu",70:"pa",71:"or",72:"ml",73:"kn",74:"ta",75:"te",76:"si",77:"my",78:"km",79:"lo",80:"vi",81:"id",82:"tl",83:"ms",84:"ms-Arab",85:"am",86:"ti",87:"om",88:"so",89:"sw",90:"rw",91:"rn",92:"ny",93:"mg",94:"eo",128:"cy",129:"eu",130:"ca",131:"la",132:"qu",133:"gn",134:"ay",135:"tt",136:"ug",137:"dz",138:"jv",139:"su",140:"gl",141:"af",142:"br",143:"iu",144:"gd",145:"gv",146:"ga",147:"to",148:"el-polyton",149:"kl",150:"az",151:"nn"},Js={0:0,1:0,2:0,3:0,4:0,5:0,6:0,7:0,8:0,9:0,10:5,11:1,12:4,13:0,14:6,15:0,16:0,17:0,18:0,19:2,20:4,21:9,22:21,23:3,24:29,25:29,26:29,27:29,28:29,29:0,30:0,31:4,32:7,33:25,34:0,35:0,36:0,37:0,38:29,39:29,40:0,41:5,42:7,43:7,44:7,45:7,46:7,47:7,48:7,49:7,50:4,51:24,52:23,53:7,54:7,55:7,56:7,57:27,58:7,59:4,60:4,61:4,62:4,63:26,64:9,65:9,66:9,67:13,68:13,69:11,70:10,71:12,72:17,73:16,74:14,75:15,76:18,77:19,78:20,79:22,80:30,81:0,82:0,83:0,84:4,85:28,86:28,87:28,88:0,89:0,90:0,91:0,92:0,93:0,94:0,128:0,129:0,130:0,131:0,132:0,133:0,134:0,135:7,136:4,137:26,138:0,139:0,140:0,141:0,142:0,143:28,144:0,145:0,146:0,147:0,148:6,149:0,150:0,151:0},to={1078:"af",1052:"sq",1156:"gsw",1118:"am",5121:"ar-DZ",15361:"ar-BH",3073:"ar",2049:"ar-IQ",11265:"ar-JO",13313:"ar-KW",12289:"ar-LB",4097:"ar-LY",6145:"ary",8193:"ar-OM",16385:"ar-QA",1025:"ar-SA",10241:"ar-SY",7169:"aeb",14337:"ar-AE",9217:"ar-YE",1067:"hy",1101:"as",2092:"az-Cyrl",1068:"az",1133:"ba",1069:"eu",1059:"be",2117:"bn",1093:"bn-IN",8218:"bs-Cyrl",5146:"bs",1150:"br",1026:"bg",1027:"ca",3076:"zh-HK",5124:"zh-MO",2052:"zh",4100:"zh-SG",1028:"zh-TW",1155:"co",1050:"hr",4122:"hr-BA",1029:"cs",1030:"da",1164:"prs",1125:"dv",2067:"nl-BE",1043:"nl",3081:"en-AU",10249:"en-BZ",4105:"en-CA",9225:"en-029",16393:"en-IN",6153:"en-IE",8201:"en-JM",17417:"en-MY",5129:"en-NZ",13321:"en-PH",18441:"en-SG",7177:"en-ZA",11273:"en-TT",2057:"en-GB",1033:"en",12297:"en-ZW",1061:"et",1080:"fo",1124:"fil",1035:"fi",2060:"fr-BE",3084:"fr-CA",1036:"fr",5132:"fr-LU",6156:"fr-MC",4108:"fr-CH",1122:"fy",1110:"gl",1079:"ka",3079:"de-AT",1031:"de",5127:"de-LI",4103:"de-LU",2055:"de-CH",1032:"el",1135:"kl",1095:"gu",1128:"ha",1037:"he",1081:"hi",1038:"hu",1039:"is",1136:"ig",1057:"id",1117:"iu",2141:"iu-Latn",2108:"ga",1076:"xh",1077:"zu",1040:"it",2064:"it-CH",1041:"ja",1099:"kn",1087:"kk",1107:"km",1158:"quc",1159:"rw",1089:"sw",1111:"kok",1042:"ko",1088:"ky",1108:"lo",1062:"lv",1063:"lt",2094:"dsb",1134:"lb",1071:"mk",2110:"ms-BN",1086:"ms",1100:"ml",1082:"mt",1153:"mi",1146:"arn",1102:"mr",1148:"moh",1104:"mn",2128:"mn-CN",1121:"ne",1044:"nb",2068:"nn",1154:"oc",1096:"or",1123:"ps",1045:"pl",1046:"pt",2070:"pt-PT",1094:"pa",1131:"qu-BO",2155:"qu-EC",3179:"qu",1048:"ro",1047:"rm",1049:"ru",9275:"smn",4155:"smj-NO",5179:"smj",3131:"se-FI",1083:"se",2107:"se-SE",8251:"sms",6203:"sma-NO",7227:"sms",1103:"sa",7194:"sr-Cyrl-BA",3098:"sr",6170:"sr-Latn-BA",2074:"sr-Latn",1132:"nso",1074:"tn",1115:"si",1051:"sk",1060:"sl",11274:"es-AR",16394:"es-BO",13322:"es-CL",9226:"es-CO",5130:"es-CR",7178:"es-DO",12298:"es-EC",17418:"es-SV",4106:"es-GT",18442:"es-HN",2058:"es-MX",19466:"es-NI",6154:"es-PA",15370:"es-PY",10250:"es-PE",20490:"es-PR",3082:"es",1034:"es",21514:"es-US",14346:"es-UY",8202:"es-VE",2077:"sv-FI",1053:"sv",1114:"syr",1064:"tg",2143:"tzm",1097:"ta",1092:"tt",1098:"te",1054:"th",1105:"bo",1055:"tr",1090:"tk",1152:"ug",1058:"uk",1070:"hsb",1056:"ur",2115:"uz-Cyrl",1091:"uz",1066:"vi",1106:"cy",1160:"wo",1157:"sah",1144:"ii",1130:"yo"},eo="utf-16",io={0:"macintosh",1:"x-mac-japanese",2:"x-mac-chinesetrad",3:"x-mac-korean",6:"x-mac-greek",7:"x-mac-cyrillic",9:"x-mac-devanagai",10:"x-mac-gurmukhi",11:"x-mac-gujarati",12:"x-mac-oriya",13:"x-mac-bengali",14:"x-mac-tamil",15:"x-mac-telugu",16:"x-mac-kannada",17:"x-mac-malayalam",18:"x-mac-sinhalese",19:"x-mac-burmese",20:"x-mac-khmer",21:"x-mac-thai",22:"x-mac-lao",23:"x-mac-georgian",24:"x-mac-armenian",25:"x-mac-chinesesimp",26:"x-mac-tibetan",27:"x-mac-mongolian",28:"x-mac-ethiopic",29:"x-mac-ce",30:"x-mac-vietnamese",31:"x-mac-extarabic"},no={15:"x-mac-icelandic",17:"x-mac-turkish",18:"x-mac-croatian",24:"x-mac-ce",25:"x-mac-ce",26:"x-mac-ce",27:"x-mac-ce",28:"x-mac-ce",30:"x-mac-icelandic",37:"x-mac-romanian",38:"x-mac-ce",39:"x-mac-ce",40:"x-mac-ce",143:"x-mac-inuit",146:"x-mac-gaelic"},ro={parse:te,make:se},so=[{begin:0,end:127},{begin:128,end:255},{begin:256,end:383},{begin:384,end:591},{begin:592,end:687},{begin:688,end:767},{begin:768,end:879},{begin:880,end:1023},{begin:11392,end:11519},{begin:1024,end:1279},{begin:1328,end:1423},{begin:1424,end:1535},{begin:42240,end:42559},{begin:1536,end:1791},{begin:1984,end:2047},{begin:2304,end:2431},{begin:2432,end:2559},{begin:2560,end:2687},{begin:2688,end:2815},{begin:2816,end:2943},{begin:2944,end:3071},{begin:3072,end:3199},{begin:3200,end:3327},{begin:3328,end:3455},{begin:3584,end:3711},{begin:3712,end:3839},{begin:4256,end:4351},{begin:6912,end:7039},{begin:4352,end:4607},{begin:7680,end:7935},{begin:7936,end:8191},{begin:8192,end:8303},{begin:8304,end:8351},{begin:8352,end:8399},{begin:8400,end:8447},{begin:8448,end:8527},{begin:8528,end:8591},{begin:8592,end:8703},{begin:8704,end:8959},{begin:8960,end:9215},{begin:9216,end:9279},{begin:9280,end:9311},{begin:9312,end:9471},{begin:9472,end:9599},{begin:9600,end:9631},{begin:9632,end:9727},{begin:9728,end:9983},{begin:9984,end:10175},{begin:12288,end:12351},{begin:12352,end:12447},{begin:12448,end:12543},{begin:12544,end:12591},{begin:12592,end:12687},{begin:43072,end:43135},{begin:12800,end:13055},{begin:13056,end:13311},{begin:44032,end:55215},{begin:55296,end:57343},{begin:67840,end:67871},{begin:19968,end:40959},{begin:57344,end:63743},{begin:12736,end:12783},{begin:64256,end:64335},{begin:64336,end:65023},{begin:65056,end:65071},{begin:65040,end:65055},{begin:65104,end:65135},{begin:65136,end:65279},{begin:65280,end:65519},{begin:65520,end:65535},{begin:3840,end:4095},{begin:1792,end:1871},{begin:1920,end:1983},{begin:3456,end:3583},{begin:4096,end:4255},{begin:4608,end:4991},{begin:5024,end:5119},{begin:5120,end:5759},{begin:5760,end:5791},{begin:5792,end:5887},{begin:6016,end:6143},{begin:6144,end:6319},{begin:10240,end:10495},{begin:40960,end:42127},{begin:5888,end:5919},{begin:66304,end:66351},{begin:66352,end:66383},{begin:66560,end:66639},{begin:118784,end:119039},{begin:119808,end:120831},{begin:1044480,end:1048573},{begin:65024,end:65039},{begin:917504,end:917631},{begin:6400,end:6479},{begin:6480,end:6527},{begin:6528,end:6623},{begin:6656,end:6687},{begin:11264,end:11359},{begin:11568,end:11647},{begin:19904,end:19967},{begin:43008,end:43055},{begin:65536,end:65663},{begin:65856,end:65935},{begin:66432,end:66463},{begin:66464,end:66527},{begin:66640,end:66687},{begin:66688,end:66735},{begin:67584,end:67647},{begin:68096,end:68191},{begin:119552,end:119647},{begin:73728,end:74751},{begin:119648,end:119679},{begin:7040,end:7103},{begin:7168,end:7247},{begin:7248,end:7295},{begin:43136,end:43231},{begin:43264,end:43311},{begin:43312,end:43359},{begin:43520,end:43615},{begin:65936,end:65999},{begin:66e3,end:66047},{begin:66208,end:66271},{begin:127024,end:127135}],oo={parse:ae,make:ue,unicodeRanges:so,getUnicodeRange:oe},ao={parse:le,make:ce},uo=new Array(9);uo[1]=function(){var t=this.offset+this.relativeOffset,e=this.parseUShort();return 1===e?{substFormat:1,coverage:this.parsePointer(k.coverage),deltaGlyphId:this.parseUShort()}:2===e?{substFormat:2,coverage:this.parsePointer(k.coverage),substitute:this.parseOffset16List()}:void Ss.assert(!1,"0x"+t.toString(16)+": lookup type 1 format must be 1 or 2.")},uo[2]=function(){var t=this.parseUShort();return Ss.argument(1===t,"GSUB Multiple Substitution Subtable identifier-format must be 1"),{substFormat:t,coverage:this.parsePointer(k.coverage),sequences:this.parseListOfLists()}},uo[3]=function(){var t=this.parseUShort();return Ss.argument(1===t,"GSUB Alternate Substitution Subtable identifier-format must be 1"),{substFormat:t,coverage:this.parsePointer(k.coverage),alternateSets:this.parseListOfLists()}},uo[4]=function(){var t=this.parseUShort();return Ss.argument(1===t,"GSUB ligature table identifier-format must be 1"),{substFormat:t,coverage:this.parsePointer(k.coverage),ligatureSets:this.parseListOfLists(function(){return{ligGlyph:this.parseUShort(),components:this.parseUShortList(this.parseUShort()-1)}})}};var lo={sequenceIndex:k.uShort,lookupListIndex:k.uShort};uo[5]=function(){var t=this.offset+this.relativeOffset,e=this.parseUShort();if(1===e)return{substFormat:e,coverage:this.parsePointer(k.coverage),ruleSets:this.parseListOfLists(function(){var t=this.parseUShort(),e=this.parseUShort();return{input:this.parseUShortList(t-1),lookupRecords:this.parseRecordList(e,lo)}})};if(2===e)return{substFormat:e,coverage:this.parsePointer(k.coverage),classDef:this.parsePointer(k.classDef),classSets:this.parseListOfLists(function(){var t=this.parseUShort(),e=this.parseUShort();return{classes:this.parseUShortList(t-1),lookupRecords:this.parseRecordList(e,lo)}})};if(3===e){var i=this.parseUShort(),n=this.parseUShort();return{substFormat:e,coverages:this.parseList(i,k.pointer(k.coverage)),lookupRecords:this.parseRecordList(n,lo)}}Ss.assert(!1,"0x"+t.toString(16)+": lookup type 5 format must be 1, 2 or 3.")},uo[6]=function(){var t=this.offset+this.relativeOffset,e=this.parseUShort();return 1===e?{substFormat:1,coverage:this.parsePointer(k.coverage),chainRuleSets:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(lo)}})}:2===e?{substFormat:2,coverage:this.parsePointer(k.coverage),backtrackClassDef:this.parsePointer(k.classDef),inputClassDef:this.parsePointer(k.classDef),lookaheadClassDef:this.parsePointer(k.classDef),chainClassSet:this.parseListOfLists(function(){return{backtrack:this.parseUShortList(),input:this.parseUShortList(this.parseShort()-1),lookahead:this.parseUShortList(),lookupRecords:this.parseRecordList(lo)}})}:3===e?{substFormat:3,backtrackCoverage:this.parseList(k.pointer(k.coverage)),inputCoverage:this.parseList(k.pointer(k.coverage)),lookaheadCoverage:this.parseList(k.pointer(k.coverage)),lookupRecords:this.parseRecordList(lo)}:void Ss.assert(!1,"0x"+t.toString(16)+": lookup type 6 format must be 1, 2 or 3.")},uo[7]=function(){var t=this.parseUShort();Ss.argument(1===t,"GSUB Extension Substitution subtable identifier-format must be 1");var e=this.parseUShort(),i=new k(this.data,this.offset+this.parseULong());return{substFormat:1,lookupType:e,extension:uo[e].call(i)}},uo[8]=function(){var t=this.parseUShort();return Ss.argument(1===t,"GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"),{substFormat:t,coverage:this.parsePointer(k.coverage),backtrackCoverage:this.parseList(k.pointer(k.coverage)),lookaheadCoverage:this.parseList(k.pointer(k.coverage)),substitutes:this.parseUShortList()}};var co=new Array(9);co[1]=function(t){return 1===t.substFormat?new Vs.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new Vs.Coverage(t.coverage)},{name:"deltaGlyphID",type:"USHORT",value:t.deltaGlyphId}]):new Vs.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:2},{name:"coverage",type:"TABLE",value:new Vs.Coverage(t.coverage)}].concat(Vs.ushortList("substitute",t.substitute)))},co[2]=function(t){return Ss.assert(1===t.substFormat,"Lookup type 2 substFormat must be 1."),new Vs.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new Vs.Coverage(t.coverage)}].concat(Vs.tableList("seqSet",t.sequences,function(t){return new Vs.Table("sequenceSetTable",Vs.ushortList("sequence",t))})))},co[3]=function(t){return Ss.assert(1===t.substFormat,"Lookup type 3 substFormat must be 1."),new Vs.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new Vs.Coverage(t.coverage)}].concat(Vs.tableList("altSet",t.alternateSets,function(t){return new Vs.Table("alternateSetTable",Vs.ushortList("alternate",t))})))},co[4]=function(t){return Ss.assert(1===t.substFormat,"Lookup type 4 substFormat must be 1."),new Vs.Table("substitutionTable",[{name:"substFormat",type:"USHORT",value:1},{name:"coverage",type:"TABLE",value:new Vs.Coverage(t.coverage)}].concat(Vs.tableList("ligSet",t.ligatureSets,function(t){return new Vs.Table("ligatureSetTable",Vs.tableList("ligature",t,function(t){return new Vs.Table("ligatureTable",[{name:"ligGlyph",type:"USHORT",value:t.ligGlyph}].concat(Vs.ushortList("component",t.components,t.components.length+1)))}))})))},co[6]=function(t){if(1===t.substFormat){return new Vs.Table("chainContextTable",[{name:"substFormat",type:"USHORT",value:t.substFormat},{name:"coverage",type:"TABLE",value:new Vs.Coverage(t.coverage)}].concat(Vs.tableList("chainRuleSet",t.chainRuleSets,function(t){return new Vs.Table("chainRuleSetTable",Vs.tableList("chainRule",t,function(t){var e=Vs.ushortList("backtrackGlyph",t.backtrack,t.backtrack.length).concat(Vs.ushortList("inputGlyph",t.input,t.input.length+1)).concat(Vs.ushortList("lookaheadGlyph",t.lookahead,t.lookahead.length)).concat(Vs.ushortList("substitution",[],t.lookupRecords.length));return t.lookupRecords.forEach(function(t,i){e=e.concat({name:"sequenceIndex"+i,type:"USHORT",value:t.sequenceIndex}).concat({name:"lookupListIndex"+i,type:"USHORT",value:t.lookupListIndex})}),new Vs.Table("chainRuleTable",e)}))})))}if(2===t.substFormat)Ss.assert(!1,"lookup type 6 format 2 is not yet supported.");else if(3===t.substFormat){var e=[{name:"substFormat",type:"USHORT",value:t.substFormat}];e.push({name:"backtrackGlyphCount",type:"USHORT",value:t.backtrackCoverage.length}),t.backtrackCoverage.forEach(function(t,i){e.push({name:"backtrackCoverage"+i,type:"TABLE",value:new Vs.Coverage(t)})}),e.push({name:"inputGlyphCount",type:"USHORT",value:t.inputCoverage.length}),t.inputCoverage.forEach(function(t,i){e.push({name:"inputCoverage"+i,type:"TABLE",value:new Vs.Coverage(t)})}),e.push({name:"lookaheadGlyphCount",type:"USHORT",value:t.lookaheadCoverage.length}),t.lookaheadCoverage.forEach(function(t,i){e.push({name:"lookaheadCoverage"+i,type:"TABLE",value:new Vs.Coverage(t)})}),e.push({name:"substitutionCount",type:"USHORT",value:t.lookupRecords.length}),t.lookupRecords.forEach(function(t,i){e=e.concat({name:"sequenceIndex"+i,type:"USHORT",value:t.sequenceIndex}).concat({name:"lookupListIndex"+i,type:"USHORT",value:t.lookupListIndex})});var i=new Vs.Table("chainContextTable",e);return i}Ss.assert(!1,"lookup type 6 format must be 1, 2 or 3.")};var ho={parse:he,make:de},po={parse:pe,make:fe},fo={make:xe,fontToTable:we,computeCheckSum:me};Te.prototype={searchTag:be,binSearch:Se,getTable:function(t){var e=this.font.tables[this.tableName];return!e&&t&&(e=this.font.tables[this.tableName]=this.createDefaultTable()),e},getScriptNames:function(){var t=this.getTable();return t?t.scripts.map(function(t){return t.tag}):[]},getDefaultScriptName:function(){var t=this.getTable();if(t){for(var e=!1,i=0;i<t.scripts.length;i++){var n=t.scripts[i].tag;if("DFLT"===n)return n;"latn"===n&&(e=!0)}return e?"latn":void 0}},getScriptTable:function(t,e){var i=this.getTable(e);if(i){t=t||"DFLT";var n=i.scripts,r=be(i.scripts,t);if(r>=0)return n[r].script;if(e){var s={tag:t,script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}};return n.splice(-1-r,0,s),s.script}}},getLangSysTable:function(t,e,i){var n=this.getScriptTable(t,i);if(n){if(!e||"dflt"===e||"DFLT"===e)return n.defaultLangSys;var r=be(n.langSysRecords,e);if(r>=0)return n.langSysRecords[r].langSys;if(i){var s={tag:e,langSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]}};return n.langSysRecords.splice(-1-r,0,s),s.langSys}}},getFeatureTable:function(t,e,i,n){var r=this.getLangSysTable(t,e,n);if(r){for(var s,o=r.featureIndexes,a=this.font.tables[this.tableName].features,u=0;u<o.length;u++)if(s=a[o[u]],s.tag===i)return s.feature;if(n){var l=a.length;return Ss.assert(0===l||i>=a[l-1].tag,"Features must be added in alphabetical order."),s={tag:i,feature:{params:0,lookupListIndexes:[]}},a.push(s),o.push(l),s.feature}}},getLookupTables:function(t,e,i,n,r){var s=this.getFeatureTable(t,e,i,r),o=[];if(s){for(var a,u=s.lookupListIndexes,l=this.font.tables[this.tableName].lookups,c=0;c<u.length;c++)a=l[u[c]],a.lookupType===n&&o.push(a);if(0===o.length&&r){a={lookupType:n,lookupFlag:0,subtables:[],markFilteringSet:void 0};var h=l.length;return l.push(a),u.push(h),[a]}}return o},getGlyphClass:function(t,e){switch(t.format){case 1:return t.startGlyph<=e&&e<t.startGlyph+t.classes.length?t.classes[e-t.startGlyph]:0;case 2:var i=Ce(t.ranges,e);return i?i.classId:0}},getCoverageIndex:function(t,e){switch(t.format){case 1:var i=Se(t.glyphs,e);return i>=0?i:-1;case 2:var n=Ce(t.ranges,e);return n?n.index+e-n.start:-1}},expandCoverage:function(t){if(1===t.format)return t.glyphs;for(var e=[],i=t.ranges,n=0;n<i.length;n++)for(var r=i[n],s=r.start,o=r.end,a=s;a<=o;a++)e.push(a);return e}},Fe.prototype=Te.prototype,Fe.prototype.init=function(){var t=this.getDefaultScriptName();this.defaultKerningTables=this.getKerningTables(t)},Fe.prototype.getKerningValue=function(t,e,i){for(var n=0;n<t.length;n++)for(var r=t[n].subtables,s=0;s<r.length;s++){var o=r[s],a=this.getCoverageIndex(o.coverage,e);if(!(a<0))switch(o.posFormat){case 1:for(var u=o.pairSets[a],l=0;l<u.length;l++){var c=u[l];if(c.secondGlyph===i)return c.value1&&c.value1.xAdvance||0}break;case 2:var h=this.getGlyphClass(o.classDef1,e),d=this.getGlyphClass(o.classDef2,i),p=o.classRecords[h][d];return p.value1&&p.value1.xAdvance||0}}return 0},Fe.prototype.getKerningTables=function(t,e){if(this.font.tables.gpos)return this.getLookupTables(t,e,"kern",2)},Oe.prototype=Te.prototype,Oe.prototype.createDefaultTable=function(){return{version:1,scripts:[{tag:"DFLT",script:{defaultLangSys:{reserved:0,reqFeatureIndex:65535,featureIndexes:[]},langSysRecords:[]}}],features:[],lookups:[]}},Oe.prototype.getSingle=function(t,e,i){for(var n=[],r=this.getLookupTables(e,i,t,1),s=0;s<r.length;s++)for(var o=r[s].subtables,a=0;a<o.length;a++){var u=o[a],l=this.expandCoverage(u.coverage),c=void 0;if(1===u.substFormat){var h=u.deltaGlyphId;for(c=0;c<l.length;c++){var d=l[c];n.push({sub:d,by:d+h})}}else{var p=u.substitute;for(c=0;c<l.length;c++)n.push({sub:l[c],by:p[c]})}}return n},Oe.prototype.getMultiple=function(t,e,i){for(var n=[],r=this.getLookupTables(e,i,t,2),s=0;s<r.length;s++)for(var o=r[s].subtables,a=0;a<o.length;a++){var u=o[a],l=this.expandCoverage(u.coverage),c=void 0;for(c=0;c<l.length;c++){var h=l[c],d=u.sequences[c];n.push({sub:h,by:d})}}return n},Oe.prototype.getAlternates=function(t,e,i){for(var n=[],r=this.getLookupTables(e,i,t,3),s=0;s<r.length;s++)for(var o=r[s].subtables,a=0;a<o.length;a++)for(var u=o[a],l=this.expandCoverage(u.coverage),c=u.alternateSets,h=0;h<l.length;h++)n.push({sub:l[h],by:c[h]});return n},Oe.prototype.getLigatures=function(t,e,i){for(var n=[],r=this.getLookupTables(e,i,t,4),s=0;s<r.length;s++)for(var o=r[s].subtables,a=0;a<o.length;a++)for(var u=o[a],l=this.expandCoverage(u.coverage),c=u.ligatureSets,h=0;h<l.length;h++)for(var d=l[h],p=c[h],f=0;f<p.length;f++){var g=p[f];n.push({sub:[d].concat(g.components),by:g.ligGlyph})}return n},Oe.prototype.addSingle=function(t,e,i,n){var r=this.getLookupTables(i,n,t,1,!0)[0],s=Ee(r,2,{substFormat:2,coverage:{format:1,glyphs:[]},substitute:[]});Ss.assert(1===s.coverage.format,"Single: unable to modify coverage table format "+s.coverage.format);var o=e.sub,a=this.binSearch(s.coverage.glyphs,o);a<0&&(a=-1-a,s.coverage.glyphs.splice(a,0,o),s.substitute.splice(a,0,0)),s.substitute[a]=e.by},Oe.prototype.addMultiple=function(t,e,i,n){Ss.assert(e.by instanceof Array&&e.by.length>1,'Multiple: "by" must be an array of two or more ids');var r=this.getLookupTables(i,n,t,2,!0)[0],s=Ee(r,1,{substFormat:1,coverage:{format:1,glyphs:[]},sequences:[]});Ss.assert(1===s.coverage.format,"Multiple: unable to modify coverage table format "+s.coverage.format);var o=e.sub,a=this.binSearch(s.coverage.glyphs,o);a<0&&(a=-1-a,s.coverage.glyphs.splice(a,0,o),s.sequences.splice(a,0,0)),s.sequences[a]=e.by},Oe.prototype.addAlternate=function(t,e,i,n){var r=this.getLookupTables(i,n,t,3,!0)[0],s=Ee(r,1,{substFormat:1,coverage:{format:1,glyphs:[]},alternateSets:[]});Ss.assert(1===s.coverage.format,"Alternate: unable to modify coverage table format "+s.coverage.format);var o=e.sub,a=this.binSearch(s.coverage.glyphs,o);a<0&&(a=-1-a,s.coverage.glyphs.splice(a,0,o),s.alternateSets.splice(a,0,0)),s.alternateSets[a]=e.by},Oe.prototype.addLigature=function(t,e,i,n){var r=this.getLookupTables(i,n,t,4,!0)[0],s=r.subtables[0];s||(s={substFormat:1,coverage:{format:1,glyphs:[]},ligatureSets:[]},r.subtables[0]=s),Ss.assert(1===s.coverage.format,"Ligature: unable to modify coverage table format "+s.coverage.format);var o=e.sub[0],a=e.sub.slice(1),u={ligGlyph:e.by,components:a},l=this.binSearch(s.coverage.glyphs,o);if(l>=0){for(var c=s.ligatureSets[l],h=0;h<c.length;h++)if(Ne(c[h].components,a))return;c.push(u)}else l=-1-l,s.coverage.glyphs.splice(l,0,o),s.ligatureSets.splice(l,0,[u])},Oe.prototype.getFeature=function(t,e,i){if(/ss\d\d/.test(t))return this.getSingle(t,e,i);switch(t){case"aalt":case"salt":return this.getSingle(t,e,i).concat(this.getAlternates(t,e,i));case"dlig":case"liga":case"rlig":return this.getLigatures(t,e,i);case"ccmp":return this.getMultiple(t,e,i).concat(this.getLigatures(t,e,i));case"stch":return this.getMultiple(t,e,i)}},Oe.prototype.add=function(t,e,i,n){if(/ss\d\d/.test(t))return this.addSingle(t,e,i,n);switch(t){case"aalt":case"salt":return"number"==typeof e.by?this.addSingle(t,e,i,n):this.addAlternate(t,e,i,n);case"dlig":case"liga":case"rlig":return this.addLigature(t,e,i,n);case"ccmp":return e.by instanceof Array?this.addMultiple(t,e,i,n):this.addLigature(t,e,i,n)}};var go,mo,_o,xo,yo={getPath:Re,parse:je},vo=function(t){var e=this.srPeriod,i=this.srPhase,n=this.srThreshold,r=1;return t<0&&(t=-t,r=-1),t+=n-i,t=Math.trunc(t/e)*e,t+=i,t<0?i*r:t*r},wo={x:1,y:0,axis:"x",distance:function(t,e,i,n){return(i?t.xo:t.x)-(n?e.xo:e.x)},interpolate:function(t,e,i,n){var r,s,o,a,u,l,c;return n&&n!==this?(r=n.distance(t,e,!0,!0),s=n.distance(t,i,!0,!0),u=n.distance(e,e,!1,!0),l=n.distance(i,i,!1,!0),o=Math.abs(r),a=Math.abs(s),0===(c=o+a)?void wo.setRelative(t,t,(u+l)/2,n,!0):void wo.setRelative(t,t,(u*a+l*o)/c,n,!0)):(r=t.xo-e.xo,s=t.xo-i.xo,u=e.x-e.xo,l=i.x-i.xo,o=Math.abs(r),a=Math.abs(s),0===(c=o+a)?void(t.x=t.xo+(u+l)/2):void(t.x=t.xo+(u*a+l*o)/c))},normalSlope:Number.NEGATIVE_INFINITY,setRelative:function(t,e,i,n,r){if(!n||n===this)return void(t.x=(r?e.xo:e.x)+i);var s=r?e.xo:e.x,o=r?e.yo:e.y,a=s+i*n.x,u=o+i*n.y;t.x=a+(t.y-u)/n.normalSlope},slope:0,touch:function(t){t.xTouched=!0},touched:function(t){return t.xTouched},untouch:function(t){t.xTouched=!1}},bo={x:0,y:1,axis:"y",distance:function(t,e,i,n){return(i?t.yo:t.y)-(n?e.yo:e.y)},interpolate:function(t,e,i,n){var r,s,o,a,u,l,c;return n&&n!==this?(r=n.distance(t,e,!0,!0),s=n.distance(t,i,!0,!0),u=n.distance(e,e,!1,!0),l=n.distance(i,i,!1,!0),o=Math.abs(r),a=Math.abs(s),0===(c=o+a)?void bo.setRelative(t,t,(u+l)/2,n,!0):void bo.setRelative(t,t,(u*a+l*o)/c,n,!0)):(r=t.yo-e.yo,s=t.yo-i.yo,u=e.y-e.yo,l=i.y-i.yo,o=Math.abs(r),a=Math.abs(s),0===(c=o+a)?void(t.y=t.yo+(u+l)/2):void(t.y=t.yo+(u*a+l*o)/c))},normalSlope:0,setRelative:function(t,e,i,n,r){if(!n||n===this)return void(t.y=(r?e.yo:e.y)+i);var s=r?e.xo:e.x,o=r?e.yo:e.y,a=s+i*n.x,u=o+i*n.y;t.y=u+n.normalSlope*(t.x-a)},slope:Number.POSITIVE_INFINITY,touch:function(t){t.yTouched=!0},touched:function(t){return t.yTouched},untouch:function(t){t.yTouched=!1}};Object.freeze(wo),Object.freeze(bo),Ze.prototype.distance=function(t,e,i,n){return this.x*wo.distance(t,e,i,n)+this.y*bo.distance(t,e,i,n)},Ze.prototype.interpolate=function(t,e,i,n){var r,s,o,a,u,l,c;if(o=n.distance(t,e,!0,!0),a=n.distance(t,i,!0,!0),r=n.distance(e,e,!1,!0),s=n.distance(i,i,!1,!0),u=Math.abs(o),l=Math.abs(a),0===(c=u+l))return void this.setRelative(t,t,(r+s)/2,n,!0);this.setRelative(t,t,(r*l+s*u)/c,n,!0)},Ze.prototype.setRelative=function(t,e,i,n,r){n=n||this;var s=r?e.xo:e.x,o=r?e.yo:e.y,a=s+i*n.x,u=o+i*n.y,l=n.normalSlope,c=this.slope,h=t.x,d=t.y;t.x=(c*h-l*a+u-d)/(c-l),t.y=c*(t.x-h)+d},Ze.prototype.touch=function(t){t.xTouched=!0,t.yTouched=!0},Ke.prototype.nextTouched=function(t){for(var e=this.nextPointOnContour;!t.touched(e)&&e!==this;)e=e.nextPointOnContour;return e},Ke.prototype.prevTouched=function(t){for(var e=this.prevPointOnContour;!t.touched(e)&&e!==this;)e=e.prevPointOnContour;return e};var So=Object.freeze(new Ke(0,0)),Co={cvCutIn:17/16,deltaBase:9,deltaShift:.125,loop:1,minDis:1,autoFlip:!0};ze.prototype.exec=function(e,i){if("number"!=typeof i)throw new Error("Point size is not a number!");if(!(this._errorState>2)){var n=this.font,r=this._prepState;if(!r||r.ppem!==i){var s=this._fpgmState;if(!s){Je.prototype=Co,s=this._fpgmState=new Je("fpgm",n.tables.fpgm),s.funcs=[],s.font=n,t.DEBUG&&(console.log("---EXEC FPGM---"),s.step=-1);try{mo(s)}catch(t){return console.log("Hinting error in FPGM:"+t),void(this._errorState=3)}}Je.prototype=s,r=this._prepState=new Je("prep",n.tables.prep),r.ppem=i;var o=n.tables.cvt;if(o)for(var a=r.cvt=new Array(o.length),u=i/n.unitsPerEm,l=0;l<o.length;l++)a[l]=o[l]*u;else r.cvt=[];t.DEBUG&&(console.log("---EXEC PREP---"),r.step=-1);try{mo(r)}catch(t){this._errorState<2&&console.log("Hinting error in PREP:"+t),this._errorState=2}}if(!(this._errorState>1))try{return _o(e,r)}catch(t){return this._errorState<1&&(console.log("Hinting error:"+t),console.log("Note: further hinting errors are silenced")),void(this._errorState=1)}}},_o=function(e,i){var n,r,s,o=i.ppem/i.font.unitsPerEm,a=o,u=e.components;if(Je.prototype=i,u){var l=i.font;r=[],n=[];for(var c=0;c<u.length;c++){var h=u[c],d=l.glyphs.get(h.glyphIndex);s=new Je("glyf",d.instructions),t.DEBUG&&(console.log("---EXEC COMP "+c+"---"),s.step=-1),xo(d,s,o,a);for(var p=Math.round(h.dx*o),f=Math.round(h.dy*a),g=s.gZone,m=s.contours,_=0;_<g.length;_++){var x=g[_];x.xTouched=x.yTouched=!1,
|
|
34
|
+
x.xo=x.x=x.x+p,x.yo=x.y=x.y+f}var y=r.length;r.push.apply(r,g);for(var v=0;v<m.length;v++)n.push(m[v]+y)}e.instructions&&!s.inhibitGridFit&&(s=new Je("glyf",e.instructions),s.gZone=s.z0=s.z1=s.z2=r,s.contours=n,r.push(new Ke(0,0),new Ke(Math.round(e.advanceWidth*o),0)),t.DEBUG&&(console.log("---EXEC COMPOSITE---"),s.step=-1),mo(s),r.length-=2)}else s=new Je("glyf",e.instructions),t.DEBUG&&(console.log("---EXEC GLYPH---"),s.step=-1),xo(e,s,o,a),r=s.gZone;return r},xo=function(e,i,n,r){for(var s,o=e.points||[],a=o.length,u=i.gZone=i.z0=i.z1=i.z2=[],l=i.contours=[],c=0;c<a;c++)s=o[c],u[c]=new Ke(s.x*n,s.y*r,s.lastPointOfContour,s.onCurve);for(var h,d,p=0;p<a;p++)s=u[p],h||(h=s,l.push(p)),s.lastPointOfContour?(s.nextPointOnContour=h,h.prevPointOnContour=s,h=void 0):(d=u[p+1],s.nextPointOnContour=d,d.prevPointOnContour=s);if(!i.inhibitGridFit){if(t.DEBUG){console.log("PROCESSING GLYPH",i.stack);for(var f=0;f<a;f++)console.log(f,u[f].x,u[f].y)}if(u.push(new Ke(0,0),new Ke(Math.round(e.advanceWidth*n),0)),mo(i),u.length-=2,t.DEBUG){console.log("FINISHED GLYPH",i.stack);for(var g=0;g<a;g++)console.log(g,u[g].x,u[g].y)}}},mo=function(e){var i=e.prog;if(i){var n,r=i.length;for(e.ip=0;e.ip<r;e.ip++){if(t.DEBUG&&e.step++,!(n=go[i[e.ip]]))throw new Error("unknown instruction: 0x"+Number(i[e.ip]).toString(16));n(e)}}},go=[ii.bind(void 0,bo),ii.bind(void 0,wo),ni.bind(void 0,bo),ni.bind(void 0,wo),ri.bind(void 0,bo),ri.bind(void 0,wo),si.bind(void 0,0),si.bind(void 0,1),oi.bind(void 0,0),oi.bind(void 0,1),ai,ui,li,ci,hi,di,pi,fi,gi,mi,_i,xi,yi,vi,wi,bi,Si,Ci,Ti,Fi,void 0,void 0,Oi,Ni,Ei,Mi,Di,Bi,Ai,void 0,void 0,void 0,Vi,Ii,Pi,void 0,Li.bind(void 0,0),Li.bind(void 0,1),Ri.bind(void 0,bo),Ri.bind(void 0,wo),ki.bind(void 0,0),ki.bind(void 0,1),Ui.bind(void 0,0),Ui.bind(void 0,1),Xi.bind(void 0,0),Xi.bind(void 0,1),ji,zi,Gi.bind(void 0,0),Gi.bind(void 0,1),Hi,qi,Wi.bind(void 0,0),Wi.bind(void 0,1),Yi,$i,Zi,Qi,Ki,Ji,tn.bind(void 0,0),tn.bind(void 0,1),void 0,en.bind(void 0,0),en.bind(void 0,1),nn,void 0,rn,void 0,void 0,sn,on,an,un,ln,cn,hn,dn,pn,fn,gn,mn,_n,xn.bind(void 0,1),yn,vn,wn,bn,Sn,Cn,Tn,Fn,On,Nn,En.bind(void 0,0),En.bind(void 0,1),En.bind(void 0,2),En.bind(void 0,3),void 0,void 0,void 0,void 0,Mn,xn.bind(void 0,2),xn.bind(void 0,3),Dn.bind(void 0,1),Dn.bind(void 0,2),Dn.bind(void 0,3),Vn,In,void 0,void 0,Bn,void 0,An,Pn,Ni,Ni,void 0,void 0,void 0,void 0,void 0,Ln,Rn.bind(void 0,0),Rn.bind(void 0,1),kn,void 0,Un,Xn,jn,zn,Gn,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,void 0,Hn.bind(void 0,1),Hn.bind(void 0,2),Hn.bind(void 0,3),Hn.bind(void 0,4),Hn.bind(void 0,5),Hn.bind(void 0,6),Hn.bind(void 0,7),Hn.bind(void 0,8),qn.bind(void 0,1),qn.bind(void 0,2),qn.bind(void 0,3),qn.bind(void 0,4),qn.bind(void 0,5),qn.bind(void 0,6),qn.bind(void 0,7),qn.bind(void 0,8),Wn.bind(void 0,0,0,0,0,0),Wn.bind(void 0,0,0,0,0,1),Wn.bind(void 0,0,0,0,0,2),Wn.bind(void 0,0,0,0,0,3),Wn.bind(void 0,0,0,0,1,0),Wn.bind(void 0,0,0,0,1,1),Wn.bind(void 0,0,0,0,1,2),Wn.bind(void 0,0,0,0,1,3),Wn.bind(void 0,0,0,1,0,0),Wn.bind(void 0,0,0,1,0,1),Wn.bind(void 0,0,0,1,0,2),Wn.bind(void 0,0,0,1,0,3),Wn.bind(void 0,0,0,1,1,0),Wn.bind(void 0,0,0,1,1,1),Wn.bind(void 0,0,0,1,1,2),Wn.bind(void 0,0,0,1,1,3),Wn.bind(void 0,0,1,0,0,0),Wn.bind(void 0,0,1,0,0,1),Wn.bind(void 0,0,1,0,0,2),Wn.bind(void 0,0,1,0,0,3),Wn.bind(void 0,0,1,0,1,0),Wn.bind(void 0,0,1,0,1,1),Wn.bind(void 0,0,1,0,1,2),Wn.bind(void 0,0,1,0,1,3),Wn.bind(void 0,0,1,1,0,0),Wn.bind(void 0,0,1,1,0,1),Wn.bind(void 0,0,1,1,0,2),Wn.bind(void 0,0,1,1,0,3),Wn.bind(void 0,0,1,1,1,0),Wn.bind(void 0,0,1,1,1,1),Wn.bind(void 0,0,1,1,1,2),Wn.bind(void 0,0,1,1,1,3),Wn.bind(void 0,1,0,0,0,0),Wn.bind(void 0,1,0,0,0,1),Wn.bind(void 0,1,0,0,0,2),Wn.bind(void 0,1,0,0,0,3),Wn.bind(void 0,1,0,0,1,0),Wn.bind(void 0,1,0,0,1,1),Wn.bind(void 0,1,0,0,1,2),Wn.bind(void 0,1,0,0,1,3),Wn.bind(void 0,1,0,1,0,0),Wn.bind(void 0,1,0,1,0,1),Wn.bind(void 0,1,0,1,0,2),Wn.bind(void 0,1,0,1,0,3),Wn.bind(void 0,1,0,1,1,0),Wn.bind(void 0,1,0,1,1,1),Wn.bind(void 0,1,0,1,1,2),Wn.bind(void 0,1,0,1,1,3),Wn.bind(void 0,1,1,0,0,0),Wn.bind(void 0,1,1,0,0,1),Wn.bind(void 0,1,1,0,0,2),Wn.bind(void 0,1,1,0,0,3),Wn.bind(void 0,1,1,0,1,0),Wn.bind(void 0,1,1,0,1,1),Wn.bind(void 0,1,1,0,1,2),Wn.bind(void 0,1,1,0,1,3),Wn.bind(void 0,1,1,1,0,0),Wn.bind(void 0,1,1,1,0,1),Wn.bind(void 0,1,1,1,0,2),Wn.bind(void 0,1,1,1,0,3),Wn.bind(void 0,1,1,1,1,0),Wn.bind(void 0,1,1,1,1,1),Wn.bind(void 0,1,1,1,1,2),Wn.bind(void 0,1,1,1,1,3)],Yn.prototype.setState=function(t,e){return this.state[t]=e,this.activeState={key:t,value:this.state[t]},this.activeState},Yn.prototype.getState=function(t){return this.state[t]||null},tr.prototype.inboundIndex=function(t){return t>=0&&t<this.tokens.length},tr.prototype.composeRUD=function(t){var e=this,i=t.map(function(t){return e[t[0]].apply(e,t.slice(1).concat(!0))}),n=function(t){return"object"==typeof t&&t.hasOwnProperty("FAIL")};if(i.every(n))return{FAIL:"composeRUD: one or more operations hasn't completed successfully",report:i.filter(n)};this.dispatch("composeRUD",[i.filter(function(t){return!n(t)})])},tr.prototype.replaceRange=function(t,e,i,n){e=null!==e?e:this.tokens.length;var r=i.every(function(t){return t instanceof Yn});if(!isNaN(t)&&this.inboundIndex(t)&&r){var s=this.tokens.splice.apply(this.tokens,[t,e].concat(i));return n||this.dispatch("replaceToken",[t,e,i]),[s,i]}return{FAIL:"replaceRange: invalid tokens or startIndex."}},tr.prototype.replaceToken=function(t,e,i){if(!isNaN(t)&&this.inboundIndex(t)&&e instanceof Yn){var n=this.tokens.splice(t,1,e);return i||this.dispatch("replaceToken",[t,e]),[n[0],e]}return{FAIL:"replaceToken: invalid token or index."}},tr.prototype.removeRange=function(t,e,i){e=isNaN(e)?this.tokens.length:e;var n=this.tokens.splice(t,e);return i||this.dispatch("removeRange",[n,t,e]),n},tr.prototype.removeToken=function(t,e){if(!isNaN(t)&&this.inboundIndex(t)){var i=this.tokens.splice(t,1);return e||this.dispatch("removeToken",[i,t]),i}return{FAIL:"removeToken: invalid token index."}},tr.prototype.insertToken=function(t,e,i){return t.every(function(t){return t instanceof Yn})?(this.tokens.splice.apply(this.tokens,[e,0].concat(t)),i||this.dispatch("insertToken",[t,e]),t):{FAIL:"insertToken: invalid token(s)."}},tr.prototype.registerModifier=function(t,e,i){this.events.newToken.subscribe(function(n,r){var s=[n,r],o=null===e||e.apply(this,s)===!0,a=[n,r];if(o){var u=i.apply(this,a);n.setState(t,u)}}),this.registeredModifiers.push(t)},Kn.prototype.subscribe=function(t){return"function"==typeof t?this.subscribers.push(t)-1:{FAIL:"invalid '"+this.eventId+"' event handler"}},Kn.prototype.unsubscribe=function(t){this.subscribers.splice(t,1)},Qn.prototype.setCurrentIndex=function(t){this.index=t,this.current=this.context[t],this.backtrack=this.context.slice(0,t),this.lookahead=this.context.slice(t+1)},Qn.prototype.get=function(t){switch(!0){case 0===t:return this.current;case t<0&&Math.abs(t)<=this.backtrack.length:return this.backtrack.slice(t)[0];case t>0&&t<=this.lookahead.length:return this.lookahead[t-1];default:return null}},tr.prototype.rangeToText=function(t){if(t instanceof $n)return this.getRangeTokens(t).map(function(t){return t.char}).join("")},tr.prototype.getText=function(){return this.tokens.map(function(t){return t.char}).join("")},tr.prototype.getContext=function(t){var e=this.registeredContexts[t];return e?e:null},tr.prototype.on=function(t,e){var i=this.events[t];return i?i.subscribe(e):null},tr.prototype.dispatch=function(t,e){var i=this,n=this.events[t];n instanceof Kn&&n.subscribers.forEach(function(t){t.apply(i,e||[])})},tr.prototype.registerContextChecker=function(t,e,i){if(this.getContext(t))return{FAIL:"context name '"+t+"' is already registered."};if("function"!=typeof e)return{FAIL:"missing context start check."};if("function"!=typeof i)return{FAIL:"missing context end check."};var n=new Zn(t,e,i);return this.registeredContexts[t]=n,this.contextCheckers.push(n),n},tr.prototype.getRangeTokens=function(t){var e=t.startIndex+t.endOffset;return[].concat(this.tokens.slice(t.startIndex,e))},tr.prototype.getContextRanges=function(t){var e=this.getContext(t);return e?e.ranges:{FAIL:"context checker '"+t+"' is not registered."}},tr.prototype.resetContextsRanges=function(){var t=this.registeredContexts;for(var e in t)if(t.hasOwnProperty(e)){var i=t[e];i.ranges=[]}},tr.prototype.updateContextsRanges=function(){this.resetContextsRanges();for(var t=this.tokens.map(function(t){return t.char}),e=0;e<t.length;e++){var i=new Qn(t,e);this.runContextCheck(i)}this.dispatch("updateContextsRanges",[this.registeredContexts])},tr.prototype.setEndOffset=function(t,e){var i=this.getContext(e).openRange.startIndex,n=new $n(i,t,e),r=this.getContext(e).ranges;return n.rangeId=e+"."+r.length,r.push(n),this.getContext(e).openRange=null,n},tr.prototype.runContextCheck=function(t){var e=this,i=t.index;this.contextCheckers.forEach(function(n){var r=n.contextName,s=e.getContext(r).openRange;if(!s&&n.checkStart(t)&&(s=new $n(i,null,r),e.getContext(r).openRange=s,e.dispatch("contextStart",[r,i])),s&&n.checkEnd(t)){var o=i-s.startIndex+1,a=e.setEndOffset(o,r);e.dispatch("contextEnd",[r,a])}})},tr.prototype.tokenize=function(t){this.tokens=[],this.resetContextsRanges();var e=Array.from(t);this.dispatch("start");for(var i=0;i<e.length;i++){var n=e[i],r=new Qn(e,i);this.dispatch("next",[r]),this.runContextCheck(r);var s=new Yn(n);this.tokens.push(s),this.dispatch("newToken",[s,r])}return this.dispatch("end",[this.tokens]),this.tokens},or.prototype.getDefaultScriptFeaturesIndexes=function(){for(var t=this.font.tables.gsub.scripts,e=0;e<t.length;e++){var i=t[e];if("DFLT"===i.tag)return i.script.defaultLangSys.featureIndexes}return[]},or.prototype.getScriptFeaturesIndexes=function(t){if(!this.font.tables.gsub)return[];if(!t)return this.getDefaultScriptFeaturesIndexes();for(var e=this.font.tables.gsub.scripts,i=0;i<e.length;i++){var n=e[i];if(n.tag===t&&n.script.defaultLangSys)return n.script.defaultLangSys.featureIndexes;var r=n.langSysRecords;if(r)for(var s=0;s<r.length;s++){var o=r[s];if(o.tag===t){var a=o.langSys;return a.featureIndexes}}}return this.getDefaultScriptFeaturesIndexes()},or.prototype.mapTagsToFeatures=function(t,e){for(var i={},n=0;n<t.length;n++){var r=t[n].tag,s=t[n].feature;i[r]=s}this.features[e].tags=i},or.prototype.getScriptFeatures=function(t){var e=this.features[t];if(this.features.hasOwnProperty(t))return e;var i=this.getScriptFeaturesIndexes(t);if(!i)return null;var n=this.font.tables.gsub;return e=i.map(function(t){return n.features[t]}),this.features[t]=e,this.mapTagsToFeatures(e,t),e},or.prototype.getSubstitutionType=function(t,e){return t.lookupType.toString()+e.substFormat.toString()},or.prototype.getLookupMethod=function(t,e){var i=this;switch(this.getSubstitutionType(t,e)){case"11":return function(t){return lr.apply(i,[t,e])};case"12":return function(t){return cr.apply(i,[t,e])};case"63":return function(t){return dr.apply(i,[t,e])};case"41":return function(t){return pr.apply(i,[t,e])};case"21":return function(t){return fr.apply(i,[t,e])};default:throw new Error("lookupType: "+t.lookupType+" - substFormat: "+e.substFormat+" is not yet supported")}},or.prototype.lookupFeature=function(t){var e=t.contextParams,i=e.index,n=this.getFeature({tag:t.tag,script:t.script});if(!n)return new Error("font '"+this.font.names.fullName.en+"' doesn't support feature '"+t.tag+"' for script '"+t.script+"'.");for(var r=this.getFeatureLookups(n),s=[].concat(e.context),o=0;o<r.length;o++)for(var a=r[o],u=this.getLookupSubtables(a),l=0;l<u.length;l++){var c=u[l],h=this.getSubstitutionType(a,c),d=this.getLookupMethod(a,c),p=void 0;switch(h){case"11":p=d(e.current),p&&s.splice(i,1,new ar({id:11,tag:t.tag,substitution:p}));break;case"12":p=d(e.current),p&&s.splice(i,1,new ar({id:12,tag:t.tag,substitution:p}));break;case"63":p=d(e),Array.isArray(p)&&p.length&&s.splice(i,1,new ar({id:63,tag:t.tag,substitution:p}));break;case"41":p=d(e),p&&s.splice(i,1,new ar({id:41,tag:t.tag,substitution:p}));break;case"21":p=d(e.current),p&&s.splice(i,1,new ar({id:21,tag:t.tag,substitution:p}))}e=new Qn(s,i),Array.isArray(p)&&!p.length||(p=null)}return s.length?s:null},or.prototype.supports=function(t){if(!t.script)return!1;this.getScriptFeatures(t.script);var e=this.features.hasOwnProperty(t.script);if(!t.tag)return e;var i=this.features[t.script].some(function(e){return e.tag===t.tag});return e&&i},or.prototype.getLookupSubtables=function(t){return t.subtables||null},or.prototype.getLookupByIndex=function(t){return this.font.tables.gsub.lookups[t]||null},or.prototype.getFeatureLookups=function(t){return t.lookupListIndexes.map(this.getLookupByIndex.bind(this))},or.prototype.getFeature=function(t){if(!this.font)return{FAIL:"No font was found"};this.features.hasOwnProperty(t.script)||this.getScriptFeatures(t.script);var e=this.features[t.script];return e?e.tags[t.tag]?this.features[t.script].tags[t.tag]:null:{FAIL:"No feature for script "+t.script}};var To={startCheck:gr,endCheck:mr},Fo={startCheck:_r,endCheck:xr},Oo={11:yr,12:vr,63:wr,41:br},No={startCheck:Er,endCheck:Mr};Ir.prototype.setText=function(t){this.text=t},Ir.prototype.contextChecks={latinWordCheck:No,arabicWordCheck:To,arabicSentenceCheck:Fo},Ir.prototype.registerFeatures=function(t,e){var i=this,n=e.filter(function(e){return i.query.supports({script:t,tag:e})});this.featuresTags.hasOwnProperty(t)?this.featuresTags[t]=this.featuresTags[t].concat(n):this.featuresTags[t]=n},Ir.prototype.applyFeatures=function(t,e){if(!t)throw new Error("No valid font was provided to apply features");this.query||(this.query=new or(t));for(var i=0;i<e.length;i++){var n=e[i];this.query.supports({script:n.script})&&this.registerFeatures(n.script,n.tags)}},Ir.prototype.registerModifier=function(t,e,i){this.tokenizer.registerModifier(t,e,i)},Ir.prototype.checkContextReady=function(t){return!!this.tokenizer.getContext(t)},Ir.prototype.applyFeaturesToContexts=function(){this.checkContextReady("arabicWord")&&(Rr.call(this),kr.call(this)),this.checkContextReady("latinWord")&&Ur.call(this),this.checkContextReady("arabicSentence")&&Pr.call(this)},Ir.prototype.processText=function(t){this.text&&this.text===t||(this.setText(t),Ar.call(this),this.applyFeaturesToContexts())},Ir.prototype.getBidiText=function(t){return this.processText(t),this.tokenizer.getText()},Ir.prototype.getTextGlyphs=function(t){this.processText(t);for(var e=[],i=0;i<this.tokenizer.tokens.length;i++){var n=this.tokenizer.tokens[i];if(!n.state.deleted){var r=n.activeState.value;e.push(Array.isArray(r)?r[0]:r)}}return e},Xr.prototype.hasChar=function(t){return null!==this.encoding.charToGlyphIndex(t)},Xr.prototype.charToGlyphIndex=function(t){return this.encoding.charToGlyphIndex(t)},Xr.prototype.charToGlyph=function(t){var e=this.charToGlyphIndex(t),i=this.glyphs.get(e);return i||(i=this.glyphs.get(0)),i},Xr.prototype.updateFeatures=function(t){return this.defaultRenderOptions.features.map(function(e){return"latn"===e.script?{script:"latn",tags:e.tags.filter(function(e){return t[e]})}:e})},Xr.prototype.stringToGlyphs=function(t,e){var i=this,n=new Ir,r=function(t){return i.charToGlyphIndex(t.char)};n.registerModifier("glyphIndex",null,r);var s=e?this.updateFeatures(e.features):this.defaultRenderOptions.features;n.applyFeatures(this,s);for(var o=n.getTextGlyphs(t),a=o.length,u=new Array(a),l=this.glyphs.get(0),c=0;c<a;c+=1)u[c]=this.glyphs.get(o[c])||l;return u},Xr.prototype.nameToGlyphIndex=function(t){return this.glyphNames.nameToGlyphIndex(t)},Xr.prototype.nameToGlyph=function(t){var e=this.nameToGlyphIndex(t),i=this.glyphs.get(e);return i||(i=this.glyphs.get(0)),i},Xr.prototype.glyphIndexToName=function(t){return this.glyphNames.glyphIndexToName?this.glyphNames.glyphIndexToName(t):""},Xr.prototype.getKerningValue=function(t,e){t=t.index||t,e=e.index||e;var i=this.position.defaultKerningTables;return i?this.position.getKerningValue(i,t,e):this.kerningPairs[t+","+e]||0},Xr.prototype.defaultRenderOptions={kerning:!0,features:[{script:"arab",tags:["init","medi","fina","rlig"]},{script:"latn",tags:["liga","rlig"]}]},Xr.prototype.forEachGlyph=function(t,e,i,n,r,s){e=void 0!==e?e:0,i=void 0!==i?i:0,n=void 0!==n?n:72,r=Object.assign({},this.defaultRenderOptions,r);var o,a=1/this.unitsPerEm*n,u=this.stringToGlyphs(t,r);if(r.kerning){var l=r.script||this.position.getDefaultScriptName();o=this.position.getKerningTables(l,r.language)}for(var c=0;c<u.length;c+=1){var h=u[c];if(s.call(this,h,e,i,n,r),h.advanceWidth&&(e+=h.advanceWidth*a),r.kerning&&c<u.length-1){e+=(o?this.position.getKerningValue(o,h.index,u[c+1].index):this.getKerningValue(h,u[c+1]))*a}r.letterSpacing?e+=r.letterSpacing*n:r.tracking&&(e+=r.tracking/1e3*n)}return e},Xr.prototype.getPath=function(t,e,i,n,r){var s=new f;return this.forEachGlyph(t,e,i,n,r,function(t,e,i,n){var o=t.getPath(e,i,n,r,this);s.extend(o)}),s},Xr.prototype.getPaths=function(t,e,i,n,r){var s=[];return this.forEachGlyph(t,e,i,n,r,function(t,e,i,n){var o=t.getPath(e,i,n,r,this);s.push(o)}),s},Xr.prototype.getAdvanceWidth=function(t,e,i){return this.forEachGlyph(t,0,0,e,i,function(){})},Xr.prototype.draw=function(t,e,i,n,r,s){this.getPath(e,i,n,r,s).draw(t)},Xr.prototype.drawPoints=function(t,e,i,n,r,s){this.forEachGlyph(e,i,n,r,s,function(e,i,n,r){e.drawPoints(t,i,n,r)})},Xr.prototype.drawMetrics=function(t,e,i,n,r,s){this.forEachGlyph(e,i,n,r,s,function(e,i,n,r){e.drawMetrics(t,i,n,r)})},Xr.prototype.getEnglishName=function(t){var e=this.names[t];if(e)return e.en},Xr.prototype.validate=function(){function t(t,e){}function e(e){var n=i.getEnglishName(e);t(n&&n.trim().length>0)}var i=this;e("fontFamily"),e("weightName"),e("manufacturer"),e("copyright"),e("version"),t(this.unitsPerEm>0)},Xr.prototype.toTables=function(){return fo.fontToTable(this)},Xr.prototype.toBuffer=function(){return console.warn("Font.toBuffer is deprecated. Use Font.toArrayBuffer instead."),this.toArrayBuffer()},Xr.prototype.toArrayBuffer=function(){for(var t=this.toTables(),e=t.encode(),i=new ArrayBuffer(e.length),n=new Uint8Array(i),r=0;r<e.length;r++)n[r]=e[r];return i},Xr.prototype.download=function(t){var e=this.getEnglishName("fontFamily"),i=this.getEnglishName("fontSubfamily");t=t||e.replace(/\s/g,"")+"-"+i+".otf";var n=this.toArrayBuffer();if(Me())if(window.URL=window.URL||window.webkitURL,window.URL){var r=new DataView(n),s=new Blob([r],{type:"font/opentype"}),o=document.createElement("a");o.href=window.URL.createObjectURL(s),o.download=t;var a=document.createEvent("MouseEvents");a.initEvent("click",!0,!1),o.dispatchEvent(a)}else console.warn("Font file could not be downloaded. Try using a different browser.");else{var u=require("fs"),l=Ve(n);u.writeFileSync(t,l)}},Xr.prototype.fsSelectionValues={ITALIC:1,UNDERSCORE:2,NEGATIVE:4,OUTLINED:8,STRIKEOUT:16,BOLD:32,REGULAR:64,USER_TYPO_METRICS:128,WWS:256,OBLIQUE:512},Xr.prototype.usWidthClasses={ULTRA_CONDENSED:1,EXTRA_CONDENSED:2,CONDENSED:3,SEMI_CONDENSED:4,MEDIUM:5,SEMI_EXPANDED:6,EXPANDED:7,EXTRA_EXPANDED:8,ULTRA_EXPANDED:9},Xr.prototype.usWeightClasses={THIN:100,EXTRA_LIGHT:200,LIGHT:300,NORMAL:400,MEDIUM:500,SEMI_BOLD:600,BOLD:700,EXTRA_BOLD:800,BLACK:900};var Eo={make:Wr,parse:Yr},Mo=function(){return{coverage:this.parsePointer(k.coverage),attachPoints:this.parseList(k.pointer(k.uShortList))}},Do=function(){var t=this.parseUShort();return Ss.argument(1===t||2===t||3===t,"Unsupported CaretValue table version."),1===t?{coordinate:this.parseShort()}:2===t?{pointindex:this.parseShort()}:3===t?{coordinate:this.parseShort()}:void 0},Vo=function(){return this.parseList(k.pointer(Do))},Io=function(){return{coverage:this.parsePointer(k.coverage),ligGlyphs:this.parseList(k.pointer(Vo))}},Bo=function(){return this.parseUShort(),this.parseList(k.pointer(k.coverage))},Ao={parse:$r},Po=new Array(10);Po[1]=function(){var t=this.offset+this.relativeOffset,e=this.parseUShort();return 1===e?{posFormat:1,coverage:this.parsePointer(k.coverage),value:this.parseValueRecord()}:2===e?{posFormat:2,coverage:this.parsePointer(k.coverage),values:this.parseValueRecordList()}:void Ss.assert(!1,"0x"+t.toString(16)+": GPOS lookup type 1 format must be 1 or 2.")},Po[2]=function(){var t=this.offset+this.relativeOffset,e=this.parseUShort();Ss.assert(1===e||2===e,"0x"+t.toString(16)+": GPOS lookup type 2 format must be 1 or 2.");var i=this.parsePointer(k.coverage),n=this.parseUShort(),r=this.parseUShort();if(1===e)return{posFormat:e,coverage:i,valueFormat1:n,valueFormat2:r,pairSets:this.parseList(k.pointer(k.list(function(){return{secondGlyph:this.parseUShort(),value1:this.parseValueRecord(n),value2:this.parseValueRecord(r)}})))};if(2===e){var s=this.parsePointer(k.classDef),o=this.parsePointer(k.classDef),a=this.parseUShort(),u=this.parseUShort();return{posFormat:e,coverage:i,valueFormat1:n,valueFormat2:r,classDef1:s,classDef2:o,class1Count:a,class2Count:u,classRecords:this.parseList(a,k.list(u,function(){return{value1:this.parseValueRecord(n),value2:this.parseValueRecord(r)}}))}}},Po[3]=function(){return{error:"GPOS Lookup 3 not supported"}},Po[4]=function(){return{error:"GPOS Lookup 4 not supported"}},Po[5]=function(){return{error:"GPOS Lookup 5 not supported"}},Po[6]=function(){return{error:"GPOS Lookup 6 not supported"}},Po[7]=function(){return{error:"GPOS Lookup 7 not supported"}},Po[8]=function(){return{error:"GPOS Lookup 8 not supported"}},Po[9]=function(){return{error:"GPOS Lookup 9 not supported"}};var Lo=new Array(10),Ro={parse:Zr,make:Qr},ko={parse:ts},Uo={parse:es},Xo=Object.freeze({__proto__:null,Font:Xr,Glyph:et,Path:f,BoundingBox:p,_parse:As,parse:as,load:us,loadSync:ls});t.BoundingBox=p,t.Font=Xr,t.Glyph=et,t.Path=f,t._parse=As,t.default=Xo,t.load=us,t.loadSync=ls,t.parse=as,Object.defineProperty(t,"__esModule",{value:!0})}),define("opentype",["opentype/dist/opentype"],function(t){return t}),define("x_ite/Browser/Text/X3DTextContext",["jquery","x_ite/Components/Text/FontStyle","opentype"],function(t,e,i){"use strict";function n(){this.fontCache=new Map,this.glyphCache=new Map}return n.prototype={initialize:function(){},getDefaultFontStyle:function(){return this.defaultFontStyle=new e(this.getPrivateScene()),this.defaultFontStyle.setup(),this.getDefaultFontStyle=function(){return this.defaultFontStyle},this.defaultFontStyle},getFont:function(e){e=e.toString();var n=this.fontCache.get(e);return void 0===n&&(this.fontCache.set(e,n=t.Deferred()),i.load(e,this.setFont.bind(this,n))),n},setFont:function(t,e,i){e?t.reject(e):t.resolve(i)},getGlyph:function(t,e,i){var n=this.glyphCache.get(t);n||this.glyphCache.set(t,n=[]);var r=n[e];r||(r=n[e]=[]);var s=r[i];return s||(s=r[i]={}),s}},n}),define("x_ite/Components/Texturing/X3DTextureTransformNode",["x_ite/Components/Shape/X3DAppearanceChildNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Matrix4"],function(t,e,i){"use strict";function n(n){t.call(this,n),this.addType(e.X3DTextureTransformNode),this.matrixArray=new Float32Array(i.Identity)}return n.prototype=Object.assign(Object.create(t.prototype),{constructor:n,setMatrix:function(t){this.matrixArray.set(t)},setShaderUniformsToChannel:function(t,e,i){t.uniformMatrix4fv(e.x3d_TextureMatrix[i],!1,this.matrixArray)}}),n}),define("x_ite/Components/Texturing/X3DSingleTextureTransformNode",["x_ite/Components/Texturing/X3DTextureTransformNode","x_ite/Bits/X3DConstants"],function(t,e){"use strict";function i(i){t.call(this,i),this.addType(e.X3DSingleTextureTransformNode)}return i.prototype=Object.assign(Object.create(t.prototype),{constructor:i,setShaderUniforms:function(t,e){for(let i=0,n=e.x3d_MaxTextures;i<n;++i)this.setShaderUniformsToChannel(t,e,i)}}),i}),define("x_ite/Components/Texturing/TextureTransform",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Texturing/X3DSingleTextureTransformNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector2","standard/Math/Numbers/Matrix3","standard/Math/Numbers/Matrix4"],function(t,e,i,n,r,s,o,a){"use strict";function u(t){n.call(this,t),this.addType(r.TextureTransform),this.rotation_.setUnit("angle"),this.matrix=new a}return u.prototype=Object.assign(Object.create(n.prototype),{constructor:u,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"mapping",new t.SFString),new e(r.inputOutput,"translation",new t.SFVec2f),new e(r.inputOutput,"rotation",new t.SFFloat),new e(r.inputOutput,"scale",new t.SFVec2f(1,1)),new e(r.inputOutput,"center",new t.SFVec2f)]),getTypeName:function(){return"TextureTransform"},getComponentName:function(){return"Texturing"},getContainerField:function(){return"textureTransform"},initialize:function(){n.prototype.initialize.call(this),this.addInterest("eventsProcessed",this),this.eventsProcessed()},getMatrix:function(){return this.matrix},eventsProcessed:function(){const t=new s(0,0),e=new o;return function(){const i=this.translation_.getValue(),n=this.rotation_.getValue(),r=this.scale_.getValue(),o=this.center_.getValue(),a=this.matrix;e.identity(),o.equals(s.Zero)||e.translate(t.assign(o).negate()),r.equals(s.One)||e.scale(r),0!==n&&e.rotate(n),o.equals(s.Zero)||e.translate(o),i.equals(s.Zero)||e.translate(i),a[0]=e[0],a[1]=e[1],a[4]=e[3],a[5]=e[4],a[12]=e[6],a[13]=e[7],this.setMatrix(a)}}()}),u}),define("x_ite/Browser/Texturing/X3DTexturingContext",["x_ite/Components/Texturing/TextureProperties","x_ite/Components/Texturing/TextureTransform","x_ite/Components/Texturing/TextureCoordinate"],function(t,e,i){"use strict";function n(){var t=this.getContext(),e=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS);this.maxTextures=e>8?2:1,this.multiTexturing=e>8,this.projectiveTextureMapping=e>8,this.combinedTextureUnits=[]}return n.prototype={initialize:function(){var t=this.getContext();this.maxTextureSize=t.getParameter(t.MAX_TEXTURE_SIZE),this.maxCombinedTextureUnits=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS),this.textureMemory=NaN;for(var e=this.combinedTextureUnits,i=1,n=this.maxCombinedTextureUnits;i<n;++i)e.push(i);this.shadowTextureUnit=this.getCombinedTextureUnits().pop(),this.linetypeUnit=this.getCombinedTextureUnits().pop(),this.hatchStyleUnit=this.getCombinedTextureUnits().pop(),this.texture2DUnits=new Int32Array(this.getMaxTextures()),this.projectiveTextureUnits=new Int32Array(this.getMaxTextures());for(var i=0,n=this.getMaxTextures();i<n;++i)this.texture2DUnits[i]=this.getCombinedTextureUnits().pop();if(this.getProjectiveTextureMapping())for(var i=0,n=this.getMaxTextures();i<n;++i)this.projectiveTextureUnits[i]=this.getCombinedTextureUnits().pop();var r=new Uint8Array([255,255,255,255]);this.defaultTexture2D=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.defaultTexture2D),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,r),t.activeTexture(t.TEXTURE0+this.shadowTextureUnit),t.bindTexture(t.TEXTURE_2D,this.defaultTexture2D),t.activeTexture(t.TEXTURE0+this.linetypeUnit),t.bindTexture(t.TEXTURE_2D,this.defaultTexture2D),t.activeTexture(t.TEXTURE0+this.hatchStyleUnit),t.bindTexture(t.TEXTURE_2D,this.defaultTexture2D);for(var i=0,n=this.texture2DUnits.length;i<n;++i)t.activeTexture(t.TEXTURE0+this.texture2DUnits[i]),t.bindTexture(t.TEXTURE_2D,this.defaultTexture2D);for(var i=0,n=this.projectiveTextureUnits.length;i<n;++i)t.activeTexture(t.TEXTURE0+this.projectiveTextureUnits[i]),t.bindTexture(t.TEXTURE_2D,this.defaultTexture2D);if(t.getVersion()>=2){this.texture3DUnits=new Int32Array(this.getMaxTextures());for(var i=0,n=this.getMaxTextures();i<n;++i)this.texture3DUnits[i]=this.getCombinedTextureUnits().pop();this.defaultTexture3D=t.createTexture(),t.bindTexture(t.TEXTURE_3D,this.defaultTexture3D),t.texImage3D(t.TEXTURE_3D,0,t.RGBA,1,1,1,0,t.RGBA,t.UNSIGNED_BYTE,r);for(var i=0,n=this.texture3DUnits.length;i<n;++i)t.activeTexture(t.TEXTURE0+this.texture3DUnits[i]),t.bindTexture(t.TEXTURE_3D,this.defaultTexture3D);t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_3D,this.defaultTexture3D)}this.cubeMapTextureUnits=new Int32Array(this.getMaxTextures());for(var i=0,n=this.getMaxTextures();i<n;++i)this.cubeMapTextureUnits[i]=this.getCombinedTextureUnits().pop();this.defaultCubeMapTexture=t.createTexture(),t.bindTexture(t.TEXTURE_CUBE_MAP,this.defaultCubeMapTexture),t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_Z,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,r),t.texImage2D(t.TEXTURE_CUBE_MAP_NEGATIVE_Z,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,r),t.texImage2D(t.TEXTURE_CUBE_MAP_NEGATIVE_X,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,r),t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,r),t.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_Y,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,r),t.texImage2D(t.TEXTURE_CUBE_MAP_NEGATIVE_Y,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,r);for(var i=0,n=this.cubeMapTextureUnits.length;i<n;++i)t.activeTexture(t.TEXTURE0+this.cubeMapTextureUnits[i]),t.bindTexture(t.TEXTURE_CUBE_MAP,this.defaultCubeMapTexture);t.activeTexture(t.TEXTURE0)},getMaxTextures:function(){return this.maxTextures},getMinTextureSize:function(){return 16},getMaxTextureSize:function(){return this.maxTextureSize},getMaxCombinedTextureUnits:function(){return this.maxCombinedTextureUnits},getCombinedTextureUnits:function(){return this.combinedTextureUnits},getTexture2DUnits:function(){return this.texture2DUnits},getTexture3DUnits:function(){return this.texture3DUnits},getCubeMapTextureUnits:function(){return this.cubeMapTextureUnits},getProjectiveTextureUnits:function(){return this.projectiveTextureUnits},getShadowTextureUnit:function(){return this.shadowTextureUnit},getLinetypeUnit:function(){return this.linetypeUnit},getHatchStyleUnit:function(){return this.hatchStyleUnit},getTextureMemory:function(){return this.textureMemory},getMultiTexturing:function(){return this.multiTexturing},getProjectiveTextureMapping:function(){return this.projectiveTextureMapping},getDefaultTextureProperties:function(){return this.defaultTextureProperties=new t(this.getPrivateScene()),this.defaultTextureProperties.magnificationFilter_="NICEST",this.defaultTextureProperties.minificationFilter_="AVG_PIXEL_AVG_MIPMAP",this.defaultTextureProperties.textureCompression_="NICEST",this.defaultTextureProperties.generateMipMaps_=!0,this.defaultTextureProperties.setup(),this.getDefaultTextureProperties=function(){return this.defaultTextureProperties},this.defaultTextureProperties},getDefaultTextureTransform:function(){return this.defaultTextureTransform=new e(this.getPrivateScene()),this.defaultTextureTransform.setup(),this.getDefaultTextureTransform=function(){return this.defaultTextureTransform},this.defaultTextureTransform},getDefaultTextureCoordinate:function(){return this.defaultTextureCoordinate=new i(this.getPrivateScene()),this.defaultTextureCoordinate.setup(),this.getDefaultTextureCoordinate=function(){return this.defaultTextureCoordinate},this.defaultTextureCoordinate}},n}),define("x_ite/Browser/Time/X3DTimeContext",["standard/Math/Numbers/Vector3"],function(t){"use strict";function e(){this.currentPosition=new t(0,0,0)}return e.prototype={initialize:function(){this.advanceTime(performance.now())},getCurrentTime:function(){return this.currentTime},advanceTime:function(){const e=new t(0,0,0);return function(t){t=(t+performance.timeOrigin)/1e3;const i=t-this.currentTime;if(this.currentTime=t,this.currentFrameRate=i?1/i:60,this.getWorld()&&this.getActiveLayer()){const t=this.getActiveLayer().getViewpoint().getCameraSpaceMatrix();e.assign(this.currentPosition),this.currentPosition.set(t[12],t[13],t[14]),this.currentSpeed=e.subtract(this.currentPosition).abs()*this.currentFrameRate}else this.currentSpeed=0}}()},e}),
|
|
35
35
|
define("x_ite/Browser/X3DBrowserContext",["jquery","x_ite/Fields/SFTime","x_ite/Basic/X3DBaseNode","x_ite/Browser/Core/X3DCoreContext","x_ite/Routing/X3DRoutingContext","x_ite/Browser/Scripting/X3DScriptingContext","x_ite/Browser/Networking/X3DNetworkingContext","x_ite/Browser/Shaders/X3DShadersContext","x_ite/Browser/Rendering/X3DRenderingContext","x_ite/Browser/Shape/X3DShapeContext","x_ite/Browser/Grouping/X3DGroupingContext","x_ite/Browser/Geometry3D/X3DGeometry3DContext","x_ite/Browser/PointingDeviceSensor/X3DPointingDeviceSensorContext","x_ite/Browser/Navigation/X3DNavigationContext","x_ite/Browser/Layering/X3DLayeringContext","x_ite/Browser/EnvironmentalEffects/X3DEnvironmentalEffectsContext","x_ite/Browser/Lighting/X3DLightingContext","x_ite/Browser/Picking/X3DPickingContext","x_ite/Browser/Sound/X3DSoundContext","x_ite/Browser/Text/X3DTextContext","x_ite/Browser/Texturing/X3DTexturingContext","x_ite/Browser/Time/X3DTimeContext","x_ite/Execution/World","x_ite/Bits/TraverseType"],function(t,e,i,n,r,s,o,a,u,l,c,h,d,p,f,g,m,_,x,y,v,w,b,S){"use strict";function C(t){i.call(this,this),r.call(this),n.call(this,t),s.call(this),o.call(this),a.call(this),u.call(this),l.call(this),c.call(this),h.call(this),d.call(this),p.call(this),f.call(this),g.call(this),m.call(this),_.call(this),x.call(this),y.call(this),v.call(this),w.call(this),T.forEach(function(t){t.call(this)},this),this.addChildObjects("initialized",new e,"shutdown",new e,"prepareEvents",new e,"timeEvents",new e,"sensorEvents",new e,"finished",new e),this.changedTime=0,this.renderCallback=this.traverse.bind(this),this.systemTime=0,this.systemStartTime=0,this.browserTime=0,this.cameraTime=0,this.collisionTime=0,this.displayTime=0}const T=[];return C.prototype=Object.assign(Object.create(i.prototype),r.prototype,n.prototype,s.prototype,o.prototype,a.prototype,u.prototype,l.prototype,c.prototype,h.prototype,d.prototype,p.prototype,f.prototype,g.prototype,m.prototype,_.prototype,x.prototype,y.prototype,v.prototype,w.prototype,{constructor:C,initialize:function(){i.prototype.initialize.call(this),r.prototype.initialize.call(this),n.prototype.initialize.call(this),s.prototype.initialize.call(this),o.prototype.initialize.call(this),a.prototype.initialize.call(this),u.prototype.initialize.call(this),l.prototype.initialize.call(this),c.prototype.initialize.call(this),h.prototype.initialize.call(this),d.prototype.initialize.call(this),p.prototype.initialize.call(this),f.prototype.initialize.call(this),g.prototype.initialize.call(this),m.prototype.initialize.call(this),_.prototype.initialize.call(this),x.prototype.initialize.call(this),y.prototype.initialize.call(this),v.prototype.initialize.call(this),w.prototype.initialize.call(this),T.forEach(function(t){t.prototype.initialize&&t.prototype.initialize.call(this)}.bind(this))},initialized:function(){return this.initialized_},shutdown:function(){return this.shutdown_},prepareEvents:function(){return this.prepareEvents_},timeEvents:function(){return this.timeEvents_},sensorEvents:function(){return this.sensorEvents_},finished:function(){return this.finished_},getBrowser:function(){return this},getWorld:function(){return this.world},setExecutionContext:function(t){this.world=new b(t),this.world.setup()},getExecutionContext:function(){return this.world.getExecutionContext()},addBrowserEvent:function(){this.changedTime!==this.getCurrentTime()&&(this.changedTime=this.getCurrentTime(),this.requestAnimationFrame())},requestAnimationFrame:function(){window.requestAnimationFrame(this.renderCallback)},traverse:function(t){const e=this.getContext(),i=performance.now();this.systemTime=i-this.systemStartTime,this.advanceTime(t),this.prepareEvents_.processInterests(),this.processEvents(),this.timeEvents_.processInterests(),this.processEvents();const n=performance.now();this.world.traverse(S.CAMERA,null),this.cameraTime=performance.now()-n;const r=performance.now();this.getCollisionCount()&&this.world.traverse(S.COLLISION,null),this.collisionTime=performance.now()-r,this.sensorEvents_.processInterests(),this.processEvents();const s=performance.now();e.clearColor(0,0,0,0),e.clear(e.COLOR_BUFFER_BIT),this.world.traverse(S.DISPLAY,null),this.displayTime=performance.now()-s,this.browserTime=performance.now()-i,this.systemStartTime=performance.now(),this.finished_.processInterests()},toStream:function(t){t.string+=Object.prototype.toString.call(this)}}),Object.assign(C,{addContext:function(e){const i=require("x_ite/X3D");T.push(e),Object.assign(C.prototype,e.prototype),t("X3DCanvas").each(function(t,n){const r=i.getBrowser(n);e.call(r),e.prototype.initialize&&e.prototype.initialize.call(r)})}}),C}),define("x_ite/Configuration/SupportedNodes",["x_ite/Bits/X3DConstants","x_ite/Parser/HTMLSupport"],function(t,e){"use strict";function i(){this.types=new Map,this.abstractTypes=new Map}let n=0;return i.prototype={addType:function(i,r){t[i]=++n,this.types.set(i,r),this.types.set(i.toUpperCase(),r);for(const i of r.prototype.fieldDefinitions){const n=i.name,r=i.accessType;r&t.initializeOnly&&(e.fields.set(n,n),e.fields.set(n.toLowerCase(),n))}},addAbstractType:function(e,i){t[e]=++n},getType:function(t){return this.types.get(t)}},new i}),define("x_ite/Components/Core/X3DMetadataObject",["x_ite/Bits/X3DConstants"],function(t){"use strict";function e(e){this.addType(t.X3DMetadataObject)}return e.prototype={constructor:e,initialize:function(){}},e}),define("x_ite/Components/Core/MetadataBoolean",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Core/X3DNode","x_ite/Components/Core/X3DMetadataObject","x_ite/Bits/X3DConstants"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),r.call(this,t),this.addType(s.MetadataBoolean)}return o.prototype=Object.assign(Object.create(n.prototype),r.prototype,{constructor:o,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOutput,"name",new t.SFString),new e(s.inputOutput,"reference",new t.SFString),new e(s.inputOutput,"value",new t.MFBool)]),getTypeName:function(){return"MetadataBoolean"},getComponentName:function(){return"Core"},getContainerField:function(){return"metadata"}}),o}),define("x_ite/Components/Core/MetadataDouble",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Core/X3DNode","x_ite/Components/Core/X3DMetadataObject","x_ite/Bits/X3DConstants"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),r.call(this,t),this.addType(s.MetadataDouble)}return o.prototype=Object.assign(Object.create(n.prototype),r.prototype,{constructor:o,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOutput,"name",new t.SFString),new e(s.inputOutput,"reference",new t.SFString),new e(s.inputOutput,"value",new t.MFDouble)]),getTypeName:function(){return"MetadataDouble"},getComponentName:function(){return"Core"},getContainerField:function(){return"metadata"}}),o}),define("x_ite/Components/Core/MetadataFloat",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Core/X3DNode","x_ite/Components/Core/X3DMetadataObject","x_ite/Bits/X3DConstants"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),r.call(this,t),this.addType(s.MetadataFloat)}return o.prototype=Object.assign(Object.create(n.prototype),r.prototype,{constructor:o,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOutput,"name",new t.SFString),new e(s.inputOutput,"reference",new t.SFString),new e(s.inputOutput,"value",new t.MFFloat)]),getTypeName:function(){return"MetadataFloat"},getComponentName:function(){return"Core"},getContainerField:function(){return"metadata"}}),o}),define("x_ite/Components/Core/MetadataInteger",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Core/X3DNode","x_ite/Components/Core/X3DMetadataObject","x_ite/Bits/X3DConstants"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),r.call(this,t),this.addType(s.MetadataInteger)}return o.prototype=Object.assign(Object.create(n.prototype),r.prototype,{constructor:o,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOutput,"name",new t.SFString),new e(s.inputOutput,"reference",new t.SFString),new e(s.inputOutput,"value",new t.MFInt32)]),getTypeName:function(){return"MetadataInteger"},getComponentName:function(){return"Core"},getContainerField:function(){return"metadata"}}),o}),define("x_ite/Components/Core/MetadataSet",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Core/X3DNode","x_ite/Components/Core/X3DMetadataObject","x_ite/Bits/X3DConstants"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),r.call(this,t),this.addType(s.MetadataSet)}return o.prototype=Object.assign(Object.create(n.prototype),r.prototype,{constructor:o,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOutput,"name",new t.SFString),new e(s.inputOutput,"reference",new t.SFString),new e(s.inputOutput,"value",new t.MFNode)]),getTypeName:function(){return"MetadataSet"},getComponentName:function(){return"Core"},getContainerField:function(){return"metadata"}}),o}),define("x_ite/Components/Core/MetadataString",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Core/X3DNode","x_ite/Components/Core/X3DMetadataObject","x_ite/Bits/X3DConstants"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),r.call(this,t),this.addType(s.MetadataString)}return o.prototype=Object.assign(Object.create(n.prototype),r.prototype,{constructor:o,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOutput,"name",new t.SFString),new e(s.inputOutput,"reference",new t.SFString),new e(s.inputOutput,"value",new t.MFString)]),getTypeName:function(){return"MetadataString"},getComponentName:function(){return"Core"},getContainerField:function(){return"metadata"}}),o}),define("x_ite/Components/Core/X3DInfoNode",["x_ite/Components/Core/X3DChildNode","x_ite/Bits/X3DConstants"],function(t,e){"use strict";function i(i){t.call(this,i),this.addType(e.X3DInfoNode)}return i.prototype=Object.assign(Object.create(t.prototype),{constructor:i}),i}),define("x_ite/Components/Core/WorldInfo",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Core/X3DInfoNode","x_ite/Bits/X3DConstants"],function(t,e,i,n,r){"use strict";function s(t){n.call(this,t),this.addType(r.WorldInfo)}return s.prototype=Object.assign(Object.create(n.prototype),{constructor:s,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"title",new t.SFString),new e(r.inputOutput,"info",new t.MFString)]),getTypeName:function(){return"WorldInfo"},getComponentName:function(){return"Core"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.getExecutionContext().addWorldInfo(this)},dispose:function(){this.getExecutionContext().removeWorldInfo(this),n.prototype.dispose.call(this)}}),s}),define("x_ite/Components/Core",["x_ite/Configuration/SupportedNodes","x_ite/Components/Core/MetadataBoolean","x_ite/Components/Core/MetadataDouble","x_ite/Components/Core/MetadataFloat","x_ite/Components/Core/MetadataInteger","x_ite/Components/Core/MetadataSet","x_ite/Components/Core/MetadataString","x_ite/Components/Core/WorldInfo","x_ite/Components/Core/X3DBindableNode","x_ite/Components/Core/X3DChildNode","x_ite/Components/Core/X3DInfoNode","x_ite/Components/Core/X3DMetadataObject","x_ite/Components/Core/X3DNode","x_ite/Components/Core/X3DPrototypeInstance","x_ite/Components/Core/X3DSensorNode"],function(t,e,i,n,r,s,o,a,u,l,c,h,d,p,f){"use strict";const g={MetadataBoolean:e,MetadataDouble:i,MetadataFloat:n,MetadataInteger:r,MetadataSet:s,MetadataString:o,WorldInfo:a},m={X3DBindableNode:u,X3DChildNode:l,X3DInfoNode:c,X3DMetadataObject:h,X3DNode:d,X3DPrototypeInstance:p,X3DSensorNode:f};for(const e in g)t.addType(e,g[e]);for(const e in m)t.addAbstractType(e,m[e])}),define("x_ite/Components/EnvironmentalEffects/FogCoordinate",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Rendering/X3DGeometricPropertyNode","x_ite/Bits/X3DConstants"],function(t,e,i,n,r){"use strict";function s(t){n.call(this,t),this.addType(r.FogCoordinate),this.depth_.setUnit("length")}return s.prototype=Object.assign(Object.create(n.prototype),{constructor:s,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"depth",new t.MFFloat)]),getTypeName:function(){return"FogCoordinate"},getComponentName:function(){return"EnvironmentalEffects"},getContainerField:function(){return"fogCoord"},initialize:function(){n.prototype.initialize.call(this),this.depth_.addInterest("set_depth__",this),this.set_depth__()},set_depth__:function(){this.depth=this.depth_.getValue(),this.length=this.depth_.length},isEmpty:function(){return 0===this.length},getSize:function(){return this.length},addDepth:function(t,e){t<this.length?e.push(this.depth[t]):this.length?e.push(this.depth[this.length-1]):e.push(0)},addDepths:function(t,e){var i=this.length;if(i){const s=this.depth;for(var n=0;n<i;++n)t.push(s[n]);for(var r=s[i-1],n=i;n<e;++n)t.push(r)}else for(var n=0;n<e;++n)t.push(0)}}),s}),define("x_ite/Components/EnvironmentalEffects/LocalFog",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Core/X3DChildNode","x_ite/Components/EnvironmentalEffects/X3DFogObject","x_ite/Bits/X3DConstants"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),r.call(this,t),this.addType(s.LocalFog)}return o.prototype=Object.assign(Object.create(n.prototype),r.prototype,{constructor:o,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOutput,"enabled",new t.SFBool(!0)),new e(s.inputOutput,"fogType",new t.SFString("LINEAR")),new e(s.inputOutput,"color",new t.SFColor(1,1,1)),new e(s.inputOutput,"visibilityRange",new t.SFFloat)]),getTypeName:function(){return"LocalFog"},getComponentName:function(){return"EnvironmentalEffects"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),r.prototype.initialize.call(this)},push:function(t){if(this.enabled_.getValue()){var e=this.getFogs().pop();e.set(this,t.getModelViewMatrix().get()),t.pushLocalFog(e)}},pop:function(t){this.enabled_.getValue()&&t.getBrowser().getLocalObjects().push(t.popLocalFog())}}),o}),define("x_ite/Components/EnvironmentalEffects/TextureBackground",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/EnvironmentalEffects/X3DBackgroundNode","x_ite/Bits/X3DCast","x_ite/Bits/X3DConstants"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(s.TextureBackground)}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOnly,"set_bind",new t.SFBool),new e(s.inputOutput,"skyAngle",new t.MFFloat),new e(s.inputOutput,"skyColor",new t.MFColor(0,0,0)),new e(s.inputOutput,"groundAngle",new t.MFFloat),new e(s.inputOutput,"groundColor",new t.MFColor),new e(s.inputOutput,"transparency",new t.SFFloat),new e(s.outputOnly,"isBound",new t.SFBool),new e(s.outputOnly,"bindTime",new t.SFTime),new e(s.inputOutput,"frontTexture",new t.SFNode),new e(s.inputOutput,"backTexture",new t.SFNode),new e(s.inputOutput,"leftTexture",new t.SFNode),new e(s.inputOutput,"rightTexture",new t.SFNode),new e(s.inputOutput,"topTexture",new t.SFNode),new e(s.inputOutput,"bottomTexture",new t.SFNode)]),getTypeName:function(){return"TextureBackground"},getComponentName:function(){return"EnvironmentalEffects"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.frontTexture_.addInterest("set_frontTexture__",this),this.backTexture_.addInterest("set_backTexture__",this),this.leftTexture_.addInterest("set_leftTexture__",this),this.rightTexture_.addInterest("set_rightTexture__",this),this.topTexture_.addInterest("set_topTexture__",this),this.bottomTexture_.addInterest("set_bottomTexture__",this),this.set_frontTexture__(this.frontTexture_),this.set_backTexture__(this.backTexture_),this.set_leftTexture__(this.leftTexture_),this.set_rightTexture__(this.rightTexture_),this.set_topTexture__(this.topTexture_),this.set_bottomTexture__(this.bottomTexture_)},set_frontTexture__:function(){n.prototype.set_frontTexture__.call(this,r(s.X3DTextureNode,this.frontTexture_))},set_backTexture__:function(){n.prototype.set_backTexture__.call(this,r(s.X3DTextureNode,this.backTexture_))},set_leftTexture__:function(){n.prototype.set_leftTexture__.call(this,r(s.X3DTextureNode,this.leftTexture_))},set_rightTexture__:function(){n.prototype.set_rightTexture__.call(this,r(s.X3DTextureNode,this.rightTexture_))},set_topTexture__:function(){n.prototype.set_topTexture__.call(this,r(s.X3DTextureNode,this.topTexture_))},set_bottomTexture__:function(){n.prototype.set_bottomTexture__.call(this,r(s.X3DTextureNode,this.bottomTexture_))}}),o}),define("x_ite/Components/EnvironmentalEffects",["x_ite/Configuration/SupportedNodes","x_ite/Components/EnvironmentalEffects/Background","x_ite/Components/EnvironmentalEffects/Fog","x_ite/Components/EnvironmentalEffects/FogCoordinate","x_ite/Components/EnvironmentalEffects/LocalFog","x_ite/Components/EnvironmentalEffects/TextureBackground","x_ite/Components/EnvironmentalEffects/X3DBackgroundNode","x_ite/Components/EnvironmentalEffects/X3DFogObject"],function(t,e,i,n,r,s,o,a){"use strict";const u={Background:e,Fog:i,FogCoordinate:n,LocalFog:r,TextureBackground:s},l={X3DBackgroundNode:o,X3DFogObject:a};for(const e in u)t.addType(e,u[e]);for(const e in l)t.addAbstractType(e,l[e])}),define("x_ite/Components/EnvironmentalSensor/X3DEnvironmentalSensorNode",["x_ite/Fields","x_ite/Components/Core/X3DSensorNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(t,e,i,n){"use strict";function r(n){e.call(this,n),this.addType(i.X3DEnvironmentalSensorNode),this.addChildObjects("traversed",new t.SFBool(!0)),this.size_.setUnit("length"),this.center_.setUnit("length"),this.zeroTest=!1,this.currentTraversed=!0}return r.prototype=Object.assign(Object.create(e.prototype),{constructor:r,initialize:function(){e.prototype.initialize.call(this),this.isLive().addInterest("set_live__",this),this.enabled_.addInterest("set_live__",this),this.size_.addInterest("set_live__",this),this.traversed_.addInterest("set_live__",this),this.set_live__()},set_live__:function(){!(this.traversed_.getValue()&&this.isLive().getValue()&&this.enabled_.getValue())||this.zeroTest&&this.size_.getValue().equals(n.Zero)?(this.getBrowser().sensorEvents().removeInterest("update",this),this.isActive_.getValue()&&(this.isActive_=!1,this.exitTime_=this.getBrowser().getCurrentTime())):this.getBrowser().sensorEvents().addInterest("update",this)},setZeroTest:function(t){this.zeroTest=t},getZeroTest:function(){return this.zeroTest},setTraversed:function(t){t?this.traversed_.getValue()===!1&&(this.traversed_=!0):this.currentTraversed!==this.traversed_.getValue()&&(this.traversed_=this.currentTraversed),this.currentTraversed=t},getTraversed:function(){return this.currentTraversed},update:function(){}}),r}),define("x_ite/Components/EnvironmentalSensor/ProximitySensor",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/EnvironmentalSensor/X3DEnvironmentalSensorNode","x_ite/Bits/TraverseType","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4"],function(t,e,i,n,r,s,o,a,u){"use strict";function l(t){n.call(this,t),this.addType(s.ProximitySensor),this.setCameraObject(!0),this.centerOfRotation_changed_.setUnit("length"),this.position_changed_.setUnit("length"),this.setZeroTest(!0),this.min=new o(0,0,0),this.max=new o(0,0,0),this.viewpointNode=null,this.modelMatrix=new u,this.inside=!1}return l.prototype=Object.assign(Object.create(n.prototype),{constructor:l,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOutput,"enabled",new t.SFBool(!0)),new e(s.inputOutput,"size",new t.SFVec3f),new e(s.inputOutput,"center",new t.SFVec3f),new e(s.outputOnly,"enterTime",new t.SFTime),new e(s.outputOnly,"exitTime",new t.SFTime),new e(s.outputOnly,"isActive",new t.SFBool),new e(s.outputOnly,"position_changed",new t.SFVec3f),new e(s.outputOnly,"orientation_changed",new t.SFRotation),new e(s.outputOnly,"centerOfRotation_changed",new t.SFVec3f)]),getTypeName:function(){return"ProximitySensor"},getComponentName:function(){return"EnvironmentalSensor"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.enabled_.addInterest("set_enabled__",this),this.size_.addInterest("set_extents__",this),this.center_.addInterest("set_extents__",this),this.traversed_.addFieldInterest(this.isCameraObject_),this.set_enabled__(),this.set_extents__()},set_enabled__:function(){this.setCameraObject(this.enabled_.getValue()),this.enabled_.getValue()?delete this.traverse:this.traverse=Function.prototype},set_extents__:function(){const t=this.size_.getValue(),e=this.center_.getValue(),i=t.x/2,n=t.y/2,r=t.z/2,s=e.x,o=e.y,a=e.z;this.min.set(s-i,o-n,a-r),this.max.set(s+i,o+n,a+r)},update:function(){const t=new u,e=new u,i=new o(0,0,0),n=new a(0,0,1,0),r=new o(0,0,0);return function(){try{if(this.inside&&this.getTraversed()){if(this.viewpointNode){const s=this.modelMatrix;e.assign(this.viewpointNode.getModelMatrix()),e.translate(this.viewpointNode.getUserCenterOfRotation()),e.multRight(t.assign(s).inverse()),s.multRight(this.viewpointNode.getViewMatrix()),s.get(null,n),s.inverse(),i.set(s[12],s[13],s[14]),n.inverse(),r.set(e[12],e[13],e[14]),this.isActive_.getValue()?(this.position_changed_.getValue().equals(i)||(this.position_changed_=i),this.orientation_changed_.getValue().equals(n)||(this.orientation_changed_=n),this.centerOfRotation_changed_.getValue().equals(r)||(this.centerOfRotation_changed_=r)):(this.isActive_=!0,this.enterTime_=this.getBrowser().getCurrentTime(),this.position_changed_=i,this.orientation_changed_=n,this.centerOfRotation_changed_=r)}}else this.isActive_.getValue()&&(this.isActive_=!1,this.exitTime_=this.getBrowser().getCurrentTime())}catch(t){}this.inside=!1,this.viewpointNode=null,this.setTraversed(!1)}}(),traverse:function(){const t=new u,e=new o(-1,-1,-1);return function(i,n){try{switch(i){case r.CAMERA:return this.viewpointNode=n.getViewpoint(),void this.modelMatrix.assign(n.getModelViewMatrix().get());case r.DISPLAY:if(this.setTraversed(!0),this.inside)return;return void(this.size_.getValue().equals(e)?this.inside=!0:(t.assign(n.getModelViewMatrix().get()).inverse(),this.inside=this.containsPoint(t.origin)))}}catch(t){console.log(t)}}}(),containsPoint:function(t){const e=this.min,i=this.max;return e.x<=t.x&&i.x>=t.x&&e.y<=t.y&&i.y>=t.y&&e.z<=t.z&&i.z>=t.z}}),l}),define("x_ite/Components/EnvironmentalSensor/TransformSensor",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/EnvironmentalSensor/X3DEnvironmentalSensorNode","x_ite/Bits/TraverseType","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4","standard/Utility/ObjectCache"],function(t,e,i,n,r,s,o,a,u,l){"use strict";function c(t){n.call(this,t),this.addType(s.TransformSensor),this.position_changed_.setUnit("length"),this.setZeroTest(!0),this.min=new o,this.max=new o,this.targetObjectNode=null,this.modelMatrices=[],this.targetMatrices=[]}const h=l(u),d=l(u);return c.prototype=Object.assign(Object.create(n.prototype),{constructor:c,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOutput,"enabled",new t.SFBool(!0)),new e(s.inputOutput,"size",new t.SFVec3f),new e(s.inputOutput,"center",new t.SFVec3f),new e(s.outputOnly,"enterTime",new t.SFTime),new e(s.outputOnly,"exitTime",new t.SFTime),new e(s.outputOnly,"isActive",new t.SFBool),new e(s.outputOnly,"position_changed",new t.SFVec3f),new e(s.outputOnly,"orientation_changed",new t.SFRotation),new e(s.inputOutput,"targetObject",new t.SFNode)]),getTypeName:function(){return"TransformSensor"},getComponentName:function(){return"EnvironmentalSensor"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.isLive().addInterest("set_enabled__",this),this.enabled_.addInterest("set_enabled__",this),this.size_.addInterest("set_enabled__",this),this.size_.addInterest("set_extents__",this),this.center_.addInterest("set_extents__",this),this.targetObject_.addInterest("set_targetObject__",this),this.set_extents__(),this.set_targetObject__()},set_live__:function(){},set_enabled__:function(){this.isLive().getValue()&&this.targetObjectNode&&this.enabled_.getValue()&&!this.size_.getValue().equals(o.Zero)?(this.setPickableObject(!0),this.getBrowser().addTransformSensor(this),this.targetObjectNode.addTransformSensor(this)):(this.setPickableObject(!1),this.getBrowser().removeTransformSensor(this),this.targetObjectNode&&this.targetObjectNode.removeTransformSensor(this),this.isActive_.getValue()&&(this.isActive_=!1,this.exitTime_=this.getBrowser().getCurrentTime()))},set_extents__:function(){const t=this.size_.getValue(),e=this.center_.getValue(),i=t.x/2,n=t.y/2,r=t.z/2,s=e.x,o=e.y,a=e.z;this.min.set(s-i,o-n,a-r),this.max.set(s+i,o+n,a+r)},set_targetObject__:function(){this.targetObjectNode=null;try{const t=this.targetObject_.getValue().getInnerNode(),e=t.getType();for(let i=e.length-1;i>=0;--i){switch(e[i]){case s.X3DGroupingNode:case s.X3DShapeNode:this.targetObjectNode=t;break;default:continue}break}}catch(t){}this.set_enabled__()},traverse:function(t,e){t===r.PICKING&&this.getPickableObject()&&this.modelMatrices.push(h.pop().assign(e.getModelViewMatrix().get()))},collect:function(t){this.targetMatrices.push(d.pop().assign(t))},process:function(){const t=new o(0,0,0),e=new a(0,0,1,0);return function(){const i=this.modelMatrices,n=this.targetMatrices,r=this.intersects();r?(r.get(t,e),this.isActive_.getValue()?(this.position_changed_.getValue().equals(t)||(this.position_changed_=t),this.orientation_changed_.getValue().equals(e)||(this.orientation_changed_=e)):(this.isActive_=!0,this.enterTime_=this.getBrowser().getCurrentTime(),this.position_changed_=t,this.orientation_changed_=e)):this.isActive_.getValue()&&(this.isActive_=!1,this.exitTime_=this.getBrowser().getCurrentTime());for(const t of i)h.push(t);for(const t of n)d.push(t);i.length=0,n.length=0}}(),intersects:function(){const t=new o(-1,-1,-1);return function(){const e=this.modelMatrices,i=this.targetMatrices,n=this.size_.getValue().equals(t);for(const t of e){const e=t.inverse();for(const t of i){const i=t.multRight(e);if(n||this.containsPoint(i.origin))return i}}return null}}(),containsPoint:function(t){const e=this.min,i=this.max;return e.x<=t.x&&i.x>=t.x&&e.y<=t.y&&i.y>=t.y&&e.z<=t.z&&i.z>=t.z}}),c}),define("x_ite/Components/EnvironmentalSensor/VisibilitySensor",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/EnvironmentalSensor/X3DEnvironmentalSensorNode","x_ite/Bits/TraverseType","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector3","standard/Math/Geometry/Box3"],function(t,e,i,n,r,s,o,a){"use strict";function u(t){n.call(this,t),this.addType(s.VisibilitySensor),this.setZeroTest(!1),this.visible=!1}return u.prototype=Object.assign(Object.create(n.prototype),{constructor:u,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOutput,"enabled",new t.SFBool(!0)),new e(s.inputOutput,"size",new t.SFVec3f),new e(s.inputOutput,"center",new t.SFVec3f),new e(s.outputOnly,"enterTime",new t.SFTime),new e(s.outputOnly,"exitTime",new t.SFTime),new e(s.outputOnly,"isActive",new t.SFBool)]),getTypeName:function(){return"VisibilitySensor"},getComponentName:function(){return"EnvironmentalSensor"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.enabled_.addInterest("set_enabled__",this),this.set_enabled__()},set_enabled__:function(){this.enabled_.getValue()?delete this.traverse:this.traverse=Function.prototype},update:function(){this.visible&&this.getTraversed()?(this.isActive_.getValue()||(this.isActive_=!0,this.enterTime_=this.getBrowser().getCurrentTime()),this.visible=!1):this.isActive_.getValue()&&(this.isActive_=!1,this.exitTime_=this.getBrowser().getCurrentTime()),this.setTraversed(!1)},traverse:function(){const t=new a,e=new o(-1,-1,-1);return function(i,n){i===r.DISPLAY&&(this.setTraversed(!0),this.visible||(this.size_.getValue().equals(e)?this.visible=!0:(t.set(this.size_.getValue(),this.center_.getValue()).multRight(n.getModelViewMatrix().get()),this.visible=n.getViewVolume().intersectsBox(t))))}}()}),u}),define("x_ite/Components/EnvironmentalSensor",["x_ite/Configuration/SupportedNodes","x_ite/Components/EnvironmentalSensor/ProximitySensor","x_ite/Components/EnvironmentalSensor/TransformSensor","x_ite/Components/EnvironmentalSensor/VisibilitySensor","x_ite/Components/EnvironmentalSensor/X3DEnvironmentalSensorNode"],function(t,e,i,n,r){"use strict";const s={ProximitySensor:e,TransformSensor:i,VisibilitySensor:n},o={X3DEnvironmentalSensorNode:r};for(const e in s)t.addType(e,s[e]);for(const e in o)t.addAbstractType(e,o[e])}),define("x_ite/Components/Followers/ColorChaser",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Followers/X3DChaserNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Color3","standard/Math/Numbers/Vector3"],function(t,e,i,n,r,s,o){"use strict";function a(t){n.call(this,t),this.addType(r.ColorChaser)}var u=new o(0,0,0),l=new o(0,0,0),c=new o(0,0,0),h=new o(0,0,0);return a.prototype=Object.assign(Object.create(n.prototype),{constructor:a,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOnly,"set_value",new t.SFColor),new e(r.inputOnly,"set_destination",new t.SFColor),new e(r.initializeOnly,"initialValue",new t.SFColor(.8,.8,.8)),new e(r.initializeOnly,"initialDestination",new t.SFColor(.8,.8,.8)),new e(r.initializeOnly,"duration",new t.SFTime(1)),new e(r.outputOnly,"isActive",new t.SFBool),new e(r.outputOnly,"value_changed",new t.SFColor)]),getTypeName:function(){return"ColorChaser"},getComponentName:function(){return"Followers"},getContainerField:function(){return"children"},getVector:function(){return new o(0,0,0)},getValue:function(){return this.set_value_.getValue().getHSV(h)},getDestination:function(){return this.set_destination_.getValue().getHSV(h)},getInitialValue:function(){return this.initialValue_.getValue().getHSV(u)},getInitialDestination:function(){return this.initialDestination_.getValue().getHSV(l)},setValue:function(t){this.value_changed_.setHSV(t.x,t.y,t.z)},interpolate:function(t,e,i){return s.lerp(t,e,i,h)},step:function(t,e,i){c.assign(this.output).add(t).subtract(e),s.lerp(this.output,c,i,this.output)}}),a}),define("x_ite/Components/Followers/X3DDamperNode",["x_ite/Components/Followers/X3DFollowerNode","x_ite/Bits/X3DConstants","standard/Math/Algorithm"],function(t,e,i){"use strict";function n(i){t.call(this,i),this.addType(e.X3DDamperNode)}return n.prototype=Object.assign(Object.create(t.prototype),{constructor:n,initialize:function(){t.prototype.initialize.call(this),this.order_.addInterest("set_order__",this),this.set_value_.addInterest("set_value__",this),this.set_destination_.addInterest("set_destination__",this);var e=this.getBuffer(),i=this.getInitialValue(),n=this.getInitialDestination();e[0]=this.duplicate(n);for(var r=1,s=this.getOrder()+1;r<s;++r)e[r]=this.duplicate(i)
|
|
36
36
|
;this.equals(n,i,this.getTolerance())?this.setValue(n):this.set_active(!0)},getOrder:function(){return i.clamp(this.order_.getValue(),0,5)},getTolerance:function(){return this.tolerance_.getValue()<0?1e-4:this.tolerance_.getValue()},prepareEvents:function(){var t=this.getBuffer(),e=t.length-1;if(this.tau_.getValue()){for(var i=1/this.getBrowser().currentFrameRate,n=Math.exp(-i/this.tau_.getValue()),r=0;r<e;++r)try{this.assign(t,r+1,this.interpolate(t[r],t[r+1],n))}catch(t){}if(this.setValue(t[e]),!this.equals(t[e],t[0],this.getTolerance()))return}else this.setValue(t[0]),e=0;for(var r=1,s=t.length;r<s;++r)this.assign(t,r,t[e]);this.set_active(!1)},set_value__:function(){for(var t=this.getBuffer(),e=this.getValue(),i=1,n=t.length;i<n;++i)this.assign(t,i,e);this.setValue(e),this.set_active(!0)},set_destination__:function(){this.assign(this.getBuffer(),0,this.getDestination()),this.set_active(!0)},set_order__:function(){for(var t=this.getBuffer(),e=t[t.length-1],i=t.length,n=this.getOrder()+1;i<n;++i)t[i]=this.duplicate(e);t.length=n}}),n}),define("x_ite/Components/Followers/ColorDamper",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Followers/X3DDamperNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Color3","standard/Math/Numbers/Vector3"],function(t,e,i,n,r,s,o){"use strict";function a(t){n.call(this,t),this.addType(r.ColorDamper)}var u=new o(0,0,0),l=new o(0,0,0),c=new o(0,0,0),h=new o(0,0,0);return a.prototype=Object.assign(Object.create(n.prototype),{constructor:a,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOnly,"set_value",new t.SFColor),new e(r.inputOnly,"set_destination",new t.SFColor),new e(r.initializeOnly,"initialValue",new t.SFColor(.8,.8,.8)),new e(r.initializeOnly,"initialDestination",new t.SFColor(.8,.8,.8)),new e(r.initializeOnly,"order",new t.SFInt32(3)),new e(r.inputOutput,"tau",new t.SFTime(.3)),new e(r.inputOutput,"tolerance",new t.SFFloat(-1)),new e(r.outputOnly,"isActive",new t.SFBool),new e(r.outputOnly,"value_changed",new t.SFColor)]),getTypeName:function(){return"ColorDamper"},getComponentName:function(){return"Followers"},getContainerField:function(){return"children"},getVector:function(){return new o(0,0,0)},getValue:function(){return this.set_value_.getValue().getHSV(h)},getDestination:function(){return this.set_destination_.getValue().getHSV(h)},getInitialValue:function(){return this.initialValue_.getValue().getHSV(l)},getInitialDestination:function(){return this.initialDestination_.getValue().getHSV(c)},setValue:function(t){this.value_changed_.setHSV(t.x,t.y,t.z)},equals:function(t,e,i){return u.assign(t).subtract(e).abs()<i},interpolate:function(t,e,i){return s.lerp(t,e,i,h)}}),a}),define("x_ite/Browser/Followers/X3DArrayFollowerTemplate",[],function(){"use strict";return function(t){function e(){this.array=this.getArray(),this.zero=this.getVector()}return e.prototype={getArray:function(){var t=[];return t.assign=function(t){if(Array.isArray(t)){for(var e=0,i=Math.min(this.length,t.length);e<i;++e)this[e].assign(t[e]);for(var e=i,i=t.length;e<i;++e)this[e]=t[e].copy();this.length=i}else{for(var e=0,i=Math.min(this.length,t.length);e<i;++e)this[e].assign(t[e].getValue());for(var e=i,i=t.length;e<i;++e)this[e]=t[e].getValue().copy();this.length=i}},t},getValue:function(){return this.set_value_},getDestination:function(){return this.set_destination_},getInitialValue:function(){return this.initialValue_},getInitialDestination:function(){return this.initialDestination_},setValue:function(t){if(Array.isArray(t)){for(var e=this.value_changed_,i=0,n=t.length;i<n;++i)e[i]=t[i];e.length=n}else this.value_changed_=t},duplicate:function(t){var e=this.getArray();return e.assign(t),e},equals:function(t,e,i){if(t.length!==e.length)return!1;for(var n=this.a,r=0,s=0,o=t.length;s<o;++s)r=Math.max(n.assign(t[s]).subtract(e[s]).abs());return r<i},interpolate:function(t,e,i){var n=this.array;n.assign(t);for(var r=0,s=n.length;r<s;++r)n[r].lerp(e[r]||this.zero,i);return n},set_destination__:function(){for(var e=this.getBuffer(),i=this.set_destination_.length,n=0,r=e.length;n<r;++n){for(var s=e[n],o=s.length;o<i;++o)s[o]=this.getVector();s.length=i}t.prototype.set_destination__.call(this)}},e}}),define("x_ite/Browser/Followers/X3DArrayChaserTemplate",["x_ite/Browser/Followers/X3DArrayFollowerTemplate"],function(t){"use strict";return function(e){function i(){n.call(this),this.array=this.getArray()}var n=t(e);return Object.assign(i.prototype,n.prototype,{step:function(t,e,i){for(var n=this.output,r=this.deltaOut,s=0,o=n.length;s<o;++s)n[s].add(r.assign(t[s]||this.zero).subtract(e[s]||this.zero).multiply(i))}}),i}}),define("x_ite/Components/Followers/CoordinateChaser",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Followers/X3DChaserNode","x_ite/Browser/Followers/X3DArrayChaserTemplate","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(t,e,i,n,r,s,o){"use strict";function a(t){n.call(this,t),u.call(this,t),this.addType(s.CoordinateChaser)}var u=r(n);return a.prototype=Object.assign(Object.create(n.prototype),u.prototype,{constructor:a,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOnly,"set_value",new t.MFVec3f),new e(s.inputOnly,"set_destination",new t.MFVec3f),new e(s.initializeOnly,"initialValue",new t.MFVec3f(new o(0,0,0))),new e(s.initializeOnly,"initialDestination",new t.MFVec3f(new o(0,0,0))),new e(s.initializeOnly,"duration",new t.SFTime(1)),new e(s.outputOnly,"isActive",new t.SFBool),new e(s.outputOnly,"value_changed",new t.MFVec3f)]),getTypeName:function(){return"CoordinateChaser"},getComponentName:function(){return"Followers"},getContainerField:function(){return"children"},getVector:function(){return new o(0,0,0)}}),a}),define("x_ite/Components/Followers/CoordinateDamper",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Followers/X3DDamperNode","x_ite/Browser/Followers/X3DArrayFollowerTemplate","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(t,e,i,n,r,s,o){"use strict";function a(t){n.call(this,t),u.call(this,t),this.addType(s.CoordinateDamper)}var u=r(n);return a.prototype=Object.assign(Object.create(n.prototype),u.prototype,{constructor:a,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOnly,"set_value",new t.MFVec3f),new e(s.inputOnly,"set_destination",new t.MFVec3f),new e(s.initializeOnly,"initialValue",new t.MFVec3f(new o(0,0,0))),new e(s.initializeOnly,"initialDestination",new t.MFVec3f(new o(0,0,0))),new e(s.initializeOnly,"order",new t.SFInt32(3)),new e(s.inputOutput,"tau",new t.SFTime(.3)),new e(s.inputOutput,"tolerance",new t.SFFloat(-1)),new e(s.outputOnly,"isActive",new t.SFBool),new e(s.outputOnly,"value_changed",new t.MFVec3f)]),getTypeName:function(){return"CoordinateDamper"},getComponentName:function(){return"Followers"},getContainerField:function(){return"children"},getVector:function(){return new o(0,0,0)}}),a}),define("x_ite/Components/Followers/OrientationDamper",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Followers/X3DDamperNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Rotation4"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.OrientationDamper),this.set_value_.setUnit("angle"),this.set_destination_.setUnit("angle"),this.initialValue_.setUnit("angle"),this.initialDestination_.setUnit("angle"),this.value_changed_.setUnit("angle")}var a=new s(0,0,1,0),u=new s(0,0,1,0);return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOnly,"set_value",new t.SFRotation),new e(r.inputOnly,"set_destination",new t.SFRotation),new e(r.initializeOnly,"initialValue",new t.SFRotation),new e(r.initializeOnly,"initialDestination",new t.SFRotation),new e(r.initializeOnly,"order",new t.SFInt32(3)),new e(r.inputOutput,"tau",new t.SFTime(.3)),new e(r.inputOutput,"tolerance",new t.SFFloat(-1)),new e(r.outputOnly,"isActive",new t.SFBool),new e(r.outputOnly,"value_changed",new t.SFRotation)]),getTypeName:function(){return"OrientationDamper"},getComponentName:function(){return"Followers"},getContainerField:function(){return"children"},getVector:function(){return new s(0,0,1,0)},equals:function(t,e,i){return a.assign(t).inverse().multRight(e),Math.abs(a.angle)<i},interpolate:function(t,e,i){return u.assign(t).slerp(e,i)}}),o}),define("x_ite/Components/Followers/PositionChaser2D",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Followers/X3DChaserNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector2"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.PositionChaser2D)}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOnly,"set_value",new t.SFVec2f),new e(r.inputOnly,"set_destination",new t.SFVec2f),new e(r.initializeOnly,"initialValue",new t.SFVec2f),new e(r.initializeOnly,"initialDestination",new t.SFVec2f),new e(r.initializeOnly,"duration",new t.SFTime(1)),new e(r.outputOnly,"isActive",new t.SFBool),new e(r.outputOnly,"value_changed",new t.SFVec2f)]),getTypeName:function(){return"PositionChaser2D"},getComponentName:function(){return"Followers"},getContainerField:function(){return"children"},getVector:function(){return new s(0,0)}}),o}),define("x_ite/Components/Followers/PositionDamper",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Followers/X3DDamperNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.PositionDamper)}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOnly,"set_value",new t.SFVec3f),new e(r.inputOnly,"set_destination",new t.SFVec3f),new e(r.initializeOnly,"initialValue",new t.SFVec3f),new e(r.initializeOnly,"initialDestination",new t.SFVec3f),new e(r.initializeOnly,"order",new t.SFInt32(3)),new e(r.inputOutput,"tolerance",new t.SFFloat(-1)),new e(r.inputOutput,"tau",new t.SFTime(.3)),new e(r.outputOnly,"value_changed",new t.SFVec3f),new e(r.outputOnly,"isActive",new t.SFBool)]),getTypeName:function(){return"PositionDamper"},getComponentName:function(){return"Followers"},getContainerField:function(){return"children"},getVector:function(){return new s(0,0,0)}}),o}),define("x_ite/Components/Followers/PositionDamper2D",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Followers/X3DDamperNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector2"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.PositionDamper2D)}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOnly,"set_value",new t.SFVec2f),new e(r.inputOnly,"set_destination",new t.SFVec2f),new e(r.initializeOnly,"initialValue",new t.SFVec2f),new e(r.initializeOnly,"initialDestination",new t.SFVec2f),new e(r.initializeOnly,"order",new t.SFInt32(3)),new e(r.inputOutput,"tau",new t.SFTime(.3)),new e(r.inputOutput,"tolerance",new t.SFFloat(-1)),new e(r.outputOnly,"isActive",new t.SFBool),new e(r.outputOnly,"value_changed",new t.SFVec2f)]),getTypeName:function(){return"PositionDamper2D"},getComponentName:function(){return"Followers"},getContainerField:function(){return"children"},getVector:function(){return new s(0,0)}}),o}),define("x_ite/Components/Followers/ScalarChaser",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Followers/X3DChaserNode","x_ite/Bits/X3DConstants","standard/Math/Algorithm"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.ScalarChaser)}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOnly,"set_value",new t.SFFloat),new e(r.inputOnly,"set_destination",new t.SFFloat),new e(r.initializeOnly,"initialValue",new t.SFFloat),new e(r.initializeOnly,"initialDestination",new t.SFFloat),new e(r.initializeOnly,"duration",new t.SFTime(1)),new e(r.outputOnly,"isActive",new t.SFBool),new e(r.outputOnly,"value_changed",new t.SFFloat)]),getTypeName:function(){return"ScalarChaser"},getComponentName:function(){return"Followers"},getContainerField:function(){return"children"},getVector:function(){return 0},setPreviousValue:function(t){this.previousValue=t},setDestination:function(t){this.destination=t},duplicate:function(t){return t},assign:function(t,e,i){t[e]=i},equals:function(t,e,i){return Math.abs(t-e)<i},interpolate:function(t,e,i){return s.lerp(t,e,i)},step:function(t,e,i){this.output+=(t-e)*i}}),o}),define("x_ite/Components/Followers/ScalarDamper",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Followers/X3DDamperNode","x_ite/Bits/X3DConstants","standard/Math/Algorithm"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.ScalarDamper)}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOnly,"set_value",new t.SFFloat),new e(r.inputOnly,"set_destination",new t.SFFloat),new e(r.initializeOnly,"initialValue",new t.SFFloat),new e(r.initializeOnly,"initialDestination",new t.SFFloat),new e(r.initializeOnly,"order",new t.SFInt32(3)),new e(r.inputOutput,"tau",new t.SFTime(.3)),new e(r.inputOutput,"tolerance",new t.SFFloat(-1)),new e(r.outputOnly,"isActive",new t.SFBool),new e(r.outputOnly,"value_changed",new t.SFFloat)]),getTypeName:function(){return"ScalarDamper"},getComponentName:function(){return"Followers"},getContainerField:function(){return"children"},getVector:function(){return 0},duplicate:function(t){return t},assign:function(t,e,i){t[e]=i},equals:function(t,e,i){return Math.abs(t-e)<i},interpolate:function(t,e,i){return s.lerp(t,e,i)}}),o}),define("x_ite/Components/Followers/TexCoordChaser2D",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Followers/X3DChaserNode","x_ite/Browser/Followers/X3DArrayChaserTemplate","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector2"],function(t,e,i,n,r,s,o){"use strict";function a(t){n.call(this,t),u.call(this,t),this.addType(s.TexCoordChaser2D)}var u=r(n);return a.prototype=Object.assign(Object.create(n.prototype),u.prototype,{constructor:a,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOnly,"set_value",new t.MFVec2f),new e(s.inputOnly,"set_destination",new t.MFVec2f),new e(s.initializeOnly,"initialValue",new t.MFVec2f),new e(s.initializeOnly,"initialDestination",new t.MFVec2f),new e(s.initializeOnly,"duration",new t.SFTime(1)),new e(s.outputOnly,"isActive",new t.SFBool),new e(s.outputOnly,"value_changed",new t.MFVec2f)]),getTypeName:function(){return"TexCoordChaser2D"},getComponentName:function(){return"Followers"},getContainerField:function(){return"children"},getVector:function(){return new o(0,0)}}),a}),define("x_ite/Components/Followers/TexCoordDamper2D",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Followers/X3DDamperNode","x_ite/Browser/Followers/X3DArrayFollowerTemplate","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector2"],function(t,e,i,n,r,s,o){"use strict";function a(t){n.call(this,t),u.call(this,t),this.addType(s.TexCoordDamper2D)}var u=r(n);return a.prototype=Object.assign(Object.create(n.prototype),u.prototype,{constructor:a,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOnly,"set_value",new t.MFVec2f),new e(s.inputOnly,"set_destination",new t.MFVec2f),new e(s.initializeOnly,"initialValue",new t.MFVec2f),new e(s.initializeOnly,"initialDestination",new t.MFVec2f),new e(s.initializeOnly,"order",new t.SFInt32(3)),new e(s.inputOutput,"tau",new t.SFTime(.3)),new e(s.inputOutput,"tolerance",new t.SFFloat(-1)),new e(s.outputOnly,"isActive",new t.SFBool),new e(s.outputOnly,"value_changed",new t.MFVec2f)]),getTypeName:function(){return"TexCoordDamper2D"},getComponentName:function(){return"Followers"},getContainerField:function(){return"children"},getVector:function(){return new o(0,0,0)}}),a}),define("x_ite/Components/Followers",["x_ite/Configuration/SupportedNodes","x_ite/Components/Followers/ColorChaser","x_ite/Components/Followers/ColorDamper","x_ite/Components/Followers/CoordinateChaser","x_ite/Components/Followers/CoordinateDamper","x_ite/Components/Followers/OrientationChaser","x_ite/Components/Followers/OrientationDamper","x_ite/Components/Followers/PositionChaser","x_ite/Components/Followers/PositionChaser2D","x_ite/Components/Followers/PositionDamper","x_ite/Components/Followers/PositionDamper2D","x_ite/Components/Followers/ScalarChaser","x_ite/Components/Followers/ScalarDamper","x_ite/Components/Followers/TexCoordChaser2D","x_ite/Components/Followers/TexCoordDamper2D","x_ite/Components/Followers/X3DChaserNode","x_ite/Components/Followers/X3DDamperNode","x_ite/Components/Followers/X3DFollowerNode"],function(t,e,i,n,r,s,o,a,u,l,c,h,d,p,f,g,m,_){"use strict";const x={ColorChaser:e,ColorDamper:i,CoordinateChaser:n,CoordinateDamper:r,OrientationChaser:s,OrientationDamper:o,PositionChaser:a,PositionChaser2D:u,PositionDamper:l,PositionDamper2D:c,ScalarChaser:h,ScalarDamper:d,TexCoordChaser2D:p,TexCoordDamper2D:f},y={X3DChaserNode:g,X3DDamperNode:m,X3DFollowerNode:_};for(const e in x)t.addType(e,x[e]);for(const e in y)t.addAbstractType(e,y[e])}),define("x_ite/Components/Geometry3D/Box",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Rendering/X3DGeometryNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.Box),this.size_.setUnit("length")}var a=new s(2,2,2);return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.initializeOnly,"size",new t.SFVec3f(2,2,2)),new e(r.initializeOnly,"solid",new t.SFBool(!0))]),getTypeName:function(){return"Box"},getComponentName:function(){return"Geometry3D"},getContainerField:function(){return"geometry"},build:function(){var t=this.getBrowser().getBoxOptions(),e=t.getGeometry(),i=this.size_.getValue();if(this.setMultiTexCoords(e.getMultiTexCoords()),this.setNormals(e.getNormals()),i.equals(a))this.setVertices(e.getVertices()),this.getMin().assign(e.getMin()),this.getMax().assign(e.getMax());else{for(var n=s.divide(i,2),r=n.x,o=n.y,u=n.z,l=e.getVertices().getValue(),c=this.getVertices(),h=0;h<l.length;h+=4)c.push(r*l[h],o*l[h+1],u*l[h+2],1);r=Math.abs(r),o=Math.abs(o),u=Math.abs(u),this.getMin().set(-r,-o,-u),this.getMax().set(r,o,u)}this.setSolid(this.solid_.getValue())}}),o}),define("x_ite/Components/Geometry3D/Cone",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Rendering/X3DGeometryNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Complex","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3"],function(t,e,i,n,r,s,o,a){"use strict";function u(t){n.call(this,t),this.addType(r.Cone),this.height_.setUnit("length"),this.bottomRadius_.setUnit("length")}return u.prototype=Object.assign(Object.create(n.prototype),{constructor:u,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.initializeOnly,"side",new t.SFBool(!0)),new e(r.initializeOnly,"bottom",new t.SFBool(!0)),new e(r.initializeOnly,"height",new t.SFFloat(2)),new e(r.initializeOnly,"bottomRadius",new t.SFFloat(1)),new e(r.initializeOnly,"solid",new t.SFBool(!0))]),getTypeName:function(){return"Cone"},getComponentName:function(){return"Geometry3D"},getContainerField:function(){return"geometry"},set_live__:function(){n.prototype.set_live__.call(this),this.isLive().getValue()?this.getBrowser().getConeOptions().addInterest("requestRebuild",this):this.getBrowser().getConeOptions().removeInterest("requestRebuild",this)},build:function(){var t=this.getBrowser().getConeOptions(),e=t.xDimension_.getValue(),i=this.height_.getValue(),n=this.bottomRadius_.getValue(),r=this.getTexCoords(),u=this.getNormals(),l=this.getVertices();this.getMultiTexCoords().push(r);var c=i/2,h=-c,d=s.Polar(1,-Math.PI/2+Math.atan(n/i));if(this.side_.getValue())for(var p=0;p<e;++p){var f=(p+.5)/e,g=2*Math.PI*f,m=s.Polar(d.imag,g),_=p/e,x=2*Math.PI*_,y=s.Polar(-n,x),v=s.Polar(d.imag,x),w=(p+1)/e,b=2*Math.PI*w,S=s.Polar(-n,b),C=s.Polar(d.imag,b);r.push(f,1,0,1),u.push(m.imag,d.real,m.real),l.push(0,c,0,1),r.push(_,0,0,1),u.push(v.imag,d.real,v.real),l.push(y.imag,h,y.real,1),r.push(w,0,0,1),u.push(C.imag,d.real,C.real),l.push(S.imag,h,S.real,1)}if(this.bottom_.getValue()){for(var T=[],F=[],p=e-1;p>-1;--p){var O=p/e,N=2*Math.PI*O,E=s.Polar(-1,N),M=s.multiply(E,n);T.push(new o((E.imag+1)/2,(E.real+1)/2)),F.push(new a(M.imag,h,M.real))}for(var D=T[0],V=F[0],p=1,I=F.length-1;p<I;++p){var B=T[p],A=T[p+1],P=F[p],y=F[p+1];r.push(D.x,D.y,0,1),u.push(0,-1,0),l.push(V.x,V.y,V.z,1),r.push(B.x,B.y,0,1),u.push(0,-1,0),l.push(P.x,P.y,P.z,1),r.push(A.x,A.y,0,1),u.push(0,-1,0),l.push(y.x,y.y,y.z,1)}}this.setSolid(this.solid_.getValue()),this.setExtents()},setExtents:function(){var t=this.bottomRadius_.getValue(),e=this.height_.getValue()/2,i=-e;this.side_.getValue()||this.bottom_.getValue()?this.side_.getValue()?(this.getMin().set(-t,i,-t),this.getMax().set(t,e,t)):(this.getMin().set(-t,i,-t),this.getMax().set(t,i,t)):(this.getMin().set(0,0,0),this.getMax().set(0,0,0))}}),u}),define("x_ite/Components/Geometry3D/Cylinder",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Rendering/X3DGeometryNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Complex","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3"],function(t,e,i,n,r,s,o,a){"use strict";function u(t){n.call(this,t),this.addType(r.Cylinder),this.height_.setUnit("length"),this.radius_.setUnit("length")}return u.prototype=Object.assign(Object.create(n.prototype),{constructor:u,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.initializeOnly,"top",new t.SFBool(!0)),new e(r.initializeOnly,"side",new t.SFBool(!0)),new e(r.initializeOnly,"bottom",new t.SFBool(!0)),new e(r.initializeOnly,"height",new t.SFFloat(2)),new e(r.initializeOnly,"radius",new t.SFFloat(1)),new e(r.initializeOnly,"solid",new t.SFBool(!0))]),getTypeName:function(){return"Cylinder"},getComponentName:function(){return"Geometry3D"},getContainerField:function(){return"geometry"},set_live__:function(){n.prototype.set_live__.call(this),this.isLive().getValue()?this.getBrowser().getCylinderOptions().addInterest("requestRebuild",this):this.getBrowser().getCylinderOptions().removeInterest("requestRebuild",this)},build:function(){var t=this.getBrowser().getCylinderOptions(),e=t.xDimension_.getValue(),i=this.getTexCoords(),n=this.getNormals(),r=this.getVertices();this.getMultiTexCoords().push(i);var u=this.radius_.getValue(),l=this.height_.getValue()/2,c=-l;if(this.side_.getValue())for(var h=0;h<e;++h){var d=h/e,p=2*Math.PI*d,f=s.Polar(-1,p),g=s.multiply(f,u),m=(h+1)/e,_=2*Math.PI*m,x=s.Polar(-1,_),y=s.multiply(x,u);i.push(d,1,0,1),n.push(f.imag,0,f.real),r.push(g.imag,l,g.real,1),i.push(d,0,0,1),n.push(f.imag,0,f.real),r.push(g.imag,c,g.real,1),i.push(m,0,0,1),n.push(x.imag,0,x.real),r.push(y.imag,c,y.real,1),i.push(d,1,0,1),n.push(f.imag,0,f.real),r.push(g.imag,l,g.real,1),i.push(m,0,0,1),n.push(x.imag,0,x.real),r.push(y.imag,c,y.real,1),i.push(m,1,0,1),n.push(x.imag,0,x.real),r.push(y.imag,l,y.real,1)}if(this.top_.getValue()){for(var v=[],w=[],h=0;h<e;++h){var b=h/e,S=2*Math.PI*b,C=s.Polar(-1,S);v.push(new o((C.imag+1)/2,-(C.real-1)/2)),w.push(new a(C.imag*u,l,C.real*u))}for(var T=v[0],F=w[0],h=1,O=w.length-1;h<O;++h){var N=v[h],E=v[h+1],g=w[h],y=w[h+1];i.push(T.x,T.y,0,1),n.push(0,1,0),r.push(F.x,F.y,F.z,1),i.push(N.x,N.y,0,1),n.push(0,1,0),r.push(g.x,g.y,g.z,1),i.push(E.x,E.y,0,1),n.push(0,1,0),r.push(y.x,y.y,y.z,1)}}if(this.bottom_.getValue()){for(var v=[],w=[],h=e-1;h>-1;--h){var b=h/e,S=2*Math.PI*b,C=s.Polar(-1,S);v.push(new o((C.imag+1)/2,(C.real+1)/2)),w.push(new a(C.imag*u,c,C.real*u))}for(var T=v[0],F=w[0],h=1,O=w.length-1;h<O;++h){var N=v[h],E=v[h+1],g=w[h],y=w[h+1];i.push(T.x,T.y,0,1),n.push(0,-1,0),r.push(F.x,F.y,F.z,1),i.push(N.x,N.y,0,1),n.push(0,-1,0),r.push(g.x,g.y,g.z,1),i.push(E.x,E.y,0,1),n.push(0,-1,0),r.push(y.x,y.y,y.z,1)}}this.setSolid(this.solid_.getValue()),this.setExtents()},setExtents:function(){var t=this.radius_.getValue(),e=this.height_.getValue()/2,i=-e;this.top_.getValue()||this.side_.getValue()||this.bottom_.getValue()?this.top_.getValue()||this.side_.getValue()?this.bottom_.getValue()||this.side_.getValue()?(this.getMin().set(-t,i,-t),this.getMax().set(t,e,t)):(this.getMin().set(-t,e,-t),this.getMax().set(t,e,t)):(this.getMin().set(-t,i,-t),this.getMax().set(t,i,t)):(this.getMin().set(0,0,0),this.getMax().set(0,0,0))}}),u}),define("x_ite/Components/Geometry3D/ElevationGrid",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Rendering/X3DGeometryNode","x_ite/Bits/X3DCast","x_ite/Bits/X3DConstants","standard/Math/Geometry/Triangle3","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3"],function(t,e,i,n,r,s,o,a,u){"use strict";function l(t){n.call(this,t),this.addType(s.ElevationGrid),this.xSpacing_.setUnit("length"),this.zSpacing_.setUnit("length"),this.creaseAngle_.setUnit("angle"),this.height_.setUnit("length"),this.fogCoordNode=null,this.colorNode=null,this.texCoordNode=null,this.normalNode=null,this.coordNode=null}return l.prototype=Object.assign(Object.create(n.prototype),{constructor:l,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOnly,"set_height",new t.MFFloat),new e(s.initializeOnly,"xDimension",new t.SFInt32),new e(s.initializeOnly,"zDimension",new t.SFInt32),new e(s.initializeOnly,"xSpacing",new t.SFFloat(1)),new e(s.initializeOnly,"zSpacing",new t.SFFloat(1)),new e(s.initializeOnly,"solid",new t.SFBool(!0)),new e(s.initializeOnly,"ccw",new t.SFBool(!0)),new e(s.initializeOnly,"creaseAngle",new t.SFFloat),new e(s.initializeOnly,"colorPerVertex",new t.SFBool(!0)),new e(s.initializeOnly,"normalPerVertex",new t.SFBool(!0)),new e(s.inputOutput,"attrib",new t.MFNode),new e(s.inputOutput,"fogCoord",new t.SFNode),new e(s.inputOutput,"color",new t.SFNode),new e(s.inputOutput,"texCoord",new t.SFNode),new e(s.inputOutput,"normal",new t.SFNode),new e(s.initializeOnly,"height",new t.MFFloat)]),getTypeName:function(){return"ElevationGrid"},getComponentName:function(){return"Geometry3D"},getContainerField:function(){return"geometry"},initialize:function(){n.prototype.initialize.call(this),this.set_height_.addFieldInterest(this.height_),this.attrib_.addInterest("set_attrib__",this),this.fogCoord_.addInterest("set_fogCoord__",this),this.color_.addInterest("set_color__",this),this.texCoord_.addInterest("set_texCoord__",this),this.normal_.addInterest("set_normal__",this),this.set_attrib__(),this.set_fogCoord__(),this.set_color__(),this.set_texCoord__(),this.set_normal__()},set_attrib__:function(){for(var t=this.getAttrib(),e=0,i=t.length;e<i;++e)t[e].removeInterest("requestRebuild",this);t.length=0;for(var e=0,i=this.attrib_.length;e<i;++e){var n=r(s.X3DVertexAttributeNode,this.attrib_[e]);n&&t.push(n)}for(var e=0;e<this.attribNodes.length;++e)t[e].addInterest("requestRebuild",this)},set_fogCoord__:function(){this.fogCoordNode&&this.fogCoordNode.removeInterest("requestRebuild",this),this.fogCoordNode=r(s.FogCoordinate,this.fogCoord_),this.fogCoordNode&&this.fogCoordNode.addInterest("requestRebuild",this)},set_color__:function(){this.colorNode&&(this.colorNode.removeInterest("requestRebuild",this),this.colorNode.transparent_.removeInterest("set_transparent__",this)),this.colorNode=r(s.X3DColorNode,this.color_),this.colorNode?(this.colorNode.addInterest("requestRebuild",this),this.colorNode.transparent_.addInterest("set_transparent__",this),this.set_transparent__()):this.setTransparent(!1)},set_transparent__:function(){this.setTransparent(this.colorNode.getTransparent())},set_texCoord__:function(){this.texCoordNode&&this.texCoordNode.removeInterest("requestRebuild",this),this.texCoordNode=r(s.X3DTextureCoordinateNode,this.texCoord_),this.texCoordNode&&this.texCoordNode.addInterest("requestRebuild",this),this.setTextureCoordinate(this.texCoordNode)},set_normal__:function(){this.normalNode&&this.normalNode.removeInterest("requestRebuild",this),this.normalNode=r(s.X3DNormalNode,this.normal_),this.normalNode&&this.normalNode.addInterest("requestRebuild",this)},getColor:function(){return this.colorNode},getTexCoord:function(){return this.texCoordNode},getNormal:function(){return this.normalNode},getHeight:function(t){return t<this.height_.length?this.height_[t]:0},createTexCoords:function(){for(var t=[],e=this.xDimension_.getValue(),i=this.zDimension_.getValue(),n=e-1,r=i-1,s=0;s<i;++s)for(var o=0;o<e;++o)t.push(new a(o/n,s/r));return t},createNormals:function(t,e,i){for(var n=!this.ccw_.getValue(),r=[],s=[],a=0;a<t.length;++a)r[a]=[];for(var l=0;l<e.length;l+=3){var c=e[l],h=e[l+1],d=e[l+2];r[c].push(s.length),r[h].push(s.length+1),r[d].push(s.length+2);var p=o.normal(t[c],t[h],t[d],new u(0,0,0));n&&p.negate(),s.push(p),s.push(p),s.push(p)}return this.refineNormals(r,s,this.creaseAngle_.getValue())},createCoordIndex:function(){for(var t=[],e=this.xDimension_.getValue(),i=this.zDimension_.getValue(),n=e-1,r=i-1,s=0;s<r;++s)for(var o=0;o<n;++o){var a=s*e+o,u=(s+1)*e+o,l=(s+1)*e+(o+1),c=s*e+(o+1);t.push(a),t.push(u),t.push(l),t.push(a),t.push(l),t.push(c)}return t},createPoints:function(){for(var t=[],e=this.xDimension_.getValue(),i=this.zDimension_.getValue(),n=this.xSpacing_.getValue(),r=this.zSpacing_.getValue(),s=0;s<i;++s)for(var o=0;o<e;++o)t.push(new u(n*o,this.getHeight(o+s*e),r*s));return t},build:function(){if(!(this.xDimension_.getValue()<2||this.zDimension_.getValue()<2)){var t=this.colorPerVertex_.getValue(),e=this.normalPerVertex_.getValue(),i=this.createCoordIndex(),n=this.getAttrib(),r=n.length,s=this.getAttribs(),o=this.fogCoordNode,a=this.getColor(),u=this.getTexCoord(),l=this.getNormal(),c=this.createPoints(),h=this.getFogDepths(),d=this.getColors(),p=this.getMultiTexCoords(),f=this.getNormals(),g=this.getVertices(),m=0;if(u)u.init(p);else{var _=this.createTexCoords(),x=this.getTexCoords();p.push(x)}for(var y=0,v=i.length;y<v;++m)for(var w=0;w<6;++w,++y){for(var b=i[y],S=c[b],C=0;C<r;++C)n[C].addValue(b,s[C]);if(o&&o.addDepth(b,h),a&&(t?a.addColor(b,d):a.addColor(m,d)),u)u.addTexCoord(b,p);else{var T=_[b];x.push(T.x,T.y,0,1)}l&&(e?l.addVector(b,f):l.addVector(m,f)),g.push(S.x,S.y,S.z,1)}if(!l)for(var F=this.createNormals(c,i),O=0;O<F.length;++O){var N=F[O];f.push(N.x,N.y,N.z)}this.setSolid(this.solid_.getValue()),this.setCCW(this.ccw_.getValue())}}}),l}),define("x_ite/Components/Geometry3D/Extrusion",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Rendering/X3DGeometryNode","x_ite/Bits/X3DConstants","standard/Math/Geometry/Triangle3","standard/Math/Numbers/Vector2","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4"],function(t,e,i,n,r,s,o,a,u,l){"use strict";function c(t){n.call(this,t),this.addType(r.Extrusion),this.creaseAngle_.setUnit("angle"),
|
|
37
|
-
this.crossSection_.setUnit("length"),this.spine_.setUnit("length")}return c.prototype=Object.assign(Object.create(n.prototype),{constructor:c,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOnly,"set_crossSection",new t.MFVec2f),new e(r.inputOnly,"set_orientation",new t.MFRotation),new e(r.inputOnly,"set_scale",new t.MFVec2f),new e(r.inputOnly,"set_spine",new t.MFVec3f),new e(r.initializeOnly,"beginCap",new t.SFBool(!0)),new e(r.initializeOnly,"endCap",new t.SFBool(!0)),new e(r.initializeOnly,"solid",new t.SFBool(!0)),new e(r.initializeOnly,"ccw",new t.SFBool(!0)),new e(r.initializeOnly,"convex",new t.SFBool(!0)),new e(r.initializeOnly,"creaseAngle",new t.SFFloat),new e(r.initializeOnly,"crossSection",new t.MFVec2f(new o(1,1),new o(1,-1),new o(-1,-1),new o(-1,1),new o(1,1))),new e(r.initializeOnly,"orientation",new t.MFRotation(new u)),new e(r.initializeOnly,"scale",new t.MFVec2f(new o(1,1))),new e(r.initializeOnly,"spine",new t.MFVec3f(new a(0,0,0),new a(0,1,0)))]),getTypeName:function(){return"Extrusion"},getComponentName:function(){return"Geometry3D"},getContainerField:function(){return"geometry"},initialize:function(){n.prototype.initialize.call(this),this.set_crossSection_.addFieldInterest(this.crossSection_),this.set_orientation_.addFieldInterest(this.orientation_),this.set_scale_.addFieldInterest(this.scale_),this.set_spine_.addFieldInterest(this.spine_)},getClosedOrientation:function(){var t=this.orientation_;if(t.length){var e=t[0].getValue(),i=t[t.length-1].getValue();return e.equals(i)}return!0},createPoints:function(){var t=new a(1,1,1);return function(){for(var e=this.crossSection_,i=this.orientation_,n=this.scale_,r=this.spine_,s=[],o=this.createRotations(),u=0,l=r.length;u<l;++u){var c=o[u];if(i.length&&c.rotate(i[Math.min(u,i.length-1)].getValue()),n.length){var h=n[Math.min(u,n.length-1)].getValue();c.scale(t.set(h.x,1,h.y))}for(var d=0,p=e.length;d<p;++d){var f=e[d].getValue();s.push(c.multVecMatrix(new a(f.x,0,f.y)))}}return s}}(),createRotations:function(){var t=[],e=new a(0,0,0),i=new a(0,0,0),n=new a(0,0,0),r=new a(0,0,0),s=new a(0,0,0),o=new a(0,0,0),c=new u(0,0,1,0);return function(){for(var u=this.spine_,h=u.length,d=u[0].getValue(),p=u[u.length-1].getValue(),f=d.equals(p)&&this.getClosedOrientation(),g=t.length;g<h;++g)t[g]=new l;if(t.length=h,e.set(0,0,0),i.set(0,0,0),n.set(0,0,0),f){for(var m=d,g=1,_=h-2;g<_&&(i.assign(u[g].getValue()).subtract(m).normalize().subtract(o.assign(u[_].getValue()).subtract(m).normalize()).normalize(),i.equals(a.Zero));++g);for(var g=0,_=h-2;g<_&&(n.assign(u[g+1].getValue()).subtract(u[g].getValue()).cross(o.assign(u[_].getValue()).subtract(u[g].getValue())).normalize(),n.equals(a.Zero));++g);}else{for(var g=0,_=h-1;g<_&&(i.assign(u[g+1].getValue()).subtract(u[g].getValue()).normalize(),i.equals(a.Zero));++g);for(var g=1,_=h-1;g<_&&(n.assign(u[g+1].getValue()).subtract(u[g].getValue()).cross(o.assign(u[g-1].getValue()).subtract(u[g].getValue())).normalize(),n.equals(a.Zero));++g);}i.equals(a.Zero)&&i.set(0,1,0),n.equals(a.Zero)&&c.setFromToVec(a.yAxis,i).multVecRot(n.assign(a.zAxis)),e.assign(i).cross(n);var m=d;t[0].set(e.x,e.y,e.z,0,i.x,i.y,i.z,0,n.x,n.y,n.z,0,m.x,m.y,m.z,1),r.assign(i),s.assign(n);for(var g=1,_=h-1;g<_;++g){var m=u[g].getValue();i.assign(u[g+1].getValue()).subtract(m).normalize().subtract(o.assign(u[g-1].getValue()).subtract(m).normalize()).normalize(),n.assign(u[g+1].getValue()).subtract(m).cross(o.assign(u[g-1].getValue()).subtract(m)).normalize(),s.dot(n)<0&&n.negate(),i.equals(a.Zero)?i.assign(r):r.assign(i),n.equals(a.Zero)?n.assign(s):s.assign(n),e.assign(i).cross(n),t[g].set(e.x,e.y,e.z,0,i.x,i.y,i.z,0,n.x,n.y,n.z,0,m.x,m.y,m.z,1)}if(f)t[h-1].assign(t[0]);else{var m=p;i.assign(m).subtract(u[h-2].getValue()).normalize(),h>2&&n.assign(m).subtract(u[h-2].getValue()).cross(o.assign(u[h-3].getValue()).subtract(u[h-2].getValue())).normalize(),s.dot(n)<0&&n.negate(),i.equals(a.Zero)&&i.assign(r),n.equals(a.Zero)&&n.assign(s),e.assign(i).cross(n),t[h-1].set(e.x,e.y,e.z,0,i.x,i.y,i.z,0,n.x,n.y,n.z,0,m.x,m.y,m.z,1)}return t}}(),build:function(){var t=new o(0,0,0),e=new o(0,0,0),i=new o(0,0,0);return function(){function n(t,e){return t*d+e}var r=!this.ccw_.getValue(),u=this.crossSection_,l=this.spine_,c=l.length,h=this.getTexCoords();if(!(c<2||u.length<2)){this.getMultiTexCoords().push(h);var d=u.length,p=l[0].getValue(),f=l[c-1].getValue(),g=p.equals(f)&&this.getClosedOrientation(),m=u[0].getValue(),_=u[u.length-1].getValue(),x=m.equals(_);t.assign(u[0].getValue()),e.assign(u[0].getValue());for(var y=1,v=u.length;y<v;++y)t.min(u[y].getValue()),e.max(u[y].getValue());for(var w=i.assign(e).subtract(t),b=Math.max(w.x,w.y),S=x?u.length-1:u.length,C=[],T=[],F=this.createPoints(),O=0,v=F.length;O<v;++O)C[O]=[];for(var N=this.getNormals(),E=this.getVertices(),M=u.length-1,D=c-1,V=n(0,0),I=n(0,x?0:M),B=0;B<D;++B)for(var y=0;y<M;++y){var A=g&&B===c-2?0:B+1,P=x&&y===u.length-2?0:y+1,L=n(B,y),R=n(B,P),k=n(A,P),U=n(A,y),X=F[L],j=F[R],z=F[k],G=F[U],H=j.distance(z)>=1e-7,q=G.distance(X)>=1e-7;if(r)var W=s.normal(z,j,X,new a(0,0,0)),Y=s.normal(G,z,X,new a(0,0,0));else var W=s.normal(X,j,z,new a(0,0,0)),Y=s.normal(X,z,G,new a(0,0,0));if(0==y&&(q?V=L:(L=V,X=F[L])),y==u.length-2&&(H?I=R:(k=I,z=F[k])),H){if(q)h.push(y/M,B/D,0,1);else{var $=(B/D+(B+1)/D)/2;h.push(y/M,$,0,1)}C[L].push(T.length),T.push(W),E.push(X.x,X.y,X.z,1),h.push((y+1)/M,B/D,0,1),C[R].push(T.length),T.push(W),E.push(j.x,j.y,j.z,1),h.push((y+1)/M,(B+1)/D,0,1),C[k].push(T.length),T.push(W),E.push(z.x,z.y,z.z,1)}if(q){if(h.push(y/M,B/D,0,1),C[L].push(T.length),T.push(Y),E.push(X.x,X.y,X.z,1),H)h.push((y+1)/M,(B+1)/D,0,1);else{var $=((B+1)/D+B/D)/2;h.push((y+1)/M,$,0,1)}C[k].push(T.length),T.push(Y),E.push(z.x,z.y,z.z,1),h.push(y/M,(B+1)/D,0,1),C[U].push(T.length),T.push(Y),E.push(G.x,G.y,G.z,1)}}T=this.refineNormals(C,T,this.creaseAngle_.getValue());for(var Z=0;Z<T.length;++Z){var Q=T[Z];N.push(Q.x,Q.y,Q.z)}if(b&&S>2){if(this.beginCap_.getValue()){for(var K=0,J=[],tt=[],y=0;y<S;++y){var et=n(K,S-1-y),it=F[et].copy();it.index=et,it.texCoord=o.subtract(u[S-1-y].getValue(),t).divide(b),J.push(it)}if(this.convex_.getValue()?s.triangulateConvexPolygon(J,tt):s.triangulatePolygon(J,tt),tt.length>=3){var Q=s.normal(F[tt[0].index],F[tt[1].index],F[tt[2].index],new a(0,0,0));r&&Q.negate(),this.addCap(h,Q,F,tt)}}if(this.endCap_.getValue()){for(var K=c-1,J=[],tt=[],y=0;y<S;++y){var et=n(K,y),it=F[et].copy();it.index=et,it.texCoord=o.subtract(u[y].getValue(),t).divide(b),J.push(it)}if(this.convex_.getValue()?s.triangulateConvexPolygon(J,tt):s.triangulatePolygon(J,tt),tt.length>=3){var Q=s.normal(F[tt[0].index],F[tt[1].index],F[tt[2].index],new a(0,0,0));r&&Q.negate(),this.addCap(h,Q,F,tt)}}}this.setSolid(this.solid_.getValue()),this.setCCW(this.ccw_.getValue())}}}(),addCap:function(t,e,i,n){for(var r=this.getNormals(),s=this.getVertices(),o=0;o<n.length;o+=3){var a=i[n[o].index],u=i[n[o+1].index],l=i[n[o+2].index],c=n[o].texCoord,h=n[o+1].texCoord,d=n[o+2].texCoord;t.push(c.x,c.y,0,1),t.push(h.x,h.y,0,1),t.push(d.x,d.y,0,1),r.push(e.x,e.y,e.z,e.x,e.y,e.z,e.x,e.y,e.z),s.push(a.x,a.y,a.z,1,u.x,u.y,u.z,1,l.x,l.y,l.z,1)}}}),c}),define("x_ite/Components/Geometry3D/Sphere",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Rendering/X3DGeometryNode","x_ite/Bits/X3DConstants"],function(t,e,i,n,r){"use strict";function s(t){n.call(this,t),this.addType(r.Sphere),this.radius_.setUnit("length")}return s.prototype=Object.assign(Object.create(n.prototype),{constructor:s,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.initializeOnly,"radius",new t.SFFloat(1)),new e(r.initializeOnly,"solid",new t.SFBool(!0))]),getTypeName:function(){return"Sphere"},getComponentName:function(){return"Geometry3D"},getContainerField:function(){return"geometry"},set_live__:function(){n.prototype.set_live__.call(this),this.isLive().getValue()?this.getBrowser().getSphereOptions().addInterest("requestRebuild",this):this.getBrowser().getSphereOptions().removeInterest("requestRebuild",this)},build:function(){var t=this.getBrowser().getSphereOptions(),e=t.getGeometry(),i=this.radius_.getValue();if(this.setMultiTexCoords(e.getMultiTexCoords()),this.setNormals(e.getNormals()),1===i)this.setVertices(e.getVertices()),this.getMin().assign(e.getMin()),this.getMax().assign(e.getMax());else{for(var n=e.getVertices().getValue(),r=this.getVertices(),s=0;s<n.length;s+=4)r.push(i*n[s],i*n[s+1],i*n[s+2],1);i=Math.abs(i),this.getMin().set(-i,-i,-i),this.getMax().set(i,i,i)}this.setSolid(this.solid_.getValue())}}),s}),define("x_ite/Components/Geometry3D",["x_ite/Configuration/SupportedNodes","x_ite/Components/Geometry3D/Box","x_ite/Components/Geometry3D/Cone","x_ite/Components/Geometry3D/Cylinder","x_ite/Components/Geometry3D/ElevationGrid","x_ite/Components/Geometry3D/Extrusion","x_ite/Components/Geometry3D/IndexedFaceSet","x_ite/Components/Geometry3D/Sphere"],function(t,e,i,n,r,s,o,a){"use strict";const u={Box:e,Cone:i,Cylinder:n,ElevationGrid:r,Extrusion:s,IndexedFaceSet:o,Sphere:a},l={};for(const e in u)t.addType(e,u[e]);for(const e in l)t.addAbstractType(e,l[e])}),define("x_ite/Components/Grouping/StaticGroup",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Core/X3DChildNode","x_ite/Components/Grouping/X3DBoundedObject","x_ite/Components/Grouping/Group","x_ite/Bits/X3DConstants","x_ite/Bits/TraverseType","standard/Math/Geometry/Box3","standard/Math/Geometry/ViewVolume"],function(t,e,i,n,r,s,o,a,u,l){"use strict";function c(t){n.call(this,t),r.call(this,t),this.addType(o.StaticGroup),this.group=new s(this.getExecutionContext()),this.collisionShapes=null,this.depthShapes=null,this.opaqueShapes=null,this.transparentShapes=null,this.bbox=new u,this.shadowBBox=new u}return c.prototype=Object.assign(Object.create(n.prototype),r.prototype,{constructor:c,fieldDefinitions:new i([new e(o.inputOutput,"metadata",new t.SFNode),new e(o.inputOutput,"visible",new t.SFBool(!0)),new e(o.inputOutput,"bboxDisplay",new t.SFBool),new e(o.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new e(o.initializeOnly,"bboxCenter",new t.SFVec3f),new e(o.initializeOnly,"children",new t.MFNode)]),getTypeName:function(){return"StaticGroup"},getComponentName:function(){return"Grouping"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),r.prototype.initialize.call(this),this.bboxSize_.addFieldInterest(this.group.bboxSize_),this.bboxCenter_.addFieldInterest(this.group.bboxCenter_),this.children_.addFieldInterest(this.group.children_),this.group.bboxSize_=this.bboxSize_,this.group.bboxCenter_=this.bboxCenter_,this.group.children_=this.children_,this.group.setPrivate(!0),this.group.setup(),this.group.isCameraObject_.addFieldInterest(this.isCameraObject_),this.group.isPickableObject_.addFieldInterest(this.isPickableObject_),this.group.children_.addInterest("set_children__",this),this.setCameraObject(this.group.getCameraObject()),this.setPickableObject(this.group.getPickableObject()),this.set_children__()},getBBox:function(t,e){return t.assign(e?this.shadowBBox:this.bbox)},set_children__:function(){this.group.getBBox(this.bbox),this.group.getBBox(this.shadowBBox,!0),this.collisionShapes=null,this.depthShapes=null,this.opaqueShapes=null,this.transparentShapes=null},traverse:function(){const t=new l;return t.intersectsSphere=function(){return!0},function(e,i){switch(e){case a.CAMERA:return;case a.POINTER:case a.COLLISION:{if(!this.collisionShapes){const n=i.getViewVolumes(),r=i.getViewport(),s=i.getProjectionMatrix(),o=i.getModelViewMatrix(),a=i.getNumCollisionShapes();n.push(t.set(s,r,r)),o.push(),o.identity(),this.group.traverse(e,i),o.pop(),n.pop();const u=i.getNumCollisionShapes();this.collisionShapes=i.getCollisionShapes().splice(a,u-a),i.setNumCollisionShapes(a)}const n=i.getModelViewMatrix();for(const t of this.collisionShapes)n.push(),n.multLeft(t.modelViewMatrix),t.shapeNode.traverse(e,i),n.pop();return}case a.SHADOW:{if(!this.depthShapes){const n=i.getViewVolumes(),r=i.getViewport(),s=i.getProjectionMatrix(),o=i.getModelViewMatrix(),a=i.getNumDepthShapes();n.push(t.set(s,r,r)),o.push(),o.identity(),this.group.traverse(e,i),o.pop(),n.pop();const u=i.getNumDepthShapes();this.depthShapes=i.getDepthShapes().splice(a,u-a),i.setNumDepthShapes(a)}const n=i.getModelViewMatrix();for(const t of this.depthShapes)n.push(),n.multLeft(t.modelViewMatrix),t.shapeNode.traverse(e,i),n.pop();return}case a.DISPLAY:{if(!this.opaqueShapes){const n=i.getViewVolumes(),r=i.getViewport(),s=i.getProjectionMatrix(),o=i.getModelViewMatrix(),a=i.getNumOpaqueShapes(),u=i.getNumTransparentShapes();n.push(t.set(s,r,r)),o.push(),o.identity(),this.group.traverse(e,i),o.pop(),n.pop();const l=i.getNumOpaqueShapes(),c=i.getNumTransparentShapes();this.opaqueShapes=i.getOpaqueShapes().splice(a,l-a),this.transparentShapes=i.getTransparentShapes().splice(u,c-u),i.setNumOpaqueShapes(a),i.setNumTransparentShapes(u)}const n=i.getModelViewMatrix();for(const t of this.opaqueShapes)n.push(),n.multLeft(t.modelViewMatrix),t.shapeNode.traverse(e,i),n.pop();for(const t of this.transparentShapes)n.push(),n.multLeft(t.modelViewMatrix),t.shapeNode.traverse(e,i),n.pop();return}}}}()}),c}),define("x_ite/Components/Grouping/Switch",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Grouping/X3DGroupingNode","x_ite/Bits/TraverseType","x_ite/Bits/X3DCast","x_ite/Bits/X3DConstants"],function(t,e,i,n,r,s,o){"use strict";function a(t){n.call(this,t),this.addType(o.Switch),"2.0"==t.getSpecificationVersion()&&this.addAlias("choice",this.children_),this.childNode=null,this.visibleNode=null,this.boundedObject=null}return a.prototype=Object.assign(Object.create(n.prototype),{constructor:a,fieldDefinitions:new i([new e(o.inputOutput,"metadata",new t.SFNode),new e(o.inputOutput,"whichChoice",new t.SFInt32(-1)),new e(o.inputOutput,"visible",new t.SFBool(!0)),new e(o.inputOutput,"bboxDisplay",new t.SFBool),new e(o.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new e(o.initializeOnly,"bboxCenter",new t.SFVec3f),new e(o.inputOnly,"addChildren",new t.MFNode),new e(o.inputOnly,"removeChildren",new t.MFNode),new e(o.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"Switch"},getComponentName:function(){return"Grouping"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.whichChoice_.addInterest("set_child__",this),this.children_.addInterest("set_child__",this),this.set_child__()},getSubBBox:function(t,e){if(this.bboxSize_.getValue().equals(this.getDefaultBBoxSize())){const i=s(o.X3DBoundedObject,this.visibleNode);return i?i.getBBox(t,e):t.set()}return t.set(this.bboxSize_.getValue(),this.bboxCenter_.getValue())},clear:function(){},add:function(){},remove:function(){},set_child__:function(){this.childNode&&(this.childNode.isCameraObject_.removeInterest("set_cameraObject__",this),this.childNode.isPickableObject_.removeInterest("set_transformSensors__",this)),s(o.X3DBoundedObject,this.childNode)&&(this.childNode.visible_.removeInterest("set_visible__",this),this.childNode.bboxDisplay_.removeInterest("set_bboxDisplay__",this));const t=this.whichChoice_.getValue();t>=0&&t<this.children_.length?(this.childNode=s(o.X3DChildNode,this.children_[t]),this.childNode&&(this.childNode.isCameraObject_.addInterest("set_cameraObject__",this),this.childNode.isPickableObject_.addInterest("set_transformSensors__",this),s(o.X3DBoundedObject,this.childNode)&&(this.childNode.visible_.addInterest("set_visible__",this),this.childNode.bboxDisplay_.addInterest("set_bboxDisplay__",this)),delete this.traverse)):(this.childNode=null,this.traverse=Function.prototype),this.set_transformSensors__(),this.set_visible__(),this.set_bboxDisplay__()},set_cameraObject__:function(){this.childNode&&this.childNode.getCameraObject()?s(o.X3DBoundedObject,this.childNode)?this.setCameraObject(this.childNode.visible_.getValue()):this.setCameraObject(!0):this.setCameraObject(!1)},set_transformSensors__:function(){this.setPickableObject(Boolean(this.getTransformSensors().size||this.childNode&&this.childNode.getPickableObject()))},set_visible__:function(){s(o.X3DBoundedObject,this.childNode)?this.visibleNode=this.childNode.visible_.getValue()?this.childNode:null:this.visibleNode=this.childNode,this.set_cameraObject__()},set_bboxDisplay__:function(){s(o.X3DBoundedObject,this.childNode)?this.boundedObject=this.childNode.bboxDisplay_.getValue()?this.childNode:null:this.boundedObject=null},traverse:function(t,e){switch(t){case r.POINTER:case r.CAMERA:case r.SHADOW:{const i=this.visibleNode;return void(i&&i.traverse(t,e))}case r.PICKING:{if(this.getTransformSensors().size){const t=e.getModelViewMatrix().get();for(const e of this.getTransformSensors())e.collect(t)}const i=this.childNode;if(i){const n=e.getBrowser(),r=n.getPickingHierarchy();r.push(this),i.traverse(t,e),r.pop()}return}case r.COLLISION:{const i=this.childNode;return void(i&&i.traverse(t,e))}case r.DISPLAY:{const i=this.visibleNode;i&&i.traverse(t,e);const n=this.boundedObject;return void(n&&n.displayBBox(t,e))}}}}),a}),define("x_ite/Components/Grouping/X3DTransformMatrix3DNode",["x_ite/Components/Grouping/X3DGroupingNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4"],function(t,e,i,n,r){"use strict";function s(i){t.call(this,i),this.addType(e.X3DTransformMatrix3DNode),this.matrix=new r,this.getBBox=this.getGetGroupBBox(),this.traverse=this.getGroupTraverse()}return s.prototype=Object.assign(Object.create(t.prototype),{constructor:s,setMatrix:function(t){t.equals(r.Identity)?(this.matrix.identity(),this.getBBox=this.getGetGroupBBox(),this.traverse=this.getGroupTraverse()):(this.matrix.assign(t),this.getBBox=this.getGetBBox(),this.traverse=this.getTraverse())},getMatrix:function(){return this.matrix},setTransform:function(t,e,r,s,o){t.equals(i.Zero)&&e.equals(n.Identity)&&r.equals(i.One)?(this.matrix.identity(),this.getBBox=this.getGetGroupBBox(),this.traverse=this.getGroupTraverse()):(this.matrix.set(t,e,r,s,o),this.getBBox=this.getGetBBox(),this.traverse=this.getTraverse())},getGetBBox:function(){function t(t,e){return this.getSubBBox(t,e).multRight(this.matrix)}return function(){return t}}(),getGetGroupBBox:function(){return t.prototype.getBBox},getTraverse:function(){function e(e,i){const n=i.getModelViewMatrix();n.push(),n.multLeft(this.matrix),t.prototype.traverse.call(this,e,i),n.pop()}return function(){return e}}(),getGroupTraverse:function(){return t.prototype.traverse}}),s}),define("x_ite/Components/Grouping/X3DTransformNode",["x_ite/Components/Grouping/X3DTransformMatrix3DNode","x_ite/Bits/X3DConstants"],function(t,e){"use strict";function i(i){t.call(this,i),this.addType(e.X3DTransformNode),this.translation_.setUnit("length"),this.center_.setUnit("length")}return i.prototype=Object.assign(Object.create(t.prototype),{constructor:i,initialize:function(){t.prototype.initialize.call(this),this.addInterest("eventsProcessed",this),this.eventsProcessed()},eventsProcessed:function(){this.setHidden(0===this.scale_.x||0===this.scale_.y||0===this.scale_.z),this.setTransform(this.translation_.getValue(),this.rotation_.getValue(),this.scale_.getValue(),this.scaleOrientation_.getValue(),this.center_.getValue())}}),i}),define("x_ite/Components/Grouping/Transform",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Grouping/X3DTransformNode","x_ite/Bits/X3DConstants"],function(t,e,i,n,r){"use strict";function s(t){n.call(this,t),this.addType(r.Transform)}return s.prototype=Object.assign(Object.create(n.prototype),{constructor:s,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"translation",new t.SFVec3f),new e(r.inputOutput,"rotation",new t.SFRotation),new e(r.inputOutput,"scale",new t.SFVec3f(1,1,1)),new e(r.inputOutput,"scaleOrientation",new t.SFRotation),new e(r.inputOutput,"center",new t.SFVec3f),new e(r.inputOutput,"visible",new t.SFBool(!0)),new e(r.inputOutput,"bboxDisplay",new t.SFBool),new e(r.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new e(r.initializeOnly,"bboxCenter",new t.SFVec3f),new e(r.inputOnly,"addChildren",new t.MFNode),new e(r.inputOnly,"removeChildren",new t.MFNode),new e(r.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"Transform"},getComponentName:function(){return"Grouping"},getContainerField:function(){return"children"}}),s}),define("x_ite/Components/Grouping",["x_ite/Configuration/SupportedNodes","x_ite/Components/Grouping/Group","x_ite/Components/Grouping/StaticGroup","x_ite/Components/Grouping/Switch","x_ite/Components/Grouping/Transform","x_ite/Components/Grouping/X3DBoundedObject","x_ite/Components/Grouping/X3DGroupingNode","x_ite/Components/Grouping/X3DTransformMatrix3DNode","x_ite/Components/Grouping/X3DTransformNode"],function(t,e,i,n,r,s,o,a,u){"use strict";const l={Group:e,StaticGroup:i,Switch:n,Transform:r},c={X3DBoundedObject:s,X3DGroupingNode:o,X3DTransformMatrix3DNode:a,X3DTransformNode:u};for(const e in l)t.addType(e,l[e]);for(const e in c)t.addAbstractType(e,c[e])}),define("x_ite/Components/Interpolation/ColorInterpolator",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Interpolation/X3DInterpolatorNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Color3"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.ColorInterpolator),this.hsv=[]}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOnly,"set_fraction",new t.SFFloat),new e(r.inputOutput,"key",new t.MFFloat),new e(r.inputOutput,"keyValue",new t.MFColor),new e(r.outputOnly,"value_changed",new t.SFColor)]),getTypeName:function(){return"ColorInterpolator"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.keyValue_.addInterest("set_keyValue__",this)},set_keyValue__:function(){var e=this.keyValue_;e.length<this.key_.length&&this.keyValue_.resize(this.key_.length,e.length?e[this.keyValue_.length-1]:new t.SFColor),this.hsv.length=0;for(var i=0,n=e.length;i<n;++i)this.hsv.push(e[i].getHSV([]))},interpolate:function(){var t=[];return function(e,i,n){s.lerp(this.hsv[e],this.hsv[i],n,t),this.value_changed_.setHSV(t[0],t[1],t[2])}}()}),o}),define("x_ite/Components/Interpolation/CoordinateInterpolator",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Interpolation/X3DInterpolatorNode","x_ite/Bits/X3DConstants","standard/Math/Algorithm"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.CoordinateInterpolator)}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOnly,"set_fraction",new t.SFFloat),new e(r.inputOutput,"key",new t.MFFloat),new e(r.inputOutput,"keyValue",new t.MFVec3f),new e(r.outputOnly,"value_changed",new t.MFVec3f)]),getTypeName:function(){return"CoordinateInterpolator"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},set_keyValue__:function(){},interpolate:function(t,e,i){var n=this.keyValue_.getValue(),r=this.key_.length?Math.floor(this.keyValue_.length/this.key_.length):0;this.value_changed_.length=r;var o=this.value_changed_.getValue();t*=r,e=t+(this.key_.length>1?r:0),t*=3,e*=3,r*=3;for(var a=0;a<r;a+=3){var u=a+1,l=a+2;o[a]=s.lerp(n[t+a],n[e+a],i),o[u]=s.lerp(n[t+u],n[e+u],i),o[l]=s.lerp(n[t+l],n[e+l],i)}this.value_changed_.addEvent()}}),o}),define("x_ite/Components/Interpolation/CoordinateInterpolator2D",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Interpolation/X3DInterpolatorNode","x_ite/Bits/X3DConstants","standard/Math/Algorithm"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.CoordinateInterpolator2D)}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOnly,"set_fraction",new t.SFFloat),new e(r.inputOutput,"key",new t.MFFloat),new e(r.inputOutput,"keyValue",new t.MFVec2f),new e(r.outputOnly,"value_changed",new t.MFVec2f)]),getTypeName:function(){return"CoordinateInterpolator2D"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},set_keyValue__:function(){},interpolate:function(t,e,i){var n=this.keyValue_.getValue(),r=this.key_.length?Math.floor(this.keyValue_.length/this.key_.length):0;this.value_changed_.length=r;var o=this.value_changed_.getValue();t*=r,e=t+(this.key_.length>1?r:0),t*=2,e*=2,r*=2;for(var a=0;a<r;a+=2){var u=a+1;o[a]=s.lerp(n[t+a],n[e+a],i),o[u]=s.lerp(n[t+u],n[e+u],i)}this.value_changed_.addEvent()}}),o}),define("x_ite/Components/Interpolation/NormalInterpolator",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Interpolation/X3DInterpolatorNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector3","standard/Math/Algorithm"],function(t,e,i,n,r,s,o){"use strict";function a(t){n.call(this,t),this.addType(r.NormalInterpolator)}var u=new s(0,0,0),l=new s(0,0,0);return a.prototype=Object.assign(Object.create(n.prototype),{constructor:a,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOnly,"set_fraction",new t.SFFloat),new e(r.inputOutput,"key",new t.MFFloat),new e(r.inputOutput,"keyValue",new t.MFVec3f),new e(r.outputOnly,"value_changed",new t.MFVec3f)]),getTypeName:function(){return"NormalInterpolator"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.keyValue_.addInterest("set_keyValue__",this)},set_keyValue__:function(){},interpolate:function(t,e,i){var n=this.keyValue_.getValue(),r=this.key_.length>1?Math.floor(this.keyValue_.length/this.key_.length):0;this.value_changed_.length=r;var s=this.value_changed_.getValue();t*=r,e=t+r,t*=3,e*=3,r*=3;for(var a=0;a<r;a+=3)try{var c=a+1,h=a+2;u.set(n[t+a],n[t+c],n[t+h]),l.set(n[e+a],n[e+c],n[e+h]);var d=o.simpleSlerp(u,l,i);s[a]=d[0],s[c]=d[1],s[h]=d[2]}catch(t){}this.value_changed_.addEvent()}}),a}),define("x_ite/Components/Interpolation/PositionInterpolator2D",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Interpolation/X3DInterpolatorNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector2"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.PositionInterpolator2D)}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOnly,"set_fraction",new t.SFFloat),new e(r.inputOutput,"key",new t.MFFloat),new e(r.inputOutput,"keyValue",new t.MFVec2f),new e(r.outputOnly,"value_changed",new t.SFVec2f)]),getTypeName:function(){return"PositionInterpolator2D"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.keyValue_.addInterest("set_keyValue__",this)},set_keyValue__:function(){var e=this.key_,i=this.keyValue_;i.length<e.length&&i.resize(e.length,i.length?i[i.length-1]:new t.SFVec2f)},interpolate:function(){var t=new s(0,0);return function(e,i,n){this.value_changed_=t.assign(this.keyValue_[e].getValue()).lerp(this.keyValue_[i].getValue(),n)}}()}),o}),define("x_ite/Browser/Interpolation/CatmullRomSplineInterpolator",["standard/Math/Numbers/Vector4","standard/Math/Numbers/Matrix4"],function(t,e){"use strict";function i(){this.T0=[],this.T1=[]}var n=[],r=[],s=[],o=new t(0,0,0,0),a=new e(2,-2,1,1,-3,3,-2,-1,0,0,1,0,1,0,0,0);return i.prototype={constructor:i,generate:function(t,e,i,o,a){var u=this.T0,l=this.T1;if(u.length=0,l.length=0,n.length=0,r.length=0,s.length=0,e.length>1){if(0===o.length){t?n.push(this.divide(this.subtract(i[1],i[i.length-2]),2)):n.push(this.create());for(var c=1,h=i.length-1;c<h;++c)n.push(this.divide(this.subtract(i[c+1],i[c-1]),2));n.push(this.copy(n[0]))}else{for(var c=0,h=o.length;c<h;++c)n.push(this.copy(o[c]));if(a){for(var d=0,c=0,h=i.length-1;c<h;++c)d+=this.abs(this.subtract(i[c],i[c+1]));for(var c=0,h=n.length-1;c<h;++c){var p=this.abs(n[c]);p&&(n[c]=this.multiply(n[c],d/p))}}}if(t){var f=e.length-1,g=e.length-2,m=e[1]-e[0]+e[f]-e[g];s.push(2*(e[1]-e[0])/m),r.push(2*(e[f]-e[g])/m)}else s.push(1),r.push(1);for(var c=1,h=e.length-1;c<h;++c){var m=e[c+1]-e[c-1];s.push(2*(e[c+1]-e[c])/m),r.push(2*(e[c]-e[c-1])/m)}s.push(s[0]),r.push(r[0]);for(var c=0,h=n.length;c<h;++c)u.push(this.multiply(n[c],r[c])),l.push(this.multiply(n[c],s[c]))}else u.push(this.create()),l.push(this.create())},interpolate:function(t,e,i,n){return o.set(Math.pow(i,3),Math.pow(i,2),i,1),this.dot(a.multVecMatrix(o),n[t],n[e],this.T0[t],this.T1[e])}},i}),define("x_ite/Browser/Interpolation/CatmullRomSplineInterpolatorTemplate",["x_ite/Browser/Interpolation/CatmullRomSplineInterpolator"],function(t){"use strict";return function(e){function i(){this.T0=[],this.T1=[]}var n=new e(0,0,0,0),r=new e(0,0,0,0),s=new e(0,0,0,0),o=new e(0,0,0,0);return i.prototype=Object.assign(Object.create(t.prototype),{constructor:i,create:function(){return new e(0,0,0,0)},copy:function(t){return t.copy()},subtract:function(t,i){return e.subtract(t,i)},multiply:function(t,i){return e.multiply(t,i)},divide:function(t,i){return e.divide(t,i)},abs:function(t){return t.abs()},dot:function(t,e,i,a,u){return n.assign(e).multiply(t[0]),r.assign(i).multiply(t[1]),s.assign(a).multiply(t[2]),o.assign(u).multiply(t[3]),n.add(r).add(s).add(o)}}),i}}),define("x_ite/Browser/Interpolation/CatmullRomSplineInterpolator3",["x_ite/Browser/Interpolation/CatmullRomSplineInterpolatorTemplate","standard/Math/Numbers/Vector3"],function(t,e){"use strict";return t(e)}),define("x_ite/Components/Interpolation/SplinePositionInterpolator",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Interpolation/X3DInterpolatorNode","x_ite/Browser/Interpolation/CatmullRomSplineInterpolator3","x_ite/Bits/X3DConstants"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(s.SplinePositionInterpolator),this.spline=new r}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOnly,"set_fraction",new t.SFFloat),new e(s.inputOutput,"closed",new t.SFBool),new e(s.inputOutput,"key",new t.MFFloat),new e(s.inputOutput,"keyValue",new t.MFVec3f),new e(s.inputOutput,"keyVelocity",new t.MFVec3f),new e(s.inputOutput,"normalizeVelocity",new t.SFBool),new e(s.outputOnly,"value_changed",new t.SFVec3f)]),getTypeName:function(){return"SplinePositionInterpolator"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.keyValue_.addInterest("set_keyValue__",this),this.keyVelocity_.addInterest("set_keyVelocity__",this),this.normalizeVelocity_.addInterest("set_normalizeVelocity__",this)},set_keyValue__:function(){var e=this.key_,i=this.keyValue_;i.length<e.length&&i.resize(e.length,i.length?i[i.length-1]:new t.SFVec3f),this.set_keyVelocity__()},set_keyVelocity__:function(){this.keyVelocity_.length&&this.keyVelocity_.length<this.key_.length&&this.keyVelocity_.resize(this.key_.length,new t.SFVec3f),this.set_normalizeVelocity__()},set_normalizeVelocity__:function(){
|
|
38
|
-
this.spline.generate(this.closed_.getValue(),this.key_,this.keyValue_,this.keyVelocity_,this.normalizeVelocity_.getValue())},interpolate:function(t,e,i){this.value_changed_=this.spline.interpolate(t,e,i,this.keyValue_)}}),o}),define("x_ite/Browser/Interpolation/CatmullRomSplineInterpolator2",["x_ite/Browser/Interpolation/CatmullRomSplineInterpolatorTemplate","standard/Math/Numbers/Vector2"],function(t,e){"use strict";return t(e)}),define("x_ite/Components/Interpolation/SplinePositionInterpolator2D",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Interpolation/X3DInterpolatorNode","x_ite/Browser/Interpolation/CatmullRomSplineInterpolator2","x_ite/Bits/X3DConstants"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(s.SplinePositionInterpolator2D),this.spline=new r}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOnly,"set_fraction",new t.SFFloat),new e(s.inputOutput,"closed",new t.SFBool),new e(s.inputOutput,"key",new t.MFFloat),new e(s.inputOutput,"keyValue",new t.MFVec2f),new e(s.inputOutput,"keyVelocity",new t.MFVec2f),new e(s.inputOutput,"normalizeVelocity",new t.SFBool),new e(s.outputOnly,"value_changed",new t.SFVec2f)]),getTypeName:function(){return"SplinePositionInterpolator2D"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.keyValue_.addInterest("set_keyValue__",this),this.keyVelocity_.addInterest("set_keyVelocity__",this),this.normalizeVelocity_.addInterest("set_normalizeVelocity__",this)},set_keyValue__:function(){var e=this.key_,i=this.keyValue_;i.length<e.length&&i.resize(e.length,i.length?i[i.length-1]:new t.SFVec2f),this.set_keyVelocity__()},set_keyVelocity__:function(){this.keyVelocity_.length&&this.keyVelocity_.length<this.key_.length&&this.keyVelocity_.resize(this.key_.length,new t.SFVec2f),this.set_normalizeVelocity__()},set_normalizeVelocity__:function(){this.spline.generate(this.closed_.getValue(),this.key_,this.keyValue_,this.keyVelocity_,this.normalizeVelocity_.getValue())},interpolate:function(t,e,i){this.value_changed_=this.spline.interpolate(t,e,i,this.keyValue_)}}),o}),define("x_ite/Browser/Interpolation/CatmullRomSplineInterpolator1",["x_ite/Browser/Interpolation/CatmullRomSplineInterpolator"],function(t){"use strict";function e(){this.T0=[],this.T1=[]}return e.prototype=Object.assign(Object.create(t.prototype),{constructor:e,create:function(){return 0},copy:function(t){return t},subtract:function(t,e){return t-e},multiply:function(t,e){return t*e},divide:function(t,e){return t/e},abs:function(t){return Math.abs(t)},dot:function(t,e,i,n,r){return e*t[0]+i*t[1]+n*t[2]+r*t[3]}}),e}),define("x_ite/Components/Interpolation/SplineScalarInterpolator",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Interpolation/X3DInterpolatorNode","x_ite/Browser/Interpolation/CatmullRomSplineInterpolator1","x_ite/Bits/X3DConstants"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(s.SplineScalarInterpolator),this.spline=new r}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOnly,"set_fraction",new t.SFFloat),new e(s.inputOutput,"closed",new t.SFBool),new e(s.inputOutput,"key",new t.MFFloat),new e(s.inputOutput,"keyValue",new t.MFFloat),new e(s.inputOutput,"keyVelocity",new t.MFFloat),new e(s.inputOutput,"normalizeVelocity",new t.SFBool),new e(s.outputOnly,"value_changed",new t.SFFloat)]),getTypeName:function(){return"SplineScalarInterpolator"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.keyValue_.addInterest("set_keyValue__",this),this.keyVelocity_.addInterest("set_keyVelocity__",this),this.normalizeVelocity_.addInterest("set_normalizeVelocity__",this)},set_keyValue__:function(){var e=this.key_,i=this.keyValue_;i.length<e.length&&i.resize(e.length,i.length?i[i.length-1]:new t.SFFloat),this.set_keyVelocity__()},set_keyVelocity__:function(){this.keyVelocity_.length&&this.keyVelocity_.length<this.key_.length&&this.keyVelocity_.resize(this.key_.length,new t.SFFloat),this.set_normalizeVelocity__()},set_normalizeVelocity__:function(){this.spline.generate(this.closed_.getValue(),this.key_,this.keyValue_,this.keyVelocity_,this.normalizeVelocity_.getValue())},interpolate:function(t,e,i){this.value_changed_=this.spline.interpolate(t,e,i,this.keyValue_)}}),o}),define("x_ite/Browser/Interpolation/SquatInterpolator",["standard/Math/Numbers/Rotation4"],function(t){"use strict";function e(){this.s=[]}var i=new t(0,0,1,0);return e.prototype={constructor:e,generate:function(e,i,n){var r=this.s;if(r.length=0,i.length>1){e?r.push(t.spline(n[i.length-2].getValue(),n[0].getValue(),n[1].getValue())):r.push(n[0].getValue());for(var s=1,o=i.length-1;s<o;++s)r.push(t.spline(n[s-1].getValue(),n[s].getValue(),n[s+1].getValue()));e?r.push(t.spline(n[i.length-2].getValue(),n[i.length-1].getValue(),n[1].getValue())):r.push(n[i.length-1].getValue())}else i.length>0&&r.push(n[0].getValue().copy())},interpolate:function(t,e,n,r){return i.assign(r[t].getValue()).squad(this.s[t],this.s[e],r[e].getValue(),n)}},e}),define("x_ite/Components/Interpolation/SquadOrientationInterpolator",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Interpolation/X3DInterpolatorNode","x_ite/Browser/Interpolation/SquatInterpolator","x_ite/Bits/X3DConstants"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(s.SquadOrientationInterpolator),this.keyValue_.setUnit("angle"),this.value_changed_.setUnit("angle"),this.squad=new r}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOnly,"set_fraction",new t.SFFloat),new e(s.inputOutput,"closed",new t.SFBool),new e(s.inputOutput,"key",new t.MFFloat),new e(s.inputOutput,"keyValue",new t.MFRotation),new e(s.outputOnly,"value_changed",new t.SFRotation)]),getTypeName:function(){return"SquadOrientationInterpolator"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.keyValue_.addInterest("set_keyValue__",this)},set_keyValue__:function(){var e=this.key_,i=this.keyValue_;i.length<e.length&&i.resize(e.length,i.length?i[i.length-1]:new t.SFRotation),this.squad.generate(this.closed_.getValue(),this.key_,this.keyValue_)},interpolate:function(t,e,i){try{this.value_changed_=this.squad.interpolate(t,e,i,this.keyValue_)}catch(t){console.log(t)}}}),o}),define("x_ite/Components/Interpolation",["x_ite/Configuration/SupportedNodes","x_ite/Components/Interpolation/ColorInterpolator","x_ite/Components/Interpolation/CoordinateInterpolator","x_ite/Components/Interpolation/CoordinateInterpolator2D","x_ite/Components/Interpolation/EaseInEaseOut","x_ite/Components/Interpolation/NormalInterpolator","x_ite/Components/Interpolation/OrientationInterpolator","x_ite/Components/Interpolation/PositionInterpolator","x_ite/Components/Interpolation/PositionInterpolator2D","x_ite/Components/Interpolation/ScalarInterpolator","x_ite/Components/Interpolation/SplinePositionInterpolator","x_ite/Components/Interpolation/SplinePositionInterpolator2D","x_ite/Components/Interpolation/SplineScalarInterpolator","x_ite/Components/Interpolation/SquadOrientationInterpolator","x_ite/Components/Interpolation/X3DInterpolatorNode"],function(t,e,i,n,r,s,o,a,u,l,c,h,d,p,f){"use strict";const g={ColorInterpolator:e,CoordinateInterpolator:i,CoordinateInterpolator2D:n,EaseInEaseOut:r,NormalInterpolator:s,OrientationInterpolator:o,PositionInterpolator:a,PositionInterpolator2D:u,ScalarInterpolator:l,SplinePositionInterpolator:c,SplinePositionInterpolator2D:h,SplineScalarInterpolator:d,SquadOrientationInterpolator:p},m={X3DInterpolatorNode:f};for(const e in g)t.addType(e,g[e]);for(const e in m)t.addAbstractType(e,m[e])}),define("x_ite/Components/Layering",["x_ite/Configuration/SupportedNodes","x_ite/Components/Layering/Layer","x_ite/Components/Layering/LayerSet","x_ite/Components/Layering/Viewport","x_ite/Components/Layering/X3DLayerNode","x_ite/Components/Layering/X3DViewportNode"],function(t,e,i,n,r,s){"use strict";const o={Layer:e,LayerSet:i,Viewport:n},a={X3DLayerNode:r,X3DViewportNode:s};for(const e in o)t.addType(e,o[e]);for(const e in a)t.addAbstractType(e,a[e])}),define("x_ite/Components/Lighting/PointLight",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Lighting/X3DLightNode","x_ite/Components/Grouping/X3DGroupingNode","x_ite/Bits/TraverseType","x_ite/Bits/X3DConstants","standard/Math/Geometry/Camera","standard/Math/Geometry/ViewVolume","standard/Math/Numbers/Vector3","standard/Math/Numbers/Vector4","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix3","standard/Math/Numbers/Matrix4","standard/Math/Utility/MatrixStack","standard/Math/Algorithm","standard/Utility/ObjectCache"],function(t,e,i,n,r,s,o,a,u,l,c,h,d,p,f,g,m){"use strict";function _(){this.location=new l(0,0,0),this.matrixArray=new Float32Array(9),this.shadowBuffer=null,this.viewVolume=new u,this.viewport=new c(0,0,0,0),this.projectionMatrix=new p,this.modelViewMatrix=new f(p),this.modelMatrix=new p,this.invLightSpaceMatrix=new p,this.invLightSpaceProjectionMatrix=new p,this.shadowMatrix=new p,this.shadowMatrixArray=new Float32Array(16),this.rotation=new h,this.rotationMatrix=new p,this.textureUnit=0}function x(t){n.call(this,t),this.addType(o.PointLight),this.location_.setUnit("length"),this.radius_.setUnit("length")}var y=[(new p).setRotation(new h(new l(1,0,0),l.zAxis)),(new p).setRotation(new h(new l(-1,0,0),l.zAxis)),(new p).setRotation(new h(new l(0,0,-1),l.zAxis)),(new p).setRotation(new h(new l(0,0,1),l.zAxis)),(new p).setRotation(new h(new l(0,1,0),l.zAxis)),(new p).setRotation(new h(new l(0,-1,0),l.zAxis))],v=[new c(0,.5,.25,.5),new c(.5,.5,.25,.5),new c(.75,.5,.25,.5),new c(.25,.5,.25,.5),new c(0,0,.5,.5),new c(.5,0,.5,.5)],w=m(_);return _.prototype={constructor:_,getModelViewMatrix:function(){return this.modelViewMatrix},set:function(t,e,i,n){var r=t.getContext(),s=e.getShadowMapSize();this.browser=t,this.lightNode=e,this.groupNode=i;try{this.matrixArray.set(n.submatrix.inverse())}catch(t){this.matrixArray.set(d.Identity)}this.modelViewMatrix.pushMatrix(n),e.getShadowIntensity()>0&&s>0&&(this.shadowBuffer=t.popShadowBuffer(s),this.shadowBuffer?t.getCombinedTextureUnits().length?(this.textureUnit=t.getCombinedTextureUnits().pop(),r.activeTexture(r.TEXTURE0+this.textureUnit),r.getVersion()>=2||t.getExtension("WEBGL_depth_texture")?r.bindTexture(r.TEXTURE_2D,this.shadowBuffer.getDepthTexture()):r.bindTexture(r.TEXTURE_2D,this.shadowBuffer.getColorTexture()),r.activeTexture(r.TEXTURE0)):console.warn("Not enough combined texture units for shadow map available."):console.warn("Couldn't create shadow buffer."))},renderShadowMap:function(t){try{if(!this.shadowBuffer)return;var e=this.lightNode,i=t.getCameraSpaceMatrix().get(),n=this.modelMatrix.assign(this.modelViewMatrix.get()).multRight(i),o=this.invLightSpaceMatrix.assign(e.getGlobal()?n:p.Identity);o.translate(e.getLocation()),o.inverse();var u=e.getShadowMapSize();this.shadowBuffer.bind();for(var l=0;l<6;++l){var c=v[l],h=this.viewport.set(c[0]*u,c[1]*u,c[2]*u,c[3]*u),d=a.perspective2(g.radians(90),.125,1e4,h[2],h[3],this.projectionMatrix);t.getViewVolumes().push(this.viewVolume.set(d,h,h)),t.getProjectionMatrix().pushMatrix(this.projectionMatrix),t.getModelViewMatrix().pushMatrix(y[l]),t.getModelViewMatrix().multLeft(o),t.render(s.SHADOW,r.prototype.traverse,this.groupNode),t.getModelViewMatrix().pop(),t.getProjectionMatrix().pop(),t.getViewVolumes().pop()}this.shadowBuffer.unbind(),e.getGlobal()||o.multLeft(n.inverse()),this.invLightSpaceProjectionMatrix.assign(o)}catch(t){console.log(t)}},setGlobalVariables:function(t){this.modelViewMatrix.get().multVecMatrix(this.location.assign(this.lightNode.location_.getValue())),this.shadowMatrix.assign(t.getCameraSpaceMatrix().get()).multRight(this.invLightSpaceProjectionMatrix),this.shadowMatrixArray.set(this.shadowMatrix)},setShaderUniforms:function(t,e){var i=e.numLights++;if(!e.hasLight(i,this)){var n=this.lightNode,r=n.getColor(),s=n.getAttenuation(),o=this.location;if(t.uniform1i(e.x3d_LightType[i],2),t.uniform3f(e.x3d_LightColor[i],r.r,r.g,r.b),t.uniform1f(e.x3d_LightIntensity[i],n.getIntensity()),t.uniform1f(e.x3d_LightAmbientIntensity[i],n.getAmbientIntensity()),t.uniform3f(e.x3d_LightAttenuation[i],Math.max(0,s.x),Math.max(0,s.y),Math.max(0,s.z)),t.uniform3f(e.x3d_LightLocation[i],o.x,o.y,o.z),t.uniform1f(e.x3d_LightRadius[i],n.getRadius()),t.uniformMatrix3fv(e.x3d_LightMatrix[i],!1,this.matrixArray),this.textureUnit){var a=n.getShadowColor();t.uniform3f(e.x3d_ShadowColor[i],a.r,a.g,a.b),t.uniform1f(e.x3d_ShadowIntensity[i],n.getShadowIntensity()),t.uniform1f(e.x3d_ShadowBias[i],n.getShadowBias()),t.uniformMatrix4fv(e.x3d_ShadowMatrix[i],!1,this.shadowMatrixArray),t.uniform1i(e.x3d_ShadowMapSize[i],n.getShadowMapSize()),t.uniform1i(e.x3d_ShadowMap[i],this.textureUnit)}else t.uniform1f(e.x3d_ShadowIntensity[i],0)}},dispose:function(){this.textureUnit&&this.browser.getCombinedTextureUnits().push(this.textureUnit),this.browser.pushShadowBuffer(this.shadowBuffer),this.modelViewMatrix.clear(),this.browser=null,this.lightNode=null,this.groupNode=null,this.shadowBuffer=null,this.textureUnit=0,w.push(this)}},x.prototype=Object.assign(Object.create(n.prototype),{constructor:x,fieldDefinitions:new i([new e(o.inputOutput,"metadata",new t.SFNode),new e(o.inputOutput,"global",new t.SFBool(!0)),new e(o.inputOutput,"on",new t.SFBool(!0)),new e(o.inputOutput,"color",new t.SFColor(1,1,1)),new e(o.inputOutput,"intensity",new t.SFFloat(1)),new e(o.inputOutput,"ambientIntensity",new t.SFFloat),new e(o.inputOutput,"attenuation",new t.SFVec3f(1,0,0)),new e(o.inputOutput,"location",new t.SFVec3f),new e(o.inputOutput,"radius",new t.SFFloat(100)),new e(o.inputOutput,"shadows",new t.SFBool),new e(o.inputOutput,"shadowColor",new t.SFColor),new e(o.inputOutput,"shadowIntensity",new t.SFFloat(1)),new e(o.inputOutput,"shadowBias",new t.SFFloat(.005)),new e(o.initializeOnly,"shadowMapSize",new t.SFInt32(1024))]),getTypeName:function(){return"PointLight"},getComponentName:function(){return"Lighting"},getContainerField:function(){return"children"},getAttenuation:function(){return this.attenuation_.getValue()},getLocation:function(){return this.location_.getValue()},getRadius:function(){return Math.max(0,this.radius_.getValue())},getLights:function(){return w}}),x}),define("x_ite/Components/Lighting/SpotLight",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Lighting/X3DLightNode","x_ite/Components/Grouping/X3DGroupingNode","x_ite/Bits/TraverseType","x_ite/Bits/X3DConstants","standard/Math/Geometry/Box3","standard/Math/Geometry/Camera","standard/Math/Geometry/ViewVolume","standard/Math/Numbers/Vector3","standard/Math/Numbers/Vector4","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix3","standard/Math/Numbers/Matrix4","standard/Math/Utility/MatrixStack","standard/Math/Algorithm","standard/Utility/ObjectCache"],function(t,e,i,n,r,s,o,a,u,l,c,h,d,p,f,g,m,_){"use strict";function x(){this.location=new c(0,0,0),this.direction=new c(0,0,0),this.matrixArray=new Float32Array(9),this.renderShadow=!0,this.shadowBuffer=null,this.bbox=new a,this.viewVolume=new l,this.viewport=new h(0,0,0,0),this.projectionMatrix=new f,this.modelViewMatrix=new g(f),this.modelMatrix=new f,this.invLightSpaceMatrix=new f,this.invLightSpaceProjectionMatrix=new f,this.shadowMatrix=new f,this.shadowMatrixArray=new Float32Array(16),this.rotation=new d,this.lightBBoxMin=new c(0,0,0),this.lightBBoxMax=new c(0,0,0),this.textureUnit=0}function y(t){n.call(this,t),this.addType(o.SpotLight),this.location_.setUnit("length"),this.radius_.setUnit("length"),this.beamWidth_.setUnit("angle"),this.cutOffAngle_.setUnit("angle")}var v=_(x);return x.prototype={constructor:x,getModelViewMatrix:function(){return this.modelViewMatrix},set:function(t,e,i,n){var r=t.getContext(),s=e.getShadowMapSize();this.browser=t,this.lightNode=e,this.groupNode=i;try{this.matrixArray.set(n.submatrix.inverse())}catch(t){this.matrixArray.set(p.Identity)}this.modelViewMatrix.pushMatrix(n),e.getShadowIntensity()>0&&s>0&&(this.shadowBuffer=t.popShadowBuffer(s),this.shadowBuffer?t.getCombinedTextureUnits().length?(this.textureUnit=t.getCombinedTextureUnits().pop(),r.activeTexture(r.TEXTURE0+this.textureUnit),r.getVersion()>=2||t.getExtension("WEBGL_depth_texture")?r.bindTexture(r.TEXTURE_2D,this.shadowBuffer.getDepthTexture()):r.bindTexture(r.TEXTURE_2D,this.shadowBuffer.getColorTexture()),r.activeTexture(r.TEXTURE0)):console.warn("Not enough combined texture units for shadow map available."):console.warn("Couldn't create shadow buffer."))},renderShadowMap:function(t){try{if(!this.shadowBuffer)return;var e=this.lightNode,i=t.getCameraSpaceMatrix().get(),n=this.modelMatrix.assign(this.modelViewMatrix.get()).multRight(i),o=this.invLightSpaceMatrix.assign(e.getGlobal()?n:f.Identity);o.translate(e.getLocation()),o.rotate(this.rotation.setFromToVec(c.zAxis,this.direction.assign(e.getDirection()).negate())),o.inverse();var a=this.groupNode.getSubBBox(this.bbox,!0),l=a.multRight(o),h=(l.getExtents(this.lightBBoxMin,this.lightBBoxMax),e.getShadowMapSize()),d=Math.min(e.getRadius(),-this.lightBBoxMin.z),p=this.viewport.set(0,0,h,h),g=u.perspective(2*e.getCutOffAngle(),.125,Math.max(1e4,d),h,h,this.projectionMatrix);this.renderShadow=d>0,this.shadowBuffer.bind(),t.getViewVolumes().push(this.viewVolume.set(g,p,p)),t.getProjectionMatrix().pushMatrix(g),t.getModelViewMatrix().pushMatrix(o),t.render(s.SHADOW,r.prototype.traverse,this.groupNode),t.getModelViewMatrix().pop(),t.getProjectionMatrix().pop(),t.getViewVolumes().pop(),this.shadowBuffer.unbind(),e.getGlobal()||o.multLeft(n.inverse()),this.invLightSpaceProjectionMatrix.assign(o).multRight(g).multRight(e.getBiasMatrix())}catch(t){console.log(t)}},setGlobalVariables:function(t){var e=this.lightNode,i=this.modelViewMatrix.get();i.multVecMatrix(this.location.assign(e.location_.getValue())),i.multDirMatrix(this.direction.assign(e.direction_.getValue())).normalize(),this.shadowMatrix.assign(t.getCameraSpaceMatrix().get()).multRight(this.invLightSpaceProjectionMatrix),this.shadowMatrixArray.set(this.shadowMatrix)},setShaderUniforms:function(t,e){var i=e.numLights++;if(!e.hasLight(i,this)){var n=this.lightNode,r=n.getColor(),s=n.getAttenuation(),o=this.location,a=this.direction;if(t.uniform1i(e.x3d_LightType[i],3),t.uniform3f(e.x3d_LightColor[i],r.r,r.g,r.b),t.uniform1f(e.x3d_LightIntensity[i],n.getIntensity()),t.uniform1f(e.x3d_LightAmbientIntensity[i],n.getAmbientIntensity()),t.uniform3f(e.x3d_LightAttenuation[i],Math.max(0,s.x),Math.max(0,s.y),Math.max(0,s.z)),t.uniform3f(e.x3d_LightLocation[i],o.x,o.y,o.z),t.uniform3f(e.x3d_LightDirection[i],a.x,a.y,a.z),t.uniform1f(e.x3d_LightRadius[i],n.getRadius()),t.uniform1f(e.x3d_LightBeamWidth[i],n.getBeamWidth()),t.uniform1f(e.x3d_LightCutOffAngle[i],n.getCutOffAngle()),t.uniformMatrix3fv(e.x3d_LightMatrix[i],!1,this.matrixArray),this.renderShadow&&this.textureUnit){var u=n.getShadowColor();t.uniform3f(e.x3d_ShadowColor[i],u.r,u.g,u.b),t.uniform1f(e.x3d_ShadowIntensity[i],n.getShadowIntensity()),t.uniform1f(e.x3d_ShadowBias[i],n.getShadowBias()),t.uniformMatrix4fv(e.x3d_ShadowMatrix[i],!1,this.shadowMatrixArray),t.uniform1i(e.x3d_ShadowMapSize[i],n.getShadowMapSize()),t.uniform1i(e.x3d_ShadowMap[i],this.textureUnit)}else t.uniform1f(e.x3d_ShadowIntensity[i],0)}},dispose:function(){this.textureUnit&&this.browser.getCombinedTextureUnits().push(this.textureUnit),this.browser.pushShadowBuffer(this.shadowBuffer),this.modelViewMatrix.clear(),this.browser=null,this.lightNode=null,this.groupNode=null,this.shadowBuffer=null,this.textureUnit=0,v.push(this)}},y.prototype=Object.assign(Object.create(n.prototype),{constructor:y,fieldDefinitions:new i([new e(o.inputOutput,"metadata",new t.SFNode),new e(o.inputOutput,"global",new t.SFBool(!0)),new e(o.inputOutput,"on",new t.SFBool(!0)),new e(o.inputOutput,"color",new t.SFColor(1,1,1)),new e(o.inputOutput,"intensity",new t.SFFloat(1)),new e(o.inputOutput,"ambientIntensity",new t.SFFloat),new e(o.inputOutput,"attenuation",new t.SFVec3f(1,0,0)),new e(o.inputOutput,"location",new t.SFVec3f),new e(o.inputOutput,"direction",new t.SFVec3f(0,0,-1)),new e(o.inputOutput,"radius",new t.SFFloat(100)),new e(o.inputOutput,"beamWidth",new t.SFFloat(.785398)),new e(o.inputOutput,"cutOffAngle",new t.SFFloat(1.5708)),new e(o.inputOutput,"shadows",new t.SFBool),new e(o.inputOutput,"shadowColor",new t.SFColor),new e(o.inputOutput,"shadowIntensity",new t.SFFloat(1)),new e(o.inputOutput,"shadowBias",new t.SFFloat(.005)),new e(o.initializeOnly,"shadowMapSize",new t.SFInt32(1024))]),getTypeName:function(){return"SpotLight"},getComponentName:function(){return"Lighting"},getContainerField:function(){return"children"},getAttenuation:function(){return this.attenuation_.getValue()},getLocation:function(){return this.location_.getValue()},getRadius:function(){return Math.max(0,this.radius_.getValue())},getBeamWidth:function(){var t=this.beamWidth_.getValue(),e=this.getCutOffAngle();return t>e?e:m.clamp(t,0,Math.PI/2)},getCutOffAngle:function(){return m.clamp(this.cutOffAngle_.getValue(),0,Math.PI/2)},getLights:function(){return v}}),y}),define("x_ite/Components/Lighting",["x_ite/Configuration/SupportedNodes","x_ite/Components/Lighting/DirectionalLight","x_ite/Components/Lighting/PointLight","x_ite/Components/Lighting/SpotLight","x_ite/Components/Lighting/X3DLightNode"],function(t,e,i,n,r){"use strict";const s={DirectionalLight:e,PointLight:i,SpotLight:n},o={X3DLightNode:r};for(const e in s)t.addType(e,s[e]);for(const e in o)t.addAbstractType(e,o[e])}),define("x_ite/Components/Navigation/Billboard",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Grouping/X3DGroupingNode","x_ite/Bits/X3DConstants","x_ite/Bits/TraverseType","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4"],function(t,e,i,n,r,s,o,a,u){"use strict";function l(t){n.call(this,t),this.addType(r.Billboard),this.matrix=new u}const c=new u,h=new o(0,1,0),d=new o(0,0,1),p=new o(0,0,0),f=new o(0,0,0),g=new o(0,0,0),m=new o(0,0,0),_=new o(0,0,0),x=new a(0,0,1,0);return l.prototype=Object.assign(Object.create(n.prototype),{constructor:l,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"axisOfRotation",new t.SFVec3f(0,1,0)),new e(r.inputOutput,"visible",new t.SFBool(!0)),new e(r.inputOutput,"bboxDisplay",new t.SFBool),new e(r.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new e(r.initializeOnly,"bboxCenter",new t.SFVec3f),new e(r.inputOnly,"addChildren",new t.MFNode),new e(r.inputOnly,"removeChildren",new t.MFNode),new e(r.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"Billboard"},getComponentName:function(){return"Navigation"},getContainerField:function(){return"children"},getBBox:function(t,e){return n.prototype.getBBox.call(this,t,e).multRight(this.matrix)},getMatrix:function(){return this.matrix},rotate:function(t){c.assign(t).inverse();const e=c.origin.normalize();if(this.axisOfRotation_.getValue().equals(o.Zero)){c.multDirMatrix(p.assign(h)).normalize(),f.assign(p).cross(e),g.assign(e).cross(f);const t=e;f.normalize(),g.normalize(),this.matrix.set(f[0],f[1],f[2],0,g[0],g[1],g[2],0,t[0],t[1],t[2],0,0,0,0,1)}else m.assign(this.axisOfRotation_.getValue()).cross(e),_.assign(this.axisOfRotation_.getValue()).cross(d),this.matrix.setRotation(x.setFromToVec(_,m));return this.matrix},traverse:function(t,e){const i=e.getModelViewMatrix();i.push();try{switch(t){case s.CAMERA:case s.PICKING:case s.SHADOW:i.multLeft(this.matrix);break;default:i.multLeft(this.rotate(i.get()))}n.prototype.traverse.call(this,t,e)}catch(t){console.log(t)}i.pop()}}),l}),define("x_ite/Components/Navigation/Collision",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Grouping/X3DGroupingNode","x_ite/Components/Core/X3DSensorNode","x_ite/Bits/X3DCast","x_ite/Bits/TraverseType","x_ite/Bits/X3DConstants"],function(t,e,i,n,r,s,o,a){"use strict";function u(t){n.call(this,t),r.call(this,t),this.addType(a.Collision),"2.0"==t.getSpecificationVersion()&&this.addAlias("collide",this.enabled_)}return u.prototype=Object.assign(Object.create(n.prototype),r.prototype,{constructor:u,fieldDefinitions:new i([new e(a.inputOutput,"metadata",new t.SFNode),new e(a.inputOutput,"enabled",new t.SFBool(!0)),new e(a.outputOnly,"isActive",new t.SFBool),new e(a.outputOnly,"collideTime",new t.SFTime),new e(a.inputOutput,"visible",new t.SFBool(!0)),new e(a.inputOutput,"bboxDisplay",new t.SFBool),new e(a.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new e(a.initializeOnly,"bboxCenter",new t.SFVec3f),new e(a.initializeOnly,"proxy",new t.SFNode),new e(a.inputOnly,"addChildren",new t.MFNode),new e(a.inputOnly,"removeChildren",new t.MFNode),new e(a.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"Collision"},getComponentName:function(){return"Navigation"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.isLive().addInterest("set_live__",this),this.enabled_.addInterest("set_live__",this),this.proxy_.addInterest("set_proxy__",this),this.set_live__(),this.set_proxy__()},set_live__:function(){this.isLive().getValue()&&this.enabled_.getValue()?this.getBrowser().addCollision(this):this.getBrowser().removeCollision(this)},set_active:function(t){this.isActive_.getValue()!==t&&(this.isActive_=t,t&&(this.collideTime_=this.getBrowser().getCurrentTime()))},set_proxy__:function(){this.proxyNode=s(a.X3DChildNode,this.proxy_)},traverse:function(t,e){switch(t){case o.COLLISION:if(this.enabled_.getValue()){var i=e.getCollisions();i.push(this),this.proxyNode?this.proxyNode.traverse(t,e):n.prototype.traverse.call(this,t,e),i.pop()}return;default:return void n.prototype.traverse.call(this,t,e)}}}),u}),define("x_ite/Components/Navigation/LOD",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Grouping/X3DGroupingNode","x_ite/Bits/X3DCast","x_ite/Bits/TraverseType","x_ite/Bits/X3DConstants","standard/Math/Numbers/Matrix4","standard/Math/Algorithm"],function(t,e,i,n,r,s,o,a,u){"use strict";function l(t){n.call(this,t),this.addType(o.LOD),"2.0"==t.getSpecificationVersion()&&this.addAlias("level",this.children_),this.center_.setUnit("length"),this.range_.setUnit("length"),this.frameRate=60,this.keepCurrentLevel=!1,this.childNode=null,this.visibleNode=null,this.boundedObject=null}return l.prototype=Object.assign(Object.create(n.prototype),{constructor:l,fieldDefinitions:new i([new e(o.inputOutput,"metadata",new t.SFNode),new e(o.initializeOnly,"forceTransitions",new t.SFBool),new e(o.initializeOnly,"center",new t.SFVec3f),new e(o.initializeOnly,"range",new t.MFFloat),new e(o.outputOnly,"level_changed",new t.SFInt32(-1)),new e(o.inputOutput,"visible",new t.SFBool(!0)),new e(o.inputOutput,"bboxDisplay",new t.SFBool),new e(o.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new e(o.initializeOnly,"bboxCenter",new t.SFVec3f),new e(o.inputOnly,"addChildren",new t.MFNode),new e(o.inputOnly,"removeChildren",new t.MFNode),new e(o.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"LOD"},getComponentName:function(){return"Navigation"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.children_.addInterest("set_child__",this)},getSubBBox:function(t,e){if(this.bboxSize_.getValue().equals(this.getDefaultBBoxSize())){const i=r(o.X3DBoundedObject,this.visibleNode);return i?i.getBBox(t,e):t.set()}return t.set(this.bboxSize_.getValue(),this.bboxCenter_.getValue())},clear:function(){},add:function(){},remove:function(){},set_child__:function(){this.set_level__(Math.min(this.level_changed_.getValue(),this.children_.length-1))},set_level__:function(t){this.childNode&&(this.childNode.isCameraObject_.removeInterest("set_cameraObject__",this),this.childNode.isPickableObject_.removeInterest("set_transformSensors__",this)),r(o.X3DBoundedObject,this.childNode)&&(this.childNode.visible_.removeInterest("set_visible__",this),this.childNode.bboxDisplay_.removeInterest("set_bboxDisplay__",this)),t>=0&&t<this.children_.length?(this.childNode=r(o.X3DChildNode,this.children_[t]),this.childNode&&(this.childNode.isCameraObject_.addInterest("set_cameraObject__",this),this.childNode.isPickableObject_.addInterest("set_transformSensors__",this),r(o.X3DBoundedObject,this.childNode)&&(this.childNode.visible_.addInterest("set_visible__",this),this.childNode.bboxDisplay_.addInterest("set_bboxDisplay__",this)))):this.childNode=null,this.set_transformSensors__(),this.set_visible__(),this.set_bboxDisplay__()},set_cameraObject__:function(){this.childNode&&this.childNode.getCameraObject()?r(o.X3DBoundedObject,this.childNode)?this.setCameraObject(this.childNode.visible_.getValue()):this.setCameraObject(!0):this.setCameraObject(!1)},set_transformSensors__:function(){this.setPickableObject(Boolean(this.getTransformSensors().size||this.childNode&&this.childNode.getPickableObject()))},set_visible__:function(){r(o.X3DBoundedObject,this.childNode)?this.visibleNode=this.childNode.visible_.getValue()?this.childNode:null:this.visibleNode=this.childNode,this.set_cameraObject__()},set_bboxDisplay__:function(){r(o.X3DBoundedObject,this.childNode)?this.boundedObject=this.childNode.bboxDisplay_.getValue()?this.childNode:null:this.boundedObject=null},getLevel:function(){return function(t,e){if(0===this.range_.length){this.frameRate=(179*this.frameRate+t.currentFrameRate)/180;const e=this.children_.length;switch(e){case 0:return-1;case 1:return 0;case 2:return 1*(this.frameRate>55);default:{const t=1-u.clamp((this.frameRate-20)/35,0,1);return Math.min(Math.floor(t*e),e-1)}}}const i=e.translate(this.center_.getValue()).origin.abs();return u.upperBound(this.range_,0,this.range_.length,i,u.less)}}(),traverse:function(){const t=new a;return function(e,i){switch(e){case s.POINTER:case s.CAMERA:case s.SHADOW:{const t=this.visibleNode;return void(t&&t.traverse(e,i))}case s.PICKING:{if(this.getTransformSensors().size){const t=i.getModelViewMatrix().get();for(const e of this.getTransformSensors())e.collect(t)}const t=this.childNode;if(t){const n=i.getBrowser(),r=n.getPickingHierarchy();r.push(this),t.traverse(e,i),r.pop()}return}case s.COLLISION:{const t=this.childNode;return void(t&&t.traverse(e,i))}case s.DISPLAY:{if(!this.keepCurrentLevel){var n=this.getLevel(i.getBrowser(),t.assign(i.getModelViewMatrix().get())),r=this.level_changed_.getValue();this.forceTransitions_.getValue()&&(n>r?n=r+1:n<r&&(n=r-1)),n!==r&&(this.level_changed_=n,this.set_level__(Math.min(n,this.children_.length-1)))}const s=this.visibleNode;s&&s.traverse(e,i);const o=this.boundedObject;return void(o&&o.displayBBox(e,i))}}}}()}),l}),define("x_ite/Components/Navigation/ViewpointGroup",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Core/X3DChildNode","x_ite/Components/EnvironmentalSensor/ProximitySensor","x_ite/Bits/TraverseType","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(t,e,i,n,r,s,o,a){"use strict";function u(t){n.call(this,t),this.addType(o.ViewpointGroup),this.size_.setUnit("length"),this.center_.setUnit("length"),
|
|
37
|
+
this.crossSection_.setUnit("length"),this.spine_.setUnit("length")}return c.prototype=Object.assign(Object.create(n.prototype),{constructor:c,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOnly,"set_crossSection",new t.MFVec2f),new e(r.inputOnly,"set_orientation",new t.MFRotation),new e(r.inputOnly,"set_scale",new t.MFVec2f),new e(r.inputOnly,"set_spine",new t.MFVec3f),new e(r.initializeOnly,"beginCap",new t.SFBool(!0)),new e(r.initializeOnly,"endCap",new t.SFBool(!0)),new e(r.initializeOnly,"solid",new t.SFBool(!0)),new e(r.initializeOnly,"ccw",new t.SFBool(!0)),new e(r.initializeOnly,"convex",new t.SFBool(!0)),new e(r.initializeOnly,"creaseAngle",new t.SFFloat),new e(r.initializeOnly,"crossSection",new t.MFVec2f(new o(1,1),new o(1,-1),new o(-1,-1),new o(-1,1),new o(1,1))),new e(r.initializeOnly,"orientation",new t.MFRotation(new u)),new e(r.initializeOnly,"scale",new t.MFVec2f(new o(1,1))),new e(r.initializeOnly,"spine",new t.MFVec3f(new a(0,0,0),new a(0,1,0)))]),getTypeName:function(){return"Extrusion"},getComponentName:function(){return"Geometry3D"},getContainerField:function(){return"geometry"},initialize:function(){n.prototype.initialize.call(this),this.set_crossSection_.addFieldInterest(this.crossSection_),this.set_orientation_.addFieldInterest(this.orientation_),this.set_scale_.addFieldInterest(this.scale_),this.set_spine_.addFieldInterest(this.spine_)},getClosedOrientation:function(){var t=this.orientation_;if(t.length){var e=t[0].getValue(),i=t[t.length-1].getValue();return e.equals(i)}return!0},createPoints:function(){var t=new a(1,1,1);return function(){for(var e=this.crossSection_,i=this.orientation_,n=this.scale_,r=this.spine_,s=[],o=this.createRotations(),u=0,l=r.length;u<l;++u){var c=o[u];if(i.length&&c.rotate(i[Math.min(u,i.length-1)].getValue()),n.length){var h=n[Math.min(u,n.length-1)].getValue();c.scale(t.set(h.x,1,h.y))}for(var d=0,p=e.length;d<p;++d){var f=e[d].getValue();s.push(c.multVecMatrix(new a(f.x,0,f.y)))}}return s}}(),createRotations:function(){var t=[],e=new a(0,0,0),i=new a(0,0,0),n=new a(0,0,0),r=new a(0,0,0),s=new a(0,0,0),o=new a(0,0,0),c=new u(0,0,1,0);return function(){for(var u=this.spine_,h=u.length,d=u[0].getValue(),p=u[u.length-1].getValue(),f=d.equals(p)&&this.getClosedOrientation(),g=t.length;g<h;++g)t[g]=new l;if(t.length=h,e.set(0,0,0),i.set(0,0,0),n.set(0,0,0),f){for(var m=d,g=1,_=h-2;g<_&&(i.assign(u[g].getValue()).subtract(m).normalize().subtract(o.assign(u[_].getValue()).subtract(m).normalize()).normalize(),i.equals(a.Zero));++g);for(var g=0,_=h-2;g<_&&(n.assign(u[g+1].getValue()).subtract(u[g].getValue()).cross(o.assign(u[_].getValue()).subtract(u[g].getValue())).normalize(),n.equals(a.Zero));++g);}else{for(var g=0,_=h-1;g<_&&(i.assign(u[g+1].getValue()).subtract(u[g].getValue()).normalize(),i.equals(a.Zero));++g);for(var g=1,_=h-1;g<_&&(n.assign(u[g+1].getValue()).subtract(u[g].getValue()).cross(o.assign(u[g-1].getValue()).subtract(u[g].getValue())).normalize(),n.equals(a.Zero));++g);}i.equals(a.Zero)&&i.set(0,1,0),n.equals(a.Zero)&&c.setFromToVec(a.yAxis,i).multVecRot(n.assign(a.zAxis)),e.assign(i).cross(n);var m=d;t[0].set(e.x,e.y,e.z,0,i.x,i.y,i.z,0,n.x,n.y,n.z,0,m.x,m.y,m.z,1),r.assign(i),s.assign(n);for(var g=1,_=h-1;g<_;++g){var m=u[g].getValue();i.assign(u[g+1].getValue()).subtract(m).normalize().subtract(o.assign(u[g-1].getValue()).subtract(m).normalize()).normalize(),n.assign(u[g+1].getValue()).subtract(m).cross(o.assign(u[g-1].getValue()).subtract(m)).normalize(),s.dot(n)<0&&n.negate(),i.equals(a.Zero)?i.assign(r):r.assign(i),n.equals(a.Zero)?n.assign(s):s.assign(n),e.assign(i).cross(n),t[g].set(e.x,e.y,e.z,0,i.x,i.y,i.z,0,n.x,n.y,n.z,0,m.x,m.y,m.z,1)}if(f)t[h-1].assign(t[0]);else{var m=p;i.assign(m).subtract(u[h-2].getValue()).normalize(),h>2&&n.assign(m).subtract(u[h-2].getValue()).cross(o.assign(u[h-3].getValue()).subtract(u[h-2].getValue())).normalize(),s.dot(n)<0&&n.negate(),i.equals(a.Zero)&&i.assign(r),n.equals(a.Zero)&&n.assign(s),e.assign(i).cross(n),t[h-1].set(e.x,e.y,e.z,0,i.x,i.y,i.z,0,n.x,n.y,n.z,0,m.x,m.y,m.z,1)}return t}}(),build:function(){var t=new o(0,0,0),e=new o(0,0,0),i=new o(0,0,0);return function(){function n(t,e){return t*d+e}var r=!this.ccw_.getValue(),u=this.crossSection_,l=this.spine_,c=l.length,h=this.getTexCoords();if(!(c<2||u.length<2)){this.getMultiTexCoords().push(h);var d=u.length,p=l[0].getValue(),f=l[c-1].getValue(),g=p.equals(f)&&this.getClosedOrientation(),m=u[0].getValue(),_=u[u.length-1].getValue(),x=m.equals(_);t.assign(u[0].getValue()),e.assign(u[0].getValue());for(var y=1,v=u.length;y<v;++y)t.min(u[y].getValue()),e.max(u[y].getValue());for(var w=i.assign(e).subtract(t),b=Math.max(w.x,w.y),S=x?u.length-1:u.length,C=[],T=[],F=this.createPoints(),O=0,v=F.length;O<v;++O)C[O]=[];for(var N=this.getNormals(),E=this.getVertices(),M=u.length-1,D=c-1,V=n(0,0),I=n(0,x?0:M),B=0;B<D;++B)for(var y=0;y<M;++y){var A=g&&B===c-2?0:B+1,P=x&&y===u.length-2?0:y+1,L=n(B,y),R=n(B,P),k=n(A,P),U=n(A,y),X=F[L],j=F[R],z=F[k],G=F[U],H=j.distance(z)>=1e-7,q=G.distance(X)>=1e-7;if(r)var W=s.normal(z,j,X,new a(0,0,0)),Y=s.normal(G,z,X,new a(0,0,0));else var W=s.normal(X,j,z,new a(0,0,0)),Y=s.normal(X,z,G,new a(0,0,0));if(0==y&&(q?V=L:(L=V,X=F[L])),y==u.length-2&&(H?I=R:(k=I,z=F[k])),H){if(q)h.push(y/M,B/D,0,1);else{var $=(B/D+(B+1)/D)/2;h.push(y/M,$,0,1)}C[L].push(T.length),T.push(W),E.push(X.x,X.y,X.z,1),h.push((y+1)/M,B/D,0,1),C[R].push(T.length),T.push(W),E.push(j.x,j.y,j.z,1),h.push((y+1)/M,(B+1)/D,0,1),C[k].push(T.length),T.push(W),E.push(z.x,z.y,z.z,1)}if(q){if(h.push(y/M,B/D,0,1),C[L].push(T.length),T.push(Y),E.push(X.x,X.y,X.z,1),H)h.push((y+1)/M,(B+1)/D,0,1);else{var $=((B+1)/D+B/D)/2;h.push((y+1)/M,$,0,1)}C[k].push(T.length),T.push(Y),E.push(z.x,z.y,z.z,1),h.push(y/M,(B+1)/D,0,1),C[U].push(T.length),T.push(Y),E.push(G.x,G.y,G.z,1)}}T=this.refineNormals(C,T,this.creaseAngle_.getValue());for(var Z=0;Z<T.length;++Z){var Q=T[Z];N.push(Q.x,Q.y,Q.z)}if(b&&S>2){if(this.beginCap_.getValue()){for(var K=0,J=[],tt=[],y=0;y<S;++y){var et=n(K,S-1-y),it=F[et].copy();it.index=et,it.texCoord=o.subtract(u[S-1-y].getValue(),t).divide(b),J.push(it)}if(this.convex_.getValue()?s.triangulateConvexPolygon(J,tt):s.triangulatePolygon(J,tt),tt.length>=3){var Q=s.normal(F[tt[0].index],F[tt[1].index],F[tt[2].index],new a(0,0,0));r&&Q.negate(),this.addCap(h,Q,F,tt)}}if(this.endCap_.getValue()){for(var K=c-1,J=[],tt=[],y=0;y<S;++y){var et=n(K,y),it=F[et].copy();it.index=et,it.texCoord=o.subtract(u[y].getValue(),t).divide(b),J.push(it)}if(this.convex_.getValue()?s.triangulateConvexPolygon(J,tt):s.triangulatePolygon(J,tt),tt.length>=3){var Q=s.normal(F[tt[0].index],F[tt[1].index],F[tt[2].index],new a(0,0,0));r&&Q.negate(),this.addCap(h,Q,F,tt)}}}this.setSolid(this.solid_.getValue()),this.setCCW(this.ccw_.getValue())}}}(),addCap:function(t,e,i,n){for(var r=this.getNormals(),s=this.getVertices(),o=0;o<n.length;o+=3){var a=i[n[o].index],u=i[n[o+1].index],l=i[n[o+2].index],c=n[o].texCoord,h=n[o+1].texCoord,d=n[o+2].texCoord;t.push(c.x,c.y,0,1),t.push(h.x,h.y,0,1),t.push(d.x,d.y,0,1),r.push(e.x,e.y,e.z,e.x,e.y,e.z,e.x,e.y,e.z),s.push(a.x,a.y,a.z,1,u.x,u.y,u.z,1,l.x,l.y,l.z,1)}}}),c}),define("x_ite/Components/Geometry3D/Sphere",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Rendering/X3DGeometryNode","x_ite/Bits/X3DConstants"],function(t,e,i,n,r){"use strict";function s(t){n.call(this,t),this.addType(r.Sphere),this.radius_.setUnit("length")}return s.prototype=Object.assign(Object.create(n.prototype),{constructor:s,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.initializeOnly,"radius",new t.SFFloat(1)),new e(r.initializeOnly,"solid",new t.SFBool(!0))]),getTypeName:function(){return"Sphere"},getComponentName:function(){return"Geometry3D"},getContainerField:function(){return"geometry"},set_live__:function(){n.prototype.set_live__.call(this),this.isLive().getValue()?this.getBrowser().getSphereOptions().addInterest("requestRebuild",this):this.getBrowser().getSphereOptions().removeInterest("requestRebuild",this)},build:function(){var t=this.getBrowser().getSphereOptions(),e=t.getGeometry(),i=this.radius_.getValue();if(this.setMultiTexCoords(e.getMultiTexCoords()),this.setNormals(e.getNormals()),1===i)this.setVertices(e.getVertices()),this.getMin().assign(e.getMin()),this.getMax().assign(e.getMax());else{for(var n=e.getVertices().getValue(),r=this.getVertices(),s=0;s<n.length;s+=4)r.push(i*n[s],i*n[s+1],i*n[s+2],1);i=Math.abs(i),this.getMin().set(-i,-i,-i),this.getMax().set(i,i,i)}this.setSolid(this.solid_.getValue())}}),s}),define("x_ite/Components/Geometry3D",["x_ite/Configuration/SupportedNodes","x_ite/Components/Geometry3D/Box","x_ite/Components/Geometry3D/Cone","x_ite/Components/Geometry3D/Cylinder","x_ite/Components/Geometry3D/ElevationGrid","x_ite/Components/Geometry3D/Extrusion","x_ite/Components/Geometry3D/IndexedFaceSet","x_ite/Components/Geometry3D/Sphere"],function(t,e,i,n,r,s,o,a){"use strict";const u={Box:e,Cone:i,Cylinder:n,ElevationGrid:r,Extrusion:s,IndexedFaceSet:o,Sphere:a},l={};for(const e in u)t.addType(e,u[e]);for(const e in l)t.addAbstractType(e,l[e])}),define("x_ite/Components/Grouping/StaticGroup",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Core/X3DChildNode","x_ite/Components/Grouping/X3DBoundedObject","x_ite/Components/Grouping/Group","x_ite/Bits/X3DConstants","x_ite/Bits/TraverseType","standard/Math/Geometry/Box3","standard/Math/Geometry/ViewVolume"],function(t,e,i,n,r,s,o,a,u,l){"use strict";function c(t){n.call(this,t),r.call(this,t),this.addType(o.StaticGroup),this.group=new s(this.getExecutionContext()),this.collisionShapes=null,this.depthShapes=null,this.opaqueShapes=null,this.transparentShapes=null,this.bbox=new u,this.shadowBBox=new u}return c.prototype=Object.assign(Object.create(n.prototype),r.prototype,{constructor:c,fieldDefinitions:new i([new e(o.inputOutput,"metadata",new t.SFNode),new e(o.inputOutput,"visible",new t.SFBool(!0)),new e(o.inputOutput,"bboxDisplay",new t.SFBool),new e(o.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new e(o.initializeOnly,"bboxCenter",new t.SFVec3f),new e(o.initializeOnly,"children",new t.MFNode)]),getTypeName:function(){return"StaticGroup"},getComponentName:function(){return"Grouping"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),r.prototype.initialize.call(this),this.bboxSize_.addFieldInterest(this.group.bboxSize_),this.bboxCenter_.addFieldInterest(this.group.bboxCenter_),this.children_.addFieldInterest(this.group.children_),this.group.bboxSize_=this.bboxSize_,this.group.bboxCenter_=this.bboxCenter_,this.group.children_=this.children_,this.group.setPrivate(!0),this.group.setup(),this.group.isCameraObject_.addFieldInterest(this.isCameraObject_),this.group.isPickableObject_.addFieldInterest(this.isPickableObject_),this.group.children_.addInterest("set_children__",this),this.setCameraObject(this.group.getCameraObject()),this.setPickableObject(this.group.getPickableObject()),this.set_children__()},getBBox:function(t,e){return t.assign(e?this.shadowBBox:this.bbox)},set_children__:function(){this.group.getBBox(this.bbox),this.group.getBBox(this.shadowBBox,!0),this.collisionShapes=null,this.depthShapes=null,this.opaqueShapes=null,this.transparentShapes=null},traverse:function(){const t=new l;return t.intersectsSphere=function(){return!0},function(e,i){switch(e){case a.CAMERA:return;case a.POINTER:case a.COLLISION:{if(!this.collisionShapes){const n=i.getViewVolumes(),r=i.getViewport(),s=i.getProjectionMatrix(),o=i.getModelViewMatrix(),a=i.getNumCollisionShapes();n.push(t.set(s,r,r)),o.push(),o.identity(),this.group.traverse(e,i),o.pop(),n.pop();const u=i.getNumCollisionShapes();this.collisionShapes=i.getCollisionShapes().splice(a,u-a),i.setNumCollisionShapes(a)}const n=i.getModelViewMatrix();for(const t of this.collisionShapes)n.push(),n.multLeft(t.modelViewMatrix),t.shapeNode.traverse(e,i),n.pop();return}case a.SHADOW:{if(!this.depthShapes){const n=i.getViewVolumes(),r=i.getViewport(),s=i.getProjectionMatrix(),o=i.getModelViewMatrix(),a=i.getNumDepthShapes();n.push(t.set(s,r,r)),o.push(),o.identity(),this.group.traverse(e,i),o.pop(),n.pop();const u=i.getNumDepthShapes();this.depthShapes=i.getDepthShapes().splice(a,u-a),i.setNumDepthShapes(a)}const n=i.getModelViewMatrix();for(const t of this.depthShapes)n.push(),n.multLeft(t.modelViewMatrix),t.shapeNode.traverse(e,i),n.pop();return}case a.DISPLAY:{if(!this.opaqueShapes){const n=i.getViewVolumes(),r=i.getViewport(),s=i.getProjectionMatrix(),o=i.getModelViewMatrix(),a=i.getNumOpaqueShapes(),u=i.getNumTransparentShapes();n.push(t.set(s,r,r)),o.push(),o.identity(),this.group.traverse(e,i),o.pop(),n.pop();const l=i.getNumOpaqueShapes(),c=i.getNumTransparentShapes();this.opaqueShapes=i.getOpaqueShapes().splice(a,l-a),this.transparentShapes=i.getTransparentShapes().splice(u,c-u),i.setNumOpaqueShapes(a),i.setNumTransparentShapes(u)}const n=i.getModelViewMatrix();for(const t of this.opaqueShapes)n.push(),n.multLeft(t.modelViewMatrix),t.shapeNode.traverse(e,i),n.pop();for(const t of this.transparentShapes)n.push(),n.multLeft(t.modelViewMatrix),t.shapeNode.traverse(e,i),n.pop();return}}}}()}),c}),define("x_ite/Components/Grouping/Switch",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Grouping/X3DGroupingNode","x_ite/Bits/TraverseType","x_ite/Bits/X3DCast","x_ite/Bits/X3DConstants"],function(t,e,i,n,r,s,o){"use strict";function a(t){n.call(this,t),this.addType(o.Switch),"2.0"===t.getSpecificationVersion()&&this.addAlias("choice",this.children_),this.childNode=null,this.visibleNode=null,this.boundedObject=null}return a.prototype=Object.assign(Object.create(n.prototype),{constructor:a,fieldDefinitions:new i([new e(o.inputOutput,"metadata",new t.SFNode),new e(o.inputOutput,"whichChoice",new t.SFInt32(-1)),new e(o.inputOutput,"visible",new t.SFBool(!0)),new e(o.inputOutput,"bboxDisplay",new t.SFBool),new e(o.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new e(o.initializeOnly,"bboxCenter",new t.SFVec3f),new e(o.inputOnly,"addChildren",new t.MFNode),new e(o.inputOnly,"removeChildren",new t.MFNode),new e(o.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"Switch"},getComponentName:function(){return"Grouping"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.whichChoice_.addInterest("set_child__",this),this.children_.addInterest("set_child__",this),this.set_child__()},getSubBBox:function(t,e){if(this.bboxSize_.getValue().equals(this.getDefaultBBoxSize())){const i=s(o.X3DBoundedObject,this.visibleNode);return i?i.getBBox(t,e):t.set()}return t.set(this.bboxSize_.getValue(),this.bboxCenter_.getValue())},clear:function(){},add:function(){},remove:function(){},set_child__:function(){this.childNode&&(this.childNode.isCameraObject_.removeInterest("set_cameraObject__",this),this.childNode.isPickableObject_.removeInterest("set_transformSensors__",this)),s(o.X3DBoundedObject,this.childNode)&&(this.childNode.visible_.removeInterest("set_visible__",this),this.childNode.bboxDisplay_.removeInterest("set_bboxDisplay__",this));const t=this.whichChoice_.getValue();t>=0&&t<this.children_.length?(this.childNode=s(o.X3DChildNode,this.children_[t]),this.childNode&&(this.childNode.isCameraObject_.addInterest("set_cameraObject__",this),this.childNode.isPickableObject_.addInterest("set_transformSensors__",this),s(o.X3DBoundedObject,this.childNode)&&(this.childNode.visible_.addInterest("set_visible__",this),this.childNode.bboxDisplay_.addInterest("set_bboxDisplay__",this)),delete this.traverse)):(this.childNode=null,this.traverse=Function.prototype),this.set_transformSensors__(),this.set_visible__(),this.set_bboxDisplay__()},set_cameraObject__:function(){this.childNode&&this.childNode.getCameraObject()?s(o.X3DBoundedObject,this.childNode)?this.setCameraObject(this.childNode.visible_.getValue()):this.setCameraObject(!0):this.setCameraObject(!1)},set_transformSensors__:function(){this.setPickableObject(Boolean(this.getTransformSensors().size||this.childNode&&this.childNode.getPickableObject()))},set_visible__:function(){s(o.X3DBoundedObject,this.childNode)?this.visibleNode=this.childNode.visible_.getValue()?this.childNode:null:this.visibleNode=this.childNode,this.set_cameraObject__()},set_bboxDisplay__:function(){s(o.X3DBoundedObject,this.childNode)?this.boundedObject=this.childNode.bboxDisplay_.getValue()?this.childNode:null:this.boundedObject=null},traverse:function(t,e){switch(t){case r.POINTER:case r.CAMERA:case r.SHADOW:{const i=this.visibleNode;return void(i&&i.traverse(t,e))}case r.PICKING:{if(this.getTransformSensors().size){const t=e.getModelViewMatrix().get();for(const e of this.getTransformSensors())e.collect(t)}const i=this.childNode;if(i){const n=e.getBrowser(),r=n.getPickingHierarchy();r.push(this),i.traverse(t,e),r.pop()}return}case r.COLLISION:{const i=this.childNode;return void(i&&i.traverse(t,e))}case r.DISPLAY:{const i=this.visibleNode;i&&i.traverse(t,e);const n=this.boundedObject;return void(n&&n.displayBBox(t,e))}}}}),a}),define("x_ite/Components/Grouping/X3DTransformMatrix3DNode",["x_ite/Components/Grouping/X3DGroupingNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4"],function(t,e,i,n,r){"use strict";function s(i){t.call(this,i),this.addType(e.X3DTransformMatrix3DNode),this.matrix=new r,this.getBBox=this.getGetGroupBBox(),this.traverse=this.getGroupTraverse()}return s.prototype=Object.assign(Object.create(t.prototype),{constructor:s,setMatrix:function(t){t.equals(r.Identity)?(this.matrix.identity(),this.getBBox=this.getGetGroupBBox(),this.traverse=this.getGroupTraverse()):(this.matrix.assign(t),this.getBBox=this.getGetBBox(),this.traverse=this.getTraverse())},getMatrix:function(){return this.matrix},setTransform:function(t,e,r,s,o){t.equals(i.Zero)&&e.equals(n.Identity)&&r.equals(i.One)?(this.matrix.identity(),this.getBBox=this.getGetGroupBBox(),this.traverse=this.getGroupTraverse()):(this.matrix.set(t,e,r,s,o),this.getBBox=this.getGetBBox(),this.traverse=this.getTraverse())},getGetBBox:function(){function t(t,e){return this.getSubBBox(t,e).multRight(this.matrix)}return function(){return t}}(),getGetGroupBBox:function(){return t.prototype.getBBox},getTraverse:function(){function e(e,i){const n=i.getModelViewMatrix();n.push(),n.multLeft(this.matrix),t.prototype.traverse.call(this,e,i),n.pop()}return function(){return e}}(),getGroupTraverse:function(){return t.prototype.traverse}}),s}),define("x_ite/Components/Grouping/X3DTransformNode",["x_ite/Components/Grouping/X3DTransformMatrix3DNode","x_ite/Bits/X3DConstants"],function(t,e){"use strict";function i(i){t.call(this,i),this.addType(e.X3DTransformNode),this.translation_.setUnit("length"),this.center_.setUnit("length")}return i.prototype=Object.assign(Object.create(t.prototype),{constructor:i,initialize:function(){t.prototype.initialize.call(this),this.addInterest("eventsProcessed",this),this.eventsProcessed()},eventsProcessed:function(){this.setHidden(0===this.scale_.x||0===this.scale_.y||0===this.scale_.z),this.setTransform(this.translation_.getValue(),this.rotation_.getValue(),this.scale_.getValue(),this.scaleOrientation_.getValue(),this.center_.getValue())}}),i}),define("x_ite/Components/Grouping/Transform",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Grouping/X3DTransformNode","x_ite/Bits/X3DConstants"],function(t,e,i,n,r){"use strict";function s(t){n.call(this,t),this.addType(r.Transform)}return s.prototype=Object.assign(Object.create(n.prototype),{constructor:s,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"translation",new t.SFVec3f),new e(r.inputOutput,"rotation",new t.SFRotation),new e(r.inputOutput,"scale",new t.SFVec3f(1,1,1)),new e(r.inputOutput,"scaleOrientation",new t.SFRotation),new e(r.inputOutput,"center",new t.SFVec3f),new e(r.inputOutput,"visible",new t.SFBool(!0)),new e(r.inputOutput,"bboxDisplay",new t.SFBool),new e(r.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new e(r.initializeOnly,"bboxCenter",new t.SFVec3f),new e(r.inputOnly,"addChildren",new t.MFNode),new e(r.inputOnly,"removeChildren",new t.MFNode),new e(r.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"Transform"},getComponentName:function(){return"Grouping"},getContainerField:function(){return"children"}}),s}),define("x_ite/Components/Grouping",["x_ite/Configuration/SupportedNodes","x_ite/Components/Grouping/Group","x_ite/Components/Grouping/StaticGroup","x_ite/Components/Grouping/Switch","x_ite/Components/Grouping/Transform","x_ite/Components/Grouping/X3DBoundedObject","x_ite/Components/Grouping/X3DGroupingNode","x_ite/Components/Grouping/X3DTransformMatrix3DNode","x_ite/Components/Grouping/X3DTransformNode"],function(t,e,i,n,r,s,o,a,u){"use strict";const l={Group:e,StaticGroup:i,Switch:n,Transform:r},c={X3DBoundedObject:s,X3DGroupingNode:o,X3DTransformMatrix3DNode:a,X3DTransformNode:u};for(const e in l)t.addType(e,l[e]);for(const e in c)t.addAbstractType(e,c[e])}),define("x_ite/Components/Interpolation/ColorInterpolator",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Interpolation/X3DInterpolatorNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Color3"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.ColorInterpolator),this.hsv=[]}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOnly,"set_fraction",new t.SFFloat),new e(r.inputOutput,"key",new t.MFFloat),new e(r.inputOutput,"keyValue",new t.MFColor),new e(r.outputOnly,"value_changed",new t.SFColor)]),getTypeName:function(){return"ColorInterpolator"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.keyValue_.addInterest("set_keyValue__",this)},set_keyValue__:function(){var e=this.keyValue_;e.length<this.key_.length&&this.keyValue_.resize(this.key_.length,e.length?e[this.keyValue_.length-1]:new t.SFColor),this.hsv.length=0;for(var i=0,n=e.length;i<n;++i)this.hsv.push(e[i].getHSV([]))},interpolate:function(){var t=[];return function(e,i,n){s.lerp(this.hsv[e],this.hsv[i],n,t),this.value_changed_.setHSV(t[0],t[1],t[2])}}()}),o}),define("x_ite/Components/Interpolation/CoordinateInterpolator",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Interpolation/X3DInterpolatorNode","x_ite/Bits/X3DConstants","standard/Math/Algorithm"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.CoordinateInterpolator)}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOnly,"set_fraction",new t.SFFloat),new e(r.inputOutput,"key",new t.MFFloat),new e(r.inputOutput,"keyValue",new t.MFVec3f),new e(r.outputOnly,"value_changed",new t.MFVec3f)]),getTypeName:function(){return"CoordinateInterpolator"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},set_keyValue__:function(){},interpolate:function(t,e,i){var n=this.keyValue_.getValue(),r=this.key_.length?Math.floor(this.keyValue_.length/this.key_.length):0;this.value_changed_.length=r;var o=this.value_changed_.getValue();t*=r,e=t+(this.key_.length>1?r:0),t*=3,e*=3,r*=3;for(var a=0;a<r;a+=3){var u=a+1,l=a+2;o[a]=s.lerp(n[t+a],n[e+a],i),o[u]=s.lerp(n[t+u],n[e+u],i),o[l]=s.lerp(n[t+l],n[e+l],i)}this.value_changed_.addEvent()}}),o}),define("x_ite/Components/Interpolation/CoordinateInterpolator2D",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Interpolation/X3DInterpolatorNode","x_ite/Bits/X3DConstants","standard/Math/Algorithm"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.CoordinateInterpolator2D)}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOnly,"set_fraction",new t.SFFloat),new e(r.inputOutput,"key",new t.MFFloat),new e(r.inputOutput,"keyValue",new t.MFVec2f),new e(r.outputOnly,"value_changed",new t.MFVec2f)]),getTypeName:function(){return"CoordinateInterpolator2D"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},set_keyValue__:function(){},interpolate:function(t,e,i){var n=this.keyValue_.getValue(),r=this.key_.length?Math.floor(this.keyValue_.length/this.key_.length):0;this.value_changed_.length=r;var o=this.value_changed_.getValue();t*=r,e=t+(this.key_.length>1?r:0),t*=2,e*=2,r*=2;for(var a=0;a<r;a+=2){var u=a+1;o[a]=s.lerp(n[t+a],n[e+a],i),o[u]=s.lerp(n[t+u],n[e+u],i)}this.value_changed_.addEvent()}}),o}),define("x_ite/Components/Interpolation/NormalInterpolator",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Interpolation/X3DInterpolatorNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector3","standard/Math/Algorithm"],function(t,e,i,n,r,s,o){"use strict";function a(t){n.call(this,t),this.addType(r.NormalInterpolator)}var u=new s(0,0,0),l=new s(0,0,0);return a.prototype=Object.assign(Object.create(n.prototype),{constructor:a,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOnly,"set_fraction",new t.SFFloat),new e(r.inputOutput,"key",new t.MFFloat),new e(r.inputOutput,"keyValue",new t.MFVec3f),new e(r.outputOnly,"value_changed",new t.MFVec3f)]),getTypeName:function(){return"NormalInterpolator"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.keyValue_.addInterest("set_keyValue__",this)},set_keyValue__:function(){},interpolate:function(t,e,i){var n=this.keyValue_.getValue(),r=this.key_.length>1?Math.floor(this.keyValue_.length/this.key_.length):0;this.value_changed_.length=r;var s=this.value_changed_.getValue();t*=r,e=t+r,t*=3,e*=3,r*=3;for(var a=0;a<r;a+=3)try{var c=a+1,h=a+2;u.set(n[t+a],n[t+c],n[t+h]),l.set(n[e+a],n[e+c],n[e+h]);var d=o.simpleSlerp(u,l,i);s[a]=d[0],s[c]=d[1],s[h]=d[2]}catch(t){}this.value_changed_.addEvent()}}),a}),define("x_ite/Components/Interpolation/PositionInterpolator2D",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Interpolation/X3DInterpolatorNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector2"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.PositionInterpolator2D)}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOnly,"set_fraction",new t.SFFloat),new e(r.inputOutput,"key",new t.MFFloat),new e(r.inputOutput,"keyValue",new t.MFVec2f),new e(r.outputOnly,"value_changed",new t.SFVec2f)]),getTypeName:function(){return"PositionInterpolator2D"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.keyValue_.addInterest("set_keyValue__",this)},set_keyValue__:function(){var e=this.key_,i=this.keyValue_;i.length<e.length&&i.resize(e.length,i.length?i[i.length-1]:new t.SFVec2f)},interpolate:function(){var t=new s(0,0);return function(e,i,n){this.value_changed_=t.assign(this.keyValue_[e].getValue()).lerp(this.keyValue_[i].getValue(),n)}}()}),o}),define("x_ite/Browser/Interpolation/CatmullRomSplineInterpolator",["standard/Math/Numbers/Vector4","standard/Math/Numbers/Matrix4"],function(t,e){"use strict";function i(){this.T0=[],this.T1=[]}var n=[],r=[],s=[],o=new t(0,0,0,0),a=new e(2,-2,1,1,-3,3,-2,-1,0,0,1,0,1,0,0,0);return i.prototype={constructor:i,generate:function(t,e,i,o,a){var u=this.T0,l=this.T1;if(u.length=0,l.length=0,n.length=0,r.length=0,s.length=0,e.length>1){if(0===o.length){t?n.push(this.divide(this.subtract(i[1],i[i.length-2]),2)):n.push(this.create());for(var c=1,h=i.length-1;c<h;++c)n.push(this.divide(this.subtract(i[c+1],i[c-1]),2));n.push(this.copy(n[0]))}else{for(var c=0,h=o.length;c<h;++c)n.push(this.copy(o[c]));if(a){for(var d=0,c=0,h=i.length-1;c<h;++c)d+=this.abs(this.subtract(i[c],i[c+1]));for(var c=0,h=n.length-1;c<h;++c){var p=this.abs(n[c]);p&&(n[c]=this.multiply(n[c],d/p))}}}if(t){var f=e.length-1,g=e.length-2,m=e[1]-e[0]+e[f]-e[g];s.push(2*(e[1]-e[0])/m),r.push(2*(e[f]-e[g])/m)}else s.push(1),r.push(1);for(var c=1,h=e.length-1;c<h;++c){var m=e[c+1]-e[c-1];s.push(2*(e[c+1]-e[c])/m),r.push(2*(e[c]-e[c-1])/m)}s.push(s[0]),r.push(r[0]);for(var c=0,h=n.length;c<h;++c)u.push(this.multiply(n[c],r[c])),l.push(this.multiply(n[c],s[c]))}else u.push(this.create()),l.push(this.create())},interpolate:function(t,e,i,n){return o.set(Math.pow(i,3),Math.pow(i,2),i,1),this.dot(a.multVecMatrix(o),n[t],n[e],this.T0[t],this.T1[e])}},i}),define("x_ite/Browser/Interpolation/CatmullRomSplineInterpolatorTemplate",["x_ite/Browser/Interpolation/CatmullRomSplineInterpolator"],function(t){"use strict";return function(e){function i(){this.T0=[],this.T1=[]}var n=new e(0,0,0,0),r=new e(0,0,0,0),s=new e(0,0,0,0),o=new e(0,0,0,0);return i.prototype=Object.assign(Object.create(t.prototype),{constructor:i,create:function(){return new e(0,0,0,0)},copy:function(t){return t.copy()},subtract:function(t,i){return e.subtract(t,i)},multiply:function(t,i){return e.multiply(t,i)},divide:function(t,i){return e.divide(t,i)},abs:function(t){return t.abs()},dot:function(t,e,i,a,u){return n.assign(e).multiply(t[0]),r.assign(i).multiply(t[1]),s.assign(a).multiply(t[2]),o.assign(u).multiply(t[3]),n.add(r).add(s).add(o)}}),i}}),define("x_ite/Browser/Interpolation/CatmullRomSplineInterpolator3",["x_ite/Browser/Interpolation/CatmullRomSplineInterpolatorTemplate","standard/Math/Numbers/Vector3"],function(t,e){"use strict";return t(e)}),define("x_ite/Components/Interpolation/SplinePositionInterpolator",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Interpolation/X3DInterpolatorNode","x_ite/Browser/Interpolation/CatmullRomSplineInterpolator3","x_ite/Bits/X3DConstants"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(s.SplinePositionInterpolator),this.spline=new r}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOnly,"set_fraction",new t.SFFloat),new e(s.inputOutput,"closed",new t.SFBool),new e(s.inputOutput,"key",new t.MFFloat),new e(s.inputOutput,"keyValue",new t.MFVec3f),new e(s.inputOutput,"keyVelocity",new t.MFVec3f),new e(s.inputOutput,"normalizeVelocity",new t.SFBool),new e(s.outputOnly,"value_changed",new t.SFVec3f)]),getTypeName:function(){return"SplinePositionInterpolator"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.keyValue_.addInterest("set_keyValue__",this),this.keyVelocity_.addInterest("set_keyVelocity__",this),this.normalizeVelocity_.addInterest("set_normalizeVelocity__",this)},set_keyValue__:function(){var e=this.key_,i=this.keyValue_;i.length<e.length&&i.resize(e.length,i.length?i[i.length-1]:new t.SFVec3f),this.set_keyVelocity__()},set_keyVelocity__:function(){this.keyVelocity_.length&&this.keyVelocity_.length<this.key_.length&&this.keyVelocity_.resize(this.key_.length,new t.SFVec3f),this.set_normalizeVelocity__()},set_normalizeVelocity__:function(){
|
|
38
|
+
this.spline.generate(this.closed_.getValue(),this.key_,this.keyValue_,this.keyVelocity_,this.normalizeVelocity_.getValue())},interpolate:function(t,e,i){this.value_changed_=this.spline.interpolate(t,e,i,this.keyValue_)}}),o}),define("x_ite/Browser/Interpolation/CatmullRomSplineInterpolator2",["x_ite/Browser/Interpolation/CatmullRomSplineInterpolatorTemplate","standard/Math/Numbers/Vector2"],function(t,e){"use strict";return t(e)}),define("x_ite/Components/Interpolation/SplinePositionInterpolator2D",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Interpolation/X3DInterpolatorNode","x_ite/Browser/Interpolation/CatmullRomSplineInterpolator2","x_ite/Bits/X3DConstants"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(s.SplinePositionInterpolator2D),this.spline=new r}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOnly,"set_fraction",new t.SFFloat),new e(s.inputOutput,"closed",new t.SFBool),new e(s.inputOutput,"key",new t.MFFloat),new e(s.inputOutput,"keyValue",new t.MFVec2f),new e(s.inputOutput,"keyVelocity",new t.MFVec2f),new e(s.inputOutput,"normalizeVelocity",new t.SFBool),new e(s.outputOnly,"value_changed",new t.SFVec2f)]),getTypeName:function(){return"SplinePositionInterpolator2D"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.keyValue_.addInterest("set_keyValue__",this),this.keyVelocity_.addInterest("set_keyVelocity__",this),this.normalizeVelocity_.addInterest("set_normalizeVelocity__",this)},set_keyValue__:function(){var e=this.key_,i=this.keyValue_;i.length<e.length&&i.resize(e.length,i.length?i[i.length-1]:new t.SFVec2f),this.set_keyVelocity__()},set_keyVelocity__:function(){this.keyVelocity_.length&&this.keyVelocity_.length<this.key_.length&&this.keyVelocity_.resize(this.key_.length,new t.SFVec2f),this.set_normalizeVelocity__()},set_normalizeVelocity__:function(){this.spline.generate(this.closed_.getValue(),this.key_,this.keyValue_,this.keyVelocity_,this.normalizeVelocity_.getValue())},interpolate:function(t,e,i){this.value_changed_=this.spline.interpolate(t,e,i,this.keyValue_)}}),o}),define("x_ite/Browser/Interpolation/CatmullRomSplineInterpolator1",["x_ite/Browser/Interpolation/CatmullRomSplineInterpolator"],function(t){"use strict";function e(){this.T0=[],this.T1=[]}return e.prototype=Object.assign(Object.create(t.prototype),{constructor:e,create:function(){return 0},copy:function(t){return t},subtract:function(t,e){return t-e},multiply:function(t,e){return t*e},divide:function(t,e){return t/e},abs:function(t){return Math.abs(t)},dot:function(t,e,i,n,r){return e*t[0]+i*t[1]+n*t[2]+r*t[3]}}),e}),define("x_ite/Components/Interpolation/SplineScalarInterpolator",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Interpolation/X3DInterpolatorNode","x_ite/Browser/Interpolation/CatmullRomSplineInterpolator1","x_ite/Bits/X3DConstants"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(s.SplineScalarInterpolator),this.spline=new r}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOnly,"set_fraction",new t.SFFloat),new e(s.inputOutput,"closed",new t.SFBool),new e(s.inputOutput,"key",new t.MFFloat),new e(s.inputOutput,"keyValue",new t.MFFloat),new e(s.inputOutput,"keyVelocity",new t.MFFloat),new e(s.inputOutput,"normalizeVelocity",new t.SFBool),new e(s.outputOnly,"value_changed",new t.SFFloat)]),getTypeName:function(){return"SplineScalarInterpolator"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.keyValue_.addInterest("set_keyValue__",this),this.keyVelocity_.addInterest("set_keyVelocity__",this),this.normalizeVelocity_.addInterest("set_normalizeVelocity__",this)},set_keyValue__:function(){var e=this.key_,i=this.keyValue_;i.length<e.length&&i.resize(e.length,i.length?i[i.length-1]:new t.SFFloat),this.set_keyVelocity__()},set_keyVelocity__:function(){this.keyVelocity_.length&&this.keyVelocity_.length<this.key_.length&&this.keyVelocity_.resize(this.key_.length,new t.SFFloat),this.set_normalizeVelocity__()},set_normalizeVelocity__:function(){this.spline.generate(this.closed_.getValue(),this.key_,this.keyValue_,this.keyVelocity_,this.normalizeVelocity_.getValue())},interpolate:function(t,e,i){this.value_changed_=this.spline.interpolate(t,e,i,this.keyValue_)}}),o}),define("x_ite/Browser/Interpolation/SquatInterpolator",["standard/Math/Numbers/Rotation4"],function(t){"use strict";function e(){this.s=[]}var i=new t(0,0,1,0);return e.prototype={constructor:e,generate:function(e,i,n){var r=this.s;if(r.length=0,i.length>1){e?r.push(t.spline(n[i.length-2].getValue(),n[0].getValue(),n[1].getValue())):r.push(n[0].getValue());for(var s=1,o=i.length-1;s<o;++s)r.push(t.spline(n[s-1].getValue(),n[s].getValue(),n[s+1].getValue()));e?r.push(t.spline(n[i.length-2].getValue(),n[i.length-1].getValue(),n[1].getValue())):r.push(n[i.length-1].getValue())}else i.length>0&&r.push(n[0].getValue().copy())},interpolate:function(t,e,n,r){return i.assign(r[t].getValue()).squad(this.s[t],this.s[e],r[e].getValue(),n)}},e}),define("x_ite/Components/Interpolation/SquadOrientationInterpolator",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Interpolation/X3DInterpolatorNode","x_ite/Browser/Interpolation/SquatInterpolator","x_ite/Bits/X3DConstants"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(s.SquadOrientationInterpolator),this.keyValue_.setUnit("angle"),this.value_changed_.setUnit("angle"),this.squad=new r}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOnly,"set_fraction",new t.SFFloat),new e(s.inputOutput,"closed",new t.SFBool),new e(s.inputOutput,"key",new t.MFFloat),new e(s.inputOutput,"keyValue",new t.MFRotation),new e(s.outputOnly,"value_changed",new t.SFRotation)]),getTypeName:function(){return"SquadOrientationInterpolator"},getComponentName:function(){return"Interpolation"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.keyValue_.addInterest("set_keyValue__",this)},set_keyValue__:function(){var e=this.key_,i=this.keyValue_;i.length<e.length&&i.resize(e.length,i.length?i[i.length-1]:new t.SFRotation),this.squad.generate(this.closed_.getValue(),this.key_,this.keyValue_)},interpolate:function(t,e,i){try{this.value_changed_=this.squad.interpolate(t,e,i,this.keyValue_)}catch(t){console.log(t)}}}),o}),define("x_ite/Components/Interpolation",["x_ite/Configuration/SupportedNodes","x_ite/Components/Interpolation/ColorInterpolator","x_ite/Components/Interpolation/CoordinateInterpolator","x_ite/Components/Interpolation/CoordinateInterpolator2D","x_ite/Components/Interpolation/EaseInEaseOut","x_ite/Components/Interpolation/NormalInterpolator","x_ite/Components/Interpolation/OrientationInterpolator","x_ite/Components/Interpolation/PositionInterpolator","x_ite/Components/Interpolation/PositionInterpolator2D","x_ite/Components/Interpolation/ScalarInterpolator","x_ite/Components/Interpolation/SplinePositionInterpolator","x_ite/Components/Interpolation/SplinePositionInterpolator2D","x_ite/Components/Interpolation/SplineScalarInterpolator","x_ite/Components/Interpolation/SquadOrientationInterpolator","x_ite/Components/Interpolation/X3DInterpolatorNode"],function(t,e,i,n,r,s,o,a,u,l,c,h,d,p,f){"use strict";const g={ColorInterpolator:e,CoordinateInterpolator:i,CoordinateInterpolator2D:n,EaseInEaseOut:r,NormalInterpolator:s,OrientationInterpolator:o,PositionInterpolator:a,PositionInterpolator2D:u,ScalarInterpolator:l,SplinePositionInterpolator:c,SplinePositionInterpolator2D:h,SplineScalarInterpolator:d,SquadOrientationInterpolator:p},m={X3DInterpolatorNode:f};for(const e in g)t.addType(e,g[e]);for(const e in m)t.addAbstractType(e,m[e])}),define("x_ite/Components/Layering",["x_ite/Configuration/SupportedNodes","x_ite/Components/Layering/Layer","x_ite/Components/Layering/LayerSet","x_ite/Components/Layering/Viewport","x_ite/Components/Layering/X3DLayerNode","x_ite/Components/Layering/X3DViewportNode"],function(t,e,i,n,r,s){"use strict";const o={Layer:e,LayerSet:i,Viewport:n},a={X3DLayerNode:r,X3DViewportNode:s};for(const e in o)t.addType(e,o[e]);for(const e in a)t.addAbstractType(e,a[e])}),define("x_ite/Components/Lighting/PointLight",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Lighting/X3DLightNode","x_ite/Components/Grouping/X3DGroupingNode","x_ite/Bits/TraverseType","x_ite/Bits/X3DConstants","standard/Math/Geometry/Camera","standard/Math/Geometry/ViewVolume","standard/Math/Numbers/Vector3","standard/Math/Numbers/Vector4","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix3","standard/Math/Numbers/Matrix4","standard/Math/Utility/MatrixStack","standard/Math/Algorithm","standard/Utility/ObjectCache"],function(t,e,i,n,r,s,o,a,u,l,c,h,d,p,f,g,m){"use strict";function _(){this.location=new l(0,0,0),this.matrixArray=new Float32Array(9),this.shadowBuffer=null,this.viewVolume=new u,this.viewport=new c(0,0,0,0),this.projectionMatrix=new p,this.modelViewMatrix=new f(p),this.modelMatrix=new p,this.invLightSpaceMatrix=new p,this.invLightSpaceProjectionMatrix=new p,this.shadowMatrix=new p,this.shadowMatrixArray=new Float32Array(16),this.rotation=new h,this.rotationMatrix=new p,this.textureUnit=0}function x(t){n.call(this,t),this.addType(o.PointLight),this.location_.setUnit("length"),this.radius_.setUnit("length")}var y=[(new p).setRotation(new h(new l(1,0,0),l.zAxis)),(new p).setRotation(new h(new l(-1,0,0),l.zAxis)),(new p).setRotation(new h(new l(0,0,-1),l.zAxis)),(new p).setRotation(new h(new l(0,0,1),l.zAxis)),(new p).setRotation(new h(new l(0,1,0),l.zAxis)),(new p).setRotation(new h(new l(0,-1,0),l.zAxis))],v=[new c(0,.5,.25,.5),new c(.5,.5,.25,.5),new c(.75,.5,.25,.5),new c(.25,.5,.25,.5),new c(0,0,.5,.5),new c(.5,0,.5,.5)],w=m(_);return _.prototype={constructor:_,getModelViewMatrix:function(){return this.modelViewMatrix},set:function(t,e,i,n){var r=t.getContext(),s=e.getShadowMapSize();this.browser=t,this.lightNode=e,this.groupNode=i;try{this.matrixArray.set(n.submatrix.inverse())}catch(t){this.matrixArray.set(d.Identity)}this.modelViewMatrix.pushMatrix(n),e.getShadowIntensity()>0&&s>0&&(this.shadowBuffer=t.popShadowBuffer(s),this.shadowBuffer?t.getCombinedTextureUnits().length?(this.textureUnit=t.getCombinedTextureUnits().pop(),r.activeTexture(r.TEXTURE0+this.textureUnit),r.getVersion()>=2||t.getExtension("WEBGL_depth_texture")?r.bindTexture(r.TEXTURE_2D,this.shadowBuffer.getDepthTexture()):r.bindTexture(r.TEXTURE_2D,this.shadowBuffer.getColorTexture()),r.activeTexture(r.TEXTURE0)):console.warn("Not enough combined texture units for shadow map available."):console.warn("Couldn't create shadow buffer."))},renderShadowMap:function(t){try{if(!this.shadowBuffer)return;var e=this.lightNode,i=t.getCameraSpaceMatrix().get(),n=this.modelMatrix.assign(this.modelViewMatrix.get()).multRight(i),o=this.invLightSpaceMatrix.assign(e.getGlobal()?n:p.Identity);o.translate(e.getLocation()),o.inverse();var u=e.getShadowMapSize();this.shadowBuffer.bind();for(var l=0;l<6;++l){var c=v[l],h=this.viewport.set(c[0]*u,c[1]*u,c[2]*u,c[3]*u),d=a.perspective2(g.radians(90),.125,1e4,h[2],h[3],this.projectionMatrix);t.getViewVolumes().push(this.viewVolume.set(d,h,h)),t.getProjectionMatrix().pushMatrix(this.projectionMatrix),t.getModelViewMatrix().pushMatrix(y[l]),t.getModelViewMatrix().multLeft(o),t.render(s.SHADOW,r.prototype.traverse,this.groupNode),t.getModelViewMatrix().pop(),t.getProjectionMatrix().pop(),t.getViewVolumes().pop()}this.shadowBuffer.unbind(),e.getGlobal()||o.multLeft(n.inverse()),this.invLightSpaceProjectionMatrix.assign(o)}catch(t){console.log(t)}},setGlobalVariables:function(t){this.modelViewMatrix.get().multVecMatrix(this.location.assign(this.lightNode.location_.getValue())),this.shadowMatrix.assign(t.getCameraSpaceMatrix().get()).multRight(this.invLightSpaceProjectionMatrix),this.shadowMatrixArray.set(this.shadowMatrix)},setShaderUniforms:function(t,e){var i=e.numLights++;if(!e.hasLight(i,this)){var n=this.lightNode,r=n.getColor(),s=n.getAttenuation(),o=this.location;if(t.uniform1i(e.x3d_LightType[i],2),t.uniform3f(e.x3d_LightColor[i],r.r,r.g,r.b),t.uniform1f(e.x3d_LightIntensity[i],n.getIntensity()),t.uniform1f(e.x3d_LightAmbientIntensity[i],n.getAmbientIntensity()),t.uniform3f(e.x3d_LightAttenuation[i],Math.max(0,s.x),Math.max(0,s.y),Math.max(0,s.z)),t.uniform3f(e.x3d_LightLocation[i],o.x,o.y,o.z),t.uniform1f(e.x3d_LightRadius[i],n.getRadius()),t.uniformMatrix3fv(e.x3d_LightMatrix[i],!1,this.matrixArray),this.textureUnit){var a=n.getShadowColor();t.uniform3f(e.x3d_ShadowColor[i],a.r,a.g,a.b),t.uniform1f(e.x3d_ShadowIntensity[i],n.getShadowIntensity()),t.uniform1f(e.x3d_ShadowBias[i],n.getShadowBias()),t.uniformMatrix4fv(e.x3d_ShadowMatrix[i],!1,this.shadowMatrixArray),t.uniform1i(e.x3d_ShadowMapSize[i],n.getShadowMapSize()),t.uniform1i(e.x3d_ShadowMap[i],this.textureUnit)}else t.uniform1f(e.x3d_ShadowIntensity[i],0)}},dispose:function(){this.textureUnit&&this.browser.getCombinedTextureUnits().push(this.textureUnit),this.browser.pushShadowBuffer(this.shadowBuffer),this.modelViewMatrix.clear(),this.browser=null,this.lightNode=null,this.groupNode=null,this.shadowBuffer=null,this.textureUnit=0,w.push(this)}},x.prototype=Object.assign(Object.create(n.prototype),{constructor:x,fieldDefinitions:new i([new e(o.inputOutput,"metadata",new t.SFNode),new e(o.inputOutput,"global",new t.SFBool(!0)),new e(o.inputOutput,"on",new t.SFBool(!0)),new e(o.inputOutput,"color",new t.SFColor(1,1,1)),new e(o.inputOutput,"intensity",new t.SFFloat(1)),new e(o.inputOutput,"ambientIntensity",new t.SFFloat),new e(o.inputOutput,"attenuation",new t.SFVec3f(1,0,0)),new e(o.inputOutput,"location",new t.SFVec3f),new e(o.inputOutput,"radius",new t.SFFloat(100)),new e(o.inputOutput,"shadows",new t.SFBool),new e(o.inputOutput,"shadowColor",new t.SFColor),new e(o.inputOutput,"shadowIntensity",new t.SFFloat(1)),new e(o.inputOutput,"shadowBias",new t.SFFloat(.005)),new e(o.initializeOnly,"shadowMapSize",new t.SFInt32(1024))]),getTypeName:function(){return"PointLight"},getComponentName:function(){return"Lighting"},getContainerField:function(){return"children"},getAttenuation:function(){return this.attenuation_.getValue()},getLocation:function(){return this.location_.getValue()},getRadius:function(){return Math.max(0,this.radius_.getValue())},getLights:function(){return w}}),x}),define("x_ite/Components/Lighting/SpotLight",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Lighting/X3DLightNode","x_ite/Components/Grouping/X3DGroupingNode","x_ite/Bits/TraverseType","x_ite/Bits/X3DConstants","standard/Math/Geometry/Box3","standard/Math/Geometry/Camera","standard/Math/Geometry/ViewVolume","standard/Math/Numbers/Vector3","standard/Math/Numbers/Vector4","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix3","standard/Math/Numbers/Matrix4","standard/Math/Utility/MatrixStack","standard/Math/Algorithm","standard/Utility/ObjectCache"],function(t,e,i,n,r,s,o,a,u,l,c,h,d,p,f,g,m,_){"use strict";function x(){this.location=new c(0,0,0),this.direction=new c(0,0,0),this.matrixArray=new Float32Array(9),this.renderShadow=!0,this.shadowBuffer=null,this.bbox=new a,this.viewVolume=new l,this.viewport=new h(0,0,0,0),this.projectionMatrix=new f,this.modelViewMatrix=new g(f),this.modelMatrix=new f,this.invLightSpaceMatrix=new f,this.invLightSpaceProjectionMatrix=new f,this.shadowMatrix=new f,this.shadowMatrixArray=new Float32Array(16),this.rotation=new d,this.lightBBoxMin=new c(0,0,0),this.lightBBoxMax=new c(0,0,0),this.textureUnit=0}function y(t){n.call(this,t),this.addType(o.SpotLight),this.location_.setUnit("length"),this.radius_.setUnit("length"),this.beamWidth_.setUnit("angle"),this.cutOffAngle_.setUnit("angle")}var v=_(x);return x.prototype={constructor:x,getModelViewMatrix:function(){return this.modelViewMatrix},set:function(t,e,i,n){var r=t.getContext(),s=e.getShadowMapSize();this.browser=t,this.lightNode=e,this.groupNode=i;try{this.matrixArray.set(n.submatrix.inverse())}catch(t){this.matrixArray.set(p.Identity)}this.modelViewMatrix.pushMatrix(n),e.getShadowIntensity()>0&&s>0&&(this.shadowBuffer=t.popShadowBuffer(s),this.shadowBuffer?t.getCombinedTextureUnits().length?(this.textureUnit=t.getCombinedTextureUnits().pop(),r.activeTexture(r.TEXTURE0+this.textureUnit),r.getVersion()>=2||t.getExtension("WEBGL_depth_texture")?r.bindTexture(r.TEXTURE_2D,this.shadowBuffer.getDepthTexture()):r.bindTexture(r.TEXTURE_2D,this.shadowBuffer.getColorTexture()),r.activeTexture(r.TEXTURE0)):console.warn("Not enough combined texture units for shadow map available."):console.warn("Couldn't create shadow buffer."))},renderShadowMap:function(t){try{if(!this.shadowBuffer)return;var e=this.lightNode,i=t.getCameraSpaceMatrix().get(),n=this.modelMatrix.assign(this.modelViewMatrix.get()).multRight(i),o=this.invLightSpaceMatrix.assign(e.getGlobal()?n:f.Identity);o.translate(e.getLocation()),o.rotate(this.rotation.setFromToVec(c.zAxis,this.direction.assign(e.getDirection()).negate())),o.inverse();var a=this.groupNode.getSubBBox(this.bbox,!0),l=a.multRight(o),h=(l.getExtents(this.lightBBoxMin,this.lightBBoxMax),e.getShadowMapSize()),d=Math.min(e.getRadius(),-this.lightBBoxMin.z),p=this.viewport.set(0,0,h,h),g=u.perspective(2*e.getCutOffAngle(),.125,Math.max(1e4,d),h,h,this.projectionMatrix);this.renderShadow=d>0,this.shadowBuffer.bind(),t.getViewVolumes().push(this.viewVolume.set(g,p,p)),t.getProjectionMatrix().pushMatrix(g),t.getModelViewMatrix().pushMatrix(o),t.render(s.SHADOW,r.prototype.traverse,this.groupNode),t.getModelViewMatrix().pop(),t.getProjectionMatrix().pop(),t.getViewVolumes().pop(),this.shadowBuffer.unbind(),e.getGlobal()||o.multLeft(n.inverse()),this.invLightSpaceProjectionMatrix.assign(o).multRight(g).multRight(e.getBiasMatrix())}catch(t){console.log(t)}},setGlobalVariables:function(t){var e=this.lightNode,i=this.modelViewMatrix.get();i.multVecMatrix(this.location.assign(e.location_.getValue())),i.multDirMatrix(this.direction.assign(e.direction_.getValue())).normalize(),this.shadowMatrix.assign(t.getCameraSpaceMatrix().get()).multRight(this.invLightSpaceProjectionMatrix),this.shadowMatrixArray.set(this.shadowMatrix)},setShaderUniforms:function(t,e){var i=e.numLights++;if(!e.hasLight(i,this)){var n=this.lightNode,r=n.getColor(),s=n.getAttenuation(),o=this.location,a=this.direction;if(t.uniform1i(e.x3d_LightType[i],3),t.uniform3f(e.x3d_LightColor[i],r.r,r.g,r.b),t.uniform1f(e.x3d_LightIntensity[i],n.getIntensity()),t.uniform1f(e.x3d_LightAmbientIntensity[i],n.getAmbientIntensity()),t.uniform3f(e.x3d_LightAttenuation[i],Math.max(0,s.x),Math.max(0,s.y),Math.max(0,s.z)),t.uniform3f(e.x3d_LightLocation[i],o.x,o.y,o.z),t.uniform3f(e.x3d_LightDirection[i],a.x,a.y,a.z),t.uniform1f(e.x3d_LightRadius[i],n.getRadius()),t.uniform1f(e.x3d_LightBeamWidth[i],n.getBeamWidth()),t.uniform1f(e.x3d_LightCutOffAngle[i],n.getCutOffAngle()),t.uniformMatrix3fv(e.x3d_LightMatrix[i],!1,this.matrixArray),this.renderShadow&&this.textureUnit){var u=n.getShadowColor();t.uniform3f(e.x3d_ShadowColor[i],u.r,u.g,u.b),t.uniform1f(e.x3d_ShadowIntensity[i],n.getShadowIntensity()),t.uniform1f(e.x3d_ShadowBias[i],n.getShadowBias()),t.uniformMatrix4fv(e.x3d_ShadowMatrix[i],!1,this.shadowMatrixArray),t.uniform1i(e.x3d_ShadowMapSize[i],n.getShadowMapSize()),t.uniform1i(e.x3d_ShadowMap[i],this.textureUnit)}else t.uniform1f(e.x3d_ShadowIntensity[i],0)}},dispose:function(){this.textureUnit&&this.browser.getCombinedTextureUnits().push(this.textureUnit),this.browser.pushShadowBuffer(this.shadowBuffer),this.modelViewMatrix.clear(),this.browser=null,this.lightNode=null,this.groupNode=null,this.shadowBuffer=null,this.textureUnit=0,v.push(this)}},y.prototype=Object.assign(Object.create(n.prototype),{constructor:y,fieldDefinitions:new i([new e(o.inputOutput,"metadata",new t.SFNode),new e(o.inputOutput,"global",new t.SFBool(!0)),new e(o.inputOutput,"on",new t.SFBool(!0)),new e(o.inputOutput,"color",new t.SFColor(1,1,1)),new e(o.inputOutput,"intensity",new t.SFFloat(1)),new e(o.inputOutput,"ambientIntensity",new t.SFFloat),new e(o.inputOutput,"attenuation",new t.SFVec3f(1,0,0)),new e(o.inputOutput,"location",new t.SFVec3f),new e(o.inputOutput,"direction",new t.SFVec3f(0,0,-1)),new e(o.inputOutput,"radius",new t.SFFloat(100)),new e(o.inputOutput,"beamWidth",new t.SFFloat(.785398)),new e(o.inputOutput,"cutOffAngle",new t.SFFloat(1.5708)),new e(o.inputOutput,"shadows",new t.SFBool),new e(o.inputOutput,"shadowColor",new t.SFColor),new e(o.inputOutput,"shadowIntensity",new t.SFFloat(1)),new e(o.inputOutput,"shadowBias",new t.SFFloat(.005)),new e(o.initializeOnly,"shadowMapSize",new t.SFInt32(1024))]),getTypeName:function(){return"SpotLight"},getComponentName:function(){return"Lighting"},getContainerField:function(){return"children"},getAttenuation:function(){return this.attenuation_.getValue()},getLocation:function(){return this.location_.getValue()},getRadius:function(){return Math.max(0,this.radius_.getValue())},getBeamWidth:function(){var t=this.beamWidth_.getValue(),e=this.getCutOffAngle();return t>e?e:m.clamp(t,0,Math.PI/2)},getCutOffAngle:function(){return m.clamp(this.cutOffAngle_.getValue(),0,Math.PI/2)},getLights:function(){return v}}),y}),define("x_ite/Components/Lighting",["x_ite/Configuration/SupportedNodes","x_ite/Components/Lighting/DirectionalLight","x_ite/Components/Lighting/PointLight","x_ite/Components/Lighting/SpotLight","x_ite/Components/Lighting/X3DLightNode"],function(t,e,i,n,r){"use strict";const s={DirectionalLight:e,PointLight:i,SpotLight:n},o={X3DLightNode:r};for(const e in s)t.addType(e,s[e]);for(const e in o)t.addAbstractType(e,o[e])}),define("x_ite/Components/Navigation/Billboard",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Grouping/X3DGroupingNode","x_ite/Bits/X3DConstants","x_ite/Bits/TraverseType","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4"],function(t,e,i,n,r,s,o,a,u){"use strict";function l(t){n.call(this,t),this.addType(r.Billboard),this.matrix=new u}const c=new u,h=new o(0,1,0),d=new o(0,0,1),p=new o(0,0,0),f=new o(0,0,0),g=new o(0,0,0),m=new o(0,0,0),_=new o(0,0,0),x=new a(0,0,1,0);return l.prototype=Object.assign(Object.create(n.prototype),{constructor:l,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"axisOfRotation",new t.SFVec3f(0,1,0)),new e(r.inputOutput,"visible",new t.SFBool(!0)),new e(r.inputOutput,"bboxDisplay",new t.SFBool),new e(r.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new e(r.initializeOnly,"bboxCenter",new t.SFVec3f),new e(r.inputOnly,"addChildren",new t.MFNode),new e(r.inputOnly,"removeChildren",new t.MFNode),new e(r.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"Billboard"},getComponentName:function(){return"Navigation"},getContainerField:function(){return"children"},getBBox:function(t,e){return n.prototype.getBBox.call(this,t,e).multRight(this.matrix)},getMatrix:function(){return this.matrix},rotate:function(t){c.assign(t).inverse();const e=c.origin.normalize();if(this.axisOfRotation_.getValue().equals(o.Zero)){c.multDirMatrix(p.assign(h)).normalize(),f.assign(p).cross(e),g.assign(e).cross(f);const t=e;f.normalize(),g.normalize(),this.matrix.set(f[0],f[1],f[2],0,g[0],g[1],g[2],0,t[0],t[1],t[2],0,0,0,0,1)}else m.assign(this.axisOfRotation_.getValue()).cross(e),_.assign(this.axisOfRotation_.getValue()).cross(d),this.matrix.setRotation(x.setFromToVec(_,m));return this.matrix},traverse:function(t,e){const i=e.getModelViewMatrix();i.push();try{switch(t){case s.CAMERA:case s.PICKING:case s.SHADOW:i.multLeft(this.matrix);break;default:i.multLeft(this.rotate(i.get()))}n.prototype.traverse.call(this,t,e)}catch(t){console.log(t)}i.pop()}}),l}),define("x_ite/Components/Navigation/Collision",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Grouping/X3DGroupingNode","x_ite/Components/Core/X3DSensorNode","x_ite/Bits/X3DCast","x_ite/Bits/TraverseType","x_ite/Bits/X3DConstants"],function(t,e,i,n,r,s,o,a){"use strict";function u(t){n.call(this,t),r.call(this,t),this.addType(a.Collision),"2.0"===t.getSpecificationVersion()&&this.addAlias("collide",this.enabled_)}return u.prototype=Object.assign(Object.create(n.prototype),r.prototype,{constructor:u,fieldDefinitions:new i([new e(a.inputOutput,"metadata",new t.SFNode),new e(a.inputOutput,"enabled",new t.SFBool(!0)),new e(a.outputOnly,"isActive",new t.SFBool),new e(a.outputOnly,"collideTime",new t.SFTime),new e(a.inputOutput,"visible",new t.SFBool(!0)),new e(a.inputOutput,"bboxDisplay",new t.SFBool),new e(a.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new e(a.initializeOnly,"bboxCenter",new t.SFVec3f),new e(a.initializeOnly,"proxy",new t.SFNode),new e(a.inputOnly,"addChildren",new t.MFNode),new e(a.inputOnly,"removeChildren",new t.MFNode),new e(a.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"Collision"},getComponentName:function(){return"Navigation"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.isLive().addInterest("set_live__",this),this.enabled_.addInterest("set_live__",this),this.proxy_.addInterest("set_proxy__",this),this.set_live__(),this.set_proxy__()},set_live__:function(){this.isLive().getValue()&&this.enabled_.getValue()?this.getBrowser().addCollision(this):this.getBrowser().removeCollision(this)},set_active:function(t){this.isActive_.getValue()!==t&&(this.isActive_=t,t&&(this.collideTime_=this.getBrowser().getCurrentTime()))},set_proxy__:function(){this.proxyNode=s(a.X3DChildNode,this.proxy_)},traverse:function(t,e){switch(t){case o.COLLISION:if(this.enabled_.getValue()){var i=e.getCollisions();i.push(this),this.proxyNode?this.proxyNode.traverse(t,e):n.prototype.traverse.call(this,t,e),i.pop()}return;default:return void n.prototype.traverse.call(this,t,e)}}}),u}),define("x_ite/Components/Navigation/LOD",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Grouping/X3DGroupingNode","x_ite/Bits/X3DCast","x_ite/Bits/TraverseType","x_ite/Bits/X3DConstants","standard/Math/Numbers/Matrix4","standard/Math/Algorithm"],function(t,e,i,n,r,s,o,a,u){"use strict";function l(t){n.call(this,t),this.addType(o.LOD),"2.0"===t.getSpecificationVersion()&&this.addAlias("level",this.children_),this.center_.setUnit("length"),this.range_.setUnit("length"),this.frameRate=60,this.keepCurrentLevel=!1,this.childNode=null,this.visibleNode=null,this.boundedObject=null}return l.prototype=Object.assign(Object.create(n.prototype),{constructor:l,fieldDefinitions:new i([new e(o.inputOutput,"metadata",new t.SFNode),new e(o.initializeOnly,"forceTransitions",new t.SFBool),new e(o.initializeOnly,"center",new t.SFVec3f),new e(o.initializeOnly,"range",new t.MFFloat),new e(o.outputOnly,"level_changed",new t.SFInt32(-1)),new e(o.inputOutput,"visible",new t.SFBool(!0)),new e(o.inputOutput,"bboxDisplay",new t.SFBool),new e(o.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new e(o.initializeOnly,"bboxCenter",new t.SFVec3f),new e(o.inputOnly,"addChildren",new t.MFNode),new e(o.inputOnly,"removeChildren",new t.MFNode),new e(o.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"LOD"},getComponentName:function(){return"Navigation"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.children_.addInterest("set_child__",this)},getSubBBox:function(t,e){if(this.bboxSize_.getValue().equals(this.getDefaultBBoxSize())){const i=r(o.X3DBoundedObject,this.visibleNode);return i?i.getBBox(t,e):t.set()}return t.set(this.bboxSize_.getValue(),this.bboxCenter_.getValue())},clear:function(){},add:function(){},remove:function(){},set_child__:function(){this.set_level__(Math.min(this.level_changed_.getValue(),this.children_.length-1))},set_level__:function(t){this.childNode&&(this.childNode.isCameraObject_.removeInterest("set_cameraObject__",this),this.childNode.isPickableObject_.removeInterest("set_transformSensors__",this)),r(o.X3DBoundedObject,this.childNode)&&(this.childNode.visible_.removeInterest("set_visible__",this),this.childNode.bboxDisplay_.removeInterest("set_bboxDisplay__",this)),t>=0&&t<this.children_.length?(this.childNode=r(o.X3DChildNode,this.children_[t]),this.childNode&&(this.childNode.isCameraObject_.addInterest("set_cameraObject__",this),this.childNode.isPickableObject_.addInterest("set_transformSensors__",this),r(o.X3DBoundedObject,this.childNode)&&(this.childNode.visible_.addInterest("set_visible__",this),this.childNode.bboxDisplay_.addInterest("set_bboxDisplay__",this)))):this.childNode=null,this.set_transformSensors__(),this.set_visible__(),this.set_bboxDisplay__()},set_cameraObject__:function(){this.childNode&&this.childNode.getCameraObject()?r(o.X3DBoundedObject,this.childNode)?this.setCameraObject(this.childNode.visible_.getValue()):this.setCameraObject(!0):this.setCameraObject(!1)},set_transformSensors__:function(){this.setPickableObject(Boolean(this.getTransformSensors().size||this.childNode&&this.childNode.getPickableObject()))},set_visible__:function(){r(o.X3DBoundedObject,this.childNode)?this.visibleNode=this.childNode.visible_.getValue()?this.childNode:null:this.visibleNode=this.childNode,this.set_cameraObject__()},set_bboxDisplay__:function(){r(o.X3DBoundedObject,this.childNode)?this.boundedObject=this.childNode.bboxDisplay_.getValue()?this.childNode:null:this.boundedObject=null},getLevel:function(){return function(t,e){if(0===this.range_.length){this.frameRate=(179*this.frameRate+t.currentFrameRate)/180;const e=this.children_.length;switch(e){case 0:return-1;case 1:return 0;case 2:return 1*(this.frameRate>55);default:{const t=1-u.clamp((this.frameRate-20)/35,0,1);return Math.min(Math.floor(t*e),e-1)}}}const i=e.translate(this.center_.getValue()).origin.abs();return u.upperBound(this.range_,0,this.range_.length,i,u.less)}}(),traverse:function(){const t=new a;return function(e,i){switch(e){case s.POINTER:case s.CAMERA:case s.SHADOW:{const t=this.visibleNode;return void(t&&t.traverse(e,i))}case s.PICKING:{if(this.getTransformSensors().size){const t=i.getModelViewMatrix().get();for(const e of this.getTransformSensors())e.collect(t)}const t=this.childNode;if(t){const n=i.getBrowser(),r=n.getPickingHierarchy();r.push(this),t.traverse(e,i),r.pop()}return}case s.COLLISION:{const t=this.childNode;return void(t&&t.traverse(e,i))}case s.DISPLAY:{if(!this.keepCurrentLevel){var n=this.getLevel(i.getBrowser(),t.assign(i.getModelViewMatrix().get())),r=this.level_changed_.getValue();this.forceTransitions_.getValue()&&(n>r?n=r+1:n<r&&(n=r-1)),n!==r&&(this.level_changed_=n,this.set_level__(Math.min(n,this.children_.length-1)))}const s=this.visibleNode;s&&s.traverse(e,i);const o=this.boundedObject;return void(o&&o.displayBBox(e,i))}}}}()}),l}),define("x_ite/Components/Navigation/ViewpointGroup",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Core/X3DChildNode","x_ite/Components/EnvironmentalSensor/ProximitySensor","x_ite/Bits/TraverseType","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(t,e,i,n,r,s,o,a){"use strict";function u(t){n.call(this,t),this.addType(o.ViewpointGroup),this.size_.setUnit("length"),this.center_.setUnit("length"),
|
|
39
39
|
this.proximitySensor=new r(t),this.cameraObjects=[],this.viewpointGroups=[]}function l(t,e){switch(t){case s.CAMERA:if(this.proximitySensor.traverse(t,e),this.proximitySensor.isActive_.getValue())for(var i=0,n=this.cameraObjects.length;i<n;++i)this.cameraObjects[i].traverse(t,e);return;case s.DISPLAY:if(this.proximitySensor.traverse(t,e),this.proximitySensor.isActive_.getValue())for(var i=0,n=this.viewpointGroups.length;i<n;++i)this.viewpointGroups[i].traverse(t,e);return}}function c(t,e){switch(t){case s.CAMERA:for(var i=0,n=this.cameraObjects.length;i<n;++i)this.cameraObjects[i].traverse(t,e);return;case s.DISPLAY:for(var i=0,n=this.viewpointGroups.length;i<n;++i)this.viewpointGroups[i].traverse(t,e);return}}return u.prototype=Object.assign(Object.create(n.prototype),{constructor:u,fieldDefinitions:new i([new e(o.inputOutput,"metadata",new t.SFNode),new e(o.inputOutput,"description",new t.SFString),new e(o.inputOutput,"displayed",new t.SFBool(!0)),new e(o.inputOutput,"retainUserOffsets",new t.SFBool),new e(o.inputOutput,"size",new t.SFVec3f),new e(o.inputOutput,"center",new t.SFVec3f),new e(o.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"ViewpointGroup"},getComponentName:function(){return"Navigation"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.proximitySensor.setup(),this.size_.addFieldInterest(this.proximitySensor.size_),this.center_.addFieldInterest(this.proximitySensor.center_),this.proximitySensor.size_=this.size_,this.proximitySensor.center_=this.center_,this.displayed_.addInterest("set_displayed__",this),this.size_.addInterest("set_displayed__",this),this.children_.addInterest("set_children__",this),this.set_displayed__(),this.set_children__()},isActive:function(){return this.proximitySensor.isActive_.getValue()},set_displayed__:function(){var t=!this.size_.getValue().equals(a.Zero),e=this.displayed_.getValue();this.proximitySensor.enabled_=e&&t,e&&t?(this.proximitySensor.isCameraObject_.addFieldInterest(this.isCameraObject_),this.proximitySensor.isPickableObject_.addFieldInterest(this.isPickableObject_),this.setCameraObject(this.proximitySensor.getCameraObject()),this.setPickableObject(this.proximitySensor.getPickableObject()),this.traverse=l):(this.proximitySensor.isCameraObject_.removeFieldInterest(this.isCameraObject_),this.proximitySensor.isPickableObject_.removeFieldInterest(this.isPickableObject_),this.setCameraObject(e),this.setPickableObject(!1),e?this.traverse=c:delete this.traverse)},set_children__:function(){this.cameraObjects.length=0,this.viewpointGroups.length=0;for(var t=this.children_,e=0,i=t.length;e<i;++e)try{for(var n=t[e].getValue().getInnerNode(),r=n.getType(),s=r.length-1;s>=0;--s)switch(r[s]){case o.X3DViewpointNode:this.cameraObjects.push(n);break;case o.ViewpointGroup:this.cameraObjects.push(n),this.viewpointGroups.push(n)}}catch(t){}},traverse:function(){}}),u}),define("x_ite/Components/Navigation",["x_ite/Configuration/SupportedNodes","x_ite/Components/Navigation/Billboard","x_ite/Components/Navigation/Collision","x_ite/Components/Navigation/LOD","x_ite/Components/Navigation/NavigationInfo","x_ite/Components/Navigation/OrthoViewpoint","x_ite/Components/Navigation/Viewpoint","x_ite/Components/Navigation/ViewpointGroup","x_ite/Components/Navigation/X3DViewpointNode"],function(t,e,i,n,r,s,o,a,u){"use strict";const l={Billboard:e,Collision:i,LOD:n,NavigationInfo:r,OrthoViewpoint:s,Viewpoint:o,ViewpointGroup:a},c={X3DViewpointNode:u};for(const e in l)t.addType(e,l[e]);for(const e in c)t.addAbstractType(e,c[e])}),define("x_ite/Browser/PointingDeviceSensor/PointingDeviceSensorContainer",["standard/Math/Numbers/Vector4","standard/Math/Numbers/Matrix4"],function(t,e){"use strict";function i(i,n,r,s){this.node=null,this.modelViewMatrix=new e,this.projectionMatrix=new e,this.viewport=new t(0,0,0,0),this.set(i,n,r,s)}return i.prototype={set:function(t,e,i,n){this.node=t,this.modelViewMatrix.assign(e),this.projectionMatrix.assign(i),this.viewport.assign(n)},set_over__:function(t,e){this.node.set_over__(t,e,this.modelViewMatrix,this.projectionMatrix,this.viewport)},set_active__:function(t,e){this.node.set_active__(t,e,this.modelViewMatrix,this.projectionMatrix,this.viewport)},set_motion__:function(t){this.node.set_motion__(t,this.modelViewMatrix,this.projectionMatrix,this.viewport)}},i}),define("x_ite/Components/PointingDeviceSensor/X3DPointingDeviceSensorNode",["x_ite/Components/Core/X3DSensorNode","x_ite/Browser/PointingDeviceSensor/PointingDeviceSensorContainer","x_ite/Bits/X3DConstants"],function(t,e,i){"use strict";function n(e){t.call(this,e),this.addType(i.X3DPointingDeviceSensorNode)}return n.prototype=Object.assign(Object.create(t.prototype),{constructor:n,initialize:function(){t.prototype.initialize.call(this),this.enabled_.addInterest("set_enabled__",this)},getMatrices:function(){return this.matrices},set_enabled__:function(){this.enabled_.getValue()||(this.isActive_.getValue()&&(this.isActive_=!1),this.isOver_.getValue()&&(this.isOver_=!1))},set_over__:function(t,e){t!==this.isOver_.getValue()&&(this.isOver_=t,t&&(this.getBrowser().getNotification().string_=this.description_))},set_active__:function(t,e){t!==this.isActive_.getValue()&&(this.isActive_=t)},set_motion__:function(t){},push:function(t,i){this.enabled_.getValue()&&(i[this.getId()]=new e(this,t.getModelViewMatrix().get(),t.getProjectionMatrix().get(),t.getViewVolume().getViewport()))}}),n}),define("x_ite/Components/PointingDeviceSensor/X3DTouchSensorNode",["x_ite/Components/PointingDeviceSensor/X3DPointingDeviceSensorNode","x_ite/Bits/X3DConstants"],function(t,e){"use strict";function i(i){t.call(this,i),this.addType(e.X3DTouchSensorNode)}return i.prototype=Object.assign(Object.create(t.prototype),{constructor:i,set_active__:function(e,i){t.prototype.set_active__.call(this,e,i),this.enabled_.getValue()&&this.isOver_.getValue()&&!e&&(this.touchTime_=this.getBrowser().getCurrentTime())}}),i}),define("x_ite/Components/PointingDeviceSensor/TouchSensor",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/PointingDeviceSensor/X3DTouchSensorNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Matrix4"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.TouchSensor),this.hitPoint_changed_.setUnit("length")}var a=new s;return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"enabled",new t.SFBool(!0)),new e(r.inputOutput,"description",new t.SFString),new e(r.outputOnly,"hitTexCoord_changed",new t.SFVec2f),new e(r.outputOnly,"hitNormal_changed",new t.SFVec3f),new e(r.outputOnly,"hitPoint_changed",new t.SFVec3f),new e(r.outputOnly,"isOver",new t.SFBool),new e(r.outputOnly,"isActive",new t.SFBool),new e(r.outputOnly,"touchTime",new t.SFTime)]),getTypeName:function(){return"TouchSensor"},getComponentName:function(){return"PointingDeviceSensor"},getContainerField:function(){return"children"},set_over__:function(t,e,i,r,s){try{if(n.prototype.set_over__.call(this,t,e,i,r,s),this.isOver_.getValue()){var o=e.intersection;a.assign(i).inverse(),this.hitTexCoord_changed_=o.texCoord,this.hitNormal_changed_=i.multMatrixDir(o.normal.copy()).normalize(),this.hitPoint_changed_=a.multVecMatrix(o.point.copy())}}catch(t){console.log(t)}}}),o}),define("x_ite/Components/Networking/Anchor",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Grouping/X3DGroupingNode","x_ite/Components/Networking/X3DUrlObject","x_ite/Components/PointingDeviceSensor/TouchSensor","x_ite/Bits/TraverseType","x_ite/Bits/X3DConstants","x_ite/InputOutput/FileLoader"],function(t,e,i,n,r,s,o,a,u){"use strict";function l(t){n.call(this,t),r.call(this,t),this.addType(a.Anchor),this.touchSensorNode=new s(t)}return l.prototype=Object.assign(Object.create(n.prototype),r.prototype,{constructor:l,fieldDefinitions:new i([new e(a.inputOutput,"metadata",new t.SFNode),new e(a.inputOutput,"description",new t.SFString),new e(a.inputOutput,"url",new t.MFString),new e(a.inputOutput,"parameter",new t.MFString),new e(a.inputOutput,"autoRefresh",new t.SFTime),new e(a.inputOutput,"autoRefreshTimeLimit",new t.SFTime(3600)),new e(a.inputOutput,"visible",new t.SFBool(!0)),new e(a.inputOutput,"bboxDisplay",new t.SFBool),new e(a.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new e(a.initializeOnly,"bboxCenter",new t.SFVec3f),new e(a.inputOnly,"addChildren",new t.MFNode),new e(a.inputOnly,"removeChildren",new t.MFNode),new e(a.inputOutput,"children",new t.MFNode)]),getTypeName:function(){return"Anchor"},getComponentName:function(){return"Networking"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),r.prototype.initialize.call(this),this.description_.addFieldInterest(this.touchSensorNode.description_),this.touchSensorNode.description_=this.description_,this.touchSensorNode.setup();const t=this,e=this.touchSensorNode.set_active__;this.touchSensorNode.set_active__=function(i,n){e.call(this,i,n),this.isOver_.getValue()&&!i&&t.requestImmediateLoad()}},requestImmediateLoad:function(t=!0){this.setCache(t),this.setLoadState(a.IN_PROGRESS_STATE,!1),new u(this).createX3DFromURL(this.url_,this.parameter_,function(t){t?(this.getBrowser().replaceWorld(t),this.setLoadState(a.COMPLETE_STATE,!1)):this.setLoadState(a.FAILED_STATE,!1)}.bind(this),function(t){this.getBrowser().changeViewpoint(t),this.setLoadState(a.COMPLETE_STATE,!1)}.bind(this),function(t,e){e?window.open(t,e):location=t,this.setLoadState(a.COMPLETE_STATE,!1)}.bind(this))},traverse:function(t,e){if(t===o.POINTER){const i={};e.getBrowser().getSensors().push(i),this.touchSensorNode.push(e,i),n.prototype.traverse.call(this,t,e),e.getBrowser().getSensors().pop()}else n.prototype.traverse.call(this,t,e)}}),l}),define("x_ite/Components/Networking/Inline",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Core/X3DChildNode","x_ite/Components/Networking/X3DUrlObject","x_ite/Components/Grouping/X3DBoundedObject","x_ite/Components/Grouping/Group","x_ite/Bits/TraverseType","x_ite/Bits/X3DConstants","x_ite/InputOutput/FileLoader"],function(t,e,i,n,r,s,o,a,u,l){"use strict";function c(e){n.call(this,e),r.call(this,e),s.call(this,e),this.addType(u.Inline),this.addChildObjects("buffer",new t.MFString),this.scene=this.getBrowser().getDefaultScene(),this.group=new o(e),this.group.addParent(this)}return c.prototype=Object.assign(Object.create(n.prototype),r.prototype,s.prototype,{constructor:c,fieldDefinitions:new i([new e(u.inputOutput,"metadata",new t.SFNode),new e(u.inputOutput,"load",new t.SFBool(!0)),new e(u.inputOutput,"url",new t.MFString),new e(u.inputOutput,"autoRefresh",new t.SFTime),new e(u.inputOutput,"autoRefreshTimeLimit",new t.SFTime(3600)),new e(u.inputOutput,"visible",new t.SFBool(!0)),new e(u.inputOutput,"bboxDisplay",new t.SFBool),new e(u.initializeOnly,"bboxSize",new t.SFVec3f(-1,-1,-1)),new e(u.initializeOnly,"bboxCenter",new t.SFVec3f)]),getTypeName:function(){return"Inline"},getComponentName:function(){return"Networking"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),r.prototype.initialize.call(this),s.prototype.initialize.call(this),this.group.setPrivate(!0),this.group.setup(),this.group.isCameraObject_.addFieldInterest(this.isCameraObject_),this.group.isPickableObject_.addFieldInterest(this.isPickableObject_),this.load_.addInterest("set_load__",this),this.url_.addInterest("set_url__",this),this.buffer_.addInterest("set_buffer__",this),this.set_url__()},getBBox:function(t,e){return this.group.getBBox(t,e)},set_live__:function(){r.prototype.set_live__.call(this),this.getPrivate()||this.scene.setLive(this.isLive().getValue())},set_load__:function(){this.load_.getValue()?(this.setLoadState(u.NOT_STARTED_STATE),this.requestImmediateLoad()):this.requestUnload()},set_url__:function(){this.load_.getValue()&&(this.setLoadState(u.NOT_STARTED_STATE),this.requestImmediateLoad())},requestImmediateLoad:function(t=!0){this.load_.getValue()&&this.checkLoadState()!==u.COMPLETE_STATE&&this.checkLoadState()!==u.IN_PROGRESS_STATE&&(this.setCache(t),this.setLoadState(u.IN_PROGRESS_STATE),this.buffer_=this.url_)},set_buffer__:function(){new l(this).createX3DFromURL(this.buffer_,null,this.setInternalSceneAsync.bind(this))},requestUnload:function(){this.checkLoadState()!==u.NOT_STARTED_STATE&&this.checkLoadState()!==u.FAILED_STATE&&(this.setLoadState(u.NOT_STARTED_STATE),this.setInternalScene(this.getBrowser().getDefaultScene()))},setInternalSceneAsync:function(t){t?(this.setLoadState(u.COMPLETE_STATE),this.setInternalScene(t)):(this.setLoadState(u.FAILED_STATE),this.setInternalScene(this.getBrowser().getDefaultScene()))},setInternalScene:function(t){this.scene.setLive(!1),this.scene.rootNodes.removeFieldInterest(this.group.children_),this.scene=t,this.scene.setExecutionContext(this.getExecutionContext()),this.scene.setPrivate(this.getExecutionContext().getPrivate()),this.scene.rootNodes.addFieldInterest(this.group.children_),this.group.children_=this.scene.rootNodes,this.set_live__(),this.getBrowser().addBrowserEvent()},getInternalScene:function(){return this.scene},traverse:function(t,e){switch(t){case a.PICKING:var i=e.getBrowser(),n=i.getPickingHierarchy();return n.push(this),this.group.traverse(t,e),void n.pop();default:return void this.group.traverse(t,e)}}}),c}),define("x_ite/Components/Networking",["x_ite/Configuration/SupportedNodes","x_ite/Components/Networking/Anchor","x_ite/Components/Networking/Inline","x_ite/Components/Networking/LoadSensor","x_ite/Components/Networking/X3DNetworkSensorNode","x_ite/Components/Networking/X3DUrlObject"],function(t,e,i,n,r,s){"use strict";const o={Anchor:e,Inline:i,LoadSensor:n},a={X3DNetworkSensorNode:r,X3DUrlObject:s};for(const e in o)t.addType(e,o[e]);for(const e in a)t.addAbstractType(e,a[e])}),define("x_ite/Components/PointingDeviceSensor/X3DDragSensorNode",["x_ite/Components/PointingDeviceSensor/X3DPointingDeviceSensorNode","x_ite/Bits/X3DConstants"],function(t,e){"use strict";function i(i){t.call(this,i),this.addType(e.X3DDragSensorNode),this.trackPoint_changed_.setUnit("length")}return i.prototype=Object.assign(Object.create(t.prototype),{constructor:i}),i}),define("standard/Math/Geometry/Cylinder3",["standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4","standard/Math/Geometry/Line3"],function(t,e,i,n){"use strict";function r(t,e){this.axis=t.copy(),this.radius=e}return r.prototype={constructor:r,intersectsLine:function(r,s,o){const a=new e(this.axis.direction,new t(0,1,0)),u=i.Rotation(a),l=1/this.radius,c=new i;c.scale(new t(l,l,l)),c.multLeft(u);const h=t.subtract(r.point,this.axis.point),d=new n(h,r.direction),p=d.multLineMatrix(c),f=this.unitCylinderIntersectsLine(p,s,o);if(f){const t=c.inverse();t.multVecMatrix(s),s.add(this.axis.point),t.multVecMatrix(o),o.add(this.axis.point)}return f},unitCylinderIntersectsLine:function(t,e,i){let n,r;const s=t.point,o=t.direction,a=o[0]*o[0]+o[2]*o[2],u=2*(s[0]*o[0]+s[2]*o[2]),l=s[0]*s[0]+s[2]*s[2]-1,c=u*u-4*a*l;if(c<0)return!1;const h=Math.sqrt(c);return u>0?(n=-(2*l)/(h+u),r=-(h+u)/(2*a)):(n=2*l/(h-u),r=(h-u)/(2*a)),e.assign(o).multiply(n).add(s),i.assign(o).multiply(r).add(s),!0},toString:function(){return this.axis.toString()+" "+this.radius}},r}),define("x_ite/Components/PointingDeviceSensor/CylinderSensor",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/PointingDeviceSensor/X3DDragSensorNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4","standard/Math/Geometry/Line3","standard/Math/Geometry/Plane3","standard/Math/Geometry/Cylinder3","standard/Math/Algorithm"],function(t,e,i,n,r,s,o,a,u,l,c,h){"use strict";function d(t){n.call(this,t),this.addType(r.CylinderSensor),this.diskAngle_.setUnit("angle"),this.minAngle_.setUnit("angle"),this.maxAngle_.setUnit("angle"),this.offset_.setUnit("angle")}return d.prototype=Object.assign(Object.create(n.prototype),{constructor:d,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"enabled",new t.SFBool(!0)),new e(r.inputOutput,"description",new t.SFString),new e(r.inputOutput,"axisRotation",new t.SFRotation),new e(r.inputOutput,"diskAngle",new t.SFFloat(.261792)),new e(r.inputOutput,"minAngle",new t.SFFloat),new e(r.inputOutput,"maxAngle",new t.SFFloat(-1)),new e(r.inputOutput,"offset",new t.SFFloat),new e(r.inputOutput,"autoOffset",new t.SFBool(!0)),new e(r.outputOnly,"trackPoint_changed",new t.SFVec3f),new e(r.outputOnly,"rotation_changed",new t.SFRotation),new e(r.outputOnly,"isOver",new t.SFBool),new e(r.outputOnly,"isActive",new t.SFBool)]),getTypeName:function(){return"CylinderSensor"},getComponentName:function(){return"PointingDeviceSensor"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.modelViewMatrix=new a,this.invModelViewMatrix=new a,this.cylinder=new c(new u(new s(0,0,0),new s(0,0,0)),0),this.disk=!1,this.yPlane=null,this.zPlane=null,this.sxPlane=null,this.szNormal=null,this.behind=!1,this.fromVector=new s(0,0,0),this.startOffset=new o(0,0,1,0)},isBehind:function(t,e){var i=new s(0,0,0),n=new s(0,0,0);return this.cylinder.intersectsLine(t,i,n),s.subtract(e,i).abs()>s.subtract(e,n).abs()},getTrackPoint:function(t,e){var i=new s(0,0,0);this.zPlane.intersectsLine(t,i);var n=s.add(i,this.cylinder.axis.getPerpendicularVector(i)),r=this.sxPlane.getDistanceToPoint(i)/this.cylinder.radius,a=Math.floor((r+1)/2),u=h.interval(r,-1,1),l=0===a?Math.asin(u):u*Math.PI/2,c=l+a*Math.PI;new o(this.cylinder.axis.direction,c).multVecRot(e.assign(this.szNormal).multiply(this.cylinder.radius)),e.add(n)},getAngle:function(t){return s.dot(t.getAxis(),this.cylinder.axis.direction)>0?t.angle:-t.angle},set_active__:function(t,e,i,r,a){n.prototype.set_active__.call(this,t,e,i,r,a);try{if(this.isActive_.getValue()){this.modelViewMatrix.assign(i),this.invModelViewMatrix.assign(i).inverse();var h=e.hitRay.copy().multLineMatrix(this.invModelViewMatrix),d=this.invModelViewMatrix.multVecMatrix(e.intersection.point.copy()),p=this.axisRotation_.getValue().multVecRot(new s(0,1,0)),f=this.invModelViewMatrix.multDirMatrix(new s(0,0,1)).normalize(),g=new u(new s(0,0,0),p),m=g.getPerpendicularVector(d).abs();this.cylinder=new c(g,m),this.disk=Math.abs(s.dot(f,p))>Math.cos(this.diskAngle_.getValue()),this.behind=this.isBehind(h,d),this.yPlane=new l(d,p),this.zPlane=new l(d,f);var _=this.invModelViewMatrix.origin,x=s.cross(p,_).normalize();this.sxPlane=new l(new s(0,0,0),x),this.szNormal=s.cross(x,p).normalize();var y=new s(0,0,0);this.disk?this.yPlane.intersectsLine(h,y):this.getTrackPoint(h,y),this.fromVector=this.cylinder.axis.getPerpendicularVector(y).negate(),this.startOffset=new o(p,this.offset_.getValue()),this.trackPoint_changed_=y,this.rotation_changed_=this.startOffset,this.angle=this.offset_.getValue(),this.startVector=this.rotation_changed_.getValue().multVecRot(this.axisRotation_.getValue().multVecRot(new s(0,0,1)))}else this.autoOffset_.getValue()&&(this.offset_=this.getAngle(this.rotation_changed_.getValue()))}catch(t){}},set_motion__:function(t){try{var e=t.hitRay.copy().multLineMatrix(this.invModelViewMatrix),i=new s(0,0,0);this.disk?this.yPlane.intersectsLine(e,i):this.getTrackPoint(e,i),this.trackPoint_changed_=i;var n=this.cylinder.axis.getPerpendicularVector(i).negate(),r=new o(this.fromVector,n);if(this.disk){this.modelViewMatrix.multVecMatrix(i.copy()).z>0&&r.multRight(new o(this.yPlane.normal,Math.PI))}else this.behind&&r.inverse();if(r.multLeft(this.startOffset),this.minAngle_.getValue()>this.maxAngle_.getValue())this.rotation_changed_=r;else{var a=r.multVecRot(this.axisRotation_.getValue().multVecRot(new s(0,0,1))),u=new o(this.startVector,a),l=this.axisRotation_.getValue().multVecRot(new s(0,1,0)),c=l.dot(u.getAxis())>0?1:-1,h=this.minAngle_.getValue(),d=this.maxAngle_.getValue();this.angle+=c*u.angle,this.startVector.assign(a),this.angle<h?r.setAxisAngle(this.cylinder.axis.direction,h):this.angle>d?r.setAxisAngle(this.cylinder.axis.direction,d):r.setAxisAngle(this.cylinder.axis.direction,this.angle),this.rotation_changed_.getValue().equals(r)||(this.rotation_changed_=r)}}catch(t){this.trackPoint_changed_.addEvent(),this.rotation_changed_.addEvent()}}}),d}),define("x_ite/Components/PointingDeviceSensor/PlaneSensor",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/PointingDeviceSensor/X3DDragSensorNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Vector3","standard/Math/Numbers/Vector4","standard/Math/Numbers/Matrix4","standard/Math/Geometry/Line3","standard/Math/Geometry/Plane3","standard/Math/Geometry/ViewVolume","standard/Math/Algorithm"],function(t,e,i,n,r,s,o,a,u,l,c,h,d){"use strict";function p(t){n.call(this,t),this.addType(r.PlaneSensor),this.offset_.setUnit("length"),this.minPosition_.setUnit("length"),this.maxPosition_.setUnit("length"),this.translation_changed_.setUnit("length")}var f=new l(o.Zero,o.Zero),g=new o(0,0,0),m=new l(o.Zero,o.Zero);return p.prototype=Object.assign(Object.create(n.prototype),{constructor:p,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"enabled",new t.SFBool(!0)),new e(r.inputOutput,"description",new t.SFString),new e(r.inputOutput,"axisRotation",new t.SFRotation),new e(r.inputOutput,"autoOffset",new t.SFBool(!0)),new e(r.inputOutput,"offset",new t.SFVec3f),new e(r.inputOutput,"minPosition",new t.SFVec2f),new e(r.inputOutput,"maxPosition",new t.SFVec2f(-1,-1)),new e(r.outputOnly,"trackPoint_changed",new t.SFVec3f),new e(r.outputOnly,"translation_changed",new t.SFVec3f),new e(r.outputOnly,"isOver",new t.SFBool),new e(r.outputOnly,"isActive",new t.SFBool)]),getTypeName:function(){return"PlaneSensor"},getComponentName:function(){return"PointingDeviceSensor"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.modelViewMatrix=new u,this.invModelViewMatrix=new u,this.projectionMatrix=new u,this.viewport=new a,this.planeSensor=!0,this.plane=null,this.line=null,this.startOffset=new o(0,0,0),this.startPoint=new o(0,0,0)},getLineTrackPoint:function(t,e,i){return h.projectLine(e,this.modelViewMatrix,this.projectionMatrix,this.viewport,f),f.getClosestPointToPoint(new o(t.pointer.x,t.pointer.y,0),g),h.unProjectRay(g.x,g.y,this.modelViewMatrix,this.projectionMatrix,this.viewport,m),e.getClosestPointToLine(m,i)},set_active__:function(t,e,i,r,s){n.prototype.set_active__.call(this,t,e,i,r,s);try{if(this.isActive_.getValue()){this.modelViewMatrix.assign(i),this.projectionMatrix.assign(r),this.viewport.assign(s),this.invModelViewMatrix.assign(i).inverse();var a=e.hitRay.copy().multLineMatrix(this.invModelViewMatrix),u=this.invModelViewMatrix.multVecMatrix(e.intersection.point.copy()),h=this.axisRotation_.getValue();if(this.minPosition_.x===this.maxPosition_.x){this.planeSensor=!1;var d=h.multVecRot(new o(0,Math.abs(this.maxPosition_.y-this.minPosition_.y),0));this.line=new l(u,d.normalize())}else if(this.minPosition_.y===this.maxPosition_.y){this.planeSensor=!1;var d=h.multVecRot(new o(Math.abs(this.maxPosition_.x-this.minPosition_.x),0,0));this.line=new l(u,d.normalize())}else this.planeSensor=!0,this.plane=new c(u,h.multVecRot(new o(0,0,1)));if(this.planeSensor)this.plane.intersectsLine(a,this.startPoint)&&this.trackStart(this.startPoint);else if(this.getLineTrackPoint(e,this.line,this.startPoint)){var p=new o(0,0,0);try{this.getLineTrackPoint(e,new l(this.line.direction,this.line.direction),p)}catch(t){p=this.startPoint}this.trackStart(p)}}else this.autoOffset_.getValue()&&(this.offset_=this.translation_changed_)}catch(t){console.log(t)}},trackStart:function(t){this.startOffset.assign(this.offset_.getValue()),this.trackPoint_changed_=t,this.translation_changed_=this.offset_.getValue()},set_motion__:function(t){try{if(this.planeSensor){var e=t.hitRay.copy().multLineMatrix(this.invModelViewMatrix),i=new o(0,0,0);if(!this.plane.intersectsLine(e,i))throw new Error("Plane and line are parallel.");this.track(i,i.copy())}else{var i=new o(0,0,0),n=new o(0,0,0);if(!this.getLineTrackPoint(t,this.line,i))throw new Error("Lines are parallel.");try{this.getLineTrackPoint(t,new l(o.Zero,this.line.direction),n)}catch(t){n.assign(i)}this.track(i,n)}}catch(t){this.trackPoint_changed_.addEvent(),this.translation_changed_.addEvent()}},track:function(t,e){var i=this.axisRotation_.getValue(),n=s.inverse(i).multVecRot(t.add(this.startOffset).subtract(this.startPoint));this.minPosition_.x>this.maxPosition_.x||(n.x=d.clamp(n.x,this.minPosition_.x,this.maxPosition_.x)),this.minPosition_.y>this.maxPosition_.y||(n.y=d.clamp(n.y,this.minPosition_.y,this.maxPosition_.y)),i.multVecRot(n),this.trackPoint_changed_.getValue().equals(e)||(this.trackPoint_changed_=e),this.translation_changed_.getValue().equals(n)||(this.translation_changed_=n)}}),p}),define("standard/Math/Geometry/Sphere3",["standard/Math/Numbers/Vector3"],function(t){"use strict";function e(t,e){this.radius=t,this.center=e.copy()}return e.prototype={constructor:e,set:function(t,e){this.radius=t,this.center.assign(e)},intersectsLine:function(t,e,i){const n=t.point,r=t.direction,s=this.center,o=this.radius,a=2*(n.dot(r)-s.dot(r)),u=n.x*n.x+n.y*n.y+n.z*n.z+(s.x*s.x+s.y*s.y+s.z*s.z)-2*n.dot(s)-o*o,l=a*a-4*u;if(l>=0){let t=(-a+Math.sqrt(l))/2,s=(-a-Math.sqrt(l))/2;if(t>s){const e=t;t=s,s=e}return e.assign(r).multiply(t).add(n),i.assign(r).multiply(s).add(n),!0}return!1},intersectsTriangle:function(){const e=new t(0,0,0),i=new t(0,0,0),n=new t(0,0,0),r=new t(0,0,0),s=new t(0,0,0),o=new t(0,0,0),a=new t(0,0,0);return function(u,l,c){const h=this.center,d=this.radius;u.subtract(h),l.subtract(h),c.subtract(h),e.assign(l).subtract(u),i.assign(c).subtract(u);const p=d*d,f=e.cross(i),g=t.dot(u,f);if(g*g>p*t.dot(f,f))return!1;const m=t.dot(u,u),_=t.dot(u,l),x=t.dot(u,c),y=t.dot(l,l),v=t.dot(l,c),w=t.dot(c,c),b=m>p&&_>m&&x>m,S=y>p&&_>y&&v>y,C=w>p&&x>w&&v>w;if(b||S||C)return!1;e.assign(l).subtract(u),n.assign(c).subtract(l),r.assign(u).subtract(c);const T=_-m,F=v-y,O=x-w,N=t.dot(e,e),E=t.dot(n,n),M=t.dot(r,r);s.assign(u).multiply(N).subtract(e.multiply(T)),o.assign(l).multiply(E).subtract(n.multiply(F)),a.assign(c).multiply(M).subtract(r.multiply(O));const D=c.multiply(N).subtract(s),V=u.multiply(E).subtract(o),I=l.multiply(M).subtract(a),B=t.dot(s,s)>p*N*N&&t.dot(s,D)>0,A=t.dot(o,o)>p*E*E&&t.dot(o,V)>0,P=t.dot(a,a)>p*M*M&&t.dot(a,I)>0;return!(B||A||P)}}(),toString:function(){return this.radius+" "+this.center.toString()}},e}),define("x_ite/Components/PointingDeviceSensor/SphereSensor",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/PointingDeviceSensor/X3DDragSensorNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4","standard/Math/Geometry/Triangle3","standard/Math/Geometry/Line3","standard/Math/Geometry/Plane3","standard/Math/Geometry/Sphere3"],function(t,e,i,n,r,s,o,a,u,l,c,h){"use strict";function d(t){n.call(this,t),this.addType(r.SphereSensor)}return d.prototype=Object.assign(Object.create(n.prototype),{constructor:d,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"enabled",new t.SFBool(!0)),new e(r.inputOutput,"description",new t.SFString),new e(r.inputOutput,"autoOffset",new t.SFBool(!0)),new e(r.inputOutput,"offset",new t.SFRotation),new e(r.outputOnly,"trackPoint_changed",new t.SFVec3f),new e(r.outputOnly,"rotation_changed",new t.SFRotation),new e(r.outputOnly,"isOver",new t.SFBool),new e(r.outputOnly,"isActive",new t.SFBool)]),getTypeName:function(){return"SphereSensor"},getComponentName:function(){return"PointingDeviceSensor"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.modelViewMatrix=new a,this.invModelViewMatrix=new a,this.sphere=null,this.zPlane=null,this.behind=!1,this.fromVector=new s(0,0,0),this.startPoint=new s(0,0,0),this.startOffset=new o(0,0,1,0)},getTrackPoint:function(t,e,i){var n=new s(0,0,0);return!!this.sphere.intersectsLine(t,e,n)&&((s.subtract(t.point,n).abs()<s.subtract(t.point,e).abs())-i&&e.assign(n),!0)},set_active__:function(t,e,i,r,o){n.prototype.set_active__.call(this,t,e,i,r,o);try{if(this.isActive_.getValue()){this.modelViewMatrix.assign(i),this.invModelViewMatrix.assign(i).inverse();var a=this.invModelViewMatrix.multVecMatrix(e.intersection.point.copy()),u=new s(0,0,0);this.zPlane=new c(u,this.invModelViewMatrix.multDirMatrix(new s(0,0,1)).normalize()),this.sphere=new h(a.abs(),u),this.behind=this.zPlane.getDistanceToPoint(a)<0,this.fromVector.assign(a),this.startPoint.assign(a),this.startOffset.assign(this.offset_.getValue()),this.trackPoint_changed_=a,this.rotation_changed_=this.offset_.getValue()}else this.autoOffset_.getValue()&&(this.offset_=this.rotation_changed_)}catch(t){}},set_motion__:function(t){try{var e=t.hitRay.copy().multLineMatrix(this.invModelViewMatrix),i=new s(0,0,0);if(this.getTrackPoint(e,i,this.behind)){var n=this.invModelViewMatrix.multDirMatrix(new s(0,0,1)).normalize();this.zPlane=new c(i,n)}else{var r=new s(0,0,0);this.zPlane.intersectsLine(e,r),e=new l(r,s.subtract(this.sphere.center,r).normalize()),this.getTrackPoint(e,i,!1);var a=u.normal(this.sphere.center,i,this.startPoint,new s(0,0,0)),h=s.subtract(i,this.sphere.center).normalize(),d=s.cross(a,h).normalize(),p=s.subtract(i,d.multiply(s.subtract(r,i).abs()));e=new l(p,s.subtract(this.sphere.center,p).normalize()),this.getTrackPoint(e,i,!1)}this.trackPoint_changed_=i;var f=s.subtract(i,this.sphere.center),g=new o(this.fromVector,f);this.behind&&g.inverse(),this.rotation_changed_=o.multRight(this.startOffset,g)}catch(t){this.trackPoint_changed_.addEvent(),this.rotation_changed_.addEvent()}}}),d}),define("x_ite/Components/PointingDeviceSensor",["x_ite/Configuration/SupportedNodes","x_ite/Components/PointingDeviceSensor/CylinderSensor","x_ite/Components/PointingDeviceSensor/PlaneSensor","x_ite/Components/PointingDeviceSensor/SphereSensor","x_ite/Components/PointingDeviceSensor/TouchSensor","x_ite/Components/PointingDeviceSensor/X3DDragSensorNode","x_ite/Components/PointingDeviceSensor/X3DPointingDeviceSensorNode","x_ite/Components/PointingDeviceSensor/X3DTouchSensorNode"],function(t,e,i,n,r,s,o,a){"use strict";const u={CylinderSensor:e,PlaneSensor:i,SphereSensor:n,TouchSensor:r},l={X3DDragSensorNode:s,X3DPointingDeviceSensorNode:o,X3DTouchSensorNode:a};for(const e in u)t.addType(e,u[e]);for(const e in l)t.addAbstractType(e,l[e])}),define("x_ite/Components/Rendering/ClipPlane",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Core/X3DChildNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector3","standard/Math/Numbers/Vector4","standard/Math/Geometry/Plane3","standard/Utility/ObjectCache"],function(t,e,i,n,r,s,o,a,u){"use strict";function l(){this.plane=new a(s.Zero,s.Zero)}function c(t){n.call(this,t),this.addType(r.ClipPlane),this.enabled=!1,this.plane=new o(0,0,0,0)}const h=u(l);return l.prototype={constructor:l,isClipped:function(t){return this.plane.getDistanceToPoint(t)<0},set:function(t,e){const i=this.plane,n=t.plane;try{i.normal.assign(n),i.distanceFromOrigin=-n.w,i.multRight(e)}catch(t){i.normal.set(0,0,0),i.distanceFromOrigin=0}},setShaderUniforms:function(t,e){const i=this.plane,n=i.normal;t.uniform4f(e.x3d_ClipPlane[e.numClipPlanes++],n.x,n.y,n.z,i.distanceFromOrigin)},dispose:function(){h.push(this)}},c.prototype=Object.assign(Object.create(n.prototype),{constructor:c,
|
|
40
40
|
fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"enabled",new t.SFBool(!0)),new e(r.inputOutput,"plane",new t.SFVec4f(0,1,0,0))]),getTypeName:function(){return"ClipPlane"},getComponentName:function(){return"Rendering"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.enabled_.addInterest("set_enabled__",this),this.plane_.addInterest("set_enabled__",this),this.set_enabled__()},set_enabled__:function(){this.plane.assign(this.plane_.getValue()),this.enabled=this.enabled_.getValue()&&!this.plane.equals(o.Zero)},push:function(t){if(this.enabled){const e=h.pop();e.set(this,t.getModelViewMatrix().get()),t.getLocalObjects().push(e)}},pop:function(t){this.enabled&&t.getBrowser().getLocalObjects().push(t.getLocalObjects().pop())}}),c}),define("x_ite/Components/Rendering/ColorRGBA",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Rendering/X3DColorNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector4"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.ColorRGBA),this.setTransparent(!0)}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"color",new t.MFColorRGBA)]),getTypeName:function(){return"ColorRGBA"},getComponentName:function(){return"Rendering"},getContainerField:function(){return"color"},initialize:function(){n.prototype.initialize.call(this),this.color_.addInterest("set_color__",this),this.set_color__()},set_color__:function(){this.color=this.color_.getValue(),this.length=this.color_.length},addColor:function(t,e){if(t>=0&&t<this.length){const i=this.color;t*=4,e.push(i[t],i[t+1],i[t+2],i[t+3])}else if(this.length){const i=this.color;t=4*(this.length-1),e.push(i[t],i[t+1],i[t+2],i[t+3])}else e.push(1,1,1,1)},addColors:function(t,e){if(this.length){const r=this.color;for(var i=0,n=4*this.length;i<n;i+=4)t.push(r[i],r[i+1],r[i+2],r[i+3]);var i=4*(this.length-1);const s=r[i],o=r[i+1],a=r[i+2],u=r[i+2];for(var i=n,n=4*e;i<n;i+=4)t.push(s,o,a,u)}else for(var i=0;i<e;++i)t.push(1,1,1,1)},getVectors:function(t){const e=this.color_;for(var i=0,n=e.length;i<n;++i){const n=e[i];t[i]=new s(n.r,n.g,n.b,n.a)}return t.length=n,t}}),o}),define("x_ite/Components/Rendering/IndexedTriangleFanSet",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Rendering/X3DComposedGeometryNode","x_ite/Bits/X3DConstants"],function(t,e,i,n,r){"use strict";function s(t){n.call(this,t),this.addType(r.IndexedTriangleFanSet),this.triangleIndex=[]}return s.prototype=Object.assign(Object.create(n.prototype),{constructor:s,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOnly,"set_index",new t.MFInt32),new e(r.initializeOnly,"solid",new t.SFBool(!0)),new e(r.initializeOnly,"ccw",new t.SFBool(!0)),new e(r.initializeOnly,"colorPerVertex",new t.SFBool(!0)),new e(r.initializeOnly,"normalPerVertex",new t.SFBool(!0)),new e(r.initializeOnly,"index",new t.MFInt32),new e(r.inputOutput,"attrib",new t.MFNode),new e(r.inputOutput,"fogCoord",new t.SFNode),new e(r.inputOutput,"color",new t.SFNode),new e(r.inputOutput,"texCoord",new t.SFNode),new e(r.inputOutput,"normal",new t.SFNode),new e(r.inputOutput,"coord",new t.SFNode)]),getTypeName:function(){return"IndexedTriangleFanSet"},getComponentName:function(){return"Rendering"},getContainerField:function(){return"geometry"},initialize:function(){n.prototype.initialize.call(this),this.set_index_.addFieldInterest(this.index_),this.index_.addInterest("set_index__",this),this.set_index__()},set_index__:function(){const t=this.index_,e=this.triangleIndex;e.length=0;for(var i=0,n=t.length;i<n;++i){const s=t[i];if(!(s<0)&&++i<n){var r=t[i];if(r<0)continue;for(++i;i<n;++i){const n=t[i];if(n<0)break;e.push(s,r,n),r=n}}}},getPolygonIndex:function(t){return this.triangleIndex[t]},build:function(){n.prototype.build.call(this,3,this.triangleIndex.length,3,this.triangleIndex.length)}}),s}),define("x_ite/Components/Rendering/IndexedTriangleSet",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Rendering/X3DComposedGeometryNode","x_ite/Bits/X3DConstants"],function(t,e,i,n,r){"use strict";function s(t){n.call(this,t),this.addType(r.IndexedTriangleSet)}return s.prototype=Object.assign(Object.create(n.prototype),{constructor:s,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOnly,"set_index",new t.MFInt32),new e(r.initializeOnly,"solid",new t.SFBool(!0)),new e(r.initializeOnly,"ccw",new t.SFBool(!0)),new e(r.initializeOnly,"colorPerVertex",new t.SFBool(!0)),new e(r.initializeOnly,"normalPerVertex",new t.SFBool(!0)),new e(r.initializeOnly,"index",new t.MFInt32),new e(r.inputOutput,"attrib",new t.MFNode),new e(r.inputOutput,"fogCoord",new t.SFNode),new e(r.inputOutput,"color",new t.SFNode),new e(r.inputOutput,"texCoord",new t.SFNode),new e(r.inputOutput,"normal",new t.SFNode),new e(r.inputOutput,"coord",new t.SFNode)]),getTypeName:function(){return"IndexedTriangleSet"},getComponentName:function(){return"Rendering"},getContainerField:function(){return"geometry"},getPolygonIndex:function(t){return this.index_[t]},initialize:function(){n.prototype.initialize.call(this),this.set_index_.addFieldInterest(this.index_)},build:function(){n.prototype.build.call(this,3,this.index_.length,3,this.index_.length)}}),s}),define("x_ite/Components/Rendering/IndexedTriangleStripSet",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Rendering/X3DComposedGeometryNode","x_ite/Bits/X3DConstants"],function(t,e,i,n,r){"use strict";function s(t){n.call(this,t),this.addType(r.IndexedTriangleStripSet),this.triangleIndex=[]}return s.prototype=Object.assign(Object.create(n.prototype),{constructor:s,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOnly,"set_index",new t.MFInt32),new e(r.initializeOnly,"solid",new t.SFBool(!0)),new e(r.initializeOnly,"ccw",new t.SFBool(!0)),new e(r.initializeOnly,"colorPerVertex",new t.SFBool(!0)),new e(r.initializeOnly,"normalPerVertex",new t.SFBool(!0)),new e(r.initializeOnly,"index",new t.MFInt32),new e(r.inputOutput,"attrib",new t.MFNode),new e(r.inputOutput,"fogCoord",new t.SFNode),new e(r.inputOutput,"color",new t.SFNode),new e(r.inputOutput,"texCoord",new t.SFNode),new e(r.inputOutput,"normal",new t.SFNode),new e(r.inputOutput,"coord",new t.SFNode)]),getTypeName:function(){return"IndexedTriangleStripSet"},getComponentName:function(){return"Rendering"},getContainerField:function(){return"geometry"},initialize:function(){n.prototype.initialize.call(this),this.set_index_.addFieldInterest(this.index_),this.index_.addInterest("set_index__",this),this.set_index__()},set_index__:function(){const t=this.index_,e=this.triangleIndex;e.length=0;for(var i=0,n=t.length;i<n;++i){var r=t[i];if(!(r<0)&&++i<n){var s=t[i];if(s<0)continue;++i;for(var o=0;i<n;++i,++o){const n=t[i];if(n<0)break;e.push(r,s,n),1&o?s=n:r=n}}}},getPolygonIndex:function(t){return this.triangleIndex[t]},build:function(){n.prototype.build.call(this,3,this.triangleIndex.length,3,this.triangleIndex.length)}}),s}),define("x_ite/Components/Rendering/LineSet",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Rendering/X3DLineGeometryNode","x_ite/Bits/X3DCast","x_ite/Bits/X3DConstants"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(s.LineSet),this.setGeometryType(1),this.fogCoordNode=null,this.colorNode=null,this.coordNode=null}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOutput,"vertexCount",new t.MFInt32),new e(s.inputOutput,"attrib",new t.MFNode),new e(s.inputOutput,"fogCoord",new t.SFNode),new e(s.inputOutput,"color",new t.SFNode),new e(s.inputOutput,"coord",new t.SFNode)]),getTypeName:function(){return"LineSet"},getComponentName:function(){return"Rendering"},getContainerField:function(){return"geometry"},initialize:function(){n.prototype.initialize.call(this),this.attrib_.addInterest("set_attrib__",this),this.fogCoord_.addInterest("set_fogCoord__",this),this.color_.addInterest("set_color__",this),this.coord_.addInterest("set_coord__",this),this.setPrimitiveMode(this.getBrowser().getContext().LINES),this.setSolid(!1),this.set_attrib__(),this.set_fogCoord__(),this.set_color__(),this.set_coord__()},set_attrib__:function(){const t=this.getAttrib();for(var e=0,i=t.length;e<i;++e)t[e].removeInterest("requestRebuild",this);t.length=0;for(var e=0,i=this.attrib_.length;e<i;++e){const i=r(s.X3DVertexAttributeNode,this.attrib_[e]);i&&t.push(i)}for(var e=0;e<this.attribNodes.length;++e)t[e].addInterest("requestRebuild",this)},set_fogCoord__:function(){this.fogCoordNode&&this.fogCoordNode.removeInterest("requestRebuild",this),this.fogCoordNode=r(s.FogCoordinate,this.fogCoord_),this.fogCoordNode&&this.fogCoordNode.addInterest("requestRebuild",this)},set_color__:function(){this.colorNode&&(this.colorNode.removeInterest("requestRebuild",this),this.colorNode.transparent_.removeInterest("set_transparent__",this)),this.colorNode=r(s.X3DColorNode,this.color_),this.colorNode?(this.colorNode.addInterest("requestRebuild",this),this.colorNode.transparent_.addInterest("set_transparent__",this),this.set_transparent__()):this.setTransparent(!1)},set_transparent__:function(){this.setTransparent(this.colorNode.getTransparent())},set_coord__:function(){this.coordNode&&this.coordNode.removeInterest("requestRebuild",this),this.coordNode=r(s.X3DCoordinateNode,this.coord_),this.coordNode&&this.coordNode.addInterest("requestRebuild",this)},build:function(){if(this.coordNode&&!this.coordNode.isEmpty()){const o=this.vertexCount_,a=this.getAttrib(),u=a.length,l=this.getAttribs(),c=this.fogCoordNode,h=this.colorNode,d=this.coordNode,p=this.getFogDepths(),f=this.getColors(),g=this.getVertices(),m=d.getSize();for(var t=0,e=0,i=o.length;e<i;++e){var n=o[e];if(t+n>m)break;if(n>1){n=2*n-2;for(var r=0;r<n;++r,t+=1&r){for(var s=0;s<u;++s)a[s].addValue(t,l[s]);c&&c.addDepth(t,p),h&&h.addColor(t,f),d.addPoint(t,g)}++t}else t+=n}}}}),o}),define("x_ite/Components/Rendering/X3DNormalNode",["x_ite/Components/Rendering/X3DGeometricPropertyNode","x_ite/Bits/X3DConstants"],function(t,e){"use strict";function i(i){t.call(this,i),this.addType(e.X3DNormalNode)}return i.prototype=Object.assign(Object.create(t.prototype),{constructor:i}),i}),define("x_ite/Components/Rendering/Normal",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Rendering/X3DNormalNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector3"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.Normal)}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"vector",new t.MFVec3f)]),getTypeName:function(){return"Normal"},getComponentName:function(){return"Rendering"},getContainerField:function(){return"normal"},initialize:function(){n.prototype.initialize.call(this),this.vector_.addInterest("set_vector__",this),this.set_vector__()},set_vector__:function(){this.vector=this.vector_.getValue(),this.length=this.vector_.length},set1Vector:function(t,e){this.vector_[t]=e},get1Vector:function(t,e){if(t>=0&&t<this.length){const i=this.vector;return t*=3,e.set(i[t],i[t+1],i[t+2])}if(t>=0&&this.length){const i=this.vector;return t%=this.length,t*=3,e.set(i[t],i[t+1],i[t+2])}return e.set(0,0,0)},addVector:function(t,e){if(t>=0&&t<this.length){const i=this.vector;t*=3,e.push(i[t],i[t+1],i[t+2])}else{if(!(t>=0&&this.length))return e.push(0,0,0);{const i=this.vector;t%=this.length,t*=3,e.push(i[t],i[t+1],i[t+2])}}}}),o}),define("x_ite/Components/Rendering/PointSet",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Rendering/X3DLineGeometryNode","x_ite/Bits/X3DCast","x_ite/Bits/X3DConstants"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(s.PointSet),this.setGeometryType(0),this.setTransparent(!0),this.fogCoordNode=null,this.colorNode=null,this.coordNode=null}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOutput,"attrib",new t.MFNode),new e(s.inputOutput,"fogCoord",new t.SFNode),new e(s.inputOutput,"color",new t.SFNode),new e(s.inputOutput,"coord",new t.SFNode)]),getTypeName:function(){return"PointSet"},getComponentName:function(){return"Rendering"},getContainerField:function(){return"geometry"},initialize:function(){n.prototype.initialize.call(this),this.attrib_.addInterest("set_attrib__",this),this.fogCoord_.addInterest("set_fogCoord__",this),this.color_.addInterest("set_color__",this),this.coord_.addInterest("set_coord__",this);const t=this.getBrowser();this.setPrimitiveMode(t.getContext().POINTS),this.setSolid(!1),this.set_attrib__(),this.set_fogCoord__(),this.set_color__(),this.set_coord__()},getShader:function(t){return t.getPointShader()},getCoord:function(){return this.coordNode},set_attrib__:function(){const t=this.getAttrib();for(var e=0,i=t.length;e<i;++e)t[e].removeInterest("requestRebuild",this);t.length=0;for(var e=0,i=this.attrib_.length;e<i;++e){const i=r(s.X3DVertexAttributeNode,this.attrib_[e]);i&&t.push(i)}for(var e=0;e<this.attribNodes.length;++e)t[e].addInterest("requestRebuild",this)},set_fogCoord__:function(){this.fogCoordNode&&this.fogCoordNode.removeInterest("requestRebuild",this),this.fogCoordNode=r(s.FogCoordinate,this.fogCoord_),this.fogCoordNode&&this.fogCoordNode.addInterest("requestRebuild",this)},set_color__:function(){this.colorNode&&this.colorNode.removeInterest("requestRebuild",this),this.colorNode=r(s.X3DColorNode,this.color_),this.colorNode&&this.colorNode.addInterest("requestRebuild",this)},set_coord__:function(){this.coordNode&&this.coordNode.removeInterest("requestRebuild",this),this.coordNode=r(s.X3DCoordinateNode,this.coord_),this.coordNode&&this.coordNode.addInterest("requestRebuild",this)},build:function(){if(this.coordNode&&!this.coordNode.isEmpty()){const i=this.getAttrib(),n=i.length,r=this.getAttribs(),s=this.fogCoordNode,o=this.getFogDepths(),a=this.colorNode,u=this.getColors(),l=this.coordNode,c=this.getVertices(),h=l.point_.length;for(var t=0;t<n;++t)for(var e=0;e<h;++e)i[t].addValue(e,r[t]);s&&s.addDepths(o,h),a&&a.addColors(u,h),l.addPoints(c,h)}}}),o}),define("x_ite/Components/Rendering/TriangleFanSet",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Rendering/X3DComposedGeometryNode","x_ite/Bits/X3DConstants"],function(t,e,i,n,r){"use strict";function s(t){n.call(this,t),this.addType(r.TriangleFanSet),this.triangleIndex=[]}return s.prototype=Object.assign(Object.create(n.prototype),{constructor:s,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.initializeOnly,"solid",new t.SFBool(!0)),new e(r.initializeOnly,"ccw",new t.SFBool(!0)),new e(r.initializeOnly,"colorPerVertex",new t.SFBool(!0)),new e(r.initializeOnly,"normalPerVertex",new t.SFBool(!0)),new e(r.inputOutput,"fanCount",new t.MFInt32),new e(r.inputOutput,"attrib",new t.MFNode),new e(r.inputOutput,"fogCoord",new t.SFNode),new e(r.inputOutput,"color",new t.SFNode),new e(r.inputOutput,"texCoord",new t.SFNode),new e(r.inputOutput,"normal",new t.SFNode),new e(r.inputOutput,"coord",new t.SFNode)]),getTypeName:function(){return"TriangleFanSet"},getComponentName:function(){return"Rendering"},getContainerField:function(){return"geometry"},initialize:function(){n.prototype.initialize.call(this),this.fanCount_.addInterest("set_fanCount__",this),this.set_fanCount__()},set_fanCount__:function(){const t=this.fanCount_,e=this.triangleIndex;e.length=0;for(var i=0,n=t.length,r=0;i<n;++i){const n=t[i];for(var s=1,o=n-1;s<o;++s)e.push(r,r+s,r+s+1);r+=n}},getPolygonIndex:function(t){return this.triangleIndex[t]},build:function(){n.prototype.build.call(this,3,this.triangleIndex.length,3,this.triangleIndex.length)}}),s}),define("x_ite/Components/Rendering/TriangleSet",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Rendering/X3DComposedGeometryNode","x_ite/Bits/X3DConstants"],function(t,e,i,n,r){"use strict";function s(t){n.call(this,t),this.addType(r.TriangleSet)}return s.prototype=Object.assign(Object.create(n.prototype),{constructor:s,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.initializeOnly,"solid",new t.SFBool(!0)),new e(r.initializeOnly,"ccw",new t.SFBool(!0)),new e(r.initializeOnly,"colorPerVertex",new t.SFBool(!0)),new e(r.initializeOnly,"normalPerVertex",new t.SFBool(!0)),new e(r.inputOutput,"attrib",new t.MFNode),new e(r.inputOutput,"fogCoord",new t.SFNode),new e(r.inputOutput,"color",new t.SFNode),new e(r.inputOutput,"texCoord",new t.SFNode),new e(r.inputOutput,"normal",new t.SFNode),new e(r.inputOutput,"coord",new t.SFNode)]),getTypeName:function(){return"TriangleSet"},getComponentName:function(){return"Rendering"},getContainerField:function(){return"geometry"},build:function(){this.getCoord()&&n.prototype.build.call(this,3,this.getCoord().getSize(),3,this.getCoord().getSize())},createNormals:function(t,e){return this.createFaceNormals(t,e)}}),s}),define("x_ite/Components/Rendering/TriangleStripSet",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Rendering/X3DComposedGeometryNode","x_ite/Bits/X3DConstants"],function(t,e,i,n,r){"use strict";function s(t){n.call(this,t),this.addType(r.TriangleStripSet),this.triangleIndex=[]}return s.prototype=Object.assign(Object.create(n.prototype),{constructor:s,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.initializeOnly,"solid",new t.SFBool(!0)),new e(r.initializeOnly,"ccw",new t.SFBool(!0)),new e(r.initializeOnly,"colorPerVertex",new t.SFBool(!0)),new e(r.initializeOnly,"normalPerVertex",new t.SFBool(!0)),new e(r.inputOutput,"stripCount",new t.MFInt32),new e(r.inputOutput,"attrib",new t.MFNode),new e(r.inputOutput,"fogCoord",new t.SFNode),new e(r.inputOutput,"color",new t.SFNode),new e(r.inputOutput,"texCoord",new t.SFNode),new e(r.inputOutput,"normal",new t.SFNode),new e(r.inputOutput,"coord",new t.SFNode)]),getTypeName:function(){return"TriangleStripSet"},getComponentName:function(){return"Rendering"},getContainerField:function(){return"geometry"},initialize:function(){n.prototype.initialize.call(this),this.stripCount_.addInterest("set_stripCount__",this),this.set_stripCount__()},set_stripCount__:function(){const t=this.stripCount_,e=this.triangleIndex;e.length=0;for(var i=0,n=t.length,r=0;i<n;++i){const n=t[i];for(var s=0,o=n-2;s<o;++s){const t=1&s;e.push(r+(t?s+1:s),r+(t?s:s+1),r+(s+2))}r+=n}},getPolygonIndex:function(t){return this.triangleIndex[t]},build:function(){n.prototype.build.call(this,3,this.triangleIndex.length,3,this.triangleIndex.length)}}),s}),define("x_ite/Components/Rendering",["x_ite/Configuration/SupportedNodes","x_ite/Components/Rendering/ClipPlane","x_ite/Components/Rendering/Color","x_ite/Components/Rendering/ColorRGBA","x_ite/Components/Rendering/Coordinate","x_ite/Components/Rendering/IndexedLineSet","x_ite/Components/Rendering/IndexedTriangleFanSet","x_ite/Components/Rendering/IndexedTriangleSet","x_ite/Components/Rendering/IndexedTriangleStripSet","x_ite/Components/Rendering/LineSet","x_ite/Components/Rendering/Normal","x_ite/Components/Rendering/PointSet","x_ite/Components/Rendering/TriangleFanSet","x_ite/Components/Rendering/TriangleSet","x_ite/Components/Rendering/TriangleStripSet","x_ite/Components/Rendering/X3DColorNode","x_ite/Components/Rendering/X3DComposedGeometryNode","x_ite/Components/Rendering/X3DCoordinateNode","x_ite/Components/Rendering/X3DGeometricPropertyNode","x_ite/Components/Rendering/X3DGeometryNode","x_ite/Components/Rendering/X3DLineGeometryNode","x_ite/Components/Rendering/X3DNormalNode"],function(t,e,i,n,r,s,o,a,u,l,c,h,d,p,f,g,m,_,x,y,v,w){"use strict";const b={ClipPlane:e,Color:i,ColorRGBA:n,Coordinate:r,IndexedLineSet:s,IndexedTriangleFanSet:o,IndexedTriangleSet:a,IndexedTriangleStripSet:u,LineSet:l,Normal:c,PointSet:h,TriangleFanSet:d,TriangleSet:p,TriangleStripSet:f},S={X3DColorNode:g,X3DComposedGeometryNode:m,X3DCoordinateNode:_,X3DGeometricPropertyNode:x,X3DGeometryNode:y,X3DLineGeometryNode:v,X3DNormalNode:w};for(const e in b)t.addType(e,b[e]);for(const e in S)t.addAbstractType(e,S[e])}),define("x_ite/Components/Shaders/X3DVertexAttributeNode",["x_ite/Components/Rendering/X3DGeometricPropertyNode","x_ite/Bits/X3DConstants"],function(t,e){"use strict";function i(i){t.call(this,i),this.addType(e.X3DVertexAttributeNode)}return i.prototype=Object.assign(Object.create(t.prototype),{constructor:i}),i}),define("x_ite/Components/Shaders/FloatVertexAttribute",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Shaders/X3DVertexAttributeNode","x_ite/Bits/X3DConstants","standard/Math/Algorithm"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.FloatVertexAttribute)}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.initializeOnly,"name",new t.SFString),new e(r.initializeOnly,"numComponents",new t.SFInt32(4)),new e(r.inputOutput,"value",new t.MFFloat)]),getTypeName:function(){return"FloatVertexAttribute"},getComponentName:function(){return"Shaders"},getContainerField:function(){return"attrib"},initialize:function(){n.prototype.initialize.call(this),this.numComponents_.addInterest("set_numComponents",this),this.value_.addInterest("set_value",this),this.set_numComponents(),this.set_value()},set_numComponents:function(){this.numComponents=s.clamp(this.numComponents_.getValue(),1,4)},set_value:function(){this.value=this.value_.getValue(),this.length=this.value_.length},addValue:function(t,e){var i=this.value,n=t*this.numComponents,r=n+this.numComponents;if(r<=this.length)for(;n<r;++n)e.push(i[n]);else if(this.numComponents<=this.length)for(r=i.length,n=r-this.numComponents;n<r;++n)e.push(i[n]);else for(;n<r;++n)e.push(0)},enable:function(t,e,i){e.enableFloatAttrib(t,this.name_.getValue(),i,this.numComponents)},disable:function(t,e){e.disableFloatAttrib(t,this.name_.getValue())}}),o}),define("x_ite/Components/Shaders/Matrix3VertexAttribute",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Shaders/X3DVertexAttributeNode","x_ite/Bits/X3DConstants","standard/Math/Numbers/Matrix3"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.Matrix3VertexAttribute)}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.initializeOnly,"name",new t.SFString),new e(r.inputOutput,"value",new t.MFMatrix3f)]),getTypeName:function(){return"Matrix3VertexAttribute"},getComponentName:function(){return"Shaders"},getContainerField:function(){return"attrib"},initialize:function(){n.prototype.initialize.call(this),this.value_.addInterest("set_value",this),this.set_value()},set_value:function(){this.value=this.value_.getValue(),this.length=this.value_.length},addValue:function(t,e){if(t<this.length)for(var i=this.value,n=9*t,r=n+9;n<r;++n)e.push(i[n]);else if(this.length){var i=this.value;t=this.length-1;for(var n=9*t,r=n+9;n<r;++n)e.push(i[n])}else for(var i=s.Identity,n=0;n<9;++n)e.push(i[n])},enable:function(t,e,i){e.enableMatrix3Attrib(t,this.name_.getValue(),i)},disable:function(t,e){e.disableMatrix3Attrib(t,this.name_.getValue())}}),o}),define("x_ite/Components/Shaders/Matrix4VertexAttribute",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Shaders/X3DVertexAttributeNode","x_ite/Bits/X3DConstants"],function(t,e,i,n,r){"use strict";function s(t){n.call(this,t),this.addType(r.Matrix4VertexAttribute)}return s.prototype=Object.assign(Object.create(n.prototype),{constructor:s,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.initializeOnly,"name",new t.SFString),new e(r.inputOutput,"value",new t.MFMatrix4f)]),getTypeName:function(){return"Matrix4VertexAttribute"},getComponentName:function(){return"Shaders"},getContainerField:function(){return"attrib"},initialize:function(){n.prototype.initialize.call(this),this.value_.addInterest("set_value",this),this.set_value()},set_value:function(){this.value=this.value_.getValue(),this.length=this.value_.length},addValue:function(t,e){if(t<this.length)for(var i=this.value,n=16*t,r=n+16;n<r;++n)e.push(i[n]);else if(this.length){var i=this.value;t=this.length-1;for(var n=16*t,r=n+16;n<r;++n)e.push(i[n])}else for(var i=Matrix4.Identity,n=0;n<16;++n)e.push(i[n])},enable:function(t,e,i){e.enableMatrix4Attrib(t,this.name_.getValue(),i)},disable:function(t,e){e.disableMatrix4Attrib(t,this.name_.getValue())}}),s}),define("x_ite/Components/Shaders",["x_ite/Configuration/SupportedNodes","x_ite/Components/Shaders/ComposedShader","x_ite/Components/Shaders/FloatVertexAttribute","x_ite/Components/Shaders/Matrix3VertexAttribute","x_ite/Components/Shaders/Matrix4VertexAttribute","x_ite/Components/Shaders/ShaderPart","x_ite/Components/Shaders/X3DProgrammableShaderObject","x_ite/Components/Shaders/X3DShaderNode","x_ite/Components/Shaders/X3DVertexAttributeNode"],function(t,e,i,n,r,s,o,a,u){"use strict";const l={ComposedShader:e,FloatVertexAttribute:i,Matrix3VertexAttribute:n,Matrix4VertexAttribute:r,ShaderPart:s},c={X3DProgrammableShaderObject:o,X3DShaderNode:a,X3DVertexAttributeNode:u};for(const e in l)t.addType(e,l[e]);for(const e in c)t.addAbstractType(e,c[e])}),define("x_ite/Components/Shape/Material",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Shape/X3DOneSidedMaterialNode","x_ite/Bits/X3DConstants","standard/Math/Algorithm"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.Material),this.diffuseColor=new Float32Array(3),this.specularColor=new Float32Array(3)}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"ambientIntensity",new t.SFFloat(.2)),new e(r.inputOutput,"ambientTexture",new t.SFNode),new e(r.inputOutput,"ambientTextureMapping",new t.SFString),new e(r.inputOutput,"diffuseColor",new t.SFColor(.8,.8,.8)),new e(r.inputOutput,"diffuseTexture",new t.SFNode),new e(r.inputOutput,"diffuseTextureMapping",new t.SFString),new e(r.inputOutput,"specularColor",new t.SFColor),new e(r.inputOutput,"specularTexture",new t.SFNode),new e(r.inputOutput,"specularTextureMapping",new t.SFString),new e(r.inputOutput,"emissiveColor",new t.SFColor),new e(r.inputOutput,"emissiveTexture",new t.SFNode),new e(r.inputOutput,"emissiveTextureMapping",new t.SFString),new e(r.inputOutput,"shininess",new t.SFFloat(.2)),new e(r.inputOutput,"shininessTexture",new t.SFNode),new e(r.inputOutput,"shininessTextureMapping",new t.SFString),new e(r.inputOutput,"occlusionStrength",new t.SFFloat(1)),new e(r.inputOutput,"occlusionTexture",new t.SFNode),new e(r.inputOutput,"occlusionTextureMapping",new t.SFString),new e(r.inputOutput,"normalScale",new t.SFFloat(1)),new e(r.inputOutput,"normalTexture",new t.SFNode),new e(r.inputOutput,"normalTextureMapping",new t.SFString),new e(r.inputOutput,"transparency",new t.SFFloat)]),getTypeName:function(){return"Material"},getComponentName:function(){return"Shape"},getContainerField:function(){return"material"},initialize:function(){n.prototype.initialize.call(this),this.ambientIntensity_.addInterest("set_ambientIntensity__",this),this.diffuseColor_.addInterest("set_diffuseColor__",this),this.specularColor_.addInterest("set_specularColor__",this),this.shininess_.addInterest("set_shininess__",this),this.set_ambientIntensity__(),this.set_diffuseColor__(),this.set_specularColor__(),this.set_shininess__()},set_ambientIntensity__:function(){this.ambientIntensity=Math.max(this.ambientIntensity_.getValue(),0)},set_diffuseColor__:function(){const t=this.diffuseColor,e=this.diffuseColor_.getValue();t[0]=e.r,t[1]=e.g,t[2]=e.b},set_specularColor__:function(){const t=this.specularColor,e=this.specularColor_.getValue();t[0]=e.r,t[1]=e.g,t[2]=e.b},set_shininess__:function(){this.shininess=s.clamp(this.shininess_.getValue(),0,1)},getShader:function(t,e){return e?t.getShadowShader():t.getDefaultShader()},setShaderUniforms:function(t,e){t.uniform1f(e.x3d_AmbientIntensity,this.ambientIntensity),t.uniform3fv(e.x3d_DiffuseColor,this.diffuseColor),t.uniform3fv(e.x3d_SpecularColor,this.specularColor),t.uniform3fv(e.x3d_EmissiveColor,this.emissiveColor),t.uniform1f(e.x3d_Shininess,this.shininess),t.uniform1f(e.x3d_Transparency,this.transparency)}}),o}),define("x_ite/Components/Shape/TwoSidedMaterial",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Shape/X3DMaterialNode","x_ite/Bits/X3DConstants","standard/Math/Algorithm"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.TwoSidedMaterial),this.diffuseColor=new Float32Array(3),this.specularColor=new Float32Array(3),this.emissiveColor=new Float32Array(3),this.backDiffuseColor=new Float32Array(3),this.backSpecularColor=new Float32Array(3),this.backEmissiveColor=new Float32Array(3)}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"separateBackColor",new t.SFBool),new e(r.inputOutput,"ambientIntensity",new t.SFFloat(.2)),new e(r.inputOutput,"diffuseColor",new t.SFColor(.8,.8,.8)),new e(r.inputOutput,"specularColor",new t.SFColor),new e(r.inputOutput,"emissiveColor",new t.SFColor),new e(r.inputOutput,"shininess",new t.SFFloat(.2)),new e(r.inputOutput,"transparency",new t.SFFloat),new e(r.inputOutput,"backAmbientIntensity",new t.SFFloat(.2)),new e(r.inputOutput,"backDiffuseColor",new t.SFColor(.8,.8,.8)),new e(r.inputOutput,"backSpecularColor",new t.SFColor),new e(r.inputOutput,"backEmissiveColor",new t.SFColor),new e(r.inputOutput,"backShininess",new t.SFFloat(.2)),new e(r.inputOutput,"backTransparency",new t.SFFloat)]),getTypeName:function(){return"TwoSidedMaterial"},getComponentName:function(){return"Shape"},getContainerField:function(){return"material"},initialize:function(){n.prototype.initialize.call(this),this.separateBackColor_.addInterest("set_transparent__",this),this.ambientIntensity_.addInterest("set_ambientIntensity__",this),this.diffuseColor_.addInterest("set_diffuseColor__",this),this.specularColor_.addInterest("set_specularColor__",this),this.emissiveColor_.addInterest("set_emissiveColor__",this),this.shininess_.addInterest("set_shininess__",this),this.transparency_.addInterest("set_transparency__",this),this.backAmbientIntensity_.addInterest("set_backAmbientIntensity__",this),this.backDiffuseColor_.addInterest("set_backDiffuseColor__",this),this.backSpecularColor_.addInterest("set_backSpecularColor__",this),this.backEmissiveColor_.addInterest("set_backEmissiveColor__",this),this.backShininess_.addInterest("set_backShininess__",this),this.backTransparency_.addInterest("set_backTransparency__",this),this.set_ambientIntensity__(),this.set_diffuseColor__(),this.set_specularColor__(),this.set_emissiveColor__(),this.set_shininess__(),this.set_transparency__(),this.set_backAmbientIntensity__(),this.set_backDiffuseColor__(),this.set_backSpecularColor__(),this.set_backEmissiveColor__(),this.set_backShininess__(),this.set_backTransparency__()},
|
|
41
41
|
set_ambientIntensity__:function(){this.ambientIntensity=Math.max(this.ambientIntensity_.getValue(),0)},set_diffuseColor__:function(){const t=this.diffuseColor,e=this.diffuseColor_.getValue();t[0]=e.r,t[1]=e.g,t[2]=e.b},set_specularColor__:function(){const t=this.specularColor,e=this.specularColor_.getValue();t[0]=e.r,t[1]=e.g,t[2]=e.b},set_emissiveColor__:function(){const t=this.emissiveColor,e=this.emissiveColor_.getValue();t[0]=e.r,t[1]=e.g,t[2]=e.b},set_shininess__:function(){this.shininess=s.clamp(this.shininess_.getValue(),0,1)},set_transparency__:function(){this.transparency=s.clamp(this.transparency_.getValue(),0,1),this.set_transparent__()},set_backAmbientIntensity__:function(){this.backAmbientIntensity=Math.max(this.backAmbientIntensity_.getValue(),0)},set_backDiffuseColor__:function(){const t=this.backDiffuseColor,e=this.backDiffuseColor_.getValue();t[0]=e.r,t[1]=e.g,t[2]=e.b},set_backSpecularColor__:function(){const t=this.backSpecularColor,e=this.backSpecularColor_.getValue();t[0]=e.r,t[1]=e.g,t[2]=e.b},set_backEmissiveColor__:function(){const t=this.backEmissiveColor,e=this.backEmissiveColor_.getValue();t[0]=e.r,t[1]=e.g,t[2]=e.b},set_backShininess__:function(){this.backShininess=s.clamp(this.backShininess_.getValue(),0,1)},set_backTransparency__:function(){this.backTransparency=s.clamp(this.backTransparency_.getValue(),0,1),this.set_transparent__()},set_transparent__:function(){this.setTransparent(Boolean(this.transparency_.getValue()||this.separateBackColor_.getValue()&&this.backTransparency_.getValue()))},getShader:function(t,e){return e?t.getShadowShader():t.getDefaultShader()},setShaderUniforms:function(t,e,i){!i&&this.separateBackColor_.getValue()?(t.uniform1f(e.x3d_AmbientIntensity,this.backAmbientIntensity),t.uniform3fv(e.x3d_DiffuseColor,this.backDiffuseColor),t.uniform3fv(e.x3d_SpecularColor,this.backSpecularColor),t.uniform3fv(e.x3d_EmissiveColor,this.backEmissiveColor),t.uniform1f(e.x3d_Shininess,this.backShininess),t.uniform1f(e.x3d_Transparency,this.backTransparency)):(t.uniform1f(e.x3d_AmbientIntensity,this.ambientIntensity),t.uniform3fv(e.x3d_DiffuseColor,this.diffuseColor),t.uniform3fv(e.x3d_SpecularColor,this.specularColor),t.uniform3fv(e.x3d_EmissiveColor,this.emissiveColor),t.uniform1f(e.x3d_Shininess,this.shininess),t.uniform1f(e.x3d_Transparency,this.transparency))}}),o}),define("x_ite/Components/Shape",["x_ite/Configuration/SupportedNodes","x_ite/Components/Shape/Appearance","x_ite/Components/Shape/FillProperties","x_ite/Components/Shape/LineProperties","x_ite/Components/Shape/Material","x_ite/Components/Shape/PointProperties","x_ite/Components/Shape/Shape","x_ite/Components/Shape/TwoSidedMaterial","x_ite/Components/Shape/UnlitMaterial","x_ite/Components/Shape/X3DAppearanceChildNode","x_ite/Components/Shape/X3DAppearanceNode","x_ite/Components/Shape/X3DMaterialNode","x_ite/Components/Shape/X3DOneSidedMaterialNode","x_ite/Components/Shape/X3DShapeNode"],function(t,e,i,n,r,s,o,a,u,l,c,h,d,p){"use strict";const f={Appearance:e,FillProperties:i,LineProperties:n,Material:r,PointProperties:s,Shape:o,TwoSidedMaterial:a,UnlitMaterial:u},g={X3DAppearanceChildNode:l,X3DAppearanceNode:c,X3DMaterialNode:h,X3DOneSidedMaterialNode:d,X3DShapeNode:p};for(const e in f)t.addType(e,f[e]);for(const e in g)t.addAbstractType(e,g[e])}),define("x_ite/Components/Sound/X3DSoundSourceNode",["x_ite/Fields","x_ite/Components/Core/X3DChildNode","x_ite/Components/Time/X3DTimeDependentNode","x_ite/Bits/X3DConstants","standard/Math/Algorithm"],function(t,e,i,n,r){"use strict";function s(r){e.call(this,r),i.call(this,r),this.addType(n.X3DSoundSourceNode),this.addChildObjects("enabled",new t.SFBool(!0)),this.volume=0,this.media=null}return s.prototype=Object.assign(Object.create(e.prototype),i.prototype,{constructor:s,initialize:function(){e.prototype.initialize.call(this),i.prototype.initialize.call(this)},set_browser_live__:function(){i.prototype.set_browser_live__.call(this),this.getDisabled()?(this.getBrowser().volume_.removeInterest("set_volume__",this),this.getBrowser().mute_.removeInterest("set_volume__",this)):(this.getBrowser().volume_.addInterest("set_volume__",this),this.getBrowser().mute_.addInterest("set_volume__",this),this.set_volume__())},setMedia:function(t){if(this.media&&(this.media[0].volume=0,this.media[0].pause(),this.media.unbind("ended")),this.media=t,t){var e=t[0];this.setVolume(0),this.duration_changed_=e.duration,this.resetElapsedTime(),this.isActive_.getValue()?this.isPaused_.getValue()?this.set_pause():this.getLiveState()?this.set_start():this.set_pause():this.set_stop()}},getMedia:function(){return this.media},setVolume:function(t){this.volume=r.clamp(t,0,1),this.set_volume__()},set_volume__:function(){if(this.media){var t=this.getBrowser().mute_.getValue(),e=r.clamp(this.getBrowser().volume_.getValue(),0,1),i=!t*e*this.volume;this.media[0].volume=i}},set_speed:function(){},set_pitch:function(){},set_start:function(){this.media&&this.speed_.getValue()&&(this.media[0].currentTime=0,this.media[0].play())},set_pause:function(){this.media&&(this.media.unbind("ended"),this.media[0].pause())},set_resume:function(){this.media&&this.speed_.getValue()&&this.media[0].play()},set_stop:function(){this.media&&(this.media.unbind("ended"),this.media[0].pause())},set_ended:function(){if(this.media){var t=this.media[0];if(t.currentTime<t.duration)return;this.loop_.getValue()?(this.speed_.getValue()&&t.play(),this.elapsedTime_=this.getElapsedTime()):this.stop()}},set_time:function(){this.set_ended(),this.media&&(this.elapsedTime_=this.getElapsedTime())}}),s}),define("x_ite/Components/Sound/AudioClip",["jquery","x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Sound/X3DSoundSourceNode","x_ite/Components/Networking/X3DUrlObject","x_ite/Bits/X3DConstants","x_ite/DEBUG"],function(t,e,i,n,r,s,o,a){"use strict";function u(i){r.call(this,i),s.call(this,i),this.addType(o.AudioClip),this.addChildObjects("speed",new e.SFFloat(1),"buffer",new e.MFString),this.audio=t("<audio></audio>"),this.urlStack=new e.MFString}return u.prototype=Object.assign(Object.create(r.prototype),s.prototype,{constructor:u,fieldDefinitions:new n([new i(o.inputOutput,"metadata",new e.SFNode),new i(o.inputOutput,"description",new e.SFString),new i(o.inputOutput,"url",new e.MFString),new i(o.inputOutput,"autoRefresh",new e.SFTime),new i(o.inputOutput,"autoRefreshTimeLimit",new e.SFTime(3600)),new i(o.inputOutput,"pitch",new e.SFFloat(1)),new i(o.inputOutput,"loop",new e.SFBool),new i(o.inputOutput,"startTime",new e.SFTime),new i(o.inputOutput,"resumeTime",new e.SFTime),new i(o.inputOutput,"pauseTime",new e.SFTime),new i(o.inputOutput,"stopTime",new e.SFTime),new i(o.outputOnly,"isPaused",new e.SFBool),new i(o.outputOnly,"isActive",new e.SFBool),new i(o.outputOnly,"elapsedTime",new e.SFTime),new i(o.outputOnly,"duration_changed",new e.SFTime(-1))]),getTypeName:function(){return"AudioClip"},getComponentName:function(){return"Sound"},getContainerField:function(){return"source"},initialize:function(){r.prototype.initialize.call(this),s.prototype.initialize.call(this),this.url_.addInterest("set_url__",this),this.buffer_.addInterest("set_buffer__",this),this.audio.on("error",this.setError.bind(this)),this.audio[0].preload="auto",this.audio[0].volume=0,this.audio[0].crossOrigin="Anonymous",this.set_url__()},getElement:function(){return this.audio[0]},set_url__:function(){this.setLoadState(o.NOT_STARTED_STATE),this.requestImmediateLoad()},requestImmediateLoad:function(t=!0){this.checkLoadState()!==o.COMPLETE_STATE&&this.checkLoadState()!==o.IN_PROGRESS_STATE&&(this.setCache(t),this.setLoadState(o.IN_PROGRESS_STATE),this.buffer_=this.url_)},set_buffer__:function(){this.setMedia(null),this.urlStack.setValue(this.buffer_),this.audio.bind("canplaythrough",this.setAudio.bind(this)),this.loadNext()},loadNext:function(){if(0===this.urlStack.length)return this.audio.unbind("canplaythrough"),this.duration_changed_=-1,void this.setLoadState(o.FAILED_STATE);this.URL=new URL(this.urlStack.shift(),this.getExecutionContext().getWorldURL()),this.getBrowser().getBrowserOptions().getCache()&&this.getCache()||this.URL.searchParams.set("_",Date.now()),this.audio.attr("src",this.URL.href),this.audio.get(0).load()},setError:function(){"data:"!==this.URL.protocol&&console.warn("Error loading audio:",this.URL.href),this.loadNext()},setAudio:function(){a&&"data:"!==this.URL.protocol&&console.info("Done loading audio:",this.URL.href),this.audio.unbind("canplaythrough"),this.setMedia(this.audio),this.setLoadState(o.COMPLETE_STATE)}}),u}),define("x_ite/Components/Sound/X3DSoundNode",["x_ite/Components/Core/X3DChildNode","x_ite/Bits/X3DConstants"],function(t,e){"use strict";function i(i){t.call(this,i),this.addType(e.X3DSoundNode)}return i.prototype=Object.assign(Object.create(t.prototype),{constructor:i}),i}),define("x_ite/Components/Sound/Sound",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Sound/X3DSoundNode","x_ite/Bits/X3DCast","x_ite/Bits/TraverseType","x_ite/Bits/X3DConstants","standard/Math/Numbers/Vector3","standard/Math/Numbers/Rotation4","standard/Math/Numbers/Matrix4","standard/Math/Geometry/Line3","standard/Math/Geometry/Sphere3","standard/Math/Algorithm"],function(t,e,i,n,r,s,o,a,u,l,c,h,d){"use strict";function p(e){n.call(this,e),this.addType(o.Sound),this.addChildObjects("traversed",new t.SFBool(!0)),this.location_.setUnit("length"),this.minBack_.setUnit("length"),this.minFront_.setUnit("length"),this.maxBack_.setUnit("length"),this.maxFront_.setUnit("length"),this.currentTraversed=!0}return p.prototype=Object.assign(Object.create(n.prototype),{constructor:p,fieldDefinitions:new i([new e(o.inputOutput,"metadata",new t.SFNode),new e(o.inputOutput,"intensity",new t.SFFloat(1)),new e(o.initializeOnly,"spatialize",new t.SFBool(!0)),new e(o.inputOutput,"location",new t.SFVec3f),new e(o.inputOutput,"direction",new t.SFVec3f(0,0,1)),new e(o.inputOutput,"minBack",new t.SFFloat(1)),new e(o.inputOutput,"minFront",new t.SFFloat(1)),new e(o.inputOutput,"maxBack",new t.SFFloat(10)),new e(o.inputOutput,"maxFront",new t.SFFloat(10)),new e(o.inputOutput,"priority",new t.SFFloat),new e(o.inputOutput,"source",new t.SFNode)]),getTypeName:function(){return"Sound"},getComponentName:function(){return"Sound"},getContainerField:function(){return"children"},initialize:function(){n.prototype.initialize.call(this),this.isLive().addInterest("set_live__",this),this.traversed_.addInterest("set_live__",this),this.source_.addInterest("set_source__",this),this.set_live__(),this.set_source__()},setTraversed:function(t){t?this.traversed_.getValue()===!1&&(this.traversed_=!0):this.currentTraversed!==this.traversed_.getValue()&&(this.traversed_=this.currentTraversed),this.currentTraversed=t},getTraversed:function(){return this.currentTraversed},set_live__:function(){this.isLive().getValue()&&this.traversed_.getValue()?this.getBrowser().sensorEvents().addInterest("update",this):this.getBrowser().sensorEvents().removeInterest("update",this)},set_source__:function(){this.sourceNode&&this.sourceNode.setVolume(0),this.sourceNode=r(o.X3DSoundSourceNode,this.source_)},update:function(){this.getTraversed()||this.sourceNode&&this.sourceNode.setVolume(0),this.setTraversed(!1)},traverse:function(){const t={distance:0,intersection:new a(0,0,0)},e={distance:0,intersection:new a(0,0,0)};return function(i,n){try{if(i!==s.DISPLAY)return;if(!this.sourceNode)return;if(!this.sourceNode.isActive_.getValue()||this.sourceNode.isPaused_.getValue())return;this.setTraversed(!0);const r=n.getModelViewMatrix().get();if(this.getEllipsoidParameter(r,Math.max(this.maxBack_.getValue(),0),Math.max(this.maxFront_.getValue(),0),e),e.distance<1)if(this.getEllipsoidParameter(r,Math.max(this.minBack_.getValue(),0),Math.max(this.minFront_.getValue(),0),t),t.distance<1)this.sourceNode.setVolume(this.intensity_.getValue());else{const i=e.intersection.abs(),n=e.intersection.distance(t.intersection),r=Math.min(i/n,1),s=d.clamp(this.intensity_.getValue(),0,1),o=s*r;this.sourceNode.setVolume(o)}else this.sourceNode.setVolume(0)}catch(t){this.sourceNode&&this.sourceNode.setVolume(0)}}}(),getEllipsoidParameter:function(){const t=new a(0,0,0),e=new l,i=new l,n=new u,r=new a(1,1,1),s=new h(1,a.Zero),o=new a(0,0,0),d=new c(a.Zero,a.zAxis),p=new a(0,0,0),f=new a(0,0,0);return function(u,l,c,h){if(0==l||0==c)return e.multVecMatrix(h.intersection.assign(this.location_.getValue())),void(h.distance=1);const g=(l+c)/2,m=g-l,_=Math.sqrt(g*g-m*m);t.set(0,0,m),r.set(_,_,g),n.setFromToVec(a.zAxis,this.direction_.getValue()),e.assign(u).translate(this.location_.getValue()).rotate(n).translate(t).scale(r),i.assign(e).inverse();const x=i.origin;t.negate().divVec(r),o.assign(t).subtract(x).normalize(),d.set(x,o),s.intersectsLine(d,p,f),h.intersection.assign(e.multVecMatrix(p)),h.distance=x.abs()}}()}),p}),define("x_ite/Components/Sound",["x_ite/Configuration/SupportedNodes","x_ite/Components/Sound/AudioClip","x_ite/Components/Sound/Sound","x_ite/Components/Sound/X3DSoundNode","x_ite/Components/Sound/X3DSoundSourceNode"],function(t,e,i,n,r){"use strict";const s={AudioClip:e,Sound:i},o={X3DSoundNode:n,X3DSoundSourceNode:r};for(const e in s)t.addType(e,s[e]);for(const e in o)t.addAbstractType(e,o[e])}),define("x_ite/Components/Text/Text",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Rendering/X3DGeometryNode","x_ite/Bits/X3DCast","x_ite/Bits/X3DConstants"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(s.Text),this.length_.setUnit("length"),this.maxExtent_.setUnit("length"),this.origin_.setUnit("length"),this.textBounds_.setUnit("length"),this.lineBounds_.setUnit("length")}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(s.inputOutput,"metadata",new t.SFNode),new e(s.inputOutput,"string",new t.MFString),new e(s.inputOutput,"length",new t.MFFloat),new e(s.inputOutput,"maxExtent",new t.SFFloat),new e(s.initializeOnly,"solid",new t.SFBool),new e(s.outputOnly,"origin",new t.SFVec3f),new e(s.outputOnly,"textBounds",new t.SFVec2f),new e(s.outputOnly,"lineBounds",new t.MFVec2f),new e(s.inputOutput,"fontStyle",new t.SFNode)]),getTypeName:function(){return"Text"},getComponentName:function(){return"Text"},getContainerField:function(){return"geometry"},initialize:function(){n.prototype.initialize.call(this),this.fontStyle_.addInterest("set_fontStyle__",this),this.set_fontStyle__()},getMatrix:function(){return this.textGeometry.getMatrix()},getLength:function(t){return t<this.length_.length?Math.max(0,this.length_[t]):0},set_live__:function(){n.prototype.set_live__.call(this),this.isLive().getValue()?this.getBrowser().getBrowserOptions().PrimitiveQuality_.addInterest("requestRebuild",this):this.getBrowser().getBrowserOptions().PrimitiveQuality_.removeInterest("requestRebuild",this)},set_fontStyle__:function(){this.fontStyleNode&&this.fontStyleNode.removeInterest("requestRebuild",this),this.fontStyleNode=r(s.X3DFontStyleNode,this.fontStyle_),this.fontStyleNode||(this.fontStyleNode=this.getBrowser().getDefaultFontStyle()),this.fontStyleNode.addInterest("requestRebuild",this),this.textGeometry=this.fontStyleNode.getTextGeometry(this),this.setTransparent(this.textGeometry.getTransparent())},build:function(){this.textGeometry.update(),this.textGeometry.build(),this.setSolid(this.solid_.getValue())},traverse:function(t,e){try{this.textGeometry.traverse(t,e),n.prototype.traverse.call(this,t,e)}catch(t){console.log(t)}},display:function(t,e){try{this.textGeometry.display(t,e),n.prototype.display.call(this,t,e)}catch(t){console.log(t)}},transformLine:function(t){return this.textGeometry.transformLine(t)},transformMatrix:function(t){return this.textGeometry.transformMatrix(t)}}),o}),define("x_ite/Components/Text",["x_ite/Configuration/SupportedNodes","x_ite/Components/Text/FontStyle","x_ite/Components/Text/Text","x_ite/Components/Text/X3DFontStyleNode"],function(t,e,i,n){"use strict";const r={FontStyle:e,Text:i},s={X3DFontStyleNode:n};for(const e in r)t.addType(e,r[e]);for(const e in s)t.addAbstractType(e,s[e])}),define("x_ite/Components/Texturing/MovieTexture",["jquery","x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Texturing/X3DTexture2DNode","x_ite/Components/Sound/X3DSoundSourceNode","x_ite/Components/Networking/X3DUrlObject","x_ite/Bits/X3DConstants","standard/Math/Algorithm","x_ite/DEBUG"],function(t,e,i,n,r,s,o,a,u,l){"use strict";function c(i){r.call(this,i),s.call(this,i),o.call(this,i),this.addType(a.MovieTexture),this.addChildObjects("buffer",new e.MFString),this.canvas=t("<canvas></canvas>"),this.video=t("<video></video>"),this.urlStack=new e.MFString}return c.prototype=Object.assign(Object.create(r.prototype),s.prototype,o.prototype,{constructor:c,fieldDefinitions:new n([new i(a.inputOutput,"metadata",new e.SFNode),new i(a.inputOutput,"description",new e.SFString),new i(a.inputOutput,"url",new e.MFString),new i(a.inputOutput,"autoRefresh",new e.SFTime),new i(a.inputOutput,"autoRefreshTimeLimit",new e.SFTime(3600)),new i(a.inputOutput,"speed",new e.SFFloat(1)),new i(a.inputOutput,"pitch",new e.SFFloat(1)),new i(a.inputOutput,"loop",new e.SFBool),new i(a.inputOutput,"startTime",new e.SFTime),new i(a.inputOutput,"resumeTime",new e.SFTime),new i(a.inputOutput,"pauseTime",new e.SFTime),new i(a.inputOutput,"stopTime",new e.SFTime),new i(a.outputOnly,"isPaused",new e.SFBool),new i(a.outputOnly,"isActive",new e.SFBool),new i(a.outputOnly,"elapsedTime",new e.SFTime),new i(a.outputOnly,"duration_changed",new e.SFTime(-1)),new i(a.initializeOnly,"repeatS",new e.SFBool(!0)),new i(a.initializeOnly,"repeatT",new e.SFBool(!0)),new i(a.initializeOnly,"textureProperties",new e.SFNode)]),getTypeName:function(){return"MovieTexture"},getComponentName:function(){return"Texturing"},getContainerField:function(){return"texture"},initialize:function(){r.prototype.initialize.call(this),s.prototype.initialize.call(this),o.prototype.initialize.call(this),this.url_.addInterest("set_url__",this),this.buffer_.addInterest("set_buffer__",this),this.video.on("error",this.setError.bind(this)),this.video[0].preload="auto",this.video[0].volume=0,this.video[0].crossOrigin="Anonymous",this.set_url__()},getElement:function(){return this.video[0]},set_url__:function(){this.setLoadState(a.NOT_STARTED_STATE),this.requestImmediateLoad()},requestImmediateLoad:function(t=!0){this.checkLoadState()!==a.COMPLETE_STATE&&this.checkLoadState()!==a.IN_PROGRESS_STATE&&(this.setCache(t),this.setLoadState(a.IN_PROGRESS_STATE),this.buffer_=this.url_)},set_buffer__:function(){this.setMedia(null),this.urlStack.setValue(this.buffer_),this.video.bind("canplaythrough",this.setVideo.bind(this)),this.loadNext()},loadNext:function(){if(0===this.urlStack.length)return this.video.unbind("canplaythrough"),this.duration_changed_=-1,this.clearTexture(),void this.setLoadState(a.FAILED_STATE);this.URL=new URL(this.urlStack.shift(),this.getExecutionContext().getWorldURL()),this.getBrowser().getBrowserOptions().getCache()&&this.getCache()||this.URL.searchParams.set("_",Date.now()),this.video.attr("src",this.URL.href),this.video.get(0).load()},setError:function(){"data:"!==this.URL.protocol&&console.warn("Error loading movie:",this.URL.href),this.loadNext()},setVideo:function(){l&&"data:"!==this.URL.protocol&&console.info("Done loading movie:",this.URL.href);try{this.video.unbind("canplaythrough");const t=this.video[0],e=t.videoWidth,i=t.videoHeight,n=this.canvas[0],r=n.getContext("2d");if(!u.isPowerOfTwo(e)||!u.isPowerOfTwo(i))throw new Error("The movie texture is a non power-of-two texture.");n.width=e,n.height=i,r.drawImage(t,0,0);const s=r.getImageData(0,0,e,i).data;setTimeout(function(){this.setMedia(this.video),this.setTexture(e,i,!1,new Uint8Array(s),!0),this.setLoadState(a.COMPLETE_STATE)}.bind(this),16)}catch(t){console.log(t.message),this.setError()}},set_time:function(){s.prototype.set_time.call(this),this.checkLoadState()===a.COMPLETE_STATE&&this.updateTexture(this.getMedia()[0],!0)},traverse:r.prototype.traverse}),c}),define("x_ite/Components/Texturing/MultiTexture",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Texturing/X3DTextureNode","x_ite/Bits/X3DConstants","x_ite/Bits/X3DCast","x_ite/Browser/Texturing/MultiTextureModeType","x_ite/Browser/Texturing/MultiTextureSourceType","x_ite/Browser/Texturing/MultiTextureFunctionType"],function(t,e,i,n,r,s,o,a,u){"use strict";function l(e){n.call(this,e),this.addType(r.MultiTexture),this.addChildObjects("loadState",new t.SFInt32(r.NOT_STARTED_STATE)),this.color=new Float32Array(4),this.modes=[],this.alphaModes=[],this.sources=[],this.functions=[],this.textureNodes=[]}return l.prototype=Object.assign(Object.create(n.prototype),{constructor:l,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"description",new t.SFString),new e(r.inputOutput,"color",new t.SFColor(1,1,1)),new e(r.inputOutput,"alpha",new t.SFFloat(1)),new e(r.inputOutput,"mode",new t.MFString),new e(r.inputOutput,"source",new t.MFString),new e(r.inputOutput,"function",new t.MFString),new e(r.inputOutput,"texture",new t.MFNode)]),getTypeName:function(){return"MultiTexture"},getComponentName:function(){return"Texturing"},getContainerField:function(){return"texture"},initialize:function(){n.prototype.initialize.call(this),this.color_.addInterest("set_color__",this),this.alpha_.addInterest("set_alpha__",this),this.mode_.addInterest("set_mode__",this),this.source_.addInterest("set_source__",this),this.function_.addInterest("set_function__",this),this.texture_.addInterest("set_texture__",this),this.set_color__(),this.set_alpha__(),this.set_mode__(),this.set_source__(),this.set_function__(),this.set_texture__(),this.loadState_=r.COMPLETE_STATE},getMode:function(t){return t<this.modes.length?this.modes[t]:o.MODULATE},getAlphaMode:function(t){return t<this.alphaModes.length?this.alphaModes[t]:o.MODULATE},getSource:function(t){return t<this.sources.length?this.sources[t]:a.DEFAULT},getFunction:function(t){return t<this.functions.length?this.functions[t]:u.DEFAULT},set_color__:function(){this.color[0]=this.color_.r,this.color[1]=this.color_.g,this.color[2]=this.color_.b},set_alpha__:function(){this.color[3]=this.alpha_},set_mode__:function(){var t=new Map([["REPLACE",o.REPLACE],["MODULATE",o.MODULATE],["MODULATE2X",o.MODULATE2X],["MODULATE4X",o.MODULATE4X],["ADD",o.ADD],["ADDSIGNED",o.ADDSIGNED],["ADDSIGNED2X",o.ADDSIGNED2X],["ADDSMOOTH",o.ADDSMOOTH],["SUBTRACT",o.SUBTRACT],["BLENDDIFFUSEALPHA",o.BLENDDIFFUSEALPHA],["BLENDTEXTUREALPHA",o.BLENDTEXTUREALPHA],["BLENDFACTORALPHA",o.BLENDFACTORALPHA],["BLENDCURRENTALPHA",o.BLENDCURRENTALPHA],["MODULATEALPHA_ADDCOLOR",o.MODULATEALPHA_ADDCOLOR],["MODULATEINVALPHA_ADDCOLOR",o.MODULATEINVALPHA_ADDCOLOR],["MODULATEINVCOLOR_ADDALPHA",o.MODULATEINVCOLOR_ADDALPHA],["DOTPRODUCT3",o.DOTPRODUCT3],["SELECTARG1",o.SELECTARG1],["SELECTARG2",o.SELECTARG2],["OFF",o.OFF]]);return function(){this.modes.length=0,this.alphaModes.length=0;for(var e=0,i=this.mode_.length;e<i;++e){for(var n=this.mode_[e].split(","),r=0,s=n.length;r<s;++r)n[r]=n[r].trim();0===n.length&&n.push("MODULATE"),n.length<2&&n.push(n[0]);var a=t.get(n[0]);void 0!==a?this.modes.push(a):this.modes.push(o.MODULATE);var a=t.get(n[1]);void 0!==a?this.alphaModes.push(a):this.alphaModes.push(o.MODULATE)}}}(),set_source__:function(){var t=new Map([["DIFFUSE",a.DIFFUSE],["SPECULAR",a.SPECULAR],["FACTOR",a.FACTOR]]);return function(){this.sources.length=0;for(var e=0,i=this.source_.length;e<i;++e){var n=t.get(this.source_[e]);void 0!==n?this.sources.push(n):this.sources.push(a.DEFAULT)}}}(),set_function__:function(){var t=new Map([["COMPLEMENT",u.COMPLEMENT],["ALPHAREPLICATE",u.ALPHAREPLICATE]]);return function(){this.functions.length=0;for(var e=0,i=this.function_.length;e<i;++e){var n=t.get(this.function_[e]);void 0!==n?this.functions.push(n):this.functions.push(u.DEFAULT)}}}(),set_texture__:function(){this.textureNodes.length=0;for(var t=0,e=this.texture_.length;t<e;++t){var i=this.texture_[t];if(!s(r.MultiTexture,i)){var n=s(r.X3DTextureNode,i);n&&this.textureNodes.push(n)}}},traverse:function(t,e){for(var i=this.textureNodes,n=0,r=i.length;n<r;++n)i[n].traverse(t,e)},setShaderUniforms:function(t,e,i){var n=this.textureNodes,r=Math.min(e.getBrowser().getMaxTextures(),n.length);t.uniform1i(e.x3d_NumTextures,r),t.uniform4fv(e.x3d_MultiTextureColor,this.color);for(var s=0;s<r;++s)n[s].setShaderUniformsToChannel(t,e,i,s),t.uniform1i(e.x3d_MultiTextureMode[s],this.getMode(s)),t.uniform1i(e.x3d_MultiTextureAlphaMode[s],this.getAlphaMode(s)),t.uniform1i(e.x3d_MultiTextureSource[s],this.getSource(s)),t.uniform1i(e.x3d_MultiTextureFunction[s],this.getFunction(s))}}),l}),define("x_ite/Components/Texturing/MultiTextureCoordinate",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Texturing/X3DTextureCoordinateNode","x_ite/Bits/X3DConstants","x_ite/Bits/X3DCast"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.MultiTextureCoordinate),this.textureCoordinateNodes=[]}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"texCoord",new t.MFNode)]),getTypeName:function(){return"MultiTextureCoordinate"},getComponentName:function(){return"Texturing"},getContainerField:function(){return"texCoord"},initialize:function(){n.prototype.initialize.call(this),this.texCoord_.addInterest("set_texCoord__",this),this.set_texCoord__()},set_texCoord__:function(){const t=this.textureCoordinateNodes;for(const e of t)e.removeInterest("addNodeEvent",this);t.length=0;for(const e of this.texCoord_)if(!s(r.MultiTextureCoordinate,e)){const i=s(r.X3DTextureCoordinateNode,e);i&&t.push(i)}for(const e of t)e.addInterest("addNodeEvent",this)},isEmpty:function(){return!0},getSize:function(){return 0},get1Point:function(t,e){for(const i of this.textureCoordinateNodes)return i.get1Point(t,e);return e.set(0,0,0,1)},init:function(t){for(const e of this.textureCoordinateNodes)e.init(t)},addTexCoord:function(t,e){const i=this.textureCoordinateNodes;for(let n=0,r=i.length;n<r;++n)i[n].addTexCoordToChannel(t,e[n])},addTexCoordToChannel:function(t,e){},getTexCoord:function(t){for(const e of this.textureCoordinateNodes)return e.getTexCoord(t);return t},setShaderUniforms:function(t,e){const i=this.textureCoordinateNodes,n=Math.min(e.x3d_MaxTextures,i.length);for(let r=0;r<n;++r)i[r].setShaderUniformsToChannel(t,e,r);const r=n?i.at(-1):this;for(let s=n,o=e.x3d_MaxTextures;s<o;++s)i[r].setShaderUniformsToChannel(t,e,s)}}),o}),define("x_ite/Components/Texturing/MultiTextureTransform",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Texturing/X3DTextureTransformNode","x_ite/Bits/X3DConstants","x_ite/Bits/X3DCast"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.MultiTextureTransform),this.textureTransformNodes=[]}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"textureTransform",new t.MFNode)]),getTypeName:function(){return"MultiTextureTransform"},getComponentName:function(){return"Texturing"},getContainerField:function(){return"textureTransform"},initialize:function(){n.prototype.initialize.call(this),this.textureTransform_.addInterest("set_textureTransform_",this),this.set_textureTransform__()},set_textureTransform__:function(){const t=this.textureTransformNodes;t.length=0;for(const e of this.textureTransform_)if(!s(r.MultiTextureTransform,e)){const i=s(r.X3DTextureTransformNode,e);i&&t.push(i)}},setShaderUniforms:function(t,e){const i=this.textureTransformNodes,n=Math.min(e.x3d_MaxTextures,i.length);for(let r=0;r<n;++r)i[r].setShaderUniformsToChannel(t,e,r);const r=n?i.at(-1):this;for(let i=n,s=e.x3d_MaxTextures;i<s;++i)r.setShaderUniformsToChannel(t,e,i)}}),o}),define("x_ite/Components/Texturing/PixelTexture",["jquery","x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Texturing/X3DTexture2DNode","x_ite/Bits/X3DConstants","standard/Math/Algorithm","standard/Math/Numbers/Vector3","standard/Math/Numbers/Matrix3"],function(t,e,i,n,r,s,o){"use strict";function a(t){r.call(this,t),this.addType(s.PixelTexture),this.addChildObjects("loadState",new e.SFInt32(s.NOT_STARTED_STATE))}return a.prototype=Object.assign(Object.create(r.prototype),{constructor:a,fieldDefinitions:new n([new i(s.inputOutput,"metadata",new e.SFNode),new i(s.inputOutput,"description",new e.SFString),new i(s.inputOutput,"image",new e.SFImage(0,0,0,new e.MFInt32)),new i(s.initializeOnly,"repeatS",new e.SFBool(!0)),new i(s.initializeOnly,"repeatT",new e.SFBool(!0)),new i(s.initializeOnly,"textureProperties",new e.SFNode)]),getTypeName:function(){return"PixelTexture"},getComponentName:function(){return"Texturing"},getContainerField:function(){return"texture"},initialize:function(){r.prototype.initialize.call(this),this.image_.addInterest("set_image__",this),this.canvas1=t("<canvas></canvas>"),this.canvas2=t("<canvas></canvas>"),this.set_image__()},checkLoadState:function(){return this.loadState_.getValue()},convert:function(t,e,i,n){switch(e){case 1:for(var r=0,s=0;r<n;++r,s+=4){var o=i[r];t[s]=t[s+1]=t[s+2]=255&o,t[s+3]=255}break;case 2:for(var r=0,s=0;r<n;++r,s+=4){var o=i[r];t[s]=t[s+1]=t[s+2]=o>>>8&255,t[s+3]=255&o}break;case 3:for(var r=0,s=0;r<n;++r,s+=4){var o=i[r];t[s]=o>>>16&255,t[s+1]=o>>>8&255,t[s+2]=255&o,t[s+3]=255}break;case 4:for(var r=0,s=0;r<n;++r,s+=4){var o=i[r];t[s]=o>>>24,t[s+1]=o>>>16&255,t[s+2]=o>>>8&255,t[s+3]=255&o}}},resize:function(t,e,i,n,r){for(var s=new Uint8Array(n*r*4),o=n/e,a=r/i,u=0;u<r;++u)for(var l=Math.floor(u/a)*e,c=u*n,h=0;h<n;++h){var d=4*(l+Math.floor(h/o)),p=4*(c+h);s[p]=t[d],s[p+1]=t[d+1],s[p+2]=t[d+2],s[p+3]=t[d+3]}return s},set_image__:function(){var t=this.getBrowser().getContext(),e=this.image_.width,i=this.image_.height,n=this.image_.comp,r=this.image_.array,a=!(n%2),u=null;if(e>0&&i>0&&n>0&&n<5){if(t.getVersion()>=2||o.isPowerOfTwo(e)&&o.isPowerOfTwo(i))u=new Uint8Array(e*i*4),this.convert(u,n,r.getValue(),r.length);else if(Math.max(e,i)<this.getBrowser().getMinTextureSize()&&!this.textureProperties_.getValue()){u=new Uint8Array(e*i*4),this.convert(u,n,r.getValue(),r.length);var l=e,c=i;e=4*o.nextPowerOfTwo(l),i=4*o.nextPowerOfTwo(c),u=this.resize(u,l,c,e,i)}else{var h=this.canvas1[0],d=this.canvas2[0],p=h.getContext("2d"),f=d.getContext("2d"),g=p.createImageData(e,i);h.width=e,h.height=i,this.convert(g.data,n,r,r.length),p.putImageData(g,0,0),e=o.nextPowerOfTwo(e),i=o.nextPowerOfTwo(i),d.width=e,d.height=i,f.clearRect(0,0,e,i),f.drawImage(h,0,0,h.width,h.height,0,0,e,i),u=f.getImageData(0,0,e,i).data}this.setTexture(e,i,a,new Uint8Array(u),!1),this.loadState_=s.COMPLETE_STATE}else this.clearTexture(),this.loadState_=s.FAILED_STATE}}),a}),define("x_ite/Components/Texturing/TextureCoordinateGenerator",["x_ite/Fields","x_ite/Basic/X3DFieldDefinition","x_ite/Basic/FieldDefinitionArray","x_ite/Components/Texturing/X3DSingleTextureCoordinateNode","x_ite/Bits/X3DConstants","x_ite/Browser/Texturing/TextureCoordinateGeneratorModeType"],function(t,e,i,n,r,s){"use strict";function o(t){n.call(this,t),this.addType(r.TextureCoordinateGenerator),this.mode=s.SPHERE,this.parameter=new Float32Array(6)}return o.prototype=Object.assign(Object.create(n.prototype),{constructor:o,fieldDefinitions:new i([new e(r.inputOutput,"metadata",new t.SFNode),new e(r.inputOutput,"mapping",new t.SFString),new e(r.inputOutput,"mode",new t.SFString("SPHERE")),new e(r.inputOutput,"parameter",new t.MFFloat)]),getTypeName:function(){return"TextureCoordinateGenerator"},
|