!function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},n.r=function(t){Object.defineProperty(t,"__esModule",{value:!0})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=323)}([function(t,e,n){t.exports=n(313)()},function(t,e,n){"use strict";n.r(e),n.d(e,"h",function(){return s}),n.d(e,"createElement",function(){return s}),n.d(e,"cloneElement",function(){return l}),n.d(e,"Component",function(){return N}),n.d(e,"render",function(){return F}),n.d(e,"rerender",function(){return f}),n.d(e,"options",function(){return i});var i={},r=[],o=[];function s(t,e){var n,s,a,u,l=o;for(u=arguments.length;u-- >2;)r.push(arguments[u]);for(e&&null!=e.children&&(r.length||r.push(e.children),delete e.children);r.length;)if((s=r.pop())&&void 0!==s.pop)for(u=s.length;u--;)r.push(s[u]);else"boolean"==typeof s&&(s=null),(a="function"!=typeof t)&&(null==s?s="":"number"==typeof s?s=String(s):"string"!=typeof s&&(a=!1)),a&&n?l[l.length-1]+=s:l===o?l=[s]:l.push(s),n=a;var c=new function(){};return c.nodeName=t,c.children=l,c.attributes=null==e?void 0:e,c.key=null==e?void 0:e.key,void 0!==i.vnode&&i.vnode(c),c}function a(t,e){for(var n in e)t[n]=e[n];return t}var u="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout;function l(t,e){return s(t.nodeName,a(a({},t.attributes),e),arguments.length>2?[].slice.call(arguments,2):t.children)}var c=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,h=[];function p(t){!t._dirty&&(t._dirty=!0)&&1==h.push(t)&&(i.debounceRendering||u)(f)}function f(){var t,e=h;for(h=[];t=e.pop();)t._dirty&&R(t)}function d(t,e){return t.normalizedNodeName===e||t.nodeName.toLowerCase()===e.toLowerCase()}function m(t){var e=a({},t.attributes);e.children=t.children;var n=t.nodeName.defaultProps;if(void 0!==n)for(var i in n)void 0===e[i]&&(e[i]=n[i]);return e}function y(t){var e=t.parentNode;e&&e.removeChild(t)}function _(t,e,n,i,r){if("className"===e&&(e="class"),"key"===e);else if("ref"===e)n&&n(null),i&&i(t);else if("class"!==e||r)if("style"===e){if(i&&"string"!=typeof i&&"string"!=typeof n||(t.style.cssText=i||""),i&&"object"==typeof i){if("string"!=typeof n)for(var o in n)o in i||(t.style[o]="");for(var o in i)t.style[o]="number"==typeof i[o]&&!1===c.test(o)?i[o]+"px":i[o]}}else if("dangerouslySetInnerHTML"===e)i&&(t.innerHTML=i.__html||"");else if("o"==e[0]&&"n"==e[1]){var s=e!==(e=e.replace(/Capture$/,""));e=e.toLowerCase().substring(2),i?n||t.addEventListener(e,v,s):t.removeEventListener(e,v,s),(t._listeners||(t._listeners={}))[e]=i}else if("list"!==e&&"type"!==e&&!r&&e in t)!function(t,e,n){try{t[e]=n}catch(t){}}(t,e,null==i?"":i),null!=i&&!1!==i||t.removeAttribute(e);else{var a=r&&e!==(e=e.replace(/^xlink:?/,""));null==i||!1===i?a?t.removeAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase()):t.removeAttribute(e):"function"!=typeof i&&(a?t.setAttributeNS("http://www.w3.org/1999/xlink",e.toLowerCase(),i):t.setAttribute(e,i))}else t.className=i||""}function v(t){return this._listeners[t.type](i.event&&i.event(t)||t)}var g=[],b=0,w=!1,k=!1;function S(){for(var t;t=g.pop();)i.afterMount&&i.afterMount(t),t.componentDidMount&&t.componentDidMount()}function x(t,e,n,i,r,o){b++||(w=null!=r&&void 0!==r.ownerSVGElement,k=null!=t&&!("__preactattr_"in t));var s=T(t,e,n,i,o);return r&&s.parentNode!==r&&r.appendChild(s),--b||(k=!1,o||S()),s}function T(t,e,n,i,r){var o=t,s=w;if(null!=e&&"boolean"!=typeof e||(e=""),"string"==typeof e||"number"==typeof e)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||r)?t.nodeValue!=e&&(t.nodeValue=e):(o=document.createTextNode(e),t&&(t.parentNode&&t.parentNode.replaceChild(o,t),O(t,!0))),o.__preactattr_=!0,o;var a,u,l=e.nodeName;if("function"==typeof l)return function(t,e,n,i){var r=t&&t._component,o=r,s=t,a=r&&t._componentConstructor===e.nodeName,u=a,l=m(e);for(;r&&!u&&(r=r._parentComponent);)u=r.constructor===e.nodeName;r&&u&&(!i||r._component)?(M(r,l,3,n,i),t=r.base):(o&&!a&&(j(o),t=s=null),r=C(e.nodeName,l,n),t&&!r.nextBase&&(r.nextBase=t,s=null),M(r,l,1,n,i),t=r.base,s&&t!==s&&(s._component=null,O(s,!1)));return t}(t,e,n,i);if(w="svg"===l||"foreignObject"!==l&&w,l=String(l),(!t||!d(t,l))&&(a=l,(u=w?document.createElementNS("http://www.w3.org/2000/svg",a):document.createElement(a)).normalizedNodeName=a,o=u,t)){for(;t.firstChild;)o.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(o,t),O(t,!0)}var c=o.firstChild,h=o.__preactattr_,p=e.children;if(null==h){h=o.__preactattr_={};for(var f=o.attributes,v=f.length;v--;)h[f[v].name]=f[v].value}return!k&&p&&1===p.length&&"string"==typeof p[0]&&null!=c&&void 0!==c.splitText&&null==c.nextSibling?c.nodeValue!=p[0]&&(c.nodeValue=p[0]):(p&&p.length||null!=c)&&function(t,e,n,i,r){var o,s,a,u,l,c=t.childNodes,h=[],p={},f=0,m=0,_=c.length,v=0,g=e?e.length:0;if(0!==_)for(var b=0;b<_;b++){var w=c[b],k=w.__preactattr_,S=g&&k?w._component?w._component.__key:k.key:null;null!=S?(f++,p[S]=w):(k||(void 0!==w.splitText?!r||w.nodeValue.trim():r))&&(h[v++]=w)}if(0!==g)for(var b=0;b0&&void 0!==arguments[0]?arguments[0]:"store",n=arguments[1]||e+"Subscription",r=function(t){function r(n,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,r);var o=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}(this,t.call(this,n,i));return o[e]=n.store,o}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(r,t),r.prototype.getChildContext=function(){var t;return(t={})[e]=this[e],t[n]=null,t},r.prototype.render=function(){return i.a.only(this.props.children)},r}(i.b);return r.propTypes={store:a.isRequired,children:o.a.element.isRequired},r.childContextTypes=((t={})[e]=a.isRequired,t[n]=s,t),r}var l=u(),c=n(148),h=n.n(c),p=n(65),f=n.n(p);var d=null,m={notify:function(){}};var y=function(){function t(e,n,i){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.store=e,this.parentSub=n,this.onStateChange=i,this.unsubscribe=null,this.listeners=m}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(){var t,e;this.unsubscribe||(this.unsubscribe=this.parentSub?this.parentSub.addNestedSub(this.onStateChange):this.store.subscribe(this.onStateChange),this.listeners=(t=[],e=[],{clear:function(){e=d,t=d},notify:function(){for(var n=t=e,i=0;i1&&void 0!==arguments[1]?arguments[1]:{},o=r.getDisplayName,u=void 0===o?function(t){return"ConnectAdvanced("+t+")"}:o,l=r.methodName,c=void 0===l?"connectAdvanced":l,p=r.renderCountProp,d=void 0===p?void 0:p,m=r.shouldHandleStateChanges,w=void 0===m||m,k=r.storeKey,S=void 0===k?"store":k,x=r.withRef,T=void 0!==x&&x,O=function(t,e){var n={};for(var i in t)e.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}(r,["getDisplayName","methodName","renderCountProp","shouldHandleStateChanges","storeKey","withRef"]),P=S+"Subscription",A=v++,C=((e={})[S]=a,e[P]=s,e),E=((n={})[P]=s,n);return function(e){f()("function"==typeof e,"You must pass a component to the function returned by "+c+". Instead received "+JSON.stringify(e));var n=e.displayName||e.name||"Component",r=u(n),o=_({},O,{getDisplayName:u,methodName:c,renderCountProp:d,shouldHandleStateChanges:w,storeKey:S,withRef:T,displayName:r,wrappedComponentName:n,WrappedComponent:e}),s=function(n){function s(t,e){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,s);var i=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}(this,n.call(this,t,e));return i.version=A,i.state={},i.renderCount=0,i.store=t[S]||e[S],i.propsMode=Boolean(t[S]),i.setWrappedInstance=i.setWrappedInstance.bind(i),f()(i.store,'Could not find "'+S+'" in either the context or props of "'+r+'". Either wrap the root component in a , or explicitly pass "'+S+'" as a prop to "'+r+'".'),i.initSelector(),i.initSubscription(),i}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(s,n),s.prototype.getChildContext=function(){var t,e=this.propsMode?null:this.subscription;return(t={})[P]=e||this.context[P],t},s.prototype.componentDidMount=function(){w&&(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=b,this.store=null,this.selector.run=b,this.selector.shouldComponentUpdate=!1},s.prototype.getWrappedInstance=function(){return f()(T,"To access the wrapped instance, you need to specify { withRef: true } in the options argument of the "+c+"() call."),this.wrappedInstance},s.prototype.setWrappedInstance=function(t){this.wrappedInstance=t},s.prototype.initSelector=function(){var e=t(this.store.dispatch,o);this.selector=function(t,e){var n={run:function(i){try{var r=t(e.getState(),i);(r!==n.props||n.error)&&(n.shouldComponentUpdate=!0,n.props=r,n.error=null)}catch(t){n.shouldComponentUpdate=!0,n.error=t}}};return n}(e,this.store),this.selector.run(this.props)},s.prototype.initSubscription=function(){if(w){var t=(this.propsMode?this.props:this.context)[P];this.subscription=new y(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(g)):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(!(T||d||this.propsMode&&this.subscription))return t;var e=_({},t);return T&&(e.ref=this.setWrappedInstance),d&&(e[d]=this.renderCount++),this.propsMode&&this.subscription&&(e[P]=this.subscription),e},s.prototype.render=function(){var t=this.selector;if(t.shouldComponentUpdate=!1,t.error)throw t.error;return Object(i.c)(e,this.addExtraProps(t.props))},s}(i.b);return s.WrappedComponent=e,s.displayName=r,s.childContextTypes=E,s.contextTypes=C,s.propTypes=C,h()(s,e)}}var k=Object.prototype.hasOwnProperty;function S(t,e){return t===e?0!==t||0!==e||1/t==1/e:t!=t&&e!=e}function x(t,e){if(S(t,e))return!0;if("object"!=typeof t||null===t||"object"!=typeof e||null===e)return!1;var n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;for(var r=0;r=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}(e,["initMapStateToProps","initMapDispatchToProps","initMergeProps"]),s=n(t,o),a=i(t,o),u=r(t,o);return(o.pure?z:U)(s,a,u,t,o)}var W=Object.assign||function(t){for(var e=1;e=0;i--){var r=e[i](t);if(r)return r}return function(e,i){throw new Error("Invalid value of type "+typeof t+" for "+n+" argument when connecting component "+i.wrappedComponentName+".")}}function V(t,e){return t===e}var H=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=t.connectHOC,n=void 0===e?w:e,i=t.mapStateToPropsFactories,r=void 0===i?D:i,o=t.mapDispatchToPropsFactories,s=void 0===o?L:o,a=t.mergePropsFactories,u=void 0===a?B:a,l=t.selectorFactory,c=void 0===l?Y:l;return function(t,e,i){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=o.pure,l=void 0===a||a,h=o.areStatesEqual,p=void 0===h?V:h,f=o.areOwnPropsEqual,d=void 0===f?x:f,m=o.areStatePropsEqual,y=void 0===m?x:m,_=o.areMergedPropsEqual,v=void 0===_?x:_,g=function(t,e){var n={};for(var i in t)e.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}(o,["pure","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","areMergedPropsEqual"]),b=G(t,r,"mapStateToProps"),w=G(e,s,"mapDispatchToProps"),k=G(i,u,"mergeProps");return n(c,W({methodName:"connect",getDisplayName:function(t){return"Connect("+t+")"},shouldHandleStateChanges:Boolean(t),initMapStateToProps:b,initMapDispatchToProps:w,initMergeProps:k,pure:l,areStatesEqual:p,areOwnPropsEqual:d,areStatePropsEqual:y,areMergedPropsEqual:v},g))}}();n.d(e,"Provider",function(){return l}),n.d(e,"createProvider",function(){return u}),n.d(e,"connectAdvanced",function(){return w}),n.d(e,"connect",function(){return H})},function(t,e,n){"use strict";n.r(e),n.d(e,"createStore",function(){return u}),n.d(e,"combineReducers",function(){return c}),n.d(e,"bindActionCreators",function(){return p}),n.d(e,"applyMiddleware",function(){return d}),n.d(e,"compose",function(){return f}),n.d(e,"__DO_NOT_USE__ActionTypes",function(){return r});var i=n(89),r={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(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s=Object.assign||function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},e=arguments[1];if(a)throw a;for(var i=!1,r={},o=0;o0;)n[i]=arguments[i+2];if(!A(t))return t;var r=t.attributes||t.props,s=[Object(o.h)(t.nodeName||t.type,E({},r),t.children||r&&r.children),e];return n&&n.length?s.push(n):e&&e.children&&s.push(e.children),P(o.cloneElement.apply(void 0,s))},isValidElement:A,findDOMNode:function(t){return t&&t.base||t},unmountComponentAtNode:function(t){var e=t._preactCompatRendered&&t._preactCompatRendered.base;return!(!e||e.parentNode!==t||(Object(o.render)(Object(o.h)(f),t,e),0))},Component:B,PureComponent:U,unstable_renderSubtreeIntoContainer:function(t,e,n,i){var r=_(Object(o.h)(v,{context:t.context},e),n),s=r._component||r.base;return i&&i.call(s,r),s},__spread:E};e.d=z}).call(this,n(43))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(85);e.default={system:{load_site:"SYSTEM_LOAD_SITE",running_command:"SYSTEM_RUNNING_COMMAND",command_output:"SYSTEM_COMMAND_OUTPUT",relay_connected:"SYSTEM_RELAY_CONNECTED",relay_disconnected:"SYSTEM_RELAY_DISCONNECTED",rpc_connected:"SYSTEM_RPC_CONNECTED",rpc_disconnected:"SYSTEM_RPC_DISCONNECTED",list_directory:"SYSTEM_LIST_DIRECTORY",listing_directory:"SYSTEM_LISTING_DIRECTORY",count_directory:"SYSTEM_COUNT_DIRECTORY",counting_directory:"SYSTEM_COUNTING_DIRECTORY",stdout:"SYSTEM_STDOUT",stderr:"SYSTEM_STDERR",change_language:"SYSTEM_CHANGE_LANGUAGE"},app:{change_tool:"APP_CHANGE_TOOL",load_progress:"APP_LOAD_PROGRESS"},folder:(0,i.crud_type)("folder",[]),file:(0,i.crud_type)("file",[]),task:(0,i.crud_type)("task",["starting_task","stopping_task","task_begin","task_finish","start_queue","stop_queue","starting_queue","stopping_queue","progress","epoch"]),auth:(0,i.crud_type)("auth",["set_token","set_error","set_current_user","logout_user","loading","initialized","set_return_to"]),socket:{connect:"SOCKET_CONNECT",connect_error:"SOCKET_CONNECT_ERROR",reconnect:"SOCKET_RECONNECT",reconnecting:"SOCKET_RECONNECTING",reconnect_error:"SOCKET_RECONNECT_ERROR",reconnect_failed:"SOCKET_RECONNECT_FAILED",disconnect:"SOCKET_DISCONNECT",error:"SOCKET_ERROR",status:"SOCKET_STATUS",load_params:"SOCKET_LOAD_PARAMS",list_checkpoints:"SOCKET_LIST_CHECKPOINTS",list_sequences:"SOCKET_LIST_SEQUENCES",list_epochs:"SOCKET_LIST_EPOCHS"},player:{get_params:"GET_PARAMS",set_param:"SET_PARAM",send_command:"SEND_COMMAND",loading_checkpoints:"LOADING_CHECKPOINTS",loading_checkpoint:"LOADING_CHECKPOINT",list_checkpoints:"LIST_CHECKPOINTS",loading_sequences:"LOADING_SEQUENCES",loading_sequence:"LOADING_SEQUENCE",load_sequence:"LOAD_SEQUENCE",loading_epochs:"LOADING_EPOCHS",load_epoch:"LOAD_EPOCH",set_fps:"SET_FPS",seeking:"SEEKING",pausing:"PAUSING",playing:"PLAYING",current_frame:"CURRENT_FRAME",start_recording:"START_RECORDING",add_record_frame:"ADD_RECORD_FRAME",save_frame:"SAVE_FRAME",saving_video:"SAVING_VIDEO",save_video:"SAVE_VIDEO",set_fullscreen:"SET_FULLSCREEN"},audioPlayer:{play:"AUDIO_PLAY",pause:"AUDIO_PAUSE",resume:"AUDIO_RESUME",enqueue:"AUDIO_ENQUEUE"},dataset:{load:"DATASET_LOAD",set_folder:"DATASET_SET_FOLDER",upload_files:"DATASET_UPLOAD_FILES",file_progress:"DATASET_FILE_PROGRESS",file_uploaded:"DATASET_FILE_UPLOADED",fetch_url:"DATASET_FETCH_URL",fetch_progress:"DATASET_FETCH_PROGRESS",list_epochs:"DATASET_LIST_EPOCHS"},samplernn:{init:"SAMPLERNN_INIT",set_folder:"SAMPLERNN_SET_FOLDER",load_loss:"SAMPLERNN_LOAD_LOSS",load_graph:"SAMPLERNN_LOAD_GRAPH"},biggan:(0,i.with_type)("biggan",["init","set_folder","load_results","load_encodings"]),pix2pix:(0,i.with_type)("pix2pix",["init","set_folder"]),pix2pixhd:(0,i.with_type)("pix2pixhd",["init","set_folder","load_results","load_dataset_count","load_uprez"]),pix2wav:(0,i.with_type)("pix2wav",["init","set_folder"]),wav2pix:(0,i.with_type)("wav2pix",["load","progress","finish","zip","uploading"]),dashboard:(0,i.with_type)("dashboard",["load"]),morph:(0,i.with_type)("morph",["load"])}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(3),r=n(126),o=p(n(19)),s=p(n(38)),a=p(n(81)),u=p(n(135)),l=p(n(62)),c=p(n(52)),h=n(20);function p(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}e.default=Object.keys(r.actions).map(function(t){return[t,r.actions[t]]}).concat([["live",o],["queue",s],["system",a],["dataset",l],["audioPlayer",c]]).map(function(t){return[t[0],(0,i.bindActionCreators)(t[1],h.store.dispatch)]}).concat([["socket",u]]).reduce(function(t,e){return(t[e[0]]=e[1])&&t},{})},function(t,e,n){"use strict";n.r(e);var i=n(9),r=n.n(i),o=n(5),s=n(0),a=n.n(s),u=n(146),l=n.n(u),c=n(13),h=n.n(c),p=n(12),f=n.n(p),d=Object.assign||function(t){for(var e=1;e may have only one child element"),this.unlisten=i.listen(function(){t.setState({match:t.computeMatch(i.location.pathname)})})},e.prototype.componentWillReceiveProps=function(t){h()(this.props.history===t.history,"You cannot change ")},e.prototype.componentWillUnmount=function(){this.unlisten()},e.prototype.render=function(){var t=this.props.children;return t?o.d.Children.only(t):null},e}(o.d.Component);y.propTypes={history:a.a.object.isRequired,children:a.a.node},y.contextTypes={router:a.a.object},y.childContextTypes={router:a.a.object.isRequired};var _=y,v=_;function g(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}var b=function(t){function e(){var n,i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var r=arguments.length,o=Array(r),s=0;s ignores the history prop. To use a custom history, use `import { Router }` instead of `import { BrowserRouter as Router }`.")},e.prototype.render=function(){return o.d.createElement(v,{history:this.history,children:this.props.children})},e}(o.d.Component);b.propTypes={basename:a.a.string,forceRefresh:a.a.bool,getUserConfirmation:a.a.func,keyLength:a.a.number,children:a.a.node};var w=b,k=n(145),S=n.n(k);function x(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}var T=function(t){function e(){var n,i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var r=arguments.length,o=Array(r),s=0;s ignores the history prop. To use a custom history, use `import { Router }` instead of `import { HashRouter as Router }`.")},e.prototype.render=function(){return o.d.createElement(v,{history:this.history,children:this.props.children})},e}(o.d.Component);T.propTypes={basename:a.a.string,getUserConfirmation:a.a.func,hashType:a.a.oneOf(["hashbang","noslash","slash"]),children:a.a.node};var O=T,P=Object.assign||function(t){for(var e=1;e=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}(t,["replace","to","innerRef"]);f()(this.context.router,"You should not use outside a ");var r=this.context.router.history.createHref("string"==typeof e?{pathname:e}:e);return o.d.createElement("a",P({},i,{onClick:this.handleClick,href:r,ref:n}))},e}(o.d.Component);E.propTypes={onClick:a.a.func,target:a.a.string,replace:a.a.bool,to:a.a.oneOfType([a.a.string,a.a.object]).isRequired,innerRef:a.a.oneOfType([a.a.string,a.a.func])},E.defaultProps={replace:!1},E.contextTypes={router:a.a.shape({history:a.a.shape({push:a.a.func.isRequired,replace:a.a.func.isRequired,createHref:a.a.func.isRequired}).isRequired}).isRequired};var M=E,R=n(88),j=n(87),N=function(t){var e=t.pathname,n=t.search,i=t.hash,r=e||"/";return n&&"?"!==n&&(r+="?"===n.charAt(0)?n:"?"+n),i&&"#"!==i&&(r+="#"===i.charAt(0)?i:"#"+i),r},F=Object.assign||function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{},e=t.getUserConfirmation,n=t.initialEntries,i=void 0===n?["/"]:n,o=t.initialIndex,s=void 0===o?0:o,a=t.keyLength,u=void 0===a?6:a,l=q(),c=function(t){B(y,t),y.length=y.entries.length,l.notifyListeners(y.location,y.action)},h=function(){return Math.random().toString(36).substr(2,u)},p=U(s,0,i.length-1),f=i.map(function(t){return L(t,void 0,"string"==typeof t?h():t.key||h())}),d=N,m=function(t){var n=U(y.index+t,0,y.entries.length-1),i=y.entries[n];l.confirmTransitionTo(i,"POP",e,function(t){t?c({action:"POP",location:i,index:n}):c()})},y={length:f.length,action:"POP",location:f[p],index:p,entries:f,createHref:d,push:function(t,n){r()(!("object"===(void 0===t?"undefined":I(t))&&void 0!==t.state&&void 0!==n),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var i=L(t,n,h(),y.location);l.confirmTransitionTo(i,"PUSH",e,function(t){if(t){var e=y.index+1,n=y.entries.slice(0);n.length>e?n.splice(e,n.length-e,i):n.push(i),c({action:"PUSH",location:i,index:e,entries:n})}})},replace:function(t,n){r()(!("object"===(void 0===t?"undefined":I(t))&&void 0!==t.state&&void 0!==n),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var i=L(t,n,h(),y.location);l.confirmTransitionTo(i,"REPLACE",e,function(t){t&&(y.entries[y.index]=i,c({action:"REPLACE",location:i}))})},go:m,goBack:function(){return m(-1)},goForward:function(){return m(1)},canGo:function(t){var e=y.index+t;return e>=0&&e0&&void 0!==arguments[0]&&arguments[0];return l.setPrompt(t)},listen:function(t){return l.appendListener(t)}};return y};function Y(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}var W=function(t){function e(){var n,i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var r=arguments.length,o=Array(r),s=0;s ignores the history prop. To use a custom history, use `import { Router }` instead of `import { MemoryRouter as Router }`.")},e.prototype.render=function(){return o.d.createElement(_,{history:this.history,children:this.props.children})},e}(o.d.Component);W.propTypes={initialEntries:a.a.array,initialIndex:a.a.number,getUserConfirmation:a.a.func,keyLength:a.a.number,children:a.a.node};var G=W,V=n(63),H=n.n(V),Z={},Q=0,K=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments[2];"string"==typeof e&&(e={path:e});var i=e,r=i.path,o=i.exact,s=void 0!==o&&o,a=i.strict,u=void 0!==a&&a,l=i.sensitive,c=void 0!==l&&l;if(null==r)return n;var h=function(t,e){var n=""+e.end+e.strict+e.sensitive,i=Z[n]||(Z[n]={});if(i[t])return i[t];var r=[],o={re:H()(t,r,e),keys:r};return Q<1e4&&(i[t]=o,Q++),o}(r,{end:s,strict:u,sensitive:c}),p=h.re,f=h.keys,d=p.exec(t);if(!d)return null;var m=d[0],y=d.slice(1),_=t===m;return s&&!_?null:{path:r,url:"/"===r&&""===m?"/":m,isExact:_,params:f.reduce(function(t,e,n){return t[e.name]=y[n],t},{})}},$=Object.assign||function(t){for(var e=1;e or withRouter() outside a ");var u=e.route,l=(i||u.location).pathname;return K(l,{path:r,strict:o,exact:s,sensitive:a},u.match)},e.prototype.componentWillMount=function(){h()(!(this.props.component&&this.props.render),"You should not use and in the same route; will be ignored"),h()(!(this.props.component&&this.props.children&&!J(this.props.children)),"You should not use and in the same route; will be ignored"),h()(!(this.props.render&&this.props.children&&!J(this.props.children)),"You should not use and in the same route; will be ignored")},e.prototype.componentWillReceiveProps=function(t,e){h()(!(t.location&&!this.props.location),' elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'),h()(!(!t.location&&this.props.location),' elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.'),this.setState({match:this.computeMatch(t,e.router)})},e.prototype.render=function(){var t=this.state.match,e=this.props,n=e.children,i=e.component,r=e.render,s=this.context.router,a=s.history,u=s.route,l=s.staticContext,c={match:t,location:this.props.location||u.location,history:a,staticContext:l};return i?t?o.d.createElement(i,c):null:r?t?r(c):null:"function"==typeof n?n(c):n&&!J(n)?o.d.Children.only(n):null},e}(o.d.Component);tt.propTypes={computedMatch:a.a.object,path:a.a.string,exact:a.a.bool,strict:a.a.bool,sensitive:a.a.bool,component:a.a.func,render:a.a.func,children:a.a.oneOfType([a.a.func,a.a.node]),location:a.a.object},tt.contextTypes={router:a.a.shape({history:a.a.object.isRequired,route:a.a.object.isRequired,staticContext:a.a.object})},tt.childContextTypes={router:a.a.object.isRequired};var et=tt,nt=et,it=Object.assign||function(t){for(var e=1;e=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}(t,["to","exact","strict","location","activeClassName","className","activeStyle","style","isActive","ariaCurrent"]);return o.d.createElement(nt,{path:"object"===(void 0===e?"undefined":rt(e))?e.pathname:e,exact:n,strict:i,location:r,children:function(t){var n=t.location,i=t.match,r=!!(c?c(i,n):i);return o.d.createElement(M,it({to:e,className:r?[a,s].filter(function(t){return t}).join(" "):a,style:r?it({},l,u):l,"aria-current":r&&h},p))}})};ot.propTypes={to:M.propTypes.to,exact:a.a.bool,strict:a.a.bool,location:a.a.object,activeClassName:a.a.string,className:a.a.string,activeStyle:a.a.object,style:a.a.object,isActive:a.a.func,ariaCurrent:a.a.oneOf(["page","step","location","true"])},ot.defaultProps={activeClassName:"active",ariaCurrent:"true"};var st=ot;var at=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),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}(this,t.apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.enable=function(t){this.unblock&&this.unblock(),this.unblock=this.context.router.history.block(t)},e.prototype.disable=function(){this.unblock&&(this.unblock(),this.unblock=null)},e.prototype.componentWillMount=function(){f()(this.context.router,"You should not use outside a "),this.props.when&&this.enable(this.props.message)},e.prototype.componentWillReceiveProps=function(t){t.when?this.props.when&&this.props.message===t.message||this.enable(t.message):this.disable()},e.prototype.componentWillUnmount=function(){this.disable()},e.prototype.render=function(){return null},e}(o.d.Component);at.propTypes={when:a.a.bool,message:a.a.oneOfType([a.a.func,a.a.string]).isRequired},at.defaultProps={when:!0},at.contextTypes={router:a.a.shape({history:a.a.shape({block:a.a.func.isRequired}).isRequired}).isRequired};var ut=at,lt={},ct=0,ht=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/",e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"/"===t?t:function(t){var e=t,n=lt[e]||(lt[e]={});if(n[t])return n[t];var i=H.a.compile(t);return ct<1e4&&(n[t]=i,ct++),i}(t)(e,{pretty:!0})},pt=Object.assign||function(t){for(var e=1;e outside a "),this.isStatic()&&this.perform()},e.prototype.componentDidMount=function(){this.isStatic()||this.perform()},e.prototype.componentDidUpdate=function(t){var e=L(t.to),n=L(this.props.to);D(e,n)?h()(!1,"You tried to redirect to the same route you're currently on: \""+n.pathname+n.search+'"'):this.perform()},e.prototype.computeTo=function(t){var e=t.computedMatch,n=t.to;return e?"string"==typeof n?ht(n,e.params):pt({},n,{pathname:ht(n.pathname,e.params)}):n},e.prototype.perform=function(){var t=this.context.router.history,e=this.props.push,n=this.computeTo(this.props);e?t.push(n):t.replace(n)},e.prototype.render=function(){return null},e}(o.d.Component);ft.propTypes={computedMatch:a.a.object,push:a.a.bool,from:a.a.string,to:a.a.oneOfType([a.a.string,a.a.object]).isRequired},ft.defaultProps={push:!1},ft.contextTypes={router:a.a.shape({history:a.a.shape({push:a.a.func.isRequired,replace:a.a.func.isRequired}).isRequired,staticContext:a.a.object}).isRequired};var dt=ft,mt=Object.assign||function(t){for(var e=1;e",t)}},wt=function(){},kt=function(t){function e(){var n,i;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);for(var r=arguments.length,o=Array(r),s=0;s ignores the history prop. To use a custom history, use `import { Router }` instead of `import { StaticRouter as Router }`.")},e.prototype.render=function(){var t=this.props,e=t.basename,n=(t.context,t.location),i=function(t,e){var n={};for(var i in t)e.indexOf(i)>=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}(t,["basename","context","location"]),r={createHref:this.createHref,action:"POP",location:function(t,e){if(!t)return e;var n=_t(t);return 0!==e.pathname.indexOf(n)?e:mt({},e,{pathname:e.pathname.substr(n.length)})}(e,L(n)),push:this.handlePush,replace:this.handleReplace,go:bt("go"),goBack:bt("goBack"),goForward:bt("goForward"),listen:this.handleListen,block:this.handleBlock};return o.d.createElement(_,mt({},i,{history:r}))},e}(o.d.Component);kt.propTypes={basename:a.a.string,context:a.a.object.isRequired,location:a.a.oneOfType([a.a.string,a.a.object])},kt.defaultProps={basename:"",location:"/"},kt.childContextTypes={router:a.a.object.isRequired};var St=kt;var xt=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),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}(this,t.apply(this,arguments))}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(e,t),e.prototype.componentWillMount=function(){f()(this.context.router,"You should not use outside a ")},e.prototype.componentWillReceiveProps=function(t){h()(!(t.location&&!this.props.location),' elements should not change from uncontrolled to controlled (or vice versa). You initially used no "location" prop and then provided one on a subsequent render.'),h()(!(!t.location&&this.props.location),' elements should not change from controlled to uncontrolled (or vice versa). You provided a "location" prop initially but omitted it on a subsequent render.')},e.prototype.render=function(){var t=this.context.router.route,e=this.props.children,n=this.props.location||t.location,i=void 0,r=void 0;return o.d.Children.forEach(e,function(e){if(null==i&&o.d.isValidElement(e)){var s=e.props,a=s.path,u=s.exact,l=s.strict,c=s.sensitive,h=s.from,p=a||h;r=e,i=K(n.pathname,{path:p,exact:u,strict:l,sensitive:c},t.match)}}),i?o.d.cloneElement(r,{location:n,computedMatch:i}):null},e}(o.d.Component);xt.contextTypes={router:a.a.shape({route:a.a.object.isRequired}).isRequired},xt.propTypes={children:a.a.node,location:a.a.object};var Tt=xt,Ot=K,Pt=n(144),At=n.n(Pt),Ct=Object.assign||function(t){for(var e=1;e=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}(e,["wrappedComponentRef"]);return o.d.createElement(et,{children:function(e){return o.d.createElement(t,Ct({},i,e,{ref:n}))}})};return e.displayName="withRouter("+(t.displayName||t.name)+")",e.WrappedComponent=t,e.propTypes={wrappedComponentRef:a.a.func},At()(e,t)};n.d(e,"BrowserRouter",function(){return w}),n.d(e,"HashRouter",function(){return O}),n.d(e,"Link",function(){return M}),n.d(e,"MemoryRouter",function(){return G}),n.d(e,"NavLink",function(){return st}),n.d(e,"Prompt",function(){return ut}),n.d(e,"Redirect",function(){return dt}),n.d(e,"Route",function(){return nt}),n.d(e,"Router",function(){return v}),n.d(e,"StaticRouter",function(){return St}),n.d(e,"Switch",function(){return Tt}),n.d(e,"matchPath",function(){return Ot}),n.d(e,"withRouter",function(){return Et})},function(t,e,n){"use strict";t.exports=function(){}},function(t,e,n){"use strict";var i=n(24),r=n(113),o=n(57),s=n(207),a=n(45);function u(t){return t}function l(t,e){for(var n=0;n1;)try{return c.stringifyByChunk(t,i,n)}catch(t){n=Math.floor(n/2)}return c.stringifyByChar(t)}function p(t,e){for(var n=0;na)&&void 0===t.nsecs&&(m=0),m>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=d,u=m,r=p;var _=(1e4*(268435455&(d+=122192928e5))+m)%4294967296;c[l++]=_>>>24&255,c[l++]=_>>>16&255,c[l++]=_>>>8&255,c[l++]=255&_;var v=d/4294967296*1e4&268435455;c[l++]=v>>>8&255,c[l++]=255&v,c[l++]=v>>>24&15|16,c[l++]=v>>>16&255,c[l++]=p>>>8|128,c[l++]=255&p;for(var g=0;g<6;++g)c[l+g]=h[g];return e||s(c)}},function(t,e,n){"use strict";function i(t){this.name=t||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}i.prototype={push:function(t){this.emit("data",t)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(t){this.emit("error",t)}return!0},error:function(t){return!this.isFinished&&(this.isPaused?this.generatedError=t:(this.isFinished=!0,this.emit("error",t),this.previous&&this.previous.error(t),this.cleanUp()),!0)},on:function(t,e){return this._listeners[t].push(e),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(t,e){if(this._listeners[t])for(var n=0;n "+t:t}},t.exports=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=t.progress;return(0,r.h)("div",{className:"loading"},"Loading",(0,r.h)("br",null),e&&(0,r.h)(s.default,{progress:e}))};var i,r=n(1),o=n(123),s=(i=o)&&i.__esModule?i:{default:i}},function(t,e,n){t.exports=n(318)()},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.play=e.pause=e.seek=e.load_epoch=e.load_sequence=e.list_sequences=e.list_epochs=e.list_checkpoints=e.set_fullscreen=e.send_command=e.set_param=e.get_params=void 0;var i=s(n(14)),r=s(n(6)),o=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(40));function s(t){return t&&t.__esModule?t:{default:t}}e.get_params=function(){return i.default.live.get_params(),{type:r.default.player.get_params}},e.set_param=function(t,e){return console.log("set param",t,e),i.default.live.set_param(t,e),{type:r.default.player.set_param,key:t,value:e}},e.send_command=function(t,e){return i.default.live.send_command(t,e),{type:r.default.player.send_command}},e.set_fullscreen=function(t){return{type:r.default.player.set_fullscreen,value:t}},e.list_checkpoints=function(t){return i.default.live.list_checkpoints(t),{type:r.default.player.loading_checkpoints}},e.list_epochs=function(t,e){return i.default.live.list_epochs(t,e),{type:r.default.player.loading_epochs}},e.list_sequences=function(t){return i.default.live.list_sequences(t),{type:r.default.player.loading_sequences}},e.load_sequence=function(t){return i.default.live.load_sequence(t),{type:r.default.player.loading_sequence,sequence_name:t}},e.load_epoch=function(t,e){return i.default.live.load_epoch(t,e),{type:r.default.player.loading_checkpoint,checkpoint_name:t,epoch:e}},e.seek=function(t){return i.default.live.seek(t),{type:r.default.player.seeking}},e.pause=function t(e){return i.default.live.pause(t),o.toggleFPS(!1),{type:r.default.player.pausing}},e.play=function(t){return i.default.live.play(),o.toggleFPS(!0),{type:r.default.player.playing}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.dispatch=e.store=e.history=void 0;var i=n(3),r=n(308),o=m(n(305)),s=m(n(304)),a=m(n(297)),u=m(n(296)),l=m(n(292)),c=m(n(289)),h=m(n(286)),p=m(n(285)),f=m(n(284)),d=n(283);function m(t){return t&&t.__esModule?t:{default:t}}var y=(0,i.combineReducers)({router:r.routerReducer,auth:a.default,live:u.default,queue:l.default,system:c.default,upload:h.default,dashboard:p.default,audioPlayer:f.default,module:d.moduleReducer}),_=e.history=(0,s.default)(),v=e.store=(0,i.createStore)(y,(0,i.compose)((0,i.applyMiddleware)(o.default,(0,r.routerMiddleware)(_))));e.dispatch=v.dispatch},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.FileRow=e.FileList=void 0;var i=n(1),r=(n(3),n(2),n(8),s(n(29))),o=s(n(4));function s(t){return t&&t.__esModule?t:{default:t}}var a=o.default.fieldSet(new Set(["name","date","size"])),u=(e.FileList=function(t){var e=t.files,n=t.fields,r=(t.sort,t.title),s=t.linkFiles,l=t.onClick,c=t.onClickParent,h=t.onDelete,p=t.groupDirectories,f=t.parentDirectory,d=t.orderBy,m=void 0===d?"name asc":d,y=t.className,_=void 0===y?"":y,v=t.fileListClassName,g=void 0===v?"filelist":v,b=t.rowClassName,w=void 0===b?"row file":b,k=t.options,S=o.default.sort.orderByFn(m),x=S.mapFn,T=S.sortFn,O=(e||[]).filter(function(t){return!!t}).map(x).sort(T);if(p){var P=O.reduce(function(t,e){return t[e[1].dir].push(e),t},{true:[],false:[]});O=P.true.concat(P.false)}var A=a(n),C=null;A.has("thumbnail")&&(C=(0,i.h)("div",{class:"thumbnails"},O.map(function(t){return(0,i.h)("div",null,(0,i.h)("a",{href:t[1].url,target:"_blank"},(0,i.h)("img",{src:t[1].url})))})));var E=O.map(function(t){return(0,i.h)(u,{file:t[1],fields:A,className:w,linkFiles:s,onDelete:h,onClick:l,options:k})});return E&&E.length?(0,i.h)("div",{className:"rows "+_},r&&(0,i.h)("div",{className:"row heading"},(0,i.h)("h3",null,r),"}"),(0,i.h)("div",{className:"rows "+g},f&&(0,i.h)("div",{className:w+" parent"},(0,i.h)("div",{className:"filename",title:"Parent Directory"},(0,i.h)("span",{className:"link",onClick:function(t){return c&&c(t)}},(0,i.h)("i",null,"Parent Directory")))),C,E)):(0,i.h)("div",{className:"rows "+_},(0,i.h)("div",{className:"row heading"},(0,i.h)("h4",{className:"noFiles"},"No files")))},e.FileRow=function(t){var e=t.file,n=t.linkFiles,s=t.onDelete,u=t.onClick,l=t.className,c=void 0===l?"row file":l,h=t.username,p=void 0===h?"":h,f=t.options,d=a(t.fields),m=o.default.hush_size(e.size),y=e.date||e.created_at,_=e.epoch||e.epochs||0,v=e.count||0,g=void 0,b=void 0;return e.name?b=g=e.name:e.url&&(e.opt&&e.opt.type?(g=e.opt.type+": "+e.opt.title,b=e.opt.token):b=g=e.url.replace(/^https?:\/\//,"")),(0,i.h)("div",{className:c,key:b},d.has("name")&&(0,i.h)("div",{className:"filename",title:e.name||e.url},!1===e.persisted?(0,i.h)("span",{className:"unpersisted"},g):n&&e.url?(0,i.h)("a",{target:"_blank",onClick:function(t){t.metaKey||t.ctrlKey||t.altKey||!u||(t.preventDefault(),u&&u(e,t))},href:e.url},g):(0,i.h)("span",{className:"link",onClick:function(t){return u&&u(e,t)}},g)),d.has("age")&&(0,i.h)("div",{className:"age "+o.default.carbon_date(y)},o.default.get_age(y)),d.has("username")&&(0,i.h)("div",{className:"username"},p),d.has("epoch")&&(0,i.h)("div",{className:"epoch "+o.default.hush_null(_)[0]},_>0?"ep. "+_:""),d.has("date")&&(0,i.h)("div",{className:"date "+o.default.carbon_date(y),title:(0,r.default)(y).format("YYYY-MM-DD HH:mm")},(0,r.default)(y).format("YYYY-MM-DD")),d.has("datetime")&&(0,i.h)("div",{className:"datetime"},(0,i.h)("span",{class:"date "+o.default.carbon_date(y)},(0,r.default)(y).format("YYYY-MM-DD")),(0,i.h)("span",{class:"time "+o.default.carbon_time(y)},(0,r.default)(y).format("H:mm"))),d.has("size")&&(0,i.h)("div",{className:"size "+m[0]},m[1]),d.has("count")&&(0,i.h)("div",{className:"count "+o.default.hush_null(v)[0]},v>0?v+" files":""),(d.has("activity")||d.has("module"))&&(0,i.h)("div",{className:"activity"},d.has("activity")&&e.activity,d.has("module")&&e.module),d.has("delete")&&s&&e.id&&(0,i.h)("div",{className:"destroy",onClick:function(t){return s(e)}},"x"),d.has("deleteLink")&&s&&e.id&&(0,i.h)("div",{className:"destroyLink",onClick:function(t){return s(e)}},"Delete"),f&&t.options(e))})},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function r(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var n=e.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var i in n)r(n,i)&&(t[i]=n[i])}}return t},e.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var o={arraySet:function(t,e,n,i,r){if(e.subarray&&t.subarray)t.set(e.subarray(n,n+i),r);else for(var o=0;o>>0,i=0;ixt(t)?(o=t+1,s=a-xt(t)):(o=t,s=a),{year:o,dayOfYear:s}}function Yt(t,e,n){var i,r,o=Ut(t.year(),e,n),s=Math.floor((t.dayOfYear()-o-1)/7)+1;return s<1?i=s+Wt(r=t.year()-1,e,n):s>Wt(t.year(),e,n)?(i=s-Wt(t.year(),e,n),r=t.year()+1):(r=t.year(),i=s),{week:i,year:r}}function Wt(t,e,n){var i=Ut(t,e,n),r=Ut(t+1,e,n);return(xt(t)-i+r)/7}Y("w",["ww",2],"wo","week"),Y("W",["WW",2],"Wo","isoWeek"),j("week","w"),j("isoWeek","W"),D("week",5),D("isoWeek",5),lt("w",$),lt("ww",$,H),lt("W",$),lt("WW",$,H),dt(["w","ww","W","WW"],function(t,e,n,i){e[i.substr(0,1)]=k(t)}),Y("d",0,"do","day"),Y("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),Y("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),Y("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),Y("e",0,0,"weekday"),Y("E",0,0,"isoWeekday"),j("day","d"),j("weekday","e"),j("isoWeekday","E"),D("day",11),D("weekday",11),D("isoWeekday",11),lt("d",$),lt("e",$),lt("E",$),lt("dd",function(t,e){return e.weekdaysMinRegex(t)}),lt("ddd",function(t,e){return e.weekdaysShortRegex(t)}),lt("dddd",function(t,e){return e.weekdaysRegex(t)}),dt(["dd","ddd","dddd"],function(t,e,n,i){var r=n._locale.weekdaysParse(t,i,n._strict);null!=r?e.d=r:f(n).invalidWeekday=t}),dt(["d","e","E"],function(t,e,n,i){e[i]=k(t)});var Gt="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Vt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ht="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Zt=at,Qt=at,Kt=at;function $t(){function t(t,e){return e.length-t.length}var e,n,i,r,o,s=[],a=[],u=[],l=[];for(e=0;e<7;e++)n=p([2e3,1]).day(e),i=this.weekdaysMin(n,""),r=this.weekdaysShort(n,""),o=this.weekdays(n,""),s.push(i),a.push(r),u.push(o),l.push(i),l.push(r),l.push(o);for(s.sort(t),a.sort(t),u.sort(t),l.sort(t),e=0;e<7;e++)a[e]=ht(a[e]),u[e]=ht(u[e]),l[e]=ht(l[e]);this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+s.join("|")+")","i")}function Xt(){return this.hours()%12||12}function Jt(t,e){Y(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function te(t,e){return e._meridiemParse}Y("H",["HH",2],0,"hour"),Y("h",["hh",2],0,Xt),Y("k",["kk",2],0,function(){return this.hours()||24}),Y("hmm",0,0,function(){return""+Xt.apply(this)+q(this.minutes(),2)}),Y("hmmss",0,0,function(){return""+Xt.apply(this)+q(this.minutes(),2)+q(this.seconds(),2)}),Y("Hmm",0,0,function(){return""+this.hours()+q(this.minutes(),2)}),Y("Hmmss",0,0,function(){return""+this.hours()+q(this.minutes(),2)+q(this.seconds(),2)}),Jt("a",!0),Jt("A",!1),j("hour","h"),D("hour",13),lt("a",te),lt("A",te),lt("H",$),lt("h",$),lt("k",$),lt("HH",$,H),lt("hh",$,H),lt("kk",$,H),lt("hmm",X),lt("hmmss",J),lt("Hmm",X),lt("Hmmss",J),ft(["H","HH"],vt),ft(["k","kk"],function(t,e,n){var i=k(t);e[vt]=24===i?0:i}),ft(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),ft(["h","hh"],function(t,e,n){e[vt]=k(t),f(n).bigHour=!0}),ft("hmm",function(t,e,n){var i=t.length-2;e[vt]=k(t.substr(0,i)),e[gt]=k(t.substr(i)),f(n).bigHour=!0}),ft("hmmss",function(t,e,n){var i=t.length-4,r=t.length-2;e[vt]=k(t.substr(0,i)),e[gt]=k(t.substr(i,2)),e[bt]=k(t.substr(r)),f(n).bigHour=!0}),ft("Hmm",function(t,e,n){var i=t.length-2;e[vt]=k(t.substr(0,i)),e[gt]=k(t.substr(i))}),ft("Hmmss",function(t,e,n){var i=t.length-4,r=t.length-2;e[vt]=k(t.substr(0,i)),e[gt]=k(t.substr(i,2)),e[bt]=k(t.substr(r))});var ee,ne=At("Hours",!0),ie={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:jt,monthsShort:Nt,week:{dow:0,doy:6},weekdays:Gt,weekdaysMin:Ht,weekdaysShort:Vt,meridiemParse:/[ap]\.?m?\.?/i},re={},oe={};function se(t){return t?t.toLowerCase().replace("_","-"):t}function ae(e){var n=null;if(!re[e]&&void 0!==t&&t&&t.exports)try{n=ee._abbr,function(){var t=new Error('Cannot find module "undefined"');throw t.code="MODULE_NOT_FOUND",t}(),ue(n)}catch(e){}return re[e]}function ue(t,e){var n;return t&&((n=s(e)?ce(t):le(t,e))?ee=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),ee._abbr}function le(t,e){if(null!==e){var n,i=ie;if(e.abbr=t,null!=re[t])A("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),i=re[t]._config;else if(null!=e.parentLocale)if(null!=re[e.parentLocale])i=re[e.parentLocale]._config;else{if(null==(n=ae(e.parentLocale)))return oe[e.parentLocale]||(oe[e.parentLocale]=[]),oe[e.parentLocale].push({name:t,config:e}),null;i=n._config}return re[t]=new M(E(i,e)),oe[t]&&oe[t].forEach(function(t){le(t.name,t.config)}),ue(t),re[t]}return delete re[t],null}function ce(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return ee;if(!r(t)){if(e=ae(t))return e;t=[t]}return function(t){for(var e,n,i,r,o=0;o=e&&S(r,n,!0)>=e-1)break;e--}o++}return ee}(t)}function he(t){var e,n=t._a;return n&&-2===f(t).overflow&&(e=n[yt]<0||11Mt(n[mt],n[yt])?_t:n[vt]<0||24Wt(n,o,s)?f(t)._overflowWeeks=!0:null!=u?f(t)._overflowWeekday=!0:(a=zt(n,i,r,o,s),t._a[mt]=a.year,t._dayOfYear=a.dayOfYear)}(t),null!=t._dayOfYear&&(s=pe(t._a[mt],r[mt]),(t._dayOfYear>xt(s)||0===t._dayOfYear)&&(f(t)._overflowDayOfYear=!0),n=Bt(s,0,t._dayOfYear),t._a[yt]=n.getUTCMonth(),t._a[_t]=n.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=a[e]=r[e];for(;e<7;e++)t._a[e]=a[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[vt]&&0===t._a[gt]&&0===t._a[bt]&&0===t._a[wt]&&(t._nextDay=!0,t._a[vt]=0),t._d=(t._useUTC?Bt:function(t,e,n,i,r,o,s){var a=new Date(t,e,n,i,r,o,s);return t<100&&0<=t&&isFinite(a.getFullYear())&&a.setFullYear(t),a}).apply(null,a),o=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[vt]=24),t._w&&void 0!==t._w.d&&t._w.d!==o&&(f(t).weekdayMismatch=!0)}}var de=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,me=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,ye=/Z|[+-]\d\d(?::?\d\d)?/,_e=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],ve=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],ge=/^\/?Date\((\-?\d+)/i;function be(t){var e,n,i,r,o,s,a=t._i,u=de.exec(a)||me.exec(a);if(u){for(f(t).iso=!0,e=0,n=_e.length;en.valueOf():n.valueOf()this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},ln.isLocal=function(){return!!this.isValid()&&!this._isUTC},ln.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},ln.isUtc=Be,ln.isUTC=Be,ln.zoneAbbr=function(){return this._isUTC?"UTC":""},ln.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},ln.dates=T("dates accessor is deprecated. Use date instead.",nn),ln.months=T("months accessor is deprecated. Use month instead",Lt),ln.years=T("years accessor is deprecated. Use year instead",Pt),ln.zone=T("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}),ln.isDSTShifted=T("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!s(this._isDSTShifted))return this._isDSTShifted;var t={};if(_(t,this),(t=Te(t))._a){var e=t._isUTC?p(t._a):Pe(t._a);this._isDSTShifted=this.isValid()&&0=252?6:u>=248?5:u>=240?4:u>=224?3:u>=192?2:1;a[254]=a[254]=1;function l(){s.call(this,"utf-8 decode"),this.leftOver=null}function c(){s.call(this,"utf-8 encode")}e.utf8encode=function(t){return r.nodebuffer?o.newBufferFrom(t,"utf-8"):function(t){var e,n,i,o,s,a=t.length,u=0;for(o=0;o>>6,e[s++]=128|63&n):n<65536?(e[s++]=224|n>>>12,e[s++]=128|n>>>6&63,e[s++]=128|63&n):(e[s++]=240|n>>>18,e[s++]=128|n>>>12&63,e[s++]=128|n>>>6&63,e[s++]=128|63&n);return e}(t)},e.utf8decode=function(t){return r.nodebuffer?i.transformTo("nodebuffer",t).toString("utf-8"):function(t){var e,n,r,o,s=t.length,u=new Array(2*s);for(n=0,e=0;e4)u[n++]=65533,e+=o-1;else{for(r&=2===o?31:3===o?15:7;o>1&&e1?u[n++]=65533:r<65536?u[n++]=r:(r-=65536,u[n++]=55296|r>>10&1023,u[n++]=56320|1023&r)}return u.length!==n&&(u.subarray?u=u.subarray(0,n):u.length=n),i.applyFromCharCode(u)}(t=i.transformTo(r.uint8array?"uint8array":"array",t))},i.inherits(l,s),l.prototype.processChunk=function(t){var n=i.transformTo(r.uint8array?"uint8array":"array",t.data);if(this.leftOver&&this.leftOver.length){if(r.uint8array){var o=n;(n=new Uint8Array(o.length+this.leftOver.length)).set(this.leftOver,0),n.set(o,this.leftOver.length)}else n=this.leftOver.concat(n);this.leftOver=null}var s=function(t,e){var n;for((e=e||t.length)>t.length&&(e=t.length),n=e-1;n>=0&&128==(192&t[n]);)n--;return n<0?e:0===n?e:n+a[t[n]]>e?n:e}(n),u=n;s!==n.length&&(r.uint8array?(u=n.subarray(0,s),this.leftOver=n.subarray(s,n.length)):(u=n.slice(0,s),this.leftOver=n.slice(s,n.length))),this.push({data:e.utf8decode(u),meta:t.meta})},l.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:e.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},e.Utf8DecodeWorker=l,i.inherits(c,s),c.prototype.processChunk=function(t){this.push({data:e.utf8encode(t.data),meta:t.meta})},e.Utf8EncodeWorker=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.uprez_task=e.splice_task=e.augment_task=e.live_task=e.train_task=e.fetch_task=void 0;var i=Object.assign||function(t){for(var e=1;e2&&void 0!==arguments[2]?arguments[2]:1;return function(i){if("PLACEHOLDER"!==(t=t.name||t)){var s={module:o.default.name,activity:"train",dataset:t,epoch:0,epochs:n,opt:{folder_id:e}};if(s.dataset)return console.log(s),r.default.queue.add_task(s);console.error("train task: no dataset specified")}}},e.live_task=function(t,e,n){return function(s){var a={module:o.default.name,activity:"live",dataset:t,checkpoint:e,opt:i({},n,{poll_delay:.01})};return console.log(a),console.log("add live task"),r.default.queue.add_task(a)}},e.augment_task=function(t,e){return function(n){if("PLACEHOLDER"!==t){var s={module:o.default.name,activity:"augment",dataset:t,folder_id:e.folder_id,opt:i({},e)};return console.log(s),console.log("add augment task"),r.default.queue.add_task(s)}}},e.splice_task=function(t){return function(e){var n={module:o.default.name,activity:"splice",dataset:t.title,folder_id:t.folder_id,epochs:1,opt:i({},t)};return console.log(n),console.log("add splice task"),r.default.queue.add_task(n)}},e.uprez_task=function(t){return function(e){var n={module:o.default.name,activity:"uprez",dataset:t.dataset,folder_id:t.folder_id,opt:i({},t)};return console.log(n),console.log("add uprez task"),r.default.queue.add_task(n)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.count_dataset=e.list_epochs=e.load_uprez=e.load_results=e.load_directories=void 0;var i=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{!i&&a.return&&a.return()}finally{if(r)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=(l(n(15)),l(n(14)),l(n(6))),o=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(36)),s=l(n(7)),a=l(n(4)),u=l(n(48));function l(t){return t&&t.__esModule?t:{default:t}}e.load_directories=function(t){return function(e){var n=u.default.name;a.default.allProgress([o.load(n),s.default.socket.list_directory({module:n,dir:"sequences"}),s.default.socket.list_directory({module:n,dir:"datasets"}),s.default.socket.list_directory({module:n,dir:"checkpoints"})],function(t,n,i){console.log("pix2pixhd load progress",n,i),e({type:r.default.app.load_progress,progress:{i:n,n:i},data:{module:"pix2pixhd"}})}).then(function(s){var a=i(s,4),u=a[0],l=a[1],c=a[2],h=a[3],p=u.folderLookup,f=u.fileLookup,d=u.datasetLookup,m=u.folders,y=u.files,_=(u.unsortedFolder,u.resultsFolder),v=l.filter(function(t){return t.dir});v.forEach(function(t){o.getDataset(n,d,t.name).isBuilt=!0}),c.filter(function(t){return t.dir}).forEach(function(t){o.getDataset(n,d,t.name).hasDataset=!0});var g=h.filter(function(t){return t.dir});g.forEach(function(t){var e=o.getDataset(n,d,t.name);e.hasCheckpoints=!0,e.checkpoints=[t]}),e({type:r.default.dataset.load,data:{module:n,folderLookup:p,fileLookup:f,datasetLookup:d,folders:m,files:y,sequences:v,datasets:c,checkpoints:g,resultsFolder:_}}),t&&(console.log("folder id",t),e({type:r.default.dataset.set_folder,data:{folder_id:t,module:n}}))}).catch(function(t){console.error(t)}),t&&(console.log("folder id",t),e({type:r.default.dataset.set_folder,data:{folder_id:t,module:n}}))}},e.load_results=function(t){return function(t){var e=u.default.name;a.default.allProgress([s.default.folder.index({module:e,name:"results"}),s.default.file.index({module:e,generated:1,limit:250}),s.default.socket.list_directory({module:e,dir:"renders"}),s.default.socket.list_sequences({module:e,dir:"results"})],function(e,n,i){console.log("pix2pixhd load progress",n,i),t({type:r.default.app.load_progress,progress:{i:n,n:i},data:{module:"pix2pixhd"}})}).then(function(e){var n=i(e,4),o=n[0],s=n[1],a=n[2],u=n[3];t({type:r.default.pix2pixhd.load_results,results:{resultsFolder:o[0],files:s,renders:a,results:u}})})}},e.load_uprez=function(t){return function(t){var e=u.default.name;a.default.allProgress([s.default.folder.index({module:e,name:"results"}),s.default.socket.list_sequences({module:e,dir:"results"}),s.default.file.index({module:e,activity:"uprez"})],function(e,n,i){console.log("pix2pixhd load progress",n,i),t({type:r.default.app.load_progress,progress:{i:n,n:i},data:{module:"pix2pixhd"}})}).then(function(e){var n=i(e,3),o=n[0],s=n[1],a=n[2];t({type:r.default.pix2pixhd.load_uprez,uprez:{resultsFolder:o[0],results:s,files:a}})})}};var c=new RegExp("_net_G.pth$");e.list_epochs=function(t){return function(e){var n=u.default.name;s.default.socket.list_directory({module:n,dir:"checkpoints/"+t}).then(function(t){var i=t.map(function(t){return t.name.match(c)?t.name.replace(c,""):null}).filter(function(t){return!!t});e({type:r.default.dataset.list_epochs,data:{epochs:i,module:n}})})}},e.count_dataset=function(t){return function(e){var n=u.default.name;a.default.allProgress([s.default.socket.list_directory({module:n,dir:"sequences/"+t+"/"}),s.default.socket.count_directory({module:n,dir:"datasets/"+t+"/train_A/"})],function(t,e,n){console.log("pix2pixhd load progress",e,n)}).then(function(n){var o=i(n,2),s=o[0],a=o[1],u=s.length;console.log(u,a),e({type:r.default.pix2pixhd.load_dataset_count,data:{name:t,sequence:s,sequenceCount:u,datasetCount:a}})})}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,r=n(1),o=(n(3),n(2)),s=n(17);(i=s)&&i.__esModule;e.default=(0,o.connect)(function(t){return t.upload},function(t,e){return{}})(function(t){return(0,r.h)("div",{className:"status"},t.status)})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1];if(!a[t]||e){var n={id:0,module:t,name:"unsorted",files:[],datasets:[]};a[t]=n}return a[t]},l=e.emptyDataset=function(t,e,n,i){(i=i||u(t)).datasets.push(n);var r={name:n,folder_id:i.id,input:[],checkpoints:[],output:[]};return e[n]=r,r},c=e.getDataset=function(t,e,n,i,r){var o=e[n=n.toLowerCase()]||l(t,e,n,i);return r&&(o.date=o.date&&!isNaN(o.date)?Math.max(+new Date(r),o.date):+new Date(r)),o};e.load=function(t){return console.log(t),Promise.all([s.default.folder.index({module:t,limit:0}),s.default.file.index({module:t,limit:0}),s.default.task.index({module:t})]).then(function(e){var n=r(e,3),i=n[0],o=n[1],a=(n[2],{}),l={},h={},p=void 0;l=i.reduce(function(t,e){return t[e.id]={id:e.id,name:e.name,folder:e,files:[],datasets:[]},"results"===e.name&&(p=e),t},{unsorted:u(t,!0)}),p?console.log("got results folder",p):(console.log("creating results folder..."),s.default.folder.create({module:t,name:"results",activity:"results"}).then(function(t){console.log("created folder",t),l.results=t}));var f=o.filter(function(t){return t.generated});return o.filter(function(t){return!t.generated}).reduce(function(e,n){h[n.id]=n,n.name||(n.opt&&n.opt.media&&n.opt.media.token?n.name=n.opt.media.token:n.name=n.url.replace(/^https?:\/\/(www.)?/,"").replace(/[^a-zA-Z0-9_]/g,"_").replace(/_+/g,"_")||"unknown_"+Math.floor(1e3*Math.random()));var i=(n.name||"unsorted").split(".")[0],r=l[n.folder_id]||u(t),o=c(t,e,n.dataset||i,r,n.date||n.created_at);return n.url.match(n.name)&&(n.persisted=!0),o.input.push(n.id),r.files.push(n.id),e},a),f.map(function(e){h[e.id]=e;var n=e.name.split(".")[0].split("-"),i=l[e.folder_id]||u(t);c(t,a,e.dataset||n[0],i,e.date||e.created_at).output.push(e.id),i.files.push(e.id),e.epoch=e.epoch||n[1]}),{folderLookup:l,fileLookup:h,datasetLookup:a,folders:i,files:o,unsortedFolder:l.unsorted,resultsFolder:p}}).catch(function(t){console.error(t)})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.load_encodings=e.load_results=e.load_directories=void 0;var i=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{!i&&a.return&&a.return()}finally{if(r)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=(l(n(15)),l(n(14)),l(n(6))),o=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(36)),s=l(n(7)),a=l(n(4)),u=l(n(61));function l(t){return t&&t.__esModule?t:{default:t}}e.load_directories=function(t){return function(e){var n=u.default.name;a.default.allProgress([o.load(n),s.default.socket.list_directory({module:n,dir:"sequences"}),s.default.socket.list_directory({module:n,dir:"datasets"}),s.default.socket.list_directory({module:n,dir:"checkpoints"})],function(t,n,i){console.log("biggan load progress",n,i),e({type:r.default.app.load_progress,progress:{i:n,n:i},data:{module:"biggan"}})}).then(function(s){var a=i(s,4),u=a[0],l=a[1],c=a[2],h=a[3],p=u.folderLookup,f=u.fileLookup,d=u.datasetLookup,m=u.folders,y=u.files,_=(u.unsortedFolder,u.resultsFolder),v=l.filter(function(t){return t.dir});v.forEach(function(t){o.getDataset(n,d,t.name).isBuilt=!0}),c.filter(function(t){return t.dir}).forEach(function(t){o.getDataset(n,d,t.name).hasDataset=!0});var g=h.filter(function(t){return t.dir});g.forEach(function(t){var e=o.getDataset(n,d,t.name);e.hasCheckpoints=!0,e.checkpoints=[t]}),e({type:r.default.dataset.load,data:{module:n,folderLookup:p,fileLookup:f,datasetLookup:d,folders:m,files:y,sequences:v,datasets:c,checkpoints:g,resultsFolder:_}}),t&&(console.log("folder id",t),e({type:r.default.dataset.set_folder,data:{folder_id:t,module:n}}))}).catch(function(t){console.error(t)}),t&&(console.log("folder id",t),e({type:r.default.dataset.set_folder,data:{folder_id:t,module:n}}))}},e.load_results=function(t){return function(t){var e=u.default.name;a.default.allProgress([s.default.folder.index({module:e,name:"results"}),s.default.file.index({module:e,datatype:"video",generated:1,limit:250})],function(e,n,i){console.log("biggan load progress",n,i),t({type:r.default.app.load_progress,progress:{i:n,n:i},data:{module:"biggan"}})}).then(function(e){var n=i(e,2),o=n[0],s=n[1];t({type:r.default.biggan.load_results,results:{resultsFolder:o[0],files:s}})})}},e.load_encodings=function(){return function(t){var e=u.default.name;a.default.allProgress([s.default.folder.index({module:e}),s.default.file.index({module:e,datatype:"image",generated:1})],function(t,e,n){}).then(function(e){var n=i(e,2),o=n[0],s=n[1],a={},u={};o.forEach(function(t){a[t.id]=t.name,u[t.name]=[]}),s.forEach(function(t){var e=a[t.folder_id];u[e].push(t)}),o.forEach(function(t){u[t.name].length||delete u[t.name]}),t({type:r.default.biggan.load_encodings,encodings:u})})}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.stop_queue=e.start_queue=e.add_task=e.stop_task=e.start_task=void 0;var i=Object.assign||function(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:{};return r.default.task.start_task(t,e),i({type:o.default.task.starting_task,task:t},e)},e.stop_task=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r.default.task.stop_task(t,e),i({type:o.default.task.stopping_task,task:t},e)},e.add_task=function(t){return function(e){s.default.task.create(t).then(function(t){r.default.task.add_task(t)})}},e.start_queue=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r.default.task.start_queue(t,e),i({type:o.default.task.starting_queue,task:t},e)},e.stop_queue=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r.default.task.stop_queue(t,e),i({type:o.default.task.stopping_queue,task:t},e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n0&&void 0!==arguments[0]?arguments[0]:{loading:!0,progress:null,error:null,data:null,folder_id:0},e=arguments[1];switch(e.type){case s.default.app.load_progress:return r({},t,{progress:e.progress});case s.default.dataset.load:return r({},t,{loading:!1,data:e.data});case s.default.dataset.set_folder:return r({},t,{folder_id:e.data.folder_id});case s.default.folder.create:return r({},t,{loading:!1,data:{folders:t.data.folders.concat([e.data.id]),folderLookup:r({},t.data.folderLookup,a({},e.data.id,e.data))}});case s.default.file.create:return function(t,e){if(console.log(e.data),!t.data||!t.data.datasetLookup)return t;var n=void 0,i=void 0,o=void 0,s=void 0,u=void 0;return(u=e.data.dataset?e.data.dataset:e.data.name?e.data.name.split(".")[0]:e.data.url?e.data.url:null)in t.data.datasetLookup?(i=t.data.datasetLookup[u],n=r({},i,{input:e.data.generated?i.input:[e.data.id].concat(i.input),output:e.data.generated?[e.data.id].concat(i.output):i.output})):(console.log(e.data.created_at,e.data.date),n={name:u,date:e.data.created_at||e.data.date,input:e.data.generated?[]:[e.data.id],checkpoints:[],output:e.data.generated?[e.data.id]:[]}),s=t.data.folderLookup[e.data.folder_id],o=r({},s,{datasets:s.datasets.concat([u]),files:s.files.concat([e.data.id])}),r({},t,{loading:!1,data:r({},t.data,{files:t.data.files.concat([e.data.id]),folderLookup:r({},t.data.folderLookup,a({},e.data.folder_id,o)),fileLookup:r({},t.data.fileLookup,a({},e.data.id,e.data)),datasetLookup:r({},t.data.datasetLookup,a({},u,n))})})}(t,e);case s.default.file.update:return function(t,e){var n,i=void 0,o=t.data.datasetLookup[e.data.dataset],s=t.data.fileLookup[e.data.id],u=void 0;return s&&e.data.dataset!==s.dataset&&(t.data.datasetLookup[s.dataset]&&(i=t.data.datasetLookup[s.dataset],old_dataset_update=r({},i,{input:i.input.filter(function(t){return t!==e.data.id}),output:i.output.filter(function(t){return t!==e.data.id})})),u=r({},o,{input:e.data.generated?[]:[e.data.id],output:e.data.generated?[e.data.id]:[]})),console.log("old_dataset",old_dataset_update.name),console.log("new_dataset",u.name),r({},t,{loading:!1,data:r({},t.data,{datasetLookup:i?r({},t.data.datasetLookup,(n={},a(n,i.name,old_dataset_update),a(n,o.name,u),n)):u?r({},t.data.datasetLookup,a({},o.name,u)):t.data.datasetLookup,fileLookup:r({},t.data.fileLookup,a({},e.data.id,e.data))})})}(t,e);case s.default.file.destroy:return function(t,e){if(!t.data)return t;var n=r({},t.data.fileLookup),i=r({},t.data.datasetLookup),o=r({},t.data.folderLookup),s=n[e.data.id];if(!s)return t;var a=t.data.datasetLookup[s.dataset],u=void 0;if(a)if((u=r({},a,{input:a.input.filter(function(t){return t!==s.id}),output:a.output.filter(function(t){return t!==s.id})})).input.length||u.checkpoints.length||u.output.length)console.log("dataset just needs sweeping"),i[s.dataset]=u;else{delete i[s.dataset];var l=o[s.folder_id];o[s.folder_id]=r({},l,{datasets:l.datasets.filter(function(t){return t!==s.dataset})})}return delete n[s.id],r({},t,{loading:!1,data:r({},t.data,{folderLookup:o,fileLookup:n,datasetLookup:i})})}(t,e);case s.default.dataset.list_epochs:return r({},t,{epochs:e.data.epochs});default:return t}}},function(t,e){var n,i,r=t.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(t){if(n===setTimeout)return setTimeout(t,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(e){return n.call(this,t,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o}catch(t){n=o}try{i="function"==typeof clearTimeout?clearTimeout:s}catch(t){i=s}}();var u,l=[],c=!1,h=-1;function p(){c&&u&&(c=!1,u.length?l=u.concat(l):h=-1,l.length&&f())}function f(){if(!c){var t=a(p);c=!0;for(var e=l.length;e;){for(u=l,l=[];++h1)for(var n=1;n * @license MIT */ var i=n(221),r=n(220),o=n(120);function s(){return u.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function a(t,e){if(s()=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function d(t,e){if(u.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return B(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return U(t).length;default:if(i)return B(t).length;e=(""+e).toLowerCase(),i=!0}}function m(t,e,n){var i=t[e];t[e]=t[n],t[n]=i}function y(t,e,n,i,r){if(0===t.length)return-1;if("string"==typeof n?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=r?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(r)return-1;n=t.length-1}else if(n<0){if(!r)return-1;n=0}if("string"==typeof e&&(e=u.from(e,i)),u.isBuffer(e))return 0===e.length?-1:_(t,e,n,i,r);if("number"==typeof e)return e&=255,u.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):_(t,[e],n,i,r);throw new TypeError("val must be string, number or Buffer")}function _(t,e,n,i,r){var o,s=1,a=t.length,u=e.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,n/=2}function l(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(r){var c=-1;for(o=n;oa&&(n=a-u),o=n;o>=0;o--){for(var h=!0,p=0;pr&&(i=r):i=r;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var s=0;s>8,r=n%256,o.push(r),o.push(i);return o}(e,t.length-n),t,n,i)}function x(t,e,n){return 0===e&&n===t.length?i.fromByteArray(t):i.fromByteArray(t.slice(e,n))}function T(t,e,n){n=Math.min(t.length,n);for(var i=[],r=e;r239?4:l>223?3:l>191?2:1;if(r+h<=n)switch(h){case 1:l<128&&(c=l);break;case 2:128==(192&(o=t[r+1]))&&(u=(31&l)<<6|63&o)>127&&(c=u);break;case 3:o=t[r+1],s=t[r+2],128==(192&o)&&128==(192&s)&&(u=(15&l)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:o=t[r+1],s=t[r+2],a=t[r+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(c=u)}null===c?(c=65533,h=1):c>65535&&(c-=65536,i.push(c>>>10&1023|55296),c=56320|1023&c),i.push(c),r+=h}return function(t){var e=t.length;if(e<=O)return String.fromCharCode.apply(String,t);var n="",i=0;for(;ithis.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return C(this,e,n);case"utf8":case"utf-8":return T(this,e,n);case"ascii":return P(this,e,n);case"latin1":case"binary":return A(this,e,n);case"base64":return x(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,n);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}.apply(this,arguments)},u.prototype.equals=function(t){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===u.compare(this,t)},u.prototype.inspect=function(){var t="",n=e.INSPECT_MAX_BYTES;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),""},u.prototype.compare=function(t,e,n,i,r){if(!u.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===i&&(i=0),void 0===r&&(r=this.length),e<0||n>t.length||i<0||r>this.length)throw new RangeError("out of range index");if(i>=r&&e>=n)return 0;if(i>=r)return-1;if(e>=n)return 1;if(e>>>=0,n>>>=0,i>>>=0,r>>>=0,this===t)return 0;for(var o=r-i,s=n-e,a=Math.min(o,s),l=this.slice(i,r),c=t.slice(e,n),h=0;hr)&&(n=r),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var o=!1;;)switch(i){case"hex":return v(this,t,e,n);case"utf8":case"utf-8":return g(this,t,e,n);case"ascii":return b(this,t,e,n);case"latin1":case"binary":return w(this,t,e,n);case"base64":return k(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function P(t,e,n){var i="";n=Math.min(t.length,n);for(var r=e;ri)&&(n=i);for(var r="",o=e;on)throw new RangeError("Trying to access beyond buffer length")}function R(t,e,n,i,r,o){if(!u.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||et.length)throw new RangeError("Index out of range")}function j(t,e,n,i){e<0&&(e=65535+e+1);for(var r=0,o=Math.min(t.length-n,2);r>>8*(i?r:1-r)}function N(t,e,n,i){e<0&&(e=4294967295+e+1);for(var r=0,o=Math.min(t.length-n,4);r>>8*(i?r:3-r)&255}function F(t,e,n,i,r,o){if(n+i>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(t,e,n,i,o){return o||F(t,0,n,4),r.write(t,e,n,i,23,4),n+4}function D(t,e,n,i,o){return o||F(t,0,n,8),r.write(t,e,n,i,52,8),n+8}u.prototype.slice=function(t,e){var n,i=this.length;if(t=~~t,e=void 0===e?i:~~e,t<0?(t+=i)<0&&(t=0):t>i&&(t=i),e<0?(e+=i)<0&&(e=0):e>i&&(e=i),e0&&(r*=256);)i+=this[t+--e]*r;return i},u.prototype.readUInt8=function(t,e){return e||M(t,1,this.length),this[t]},u.prototype.readUInt16LE=function(t,e){return e||M(t,2,this.length),this[t]|this[t+1]<<8},u.prototype.readUInt16BE=function(t,e){return e||M(t,2,this.length),this[t]<<8|this[t+1]},u.prototype.readUInt32LE=function(t,e){return e||M(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},u.prototype.readUInt32BE=function(t,e){return e||M(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},u.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||M(t,e,this.length);for(var i=this[t],r=1,o=0;++o=(r*=128)&&(i-=Math.pow(2,8*e)),i},u.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||M(t,e,this.length);for(var i=e,r=1,o=this[t+--i];i>0&&(r*=256);)o+=this[t+--i]*r;return o>=(r*=128)&&(o-=Math.pow(2,8*e)),o},u.prototype.readInt8=function(t,e){return e||M(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},u.prototype.readInt16LE=function(t,e){e||M(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt16BE=function(t,e){e||M(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},u.prototype.readInt32LE=function(t,e){return e||M(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},u.prototype.readInt32BE=function(t,e){return e||M(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},u.prototype.readFloatLE=function(t,e){return e||M(t,4,this.length),r.read(this,t,!0,23,4)},u.prototype.readFloatBE=function(t,e){return e||M(t,4,this.length),r.read(this,t,!1,23,4)},u.prototype.readDoubleLE=function(t,e){return e||M(t,8,this.length),r.read(this,t,!0,52,8)},u.prototype.readDoubleBE=function(t,e){return e||M(t,8,this.length),r.read(this,t,!1,52,8)},u.prototype.writeUIntLE=function(t,e,n,i){(t=+t,e|=0,n|=0,i)||R(this,t,e,n,Math.pow(2,8*n)-1,0);var r=1,o=0;for(this[e]=255&t;++o=0&&(o*=256);)this[e+r]=t/o&255;return e+n},u.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,1,255,0),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},u.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},u.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,2,65535,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},u.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):N(this,t,e,!0),e+4},u.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,4,4294967295,0),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},u.prototype.writeIntLE=function(t,e,n,i){if(t=+t,e|=0,!i){var r=Math.pow(2,8*n-1);R(this,t,e,n,r-1,-r)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+n},u.prototype.writeIntBE=function(t,e,n,i){if(t=+t,e|=0,!i){var r=Math.pow(2,8*n-1);R(this,t,e,n,r-1,-r)}var o=n-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},u.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,1,127,-128),u.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},u.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):j(this,t,e,!0),e+2},u.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,2,32767,-32768),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):j(this,t,e,!1),e+2},u.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,4,2147483647,-2147483648),u.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):N(this,t,e,!0),e+4},u.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||R(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),u.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):N(this,t,e,!1),e+4},u.prototype.writeFloatLE=function(t,e,n){return L(this,t,e,!0,n)},u.prototype.writeFloatBE=function(t,e,n){return L(this,t,e,!1,n)},u.prototype.writeDoubleLE=function(t,e,n){return D(this,t,e,!0,n)},u.prototype.writeDoubleBE=function(t,e,n){return D(this,t,e,!1,n)},u.prototype.copy=function(t,e,n,i){if(n||(n=0),i||0===i||(i=this.length),e>=t.length&&(e=t.length),e||(e=0),i>0&&i=this.length)throw new RangeError("sourceStart out of bounds");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),t.length-e=0;--r)t[r+e]=this[r+n];else if(o<1e3||!u.TYPED_ARRAY_SUPPORT)for(r=0;r>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o55295&&n<57344){if(!r){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}r=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),r=n;continue}n=65536+(r-55296<<10|n-56320)}else r&&(e-=3)>-1&&o.push(239,191,189);if(r=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function U(t){return i.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(q,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,n,i){for(var r=0;r=e.length||r>=t.length);++r)e[r+n]=t[r];return r}}).call(this,n(22))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default={name:"pix2pixhd",displayName:"Pix2PixHD",datatype:"video"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;nthis.memory){var i=this.length-this.memory;this._timeline.splice(0,i)}return this},t.Timeline.prototype.remove=function(t){var e=this._timeline.indexOf(t);return-1!==e&&this._timeline.splice(e,1),this},t.Timeline.prototype.get=function(e,n){n=t.defaultArg(n,"time");var i=this._search(e,n);return-1!==i?this._timeline[i]:null},t.Timeline.prototype.peek=function(){return this._timeline[0]},t.Timeline.prototype.shift=function(){return this._timeline.shift()},t.Timeline.prototype.getAfter=function(e,n){n=t.defaultArg(n,"time");var i=this._search(e,n);return i+10&&this._timeline[i-1][n]=0?this._timeline[r-1]:null},t.Timeline.prototype.cancel=function(t){if(this._timeline.length>1){var e=this._search(t);if(e>=0)if(this._timeline[e].time===t){for(var n=e;n>=0&&this._timeline[n].time===t;n--)e=n;this._timeline=this._timeline.slice(0,e)}else this._timeline=this._timeline.slice(0,e+1);else this._timeline=[]}else 1===this._timeline.length&&this._timeline[0].time>=t&&(this._timeline=[]);return this},t.Timeline.prototype.cancelBefore=function(t){var e=this._search(t);return e>=0&&(this._timeline=this._timeline.slice(e+1)),this},t.Timeline.prototype.previousEvent=function(t){var e=this._timeline.indexOf(t);return e>0?this._timeline[e-1]:null},t.Timeline.prototype._search=function(e,n){if(0===this._timeline.length)return-1;n=t.defaultArg(n,"time");var i=0,r=this._timeline.length,o=r;if(r>0&&this._timeline[r-1][n]<=e)return r-1;for(;ie)return s;a[n]>e?o=s:i=s+1}return-1},t.Timeline.prototype._iterate=function(e,n,i){n=t.defaultArg(n,0),i=t.defaultArg(i,this._timeline.length-1),this._timeline.slice(n,i+1).forEach(function(t){e.call(this,t)}.bind(this))},t.Timeline.prototype.forEach=function(t){return this._iterate(t),this},t.Timeline.prototype.forEachBefore=function(t,e){var n=this._search(t);return-1!==n&&this._iterate(e,0,n),this},t.Timeline.prototype.forEachAfter=function(t,e){var n=this._search(t);return this._iterate(e,n+1),this},t.Timeline.prototype.forEachBetween=function(t,e,n){var i=this._search(t),r=this._search(e);return-1!==i&&-1!==r?(this._timeline[i].time!==t&&(i+=1),this._timeline[r].time===e&&(r-=1),this._iterate(n,i,r)):-1===i&&this._iterate(n,0,r),this},t.Timeline.prototype.forEachFrom=function(t,e){for(var n=this._search(t);n>=0&&this._timeline[n].time>=t;)n--;return this._iterate(e,n+1),this},t.Timeline.prototype.forEachAtTime=function(t,e){var n=this._search(t);return-1!==n&&this._iterate(function(n){n.time===t&&e.call(this,n)},0,n),this},t.Timeline.prototype.dispose=function(){return t.prototype.dispose.call(this),this._timeline=null,this},t.Timeline}),n(function(t){t.supported&&(!window.hasOwnProperty("OfflineAudioContext")&&window.hasOwnProperty("webkitOfflineAudioContext")&&(window.OfflineAudioContext=window.webkitOfflineAudioContext),new OfflineAudioContext(1,1,44100).startRendering()instanceof Promise||(OfflineAudioContext.prototype._native_startRendering=OfflineAudioContext.prototype.startRendering,OfflineAudioContext.prototype.startRendering=function(){return new Promise(function(t){this.oncomplete=function(e){t(e.renderedBuffer)},this._native_startRendering()}.bind(this))}))}),n(function(t){if(t.supported){!window.hasOwnProperty("AudioContext")&&window.hasOwnProperty("webkitAudioContext")&&(window.AudioContext=window.webkitAudioContext),AudioContext.prototype.close||(AudioContext.prototype.close=function(){return t.isFunction(this.suspend)&&this.suspend(),Promise.resolve()}),AudioContext.prototype.resume||(AudioContext.prototype.resume=function(){return Promise.resolve()}),!AudioContext.prototype.createGain&&AudioContext.prototype.createGainNode&&(AudioContext.prototype.createGain=AudioContext.prototype.createGainNode),!AudioContext.prototype.createDelay&&AudioContext.prototype.createDelayNode&&(AudioContext.prototype.createDelay=AudioContext.prototype.createDelayNode);var e=!1,n=new OfflineAudioContext(1,1,44100),i=new Uint32Array([1179011410,48,1163280727,544501094,16,131073,44100,176400,1048580,1635017060,8,0,0,0,0]).buffer;try{n.decodeAudioData(i)instanceof Promise&&(e=!0)}catch(t){e=!1}e||(AudioContext.prototype._native_decodeAudioData=AudioContext.prototype.decodeAudioData,AudioContext.prototype.decodeAudioData=function(t){return new Promise(function(e,n){this._native_decodeAudioData(t,e,n)}.bind(this))})}}),n(function(t){t.Context=function(){t.Emitter.call(this);var n=t.defaults(arguments,["context"],t.Context);if(!n.context&&(n.context=new window.AudioContext,!n.context))throw new Error("could not create AudioContext. Possibly too many AudioContexts running already.");for(var i in this._context=n.context,this._context)this._defineProperty(this._context,i);this._latencyHint=n.latencyHint,this._constants={},this.lookAhead=n.lookAhead,this._computedUpdateInterval=0,this._ticker=new e(this.emit.bind(this,"tick"),n.clockSource,n.updateInterval),this._timeouts=new t.Timeline,this._timeoutIds=0,this.on("tick",this._timeoutLoop.bind(this))},t.extend(t.Context,t.Emitter),t.Emitter.mixin(t.Context),t.Context.defaults={clockSource:"worker",latencyHint:"interactive",lookAhead:.1,updateInterval:.03},t.Context.prototype._defineProperty=function(e,n){t.isUndef(this[n])&&Object.defineProperty(this,n,{get:function(){return"function"==typeof e[n]?e[n].bind(e):e[n]},set:function(t){e[n]=t}})},t.Context.prototype.now=function(){return this._context.currentTime+this.lookAhead},t.Context.prototype.ready=function(){return new Promise(function(t){"running"===this._context.state?t():this._context.resume().then(function(){t()})}.bind(this))},t.Context.prototype.close=function(){return this._context.close().then(function(){t.Context.emit("close",this)}.bind(this))},t.Context.prototype.getConstant=function(t){if(this._constants[t])return this._constants[t];for(var e=this._context.createBuffer(1,128,this._context.sampleRate),n=e.getChannelData(0),i=0;i1&&(this.input=new Array(t)),1===e?this.output=this.context.createGain():e>1&&(this.output=new Array(e))},Object.defineProperty(t.AudioNode.prototype,"channelCount",{get:function(){return this.output.channelCount},set:function(t){return this.output.channelCount=t}}),Object.defineProperty(t.AudioNode.prototype,"channelCountMode",{get:function(){return this.output.channelCountMode},set:function(t){return this.output.channelCountMode=t}}),Object.defineProperty(t.AudioNode.prototype,"channelInterpretation",{get:function(){return this.output.channelInterpretation},set:function(t){return this.output.channelInterpretation=t}}),Object.defineProperty(t.AudioNode.prototype,"numberOfInputs",{get:function(){return this.input?t.isArray(this.input)?this.input.length:1:0}}),Object.defineProperty(t.AudioNode.prototype,"numberOfOutputs",{get:function(){return this.output?t.isArray(this.output)?this.output.length:1:0}}),t.AudioNode.prototype._onConnect=function(){},t.AudioNode.prototype.connect=function(e,n,i){return e._onConnect&&e._onConnect(this),t.isArray(this.output)?(n=t.defaultArg(n,0),this.output[n].connect(e,0,i)):this.output.connect(e,n,i),this},t.AudioNode.prototype.disconnect=function(e,n,i){t.isArray(this.output)?t.isNumber(e)?this.output[e].disconnect():(n=t.defaultArg(n,0),this.output[n].disconnect(e,0,i)):this.output.disconnect.apply(this.output,arguments)},t.AudioNode.prototype.chain=function(){for(var t=this,e=0;e3&&(i=parseFloat(parseFloat(i).toFixed(3))),[n,e,i].join(":")},t.Time.prototype.toTicks=function(){var t=this._beatsToUnits(1),e=this.valueOf()/t;return Math.round(e*this._getPPQ())},t.Time.prototype.toSeconds=function(){return this.valueOf()},t.Time.prototype.toMidi=function(){return t.Frequency.ftom(this.toFrequency())},t.Time}),n(function(t){return t.TransportTime=function(e,n){if(!(this instanceof t.TransportTime))return new t.TransportTime(e,n);t.Time.call(this,e,n)},t.extend(t.TransportTime,t.Time),t.TransportTime.prototype._now=function(){return t.Transport.seconds},t.TransportTime}),n(function(t){return t.Type={Default:"number",Time:"time",Frequency:"frequency",TransportTime:"transportTime",Ticks:"ticks",NormalRange:"normalRange",AudioRange:"audioRange",Decibels:"db",Interval:"interval",BPM:"bpm",Positive:"positive",Gain:"gain",Cents:"cents",Degrees:"degrees",MIDI:"midi",BarsBeatsSixteenths:"barsBeatsSixteenths",Samples:"samples",Hertz:"hertz",Note:"note",Milliseconds:"milliseconds",Seconds:"seconds",Notation:"notation"},t.prototype.toSeconds=function(e){return t.isNumber(e)?e:t.isUndef(e)?this.now():t.isString(e)?new t.Time(e).toSeconds():e instanceof t.TimeBase?e.toSeconds():void 0},t.prototype.toFrequency=function(e){return t.isNumber(e)?e:t.isString(e)||t.isUndef(e)?new t.Frequency(e).valueOf():e instanceof t.TimeBase?e.toFrequency():void 0},t.prototype.toTicks=function(e){return t.isNumber(e)||t.isString(e)?new t.TransportTime(e).toTicks():t.isUndef(e)?t.Transport.ticks:e instanceof t.TimeBase?e.toTicks():void 0},t}),n(function(t){return t.Param=function(){var e=t.defaults(arguments,["param","units","convert"],t.Param);t.AudioNode.call(this),this._param=this.input=e.param,this.units=e.units,this.convert=e.convert,this.overridden=!1,this._events=new t.Timeline(1e3),t.isDefined(e.value)&&this._param&&(this.value=e.value)},t.extend(t.Param,t.AudioNode),t.Param.defaults={units:t.Type.Default,convert:!0,param:void 0},Object.defineProperty(t.Param.prototype,"value",{get:function(){var t=this.now();return this._toUnits(this.getValueAtTime(t))},set:function(t){this._initialValue=this._fromUnits(t),this.cancelScheduledValues(this.context.currentTime),this.setValueAtTime(t,this.context.currentTime)}}),Object.defineProperty(t.Param.prototype,"minValue",{get:function(){return this.units===t.Type.Time||this.units===t.Type.Frequency||this.units===t.Type.NormalRange||this.units===t.Type.Positive||this.units===t.Type.BPM?0:this.units===t.Type.AudioRange?-1:this.units===t.Type.Decibels?-1/0:this._param.minValue}}),Object.defineProperty(t.Param.prototype,"maxValue",{get:function(){return this.units===t.Type.NormalRange||this.units===t.Type.AudioRange?1:this._param.maxValue}}),t.Param.prototype._fromUnits=function(e){if(!this.convert&&!t.isUndef(this.convert)||this.overridden)return e;switch(this.units){case t.Type.Time:return this.toSeconds(e);case t.Type.Frequency:return this.toFrequency(e);case t.Type.Decibels:return t.dbToGain(e);case t.Type.NormalRange:return Math.min(Math.max(e,0),1);case t.Type.AudioRange:return Math.min(Math.max(e,-1),1);case t.Type.Positive:return Math.max(e,0);default:return e}},t.Param.prototype._toUnits=function(e){if(!this.convert&&!t.isUndef(this.convert))return e;switch(this.units){case t.Type.Decibels:return t.gainToDb(e);default:return e}},t.Param.prototype._minOutput=1e-5,t.Param.AutomationType={Linear:"linearRampToValueAtTime",Exponential:"exponentialRampToValueAtTime",Target:"setTargetAtTime",SetValue:"setValueAtTime"},t.Param.prototype.setValueAtTime=function(e,n){return n=this.toSeconds(n),e=this._fromUnits(e),this._events.add({type:t.Param.AutomationType.SetValue,value:e,time:n}),this._param.setValueAtTime(e,n),this},t.Param.prototype.getValueAtTime=function(e){e=this.toSeconds(e);var n=this._events.getAfter(e),i=this._events.get(e),r=t.defaultArg(this._initialValue,this._param.defaultValue),o=r;if(null===i)o=r;else if(i.type===t.Param.AutomationType.Target){var s,a=this._events.getBefore(i.time);s=null===a?r:a.value,o=this._exponentialApproach(i.time,s,i.value,i.constant,e)}else o=null===n?i.value:n.type===t.Param.AutomationType.Linear?this._linearInterpolate(i.time,i.value,n.time,n.value,e):n.type===t.Param.AutomationType.Exponential?this._exponentialInterpolate(i.time,i.value,n.time,n.value,e):i.value;return o},t.Param.prototype.setRampPoint=function(t){t=this.toSeconds(t);var e=this.getValueAtTime(t);return this.cancelAndHoldAtTime(t),0===e&&(e=this._minOutput),this.setValueAtTime(this._toUnits(e),t),this},t.Param.prototype.linearRampToValueAtTime=function(e,n){return e=this._fromUnits(e),n=this.toSeconds(n),this._events.add({type:t.Param.AutomationType.Linear,value:e,time:n}),this._param.linearRampToValueAtTime(e,n),this},t.Param.prototype.exponentialRampToValueAtTime=function(e,n){return e=this._fromUnits(e),e=Math.max(this._minOutput,e),n=this.toSeconds(n),this._events.add({type:t.Param.AutomationType.Exponential,time:n,value:e}),this._param.exponentialRampToValueAtTime(e,n),this},t.Param.prototype.exponentialRampTo=function(t,e,n){return n=this.toSeconds(n),this.setRampPoint(n),this.exponentialRampToValueAtTime(t,n+this.toSeconds(e)),this},t.Param.prototype.linearRampTo=function(t,e,n){return n=this.toSeconds(n),this.setRampPoint(n),this.linearRampToValueAtTime(t,n+this.toSeconds(e)),this},t.Param.prototype.targetRampTo=function(t,e,n){return n=this.toSeconds(n),this.setRampPoint(n),this.exponentialApproachValueAtTime(t,n,e),this},t.Param.prototype.exponentialApproachValueAtTime=function(t,e,n){var i=Math.log(this.toSeconds(n)+1)/Math.log(200);return e=this.toSeconds(e),this.setTargetAtTime(t,e,i)},t.Param.prototype.setTargetAtTime=function(e,n,i){if(e=this._fromUnits(e),i<=0)throw new Error("timeConstant must be greater than 0");return n=this.toSeconds(n),this._events.add({type:t.Param.AutomationType.Target,value:e,time:n,constant:i}),this._param.setTargetAtTime(e,n,i),this},t.Param.prototype.setValueCurveAtTime=function(e,n,i,r){r=t.defaultArg(r,1),i=this.toSeconds(i),n=this.toSeconds(n),this.setValueAtTime(e[0]*r,n);for(var o=i/(e.length-1),s=1;s=0;)this.emit("tick"),this._currentTime+=this.blockTime;return this._context.startRendering()},t.OfflineContext.prototype.close=function(){return this._context=null,Promise.resolve()},t.OfflineContext}),n(function(t){if(t.supported){var e=navigator.userAgent.toLowerCase();e.includes("safari")&&!e.includes("chrome")&&e.includes("mobile")&&(t.OfflineContext.prototype.createBufferSource=function(){var t=this._context.createBufferSource(),e=t.start;return t.start=function(n){this.setTimeout(function(){e.call(t,n)}.bind(this),0)}.bind(this),t})}}),n(function(t){return t.Gain=function(){var e=t.defaults(arguments,["gain","units"],t.Gain);t.AudioNode.call(this),this.input=this.output=this._gainNode=this.context.createGain(),this.gain=new t.Param({param:this._gainNode.gain,units:e.units,value:e.gain,convert:e.convert}),this._readOnly("gain")},t.extend(t.Gain,t.AudioNode),t.Gain.defaults={gain:1,convert:!0},t.Gain.prototype.dispose=function(){t.AudioNode.prototype.dispose.call(this),this._gainNode.disconnect(),this._gainNode=null,this._writable("gain"),this.gain.dispose(),this.gain=null},t.Gain}),n(function(t){if(t.supported&&!AudioContext.prototype.createConstantSource){var e=function(t){this.context=t;for(var e=t.createBuffer(1,128,t.sampleRate),n=e.getChannelData(0),i=0;i0&&(r=(1-s)/(1/r)),"linear"===this._attackCurve)this._sig.linearRampTo(n,r,e);else if("exponential"===this._attackCurve)this._sig.targetRampTo(n,r,e);else if(r>0){this._sig.cancelAndHoldAtTime(e);var a=this._attackCurve;if(r0){var i=this.toSeconds(this.release);if("linear"===this._releaseCurve)this._sig.linearRampTo(0,i,e);else if("exponential"===this._releaseCurve)this._sig.targetRampTo(0,i,e);else{var r=this._releaseCurve;t.isArray(r)&&(this._sig.cancelAndHoldAtTime(e),this._sig.setValueCurveAtTime(r,e,i,n))}}return this},t.Envelope.prototype.getValueAtTime=function(t){return this._sig.getValueAtTime(t)},t.Envelope.prototype.triggerAttackRelease=function(t,e,n){return e=this.toSeconds(e),this.triggerAttack(e,n),this.triggerRelease(e+this.toSeconds(t)),this},t.Envelope.prototype.cancel=function(t){return this._sig.cancelScheduledValues(t),this},t.Envelope.prototype.connect=t.SignalBase.prototype.connect,function(){var e,n,i=[];for(e=0;e<128;e++)i[e]=Math.sin(e/127*(Math.PI/2));var r=[];for(e=0;e<127;e++){n=e/127;var o=Math.sin(n*(2*Math.PI)*6.4-Math.PI/2)+1;r[e]=o/10+.83*n}r[127]=1;var s=[];for(e=0;e<128;e++)s[e]=Math.ceil(e/127*5)/5;var a=[];for(e=0;e<128;e++)n=e/127,a[e]=.5*(1-Math.cos(Math.PI*n));var u,l=[];for(e=0;e<128;e++){n=e/127;var c=4*Math.pow(n,3)+.2,h=Math.cos(c*Math.PI*2*n);l[e]=Math.abs(h*(1-n))}function p(t){for(var e=new Array(t.length),n=0;n0?a:(-r-s)/o)+n.time}return n?0===n.value?1/0:n.time+(e-n.ticks)/n.value:e/this._initialValue},t.TickSignal.prototype.ticksToTime=function(e,n){return n=this.toSeconds(n),new t.Time(this.getDurationOfTicks(e,n))},t.TickSignal.prototype.timeToTicks=function(e,n){n=this.toSeconds(n),e=this.toSeconds(e);var i=this.getTicksAtTime(n),r=this.getTicksAtTime(n+e);return new t.Ticks(r-i)},t.TickSignal}),n(function(t){return t.TimelineState=function(e){t.Timeline.call(this),this._initial=e},t.extend(t.TimelineState,t.Timeline),t.TimelineState.prototype.getValueAtTime=function(t){var e=this.get(t);return null!==e?e.state:this._initial},t.TimelineState.prototype.setStateAtTime=function(t,e){return this.add({state:t,time:e}),this},t.TimelineState.prototype.getLastState=function(t,e){e=this.toSeconds(e);for(var n=this._search(e);n>=0;n--){var i=this._timeline[n];if(i.state===t)return i}},t.TimelineState.prototype.getNextState=function(t,e){e=this.toSeconds(e);var n=this._search(e);if(-1!==n)for(var i=n;i0&&(this._tickOffset.cancel(n.time),this._state.cancel(n.time))}return this._state.cancel(e),this._state.setStateAtTime(t.State.Stopped,e),this.setTicksAtTime(0,e),this},t.TickSource.prototype.pause=function(e){return e=this.toSeconds(e),this._state.getValueAtTime(e)===t.State.Started&&this._state.setStateAtTime(t.State.Paused,e),this},t.TickSource.prototype.cancel=function(t){return t=this.toSeconds(t),this._state.cancel(t),this._tickOffset.cancel(t),this},t.TickSource.prototype.getTicksAtTime=function(e){e=this.toSeconds(e);var n=this._state.getLastState(t.State.Stopped,e),i={state:t.State.Paused,time:e};this._state.add(i);var r=n,o=0;return this._state.forEachBetween(n.time,e+this.sampleTime,function(e){var n=r.time,i=this._tickOffset.get(e.time);i.time>=r.time&&(o=i.ticks,n=i.time),r.state===t.State.Started&&e.state!==t.State.Started&&(o+=this.frequency.getTicksAtTime(e.time)-this.frequency.getTicksAtTime(n)),r=e}.bind(this)),this._state.remove(i),o},Object.defineProperty(t.TickSource.prototype,"ticks",{get:function(){return this.getTicksAtTime(this.now())},set:function(t){this.setTicksAtTime(t,this.now())}}),Object.defineProperty(t.TickSource.prototype,"seconds",{get:function(){return this.getSecondsAtTime(this.now())},set:function(t){var e=this.now(),n=this.frequency.timeToTicks(t,e);this.setTicksAtTime(n,e)}}),t.TickSource.prototype.getSecondsAtTime=function(e){e=this.toSeconds(e);var n=this._state.getLastState(t.State.Stopped,e),i={state:t.State.Paused,time:e};this._state.add(i);var r=n,o=0;return this._state.forEachBetween(n.time,e+this.sampleTime,function(e){var n=r.time,i=this._tickOffset.get(e.time);i.time>=r.time&&(o=i.seconds,n=i.time),r.state===t.State.Started&&e.state!==t.State.Started&&(o+=e.time-n),r=e}.bind(this)),this._state.remove(i),o},t.TickSource.prototype.setTicksAtTime=function(t,e){return e=this.toSeconds(e),this._tickOffset.cancel(e),this._tickOffset.add({time:e,ticks:t,seconds:this.frequency.getDurationOfTicks(t,e)}),this},t.TickSource.prototype.getStateAtTime=function(t){return t=this.toSeconds(t),this._state.getValueAtTime(t)},t.TickSource.prototype.getTimeOfTick=function(e,n){n=t.defaultArg(n,this.now());var i=this._tickOffset.get(n),r=this._state.get(n),o=Math.max(i.time,r.time),s=this.frequency.getTicksAtTime(o)+e-i.ticks;return this.frequency.getTimeOfTick(s)},t.TickSource.prototype.forEachTickBetween=function(e,n,i){var r=this._state.get(e);if(this._state.forEachBetween(e,n,function(n){r.state===t.State.Started&&n.state!==t.State.Started&&this.forEachTickBetween(Math.max(r.time,e),n.time-this.sampleTime,i),r=n}.bind(this)),e=Math.max(r.time,e),r.state===t.State.Started&&this._state){var o=this.frequency.getTicksAtTime(e),s=(o-this.frequency.getTicksAtTime(r.time))%1;0!==s&&(s=1-s);for(var a=this.frequency.getTimeOfTick(o+s),u=null;a0)if(null===t.left.right)(e=t.left).right=t.right,n=e;else{for(e=t.left.right;null!==e.right;)e=e.right;e.parent.right=e.left,n=e.parent,e.left=t.left,e.right=t.right}else if(null===t.right.left)(e=t.right).left=t.left,n=e;else{for(e=t.right.left;null!==e.left;)e=e.left;e.parent=e.parent,e.parent.left=e.right,n=e.parent,e.left=t.left,e.right=t.right}null!==t.parent?t.isLeftChild()?t.parent.left=e:t.parent.right=e:this._setRoot(e),this._rebalance(n)}t.dispose()},t.IntervalTimeline.prototype._rotateLeft=function(t){var e=t.parent,n=t.isLeftChild(),i=t.right;t.right=i.left,i.left=t,null!==e?n?e.left=i:e.right=i:this._setRoot(i)},t.IntervalTimeline.prototype._rotateRight=function(t){var e=t.parent,n=t.isLeftChild(),i=t.left;t.left=i.right,i.right=t,null!==e?n?e.left=i:e.right=i:this._setRoot(i)},t.IntervalTimeline.prototype._rebalance=function(t){var e=t.getBalance();e>1?t.left.getBalance()<0?this._rotateLeft(t.left):this._rotateRight(t):e<-1&&(t.right.getBalance()>0?this._rotateRight(t.right):this._rotateLeft(t))},t.IntervalTimeline.prototype.get=function(t){if(null!==this._root){var e=[];if(this._root.search(t,e),e.length>0){for(var n=e[0],i=1;in.low&&(n=e[i]);return n.event}}return null},t.IntervalTimeline.prototype.forEach=function(t){if(null!==this._root){var e=[];this._root.traverse(function(t){e.push(t)});for(var n=0;n=0;i--){var r=n[i].event;r&&e(r)}}return this},t.IntervalTimeline.prototype.forEachFrom=function(t,e){if(null!==this._root){var n=[];this._root.searchAfter(t,n);for(var i=n.length-1;i>=0;i--)e(n[i].event)}return this},t.IntervalTimeline.prototype.dispose=function(){var t=[];null!==this._root&&this._root.traverse(function(e){t.push(e)});for(var e=0;ethis.max||(null!==this.left&&this.left.search(t,e),this.low<=t&&this.high>t&&e.push(this),this.low>t||null!==this.right&&this.right.search(t,e))},e.prototype.searchAfter=function(t,e){this.low>=t&&(e.push(this),null!==this.left&&this.left.searchAfter(t,e)),null!==this.right&&this.right.searchAfter(t,e)},e.prototype.traverse=function(t){t(this),null!==this.left&&this.left.traverse(t),null!==this.right&&this.right.traverse(t)},e.prototype.updateHeight=function(){null!==this.left&&null!==this.right?this.height=Math.max(this.left.height,this.right.height)+1:null!==this.right?this.height=this.right.height+1:null!==this.left?this.height=this.left.height+1:this.height=0},e.prototype.updateMax=function(){this.max=this.high,null!==this.left&&(this.max=Math.max(this.max,this.left.max)),null!==this.right&&(this.max=Math.max(this.max,this.right.max))},e.prototype.getBalance=function(){var t=0;return null!==this.left&&null!==this.right?t=this.left.height-this.right.height:null!==this.left?t=this.left.height+1:null!==this.right&&(t=-(this.right.height+1)),t},e.prototype.isLeftChild=function(){return null!==this.parent&&this.parent.left===this},Object.defineProperty(e.prototype,"left",{get:function(){return this._left},set:function(t){this._left=t,null!==t&&(t.parent=this),this.updateHeight(),this.updateMax()}}),Object.defineProperty(e.prototype,"right",{get:function(){return this._right},set:function(t){this._right=t,null!==t&&(t.parent=this),this.updateHeight(),this.updateMax()}}),e.prototype.dispose=function(){this.parent=null,this._left=null,this._right=null,this.event=null},t.IntervalTimeline}),n(function(t){return t.Ticks=function(e,n){if(!(this instanceof t.Ticks))return new t.Ticks(e,n);t.TransportTime.call(this,e,n)},t.extend(t.Ticks,t.TransportTime),t.Ticks.prototype._defaultUnits="i",t.Ticks.prototype._now=function(){return t.Transport.ticks},t.Ticks.prototype._beatsToUnits=function(t){return this._getPPQ()*t},t.Ticks.prototype._secondsToUnits=function(t){return t/(60/this._getBpm())*this._getPPQ()},t.Ticks.prototype._ticksToUnits=function(t){return t},t.Ticks.prototype.toTicks=function(){return this.valueOf()},t.Ticks.prototype.toSeconds=function(){return this.valueOf()/this._getPPQ()*(60/this._getBpm())},t.Ticks}),n(function(t){return t.TransportEvent=function(e,n){n=t.defaultArg(n,t.TransportEvent.defaults),t.call(this),this.Transport=e,this.id=t.TransportEvent._eventId++,this.time=t.Ticks(n.time),this.callback=n.callback,this._once=n.once},t.extend(t.TransportEvent),t.TransportEvent.defaults={once:!1,callback:t.noOp},t.TransportEvent._eventId=0,t.TransportEvent.prototype.invoke=function(t){this.callback&&(this.callback(t),this._once&&this.Transport&&this.Transport.clear(this.id))},t.TransportEvent.prototype.dispose=function(){return t.prototype.dispose.call(this),this.Transport=null,this.callback=null,this.time=null,this},t.TransportEvent}),n(function(t){return t.TransportRepeatEvent=function(e,n){t.TransportEvent.call(this,e,n),n=t.defaultArg(n,t.TransportRepeatEvent.defaults),this.duration=t.Ticks(n.duration),this._interval=t.Ticks(n.interval),this._currentId=-1,this._nextId=-1,this._nextTick=this.time,this._boundRestart=this._restart.bind(this),this.Transport.on("start loopStart",this._boundRestart),this._restart()},t.extend(t.TransportRepeatEvent,t.TransportEvent),t.TransportRepeatEvent.defaults={duration:1/0,interval:1},t.TransportRepeatEvent.prototype.invoke=function(e){this._createEvents(e),t.TransportEvent.prototype.invoke.call(this,e)},t.TransportRepeatEvent.prototype._createEvents=function(e){var n=this.Transport.getTicksAtTime(e);n>=this.time&&n>=this._nextTick&&this._nextTick+this._intervalthis.time&&(this._nextTick=this.time+Math.ceil((n-this.time)/this._interval)*this._interval),this._currentId=this.Transport.scheduleOnce(this.invoke.bind(this),t.Ticks(this._nextTick)),this._nextTick+=this._interval,this._nextId=this.Transport.scheduleOnce(this.invoke.bind(this),t.Ticks(this._nextTick))},t.TransportRepeatEvent.prototype.dispose=function(){return this.Transport.clear(this._currentId),this.Transport.clear(this._nextId),this.Transport.off("start loopStart",this._boundRestart),this._boundCreateEvents=null,t.TransportEvent.prototype.dispose.call(this),this.duration=null,this._interval=null,this},t.TransportRepeatEvent}),n(function(t){t.Transport=function(){t.Emitter.call(this),t.getContext(function(){this.loop=!1,this._loopStart=0,this._loopEnd=0,this._ppq=e.defaults.PPQ,this._clock=new t.Clock({callback:this._processTick.bind(this),frequency:0}),this._bindClockEvents(),this.bpm=this._clock.frequency,this.bpm._toUnits=this._toUnits.bind(this),this.bpm._fromUnits=this._fromUnits.bind(this),this.bpm.units=t.Type.BPM,this.bpm.value=e.defaults.bpm,this._readOnly("bpm"),this._timeSignature=e.defaults.timeSignature,this._scheduledEvents={},this._timeline=new t.Timeline,this._repeatedEvents=new t.IntervalTimeline,this._syncedSignals=[],this._swingTicks=e.defaults.PPQ/2,this._swingAmount=0}.bind(this))},t.extend(t.Transport,t.Emitter),t.Transport.defaults={bpm:120,swing:0,swingSubdivision:"8n",timeSignature:4,loopStart:0,loopEnd:"4m",PPQ:192},t.Transport.prototype._processTick=function(e,n){if(this._swingAmount>0&&n%this._ppq!=0&&n%(2*this._swingTicks)!=0){var i=n%(2*this._swingTicks)/(2*this._swingTicks),r=Math.sin(i*Math.PI)*this._swingAmount;e+=t.Ticks(2*this._swingTicks/3).toSeconds()*r}this.loop&&n>=this._loopEnd&&(this.emit("loopEnd",e),this._clock.setTicksAtTime(this._loopStart,e),n=this._loopStart,this.emit("loopStart",e,this._clock.getSecondsAtTime(e)),this.emit("loop",e)),this._timeline.forEachAtTime(n,function(t){t.invoke(e)})},t.Transport.prototype.schedule=function(e,n){var i=new t.TransportEvent(this,{time:t.TransportTime(n),callback:e});return this._addEvent(i,this._timeline)},t.Transport.prototype.scheduleRepeat=function(e,n,i,r){var o=new t.TransportRepeatEvent(this,{callback:e,interval:t.Time(n),time:t.TransportTime(i),duration:t.Time(t.defaultArg(r,1/0))});return this._addEvent(o,this._repeatedEvents)},t.Transport.prototype.scheduleOnce=function(e,n){var i=new t.TransportEvent(this,{time:t.TransportTime(n),callback:e,once:!0});return this._addEvent(i,this._timeline)},t.Transport.prototype.clear=function(t){if(this._scheduledEvents.hasOwnProperty(t)){var e=this._scheduledEvents[t.toString()];e.timeline.remove(e.event),e.event.dispose(),delete this._scheduledEvents[t.toString()]}return this},t.Transport.prototype._addEvent=function(t,e){return this._scheduledEvents[t.id.toString()]={event:t,timeline:e},e.add(t),t.id},t.Transport.prototype.cancel=function(e){return e=t.defaultArg(e,0),e=this.toTicks(e),this._timeline.forEachFrom(e,function(t){this.clear(t.id)}.bind(this)),this._repeatedEvents.forEachFrom(e,function(t){this.clear(t.id)}.bind(this)),this},t.Transport.prototype._bindClockEvents=function(){this._clock.on("start",function(e,n){n=t.Ticks(n).toSeconds(),this.emit("start",e,n)}.bind(this)),this._clock.on("stop",function(t){this.emit("stop",t)}.bind(this)),this._clock.on("pause",function(t){this.emit("pause",t)}.bind(this))},Object.defineProperty(t.Transport.prototype,"state",{get:function(){return this._clock.getStateAtTime(this.now())}}),t.Transport.prototype.start=function(e,n){return t.isDefined(n)&&(n=this.toTicks(n)),this._clock.start(e,n),this},t.Transport.prototype.stop=function(t){return this._clock.stop(t),this},t.Transport.prototype.pause=function(t){return this._clock.pause(t),this},t.Transport.prototype.toggle=function(e){return e=this.toSeconds(e),this._clock.getStateAtTime(e)!==t.State.Started?this.start(e):this.stop(e),this},Object.defineProperty(t.Transport.prototype,"timeSignature",{get:function(){return this._timeSignature},set:function(e){t.isArray(e)&&(e=e[0]/e[1]*4),this._timeSignature=e}}),Object.defineProperty(t.Transport.prototype,"loopStart",{get:function(){return t.Ticks(this._loopStart).toSeconds()},set:function(t){this._loopStart=this.toTicks(t)}}),Object.defineProperty(t.Transport.prototype,"loopEnd",{get:function(){return t.Ticks(this._loopEnd).toSeconds()},set:function(t){this._loopEnd=this.toTicks(t)}}),t.Transport.prototype.setLoopPoints=function(t,e){return this.loopStart=t,this.loopEnd=e,this},Object.defineProperty(t.Transport.prototype,"swing",{get:function(){return this._swingAmount},set:function(t){this._swingAmount=t}}),Object.defineProperty(t.Transport.prototype,"swingSubdivision",{get:function(){return t.Ticks(this._swingTicks).toNotation()},set:function(t){this._swingTicks=this.toTicks(t)}}),Object.defineProperty(t.Transport.prototype,"position",{get:function(){var e=this.now(),n=this._clock.getTicksAtTime(e);return t.Ticks(n).toBarsBeatsSixteenths()},set:function(t){var e=this.toTicks(t);this.ticks=e}}),Object.defineProperty(t.Transport.prototype,"seconds",{get:function(){return this._clock.seconds},set:function(t){var e=this.now(),n=this.bpm.timeToTicks(t,e);this.ticks=n}}),Object.defineProperty(t.Transport.prototype,"progress",{get:function(){if(this.loop){var t=this.now();return(this._clock.getTicksAtTime(t)-this._loopStart)/(this._loopEnd-this._loopStart)}return 0}}),Object.defineProperty(t.Transport.prototype,"ticks",{get:function(){return this._clock.ticks},set:function(e){if(this._clock.ticks!==e){var n=this.now();this.state===t.State.Started?(this.emit("stop",n),this._clock.setTicksAtTime(e,n),this.emit("start",n,this.seconds)):this._clock.setTicksAtTime(e,n)}}}),t.Transport.prototype.getTicksAtTime=function(t){return Math.round(this._clock.getTicksAtTime(t))},t.Transport.prototype.getSecondsAtTime=function(t){return this._clock.getSecondsAtTime(t)},Object.defineProperty(t.Transport.prototype,"PPQ",{get:function(){return this._ppq},set:function(t){var e=this.bpm.value;this._ppq=t,this.bpm.value=e}}),t.Transport.prototype._fromUnits=function(t){return 1/(60/t/this.PPQ)},t.Transport.prototype._toUnits=function(t){return t/this.PPQ*60},t.Transport.prototype.nextSubdivision=function(e){if(e=this.toTicks(e),this.state!==t.State.Started)return 0;var n=this.now(),i=e-this.getTicksAtTime(n)%e;return this._clock.nextTickTime(i,n)},t.Transport.prototype.syncSignal=function(e,n){if(!n){var i=this.now();n=0!==e.getValueAtTime(i)?e.getValueAtTime(i)/this.bpm.getValueAtTime(i):0}var r=new t.Gain(n);return this.bpm.chain(r,e._param),this._syncedSignals.push({ratio:r,signal:e,initial:e.value}),e.value=0,this},t.Transport.prototype.unsyncSignal=function(t){for(var e=this._syncedSignals.length-1;e>=0;e--){var n=this._syncedSignals[e];n.signal===t&&(n.ratio.dispose(),n.signal.value=n.initial,this._syncedSignals.splice(e,1))}return this},t.Transport.prototype.dispose=function(){return t.Emitter.prototype.dispose.call(this),this._clock.dispose(),this._clock=null,this._writable("bpm"),this.bpm=null,this._timeline.dispose(),this._timeline=null,this._repeatedEvents.dispose(),this._repeatedEvents=null,this};var e=t.Transport;return t.Transport=new e,t.Context.on("init",function(n){n.Transport instanceof e?t.Transport=n.Transport:t.Transport=new e,n.Transport=t.Transport}),t.Context.on("close",function(t){t.Transport instanceof e&&t.Transport.dispose()}),t.Transport}),n(function(t){return t.Volume=function(){var e=t.defaults(arguments,["volume"],t.Volume);t.AudioNode.call(this),this.output=this.input=new t.Gain(e.volume,t.Type.Decibels),this._unmutedVolume=e.volume,this.volume=this.output.gain,this._readOnly("volume"),this.mute=e.mute},t.extend(t.Volume,t.AudioNode),t.Volume.defaults={volume:0,mute:!1},Object.defineProperty(t.Volume.prototype,"mute",{get:function(){return this.volume.value===-1/0},set:function(t){!this.mute&&t?(this._unmutedVolume=this.volume.value,this.volume.value=-1/0):this.mute&&!t&&(this.volume.value=this._unmutedVolume)}}),t.Volume.prototype.dispose=function(){return this.input.dispose(),t.AudioNode.prototype.dispose.call(this),this._writable("volume"),this.volume.dispose(),this.volume=null,this},t.Volume}),n(function(t){t.Master=function(){t.AudioNode.call(this),t.getContext(function(){this.createInsOuts(1,0),this._volume=this.output=new t.Volume,this.volume=this._volume.volume,this._readOnly("volume"),this.input.chain(this.output,this.context.destination)}.bind(this))},t.extend(t.Master,t.AudioNode),t.Master.defaults={volume:0,mute:!1},Object.defineProperty(t.Master.prototype,"mute",{get:function(){return this._volume.mute},set:function(t){this._volume.mute=t}}),t.Master.prototype.chain=function(){this.input.disconnect(),this.input.chain.apply(this.input,arguments),arguments[arguments.length-1].connect(this.output)},t.Master.prototype.dispose=function(){t.AudioNode.prototype.dispose.call(this),this._writable("volume"),this._volume.dispose(),this._volume=null,this.volume=null},t.AudioNode.prototype.toMaster=function(){return this.connect(t.Master),this},window.AudioNode&&(AudioNode.prototype.toMaster=function(){return this.connect(t.Master),this});var e=t.Master;return t.Master=new e,t.Context.on("init",function(n){n.Master instanceof e?t.Master=n.Master:t.Master=new e,n.Master=t.Master}),t.Context.on("close",function(t){t.Master instanceof e&&t.Master.dispose()}),t.Master}),n(function(t){return t.Source=function(e){e=t.defaultArg(e,t.Source.defaults),t.AudioNode.call(this),this._volume=this.output=new t.Volume(e.volume),this.volume=this._volume.volume,this._readOnly("volume"),this._state=new t.TimelineState(t.State.Stopped),this._state.memory=100,this._synced=!1,this._scheduled=[],this._volume.output.output.channelCount=2,this._volume.output.output.channelCountMode="explicit",this.mute=e.mute},t.extend(t.Source,t.AudioNode),t.Source.defaults={volume:0,mute:!1},Object.defineProperty(t.Source.prototype,"state",{get:function(){return this._synced?t.Transport.state===t.State.Started?this._state.getValueAtTime(t.Transport.seconds):t.State.Stopped:this._state.getValueAtTime(this.now())}}),Object.defineProperty(t.Source.prototype,"mute",{get:function(){return this._volume.mute},set:function(t){this._volume.mute=t}}),t.Source.prototype._start=t.noOp,t.Source.prototype.restart=t.noOp,t.Source.prototype._stop=t.noOp,t.Source.prototype.start=function(e,n,i){if(e=t.isUndef(e)&&this._synced?t.Transport.seconds:this.toSeconds(e),this._state.getValueAtTime(e)===t.State.Started)this._state.cancel(e),this._state.setStateAtTime(t.State.Started,e),this.restart(e,n,i);else if(this._state.setStateAtTime(t.State.Started,e),this._synced){var r=this._state.get(e);r.offset=t.defaultArg(n,0),r.duration=i;var o=t.Transport.schedule(function(t){this._start(t,n,i)}.bind(this),e);this._scheduled.push(o),t.Transport.state===t.State.Started&&this._syncedStart(this.now(),t.Transport.seconds)}else this._start.apply(this,arguments);return this},t.Source.prototype.stop=function(e){if(e=t.isUndef(e)&&this._synced?t.Transport.seconds:this.toSeconds(e),this._synced){var n=t.Transport.schedule(this._stop.bind(this),e);this._scheduled.push(n)}else this._stop.apply(this,arguments);return this._state.cancel(e),this._state.setStateAtTime(t.State.Stopped,e),this},t.Source.prototype.sync=function(){return this._synced=!0,this._syncedStart=function(e,n){if(n>0){var i=this._state.get(n);if(i&&i.state===t.State.Started&&i.time!==n){var r,o=n-this.toSeconds(i.time);i.duration&&(r=this.toSeconds(i.duration)-o),this._start(e,this.toSeconds(i.offset)+o,r)}}}.bind(this),this._syncedStop=function(e){var n=t.Transport.getSecondsAtTime(Math.max(e-this.sampleTime,0));this._state.getValueAtTime(n)===t.State.Started&&this._stop(e)}.bind(this),t.Transport.on("start loopStart",this._syncedStart),t.Transport.on("stop pause loopEnd",this._syncedStop),this},t.Source.prototype.unsync=function(){this._synced&&(t.Transport.off("stop pause loopEnd",this._syncedStop),t.Transport.off("start loopStart",this._syncedStart)),this._synced=!1;for(var e=0;e0}}),Object.defineProperty(t.Buffer.prototype,"duration",{get:function(){return this._buffer?this._buffer.duration:0}}),Object.defineProperty(t.Buffer.prototype,"length",{get:function(){return this._buffer?this._buffer.length:0}}),Object.defineProperty(t.Buffer.prototype,"numberOfChannels",{get:function(){return this._buffer?this._buffer.numberOfChannels:0}}),t.Buffer.prototype.fromArray=function(t){var e=t[0].length>0,n=e?t.length:1,i=e?t[0].length:t.length,r=this.context.createBuffer(n,i,this.context.sampleRate);e||1!==n||(t=[t]);for(var o=0;o=this._startTime&&(-1===this._stopTime||e<=this._stopTime)?t.State.Started:t.State.Stopped},t.OscillatorNode.prototype.start=function(t){if(-1!==this._startTime)throw new Error("cannot call OscillatorNode.start more than once");this._startTime=this.toSeconds(t),this._oscillator.start(this._startTime);var e=this.context.currentTime;return this._gainNode.gain.cancelScheduledValues(e),this._gainNode.gain.setValueAtTime(0,e),this._gainNode.gain.setValueAtTime(1,this._startTime),this},t.OscillatorNode.prototype.setPeriodicWave=function(t){return this._oscillator.setPeriodicWave(t),this},t.OscillatorNode.prototype.stop=function(t){return this.cancelStop(),this._stopTime=this.toSeconds(t),this._gainNode.gain.setValueAtTime(0,this._stopTime),this.context.clearTimeout(this._timeout),this._timeout=this.context.setTimeout(function(){this._oscillator.stop(this.now()),this.onended()}.bind(this),this._stopTime-this.now()),this},t.OscillatorNode.prototype.cancelStop=function(){return-1!==this._startTime&&(this._gainNode.gain.cancelScheduledValues(this._startTime+this.sampleTime),this._gainNode.gain.setValueAtTime(1,Math.max(this.now(),this._startTime)),this.context.clearTimeout(this._timeout),this._stopTime=-1),this},Object.defineProperty(t.OscillatorNode.prototype,"type",{get:function(){return this._oscillator.type},set:function(t){this._oscillator.type=t}}),t.OscillatorNode.prototype.dispose=function(){return this.context.clearTimeout(this._timeout),t.AudioNode.prototype.dispose.call(this),this.onended=null,this._oscillator.disconnect(),this._oscillator=null,this._gainNode.dispose(),this._gainNode=null,this.frequency.dispose(),this.frequency=null,this.detune.dispose(),this.detune=null,this},t.OscillatorNode}),n(function(t){return t.Oscillator=function(){var e=t.defaults(arguments,["frequency","type"],t.Oscillator);t.Source.call(this,e),this._oscillator=null,this.frequency=new t.Signal(e.frequency,t.Type.Frequency),this.detune=new t.Signal(e.detune,t.Type.Cents),this._wave=null,this._partials=t.defaultArg(e.partials,[1]),this._phase=e.phase,this._type=null,this.type=e.type,this.phase=this._phase,this._readOnly(["frequency","detune"])},t.extend(t.Oscillator,t.Source),t.Oscillator.defaults={type:"sine",frequency:440,detune:0,phase:0,partials:[]},t.Oscillator.Type={Sine:"sine",Triangle:"triangle",Sawtooth:"sawtooth",Square:"square",Custom:"custom"},t.Oscillator.prototype._start=function(e){this._oscillator=new t.OscillatorNode,this._wave?this._oscillator.setPeriodicWave(this._wave):this._oscillator.type=this._type,this._oscillator.connect(this.output),this.frequency.connect(this._oscillator.frequency),this.detune.connect(this._oscillator.detune),e=this.toSeconds(e),this._oscillator.start(e)},t.Oscillator.prototype._stop=function(t){return this._oscillator&&(t=this.toSeconds(t),this._oscillator.stop(t)),this},t.Oscillator.prototype.restart=function(t){return this._oscillator.cancelStop(),this._state.cancel(this.toSeconds(t)),this},t.Oscillator.prototype.syncFrequency=function(){return t.Transport.syncSignal(this.frequency),this},t.Oscillator.prototype.unsyncFrequency=function(){return t.Transport.unsyncSignal(this.frequency),this},Object.defineProperty(t.Oscillator.prototype,"type",{get:function(){return this._type},set:function(e){var n=[t.Oscillator.Type.Sine,t.Oscillator.Type.Square,t.Oscillator.Type.Triangle,t.Oscillator.Type.Sawtooth].includes(e);if(0===this._phase&&n)this._wave=null,null!==this._oscillator&&this._oscillator.type;else{var i=this._getRealImaginary(e,this._phase),r=this.context.createPeriodicWave(i[0],i[1]);this._wave=r,null!==this._oscillator&&this._oscillator.setPeriodicWave(this._wave)}this._type=e}}),t.Oscillator.prototype._getRealImaginary=function(e,n){var i=2048,r=new Float32Array(i),o=new Float32Array(i),s=1;if(e===t.Oscillator.Type.Custom)i=s=this._partials.length+1;else{var a=/^(sine|triangle|square|sawtooth)(\d+)$/.exec(e);a&&(s=parseInt(a[2])+1,e=a[1],i=s=Math.max(s,2))}for(var u=1;u>1&1?-1:1):0;break;case t.Oscillator.Type.Custom:l=this._partials[u-1];break;default:throw new TypeError("Tone.Oscillator: invalid type: "+e)}0!==l?(r[u]=-l*Math.sin(n*u),o[u]=l*Math.cos(n*u)):(r[u]=0,o[u]=0)}return[r,o]},t.Oscillator.prototype._inverseFFT=function(t,e,n){for(var i=0,r=t.length,o=0;or&&i=this.values.length&&(this.index=0)):e===t.CtrlPattern.Type.Down?(this.index--,this.index<0&&(this.index=this.values.length-1)):e===t.CtrlPattern.Type.UpDown||e===t.CtrlPattern.Type.DownUp?(this._direction===t.CtrlPattern.Type.Up?this.index++:this.index--,this.index<0?(this.index=1,this._direction=t.CtrlPattern.Type.Up):this.index>=this.values.length&&(this.index=this.values.length-2,this._direction=t.CtrlPattern.Type.Down)):e===t.CtrlPattern.Type.Random?this.index=Math.floor(Math.random()*this.values.length):e===t.CtrlPattern.Type.RandomWalk?Math.random()<.5?(this.index--,this.index=Math.max(this.index,0)):(this.index++,this.index=Math.min(this.index,this.values.length-1)):e===t.CtrlPattern.Type.RandomOnce?(this.index++,this.index>=this.values.length&&(this.index=0,this._shuffleValues())):e===t.CtrlPattern.Type.AlternateUp?(this._direction===t.CtrlPattern.Type.Up?(this.index+=2,this._direction=t.CtrlPattern.Type.Down):(this.index-=1,this._direction=t.CtrlPattern.Type.Up),this.index>=this.values.length&&(this.index=0,this._direction=t.CtrlPattern.Type.Up)):e===t.CtrlPattern.Type.AlternateDown&&(this._direction===t.CtrlPattern.Type.Up?(this.index+=1,this._direction=t.CtrlPattern.Type.Down):(this.index-=2,this._direction=t.CtrlPattern.Type.Up),this.index<0&&(this.index=this.values.length-1,this._direction=t.CtrlPattern.Type.Down)),this.value},t.CtrlPattern.prototype._shuffleValues=function(){var t=[];this._shuffled=[];for(var e=0;e0;){var n=t.splice(Math.floor(t.length*Math.random()),1);this._shuffled.push(n[0])}},t.CtrlPattern.prototype.dispose=function(){this._shuffled=null,this.values=null},t.CtrlPattern}),n(function(t){return t.CtrlRandom=function(){var e=t.defaults(arguments,["min","max"],t.CtrlRandom);t.call(this),this.min=e.min,this.max=e.max,this.integer=e.integer},t.extend(t.CtrlRandom),t.CtrlRandom.defaults={min:0,max:1,integer:!1},Object.defineProperty(t.CtrlRandom.prototype,"value",{get:function(){var t=this.toSeconds(this.min),e=this.toSeconds(this.max),n=Math.random(),i=n*t+(1-n)*e;return this.integer&&(i=Math.floor(i)),i}}),t.CtrlRandom}),n(function(t){return t.Buffers=function(e){var n=Array.prototype.slice.call(arguments);n.shift();var i=t.defaults(n,["onload","baseUrl"],t.Buffers);for(var r in t.call(this),this._buffers={},this.baseUrl=i.baseUrl,this._loadingCount=0,e)this._loadingCount++,this.add(r,e[r],this._bufferLoaded.bind(this,i.onload))},t.extend(t.Buffers),t.Buffers.defaults={onload:t.noOp,baseUrl:""},t.Buffers.prototype.has=function(t){return this._buffers.hasOwnProperty(t)},t.Buffers.prototype.get=function(t){if(this.has(t))return this._buffers[t];throw new Error("Tone.Buffers: no buffer named "+t)},t.Buffers.prototype._bufferLoaded=function(t){this._loadingCount--,0===this._loadingCount&&t&&t(this)},Object.defineProperty(t.Buffers.prototype,"loaded",{get:function(){var t=!0;for(var e in this._buffers){var n=this.get(e);t=t&&n.loaded}return t}}),t.Buffers.prototype.add=function(e,n,i){return i=t.defaultArg(i,t.noOp),n instanceof t.Buffer?(this._buffers[e]=n,i(this)):n instanceof AudioBuffer?(this._buffers[e]=new t.Buffer(n),i(this)):t.isString(n)&&(this._buffers[e]=new t.Buffer(this.baseUrl+n,i)),this},t.Buffers.prototype.dispose=function(){for(var e in t.prototype.dispose.call(this),this._buffers)this._buffers[e].dispose();return this._buffers=null,this},t.Buffers}),n(function(t){var e={};return t.prototype.send=function(n,i){e.hasOwnProperty(n)||(e[n]=this.context.createGain()),i=t.defaultArg(i,0);var r=new t.Gain(i,t.Type.Decibels);return this.connect(r),r.connect(e[n]),r},t.prototype.receive=function(t,n){return e.hasOwnProperty(t)||(e[t]=this.context.createGain()),e[t].connect(this,0,n),this},t.Context.on("init",function(t){t.Buses?e=t.Buses:(e={},t.Buses=e)}),t}),n(function(t){return t.Draw=function(){t.call(this),this._events=new t.Timeline,this.expiration=.25,this.anticipation=.008,this._boundDrawLoop=this._drawLoop.bind(this)},t.extend(t.Draw),t.Draw.prototype.schedule=function(t,e){return this._events.add({callback:t,time:this.toSeconds(e)}),1===this._events.length&&requestAnimationFrame(this._boundDrawLoop),this},t.Draw.prototype.cancel=function(t){return this._events.cancel(this.toSeconds(t)),this},t.Draw.prototype._drawLoop=function(){for(var e=t.now();this._events.length&&this._events.peek().time-this.anticipation<=e;){var n=this._events.shift();e-n.time<=this.expiration&&n.callback()}this._events.length>0&&requestAnimationFrame(this._boundDrawLoop)},t.Draw=new t.Draw,t.Draw}),n(function(t){t.Listener=function(){t.call(this),this._orientation=[0,0,0,0,0,0],this._position=[0,0,0],t.getContext(function(){this.set(e.defaults)}.bind(this))},t.extend(t.Listener),t.Listener.defaults={positionX:0,positionY:0,positionZ:0,forwardX:0,forwardY:0,forwardZ:1,upX:0,upY:1,upZ:0},t.Listener.prototype._rampTimeConstant=.01,t.Listener.prototype.setPosition=function(t,e,n){if(this.context.listener.positionX){var i=this.now();this.context.listener.positionX.setTargetAtTime(t,i,this._rampTimeConstant),this.context.listener.positionY.setTargetAtTime(e,i,this._rampTimeConstant),this.context.listener.positionZ.setTargetAtTime(n,i,this._rampTimeConstant)}else this.context.listener.setPosition(t,e,n);return this._position=Array.prototype.slice.call(arguments),this},t.Listener.prototype.setOrientation=function(t,e,n,i,r,o){if(this.context.listener.forwardX){var s=this.now();this.context.listener.forwardX.setTargetAtTime(t,s,this._rampTimeConstant),this.context.listener.forwardY.setTargetAtTime(e,s,this._rampTimeConstant),this.context.listener.forwardZ.setTargetAtTime(n,s,this._rampTimeConstant),this.context.listener.upX.setTargetAtTime(i,s,this._rampTimeConstant),this.context.listener.upY.setTargetAtTime(r,s,this._rampTimeConstant),this.context.listener.upZ.setTargetAtTime(o,s,this._rampTimeConstant)}else this.context.listener.setOrientation(t,e,n,i,r,o);return this._orientation=Array.prototype.slice.call(arguments),this},Object.defineProperty(t.Listener.prototype,"positionX",{set:function(t){this._position[0]=t,this.setPosition.apply(this,this._position)},get:function(){return this._position[0]}}),Object.defineProperty(t.Listener.prototype,"positionY",{set:function(t){this._position[1]=t,this.setPosition.apply(this,this._position)},get:function(){return this._position[1]}}),Object.defineProperty(t.Listener.prototype,"positionZ",{set:function(t){this._position[2]=t,this.setPosition.apply(this,this._position)},get:function(){return this._position[2]}}),Object.defineProperty(t.Listener.prototype,"forwardX",{set:function(t){this._orientation[0]=t,this.setOrientation.apply(this,this._orientation)},get:function(){return this._orientation[0]}}),Object.defineProperty(t.Listener.prototype,"forwardY",{set:function(t){this._orientation[1]=t,this.setOrientation.apply(this,this._orientation)},get:function(){return this._orientation[1]}}),Object.defineProperty(t.Listener.prototype,"forwardZ",{set:function(t){this._orientation[2]=t,this.setOrientation.apply(this,this._orientation)},get:function(){return this._orientation[2]}}),Object.defineProperty(t.Listener.prototype,"upX",{set:function(t){this._orientation[3]=t,this.setOrientation.apply(this,this._orientation)},get:function(){return this._orientation[3]}}),Object.defineProperty(t.Listener.prototype,"upY",{set:function(t){this._orientation[4]=t,this.setOrientation.apply(this,this._orientation)},get:function(){return this._orientation[4]}}),Object.defineProperty(t.Listener.prototype,"upZ",{set:function(t){this._orientation[5]=t,this.setOrientation.apply(this,this._orientation)},get:function(){return this._orientation[5]}}),t.Listener.prototype.dispose=function(){return this._orientation=null,this._position=null,this};var e=t.Listener;return t.Listener=new e,t.Context.on("init",function(n){n.Listener instanceof e?t.Listener=n.Listener:t.Listener=new e,n.Listener=t.Listener}),t.Listener}),n(function(t){return t.Offline=function(e,n){var i,r=t.context.sampleRate,o=t.context,s=function e(n,i,r,o){o=t.defaultArg(o,0);var s=new t.OfflineContext(2,i,r);t.context=s;var a=n(t.Transport);return s.currentTime>0&&o<1e3?e(n,i,r,++o):{response:a,context:s}}(e,n,r),a=s.response,u=s.context;return i=a instanceof Promise?a.then(function(){return u.render()}):u.render(),t.context=o,i.then(function(e){return new t.Buffer(e)})},t.Offline}),n(function(t){return t.Effect=function(){var e=t.defaults(arguments,["wet"],t.Effect);t.AudioNode.call(this),this.createInsOuts(1,1),this._dryWet=new t.CrossFade(e.wet),this.wet=this._dryWet.fade,this.effectSend=new t.Gain,this.effectReturn=new t.Gain,this.input.connect(this._dryWet.a),this.input.connect(this.effectSend),this.effectReturn.connect(this._dryWet.b),this._dryWet.connect(this.output),this._readOnly(["wet"])},t.extend(t.Effect,t.AudioNode),t.Effect.defaults={wet:1},t.Effect.prototype.connectEffect=function(t){return this.effectSend.chain(t,this.effectReturn),this},t.Effect.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this._dryWet.dispose(),this._dryWet=null,this.effectSend.dispose(),this.effectSend=null,this.effectReturn.dispose(),this.effectReturn=null,this._writable(["wet"]),this.wet=null,this},t.Effect}),n(function(t){return t.AutoFilter=function(){var e=t.defaults(arguments,["frequency","baseFrequency","octaves"],t.AutoFilter);t.Effect.call(this,e),this._lfo=new t.LFO({frequency:e.frequency,amplitude:e.depth}),this.depth=this._lfo.amplitude,this.frequency=this._lfo.frequency,this.filter=new t.Filter(e.filter),this._octaves=0,this.connectEffect(this.filter),this._lfo.connect(this.filter.frequency),this.type=e.type,this._readOnly(["frequency","depth"]),this.octaves=e.octaves,this.baseFrequency=e.baseFrequency},t.extend(t.AutoFilter,t.Effect),t.AutoFilter.defaults={frequency:1,type:"sine",depth:1,baseFrequency:200,octaves:2.6,filter:{type:"lowpass",rolloff:-12,Q:1}},t.AutoFilter.prototype.start=function(t){return this._lfo.start(t),this},t.AutoFilter.prototype.stop=function(t){return this._lfo.stop(t),this},t.AutoFilter.prototype.sync=function(t){return this._lfo.sync(t),this},t.AutoFilter.prototype.unsync=function(){return this._lfo.unsync(),this},Object.defineProperty(t.AutoFilter.prototype,"type",{get:function(){return this._lfo.type},set:function(t){this._lfo.type=t}}),Object.defineProperty(t.AutoFilter.prototype,"baseFrequency",{get:function(){return this._lfo.min},set:function(t){this._lfo.min=this.toFrequency(t),this.octaves=this._octaves}}),Object.defineProperty(t.AutoFilter.prototype,"octaves",{get:function(){return this._octaves},set:function(t){this._octaves=t,this._lfo.max=this.baseFrequency*Math.pow(2,t)}}),t.AutoFilter.prototype.dispose=function(){return t.Effect.prototype.dispose.call(this),this._lfo.dispose(),this._lfo=null,this.filter.dispose(),this.filter=null,this._writable(["frequency","depth"]),this.frequency=null,this.depth=null,this},t.AutoFilter}),n(function(t){return t.AutoPanner=function(){var e=t.defaults(arguments,["frequency"],t.AutoPanner);t.Effect.call(this,e),this._lfo=new t.LFO({frequency:e.frequency,amplitude:e.depth,min:-1,max:1}),this.depth=this._lfo.amplitude,this._panner=new t.Panner,this.frequency=this._lfo.frequency,this.connectEffect(this._panner),this._lfo.connect(this._panner.pan),this.type=e.type,this._readOnly(["depth","frequency"])},t.extend(t.AutoPanner,t.Effect),t.AutoPanner.defaults={frequency:1,type:"sine",depth:1},t.AutoPanner.prototype.start=function(t){return this._lfo.start(t),this},t.AutoPanner.prototype.stop=function(t){return this._lfo.stop(t),this},t.AutoPanner.prototype.sync=function(t){return this._lfo.sync(t),this},t.AutoPanner.prototype.unsync=function(){return this._lfo.unsync(),this},Object.defineProperty(t.AutoPanner.prototype,"type",{get:function(){return this._lfo.type},set:function(t){this._lfo.type=t}}),t.AutoPanner.prototype.dispose=function(){return t.Effect.prototype.dispose.call(this),this._lfo.dispose(),this._lfo=null,this._panner.dispose(),this._panner=null,this._writable(["depth","frequency"]),this.frequency=null,this.depth=null,this},t.AutoPanner}),n(function(t){return t.AutoWah=function(){var e=t.defaults(arguments,["baseFrequency","octaves","sensitivity"],t.AutoWah);t.Effect.call(this,e),this.follower=new t.Follower(e.follower),this._sweepRange=new t.ScaleExp(0,1,.5),this._baseFrequency=e.baseFrequency,this._octaves=e.octaves,this._inputBoost=new t.Gain,this._bandpass=new t.Filter({rolloff:-48,frequency:0,Q:e.Q}),this._peaking=new t.Filter(0,"peaking"),this._peaking.gain.value=e.gain,this.gain=this._peaking.gain,this.Q=this._bandpass.Q,this.effectSend.chain(this._inputBoost,this.follower,this._sweepRange),this._sweepRange.connect(this._bandpass.frequency),this._sweepRange.connect(this._peaking.frequency),this.effectSend.chain(this._bandpass,this._peaking,this.effectReturn),this._setSweepRange(),this.sensitivity=e.sensitivity,this._readOnly(["gain","Q"])},t.extend(t.AutoWah,t.Effect),t.AutoWah.defaults={baseFrequency:100,octaves:6,sensitivity:0,Q:2,gain:2,follower:{attack:.3,release:.5}},Object.defineProperty(t.AutoWah.prototype,"octaves",{get:function(){return this._octaves},set:function(t){this._octaves=t,this._setSweepRange()}}),Object.defineProperty(t.AutoWah.prototype,"baseFrequency",{get:function(){return this._baseFrequency},set:function(t){this._baseFrequency=t,this._setSweepRange()}}),Object.defineProperty(t.AutoWah.prototype,"sensitivity",{get:function(){return t.gainToDb(1/this._inputBoost.gain.value)},set:function(e){this._inputBoost.gain.value=1/t.dbToGain(e)}}),t.AutoWah.prototype._setSweepRange=function(){this._sweepRange.min=this._baseFrequency,this._sweepRange.max=Math.min(this._baseFrequency*Math.pow(2,this._octaves),this.context.sampleRate/2)},t.AutoWah.prototype.dispose=function(){return t.Effect.prototype.dispose.call(this),this.follower.dispose(),this.follower=null,this._sweepRange.dispose(),this._sweepRange=null,this._bandpass.dispose(),this._bandpass=null,this._peaking.dispose(),this._peaking=null,this._inputBoost.dispose(),this._inputBoost=null,this._writable(["gain","Q"]),this.gain=null,this.Q=null,this},t.AutoWah}),n(function(t){return t.Modulo=function(e){t.SignalBase.call(this),this.createInsOuts(1,0),this._shaper=new t.WaveShaper(Math.pow(2,16)),this._multiply=new t.Multiply,this._subtract=this.output=new t.Subtract,this._modSignal=new t.Signal(e),this.input.fan(this._shaper,this._subtract),this._modSignal.connect(this._multiply,0,0),this._shaper.connect(this._multiply,0,1),this._multiply.connect(this._subtract,0,1),this._setWaveShaper(e)},t.extend(t.Modulo,t.SignalBase),t.Modulo.prototype._setWaveShaper=function(t){this._shaper.setMap(function(e){return Math.floor((e+1e-4)/t)})},Object.defineProperty(t.Modulo.prototype,"value",{get:function(){return this._modSignal.value},set:function(t){this._modSignal.value=t,this._setWaveShaper(t)}}),t.Modulo.prototype.dispose=function(){return t.SignalBase.prototype.dispose.call(this),this._shaper.dispose(),this._shaper=null,this._multiply.dispose(),this._multiply=null,this._subtract.dispose(),this._subtract=null,this._modSignal.dispose(),this._modSignal=null,this},t.Modulo}),n(function(t){return t.BitCrusher=function(){var e=t.defaults(arguments,["bits"],t.BitCrusher);t.Effect.call(this,e);var n=1/Math.pow(2,e.bits-1);this._subtract=new t.Subtract,this._modulo=new t.Modulo(n),this._bits=e.bits,this.effectSend.fan(this._subtract,this._modulo),this._modulo.connect(this._subtract,0,1),this._subtract.connect(this.effectReturn)},t.extend(t.BitCrusher,t.Effect),t.BitCrusher.defaults={bits:4},Object.defineProperty(t.BitCrusher.prototype,"bits",{get:function(){return this._bits},set:function(t){this._bits=t;var e=1/Math.pow(2,t-1);this._modulo.value=e}}),t.BitCrusher.prototype.dispose=function(){return t.Effect.prototype.dispose.call(this),this._subtract.dispose(),this._subtract=null,this._modulo.dispose(),this._modulo=null,this},t.BitCrusher}),n(function(t){return t.Chebyshev=function(){var e=t.defaults(arguments,["order"],t.Chebyshev);t.Effect.call(this,e),this._shaper=new t.WaveShaper(4096),this._order=e.order,this.connectEffect(this._shaper),this.order=e.order,this.oversample=e.oversample},t.extend(t.Chebyshev,t.Effect),t.Chebyshev.defaults={order:1,oversample:"none"},t.Chebyshev.prototype._getCoefficient=function(t,e,n){return n.hasOwnProperty(e)?n[e]:(n[e]=0===e?0:1===e?t:2*t*this._getCoefficient(t,e-1,n)-this._getCoefficient(t,e-2,n),n[e])},Object.defineProperty(t.Chebyshev.prototype,"order",{get:function(){return this._order},set:function(t){this._order=t;for(var e=new Array(4096),n=e.length,i=0;i=this._startTime&&!this._sourceStopped?t.State.Started:t.State.Stopped},t.BufferSource.prototype.start=function(e,n,i,r,o){if(-1!==this._startTime)throw new Error("Tone.BufferSource can only be started once.");if(!this.buffer.loaded)throw new Error("Tone.BufferSource: buffer is either not set or not loaded.");e=this.toSeconds(e),n=this.loop?t.defaultArg(n,this.loopStart):t.defaultArg(n,0),n=this.toSeconds(n),r=t.defaultArg(r,1),this._gain=r,o=this.toSeconds(t.defaultArg(o,this.fadeIn)),this.fadeIn=o,o>0?(this._gainNode.gain.setValueAtTime(0,e),"linear"===this.curve?this._gainNode.gain.linearRampToValueAtTime(this._gain,e+o):this._gainNode.gain.exponentialApproachValueAtTime(this._gain,e,o)):this._gainNode.gain.setValueAtTime(r,e),this._startTime=e;var s=this.toSeconds(t.defaultArg(i,this.buffer.duration-n%this.buffer.duration));if(s=Math.max(s,0),t.isDefined(i)&&(this.loop||(s=Math.min(s,this.buffer.duration-n%this.buffer.duration)),this.stop(e+s,this.fadeOut)),this.loop){var a=this.loopEnd||this.buffer.duration,u=this.loopStart;n>=a&&(n=(n-u)%(a-u)+u)}return this._source.buffer=this.buffer.get(),this._source.loopEnd=this.loopEnd||this.buffer.duration,nthis.sampleTime?(this._gainNode.gain.setValueAtTime(this._gain,r),"linear"===this.curve?this._gainNode.gain.linearRampToValueAtTime(0,e):this._gainNode.gain.exponentialApproachValueAtTime(0,r,n)):this._gainNode.gain.setValueAtTime(0,e),t.context.clearTimeout(this._onendedTimeout),this._onendedTimeout=t.context.setTimeout(this._onended.bind(this),this._stopTime-this.now()),this}},t.BufferSource.prototype.cancelStop=function(){if(-1!==this._startTime&&!this._sourceStopped){var t=this.toSeconds(this.fadeIn);this._gainNode.gain.cancelScheduledValues(this._startTime+t+this.sampleTime),this._gainNode.gain.setValueAtTime(1,Math.max(this.now(),this._startTime+t+this.sampleTime)),this.context.clearTimeout(this._onendedTimeout),this._stopTime=-1}return this},t.BufferSource.prototype._onended=function(){if(!this._sourceStopped){this._sourceStopped=!0;var t="exponential"===this.curve?2*this.fadeOut:0;this._sourceStarted&&-1!==this._stopTime&&this._source.stop(this._stopTime+t),this.onended(this)}},Object.defineProperty(t.BufferSource.prototype,"loopStart",{get:function(){return this._source.loopStart},set:function(t){this._source.loopStart=this.toSeconds(t)}}),Object.defineProperty(t.BufferSource.prototype,"loopEnd",{get:function(){return this._source.loopEnd},set:function(t){this._source.loopEnd=this.toSeconds(t)}}),Object.defineProperty(t.BufferSource.prototype,"buffer",{get:function(){return this._buffer},set:function(t){this._buffer.set(t)}}),Object.defineProperty(t.BufferSource.prototype,"loop",{get:function(){return this._source.loop},set:function(t){this._source.loop=t,this.cancelStop()}}),t.BufferSource.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this.onended=null,this._source.onended=null,this._source.disconnect(),this._source=null,this._gainNode.dispose(),this._gainNode=null,this._buffer.dispose(),this._buffer=null,this._startTime=-1,this.playbackRate=null,t.context.clearTimeout(this._onendedTimeout),this},t.BufferSource}),n(function(t){t.Noise=function(){var e=t.defaults(arguments,["type"],t.Noise);t.Source.call(this,e),this._source=null,this._type=e.type,this._playbackRate=e.playbackRate},t.extend(t.Noise,t.Source),t.Noise.defaults={type:"white",playbackRate:1},Object.defineProperty(t.Noise.prototype,"type",{get:function(){return this._type},set:function(e){if(this._type!==e){if(!(e in n))throw new TypeError("Tone.Noise: invalid type: "+e);if(this._type=e,this.state===t.State.Started){var i=this.now();this._stop(i),this._start(i)}}}}),Object.defineProperty(t.Noise.prototype,"playbackRate",{get:function(){return this._playbackRate},set:function(t){this._playbackRate=t,this._source&&(this._source.playbackRate.value=t)}}),t.Noise.prototype._start=function(e){var i=n[this._type];this._source=new t.BufferSource(i).connect(this.output),this._source.loop=!0,this._source.playbackRate.value=this._playbackRate,this._source.start(this.toSeconds(e),Math.random()*(i.duration-.001))},t.Noise.prototype._stop=function(t){this._source&&(this._source.stop(this.toSeconds(t)),this._source=null)},t.Noise.prototype.restart=function(t){this._stop(t),this._start(t)},t.Noise.prototype.dispose=function(){return t.Source.prototype.dispose.call(this),null!==this._source&&(this._source.disconnect(),this._source=null),this._buffer=null,this};var e={pink:function(){for(var t=[],e=0;e<2;e++){var n,i,r,o,s,a,u,l=new Float32Array(220500);t[e]=l,n=i=r=o=s=a=u=0;for(var c=0;c<220500;c++){var h=2*Math.random()-1;n=.99886*n+.0555179*h,i=.99332*i+.0750759*h,r=.969*r+.153852*h,o=.8665*o+.3104856*h,s=.55*s+.5329522*h,a=-.7616*a-.016898*h,l[c]=n+i+r+o+s+a+u+.5362*h,l[c]*=.11,u=.115926*h}}return t}(),brown:function(){for(var t=[],e=0;e<2;e++){var n=new Float32Array(220500);t[e]=n;for(var i=0,r=0;r<220500;r++){var o=2*Math.random()-1;n[r]=(i+.02*o)/1.02,i=n[r],n[r]*=3.5}}return t}(),white:function(){for(var t=[],e=0;e<2;e++){var n=new Float32Array(220500);t[e]=n;for(var i=0;i<220500;i++)n[i]=2*Math.random()-1}return t}()},n={};function i(){for(var i in e)n[i]=(new t.Buffer).fromArray(e[i])}return t.getContext(i),t.Context.on("init",i),t.Noise}),n(function(t){return t.Reverb=function(){var e=t.defaults(arguments,["decay"],t.Reverb);t.Effect.call(this,e),this._convolver=this.context.createConvolver(),this.decay=e.decay,this.preDelay=e.preDelay,this.connectEffect(this._convolver)},t.extend(t.Reverb,t.Effect),t.Reverb.defaults={decay:1.5,preDelay:.01},t.Reverb.prototype.generate=function(){return t.Offline(function(){var e=new t.Noise,n=new t.Noise,i=new t.Merge;e.connect(i.left),n.connect(i.right);var r=(new t.Gain).toMaster();i.connect(r),e.start(0),n.start(0),r.gain.setValueAtTime(0,0),r.gain.linearRampToValueAtTime(1,this.preDelay),r.gain.exponentialApproachValueAtTime(0,this.preDelay,this.decay-this.preDelay)}.bind(this),this.decay).then(function(t){return this._convolver.buffer=t.get(),this}.bind(this))},t.Reverb.prototype.dispose=function(){return t.Effect.prototype.dispose.call(this),this._convolver.disconnect(),this._convolver=null,this},t.Reverb}),n(function(t){return t.StereoFeedbackEffect=function(){var e=t.defaults(arguments,["feedback"],t.FeedbackEffect);t.StereoEffect.call(this,e),this.feedback=new t.Signal(e.feedback,t.Type.NormalRange),this._feedbackL=new t.Gain,this._feedbackR=new t.Gain,this.effectReturnL.chain(this._feedbackL,this.effectSendL),this.effectReturnR.chain(this._feedbackR,this.effectSendR),this.feedback.fan(this._feedbackL.gain,this._feedbackR.gain),this._readOnly(["feedback"])},t.extend(t.StereoFeedbackEffect,t.StereoEffect),t.StereoFeedbackEffect.prototype.dispose=function(){return t.StereoEffect.prototype.dispose.call(this),this._writable(["feedback"]),this.feedback.dispose(),this.feedback=null,this._feedbackL.dispose(),this._feedbackL=null,this._feedbackR.dispose(),this._feedbackR=null,this},t.StereoFeedbackEffect}),n(function(t){return t.StereoWidener=function(){var e=t.defaults(arguments,["width"],t.StereoWidener);t.MidSideEffect.call(this,e),this.width=new t.Signal(e.width,t.Type.NormalRange),this._readOnly(["width"]),this._twoTimesWidthMid=new t.Multiply(2),this._twoTimesWidthSide=new t.Multiply(2),this._midMult=new t.Multiply,this._twoTimesWidthMid.connect(this._midMult,0,1),this.midSend.chain(this._midMult,this.midReturn),this._oneMinusWidth=new t.Subtract,this._oneMinusWidth.connect(this._twoTimesWidthMid),this.context.getConstant(1).connect(this._oneMinusWidth,0,0),this.width.connect(this._oneMinusWidth,0,1),this._sideMult=new t.Multiply,this.width.connect(this._twoTimesWidthSide),this._twoTimesWidthSide.connect(this._sideMult,0,1),this.sideSend.chain(this._sideMult,this.sideReturn)},t.extend(t.StereoWidener,t.MidSideEffect),t.StereoWidener.defaults={width:.5},t.StereoWidener.prototype.dispose=function(){return t.MidSideEffect.prototype.dispose.call(this),this._writable(["width"]),this.width.dispose(),this.width=null,this._midMult.dispose(),this._midMult=null,this._sideMult.dispose(),this._sideMult=null,this._twoTimesWidthMid.dispose(),this._twoTimesWidthMid=null,this._twoTimesWidthSide.dispose(),this._twoTimesWidthSide=null,this._oneMinusWidth.dispose(),this._oneMinusWidth=null,this},t.StereoWidener}),n(function(t){return t.Tremolo=function(){var e=t.defaults(arguments,["frequency","depth"],t.Tremolo);t.StereoEffect.call(this,e),this._lfoL=new t.LFO({phase:e.spread,min:1,max:0}),this._lfoR=new t.LFO({phase:e.spread,min:1,max:0}),this._amplitudeL=new t.Gain,this._amplitudeR=new t.Gain,this.frequency=new t.Signal(e.frequency,t.Type.Frequency),this.depth=new t.Signal(e.depth,t.Type.NormalRange),this._readOnly(["frequency","depth"]),this.effectSendL.chain(this._amplitudeL,this.effectReturnL),this.effectSendR.chain(this._amplitudeR,this.effectReturnR),this._lfoL.connect(this._amplitudeL.gain),this._lfoR.connect(this._amplitudeR.gain),this.frequency.fan(this._lfoL.frequency,this._lfoR.frequency),this.depth.fan(this._lfoR.amplitude,this._lfoL.amplitude),this.type=e.type,this.spread=e.spread},t.extend(t.Tremolo,t.StereoEffect),t.Tremolo.defaults={frequency:10,type:"sine",depth:.5,spread:180},t.Tremolo.prototype.start=function(t){return this._lfoL.start(t),this._lfoR.start(t),this},t.Tremolo.prototype.stop=function(t){return this._lfoL.stop(t),this._lfoR.stop(t),this},t.Tremolo.prototype.sync=function(e){return this._lfoL.sync(e),this._lfoR.sync(e),t.Transport.syncSignal(this.frequency),this},t.Tremolo.prototype.unsync=function(){return this._lfoL.unsync(),this._lfoR.unsync(),t.Transport.unsyncSignal(this.frequency),this},Object.defineProperty(t.Tremolo.prototype,"type",{get:function(){return this._lfoL.type},set:function(t){this._lfoL.type=t,this._lfoR.type=t}}),Object.defineProperty(t.Tremolo.prototype,"spread",{get:function(){return this._lfoR.phase-this._lfoL.phase},set:function(t){this._lfoL.phase=90-t/2,this._lfoR.phase=t/2+90}}),t.Tremolo.prototype.dispose=function(){return t.StereoEffect.prototype.dispose.call(this),this._writable(["frequency","depth"]),this._lfoL.dispose(),this._lfoL=null,this._lfoR.dispose(),this._lfoR=null,this._amplitudeL.dispose(),this._amplitudeL=null,this._amplitudeR.dispose(),this._amplitudeR=null,this.frequency=null,this.depth=null,this},t.Tremolo}),n(function(t){return t.Vibrato=function(){var e=t.defaults(arguments,["frequency","depth"],t.Vibrato);t.Effect.call(this,e),this._delayNode=new t.Delay(0,e.maxDelay),this._lfo=new t.LFO({type:e.type,min:0,max:e.maxDelay,frequency:e.frequency,phase:-90}).start().connect(this._delayNode.delayTime),this.frequency=this._lfo.frequency,this.depth=this._lfo.amplitude,this.depth.value=e.depth,this._readOnly(["frequency","depth"]),this.effectSend.chain(this._delayNode,this.effectReturn)},t.extend(t.Vibrato,t.Effect),t.Vibrato.defaults={maxDelay:.005,frequency:5,depth:.1,type:"sine"},Object.defineProperty(t.Vibrato.prototype,"type",{get:function(){return this._lfo.type},set:function(t){this._lfo.type=t}}),t.Vibrato.prototype.dispose=function(){t.Effect.prototype.dispose.call(this),this._delayNode.dispose(),this._delayNode=null,this._lfo.dispose(),this._lfo=null,this._writable(["frequency","depth"]),this.frequency=null,this.depth=null},t.Vibrato}),n(function(t){return t.Event=function(){var e=t.defaults(arguments,["callback","value"],t.Event);t.call(this),this._loop=e.loop,this.callback=e.callback,this.value=e.value,this._loopStart=this.toTicks(e.loopStart),this._loopEnd=this.toTicks(e.loopEnd),this._state=new t.TimelineState(t.State.Stopped),this._playbackRate=1,this._startOffset=0,this._probability=e.probability,this._humanize=e.humanize,this.mute=e.mute,this.playbackRate=e.playbackRate},t.extend(t.Event),t.Event.defaults={callback:t.noOp,loop:!1,loopEnd:"1m",loopStart:0,playbackRate:1,value:null,probability:1,mute:!1,humanize:!1},t.Event.prototype._rescheduleEvents=function(e){return e=t.defaultArg(e,-1),this._state.forEachFrom(e,function(e){var n;if(e.state===t.State.Started){t.isDefined(e.id)&&t.Transport.clear(e.id);var i=e.time+Math.round(this.startOffset/this._playbackRate);if(this._loop){n=1/0,t.isNumber(this._loop)&&(n=this._loop*this._getLoopDuration());var r=this._state.getAfter(i);null!==r&&(n=Math.min(n,r.time-i)),n!==1/0&&(this._state.setStateAtTime(t.State.Stopped,i+n+1),n=t.Ticks(n));var o=t.Ticks(this._getLoopDuration());e.id=t.Transport.scheduleRepeat(this._tick.bind(this),o,t.Ticks(i),n)}else e.id=t.Transport.schedule(this._tick.bind(this),t.Ticks(i))}}.bind(this)),this},Object.defineProperty(t.Event.prototype,"state",{get:function(){return this._state.getValueAtTime(t.Transport.ticks)}}),Object.defineProperty(t.Event.prototype,"startOffset",{get:function(){return this._startOffset},set:function(t){this._startOffset=t}}),Object.defineProperty(t.Event.prototype,"probability",{get:function(){return this._probability},set:function(t){this._probability=t}}),Object.defineProperty(t.Event.prototype,"humanize",{get:function(){return this._humanize},set:function(t){this._humanize=t}}),t.Event.prototype.start=function(e){return e=this.toTicks(e),this._state.getValueAtTime(e)===t.State.Stopped&&(this._state.add({state:t.State.Started,time:e,id:void 0}),this._rescheduleEvents(e)),this},t.Event.prototype.stop=function(e){if(this.cancel(e),e=this.toTicks(e),this._state.getValueAtTime(e)===t.State.Started){this._state.setStateAtTime(t.State.Stopped,e);var n=this._state.getBefore(e),i=e;null!==n&&(i=n.time),this._rescheduleEvents(i)}return this},t.Event.prototype.cancel=function(e){return e=t.defaultArg(e,-1/0),e=this.toTicks(e),this._state.forEachFrom(e,function(e){t.Transport.clear(e.id)}),this._state.cancel(e),this},t.Event.prototype._tick=function(e){var n=t.Transport.getTicksAtTime(e);if(!this.mute&&this._state.getValueAtTime(n)===t.State.Started){if(this.probability<1&&Math.random()>this.probability)return;if(this.humanize){var i=.02;t.isBoolean(this.humanize)||(i=this.toSeconds(this.humanize)),e+=(2*Math.random()-1)*i}this.callback(e,this.value)}},t.Event.prototype._getLoopDuration=function(){return Math.round((this._loopEnd-this._loopStart)/this._playbackRate)},Object.defineProperty(t.Event.prototype,"loop",{get:function(){return this._loop},set:function(t){this._loop=t,this._rescheduleEvents()}}),Object.defineProperty(t.Event.prototype,"playbackRate",{get:function(){return this._playbackRate},set:function(t){this._playbackRate=t,this._rescheduleEvents()}}),Object.defineProperty(t.Event.prototype,"loopEnd",{get:function(){return t.Ticks(this._loopEnd).toSeconds()},set:function(t){this._loopEnd=this.toTicks(t),this._loop&&this._rescheduleEvents()}}),Object.defineProperty(t.Event.prototype,"loopStart",{get:function(){return t.Ticks(this._loopStart).toSeconds()},set:function(t){this._loopStart=this.toTicks(t),this._loop&&this._rescheduleEvents()}}),Object.defineProperty(t.Event.prototype,"progress",{get:function(){if(this._loop){var e=t.Transport.ticks,n=this._state.get(e);if(null!==n&&n.state===t.State.Started){var i=this._getLoopDuration();return(e-n.time)%i/i}return 0}return 0}}),t.Event.prototype.dispose=function(){this.cancel(),this._state.dispose(),this._state=null,this.callback=null,this.value=null},t.Event}),n(function(t){return t.Loop=function(){var e=t.defaults(arguments,["callback","interval"],t.Loop);t.call(this),this._event=new t.Event({callback:this._tick.bind(this),loop:!0,loopEnd:e.interval,playbackRate:e.playbackRate,probability:e.probability}),this.callback=e.callback,this.iterations=e.iterations},t.extend(t.Loop),t.Loop.defaults={interval:"4n",callback:t.noOp,playbackRate:1,iterations:1/0,probability:!0,mute:!1},t.Loop.prototype.start=function(t){return this._event.start(t),this},t.Loop.prototype.stop=function(t){return this._event.stop(t),this},t.Loop.prototype.cancel=function(t){return this._event.cancel(t),this},t.Loop.prototype._tick=function(t){this.callback(t)},Object.defineProperty(t.Loop.prototype,"state",{get:function(){return this._event.state}}),Object.defineProperty(t.Loop.prototype,"progress",{get:function(){return this._event.progress}}),Object.defineProperty(t.Loop.prototype,"interval",{get:function(){return this._event.loopEnd},set:function(t){this._event.loopEnd=t}}),Object.defineProperty(t.Loop.prototype,"playbackRate",{get:function(){return this._event.playbackRate},set:function(t){this._event.playbackRate=t}}),Object.defineProperty(t.Loop.prototype,"humanize",{get:function(){return this._event.humanize},set:function(t){this._event.humanize=t}}),Object.defineProperty(t.Loop.prototype,"probability",{get:function(){return this._event.probability},set:function(t){this._event.probability=t}}),Object.defineProperty(t.Loop.prototype,"mute",{get:function(){return this._event.mute},set:function(t){this._event.mute=t}}),Object.defineProperty(t.Loop.prototype,"iterations",{get:function(){return!0===this._event.loop?1/0:this._event.loop},set:function(t){this._event.loop=t===1/0||t}}),t.Loop.prototype.dispose=function(){this._event.dispose(),this._event=null,this.callback=null},t.Loop}),n(function(t){return t.Part=function(){var e=t.defaults(arguments,["callback","events"],t.Part);t.Event.call(this,e),this._events=[];for(var n=0;n=this._loopStart&&e.startOffset=i&&(e.loop=!1,e.start(t.Ticks(n))):e.startOffset>=i&&e.start(t.Ticks(n))},Object.defineProperty(t.Part.prototype,"startOffset",{get:function(){return this._startOffset},set:function(t){this._startOffset=t,this._forEach(function(t){t.startOffset+=this._startOffset})}}),t.Part.prototype.stop=function(e){var n=this.toTicks(e);return this._state.cancel(n),this._state.setStateAtTime(t.State.Stopped,n),this._forEach(function(t){t.stop(e)}),this},t.Part.prototype.at=function(e,n){e=t.TransportTime(e);for(var i=t.Ticks(1).toSeconds(),r=0;r=0;i--){var r=this._events[i];r instanceof t.Part?r.remove(e,n):r.startOffset===e&&(t.isUndef(n)||t.isDefined(n)&&r.value===n)&&(this._events.splice(i,1),r.dispose())}return this},t.Part.prototype.removeAll=function(){return this._forEach(function(t){t.dispose()}),this._events=[],this},t.Part.prototype.cancel=function(t){return this._forEach(function(e){e.cancel(t)}),this._state.cancel(this.toTicks(t)),this},t.Part.prototype._forEach=function(e,n){if(this._events){n=t.defaultArg(n,this);for(var i=this._events.length-1;i>=0;i--){var r=this._events[i];r instanceof t.Part?r._forEach(e,n):e.call(n,r)}}return this},t.Part.prototype._setAll=function(t,e){this._forEach(function(n){n[t]=e})},t.Part.prototype._tick=function(t,e){this.mute||this.callback(t,e)},t.Part.prototype._testLoopBoundries=function(e){e.startOffset=this._loopEnd?e.cancel(0):e.state===t.State.Stopped&&this._restartEvent(e)},Object.defineProperty(t.Part.prototype,"probability",{get:function(){return this._probability},set:function(t){this._probability=t,this._setAll("probability",t)}}),Object.defineProperty(t.Part.prototype,"humanize",{get:function(){return this._humanize},set:function(t){this._humanize=t,this._setAll("humanize",t)}}),Object.defineProperty(t.Part.prototype,"loop",{get:function(){return this._loop},set:function(t){this._loop=t,this._forEach(function(e){e._loopStart=this._loopStart,e._loopEnd=this._loopEnd,e.loop=t,this._testLoopBoundries(e)})}}),Object.defineProperty(t.Part.prototype,"loopEnd",{get:function(){return t.Ticks(this._loopEnd).toSeconds()},set:function(t){this._loopEnd=this.toTicks(t),this._loop&&this._forEach(function(e){e.loopEnd=t,this._testLoopBoundries(e)})}}),Object.defineProperty(t.Part.prototype,"loopStart",{get:function(){return t.Ticks(this._loopStart).toSeconds()},set:function(t){this._loopStart=this.toTicks(t),this._loop&&this._forEach(function(t){t.loopStart=this.loopStart,this._testLoopBoundries(t)})}}),Object.defineProperty(t.Part.prototype,"playbackRate",{get:function(){return this._playbackRate},set:function(t){this._playbackRate=t,this._setAll("playbackRate",t)}}),Object.defineProperty(t.Part.prototype,"length",{get:function(){return this._events.length}}),t.Part.prototype.dispose=function(){return this.removeAll(),this._state.dispose(),this._state=null,this.callback=null,this._events=null,this},t.Part}),n(function(t){return t.Pattern=function(){var e=t.defaults(arguments,["callback","values","pattern"],t.Pattern);t.Loop.call(this,e),this._pattern=new t.CtrlPattern({values:e.values,type:e.pattern,index:e.index})},t.extend(t.Pattern,t.Loop),t.Pattern.defaults={pattern:t.CtrlPattern.Type.Up,callback:t.noOp,values:[]},t.Pattern.prototype._tick=function(t){this.callback(t,this._pattern.value),this._pattern.next()},Object.defineProperty(t.Pattern.prototype,"index",{get:function(){return this._pattern.index},set:function(t){this._pattern.index=t}}),Object.defineProperty(t.Pattern.prototype,"values",{get:function(){return this._pattern.values},set:function(t){this._pattern.values=t}}),Object.defineProperty(t.Pattern.prototype,"value",{get:function(){return this._pattern.value}}),Object.defineProperty(t.Pattern.prototype,"pattern",{get:function(){return this._pattern.type},set:function(t){this._pattern.type=t}}),t.Pattern.prototype.dispose=function(){t.Loop.prototype.dispose.call(this),this._pattern.dispose(),this._pattern=null},t.Pattern}),n(function(t){return t.Sequence=function(){var e=t.defaults(arguments,["callback","events","subdivision"],t.Sequence),n=e.events;if(delete e.events,t.Part.call(this,e),this._subdivision=this.toTicks(e.subdivision),t.isUndef(e.loopEnd)&&t.isDefined(n)&&(this._loopEnd=n.length*this._subdivision),this._loop=!0,t.isDefined(n))for(var i=0;i1){var e=-t/2,n=t/(this._oscillators.length-1);this._forEach(function(t,i){t.detune.value=e+n*i})}}}),Object.defineProperty(t.FatOscillator.prototype,"count",{get:function(){return this._oscillators.length},set:function(e){if(e=Math.max(e,1),this._oscillators.length!==e){this._forEach(function(t){t.dispose()}),this._oscillators=[];for(var n=0;n0&&this.getLevelAtTime(e)>.05){var n=this.toSeconds(this.portamento);this.frequency.exponentialRampTo(t,n,e)}else this.frequency.setValueAtTime(t,e);return this},t.Monophonic}),n(function(t){return t.Synth=function(e){e=t.defaultArg(e,t.Synth.defaults),t.Monophonic.call(this,e),this.oscillator=new t.OmniOscillator(e.oscillator),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.envelope=new t.AmplitudeEnvelope(e.envelope),this.oscillator.chain(this.envelope,this.output),this._readOnly(["oscillator","frequency","detune","envelope"])},t.extend(t.Synth,t.Monophonic),t.Synth.defaults={oscillator:{type:"triangle"},envelope:{attack:.005,decay:.1,sustain:.3,release:1}},t.Synth.prototype._triggerEnvelopeAttack=function(t,e){return this.envelope.triggerAttack(t,e),this.oscillator.start(t),0===this.envelope.sustain&&this.oscillator.stop(t+this.envelope.attack+this.envelope.decay),this},t.Synth.prototype._triggerEnvelopeRelease=function(t){return t=this.toSeconds(t),this.envelope.triggerRelease(t),this.oscillator.stop(t+this.envelope.release),this},t.Synth.prototype.dispose=function(){return t.Monophonic.prototype.dispose.call(this),this._writable(["oscillator","frequency","detune","envelope"]),this.oscillator.dispose(),this.oscillator=null,this.envelope.dispose(),this.envelope=null,this.frequency=null,this.detune=null,this},t.Synth}),n(function(t){return t.AMSynth=function(e){e=t.defaultArg(e,t.AMSynth.defaults),t.Monophonic.call(this,e),this._carrier=new t.Synth,this._carrier.volume.value=-10,this.oscillator=this._carrier.oscillator,this.envelope=this._carrier.envelope.set(e.envelope),this._modulator=new t.Synth,this._modulator.volume.value=-10,this.modulation=this._modulator.oscillator.set(e.modulation),this.modulationEnvelope=this._modulator.envelope.set(e.modulationEnvelope),this.frequency=new t.Signal(440,t.Type.Frequency),this.detune=new t.Signal(e.detune,t.Type.Cents),this.harmonicity=new t.Multiply(e.harmonicity),this.harmonicity.units=t.Type.Positive,this._modulationScale=new t.AudioToGain,this._modulationNode=new t.Gain,this.frequency.connect(this._carrier.frequency),this.frequency.chain(this.harmonicity,this._modulator.frequency),this.detune.fan(this._carrier.detune,this._modulator.detune),this._modulator.chain(this._modulationScale,this._modulationNode.gain),this._carrier.chain(this._modulationNode,this.output),this._readOnly(["frequency","harmonicity","oscillator","envelope","modulation","modulationEnvelope","detune"])},t.extend(t.AMSynth,t.Monophonic),t.AMSynth.defaults={harmonicity:3,detune:0,oscillator:{type:"sine"},envelope:{attack:.01,decay:.01,sustain:1,release:.5},modulation:{type:"square"},modulationEnvelope:{attack:.5,decay:0,sustain:1,release:.5}},t.AMSynth.prototype._triggerEnvelopeAttack=function(t,e){return t=this.toSeconds(t),this._carrier._triggerEnvelopeAttack(t,e),this._modulator._triggerEnvelopeAttack(t),this},t.AMSynth.prototype._triggerEnvelopeRelease=function(t){return this._carrier._triggerEnvelopeRelease(t),this._modulator._triggerEnvelopeRelease(t),this},t.AMSynth.prototype.dispose=function(){return t.Monophonic.prototype.dispose.call(this),this._writable(["frequency","harmonicity","oscillator","envelope","modulation","modulationEnvelope","detune"]),this._carrier.dispose(),this._carrier=null,this._modulator.dispose(),this._modulator=null,this.frequency.dispose(),this.frequency=null,this.detune.dispose(),this.detune=null,this.harmonicity.dispose(),this.harmonicity=null,this._modulationScale.dispose(),this._modulationScale=null,this._modulationNode.dispose(),this._modulationNode=null,this.oscillator=null,this.envelope=null,this.modulationEnvelope=null,this.modulation=null,this},t.AMSynth}),n(function(t){return t.MonoSynth=function(e){e=t.defaultArg(e,t.MonoSynth.defaults),t.Monophonic.call(this,e),this.oscillator=new t.OmniOscillator(e.oscillator),this.frequency=this.oscillator.frequency,this.detune=this.oscillator.detune,this.filter=new t.Filter(e.filter),this.filterEnvelope=new t.FrequencyEnvelope(e.filterEnvelope),this.envelope=new t.AmplitudeEnvelope(e.envelope),this.oscillator.chain(this.filter,this.envelope,this.output),this.filterEnvelope.connect(this.filter.frequency),this._readOnly(["oscillator","frequency","detune","filter","filterEnvelope","envelope"])},t.extend(t.MonoSynth,t.Monophonic),t.MonoSynth.defaults={frequency:"C4",detune:0,oscillator:{type:"square"},filter:{Q:6,type:"lowpass",rolloff:-24},envelope:{attack:.005,decay:.1,sustain:.9,release:1},filterEnvelope:{attack:.06,decay:.2,sustain:.5,release:2,baseFrequency:200,octaves:7,exponent:2}},t.MonoSynth.prototype._triggerEnvelopeAttack=function(t,e){return t=this.toSeconds(t),this.envelope.triggerAttack(t,e),this.filterEnvelope.triggerAttack(t),this.oscillator.start(t),0===this.envelope.sustain&&this.oscillator.stop(t+this.envelope.attack+this.envelope.decay),this},t.MonoSynth.prototype._triggerEnvelopeRelease=function(t){return this.envelope.triggerRelease(t),this.filterEnvelope.triggerRelease(t),this.oscillator.stop(t+this.envelope.release),this},t.MonoSynth.prototype.dispose=function(){return t.Monophonic.prototype.dispose.call(this),this._writable(["oscillator","frequency","detune","filter","filterEnvelope","envelope"]),this.oscillator.dispose(),this.oscillator=null,this.envelope.dispose(),this.envelope=null,this.filterEnvelope.dispose(),this.filterEnvelope=null,this.filter.dispose(),this.filter=null,this.frequency=null,this.detune=null,this},t.MonoSynth}),n(function(t){return t.DuoSynth=function(e){e=t.defaultArg(e,t.DuoSynth.defaults),t.Monophonic.call(this,e),this.voice0=new t.MonoSynth(e.voice0),this.voice0.volume.value=-10,this.voice1=new t.MonoSynth(e.voice1),this.voice1.volume.value=-10,this._vibrato=new t.LFO(e.vibratoRate,-50,50),this._vibrato.start(),this.vibratoRate=this._vibrato.frequency,this._vibratoGain=new t.Gain(e.vibratoAmount,t.Type.Positive),this.vibratoAmount=this._vibratoGain.gain,this.frequency=new t.Signal(440,t.Type.Frequency),this.harmonicity=new t.Multiply(e.harmonicity),this.harmonicity.units=t.Type.Positive,this.frequency.connect(this.voice0.frequency),this.frequency.chain(this.harmonicity,this.voice1.frequency),this._vibrato.connect(this._vibratoGain),this._vibratoGain.fan(this.voice0.detune,this.voice1.detune),this.voice0.connect(this.output),this.voice1.connect(this.output),this._readOnly(["voice0","voice1","frequency","vibratoAmount","vibratoRate"])},t.extend(t.DuoSynth,t.Monophonic),t.DuoSynth.defaults={vibratoAmount:.5,vibratoRate:5,harmonicity:1.5,voice0:{volume:-10,portamento:0,oscillator:{type:"sine"},filterEnvelope:{attack:.01,decay:0,sustain:1,release:.5},envelope:{attack:.01,decay:0,sustain:1,release:.5}},voice1:{volume:-10,portamento:0,oscillator:{type:"sine"},filterEnvelope:{attack:.01,decay:0,sustain:1,release:.5},envelope:{attack:.01,decay:0,sustain:1,release:.5}}},t.DuoSynth.prototype._triggerEnvelopeAttack=function(t,e){return t=this.toSeconds(t),this.voice0._triggerEnvelopeAttack(t,e),this.voice1._triggerEnvelopeAttack(t,e),this},t.DuoSynth.prototype._triggerEnvelopeRelease=function(t){return this.voice0._triggerEnvelopeRelease(t),this.voice1._triggerEnvelopeRelease(t),this},t.DuoSynth.prototype.getLevelAtTime=function(t){return(this.voice0.getLevelAtTime(t)+this.voice1.getLevelAtTime(t))/2},t.DuoSynth.prototype.dispose=function(){return t.Monophonic.prototype.dispose.call(this),this._writable(["voice0","voice1","frequency","vibratoAmount","vibratoRate"]),this.voice0.dispose(),this.voice0=null,this.voice1.dispose(),this.voice1=null,this.frequency.dispose(),this.frequency=null,this._vibratoGain.dispose(),this._vibratoGain=null,this._vibrato=null,this.harmonicity.dispose(),this.harmonicity=null,this.vibratoAmount.dispose(),this.vibratoAmount=null,this.vibratoRate=null,this},t.DuoSynth}),n(function(t){return t.FMSynth=function(e){e=t.defaultArg(e,t.FMSynth.defaults),t.Monophonic.call(this,e),this._carrier=new t.Synth(e.carrier),this._carrier.volume.value=-10,this.oscillator=this._carrier.oscillator,this.envelope=this._carrier.envelope.set(e.envelope),this._modulator=new t.Synth(e.modulator),this._modulator.volume.value=-10,this.modulation=this._modulator.oscillator.set(e.modulation),this.modulationEnvelope=this._modulator.envelope.set(e.modulationEnvelope),this.frequency=new t.Signal(440,t.Type.Frequency),this.detune=new t.Signal(e.detune,t.Type.Cents),this.harmonicity=new t.Multiply(e.harmonicity),this.harmonicity.units=t.Type.Positive,this.modulationIndex=new t.Multiply(e.modulationIndex),this.modulationIndex.units=t.Type.Positive,this._modulationNode=new t.Gain(0),this.frequency.connect(this._carrier.frequency),this.frequency.chain(this.harmonicity,this._modulator.frequency),this.frequency.chain(this.modulationIndex,this._modulationNode),this.detune.fan(this._carrier.detune,this._modulator.detune),this._modulator.connect(this._modulationNode.gain),this._modulationNode.connect(this._carrier.frequency),this._carrier.connect(this.output),this._readOnly(["frequency","harmonicity","modulationIndex","oscillator","envelope","modulation","modulationEnvelope","detune"])},t.extend(t.FMSynth,t.Monophonic),t.FMSynth.defaults={harmonicity:3,modulationIndex:10,detune:0,oscillator:{type:"sine"},envelope:{attack:.01,decay:.01,sustain:1,release:.5},modulation:{type:"square"},modulationEnvelope:{attack:.5,decay:0,sustain:1,release:.5}},t.FMSynth.prototype._triggerEnvelopeAttack=function(t,e){return t=this.toSeconds(t),this._carrier._triggerEnvelopeAttack(t,e),this._modulator._triggerEnvelopeAttack(t),this},t.FMSynth.prototype._triggerEnvelopeRelease=function(t){return t=this.toSeconds(t),this._carrier._triggerEnvelopeRelease(t),this._modulator._triggerEnvelopeRelease(t),this},t.FMSynth.prototype.dispose=function(){return t.Monophonic.prototype.dispose.call(this),this._writable(["frequency","harmonicity","modulationIndex","oscillator","envelope","modulation","modulationEnvelope","detune"]),this._carrier.dispose(),this._carrier=null,this._modulator.dispose(),this._modulator=null,this.frequency.dispose(),this.frequency=null,this.detune.dispose(),this.detune=null,this.modulationIndex.dispose(),this.modulationIndex=null,this.harmonicity.dispose(),this.harmonicity=null,this._modulationNode.dispose(),this._modulationNode=null,this.oscillator=null,this.envelope=null,this.modulationEnvelope=null,this.modulation=null,this},t.FMSynth}),n(function(t){return t.MembraneSynth=function(e){e=t.defaultArg(e,t.MembraneSynth.defaults),t.Instrument.call(this,e),this.oscillator=new t.OmniOscillator(e.oscillator),this.envelope=new t.AmplitudeEnvelope(e.envelope),this.octaves=e.octaves,this.pitchDecay=e.pitchDecay,this.oscillator.chain(this.envelope,this.output),this._readOnly(["oscillator","envelope"])},t.extend(t.MembraneSynth,t.Instrument),t.MembraneSynth.defaults={pitchDecay:.05,octaves:10,oscillator:{type:"sine"},envelope:{attack:.001,decay:.4,sustain:.01,release:1.4,attackCurve:"exponential"}},t.MembraneSynth.prototype.triggerAttack=function(t,e,n){e=this.toSeconds(e);var i=(t=this.toFrequency(t))*this.octaves;return this.oscillator.frequency.setValueAtTime(i,e),this.oscillator.frequency.exponentialRampToValueAtTime(t,e+this.toSeconds(this.pitchDecay)),this.envelope.triggerAttack(e,n),this.oscillator.start(e),this},t.MembraneSynth.prototype.triggerRelease=function(t){return t=this.toSeconds(t),this.envelope.triggerRelease(t),this.oscillator.stop(t+this.envelope.release),this},t.MembraneSynth.prototype.dispose=function(){return t.Instrument.prototype.dispose.call(this),this._writable(["oscillator","envelope"]),this.oscillator.dispose(),this.oscillator=null,this.envelope.dispose(),this.envelope=null,this},t.MembraneSynth}),n(function(t){var e=[1,1.483,1.932,2.546,2.63,3.897];return t.MetalSynth=function(n){n=t.defaultArg(n,t.MetalSynth.defaults),t.Instrument.call(this,n),this.frequency=new t.Signal(n.frequency,t.Type.Frequency),this._oscillators=[],this._freqMultipliers=[],this._amplitue=new t.Gain(0).connect(this.output),this._highpass=new t.Filter({type:"highpass",Q:-3.0102999566398125}).connect(this._amplitue),this._octaves=n.octaves,this._filterFreqScaler=new t.Scale(n.resonance,7e3),this.envelope=new t.Envelope({attack:n.envelope.attack,attackCurve:"linear",decay:n.envelope.decay,sustain:0,release:n.envelope.release}).chain(this._filterFreqScaler,this._highpass.frequency),this.envelope.connect(this._amplitue.gain);for(var i=0;ie&&(o.voice.triggerRelease(e),o.release=e)}return this},t.PolySynth.prototype.sync=function(){return this._syncMethod("triggerAttack",1),this._syncMethod("triggerRelease",1),this},t.PolySynth.prototype.set=function(t,e,n){for(var i=0;it&&(n.release=t,n.voice.triggerRelease(t))}return this},t.PolySynth.prototype.dispose=function(){t.Instrument.prototype.dispose.call(this);for(var e=0;e0)i=n[0];else if(!i&&t.isDefined(e))throw new Error("Tone.UserMedia: no matching device: "+e);this._device=i;var r={audio:{echoCancellation:!1,sampleRate:this.context.sampleRate}};return i&&(r.audio.deviceId=i.deviceId),navigator.mediaDevices.getUserMedia(r).then(function(t){return this._stream||(this._stream=t,this._mediaStream=this.context.createMediaStreamSource(t),this._mediaStream.connect(this.output)),this}.bind(this))}.bind(this))},t.UserMedia.prototype.close=function(){return this._stream&&(this._stream.getAudioTracks().forEach(function(t){t.stop()}),this._stream=null,this._mediaStream.disconnect(),this._mediaStream=null),this._device=null,this},t.UserMedia.enumerateDevices=function(){return navigator.mediaDevices.enumerateDevices().then(function(t){return t.filter(function(t){return"audioinput"===t.kind})})},Object.defineProperty(t.UserMedia.prototype,"state",{get:function(){return this._stream&&this._stream.active?t.State.Started:t.State.Stopped}}),Object.defineProperty(t.UserMedia.prototype,"deviceId",{get:function(){if(this._device)return this._device.deviceId}}),Object.defineProperty(t.UserMedia.prototype,"groupId",{get:function(){if(this._device)return this._device.groupId}}),Object.defineProperty(t.UserMedia.prototype,"label",{get:function(){if(this._device)return this._device.label}}),Object.defineProperty(t.UserMedia.prototype,"mute",{get:function(){return this._volume.mute},set:function(t){this._volume.mute=t}}),t.UserMedia.prototype.dispose=function(){return t.AudioNode.prototype.dispose.call(this),this.close(),this._writable("volume"),this._volume.dispose(),this._volume=null,this.volume=null,this},Object.defineProperty(t.UserMedia,"supported",{get:function(){return t.isDefined(navigator.mediaDevices)&&t.isFunction(navigator.mediaDevices.getUserMedia)}}),t.UserMedia}),n(function(t){return t.Midi=function(e,n){if(!(this instanceof t.Midi))return new t.Midi(e,n);t.Frequency.call(this,e,n)},t.extend(t.Midi,t.Frequency),t.Midi.prototype._defaultUnits="midi",t.Midi.prototype._frequencyToUnits=function(e){return t.Frequency.ftom(t.Frequency.prototype._frequencyToUnits.call(this,e))},t.Midi.prototype._ticksToUnits=function(e){return t.Frequency.ftom(t.Frequency.prototype._ticksToUnits.call(this,e))},t.Midi.prototype._beatsToUnits=function(e){return t.Frequency.ftom(t.Frequency.prototype._beatsToUnits.call(this,e))},t.Midi.prototype._secondsToUnits=function(e){return t.Frequency.ftom(t.Frequency.prototype._secondsToUnits.call(this,e))},t.Midi.prototype.toMidi=function(){return this.valueOf()},t.Midi.prototype.toFrequency=function(){return t.Frequency.mtof(this.toMidi())},t.Midi.prototype.transpose=function(t){return new this.constructor(this.toMidi()+t)},t.Midi}),t}()}.call(e,n,e,t))||(t.exports=i)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{!i&&a.return&&a.return()}finally{if(r)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r="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},o=function(){function t(t,e){for(var n=0;n3&&void 0!==arguments[3]?arguments[3]:{};return function(o){return e&&e.id?r.default.folder.update({id:e.id,module:t.name,datatype:t.datatype,activity:"dataset",name:n,opt:i}):null}},e.uploadFile=function(t,e,n,i){return function(o){var s=new FormData;return s.append("file",n,i),r.default.folder.upload(s,{id:e.id,module:t.name,activity:"file",epoch:0,processed:!1,generated:!1})}},e.fetchURL=function(t,e,n){return function(i){console.log(t,e,n);var s=e.files.some(function(t){return t.url===n});console.log(s),s?console.log("already seen this url"):o.parser.parse(n,function(i){i&&(i.title=i.title.replace(/([\uE000-\uF8FF]|\uD83C[\uDF00-\uDFFF]|\uD83D[\uDC00-\uDDFF])/g,"").trim(),console.log("media",i),r.default.file.create({folder_id:e.id,name:(i.title||"").replace(/\.[^.]+$/g,"").replace(/[^a-zA-Z0-9_]/g,"_").replace(/_+/g,"_"),module:t.name,dataset:i.token,activity:"url",duration:parseInt(i.duration)||0,epoch:0,processed:!1,generated:!1,opt:i,url:n}))})}},e.uploadFiles=function(t){return{type:i.default.dataset.upload_files}}},function(t,e,n){var i=n(309);t.exports=f,t.exports.parse=o,t.exports.compile=function(t,e){return a(o(t,e))},t.exports.tokensToFunction=a,t.exports.tokensToRegExp=p;var r=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function o(t,e){for(var n,i=[],o=0,s=0,a="",c=e&&e.delimiter||"/";null!=(n=r.exec(t));){var h=n[0],p=n[1],f=n.index;if(a+=t.slice(s,f),s=f+h.length,p)a+=p[1];else{var d=t[s],m=n[2],y=n[3],_=n[4],v=n[5],g=n[6],b=n[7];a&&(i.push(a),a="");var w=null!=m&&null!=d&&d!==m,k="+"===g||"*"===g,S="?"===g||"*"===g,x=n[2]||c,T=_||v;i.push({name:y||o++,prefix:m||"",delimiter:x,optional:S,repeat:k,partial:w,asterisk:!!b,pattern:T?l(T):b?".*":"[^"+u(x)+"]+?"})}}return s>>1:t>>>1;e[n]=t}return e}();t.exports=function(t,e){return void 0!==t&&t.length?"string"!==i.getTypeOf(t)?function(t,e,n,i){var o=r,s=i+n;t^=-1;for(var a=i;a>>8^o[255&(t^e[a])];return-1^t}(0|e,t,t.length,0):function(t,e,n,i){var o=r,s=i+n;t^=-1;for(var a=i;a>>8^o[255&(t^e.charCodeAt(a))];return-1^t}(0|e,t,t.length,0):0}},function(t,e,n){"use strict";var i=n(45),r=n(106),o=n(105),s=n(104);o=n(105);function a(t,e,n,i,r){this.compressedSize=t,this.uncompressedSize=e,this.crc32=n,this.compression=i,this.compressedContent=r}a.prototype={getContentWorker:function(){var t=new r(i.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o("data_length")),e=this;return t.on("end",function(){if(this.streamInfo.data_length!==e.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),t},getCompressedWorker:function(){return new r(i.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},a.createWorkerFrom=function(t,e,n){return t.pipe(new s).pipe(new o("uncompressedSize")).pipe(e.compressWorker(n)).pipe(new o("compressedSize")).withStreamInfo("compression",e)},t.exports=a},function(t,e,n){t.exports=!n(110)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){"use strict";(function(e,i,r){var o=n(59);function s(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,n){var i=t.entry;t.entry=null;for(;i;){var r=i.callback;e.pendingcb--,r(n),i=i.next}e.corkedRequestsFree?e.corkedRequestsFree.next=t:e.corkedRequestsFree=t}(e,t)}}t.exports=v;var a,u=!e.browser&&["v0.10","v0.9."].indexOf(e.version.slice(0,5))>-1?i:o.nextTick;v.WritableState=_;var l=n(46);l.inherits=n(30);var c={deprecate:n(213)},h=n(117),p=n(58).Buffer,f=r.Uint8Array||function(){};var d,m=n(116);function y(){}function _(t,e){a=a||n(26),t=t||{};var i=e instanceof a;this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var r=t.highWaterMark,l=t.writableHighWaterMark,c=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i&&(l||0===l)?l:c,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var h=!1===t.decodeStrings;this.decodeStrings=!h,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var n=t._writableState,i=n.sync,r=n.writecb;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(n),e)!function(t,e,n,i,r){--e.pendingcb,n?(o.nextTick(r,i),o.nextTick(x,t,e),t._writableState.errorEmitted=!0,t.emit("error",i)):(r(i),t._writableState.errorEmitted=!0,t.emit("error",i),x(t,e))}(t,n,i,e,r);else{var s=k(n);s||n.corked||n.bufferProcessing||!n.bufferedRequest||w(t,n),i?u(b,t,n,s,r):b(t,n,s,r)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function v(t){if(a=a||n(26),!(d.call(v,this)||this instanceof a))return new v(t);this._writableState=new _(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),h.call(this)}function g(t,e,n,i,r,o,s){e.writelen=i,e.writecb=s,e.writing=!0,e.sync=!0,n?t._writev(r,e.onwrite):t._write(r,o,e.onwrite),e.sync=!1}function b(t,e,n,i){n||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,i(),x(t,e)}function w(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var i=e.bufferedRequestCount,r=new Array(i),o=e.corkedRequestsFree;o.entry=n;for(var a=0,u=!0;n;)r[a]=n,n.isBuf||(u=!1),n=n.next,a+=1;r.allBuffers=u,g(t,e,!0,e.length,r,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new s(e),e.bufferedRequestCount=0}else{for(;n;){var l=n.chunk,c=n.encoding,h=n.callback;if(g(t,e,!1,e.objectMode?1:l.length,l,c,h),n=n.next,e.bufferedRequestCount--,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequest=n,e.bufferProcessing=!1}function k(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function S(t,e){t._final(function(n){e.pendingcb--,n&&t.emit("error",n),e.prefinished=!0,t.emit("prefinish"),x(t,e)})}function x(t,e){var n=k(e);return n&&(!function(t,e){e.prefinished||e.finalCalled||("function"==typeof t._final?(e.pendingcb++,e.finalCalled=!0,o.nextTick(S,t,e)):(e.prefinished=!0,t.emit("prefinish")))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"))),n}l.inherits(v,h),_.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(_.prototype,"buffer",{get:c.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(d=Function.prototype[Symbol.hasInstance],Object.defineProperty(v,Symbol.hasInstance,{value:function(t){return!!d.call(this,t)||this===v&&(t&&t._writableState instanceof _)}})):d=function(t){return t instanceof this},v.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))},v.prototype.write=function(t,e,n){var i,r=this._writableState,s=!1,a=!r.objectMode&&(i=t,p.isBuffer(i)||i instanceof f);return a&&!p.isBuffer(t)&&(t=function(t){return p.from(t)}(t)),"function"==typeof e&&(n=e,e=null),a?e="buffer":e||(e=r.defaultEncoding),"function"!=typeof n&&(n=y),r.ended?function(t,e){var n=new Error("write after end");t.emit("error",n),o.nextTick(e,n)}(this,n):(a||function(t,e,n,i){var r=!0,s=!1;return null===n?s=new TypeError("May not write null values to stream"):"string"==typeof n||void 0===n||e.objectMode||(s=new TypeError("Invalid non-string/buffer chunk")),s&&(t.emit("error",s),o.nextTick(i,s),r=!1),r}(this,r,t,n))&&(r.pendingcb++,s=function(t,e,n,i,r,o){if(!n){var s=function(t,e,n){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=p.from(e,n));return e}(e,i,r);i!==s&&(n=!0,r="buffer",i=s)}var a=e.objectMode?1:i.length;e.length+=a;var u=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(v.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),v.prototype._write=function(t,e,n){n(new Error("_write() is not implemented"))},v.prototype._writev=null,v.prototype.end=function(t,e,n){var i=this._writableState;"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!==t&&void 0!==t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||function(t,e,n){e.ending=!0,x(t,e),n&&(e.finished?o.nextTick(n):t.once("finish",n));e.ended=!0,t.writable=!1}(this,i,n)},Object.defineProperty(v.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),v.prototype.destroy=m.destroy,v.prototype._undestroy=m.undestroy,v.prototype._destroy=function(t,e){this.end(),e(t)}}).call(this,n(43),n(215).setImmediate,n(22))},function(t,e,n){(e=t.exports=n(118)).Stream=e,e.Readable=e,e.Writable=n(73),e.Duplex=n(26),e.Transform=n(114),e.PassThrough=n(212)},function(t,e){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(t){return"function"==typeof t}function r(t){return"object"==typeof t&&null!==t}function o(t){return void 0===t}t.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||isNaN(t))throw TypeError("n must be a positive number");return this._maxListeners=t,this},n.prototype.emit=function(t){var e,n,s,a,u,l;if(this._events||(this._events={}),"error"===t&&(!this._events.error||r(this._events.error)&&!this._events.error.length)){if((e=arguments[1])instanceof Error)throw e;var c=new Error('Uncaught, unspecified "error" event. ('+e+")");throw c.context=e,c}if(o(n=this._events[t]))return!1;if(i(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),n.apply(this,a)}else if(r(n))for(a=Array.prototype.slice.call(arguments,1),s=(l=n.slice()).length,u=0;u0&&this._events[t].length>s&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){if(!i(e))throw TypeError("listener must be a function");var n=!1;function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}return r.listener=e,this.on(t,r),this},n.prototype.removeListener=function(t,e){var n,o,s,a;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(s=(n=this._events[t]).length,o=-1,n===e||i(n.listener)&&n.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(r(n)){for(a=s;a-- >0;)if(n[a]===e||n[a].listener&&n[a].listener===e){o=a;break}if(o<0)return this;1===n.length?(n.length=0,delete this._events[t]):n.splice(o,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(i(n=this._events[t]))this.removeListener(t,n);else if(n)for(;n.length;)this.removeListener(t,n[n.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){return this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.live_task=void 0;r(n(15)),r(n(14)),r(n(6));var i=r(n(7));function r(t){return t&&t.__esModule?t:{default:t}}e.live_task=function(t,e){return function(n){var r={module:"pix2wav",activity:"live",dataset:t,checkpoint:e,opt:{poll_delay:.2}};return console.log(r),console.log("add live task"),i.default.queue.add_task(r)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.load_directories=void 0;var i=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{!i&&a.return&&a.return()}finally{if(r)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=(l(n(15)),l(n(14)),l(n(6))),o=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(36)),s=l(n(7)),a=l(n(4)),u=l(n(60));function l(t){return t&&t.__esModule?t:{default:t}}e.load_directories=function(t){return function(e){var n=u.default.name;a.default.allProgress([o.load(n),s.default.socket.list_directory({module:"pix2pix",dir:"sequences/pix2wav/"}),s.default.socket.list_directory({module:"pix2pix",dir:"datasets/pix2wav/"}),s.default.socket.list_directory({module:"pix2pix",dir:"checkpoints/pix2wav/"}),s.default.socket.list_directory({module:"pix2pix",dir:"checkpoints/pix2pix/"})],function(t,n,i){console.log("progress",n,i),e({type:r.default.app.load_progress,progress:{i:n,n:i}})}).then(function(t){var s=i(t,5),a=s[0],u=s[1],l=s[2],c=s[3],h=s[4],p=a.folderLookup,f=a.fileLookup,d=a.datasetLookup,m=a.folders,y=a.files,_=(a.unsortedFolder,u.filter(function(t){return t.dir}));_.forEach(function(t){o.getDataset(n,d,t.name).isBuilt=!0}),l.filter(function(t){return t.dir}).forEach(function(t){o.getDataset(n,d,t.name).hasDataset=!0});var v=c.filter(function(t){return t.dir});v.forEach(function(t){o.getDataset(n,d,t.name).hasCheckpoints=!0,t.module="pix2wav"});var g=h.filter(function(t){return t.dir});g.forEach(function(t){o.getDataset(n,d,t.name).hasCheckpoints=!0,t.module="pix2pix"}),console.log(t),console.log(v),console.log(g),e({type:r.default.dataset.load,data:{module:n,folderLookup:p,fileLookup:f,datasetLookup:d,folders:m,files:y,sequences:_,datasets:l,checkpoints:v.concat(g)}})}).catch(function(t){console.error(t)}),t&&(console.log("folder id",t),e({type:r.default.dataset.set_folder,data:{folder_id:t,module:n}}))}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default={name:"pix2pix",displayName:"Pix2Pix",datatype:"video"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.load_directories=void 0;var i=function(){return function(t,e){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return function(t,e){var n=[],i=!0,r=!1,o=void 0;try{for(var s,a=t[Symbol.iterator]();!(i=(s=a.next()).done)&&(n.push(s.value),!e||n.length!==e);i=!0);}catch(t){r=!0,o=t}finally{try{!i&&a.return&&a.return()}finally{if(r)throw o}}return n}(t,e);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),r=(l(n(15)),l(n(14)),l(n(6))),o=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(36)),s=l(n(7)),a=l(n(4)),u=l(n(78));function l(t){return t&&t.__esModule?t:{default:t}}e.load_directories=function(t){return function(e){var n=u.default.name;a.default.allProgress([o.load(n),s.default.socket.list_directory({module:n,dir:"sequences/pix2pix/"}),s.default.socket.list_directory({module:n,dir:"datasets/pix2pix/"}),s.default.socket.list_directory({module:n,dir:"checkpoints/pix2pix/"})],function(t,n,i){console.log("pix2pix load progress",n,i),e({type:r.default.app.load_progress,progress:{i:n,n:i}})}).then(function(t){var s=i(t,4),a=s[0],u=s[1],l=s[2],c=s[3],h=a.folderLookup,p=a.fileLookup,f=a.datasetLookup,d=a.folders,m=a.files,y=(a.unsortedFolder,u.filter(function(t){return t.dir}));y.forEach(function(t){o.getDataset(n,f,t.name).isBuilt=!0}),l.filter(function(t){return t.dir}).forEach(function(t){o.getDataset(n,f,t.name).hasDataset=!0});var _=c.filter(function(t){return t.dir});_.forEach(function(t){var e=o.getDataset(n,f,t.name);e.hasCheckpoints=!0,e.checkpoints=[t]}),e({type:r.default.dataset.load,data:{module:n,folderLookup:h,fileLookup:p,datasetLookup:f,folders:d,files:m,sequences:y,datasets:l,checkpoints:_}})}).catch(function(t){console.error(t)}),t&&(console.log("folder id",t),e({type:r.default.dataset.set_folder,data:{folder_id:t,module:n}}))}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=l(n(251)),r=l(n(244)),o=l(n(240)),s=l(n(236)),a=l(n(228)),u=l(n(166));function l(t){return t&&t.__esModule?t:{default:t}}e.default={biggan:i.default,morph:r.default,pix2pix:o.default,pix2pixhd:s.default,pix2wav:a.default,samplernn:u.default}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.enqueue_test_task=e.changeLanguage=e.changeTool=e.countDirectory=e.listDirectory=e.run=void 0;var i=o(n(14)),r=o(n(6));function o(t){return t&&t.__esModule?t:{default:t}}e.run=function(t){return function(e){e({type:r.default.system.running_command,cmd:t}),i.default.actions.run_system_command({cmd:t}).then(function(t){e({type:r.default.system.command_output,data:t})})}},e.listDirectory=function(t){return function(e){e({type:r.default.system.listing_directory,opt:t}),i.default.actions.list_directory(t).then(function(t){e({type:r.default.system.list_directory,data:t})})}},e.countDirectory=function(t){return function(e){e({type:r.default.system.counting_directory,opt:t}),i.default.actions.count_directory(t).then(function(t){e({type:r.default.system.count_directory,data:t})})}},e.changeTool=function(t){return localStorage.setItem("system.last_tool",t),{type:r.default.app.change_tool,tool:t}},e.changeLanguage=function(t){return localStorage.setItem("cortex.i18n.language",t),{type:r.default.system.change_language,language:t}},e.enqueue_test_task=function(t){return function(t){}};window.addEventListener("keyDown",function(t){t.altKey&&t.keyCode})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.languages=e.strings=void 0;var i=o(n(288)),r=o(n(287));function o(t){return t&&t.__esModule?t:{default:t}}e.strings=function(t){switch(t){case"pyro":return r.default;default:return i.default}},e.languages=["en","pyro"]},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.gaussian=function(t,e){var n=void 0,i=!1;return function(){var r=void 0;if(i)r=n,i=!1;else{var o=void 0,s=void 0,a=void 0;do{o=2*Math.random()-1,s=2*Math.random()-1,a=o*o+s*s}while(a>=1);a=Math.sqrt(-2*Math.log(a)/a),r=o*a,n=s*a,i=!0}var u=t+e*r;return u>0?u:-u}};e.mod=function(t,e){return t-e*Math.floor(t/e)},e.clamp=function(t,e,n){return t=.5?-1:1},e.choice=function(t){return t[Math.floor(Math.random()*t.length)]},e.angle=function(t,e,n,i){return Math.atan2(i-e,n-t)},e.dist=function(t,e,n,i){return Math.sqrt(Math.pow(n-t,2)+Math.pow(i-e,2))},e.xor=function(t,e){return e=!!e,((t=!!t)||e)&&!(t&&e)},e.quantize=function(t,e){return Math.floor(t/e)*e},e.shuffle=function(t){for(var e=t.length;e>0;e--){var n=i(e),r=t[e-1];t[e-1]=t[n],t[n]=r}return t}},function(t,e,n){var i,r=r||function(t){"use strict";if(!(void 0===t||"undefined"!=typeof navigator&&/MSIE [1-9]\./.test(navigator.userAgent))){var e=function(){return t.URL||t.webkitURL||t},n=t.document.createElementNS("http://www.w3.org/1999/xhtml","a"),i="download"in n,r=/constructor/i.test(t.HTMLElement)||t.safari,o=/CriOS\/[\d]+/.test(navigator.userAgent),s=function(e){(t.setImmediate||t.setTimeout)(function(){throw e},0)},a=function(t){setTimeout(function(){"string"==typeof t?e().revokeObjectURL(t):t.remove()},4e4)},u=function(t){return/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(t.type)?new Blob([String.fromCharCode(65279),t],{type:t.type}):t},l=function(l,c,h){h||(l=u(l));var p,f=this,d="application/octet-stream"===l.type,m=function(){!function(t,e,n){for(var i=(e=[].concat(e)).length;i--;){var r=t["on"+e[i]];if("function"==typeof r)try{r.call(t,n||t)}catch(t){s(t)}}}(f,"writestart progress write writeend".split(" "))};if(f.readyState=f.INIT,i)return p=e().createObjectURL(l),void setTimeout(function(){var t,e;n.href=p,n.download=c,t=n,e=new MouseEvent("click"),t.dispatchEvent(e),m(),a(p),f.readyState=f.DONE});!function(){if((o||d&&r)&&t.FileReader){var n=new FileReader;return n.onloadend=function(){var e=o?n.result:n.result.replace(/^data:[^;]*;/,"data:attachment/file;");t.open(e,"_blank")||(t.location.href=e),e=void 0,f.readyState=f.DONE,m()},n.readAsDataURL(l),void(f.readyState=f.INIT)}p||(p=e().createObjectURL(l)),d?t.location.href=p:t.open(p,"_blank")||(t.location.href=p);f.readyState=f.DONE,m(),a(p)}()},c=l.prototype;return"undefined"!=typeof navigator&&navigator.msSaveOrOpenBlob?function(t,e,n){return e=e||t.name||"download",n||(t=u(t)),navigator.msSaveOrOpenBlob(t,e)}:(c.abort=function(){},c.readyState=c.INIT=0,c.WRITING=1,c.DONE=2,c.error=c.onwritestart=c.onprogress=c.onwrite=c.onabort=c.onerror=c.onwriteend=null,function(t,e,n){return new l(t,e||t.name||"download",n)})}}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content); /*! @source http://purl.eligrey.com/github/FileSaver.js/blob/master/FileSaver.js */void 0!==t&&t.exports?t.exports.saveAs=r:null!==n(294)&&null!==n(293)&&(void 0===(i=function(){return r}.call(e,n,e,t))||(t.exports=i))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=e.as_type=function(t,e){return[t,e].join("_").toUpperCase()},r=e.with_type=function(t,e){return e.reduce(function(e,n){return(e[n]=i(t,n))&&e},{})};e.crud_type=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return r(t,e.concat(["index_loading","index","index_error","show_loading","show","show_error","create_loading","create","create_error","update_loading","update","update_error","destroy_loading","destroy","destroy_error","upload_loading","upload_progress","upload_waiting","upload_complete","upload_error","sort"]))}},function(t,e,n){"use strict";e.__esModule=!0;e.addLeadingSlash=function(t){return"/"===t.charAt(0)?t:"/"+t},e.stripLeadingSlash=function(t){return"/"===t.charAt(0)?t.substr(1):t};var i=e.hasBasename=function(t,e){return new RegExp("^"+e+"(\\/|\\?|#|$)","i").test(t)};e.stripBasename=function(t,e){return i(t,e)?t.substr(e.length):t},e.stripTrailingSlash=function(t){return"/"===t.charAt(t.length-1)?t.slice(0,-1):t},e.parsePath=function(t){var e=t||"/",n="",i="",r=e.indexOf("#");-1!==r&&(i=e.substr(r),e=e.substr(0,r));var o=e.indexOf("?");return-1!==o&&(n=e.substr(o),e=e.substr(0,o)),{pathname:e,search:"?"===n?"":n,hash:"#"===i?"":i}},e.createPath=function(t){var e=t.pathname,n=t.search,i=t.hash,r=e||"/";return n&&"?"!==n&&(r+="?"===n.charAt(0)?n:"?"+n),i&&"#"!==i&&(r+="#"===i.charAt(0)?i:"#"+i),r}},function(t,e,n){"use strict";n.r(e);var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};e.default=function t(e,n){if(e===n)return!0;if(null==e||null==n)return!1;if(Array.isArray(e))return Array.isArray(n)&&e.length===n.length&&e.every(function(e,i){return t(e,n[i])});var r=void 0===e?"undefined":i(e);if(r!==(void 0===n?"undefined":i(n)))return!1;if("object"===r){var o=e.valueOf(),s=n.valueOf();if(o!==e||s!==n)return t(o,s);var a=Object.keys(e),u=Object.keys(n);return a.length===u.length&&a.every(function(i){return t(e[i],n[i])})}return!1}},function(t,e,n){"use strict";function i(t){return"/"===t.charAt(0)}function r(t,e){for(var n=e,i=n+1,r=t.length;i1&&void 0!==arguments[1]?arguments[1]:"",n=t&&t.split("/")||[],o=e&&e.split("/")||[],s=t&&i(t),a=e&&i(e),u=s||a;if(t&&i(t)?o=n:n.length&&(o.pop(),o=o.concat(n)),!o.length)return"/";var l=void 0;if(o.length){var c=o[o.length-1];l="."===c||".."===c||""===c}else l=!1;for(var h=0,p=o.length;p>=0;p--){var f=o[p];"."===f?r(o,p):".."===f?(r(o,p),h++):h&&(r(o,p),h--)}if(!u)for(;h--;h)o.unshift("..");!u||""===o[0]||o[0]&&i(o[0])||o.unshift("");var d=o.join("/");return l&&"/"!==d.substr(-1)&&(d+="/"),d}},function(t,e,n){"use strict";(function(t,i){var r,o=n(147);r="undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==t?t:i;var s=Object(o.a)(r);e.a=s}).call(this,n(22),n(314)(t))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=Object.assign||function(t){for(var e=1;e=0||Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}(this.state,[]);this.props.actions.signup(e)}}},{key:"render",value:function(){if(this.props.auth.isAuthenticated){var t=this.props.auth.returnTo;return t&&!t.match(/(api|login|logout|signup)/i)||(t="/"),(0,o.h)(u.Redirect,{to:t})}return(0,o.h)("form",{onSubmit:this.handleSubmit},(0,o.h)("h1",null,"New account"),(0,o.h)("br",null),(0,o.h)(c.Group,null,(0,o.h)(c.TextInput,{autofocus:!0,autocapitalize:"off",autocomplete:"off",title:"Username",name:"username",type:"text",value:this.state.username,onInput:this.handleChange}),(0,o.h)(c.TextInput,{title:"Password",name:"password",type:"password",value:this.state.password,onInput:this.handleChange}),(0,o.h)(c.TextInput,{title:"Password again :)",name:"password2",type:"password",value:this.state.password2,onInput:this.handleChange}),(0,o.h)(c.Button,{loading:this.props.auth.loading},"Sign up"),this.renderAuthError()))}},{key:"renderAuthError",value:function(){return this.props.auth.error?(0,o.h)("div",{className:"form-input-hint"},"Please doublecheck the form (o=_o~~)"):(0,o.h)("div",{className:"form-input-hint"})}}]),e}();e.default=(0,a.connect)(function(t){return{auth:t.auth}},function(t){return{actions:(0,s.bindActionCreators)(i({},l),t)}})(h)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n=this.index;e--)n=(n<<8)+this.byteAt(e);return this.index+=t,n},readString:function(t){return i.transformTo("string",this.readData(t))},readData:function(t){},lastIndexOfSignature:function(t){},readAndCheckSignature:function(t){},readDate:function(){var t=this.readInt(4);return new Date(Date.UTC(1980+(t>>25&127),(t>>21&15)-1,t>>16&31,t>>11&31,t>>5&63,(31&t)<<1))}},t.exports=r},function(t,e,n){"use strict";var i=n(94);function r(t){i.call(this,t);for(var e=0;e=0;--o)if(this.data[o]===e&&this.data[o+1]===n&&this.data[o+2]===i&&this.data[o+3]===r)return o-this.zero;return-1},r.prototype.readAndCheckSignature=function(t){var e=t.charCodeAt(0),n=t.charCodeAt(1),i=t.charCodeAt(2),r=t.charCodeAt(3),o=this.readData(4);return e===o[0]&&n===o[1]&&i===o[2]&&r===o[3]},r.prototype.readData=function(t){if(this.checkOffset(t),0===t)return[];var e=this.data.slice(this.zero+this.index,this.zero+this.index+t);return this.index+=t,e},t.exports=r},function(t,e,n){"use strict";var i=n(10),r=n(24),o=n(95),s=n(173),a=n(172),u=n(93);t.exports=function(t){var e=i.getTypeOf(t);return i.checkSupport(e),"string"!==e||r.uint8array?"nodebuffer"===e?new a(t):r.uint8array?new u(i.transformTo("uint8array",t)):new o(i.transformTo("array",t)):new s(t)}},function(t,e,n){"use strict";e.LOCAL_FILE_HEADER="PK",e.CENTRAL_FILE_HEADER="PK",e.CENTRAL_DIRECTORY_END="PK",e.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",e.ZIP64_CENTRAL_DIRECTORY_END="PK",e.DATA_DESCRIPTOR="PK\b"},function(t,e,n){"use strict";t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},function(t,e,n){"use strict";t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},function(t,e,n){"use strict";var i=n(23),r=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(t){r=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(t){o=!1}for(var s=new i.Buf8(256),a=0;a<256;a++)s[a]=a>=252?6:a>=248?5:a>=240?4:a>=224?3:a>=192?2:1;function u(t,e){if(e<65537&&(t.subarray&&o||!t.subarray&&r))return String.fromCharCode.apply(null,i.shrinkBuf(t,e));for(var n="",s=0;s>>6,e[s++]=128|63&n):n<65536?(e[s++]=224|n>>>12,e[s++]=128|n>>>6&63,e[s++]=128|63&n):(e[s++]=240|n>>>18,e[s++]=128|n>>>12&63,e[s++]=128|n>>>6&63,e[s++]=128|63&n);return e},e.buf2binstring=function(t){return u(t,t.length)},e.binstring2buf=function(t){for(var e=new i.Buf8(t.length),n=0,r=e.length;n4)l[i++]=65533,n+=o-1;else{for(r&=2===o?31:3===o?15:7;o>1&&n1?l[i++]=65533:r<65536?l[i++]=r:(r-=65536,l[i++]=55296|r>>10&1023,l[i++]=56320|1023&r)}return u(l,i)},e.utf8border=function(t,e){var n;for((e=e||t.length)>t.length&&(e=t.length),n=e-1;n>=0&&128==(192&t[n]);)n--;return n<0?e:0===n?e:n+s[t[n]]>e?n:e}},function(t,e,n){"use strict";var i=function(){for(var t,e=[],n=0;n<256;n++){t=n;for(var i=0;i<8;i++)t=1&t?3988292384^t>>>1:t>>>1;e[n]=t}return e}();t.exports=function(t,e,n,r){var o=i,s=r+n;t^=-1;for(var a=r;a>>8^o[255&(t^e[a])];return-1^t}},function(t,e,n){"use strict";t.exports=function(t,e,n,i){for(var r=65535&t|0,o=t>>>16&65535|0,s=0;0!==n;){n-=s=n>2e3?2e3:n;do{o=o+(r=r+e[i++]|0)|0}while(--s);r%=65521,o%=65521}return r|o<<16|0}},function(t,e,n){"use strict";var i=n(16);e.STORE={magic:"\0\0",compressWorker:function(t){return new i("STORE compression")},uncompressWorker:function(){return new i("STORE decompression")}},e.DEFLATE=n(187)},function(t,e,n){"use strict";var i=n(16),r=n(69);function o(){i.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}n(10).inherits(o,i),o.prototype.processChunk=function(t){this.streamInfo.crc32=r(t.data,this.streamInfo.crc32||0),this.push(t)},t.exports=o},function(t,e,n){"use strict";var i=n(10),r=n(16);function o(t){r.call(this,"DataLengthProbe for "+t),this.propName=t,this.withStreamInfo(t,0)}i.inherits(o,r),o.prototype.processChunk=function(t){if(t){var e=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=e+t.data.length}r.prototype.processChunk.call(this,t)},t.exports=o},function(t,e,n){"use strict";var i=n(10),r=n(16);function o(t){r.call(this,"DataWorker");var e=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,t.then(function(t){e.dataIsReady=!0,e.data=t,e.max=t&&t.length||0,e.type=i.getTypeOf(t),e.isPaused||e._tickAndRepeat()},function(t){e.error(t)})}i.inherits(o,r),o.prototype.cleanUp=function(){r.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,i.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(i.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var t=null,e=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":t=this.data.substring(this.index,e);break;case"uint8array":t=this.data.subarray(this.index,e);break;case"array":case"nodebuffer":t=this.data.slice(this.index,e)}return this.index=e,this.push({data:t,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=o},function(t,e,n){"use strict";e.base64=!1,e.binary=!1,e.dir=!1,e.createFolders=!0,e.date=null,e.compression=null,e.compressionOptions=null,e.comment=null,e.unixPermissions=null,e.dosPermissions=null},function(t,e,n){"use strict";(function(e){var i=n(10),r=n(191),o=n(16),s=n(113),a=n(24),u=n(45),l=null;if(a.nodestream)try{l=n(190)}catch(t){}function c(t,n){return new u.Promise(function(r,o){var a=[],u=t._internalType,l=t._outputType,c=t._mimeType;t.on("data",function(t,e){a.push(t),n&&n(e)}).on("error",function(t){a=[],o(t)}).on("end",function(){try{var t=function(t,e,n){switch(t){case"blob":return i.newBlob(i.transformTo("arraybuffer",e),n);case"base64":return s.encode(e);default:return i.transformTo(t,e)}}(l,function(t,n){var i,r=0,o=null,s=0;for(i=0;i>2,a=(3&e)<<4|n>>4,u=f>1?(15&n)<<2|r>>6:64,l=f>2?63&r:64,c.push(o.charAt(s)+o.charAt(a)+o.charAt(u)+o.charAt(l));return c.join("")},e.decode=function(t){var e,n,i,s,a,u,l=0,c=0;if("data:"===t.substr(0,"data:".length))throw new Error("Invalid base64 input, it looks like a data url.");var h,p=3*(t=t.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(t.charAt(t.length-1)===o.charAt(64)&&p--,t.charAt(t.length-2)===o.charAt(64)&&p--,p%1!=0)throw new Error("Invalid base64 input, bad content length.");for(h=r.uint8array?new Uint8Array(0|p):new Array(0|p);l>4,n=(15&s)<<4|(a=o.indexOf(t.charAt(l++)))>>2,i=(3&a)<<6|(u=o.indexOf(t.charAt(l++))),h[c++]=e,64!==a&&(h[c++]=n),64!==u&&(h[c++]=i);return h}},function(t,e,n){"use strict";t.exports=o;var i=n(26),r=n(46);function o(t){if(!(this instanceof o))return new o(t);i.call(this,t),this._transformState={afterTransform:function(t,e){var n=this._transformState;n.transforming=!1;var i=n.writecb;if(!i)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,null!=e&&this.push(e),i(t);var r=this._readableState;r.reading=!1,(r.needReadable||r.length>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function a(t){var e=this.lastTotal-this.lastNeed,n=function(t,e,n){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function u(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var i=n.charCodeAt(n.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function l(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function c(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function p(t){return t.toString(this.encoding)}function f(t){return t&&t.length?this.write(t):""}e.StringDecoder=o,o.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n=0)return r>0&&(t.lastNeed=r-1),r;if(--i=0)return r>0&&(t.lastNeed=r-2),r;if(--i=0)return r>0&&(2===r?r=0:t.lastNeed=r-3),r;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var i=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)},o.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,n){"use strict";var i=n(59);function r(t,e){t.emit("error",e)}t.exports={destroy:function(t,e){var n=this,o=this._readableState&&this._readableState.destroyed,s=this._writableState&&this._writableState.destroyed;return o||s?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||i.nextTick(r,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?(i.nextTick(r,n,t),n._writableState&&(n._writableState.errorEmitted=!0)):e&&e(t)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}}},function(t,e,n){t.exports=n(75).EventEmitter},function(t,e,n){"use strict";(function(e,i){var r=n(59);t.exports=g;var o,s=n(120);g.ReadableState=v;n(75).EventEmitter;var a=function(t,e){return t.listeners(e).length},u=n(117),l=n(58).Buffer,c=e.Uint8Array||function(){};var h=n(46);h.inherits=n(30);var p=n(218),f=void 0;f=p&&p.debuglog?p.debuglog("stream"):function(){};var d,m=n(217),y=n(116);h.inherits(g,u);var _=["error","close","destroy","pause","resume"];function v(t,e){o=o||n(26),t=t||{};var i=e instanceof o;this.objectMode=!!t.objectMode,i&&(this.objectMode=this.objectMode||!!t.readableObjectMode);var r=t.highWaterMark,s=t.readableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=r||0===r?r:i&&(s||0===s)?s:a,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(d||(d=n(115).StringDecoder),this.decoder=new d(t.encoding),this.encoding=t.encoding)}function g(t){if(o=o||n(26),!(this instanceof g))return new g(t);this._readableState=new v(t,this),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),u.call(this)}function b(t,e,n,i,r){var o,s=t._readableState;null===e?(s.reading=!1,function(t,e){if(e.ended)return;if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,x(t)}(t,s)):(r||(o=function(t,e){var n;i=e,l.isBuffer(i)||i instanceof c||"string"==typeof e||void 0===e||t.objectMode||(n=new TypeError("Invalid non-string/buffer chunk"));var i;return n}(s,e)),o?t.emit("error",o):s.objectMode||e&&e.length>0?("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===l.prototype||(e=function(t){return l.from(t)}(e)),i?s.endEmitted?t.emit("error",new Error("stream.unshift() after end event")):w(t,s,e,!0):s.ended?t.emit("error",new Error("stream.push() after EOF")):(s.reading=!1,s.decoder&&!n?(e=s.decoder.write(e),s.objectMode||0!==e.length?w(t,s,e,!1):O(t,s)):w(t,s,e,!1))):i||(s.reading=!1));return function(t){return!t.ended&&(t.needReadable||t.lengthe.highWaterMark&&(e.highWaterMark=function(t){return t>=k?t=k:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function x(t){var e=t._readableState;e.needReadable=!1,e.emittedReadable||(f("emitReadable",e.flowing),e.emittedReadable=!0,e.sync?r.nextTick(T,t):T(t))}function T(t){f("emit readable"),t.emit("readable"),E(t)}function O(t,e){e.readingMore||(e.readingMore=!0,r.nextTick(P,t,e))}function P(t,e){for(var n=e.length;!e.reading&&!e.flowing&&!e.ended&&e.length=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.head.data:e.buffer.concat(e.length),e.buffer.clear()):n=function(t,e,n){var i;to.length?o.length:t;if(s===o.length?r+=o:r+=o.slice(0,t),0===(t-=s)){s===o.length?(++i,n.next?e.head=n.next:e.head=e.tail=null):(e.head=n,n.data=o.slice(s));break}++i}return e.length-=i,r}(t,e):function(t,e){var n=l.allocUnsafe(t),i=e.head,r=1;i.data.copy(n),t-=i.data.length;for(;i=i.next;){var o=i.data,s=t>o.length?o.length:t;if(o.copy(n,n.length-t,0,s),0===(t-=s)){s===o.length?(++r,i.next?e.head=i.next:e.head=e.tail=null):(e.head=i,i.data=o.slice(s));break}++r}return e.length-=r,n}(t,e);return i}(t,e.buffer,e.decoder),n);var n}function R(t){var e=t._readableState;if(e.length>0)throw new Error('"endReadable()" called on non-empty stream');e.endEmitted||(e.ended=!0,r.nextTick(j,e,t))}function j(t,e){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end"))}function N(t,e){for(var n=0,i=t.length;n=e.highWaterMark||e.ended))return f("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?R(this):x(this),null;if(0===(t=S(t,e))&&e.ended)return 0===e.length&&R(this),null;var i,r=e.needReadable;return f("need readable",r),(0===e.length||e.length-t0?M(t,e):null)?(e.needReadable=!0,t=0):e.length-=t,0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&R(this)),null!==i&&this.emit("data",i),i},g.prototype._read=function(t){this.emit("error",new Error("_read() is not implemented"))},g.prototype.pipe=function(t,e){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,f("pipe count=%d opts=%j",o.pipesCount,e);var u=(!e||!1!==e.end)&&t!==i.stdout&&t!==i.stderr?c:g;function l(e,i){f("onunpipe"),e===n&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,f("cleanup"),t.removeListener("close",_),t.removeListener("finish",v),t.removeListener("drain",h),t.removeListener("error",y),t.removeListener("unpipe",l),n.removeListener("end",c),n.removeListener("end",g),n.removeListener("data",m),p=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||h())}function c(){f("onend"),t.end()}o.endEmitted?r.nextTick(u):n.once("end",u),t.on("unpipe",l);var h=function(t){return function(){var e=t._readableState;f("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&a(t,"data")&&(e.flowing=!0,E(t))}}(n);t.on("drain",h);var p=!1;var d=!1;function m(e){f("ondata"),d=!1,!1!==t.write(e)||d||((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==N(o.pipes,t))&&!p&&(f("false write response, pause",n._readableState.awaitDrain),n._readableState.awaitDrain++,d=!0),n.pause())}function y(e){f("onerror",e),g(),t.removeListener("error",y),0===a(t,"error")&&t.emit("error",e)}function _(){t.removeListener("finish",v),g()}function v(){f("onfinish"),t.removeListener("close",_),g()}function g(){f("unpipe"),n.unpipe(t)}return n.on("data",m),function(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?s(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}(t,"error",y),t.once("close",_),t.once("finish",v),t.emit("pipe",n),o.flowing||(f("pipe resume"),n.resume()),t},g.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n),this);if(!t){var i=e.pipes,r=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o2&&void 0!==arguments[2]?arguments[2]:1;return function(r){var o={module:"pix2pix",activity:"train",dataset:t.name,epoch:0,epochs:n,opt:{folder_id:e,load_size:264}};return console.log(o),i.default.queue.add_task(o)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.default={name:"morph",displayName:"Morph",datatype:"video"}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=t.progress;if(!e)return;for(var n=e.i,r=e.n,o=[],s=0;sl?" ":(0,r.h)("button",{onClick:function(){return c(n,e)},onMouseEnter:function(){t.setState({x:n,y:e}),h(n,e)}}," "))}))}))}}]),e}();e.default=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:1e4;return n=e.ttl||n,new Promise(function(i,r){var o=(0,s.default)(),u=setTimeout(function(){a.socket.off("system_res",l),r("timeout")},n),l=function t(e){e.uuid&&e.uuid===o&&(clearTimeout(u),a.socket.off("system_res",t),i(e))};a.socket.emit("system",{cmd:t,payload:e,uuid:o}),a.socket.on("system_res",l)})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.frameTimestamp=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,e=o(((t/=i)%60).toFixed(1));if((t=Math.floor(t/60))>60)return Math.floor(t/60)+":"+o(t%60)+":"+e;return t%60+":"+e},e.timeInSeconds=function(t){return(t/10).toFixed(1)+" s."},e.gerund=function(t){return t.replace(/e?$/,"ing")},e.commatize=r,e.carbon_date=function(t,e){var n,i=(+new Date-new Date(t))/1e3;n=!e&&i<86400?"new":i<604800?"recent":i<1209600?"med":i<3024e3?"old":i<12315200?"older":"quiet";return n},e.carbon_time=function(t,e){var n,i=(+new Date-new Date(t))/1e3;n=!e&&i<3600?"new":i<10800?"recent":i<43200?"med":i<86400?"old":i<172800?"older":"quiet";return n},e.hush_views=function(t,e,n){var i=r(t,1e3);if(e=e||1,(t=t||0)<30)return["quiet",t+" v."];return t<200?["quiet",i+" v."]:t<500?["quiet",i+" v."]:t<1e3?["old",i+" v."]:t<5e3?["med",i+" kv."]:n||t<1e4?["recent",i+" kv."]:["new",i+" kv."]},e.hush_threads=function(t,e,n){var i=r(t,1e3);return e=e||1,(t=t||0)<10?["quiet",t+" t."]:t<25?["old",i+" t."]:t<50?["med",i+" t."]:n||t<100?["recent",i+" t."]:["new",i+" t."]},e.hush_size=function(t,e,n){var i=r(Math.round(t/1024));if(e=1,!(t=t||0))return["",""];if(t<1e3)return["quiet",t+" b."];if(t<1e6)return["quiet",i+" kb."];if(t<2e7/e)return["quiet",i+" mb."];if(t<5e7/e)return["old",i+" mb."];if(t<8e7/e)return["med",i+" mb."];if(n||t<17e7/e)return["recent",i+" mb."];return["new",i+" mb."]},e.hush_null=function(t,e,n){var i=e?t+" "+e+".":t;return t<3?["quiet",i]:t<6?["older",i]:t<10?["old",i]:t<16?["med",i]:n||t<21?["recent",i]:["new",i]},e.get_age=function(t){var e,n=Math.abs(+Date.now()-new Date(t))/1e3,i=Math.floor;if(n<5)return"now";if(n<60)return i(n)+"s";if((n/=60)<60)return i(n)+"m";if(e=i(n%60),n/=60,e>0&&n<2)return i(n)+"h"+e+"m";if(n<24)return i(n)+"h";if((n/=24)<7)return i(n)+"d";if((n/=7)<12)return i(n)+"w";if((n/=4)<12)return i(n)+"m";return i(n/=12)+"y"},e.courtesy_s=function(t,e){return 1==t?"":e||"s"},e.pad=o;var i=25;function r(t,e){e=e||1024;var n,i=[],r=0,o=Math.floor;t>e&&(t/=e,i.unshift(o(10*t%10)),i.unshift("."));do{n=t%10,!(t=o(t/10))||++r%3||(n=" "+o(n)),i.unshift(o(n))}while(t);return i.join("")}function o(t,e){return t<10?"0"+t:t}},function(t,e,n){"use strict";e.__esModule=!0;e.addLeadingSlash=function(t){return"/"===t.charAt(0)?t:"/"+t},e.stripLeadingSlash=function(t){return"/"===t.charAt(0)?t.substr(1):t};var i=e.hasBasename=function(t,e){return new RegExp("^"+e+"(\\/|\\?|#|$)","i").test(t)};e.stripBasename=function(t,e){return i(t,e)?t.substr(e.length):t},e.stripTrailingSlash=function(t){return"/"===t.charAt(t.length-1)?t.slice(0,-1):t},e.parsePath=function(t){var e=t||"/",n="",i="",r=e.indexOf("#");-1!==r&&(i=e.substr(r),e=e.substr(0,r));var o=e.indexOf("?");return-1!==o&&(n=e.substr(o),e=e.substr(0,o)),{pathname:e,search:"?"===n?"":n,hash:"#"===i?"":i}},e.createPath=function(t){var e=t.pathname,n=t.search,i=t.hash,r=e||"/";return n&&"?"!==n&&(r+="?"===n.charAt(0)?n:"?"+n),i&&"#"!==i&&(r+="#"===i.charAt(0)?i:"#"+i),r}},function(t,e,n){"use strict";t.exports=function(){}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=e.CALL_HISTORY_METHOD="@@router/CALL_HISTORY_METHOD";function r(t){return function(){for(var e=arguments.length,n=Array(e),r=0;r0&&void 0!==arguments[0]?arguments[0]:o,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=e.type,s=e.payload;if(n===r)return i({},t,{locationBeforeTransitions:s});return t};var r=e.LOCATION_CHANGE="@@router/LOCATION_CHANGE",o={locationBeforeTransitions:null}},function(t,e,n){"use strict";e.__esModule=!0;e.canUseDOM=!("undefined"==typeof window||!window.document||!window.document.createElement),e.addEventListener=function(t,e,n){return t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)},e.removeEventListener=function(t,e,n){return t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent("on"+e,n)},e.getConfirmation=function(t,e){return e(window.confirm(t))},e.supportsHistory=function(){var t=window.navigator.userAgent;return(-1===t.indexOf("Android 2.")&&-1===t.indexOf("Android 4.0")||-1===t.indexOf("Mobile Safari")||-1!==t.indexOf("Chrome")||-1!==t.indexOf("Windows Phone"))&&(window.history&&"pushState"in window.history)},e.supportsPopStateOnHashChange=function(){return-1===window.navigator.userAgent.indexOf("Trident")},e.supportsGoWithoutReloadUsingHash=function(){return-1===window.navigator.userAgent.indexOf("Firefox")},e.isExtraneousPopstateEvent=function(t){return void 0===t.state&&-1===navigator.userAgent.indexOf("CriOS")}},function(t,e,n){"use strict";e.__esModule=!0;var i,r=n(9),o=(i=r)&&i.__esModule?i:{default:i};e.default=function(){var t=null,e=[];return{setPrompt:function(e){return(0,o.default)(null==t,"A history supports only one prompt at a time"),t=e,function(){t===e&&(t=null)}},confirmTransitionTo:function(e,n,i,r){if(null!=t){var s="function"==typeof t?t(e,n):t;"string"==typeof s?"function"==typeof i?i(s,r):((0,o.default)(!1,"A history needs a getUserConfirmation function in order to use a prompt message"),r(!0)):r(!1!==s)}else r(!0)},appendListener:function(t){var n=!0,i=function(){n&&t.apply(void 0,arguments)};return e.push(i),function(){n=!1,e=e.filter(function(t){return t!==i})}},notifyListeners:function(){for(var t=arguments.length,n=Array(t),i=0;i=0?e:0)+"#"+t)};e.default=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,o.default)(l.canUseDOM,"Hash history needs a DOM");var e=window.history,n=(0,l.supportsGoWithoutReloadUsingHash)(),c=t.getUserConfirmation,d=void 0===c?l.getConfirmation:c,m=t.hashType,y=void 0===m?"slash":m,_=t.basename?(0,a.stripTrailingSlash)((0,a.addLeadingSlash)(t.basename)):"",v=h[y],g=v.encodePath,b=v.decodePath,w=function(){var t=b(p());return(0,r.default)(!_||(0,a.hasBasename)(t,_),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+t+'" to begin with "'+_+'".'),_&&(t=(0,a.stripBasename)(t,_)),(0,s.createLocation)(t)},k=(0,u.default)(),S=function(t){i(D,t),D.length=e.length,k.notifyListeners(D.location,D.action)},x=!1,T=null,O=function(){var t=p(),e=g(t);if(t!==e)f(e);else{var n=w(),i=D.location;if(!x&&(0,s.locationsAreEqual)(i,n))return;if(T===(0,a.createPath)(n))return;T=null,P(n)}},P=function(t){x?(x=!1,S()):k.confirmTransitionTo(t,"POP",d,function(e){e?S({action:"POP",location:t}):A(t)})},A=function(t){var e=D.location,n=R.lastIndexOf((0,a.createPath)(e));-1===n&&(n=0);var i=R.lastIndexOf((0,a.createPath)(t));-1===i&&(i=0);var r=n-i;r&&(x=!0,j(r))},C=p(),E=g(C);C!==E&&f(E);var M=w(),R=[(0,a.createPath)(M)],j=function(t){(0,r.default)(n,"Hash history go(n) causes a full page reload in this browser"),e.go(t)},N=0,F=function(t){1===(N+=t)?(0,l.addEventListener)(window,"hashchange",O):0===N&&(0,l.removeEventListener)(window,"hashchange",O)},L=!1,D={length:e.length,action:"POP",location:M,createHref:function(t){return"#"+g(_+(0,a.createPath)(t))},push:function(t,e){(0,r.default)(void 0===e,"Hash history cannot push state; it is ignored");var n=(0,s.createLocation)(t,void 0,void 0,D.location);k.confirmTransitionTo(n,"PUSH",d,function(t){if(t){var e=(0,a.createPath)(n),i=g(_+e);if(p()!==i){T=e,function(t){window.location.hash=t}(i);var o=R.lastIndexOf((0,a.createPath)(D.location)),s=R.slice(0,-1===o?0:o+1);s.push(e),R=s,S({action:"PUSH",location:n})}else(0,r.default)(!1,"Hash history cannot PUSH the same path; a new entry will not be added to the history stack"),S()}})},replace:function(t,e){(0,r.default)(void 0===e,"Hash history cannot replace state; it is ignored");var n=(0,s.createLocation)(t,void 0,void 0,D.location);k.confirmTransitionTo(n,"REPLACE",d,function(t){if(t){var e=(0,a.createPath)(n),i=g(_+e);p()!==i&&(T=e,f(i));var r=R.indexOf((0,a.createPath)(D.location));-1!==r&&(R[r]=e),S({action:"REPLACE",location:n})}})},go:j,goBack:function(){return j(-1)},goForward:function(){return j(1)},block:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=k.setPrompt(t);return L||(F(1),L=!0),function(){return L&&(L=!1,F(-1)),e()}},listen:function(t){var e=k.appendListener(t);return F(1),function(){F(-1),e()}}};return D}},function(t,e,n){"use strict";e.__esModule=!0;var i="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},r=Object.assign||function(t){for(var e=1;e0&&void 0!==arguments[0]?arguments[0]:{};(0,s.default)(c.canUseDOM,"Browser history needs a DOM");var e=window.history,n=(0,c.supportsHistory)(),h=!(0,c.supportsPopStateOnHashChange)(),f=t.forceRefresh,d=void 0!==f&&f,m=t.getUserConfirmation,y=void 0===m?c.getConfirmation:m,_=t.keyLength,v=void 0===_?6:_,g=t.basename?(0,u.stripTrailingSlash)((0,u.addLeadingSlash)(t.basename)):"",b=function(t){var e=t||{},n=e.key,i=e.state,r=window.location,s=r.pathname+r.search+r.hash;return(0,o.default)(!g||(0,u.hasBasename)(s,g),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+s+'" to begin with "'+g+'".'),g&&(s=(0,u.stripBasename)(s,g)),(0,a.createLocation)(s,i,n)},w=function(){return Math.random().toString(36).substr(2,v)},k=(0,l.default)(),S=function(t){r(L,t),L.length=e.length,k.notifyListeners(L.location,L.action)},x=function(t){(0,c.isExtraneousPopstateEvent)(t)||P(b(t.state))},T=function(){P(b(p()))},O=!1,P=function(t){O?(O=!1,S()):k.confirmTransitionTo(t,"POP",y,function(e){e?S({action:"POP",location:t}):A(t)})},A=function(t){var e=L.location,n=E.indexOf(e.key);-1===n&&(n=0);var i=E.indexOf(t.key);-1===i&&(i=0);var r=n-i;r&&(O=!0,R(r))},C=b(p()),E=[C.key],M=function(t){return g+(0,u.createPath)(t)},R=function(t){e.go(t)},j=0,N=function(t){1===(j+=t)?((0,c.addEventListener)(window,"popstate",x),h&&(0,c.addEventListener)(window,"hashchange",T)):0===j&&((0,c.removeEventListener)(window,"popstate",x),h&&(0,c.removeEventListener)(window,"hashchange",T))},F=!1,L={length:e.length,action:"POP",location:C,createHref:M,push:function(t,r){(0,o.default)(!("object"===(void 0===t?"undefined":i(t))&&void 0!==t.state&&void 0!==r),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var s=(0,a.createLocation)(t,r,w(),L.location);k.confirmTransitionTo(s,"PUSH",y,function(t){if(t){var i=M(s),r=s.key,a=s.state;if(n)if(e.pushState({key:r,state:a},null,i),d)window.location.href=i;else{var u=E.indexOf(L.location.key),l=E.slice(0,-1===u?0:u+1);l.push(s.key),E=l,S({action:"PUSH",location:s})}else(0,o.default)(void 0===a,"Browser history cannot push state in browsers that do not support HTML5 history"),window.location.href=i}})},replace:function(t,r){(0,o.default)(!("object"===(void 0===t?"undefined":i(t))&&void 0!==t.state&&void 0!==r),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var s=(0,a.createLocation)(t,r,w(),L.location);k.confirmTransitionTo(s,"REPLACE",y,function(t){if(t){var i=M(s),r=s.key,a=s.state;if(n)if(e.replaceState({key:r,state:a},null,i),d)window.location.replace(i);else{var u=E.indexOf(L.location.key);-1!==u&&(E[u]=s.key),S({action:"REPLACE",location:s})}else(0,o.default)(void 0===a,"Browser history cannot replace state in browsers that do not support HTML5 history"),window.location.replace(i)}})},go:R,goBack:function(){return R(-1)},goForward:function(){return R(1)},block:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=k.setPrompt(t);return F||(N(1),F=!0),function(){return F&&(F=!1,N(-1)),e()}},listen:function(t){var e=k.appendListener(t);return N(1),function(){N(-1),e()}}};return L}},function(t,e,n){"use strict";function i(t){var e,n=t.Symbol;return"function"==typeof n?n.observable?e=n.observable:(e=n("observable"),n.observable=e):e="@@observable",e}n.d(e,"a",function(){return i})},function(t,e,n){t.exports=function(){"use strict";var t={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},e={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},n=Object.defineProperty,i=Object.getOwnPropertyNames,r=Object.getOwnPropertySymbols,o=Object.getOwnPropertyDescriptor,s=Object.getPrototypeOf,a=s&&s(Object);return function u(l,c,h){if("string"!=typeof c){if(a){var p=s(c);p&&p!==a&&u(l,p,h)}var f=i(c);r&&(f=f.concat(r(c)));for(var d=0;dthis._screen.scrollTop-this._screen.offsetHeight+100&&(this._screen.scrollTop=this._screen.scrollHeight)}},{key:"render",value:function(){var t=this.props,e=t.site,n=t.server,i=t.relay,r=t.runner,s=t.rpc,a=t.actions,c=t.user;return(0,o.h)("div",{className:"app system"},(0,o.h)("div",{className:"heading"},(0,o.h)("h1",null,e.name," system")),(0,o.h)("div",{className:"row params"},(0,o.h)("div",{className:"column"},(0,o.h)(u.default,{title:"Status"},(0,o.h)(l.default,{title:"Server"},n.status),n.error&&(0,o.h)(l.default,{title:"Server error"},n.error.message),(0,o.h)(l.default,{title:"Relay"},i.status),(0,o.h)(l.default,{title:"RPC"},s.status),(0,o.h)(l.default,{title:"CPU"},this.renderStatus(r.cpu)),(0,o.h)(l.default,{title:"GPU"},this.renderStatus(r.gpu))),(0,o.h)(u.default,{title:"Diagnostics"},(0,o.h)(l.default,{title:"Check GPU"},(0,o.h)("button",{onClick:function(){return a.system.run("nvidia-smi")}},"nvidia-smi")),(0,o.h)(l.default,{title:"List processes"},(0,o.h)("button",{onClick:function(){return a.system.run("ps")}},"ps")),(0,o.h)(l.default,{title:"List users"},(0,o.h)("button",{onClick:function(){return a.system.run("w")}},"w")),(0,o.h)(l.default,{title:"Disk free space"},(0,o.h)("button",{onClick:function(){return a.system.run("df")}},"df"))),(0,o.h)(u.default,{title:"Tasks"},(0,o.h)(l.default,{title:"Kill task"},(0,o.h)("button",{onClick:function(){return a.queue.stop_task("cpu")}},"CPU"),(0,o.h)("button",{onClick:function(){return a.queue.stop_task("gpu")}},"GPU")),(0,o.h)(l.default,{title:"Queue"},(0,o.h)("button",{onClick:function(){return a.queue.start_queue()}},"Start"),(0,o.h)("button",{onClick:function(){return a.queue.stop_queue()}},"Stop"))),(0,o.h)(u.default,{title:"Auth"},(0,o.h)(l.default,{title:"Logged in as "+c.username},(0,o.h)("button",{onClick:function(){return a.auth.logout()}},"Logout"))),(0,o.h)(u.default,{title:"Test"},(0,o.h)(l.default,{title:"CPU Test Task"},(0,o.h)("button",{onClick:function(){return a.queue.start_task(_,{preempt:!0,watch:!0})}},"Start"),(0,o.h)("button",{onClick:function(){return a.queue.stop_task(r.cpu.task)}},"Stop")),(0,o.h)(l.default,{title:"GPU Test Task"},(0,o.h)("button",{onClick:function(){return a.queue.start_task(v,{preempt:!0,watch:!0})}},"Start"),(0,o.h)("button",{onClick:function(){return a.queue.stop_task(r.gpu.task)}},"Stop")),(0,o.h)(l.default,{title:"Live Test Task"},(0,o.h)("button",{onClick:function(){return a.queue.start_task(g,{preempt:!0,watch:!0})}},"Start"),(0,o.h)("button",{onClick:function(){return a.queue.stop_task(r.cpu.task)}},"Stop")),(0,o.h)(l.default,{title:"Test Live RPC"},(0,o.h)("button",{onClick:function(){return a.live.get_params()}},"Get"),(0,o.h)("button",{onClick:function(){return a.live.set_param("fruit",k(w))}},"Set")),(0,o.h)(l.default,{title:"Queue Tests"},(0,o.h)("button",{onClick:function(){return a.system.enqueue_test_task(k(w))}},"+Add test task")),(0,o.h)(l.default,{title:""},(0,o.h)("button",{onClick:function(){return a.queue.start_task(b,{preempt:!0,watch:!0})}},"Wait and Buzz"))),(0,o.h)(u.default,{title:"Internationalization"},(0,o.h)(l.default,{title:"Language"},d.languages.map(function(t){return(0,o.h)("button",{onClick:function(){return a.system.changeLanguage(t)}},t)})))),this.renderCommandOutput()))}},{key:"renderStatus",value:function(t){if(!t)return"unknown";if("IDLE"===t.status)return"idle";var e=t.task;return e.activity+" "+e.module}},{key:"renderCommandOutput",value:function(){var t=this,e=this.props,n=e.cmd,i=e.stdout,r=e.stderr,s=void 0;return n.loading?s="Loading: "+n.name:n.loaded?n.error?s="Error: "+n.name+"\n\n"+JSON.stringify(n.error,null,2):(s=n.stdout,n.stderr&&(s+="\n\n_________________________________\n\n",s+=n.stderr)):(s=i,r.length&&(s+="\n\n_________________________________\n\n",s+=r)),(0,o.h)("div",null,(0,o.h)("div",{ref:function(e){return t._screen=e},className:"screen"},s))}}]),e}();e.default=(0,a.connect)(function(t){return i({user:t.auth.user},t.system,t.live)},function(t,e){return{actions:{auth:(0,s.bindActionCreators)(f,t),system:(0,s.bindActionCreators)(c,t),queue:(0,s.bindActionCreators)(p,t),live:(0,s.bindActionCreators)(h,t)}}})(S)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:1;return function(r){var o={module:"samplernn",activity:"train",dataset:t.name,epoch:t.checkpoints.length&&t.checkpoints[0].epoch||0,epochs:n,folder_id:e,opt:{sample_length:220500,n_samples:6,keep_old_checkpoints:!1}};return console.log(o),i.default.queue.add_task(o)}},e.generate_task=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:6,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0;return function(s){var a={module:"samplernn",activity:"generate",dataset:t.name,epoch:o||t.checkpoints.length&&t.checkpoints[0].epoch||0,folder_id:e,opt:{sample_length:Math.round(44100*n),n_samples:r}};return console.log(a),i.default.queue.add_task(a)}},e.fetch_task=function(t,e,n,r){return function(o){if(!t)return console.log("input file inaccessible (no url)");var s={module:"samplernn",activity:"fetch",dataset:r,folder_id:e,opt:{url:t,file_id:n,dataset:r}};return i.default.queue.add_task(s)}},e.log_task=function(t){return function(e){var n={module:"samplernn",activity:"log",dataset:t.name};return i.default.queue.add_task(n)}},e.clear_cache_task=function(t){return function(e){var n={module:"samplernn",activity:"clear_cache",dataset:t.name};return i.default.queue.add_task(n)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],n=(arguments.length>2&&void 0!==arguments[2]&&arguments[2],this.props),i=n.samplernn,o=n.remote,s=i.data.fileLookup[t.input[0]];return s?s.name&&s.name.match(/(gif|jpe?g|png)$/i)?null:(0,r.h)("div",null,(0,r.h)("div",{class:"actions"},(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,1)}},"train"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,2)}},"2x"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,4)}},"4x"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,6)}},"6x"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,18)}},"18x")),(0,r.h)("div",{class:"actions"},(0,r.h)("span",{class:"link",onClick:function(){return o.generate_task(t,i.folder_id,5,12)}},"generate"),(0,r.h)("span",{class:"link",onClick:function(){return o.generate_task(t,i.folder_id,.5,120)}},"/2"),(0,r.h)("span",{class:"link",onClick:function(){return o.generate_task(t,i.folder_id,.25,240)}},"/4"),(0,r.h)("span",{class:"link",onClick:function(){return o.generate_task(t,i.folder_id,.125,480)}},"/8"),(0,r.h)("span",{class:"link",onClick:function(){return o.generate_task(t,i.folder_id,.0625,960)}},"/16")),(0,r.h)("div",{class:"actions"},(0,r.h)("span",{class:"link",onClick:function(){return o.generate_task(t,i.folder_id,2,30)}},"2s"),(0,r.h)("span",{class:"link",onClick:function(){return o.generate_task(t,i.folder_id,10,6)}},"10s"),(0,r.h)("span",{class:"link",onClick:function(){return o.generate_task(t,i.folder_id,15,4)}},"15s"),(0,r.h)("span",{class:"link",onClick:function(){return o.generate_task(t,i.folder_id,30,2)}},"30s"),(0,r.h)("span",{class:"link",onClick:function(){return o.generate_task(t,i.folder_id,60,1)}},"1m")),t.isBuilt?(0,r.h)("div",{class:"subtext"},"fetched ",(0,r.h)("span",{class:"link",onClick:function(){return o.clear_cache_task(t)}},"x")):e?(0,r.h)("div",{class:"subtext"},"fetching"):(0,r.h)("div",{class:"subtext"},(0,r.h)("span",{class:"link",onClick:function(){return o.fetch_task(s.url,i.folder_id,s.id,t.name)}},"fetch"))):null}},{key:"handlePick",value:function(t){this.props.audioPlayer.play(t)}}]),e}();e.default=(0,s.connect)(function(t){return{samplernn:t.module.samplernn,runner:t.system.runner}},function(t,e){return{actions:(0,o.bindActionCreators)(a,t),remote:(0,o.bindActionCreators)(u,t),audioPlayer:(0,o.bindActionCreators)(l,t)}})(_)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),r=n(3),o=n(2),s=(n(8),l(n(4)),n(11)),a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(44)),u=l(n(67));function l(t){return t&&t.__esModule?t:{default:t}}e.default=(0,o.connect)(function(t){return{samplernn:t.module.samplernn}},function(t,e){return{actions:(0,r.bindActionCreators)(a,t)}})(function(t){return(0,i.h)(s.Views.New,{db:t.samplernn,path:"/samplernn/datasets/",actions:t.actions,module:u.default,history:t.history})})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n=0),a[8]){case"b":n=parseInt(n,10).toString(2);break;case"c":n=String.fromCharCode(parseInt(n,10));break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,a[6]?parseInt(a[6]):0);break;case"e":n=a[7]?parseFloat(n).toExponential(a[7]):parseFloat(n).toExponential();break;case"f":n=a[7]?parseFloat(n).toFixed(a[7]):parseFloat(n);break;case"g":n=a[7]?String(Number(n.toPrecision(a[7]))):parseFloat(n);break;case"o":n=(parseInt(n,10)>>>0).toString(8);break;case"s":n=String(n),n=a[7]?n.substring(0,a[7]):n;break;case"t":n=String(!!n),n=a[7]?n.substring(0,a[7]):n;break;case"T":n=Object.prototype.toString.call(n).slice(8,-1).toLowerCase(),n=a[7]?n.substring(0,a[7]):n;break;case"u":n=parseInt(n,10)>>>0;break;case"v":n=n.valueOf(),n=a[7]?n.substring(0,a[7]):n;break;case"x":n=(parseInt(n,10)>>>0).toString(16);break;case"X":n=(parseInt(n,10)>>>0).toString(16).toUpperCase()}r.json.test(a[8])?m+=n:(!r.number.test(a[8])||h&&!a[3]?p="":(p=h?"+":"-",n=n.toString().replace(r.sign,"")),l=a[4]?"0"===a[4]?"0":a[4].charAt(1):" ",c=a[6]-(p+n).length,u=a[6]&&c>0?l.repeat(c):"",m+=a[5]?p+n+u:"0"===l?p+u+n:u+p+n)}return m}(function(t){if(a[t])return a[t];var e,n=t,i=[],o=0;for(;n;){if(null!==(e=r.text.exec(n)))i.push(e[0]);else if(null!==(e=r.modulo.exec(n)))i.push("%");else{if(null===(e=r.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(e[2]){o|=1;var s=[],u=e[2],l=[];if(null===(l=r.key.exec(u)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(s.push(l[1]);""!==(u=u.substring(l[0].length));)if(null!==(l=r.key_access.exec(u)))s.push(l[1]);else{if(null===(l=r.index_access.exec(u)))throw new SyntaxError("[sprintf] failed to parse named argument key");s.push(l[1])}e[2]=s}else o|=2;if(3===o)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");i.push(e)}n=n.substring(e[0].length)}return a[t]=i}(t),arguments)}function s(t,e){return o.apply(null,[t].concat(e||[]))}var a=Object.create(null);e.sprintf=o,e.vsprintf=s,"undefined"!=typeof window&&(window.sprintf=o,window.vsprintf=s,void 0===(i=function(){return{sprintf:o,vsprintf:s}}.call(e,n,e,t))||(t.exports=i))}()},function(t,e,n){"use strict";var i=n(96),r=n(10),o=n(70),s=n(69),a=n(31),u=n(103),l=n(24);function c(t,e){this.options=t,this.loadOptions=e}c.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(t){var e,n;if(t.skip(22),this.fileNameLength=t.readInt(2),n=t.readInt(2),this.fileName=t.readData(this.fileNameLength),t.skip(n),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough informations from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(e=function(t){for(var e in u)if(u.hasOwnProperty(e)&&u[e].magic===t)return u[e];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+r.pretty(this.compressionMethod)+" unknown (inner file : "+r.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,e,t.readData(this.compressedSize))},readCentralPart:function(t){this.versionMadeBy=t.readInt(2),t.skip(2),this.bitFlag=t.readInt(2),this.compressionMethod=t.readString(2),this.date=t.readDate(),this.crc32=t.readInt(4),this.compressedSize=t.readInt(4),this.uncompressedSize=t.readInt(4);var e=t.readInt(2);if(this.extraFieldsLength=t.readInt(2),this.fileCommentLength=t.readInt(2),this.diskNumberStart=t.readInt(2),this.internalFileAttributes=t.readInt(2),this.externalFileAttributes=t.readInt(4),this.localHeaderOffset=t.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");t.skip(e),this.readExtraFields(t),this.parseZIP64ExtraField(t),this.fileComment=t.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var t=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0===t&&(this.dosPermissions=63&this.externalFileAttributes),3===t&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(t){if(this.extraFields[1]){var e=i(this.extraFields[1].value);this.uncompressedSize===r.MAX_VALUE_32BITS&&(this.uncompressedSize=e.readInt(8)),this.compressedSize===r.MAX_VALUE_32BITS&&(this.compressedSize=e.readInt(8)),this.localHeaderOffset===r.MAX_VALUE_32BITS&&(this.localHeaderOffset=e.readInt(8)),this.diskNumberStart===r.MAX_VALUE_32BITS&&(this.diskNumberStart=e.readInt(4))}},readExtraFields:function(t){var e,n,i,r=t.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});t.index1)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var t,e;for(t=0;t0)this.isSignature(e,o.CENTRAL_FILE_HEADER)||(this.reader.zero=i);else if(i<0)throw new Error("Corrupted zip: missing "+Math.abs(i)+" bytes.")},prepareReader:function(t){this.reader=i(t)},load:function(t){this.prepareReader(t),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=u},function(t,e,n){"use strict";var i=n(10),r=n(45),o=n(31),s=(i=n(10),n(174)),a=n(104),u=n(57);function l(t){return new r.Promise(function(e,n){var i=t.decompressed.getContentWorker().pipe(new a);i.on("error",function(t){n(t)}).on("end",function(){i.streamInfo.crc32!==t.decompressed.crc32?n(new Error("Corrupted zip : CRC32 mismatch")):e()}).resume()})}t.exports=function(t,e){var n=this;return e=i.extend(e||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),u.isNode&&u.isStream(t)?r.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):i.prepareContent("the loaded zip file",t,!0,e.optimizedBinaryString,e.base64).then(function(t){var n=new s(e);return n.load(t),n}).then(function(t){var n=[r.Promise.resolve(t)],i=t.files;if(e.checkCRC32)for(var o=0;o>>=8;return i},l=function(t,e,n,r,l,c){var h,p,f=t.file,d=t.compression,m=c!==o.utf8encode,y=i.transformTo("string",c(f.name)),_=i.transformTo("string",o.utf8encode(f.name)),v=f.comment,g=i.transformTo("string",c(v)),b=i.transformTo("string",o.utf8encode(v)),w=_.length!==f.name.length,k=b.length!==v.length,S="",x="",T="",O=f.dir,P=f.date,A={crc32:0,compressedSize:0,uncompressedSize:0};e&&!n||(A.crc32=t.crc32,A.compressedSize=t.compressedSize,A.uncompressedSize=t.uncompressedSize);var C=0;e&&(C|=8),m||!w&&!k||(C|=2048);var E,M,R=0,j=0;O&&(R|=16),"UNIX"===l?(j=798,R|=(E=f.unixPermissions,M=E,E||(M=O?16893:33204),(65535&M)<<16)):(j=20,R|=63&(f.dosPermissions||0)),h=P.getUTCHours(),h<<=6,h|=P.getUTCMinutes(),h<<=5,h|=P.getUTCSeconds()/2,p=P.getUTCFullYear()-1980,p<<=4,p|=P.getUTCMonth()+1,p<<=5,p|=P.getUTCDate(),w&&(x=u(1,1)+u(s(y),4)+_,S+="up"+u(x.length,2)+x),k&&(T=u(1,1)+u(s(g),4)+b,S+="uc"+u(T.length,2)+T);var N="";return N+="\n\0",N+=u(C,2),N+=d.magic,N+=u(h,2),N+=u(p,2),N+=u(A.crc32,4),N+=u(A.compressedSize,4),N+=u(A.uncompressedSize,4),N+=u(y.length,2),N+=u(S.length,2),{fileRecord:a.LOCAL_FILE_HEADER+N+y+S,dirRecord:a.CENTRAL_FILE_HEADER+u(j,2)+N+u(g.length,2)+"\0\0\0\0"+u(R,4)+u(r,4)+y+S+g}};function c(t,e,n,i){r.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=e,this.zipPlatform=n,this.encodeFileName=i,this.streamFiles=t,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}i.inherits(c,r),c.prototype.push=function(t){var e=t.meta.percent||0,n=this.entriesCount,i=this._sources.length;this.accumulate?this.contentBuffer.push(t):(this.bytesWritten+=t.data.length,r.prototype.push.call(this,{data:t.data,meta:{currentFile:this.currentFile,percent:n?(e+100*(n-i-1))/n:100}}))},c.prototype.openedSource=function(t){this.currentSourceOffset=this.bytesWritten,this.currentFile=t.file.name;var e=this.streamFiles&&!t.file.dir;if(e){var n=l(t,e,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},c.prototype.closedSource=function(t){this.accumulate=!1;var e=this.streamFiles&&!t.file.dir,n=l(t,e,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),e)this.push({data:function(t){return a.DATA_DESCRIPTOR+u(t.crc32,4)+u(t.compressedSize,4)+u(t.uncompressedSize,4)}(t),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},c.prototype.flush=function(){for(var t=this.bytesWritten,e=0;e=1&&0===F[O];O--);if(P>O&&(P=O),0===O)return l[c++]=20971520,l[c++]=20971520,p.bits=1,0;for(T=1;T0&&(0===t||1!==O))return-1;for(L[1]=0,S=1;S<15;S++)L[S+1]=L[S]+F[S];for(x=0;x852||2===t&&M>592)return 1;for(;;){g=S-C,h[x]v?(b=D[q+h[x]],w=j[N+h[x]]):(b=96,w=0),f=1<>C)+(d-=f)]=g<<24|b<<16|w|0}while(0!==d);for(f=1<>=1;if(0!==f?(R&=f-1,R+=f):R=0,x++,0==--F[S]){if(S===O)break;S=e[n+h[x]]}if(S>P&&(R&y)!==m){for(0===C&&(C=P),_+=T,E=1<<(A=S-C);A+C852||2===t&&M>592)return 1;l[m=R&y]=P<<24|A<<16|_-c|0}}return 0!==R&&(l[_+R]=S-C<<24|64<<16|0),p.bits=P,0}},function(t,e,n){"use strict";t.exports=function(t,e){var n,i,r,o,s,a,u,l,c,h,p,f,d,m,y,_,v,g,b,w,k,S,x,T,O;n=t.state,i=t.next_in,T=t.input,r=i+(t.avail_in-5),o=t.next_out,O=t.output,s=o-(e-t.avail_out),a=o+(t.avail_out-257),u=n.dmax,l=n.wsize,c=n.whave,h=n.wnext,p=n.window,f=n.hold,d=n.bits,m=n.lencode,y=n.distcode,_=(1<>>=b=g>>>24,d-=b,0===(b=g>>>16&255))O[o++]=65535&g;else{if(!(16&b)){if(0==(64&b)){g=m[(65535&g)+(f&(1<>>=b,d-=b),d<15&&(f+=T[i++]<>>=b=g>>>24,d-=b,!(16&(b=g>>>16&255))){if(0==(64&b)){g=y[(65535&g)+(f&(1<u){t.msg="invalid distance too far back",n.mode=30;break t}if(f>>>=b,d-=b,k>(b=o-s)){if((b=k-b)>c&&n.sane){t.msg="invalid distance too far back",n.mode=30;break t}if(S=0,x=p,0===h){if(S+=l-b,b2;)O[o++]=x[S++],O[o++]=x[S++],O[o++]=x[S++],w-=3;w&&(O[o++]=x[S++],w>1&&(O[o++]=x[S++]))}else{S=o-k;do{O[o++]=O[S++],O[o++]=O[S++],O[o++]=O[S++],w-=3}while(w>2);w&&(O[o++]=O[S++],w>1&&(O[o++]=O[S++]))}break}}break}}while(i>3,f&=(1<<(d-=w<<3))-1,t.next_in=i,t.next_out=o,t.avail_in=i>>24&255)+(t>>>8&65280)+((65280&t)<<8)+((255&t)<<24)}function rt(t){var e;return t&&t.state?(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=1&e.wrap),e.mode=k,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new i.Buf32(tt),e.distcode=e.distdyn=new i.Buf32(et),e.sane=1,e.back=-1,d):_}function ot(t){var e;return t&&t.state?((e=t.state).wsize=0,e.whave=0,e.wnext=0,rt(t)):_}function st(t,e){var n,i;return t&&t.state?(i=t.state,e<0?(n=0,e=-e):(n=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?_:(null!==i.window&&i.wbits!==e&&(i.window=null),i.wrap=n,i.wbits=e,ot(t))):_}function at(t,e){var n,r;return t?(r=new function(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new i.Buf16(320),this.work=new i.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0},t.state=r,r.window=null,(n=st(t,e))!==d&&(t.state=null),n):_}var ut,lt,ct=!0;function ht(t){if(ct){var e;for(ut=new i.Buf32(512),lt=new i.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(a(l,t.lens,0,288,ut,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;a(c,t.lens,0,32,lt,0,t.work,{bits:5}),ct=!1}t.lencode=ut,t.lenbits=9,t.distcode=lt,t.distbits=5}function pt(t,e,n,r){var o,s=t.state;return null===s.window&&(s.wsize=1<=s.wsize?(i.arraySet(s.window,e,n-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((o=s.wsize-s.wnext)>r&&(o=r),i.arraySet(s.window,e,n-r,o,s.wnext),(r-=o)?(i.arraySet(s.window,e,n-r,r,0),s.wnext=r,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,n.check=o(n.check,Pt,2,0),at=0,ut=0,n.mode=S;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&at)<<8)+(at>>8))%31){t.msg="incorrect header check",n.mode=$;break}if((15&at)!==w){t.msg="unknown compression method",n.mode=$;break}if(ut-=4,kt=8+(15&(at>>>=4)),0===n.wbits)n.wbits=kt;else if(kt>n.wbits){t.msg="invalid window size",n.mode=$;break}n.dmax=1<>8&1),512&n.flags&&(Pt[0]=255&at,Pt[1]=at>>>8&255,n.check=o(n.check,Pt,2,0)),at=0,ut=0,n.mode=x;case x:for(;ut<32;){if(0===ot)break t;ot--,at+=tt[nt++]<>>8&255,Pt[2]=at>>>16&255,Pt[3]=at>>>24&255,n.check=o(n.check,Pt,4,0)),at=0,ut=0,n.mode=T;case T:for(;ut<16;){if(0===ot)break t;ot--,at+=tt[nt++]<>8),512&n.flags&&(Pt[0]=255&at,Pt[1]=at>>>8&255,n.check=o(n.check,Pt,2,0)),at=0,ut=0,n.mode=O;case O:if(1024&n.flags){for(;ut<16;){if(0===ot)break t;ot--,at+=tt[nt++]<>>8&255,n.check=o(n.check,Pt,2,0)),at=0,ut=0}else n.head&&(n.head.extra=null);n.mode=P;case P:if(1024&n.flags&&((ft=n.length)>ot&&(ft=ot),ft&&(n.head&&(kt=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),i.arraySet(n.head.extra,tt,nt,ft,kt)),512&n.flags&&(n.check=o(n.check,tt,ft,nt)),ot-=ft,nt+=ft,n.length-=ft),n.length))break t;n.length=0,n.mode=A;case A:if(2048&n.flags){if(0===ot)break t;ft=0;do{kt=tt[nt+ft++],n.head&&kt&&n.length<65536&&(n.head.name+=String.fromCharCode(kt))}while(kt&&ft>9&1,n.head.done=!0),t.adler=n.check=0,n.mode=j;break;case M:for(;ut<32;){if(0===ot)break t;ot--,at+=tt[nt++]<>>=7&ut,ut-=7&ut,n.mode=Z;break}for(;ut<3;){if(0===ot)break t;ot--,at+=tt[nt++]<>>=1)){case 0:n.mode=F;break;case 1:if(ht(n),n.mode=U,e===f){at>>>=2,ut-=2;break t}break;case 2:n.mode=q;break;case 3:t.msg="invalid block type",n.mode=$}at>>>=2,ut-=2;break;case F:for(at>>>=7&ut,ut-=7&ut;ut<32;){if(0===ot)break t;ot--,at+=tt[nt++]<>>16^65535)){t.msg="invalid stored block lengths",n.mode=$;break}if(n.length=65535&at,at=0,ut=0,n.mode=L,e===f)break t;case L:n.mode=D;case D:if(ft=n.length){if(ft>ot&&(ft=ot),ft>st&&(ft=st),0===ft)break t;i.arraySet(et,tt,nt,ft,rt),ot-=ft,nt+=ft,st-=ft,rt+=ft,n.length-=ft;break}n.mode=j;break;case q:for(;ut<14;){if(0===ot)break t;ot--,at+=tt[nt++]<>>=5,ut-=5,n.ndist=1+(31&at),at>>>=5,ut-=5,n.ncode=4+(15&at),at>>>=4,ut-=4,n.nlen>286||n.ndist>30){t.msg="too many length or distance symbols",n.mode=$;break}n.have=0,n.mode=I;case I:for(;n.have>>=3,ut-=3}for(;n.have<19;)n.lens[At[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,xt={bits:n.lenbits},St=a(u,n.lens,0,19,n.lencode,0,n.work,xt),n.lenbits=xt.bits,St){t.msg="invalid code lengths set",n.mode=$;break}n.have=0,n.mode=B;case B:for(;n.have>>16&255,vt=65535&Ot,!((yt=Ot>>>24)<=ut);){if(0===ot)break t;ot--,at+=tt[nt++]<>>=yt,ut-=yt,n.lens[n.have++]=vt;else{if(16===vt){for(Tt=yt+2;ut>>=yt,ut-=yt,0===n.have){t.msg="invalid bit length repeat",n.mode=$;break}kt=n.lens[n.have-1],ft=3+(3&at),at>>>=2,ut-=2}else if(17===vt){for(Tt=yt+3;ut>>=yt)),at>>>=3,ut-=3}else{for(Tt=yt+7;ut>>=yt)),at>>>=7,ut-=7}if(n.have+ft>n.nlen+n.ndist){t.msg="invalid bit length repeat",n.mode=$;break}for(;ft--;)n.lens[n.have++]=kt}}if(n.mode===$)break;if(0===n.lens[256]){t.msg="invalid code -- missing end-of-block",n.mode=$;break}if(n.lenbits=9,xt={bits:n.lenbits},St=a(l,n.lens,0,n.nlen,n.lencode,0,n.work,xt),n.lenbits=xt.bits,St){t.msg="invalid literal/lengths set",n.mode=$;break}if(n.distbits=6,n.distcode=n.distdyn,xt={bits:n.distbits},St=a(c,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,xt),n.distbits=xt.bits,St){t.msg="invalid distances set",n.mode=$;break}if(n.mode=U,e===f)break t;case U:n.mode=z;case z:if(ot>=6&&st>=258){t.next_out=rt,t.avail_out=st,t.next_in=nt,t.avail_in=ot,n.hold=at,n.bits=ut,s(t,ct),rt=t.next_out,et=t.output,st=t.avail_out,nt=t.next_in,tt=t.input,ot=t.avail_in,at=n.hold,ut=n.bits,n.mode===j&&(n.back=-1);break}for(n.back=0;_t=(Ot=n.lencode[at&(1<>>16&255,vt=65535&Ot,!((yt=Ot>>>24)<=ut);){if(0===ot)break t;ot--,at+=tt[nt++]<>gt)])>>>16&255,vt=65535&Ot,!(gt+(yt=Ot>>>24)<=ut);){if(0===ot)break t;ot--,at+=tt[nt++]<>>=gt,ut-=gt,n.back+=gt}if(at>>>=yt,ut-=yt,n.back+=yt,n.length=vt,0===_t){n.mode=H;break}if(32&_t){n.back=-1,n.mode=j;break}if(64&_t){t.msg="invalid literal/length code",n.mode=$;break}n.extra=15&_t,n.mode=Y;case Y:if(n.extra){for(Tt=n.extra;ut>>=n.extra,ut-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=W;case W:for(;_t=(Ot=n.distcode[at&(1<>>16&255,vt=65535&Ot,!((yt=Ot>>>24)<=ut);){if(0===ot)break t;ot--,at+=tt[nt++]<>gt)])>>>16&255,vt=65535&Ot,!(gt+(yt=Ot>>>24)<=ut);){if(0===ot)break t;ot--,at+=tt[nt++]<>>=gt,ut-=gt,n.back+=gt}if(at>>>=yt,ut-=yt,n.back+=yt,64&_t){t.msg="invalid distance code",n.mode=$;break}n.offset=vt,n.extra=15&_t,n.mode=G;case G:if(n.extra){for(Tt=n.extra;ut>>=n.extra,ut-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){t.msg="invalid distance too far back",n.mode=$;break}n.mode=V;case V:if(0===st)break t;if(ft=ct-st,n.offset>ft){if((ft=n.offset-ft)>n.whave&&n.sane){t.msg="invalid distance too far back",n.mode=$;break}ft>n.wnext?(ft-=n.wnext,dt=n.wsize-ft):dt=n.wnext-ft,ft>n.length&&(ft=n.length),mt=n.window}else mt=et,dt=rt-n.offset,ft=n.length;ft>st&&(ft=st),st-=ft,n.length-=ft;do{et[rt++]=mt[dt++]}while(--ft);0===n.length&&(n.mode=z);break;case H:if(0===st)break t;et[rt++]=n.length,st--,n.mode=z;break;case Z:if(n.wrap){for(;ut<32;){if(0===ot)break t;ot--,at|=tt[nt++]<=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,0===e.windowBits&&(e.windowBits=-15)),!(e.windowBits>=0&&e.windowBits<16)||t&&t.windowBits||(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&0==(15&e.windowBits)&&(e.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new u,this.strm.avail_out=0;var n=i.inflateInit2(this.strm,e.windowBits);if(n!==s.Z_OK)throw new Error(a[n]);this.header=new l,i.inflateGetHeader(this.strm,this.header)}function p(t,e){var n=new h(e);if(n.push(t,!0),n.err)throw n.msg||a[n.err];return n.result}h.prototype.push=function(t,e){var n,a,u,l,h,p,f=this.strm,d=this.options.chunkSize,m=this.options.dictionary,y=!1;if(this.ended)return!1;a=e===~~e?e:!0===e?s.Z_FINISH:s.Z_NO_FLUSH,"string"==typeof t?f.input=o.binstring2buf(t):"[object ArrayBuffer]"===c.call(t)?f.input=new Uint8Array(t):f.input=t,f.next_in=0,f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new r.Buf8(d),f.next_out=0,f.avail_out=d),(n=i.inflate(f,s.Z_NO_FLUSH))===s.Z_NEED_DICT&&m&&(p="string"==typeof m?o.string2buf(m):"[object ArrayBuffer]"===c.call(m)?new Uint8Array(m):m,n=i.inflateSetDictionary(this.strm,p)),n===s.Z_BUF_ERROR&&!0===y&&(n=s.Z_OK,y=!1),n!==s.Z_STREAM_END&&n!==s.Z_OK)return this.onEnd(n),this.ended=!0,!1;f.next_out&&(0!==f.avail_out&&n!==s.Z_STREAM_END&&(0!==f.avail_in||a!==s.Z_FINISH&&a!==s.Z_SYNC_FLUSH)||("string"===this.options.to?(u=o.utf8border(f.output,f.next_out),l=f.next_out-u,h=o.buf2string(f.output,u),f.next_out=l,f.avail_out=d-l,l&&r.arraySet(f.output,f.output,u,l,0),this.onData(h)):this.onData(r.shrinkBuf(f.output,f.next_out)))),0===f.avail_in&&0===f.avail_out&&(y=!0)}while((f.avail_in>0||0===f.avail_out)&&n!==s.Z_STREAM_END);return n===s.Z_STREAM_END&&(a=s.Z_FINISH),a===s.Z_FINISH?(n=i.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===s.Z_OK):a!==s.Z_SYNC_FLUSH||(this.onEnd(s.Z_OK),f.avail_out=0,!0)},h.prototype.onData=function(t){this.chunks.push(t)},h.prototype.onEnd=function(t){t===s.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Inflate=h,e.inflate=p,e.inflateRaw=function(t,e){return(e=e||{}).raw=!0,p(t,e)},e.ungzip=p},function(t,e,n){"use strict";var i=n(23),r=4,o=0,s=1,a=2;function u(t){for(var e=t.length;--e>=0;)t[e]=0}var l=0,c=1,h=2,p=29,f=256,d=f+1+p,m=30,y=19,_=2*d+1,v=15,g=16,b=7,w=256,k=16,S=17,x=18,T=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],O=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],P=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],A=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],C=new Array(2*(d+2));u(C);var E=new Array(2*m);u(E);var M=new Array(512);u(M);var R=new Array(256);u(R);var j=new Array(p);u(j);var N,F,L,D=new Array(m);function q(t,e,n,i,r){this.static_tree=t,this.extra_bits=e,this.extra_base=n,this.elems=i,this.max_length=r,this.has_stree=t&&t.length}function I(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}function B(t){return t<256?M[t]:M[256+(t>>>7)]}function U(t,e){t.pending_buf[t.pending++]=255&e,t.pending_buf[t.pending++]=e>>>8&255}function z(t,e,n){t.bi_valid>g-n?(t.bi_buf|=e<>g-t.bi_valid,t.bi_valid+=n-g):(t.bi_buf|=e<>>=1,n<<=1}while(--e>0);return n>>>1}function G(t,e,n){var i,r,o=new Array(v+1),s=0;for(i=1;i<=v;i++)o[i]=s=s+n[i-1]<<1;for(r=0;r<=e;r++){var a=t[2*r+1];0!==a&&(t[2*r]=W(o[a]++,a))}}function V(t){var e;for(e=0;e8?U(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}function Z(t,e,n,i){var r=2*e,o=2*n;return t[r]>1;n>=1;n--)Q(t,o,n);r=u;do{n=t.heap[1],t.heap[1]=t.heap[t.heap_len--],Q(t,o,1),i=t.heap[1],t.heap[--t.heap_max]=n,t.heap[--t.heap_max]=i,o[2*r]=o[2*n]+o[2*i],t.depth[r]=(t.depth[n]>=t.depth[i]?t.depth[n]:t.depth[i])+1,o[2*n+1]=o[2*i+1]=r,t.heap[1]=r++,Q(t,o,1)}while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],function(t,e){var n,i,r,o,s,a,u=e.dyn_tree,l=e.max_code,c=e.stat_desc.static_tree,h=e.stat_desc.has_stree,p=e.stat_desc.extra_bits,f=e.stat_desc.extra_base,d=e.stat_desc.max_length,m=0;for(o=0;o<=v;o++)t.bl_count[o]=0;for(u[2*t.heap[t.heap_max]+1]=0,n=t.heap_max+1;n<_;n++)(o=u[2*u[2*(i=t.heap[n])+1]+1]+1)>d&&(o=d,m++),u[2*i+1]=o,i>l||(t.bl_count[o]++,s=0,i>=f&&(s=p[i-f]),a=u[2*i],t.opt_len+=a*(o+s),h&&(t.static_len+=a*(c[2*i+1]+s)));if(0!==m){do{for(o=d-1;0===t.bl_count[o];)o--;t.bl_count[o]--,t.bl_count[o+1]+=2,t.bl_count[d]--,m-=2}while(m>0);for(o=d;0!==o;o--)for(i=t.bl_count[o];0!==i;)(r=t.heap[--n])>l||(u[2*r+1]!==o&&(t.opt_len+=(o-u[2*r+1])*u[2*r],u[2*r+1]=o),i--)}}(t,e),G(o,l,t.bl_count)}function X(t,e,n){var i,r,o=-1,s=e[1],a=0,u=7,l=4;for(0===s&&(u=138,l=3),e[2*(n+1)+1]=65535,i=0;i<=n;i++)r=s,s=e[2*(i+1)+1],++a>=7;i0?(t.strm.data_type===a&&(t.strm.data_type=function(t){var e,n=4093624447;for(e=0;e<=31;e++,n>>>=1)if(1&n&&0!==t.dyn_ltree[2*e])return o;if(0!==t.dyn_ltree[18]||0!==t.dyn_ltree[20]||0!==t.dyn_ltree[26])return s;for(e=32;e=3&&0===t.bl_tree[2*A[e]+1];e--);return t.opt_len+=3*(e+1)+5+5+4,e}(t),u=t.opt_len+3+7>>>3,(l=t.static_len+3+7>>>3)<=u&&(u=l)):u=l=n+5,n+4<=u&&-1!==e?et(t,e,n,i):t.strategy===r||l===u?(z(t,(c<<1)+(i?1:0),3),K(t,C,E)):(z(t,(h<<1)+(i?1:0),3),function(t,e,n,i){var r;for(z(t,e-257,5),z(t,n-1,5),z(t,i-4,4),r=0;r>>8&255,t.pending_buf[t.d_buf+2*t.last_lit+1]=255&e,t.pending_buf[t.l_buf+t.last_lit]=255&n,t.last_lit++,0===e?t.dyn_ltree[2*n]++:(t.matches++,e--,t.dyn_ltree[2*(R[n]+f+1)]++,t.dyn_dtree[2*B(e)]++),t.last_lit===t.lit_bufsize-1},e._tr_align=function(t){z(t,c<<1,3),Y(t,w,C),function(t){16===t.bi_valid?(U(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=255&t.bi_buf,t.bi_buf>>=8,t.bi_valid-=8)}(t)}},function(t,e,n){"use strict";var i,r=n(23),o=n(183),s=n(102),a=n(101),u=n(68),l=0,c=1,h=3,p=4,f=5,d=0,m=1,y=-2,_=-3,v=-5,g=-1,b=1,w=2,k=3,S=4,x=0,T=2,O=8,P=9,A=15,C=8,E=286,M=30,R=19,j=2*E+1,N=15,F=3,L=258,D=L+F+1,q=32,I=42,B=69,U=73,z=91,Y=103,W=113,G=666,V=1,H=2,Z=3,Q=4,K=3;function $(t,e){return t.msg=u[e],e}function X(t){return(t<<1)-(t>4?9:0)}function J(t){for(var e=t.length;--e>=0;)t[e]=0}function tt(t){var e=t.state,n=e.pending;n>t.avail_out&&(n=t.avail_out),0!==n&&(r.arraySet(t.output,e.pending_buf,e.pending_out,n,t.next_out),t.next_out+=n,e.pending_out+=n,t.total_out+=n,t.avail_out-=n,e.pending-=n,0===e.pending&&(e.pending_out=0))}function et(t,e){o._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,tt(t.strm)}function nt(t,e){t.pending_buf[t.pending++]=e}function it(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=255&e}function rt(t,e){var n,i,r=t.max_chain_length,o=t.strstart,s=t.prev_length,a=t.nice_match,u=t.strstart>t.w_size-D?t.strstart-(t.w_size-D):0,l=t.window,c=t.w_mask,h=t.prev,p=t.strstart+L,f=l[o+s-1],d=l[o+s];t.prev_length>=t.good_match&&(r>>=2),a>t.lookahead&&(a=t.lookahead);do{if(l[(n=e)+s]===d&&l[n+s-1]===f&&l[n]===l[o]&&l[++n]===l[o+1]){o+=2,n++;do{}while(l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&l[++o]===l[++n]&&os){if(t.match_start=e,s=i,i>=a)break;f=l[o+s-1],d=l[o+s]}}}while((e=h[e&c])>u&&0!=--r);return s<=t.lookahead?s:t.lookahead}function ot(t){var e,n,i,o,u,l,c,h,p,f,d=t.w_size;do{if(o=t.window_size-t.lookahead-t.strstart,t.strstart>=d+(d-D)){r.arraySet(t.window,t.window,d,d,0),t.match_start-=d,t.strstart-=d,t.block_start-=d,e=n=t.hash_size;do{i=t.head[--e],t.head[e]=i>=d?i-d:0}while(--n);e=n=d;do{i=t.prev[--e],t.prev[e]=i>=d?i-d:0}while(--n);o+=d}if(0===t.strm.avail_in)break;if(l=t.strm,c=t.window,h=t.strstart+t.lookahead,p=o,f=void 0,(f=l.avail_in)>p&&(f=p),n=0===f?0:(l.avail_in-=f,r.arraySet(c,l.input,l.next_in,f,h),1===l.state.wrap?l.adler=s(l.adler,c,f,h):2===l.state.wrap&&(l.adler=a(l.adler,c,f,h)),l.next_in+=f,l.total_in+=f,f),t.lookahead+=n,t.lookahead+t.insert>=F)for(u=t.strstart-t.insert,t.ins_h=t.window[u],t.ins_h=(t.ins_h<=F&&(t.ins_h=(t.ins_h<=F)if(i=o._tr_tally(t,t.strstart-t.match_start,t.match_length-F),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=F){t.match_length--;do{t.strstart++,t.ins_h=(t.ins_h<=F&&(t.ins_h=(t.ins_h<4096)&&(t.match_length=F-1)),t.prev_length>=F&&t.match_length<=t.prev_length){r=t.strstart+t.lookahead-F,i=o._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-F),t.lookahead-=t.prev_length-1,t.prev_length-=2;do{++t.strstart<=r&&(t.ins_h=(t.ins_h<15&&(a=2,i-=16),o<1||o>P||n!==O||i<8||i>15||e<0||e>9||s<0||s>S)return $(t,y);8===i&&(i=9);var u=new function(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=O,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new r.Buf16(2*j),this.dyn_dtree=new r.Buf16(2*(2*M+1)),this.bl_tree=new r.Buf16(2*(2*R+1)),J(this.dyn_ltree),J(this.dyn_dtree),J(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new r.Buf16(N+1),this.heap=new r.Buf16(2*E+1),J(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new r.Buf16(2*E+1),J(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0};return t.state=u,u.strm=t,u.wrap=a,u.gzhead=null,u.w_bits=i,u.w_size=1<t.pending_buf_size-5&&(n=t.pending_buf_size-5);;){if(t.lookahead<=1){if(ot(t),0===t.lookahead&&e===l)return V;if(0===t.lookahead)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+n;if((0===t.strstart||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,et(t,!1),0===t.strm.avail_out))return V;if(t.strstart-t.block_start>=t.w_size-D&&(et(t,!1),0===t.strm.avail_out))return V}return t.insert=0,e===p?(et(t,!0),0===t.strm.avail_out?Z:Q):(t.strstart>t.block_start&&(et(t,!1),t.strm.avail_out),V)}),new ut(4,4,8,4,st),new ut(4,5,16,8,st),new ut(4,6,32,32,st),new ut(4,4,16,16,at),new ut(8,16,32,32,at),new ut(8,16,128,128,at),new ut(8,32,128,256,at),new ut(32,128,258,1024,at),new ut(32,258,258,4096,at)],e.deflateInit=function(t,e){return ht(t,e,O,A,C,x)},e.deflateInit2=ht,e.deflateReset=ct,e.deflateResetKeep=lt,e.deflateSetHeader=function(t,e){return t&&t.state?2!==t.state.wrap?y:(t.state.gzhead=e,d):y},e.deflate=function(t,e){var n,r,s,u;if(!t||!t.state||e>f||e<0)return t?$(t,y):y;if(r=t.state,!t.output||!t.input&&0!==t.avail_in||r.status===G&&e!==p)return $(t,0===t.avail_out?v:y);if(r.strm=t,n=r.last_flush,r.last_flush=e,r.status===I)if(2===r.wrap)t.adler=0,nt(r,31),nt(r,139),nt(r,8),r.gzhead?(nt(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),nt(r,255&r.gzhead.time),nt(r,r.gzhead.time>>8&255),nt(r,r.gzhead.time>>16&255),nt(r,r.gzhead.time>>24&255),nt(r,9===r.level?2:r.strategy>=w||r.level<2?4:0),nt(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(nt(r,255&r.gzhead.extra.length),nt(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(t.adler=a(t.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=B):(nt(r,0),nt(r,0),nt(r,0),nt(r,0),nt(r,0),nt(r,9===r.level?2:r.strategy>=w||r.level<2?4:0),nt(r,K),r.status=W);else{var _=O+(r.w_bits-8<<4)<<8;_|=(r.strategy>=w||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(_|=q),_+=31-_%31,r.status=W,it(r,_),0!==r.strstart&&(it(r,t.adler>>>16),it(r,65535&t.adler)),t.adler=1}if(r.status===B)if(r.gzhead.extra){for(s=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>s&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),tt(t),s=r.pending,r.pending!==r.pending_buf_size));)nt(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>s&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=U)}else r.status=U;if(r.status===U)if(r.gzhead.name){s=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>s&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),tt(t),s=r.pending,r.pending===r.pending_buf_size)){u=1;break}u=r.gzindexs&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),0===u&&(r.gzindex=0,r.status=z)}else r.status=z;if(r.status===z)if(r.gzhead.comment){s=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>s&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),tt(t),s=r.pending,r.pending===r.pending_buf_size)){u=1;break}u=r.gzindexs&&(t.adler=a(t.adler,r.pending_buf,r.pending-s,s)),0===u&&(r.status=Y)}else r.status=Y;if(r.status===Y&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&tt(t),r.pending+2<=r.pending_buf_size&&(nt(r,255&t.adler),nt(r,t.adler>>8&255),t.adler=0,r.status=W)):r.status=W),0!==r.pending){if(tt(t),0===t.avail_out)return r.last_flush=-1,d}else if(0===t.avail_in&&X(e)<=X(n)&&e!==p)return $(t,v);if(r.status===G&&0!==t.avail_in)return $(t,v);if(0!==t.avail_in||0!==r.lookahead||e!==l&&r.status!==G){var g=r.strategy===w?function(t,e){for(var n;;){if(0===t.lookahead&&(ot(t),0===t.lookahead)){if(e===l)return V;break}if(t.match_length=0,n=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,n&&(et(t,!1),0===t.strm.avail_out))return V}return t.insert=0,e===p?(et(t,!0),0===t.strm.avail_out?Z:Q):t.last_lit&&(et(t,!1),0===t.strm.avail_out)?V:H}(r,e):r.strategy===k?function(t,e){for(var n,i,r,s,a=t.window;;){if(t.lookahead<=L){if(ot(t),t.lookahead<=L&&e===l)return V;if(0===t.lookahead)break}if(t.match_length=0,t.lookahead>=F&&t.strstart>0&&(i=a[r=t.strstart-1])===a[++r]&&i===a[++r]&&i===a[++r]){s=t.strstart+L;do{}while(i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&i===a[++r]&&rt.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=F?(n=o._tr_tally(t,1,t.match_length-F),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(n=o._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),n&&(et(t,!1),0===t.strm.avail_out))return V}return t.insert=0,e===p?(et(t,!0),0===t.strm.avail_out?Z:Q):t.last_lit&&(et(t,!1),0===t.strm.avail_out)?V:H}(r,e):i[r.level].func(r,e);if(g!==Z&&g!==Q||(r.status=G),g===V||g===Z)return 0===t.avail_out&&(r.last_flush=-1),d;if(g===H&&(e===c?o._tr_align(r):e!==f&&(o._tr_stored_block(r,0,0,!1),e===h&&(J(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),tt(t),0===t.avail_out))return r.last_flush=-1,d}return e!==p?d:r.wrap<=0?m:(2===r.wrap?(nt(r,255&t.adler),nt(r,t.adler>>8&255),nt(r,t.adler>>16&255),nt(r,t.adler>>24&255),nt(r,255&t.total_in),nt(r,t.total_in>>8&255),nt(r,t.total_in>>16&255),nt(r,t.total_in>>24&255)):(it(r,t.adler>>>16),it(r,65535&t.adler)),tt(t),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?d:m)},e.deflateEnd=function(t){var e;return t&&t.state?(e=t.state.status)!==I&&e!==B&&e!==U&&e!==z&&e!==Y&&e!==W&&e!==G?$(t,y):(t.state=null,e===W?$(t,_):d):y},e.deflateSetDictionary=function(t,e){var n,i,o,a,u,l,c,h,p=e.length;if(!t||!t.state)return y;if(2===(a=(n=t.state).wrap)||1===a&&n.status!==I||n.lookahead)return y;for(1===a&&(t.adler=s(t.adler,e,p,0)),n.wrap=0,p>=n.w_size&&(0===a&&(J(n.head),n.strstart=0,n.block_start=0,n.insert=0),h=new r.Buf8(n.w_size),r.arraySet(h,e,p-n.w_size,n.w_size,0),e=h,p=n.w_size),u=t.avail_in,l=t.next_in,c=t.input,t.avail_in=p,t.next_in=0,t.input=e,ot(n);n.lookahead>=F;){i=n.strstart,o=n.lookahead-(F-1);do{n.ins_h=(n.ins_h<0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new a,this.strm.avail_out=0;var n=i.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(n!==l)throw new Error(s[n]);if(e.header&&i.deflateSetHeader(this.strm,e.header),e.dictionary){var d;if(d="string"==typeof e.dictionary?o.string2buf(e.dictionary):"[object ArrayBuffer]"===u.call(e.dictionary)?new Uint8Array(e.dictionary):e.dictionary,(n=i.deflateSetDictionary(this.strm,d))!==l)throw new Error(s[n]);this._dict_set=!0}}function d(t,e){var n=new f(e);if(n.push(t,!0),n.err)throw n.msg||s[n.err];return n.result}f.prototype.push=function(t,e){var n,s,a=this.strm,c=this.options.chunkSize;if(this.ended)return!1;s=e===~~e?e:!0===e?4:0,"string"==typeof t?a.input=o.string2buf(t):"[object ArrayBuffer]"===u.call(t)?a.input=new Uint8Array(t):a.input=t,a.next_in=0,a.avail_in=a.input.length;do{if(0===a.avail_out&&(a.output=new r.Buf8(c),a.next_out=0,a.avail_out=c),1!==(n=i.deflate(a,s))&&n!==l)return this.onEnd(n),this.ended=!0,!1;0!==a.avail_out&&(0!==a.avail_in||4!==s&&2!==s)||("string"===this.options.to?this.onData(o.buf2binstring(r.shrinkBuf(a.output,a.next_out))):this.onData(r.shrinkBuf(a.output,a.next_out)))}while((a.avail_in>0||0===a.avail_out)&&1!==n);return 4===s?(n=i.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===l):2!==s||(this.onEnd(l),a.avail_out=0,!0)},f.prototype.onData=function(t){this.chunks.push(t)},f.prototype.onEnd=function(t){t===l&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=r.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg},e.Deflate=f,e.deflate=d,e.deflateRaw=function(t,e){return(e=e||{}).raw=!0,d(t,e)},e.gzip=function(t,e){return(e=e||{}).gzip=!0,d(t,e)}},function(t,e,n){"use strict";var i={};(0,n(23).assign)(i,n(185),n(182),n(98)),t.exports=i},function(t,e,n){"use strict";var i="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,r=n(186),o=n(10),s=n(16),a=i?"uint8array":"array";function u(t,e){s.call(this,"FlateWorker/"+t),this._pako=null,this._pakoAction=t,this._pakoOptions=e,this.meta={}}e.magic="\b\0",o.inherits(u,s),u.prototype.processChunk=function(t){this.meta=t.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(a,t.data),!1)},u.prototype.flush=function(){s.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){s.prototype.cleanUp.call(this),this._pako=null},u.prototype._createPako=function(){this._pako=new r[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var t=this;this._pako.onData=function(e){t.push({data:e,meta:t.meta})}},e.compressWorker=function(t){return new u("Deflate",t)},e.uncompressWorker=function(){return new u("Inflate",{})}},function(t,e,n){"use strict";var i=n(103),r=n(177);e.generateWorker=function(t,e,n){var o=new r(e.streamFiles,n,e.platform,e.encodeFileName),s=0;try{t.forEach(function(t,n){s++;var r=function(t,e){var n=t||e,r=i[n];if(!r)throw new Error(n+" is not a valid compression method !");return r}(n.options.compression,e.compression),a=n.options.compressionOptions||e.compressionOptions||{},u=n.dir,l=n.date;n._compressWorker(r,a).withStreamInfo("file",{name:t,dir:u,date:l,comment:n.comment||"",unixPermissions:n.unixPermissions,dosPermissions:n.dosPermissions}).pipe(o)}),o.entriesCount=s}catch(t){o.error(t)}return o}},function(t,e,n){"use strict";var i=n(108),r=n(106),o=n(31),s=n(70),a=n(16),u=function(t,e,n){this.name=t,this.dir=n.dir,this.date=n.date,this.comment=n.comment,this.unixPermissions=n.unixPermissions,this.dosPermissions=n.dosPermissions,this._data=e,this._dataBinary=n.binary,this.options={compression:n.compression,compressionOptions:n.compressionOptions}};u.prototype={internalStream:function(t){var e=null,n="string";try{if(!t)throw new Error("No output type specified.");var r="string"===(n=t.toLowerCase())||"text"===n;"binarystring"!==n&&"text"!==n||(n="string"),e=this._decompressWorker();var s=!this._dataBinary;s&&!r&&(e=e.pipe(new o.Utf8EncodeWorker)),!s&&r&&(e=e.pipe(new o.Utf8DecodeWorker))}catch(t){(e=new a("error")).error(t)}return new i(e,n,"")},async:function(t,e){return this.internalStream(t).accumulate(e)},nodeStream:function(t,e){return this.internalStream(t||"nodebuffer").toNodejsStream(e)},_compressWorker:function(t,e){if(this._data instanceof s&&this._data.compression.magic===t.magic)return this._data.getCompressedWorker();var n=this._decompressWorker();return this._dataBinary||(n=n.pipe(new o.Utf8EncodeWorker)),s.createWorkerFrom(n,t,e)},_decompressWorker:function(){return this._data instanceof s?this._data.getContentWorker():this._data instanceof a?this._data:new r(this._data)}};for(var l=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],c=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},h=0;hn;)e.push(arguments[n++]);return y[++m]=function(){a("function"==typeof t?t:Function(t),e)},i(m),m},f=function(t){delete y[t]},"process"==n(194)(h)?i=function(t){h.nextTick(s(_,t,1))}:d?(o=(r=new d).port2,r.port1.onmessage=v,i=s(o.postMessage,o,1)):c.addEventListener&&"function"==typeof postMessage&&!c.importScripts?(i=function(t){c.postMessage(t+"","*")},c.addEventListener("message",v,!1)):i="onreadystatechange"in l("script")?function(t){u.appendChild(l("script")).onreadystatechange=function(){u.removeChild(this),_.call(t)}}:function(t){setTimeout(s(_,t,1),0)}),t.exports={set:p,clear:f}},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e,n){var i=n(72);t.exports=function(t,e){if(!i(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!i(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!i(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){t.exports=!n(71)&&!n(110)(function(){return 7!=Object.defineProperty(n(109)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var i=n(72);t.exports=function(t){if(!i(t))throw TypeError(t+" is not an object!");return t}},function(t,e,n){var i=n(201),r=n(200),o=n(199),s=Object.defineProperty;e.f=n(71)?Object.defineProperty:function(t,e,n){if(i(t),e=o(e,!0),i(n),r)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var i=n(202),r=n(198);t.exports=n(71)?function(t,e,n){return i.f(t,e,r(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},function(t,e,n){var i=n(56),r=n(112),o=n(111),s=n(203),a=function(t,e,n){var u,l,c,h=t&a.F,p=t&a.G,f=t&a.S,d=t&a.P,m=t&a.B,y=t&a.W,_=p?r:r[e]||(r[e]={}),v=_.prototype,g=p?i:f?i[e]:(i[e]||{}).prototype;for(u in p&&(n=e),n)(l=!h&&g&&void 0!==g[u])&&u in _||(c=l?g[u]:n[u],_[u]=p&&"function"!=typeof g[u]?n[u]:m&&l?o(c,i):y&&g[u]==c?function(t){var e=function(e,n,i){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,i)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(c):d&&"function"==typeof c?o(Function.call,c):c,d&&((_.virtual||(_.virtual={}))[u]=c,t&a.R&&v&&!v[u]&&s(v,u,c)))};a.F=1,a.G=2,a.S=4,a.P=8,a.B=16,a.W=32,a.U=64,a.R=128,t.exports=a},function(t,e,n){var i=n(205),r=n(197);i(i.G+i.B,{setImmediate:r.set,clearImmediate:r.clear})},function(t,e,n){n(206),t.exports=n(112).setImmediate},function(t,e,n){t.exports=n(74).PassThrough},function(t,e,n){t.exports=n(74).Transform},function(t,e,n){t.exports=n(26)},function(t,e,n){t.exports=n(73)},function(t,e,n){"use strict";t.exports=o;var i=n(114),r=n(46);function o(t){if(!(this instanceof o))return new o(t);i.call(this,t)}r.inherits=n(30),r.inherits(o,i),o.prototype._transform=function(t,e,n){n(null,t)}},function(t,e,n){(function(e){function n(t){try{if(!e.localStorage)return!1}catch(t){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=function(t,e){if(n("noDeprecation"))return t;var i=!1;return function(){if(!i){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),i=!0}return t.apply(this,arguments)}}}).call(this,n(22))},function(t,e,n){(function(t,e){!function(t,n){"use strict";if(!t.setImmediate){var i,r,o,s,a,u=1,l={},c=!1,h=t.document,p=Object.getPrototypeOf&&Object.getPrototypeOf(t);p=p&&p.setTimeout?p:t,"[object process]"==={}.toString.call(t.process)?i=function(t){e.nextTick(function(){d(t)})}:!function(){if(t.postMessage&&!t.importScripts){var e=!0,n=t.onmessage;return t.onmessage=function(){e=!1},t.postMessage("","*"),t.onmessage=n,e}}()?t.MessageChannel?((o=new MessageChannel).port1.onmessage=function(t){d(t.data)},i=function(t){o.port2.postMessage(t)}):h&&"onreadystatechange"in h.createElement("script")?(r=h.documentElement,i=function(t){var e=h.createElement("script");e.onreadystatechange=function(){d(t),e.onreadystatechange=null,r.removeChild(e),e=null},r.appendChild(e)}):i=function(t){setTimeout(d,0,t)}:(s="setImmediate$"+Math.random()+"$",a=function(e){e.source===t&&"string"==typeof e.data&&0===e.data.indexOf(s)&&d(+e.data.slice(s.length))},t.addEventListener?t.addEventListener("message",a,!1):t.attachEvent("onmessage",a),i=function(e){t.postMessage(s+e,"*")}),p.setImmediate=function(t){"function"!=typeof t&&(t=new Function(""+t));for(var e=new Array(arguments.length-1),n=0;n=0&&(t._idleTimeoutId=setTimeout(function(){t._onTimeout&&t._onTimeout()},e))},n(214),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(22))},function(t,e){},function(t,e,n){"use strict";var i=n(58).Buffer,r=n(216);t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}return t.prototype.push=function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n},t.prototype.concat=function(t){if(0===this.length)return i.alloc(0);if(1===this.length)return this.head.data;for(var e,n,r,o=i.allocUnsafe(t>>>0),s=this.head,a=0;s;)e=s.data,n=o,r=a,e.copy(n,r),a+=s.data.length,s=s.next;return o},t}(),r&&r.inspect&&r.inspect.custom&&(t.exports.prototype[r.inspect.custom]=function(){var t=r.inspect({length:this.length});return this.constructor.name+" "+t})},function(t,e){},function(t,e,n){t.exports=r;var i=n(75).EventEmitter;function r(){i.call(this)}n(30)(r,i),r.Readable=n(74),r.Writable=n(211),r.Duplex=n(210),r.Transform=n(209),r.PassThrough=n(208),r.Stream=r,r.prototype.pipe=function(t,e){var n=this;function r(e){t.writable&&!1===t.write(e)&&n.pause&&n.pause()}function o(){n.readable&&n.resume&&n.resume()}n.on("data",r),t.on("drain",o),t._isStdio||e&&!1===e.end||(n.on("end",a),n.on("close",u));var s=!1;function a(){s||(s=!0,t.end())}function u(){s||(s=!0,"function"==typeof t.destroy&&t.destroy())}function l(t){if(c(),0===i.listenerCount(this,"error"))throw t}function c(){n.removeListener("data",r),t.removeListener("drain",o),n.removeListener("end",a),n.removeListener("close",u),n.removeListener("error",l),t.removeListener("error",l),n.removeListener("end",c),n.removeListener("close",c),t.removeListener("close",c)}return n.on("error",l),t.on("error",l),n.on("end",c),n.on("close",c),t.on("close",c),t.emit("pipe",n),t}},function(t,e){e.read=function(t,e,n,i,r){var o,s,a=8*r-i-1,u=(1<>1,c=-7,h=n?r-1:0,p=n?-1:1,f=t[e+h];for(h+=p,o=f&(1<<-c)-1,f>>=-c,c+=a;c>0;o=256*o+t[e+h],h+=p,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=i;c>0;s=256*s+t[e+h],h+=p,c-=8);if(0===o)o=1-l;else{if(o===u)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,i),o-=l}return(f?-1:1)*s*Math.pow(2,o-i)},e.write=function(t,e,n,i,r,o){var s,a,u,l=8*o-r-1,c=(1<>1,p=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:o-1,d=i?1:-1,m=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+h>=1?p/u:p*Math.pow(2,1-h))*u>=2&&(s++,u/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(e*u-1)*Math.pow(2,r),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,r),s=0));r>=8;t[n+f]=255&a,f+=d,a/=256,r-=8);for(s=s<0;t[n+f]=255&s,f+=d,s/=256,l-=8);t[n+f-d]|=128*m}},function(t,e,n){"use strict";e.byteLength=function(t){var e=l(t),n=e[0],i=e[1];return 3*(n+i)/4-i},e.toByteArray=function(t){for(var e,n=l(t),i=n[0],s=n[1],a=new o(function(t,e,n){return 3*(e+n)/4-n}(0,i,s)),u=0,c=s>0?i-4:i,h=0;h>16&255,a[u++]=e>>8&255,a[u++]=255&e;2===s&&(e=r[t.charCodeAt(h)]<<2|r[t.charCodeAt(h+1)]>>4,a[u++]=255&e);1===s&&(e=r[t.charCodeAt(h)]<<10|r[t.charCodeAt(h+1)]<<4|r[t.charCodeAt(h+2)]>>2,a[u++]=e>>8&255,a[u++]=255&e);return a},e.fromByteArray=function(t){for(var e,n=t.length,r=n%3,o=[],s=0,a=n-r;sa?a:s+16383));1===r?(e=t[n-1],o.push(i[e>>2]+i[e<<4&63]+"==")):2===r&&(e=(t[n-2]<<8)+t[n-1],o.push(i[e>>10]+i[e>>4&63]+i[e<<2&63]+"="));return o.join("")};for(var i=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function c(t,e,n){for(var r,o,s=[],a=e;a>18&63]+i[o>>12&63]+i[o>>6&63]+i[63&o]);return s.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},function(t,e,n){"use strict";var i=n(31),r=n(10),o=n(16),s=n(108),a=n(107),u=n(70),l=n(189),c=n(188),h=n(57),p=n(176),f=function(t,e,n){var i,s=r.getTypeOf(e),c=r.extend(n||{},a);c.date=c.date||new Date,null!==c.compression&&(c.compression=c.compression.toUpperCase()),"string"==typeof c.unixPermissions&&(c.unixPermissions=parseInt(c.unixPermissions,8)),c.unixPermissions&&16384&c.unixPermissions&&(c.dir=!0),c.dosPermissions&&16&c.dosPermissions&&(c.dir=!0),c.dir&&(t=m(t)),c.createFolders&&(i=d(t))&&y.call(this,i,!0);var f="string"===s&&!1===c.binary&&!1===c.base64;n&&void 0!==n.binary||(c.binary=!f),(e instanceof u&&0===e.uncompressedSize||c.dir||!e||0===e.length)&&(c.base64=!1,c.binary=!0,e="",c.compression="STORE",s="string");var _=null;_=e instanceof u||e instanceof o?e:h.isNode&&h.isStream(e)?new p(t,e):r.prepareContent(t,e,c.binary,c.optimizedBinaryString,c.base64);var v=new l(t,_,c);this.files[t]=v},d=function(t){"/"===t.slice(-1)&&(t=t.substring(0,t.length-1));var e=t.lastIndexOf("/");return e>0?t.substring(0,e):""},m=function(t){return"/"!==t.slice(-1)&&(t+="/"),t},y=function(t,e){return e=void 0!==e?e:a.createFolders,t=m(t),this.files[t]||f.call(this,t,null,{dir:!0,createFolders:e}),this.files[t]};function _(t){return"[object RegExp]"===Object.prototype.toString.call(t)}var v={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(t){var e,n,i;for(e in this.files)this.files.hasOwnProperty(e)&&(i=this.files[e],(n=e.slice(this.root.length,e.length))&&e.slice(0,this.root.length)===this.root&&t(n,i))},filter:function(t){var e=[];return this.forEach(function(n,i){t(n,i)&&e.push(i)}),e},file:function(t,e,n){if(1===arguments.length){if(_(t)){var i=t;return this.filter(function(t,e){return!e.dir&&i.test(t)})}var r=this.files[this.root+t];return r&&!r.dir?r:null}return t=this.root+t,f.call(this,t,e,n),this},folder:function(t){if(!t)return this;if(_(t))return this.filter(function(e,n){return n.dir&&t.test(e)});var e=this.root+t,n=y.call(this,e),i=this.clone();return i.root=n.name,i},remove:function(t){t=this.root+t;var e=this.files[t];if(e||("/"!==t.slice(-1)&&(t+="/"),e=this.files[t]),e&&!e.dir)delete this.files[t];else for(var n=this.filter(function(e,n){return n.name.slice(0,t.length)===t}),i=0;i1&&void 0!==arguments[1]&&arguments[1],n=(arguments.length>2&&void 0!==arguments[2]&&arguments[2],this.props),i=n.pix2wav,o=n.remote,s=i.data.fileLookup[t.input[0]];return s?s.name&&s.name.match(/(gif|jpe?g|png)$/i)?null:(0,r.h)("div",null,(0,r.h)("div",{class:"actions"},(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,1)}},"train"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,2)}},"2x"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,4)}},"4x"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,6)}},"6x"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,18)}},"18x")),t.isBuilt?(0,r.h)("div",{class:"subtext"},"fetched ",(0,r.h)("span",{class:"link",onClick:function(){return o.clear_cache_task(t)}},"rm")):e?(0,r.h)("div",{class:"subtext"},"fetching"):(0,r.h)("div",{class:"subtext"},(0,r.h)("span",{class:"link",onClick:function(){return o.fetch_task(s.url,s.id,t.name)}},"fetch"))):null}}]),e}();e.default=(0,s.connect)(function(t){return{pix2wav:t.module.pix2wav}},function(t,e){return{actions:(0,o.bindActionCreators)(a,t),remote:(0,o.bindActionCreators)(u,t)}})(y)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){var e=t.history;return(0,i.h)("div",{class:"app pix2wav"},(0,i.h)(r.default,{module:o.default,history:e}))};var i=n(1),r=s(n(28)),o=s(n(60));function s(t){return t&&t.__esModule?t:{default:t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],n=(arguments.length>2&&void 0!==arguments[2]&&arguments[2],this.props),i=n.pix2pixhd,o=n.remote,s=i.data.fileLookup[t.input[0]];return s?s.name&&s.name.match(/(gif|jpe?g|png)$/i)?null:(0,r.h)("div",null,(0,r.h)("div",{class:"actions"},(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,1)}},"train"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,5)}},"5x"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,10)}},"10x"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,20)}},"20x"),(0,r.h)("span",{class:"link",onClick:function(){return o.train_task(t,i.folder_id,50)}},"50x")),t.isBuilt?(0,r.h)("div",{class:"subtext"},"fetched ",(0,r.h)("span",{class:"link",onClick:function(){return o.clear_cache_task(t)}},"rm")):e?(0,r.h)("div",{class:"subtext"},"fetching"):(0,r.h)("div",{class:"subtext"},(0,r.h)("span",{class:"link",onClick:function(){return o.fetch_task(s.url,s.id,t.name)}},"fetch"))):null}}]),e}();e.default=(0,s.connect)(function(t){return{pix2pixhd:t.module.pix2pixhd}},function(t,e){return{actions:(0,o.bindActionCreators)(a,t),remote:(0,o.bindActionCreators)(u,t)}})(y)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),r=n(3),o=n(2),s=(n(8),l(n(4)),n(11)),a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(33)),u=l(n(48));function l(t){return t&&t.__esModule?t:{default:t}}e.default=(0,o.connect)(function(t){return{pix2pixhd:t.module.pix2pixhd}},function(t,e){return{actions:(0,r.bindActionCreators)(a,t)}})(function(t){return(0,i.h)(s.Views.New,{db:t.pix2pixhd,path:"/pix2pixhd/sequences/",actions:t.actions,module:u.default,history:t.history})})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],n=(arguments.length>2&&void 0!==arguments[2]&&arguments[2],this.props),i=n.pix2pix,o=n.remote,s=i.data.fileLookup[t.input[0]];return s?s.name&&s.name.match(/(gif|jpe?g|png)$/i)?null:(console.log(t),(0,r.h)("div",null,(0,r.h)("div",{className:"actions"},(0,r.h)("span",{className:"link",onClick:function(){return o.train_task(t,i.folder_id,1)}},"train"),(0,r.h)("span",{className:"link",onClick:function(){return o.train_task(t,i.folder_id,5)}},"5x"),(0,r.h)("span",{className:"link",onClick:function(){return o.train_task(t,i.folder_id,10)}},"10x"),(0,r.h)("span",{className:"link",onClick:function(){return o.train_task(t,i.folder_id,20)}},"20x"),(0,r.h)("span",{className:"link",onClick:function(){return o.train_task(t,i.folder_id,50)}},"50x")),t.isBuilt?(0,r.h)("div",{className:"subtext"},"fetched ",(0,r.h)("span",{className:"link",onClick:function(){return o.clear_cache_task(t)}},"rm")):e?(0,r.h)("div",{className:"subtext"},"fetching"):(0,r.h)("div",{className:"subtext"},(0,r.h)("span",{className:"link",onClick:function(){return o.fetch_task(s.url,s.id,t.name)}},"fetch")))):null}}]),e}();e.default=(0,s.connect)(function(t){return{pix2pix:t.module.pix2pix}},function(t,e){return{actions:(0,o.bindActionCreators)(a,t),remote:(0,o.bindActionCreators)(u,t)}})(y)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),r=n(3),o=n(2),s=(n(8),l(n(4)),n(11)),a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(79)),u=l(n(78));function l(t){return t&&t.__esModule?t:{default:t}}e.default=(0,o.connect)(function(t){return{pix2pix:t.module.pix2pix}},function(t,e){return{actions:(0,r.bindActionCreators)(a,t)}})(function(t){return(0,i.h)(s.Views.New,{db:t.pix2pix,path:"/pix2pix/sequences/",actions:t.actions,module:u.default,history:t.history})})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n64&&"mix"===this.state.mode&&(f=(0,r.h)("span",null,(0,r.h)("br",null),"warning, this will take a while")),(0,r.h)("div",{className:"app morph"},(0,r.h)("div",{className:"heading row middle"},(0,r.h)("h1",null,"Morph")),(0,r.h)("div",{className:"rows params renders"},(0,r.h)("div",{className:"column"},(0,r.h)(h.Group,{title:"From"},(0,r.h)(h.Select,{title:"Starting sequence",placeholder:"Please choose a video",value:this.state.a,options:u,onChange:function(e,n){return t.setState({a:n,a_duration:l[n].count,a_pos:0,a_offset:0})}}),(0,r.h)(h.Slider,{title:"Offset",value:this.state.a_pos,min:0,max:1,step:.01,onChange:function(e){return t.setState({a_pos:e,a_offset:Math.floor(e*(t.state.a_duration-t.state.frames))})}})),(0,r.h)(h.Group,{title:"To"},(0,r.h)(h.Select,{title:"Ending sequence",placeholder:"Please choose a video",value:this.state.b,options:u,onChange:function(e,n){return t.setState({b:n,b_duration:l[n].count,b_pos:0,b_offset:0})}}),(0,r.h)(h.Slider,{title:"Offset",value:this.state.b_pos,min:0,max:1,step:.01,onChange:function(e){return t.setState({b_pos:e,b_offset:Math.floor(e*(t.state.b_duration-t.state.frames))})}})),(0,r.h)(h.Group,{title:"Morph Settings"},(0,r.h)(h.Select,{title:"Mode",value:this.state.mode,options:["mix","average","mix_images"],onChange:function(e,n){return t.setState({mode:n})}}),(0,r.h)(h.Slider,{type:"list",title:"Steps",value:this.state.steps,options:[2,4,8,16,32,64,128,256,512,1024,2048,4096],onChange:function(e){return t.setState({steps:e,frames:e*t.state.dilate})}}),(0,r.h)(h.Slider,{type:"list",title:"Dilate",value:this.state.dilate,options:[1,2,4,8,16,32],onChange:function(e){return t.setState({dilate:e,frames:t.state.steps*e})}}),(0,r.h)(h.Checkbox,{title:"Smooth",value:this.state.smooth,onToggle:function(e){return t.setState({smooth:e})}}),(0,r.h)(h.Slider,{type:"int",title:"Padding (in seconds)",value:this.state.padding,min:0,max:30,step:1,onChange:function(e){return t.setState({padding:e})}}),(0,r.h)(h.Button,{title:"Run task",value:"Morph!",onClick:function(){return t.props.remote.morph_task(t.state,n)}}),(0,r.h)("br",null),(0,r.h)(h.Param,{title:"Total length"},p.toFixed(1)+" seconds"),(0,r.h)(h.Param,{title:"Total frames"},this.state.frames+" frames"),f,(0,r.h)("br",null),(0,r.h)(h.CurrentTask,null))),(0,r.h)("h3",null,"morphed videos"),(0,r.h)(h.FileList,{linkFiles:!0,files:s,orderBy:"date desc",fields:"name datetime size delete",onDelete:function(t){(!(d<3)||confirm("Are you sure you want to delete this file?"))&&(d+=1,console.log("delete: confirmed"),a.default.file.destroy(t))}}),(0,r.h)("br",null),(0,r.h)("h3",null,"renders on server"),(0,r.h)(h.FileList,{files:o,orderBy:"date desc",fields:"name datetime time size",onClick:function(e,n){n.preventDefault(),n.stopPropagation(),console.log("picked a result",e),t.handlePick(e)}})))}},{key:"handlePick",value:function(t){}}]),e}();e.default=(0,s.connect)(function(t){return{morph:t.module.morph}},function(t,e){return{actions:(0,o.bindActionCreators)(u,t),remote:(0,o.bindActionCreators)(l,t)}})(m)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n1&&void 0!==arguments[1]&&arguments[1],n=(arguments.length>2&&void 0!==arguments[2]&&arguments[2],this.props),i=n.biggan,o=n.remote,s=i.data.fileLookup[t.input[0]];return s?s.name&&s.name.match(/(gif|jpe?g|png)$/i)?null:(0,r.h)("div",null,(0,r.h)("div",{class:"actions"}),t.isBuilt?(0,r.h)("div",{class:"subtext"},"fetched ",(0,r.h)("span",{class:"link",onClick:function(){return o.clear_cache_task(t)}},"rm")):e?(0,r.h)("div",{class:"subtext"},"fetching"):(0,r.h)("div",{class:"subtext"},(0,r.h)("span",{class:"link",onClick:function(){return o.fetch_task(s.url,s.id,t.name)}},"fetch"))):null}}]),e}();e.default=(0,s.connect)(function(t){return{biggan:t.module.biggan}},function(t,e){return{actions:(0,o.bindActionCreators)(a,t),tasks:(0,o.bindActionCreators)(u,t),remote:(0,o.bindActionCreators)(u,t)}})(y)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),r=n(3),o=n(2),s=(n(8),l(n(4)),n(11)),a=function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e.default=t,e}(n(37)),u=l(n(61));function l(t){return t&&t.__esModule?t:{default:t}}e.default=(0,o.connect)(function(t){return{biggan:t.module.biggan}},function(t,e){return{actions:(0,r.bindActionCreators)(a,t)}})(function(t){return(0,i.h)(s.Views.New,{db:t.biggan,path:"/biggan/datasets/",actions:t.actions,module:u.default,history:t.history})})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function t(t,e){for(var n=0;n'}},{type:"video",regex:/\.(mp4|webm)(\?.*)?$/i,fetch:function(t,e){var n=document.createElement("video"),i=t.replace(/\?.*$/,"").split("/"),r=i[i.length-1];n.addEventListener("loadedmetadata",function(){var i=n.videoWidth,o=n.videoHeight;n=null,e({url:t,type:"video",token:t,thumbnail:"/public/assets/img/video-thumbnail.png",title:r,width:i,height:o})}),n.src=t,n.load()},tag:function(t){return'