parcelRequire=function(e,r,n,t){var i="function"==typeof parcelRequire&&parcelRequire,o="function"==typeof require&&require;function u(n,t){if(!r[n]){if(!e[n]){var f="function"==typeof parcelRequire&&parcelRequire;if(!t&&f)return f(n,!0);if(i)return i(n,!0);if(o&&"string"==typeof n)return o(n);var c=new Error("Cannot find module '"+n+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[n][1][r]||r};var l=r[n]=new u.Module(n);e[n][0].call(l.exports,p,l,l.exports,this)}return r[n].exports;function p(e){return u(p.resolve(e))}}u.isParcelRequire=!0,u.Module=function(e){this.id=e,this.bundle=u,this.exports={}},u.modules=e,u.cache=r,u.parent=i,u.register=function(r,n){e[r]=[function(e,r){r.exports=n},{}]};for(var f=0;f<n.length;f++)u(n[f]);if(n.length){var c=u(n[n.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=c:"function"==typeof define&&define.amd?define(function(){return c}):t&&(this[t]=c)}return u}({24:[function(require,module,exports) {
"use strict";function e(){}Object.defineProperty(exports,"__esModule",{value:!0});var t={},n=[],o=[];function r(r,i){var l,a,p,s,c=o;for(s=arguments.length;s-- >2;)n.push(arguments[s]);for(i&&null!=i.children&&(n.length||n.push(i.children),delete i.children);n.length;)if((a=n.pop())&&void 0!==a.pop)for(s=a.length;s--;)n.push(a[s]);else"boolean"==typeof a&&(a=null),(p="function"!=typeof r)&&(null==a?a="":"number"==typeof a?a=String(a):"string"!=typeof a&&(p=!1)),p&&l?c[c.length-1]+=a:c===o?c=[a]:c.push(a),l=p;var u=new e;return u.nodeName=r,u.children=c,u.attributes=null==i?void 0:i,u.key=null==i?void 0:i.key,void 0!==t.vnode&&t.vnode(u),u}function i(e,t){for(var n in t)e[n]=t[n];return e}var l="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;function a(e,t){return r(e.nodeName,i(i({},e.attributes),t),arguments.length>2?[].slice.call(arguments,2):e.children)}var p=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,s=[];function c(e){!e._dirty&&(e._dirty=!0)&&1==s.push(e)&&(t.debounceRendering||l)(u)}function u(){var e,t=s;for(s=[];e=t.pop();)e._dirty&&A(e)}function f(e,t,n){return"string"==typeof t||"number"==typeof t?void 0!==e.splitText:"string"==typeof t.nodeName?!e._componentConstructor&&d(e,t.nodeName):n||e._componentConstructor===t.nodeName}function d(e,t){return e.normalizedNodeName===t||e.nodeName.toLowerCase()===t.toLowerCase()}function _(e){var t=i({},e.attributes);t.children=e.children;var n=e.nodeName.defaultProps;if(void 0!==n)for(var o in n)void 0===t[o]&&(t[o]=n[o]);return t}function v(e,t){var n=t?document.createElementNS("http://www.w3.org/2000/svg",e):document.createElement(e);return n.normalizedNodeName=e,n}function m(e){var t=e.parentNode;t&&t.removeChild(e)}function h(e,t,n,o,r){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),o&&o(e);else if("class"!==t||r)if("style"===t){if(o&&"string"!=typeof o&&"string"!=typeof n||(e.style.cssText=o||""),o&&"object"==typeof o){if("string"!=typeof n)for(var i in n)i in o||(e.style[i]="");for(var i in o)e.style[i]="number"==typeof o[i]&&!1===p.test(i)?o[i]+"px":o[i]}}else if("dangerouslySetInnerHTML"===t)o&&(e.innerHTML=o.__html||"");else if("o"==t[0]&&"n"==t[1]){var l=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),o?n||e.addEventListener(t,y,l):e.removeEventListener(t,y,l),(e._listeners||(e._listeners={}))[t]=o}else if("list"!==t&&"type"!==t&&!r&&t in e)b(e,t,null==o?"":o),null!=o&&!1!==o||e.removeAttribute(t);else{var a=r&&t!==(t=t.replace(/^xlink\:?/,""));null==o||!1===o?a?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof o&&(a?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),o):e.setAttribute(t,o))}else e.className=o||""}function b(e,t,n){try{e[t]=n}catch(e){}}function y(e){return this._listeners[e.type](t.event&&t.event(e)||e)}var x=[],C=0,g=!1,N=!1;function k(){for(var e;e=x.pop();)t.afterMount&&t.afterMount(e),e.componentDidMount&&e.componentDidMount()}function w(e,t,n,o,r,i){C++||(g=null!=r&&void 0!==r.ownerSVGElement,N=null!=e&&!("__preactattr_"in e));var l=S(e,t,n,o,i);return r&&l.parentNode!==r&&r.appendChild(l),--C||(N=!1,i||k()),l}function S(e,t,n,o,r){var i=e,l=g;if(null!=t&&"boolean"!=typeof t||(t=""),"string"==typeof t||"number"==typeof t)return e&&void 0!==e.splitText&&e.parentNode&&(!e._component||r)?e.nodeValue!=t&&(e.nodeValue=t):(i=document.createTextNode(t),e&&(e.parentNode&&e.parentNode.replaceChild(i,e),L(e,!0))),i.__preactattr_=!0,i;var a=t.nodeName;if("function"==typeof a)return D(e,t,n,o);if(g="svg"===a||"foreignObject"!==a&&g,a=String(a),(!e||!d(e,a))&&(i=v(a,g),e)){for(;e.firstChild;)i.appendChild(e.firstChild);e.parentNode&&e.parentNode.replaceChild(i,e),L(e,!0)}var p=i.firstChild,s=i.__preactattr_,c=t.children;if(null==s){s=i.__preactattr_={};for(var u=i.attributes,f=u.length;f--;)s[u[f].name]=u[f].value}return!N&&c&&1===c.length&&"string"==typeof c[0]&&null!=p&&void 0!==p.splitText&&null==p.nextSibling?p.nodeValue!=c[0]&&(p.nodeValue=c[0]):(c&&c.length||null!=p)&&U(i,c,n,o,N||null!=s.dangerouslySetInnerHTML),P(i,t.attributes,s),g=l,i}function U(e,t,n,o,r){var i,l,a,p,s,c=e.childNodes,u=[],d={},_=0,v=0,h=c.length,b=0,y=t?t.length:0;if(0!==h)for(var x=0;x<h;x++){var C=c[x],g=C.__preactattr_;null!=(N=y&&g?C._component?C._component.__key:g.key:null)?(_++,d[N]=C):(g||(void 0!==C.splitText?!r||C.nodeValue.trim():r))&&(u[b++]=C)}if(0!==y)for(x=0;x<y;x++){var N;if(s=null,null!=(N=(p=t[x]).key))_&&void 0!==d[N]&&(s=d[N],d[N]=void 0,_--);else if(!s&&v<b)for(i=v;i<b;i++)if(void 0!==u[i]&&f(l=u[i],p,r)){s=l,u[i]=void 0,i===b-1&&b--,i===v&&v++;break}s=S(s,p,n,o),a=c[x],s&&s!==e&&s!==a&&(null==a?e.appendChild(s):s===a.nextSibling?m(a):e.insertBefore(s,a))}if(_)for(var x in d)void 0!==d[x]&&L(d[x],!1);for(;v<=b;)void 0!==(s=u[b--])&&L(s,!1)}function L(e,t){var n=e._component;n?H(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||m(e),M(e))}function M(e){for(e=e.lastChild;e;){var t=e.previousSibling;L(e,!0),e=t}}function P(e,t,n){var o;for(o in n)t&&null!=t[o]||null==n[o]||h(e,o,n[o],n[o]=void 0,g);for(o in t)"children"===o||"innerHTML"===o||o in n&&t[o]===("value"===o||"checked"===o?e[o]:n[o])||h(e,o,n[o],n[o]=t[o],g)}var T={};function B(e){var t=e.constructor.name;(T[t]||(T[t]=[])).push(e)}function E(e,t,n){var o,r=T[e.name];if(e.prototype&&e.prototype.render?(o=new e(t,n),j.call(o,t,n)):((o=new j(t,n)).constructor=e,o.render=W),r)for(var i=r.length;i--;)if(r[i].constructor===e){o.nextBase=r[i].nextBase,r.splice(i,1);break}return o}function W(e,t,n){return this.constructor(e,n)}function V(e,n,o,r,i){e._disable||(e._disable=!0,(e.__ref=n.ref)&&delete n.ref,(e.__key=n.key)&&delete n.key,!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(n,r),r&&r!==e.context&&(e.prevContext||(e.prevContext=e.context),e.context=r),e.prevProps||(e.prevProps=e.props),e.props=n,e._disable=!1,0!==o&&(1!==o&&!1===t.syncComponentUpdates&&e.base?c(e):A(e,1,i)),e.__ref&&e.__ref(e))}function A(e,n,o,r){if(!e._disable){var l,a,p,s=e.props,c=e.state,u=e.context,f=e.prevProps||s,d=e.prevState||c,v=e.prevContext||u,m=e.base,h=e.nextBase,b=m||h,y=e._component,g=!1;if(m&&(e.props=f,e.state=d,e.context=v,2!==n&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(s,c,u)?g=!0:e.componentWillUpdate&&e.componentWillUpdate(s,c,u),e.props=s,e.state=c,e.context=u),e.prevProps=e.prevState=e.prevContext=e.nextBase=null,e._dirty=!1,!g){l=e.render(s,c,u),e.getChildContext&&(u=i(i({},u),e.getChildContext()));var N,S,U=l&&l.nodeName;if("function"==typeof U){var M=_(l);(a=y)&&a.constructor===U&&M.key==a.__key?V(a,M,1,u,!1):(N=a,e._component=a=E(U,M,u),a.nextBase=a.nextBase||h,a._parentComponent=e,V(a,M,0,u,!1),A(a,1,o,!0)),S=a.base}else p=b,(N=y)&&(p=e._component=null),(b||1===n)&&(p&&(p._component=null),S=w(p,l,u,o||!m,b&&b.parentNode,!0));if(b&&S!==b&&a!==y){var P=b.parentNode;P&&S!==P&&(P.replaceChild(S,b),N||(b._component=null,L(b,!1)))}if(N&&H(N),e.base=S,S&&!r){for(var T=e,B=e;B=B._parentComponent;)(T=B).base=S;S._component=T,S._componentConstructor=T.constructor}}if(!m||o?x.unshift(e):g||(e.componentDidUpdate&&e.componentDidUpdate(f,d,v),t.afterUpdate&&t.afterUpdate(e)),null!=e._renderCallbacks)for(;e._renderCallbacks.length;)e._renderCallbacks.pop().call(e);C||r||k()}}function D(e,t,n,o){for(var r=e&&e._component,i=r,l=e,a=r&&e._componentConstructor===t.nodeName,p=a,s=_(t);r&&!p&&(r=r._parentComponent);)p=r.constructor===t.nodeName;return r&&p&&(!o||r._component)?(V(r,s,3,n,o),e=r.base):(i&&!a&&(H(i),e=l=null),r=E(t.nodeName,s,n),e&&!r.nextBase&&(r.nextBase=e,l=null),V(r,s,1,n,o),e=r.base,l&&e!==l&&(l._component=null,L(l,!1))),e}function H(e){t.beforeUnmount&&t.beforeUnmount(e);var n=e.base;e._disable=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var o=e._component;o?H(o):n&&(n.__preactattr_&&n.__preactattr_.ref&&n.__preactattr_.ref(null),e.nextBase=n,m(n),B(e),M(n)),e.__ref&&e.__ref(null)}function j(e,t){this._dirty=!0,this.context=t,this.props=e,this.state=this.state||{}}function z(e,t,n){return w(n,e,{},!1,t,!1)}i(j.prototype,{setState:function(e,t){var n=this.state;this.prevState||(this.prevState=i({},n)),i(n,"function"==typeof e?e(n,this.props):e),t&&(this._renderCallbacks=this._renderCallbacks||[]).push(t),c(this)},forceUpdate:function(e){e&&(this._renderCallbacks=this._renderCallbacks||[]).push(e),A(this,2)},render:function(){}});var R={h:r,createElement:r,cloneElement:a,Component:j,render:z,rerender:u,options:t};exports.h=r,exports.createElement=r,exports.cloneElement=a,exports.Component=j,exports.render=z,exports.rerender=u,exports.options=t,exports.default=R;
},{}],94:[function(require,module,exports) {
"use strict";function e(e){var o,r=e.Symbol;return"function"==typeof r?r.observable?o=r.observable:(o=r("observable"),r.observable=o):o="@@observable",o}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e;
},{}],48:[function(require,module,exports) {
var global = arguments[3];
var e=arguments[3];Object.defineProperty(exports,"__esModule",{value:!0});var d,n=require("./ponyfill.js"),u=o(n);function o(e){return e&&e.__esModule?e:{default:e}}d="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof module?module:Function("return this")();var t=(0,u.default)(d);exports.default=t;
},{"./ponyfill.js":94}],31:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.__DO_NOT_USE__ActionTypes=exports.compose=exports.applyMiddleware=exports.bindActionCreators=exports.combineReducers=exports.createStore=void 0;var e=require("symbol-observable"),t=r(e);function r(e){return e&&e.__esModule?e:{default:e}}var n={INIT:"@@redux/INIT"+Math.random().toString(36).substring(7).split("").join("."),REPLACE:"@@redux/REPLACE"+Math.random().toString(36).substring(7).split("").join(".")},o="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},i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};function u(e){if("object"!==(void 0===e?"undefined":o(e))||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function a(e,r,i){var c;if("function"==typeof r&&void 0===i&&(i=r,r=void 0),void 0!==i){if("function"!=typeof i)throw new Error("Expected the enhancer to be a function.");return i(a)(e,r)}if("function"!=typeof e)throw new Error("Expected the reducer to be a function.");var s=e,d=r,f=[],l=f,p=!1;function h(){l===f&&(l=f.slice())}function y(){if(p)throw new Error("You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return d}function b(e){if("function"!=typeof e)throw new Error("Expected the listener to be a function.");if(p)throw new Error("You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");var t=!0;return h(),l.push(e),function(){if(t){if(p)throw new Error("You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api-reference/store#subscribe(listener) for more details.");t=!1,h();var r=l.indexOf(e);l.splice(r,1)}}}function v(e){if(!u(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if(void 0===e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(p)throw new Error("Reducers may not dispatch actions.");try{p=!0,d=s(d,e)}finally{p=!1}for(var t=f=l,r=0;r<t.length;r++){(0,t[r])()}return e}return v({type:n.INIT}),(c={dispatch:v,subscribe:b,getState:y,replaceReducer:function(e){if("function"!=typeof e)throw new Error("Expected the nextReducer to be a function.");s=e,v({type:n.REPLACE})}})[t.default]=function(){var e,r=b;return(e={subscribe:function(e){if("object"!==(void 0===e?"undefined":o(e))||null===e)throw new TypeError("Expected the observer to be an object.");function t(){e.next&&e.next(y())}return t(),{unsubscribe:r(t)}}})[t.default]=function(){return this},e},c}function c(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(e){}}function s(e,t){var r=t&&t.type;return"Given "+(r&&'action "'+String(r)+'"'||"an action")+', reducer "'+e+'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'}function d(e,t,r,o){var i=Object.keys(t),a=r&&r.type===n.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(0===i.length)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!u(e))return"The "+a+' has unexpected type of "'+{}.toString.call(e).match(/\s([a-z|A-Z]+)/)[1]+'". Expected argument to be an object with the following keys: "'+i.join('", "')+'"';var c=Object.keys(e).filter(function(e){return!t.hasOwnProperty(e)&&!o[e]});return c.forEach(function(e){o[e]=!0}),r&&r.type===n.REPLACE?void 0:c.length>0?"Unexpected "+(c.length>1?"keys":"key")+' "'+c.join('", "')+'" found in '+a+'. Expected to find one of the known reducer keys instead: "'+i.join('", "')+'". Unexpected keys will be ignored.':void 0}function f(e){Object.keys(e).forEach(function(t){var r=e[t];if(void 0===r(void 0,{type:n.INIT}))throw new Error('Reducer "'+t+"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.");if(void 0===r(void 0,{type:"@@redux/PROBE_UNKNOWN_ACTION_"+Math.random().toString(36).substring(7).split("").join(".")}))throw new Error('Reducer "'+t+"\" returned undefined when probed with a random type. Don't try to handle "+n.INIT+' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.')})}function l(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++){var o=t[n];0,"function"==typeof e[o]&&(r[o]=e[o])}var i=Object.keys(r);var u=void 0;try{f(r)}catch(e){u=e}return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];if(u)throw u;for(var n=!1,o={},a=0;a<i.length;a++){var c=i[a],d=r[c],f=e[c],l=d(f,t);if(void 0===l){var p=s(c,t);throw new Error(p)}o[c]=l,n=n||l!==f}return n?o:e}}function p(e,t){return function(){return t(e.apply(this,arguments))}}function h(e,t){if("function"==typeof e)return p(e,t);if("object"!==(void 0===e?"undefined":o(e))||null===e)throw new Error("bindActionCreators expected an object or a function, instead received "+(null===e?"null":void 0===e?"undefined":o(e))+'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?');for(var r=Object.keys(e),n={},i=0;i<r.length;i++){var u=r[i],a=e[u];"function"==typeof a&&(n[u]=p(a,t))}return n}function y(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce(function(e,t){return function(){return e(t.apply(void 0,arguments))}})}function b(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return function(){for(var r=arguments.length,n=Array(r),o=0;o<r;o++)n[o]=arguments[o];var u=e.apply(void 0,n),a=function(){throw new Error("Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},c={getState:u.getState,dispatch:function(){return a.apply(void 0,arguments)}},s=t.map(function(e){return e(c)});return a=y.apply(void 0,s)(u.dispatch),i({},u,{dispatch:a})}}}function v(){}exports.createStore=a,exports.combineReducers=l,exports.bindActionCreators=h,exports.applyMiddleware=b,exports.compose=y,exports.__DO_NOT_USE__ActionTypes=n;
},{"symbol-observable":48}],26:[function(require,module,exports) {
var global = arguments[3];
var t=arguments[3];Object.defineProperty(exports,"__esModule",{value:!0}),exports.connectAdvanced=exports.connect=exports.Provider=void 0;var e=require("preact"),n=require("redux"),r={only:function(t){return t&&t[0]||null}};function o(){}o.isRequired=o;var i={element:o,func:o,shape:function(){return o},instanceOf:function(){return o}},s=i.shape({trySubscribe:i.func.isRequired,tryUnsubscribe:i.func.isRequired,notifyNestedSubs:i.func.isRequired,isSubscribed:i.func.isRequired}),u=i.shape({subscribe:i.func.isRequired,dispatch:i.func.isRequired,getState:i.func.isRequired});function p(t){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(t);try{throw new Error(t)}catch(t){}}var c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},d=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},f=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)},l=function(t,e){var n={};for(var r in t)e.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n},h=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e},b=!1;function y(){b||(b=!0,p("<Provider> does not support changing `store` on the fly. It is most likely that you see this error because you updated to Redux 2.x and React Redux 2.x which no longer hot reload reducers automatically. See https://github.com/reactjs/react-redux/releases/tag/v2.0.0 for the migration instructions."))}function v(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"store",o=arguments[1]||n+"Subscription",i=function(t){function e(r,o){a(this,e);var i=h(this,t.call(this,r,o));return i[n]=r.store,i}return f(e,t),e.prototype.getChildContext=function(){var t;return(t={})[n]=this[n],t[o]=null,t},e.prototype.render=function(){return r.only(this.props.children)},e}(e.Component);return i.prototype.componentWillReceiveProps=function(t){this[n]!==t.store&&y()},i.childContextTypes=((t={})[n]=u.isRequired,t[o]=s,t),i}var m=v(),P={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},O={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},S=Object.defineProperty,g=Object.getOwnPropertyNames,w=Object.getOwnPropertySymbols,C=Object.getOwnPropertyDescriptor,j=Object.getPrototypeOf,T=j&&j(Object);function x(t,e,n){if("string"!=typeof e){if(T){var r=j(e);r&&r!==T&&x(t,r,n)}var o=g(e);w&&(o=o.concat(w(e)));for(var i=0;i<o.length;++i){var s=o[i];if(!(P[s]||O[s]||n&&n[s])){var u=C(e,s);try{S(t,s,u)}catch(t){}}}return t}return t}var N=x,q=function(){},E=null,U={notify:function(){}};function D(){var t=[],e=[];return{clear:function(){e=E,t=E},notify:function(){for(var n=t=e,r=0;r<n.length;r++)n[r]()},get:function(){return e},subscribe:function(n){var r=!0;return e===t&&(e=t.slice()),e.push(n),function(){r&&t!==E&&(r=!1,e===t&&(e=t.slice()),e.splice(e.indexOf(n),1))}}}}var M=function(){function t(e,n,r){a(this,t),this.store=e,this.parentSub=n,this.onStateChange=r,this.unsubscribe=null,this.listeners=U}return t.prototype.addNestedSub=function(t){return this.trySubscribe(),this.listeners.subscribe(t)},t.prototype.notifyNestedSubs=function(){this.listeners.notify()},t.prototype.isSubscribed=function(){return Boolean(this.unsubscribe)},t.prototype.trySubscribe=function(){this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.onStateChange):this.store.subscribe(this.onStateChange),this.listeners=D())},t.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null,this.listeners.clear(),this.listeners=U)},t}(),R=0,I={};function W(){}function F(t,e){var n={run:function(r){try{var o=t(e.getState(),r);(o!==n.props||n.error)&&(n.shouldComponentUpdate=!0,n.props=o,n.error=null)}catch(t){n.shouldComponentUpdate=!0,n.error=t}}};return n}function A(t){var n,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=o.getDisplayName,p=void 0===i?function(t){return"ConnectAdvanced("+t+")"}:i,c=o.methodName,b=void 0===c?"connectAdvanced":c,y=o.renderCountProp,v=void 0===y?void 0:y,m=o.shouldHandleStateChanges,P=void 0===m||m,O=o.storeKey,S=void 0===O?"store":O,g=o.withRef,w=void 0!==g&&g,C=l(o,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef"]),j=S+"Subscription",T=R++,x=((n={})[S]=u,n[j]=s,n),E=((r={})[j]=s,r);return function(n){q("function"==typeof n,"You must pass a component to the function returned by "+b+". Instead received "+JSON.stringify(n));var r=n.displayName||n.name||"Component",o=p(r),i=d({},C,{getDisplayName:p,methodName:b,renderCountProp:v,shouldHandleStateChanges:P,storeKey:S,withRef:w,displayName:o,wrappedComponentName:r,WrappedComponent:n}),s=function(r){function s(t,e){a(this,s);var n=h(this,r.call(this,t,e));return n.version=T,n.state={},n.renderCount=0,n.store=t[S]||e[S],n.propsMode=Boolean(t[S]),n.setWrappedInstance=n.setWrappedInstance.bind(n),q(n.store,'Could not find "'+S+'" in either the context or props of "'+o+'". Either wrap the root component in a <Provider>, or explicitly pass "'+S+'" as a prop to "'+o+'".'),n.initSelector(),n.initSubscription(),n}return f(s,r),s.prototype.getChildContext=function(){var t,e=this.propsMode?null:this.subscription;return(t={})[j]=e||this.context[j],t},s.prototype.componentDidMount=function(){P&&(this.subscription.trySubscribe(),this.selector.run(this.props),this.selector.shouldComponentUpdate&&this.forceUpdate())},s.prototype.componentWillReceiveProps=function(t){this.selector.run(t)},s.prototype.shouldComponentUpdate=function(){return this.selector.shouldComponentUpdate},s.prototype.componentWillUnmount=function(){this.subscription&&this.subscription.tryUnsubscribe(),this.subscription=null,this.notifyNestedSubs=W,this.store=null,this.selector.run=W,this.selector.shouldComponentUpdate=!1},s.prototype.getWrappedInstance=function(){return q(w,"To access the wrapped instance, you need to specify { withRef: true } in the options argument of the "+b+"() call."),this.wrappedInstance},s.prototype.setWrappedInstance=function(t){this.wrappedInstance=t},s.prototype.initSelector=function(){var e=t(this.store.dispatch,i);this.selector=F(e,this.store),this.selector.run(this.props)},s.prototype.initSubscription=function(){if(P){var t=(this.propsMode?this.props:this.context)[j];this.subscription=new M(this.store,t,this.onStateChange.bind(this)),this.notifyNestedSubs=this.subscription.notifyNestedSubs.bind(this.subscription)}},s.prototype.onStateChange=function(){this.selector.run(this.props),this.selector.shouldComponentUpdate?(this.componentDidUpdate=this.notifyNestedSubsOnComponentDidUpdate,this.setState(I)):this.notifyNestedSubs()},s.prototype.notifyNestedSubsOnComponentDidUpdate=function(){this.componentDidUpdate=void 0,this.notifyNestedSubs()},s.prototype.isSubscribed=function(){return Boolean(this.subscription)&&this.subscription.isSubscribed()},s.prototype.addExtraProps=function(t){if(!(w||v||this.propsMode&&this.subscription))return t;var e=d({},t);return w&&(e.ref=this.setWrappedInstance),v&&(e[v]=this.renderCount++),this.propsMode&&this.subscription&&(e[j]=this.subscription),e},s.prototype.render=function(){var t=this.selector;if(t.shouldComponentUpdate=!1,t.error)throw t.error;return(0,e.h)(n,this.addExtraProps(t.props))},s}(e.Component);return s.WrappedComponent=n,s.displayName=o,s.childContextTypes=E,s.contextTypes=x,s.prototype.componentWillUpdate=function(){var t=this;if(this.version!==T){this.version=T,this.initSelector();var e=[];this.subscription&&(e=this.subscription.listeners.get(),this.subscription.tryUnsubscribe()),this.initSubscription(),P&&(this.subscription.trySubscribe(),e.forEach(function(e){return t.subscription.listeners.subscribe(e)}))}},N(s,n)}}var _=Object.prototype.hasOwnProperty;function B(t,e){return t===e?0!==t||0!==e||1/t==1/e:t!=t&&e!=e}function H(t,e){if(B(t,e))return!0;if("object"!==(void 0===t?"undefined":c(t))||null===t||"object"!==(void 0===e?"undefined":c(e))||null===e)return!1;var n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;for(var o=0;o<n.length;o++)if(!_.call(e,n[o])||!B(t[n[o]],e[n[o]]))return!1;return!0}var k="object"==(void 0===t?"undefined":c(t))&&t&&t.Object===Object&&t,K="object"==("undefined"==typeof self?"undefined":c(self))&&self&&self.Object===Object&&self,J=k||K||Function("return this")(),Y=J.Symbol,z=Object.prototype,G=z.hasOwnProperty,L=z.toString,Q=Y?Y.toStringTag:void 0;function V(t){var e=G.call(t,Q),n=t[Q];try{t[Q]=void 0;var r=!0}catch(t){}var o=L.call(t);return r&&(e?t[Q]=n:delete t[Q]),o}var X=Object.prototype,Z=X.toString;function $(t){return Z.call(t)}var tt="[object Null]",et="[object Undefined]",nt=Y?Y.toStringTag:void 0;function rt(t){return null==t?void 0===t?et:tt:nt&&nt in Object(t)?V(t):$(t)}function ot(t,e){return function(n){return t(e(n))}}var it=ot(Object.getPrototypeOf,Object);function st(t){return null!=t&&"object"==(void 0===t?"undefined":c(t))}var ut="[object Object]",pt=Function.prototype,ct=Object.prototype,at=pt.toString,dt=ct.hasOwnProperty,ft=at.call(Object);function lt(t){if(!st(t)||rt(t)!=ut)return!1;var e=it(t);if(null===e)return!0;var n=dt.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&at.call(n)==ft}function ht(t,e,n){lt(t)||p(n+"() in "+e+" must return a plain object. Instead received "+t+".")}function bt(t){return function(e,n){var r=t(e,n);function o(){return r}return o.dependsOnOwnProps=!1,o}}function yt(t){return null!==t.dependsOnOwnProps&&void 0!==t.dependsOnOwnProps?Boolean(t.dependsOnOwnProps):1!==t.length}function vt(t,e){return function(n,r){var o=r.displayName,i=function(t,e){return i.dependsOnOwnProps?i.mapToProps(t,e):i.mapToProps(t)};return i.dependsOnOwnProps=!0,i.mapToProps=function(n,r){i.mapToProps=t,i.dependsOnOwnProps=yt(t);var s=i(n,r);return"function"==typeof s&&(i.mapToProps=s,i.dependsOnOwnProps=yt(s),s=i(n,r)),ht(s,o,e),s},i}}function mt(t){return"function"==typeof t?vt(t,"mapDispatchToProps"):void 0}function Pt(t){return t?void 0:bt(function(t){return{dispatch:t}})}function Ot(t){return t&&"object"===(void 0===t?"undefined":c(t))?bt(function(e){return(0,n.bindActionCreators)(t,e)}):void 0}var St=[mt,Pt,Ot];function gt(t){return"function"==typeof t?vt(t,"mapStateToProps"):void 0}function wt(t){return t?void 0:bt(function(){return{}})}var Ct=[gt,wt];function jt(t,e,n){return d({},n,t,e)}function Tt(t){return function(e,n){var r=n.displayName,o=n.pure,i=n.areMergedPropsEqual,s=!1,u=void 0;return function(e,n,p){var c=t(e,n,p);return s?o&&i(c,u)||(u=c):(s=!0,ht(u=c,r,"mergeProps")),u}}}function xt(t){return"function"==typeof t?Tt(t):void 0}function Nt(t){return t?void 0:function(){return jt}}var qt=[xt,Nt];function Et(t,e,n){if(!t)throw new Error("Unexpected value for "+e+" in "+n+".");"mapStateToProps"!==e&&"mapDispatchToProps"!==e||t.hasOwnProperty("dependsOnOwnProps")||p("The selector for "+e+" of "+n+" did not specify a value for dependsOnOwnProps.")}function Ut(t,e,n,r){Et(t,"mapStateToProps",r),Et(e,"mapDispatchToProps",r),Et(n,"mergeProps",r)}function Dt(t,e,n,r){return function(o,i){return n(t(o,i),e(r,i),i)}}function Mt(t,e,n,r,o){var i=o.areStatesEqual,s=o.areOwnPropsEqual,u=o.areStatePropsEqual,p=!1,c=void 0,a=void 0,d=void 0,f=void 0,l=void 0;function h(o,p){var h,b,y=!s(p,a),v=!i(o,c);return c=o,a=p,y&&v?(d=t(c,a),e.dependsOnOwnProps&&(f=e(r,a)),l=n(d,f,a)):y?(t.dependsOnOwnProps&&(d=t(c,a)),e.dependsOnOwnProps&&(f=e(r,a)),l=n(d,f,a)):v?(h=t(c,a),b=!u(h,d),d=h,b&&(l=n(d,f,a)),l):l}return function(o,i){return p?h(o,i):(d=t(c=o,a=i),f=e(r,a),l=n(d,f,a),p=!0,l)}}function Rt(t,e){var n=e.initMapStateToProps,r=e.initMapDispatchToProps,o=e.initMergeProps,i=l(e,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),s=n(t,i),u=r(t,i),p=o(t,i);return Ut(s,u,p,i.displayName),(i.pure?Mt:Dt)(s,u,p,t,i)}function It(t,e,n){for(var r=e.length-1;r>=0;r--){var o=e[r](t);if(o)return o}return function(e,r){throw new Error("Invalid value of type "+(void 0===t?"undefined":c(t))+" for "+n+" argument when connecting component "+r.wrappedComponentName+".")}}function Wt(t,e){return t===e}function Ft(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.connectHOC,n=void 0===e?A:e,r=t.mapStateToPropsFactories,o=void 0===r?Ct:r,i=t.mapDispatchToPropsFactories,s=void 0===i?St:i,u=t.mergePropsFactories,p=void 0===u?qt:u,c=t.selectorFactory,a=void 0===c?Rt:c;return function(t,e,r){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},u=i.pure,c=void 0===u||u,f=i.areStatesEqual,h=void 0===f?Wt:f,b=i.areOwnPropsEqual,y=void 0===b?H:b,v=i.areStatePropsEqual,m=void 0===v?H:v,P=i.areMergedPropsEqual,O=void 0===P?H:P,S=l(i,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),g=It(t,o,"mapStateToProps"),w=It(e,s,"mapDispatchToProps"),C=It(r,p,"mergeProps");return n(a,d({methodName:"connect",getDisplayName:function(t){return"Connect("+t+")"},shouldHandleStateChanges:Boolean(t),initMapStateToProps:g,initMapDispatchToProps:w,initMergeProps:C,pure:c,areStatesEqual:h,areOwnPropsEqual:y,areStatePropsEqual:m,areMergedPropsEqual:O},S))}}var At=Ft(),_t={Provider:m,connect:At,connectAdvanced:A};exports.Provider=m,exports.connect=At,exports.connectAdvanced=A,exports.default=_t;
},{"preact":24,"redux":31}],36:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.StatelessComponent=void 0,exports.actionCreator=n,exports.setter=o,exports.createContainer=s,exports.bindActionCreator=c;var e=require("preact-redux"),t=require("preact");const r=new Set;function n(e){if(r.has(e))throw new Error(`Cannot re-use action type name: ${e}`);const t=(t={})=>({type:e,payload:t});return t.matches=(t=>t.type===e),t}function o(e,t){return(r=t,n)=>e.matches(n)?n.payload:r}function s(t,r){return(0,e.connect)(e=>e,e=>({dispatch:e}),(e,t,n)=>r(e,t.dispatch,n))(t)}class a extends t.Component{}function c(e,t){return r=>{e(t(r))}}exports.StatelessComponent=a;
},{"preact-redux":26,"preact":24}],102:[function(require,module,exports) {
"use strict";function t(t,i,s){return t<i?i:t>s?s:t}Object.defineProperty(exports,"__esModule",{value:!0}),exports.clamp=t;class i{constructor(t,i){this.x=t,this.y=i}withX(t){return new i(t,this.y)}withY(t){return new i(this.x,t)}plus(t){return new i(this.x+t.x,this.y+t.y)}minus(t){return new i(this.x-t.x,this.y-t.y)}times(t){return new i(this.x*t,this.y*t)}timesPointwise(t){return new i(this.x*t.x,this.y*t.y)}dividedByPointwise(t){return new i(this.x/t.x,this.y/t.y)}dot(t){return this.x*t.x+this.y*t.y}equals(t){return this.x===t.x&&this.y===t.y}approxEquals(t,i=1e-9){return Math.abs(this.x-t.x)<i&&Math.abs(this.y-t.y)<i}length2(){return this.dot(this)}length(){return Math.sqrt(this.length2())}abs(){return new i(Math.abs(this.x),Math.abs(this.y))}static min(t,s){return new i(Math.min(t.x,s.x),Math.min(t.y,s.y))}static max(t,s){return new i(Math.max(t.x,s.x),Math.max(t.y,s.y))}static clamp(s,e,r){return new i(t(s.x,e.x,r.x),t(s.y,e.y,r.y))}flatten(){return[this.x,this.y]}}exports.Vec2=i,i.zero=new i(0,0),i.unit=new i(1,1);class s{constructor(t=1,i=0,s=0,e=0,r=1,n=0){this.m00=t,this.m01=i,this.m02=s,this.m10=e,this.m11=r,this.m12=n}withScale(t){let{m00:i,m01:e,m02:r,m10:n,m11:h,m12:m}=this;return i=t.x,h=t.y,new s(i,e,r,n,h,m)}static withScale(t){return(new s).withScale(t)}scaledBy(t){return s.withScale(t).times(this)}getScale(){return new i(this.m00,this.m11)}withTranslation(t){let{m00:i,m01:e,m02:r,m10:n,m11:h,m12:m}=this;return r=t.x,m=t.y,new s(i,e,r,n,h,m)}static withTranslation(t){return(new s).withTranslation(t)}getTranslation(){return new i(this.m02,this.m12)}translatedBy(t){return s.withTranslation(t).times(this)}static betweenRects(t,e){return s.withTranslation(t.origin.times(-1)).scaledBy(new i(e.size.x/t.size.x,e.size.y/t.size.y)).translatedBy(e.origin)}times(t){const i=this.m00*t.m00+this.m01*t.m10,e=this.m00*t.m01+this.m01*t.m11,r=this.m00*t.m02+this.m01*t.m12+this.m02,n=this.m10*t.m00+this.m11*t.m10,h=this.m10*t.m01+this.m11*t.m11,m=this.m10*t.m02+this.m11*t.m12+this.m12;return new s(i,e,r,n,h,m)}equals(t){return this.m00==t.m00&&this.m01==t.m01&&this.m02==t.m02&&this.m10==t.m10&&this.m11==t.m11&&this.m12==t.m12}approxEquals(t,i=1e-9){return Math.abs(this.m00-t.m00)<i&&Math.abs(this.m01-t.m01)<i&&Math.abs(this.m02-t.m02)<i&&Math.abs(this.m10-t.m10)<i&&Math.abs(this.m11-t.m11)<i&&Math.abs(this.m12-t.m12)<i}timesScalar(t){const{m00:i,m01:e,m02:r,m10:n,m11:h,m12:m}=this;return new s(t*i,t*e,t*r,t*n,t*h,t*m)}det(){const{m00:t,m01:i,m02:s,m10:e,m11:r,m12:n}=this;return t*(1*r-0*n)-i*(1*e-0*n)+s*(0*e-0*r)}adj(){const{m00:t,m01:i,m02:e,m10:r,m11:n,m12:h}=this;return new s(+(1*n-0*h),-(1*i-0*e),+(i*h-e*n),-(1*r-0*h),+(1*t-0*e),-(t*h-e*r))}inverted(){const t=this.det();return 0===t?null:this.adj().timesScalar(1/t)}transformVector(t){return new i(t.x*this.m00+t.y*this.m01,t.x*this.m10+t.y*this.m11)}inverseTransformVector(t){const i=this.inverted();return i?i.transformVector(t):null}transformPosition(t){return new i(t.x*this.m00+t.y*this.m01+this.m02,t.x*this.m10+t.y*this.m11+this.m12)}inverseTransformPosition(t){const i=this.inverted();return i?i.transformPosition(t):null}transformRect(t){const i=this.transformVector(t.size),s=this.transformPosition(t.origin);return i.x<0&&i.y<0?new e(s.plus(i),i.abs()):i.x<0?new e(s.withX(s.x+i.x),i.abs()):i.y<0?new e(s.withY(s.y+i.y),i.abs()):new e(s,i)}inverseTransformRect(t){const i=this.inverted();return i?i.transformRect(t):null}flatten(){return[this.m00,this.m10,0,this.m01,this.m11,0,this.m02,this.m12,1]}}exports.AffineTransform=s;class e{constructor(t,i){this.origin=t,this.size=i}isEmpty(){return 0==this.width()||0==this.height()}width(){return this.size.x}height(){return this.size.y}left(){return this.origin.x}right(){return this.left()+this.width()}top(){return this.origin.y}bottom(){return this.top()+this.height()}topLeft(){return this.origin}topRight(){return this.origin.plus(new i(this.width(),0))}bottomRight(){return this.origin.plus(this.size)}bottomLeft(){return this.origin.plus(new i(0,this.height()))}withOrigin(t){return new e(t,this.size)}withSize(t){return new e(this.origin,t)}closestPointTo(s){return new i(t(s.x,this.left(),this.right()),t(s.y,this.top(),this.bottom()))}distanceFrom(t){return t.minus(this.closestPointTo(t)).length()}contains(t){return 0===this.distanceFrom(t)}hasIntersectionWith(t){const i=Math.max(this.top(),t.top());if(Math.max(i,Math.min(this.bottom(),t.bottom()))-i==0)return!1;const s=Math.max(this.left(),t.left());return Math.max(s,Math.min(this.right(),t.right()))-s!=0}intersectWith(t){const s=i.max(this.topLeft(),t.topLeft()),r=i.max(s,i.min(this.bottomRight(),t.bottomRight()));return new e(s,r.minus(s))}equals(t){return this.origin.equals(t.origin)&&this.size.equals(t.size)}approxEquals(t){return this.origin.approxEquals(t.origin)&&this.size.approxEquals(t.size)}area(){return this.size.x*this.size.y}}exports.Rect=e,e.empty=new e(i.zero,i.zero),e.unit=new e(i.zero,i.unit),e.NDC=new e(new i(-1,-1),new i(2,2));
},{}],98:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.FlamechartID=void 0,exports.createFlamechartViewStateReducer=c;var e=require("../lib/math"),t=require("./actions"),a=exports.FlamechartID=void 0;function c(a,c){let o={hover:null,selectedNode:null,configSpaceViewportRect:e.Rect.empty,logicalSpaceViewportSize:e.Vec2.zero};function r(e){const{payload:t}=e;return t.args.id===a&&t.profileIndex===c}return(e=o,a)=>{if(t.actions.flamechart.setHoveredNode.matches(a)&&r(a)){const{hover:t}=a.payload.args;return Object.assign({},e,{hover:t})}if(t.actions.flamechart.setSelectedNode.matches(a)&&r(a)){const{selectedNode:t}=a.payload.args;return Object.assign({},e,{selectedNode:t})}if(t.actions.flamechart.setConfigSpaceViewportRect.matches(a)&&r(a)){const{configSpaceViewportRect:t}=a.payload.args;return Object.assign({},e,{configSpaceViewportRect:t})}if(t.actions.flamechart.setLogicalSpaceViewportSize.matches(a)&&r(a)){const{logicalSpaceViewportSize:t}=a.payload.args;return Object.assign({},e,{logicalSpaceViewportSize:t})}return t.actions.setViewMode.matches(a)?Object.assign({},e,{hover:null}):e}}!function(e){e.LEFT_HEAVY="LEFT_HEAVY",e.CHRONO="CHRONO",e.SANDWICH_INVERTED_CALLERS="SANDWICH_INVERTED_CALLERS",e.SANDWICH_CALLEES="SANDWICH_CALLEES"}(a||(exports.FlamechartID=a={}));
},{"../lib/math":102,"./actions":40}],100:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.createSandwichView=l;var e=require("./flamechart-view-state"),a=require("./actions");function l(l){const r=(0,e.createFlamechartViewStateReducer)(e.FlamechartID.SANDWICH_CALLEES,l),t=(0,e.createFlamechartViewStateReducer)(e.FlamechartID.SANDWICH_INVERTED_CALLERS,l);return(e={callerCallee:null},c)=>{if(a.actions.sandwichView.setSelectedFrame.matches(c)&&function(e){const{payload:a}=e;return a.profileIndex===l}(c))return null==c.payload.args?Object.assign({},e,{callerCallee:null}):Object.assign({},e,{callerCallee:{selectedFrame:c.payload.args,calleeFlamegraph:r(void 0,c),invertedCallerFlamegraph:t(void 0,c)}});const{callerCallee:n}=e;if(n){const{calleeFlamegraph:a,invertedCallerFlamegraph:l}=n,i=r(a,c),s=t(l,c);return i===a&&s===l?e:Object.assign({},e,{callerCallee:Object.assign({},n,{calleeFlamegraph:i,invertedCallerFlamegraph:s})})}return e}}
},{"./flamechart-view-state":98,"./actions":40}],70:[function(require,module,exports) {
"use strict";function t(t){return t[t.length-1]||null}function e(t,e){t.sort(function(t,r){return e(t)<e(r)?-1:1})}function r(t,e,r){return t.has(e)||t.set(e,r(e)),t.get(e)}function n(t,e,r){return t.has(e)?t.get(e):r(e)}function o(t,e){if(!t.has(e))throw new Error(`Expected key ${e}`);return t.get(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.lastOf=t,exports.sortBy=e,exports.getOrInsert=r,exports.getOrElse=n,exports.getOrThrow=o,exports.itMap=l,exports.itForEach=u,exports.itReduce=a,exports.zeroPad=i,exports.formatPercent=c,exports.fract=f,exports.triangle=h,exports.binarySearch=g,exports.noop=p,exports.objectsHaveShallowEquality=x,exports.memoizeByShallowEquality=d,exports.memoizeByReference=y,exports.lazyStatic=w,exports.decodeBase64=m;class s{constructor(){this.map=new Map}getOrInsert(t){const e=t.key,r=this.map.get(e);return r||(this.map.set(e,t),t)}forEach(t){this.map.forEach(t)}[Symbol.iterator](){return this.map.values()}}function*l(t,e){for(let r of t)yield e(r)}function u(t,e){for(let r of t)e(r)}function a(t,e,r){let n=r;for(let r of t)n=e(n,r);return n}function i(t,e){return new Array(Math.max(e-t.length,0)+1).join("0")+t}function c(t){let e=`${t.toFixed(0)}%`;return 100===t?e="100%":t>99?e=">99%":t<.01?e="<0.01%":t<1?e=`${t.toFixed(2)}%`:t<10&&(e=`${t.toFixed(1)}%`),e}function f(t){return t-Math.floor(t)}function h(t){return 2*Math.abs(f(t)-.5)-1}function g(t,e,r,n,o=1){for(console.assert(!isNaN(o)&&!isNaN(n));;){if(e-t<=o)return[t,e];const s=(e+t)/2;r(s)<n?t=s:e=s}}function p(...t){}function x(t,e){for(let r in t)if(t[r]!==e[r])return!1;for(let r in e)if(t[r]!==e[r])return!1;return!0}function d(t){let e=null;return r=>{let n;return null==e?(n=t(r),e={args:r,result:n},n):x(e.args,r)?e.result:(e.args=r,e.result=t(r),e.result)}}function y(t){let e=null;return r=>{let n;return null==e?(n=t(r),e={args:r,result:n},n):e.args===r?e.result:(e.args=r,e.result=t(r),e.result)}}function w(t){let e=null;return()=>(null==e&&(e={result:t()}),e.result)}exports.KeyedSet=s;const E=w(()=>{const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=new Map;for(let r=0;r<t.length;r++)e.set(t.charAt(r),r);return e.set("=",-1),e});function m(t){const e=E();if(t.length%4!=0)throw new Error(`Invalid length for base64 encoded string. Expected length % 4 = 0, got length = ${t.length}`);const r=t.length/4;let n;n=t.length>=4&&"="===t.charAt(t.length-1)?"="===t.charAt(t.length-2)?3*r-2:3*r-1:3*r;const o=new Uint8Array(n);let s=0;for(let n=0;n<r;n++){const r=t.charAt(4*n+0),l=t.charAt(4*n+1),u=t.charAt(4*n+2),a=t.charAt(4*n+3),i=e.get(r),c=e.get(l),f=e.get(u),h=e.get(a);if(null==i||null==c||null==f||null==h)throw new Error(`Invalid quartet at indices ${4*n} .. ${4*n+3}: ${t.substring(4*n,4*n+3)}`);o[s++]=i<<2|c>>4,"="!==u&&(o[s++]=(15&c)<<4|f>>2),"="!==a&&(o[s++]=(7&f)<<6|h)}if(s!==n)throw new Error(`Expected to decode ${n} bytes, but only decoded ${s})`);return o}
},{}],52:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.profileGroup=void 0,exports.actionCreatorWithIndex=n;var e=require("./flamechart-view-state"),t=require("./sandwich-view-state"),i=require("../lib/typed-redux"),r=require("./actions"),a=require("../lib/math"),o=require("../lib/utils");function n(e){return(0,i.actionCreator)(e)}function l(i,r){const a=(0,e.createFlamechartViewStateReducer)(e.FlamechartID.CHRONO,r),n=(0,e.createFlamechartViewStateReducer)(e.FlamechartID.LEFT_HEAVY,r),l=(0,t.createSandwichView)(r);return(e,t)=>{if(void 0===e)return{profile:i,chronoViewState:a(void 0,t),leftHeavyViewState:n(void 0,t),sandwichViewState:l(void 0,t)};const r={profile:i,chronoViewState:a(e.chronoViewState,t),leftHeavyViewState:n(e.leftHeavyViewState,t),sandwichViewState:l(e.sandwichViewState,t)};return(0,o.objectsHaveShallowEquality)(e,r)?e:r}}const c=exports.profileGroup=((e=null,t)=>{if(r.actions.setProfileGroup.matches(t)){const{indexToView:e,profiles:i,name:r}=t.payload;return{indexToView:e,name:r,profiles:i.map((e,i)=>l(e,i)(void 0,t))}}if(null!=e){const{indexToView:n,profiles:c}=e,s=(0,a.clamp)((0,i.setter)(r.actions.setProfileIndexToView,0)(n,t),0,c.length-1),u=c.map((e,i)=>l(e.profile,i)(e,t));return n===s&&(0,o.objectsHaveShallowEquality)(c,u)?e:Object.assign({},e,{indexToView:s,profiles:u})}return e});
},{"./flamechart-view-state":98,"./sandwich-view-state":100,"../lib/typed-redux":36,"./actions":40,"../lib/math":102,"../lib/utils":70}],40:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.actions=void 0;var e=require("../lib/typed-redux"),t=require("./profiles-state"),a=exports.actions=void 0;!function(a){let o,r;a.setProfileGroup=(0,e.actionCreator)("setProfileGroup"),a.setProfileIndexToView=(0,e.actionCreator)("setProfileIndexToView"),a.setGLCanvas=(0,e.actionCreator)("setGLCanvas"),a.setViewMode=(0,e.actionCreator)("setViewMode"),a.setFlattenRecursion=(0,e.actionCreator)("setFlattenRecursion"),a.setDragActive=(0,e.actionCreator)("setDragActive"),a.setLoading=(0,e.actionCreator)("setLoading"),a.setError=(0,e.actionCreator)("setError"),a.setHashParams=(0,e.actionCreator)("setHashParams"),function(a){a.setTableSortMethod=(0,e.actionCreator)("sandwichView.setTableSortMethod"),a.setSelectedFrame=(0,t.actionCreatorWithIndex)("sandwichView.setSelectedFarmr")}(o=a.sandwichView||(a.sandwichView={})),function(e){e.setHoveredNode=(0,t.actionCreatorWithIndex)("flamechart.setHoveredNode"),e.setSelectedNode=(0,t.actionCreatorWithIndex)("flamechart.setSelectedNode"),e.setConfigSpaceViewportRect=(0,t.actionCreatorWithIndex)("flamechart.setConfigSpaceViewportRect"),e.setLogicalSpaceViewportSize=(0,t.actionCreatorWithIndex)("flamechart.setLogicalSpaceViewportSpace")}(r=a.flamechart||(a.flamechart={}))}(a||(exports.actions=a={}));
},{"../lib/typed-redux":36,"./profiles-state":52}],50:[function(require,module,exports) {
"use strict";function t(t=window.location.hash){try{if(!t.startsWith("#"))return{};const e=t.substr(1).split("&"),r={};for(const t of e){let[e,o]=t.split("=");o=decodeURIComponent(o),"profileURL"===e?r.profileURL=o:"title"===e?r.title=o:"localProfilePath"===e&&(r.localProfilePath=o)}return r}catch(t){return console.error("Error when loading hash fragment."),console.error(t),{}}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.getHashParams=t;
},{}],158:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=t;var e=/-webkit-|-moz-|-ms-/;function t(t){return"string"==typeof t&&e.test(t)}module.exports=exports.default;
},{}],123:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=i;var e=require("css-in-js-utils/lib/isPrefixedValue"),t=r(e);function r(e){return e&&e.__esModule?e:{default:e}}var u=["-webkit-","-moz-",""];function i(e,r){if("string"==typeof r&&!(0,t.default)(r)&&r.indexOf("calc(")>-1)return u.map(function(e){return r.replace(/calc\(/g,e+"calc(")})}module.exports=exports.default;
},{"css-in-js-utils/lib/isPrefixedValue":158}],124:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=u;var e=require("css-in-js-utils/lib/isPrefixedValue"),r=t(e);function t(e){return e&&e.__esModule?e:{default:e}}var s=["-webkit-",""];function u(e,t){if("string"==typeof t&&!(0,r.default)(t)&&t.indexOf("cross-fade(")>-1)return s.map(function(e){return t.replace(/cross-fade\(/g,e+"cross-fade(")})}module.exports=exports.default;
},{"css-in-js-utils/lib/isPrefixedValue":158}],125:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=o;var e=["-webkit-","-moz-",""],r={"zoom-in":!0,"zoom-out":!0,grab:!0,grabbing:!0};function o(o,t){if("cursor"===o&&r.hasOwnProperty(t))return e.map(function(e){return e+t})}module.exports=exports.default;
},{}],126:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=u;var e=require("css-in-js-utils/lib/isPrefixedValue"),t=r(e);function r(e){return e&&e.__esModule?e:{default:e}}var i=["-webkit-",""];function u(e,r){if("string"==typeof r&&!(0,t.default)(r)&&r.indexOf("filter(")>-1)return i.map(function(e){return r.replace(/filter\(/g,e+"filter(")})}module.exports=exports.default;
},{"css-in-js-utils/lib/isPrefixedValue":158}],127:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=i;var e={flex:["-webkit-box","-moz-box","-ms-flexbox","-webkit-flex","flex"],"inline-flex":["-webkit-inline-box","-moz-inline-box","-ms-inline-flexbox","-webkit-inline-flex","inline-flex"]};function i(i,l){if("display"===i&&e.hasOwnProperty(l))return e[l]}module.exports=exports.default;
},{}],128:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=s;var e={"space-around":"distribute","space-between":"justify","flex-start":"start","flex-end":"end"},t={alignContent:"msFlexLinePack",alignSelf:"msFlexItemAlign",alignItems:"msFlexAlign",justifyContent:"msFlexPack",order:"msFlexOrder",flexGrow:"msFlexPositive",flexShrink:"msFlexNegative",flexBasis:"msFlexPreferredSize"};function s(s,l,r){t.hasOwnProperty(s)&&(r[t[s]]=e[l]||l)}module.exports=exports.default;
},{}],129:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=i;var e={"space-around":"justify","space-between":"justify","flex-start":"start","flex-end":"end","wrap-reverse":"multiple",wrap:"multiple"},t={alignItems:"WebkitBoxAlign",justifyContent:"WebkitBoxPack",flexWrap:"WebkitBoxLines"};function i(i,r,o){"flexDirection"===i&&"string"==typeof r&&(r.indexOf("column")>-1?o.WebkitBoxOrient="vertical":o.WebkitBoxOrient="horizontal",r.indexOf("reverse")>-1?o.WebkitBoxDirection="reverse":o.WebkitBoxDirection="normal"),t.hasOwnProperty(i)&&(o[t[i]]=e[r]||r)}module.exports=exports.default;
},{}],130:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=n;var e=require("css-in-js-utils/lib/isPrefixedValue"),t=r(e);function r(e){return e&&e.__esModule?e:{default:e}}var i=["-webkit-","-moz-",""],a=/linear-gradient|radial-gradient|repeating-linear-gradient|repeating-radial-gradient/;function n(e,r){if("string"==typeof r&&!(0,t.default)(r)&&a.test(r))return i.map(function(e){return e+r})}module.exports=exports.default;
},{"css-in-js-utils/lib/isPrefixedValue":158}],131:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=u;var e=require("css-in-js-utils/lib/isPrefixedValue"),t=r(e);function r(e){return e&&e.__esModule?e:{default:e}}var i=["-webkit-",""];function u(e,r){if("string"==typeof r&&!(0,t.default)(r)&&r.indexOf("image-set(")>-1)return i.map(function(e){return r.replace(/image-set\(/g,e+"image-set(")})}module.exports=exports.default;
},{"css-in-js-utils/lib/isPrefixedValue":158}],132:[function(require,module,exports) {
"use strict";function e(e,t){if("position"===e&&"sticky"===t)return["-webkit-sticky","sticky"]}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e,module.exports=exports.default;
},{}],133:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=i;var t=["-webkit-","-moz-",""],e={maxHeight:!0,maxWidth:!0,width:!0,height:!0,columnWidth:!0,minWidth:!0,minHeight:!0},n={"min-content":!0,"max-content":!0,"fill-available":!0,"fit-content":!0,"contain-floats":!0};function i(i,o){if(e.hasOwnProperty(i)&&n.hasOwnProperty(o))return t.map(function(t){return t+o})}module.exports=exports.default;
},{}],181:[function(require,module,exports) {
"use strict";var e=/[A-Z]/g,r=/^ms-/,s={};function t(t){return t in s?s[t]:s[t]=t.replace(e,"-$&").toLowerCase().replace(r,"-ms-")}module.exports=t;
},{}],165:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=u;var e=require("hyphenate-style-name"),t=r(e);function r(e){return e&&e.__esModule?e:{default:e}}function u(e){return(0,t.default)(e)}module.exports=exports.default;
},{"hyphenate-style-name":181}],164:[function(require,module,exports) {
"use strict";function e(e){return e.charAt(0).toUpperCase()+e.slice(1)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e,module.exports=exports.default;
},{}],134:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=l;var t=require("css-in-js-utils/lib/hyphenateProperty"),e=s(t),r=require("css-in-js-utils/lib/isPrefixedValue"),i=s(r),n=require("../../utils/capitalizeString"),o=s(n);function s(t){return t&&t.__esModule?t:{default:t}}var u={transition:!0,transitionProperty:!0,WebkitTransition:!0,WebkitTransitionProperty:!0,MozTransition:!0,MozTransitionProperty:!0},a={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-"};function f(t,r){if((0,i.default)(t))return t;for(var n=t.split(/,(?![^()]*(?:\([^()]*\))?\))/g),o=0,s=n.length;o<s;++o){var u=n[o],f=[u];for(var l in r){var p=(0,e.default)(l);if(u.indexOf(p)>-1&&"order"!==p)for(var d=r[l],c=0,b=d.length;c<b;++c)f.unshift(u.replace(p,a[d[c]]+p))}n[o]=f.join(",")}return n.join(",")}function l(t,e,r,i){if("string"==typeof e&&u.hasOwnProperty(t)){var n=f(e,i),s=n.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(t){return!/-moz-|-ms-/.test(t)}).join(",");if(t.indexOf("Webkit")>-1)return s;var a=n.split(/,(?![^()]*(?:\([^()]*\))?\))/g).filter(function(t){return!/-webkit-|-ms-/.test(t)}).join(",");return t.indexOf("Moz")>-1?a:(r["Webkit"+(0,o.default)(t)]=s,r["Moz"+(0,o.default)(t)]=a,n)}}module.exports=exports.default;
},{"css-in-js-utils/lib/hyphenateProperty":165,"css-in-js-utils/lib/isPrefixedValue":158,"../../utils/capitalizeString":164}],144:[function(require,module,exports) {
"use strict";function r(r){for(var t=5381,e=r.length;e;)t=33*t^r.charCodeAt(--e);return t>>>0}module.exports=r;
},{}],168:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=u;var e=require("./capitalizeString"),r=t(e);function t(e){return e&&e.__esModule?e:{default:e}}function u(e,t,u){if(e.hasOwnProperty(t)){for(var o={},a=e[t],n=(0,r.default)(t),f=Object.keys(u),l=0;l<f.length;l++){var i=f[l];if(i===t)for(var s=0;s<a.length;s++)o[a[s]+n]=u[t];o[i]=u[i]}return o}return u}module.exports=exports.default;
},{"./capitalizeString":164}],169:[function(require,module,exports) {
"use strict";function e(e,t,r,o,u){for(var s=0,f=e.length;s<f;++s){var l=e[s](t,r,o,u);if(l)return l}}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e,module.exports=exports.default;
},{}],170:[function(require,module,exports) {
"use strict";function e(e,r){-1===e.indexOf(r)&&e.push(r)}function r(r,t){if(Array.isArray(t))for(var o=0,s=t.length;o<s;++o)e(r,t[o]);else e(r,t)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=r,module.exports=exports.default;
},{}],171:[function(require,module,exports) {
"use strict";function e(e){return e instanceof Object&&!Array.isArray(e)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e,module.exports=exports.default;
},{}],135:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=n;var e=require("../utils/prefixProperty"),r=s(e),t=require("../utils/prefixValue"),u=s(t),l=require("../utils/addNewValuesOnly"),a=s(l),i=require("../utils/isObject"),f=s(i);function s(e){return e&&e.__esModule?e:{default:e}}function n(e){var t=e.prefixMap,l=e.plugins;return function e(i){for(var s in i){var n=i[s];if((0,f.default)(n))i[s]=e(n);else if(Array.isArray(n)){for(var d=[],o=0,p=n.length;o<p;++o){var v=(0,u.default)(l,s,n[o],i,t);(0,a.default)(d,v||n[o])}d.length>0&&(i[s]=d)}else{var x=(0,u.default)(l,s,n,i,t);x&&(i[s]=x),i=(0,r.default)(t,s,i)}}return i}}module.exports=exports.default;
},{"../utils/prefixProperty":168,"../utils/prefixValue":169,"../utils/addNewValuesOnly":170,"../utils/isObject":171}],166:[function(require,module,exports) {
var global = arguments[3];
var e=arguments[3];function t(e){r.length||(n(),a=!0),r[r.length]=e}module.exports=t;var n,r=[],a=!1,o=0,u=1024;function l(){for(;o<r.length;){var e=o;if(o+=1,r[e].call(),o>u){for(var t=0,n=r.length-o;t<n;t++)r[t]=r[t+o];r.length-=o,o=0}}r.length=0,o=0,a=!1}var i=void 0!==e?e:self,c=i.MutationObserver||i.WebKitMutationObserver;function f(e){var t=1,n=new c(e),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}function v(e){return function(){var t=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(t),clearInterval(n),e()}}}n="function"==typeof c?f(l):v(l),t.requestFlush=n,t.makeRequestCallFromTimer=v;
},{}],136:[function(require,module,exports) {
"use strict";var t=require("./raw"),r=[],n=[],e=t.makeRequestCallFromTimer(l);function l(){if(n.length)throw n.shift()}function o(n){var e;(e=r.length?r.pop():new i).task=n,t(e)}function i(){this.task=null}module.exports=o,i.prototype.call=function(){try{this.task.call()}catch(t){o.onerror?o.onerror(t):(n.push(t),e())}finally{this.task=null,r[r.length]=this}};
},{"./raw":166}],68:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.flushToStyleTag=exports.minify=exports.css=exports.StyleSheetTestUtils=exports.StyleSheetServer=exports.StyleSheet=void 0;var e=require("inline-style-prefixer/static/plugins/calc"),t=I(e),r=require("inline-style-prefixer/static/plugins/crossFade"),n=I(r),i=require("inline-style-prefixer/static/plugins/cursor"),o=I(i),a=require("inline-style-prefixer/static/plugins/filter"),s=I(a),u=require("inline-style-prefixer/static/plugins/flex"),l=I(u),f=require("inline-style-prefixer/static/plugins/flexboxIE"),c=I(f),y=require("inline-style-prefixer/static/plugins/flexboxOld"),p=I(y),d=require("inline-style-prefixer/static/plugins/gradient"),m=I(d),h=require("inline-style-prefixer/static/plugins/imageSet"),g=I(h),S=require("inline-style-prefixer/static/plugins/position"),v=I(S),x=require("inline-style-prefixer/static/plugins/sizing"),b=I(x),k=require("inline-style-prefixer/static/plugins/transition"),O=I(k),w=require("string-hash"),A=I(w),C=require("inline-style-prefixer/static/createPrefixer"),j=I(C),T=require("asap"),E=I(T);function I(e){return e&&e.__esModule?e:{default:e}}var R=["Webkit"],M=["Moz"],q=["ms"],F=["Webkit","Moz"],P=["Webkit","ms"],W=["Webkit","Moz","ms"],D={plugins:[t.default,n.default,o.default,s.default,l.default,c.default,p.default,m.default,g.default,v.default,b.default,O.default],prefixMap:{transform:P,transformOrigin:P,transformOriginX:P,transformOriginY:P,backfaceVisibility:R,perspective:R,perspectiveOrigin:R,transformStyle:R,transformOriginZ:R,animation:R,animationDelay:R,animationDirection:R,animationFillMode:R,animationDuration:R,animationIterationCount:R,animationName:R,animationPlayState:R,animationTimingFunction:R,appearance:F,userSelect:W,fontKerning:R,textEmphasisPosition:R,textEmphasis:R,textEmphasisStyle:R,textEmphasisColor:R,boxDecorationBreak:R,clipPath:R,maskImage:R,maskMode:R,maskRepeat:R,maskPosition:R,maskClip:R,maskOrigin:R,maskSize:R,maskComposite:R,mask:R,maskBorderSource:R,maskBorderMode:R,maskBorderSlice:R,maskBorderWidth:R,maskBorderOutset:R,maskBorderRepeat:R,maskBorder:R,maskType:R,textDecorationStyle:F,textDecorationSkip:F,textDecorationLine:F,textDecorationColor:F,filter:R,fontFeatureSettings:F,breakAfter:W,breakBefore:W,breakInside:W,columnCount:F,columnFill:F,columnGap:F,columnRule:F,columnRuleColor:F,columnRuleStyle:F,columnRuleWidth:F,columns:F,columnSpan:F,columnWidth:F,writingMode:P,flex:P,flexBasis:R,flexDirection:P,flexGrow:R,flexFlow:P,flexShrink:R,flexWrap:P,alignContent:R,alignItems:R,alignSelf:R,justifyContent:R,order:R,transitionDelay:R,transitionDuration:R,transitionProperty:R,transitionTimingFunction:R,backdropFilter:R,scrollSnapType:P,scrollSnapPointsX:P,scrollSnapPointsY:P,scrollSnapDestination:P,scrollSnapCoordinate:P,shapeImageThreshold:R,shapeImageMargin:R,shapeImageOutside:R,hyphens:W,flowInto:P,flowFrom:P,regionFragment:P,boxSizing:M,textAlignLast:M,tabSize:M,wrapFlow:q,wrapThrough:q,wrapMargin:q,touchAction:q,gridTemplateColumns:q,gridTemplateRows:q,gridTemplateAreas:q,gridTemplate:q,gridAutoColumns:q,gridAutoRows:q,gridAutoFlow:q,grid:q,gridRowStart:q,gridColumnStart:q,gridRowEnd:q,gridRow:q,gridColumn:q,gridColumnEnd:q,gridColumnGap:q,gridRowGap:q,gridArea:q,gridGap:q,textSizeAdjust:P,borderImage:R,borderImageOutset:R,borderImageRepeat:R,borderImageSlice:R,borderImageSource:R,borderImageWidth: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},z=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}();function B(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var G="undefined"!=typeof Map,N=function(){function e(){B(this,e),this.elements={},this.keyOrder=[]}return z(e,[{key:"forEach",value:function(){return function(e){for(var t=0;t<this.keyOrder.length;t++)e(this.elements[this.keyOrder[t]],this.keyOrder[t])}}()},{key:"set",value:function(){return function(t,r,n){if(this.elements.hasOwnProperty(t)){if(n){var i=this.keyOrder.indexOf(t);this.keyOrder.splice(i,1),this.keyOrder.push(t)}}else this.keyOrder.push(t);if(null!=r){if(G&&r instanceof Map||r instanceof e){var o=this.elements.hasOwnProperty(t)?this.elements[t]:new e;return r.forEach(function(e,t){o.set(t,e,n)}),void(this.elements[t]=o)}if(Array.isArray(r)||"object"!==(void 0===r?"undefined":_(r)))this.elements[t]=r;else{for(var a=this.elements.hasOwnProperty(t)?this.elements[t]:new e,s=Object.keys(r),u=0;u<s.length;u+=1)a.set(s[u],r[s[u]],n);this.elements[t]=a}}else this.elements[t]=r}}()},{key:"get",value:function(){return function(e){return this.elements[e]}}()},{key:"has",value:function(){return function(e){return this.elements.hasOwnProperty(e)}}()},{key:"addStyleType",value:function(){return function(t){var r=this;if(G&&t instanceof Map||t instanceof e)t.forEach(function(e,t){r.set(t,e,!0)});else for(var n=Object.keys(t),i=0;i<n.length;i++)this.set(n[i],t[n[i]],!0)}}()}]),e}(),L=/([A-Z])/g,U=function(e){return"-"+String(e.toLowerCase())},H=function(e){var t=e.replace(L,U);return"m"===t[0]&&"s"===t[1]&&"-"===t[2]?"-"+String(t):t},J={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridColumn:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};function X(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}var Y=["Webkit","ms","Moz","O"];Object.keys(J).forEach(function(e){Y.forEach(function(t){J[X(t,e)]=J[e]})});var Z=function(e,t){return"number"==typeof t?J[e]?""+t:t+"px":""+t},K=function(e,t){return $(Z(e,t))},V=function(e,t){return(0,A.default)(e).toString(36)},Q=function(e){return V(JSON.stringify(e))},$=function(e){return"!"===e[e.length-10]&&" !important"===e.slice(-11)?e:String(e)+" !important"};function ee(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}var te=(0,j.default)(D),re=[function(){return function(e,t,r){return":"!==e[0]?null:r(t+e)}}(),function(){return function(e,t,r){if("@"!==e[0])return null;var n=r(t);return[String(e)+"{"+String(n.join(""))+"}"]}}()],ne=function e(t,r,n,i,o){for(var a=new N,s=0;s<r.length;s++)a.addStyleType(r[s]);var u=new N,l=[];a.forEach(function(r,a){n.some(function(s){var u=s(a,t,function(t){return e(t,[r],n,i,o)});if(null!=u)return Array.isArray(u)?l.push.apply(l,ee(u)):(console.warn("WARNING: Selector handlers should return an array of rules.Returning a string containing multiple rules is deprecated.",s),l.push("@media all {"+String(u)+"}")),!0})||u.set(a,r,!0)});var f=se(t,u,i,o,n);return f&&l.unshift(f),l},ie=function(e,t,r){if(t)for(var n=Object.keys(t),i=0;i<n.length;i++){var o=n[i];e.has(o)&&e.set(o,t[o](e.get(o),r),!1)}},oe=function(e,t,r){return String(H(e))+":"+String(r(e,t))+";"},ae=function(e,t){return e[t]=!0,e},se=function(e,t,r,n,i){ie(t,r,i);var o=Object.keys(t.elements).reduce(ae,Object.create(null)),a=te(t.elements),s=Object.keys(a);if(s.length!==t.keyOrder.length)for(var u=0;u<s.length;u++)if(!o[s[u]]){var l=void 0;if((l="W"===s[u][0]?s[u][6].toLowerCase()+s[u].slice(7):"o"===s[u][1]?s[u][3].toLowerCase()+s[u].slice(4):s[u][2].toLowerCase()+s[u].slice(3))&&o[l]){var f=t.keyOrder.indexOf(l);t.keyOrder.splice(f,0,s[u])}else t.keyOrder.unshift(s[u])}for(var c=!1===n?Z:K,y=[],p=0;p<t.keyOrder.length;p++){var d=t.keyOrder[p],m=a[d];if(Array.isArray(m))for(var h=0;h<m.length;h++)y.push(oe(d,m[h],c));else y.push(oe(d,m,c))}return y.length?String(e)+"{"+String(y.join(""))+"}":""},ue="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};function le(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}var fe=null,ce=function(e){if(null==fe&&null==(fe=document.querySelector("style[data-aphrodite]"))){var t=document.head||document.getElementsByTagName("head")[0];(fe=document.createElement("style")).type="text/css",fe.setAttribute("data-aphrodite",""),t.appendChild(fe)}var r=fe.styleSheet||fe.sheet;if(r.insertRule){var n=r.cssRules.length;e.forEach(function(e){try{r.insertRule(e,n),n+=1}catch(e){}})}else fe.innerText=(fe.innerText||"")+e.join("")},ye={fontFamily:function(){return function e(t){return Array.isArray(t)?t.map(e).join(","):"object"===(void 0===t?"undefined":ue(t))?(ge(t.src,"@font-face",[t],!1),'"'+String(t.fontFamily)+'"'):t}}(),animationName:function(){return function e(t,r){if(Array.isArray(t))return t.map(function(t){return e(t,r)}).join(",");if("object"===(void 0===t?"undefined":ue(t))){var n="keyframe_"+String(Q(t)),i="@keyframes "+n+"{";return t instanceof N?t.forEach(function(e,t){i+=ne(t,[e],r,ye,!1).join("")}):Object.keys(t).forEach(function(e){i+=ne(e,[t[e]],r,ye,!1).join("")}),he(n,[i+="}"]),n}return t}}()},pe={},de=[],me=!1,he=function(e,t){var r;if(!pe[e]){if(!me){if("undefined"==typeof document)throw new Error("Cannot automatically buffer without a document");me=!0,(0,E.default)(Oe)}(r=de).push.apply(r,le(t)),pe[e]=!0}},ge=function(e,t,r,n){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[];if(!pe[e]){var o=ne(t,r,i,ye,n);he(e,o)}},Se=function(){de=[],pe={},me=!1,fe=null},ve=function(){return de},xe=function(){if(me)throw new Error("Cannot buffer while already buffering");me=!0},be=function(){me=!1;var e=de;return de=[],e},ke=function(){return be().join("")},Oe=function(){var e=be();e.length>0&&ce(e)},we=function(){return Object.keys(pe)},Ae=function(e){e.forEach(function(e){pe[e]=!0})},Ce=function e(t,r,n,i){for(var o=0;o<t.length;o+=1)t[o]&&(Array.isArray(t[o])?i+=e(t[o],r,n,i):(r.push(t[o]._name),n.push(t[o]._definition),i+=t[o]._len));return i},je=function(e,t,r){var n=[],i=[],o=Ce(t,n,i,0);if(0===n.length)return"";var a=void 0;return a=1===n.length?"_"+String(n[0]):"_"+String(V(n.join()))+String((o%36).toString(36)),ge(a,"."+String(a),i,e,r),a},Te=function(e,t){return String(t)+"_"+String(V(e))},Ee=function(){return V},Ie=Ee(),Re={create:function(){return function(e){for(var t={},r=Object.keys(e),n=0;n<r.length;n+=1){var i=r[n],o=e[i],a=JSON.stringify(o);t[i]={_len:a.length,_name:Ie(a,i),_definition:o}}return t}}(),rehydrate:function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];Ae(e)}}()},Me="undefined"!=typeof window?null:{renderStatic:function(){return function(e){return Se(),xe(),{html:e(),css:{content:ke(),renderedClassNames:we()}}}}()},qe=null;function Fe(e,t){return{StyleSheet:Object.assign({},Re,{extend:function(){return function(r){var n=r.map(function(e){return e.selectorHandler}).filter(function(e){return e});return Fe(e,t.concat(n))}}()}),StyleSheetServer:Me,StyleSheetTestUtils:qe,minify:function(){return function(e){Ie=e?V:Te}}(),css:function(){return function(){for(var r=arguments.length,n=Array(r),i=0;i<r;i++)n[i]=arguments[i];return je(e,n,t)}}()}}var Pe=!0,We=Fe(Pe,re),De=We.StyleSheet,_e=We.StyleSheetServer,ze=We.StyleSheetTestUtils,Be=We.css,Ge=We.minify;exports.StyleSheet=De,exports.StyleSheetServer=_e,exports.StyleSheetTestUtils=ze,exports.css=Be,exports.minify=Ge,exports.flushToStyleTag=Oe;
},{"inline-style-prefixer/static/plugins/calc":123,"inline-style-prefixer/static/plugins/crossFade":124,"inline-style-prefixer/static/plugins/cursor":125,"inline-style-prefixer/static/plugins/filter":126,"inline-style-prefixer/static/plugins/flex":127,"inline-style-prefixer/static/plugins/flexboxIE":128,"inline-style-prefixer/static/plugins/flexboxOld":129,"inline-style-prefixer/static/plugins/gradient":130,"inline-style-prefixer/static/plugins/imageSet":131,"inline-style-prefixer/static/plugins/position":132,"inline-style-prefixer/static/plugins/sizing":133,"inline-style-prefixer/static/plugins/transition":134,"string-hash":144,"inline-style-prefixer/static/createPrefixer":135,"asap":136}],79:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.commonStyle=exports.ZIndex=exports.Duration=exports.Sizes=exports.Colors=exports.FontSize=exports.FontFamily=void 0;var o=require("aphrodite"),e=exports.FontFamily=void 0;!function(o){o.MONOSPACE='"Source Code Pro", Courier, monospace'}(e||(exports.FontFamily=e={}));var t=exports.FontSize=void 0;!function(o){o[o.LABEL=10]="LABEL",o[o.TITLE=12]="TITLE",o[o.BIG_BUTTON=36]="BIG_BUTTON"}(t||(exports.FontSize=t={}));var r=exports.Colors=void 0;!function(o){o.WHITE="#FFFFFF",o.OFF_WHITE="#F6F6F6",o.LIGHT_GRAY="#BDBDBD",o.GRAY="#666666",o.DARK_GRAY="#222222",o.BLACK="#000000",o.BRIGHT_BLUE="#56CCF2",o.DARK_BLUE="#2F80ED",o.PALE_DARK_BLUE="#8EB7ED",o.GREEN="#6FCF97",o.TRANSPARENT_GREEN="rgba(111, 207, 151, 0.2)"}(r||(exports.Colors=r={}));var T=exports.Sizes=void 0;!function(o){o[o.MINIMAP_HEIGHT=100]="MINIMAP_HEIGHT",o[o.DETAIL_VIEW_HEIGHT=150]="DETAIL_VIEW_HEIGHT",o[o.TOOLTIP_WIDTH_MAX=900]="TOOLTIP_WIDTH_MAX",o[o.TOOLTIP_HEIGHT_MAX=80]="TOOLTIP_HEIGHT_MAX",o[o.SEPARATOR_HEIGHT=2]="SEPARATOR_HEIGHT",o[o.FRAME_HEIGHT=20]="FRAME_HEIGHT",o[o.TOOLBAR_HEIGHT=20]="TOOLBAR_HEIGHT",o[o.TOOLBAR_TAB_HEIGHT=18]="TOOLBAR_TAB_HEIGHT"}(T||(exports.Sizes=T={}));var i=exports.Duration=void 0;!function(o){o.HOVER_CHANGE="0.07s"}(i||(exports.Duration=i={}));var E=exports.ZIndex=void 0;!function(o){o[o.HOVERTIP=1]="HOVERTIP"}(E||(exports.ZIndex=E={}));const I=exports.commonStyle=o.StyleSheet.create({fillY:{height:"100%"},fillX:{width:"100%"},hbox:{display:"flex",flexDirection:"row",position:"relative",overflow:"hidden"},vbox:{display:"flex",flexDirection:"column",position:"relative",overflow:"hidden"}});
},{"aphrodite":68}],106:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ColorChit=void 0;var e=require("preact"),t=require("aphrodite"),r=require("./style");class o extends e.Component{render(){return(0,e.h)("span",{className:(0,t.css)(i.stackChit),style:{backgroundColor:this.props.color}})}}exports.ColorChit=o;const i=t.StyleSheet.create({stackChit:{position:"relative",top:-1,display:"inline-block",verticalAlign:"middle",marginRight:"0.5em",border:`1px solid ${r.Colors.LIGHT_GRAY}`,width:r.FontSize.LABEL-2,height:r.FontSize.LABEL-2}});
},{"preact":24,"aphrodite":68,"./style":79}],108:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ScrollableListView=void 0;var e=require("preact");class i extends e.Component{constructor(e){super(e),this.viewport=null,this.viewportRef=(e=>{this.viewport=e||null}),this.pendingScroll=0,this.onWindowResize=(()=>{this.recomputeVisibleIndices(this.props)}),this.onViewportScroll=(e=>{this.recomputeVisibleIndices(this.props)}),this.state={firstVisibleIndex:null,lastVisibleIndex:null,invisiblePrefixSize:null,viewportSize:null,cachedTotalSize:e.items.reduce((e,i)=>e+i.size,0)}}recomputeVisibleIndices(e){if(!this.viewport)return;const{items:i}=e,t=this.viewport.getBoundingClientRect().height,s=this.viewport.scrollTop-t/4,o=this.viewport.scrollTop+t+t/4;let l=0,r=0,n=0;for(;n<i.length;n++){if(r=l,(l+=i[n].size)>=s)break}const p=n;for(;n<i.length;n++){if((l+=i[n].size)>=o)break}const c=Math.min(n,i.length-1);this.setState({invisiblePrefixSize:r,firstVisibleIndex:p,lastVisibleIndex:c})}scrollIndexIntoView(e){this.pendingScroll=this.props.items.reduce((i,t,s)=>s>=e?i:i+t.size,0)}applyPendingScroll(){if(!this.viewport)return;const e="y"===this.props.axis?"top":"left";this.viewport.scrollTo({[e]:this.pendingScroll})}componentWillReceiveProps(e){this.props.items!==e.items&&this.recomputeVisibleIndices(e)}componentDidMount(){this.applyPendingScroll(),this.recomputeVisibleIndices(this.props),window.addEventListener("resize",this.onWindowResize)}componentWillUnmount(){window.removeEventListener("resize",this.onWindowResize)}render(){const{cachedTotalSize:i,firstVisibleIndex:t,lastVisibleIndex:s,invisiblePrefixSize:o}=this.state;return(0,e.h)("div",{className:this.props.className,ref:this.viewportRef,onScroll:this.onViewportScroll},(0,e.h)("div",{style:{height:i}},(0,e.h)("div",{style:{transform:`translateY(${o}px)`}},null!=t&&null!=s&&this.props.renderItems(t,s))))}}exports.ScrollableListView=i;
},{"preact":24}],117:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});class t{constructor(t){this.data=t,this.prev=null,this.next=null}}class e{constructor(){this.head=null,this.tail=null,this.size=0}getHead(){return this.head}getTail(){return this.tail}getSize(){return this.size}append(t){this.tail?(this.tail.next=t,t.prev=this.tail,this.tail=t):this.head=this.tail=t,this.size++}prepend(t){return this.head?(this.head.prev=t,t.next=this.head,this.head=t):this.head=this.tail=t,this.size++,t}pop(){if(this.tail){const t=this.tail;return t.prev?(this.tail=t.prev,this.tail.next=null):this.head=this.tail=null,this.size--,t.prev=null,t}return null}dequeue(){if(this.head){const t=this.head;return t.next?(this.head=t.next,this.head.prev=null):this.head=this.tail=null,this.size--,t.next=null,t}return null}remove(t){null==t.prev?this.dequeue():null==t.next?this.pop():(t.next.prev=t.prev,t.prev.next=t.next,t.next=null,t.prev=null,this.size--)}}exports.List=e;class i{constructor(t){this.capacity=t,this.list=new e,this.map=new Map}has(t){return this.map.has(t)}get(t){const e=this.map.get(t);return e?(this.list.remove(e.listNode),this.list.prepend(e.listNode),e?e.value:null):null}getSize(){return this.list.getSize()}getCapacity(){return this.capacity}insert(e,i){const s=this.map.get(e);for(s&&this.list.remove(s.listNode);this.list.getSize()>=this.capacity;)this.map.delete(this.list.pop().data);const h=this.list.prepend(new t(e));this.map.set(e,{value:i,listNode:h})}getOrInsert(t,e){let i=this.get(t);return null==i&&(i=e(t),this.insert(t,i)),i}removeLRU(){const t=this.list.pop();if(!t)return null;const e=t.data,i=this.map.get(e).value;return this.map.delete(e),[e,i]}clear(){this.list=new e,this.map=new Map}}exports.LRUCache=i;
},{}],96:[function(require,module,exports) {

var t,e,n=module.exports={};function r(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function i(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(n){try{return t.call(null,e,0)}catch(n){return t.call(this,e,0)}}}function u(t){if(e===clearTimeout)return clearTimeout(t);if((e===o||!e)&&clearTimeout)return e=clearTimeout,clearTimeout(t);try{return e(t)}catch(n){try{return e.call(null,t)}catch(n){return e.call(this,t)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(e){t=r}try{e="function"==typeof clearTimeout?clearTimeout:o}catch(t){e=o}}();var c,s=[],l=!1,a=-1;function f(){l&&c&&(l=!1,c.length?s=c.concat(s):a=-1,s.length&&h())}function h(){if(!l){var t=i(f);l=!0;for(var e=s.length;e;){for(c=s,s=[];++a<e;)c&&c[a].run();a=-1,e=s.length}c=null,l=!1,u(t)}}function m(t,e){this.fun=t,this.array=e}function p(){}n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)e[n-1]=arguments[n];s.push(new m(t,e)),1!==s.length||l||i(h)},m.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=p,n.addListener=p,n.once=p,n.off=p,n.removeListener=p,n.removeAllListeners=p,n.emit=p,n.prependListener=p,n.prependOnceListener=p,n.listeners=function(t){return[]},n.binding=function(t){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(t){throw new Error("process.chdir is not supported")},n.umask=function(){return 0};
},{}],42:[function(require,module,exports) {
var process = require("process");
var t=require("process");Object.defineProperty(exports,"__esModule",{value:!0});const e=void 0!==t&&t.env&&!0;function i(t){if(!e&&!t)throw new Error("Assertion failed.")}function r(t,e){-1===t.indexOf(e)&&t.push(e)}function s(t,e){const i=t.indexOf(e);-1!==i&&t.splice(i,1)}function n(t,e){return i(e>=0&&e<=31),t.TEXTURE0+e}var h=exports.Graphics=void 0;!function(t){t.Rect=class{constructor(t=0,e=0,i=0,r=0){this.x=t,this.y=e,this.width=i,this.height=r}set(t,e,i,r){this.x=t,this.y=e,this.width=i,this.height=r}equals(t){return this.x===t.x&&this.y===t.y&&this.width===t.width&&this.height===t.height}};class e{constructor(t,e,i,r){this.redF=t,this.greenF=e,this.blueF=i,this.alphaF=r}}let i,r,s,n,h;e.TRANSPARENT=new e(0,0,0,0),t.Color=e,function(t){t[t.ZERO=0]="ZERO",t[t.ONE=1]="ONE",t[t.SOURCE_COLOR=2]="SOURCE_COLOR",t[t.TARGET_COLOR=3]="TARGET_COLOR",t[t.INVERSE_SOURCE_COLOR=4]="INVERSE_SOURCE_COLOR",t[t.INVERSE_TARGET_COLOR=5]="INVERSE_TARGET_COLOR",t[t.SOURCE_ALPHA=6]="SOURCE_ALPHA",t[t.TARGET_ALPHA=7]="TARGET_ALPHA",t[t.INVERSE_SOURCE_ALPHA=8]="INVERSE_SOURCE_ALPHA",t[t.INVERSE_TARGET_ALPHA=9]="INVERSE_TARGET_ALPHA",t[t.CONSTANT=10]="CONSTANT",t[t.INVERSE_CONSTANT=11]="INVERSE_CONSTANT"}(i=t.BlendOperation||(t.BlendOperation={})),function(t){t[t.TRIANGLES=0]="TRIANGLES",t[t.TRIANGLE_STRIP=1]="TRIANGLE_STRIP"}(r=t.Primitive||(t.Primitive={}));function a(t){return t==s.FLOAT?4:1}t.Context=class{setCopyBlendState(){this.setBlendState(i.ONE,i.ZERO)}setAddBlendState(){this.setBlendState(i.ONE,i.ONE)}setPremultipliedBlendState(){this.setBlendState(i.ONE,i.INVERSE_SOURCE_ALPHA)}setUnpremultipliedBlendState(){this.setBlendState(i.SOURCE_ALPHA,i.INVERSE_SOURCE_ALPHA)}},function(t){t[t.FLOAT=0]="FLOAT",t[t.BYTE=1]="BYTE"}(s=t.AttributeType||(t.AttributeType={})),t.attributeByteLength=a;class _{constructor(t,e,i,r){this.name=t,this.type=e,this.count=i,this.byteOffset=r}}t.Attribute=_;t.VertexFormat=class{constructor(){this._attributes=[],this._stride=0}get attributes(){return this._attributes}get stride(){return this._stride}add(t,e,i){return this.attributes.push(new _(t,e,i,this.stride)),this._stride+=i*a(e),this}};t.VertexBuffer=class{uploadFloat32Array(t){this.upload(new Uint8Array(t.buffer),0)}uploadFloats(t){this.uploadFloat32Array(new Float32Array(t))}},function(t){t[t.NEAREST=0]="NEAREST",t[t.LINEAR=1]="LINEAR"}(n=t.PixelFilter||(t.PixelFilter={})),function(t){t[t.REPEAT=0]="REPEAT",t[t.CLAMP=1]="CLAMP"}(h=t.PixelWrap||(t.PixelWrap={}));class o{constructor(t,e,i){this.minFilter=t,this.magFilter=e,this.wrap=i}}o.LINEAR_CLAMP=new o(n.LINEAR,n.LINEAR,h.CLAMP),o.LINEAR_MIN_NEAREST_MAG_CLAMP=new o(n.LINEAR,n.NEAREST,h.CLAMP),o.NEAREST_CLAMP=new o(n.NEAREST,n.NEAREST,h.CLAMP),t.TextureFormat=o}(h||(exports.Graphics=h={}));var a=exports.WebGL=void 0;!function(t){class a extends h.Context{constructor(t=document.createElement("canvas")){super(),this._attributeCount=0,this._blendOperations=0,this._contextResetHandlers=[],this._currentClearColor=h.Color.TRANSPARENT,this._currentRenderTarget=null,this._defaultViewport=new h.Rect,this._forceStateUpdate=!0,this._generation=1,this._height=0,this._oldBlendOperations=0,this._oldRenderTarget=null,this._oldViewport=new h.Rect,this._width=0,this.handleWebglContextRestored=(()=>{this._attributeCount=0,this._currentClearColor=h.Color.TRANSPARENT,this._forceStateUpdate=!0,this._generation++;for(let t of this._contextResetHandlers)t()}),this.ANGLE_instanced_arrays=null,this.ANGLE_instanced_arrays_generation=-1;let e=t.getContext("webgl",{alpha:!1,antialias:!1,depth:!1,preserveDrawingBuffer:!1,stencil:!1});if(null==e)throw new Error("Setup failure");this._gl=e;let i=t.style;t.width=0,t.height=0,i.width=i.height="0",t.addEventListener("webglcontextlost",t=>{t.preventDefault()}),t.addEventListener("webglcontextrestored",this.handleWebglContextRestored),this._blendOperationMap={[h.BlendOperation.ZERO]:this._gl.ZERO,[h.BlendOperation.ONE]:this._gl.ONE,[h.BlendOperation.SOURCE_COLOR]:this._gl.SRC_COLOR,[h.BlendOperation.TARGET_COLOR]:this._gl.DST_COLOR,[h.BlendOperation.INVERSE_SOURCE_COLOR]:this._gl.ONE_MINUS_SRC_COLOR,[h.BlendOperation.INVERSE_TARGET_COLOR]:this._gl.ONE_MINUS_DST_COLOR,[h.BlendOperation.SOURCE_ALPHA]:this._gl.SRC_ALPHA,[h.BlendOperation.TARGET_ALPHA]:this._gl.DST_ALPHA,[h.BlendOperation.INVERSE_SOURCE_ALPHA]:this._gl.ONE_MINUS_SRC_ALPHA,[h.BlendOperation.INVERSE_TARGET_ALPHA]:this._gl.ONE_MINUS_DST_ALPHA,[h.BlendOperation.CONSTANT]:this._gl.CONSTANT_COLOR,[h.BlendOperation.INVERSE_CONSTANT]:this._gl.ONE_MINUS_CONSTANT_COLOR}}get widthInPixels(){return this._width}get heightInPixels(){return this._height}testContextLoss(){this.handleWebglContextRestored()}get gl(){return this._gl}get generation(){return this._generation}addContextResetHandler(t){r(this._contextResetHandlers,t)}removeContextResetHandler(t){s(this._contextResetHandlers,t)}get currentRenderTarget(){return this._currentRenderTarget}beginFrame(){this.setRenderTarget(null)}endFrame(){}setBlendState(t,e){this._blendOperations=a._packBlendModes(t,e)}setViewport(t,e,i,r){(null!=this._currentRenderTarget?this._currentRenderTarget.viewport:this._defaultViewport).set(t,e,i,r)}get viewport(){return null!=this._currentRenderTarget?this._currentRenderTarget.viewport:this._defaultViewport}get renderTargetWidthInPixels(){return null!=this._currentRenderTarget?this._currentRenderTarget.viewport.width:this._width}get renderTargetHeightInPixels(){return null!=this._currentRenderTarget?this._currentRenderTarget.viewport.height:this._height}draw(t,e,i){this._updateRenderTargetAndViewport(),f.from(e).prepare(),R.from(i).prepare(),this._updateFormat(e.format),this._updateBlendState(),this._gl.drawArrays(t==h.Primitive.TRIANGLES?this._gl.TRIANGLES:this._gl.TRIANGLE_STRIP,0,Math.floor(i.byteCount/e.format.stride)),this._forceStateUpdate=!1}resize(t,e,i,r){let s=this._gl.canvas;const n=s.getBoundingClientRect();if(this._width===i&&this._height===e&&n.width===i&&n.height===r)return;let h=s.style;s.width=t,s.height=e,h.width=`${i}px`,h.height=`${r}px`,this.setViewport(0,0,t,e),this._width=t,this._height=e}clear(t){this._updateRenderTargetAndViewport(),this._updateBlendState(),t!=this._currentClearColor&&(this._gl.clearColor(t.redF,t.greenF,t.blueF,t.alphaF),this._currentClearColor=t),this._gl.clear(this._gl.COLOR_BUFFER_BIT)}setRenderTarget(t){this._currentRenderTarget=A.from(t)}createMaterial(t,e,i){let r=new f(this,t,e,i);return r.program,r}createVertexBuffer(t){return i(t>0&&t%4==0),new R(this,t)}createTexture(t,e,i,r){return new p(this,t,e,i,r)}createRenderTarget(t){return new A(this,p.from(t))}getANGLE_instanced_arrays(){if(this.ANGLE_instanced_arrays_generation!==this._generation&&(this.ANGLE_instanced_arrays=null),!this.ANGLE_instanced_arrays&&(this.ANGLE_instanced_arrays=this.gl.getExtension("ANGLE_instanced_arrays"),!this.ANGLE_instanced_arrays))throw new Error("Failed to get extension ANGLE_instanced_arrays");return this.ANGLE_instanced_arrays}_updateRenderTargetAndViewport(){let t=this._currentRenderTarget,e=null!=t?t.viewport:this._defaultViewport,i=this._gl;(this._forceStateUpdate||this._oldRenderTarget!=t)&&(i.bindFramebuffer(i.FRAMEBUFFER,t?t.framebuffer:null),this._oldRenderTarget=t),!this._forceStateUpdate&&this._oldViewport.equals(e)||(i.viewport(e.x,this.renderTargetHeightInPixels-e.y-e.height,e.width,e.height),this._oldViewport.set(e.x,e.y,e.width,e.height))}_updateBlendState(){if(this._forceStateUpdate||this._oldBlendOperations!=this._blendOperations){let t=this._gl,e=this._blendOperations,r=this._oldBlendOperations,s=15&e,n=e>>4;i(s in this._blendOperationMap),i(n in this._blendOperationMap),e==a.COPY_BLEND_OPERATIONS?t.disable(t.BLEND):((this._forceStateUpdate||r==a.COPY_BLEND_OPERATIONS)&&t.enable(t.BLEND),t.blendFunc(this._blendOperationMap[s],this._blendOperationMap[n])),this._oldBlendOperations=e}}_updateFormat(t){let e=this._gl,i=t.attributes,r=i.length;for(let s=0;s<r;s++){let r=i[s],n=r.type==h.AttributeType.BYTE;e.vertexAttribPointer(s,r.count,n?e.UNSIGNED_BYTE:e.FLOAT,n,t.stride,r.byteOffset)}for(;this._attributeCount<r;)e.enableVertexAttribArray(this._attributeCount),this._attributeCount++;for(;this._attributeCount>r;)this._attributeCount--,e.disableVertexAttribArray(this._attributeCount);this._attributeCount=r}getWebGLInfo(){const t=this.gl.getExtension("WEBGL_debug_renderer_info");return{renderer:t?this.gl.getParameter(t.UNMASKED_RENDERER_WEBGL):null,vendor:t?this.gl.getParameter(t.UNMASKED_VENDOR_WEBGL):null,version:this.gl.getParameter(this.gl.VERSION)}}static from(t){return i(null==t||t instanceof a),t}static _packBlendModes(t,e){return t|e<<4}}a.COPY_BLEND_OPERATIONS=a._packBlendModes(h.BlendOperation.ONE,h.BlendOperation.ZERO),t.Context=a;class _{constructor(t,e,i=0,r=null,s=!0){this._material=t,this._name=e,this._generation=i,this._location=r,this._isDirty=s}get location(){let t=a.from(this._material.context);if(this._generation!=t.generation&&(this._location=t.gl.getUniformLocation(this._material.program,this._name),this._generation=t.generation,!e)){let e=this._material.program,r=t.gl;for(let t=0,s=r.getProgramParameter(e,r.ACTIVE_UNIFORMS);t<s;t++){let s=r.getActiveUniform(e,t);if(s&&s.name==this._name)switch(i(1==s.size),s.type){case r.FLOAT:i(this instanceof o);break;case r.FLOAT_MAT3:i(this instanceof g);break;case r.FLOAT_VEC2:i(this instanceof u);break;case r.FLOAT_VEC3:i(this instanceof c);break;case r.FLOAT_VEC4:i(this instanceof d);break;case r.INT:i(this instanceof l);break;case r.SAMPLER_2D:i(this instanceof E);break;default:i(!1)}}}if(!this._location)throw new Error("Failed to get uniform location");return this._location}}class o extends _{constructor(){super(...arguments),this._x=0}set(t){t!=this._x&&(this._x=t,this._isDirty=!0)}prepare(){let t=a.from(this._material.context);(this._generation!=t.generation||this._isDirty)&&(t.gl.uniform1f(this.location,this._x),this._isDirty=!1)}}class l extends _{constructor(){super(...arguments),this._x=0}set(t){t!=this._x&&(this._x=t,this._isDirty=!0)}prepare(){let t=a.from(this._material.context);(this._generation!=t.generation||this._isDirty)&&(t.gl.uniform1i(this.location,this._x),this._isDirty=!1)}}class u extends _{constructor(){super(...arguments),this._x=0,this._y=0}set(t,e){t==this._x&&e==this._y||(this._x=t,this._y=e,this._isDirty=!0)}prepare(){let t=a.from(this._material.context);(this._generation!=t.generation||this._isDirty)&&(t.gl.uniform2f(this.location,this._x,this._y),this._isDirty=!1)}}class c extends _{constructor(){super(...arguments),this._x=0,this._y=0,this._z=0}set(t,e,i){t==this._x&&e==this._y&&i==this._z||(this._x=t,this._y=e,this._z=i,this._isDirty=!0)}prepare(){let t=a.from(this._material.context);(this._generation!=t.generation||this._isDirty)&&(t.gl.uniform3f(this.location,this._x,this._y,this._z),this._isDirty=!1)}}class d extends _{constructor(){super(...arguments),this._x=0,this._y=0,this._z=0,this._w=0}set(t,e,i,r){t==this._x&&e==this._y&&i==this._z&&r==this._w||(this._x=t,this._y=e,this._z=i,this._w=r,this._isDirty=!0)}prepare(){let t=a.from(this._material.context);(this._generation!=t.generation||this._isDirty)&&(t.gl.uniform4f(this.location,this._x,this._y,this._z,this._w),this._isDirty=!1)}}class g extends _{constructor(){super(...arguments),this._values=[1,0,0,0,1,0,0,0,1]}set(t,e,i,r,s,n,h,a,_){g._cachedValues[0]=t,g._cachedValues[1]=r,g._cachedValues[2]=h,g._cachedValues[3]=e,g._cachedValues[4]=s,g._cachedValues[5]=a,g._cachedValues[6]=i,g._cachedValues[7]=n,g._cachedValues[8]=_;for(let t=0;t<9;t++)if(g._cachedValues[t]!=this._values[t]){let t=this._values;this._values=g._cachedValues,g._cachedValues=t,this._isDirty=!0;break}}prepare(){let t=a.from(this._material.context);(this._generation!=t.generation||this._isDirty)&&(t.gl.uniformMatrix3fv(this.location,!1,this._values),this._isDirty=!1)}}g._cachedValues=[1,0,0,0,1,0,0,0,1];class E extends _{constructor(){super(...arguments),this._texture=null,this._index=-1}set(t,e){this._texture==t&&this._index==e||(this._texture=p.from(t),this._index=e,this._isDirty=!0)}prepare(){let t=a.from(this._material.context),e=t.gl;i(null==this._texture||null==t.currentRenderTarget||this._texture!=t.currentRenderTarget.texture),(this._generation!=t.generation||this._isDirty)&&(e.uniform1i(this.location,this._index),this._isDirty=!1),e.activeTexture(n(e,this._index)),e.bindTexture(e.TEXTURE_2D,null!=this._texture&&this._texture.width>0&&this._texture.height>0?this._texture.texture:null)}}class f{constructor(t,e,i,r,s={},n=[],h=0,a=null){this._context=t,this._format=e,this._vertexSource=i,this._fragmentSource=r,this._uniformsMap=s,this._uniformsList=n,this._generation=h,this._program=a}get context(){return this._context}get format(){return this._format}get vertexSource(){return this._vertexSource}get fragmentSource(){return this._fragmentSource}setUniformFloat(t,e){let r=this._uniformsMap[t]||null;null==r&&(r=new o(this,t),this._uniformsMap[t]=r,this._uniformsList.push(r)),i(r instanceof o),r.set(e)}setUniformInt(t,e){let r=this._uniformsMap[t]||null;null==r&&(r=new l(this,t),this._uniformsMap[t]=r,this._uniformsList.push(r)),i(r instanceof l),r.set(e)}setUniformVec2(t,e,r){let s=this._uniformsMap[t]||null;null==s&&(s=new u(this,t),this._uniformsMap[t]=s,this._uniformsList.push(s)),i(s instanceof u),s.set(e,r)}setUniformVec3(t,e,r,s){let n=this._uniformsMap[t]||null;null==n&&(n=new c(this,t),this._uniformsMap[t]=n,this._uniformsList.push(n)),i(n instanceof c),n.set(e,r,s)}setUniformVec4(t,e,r,s,n){let h=this._uniformsMap[t]||null;null==h&&(h=new d(this,t),this._uniformsMap[t]=h,this._uniformsList.push(h)),i(h instanceof d),h.set(e,r,s,n)}setUniformMat3(t,e,r,s,n,h,a,_,o,l){let u=this._uniformsMap[t]||null;null==u&&(u=new g(this,t),this._uniformsMap[t]=u,this._uniformsList.push(u)),i(u instanceof g),u.set(e,r,s,n,h,a,_,o,l)}setUniformSampler(t,e,r){let s=this._uniformsMap[t]||null;null==s&&(s=new E(this,t),this._uniformsMap[t]=s,this._uniformsList.push(s)),i(s instanceof E),s.set(e,r)}get program(){let t=this._context.gl;if(this._generation!=this._context.generation){this._program=t.createProgram(),this._compileShader(t,t.VERTEX_SHADER,this.vertexSource),this._compileShader(t,t.FRAGMENT_SHADER,this.fragmentSource);let r=this.format.attributes;for(let e=0;e<r.length;e++)t.bindAttribLocation(this._program,e,r[e].name);if(t.linkProgram(this._program),!t.getProgramParameter(this._program,t.LINK_STATUS))throw new Error(`${t.getProgramInfoLog(this._program)}`);if(this._generation=this._context.generation,!e)for(let e of r)for(let r=0,s=t.getProgramParameter(this.program,t.ACTIVE_ATTRIBUTES);r<s;r++){let s=t.getActiveAttrib(this.program,r);if(s&&s.name==e.name)switch(i(1==s.size),e.count){case 1:i(s.type==t.FLOAT);break;case 2:i(s.type==t.FLOAT_VEC2);break;case 3:i(s.type==t.FLOAT_VEC3);break;case 4:i(s.type==t.FLOAT_VEC4);break;default:i(!1)}}}return this._program}prepare(){this._context.gl.useProgram(this.program);for(let t of this._uniformsList)t.prepare()}_compileShader(t,e,i){let r=t.createShader(e);if(!r)throw new Error("Failed to create shader");if(t.shaderSource(r,i),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS))throw new Error(`${t.getShaderInfoLog(r)}`);if(!this._program)throw new Error("Tried to attach shader before program was created");t.attachShader(this._program,r)}static from(t){return i(null==t||t instanceof f),t}}class R extends h.VertexBuffer{constructor(t,e){super(),this._generation=0,this._buffer=null,this._bytes=null,this._isDirty=!0,this._dirtyMin=R.INT_MAX,this._dirtyMax=0,this._totalMin=R.INT_MAX,this._totalMax=0,this._byteCount=0,this._context=t,this._byteCount=e,this._bytes=new Uint8Array(e)}get context(){return this._context}get byteCount(){return this._byteCount}move(t,e,r){i(r>=0),i(0<=t&&t+r<=this._byteCount),i(0<=e&&e+r<=this._byteCount),this._bytes&&t!=e&&0!=r&&(this._bytes.set(this._bytes.subarray(t,this._byteCount),e),this._growDirtyRegion(Math.min(t,e),Math.max(t,e)+r))}upload(t,e=0){i(0<=e&&e+t.length<=this._byteCount),i(null!=this._bytes),this._bytes.set(t,e),this._growDirtyRegion(e,e+t.length)}free(){this._buffer&&this._context.gl.deleteBuffer(this._buffer),this._generation=0}prepare(){let t=this._context.gl;this._generation!==this._context.generation&&(this._buffer=t.createBuffer(),this._generation=this._context.generation,this._isDirty=!0),t.bindBuffer(t.ARRAY_BUFFER,this._buffer),this._isDirty&&(t.bufferData(t.ARRAY_BUFFER,this._byteCount,t.DYNAMIC_DRAW),this._dirtyMin=this._totalMin,this._dirtyMax=this._totalMax,this._isDirty=!1),this._dirtyMin<this._dirtyMax&&(t.bufferSubData(t.ARRAY_BUFFER,this._dirtyMin,this._bytes.subarray(this._dirtyMin,this._dirtyMax)),this._dirtyMin=R.INT_MAX,this._dirtyMax=0)}_growDirtyRegion(t,e){this._dirtyMin=Math.min(this._dirtyMin,t),this._dirtyMax=Math.max(this._dirtyMax,e),this._totalMin=Math.min(this._totalMin,t),this._totalMax=Math.max(this._totalMax,e)}static from(t){return i(null==t||t instanceof R),t}}R.INT_MAX=2147483647;class p{constructor(t,e,i,r,s=null,n=null,h=0,a=!0,_=!0){this._context=t,this._format=e,this._width=i,this._height=r,this._pixels=s,this._texture=n,this._generation=h,this._isFormatDirty=a,this._isContentDirty=_}get context(){return this._context}get format(){return this._format}get width(){return this._width}get height(){return this._height}resize(t,e,i=null){this._width=t,this._height=e,this._pixels=i,this._isContentDirty=!0}setFormat(t){this._format!=t&&(this._format=t,this._isFormatDirty=!0)}get texture(){let t=this._context.gl;return this._generation!=this._context.generation&&(this._texture=t.createTexture(),this._generation=this._context.generation,this._isFormatDirty=!0,this._isContentDirty=!0),this._isFormatDirty&&(t.bindTexture(t.TEXTURE_2D,this._texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,this.format.magFilter==h.PixelFilter.NEAREST?t.NEAREST:t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,this.format.minFilter==h.PixelFilter.NEAREST?t.NEAREST:t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,this.format.wrap==h.PixelWrap.REPEAT?t.REPEAT:t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,this.format.wrap==h.PixelWrap.REPEAT?t.REPEAT:t.CLAMP_TO_EDGE),this._isFormatDirty=!1),this._isContentDirty&&(t.bindTexture(t.TEXTURE_2D,this._texture),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,this._width,this._height,0,t.RGBA,t.UNSIGNED_BYTE,this._pixels),this._isContentDirty=!1),this._texture}free(){this.texture&&(this._context.gl.deleteTexture(this.texture),this._generation=0)}static from(t){return i(null==t||t instanceof p),t}}class A{constructor(t,e,i=null,r=0,s=!0,n=new h.Rect){this._context=t,this._texture=e,this._framebuffer=i,this._generation=r,this._isDirty=s,this._viewport=n}get context(){return this._context}get texture(){return this._texture}get viewport(){return this._viewport}setColor(t){this._texture!=t&&(this._texture=p.from(t),this._isDirty=!0)}get framebuffer(){let t=this._context.gl,e=this._texture.texture;return this._generation!=this._context.generation&&(this._framebuffer=t.createFramebuffer(),this._generation=this._context.generation,this._isDirty=!0),this._isDirty&&(t.bindFramebuffer(t.FRAMEBUFFER,this._framebuffer),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,e,0),i(t.checkFramebufferStatus(t.FRAMEBUFFER)==t.FRAMEBUFFER_COMPLETE),this._isDirty=!1),this._framebuffer}free(){this._framebuffer&&(this._context.gl.deleteFramebuffer(this._framebuffer),this._generation=0)}static from(t){return i(null==t||t instanceof A),t}}}(a||(exports.WebGL=a={}));
},{"process":96}],119:[function(require,module,exports) {
"use strict";function e(e,t,r){let{m00:n,m01:o,m02:s,m10:i,m11:f,m12:m}=r;e.setUniformMat3(t,n,o,s,i,f,m,0,0,1)}function t(e,t,r){e.setUniformVec2(t,r.x,r.y)}function r(e,t,r){e.setRenderTarget(t),e.setViewport(0,0,t.texture.width,t.texture.height),r(),e.setRenderTarget(null)}Object.defineProperty(exports,"__esModule",{value:!0}),exports.setUniformAffineTransform=e,exports.setUniformVec2=t,exports.renderInto=r;
},{}],118:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.RectangleBatchRenderer=exports.RectangleBatch=void 0;var e=require("../lib/math"),t=require("./graphics"),r=require("./utils");const i=new t.Graphics.VertexFormat;i.add("configSpacePos",t.Graphics.AttributeType.FLOAT,2),i.add("color",t.Graphics.AttributeType.FLOAT,3);const s="\n  uniform mat3 configSpaceToNDC;\n\n  attribute vec2 configSpacePos;\n  attribute vec3 color;\n  varying vec3 vColor;\n\n  void main() {\n    vColor = color;\n    vec2 position = (configSpaceToNDC * vec3(configSpacePos, 1)).xy;\n    gl_Position = vec4(position, 1, 1);\n  }\n",n="\n  precision mediump float;\n  varying vec3 vColor;\n\n  void main() {\n    gl_FragColor = vec4(vColor.rgb, 1);\n  }\n";class o{constructor(e){this.gl=e,this.rects=[],this.colors=[],this.buffer=null}getRectCount(){return this.rects.length}getBuffer(){if(this.buffer)return this.buffer;const e=[[0,0],[1,0],[0,1],[1,0],[0,1],[1,1]],t=new Uint8Array(i.stride*e.length*this.rects.length),r=new Float32Array(t.buffer);let s=0;for(let t=0;t<this.rects.length;t++){const i=this.rects[t],n=this.colors[t];for(let t of e)r[s++]=i.origin.x+t[0]*i.size.x,r[s++]=i.origin.y+t[1]*i.size.y,r[s++]=n.r,r[s++]=n.g,r[s++]=n.b}if(s!==r.length)throw new Error("Buffer expected to be full but wasn't");return this.buffer=this.gl.createVertexBuffer(t.length),this.buffer.upload(t),this.buffer}addRect(e,t){this.rects.push(e),this.colors.push(t),this.buffer&&(this.buffer.free(),this.buffer=null)}free(){this.buffer&&(this.buffer.free(),this.buffer=null)}}exports.RectangleBatch=o;class c{constructor(e){this.gl=e,this.material=e.createMaterial(i,s,n)}render(i){(0,r.setUniformAffineTransform)(this.material,"configSpaceToNDC",(()=>{const t=e.AffineTransform.betweenRects(i.configSpaceSrcRect,i.physicalSpaceDstRect),r=new e.Vec2(this.gl.viewport.width,this.gl.viewport.height);return e.AffineTransform.withTranslation(new e.Vec2(-1,1)).times(e.AffineTransform.withScale(new e.Vec2(2,-2).dividedByPointwise(r))).times(t)})()),this.gl.setUnpremultipliedBlendState(),this.gl.draw(t.Graphics.Primitive.TRIANGLES,this.material,i.batch.getBuffer())}}exports.RectangleBatchRenderer=c;
},{"../lib/math":102,"./graphics":42,"./utils":119}],76:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Color=void 0;var t=require("./math");class r{constructor(t=0,r=0,e=0,o=1){this.r=t,this.g=r,this.b=e,this.a=o}static fromLumaChromaHue(e,o,s){const i=s/60,a=o*(1-Math.abs(i%2-1)),[h,c,u]=i<1?[o,a,0]:i<2?[a,o,0]:i<3?[0,o,a]:i<4?[0,a,o]:i<5?[a,0,o]:[o,0,a],l=e-(.3*h+.59*c+.11*u);return new r((0,t.clamp)(h+l,0,1),(0,t.clamp)(c+l,0,1),(0,t.clamp)(u+l,0,1),1)}toCSS(){return`rgba(${(255*this.r).toFixed()}, ${(255*this.g).toFixed()}, ${(255*this.b).toFixed()}, ${this.a.toFixed(2)})`}}exports.Color=r;
},{"./math":102}],72:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.RowAtlas=void 0;var e=require("../lib/lru-cache"),t=require("./rectangle-batch-renderer"),r=require("../lib/math"),i=require("../lib/color"),c=require("./graphics"),h=require("./utils");class a{constructor(h,a,s){this.gl=h,this.rectangleBatchRenderer=a,this.textureRenderer=s,this.texture=h.createTexture(c.Graphics.TextureFormat.NEAREST_CLAMP,4096,4096),this.renderTarget=h.createRenderTarget(this.texture),this.rowCache=new e.LRUCache(this.texture.height),this.clearLineBatch=new t.RectangleBatch(h),this.clearLineBatch.addRect(r.Rect.unit,new i.Color(0,0,0,0)),h.addContextResetHandler(()=>{this.rowCache.clear()})}has(e){return this.rowCache.has(e)}getResolution(){return this.texture.width}getCapacity(){return this.texture.height}allocateLine(e){if(this.rowCache.getSize()<this.rowCache.getCapacity()){const t=this.rowCache.getSize();return this.rowCache.insert(e,t),t}{const[,t]=this.rowCache.removeLRU();return this.rowCache.insert(e,t),t}}writeToAtlasIfNeeded(e,t){(0,h.renderInto)(this.gl,this.renderTarget,()=>{for(let i of e){let e=this.rowCache.get(i);if(null!=e)continue;e=this.allocateLine(i);const c=new r.Rect(new r.Vec2(0,e),new r.Vec2(this.texture.width,1));this.rectangleBatchRenderer.render({batch:this.clearLineBatch,configSpaceSrcRect:r.Rect.unit,physicalSpaceDstRect:c}),t(c,i)}})}renderViaAtlas(e,t){let i=this.rowCache.get(e);if(null==i)return!1;const c=new r.Rect(new r.Vec2(0,i),new r.Vec2(this.texture.width,1));return this.textureRenderer.render({texture:this.texture,srcRect:c,dstRect:t}),!0}}exports.RowAtlas=a;
},{"../lib/lru-cache":117,"./rectangle-batch-renderer":118,"../lib/math":102,"../lib/color":76,"./graphics":42,"./utils":119}],120:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.TextureRenderer=void 0;var e=require("../lib/math"),t=require("./graphics"),r=require("./utils");const n="\n  uniform mat3 uvTransform;\n  uniform mat3 positionTransform;\n\n  attribute vec2 position;\n  attribute vec2 uv;\n  varying vec2 vUv;\n\n  void main() {\n    vUv = (uvTransform * vec3(uv, 1)).xy;\n    gl_Position = vec4((positionTransform * vec3(position, 1)).xy, 0, 1);\n  }\n",i="\n  precision mediump float;\n\n  varying vec2 vUv;\n  uniform sampler2D texture;\n\n  void main() {\n   gl_FragColor = texture2D(texture, vUv);\n  }\n";class s{constructor(e){this.gl=e;const r=new t.Graphics.VertexFormat;r.add("position",t.Graphics.AttributeType.FLOAT,2),r.add("uv",t.Graphics.AttributeType.FLOAT,2);const s=[{pos:[-1,1],uv:[0,1]},{pos:[1,1],uv:[1,1]},{pos:[-1,-1],uv:[0,0]},{pos:[1,-1],uv:[1,0]}],o=[];for(let e of s)o.push(e.pos[0]),o.push(e.pos[1]),o.push(e.uv[0]),o.push(e.uv[1]);this.buffer=e.createVertexBuffer(r.stride*s.length),this.buffer.upload(new Uint8Array(new Float32Array(o).buffer)),this.material=e.createMaterial(r,n,i)}render(n){this.material.setUniformSampler("texture",n.texture,0),(0,r.setUniformAffineTransform)(this.material,"uvTransform",(()=>{const{srcRect:t,texture:r}=n,i=e.AffineTransform.withTranslation(new e.Vec2(0,1)).times(e.AffineTransform.withScale(new e.Vec2(1,-1))).times(e.AffineTransform.betweenRects(new e.Rect(e.Vec2.zero,new e.Vec2(r.width,r.height)),e.Rect.unit)).transformRect(t);return e.AffineTransform.betweenRects(e.Rect.unit,i)})()),(0,r.setUniformAffineTransform)(this.material,"positionTransform",(()=>{const{dstRect:t}=n,{viewport:r}=this.gl,i=new e.Vec2(r.width,r.height),s=e.AffineTransform.withScale(new e.Vec2(1,-1)).times(e.AffineTransform.betweenRects(new e.Rect(e.Vec2.zero,i),e.Rect.NDC)).transformRect(t);return e.AffineTransform.betweenRects(e.Rect.NDC,s)})()),this.gl.setUnpremultipliedBlendState(),this.gl.draw(t.Graphics.Primitive.TRIANGLE_STRIP,this.material,this.buffer)}}exports.TextureRenderer=s;
},{"../lib/math":102,"./graphics":42,"./utils":119}],121:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ViewportRectangleRenderer=void 0;var e=require("./graphics"),i=require("./utils");const r=new e.Graphics.VertexFormat;r.add("position",e.Graphics.AttributeType.FLOAT,2);const o="\n  attribute vec2 position;\n\n  void main() {\n    gl_Position = vec4(position, 0, 1);\n  }\n",n="\n  precision mediump float;\n\n  uniform mat3 configSpaceToPhysicalViewSpace;\n  uniform vec2 physicalSize;\n  uniform vec2 physicalOrigin;\n  uniform vec2 configSpaceViewportOrigin;\n  uniform vec2 configSpaceViewportSize;\n  uniform float framebufferHeight;\n\n  void main() {\n    vec2 origin = (configSpaceToPhysicalViewSpace * vec3(configSpaceViewportOrigin, 1.0)).xy;\n    vec2 size = (configSpaceToPhysicalViewSpace * vec3(configSpaceViewportSize, 0.0)).xy;\n\n    vec2 halfSize = physicalSize / 2.0;\n\n    float borderWidth = 2.0;\n\n    origin = floor(origin * halfSize) / halfSize + borderWidth * vec2(1.0, 1.0);\n    size = floor(size * halfSize) / halfSize - 2.0 * borderWidth * vec2(1.0, 1.0);\n\n    vec2 coord = gl_FragCoord.xy;\n    coord.x = coord.x - physicalOrigin.x;\n    coord.y = framebufferHeight - coord.y - physicalOrigin.y;\n    vec2 clamped = clamp(coord, origin, origin + size);\n    vec2 gap = clamped - coord;\n    float maxdist = max(abs(gap.x), abs(gap.y));\n\n    // TOOD(jlfwong): Could probably optimize this to use mix somehow.\n    if (maxdist == 0.0) {\n      // Inside viewport rectangle\n      gl_FragColor = vec4(0, 0, 0, 0);\n    } else if (maxdist < borderWidth) {\n      // Inside viewport rectangle at border\n      gl_FragColor = vec4(0.7, 0.7, 0.7, 0.8);\n    } else {\n      // Outside viewport rectangle\n      gl_FragColor = vec4(0.7, 0.7, 0.7, 0.5);\n    }\n  }\n";class t{constructor(e){this.gl=e;const i=[[-1,1],[1,1],[-1,-1],[1,-1]],t=[];for(let e of i)t.push(e[0]),t.push(e[1]);this.buffer=e.createVertexBuffer(r.stride*i.length),this.buffer.upload(new Uint8Array(new Float32Array(t).buffer)),this.material=e.createMaterial(r,o,n)}render(r){(0,i.setUniformAffineTransform)(this.material,"configSpaceToPhysicalViewSpace",r.configSpaceToPhysicalViewSpace),(0,i.setUniformVec2)(this.material,"configSpaceViewportOrigin",r.configSpaceViewportRect.origin),(0,i.setUniformVec2)(this.material,"configSpaceViewportSize",r.configSpaceViewportRect.size);const o=this.gl.viewport;this.material.setUniformVec2("physicalOrigin",o.x,o.y),this.material.setUniformVec2("physicalSize",o.width,o.height),this.material.setUniformFloat("framebufferHeight",this.gl.renderTargetHeightInPixels),this.gl.setBlendState(e.Graphics.BlendOperation.SOURCE_ALPHA,e.Graphics.BlendOperation.INVERSE_SOURCE_ALPHA),this.gl.draw(e.Graphics.Primitive.TRIANGLE_STRIP,this.material,this.buffer)}}exports.ViewportRectangleRenderer=t;
},{"./graphics":42,"./utils":119}],122:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.FlamechartColorPassRenderer=void 0;var e=require("../lib/math"),t=require("./graphics"),n=require("./utils");const r=new t.Graphics.VertexFormat;r.add("position",t.Graphics.AttributeType.FLOAT,2),r.add("uv",t.Graphics.AttributeType.FLOAT,2);const i="\n  uniform mat3 uvTransform;\n  uniform mat3 positionTransform;\n\n  attribute vec2 position;\n  attribute vec2 uv;\n  varying vec2 vUv;\n\n  void main() {\n    vUv = (uvTransform * vec3(uv, 1)).xy;\n    gl_Position = vec4((positionTransform * vec3(position, 1)).xy, 0, 1);\n  }\n",o="\n  precision mediump float;\n\n  uniform vec2 uvSpacePixelSize;\n  uniform float renderOutlines;\n\n  varying vec2 vUv;\n  uniform sampler2D colorTexture;\n\n  // https://en.wikipedia.org/wiki/HSL_and_HSV#From_luma/chroma/hue\n  vec3 hcl2rgb(float H, float C, float L) {\n    float hPrime = H / 60.0;\n    float X = C * (1.0 - abs(mod(hPrime, 2.0) - 1.0));\n    vec3 RGB =\n      hPrime < 1.0 ? vec3(C, X, 0) :\n      hPrime < 2.0 ? vec3(X, C, 0) :\n      hPrime < 3.0 ? vec3(0, C, X) :\n      hPrime < 4.0 ? vec3(0, X, C) :\n      hPrime < 5.0 ? vec3(X, 0, C) :\n      vec3(C, 0, X);\n\n    float m = L - dot(RGB, vec3(0.30, 0.59, 0.11));\n    return RGB + vec3(m, m, m);\n  }\n\n  float triangle(float x) {\n    return 2.0 * abs(fract(x) - 0.5) - 1.0;\n  }\n\n  vec3 colorForBucket(float t) {\n    float x = triangle(30.0 * t);\n    float H = 360.0 * (0.9 * t);\n    float C = 0.25 + 0.2 * x;\n    float L = 0.80 - 0.15 * x;\n    return hcl2rgb(H, C, L);\n  }\n\n  void main() {\n    vec4 here = texture2D(colorTexture, vUv);\n\n    if (here.z == 0.0) {\n      // Background color\n      gl_FragColor = vec4(0, 0, 0, 0);\n      return;\n    }\n\n    // Sample the 4 surrounding pixels in the depth texture to determine\n    // if we should draw a boundary here or not.\n    vec4 N = texture2D(colorTexture, vUv + vec2(0, uvSpacePixelSize.y));\n    vec4 E = texture2D(colorTexture, vUv + vec2(uvSpacePixelSize.x, 0));\n    vec4 S = texture2D(colorTexture, vUv + vec2(0, -uvSpacePixelSize.y));\n    vec4 W = texture2D(colorTexture, vUv + vec2(-uvSpacePixelSize.x, 0));\n\n    // NOTE: For outline checks, we intentionally check both the right\n    // and the left to determine if we're an edge. If a rectangle is a single\n    // pixel wide, we don't want to render it as an outline, so this method\n    // of checking ensures that we don't outline single physical-space\n    // pixel width rectangles.\n    if (\n      renderOutlines > 0.0 &&\n      (\n        here.y == N.y && here.y != S.y || // Top edge\n        here.y == S.y && here.y != N.y || // Bottom edge\n        here.x == E.x && here.x != W.x || // Left edge\n        here.x == W.x && here.x != E.x\n      )\n    ) {\n      // We're on an edge! Draw transparent.\n      gl_FragColor = vec4(0, 0, 0, 0);\n    } else {\n      // Not on an edge. Draw the appropriate color.\n      gl_FragColor = vec4(colorForBucket(here.z), here.a);\n    }\n  }\n";class a{constructor(e){this.gl=e;const t=[{pos:[-1,1],uv:[0,1]},{pos:[1,1],uv:[1,1]},{pos:[-1,-1],uv:[0,0]},{pos:[1,-1],uv:[1,0]}],n=[];for(let e of t)n.push(e.pos[0]),n.push(e.pos[1]),n.push(e.uv[0]),n.push(e.uv[1]);this.buffer=e.createVertexBuffer(r.stride*t.length),this.buffer.uploadFloats(n),this.material=e.createMaterial(r,i,o)}render(r){const{srcRect:i,rectInfoTexture:o}=r,a=e.AffineTransform.withTranslation(new e.Vec2(0,1)).times(e.AffineTransform.withScale(new e.Vec2(1,-1))).times(e.AffineTransform.betweenRects(new e.Rect(e.Vec2.zero,new e.Vec2(o.width,o.height)),e.Rect.unit)).transformRect(i),s=e.AffineTransform.betweenRects(e.Rect.unit,a),{dstRect:c}=r,l=new e.Vec2(this.gl.viewport.width,this.gl.viewport.height),u=e.AffineTransform.withScale(new e.Vec2(1,-1)).times(e.AffineTransform.betweenRects(new e.Rect(e.Vec2.zero,l),e.Rect.NDC)).transformRect(c),f=e.AffineTransform.betweenRects(e.Rect.NDC,u),h=e.Vec2.unit.dividedByPointwise(new e.Vec2(r.rectInfoTexture.width,r.rectInfoTexture.height));this.material.setUniformSampler("colorTexture",r.rectInfoTexture,0),(0,n.setUniformAffineTransform)(this.material,"uvTransform",s),this.material.setUniformFloat("renderOutlines",r.renderOutlines?1:0),this.material.setUniformVec2("uvSpacePixelSize",h.x,h.y),(0,n.setUniformAffineTransform)(this.material,"positionTransform",f),this.gl.setUnpremultipliedBlendState(),this.gl.draw(t.Graphics.Primitive.TRIANGLE_STRIP,this.material,this.buffer)}}exports.FlamechartColorPassRenderer=a;
},{"../lib/math":102,"./graphics":42,"./utils":119}],74:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CanvasContext=void 0;var e=require("./graphics"),r=require("./rectangle-batch-renderer"),t=require("./texture-renderer"),i=require("../lib/math"),n=require("./overlay-rectangle-renderer"),s=require("./flamechart-color-pass-renderer");class o{constructor(i){this.animationFrameRequest=null,this.beforeFrameHandlers=new Set,this.onBeforeFrame=(()=>{this.animationFrameRequest=null,this.gl.setViewport(0,0,this.gl.renderTargetWidthInPixels,this.gl.renderTargetHeightInPixels),this.gl.clear(new e.Graphics.Color(1,1,1,1));for(const e of this.beforeFrameHandlers)e()}),this.gl=new e.WebGL.Context(i),this.rectangleBatchRenderer=new r.RectangleBatchRenderer(this.gl),this.textureRenderer=new t.TextureRenderer(this.gl),this.viewportRectangleRenderer=new n.ViewportRectangleRenderer(this.gl),this.flamechartColorPassRenderer=new s.FlamechartColorPassRenderer(this.gl);const o=this.gl.getWebGLInfo();o&&console.log(`WebGL initialized. renderer: ${o.renderer}, vendor: ${o.vendor}, version: ${o.version}`),window.testContextLoss=(()=>{this.gl.testContextLoss()})}addBeforeFrameHandler(e){this.beforeFrameHandlers.add(e)}removeBeforeFrameHandler(e){this.beforeFrameHandlers.delete(e)}requestFrame(){this.animationFrameRequest||(this.animationFrameRequest=requestAnimationFrame(this.onBeforeFrame))}setViewport(e,r){const{origin:t,size:i}=e;let n=this.gl.viewport;this.gl.setViewport(t.x,t.y,i.x,i.y),r();let{x:s,y:o,width:a,height:l}=n;this.gl.setViewport(s,o,a,l)}renderBehind(e,r){const t=e.getBoundingClientRect(),n=new i.Rect(new i.Vec2(t.left*window.devicePixelRatio,t.top*window.devicePixelRatio),new i.Vec2(t.width*window.devicePixelRatio,t.height*window.devicePixelRatio));this.setViewport(n,r)}}exports.CanvasContext=o;
},{"./graphics":42,"./rectangle-batch-renderer":118,"./texture-renderer":120,"../lib/math":102,"./overlay-rectangle-renderer":121,"./flamechart-color-pass-renderer":122}],38:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.getFrameToColorBucket=exports.getProfileToView=exports.getProfileWithRecursionFlattened=exports.getRowAtlas=exports.getCanvasContext=exports.createGetCSSColorForFrame=exports.createGetColorBucketForFrame=void 0;var e=require("../lib/utils"),t=require("../gl/row-atlas"),r=require("../gl/canvas-context"),o=require("../lib/color");const n=exports.createGetColorBucketForFrame=(0,e.memoizeByReference)(e=>t=>e.get(t.key)||0),a=exports.createGetCSSColorForFrame=(0,e.memoizeByReference)(t=>{const r=n(t);return t=>{const n=r(t)/255,a=(0,e.triangle)(30*n),l=.9*n*360,i=.25+.2*a,s=.8-.15*a;return o.Color.fromLumaChromaHue(s,i,l).toCSS()}}),l=exports.getCanvasContext=(0,e.memoizeByReference)(e=>new r.CanvasContext(e)),i=exports.getRowAtlas=(0,e.memoizeByReference)(e=>new t.RowAtlas(e.gl,e.rectangleBatchRenderer,e.textureRenderer)),s=exports.getProfileWithRecursionFlattened=(0,e.memoizeByReference)(e=>e.getProfileWithRecursionFlattened()),c=exports.getProfileToView=(0,e.memoizeByShallowEquality)(({profile:e,flattenRecursion:t})=>t?e.getProfileWithRecursionFlattened():e),u=exports.getFrameToColorBucket=(0,e.memoizeByReference)(e=>{const t=[];function r(e){return(e.file||"")+e.name}e.forEachFrame(e=>t.push(e)),t.sort(function(e,t){return r(e)>r(t)?1:-1});const o=new Map;for(let e=0;e<t.length;e++)o.set(t[e].key,Math.floor(255*e/t.length));return o});
},{"../lib/utils":70,"../gl/row-atlas":72,"../gl/canvas-context":74,"../lib/color":76}],55:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ProfileTableViewContainer=exports.ProfileTableView=exports.SortDirection=exports.SortField=void 0;var e=require("preact"),t=require("aphrodite"),o=require("../lib/utils"),r=require("./style"),i=require("./color-chit"),s=require("./scrollable-list-view"),l=require("../store/actions"),a=require("../lib/typed-redux"),c=require("../store/getters"),n=exports.SortField=void 0;!function(e){e[e.SYMBOL_NAME=0]="SYMBOL_NAME",e[e.SELF=1]="SELF",e[e.TOTAL=2]="TOTAL"}(n||(exports.SortField=n={}));var h=exports.SortDirection=void 0;!function(e){e[e.ASCENDING=0]="ASCENDING",e[e.DESCENDING=1]="DESCENDING"}(h||(exports.SortDirection=h={}));class d extends e.Component{render(){return(0,e.h)("div",{className:(0,t.css)(E.hBarDisplay)},(0,e.h)("div",{className:(0,t.css)(E.hBarDisplayFilled),style:{width:`${this.props.perc}%`}}))}}class p extends e.Component{render(){const{activeDirection:o}=this.props,i=o===h.ASCENDING?r.Colors.GRAY:r.Colors.LIGHT_GRAY,s=o===h.DESCENDING?r.Colors.GRAY:r.Colors.LIGHT_GRAY;return(0,e.h)("svg",{width:"8",height:"10",viewBox:"0 0 8 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:(0,t.css)(E.sortIcon)},(0,e.h)("path",{d:"M0 4L4 0L8 4H0Z",fill:i}),(0,e.h)("path",{d:"M0 4L4 0L8 4H0Z",transform:"translate(0 10) scale(1 -1)",fill:s}))}}class S extends e.Component{constructor(){super(...arguments),this.onSortClick=((e,t)=>{t.preventDefault();const{sortMethod:o}=this.props;if(o.field==e)this.props.setSortMethod({field:e,direction:o.direction===h.ASCENDING?h.DESCENDING:h.ASCENDING});else switch(e){case n.SYMBOL_NAME:this.props.setSortMethod({field:e,direction:h.ASCENDING});break;case n.SELF:case n.TOTAL:this.props.setSortMethod({field:e,direction:h.DESCENDING})}}),this.getFrameList=(()=>{const{profile:e,sortMethod:t}=this.props,r=[];switch(e.forEachFrame(e=>r.push(e)),t.field){case n.SYMBOL_NAME:(0,o.sortBy)(r,e=>e.name.toLowerCase());break;case n.SELF:(0,o.sortBy)(r,e=>e.getSelfWeight());break;case n.TOTAL:(0,o.sortBy)(r,e=>e.getTotalWeight())}return t.direction===h.DESCENDING&&r.reverse(),r}),this.listView=null,this.listViewRef=(e=>{if(e===this.listView)return;this.listView=e;const{selectedFrame:t}=this.props;if(!t||!e)return;const o=this.getFrameList().indexOf(t);-1!==o&&e.scrollIndexIntoView(o)})}renderRow(r,s){const{profile:l,selectedFrame:a}=this.props,c=r.getTotalWeight(),n=r.getSelfWeight(),h=100*c/l.getTotalNonIdleWeight(),p=100*n/l.getTotalNonIdleWeight(),S=r===a;return(0,e.h)("tr",{key:`${s}`,onClick:this.props.setSelectedFrame.bind(null,r),className:(0,t.css)(E.tableRow,s%2==0&&E.tableRowEven,S&&E.tableRowSelected)},(0,e.h)("td",{className:(0,t.css)(E.numericCell)},l.formatValue(c)," (",(0,o.formatPercent)(h),")",(0,e.h)(d,{perc:h})),(0,e.h)("td",{className:(0,t.css)(E.numericCell)},l.formatValue(n)," (",(0,o.formatPercent)(p),")",(0,e.h)(d,{perc:p})),(0,e.h)("td",{title:r.file,className:(0,t.css)(E.textCell)},(0,e.h)(i.ColorChit,{color:this.props.getCSSColorForFrame(r)}),r.name))}render(){const{sortMethod:o}=this.props,i=this.getFrameList(),l=i.map(e=>({size:r.Sizes.FRAME_HEIGHT}));return(0,e.h)("div",{className:(0,t.css)(r.commonStyle.vbox,E.profileTableView)},(0,e.h)("table",{className:(0,t.css)(E.tableView)},(0,e.h)("thead",{className:(0,t.css)(E.tableHeader)},(0,e.h)("tr",null,(0,e.h)("th",{className:(0,t.css)(E.numericCell),onClick:e=>this.onSortClick(n.TOTAL,e)},(0,e.h)(p,{activeDirection:o.field===n.TOTAL?o.direction:null}),"Total"),(0,e.h)("th",{className:(0,t.css)(E.numericCell),onClick:e=>this.onSortClick(n.SELF,e)},(0,e.h)(p,{activeDirection:o.field===n.SELF?o.direction:null}),"Self"),(0,e.h)("th",{className:(0,t.css)(E.textCell),onClick:e=>this.onSortClick(n.SYMBOL_NAME,e)},(0,e.h)(p,{activeDirection:o.field===n.SYMBOL_NAME?o.direction:null}),"Symbol Name")))),(0,e.h)(s.ScrollableListView,{ref:this.listViewRef,axis:"y",items:l,className:(0,t.css)(E.scrollView),renderItems:(o,r)=>{const s=[];for(let e=o;e<=r;e++)s.push(this.renderRow(i[e],e));return(0,e.h)("table",{className:(0,t.css)(E.tableView)},s)}}))}}exports.ProfileTableView=S;const E=t.StyleSheet.create({profileTableView:{background:r.Colors.WHITE,height:"100%"},scrollView:{overflowY:"auto",overflowX:"hidden"},tableView:{width:"100%",fontSize:r.FontSize.LABEL,background:r.Colors.WHITE},tableHeader:{borderBottom:`2px solid ${r.Colors.LIGHT_GRAY}`,textAlign:"left",color:r.Colors.GRAY,userSelect:"none"},sortIcon:{position:"relative",top:1,marginRight:r.Sizes.FRAME_HEIGHT/4},tableRow:{height:r.Sizes.FRAME_HEIGHT},tableRowEven:{background:r.Colors.OFF_WHITE},tableRowSelected:{background:r.Colors.DARK_BLUE,color:r.Colors.WHITE},numericCell:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",position:"relative",textAlign:"right",paddingRight:r.Sizes.FRAME_HEIGHT,width:6*r.Sizes.FRAME_HEIGHT,minWidth:6*r.Sizes.FRAME_HEIGHT},textCell:{textOverflow:"ellipsis",overflow:"hidden",whiteSpace:"nowrap",width:"100%",maxWidth:0},hBarDisplay:{position:"absolute",background:r.Colors.TRANSPARENT_GREEN,bottom:2,height:2,width:`calc(100% - ${2*r.Sizes.FRAME_HEIGHT}px)`,right:r.Sizes.FRAME_HEIGHT},hBarDisplayFilled:{height:"100%",position:"absolute",background:r.Colors.GREEN,right:0}}),m=exports.ProfileTableViewContainer=(0,a.createContainer)(S,(e,t,o)=>{const{activeProfileState:r}=o,{profile:i,sandwichViewState:s,index:a}=r;if(!i)throw new Error("profile missing");const{tableSortMethod:n}=e,{callerCallee:h}=s,d=h?h.selectedFrame:null,p=(0,c.getFrameToColorBucket)(i),S=(0,c.createGetCSSColorForFrame)(p);return{profile:i,profileIndex:r.index,selectedFrame:d,getCSSColorForFrame:S,sortMethod:n,setSelectedFrame:e=>{t(l.actions.sandwichView.setSelectedFrame({profileIndex:a,args:e}))},setSortMethod:e=>{t(l.actions.sandwichView.setTableSortMethod(e))}}});
},{"preact":24,"aphrodite":68,"../lib/utils":70,"./style":79,"./color-chit":106,"./scrollable-list-view":108,"../store/actions":40,"../lib/typed-redux":36,"../store/getters":38}],29:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.canUseXHR=exports.ViewMode=void 0,exports.createApplicationStore=d;var e=require("./actions"),t=require("redux"),r=n(t),o=require("../lib/typed-redux"),s=require("../lib/hash-params"),i=require("./profiles-state"),a=require("../views/profile-table-view");function n(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}var c=exports.ViewMode=void 0;!function(e){e[e.CHRONO_FLAME_CHART=0]="CHRONO_FLAME_CHART",e[e.LEFT_HEAVY_FLAME_GRAPH=1]="LEFT_HEAVY_FLAME_GRAPH",e[e.SANDWICH_VIEW=2]="SANDWICH_VIEW"}(c||(exports.ViewMode=c={}));const l=window.location.protocol,u=exports.canUseXHR="http:"===l||"https:"===l;function d(t){const n=(0,s.getHashParams)(),l=u&&null!=n.profileURL,d=r.combineReducers({profileGroup:i.profileGroup,hashParams:(0,o.setter)(e.actions.setHashParams,n),flattenRecursion:(0,o.setter)(e.actions.setFlattenRecursion,!1),viewMode:(0,o.setter)(e.actions.setViewMode,c.CHRONO_FLAME_CHART),glCanvas:(0,o.setter)(e.actions.setGLCanvas,null),dragActive:(0,o.setter)(e.actions.setDragActive,!1),loading:(0,o.setter)(e.actions.setLoading,l),error:(0,o.setter)(e.actions.setError,!1),tableSortMethod:(0,o.setter)(e.actions.sandwichView.setTableSortMethod,{field:a.SortField.SELF,direction:a.SortDirection.DESCENDING})});return r.createStore(d,t)}
},{"./actions":40,"redux":31,"../lib/typed-redux":36,"../lib/hash-params":50,"./profiles-state":52,"../views/profile-table-view":55}],81:[function(require,module,exports) {
"use strict";function e(e){return e.replace(/\\([a-fA-F0-9]{2})/g,(e,n)=>{const t=parseInt(n,16);return String.fromCharCode(t)})}function n(n){const t=n.split("\n");if(!t.length)return null;if(""===t[t.length-1]&&t.pop(),!t.length)return null;const r=new Map,o=/^(\d+):(.+)$/,s=/^([\$\w]+):([\$\w-]+)$/;for(const n of t){const t=o.exec(n);if(t){r.set(`wasm-function[${t[1]}]`,e(t[2]));continue}const c=s.exec(n);if(!c)return null;r.set(c[1],e(c[2]))}return r}Object.defineProperty(exports,"__esModule",{value:!0}),exports.importEmscriptenSymbolMap=n;
},{}],142:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Flamechart=void 0;var t=require("./utils"),e=require("./math");class r{constructor(e){this.source=e,this.layers=[],this.totalWeight=0,this.minFrameWidth=1;const r=[];this.minFrameWidth=1/0;this.totalWeight=e.getTotalWeight(),e.forEachCall((e,i)=>{const s=(0,t.lastOf)(r),h={node:e,parent:s,children:[],start:i,end:i};s&&s.children.push(h),r.push(h)},(t,e)=>{console.assert(r.length>0);const i=r.pop();if(i.end=e,i.end-i.start==0)return;const s=r.length;for(;this.layers.length<=s;)this.layers.push([]);this.layers[s].push(i),this.minFrameWidth=Math.min(this.minFrameWidth,i.end-i.start)}),isFinite(this.minFrameWidth)||(this.minFrameWidth=1)}getTotalWeight(){return this.totalWeight}getLayers(){return this.layers}getColorBucketForFrame(t){return this.source.getColorBucketForFrame(t)}getMinFrameWidth(){return this.minFrameWidth}formatValue(t){return this.source.formatValue(t)}getClampedViewportWidth(t){const r=this.getTotalWeight(),i=Math.pow(2,40),s=(0,e.clamp)(3*this.getMinFrameWidth(),r/i,r);return(0,e.clamp)(t,s,r)}}exports.Flamechart=r;
},{"./utils":70,"./math":102}],143:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.FlamechartRenderer=exports.FlamechartRowAtlasKey=void 0;var e=require("./rectangle-batch-renderer"),t=require("../lib/math"),r=require("../lib/color"),n=require("../lib/utils"),s=require("./graphics"),o=require("./utils");const c=1e4;class i{constructor(e,t,r){this.batch=e,this.bounds=t,this.numPrecedingRectanglesInRow=r,this.children=[]}getBatch(){return this.batch}getBounds(){return this.bounds}getRectCount(){return this.batch.getRectCount()}getChildren(){return this.children}getParity(){return this.numPrecedingRectanglesInRow%2}forEachLeafNodeWithinBounds(e,t){this.bounds.hasIntersectionWith(e)&&t(this)}}class h{constructor(e){if(this.children=e,this.rectCount=0,0===e.length)throw new Error("Empty interior node");let r=1/0,n=-1/0,s=1/0,o=-1/0;for(let t of e){this.rectCount+=t.getRectCount();const e=t.getBounds();r=Math.min(r,e.left()),n=Math.max(n,e.right()),s=Math.min(s,e.top()),o=Math.max(o,e.bottom())}this.bounds=new t.Rect(new t.Vec2(r,s),new t.Vec2(n-r,o-s))}getBounds(){return this.bounds}getRectCount(){return this.rectCount}getChildren(){return this.children}forEachLeafNodeWithinBounds(e,t){if(this.bounds.hasIntersectionWith(e))for(let r of this.children)r.forEachLeafNodeWithinBounds(e,t)}}class a{get key(){return`${this.stackDepth}_${this.index}_${this.zoomLevel}`}constructor(e){this.stackDepth=e.stackDepth,this.zoomLevel=e.zoomLevel,this.index=e.index}static getOrInsert(e,t){return e.getOrInsert(new a(t))}}exports.FlamechartRowAtlasKey=a;class l{constructor(s,o,a,l,g,d={inverted:!1}){this.gl=s,this.rowAtlas=o,this.flamechart=a,this.rectangleBatchRenderer=l,this.colorPassRenderer=g,this.options=d,this.layers=[],this.rectInfoTexture=null,this.rectInfoRenderTarget=null,this.atlasKeys=new n.KeyedSet;const f=a.getLayers().length;for(let n=0;n<f;n++){const s=[],o=d.inverted?f-1-n:n;let l=1/0,g=-1/0,u=new e.RectangleBatch(this.gl),R=0;const w=a.getLayers()[n];for(let h=0;h<w.length;h++){const a=w[h];u.getRectCount()>=c&&(s.push(new i(u,new t.Rect(new t.Vec2(l,o),new t.Vec2(g-l,1)),R)),l=1/0,g=-1/0,u=new e.RectangleBatch(this.gl));const d=new t.Rect(new t.Vec2(a.start,o),new t.Vec2(a.end-a.start,1));l=Math.min(l,d.left()),g=Math.max(g,d.right());const f=new r.Color((1+h%255)/256,(1+n%255)/256,(1+this.flamechart.getColorBucketForFrame(a.node.frame))/256);u.addRect(d,f),R++}u.getRectCount()>0&&s.push(new i(u,new t.Rect(new t.Vec2(l,o),new t.Vec2(g-l,1)),R)),this.layers.push(new h(s))}}getRectInfoTexture(e,t){if(this.rectInfoTexture){const r=this.rectInfoTexture;r.width==e&&r.height==t||r.resize(e,t)}else this.rectInfoTexture=this.gl.createTexture(s.Graphics.TextureFormat.NEAREST_CLAMP,e,t);return this.rectInfoTexture}getRectInfoRenderTarget(e,t){const r=this.getRectInfoTexture(e,t);return this.rectInfoRenderTarget&&this.rectInfoRenderTarget.texture!=r&&(this.rectInfoRenderTarget.texture.free(),this.rectInfoRenderTarget.setColor(r)),this.rectInfoRenderTarget||(this.rectInfoRenderTarget=this.gl.createRenderTarget(r)),this.rectInfoRenderTarget}free(){this.rectInfoRenderTarget&&this.rectInfoRenderTarget.free(),this.rectInfoTexture&&this.rectInfoTexture.free()}configSpaceBoundsForKey(e){const{stackDepth:r,zoomLevel:n,index:s}=e,o=this.flamechart.getTotalWeight()/Math.pow(2,n),c=this.flamechart.getLayers().length,i=this.options.inverted?c-1-r:r;return new t.Rect(new t.Vec2(o*s,i),new t.Vec2(o,1))}render(e){const{configSpaceSrcRect:r,physicalSpaceDstRect:n}=e,c=[],i=t.AffineTransform.betweenRects(r,n);if(r.isEmpty())return;let h=0;for(;;){const e=a.getOrInsert(this.atlasKeys,{stackDepth:0,zoomLevel:h,index:0}),t=this.configSpaceBoundsForKey(e);if(i.transformRect(t).width()<this.rowAtlas.getResolution())break;h++}const l=Math.max(0,Math.floor(r.top())),g=Math.min(this.layers.length,Math.ceil(r.bottom())),d=this.flamechart.getTotalWeight(),f=Math.pow(2,h),u=Math.floor(f*r.left()/d),R=Math.ceil(f*r.right()/d),w=this.flamechart.getLayers().length;for(let e=l;e<g;e++)for(let t=u;t<=R;t++){const n=this.options.inverted?w-1-e:e,s=a.getOrInsert(this.atlasKeys,{stackDepth:n,zoomLevel:h,index:t});this.configSpaceBoundsForKey(s).hasIntersectionWith(r)&&c.push(s)}const p=this.rowAtlas.getCapacity(),m=c.slice(0,p),I=c.slice(p);this.rowAtlas.writeToAtlasIfNeeded(m,(e,t)=>{const r=this.configSpaceBoundsForKey(t);this.layers[t.stackDepth].forEachLeafNodeWithinBounds(r,t=>{this.rectangleBatchRenderer.render({batch:t.getBatch(),configSpaceSrcRect:r,physicalSpaceDstRect:e})})});const T=this.getRectInfoRenderTarget(n.width(),n.height());(0,o.renderInto)(this.gl,T,()=>{this.gl.clear(new s.Graphics.Color(0,0,0,0));const e=new t.Rect(t.Vec2.zero,new t.Vec2(this.gl.viewport.width,this.gl.viewport.height)),n=t.AffineTransform.betweenRects(r,e);for(let e of m){const t=this.configSpaceBoundsForKey(e);this.rowAtlas.renderViaAtlas(e,n.transformRect(t))}for(let e of I){const t=this.configSpaceBoundsForKey(e),r=n.transformRect(t);this.layers[e.stackDepth].forEachLeafNodeWithinBounds(t,e=>{this.rectangleBatchRenderer.render({batch:e.getBatch(),configSpaceSrcRect:t,physicalSpaceDstRect:r})})}});const x=this.getRectInfoTexture(n.width(),n.height());this.colorPassRenderer.render({rectInfoTexture:x,srcRect:new t.Rect(t.Vec2.zero,new t.Vec2(x.width,x.height)),dstRect:n,renderOutlines:e.renderOutlines})}}exports.FlamechartRenderer=l;
},{"./rectangle-batch-renderer":118,"../lib/math":102,"../lib/color":76,"../lib/utils":70,"./graphics":42,"./utils":119}],163:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.style=void 0;var e=require("aphrodite"),o=require("./style");const t=exports.style=e.StyleSheet.create({hoverCount:{color:o.Colors.GREEN},fill:{width:"100%",height:"100%",position:"absolute",left:0,top:0},minimap:{height:o.Sizes.MINIMAP_HEIGHT,borderBottom:`${o.Sizes.SEPARATOR_HEIGHT}px solid ${o.Colors.LIGHT_GRAY}`},panZoomView:{flex:1},detailView:{display:"grid",height:o.Sizes.DETAIL_VIEW_HEIGHT,overflow:"hidden",gridTemplateColumns:"120px 120px 1fr",gridTemplateRows:"repeat(4, 1fr)",borderTop:`${o.Sizes.SEPARATOR_HEIGHT}px solid ${o.Colors.LIGHT_GRAY}`,fontSize:o.FontSize.LABEL,position:"absolute",background:o.Colors.WHITE,width:"100vw",bottom:0},stackTraceViewPadding:{padding:5},stackTraceView:{height:o.Sizes.DETAIL_VIEW_HEIGHT,lineHeight:`${o.FontSize.LABEL+2}px`,overflow:"auto"},stackLine:{whiteSpace:"nowrap"},stackFileLine:{color:o.Colors.LIGHT_GRAY},statsTable:{display:"grid",gridTemplateColumns:"1fr 1fr",gridTemplateRows:`repeat(3, ${o.FontSize.LABEL+10}px)`,gridGap:"1px 1px",textAlign:"center",paddingRight:1},statsTableHeader:{gridColumn:"1 / 3"},statsTableCell:{position:"relative",display:"flex",justifyContent:"center",alignItems:"center"},thisInstanceCell:{background:o.Colors.DARK_BLUE,color:o.Colors.WHITE},allInstancesCell:{background:o.Colors.PALE_DARK_BLUE,color:o.Colors.WHITE},barDisplay:{position:"absolute",top:0,left:0,background:"rgba(0, 0, 0, 0.2)",width:"100%"}});
},{"aphrodite":68,"./style":79}],173:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ELLIPSIS=void 0,exports.cachedMeasureTextWidth=n,exports.trimTextMid=s;var e=require("./utils");const t=exports.ELLIPSIS="…",r=new Map;let i=-1;function n(e,t){return window.devicePixelRatio!==i&&(r.clear(),i=window.devicePixelRatio),r.has(t)||r.set(t,e.measureText(t).width),r.get(t)}function o(e,r){const i=Math.floor(r/2),n=e.substr(0,i),o=e.substr(e.length-i,i);return n+t+o}function s(t,r,i){if(n(t,r)<=i)return r;const[s]=(0,e.binarySearch)(0,r.length,e=>n(t,o(r,e)),i);return o(r,s)}
},{"./utils":70}],159:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.FlamechartMinimapView=void 0;var e,i=require("preact"),t=require("aphrodite"),o=require("../lib/math"),s=require("./flamechart-style"),n=require("./style"),a=require("../lib/text-utils");!function(e){e[e.DRAW_NEW_VIEWPORT=0]="DRAW_NEW_VIEWPORT",e[e.TRANSLATE_VIEWPORT=1]="TRANSLATE_VIEWPORT"}(e||(e={}));class r extends i.Component{constructor(){super(...arguments),this.container=null,this.containerRef=(e=>{this.container=e||null}),this.overlayCanvas=null,this.overlayCtx=null,this.onWindowResize=(()=>{this.onBeforeFrame()}),this.onBeforeFrame=(()=>{this.maybeClearInteractionLock(),this.resizeOverlayCanvasIfNeeded(),this.renderRects(),this.renderOverlays()}),this.renderCanvas=(()=>{this.props.canvasContext.requestFrame()}),this.frameHadWheelEvent=!1,this.framesWithoutWheelEvents=0,this.interactionLock=null,this.maybeClearInteractionLock=(()=>{this.interactionLock&&(this.frameHadWheelEvent||(this.framesWithoutWheelEvents++,this.framesWithoutWheelEvents>=2&&(this.interactionLock=null,this.framesWithoutWheelEvents=0)),this.props.canvasContext.requestFrame()),this.frameHadWheelEvent=!1}),this.onWheel=(e=>{if(e.preventDefault(),this.frameHadWheelEvent=!0,(e.metaKey||e.ctrlKey)&&"pan"!==this.interactionLock){let i=1+e.deltaY/100;e.ctrlKey&&(i=1+e.deltaY/40),i=(0,o.clamp)(i,.1,10),this.zoom(i)}else"zoom"!==this.interactionLock&&this.pan(new o.Vec2(e.deltaX,e.deltaY));this.renderCanvas()}),this.dragStartConfigSpaceMouse=null,this.dragConfigSpaceViewportOffset=null,this.draggingMode=null,this.onMouseDown=(i=>{const t=this.configSpaceMouse(i);t&&(this.props.configSpaceViewportRect.contains(t)?(this.draggingMode=e.TRANSLATE_VIEWPORT,this.dragConfigSpaceViewportOffset=t.minus(this.props.configSpaceViewportRect.origin)):this.draggingMode=e.DRAW_NEW_VIEWPORT,this.dragStartConfigSpaceMouse=t,window.addEventListener("mousemove",this.onWindowMouseMove),window.addEventListener("mouseup",this.onWindowMouseUp),this.updateCursor(t))}),this.onWindowMouseMove=(i=>{if(!this.dragStartConfigSpaceMouse)return;let t=this.configSpaceMouse(i);if(t)if(this.updateCursor(t),t=new o.Rect(new o.Vec2(0,0),this.configSpaceSize()).closestPointTo(t),this.draggingMode===e.DRAW_NEW_VIEWPORT){const e=this.dragStartConfigSpaceMouse;let i=t;if(!e||!i)return;const s=Math.min(e.x,i.x),n=Math.max(e.x,i.x)-s,a=this.props.configSpaceViewportRect.height();this.props.setConfigSpaceViewportRect(new o.Rect(new o.Vec2(s,i.y-a/2),new o.Vec2(n,a)))}else if(this.draggingMode===e.TRANSLATE_VIEWPORT){if(!this.dragConfigSpaceViewportOffset)return;const e=t.minus(this.dragConfigSpaceViewportOffset);this.props.setConfigSpaceViewportRect(this.props.configSpaceViewportRect.withOrigin(e))}}),this.updateCursor=(i=>{this.draggingMode===e.TRANSLATE_VIEWPORT?(document.body.style.cursor="grabbing",document.body.style.cursor="-webkit-grabbing"):this.draggingMode===e.DRAW_NEW_VIEWPORT?document.body.style.cursor="col-resize":this.props.configSpaceViewportRect.contains(i)?(document.body.style.cursor="grab",document.body.style.cursor="-webkit-grab"):document.body.style.cursor="col-resize"}),this.onMouseLeave=(()=>{null==this.draggingMode&&(document.body.style.cursor="default")}),this.onMouseMove=(e=>{const i=this.configSpaceMouse(e);i&&this.updateCursor(i)}),this.onWindowMouseUp=(e=>{this.draggingMode=null,window.removeEventListener("mousemove",this.onWindowMouseMove),window.removeEventListener("mouseup",this.onWindowMouseUp);const i=this.configSpaceMouse(e);i&&this.updateCursor(i)}),this.overlayCanvasRef=(e=>{e?(this.overlayCanvas=e,this.overlayCtx=this.overlayCanvas.getContext("2d"),this.renderCanvas()):(this.overlayCanvas=null,this.overlayCtx=null)})}physicalViewSize(){return new o.Vec2(this.overlayCanvas?this.overlayCanvas.width:0,this.overlayCanvas?this.overlayCanvas.height:0)}minimapOrigin(){return new o.Vec2(0,n.Sizes.FRAME_HEIGHT*window.devicePixelRatio)}configSpaceSize(){return new o.Vec2(this.props.flamechart.getTotalWeight(),this.props.flamechart.getLayers().length)}configSpaceToPhysicalViewSpace(){const e=this.minimapOrigin();return o.AffineTransform.betweenRects(new o.Rect(new o.Vec2(0,0),this.configSpaceSize()),new o.Rect(e,this.physicalViewSize().minus(e)))}logicalToPhysicalViewSpace(){return o.AffineTransform.withScale(new o.Vec2(window.devicePixelRatio,window.devicePixelRatio))}windowToLogicalViewSpace(){if(!this.container)return new o.AffineTransform;const e=this.container.getBoundingClientRect();return o.AffineTransform.withTranslation(new o.Vec2(-e.left,-e.top))}renderRects(){this.container&&(this.physicalViewSize().x<2||this.props.canvasContext.renderBehind(this.container,()=>{this.props.flamechartRenderer.render({configSpaceSrcRect:new o.Rect(new o.Vec2(0,0),this.configSpaceSize()),physicalSpaceDstRect:new o.Rect(this.minimapOrigin(),this.physicalViewSize().minus(this.minimapOrigin())),renderOutlines:!1}),this.props.canvasContext.viewportRectangleRenderer.render({configSpaceViewportRect:this.props.configSpaceViewportRect,configSpaceToPhysicalViewSpace:this.configSpaceToPhysicalViewSpace()})}))}renderOverlays(){const e=this.overlayCtx;if(!e)return;const i=this.physicalViewSize();e.clearRect(0,0,i.x,i.y);const t=this.configSpaceToPhysicalViewSpace(),s=this.configSpaceSize().x,r=(this.configSpaceToPhysicalViewSpace().inverted()||new o.AffineTransform).times(this.logicalToPhysicalViewSpace()).transformVector(new o.Vec2(200,1)).x,c=n.Sizes.FRAME_HEIGHT*window.devicePixelRatio,h=n.FontSize.LABEL*window.devicePixelRatio,l=(c-h)/2;e.font=`${h}px/${c}px ${n.FontFamily.MONOSPACE}`,e.textBaseline="top";let p=Math.pow(10,Math.floor(Math.log10(r)));r/p>5?p*=5:r/p>2&&(p*=2),e.fillStyle="rgba(255, 255, 255, 0.8)",e.fillRect(0,0,i.x,c),e.textBaseline="top",e.fillStyle=n.Colors.DARK_GRAY;for(let n=Math.ceil(0/p)*p;n<s;n+=p){const s=Math.round(t.transformPosition(new o.Vec2(n,0)).x),r=this.props.flamechart.formatValue(n),c=Math.ceil((0,a.cachedMeasureTextWidth)(e,r));e.fillText(r,s-c-l,l),e.fillRect(s,0,1,i.y)}}componentWillReceiveProps(e){this.props.flamechart!==e.flamechart?this.renderCanvas():this.props.configSpaceViewportRect!=e.configSpaceViewportRect&&this.renderCanvas()}componentDidMount(){window.addEventListener("resize",this.onWindowResize),this.props.canvasContext.addBeforeFrameHandler(this.onBeforeFrame)}componentWillUnmount(){window.removeEventListener("resize",this.onWindowResize),this.props.canvasContext.removeBeforeFrameHandler(this.onBeforeFrame)}resizeOverlayCanvasIfNeeded(){if(!this.overlayCanvas)return;let{width:e,height:i}=this.overlayCanvas.getBoundingClientRect();if(e=Math.floor(e),i=Math.floor(i),0===e||0===i)return;const t=e*window.devicePixelRatio,o=i*window.devicePixelRatio;t===this.overlayCanvas.width&&o===this.overlayCanvas.height||(this.overlayCanvas.width=t,this.overlayCanvas.height=o)}pan(e){this.interactionLock="pan";const i=this.logicalToPhysicalViewSpace().transformVector(e),t=this.configSpaceToPhysicalViewSpace().inverseTransformVector(i);t&&this.props.transformViewport(o.AffineTransform.withTranslation(t))}zoom(e){this.interactionLock="zoom";const i=this.props.configSpaceViewportRect,t=i.origin.plus(i.size.times(.5));if(!t)return;const s=o.AffineTransform.withTranslation(t.times(-1)).scaledBy(new o.Vec2(e,1)).translatedBy(t);this.props.transformViewport(s)}configSpaceMouse(e){const i=this.windowToLogicalViewSpace().transformPosition(new o.Vec2(e.clientX,e.clientY)),t=this.logicalToPhysicalViewSpace().transformPosition(i);return this.configSpaceToPhysicalViewSpace().inverseTransformPosition(t)}render(){return(0,i.h)("div",{ref:this.containerRef,onWheel:this.onWheel,onMouseDown:this.onMouseDown,onMouseMove:this.onMouseMove,onMouseLeave:this.onMouseLeave,className:(0,t.css)(s.style.minimap,n.commonStyle.vbox)},(0,i.h)("canvas",{width:1,height:1,ref:this.overlayCanvasRef,className:(0,t.css)(s.style.fill)}))}}exports.FlamechartMinimapView=r;
},{"preact":24,"aphrodite":68,"../lib/math":102,"./flamechart-style":163,"./style":79,"../lib/text-utils":173}],160:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.FlamechartDetailView=void 0;var e=require("aphrodite"),s=require("preact"),t=require("./flamechart-style"),l=require("../lib/utils"),a=require("./color-chit");class r extends s.Component{render(){const a=this.props.formatter(this.props.selectedTotal),r=this.props.formatter(this.props.selectedSelf),i=100*this.props.selectedTotal/this.props.grandTotal,c=100*this.props.selectedSelf/this.props.grandTotal;return(0,s.h)("div",{className:(0,e.css)(t.style.statsTable)},(0,s.h)("div",{className:(0,e.css)(this.props.cellStyle,t.style.statsTableCell,t.style.statsTableHeader)},this.props.title),(0,s.h)("div",{className:(0,e.css)(this.props.cellStyle,t.style.statsTableCell)},"Total"),(0,s.h)("div",{className:(0,e.css)(this.props.cellStyle,t.style.statsTableCell)},"Self"),(0,s.h)("div",{className:(0,e.css)(this.props.cellStyle,t.style.statsTableCell)},a),(0,s.h)("div",{className:(0,e.css)(this.props.cellStyle,t.style.statsTableCell)},r),(0,s.h)("div",{className:(0,e.css)(this.props.cellStyle,t.style.statsTableCell)},(0,l.formatPercent)(i),(0,s.h)("div",{className:(0,e.css)(t.style.barDisplay),style:{height:`${i}%`}})),(0,s.h)("div",{className:(0,e.css)(this.props.cellStyle,t.style.statsTableCell)},(0,l.formatPercent)(c),(0,s.h)("div",{className:(0,e.css)(t.style.barDisplay),style:{height:`${c}%`}})))}}class i extends s.Component{render(){const l=[];let r=this.props.node;for(;r&&!r.isRoot();r=r.parent){const i=[],{frame:c}=r;if(i.push((0,s.h)(a.ColorChit,{color:this.props.getFrameColor(c)})),l.length&&i.push((0,s.h)("span",{className:(0,e.css)(t.style.stackFileLine)},"> ")),i.push(c.name),c.file){let l=c.file;c.line&&(l+=`:${c.line}`,c.col&&(l+=`:${c.col}`)),i.push((0,s.h)("span",{className:(0,e.css)(t.style.stackFileLine)}," (",l,")"))}l.push((0,s.h)("div",{className:(0,e.css)(t.style.stackLine)},i))}return(0,s.h)("div",{className:(0,e.css)(t.style.stackTraceView)},(0,s.h)("div",{className:(0,e.css)(t.style.stackTraceViewPadding)},l))}}class c extends s.Component{render(){const{flamechart:l,selectedNode:a}=this.props,{frame:c}=a;return(0,s.h)("div",{className:(0,e.css)(t.style.detailView)},(0,s.h)(r,{title:"This Instance",cellStyle:t.style.thisInstanceCell,grandTotal:l.getTotalWeight(),selectedTotal:a.getTotalWeight(),selectedSelf:a.getSelfWeight(),formatter:l.formatValue.bind(l)}),(0,s.h)(r,{title:"All Instances",cellStyle:t.style.allInstancesCell,grandTotal:l.getTotalWeight(),selectedTotal:c.getTotalWeight(),selectedSelf:c.getSelfWeight(),formatter:l.formatValue.bind(l)}),(0,s.h)(i,{node:a,getFrameColor:this.props.getCSSColorForFrame}))}}exports.FlamechartDetailView=c;
},{"aphrodite":68,"preact":24,"./flamechart-style":163,"../lib/utils":70,"./color-chit":106}],161:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.FlamechartPanZoomView=void 0;var e=require("../lib/math"),t=require("./style"),i=require("../lib/text-utils"),o=require("./flamechart-style"),s=require("preact"),n=require("aphrodite");class r extends s.Component{constructor(){super(...arguments),this.container=null,this.containerRef=(e=>{this.container=e||null}),this.overlayCanvas=null,this.overlayCtx=null,this.hoveredLabel=null,this.overlayCanvasRef=(e=>{e?(this.overlayCanvas=e,this.overlayCtx=this.overlayCanvas.getContext("2d"),this.renderCanvas()):(this.overlayCanvas=null,this.overlayCtx=null)}),this.LOGICAL_VIEW_SPACE_FRAME_HEIGHT=t.Sizes.FRAME_HEIGHT,this.onWindowResize=(()=>{this.updateConfigSpaceViewport(),this.onBeforeFrame()}),this.frameHadWheelEvent=!1,this.framesWithoutWheelEvents=0,this.interactionLock=null,this.maybeClearInteractionLock=(()=>{this.interactionLock&&(this.frameHadWheelEvent||(this.framesWithoutWheelEvents++,this.framesWithoutWheelEvents>=2&&(this.interactionLock=null,this.framesWithoutWheelEvents=0)),this.props.canvasContext.requestFrame()),this.frameHadWheelEvent=!1}),this.onBeforeFrame=(()=>{this.resizeOverlayCanvasIfNeeded(),this.renderRects(),this.renderOverlays(),this.maybeClearInteractionLock()}),this.renderCanvas=(()=>{this.props.canvasContext.requestFrame()}),this.lastDragPos=null,this.mouseDownPos=null,this.onMouseDown=(t=>{this.mouseDownPos=this.lastDragPos=new e.Vec2(t.offsetX,t.offsetY),this.updateCursor(),window.addEventListener("mouseup",this.onWindowMouseUp)}),this.onMouseDrag=(t=>{if(!this.lastDragPos)return;const i=new e.Vec2(t.offsetX,t.offsetY);this.pan(this.lastDragPos.minus(i)),this.lastDragPos=i,this.hoveredLabel&&this.props.onNodeHover(null)}),this.onDblClick=(t=>{if(this.hoveredLabel){const t=this.hoveredLabel.configSpaceBounds,i=new e.Rect(t.origin.minus(new e.Vec2(0,1)),t.size.withY(this.props.configSpaceViewportRect.height()));this.props.setConfigSpaceViewportRect(i)}}),this.onClick=(t=>{const i=new e.Vec2(t.offsetX,t.offsetY),o=this.mouseDownPos;this.mouseDownPos=null,o&&i.minus(o).length()>5||(this.hoveredLabel?(this.props.onNodeSelect(this.hoveredLabel.node),this.renderCanvas()):this.props.onNodeSelect(null))}),this.onWindowMouseUp=(e=>{this.lastDragPos=null,this.updateCursor(),window.removeEventListener("mouseup",this.onWindowMouseUp)}),this.onMouseMove=(t=>{if(this.updateCursor(),this.lastDragPos)return t.preventDefault(),void this.onMouseDrag(t);this.hoveredLabel=null;const i=new e.Vec2(t.offsetX,t.offsetY),o=this.logicalToPhysicalViewSpace().transformPosition(i),s=this.configSpaceToPhysicalViewSpace().inverseTransformPosition(o);if(!s)return;const n=(t,i=0)=>{const o=t.end-t.start,r=this.props.renderInverted?this.configSpaceSize().y-1-i:i,a=new e.Rect(new e.Vec2(t.start,r),new e.Vec2(o,1));if(s.x<a.left())return null;if(s.x>a.right())return null;a.contains(s)&&(this.hoveredLabel={configSpaceBounds:a,node:t.node});for(let e of t.children)n(e,i+1)};for(let e of this.props.flamechart.getLayers()[0]||[])n(e);this.hoveredLabel?this.props.onNodeHover({node:this.hoveredLabel.node,event:t}):this.props.onNodeHover(null),this.renderCanvas()}),this.onMouseLeave=(e=>{this.hoveredLabel=null,this.props.onNodeHover(null),this.renderCanvas()}),this.onWheel=(t=>{t.preventDefault(),this.frameHadWheelEvent=!0;const i=t.metaKey||t.ctrlKey;let o=t.deltaY,s=t.deltaX;if(t.deltaMode===t.DOM_DELTA_LINE&&(o*=this.LOGICAL_VIEW_SPACE_FRAME_HEIGHT,s*=this.LOGICAL_VIEW_SPACE_FRAME_HEIGHT),i&&"pan"!==this.interactionLock){let i=1+o/100;t.ctrlKey&&(i=1+o/40),i=(0,e.clamp)(i,.1,10),this.zoom(new e.Vec2(t.offsetX,t.offsetY),i)}else"zoom"!==this.interactionLock&&this.pan(new e.Vec2(s,o));this.renderCanvas()}),this.onWindowKeyPress=(t=>{if(!this.container)return;const{width:i,height:o}=this.container.getBoundingClientRect();"="===t.key||"+"===t.key?(this.zoom(new e.Vec2(i/2,o/2),.5),t.preventDefault()):"-"!==t.key&&"_"!==t.key||(this.zoom(new e.Vec2(i/2,o/2),2),t.preventDefault()),t.ctrlKey||t.shiftKey||t.metaKey||("0"===t.key?this.zoom(new e.Vec2(i/2,o/2),1e9):"ArrowRight"===t.key||"KeyD"===t.code?this.pan(new e.Vec2(100,0)):"ArrowLeft"===t.key||"KeyA"===t.code?this.pan(new e.Vec2(-100,0)):"ArrowUp"===t.key||"KeyW"===t.code?this.pan(new e.Vec2(0,-100)):"ArrowDown"===t.key||"KeyS"===t.code?this.pan(new e.Vec2(0,100)):"Escape"===t.key&&(this.props.onNodeSelect(null),this.renderCanvas()))})}setConfigSpaceViewportRect(e){this.props.setConfigSpaceViewportRect(e)}configSpaceSize(){return new e.Vec2(this.props.flamechart.getTotalWeight(),this.props.flamechart.getLayers().length)}physicalViewSize(){return new e.Vec2(this.overlayCanvas?this.overlayCanvas.width:0,this.overlayCanvas?this.overlayCanvas.height:0)}physicalBounds(){if(this.props.renderInverted){const t=this.physicalViewSize().y,i=(this.configSpaceSize().y+1)*this.LOGICAL_VIEW_SPACE_FRAME_HEIGHT*window.devicePixelRatio;if(i<t)return new e.Rect(new e.Vec2(0,t-i),this.physicalViewSize())}return new e.Rect(new e.Vec2(0,0),this.physicalViewSize())}configSpaceToPhysicalViewSpace(){return e.AffineTransform.betweenRects(this.props.configSpaceViewportRect,this.physicalBounds())}logicalToPhysicalViewSpace(){return e.AffineTransform.withScale(new e.Vec2(window.devicePixelRatio,window.devicePixelRatio))}resizeOverlayCanvasIfNeeded(){if(!this.overlayCanvas)return;let{width:e,height:t}=this.overlayCanvas.getBoundingClientRect();if(e=Math.floor(e),t=Math.floor(t),0===e||0===t)return;const i=e*window.devicePixelRatio,o=t*window.devicePixelRatio;i===this.overlayCanvas.width&&o===this.overlayCanvas.height||(this.overlayCanvas.width=i,this.overlayCanvas.height=o)}renderOverlays(){const o=this.overlayCtx;if(!o)return;if(this.props.configSpaceViewportRect.isEmpty())return;const s=this.configSpaceToPhysicalViewSpace(),n=t.FontSize.LABEL*window.devicePixelRatio,r=this.LOGICAL_VIEW_SPACE_FRAME_HEIGHT*window.devicePixelRatio,a=this.physicalViewSize();if(o.clearRect(0,0,a.x,a.y),this.hoveredLabel){let e=t.Colors.DARK_GRAY;this.props.selectedNode===this.hoveredLabel.node&&(e=t.Colors.DARK_BLUE),o.lineWidth=2*devicePixelRatio,o.strokeStyle=e;const i=s.transformRect(this.hoveredLabel.configSpaceBounds);o.strokeRect(Math.round(i.left()),Math.round(i.top()),Math.round(Math.max(0,i.width())),Math.round(Math.max(0,i.height())))}o.font=`${n}px/${r}px ${t.FontFamily.MONOSPACE}`,o.textBaseline="alphabetic",o.fillStyle=t.Colors.DARK_GRAY;const h=(0,i.cachedMeasureTextWidth)(o,"M"+i.ELLIPSIS+"M"),c=(s.inverseTransformVector(new e.Vec2(h,0))||new e.Vec2(0,0)).x,l=5*window.devicePixelRatio,p=(t,d=0)=>{const f=t.end-t.start,w=this.props.renderInverted?this.configSpaceSize().y-1-d:d,u=new e.Rect(new e.Vec2(t.start,w),new e.Vec2(f,1));if(!(f<c||u.left()>this.props.configSpaceViewportRect.right()||u.right()<this.props.configSpaceViewportRect.left())){if(this.props.renderInverted){if(u.bottom()<this.props.configSpaceViewportRect.top())return}else if(u.top()>this.props.configSpaceViewportRect.bottom())return;if(u.hasIntersectionWith(this.props.configSpaceViewportRect)){let e=s.transformRect(u);if(e.left()<0&&(e=e.withOrigin(e.origin.withX(0)).withSize(e.size.withX(e.size.x+e.left()))),e.right()>a.x&&(e=e.withSize(e.size.withX(a.x-e.left()))),e.width()>h){const s=(0,i.trimTextMid)(o,t.node.frame.name,e.width()-2*l);o.fillText(s,e.left()+l,Math.round(e.bottom()-(r-n)/2))}}for(let e of t.children)p(e,d+1)}};for(let e of this.props.flamechart.getLayers()[0]||[])p(e);const d=2*window.devicePixelRatio;o.strokeStyle=t.Colors.PALE_DARK_BLUE,o.lineWidth=d;const f=(s.inverseTransformVector(new e.Vec2(1,0))||new e.Vec2(0,0)).x,w=(i,n=0)=>{if(!this.props.selectedNode)return;const r=i.end-i.start,a=this.props.renderInverted?this.configSpaceSize().y-1-n:n,h=new e.Rect(new e.Vec2(i.start,a),new e.Vec2(r,1));if(!(r<f||h.left()>this.props.configSpaceViewportRect.right()||h.right()<this.props.configSpaceViewportRect.left()||h.top()>this.props.configSpaceViewportRect.bottom())){if(h.hasIntersectionWith(this.props.configSpaceViewportRect)){const e=s.transformRect(h);i.node.frame===this.props.selectedNode.frame&&(i.node===this.props.selectedNode?o.strokeStyle!==t.Colors.DARK_BLUE&&(o.stroke(),o.beginPath(),o.strokeStyle=t.Colors.DARK_BLUE):o.strokeStyle!==t.Colors.PALE_DARK_BLUE&&(o.stroke(),o.beginPath(),o.strokeStyle=t.Colors.PALE_DARK_BLUE),o.rect(Math.round(e.left()+1+d/2),Math.round(e.top()+1+d/2),Math.round(Math.max(0,e.width()-2-d)),Math.round(Math.max(0,e.height()-2-d))))}for(let e of i.children)w(e,n+1)}};o.beginPath();for(let e of this.props.flamechart.getLayers()[0]||[])w(e);o.stroke(),this.renderTimeIndicators()}renderTimeIndicators(){const o=this.overlayCtx;if(!o)return;const s=this.LOGICAL_VIEW_SPACE_FRAME_HEIGHT*window.devicePixelRatio,n=this.physicalViewSize(),r=this.configSpaceToPhysicalViewSpace(),a=(s-t.FontSize.LABEL*window.devicePixelRatio)/2,h=this.props.configSpaceViewportRect.left(),c=this.props.configSpaceViewportRect.right(),l=(this.configSpaceToPhysicalViewSpace().inverted()||new e.AffineTransform).times(this.logicalToPhysicalViewSpace()).transformVector(new e.Vec2(200,1)).x;let p=Math.pow(10,Math.floor(Math.log10(l)));l/p>5?p*=5:l/p>2&&(p*=2);{const l=this.props.renderInverted?n.y-s:0;o.fillStyle="rgba(255, 255, 255, 0.8)",o.fillRect(0,l,n.x,s),o.fillStyle=t.Colors.DARK_GRAY,o.textBaseline="top";for(let t=Math.ceil(h/p)*p;t<c;t+=p){const s=Math.round(r.transformPosition(new e.Vec2(t,0)).x),h=this.props.flamechart.formatValue(t),c=(0,i.cachedMeasureTextWidth)(o,h);o.fillText(h,s-c-a,l+a),o.fillRect(s,0,1,n.y)}}}updateConfigSpaceViewport(){if(!this.container)return;const{logicalSpaceViewportSize:t}=this.props,i=this.container.getBoundingClientRect(),{width:o,height:s}=i;if(!(o<2||s<2)){if(this.props.configSpaceViewportRect.isEmpty()){const t=s/this.LOGICAL_VIEW_SPACE_FRAME_HEIGHT;this.props.renderInverted?this.setConfigSpaceViewportRect(new e.Rect(new e.Vec2(0,this.configSpaceSize().y-t+1),new e.Vec2(this.configSpaceSize().x,t))):this.setConfigSpaceViewportRect(new e.Rect(new e.Vec2(0,-1),new e.Vec2(this.configSpaceSize().x,t)))}else t.equals(e.Vec2.zero)||t.x===o&&t.y===s||this.setConfigSpaceViewportRect(this.props.configSpaceViewportRect.withSize(this.props.configSpaceViewportRect.size.timesPointwise(new e.Vec2(o/t.x,s/t.y))));this.props.setLogicalSpaceViewportBounds(new e.Vec2(o,s))}}renderRects(){this.container&&(this.updateConfigSpaceViewport(),this.props.configSpaceViewportRect.isEmpty()||this.props.canvasContext.renderBehind(this.container,()=>{this.props.flamechartRenderer.render({physicalSpaceDstRect:this.physicalBounds(),configSpaceSrcRect:this.props.configSpaceViewportRect,renderOutlines:!0})}))}pan(t){this.interactionLock="pan";const i=this.logicalToPhysicalViewSpace().transformVector(t),o=this.configSpaceToPhysicalViewSpace().inverseTransformVector(i);this.hoveredLabel&&this.props.onNodeHover(null),o&&this.props.transformViewport(e.AffineTransform.withTranslation(o))}zoom(t,i){this.interactionLock="zoom";const o=this.logicalToPhysicalViewSpace().transformPosition(t),s=this.configSpaceToPhysicalViewSpace().inverseTransformPosition(o);if(!s)return;const n=e.AffineTransform.withTranslation(s.times(-1)).scaledBy(new e.Vec2(i,1)).translatedBy(s);this.props.transformViewport(n)}updateCursor(){this.lastDragPos?(document.body.style.cursor="grabbing",document.body.style.cursor="-webkit-grabbing"):document.body.style.cursor="default"}shouldComponentUpdate(){return!1}componentWillReceiveProps(e){this.props.flamechart!==e.flamechart?(this.hoveredLabel=null,this.renderCanvas()):this.props.selectedNode!==e.selectedNode?this.renderCanvas():this.props.configSpaceViewportRect!==e.configSpaceViewportRect&&this.renderCanvas()}componentDidMount(){this.props.canvasContext.addBeforeFrameHandler(this.onBeforeFrame),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keydown",this.onWindowKeyPress)}componentWillUnmount(){this.props.canvasContext.removeBeforeFrameHandler(this.onBeforeFrame),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keydown",this.onWindowKeyPress)}render(){return(0,s.h)("div",{className:(0,n.css)(o.style.panZoomView,t.commonStyle.vbox),onMouseDown:this.onMouseDown,onMouseMove:this.onMouseMove,onMouseLeave:this.onMouseLeave,onClick:this.onClick,onDblClick:this.onDblClick,onWheel:this.onWheel,ref:this.containerRef},(0,s.h)("canvas",{width:1,height:1,ref:this.overlayCanvasRef,className:(0,n.css)(o.style.fill)}))}}exports.FlamechartPanZoomView=r;
},{"../lib/math":102,"./style":79,"../lib/text-utils":173,"./flamechart-style":163,"preact":24,"aphrodite":68}],162:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Hovertip=void 0;var e=require("./style"),o=require("aphrodite"),t=require("preact");class i extends t.Component{render(){const{containerSize:i,offset:r}=this.props,n=i.x,p=i.y,d={};return r.x+7+e.Sizes.TOOLTIP_WIDTH_MAX<n?d.left=r.x+7:d.right=n-r.x+1,r.y+7+e.Sizes.TOOLTIP_HEIGHT_MAX<p?d.top=r.y+7:d.bottom=p-r.y+1,(0,t.h)("div",{className:(0,o.css)(s.hoverTip),style:d},(0,t.h)("div",{className:(0,o.css)(s.hoverTipRow)},this.props.children))}}exports.Hovertip=i;const r=2,s=o.StyleSheet.create({hoverTip:{position:"absolute",background:e.Colors.WHITE,border:"1px solid black",maxWidth:e.Sizes.TOOLTIP_WIDTH_MAX,paddingTop:2,paddingBottom:2,pointerEvents:"none",userSelect:"none",fontSize:e.FontSize.LABEL,fontFamily:e.FontFamily.MONOSPACE,zIndex:e.ZIndex.HOVERTIP},hoverTipRow:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflowX:"hidden",paddingLeft:2,paddingRight:2,maxWidth:e.Sizes.TOOLTIP_WIDTH_MAX}});
},{"./style":79,"aphrodite":68,"preact":24}],115:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.FlamechartView=void 0;var e=require("preact"),t=require("aphrodite"),r=require("../lib/math"),i=require("../lib/utils"),o=require("./flamechart-minimap-view"),s=require("./flamechart-style"),a=require("./style"),c=require("./flamechart-detail-view"),p=require("./flamechart-pan-zoom-view"),n=require("./hovertip"),h=require("../lib/typed-redux");class l extends h.StatelessComponent{constructor(){super(...arguments),this.setConfigSpaceViewportRect=(e=>{const t=a.Sizes.DETAIL_VIEW_HEIGHT/a.Sizes.FRAME_HEIGHT,i=this.configSpaceSize(),o=this.props.flamechart.getClampedViewportWidth(e.size.x),s=e.size.withX(o),c=r.Vec2.clamp(e.origin,new r.Vec2(0,-1),r.Vec2.max(r.Vec2.zero,i.minus(s).plus(new r.Vec2(0,t+1))));this.props.setConfigSpaceViewportRect(new r.Rect(c,e.size.withX(o)))}),this.setLogicalSpaceViewportSize=(e=>{this.props.setLogicalSpaceViewportSize(e)}),this.transformViewport=(e=>{const t=e.transformRect(this.props.configSpaceViewportRect);this.setConfigSpaceViewportRect(t)}),this.onNodeHover=(e=>{this.props.setNodeHover(e)}),this.onNodeClick=(e=>{this.props.setSelectedNode(e)}),this.container=null,this.containerRef=(e=>{this.container=e||null})}configSpaceSize(){return new r.Vec2(this.props.flamechart.getTotalWeight(),this.props.flamechart.getLayers().length)}formatValue(e){const t=100*e/this.props.flamechart.getTotalWeight(),r=(0,i.formatPercent)(t);return`${this.props.flamechart.formatValue(e)} (${r})`}renderTooltip(){if(!this.container)return null;const{hover:i}=this.props;if(!i)return null;const{width:o,height:a,left:c,top:p}=this.container.getBoundingClientRect(),h=new r.Vec2(i.event.clientX-c,i.event.clientY-p);return(0,e.h)(n.Hovertip,{containerSize:new r.Vec2(o,a),offset:h},(0,e.h)("span",{className:(0,t.css)(s.style.hoverCount)},this.formatValue(i.node.getTotalWeight()))," ",i.node.frame.name)}render(){return(0,e.h)("div",{className:(0,t.css)(s.style.fill,a.commonStyle.vbox),ref:this.containerRef},(0,e.h)(o.FlamechartMinimapView,{configSpaceViewportRect:this.props.configSpaceViewportRect,transformViewport:this.transformViewport,flamechart:this.props.flamechart,flamechartRenderer:this.props.flamechartRenderer,canvasContext:this.props.canvasContext,setConfigSpaceViewportRect:this.setConfigSpaceViewportRect}),(0,e.h)(p.FlamechartPanZoomView,{canvasContext:this.props.canvasContext,flamechart:this.props.flamechart,flamechartRenderer:this.props.flamechartRenderer,renderInverted:!1,onNodeHover:this.onNodeHover,onNodeSelect:this.onNodeClick,selectedNode:this.props.selectedNode,transformViewport:this.transformViewport,configSpaceViewportRect:this.props.configSpaceViewportRect,setConfigSpaceViewportRect:this.setConfigSpaceViewportRect,logicalSpaceViewportSize:this.props.logicalSpaceViewportSize,setLogicalSpaceViewportBounds:this.setLogicalSpaceViewportSize}),this.renderTooltip(),this.props.selectedNode&&(0,e.h)(c.FlamechartDetailView,{flamechart:this.props.flamechart,getCSSColorForFrame:this.props.getCSSColorForFrame,selectedNode:this.props.selectedNode}))}}exports.FlamechartView=l;
},{"preact":24,"aphrodite":68,"../lib/math":102,"../lib/utils":70,"./flamechart-minimap-view":159,"./flamechart-style":163,"./style":79,"./flamechart-detail-view":160,"./flamechart-pan-zoom-view":161,"./hovertip":162,"../lib/typed-redux":36}],62:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.LeftHeavyFlamechartView=exports.getLeftHeavyFlamechart=exports.ChronoFlamechartView=exports.createMemoizedFlamechartRenderer=exports.getChronoViewFlamechart=void 0,exports.createFlamechartSetters=n;var e=require("../store/flamechart-view-state"),t=require("../lib/flamechart"),r=require("../gl/flamechart-renderer"),a=require("../lib/typed-redux"),o=require("../lib/utils"),l=require("./flamechart-view"),c=require("../store/getters"),i=require("../store/actions");function n(e,t,r){function a(a,o){return l=>{const c=Object.assign({},o(l),{id:t});e(a({profileIndex:r,args:c}))}}const{setHoveredNode:o,setLogicalSpaceViewportSize:l,setConfigSpaceViewportRect:c,setSelectedNode:n}=i.actions.flamechart;return{setNodeHover:a(o,e=>({hover:e})),setLogicalSpaceViewportSize:a(l,e=>({logicalSpaceViewportSize:e})),setConfigSpaceViewportRect:a(c,e=>({configSpaceViewportRect:e})),setSelectedNode:a(n,e=>({selectedNode:e}))}}const m=exports.getChronoViewFlamechart=(0,o.memoizeByShallowEquality)(({profile:e,getColorBucketForFrame:r})=>new t.Flamechart({getTotalWeight:e.getTotalWeight.bind(e),forEachCall:e.forEachCall.bind(e),formatValue:e.formatValue.bind(e),getColorBucketForFrame:r})),s=exports.createMemoizedFlamechartRenderer=(e=>(0,o.memoizeByShallowEquality)(({canvasContext:t,flamechart:a})=>new r.FlamechartRenderer(t.gl,(0,c.getRowAtlas)(t),a,t.rectangleBatchRenderer,t.flamechartColorPassRenderer,e))),h=s(),F=exports.ChronoFlamechartView=(0,a.createContainer)(l.FlamechartView,(t,r,a)=>{const{activeProfileState:o,glCanvas:l}=a,{index:i,profile:s,chronoViewState:F}=o,C=(0,c.getCanvasContext)(l),f=(0,c.getFrameToColorBucket)(s),g=(0,c.createGetColorBucketForFrame)(f),d=(0,c.createGetCSSColorForFrame)(f),u=m({profile:s,getColorBucketForFrame:g}),p=h({canvasContext:C,flamechart:u});return Object.assign({renderInverted:!1,flamechart:u,flamechartRenderer:p,canvasContext:C,getCSSColorForFrame:d},n(r,e.FlamechartID.CHRONO,i),F)}),C=exports.getLeftHeavyFlamechart=(0,o.memoizeByShallowEquality)(({profile:e,getColorBucketForFrame:r})=>new t.Flamechart({getTotalWeight:e.getTotalNonIdleWeight.bind(e),forEachCall:e.forEachCallGrouped.bind(e),formatValue:e.formatValue.bind(e),getColorBucketForFrame:r})),f=s(),g=exports.LeftHeavyFlamechartView=(0,a.createContainer)(l.FlamechartView,(t,r,a)=>{const{activeProfileState:o,glCanvas:l}=a,{index:i,profile:m,leftHeavyViewState:s}=o,h=(0,c.getCanvasContext)(l),F=(0,c.getFrameToColorBucket)(m),g=(0,c.createGetColorBucketForFrame)(F),d=(0,c.createGetCSSColorForFrame)(F),u=C({profile:m,getColorBucketForFrame:g}),p=f({canvasContext:h,flamechart:u});return Object.assign({renderInverted:!1,flamechart:u,flamechartRenderer:p,canvasContext:h,getCSSColorForFrame:d},n(r,e.FlamechartID.LEFT_HEAVY,i),s)});
},{"../store/flamechart-view-state":98,"../lib/flamechart":142,"../gl/flamechart-renderer":143,"../lib/typed-redux":36,"../lib/utils":70,"./flamechart-view":115,"../store/getters":38,"../store/actions":40}],167:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.style=exports.FlamechartWrapper=void 0;var e=require("aphrodite"),t=require("preact"),r=require("./style"),o=require("../lib/math"),i=require("./flamechart-pan-zoom-view"),s=require("../lib/utils"),a=require("./hovertip"),n=require("../lib/typed-redux");class p extends n.StatelessComponent{constructor(){super(...arguments),this.setConfigSpaceViewportRect=(e=>{this.props.setConfigSpaceViewportRect(this.clampViewportToFlamegraph(e))}),this.setLogicalSpaceViewportSize=(e=>{this.props.setLogicalSpaceViewportSize(e)}),this.transformViewport=(e=>{this.setConfigSpaceViewportRect(e.transformRect(this.props.configSpaceViewportRect))}),this.container=null,this.containerRef=(e=>{this.container=e||null}),this.setNodeHover=(e=>{this.props.setNodeHover(e)})}clampViewportToFlamegraph(e){const{flamechart:t,renderInverted:r}=this.props,i=new o.Vec2(t.getTotalWeight(),t.getLayers().length),s=this.props.flamechart.getClampedViewportWidth(e.size.x),a=e.size.withX(s),n=o.Vec2.clamp(e.origin,new o.Vec2(0,r?0:-1),o.Vec2.max(o.Vec2.zero,i.minus(a).plus(new o.Vec2(0,1))));return new o.Rect(n,e.size.withX(s))}formatValue(e){const t=100*e/this.props.flamechart.getTotalWeight(),r=(0,s.formatPercent)(t);return`${this.props.flamechart.formatValue(e)} (${r})`}renderTooltip(){if(!this.container)return null;const{hover:r}=this.props;if(!r)return null;const{width:i,height:s,left:n,top:p}=this.container.getBoundingClientRect(),l=new o.Vec2(r.event.clientX-n,r.event.clientY-p);return(0,t.h)(a.Hovertip,{containerSize:new o.Vec2(i,s),offset:l},(0,t.h)("span",{className:(0,e.css)(c.hoverCount)},this.formatValue(r.node.getTotalWeight()))," ",r.node.frame.name)}render(){return(0,t.h)("div",{className:(0,e.css)(r.commonStyle.fillY,r.commonStyle.fillX,r.commonStyle.vbox),ref:this.containerRef},(0,t.h)(i.FlamechartPanZoomView,{selectedNode:null,onNodeHover:this.setNodeHover,onNodeSelect:s.noop,configSpaceViewportRect:this.props.configSpaceViewportRect,setConfigSpaceViewportRect:this.setConfigSpaceViewportRect,transformViewport:this.transformViewport,flamechart:this.props.flamechart,flamechartRenderer:this.props.flamechartRenderer,canvasContext:this.props.canvasContext,renderInverted:this.props.renderInverted,logicalSpaceViewportSize:this.props.logicalSpaceViewportSize,setLogicalSpaceViewportBounds:this.setLogicalSpaceViewportSize}),this.renderTooltip())}}exports.FlamechartWrapper=p;const c=exports.style=e.StyleSheet.create({hoverCount:{color:r.Colors.GREEN}});
},{"aphrodite":68,"preact":24,"./style":79,"../lib/math":102,"./flamechart-pan-zoom-view":161,"../lib/utils":70,"./hovertip":162,"../lib/typed-redux":36}],137:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.InvertedCallerFlamegraphView=void 0;var e=require("../lib/utils"),r=require("../lib/flamechart"),t=require("./flamechart-view-container"),a=require("../lib/typed-redux"),l=require("../store/getters"),o=require("../store/flamechart-view-state"),i=require("./flamechart-wrapper");const n=(0,e.memoizeByShallowEquality)(({profile:e,frame:r,flattenRecursion:t})=>{let a=e.getInvertedProfileForCallersOf(r);return t?a.getProfileWithRecursionFlattened():a}),c=(0,e.memoizeByShallowEquality)(({invertedCallerProfile:e,getColorBucketForFrame:t})=>new r.Flamechart({getTotalWeight:e.getTotalNonIdleWeight.bind(e),forEachCall:e.forEachCallGrouped.bind(e),formatValue:e.formatValue.bind(e),getColorBucketForFrame:t})),s=(0,t.createMemoizedFlamechartRenderer)({inverted:!0}),m=exports.InvertedCallerFlamegraphView=(0,a.createContainer)(i.FlamechartWrapper,(e,r,a)=>{const{activeProfileState:i}=a;let{profile:m,sandwichViewState:f,index:d}=i,{flattenRecursion:u,glCanvas:C}=e;if(!m)throw new Error("profile missing");if(!C)throw new Error("glCanvas missing");const{callerCallee:h}=f;if(!h)throw new Error("callerCallee missing");const{selectedFrame:F}=h;m=u?(0,l.getProfileWithRecursionFlattened)(m):m;const g=(0,l.getFrameToColorBucket)(m),v=(0,l.createGetColorBucketForFrame)(g),p=(0,l.createGetCSSColorForFrame)(g),w=(0,l.getCanvasContext)(C),S=c({invertedCallerProfile:n({profile:m,frame:F,flattenRecursion:u}),getColorBucketForFrame:v}),E=s({canvasContext:w,flamechart:S});return Object.assign({renderInverted:!0,flamechart:S,flamechartRenderer:E,canvasContext:w,getCSSColorForFrame:p},(0,t.createFlamechartSetters)(r,o.FlamechartID.SANDWICH_INVERTED_CALLERS,d),{setSelectedNode:()=>{}},h.invertedCallerFlamegraph)});
},{"../lib/utils":70,"../lib/flamechart":142,"./flamechart-view-container":62,"../lib/typed-redux":36,"../store/getters":38,"../store/flamechart-view-state":98,"./flamechart-wrapper":167}],138:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CalleeFlamegraphView=void 0;var e=require("../lib/utils"),r=require("../lib/flamechart"),t=require("./flamechart-view-container"),a=require("../lib/typed-redux"),l=require("../store/getters"),o=require("../store/flamechart-view-state"),i=require("./flamechart-wrapper");const c=(0,e.memoizeByShallowEquality)(({profile:e,frame:r,flattenRecursion:t})=>{let a=e.getProfileForCalleesOf(r);return t?a.getProfileWithRecursionFlattened():a}),n=(0,e.memoizeByShallowEquality)(({calleeProfile:e,getColorBucketForFrame:t})=>new r.Flamechart({getTotalWeight:e.getTotalNonIdleWeight.bind(e),forEachCall:e.forEachCallGrouped.bind(e),formatValue:e.formatValue.bind(e),getColorBucketForFrame:t})),s=(0,t.createMemoizedFlamechartRenderer)(),m=exports.CalleeFlamegraphView=(0,a.createContainer)(i.FlamechartWrapper,(e,r,a)=>{const{activeProfileState:i}=a,{index:m,profile:f,sandwichViewState:u}=i,{flattenRecursion:h,glCanvas:C}=e;if(!f)throw new Error("profile missing");if(!C)throw new Error("glCanvas missing");const{callerCallee:F}=u;if(!F)throw new Error("callerCallee missing");const{selectedFrame:g}=F,d=(0,l.getFrameToColorBucket)(f),p=(0,l.createGetColorBucketForFrame)(d),w=(0,l.createGetCSSColorForFrame)(d),v=(0,l.getCanvasContext)(C),S=n({calleeProfile:c({profile:f,frame:g,flattenRecursion:h}),getColorBucketForFrame:p}),q=s({canvasContext:v,flamechart:S});return Object.assign({renderInverted:!1,flamechart:S,flamechartRenderer:q,canvasContext:v,getCSSColorForFrame:w},(0,t.createFlamechartSetters)(r,o.FlamechartID.SANDWICH_CALLEES,m),{setSelectedNode:()=>{}},F.calleeFlamegraph)});
},{"../lib/utils":70,"../lib/flamechart":142,"./flamechart-view-container":62,"../lib/typed-redux":36,"../store/getters":38,"../store/flamechart-view-state":98,"./flamechart-wrapper":167}],60:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.SandwichViewContainer=void 0;var e=require("aphrodite"),t=require("./profile-table-view"),a=require("preact"),l=require("./style"),r=require("../store/actions"),s=require("../lib/typed-redux"),i=require("./inverted-caller-flamegraph-view"),o=require("./callee-flamegraph-view");class n extends s.StatelessComponent{constructor(){super(...arguments),this.setSelectedFrame=(e=>{this.props.setSelectedFrame(e)}),this.onWindowKeyPress=(e=>{"Escape"===e.key&&this.setSelectedFrame(null)})}componentDidMount(){window.addEventListener("keydown",this.onWindowKeyPress)}componentWillUnmount(){window.removeEventListener("keydown",this.onWindowKeyPress)}render(){const{selectedFrame:r}=this.props;let s=null;return r&&(s=(0,a.h)("div",{className:(0,e.css)(l.commonStyle.fillY,c.callersAndCallees,l.commonStyle.vbox)},(0,a.h)("div",{className:(0,e.css)(l.commonStyle.hbox,c.panZoomViewWraper)},(0,a.h)("div",{className:(0,e.css)(c.flamechartLabelParent)},(0,a.h)("div",{className:(0,e.css)(c.flamechartLabel)},"Callers")),(0,a.h)(i.InvertedCallerFlamegraphView,{glCanvas:this.props.glCanvas,activeProfileState:this.props.activeProfileState})),(0,a.h)("div",{className:(0,e.css)(c.divider)}),(0,a.h)("div",{className:(0,e.css)(l.commonStyle.hbox,c.panZoomViewWraper)},(0,a.h)("div",{className:(0,e.css)(c.flamechartLabelParent,c.flamechartLabelParentBottom)},(0,a.h)("div",{className:(0,e.css)(c.flamechartLabel,c.flamechartLabelBottom)},"Callees")),(0,a.h)(o.CalleeFlamegraphView,{glCanvas:this.props.glCanvas,activeProfileState:this.props.activeProfileState})))),(0,a.h)("div",{className:(0,e.css)(l.commonStyle.hbox,l.commonStyle.fillY)},(0,a.h)("div",{className:(0,e.css)(c.tableView)},(0,a.h)(t.ProfileTableViewContainer,{activeProfileState:this.props.activeProfileState})),s)}}const c=e.StyleSheet.create({tableView:{flex:1},panZoomViewWraper:{flex:1},flamechartLabelParent:{display:"flex",flexDirection:"column",justifyContent:"flex-end",alignItems:"flex-start",fontSize:l.FontSize.TITLE,width:1.2*l.FontSize.TITLE,borderRight:`1px solid ${l.Colors.LIGHT_GRAY}`},flamechartLabelParentBottom:{justifyContent:"flex-start"},flamechartLabel:{transform:"rotate(-90deg)",transformOrigin:"50% 50% 0",width:1.2*l.FontSize.TITLE,flexShrink:1},flamechartLabelBottom:{transform:"rotate(-90deg)",display:"flex",justifyContent:"flex-end"},callersAndCallees:{flex:1,borderLeft:`${l.Sizes.SEPARATOR_HEIGHT}px solid ${l.Colors.LIGHT_GRAY}`},divider:{height:2,background:l.Colors.LIGHT_GRAY}}),d=exports.SandwichViewContainer=(0,s.createContainer)(n,(e,t,a)=>{const{activeProfileState:l,glCanvas:s}=a,{sandwichViewState:i,index:o}=l,{callerCallee:n}=i;return{activeProfileState:l,glCanvas:s,setSelectedFrame:e=>{t(r.actions.sandwichView.setSelectedFrame({profileIndex:o,args:e}))},selectedFrame:n?n.selectedFrame:null,profileIndex:o}});
},{"aphrodite":68,"./profile-table-view":55,"preact":24,"./style":79,"../store/actions":40,"../lib/typed-redux":36,"./inverted-caller-flamegraph-view":137,"./callee-flamegraph-view":138}],140:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ByteFormatter=exports.TimeFormatter=exports.RawValueFormatter=void 0;var t=require("./utils");class e{constructor(){this.unit="none"}format(t){return t.toLocaleString()}}exports.RawValueFormatter=e;class r{constructor(t){this.unit=t,this.multiplier="nanoseconds"===t?1e-9:"microseconds"===t?1e-6:"milliseconds"===t?.001:1}formatUnsigned(e){const r=e*this.multiplier;if(r/60>=1){const e=Math.floor(r/60),o=Math.floor(r-60*e).toString();return`${e}:${(0,t.zeroPad)(o,2)}`}return r/1>=1?`${r.toFixed(2)}s`:r/.001>=1?`${(r/.001).toFixed(2)}ms`:r/1e-6>=1?`${(r/1e-6).toFixed(2)}µs`:`${(r/1e-9).toFixed(2)}ns`}format(t){return`${t<0?"-":""}${this.formatUnsigned(Math.abs(t))}`}}exports.TimeFormatter=r;class o{constructor(){this.unit="bytes"}format(t){return t<1024?`${t.toFixed(0)} B`:(t/=1024)<1024?`${t.toFixed(2)} KB`:(t/=1024)<1024?`${t.toFixed(2)} MB`:`${(t/=1024).toFixed(2)} GB`}}exports.ByteFormatter=o;
},{"./utils":70}],145:[function(require,module,exports) {
var t=null;function r(){return t||(t=e()),t}function e(){try{throw new Error}catch(r){var t=(""+r.stack).match(/(https?|file|ftp):\/\/[^)\n]+/g);if(t)return n(t[0])}return"/"}function n(t){return(""+t).replace(/^((?:https?|file|ftp):\/\/.+)\/[^\/]+$/,"$1")+"/"}exports.getBundleURL=r,exports.getBaseURL=n;
},{}],66:[function(require,module,exports) {
var r=require("./bundle-url").getBundleURL;function e(r){Array.isArray(r)||(r=[r]);var e=r[r.length-1];try{return Promise.resolve(require(e))}catch(n){if("MODULE_NOT_FOUND"===n.code)return new u(function(n,i){t(r.slice(0,-1)).then(function(){return require(e)}).then(n,i)});throw n}}function t(r){return Promise.all(r.map(s))}var n={};function i(r,e){n[r]=e}module.exports=exports=e,exports.load=t,exports.register=i;var o={};function s(e){var t;if(Array.isArray(e)&&(t=e[1],e=e[0]),o[e])return o[e];var i=(e.substring(e.lastIndexOf(".")+1,e.length)||e).toLowerCase(),s=n[i];return s?o[e]=s(r()+e).then(function(r){return r&&module.bundle.register(t,r),r}):void 0}function u(r){this.executor=r,this.promise=null}u.prototype.then=function(r,e){return null===this.promise&&(this.promise=new Promise(this.executor)),this.promise.then(r,e)},u.prototype.catch=function(r){return null===this.promise&&(this.promise=new Promise(this.executor)),this.promise.catch(r)};
},{"./bundle-url":145}],139:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.CallTreeProfileBuilder=exports.StackListProfileBuilder=exports.Profile=exports.CallTreeNode=exports.Frame=exports.HasWeights=void 0;var e=require("./utils"),t=require("./value-formatters"),s=function(e,t,s,r){return new(s||(s=Promise))(function(a,i){function l(e){try{h(r.next(e))}catch(e){i(e)}}function o(e){try{h(r.throw(e))}catch(e){i(e)}}function h(e){e.done?a(e.value):new s(function(t){t(e.value)}).then(l,o)}h((r=r.apply(e,t||[])).next())})};const r=require("_bundle_loader")(require.resolve("./demangle-cpp"));r.then(()=>{});class a{constructor(){this.selfWeight=0,this.totalWeight=0}getSelfWeight(){return this.selfWeight}getTotalWeight(){return this.totalWeight}addToTotalWeight(e){this.totalWeight+=e}addToSelfWeight(e){this.selfWeight+=e}overwriteWeightWith(e){this.selfWeight=e.selfWeight,this.totalWeight=e.totalWeight}}exports.HasWeights=a;class i extends a{constructor(e){super(),this.key=e.key,this.name=e.name,this.file=e.file,this.line=e.line,this.col=e.col}static getOrInsert(e,t){return e.getOrInsert(new i(t))}}exports.Frame=i,i.root=new i({key:"(speedscope root)",name:"(speedscope root)"});class l extends a{constructor(e,t){super(),this.frame=e,this.parent=t,this.children=[],this.frozen=!1}isRoot(){return this.frame===i.root}isFrozen(){return this.frozen}freeze(){this.frozen=!0}}exports.CallTreeNode=l;class o{constructor(s=0){this.name="",this.frames=new e.KeyedSet,this.appendOrderCalltreeRoot=new l(i.root,null),this.groupedCalltreeRoot=new l(i.root,null),this.samples=[],this.weights=[],this.valueFormatter=new t.RawValueFormatter,this.totalNonIdleWeight=null,this.totalWeight=s}getAppendOrderCalltreeRoot(){return this.appendOrderCalltreeRoot}getGroupedCalltreeRoot(){return this.groupedCalltreeRoot}formatValue(e){return this.valueFormatter.format(e)}setValueFormatter(e){this.valueFormatter=e}getWeightUnit(){return this.valueFormatter.unit}getName(){return this.name}setName(e){this.name=e}getTotalWeight(){return this.totalWeight}getTotalNonIdleWeight(){return null===this.totalNonIdleWeight&&(this.totalNonIdleWeight=this.groupedCalltreeRoot.children.reduce((e,t)=>e+t.getTotalWeight(),0)),this.totalNonIdleWeight}forEachCallGrouped(e,t){!function s(r,a){r.frame!==i.root&&e(r,a);let l=0;const o=[...r.children];o.sort((e,t)=>e.getTotalWeight()>t.getTotalWeight()?-1:1),o.forEach(function(e){s(e,a+l),l+=e.getTotalWeight()}),r.frame!==i.root&&t(r,a+r.getTotalWeight())}(this.groupedCalltreeRoot,0)}forEachCall(t,s){let r=[],a=0,l=0;for(let o of this.samples){let h=null;for(h=o;h&&h.frame!=i.root&&-1===r.indexOf(h);h=h.parent);for(;r.length>0&&(0,e.lastOf)(r)!=h;){s(r.pop(),a)}const n=[];for(let e=o;e&&e.frame!=i.root&&e!=h;e=e.parent)n.push(e);n.reverse();for(let e of n)t(e,a);r=r.concat(n),a+=this.weights[l++]}for(let e=r.length-1;e>=0;e--)s(r[e],a)}forEachFrame(e){this.frames.forEach(e)}forEachSample(e){for(let t=0;t<this.samples.length;t++)e(this.samples[t],this.weights[t])}getProfileWithRecursionFlattened(){const e=new n,t=[],s=new Set;this.forEachCall(function(r,a){s.has(r.frame)?t.push(null):(s.add(r.frame),t.push(r),e.enterFrame(r.frame,a))},function(r,a){const i=t.pop();i&&(s.delete(i.frame),e.leaveFrame(i.frame,a))});const r=e.build();return r.name=this.name,r.valueFormatter=this.valueFormatter,this.forEachFrame(e=>{r.frames.getOrInsert(e).overwriteWeightWith(e)}),r}getInvertedProfileForCallersOf(e){const t=i.getOrInsert(this.frames,e),s=new h,r=[];!function e(s){if(s.frame===t)r.push(s);else for(let t of s.children)e(t)}(this.appendOrderCalltreeRoot);for(let e of r){const t=[];for(let s=e;null!=s&&s.frame!==i.root;s=s.parent)t.push(s.frame);s.appendSampleWithWeight(t,e.getTotalWeight())}const a=s.build();return a.name=this.name,a.valueFormatter=this.valueFormatter,a}getProfileForCalleesOf(e){const t=i.getOrInsert(this.frames,e),s=new h;!function e(r){if(r.frame===t)!function(e){const t=[];!function e(r){t.push(r.frame),s.appendSampleWithWeight(t,r.getSelfWeight());for(let t of r.children)e(t);t.pop()}(e)}(r);else for(let t of r.children)e(t)}(this.appendOrderCalltreeRoot);const r=s.build();return r.name=this.name,r.valueFormatter=this.valueFormatter,r}demangle(){return s(this,void 0,void 0,function*(){let e=null;for(let t of this.frames)t.name.startsWith("__Z")&&(e||(e=(yield r).demangleCpp),t.name=e(t.name))})}remapNames(e){for(let t of this.frames)t.name=e(t.name)}}exports.Profile=o;class h extends o{constructor(){super(...arguments),this.pendingSample=null}_appendSample(t,s,r){if(isNaN(s))throw new Error("invalid weight");let a=r?this.appendOrderCalltreeRoot:this.groupedCalltreeRoot,o=new Set;for(let h of t){const t=i.getOrInsert(this.frames,h),n=r?(0,e.lastOf)(a.children):a.children.find(e=>e.frame===t);if(n&&!n.isFrozen()&&n.frame==t)a=n;else{const e=a;a=new l(t,a),e.children.push(a)}a.addToTotalWeight(s),o.add(a.frame)}if(a.addToSelfWeight(s),r)for(let e of a.children)e.freeze();if(r){a.frame.addToSelfWeight(s);for(let e of o)e.addToTotalWeight(s);a===(0,e.lastOf)(this.samples)?this.weights[this.weights.length-1]+=s:(this.samples.push(a),this.weights.push(s))}}appendSampleWithWeight(e,t){if(0!==t){if(t<0)throw new Error("Samples must have positive weights");this._appendSample(e,t,!0),this._appendSample(e,t,!1)}}appendSampleWithTimestamp(e,t){if(this.pendingSample){if(t<this.pendingSample.centralTimestamp)throw new Error("Timestamps received out of order");const s=(t+this.pendingSample.centralTimestamp)/2;this.appendSampleWithWeight(this.pendingSample.stack,s-this.pendingSample.startTimestamp),this.pendingSample={stack:e,startTimestamp:s,centralTimestamp:t}}else this.pendingSample={stack:e,startTimestamp:t,centralTimestamp:t}}build(){return this.pendingSample&&(this.samples.length>0?this.appendSampleWithWeight(this.pendingSample.stack,this.pendingSample.centralTimestamp-this.pendingSample.startTimestamp):(this.appendSampleWithWeight(this.pendingSample.stack,1),this.setValueFormatter(new t.RawValueFormatter))),this.totalWeight=Math.max(this.totalWeight,this.weights.reduce((e,t)=>e+t,0)),this}}exports.StackListProfileBuilder=h;class n extends o{constructor(){super(...arguments),this.appendOrderStack=[this.appendOrderCalltreeRoot],this.groupedOrderStack=[this.groupedCalltreeRoot],this.framesInStack=new Map,this.stack=[],this.lastValue=0}addWeightsToFrames(t){const s=t-this.lastValue;for(let e of this.framesInStack.keys())e.addToTotalWeight(s);const r=(0,e.lastOf)(this.stack);r&&r.addToSelfWeight(s)}addWeightsToNodes(t,s){const r=t-this.lastValue;for(let e of s)e.addToTotalWeight(r);const a=(0,e.lastOf)(s);a&&a.addToSelfWeight(r)}_enterFrame(t,s,r){let a=r?this.appendOrderStack:this.groupedOrderStack;this.addWeightsToNodes(s,a);let i=(0,e.lastOf)(a);if(i){if(r){const e=s-this.lastValue;if(e>0)this.samples.push(i),this.weights.push(s-this.lastValue);else if(e<0)throw new Error(`Samples must be provided in increasing order of cumulative value. Last sample was ${this.lastValue}, this sample was ${s}`)}const o=r?(0,e.lastOf)(i.children):i.children.find(e=>e.frame===t);let h;o&&!o.isFrozen()&&o.frame==t?h=o:(h=new l(t,i),i.children.push(h)),a.push(h)}}enterFrame(e,t){const s=i.getOrInsert(this.frames,e);this.addWeightsToFrames(t),this._enterFrame(s,t,!0),this._enterFrame(s,t,!1),this.stack.push(s);const r=this.framesInStack.get(s)||0;this.framesInStack.set(s,r+1),this.lastValue=t}_leaveFrame(e,t,s){let r=s?this.appendOrderStack:this.groupedOrderStack;if(this.addWeightsToNodes(t,r),s){const s=this.appendOrderStack.pop();if(null==s)throw new Error(`Trying to leave ${e.key} when stack is empty`);if(null==this.lastValue)throw new Error(`Trying to leave a ${e.key} before any have been entered`);s.freeze();const r=t-this.lastValue;if(r>0)this.samples.push(s),this.weights.push(t-this.lastValue);else if(r<0)throw new Error(`Samples must be provided in increasing order of cumulative value. Last sample was ${this.lastValue}, this sample was ${t}`)}else this.groupedOrderStack.pop()}leaveFrame(e,t){const s=i.getOrInsert(this.frames,e);this.addWeightsToFrames(t),this._leaveFrame(s,t,!0),this._leaveFrame(s,t,!1),this.stack.pop();const r=this.framesInStack.get(s);null!=r&&(1===r?this.framesInStack.delete(s):this.framesInStack.set(s,r-1),this.lastValue=t,this.totalWeight=Math.max(this.totalWeight,this.lastValue))}build(){if(this.appendOrderStack.length>1||this.groupedOrderStack.length>1)throw new Error("Tried to complete profile construction with a non-empty stack");return this}}exports.CallTreeProfileBuilder=n;
},{"./utils":70,"./value-formatters":140,"_bundle_loader":66,"./demangle-cpp":[["demangle-cpp.8a387750.js",180],"demangle-cpp.8a387750.map",180]}],141:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=exports.FileFormat=void 0;!function(e){let t,o;!function(e){e.EVENTED="evented",e.SAMPLED="sampled"}(t=e.ProfileType||(e.ProfileType={})),function(e){e.OPEN_FRAME="O",e.CLOSE_FRAME="C"}(o=e.EventType||(e.EventType={}))}(e||(exports.FileFormat=e={}));
},{}],19:[function(require,module,exports) {
module.exports={name:"speedscope",version:"1.5.3",description:"",repository:"jlfwong/speedscope",main:"index.js",bin:{speedscope:"./bin/cli.js"},scripts:{deploy:"./scripts/deploy.sh",prepack:"./scripts/build-release.sh",prettier:"prettier --write 'src/**/*.ts' 'src/**/*.tsx'",lint:"eslint 'src/**/*.ts' 'src/**/*.tsx'",jest:"./scripts/test-setup.sh && jest --runInBand",coverage:"npm run jest -- --coverage && coveralls < coverage/lcov.info",test:"tsc --noEmit && npm run lint && npm run coverage",serve:"parcel assets/index.html --open --no-autoinstall"},files:["bin/cli.js","dist/release/**","!*.map"],browserslist:["last 2 Chrome versions","last 2 Firefox versions"],author:"",license:"MIT",devDependencies:{"@types/jest":"22.2.3","@types/jszip":"3.1.4","@types/node":"10.1.4","@types/pako":"1.0.0",aphrodite:"2.1.0",coveralls:"3.0.1",eslint:"4.19.1","eslint-plugin-prettier":"2.6.0",jest:"24.3.0",jsverify:"0.8.3",jszip:"3.1.5",pako:"1.0.6","parcel-bundler":"1.9.2",preact:"8.2.7","preact-redux":"jlfwong/preact-redux#a56dcc4",prettier:"1.12.0",protobufjs:"6.8.8",quicktype:"15.0.209",redux:"^4.0.0","ts-jest":"24.3.0",typescript:"3.2.4","typescript-eslint-parser":"17.0.1","uglify-es":"3.2.2"},jest:{transform:{"^.+\\.tsx?$":"ts-jest"},testRegex:"\\.test\\.tsx?$",collectCoverageFrom:["**/*.{ts,tsx}","!**/*.d.{ts,tsx}"],moduleFileExtensions:["ts","tsx","js","jsx","json"]},dependencies:{opn:"5.3.0"}};
},{}],83:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.exportProfileGroup=r,exports.importSpeedscopeProfiles=s,exports.saveToFile=l;var e=require("./profile"),t=require("./value-formatters"),n=require("./file-format-spec");function r(e){const t=[],n=new Map;function r(e){let r=n.get(e);if(null==r){const o={name:e.name};null!=e.file&&(o.file=e.file),null!=e.line&&(o.line=e.line),null!=e.col&&(o.col=e.col),r=t.length,n.set(e,r),t.push(o)}return r}const a={exporter:`speedscope@${require("../../package.json").version}`,name:e.name,activeProfileIndex:e.indexToView,$schema:"https://www.speedscope.app/file-format-schema.json",shared:{frames:t},profiles:[]};for(let t of e.profiles)a.profiles.push(o(t,r));return a}function o(e,t){const r={type:n.FileFormat.ProfileType.EVENTED,name:e.getName(),unit:e.getWeightUnit(),startValue:0,endValue:e.getTotalWeight(),events:[]};return e.forEachCall((e,o)=>{r.events.push({type:n.FileFormat.EventType.OPEN_FRAME,frame:t(e.frame),at:o})},(e,o)=>{r.events.push({type:n.FileFormat.EventType.CLOSE_FRAME,frame:t(e.frame),at:o})}),r}function a(r,o){function a(e){const{name:n,unit:o}=r;switch(o){case"nanoseconds":case"microseconds":case"milliseconds":case"seconds":e.setValueFormatter(new t.TimeFormatter(o));break;case"bytes":e.setValueFormatter(new t.ByteFormatter);break;case"none":e.setValueFormatter(new t.RawValueFormatter)}e.setName(n)}switch(r.type){case n.FileFormat.ProfileType.EVENTED:return function(t){const{startValue:r,endValue:s,events:l}=t,i=new e.CallTreeProfileBuilder(s-r);a(i);const c=o.map((e,t)=>Object.assign({key:t},e));for(let e of l)switch(e.type){case n.FileFormat.EventType.OPEN_FRAME:i.enterFrame(c[e.frame],e.at-r);break;case n.FileFormat.EventType.CLOSE_FRAME:i.leaveFrame(c[e.frame],e.at-r)}return i.build()}(r);case n.FileFormat.ProfileType.SAMPLED:return function(t){const{startValue:n,endValue:r,samples:s,weights:l}=t,i=new e.StackListProfileBuilder(r-n);a(i);const c=o.map((e,t)=>Object.assign({key:t},e));if(s.length!==l.length)throw new Error(`Expected samples.length (${s.length}) to equal weights.length (${l.length})`);for(let e=0;e<s.length;e++){const t=s[e],n=l[e];i.appendSampleWithWeight(t.map(e=>c[e]),n)}return i.build()}(r)}}function s(e){return{name:e.name||e.profiles[0].name||"profile",indexToView:e.activeProfileIndex||0,profiles:e.profiles.map(t=>a(t,e.shared.frames))}}function l(e){const t=r(e),n=new Blob([JSON.stringify(t)],{type:"text/json"}),o=`${(t.name?t.name.split(".")[0]:"profile").replace(/\W+/g,"_")}.speedscope.json`;console.log("Saving",o);const a=document.createElement("a");a.download=o,a.href=window.URL.createObjectURL(n),a.dataset.downloadurl=["text/json",a.download,a.href].join(":"),document.body.appendChild(a),a.click(),document.body.removeChild(a)}
},{"./profile":139,"./value-formatters":140,"./file-format-spec":141,"../../package.json":19}],64:[function(require,module,exports) {
module.exports="perf-vertx-stacks-01-collapsed-all.3e0a632c.txt";
},{}],34:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.Application=exports.GLCanvas=exports.Toolbar=void 0;var e=require("preact"),t=require("aphrodite"),o=require("./style"),i=require("../lib/emscripten"),s=require("./sandwich-view"),r=require("../lib/file-format"),n=require("../store"),a=require("../lib/typed-redux"),l=require("./flamechart-view-container"),c=require("../gl/graphics"),d=function(e,t,o,i){return new(o||(o=Promise))(function(s,r){function n(e){try{l(i.next(e))}catch(e){r(e)}}function a(e){try{l(i.throw(e))}catch(e){r(e)}}function l(e){e.done?s(e.value):new o(function(t){t(e.value)}).then(n,a)}l((i=i.apply(e,t||[])).next())})};const p=require("_bundle_loader")(require.resolve("../import"));function h(e,t){return d(this,void 0,void 0,function*(){return(yield p).importProfileGroupFromText(e,t)})}function f(e,t){return d(this,void 0,void 0,function*(){return(yield p).importProfileGroupFromBase64(e,t)})}function m(e,t){return d(this,void 0,void 0,function*(){return(yield p).importProfilesFromArrayBuffer(e,t)})}function u(e){return d(this,void 0,void 0,function*(){return(yield p).importProfilesFromFile(e)})}function v(e){return d(this,void 0,void 0,function*(){return(yield p).importFromFileSystemDirectoryEntry(e)})}p.then(()=>{});const g=require("../../sample/profiles/stackcollapse/perf-vertx-stacks-01-collapsed-all.txt");class w extends a.StatelessComponent{constructor(){super(...arguments),this.setTimeOrder=(()=>{this.props.setViewMode(n.ViewMode.CHRONO_FLAME_CHART)}),this.setLeftHeavyOrder=(()=>{this.props.setViewMode(n.ViewMode.LEFT_HEAVY_FLAME_GRAPH)}),this.setSandwichView=(()=>{this.props.setViewMode(n.ViewMode.SANDWICH_VIEW)})}renderLeftContent(){return this.props.activeProfileState?(0,e.h)("div",{className:(0,t.css)(y.toolbarLeft)},(0,e.h)("div",{className:(0,t.css)(y.toolbarTab,this.props.viewMode===n.ViewMode.CHRONO_FLAME_CHART&&y.toolbarTabActive),onClick:this.setTimeOrder},(0,e.h)("span",{className:(0,t.css)(y.emoji)},"🕰"),"Time Order"),(0,e.h)("div",{className:(0,t.css)(y.toolbarTab,this.props.viewMode===n.ViewMode.LEFT_HEAVY_FLAME_GRAPH&&y.toolbarTabActive),onClick:this.setLeftHeavyOrder},(0,e.h)("span",{className:(0,t.css)(y.emoji)},"⬅️"),"Left Heavy"),(0,e.h)("div",{className:(0,t.css)(y.toolbarTab,this.props.viewMode===n.ViewMode.SANDWICH_VIEW&&y.toolbarTabActive),onClick:this.setSandwichView},(0,e.h)("span",{className:(0,t.css)(y.emoji)},"🥪"),"Sandwich")):null}renderCenterContent(){const{activeProfileState:o,profileGroup:i}=this.props;if(o&&i){const{index:r}=o;if(1===i.profiles.length)return o.profile.getName();{function s(o,i,s){return(0,e.h)("button",{disabled:i,onClick:s,className:(0,t.css)(y.emoji,y.toolbarProfileNavButton,i&&y.toolbarProfileNavButtonDisabled)},o)}const n=s("⬅️",0===r,()=>this.props.setProfileIndexToView(r-1)),a=s("➡️",r>=i.profiles.length-1,()=>this.props.setProfileIndexToView(r+1));return(0,e.h)("div",{className:(0,t.css)(y.toolbarCenter)},n,o.profile.getName()," ",(0,e.h)("span",{className:(0,t.css)(y.toolbarProfileIndex)},"(",o.index+1,"/",i.profiles.length,")"),a)}}return"🔬speedscope"}renderRightContent(){const o=(0,e.h)("div",{className:(0,t.css)(y.toolbarTab),onClick:this.props.browseForFile},(0,e.h)("span",{className:(0,t.css)(y.emoji)},"⤵️"),"Import"),i=(0,e.h)("div",{className:(0,t.css)(y.toolbarTab)},(0,e.h)("a",{href:"https://github.com/jlfwong/speedscope#usage",className:(0,t.css)(y.noLinkStyle),target:"_blank"},(0,e.h)("span",{className:(0,t.css)(y.emoji)},"❓"),"Help"));return(0,e.h)("div",{className:(0,t.css)(y.toolbarRight)},this.props.activeProfileState&&(0,e.h)("div",{className:(0,t.css)(y.toolbarTab),onClick:this.props.saveFile},(0,e.h)("span",{className:(0,t.css)(y.emoji)},"⤴️"),"Export"),o,i)}render(){return(0,e.h)("div",{className:(0,t.css)(y.toolbar)},this.renderLeftContent(),this.renderCenterContent(),this.renderRightContent())}}exports.Toolbar=w;class b extends e.Component{constructor(){super(...arguments),this.canvas=null,this.ref=(e=>{e instanceof HTMLCanvasElement?this.canvas=e:this.canvas=null,this.props.setGLCanvas(this.canvas)}),this.container=null,this.containerRef=(e=>{e instanceof HTMLElement?this.container=e:this.container=null}),this.maybeResize=(()=>{if(!this.container)return;if(!this.props.canvasContext)return;let{width:e,height:t}=this.container.getBoundingClientRect();const o=e,i=t,s=e*window.devicePixelRatio,r=t*window.devicePixelRatio;this.props.canvasContext.gl.resize(s,r,o,i),this.props.canvasContext.gl.clear(new c.Graphics.Color(1,1,1,1))}),this.onWindowResize=(()=>{this.props.canvasContext&&this.props.canvasContext.requestFrame()})}componentWillReceiveProps(e){this.props.canvasContext!==e.canvasContext&&(this.props.canvasContext&&this.props.canvasContext.removeBeforeFrameHandler(this.maybeResize),e.canvasContext&&(e.canvasContext.addBeforeFrameHandler(this.maybeResize),e.canvasContext.requestFrame()))}componentDidMount(){window.addEventListener("resize",this.onWindowResize)}componentWillUnmount(){this.props.canvasContext&&this.props.canvasContext.removeBeforeFrameHandler(this.maybeResize),window.removeEventListener("resize",this.onWindowResize)}render(){return(0,e.h)("div",{ref:this.containerRef,className:(0,t.css)(y.glCanvasView)},(0,e.h)("canvas",{ref:this.ref,width:1,height:1}))}}exports.GLCanvas=b;class C extends a.StatelessComponent{constructor(){super(...arguments),this.loadExample=(()=>{this.loadProfile(()=>d(this,void 0,void 0,function*(){return yield h("perf-vertx-stacks-01-collapsed-all.txt",yield fetch(g).then(e=>e.text()))}))}),this.onDrop=(e=>{if(this.props.setDragActive(!1),e.preventDefault(),!e.dataTransfer)return;const t=e.dataTransfer.items[0];if("webkitGetAsEntry"in t){const e=t.webkitGetAsEntry();if(e.isDirectory&&e.name.endsWith(".trace"))return console.log("Importing as Instruments.app .trace file"),void this.loadProfile(()=>d(this,void 0,void 0,function*(){return yield v(e)}))}let o=e.dataTransfer.files.item(0);o&&this.loadFromFile(o)}),this.onDragOver=(e=>{this.props.setDragActive(!0),e.preventDefault()}),this.onDragLeave=(e=>{this.props.setDragActive(!1),e.preventDefault()}),this.onWindowKeyPress=(e=>d(this,void 0,void 0,function*(){if("1"===e.key)this.props.setViewMode(n.ViewMode.CHRONO_FLAME_CHART);else if("2"===e.key)this.props.setViewMode(n.ViewMode.LEFT_HEAVY_FLAME_GRAPH);else if("3"===e.key)this.props.setViewMode(n.ViewMode.SANDWICH_VIEW);else if("r"===e.key){const{flattenRecursion:e}=this.props;this.props.setFlattenRecursion(!e)}else if("n"===e.key){const{activeProfileState:e}=this.props;e&&this.props.setProfileIndexToView(e.index+1)}else if("p"===e.key){const{activeProfileState:e}=this.props;e&&this.props.setProfileIndexToView(e.index-1)}})),this.saveFile=(()=>{if(this.props.profileGroup){const{name:e,indexToView:t,profiles:o}=this.props.profileGroup,i={name:e,indexToView:t,profiles:o.map(e=>e.profile)};(0,r.saveToFile)(i)}}),this.browseForFile=(()=>{const e=document.createElement("input");e.type="file",e.addEventListener("change",this.onFileSelect),e.click()}),this.onWindowKeyDown=(e=>d(this,void 0,void 0,function*(){"s"===e.key&&(e.ctrlKey||e.metaKey)?(e.preventDefault(),this.saveFile()):"o"===e.key&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),this.browseForFile())})),this.onDocumentPaste=(e=>{e.preventDefault(),e.stopPropagation();const t=e.clipboardData;if(!t)return;const o=t.getData("text");this.loadProfile(()=>d(this,void 0,void 0,function*(){return yield h("From Clipboard",o)}))}),this.onFileSelect=(e=>{const t=e.target.files.item(0);t&&this.loadFromFile(t)})}loadProfile(e){return d(this,void 0,void 0,function*(){if(this.props.setLoading(!0),yield new Promise(e=>setTimeout(e,0)),!this.props.glCanvas)return;console.time("import");let t=null;try{t=yield e()}catch(e){return console.log("Failed to load format",e),void this.props.setError(!0)}if(null==t)return alert("Unrecognized format! See documentation about supported formats."),void this.props.setLoading(!1);if(0===t.profiles.length)return alert("Successfully imported profile, but it's empty!"),void this.props.setLoading(!1);this.props.hashParams.title&&(t=Object.assign({name:this.props.hashParams.title},t)),document.title=`${t.name} - speedscope`;for(let e of t.profiles)yield e.demangle();for(let e of t.profiles){const t=this.props.hashParams.title||e.getName();e.setName(t)}console.timeEnd("import"),this.props.setProfileGroup(t),this.props.setLoading(!1)})}loadFromFile(e){this.loadProfile(()=>d(this,void 0,void 0,function*(){const t=yield u(e);if(t){for(let o of t.profiles)o.getName()||o.setName(e.name);return t}if(this.props.profileGroup&&this.props.activeProfileState){const t=new FileReader,o=new Promise(e=>{t.addEventListener("loadend",()=>{if("string"!=typeof t.result)throw new Error("Expected reader.result to be a string");e(t.result)})});t.readAsText(e);const s=yield o,r=(0,i.importEmscriptenSymbolMap)(s);if(r){const{profile:e,index:t}=this.props.activeProfileState;return console.log("Importing as emscripten symbol map"),e.remapNames(e=>r.get(e)||e),{name:this.props.profileGroup.name||"profile",indexToView:t,profiles:[e]}}}return null}))}componentDidMount(){window.addEventListener("keydown",this.onWindowKeyDown),window.addEventListener("keypress",this.onWindowKeyPress),document.addEventListener("paste",this.onDocumentPaste),this.maybeLoadHashParamProfile()}componentWillUnmount(){window.removeEventListener("keydown",this.onWindowKeyDown),window.removeEventListener("keypress",this.onWindowKeyPress),document.removeEventListener("paste",this.onDocumentPaste)}maybeLoadHashParamProfile(){return d(this,void 0,void 0,function*(){if(this.props.hashParams.profileURL){if(!n.canUseXHR)return void alert(`Cannot load a profile URL when loading from "${window.location.protocol}" URL protocol`);this.loadProfile(()=>d(this,void 0,void 0,function*(){const e=yield fetch(this.props.hashParams.profileURL);let t=new URL(this.props.hashParams.profileURL).pathname;return t.includes("/")&&(t=t.slice(t.lastIndexOf("/")+1)),yield m(t,yield e.arrayBuffer())}))}else if(this.props.hashParams.localProfilePath){window.speedscope={loadFileFromBase64:(e,t)=>{this.loadProfile(()=>f(e,t))}};const e=document.createElement("script");e.src=`file:///${this.props.hashParams.localProfilePath}`,document.head.appendChild(e)}})}renderLanding(){return(0,e.h)("div",{className:(0,t.css)(y.landingContainer)},(0,e.h)("div",{className:(0,t.css)(y.landingMessage)},(0,e.h)("p",{className:(0,t.css)(y.landingP)},"👋 Hi there! Welcome to 🔬speedscope, an interactive"," ",(0,e.h)("a",{className:(0,t.css)(y.link),href:"http://www.brendangregg.com/FlameGraphs/cpuflamegraphs.html"},"flamegraph")," ","visualizer. Use it to help you make your software faster."),n.canUseXHR?(0,e.h)("p",{className:(0,t.css)(y.landingP)},"Drag and drop a profile file onto this window to get started, click the big blue button below to browse for a profile to explore, or"," ",(0,e.h)("a",{tabIndex:0,className:(0,t.css)(y.link),onClick:this.loadExample},"click here")," ","to load an example profile."):(0,e.h)("p",{className:(0,t.css)(y.landingP)},"Drag and drop a profile file onto this window to get started, or click the big blue button below to browse for a profile to explore."),(0,e.h)("div",{className:(0,t.css)(y.browseButtonContainer)},(0,e.h)("input",{type:"file",name:"file",id:"file",onChange:this.onFileSelect,className:(0,t.css)(y.hide)}),(0,e.h)("label",{for:"file",className:(0,t.css)(y.browseButton),tabIndex:0},"Browse")),(0,e.h)("p",{className:(0,t.css)(y.landingP)},"See the"," ",(0,e.h)("a",{className:(0,t.css)(y.link),href:"https://github.com/jlfwong/speedscope#usage",target:"_blank"},"documentation")," ","for information about supported file formats, keyboard shortcuts, and how to navigate around the profile."),(0,e.h)("p",{className:(0,t.css)(y.landingP)},"speedscope is open source. Please"," ",(0,e.h)("a",{className:(0,t.css)(y.link),target:"_blank",href:"https://github.com/jlfwong/speedscope/issues"},"report any issues on GitHub"),".")))}renderError(){return(0,e.h)("div",{className:(0,t.css)(y.error)},(0,e.h)("div",null,"😿 Something went wrong."),(0,e.h)("div",null,"Check the JS console for more details."))}renderLoadingBar(){return(0,e.h)("div",{className:(0,t.css)(y.loading)})}renderContent(){const{viewMode:t,activeProfileState:o,error:i,loading:r,glCanvas:a}=this.props;if(i)return this.renderError();if(r)return this.renderLoadingBar();if(!o||!a)return this.renderLanding();switch(t){case n.ViewMode.CHRONO_FLAME_CHART:return(0,e.h)(l.ChronoFlamechartView,{activeProfileState:o,glCanvas:a});case n.ViewMode.LEFT_HEAVY_FLAME_GRAPH:return(0,e.h)(l.LeftHeavyFlamechartView,{activeProfileState:o,glCanvas:a});case n.ViewMode.SANDWICH_VIEW:return(0,e.h)(s.SandwichViewContainer,{activeProfileState:o,glCanvas:a})}}render(){return(0,e.h)("div",{onDrop:this.onDrop,onDragOver:this.onDragOver,onDragLeave:this.onDragLeave,className:(0,t.css)(y.root,this.props.dragActive&&y.dragTargetRoot)},(0,e.h)(b,{setGLCanvas:this.props.setGLCanvas,canvasContext:this.props.canvasContext}),(0,e.h)(w,Object.assign({saveFile:this.saveFile,browseForFile:this.browseForFile},this.props)),(0,e.h)("div",{className:(0,t.css)(y.contentContainer)},this.renderContent()),this.props.dragActive&&(0,e.h)("div",{className:(0,t.css)(y.dragTarget)}))}}exports.Application=C;const y=t.StyleSheet.create({glCanvasView:{position:"absolute",width:"100vw",height:"100vh",zIndex:-1,pointerEvents:"none"},error:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%"},loading:{height:3,marginBottom:-3,background:o.Colors.DARK_BLUE,transformOrigin:"0% 50%",animationName:[{from:{transform:"scaleX(0)"},to:{transform:"scaleX(1)"}}],animationTimingFunction:"cubic-bezier(0, 1, 0, 1)",animationDuration:"30s"},root:{width:"100vw",height:"100vh",overflow:"hidden",display:"flex",flexDirection:"column",position:"relative",fontFamily:o.FontFamily.MONOSPACE,lineHeight:"20px"},dragTargetRoot:{cursor:"copy"},dragTarget:{boxSizing:"border-box",position:"absolute",top:0,left:0,width:"100%",height:"100%",border:`5px dashed ${o.Colors.DARK_BLUE}`,pointerEvents:"none"},contentContainer:{position:"relative",display:"flex",overflow:"hidden",flexDirection:"column",flex:1},landingContainer:{display:"flex",alignItems:"center",justifyContent:"center",flex:1},landingMessage:{maxWidth:600},landingP:{marginBottom:16},hide:{display:"none"},browseButtonContainer:{display:"flex",alignItems:"center",justifyContent:"center"},browseButton:{marginBottom:16,height:72,flex:1,maxWidth:256,textAlign:"center",fontSize:o.FontSize.BIG_BUTTON,lineHeight:"72px",background:o.Colors.DARK_BLUE,color:o.Colors.WHITE,transition:`all ${o.Duration.HOVER_CHANGE} ease-in`,":hover":{background:o.Colors.BRIGHT_BLUE}},link:{color:o.Colors.BRIGHT_BLUE,cursor:"pointer",textDecoration:"none"},toolbar:{height:o.Sizes.TOOLBAR_HEIGHT,flexShrink:0,background:o.Colors.BLACK,color:o.Colors.WHITE,textAlign:"center",fontFamily:o.FontFamily.MONOSPACE,fontSize:o.FontSize.TITLE,lineHeight:`${o.Sizes.TOOLBAR_TAB_HEIGHT}px`,userSelect:"none"},toolbarLeft:{position:"absolute",height:o.Sizes.TOOLBAR_HEIGHT,overflow:"hidden",top:0,left:0,marginRight:2,textAlign:"left"},toolbarCenter:{paddingTop:1,height:o.Sizes.TOOLBAR_HEIGHT},toolbarRight:{height:o.Sizes.TOOLBAR_HEIGHT,overflow:"hidden",position:"absolute",top:0,right:0,marginRight:2,textAlign:"right"},toolbarProfileIndex:{color:o.Colors.LIGHT_GRAY},toolbarProfileNavButton:{opacity:.8,fontSize:o.FontSize.TITLE,lineHeight:`${o.Sizes.TOOLBAR_TAB_HEIGHT}px`,":hover":{opacity:1},background:"none",border:"none",padding:0,marginLeft:"0.3em",marginRight:"0.3em",transition:`all ${o.Duration.HOVER_CHANGE} ease-in`},toolbarProfileNavButtonDisabled:{opacity:.5,":hover":{opacity:.5}},toolbarTab:{background:o.Colors.DARK_GRAY,marginTop:o.Sizes.SEPARATOR_HEIGHT,height:o.Sizes.TOOLBAR_TAB_HEIGHT,lineHeight:`${o.Sizes.TOOLBAR_TAB_HEIGHT}px`,paddingLeft:2,paddingRight:8,display:"inline-block",marginLeft:2,transition:`all ${o.Duration.HOVER_CHANGE} ease-in`,":hover":{background:o.Colors.GRAY}},toolbarTabActive:{background:o.Colors.BRIGHT_BLUE,":hover":{background:o.Colors.BRIGHT_BLUE}},noLinkStyle:{textDecoration:"none",color:"inherit"},emoji:{display:"inline-block",verticalAlign:"middle",paddingTop:"0px",marginRight:"0.3em"}});
},{"preact":24,"aphrodite":68,"./style":79,"../lib/emscripten":81,"./sandwich-view":60,"../lib/file-format":83,"../store":29,"../lib/typed-redux":36,"./flamechart-view-container":62,"../gl/graphics":42,"_bundle_loader":66,"../import":[["import.a03c2bef.js",104],"import.a03c2bef.map",104],"../../sample/profiles/stackcollapse/perf-vertx-stacks-01-collapsed-all.txt":64}],21:[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.ApplicationContainer=void 0;var e=require("../lib/typed-redux"),t=require("./application"),i=require("../store/getters"),o=require("../store/actions"),n=require("../gl/graphics");const r=exports.ApplicationContainer=(0,e.createContainer)(t.Application,(t,r)=>{const{flattenRecursion:s,profileGroup:a}=t;let l=null;if(a&&a.profiles.length>a.indexToView){const e=a.indexToView,t=a.profiles[e];l=Object.assign({},a.profiles[a.indexToView],{profile:(0,i.getProfileToView)({profile:t.profile,flattenRecursion:s}),index:a.indexToView})}function c(t){return(0,e.bindActionCreator)(r,t)}const p={setGLCanvas:c(o.actions.setGLCanvas),setLoading:c(o.actions.setLoading),setError:c(o.actions.setError),setProfileGroup:c(o.actions.setProfileGroup),setDragActive:c(o.actions.setDragActive),setViewMode:c(o.actions.setViewMode),setFlattenRecursion:c(o.actions.setFlattenRecursion),setProfileIndexToView:c(o.actions.setProfileIndexToView)};return Object.assign({activeProfileState:l,dispatch:r,canvasContext:t.glCanvas?(0,i.getCanvasContext)(t.glCanvas):null,resizeCanvas:(e,o,r,s)=>{if(t.glCanvas){const a=(0,i.getCanvasContext)(t.glCanvas).gl;a.resize(e,o,r,s),a.clear(new n.Graphics.Color(1,1,1,1))}}},p,t)});
},{"../lib/typed-redux":36,"./application":34,"../store/getters":38,"../store/actions":40,"../gl/graphics":42}],13:[function(require,module,exports) {
"use strict";var e=require("preact"),o=require("./store"),t=require("preact-redux"),r=require("./views/application-container");console.log(`speedscope v${require("../package.json").version}`),module.hot&&(module.hot.dispose(()=>{(0,e.render)((0,e.h)("div",null),document.body,document.body.lastElementChild||void 0)}),module.hot.accept());const i=window.store,d=(0,o.createApplicationStore)(i?i.getState():{});window.store=d,(0,e.render)((0,e.h)(t.Provider,{store:d},(0,e.h)(r.ApplicationContainer,null)),document.body,document.body.lastElementChild||void 0);
},{"preact":24,"./store":29,"preact-redux":26,"./views/application-container":21,"../package.json":19}],215:[function(require,module,exports) {
module.exports=function(n){return new Promise(function(e,o){var r=document.createElement("script");r.async=!0,r.type="text/javascript",r.charset="utf-8",r.src=n,r.onerror=function(n){r.onerror=r.onload=null,o(n)},r.onload=function(){r.onerror=r.onload=null,e()},document.getElementsByTagName("head")[0].appendChild(r)})};
},{}],0:[function(require,module,exports) {
var b=require(66);b.register("js",require(215));
},{}]},{},[0,13], null)
//# sourceMappingURL=speedscope.9ee942dd.map