UNPKG

@jcmap-sdk-web/navegador

Version:

甲虫室内定位导航引擎

1 lines 243 kB
!function(e){"function"==typeof define&&define.amd?define(e):e()}((function(){"use strict";var e,r;e=window,r=function(e){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function t(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function n(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,r,t){return r&&n(e.prototype,r),t&&n(e,t),e}function o(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function a(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function s(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?a(Object(t),!0).forEach((function(r){o(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):a(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,r){return(u=Object.setPrototypeOf||function(e,r){return e.__proto__=r,e})(e,r)}function c(e,r){return!r||"object"!=typeof r&&"function"!=typeof r?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):r}function l(e){var r=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var t,n=f(e);if(r){var i=f(this).constructor;t=Reflect.construct(n,arguments,i)}else t=n.apply(this,arguments);return c(this,t)}}function A(e,r){return _(e)||function(e,r){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var t=[],n=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(n=(a=s.next()).done)&&(t.push(a.value),!r||t.length!==r);n=!0);}catch(e){i=!0,o=e}finally{try{n||null==s.return||s.return()}finally{if(i)throw o}}return t}}(e,r)||v(e,r)||m()}function d(e){return _(e)||g(e)||v(e)||m()}function h(e){return function(e){if(Array.isArray(e))return p(e)}(e)||g(e)||v(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(e){if(Array.isArray(e))return e}function g(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function v(e,r){if(e){if("string"==typeof e)return p(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?p(e,r):void 0}}function p(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function m(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var b,w="object"===("undefined"==typeof Reflect?"undefined":r(Reflect))?Reflect:null,k=w&&"function"==typeof w.apply?w.apply:function(e,r,t){return Function.prototype.apply.call(e,r,t)};b=w&&"function"==typeof w.ownKeys?w.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var y=Number.isNaN||function(e){return e!=e};function E(){E.init.call(this)}var C=E,S=function(e,r){return new Promise((function(t,n){function i(){void 0!==o&&e.removeListener("error",o),t([].slice.call(arguments))}var o;"error"!==r&&(o=function(t){e.removeListener(r,i),n(t)},e.once("error",o)),e.once(r,i)}))};E.EventEmitter=E,E.prototype._events=void 0,E.prototype._eventsCount=0,E.prototype._maxListeners=void 0;var D=10;function F(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+r(e))}function P(e){return void 0===e._maxListeners?E.defaultMaxListeners:e._maxListeners}function R(e,r,t,n){var i,o,a,s;if(F(t),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",r,t.listener?t.listener:t),o=e._events),a=o[r]),void 0===a)a=o[r]=t,++e._eventsCount;else if("function"==typeof a?a=o[r]=n?[t,a]:[a,t]:n?a.unshift(t):a.push(t),(i=P(e))>0&&a.length>i&&!a.warned){a.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(r)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=e,f.type=r,f.count=a.length,s=f,console&&console.warn&&console.warn(s)}return e}function x(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function M(e,r,t){var n={fired:!1,wrapFn:void 0,target:e,type:r,listener:t},i=x.bind(n);return i.listener=t,n.wrapFn=i,i}function L(e,r,t){var n=e._events;if(void 0===n)return[];var i=n[r];return void 0===i?[]:"function"==typeof i?t?[i.listener||i]:[i]:t?function(e){for(var r=new Array(e.length),t=0;t<r.length;++t)r[t]=e[t].listener||e[t];return r}(i):j(i,i.length)}function O(e){var r=this._events;if(void 0!==r){var t=r[e];if("function"==typeof t)return 1;if(void 0!==t)return t.length}return 0}function j(e,r){for(var t=new Array(r),n=0;n<r;++n)t[n]=e[n];return t}Object.defineProperty(E,"defaultMaxListeners",{enumerable:!0,get:function(){return D},set:function(e){if("number"!=typeof e||e<0||y(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");D=e}}),E.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},E.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||y(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},E.prototype.getMaxListeners=function(){return P(this)},E.prototype.emit=function(e){for(var r=[],t=1;t<arguments.length;t++)r.push(arguments[t]);var n="error"===e,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var o;if(r.length>0&&(o=r[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var s=i[e];if(void 0===s)return!1;if("function"==typeof s)k(s,this,r);else{var f=s.length,u=j(s,f);for(t=0;t<f;++t)k(u[t],this,r)}return!0},E.prototype.addListener=function(e,r){return R(this,e,r,!1)},E.prototype.on=E.prototype.addListener,E.prototype.prependListener=function(e,r){return R(this,e,r,!0)},E.prototype.once=function(e,r){return F(r),this.on(e,M(this,e,r)),this},E.prototype.prependOnceListener=function(e,r){return F(r),this.prependListener(e,M(this,e,r)),this},E.prototype.removeListener=function(e,r){var t,n,i,o,a;if(F(r),void 0===(n=this._events))return this;if(void 0===(t=n[e]))return this;if(t===r||t.listener===r)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,t.listener||r));else if("function"!=typeof t){for(i=-1,o=t.length-1;o>=0;o--)if(t[o]===r||t[o].listener===r){a=t[o].listener,i=o;break}if(i<0)return this;0===i?t.shift():function(e,r){for(;r+1<e.length;r++)e[r]=e[r+1];e.pop()}(t,i),1===t.length&&(n[e]=t[0]),void 0!==n.removeListener&&this.emit("removeListener",e,a||r)}return this},E.prototype.off=E.prototype.removeListener,E.prototype.removeAllListeners=function(e){var r,t,n;if(void 0===(t=this._events))return this;if(void 0===t.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==t[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete t[e]),this;if(0===arguments.length){var i,o=Object.keys(t);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(r=t[e]))this.removeListener(e,r);else if(void 0!==r)for(n=r.length-1;n>=0;n--)this.removeListener(e,r[n]);return this},E.prototype.listeners=function(e){return L(this,e,!0)},E.prototype.rawListeners=function(e){return L(this,e,!1)},E.listenerCount=function(e,r){return"function"==typeof e.listenerCount?e.listenerCount(r):O.call(e,r)},E.prototype.listenerCount=O,E.prototype.eventNames=function(){return this._eventsCount>0?b(this._events):[]},C.once=S;var I={meters:6371008.8,metres:6371008.8,millimeters:6371008800,millimetres:6371008800,centimeters:637100880,centimetres:637100880,kilometers:6371.0088,kilometres:6371.0088,miles:3958.761333810546,nauticalmiles:6371008.8/1852,inches:6371008.8*39.37,yards:6371008.8/1.0936,feet:20902260.511392,radians:1,degrees:6371008.8/111325};function N(e,r,t){if(!Y(t=t||{}))throw new Error("options is invalid");var n=t.bbox,i=t.id;if(void 0===e)throw new Error("geometry is required");if(r&&r.constructor!==Object)throw new Error("properties must be an Object");n&&X(n),i&&H(i);var o={type:"Feature"};return i&&(o.id=i),n&&(o.bbox=n),o.properties=r||{},o.geometry=e,o}function B(e,r,t){if(!e)throw new Error("coordinates is required");if(!Array.isArray(e))throw new Error("coordinates must be an Array");if(e.length<2)throw new Error("coordinates must be at least 2 numbers long");if(!G(e[0])||!G(e[1]))throw new Error("coordinates must contain numbers");return N({type:"Point",coordinates:e},r,t)}function V(e,r,t){if(!e)throw new Error("coordinates is required");if(e.length<2)throw new Error("coordinates must be an array of two or more positions");if(!G(e[0][1])||!G(e[0][1]))throw new Error("coordinates must contain numbers");return N({type:"LineString",coordinates:e},r,t)}function z(e,r){if(null==e)throw new Error("radians is required");if(r&&"string"!=typeof r)throw new Error("units must be a string");var t=I[r||"kilometers"];if(!t)throw new Error(r+" units is invalid");return e*t}function T(e,r){if(null==e)throw new Error("distance is required");if(r&&"string"!=typeof r)throw new Error("units must be a string");var t=I[r||"kilometers"];if(!t)throw new Error(r+" units is invalid");return e/t}function Z(e){if(null==e)throw new Error("radians is required");return e%(2*Math.PI)*180/Math.PI}function W(e){if(null==e)throw new Error("degrees is required");return e%360*Math.PI/180}function G(e){return!isNaN(e)&&null!==e&&!Array.isArray(e)}function Y(e){return!!e&&e.constructor===Object}function X(e){if(!e)throw new Error("bbox is required");if(!Array.isArray(e))throw new Error("bbox must be an Array");if(4!==e.length&&6!==e.length)throw new Error("bbox must be an Array of 4 or 6 numbers");e.forEach((function(e){if(!G(e))throw new Error("bbox must only contain numbers")}))}function H(e){if(!e)throw new Error("id is required");if(-1===["string","number"].indexOf(r(e)))throw new Error("id must be a number or a string")}function J(e){if(!e)throw new Error("obj is required");var r=U(e);if(r.length>1&&G(r[0])&&G(r[1]))return r;throw new Error("Coordinate is not a valid Point")}function U(e){if(!e)throw new Error("obj is required");var r;if(e.length?r=e:e.coordinates?r=e.coordinates:e.geometry&&e.geometry.coordinates&&(r=e.geometry.coordinates),r)return function e(r){if(r.length>1&&G(r[0])&&G(r[1]))return!0;if(Array.isArray(r[0])&&r[0].length)return e(r[0]);throw new Error("coordinates must only contain numbers")}(r),r;throw new Error("No valid coordinates")}function Q(e,r,t){if(!Y(t=t||{}))throw new Error("options is invalid");var n=t.units,i=J(e),o=J(r),a=W(o[1]-i[1]),s=W(o[0]-i[0]),f=W(i[1]),u=W(o[1]),c=Math.pow(Math.sin(a/2),2)+Math.pow(Math.sin(s/2),2)*Math.cos(f)*Math.cos(u);return z(2*Math.atan2(Math.sqrt(c),Math.sqrt(1-c)),n)}function q(e){return null!=e&&"object"===r(e)&&!0===e["@@functional/placeholder"]}function K(e){return function r(t){return 0===arguments.length||q(t)?r:e.apply(this,arguments)}}function $(e){return function r(t,n){switch(arguments.length){case 0:return r;case 1:return q(t)?r:K((function(r){return e(t,r)}));default:return q(t)&&q(n)?r:q(t)?K((function(r){return e(r,n)})):q(n)?K((function(r){return e(t,r)})):e(t,n)}}}function ee(e){return function r(t,n,i){switch(arguments.length){case 0:return r;case 1:return q(t)?r:$((function(r,n){return e(t,r,n)}));case 2:return q(t)&&q(n)?r:q(t)?$((function(r,t){return e(r,n,t)})):q(n)?$((function(r,n){return e(t,r,n)})):K((function(r){return e(t,n,r)}));default:return q(t)&&q(n)&&q(i)?r:q(t)&&q(n)?$((function(r,t){return e(r,t,i)})):q(t)&&q(i)?$((function(r,t){return e(r,n,t)})):q(n)&&q(i)?$((function(r,n){return e(t,r,n)})):q(t)?K((function(r){return e(r,n,i)})):q(n)?K((function(r){return e(t,r,i)})):q(i)?K((function(r){return e(t,n,r)})):e(t,n,i)}}}var re=Number.isInteger||function(e){return e<<0===e},te=$((function(e,r){var t,n=e<0?r.length+e:e;return t=r,"[object String]"===Object.prototype.toString.call(t)?r.charAt(n):r[n]})),ne=$((function(e,r){return e.map((function(e){for(var t,n=r,i=0;i<e.length;){if(null==n)return;t=e[i],n=re(t)?te(t,n):n[t],i+=1}return n}))})),ie=$((function(e,r){return ne([e],r)[0]})),oe=$((function(e,r){return null==r||r!=r?e:r}));function ae(e){return"[object Number]"===Object.prototype.toString.call(e)}var se=ee((function(e,r,t){return oe(e,ie(r,t))})),fe=ee((function(e,r,t){return se(e,[r],t)})),ue=$((function(e,r){if(!ae(e)||!ae(r))throw new TypeError("Both arguments to range must be numbers");for(var t=[],n=e;n<r;)t.push(n),n+=1;return t}));function ce(e,r,t){if(!Y(t=t||{}))throw new Error("options is invalid");if(!0===t.final)return function(e,r){var t=ce(r,e);return t=(t+180)%360}(e,r);var n=J(e),i=J(r),o=W(n[0]),a=W(i[0]),s=W(n[1]),f=W(i[1]),u=Math.sin(a-o)*Math.cos(f),c=Math.cos(s)*Math.sin(f)-Math.sin(s)*Math.cos(f)*Math.cos(a-o);return Z(Math.atan2(u,c))}function le(e,r,t,n){if(!Y(n=n||{}))throw new Error("options is invalid");var i=n.units,o=n.properties,a=J(e),s=W(a[0]),f=W(a[1]),u=W(t),c=T(r,i),l=Math.asin(Math.sin(f)*Math.cos(c)+Math.cos(f)*Math.sin(c)*Math.cos(u));return B([Z(s+Math.atan2(Math.sin(u)*Math.sin(c)*Math.cos(f),Math.cos(c)-Math.sin(f)*Math.sin(l))),Z(l)],o)}function Ae(e,r,t){if(!Y(t=t||{}))throw new Error("options is invalid");var n;if("Feature"===e.type)n=e.geometry.coordinates;else{if("LineString"!==e.type)throw new Error("input must be a LineString Feature or Geometry");n=e.coordinates}if(!G(r))throw new Error("distance must be a number");for(var i=0,o=0;o<n.length&&!(r>=i&&o===n.length-1);o++){if(i>=r){var a=r-i;if(a){var s=ce(n[o],n[o-1])-180;return le(n[o],a,s,t)}return B(n[o])}i+=Q(n[o],n[o+1],t)}return B(n[n.length-1])}function de(e){return(de="function"==typeof Symbol&&"symbol"===r(Symbol.iterator)?function(e){return r(e)}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":r(e)})(e)}function he(){var e,r=void 0!==r?r:{},t={};for(e in r)r.hasOwnProperty(e)&&(t[e]=r[e]);var n,i,o="";document.currentScript&&(o=document.currentScript.src),o=0!==o.indexOf("blob:")?o.substr(0,o.lastIndexOf("/")+1):"",n=function(e){try{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.send(null),r.responseText}catch(r){var t=Ae(e);if(t)return function(e){for(var r=[],t=0;t<e.length;t++){var n=e[t];n>255&&(n&=255),r.push(String.fromCharCode(n))}return r.join("")}(t);throw r}},i=function(e,r,t){var n=new XMLHttpRequest;n.open("GET",e,!0),n.responseType="arraybuffer",n.onload=function(){if(200==n.status||0==n.status&&n.response)r(n.response);else{var i=Ae(e);i?r(i.buffer):t()}},n.onerror=t,n.send(null)};var a=r.print||console.log.bind(console),s=r.printErr||console.warn.bind(console);for(e in t)t.hasOwnProperty(e)&&(r[e]=t[e]);t=null,new Array(0);var f=0,u=!1;function c(e){var t,n=r["_"+e];return t="Cannot call unknown function "+e+", make sure it is exported",n||T("Assertion failed: "+t),n}function l(e,r,t,n,i){var o={string:function(e){var r=0;if(null!=e&&0!==e){var t=1+(e.length<<2);y(e,r=me(t),t)}return r},array:function(e){var r=me(e.length);return function(e,r){d.set(e,r)}(e,r),r}},a=c(e),s=[],f=0;if(n)for(var u=0;u<n.length;u++){var l=o[t[u]];l?(0===f&&(f=we()),s[u]=l(n[u])):s[u]=n[u]}var A=a.apply(null,s);return A=function(e){return"string"===r?w(e):"boolean"===r?Boolean(e):e}(A),0!==f&&be(f),A}var A,d,h,_,g,v,p,m="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function b(e,r,t){for(var n=r+t,i=r;e[i]&&!(i>=n);)++i;if(i-r>16&&e.subarray&&m)return m.decode(e.subarray(r,i));for(var o="";r<i;){var a=e[r++];if(128&a){var s=63&e[r++];if(192!=(224&a)){var f=63&e[r++];if((a=224==(240&a)?(15&a)<<12|s<<6|f:(7&a)<<18|s<<12|f<<6|63&e[r++])<65536)o+=String.fromCharCode(a);else{var u=a-65536;o+=String.fromCharCode(55296|u>>10,56320|1023&u)}}else o+=String.fromCharCode((31&a)<<6|s)}else o+=String.fromCharCode(a)}return o}function w(e,r){return e?b(h,e,r):""}function k(e,r,t,n){if(!(n>0))return 0;for(var i=t,o=t+n-1,a=0;a<e.length;++a){var s=e.charCodeAt(a);if(s>=55296&&s<=57343&&(s=65536+((1023&s)<<10)|1023&e.charCodeAt(++a)),s<=127){if(t>=o)break;r[t++]=s}else if(s<=2047){if(t+1>=o)break;r[t++]=192|s>>6,r[t++]=128|63&s}else if(s<=65535){if(t+2>=o)break;r[t++]=224|s>>12,r[t++]=128|s>>6&63,r[t++]=128|63&s}else{if(t+3>=o)break;r[t++]=240|s>>18,r[t++]=128|s>>12&63,r[t++]=128|s>>6&63,r[t++]=128|63&s}}return r[t]=0,t-i}function y(e,r,t){return k(e,h,r,t)}function E(e){for(var r=0,t=0;t<e.length;++t){var n=e.charCodeAt(t);n>=55296&&n<=57343&&(n=65536+((1023&n)<<10)|1023&e.charCodeAt(++t)),n<=127?++r:r+=n<=2047?2:n<=65535?3:4}return r}function C(e,r){return e%r>0&&(e+=r-e%r),e}function S(e){A=e,r.HEAP8=d=new Int8Array(e),r.HEAP16=_=new Int16Array(e),r.HEAP32=g=new Int32Array(e),r.HEAPU8=h=new Uint8Array(e),r.HEAPU16=new Uint16Array(e),r.HEAPU32=new Uint32Array(e),r.HEAPF32=v=new Float32Array(e),r.HEAPF64=p=new Float64Array(e)}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le");var D=r.TOTAL_MEMORY||16777216;function F(e){for(;e.length>0;){var t=e.shift();if("function"!=typeof t){var n=t.func;"number"==typeof n?void 0===t.arg?r.dynCall_v(n):r.dynCall_vi(n,t.arg):n(void 0===t.arg?null:t.arg)}else t()}}D=(A=r.buffer?r.buffer:new ArrayBuffer(D)).byteLength,S(A),g[1408]=5248720;var P=[],R=[],x=[],M=[],L=Math.abs,O=Math.ceil,j=Math.floor,I=Math.min,N=0,B=null;function V(e){N++,r.monitorRunDependencies&&r.monitorRunDependencies(N)}function z(e){if(N--,r.monitorRunDependencies&&r.monitorRunDependencies(N),0==N&&B){var t=B;B=null,t()}}function T(e){throw r.onAbort&&r.onAbort(e),a(e+=""),s(e),u=!0,"abort("+e+"). Build with -s ASSERTIONS=1 for more info."}r.preloadedImages={},r.preloadedAudios={};var Z,W,G=null,Y="data:application/octet-stream;base64,";function X(e){return String.prototype.startsWith?e.startsWith(Y):0===e.indexOf(Y)}function H(e){return e}function J(e){return e.replace(/\b__Z[\w\d_]+/g,(function(e){return e==e?e:e+" ["+e+"]"}))}function U(){var e=new Error;if(!e.stack){try{throw new Error(0)}catch(r){e=r}if(!e.stack)return"(no stack trace available)"}return e.stack.toString()}function Q(){var e=U();return r.extraStackTrace&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?|)(\.[^.\/]*|))(?:[\/]*)$/.exec(e).slice(1)},normalizeArray:function(e,r){for(var t=0,n=e.length-1;n>=0;n--){var i=e[n];"."===i?e.splice(n,1):".."===i?(e.splice(n,1),t++):t&&(e.splice(n,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:function(e){var r="/"===e.charAt(0),t="/"===e.substr(-1);return(e=q.normalizeArray(e.split("/").filter((function(e){return!!e})),!r).join("/"))||r||(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:function(e){var r=q.splitPath(e),t=r[0],n=r[1];return t||n?(n&&(n=n.substr(0,n.length-1)),t+n):"."},basename:function(e){if("/"===e)return"/";var r=e.lastIndexOf("/");return-1===r?e:e.substr(r+1)},extname:function(e){return q.splitPath(e)[3]},join:function(){var e=Array.prototype.slice.call(arguments,0);return q.normalize(e.join("/"))},join2:function(e,r){return q.normalize(e+"/"+r)}};function K(e){return r.___errno_location&&(g[r.___errno_location()>>2]=e),e}var $={resolve:function(){for(var e="",r=!1,t=arguments.length-1;t>=-1&&!r;t--){var n=t>=0?arguments[t]:te.cwd();if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");if(!n)return"";e=n+"/"+e,r="/"===n.charAt(0)}return(r?"/":"")+(e=q.normalizeArray(e.split("/").filter((function(e){return!!e})),!r).join("/"))||"."},relative:function(e,r){function t(e){for(var r=0;r<e.length&&""===e[r];r++);for(var t=e.length-1;t>=0&&""===e[t];t--);return r>t?[]:e.slice(r,t-r+1)}e=$.resolve(e).substr(1),r=$.resolve(r).substr(1);for(var n=t(e.split("/")),i=t(r.split("/")),o=Math.min(n.length,i.length),a=o,s=0;s<o;s++)if(n[s]!==i[s]){a=s;break}var f=[];for(s=a;s<n.length;s++)f.push("..");return(f=f.concat(i.slice(a))).join("/")}},ee={ttys:[],init:function(){},shutdown:function(){},register:function(e,r){ee.ttys[e]={input:[],output:[],ops:r},te.registerDevice(e,ee.stream_ops)},stream_ops:{open:function(e){var r=ee.ttys[e.node.rdev];if(!r)throw new te.ErrnoError(43);e.tty=r,e.seekable=!1},close:function(e){e.tty.ops.flush(e.tty)},flush:function(e){e.tty.ops.flush(e.tty)},read:function(e,r,t,n,i){if(!e.tty||!e.tty.ops.get_char)throw new te.ErrnoError(60);for(var o=0,a=0;a<n;a++){var s;try{s=e.tty.ops.get_char(e.tty)}catch(e){throw new te.ErrnoError(29)}if(void 0===s&&0===o)throw new te.ErrnoError(6);if(null==s)break;o++,r[t+a]=s}return o&&(e.node.timestamp=Date.now()),o},write:function(e,r,t,n,i){if(!e.tty||!e.tty.ops.put_char)throw new te.ErrnoError(60);try{for(var o=0;o<n;o++)e.tty.ops.put_char(e.tty,r[t+o])}catch(e){throw new te.ErrnoError(29)}return n&&(e.node.timestamp=Date.now()),o}},default_tty_ops:{get_char:function(e){if(!e.input.length){var r=null;if("undefined"!=typeof window&&"function"==typeof window.prompt?null!==(r=window.prompt("Input: "))&&(r+="\n"):"function"==typeof readline&&null!==(r=readline())&&(r+="\n"),!r)return null;e.input=ce(r,!0)}return e.input.shift()},put_char:function(e,r){null===r||10===r?(a(b(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},flush:function(e){e.output&&e.output.length>0&&(a(b(e.output,0)),e.output=[])}},default_tty1_ops:{put_char:function(e,r){null===r||10===r?(s(b(e.output,0)),e.output=[]):0!=r&&e.output.push(r)},flush:function(e){e.output&&e.output.length>0&&(s(b(e.output,0)),e.output=[])}}},re={ops_table:null,mount:function(e){return re.createNode(null,"/",16895,0)},createNode:function(e,r,t,n){if(te.isBlkdev(t)||te.isFIFO(t))throw new te.ErrnoError(63);re.ops_table||(re.ops_table={dir:{node:{getattr:re.node_ops.getattr,setattr:re.node_ops.setattr,lookup:re.node_ops.lookup,mknod:re.node_ops.mknod,rename:re.node_ops.rename,unlink:re.node_ops.unlink,rmdir:re.node_ops.rmdir,readdir:re.node_ops.readdir,symlink:re.node_ops.symlink},stream:{llseek:re.stream_ops.llseek}},file:{node:{getattr:re.node_ops.getattr,setattr:re.node_ops.setattr},stream:{llseek:re.stream_ops.llseek,read:re.stream_ops.read,write:re.stream_ops.write,allocate:re.stream_ops.allocate,mmap:re.stream_ops.mmap,msync:re.stream_ops.msync}},link:{node:{getattr:re.node_ops.getattr,setattr:re.node_ops.setattr,readlink:re.node_ops.readlink},stream:{}},chrdev:{node:{getattr:re.node_ops.getattr,setattr:re.node_ops.setattr},stream:te.chrdev_stream_ops}});var i=te.createNode(e,r,t,n);return te.isDir(i.mode)?(i.node_ops=re.ops_table.dir.node,i.stream_ops=re.ops_table.dir.stream,i.contents={}):te.isFile(i.mode)?(i.node_ops=re.ops_table.file.node,i.stream_ops=re.ops_table.file.stream,i.usedBytes=0,i.contents=null):te.isLink(i.mode)?(i.node_ops=re.ops_table.link.node,i.stream_ops=re.ops_table.link.stream):te.isChrdev(i.mode)&&(i.node_ops=re.ops_table.chrdev.node,i.stream_ops=re.ops_table.chrdev.stream),i.timestamp=Date.now(),e&&(e.contents[r]=i),i},getFileDataAsRegularArray:function(e){if(e.contents&&e.contents.subarray){for(var r=[],t=0;t<e.usedBytes;++t)r.push(e.contents[t]);return r}return e.contents},getFileDataAsTypedArray:function(e){return e.contents?e.contents.subarray?e.contents.subarray(0,e.usedBytes):new Uint8Array(e.contents):new Uint8Array},expandFileStorage:function(e,r){var t=e.contents?e.contents.length:0;if(!(t>=r)){r=Math.max(r,t*(t<1048576?2:1.125)|0),0!=t&&(r=Math.max(r,256));var n=e.contents;e.contents=new Uint8Array(r),e.usedBytes>0&&e.contents.set(n.subarray(0,e.usedBytes),0)}},resizeFileStorage:function(e,r){if(e.usedBytes!=r){if(0==r)return e.contents=null,void(e.usedBytes=0);if(!e.contents||e.contents.subarray){var t=e.contents;return e.contents=new Uint8Array(new ArrayBuffer(r)),t&&e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),void(e.usedBytes=r)}if(e.contents||(e.contents=[]),e.contents.length>r)e.contents.length=r;else for(;e.contents.length<r;)e.contents.push(0);e.usedBytes=r}},node_ops:{getattr:function(e){var r={};return r.dev=te.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,te.isDir(e.mode)?r.size=4096:te.isFile(e.mode)?r.size=e.usedBytes:te.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.timestamp),r.mtime=new Date(e.timestamp),r.ctime=new Date(e.timestamp),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr:function(e,r){void 0!==r.mode&&(e.mode=r.mode),void 0!==r.timestamp&&(e.timestamp=r.timestamp),void 0!==r.size&&re.resizeFileStorage(e,r.size)},lookup:function(e,r){throw te.genericErrors[44]},mknod:function(e,r,t,n){return re.createNode(e,r,t,n)},rename:function(e,r,t){if(te.isDir(e.mode)){var n;try{n=te.lookupNode(r,t)}catch(e){}if(n)for(var i in n.contents)throw new te.ErrnoError(55)}delete e.parent.contents[e.name],e.name=t,r.contents[t]=e,e.parent=r},unlink:function(e,r){delete e.contents[r]},rmdir:function(e,r){var t=te.lookupNode(e,r);for(var n in t.contents)throw new te.ErrnoError(55);delete e.contents[r]},readdir:function(e){var r=[".",".."];for(var t in e.contents)e.contents.hasOwnProperty(t)&&r.push(t);return r},symlink:function(e,r,t){var n=re.createNode(e,r,41471,0);return n.link=t,n},readlink:function(e){if(!te.isLink(e.mode))throw new te.ErrnoError(28);return e.link}},stream_ops:{read:function(e,r,t,n,i){var o=e.node.contents;if(i>=e.node.usedBytes)return 0;var a=Math.min(e.node.usedBytes-i,n);if(a>8&&o.subarray)r.set(o.subarray(i,i+a),t);else for(var s=0;s<a;s++)r[t+s]=o[i+s];return a},write:function(e,r,t,n,i,o){if(!n)return 0;var a=e.node;if(a.timestamp=Date.now(),r.subarray&&(!a.contents||a.contents.subarray)){if(0===a.usedBytes&&0===i)return a.contents=new Uint8Array(r.subarray(t,t+n)),a.usedBytes=n,n;if(i+n<=a.usedBytes)return a.contents.set(r.subarray(t,t+n),i),n}if(re.expandFileStorage(a,i+n),a.contents.subarray&&r.subarray)a.contents.set(r.subarray(t,t+n),i);else for(var s=0;s<n;s++)a.contents[i+s]=r[t+s];return a.usedBytes=Math.max(a.usedBytes,i+n),n},llseek:function(e,r,t){var n=r;if(1===t?n+=e.position:2===t&&te.isFile(e.node.mode)&&(n+=e.node.usedBytes),n<0)throw new te.ErrnoError(28);return n},allocate:function(e,r,t){re.expandFileStorage(e.node,r+t),e.node.usedBytes=Math.max(e.node.usedBytes,r+t)},mmap:function(e,r,t,n,i,o,a){if(!te.isFile(e.node.mode))throw new te.ErrnoError(43);var s,f,u=e.node.contents;if(2&a||u.buffer!==r&&u.buffer!==r.buffer){(i>0||i+n<e.node.usedBytes)&&(u=u.subarray?u.subarray(i,i+n):Array.prototype.slice.call(u,i,i+n)),f=!0;var c=r.buffer==d.buffer;if(!(s=ve(n)))throw new te.ErrnoError(48);(c?d:r).set(u,s)}else f=!1,s=u.byteOffset;return{ptr:s,allocated:f}},msync:function(e,r,t,n,i){if(!te.isFile(e.node.mode))throw new te.ErrnoError(43);return 2&i||re.stream_ops.write(e,r,0,n,t,!1),0}}},te={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,trackingDelegate:{},tracking:{openFlags:{READ:1,WRITE:2}},ErrnoError:null,genericErrors:{},filesystems:null,syncFSRequests:0,handleFSError:function(e){if(!(e instanceof te.ErrnoError))throw e+" : "+Q();return K(e.errno)},lookupPath:function(e,r){if(r=r||{},!(e=$.resolve(te.cwd(),e)))return{path:"",node:null};var t={follow_mount:!0,recurse_count:0};for(var n in t)void 0===r[n]&&(r[n]=t[n]);if(r.recurse_count>8)throw new te.ErrnoError(32);for(var i=q.normalizeArray(e.split("/").filter((function(e){return!!e})),!1),o=te.root,a="/",s=0;s<i.length;s++){var f=s===i.length-1;if(f&&r.parent)break;if(o=te.lookupNode(o,i[s]),a=q.join2(a,i[s]),te.isMountpoint(o)&&(!f||f&&r.follow_mount)&&(o=o.mounted.root),!f||r.follow)for(var u=0;te.isLink(o.mode);){var c=te.readlink(a);if(a=$.resolve(q.dirname(a),c),o=te.lookupPath(a,{recurse_count:r.recurse_count}).node,u++>40)throw new te.ErrnoError(32)}}return{path:a,node:o}},getPath:function(e){for(var r;;){if(te.isRoot(e)){var t=e.mount.mountpoint;return r?"/"!==t[t.length-1]?t+"/"+r:t+r:t}r=r?e.name+"/"+r:e.name,e=e.parent}},hashName:function(e,r){for(var t=0,n=0;n<r.length;n++)t=(t<<5)-t+r.charCodeAt(n)|0;return(e+t>>>0)%te.nameTable.length},hashAddNode:function(e){var r=te.hashName(e.parent.id,e.name);e.name_next=te.nameTable[r],te.nameTable[r]=e},hashRemoveNode:function(e){var r=te.hashName(e.parent.id,e.name);if(te.nameTable[r]===e)te.nameTable[r]=e.name_next;else for(var t=te.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode:function(e,r){var t=te.mayLookup(e);if(t)throw new te.ErrnoError(t,e);for(var n=te.hashName(e.id,r),i=te.nameTable[n];i;i=i.name_next){var o=i.name;if(i.parent.id===e.id&&o===r)return i}return te.lookup(e,r)},createNode:function(e,r,t,n){te.FSNode||(te.FSNode=function(e,r,t,n){e||(e=this),this.parent=e,this.mount=e.mount,this.mounted=null,this.id=te.nextInode++,this.name=r,this.mode=t,this.node_ops={},this.stream_ops={},this.rdev=n},te.FSNode.prototype={},Object.defineProperties(te.FSNode.prototype,{read:{get:function(){return 365==(365&this.mode)},set:function(e){e?this.mode|=365:this.mode&=-366}},write:{get:function(){return 146==(146&this.mode)},set:function(e){e?this.mode|=146:this.mode&=-147}},isFolder:{get:function(){return te.isDir(this.mode)}},isDevice:{get:function(){return te.isChrdev(this.mode)}}}));var i=new te.FSNode(e,r,t,n);return te.hashAddNode(i),i},destroyNode:function(e){te.hashRemoveNode(e)},isRoot:function(e){return e===e.parent},isMountpoint:function(e){return!!e.mounted},isFile:function(e){return 32768==(61440&e)},isDir:function(e){return 16384==(61440&e)},isLink:function(e){return 40960==(61440&e)},isChrdev:function(e){return 8192==(61440&e)},isBlkdev:function(e){return 24576==(61440&e)},isFIFO:function(e){return 4096==(61440&e)},isSocket:function(e){return 49152==(49152&e)},flagModes:{r:0,rs:1052672,"r+":2,w:577,wx:705,xw:705,"w+":578,"wx+":706,"xw+":706,a:1089,ax:1217,xa:1217,"a+":1090,"ax+":1218,"xa+":1218},modeStringToFlags:function(e){var r=te.flagModes[e];if(void 0===r)throw new Error("Unknown file open mode: "+e);return r},flagsToPermissionString:function(e){var r=["r","w","rw"][3&e];return 512&e&&(r+="w"),r},nodePermissions:function(e,r){return te.ignorePermissions||(-1===r.indexOf("r")||292&e.mode)&&(-1===r.indexOf("w")||146&e.mode)&&(-1===r.indexOf("x")||73&e.mode)?0:2},mayLookup:function(e){var r=te.nodePermissions(e,"x");return r||(e.node_ops.lookup?0:2)},mayCreate:function(e,r){try{return te.lookupNode(e,r),20}catch(e){}return te.nodePermissions(e,"wx")},mayDelete:function(e,r,t){var n;try{n=te.lookupNode(e,r)}catch(e){return e.errno}var i=te.nodePermissions(e,"wx");if(i)return i;if(t){if(!te.isDir(n.mode))return 54;if(te.isRoot(n)||te.getPath(n)===te.cwd())return 10}else if(te.isDir(n.mode))return 31;return 0},mayOpen:function(e,r){return e?te.isLink(e.mode)?32:te.isDir(e.mode)&&("r"!==te.flagsToPermissionString(r)||512&r)?31:te.nodePermissions(e,te.flagsToPermissionString(r)):44},MAX_OPEN_FDS:4096,nextfd:function(e,r){e=e||0,r=r||te.MAX_OPEN_FDS;for(var t=e;t<=r;t++)if(!te.streams[t])return t;throw new te.ErrnoError(33)},getStream:function(e){return te.streams[e]},createStream:function(e,r,t){te.FSStream||(te.FSStream=function(){},te.FSStream.prototype={},Object.defineProperties(te.FSStream.prototype,{object:{get:function(){return this.node},set:function(e){this.node=e}},isRead:{get:function(){return 1!=(2097155&this.flags)}},isWrite:{get:function(){return 0!=(2097155&this.flags)}},isAppend:{get:function(){return 1024&this.flags}}}));var n=new te.FSStream;for(var i in e)n[i]=e[i];e=n;var o=te.nextfd(r,t);return e.fd=o,te.streams[o]=e,e},closeStream:function(e){te.streams[e]=null},chrdev_stream_ops:{open:function(e){var r=te.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open&&e.stream_ops.open(e)},llseek:function(){throw new te.ErrnoError(70)}},major:function(e){return e>>8},minor:function(e){return 255&e},makedev:function(e,r){return e<<8|r},registerDevice:function(e,r){te.devices[e]={stream_ops:r}},getDevice:function(e){return te.devices[e]},getMounts:function(e){for(var r=[],t=[e];t.length;){var n=t.pop();r.push(n),t.push.apply(t,n.mounts)}return r},syncfs:function(e,r){"function"==typeof e&&(r=e,e=!1),te.syncFSRequests++,te.syncFSRequests>1&&console.log("warning: "+te.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work");var t=te.getMounts(te.root.mount),n=0;function i(e){return te.syncFSRequests--,r(e)}function o(e){if(e)return o.errored?void 0:(o.errored=!0,i(e));++n>=t.length&&i(null)}t.forEach((function(r){if(!r.type.syncfs)return o(null);r.type.syncfs(r,e,o)}))},mount:function(e,r,t){var n,i="/"===t,o=!t;if(i&&te.root)throw new te.ErrnoError(10);if(!i&&!o){var a=te.lookupPath(t,{follow_mount:!1});if(t=a.path,n=a.node,te.isMountpoint(n))throw new te.ErrnoError(10);if(!te.isDir(n.mode))throw new te.ErrnoError(54)}var s={type:e,opts:r,mountpoint:t,mounts:[]},f=e.mount(s);return f.mount=s,s.root=f,i?te.root=f:n&&(n.mounted=s,n.mount&&n.mount.mounts.push(s)),f},unmount:function(e){var r=te.lookupPath(e,{follow_mount:!1});if(!te.isMountpoint(r.node))throw new te.ErrnoError(28);var t=r.node,n=t.mounted,i=te.getMounts(n);Object.keys(te.nameTable).forEach((function(e){for(var r=te.nameTable[e];r;){var t=r.name_next;-1!==i.indexOf(r.mount)&&te.destroyNode(r),r=t}})),t.mounted=null;var o=t.mount.mounts.indexOf(n);t.mount.mounts.splice(o,1)},lookup:function(e,r){return e.node_ops.lookup(e,r)},mknod:function(e,r,t){var n=te.lookupPath(e,{parent:!0}).node,i=q.basename(e);if(!i||"."===i||".."===i)throw new te.ErrnoError(28);var o=te.mayCreate(n,i);if(o)throw new te.ErrnoError(o);if(!n.node_ops.mknod)throw new te.ErrnoError(63);return n.node_ops.mknod(n,i,r,t)},create:function(e,r){return r=void 0!==r?r:438,r&=4095,r|=32768,te.mknod(e,r,0)},mkdir:function(e,r){return r=void 0!==r?r:511,r&=1023,r|=16384,te.mknod(e,r,0)},mkdirTree:function(e,r){for(var t=e.split("/"),n="",i=0;i<t.length;++i)if(t[i]){n+="/"+t[i];try{te.mkdir(n,r)}catch(e){if(20!=e.errno)throw e}}},mkdev:function(e,r,t){return void 0===t&&(t=r,r=438),r|=8192,te.mknod(e,r,t)},symlink:function(e,r){if(!$.resolve(e))throw new te.ErrnoError(44);var t=te.lookupPath(r,{parent:!0}).node;if(!t)throw new te.ErrnoError(44);var n=q.basename(r),i=te.mayCreate(t,n);if(i)throw new te.ErrnoError(i);if(!t.node_ops.symlink)throw new te.ErrnoError(63);return t.node_ops.symlink(t,n,e)},rename:function(e,r){var t,n,i=q.dirname(e),o=q.dirname(r),a=q.basename(e),s=q.basename(r);try{t=te.lookupPath(e,{parent:!0}).node,n=te.lookupPath(r,{parent:!0}).node}catch(e){throw new te.ErrnoError(10)}if(!t||!n)throw new te.ErrnoError(44);if(t.mount!==n.mount)throw new te.ErrnoError(75);var f,u=te.lookupNode(t,a),c=$.relative(e,o);if("."!==c.charAt(0))throw new te.ErrnoError(28);if("."!==(c=$.relative(r,i)).charAt(0))throw new te.ErrnoError(55);try{f=te.lookupNode(n,s)}catch(e){}if(u!==f){var l=te.isDir(u.mode),A=te.mayDelete(t,a,l);if(A)throw new te.ErrnoError(A);if(A=f?te.mayDelete(n,s,l):te.mayCreate(n,s))throw new te.ErrnoError(A);if(!t.node_ops.rename)throw new te.ErrnoError(63);if(te.isMountpoint(u)||f&&te.isMountpoint(f))throw new te.ErrnoError(10);if(n!==t&&(A=te.nodePermissions(t,"w")))throw new te.ErrnoError(A);try{te.trackingDelegate.willMovePath&&te.trackingDelegate.willMovePath(e,r)}catch(t){console.log("FS.trackingDelegate['willMovePath']('"+e+"', '"+r+"') threw an exception: "+t.message)}te.hashRemoveNode(u);try{t.node_ops.rename(u,n,s)}catch(e){throw e}finally{te.hashAddNode(u)}try{te.trackingDelegate.onMovePath&&te.trackingDelegate.onMovePath(e,r)}catch(t){console.log("FS.trackingDelegate['onMovePath']('"+e+"', '"+r+"') threw an exception: "+t.message)}}},rmdir:function(e){var r=te.lookupPath(e,{parent:!0}).node,t=q.basename(e),n=te.lookupNode(r,t),i=te.mayDelete(r,t,!0);if(i)throw new te.ErrnoError(i);if(!r.node_ops.rmdir)throw new te.ErrnoError(63);if(te.isMountpoint(n))throw new te.ErrnoError(10);try{te.trackingDelegate.willDeletePath&&te.trackingDelegate.willDeletePath(e)}catch(r){console.log("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+r.message)}r.node_ops.rmdir(r,t),te.destroyNode(n);try{te.trackingDelegate.onDeletePath&&te.trackingDelegate.onDeletePath(e)}catch(r){console.log("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+r.message)}},readdir:function(e){var r=te.lookupPath(e,{follow:!0}).node;if(!r.node_ops.readdir)throw new te.ErrnoError(54);return r.node_ops.readdir(r)},unlink:function(e){var r=te.lookupPath(e,{parent:!0}).node,t=q.basename(e),n=te.lookupNode(r,t),i=te.mayDelete(r,t,!1);if(i)throw new te.ErrnoError(i);if(!r.node_ops.unlink)throw new te.ErrnoError(63);if(te.isMountpoint(n))throw new te.ErrnoError(10);try{te.trackingDelegate.willDeletePath&&te.trackingDelegate.willDeletePath(e)}catch(r){console.log("FS.trackingDelegate['willDeletePath']('"+e+"') threw an exception: "+r.message)}r.node_ops.unlink(r,t),te.destroyNode(n);try{te.trackingDelegate.onDeletePath&&te.trackingDelegate.onDeletePath(e)}catch(r){console.log("FS.trackingDelegate['onDeletePath']('"+e+"') threw an exception: "+r.message)}},readlink:function(e){var r=te.lookupPath(e).node;if(!r)throw new te.ErrnoError(44);if(!r.node_ops.readlink)throw new te.ErrnoError(28);return $.resolve(te.getPath(r.parent),r.node_ops.readlink(r))},stat:function(e,r){var t=te.lookupPath(e,{follow:!r}).node;if(!t)throw new te.ErrnoError(44);if(!t.node_ops.getattr)throw new te.ErrnoError(63);return t.node_ops.getattr(t)},lstat:function(e){return te.stat(e,!0)},chmod:function(e,r,t){var n;if(!(n="string"==typeof e?te.lookupPath(e,{follow:!t}).node:e).node_ops.setattr)throw new te.ErrnoError(63);n.node_ops.setattr(n,{mode:4095&r|-4096&n.mode,timestamp:Date.now()})},lchmod:function(e,r){te.chmod(e,r,!0)},fchmod:function(e,r){var t=te.getStream(e);if(!t)throw new te.ErrnoError(8);te.chmod(t.node,r)},chown:function(e,r,t,n){var i;if(!(i="string"==typeof e?te.lookupPath(e,{follow:!n}).node:e).node_ops.setattr)throw new te.ErrnoError(63);i.node_ops.setattr(i,{timestamp:Date.now()})},lchown:function(e,r,t){te.chown(e,r,t,!0)},fchown:function(e,r,t){var n=te.getStream(e);if(!n)throw new te.ErrnoError(8);te.chown(n.node,r,t)},truncate:function(e,r){if(r<0)throw new te.ErrnoError(28);var t;if(!(t="string"==typeof e?te.lookupPath(e,{follow:!0}).node:e).node_ops.setattr)throw new te.ErrnoError(63);if(te.isDir(t.mode))throw new te.ErrnoError(31);if(!te.isFile(t.mode))throw new te.ErrnoError(28);var n=te.nodePermissions(t,"w");if(n)throw new te.ErrnoError(n);t.node_ops.setattr(t,{size:r,timestamp:Date.now()})},ftruncate:function(e,r){var t=te.getStream(e);if(!t)throw new te.ErrnoError(8);if(0==(2097155&t.flags))throw new te.ErrnoError(28);te.truncate(t.node,r)},utime:function(e,r,t){var n=te.lookupPath(e,{follow:!0}).node;n.node_ops.setattr(n,{timestamp:Math.max(r,t)})},open:function(e,t,n,i,o){if(""===e)throw new te.ErrnoError(44);var a;if(n=void 0===n?438:n,n=64&(t="string"==typeof t?te.modeStringToFlags(t):t)?4095&n|32768:0,"object"===de(e))a=e;else{e=q.normalize(e);try{a=te.lookupPath(e,{follow:!(131072&t)}).node}catch(e){}}var s=!1;if(64&t)if(a){if(128&t)throw new te.ErrnoError(20)}else a=te.mknod(e,n,0),s=!0;if(!a)throw new te.ErrnoError(44);if(te.isChrdev(a.mode)&&(t&=-513),65536&t&&!te.isDir(a.mode))throw new te.ErrnoError(54);if(!s){var f=te.mayOpen(a,t);if(f)throw new te.ErrnoError(f)}512&t&&te.truncate(a,0),t&=-641;var u=te.createStream({node:a,path:te.getPath(a),flags:t,seekable:!0,position:0,stream_ops:a.stream_ops,ungotten:[],error:!1},i,o);u.stream_ops.open&&u.stream_ops.open(u),!r.logReadFiles||1&t||(te.readFiles||(te.readFiles={}),e in te.readFiles||(te.readFiles[e]=1,console.log("FS.trackingDelegate error on read file: "+e)));try{if(te.trackingDelegate.onOpenFile){var c=0;1!=(2097155&t)&&(c|=te.tracking.openFlags.READ),0!=(2097155&t)&&(c|=te.tracking.openFlags.WRITE),te.trackingDelegate.onOpenFile(e,c)}}catch(r){console.log("FS.trackingDelegate['onOpenFile']('"+e+"', flags) threw an exception: "+r.message)}return u},close:function(e){if(te.isClosed(e))throw new te.ErrnoError(8);e.getdents&&(e.getdents=null);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(e){throw e}finally{te.closeStream(e.fd)}e.fd=null},isClosed:function(e){return null===e.fd},llseek:function(e,r,t){if(te.isClosed(e))throw new te.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new te.ErrnoError(70);if(0!=t&&1!=t&&2!=t)throw new te.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read:function(e,r,t,n,i){if(n<0||i<0)throw new te.ErrnoError(28);if(te.isClosed(e))throw new te.ErrnoError(8);if(1==(2097155&e.flags))throw new te.ErrnoError(8);if(te.isDir(e.node.mode))throw new te.ErrnoError(31);if(!e.stream_ops.read)throw new te.ErrnoError(28);var o=void 0!==i;if(o){if(!e.seekable)throw new te.ErrnoError(70)}else i=e.position;var a=e.stream_ops.read(e,r,t,n,i);return o||(e.position+=a),a},write:function(e,r,t,n,i,o){if(n<0||i<0)throw new te.ErrnoError(28);if(te.isClosed(e))throw new te.ErrnoError(8);if(0==(2097155&e.flags))throw new te.ErrnoError(8);if(te.isDir(e.node.mode))throw new te.ErrnoError(31);if(!e.stream_ops.write)throw new te.ErrnoError(28);1024&e.flags&&te.llseek(e,0,2);var a=void 0!==i;if(a){if(!e.seekable)throw new te.ErrnoError(70)}else i=e.position;var s=e.stream_ops.write(e,r,t,n,i,o);a||(e.position+=s);try{e.path&&te.trackingDelegate.onWriteToFile&&te.trackingDelegate.onWriteToFile(e.path)}catch(r){console.log("FS.trackingDelegate['onWriteToFile']('"+e.path+"') threw an exception: "+r.message)}return s},allocate:function(e,r,t){if(te.isClosed(e))throw new te.ErrnoError(8);if(r<0||t<=0)throw new te.ErrnoError(28);if(0==(2097155&e.flags))throw new te.ErrnoError(8);if(!te.isFile(e.node.mode)&&!te.isDir(e.node.mode))throw new te.ErrnoError(43);if(!e.stream_ops.allocate)throw new te.ErrnoError(138);e.stream_ops.allocate(e,r,t)},mmap:function(e,r,t,n,i,o,a){if(0!=(2&o)&&0==(2&a)&&2!=(2097155&e.flags))throw new te.ErrnoError(2);if(1==(2097155&e.flags))throw new te.ErrnoError(2);if(!e.stream_ops.mmap)throw new te.ErrnoError(43);return e.stream_ops.mmap(e,r,t,n,i,o,a)},msync:function(e,r,t,n,i){return e&&e.stream_ops.msync?e.stream_ops.msync(e,r,t,n,i):0},munmap:function(e){return 0},ioctl:function(e,r,t){if(!e.stream_ops.ioctl)throw new te.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile:function(e,r){if((r=r||{}).flags=r.flags||"r",r.encoding=r.encoding||"binary","utf8"!==r.encoding&&"binary"!==r.encoding)throw new Error('Invalid encoding type "'+r.encoding+'"');var t,n=te.open(e,r.flags),i=te.stat(e).size,o=new Uint8Array(i);return te.read(n,o,0,i,0),"utf8"===r.encoding?t=b(o,0):"binary"===r.encoding&&(t=o),te.close(n),t},writeFile:function(e,r,t){(t=t||{}).flags=t.flags||"w";var n=te.open(e,t.flags,t.mode);if("string"==typeof r){var i=new Uint8Array(E(r)+1),o=k(r,i,0,i.length);te.write(n,i,0,o,void 0,t.canOwn)}else{if(!ArrayBuffer.isView(r))throw new Error("Unsupported data type");te.write(n,r,0,r.byteLength,void 0,t.canOwn)}te.close(n)},cwd:function(){return te.currentPath},chdir:function(e){var r=te.lookupPath(e,{follow:!0});if(null===r.node)throw new te.ErrnoError(44);if(!te.isDir(r.node.mode))throw new te.Errno