(function (global) {var process;(function (entrypoint, files, compilations, implicitRequires) { function cachedRequire(index) { const module = Module._cache[index] || new Module(index); return module.exports; } function Module(index) { Module._cache[index] = this; const file = files[index]; const filename = file[0]; const precompiled = compilations[file[1]]; const references = file[2]; this.exports = { }; this.__dirname = filename.split("/").slice(0, -1).join("/"); this.__filename = filename; this.require = function require(index) { if (typeof index !== "number") throw TypeError("Expected index require"); const reference = references[index]; if (typeof reference !== "number") throw TypeError("Could not find file referenced at " + index); return cachedRequire(reference); } precompiled.call( this.exports, /*this*/ this.exports, this.require, this, this.__filename, this.__dirname); } Module._cache = { }; if (implicitRequires) implicitRequires(cachedRequire); cachedRequire(entrypoint); }) (12, [["/app/node_modules/asap/browser-asap.js", 0, [1,]], ["/app/node_modules/asap/browser-raw.js", 1, []], ["/app/node_modules/bluebird/js/browser/bluebird.core.js", 2, [14,]], ["/app/node_modules/runkit-embed/app-channel.js", 3, [4,5,6,13,]], ["/app/node_modules/runkit-embed/dom.js", 4, [6,]], ["/app/node_modules/runkit-embed/eframes.js", 5, [3,4,6,2,]], ["/app/node_modules/runkit-embed/ipromise.js", 6, []], ["/app/node_modules/runkit-embed/notebook.js", 7, [4,5,2,8,]], ["/app/node_modules/runkit-embed/notebook/api.js", 8, [10,]], ["/app/node_modules/runkit-embed/notebook/from-dataset.js", 9, [8,]], ["/app/node_modules/runkit-embed/notebook/notebook.json", 10, []], ["/app/node_modules/runkit-embed/public-api.js", 11, [4,7,9,]], ["/app/node_modules/runkit-embed/runkit-embed.js", 12, [3,4,11,]], ["/app/node_modules/window-channel/window-channel.js", 13, [0,2,]], ["process", 14, []], ], [(function(t,n,l){"use strict" var o=n(0),r=[],i=[],s=o.makeRequestCallFromTimer(function(){if(i.length)throw i.shift()}) function e(t){var n;(n=r.length?r.pop():new a).task=t,o(n)}function a(){this.task=null}l.exports=e,a.prototype.call=function(){try{this.task.call()}catch(t){e.onerror?e.onerror(t):(i.push(t),s())}finally{this.task=null,r[r.length]=this}}}) ,(function(e,t,n){"use strict" function r(e){o.length||(a(),!0),o[o.length]=e}n.exports=r var a,o=[],l=0,u=1024 function i(){for(;lu){for(var t=0,n=o.length-l;t0;)y(t)}function C(){b(this._normalQueue),this._reset(),this._haveDrainedQueues=!0,b(this._lateQueue)}function w(t,e,n){"use strict" var r try{throw new Error}catch(t){r=t}var i=t("./schedule"),y=t("./queue"),b=t("./util") function w(){this._customScheduler=!1,this._isTickUsed=!1,this._lateQueue=new y(16),this._normalQueue=new y(16),this._haveDrainedQueues=!1,this._trampolineEnabled=!0 var t=this this.drainQueues=function(){t._drainQueues()},this._schedule=i}w.prototype.setScheduler=o,w.prototype.hasCustomScheduler=a,w.prototype.enableTrampoline=s,w.prototype.disableTrampolineIfNecessary=function(){b.hasDevTools&&(this._trampolineEnabled=!1)},w.prototype.haveItemsQueued=c,w.prototype.fatalError=l,w.prototype.throwLater=u,b.hasDevTools?(w.prototype.invokeLater=_,w.prototype.invoke=d,w.prototype.settlePromises=v):(w.prototype.invokeLater=p,w.prototype.invoke=f,w.prototype.settlePromises=h),w.prototype._drainQueues=C,w.prototype._queueTick=g,w.prototype._reset=m,e.exports=w,e.exports.firstLineError=r}function E(t,e){this._reject(e)}function k(t,e){0==(50397184&this._bitField)&&this._resolveCallback(e.target)}function j(t,e){e.promiseRejectionQueued||this._reject(t)}function F(t){void 0!==t?(this._bitField=2097152|this._bitField,this._boundTo=t):this._bitField=-2097153&this._bitField}function T(){return 2097152==(2097152&this._bitField)}function P(t,e,n,r){var i=!1,o=E,a=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(o,o,null,this,t)},s=k,c=j t.prototype.bind=function(o){i||(i=!0,t.prototype._propagateFrom=r.propagateFromFunction(),t.prototype._boundValue=r.boundValueFunction()) var l=n(o),u=new t(e) u._propagateFrom(this,1) var p=this._target() if(u._setBoundTo(l),l instanceof t){var f={promiseRejectionQueued:!1,promise:u,target:p,bindingPromise:l} p._then(e,a,void 0,u,f),l._then(s,c,void 0,u,f),u._setOnCancel(l)}else u._resolveCallback(p) return u},t.prototype._setBoundTo=F,t.prototype._isBound=T,t.bind=function(e,n){return t.resolve(n).bind(e)}}function S(t,e,n){"use strict" e.exports=P}function x(t,e,n){"use strict" var r "undefined"!=typeof Promise&&(r=Promise) var i=t("./promise")() i.noConflict=function(){try{Promise===i&&(Promise=r)}catch(t){}return i},e.exports=i}function R(){this._branchesRemainingToCancel--}function O(){return void 0===this._branchesRemainingToCancel||this._branchesRemainingToCancel<=0}function A(t){return t===this?(this._branchesRemainingToCancel=0,this._invokeOnCancel(),!0):(this._branchHasCancelled(),!!this._enoughBranchesHaveCancelled()&&(this._invokeOnCancel(),!0))}function I(){this._enoughBranchesHaveCancelled()&&this._cancel()}function L(){this._length()>0&&this._settlePromises()}function N(){this._onCancelField=void 0}function U(){return this.isPending()&&!this._isCancelled()}function B(){return this.isPending()&&!this.isCancelled()}function H(){this._isCancellable()&&(this._doInvokeOnCancel(this._onCancel(),!0),this._unsetOnCancel())}function D(){this.cancel()}function V(t,e,n){"use strict" e.exports=function(e,n,r,i){var o=t("./util"),a=o.tryCatch,s=o.errorObj,c=e._async e.prototype.break=e.prototype.cancel=function(){if(!i.cancellation())return this._warn("cancellation is disabled") for(var t=this,e=t;t._isCancellable();){if(!t._cancelBy(e)){e._isFollowing()?e._followee().cancel():e._cancelBranched() break}var n=t._cancellationParent if(null==n||!n._isCancellable()){t._isFollowing()?t._followee().cancel():t._cancelBranched() break}t._isFollowing()&&t._followee().cancel(),t._setWillBeCancelled(),e=t,t=n}},e.prototype._branchHasCancelled=R,e.prototype._enoughBranchesHaveCancelled=O,e.prototype._cancelBy=A,e.prototype._cancelBranched=I,e.prototype._cancel=function(){this._isCancellable()&&(this._setCancelled(),c.invoke(this._cancelPromises,this,void 0))},e.prototype._cancelPromises=L,e.prototype._unsetOnCancel=N,e.prototype._isCancellable=U,e.prototype.isCancellable=B,e.prototype._doInvokeOnCancel=function(t,e){if(o.isArray(t))for(var n=0;n=0)return n[t]}return t.prototype._promiseCreated=q,t.prototype._pushContext=M,t.prototype._popContext=G,t._peekContext=t.prototype._peekContext=W,r.prototype._pushContext=function(){void 0!==this._trace&&(this._trace._promiseCreated=null,n.push(this._trace))},r.prototype._popContext=function(){if(void 0!==this._trace){var t=n.pop(),e=t._promiseCreated return t._promiseCreated=null,e}return null},r.CapturedTrace=null,r.create=function(){if(e)return new r},r.deactivateLongStackTraces=$,r.activateLongStackTraces=function(){var n=t.prototype._pushContext,o=t.prototype._popContext,a=t._peekContext,s=t.prototype._peekContext,c=t.prototype._promiseCreated r.deactivateLongStackTraces=function(){t.prototype._pushContext=n,t.prototype._popContext=o,t._peekContext=a,t.prototype._peekContext=s,t.prototype._promiseCreated=c,e=!1},e=!0,t.prototype._pushContext=r.prototype._pushContext,t.prototype._popContext=r.prototype._popContext,t._peekContext=t.prototype._peekContext=i,t.prototype._promiseCreated=z},r}function K(t,e,n){"use strict" e.exports=X}function J(){var t=this._target() t._bitField=-1048577&t._bitField|524288}function Y(){if(0==(524288&this._bitField)){this._setRejectionIsUnhandled() var t=this setTimeout(function(){t._notifyUnhandledRejection()},1)}}function Z(){this._bitField=268435456|this._bitField}function tt(){return 0!=(268435456&this._bitField)}function et(){this._bitField=262144|this._bitField}function nt(){this._bitField=-262145&this._bitField}function rt(){return(262144&this._bitField)>0}function it(){this._bitField=1048576|this._bitField}function ot(){this._bitField=-1048577&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())}function at(){return(1048576&this._bitField)>0}function st(){}function ct(){return!1}function lt(){return process.emit.apply(process,arguments)}function ut(){return!1}function pt(t,e){return{promise:e}}function ft(t,e,n){return{promise:e,child:n}}function ht(t,e){return{warning:e}}function _t(t,e,n){return{reason:e,promise:n}}function dt(){return!1}function vt(t,e,n){try{t(e,n)}catch(t){return t}}function yt(){}function gt(t){}function mt(t){}function bt(){}function Ct(){}function wt(){}function Et(){}function kt(t,e){}function jt(){return this._onCancelField}function Ft(t){this._onCancelField=t}function Tt(){this._cancellationParent=void 0,this._onCancelField=void 0}function Pt(t,e){if(0!=(1&e)){this._cancellationParent=t var n=t._branchesRemainingToCancel void 0===n&&(n=0),t._branchesRemainingToCancel=n+1}0!=(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function St(t,e){0!=(2&e)&&t._isBound()&&this._setBoundTo(t._boundTo)}function xt(){this._trace=void 0}function Rt(t,e){for(var n=0;n=0;--s)if(r[s]===o){a=s break}for(s=a;s>=0;--s){var c=r[s] if(e[i]!==c)break e.pop(),i--}e=r}}function It(t){return t.length<41?t:t.substr(0,38)+"..."}function Lt(){return!1}function Nt(){var t=this._length if(!(t<2)){for(var e=[],n={},r=0,i=this;void 0!==i;++r)e.push(i),i=i._parent for(r=(t=this._length=r)-1;r>=0;--r){var o=e[r].stack void 0===n[o]&&(n[o]=r)}for(r=0;r0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[r]._parent=void 0,e[r]._length=1 var s=r>0?e[r-1]:this a=0;--l)e[l]._length=c,c++ return}}}}function Ut(t){t.stack=(new Error).stack}function Bt(t){Error.stackTraceLimit+=6 try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit-=6}function Ht(t){console.warn(t)}function Dt(t,e){var n=e?"":"" console.warn(n+t+"\n")}function Vt(t,e){console.warn("%c"+t,e?"color: darkorange":"color: red")}function Qt(t,e,n){"use strict" e.exports=function(e,n){var i,o,a,s=e._getDomain,c=e._async,l=t("./errors").Warning,u=t("./util"),p=t("./es5"),f=u.canAttachTrace,h=/[\\\/]bluebird[\\\/]js[\\\/](release|debug|instrumented)/,_=/\((?:timers\.js):\d+:\d+\)/,d=/[\/<\(](.+?):(\d+):(\d+)\)?\s*$/,v=null,y=null,g=!1,m=!(0==u.env("BLUEBIRD_DEBUG")),b=!(0==u.env("BLUEBIRD_WARNINGS")||!m&&!u.env("BLUEBIRD_WARNINGS")),C=!(0==u.env("BLUEBIRD_LONG_STACK_TRACES")||!m&&!u.env("BLUEBIRD_LONG_STACK_TRACES")),w=0!=u.env("BLUEBIRD_W_FORGOTTEN_RETURN")&&(b||!!u.env("BLUEBIRD_W_FORGOTTEN_RETURN")) e.prototype.suppressUnhandledRejections=J,e.prototype._ensurePossibleRejectionHandled=Y,e.prototype._notifyUnhandledRejectionIsHandled=function(){Q("rejectionHandled",i,void 0,this)},e.prototype._setReturnedNonUndefined=Z,e.prototype._returnedNonUndefined=tt,e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._settledValue() this._setUnhandledRejectionIsNotified(),Q("unhandledRejection",o,t,this)}},e.prototype._setUnhandledRejectionIsNotified=et,e.prototype._unsetUnhandledRejectionIsNotified=nt,e.prototype._isUnhandledRejectionNotified=rt,e.prototype._setRejectionIsUnhandled=it,e.prototype._unsetRejectionIsUnhandled=ot,e.prototype._isRejectionUnhandled=at,e.prototype._warn=function(t,e,n){return B(t,e,n||this)},e.onPossiblyUnhandledRejection=function(t){var e=s() o="function"==typeof t?null===e?t:u.domainBind(e,t):void 0},e.onUnhandledRejectionHandled=function(t){var e=s() i="function"==typeof t?null===e?t:u.domainBind(e,t):void 0} var E=st function k(t,e){var n={detail:e,cancelable:!0} p.defineProperty(n,"promise",{value:e.promise}),p.defineProperty(n,"reason",{value:e.reason}) var r=new CustomEvent(t.toLowerCase(),n) return!u.global.dispatchEvent(r)}function j(t,e){var n=new Event(t.toLowerCase(),{cancelable:!0}) return n.detail=e,p.defineProperty(n,"promise",{value:e.promise}),p.defineProperty(n,"reason",{value:e.reason}),!u.global.dispatchEvent(n)}function F(t,e){var n=document.createEvent("CustomEvent") return n.initCustomEvent(t.toLowerCase(),!1,!0,e),!u.global.dispatchEvent(n)}e.longStackTraces=function(){if(c.haveItemsQueued()&&!Mt.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n") if(!Mt.longStackTraces&&M()){var t=e.prototype._captureStackTrace,r=e.prototype._attachExtraTrace,i=e.prototype._dereferenceTrace Mt.longStackTraces=!0,E=function(){if(c.haveItemsQueued()&&!Mt.longStackTraces)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/MqrFmX\n") e.prototype._captureStackTrace=t,e.prototype._attachExtraTrace=r,e.prototype._dereferenceTrace=i,n.deactivateLongStackTraces(),c.enableTrampoline(),Mt.longStackTraces=!1},e.prototype._captureStackTrace=N,e.prototype._attachExtraTrace=U,e.prototype._dereferenceTrace=xt,n.activateLongStackTraces(),c.disableTrampolineIfNecessary()}},e.hasLongStackTraces=function(){return Mt.longStackTraces&&M()} var T=function(){try{if("function"==typeof CustomEvent){var t=new CustomEvent("CustomEvent") return u.global.dispatchEvent(t),k}if("function"==typeof Event){t=new Event("CustomEvent") return u.global.dispatchEvent(t),j}return(t=document.createEvent("CustomEvent")).initCustomEvent("testingtheevent",!1,!0,{}),u.global.dispatchEvent(t),F}catch(t){}return ct}() function P(t){var e="on"+t.toLowerCase(),n=u.global[e] return!!n&&(n.apply(u.global,[].slice.call(arguments,1)),!0)}var S=u.isNode?lt:u.global?P:ut,x={promiseCreated:pt,promiseFulfilled:pt,promiseRejected:pt,promiseResolved:pt,promiseCancelled:pt,promiseChained:ft,warning:ht,unhandledRejection:_t,rejectionHandled:pt},R=function(t){var e=!1 try{e=S.apply(null,arguments)}catch(t){c.throwLater(t),e=!0}var n=!1 try{n=T(t,x[t].apply(null,arguments))}catch(t){c.throwLater(t),n=!0}return n||e} function O(t,e,n){var r=this try{t(e,n,function(t){if("function"!=typeof t)throw new TypeError("onCancel must be a function, got: "+u.toString(t)) r._attachCancellationCallback(t)})}catch(t){return t}}function A(t){if(!this._isCancellable())return this var e=this._onCancel() void 0!==e?u.isArray(e)?e.push(t):this._setOnCancel([e,t]):this._setOnCancel(t)}e.config=function(t){if("longStackTraces"in(t=Object(t))&&(t.longStackTraces?e.longStackTraces():!t.longStackTraces&&e.hasLongStackTraces()&&E()),"warnings"in t){var n=t.warnings Mt.warnings=!!n,w=Mt.warnings,u.isObject(n)&&"wForgottenReturn"in n&&(w=!!n.wForgottenReturn)}if("cancellation"in t&&t.cancellation&&!Mt.cancellation){if(c.haveItemsQueued())throw new Error("cannot enable cancellation after promises are in use") e.prototype._clearCancellationData=Tt,e.prototype._propagateFrom=Pt,e.prototype._onCancel=jt,e.prototype._setOnCancel=Ft,e.prototype._attachCancellationCallback=A,e.prototype._execute=O,I=Pt,Mt.cancellation=!0}return"monitoring"in t&&(t.monitoring&&!Mt.monitoring?(Mt.monitoring=!0,e.prototype._fireEvent=R):!t.monitoring&&Mt.monitoring&&(Mt.monitoring=!1,e.prototype._fireEvent=dt)),e},e.prototype._fireEvent=dt,e.prototype._execute=vt,e.prototype._onCancel=yt,e.prototype._setOnCancel=gt,e.prototype._attachCancellationCallback=mt,e.prototype._captureStackTrace=bt,e.prototype._attachExtraTrace=Ct,e.prototype._dereferenceTrace=wt,e.prototype._clearCancellationData=Et,e.prototype._propagateFrom=kt var I=St function L(){var t=this._boundTo return void 0!==t&&t instanceof e?t.isFulfilled()?t.value():void 0:t}function N(){this._trace=new z(this._peekContext())}function U(t,e){if(f(t)){var n=this._trace if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t) else if(!t.__stackCleaned__){var r=D(t) u.notEnumerableProp(t,"stack",r.message+"\n"+r.stack.join("\n")),u.notEnumerableProp(t,"__stackCleaned__",!0)}}}function B(t,n,r){if(Mt.warnings){var i,o=new l(t) if(n)r._attachExtraTrace(o) else if(Mt.longStackTraces&&(i=e._peekContext()))i.attachExtraTrace(o) else{var a=D(o) o.stack=a.message+"\n"+a.stack.join("\n")}R("warning",o)||V(o,"",!0)}}function H(t){for(var e=[],n=0;n0?function(t){for(var e=t.stack.replace(/\s+$/g,"").split("\n"),n=0;n0&&"SyntaxError"!=t.name&&(e=e.slice(n)),e}(t):[" (No stack trace)"],{message:n,stack:"SyntaxError"==t.name?e:H(e)}}function V(t,e,n){if("undefined"!=typeof console){var i if(u.isObject(t)){var o=t.stack i=e+y(o,t)}else i=e+String(t) "function"==typeof a?a(i,n):"function"!=typeof console.log&&"object"!==r(console.log)||console.log(i)}}function Q(t,e,n,r){var i=!1 try{"function"==typeof e&&(i=!0,"rejectionHandled"===t?e(r):e(n,r))}catch(t){c.throwLater(t)}"unhandledRejection"===t?R(t,n,r)||i||V(n,"Unhandled rejection "):R(t,r)}function q(t){var e if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]" else{e=t&&"function"==typeof t.toString?t.toString():u.toString(t) if(/\[object [a-zA-Z0-9$_]+\]/.test(e))try{e=JSON.stringify(t)}catch(t){}0===e.length&&(e="(empty array)")}return"(<"+It(e)+">, no stack trace)"}function M(){return"function"==typeof qt}var G=Lt,W=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/ function $(t){var e=t.match(W) if(e)return{fileName:e[1],line:parseInt(e[2],10)}}function z(t){this._parent=t,this._promisesCreated=0 var e=this._length=1+(void 0===t?0:t._length) qt(this,z),e>32&&this.uncycle()}function X(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():q(e)}function K(t){return h.test(t)}function Qt(t,e){return"string"==typeof t?t:"object"!==r(e)&&"function"!=typeof e||void 0===e.name||void 0===e.message?q(e):e.toString()}u.inherits(z,Error),n.CapturedTrace=z,z.prototype.uncycle=Nt,z.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle() for(var e=D(t),n=e.message,r=[e.stack],i=this;void 0!==i;)r.push(H(i.stack.split("\n"))),i=i._parent At(r),Ot(r),u.notEnumerableProp(t,"stack",Rt(n,r)),u.notEnumerableProp(t,"__stackCleaned__",!0)}} var qt=function(){var t=/^\s*at\s*/,e=X if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit+=6,v=t,y=e var n=Error.captureStackTrace return G=K,function(t,e){Error.stackTraceLimit+=6,n(t,e),Error.stackTraceLimit-=6}}var r,i=new Error if("string"==typeof i.stack&&i.stack.split("\n")[0].indexOf("stackDetection@")>=0)return v=/@/,y=e,g=!0,Ut try{throw new Error}catch(t){r="stack"in t}return"stack"in i||!r||"number"!=typeof Error.stackTraceLimit?(y=Qt,null):(v=t,y=e,Bt)}() "undefined"!=typeof console&&void 0!==console.warn&&(a=Ht,u.isNode&&process.stderr.isTTY?a=Dt:u.isNode||"string"!=typeof(new Error).stack||(a=Vt)) var Mt={warnings:b,longStackTraces:!1,cancellation:!1,monitoring:!1} return C&&e.longStackTraces(),{longStackTraces:function(){return Mt.longStackTraces},warnings:function(){return Mt.warnings},cancellation:function(){return Mt.cancellation},monitoring:function(){return Mt.monitoring},propagateFromFunction:function(){return I},boundValueFunction:function(){return L},checkForgottenReturns:function(t,e,n,r,i){if(void 0===t&&null!==e&&w){if(void 0!==i&&i._returnedNonUndefined())return if(0==(65535&r._bitField))return n&&(n+=" ") var o="",a="" if(e._trace){for(var s=e._trace.stack.split("\n"),c=H(s),l=c.length-1;l>=0;--l){var u=c[l] if(!_.test(u)){var p=u.match(d) p&&(o="at "+p[1]+":"+p[2]+":"+p[3]+" ") break}}if(c.length>0){var f=c[0] for(l=0;l0&&(a="\n"+s[l-1]) break}}}var h="a promise was created in a "+n+"handler "+o+"but was not returned from it, see http://goo.gl/rRqMUw"+a r._warn(h,!0,e)}},setBounds:function(t,e){if(M()){for(var n,r,i=t.stack.split("\n"),o=e.stack.split("\n"),a=-1,s=-1,c=0;c=s||(G=function(t){if(h.test(t))return!0 var e=$(t) return!!(e&&e.fileName===n&&a<=e.line&&e.line<=s)})}},warn:B,deprecated:function(t,e){var n=t+" is deprecated and will be removed in a future version." return e&&(n+=" Use "+e+" instead."),B(n)},CapturedTrace:z,fireDomEvent:T,fireGlobalEvent:S}}}function qt(){return this.value}function Mt(){throw this.reason}function Gt(t){return this._then(Mt,void 0,void 0,{reason:t},void 0)}function Wt(t){if(arguments.length<=1)return this._then(void 0,Mt,void 0,{reason:t},void 0) var e=arguments[1],n=function(){throw e} return this.caught(t,n)}function $t(t){t.prototype.return=t.prototype.thenReturn=function(e){return e instanceof t&&e.suppressUnhandledRejections(),this._then(qt,void 0,void 0,{value:e},void 0)},t.prototype.throw=t.prototype.thenThrow=Gt,t.prototype.catchThrow=Wt,t.prototype.catchReturn=function(e){if(arguments.length<=1)return e instanceof t&&e.suppressUnhandledRejections(),this._then(void 0,qt,void 0,{value:e},void 0) var n=arguments[1] n instanceof t&&n.suppressUnhandledRejections() var r=function(){return n} return this.caught(e,r)}}function zt(t,e,n){"use strict" e.exports=$t}function Xt(t,e,n){"use strict" var r,i,o=t("./es5"),a=o.freeze,s=t("./util"),c=s.inherits,l=s.notEnumerableProp function u(t,e){function n(r){if(!(this instanceof n))return new n(r) l(this,"message","string"==typeof r?r:e),l(this,"name",t),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this)}return c(n,Error),n}var p=u("Warning","warning"),f=u("CancellationError","cancellation error"),h=u("TimeoutError","timeout error"),_=u("AggregateError","aggregate error") try{r=TypeError,i=RangeError}catch(t){r=u("TypeError","type error"),i=u("RangeError","range error")}for(var d="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),v=0;v1?t.cancelPromise._reject(e):t.cancelPromise._cancel(),t.cancelPromise=null,!0)}function se(t,e,n,r){return"function"!=typeof t?this.then():this._then(n,r,void 0,new re(this,e,t),void 0)}function ce(){ae(this.finallyHandler)}function le(t,e,n){"use strict" e.exports=function(e,n,r){var i=t("./util"),o=e.CancellationError,a=i.errorObj,s=t("./catch_filter")(r) function c(){return u.call(this,this.promise._target()._settledValue())}function l(t){if(!ae(this,t))return a.e=t,a}function u(t){var i=this.promise,s=this.handler if(!this.called){this.called=!0 var u=this.isFinallyHandler()?s.call(i._boundValue()):s.call(i._boundValue(),t) if(u===r)return u if(void 0!==u){i._setReturnedNonUndefined() var p=n(u,i) if(p instanceof e){if(null!=this.cancelPromise){if(p._isCancelled()){var f=new o("late cancellation observer") return i._attachExtraTrace(f),a.e=f,a}p.isPending()&&p._attachCancellationCallback(new oe(this))}return p._then(c,l,void 0,this,void 0)}}}return i.isRejected()?(ae(this),a.e=t,a):(ae(this),t)}return re.prototype.isFinallyHandler=ie,oe.prototype._resultCancelled=ce,e.prototype._passThrough=se,e.prototype.lastly=e.prototype.finally=function(t){return this._passThrough(t,0,u,u)},e.prototype.tap=function(t){return this._passThrough(t,1,u)},e.prototype.tapCatch=function(t){var n=arguments.length if(1===n)return this._passThrough(t,1,void 0,u) var r,o=new Array(n-1),a=0 for(r=0;r0&&"function"==typeof arguments[e]&&(t=arguments[e]) var r=[].slice.call(arguments) t&&r.pop() var i=new n(r).promise() return void 0!==t?i.spread(t):i}}}function de(t,e,n){"use strict" e.exports=function(e,n,r,i,o){var a=t("./util"),s=a.tryCatch e.method=function(t){if("function"!=typeof t)throw new e.TypeError("expecting a function but got "+a.classString(t)) return function(){var r=new e(n) r._captureStackTrace(),r._pushContext() var i=s(t).apply(this,arguments),a=r._popContext() return o.checkForgottenReturns(i,a,"Promise.method",r),r._resolveFromSyncValue(i),r}},e.attempt=e.try=function(t){if("function"!=typeof t)return i("expecting a function but got "+a.classString(t)) var r,c=new e(n) if(c._captureStackTrace(),c._pushContext(),arguments.length>1){o.deprecated("calling Promise.try with more than 1 argument") var l=arguments[1],u=arguments[2] r=a.isArray(l)?s(t).apply(u,l):s(t).call(u,l)}else r=s(t)() var p=c._popContext() return o.checkForgottenReturns(r,p,"Promise.try",c),c._resolveFromSyncValue(r),c},e.prototype._resolveFromSyncValue=function(t){t===a.errorObj?this._rejectCallback(t.e,!1):this._resolveCallback(t,!0)}}}function ve(t,e,n){"use strict" var r=t("./util"),i=r.maybeWrapAsError,o=t("./errors").OperationalError,a=t("./es5") var s=/^(?:name|message|stack|cause)$/ function c(t){var e if(function(t){return t instanceof Error&&a.getPrototypeOf(t)===Error.prototype}(t)){(e=new o(t)).name=t.name,e.message=t.message,e.stack=t.stack for(var n=a.keys(t),i=0;i0}function Ae(){this._bitField=-65537&this._bitField}function Ie(){this._bitField=65536|this._bitField,this._fireEvent("promiseCancelled",this)}function Le(){this._bitField=8388608|this._bitField}function Ne(t){return this[4*t-4+2]}function Ue(t){return this[4*t-4+0]}function Be(t){return this[4*t-4+1]}function He(){}function De(t,e){this._addCallbacks(void 0,void 0,e,t,null)}function Ve(){for(var t=this;t._isFollowing();)t=t._followee() return t}function Qe(){return this._rejectionHandler0}function qe(t){this._rejectionHandler0=t}function Me(t){this._settlePromise(t.promise,t.handler,t.receiver,t.value)}function Ge(t,e,n){var r=this._promise0,i=this._receiverAt(0) this._promise0=void 0,this._receiver0=void 0,this._settlePromise(r,t,i,e)}function We(t){var e=4*t-4 this[e+2]=this[e+3]=this[e+0]=this[e+1]=void 0}function $e(t,e){for(var n=1;n0){if(0!=(16842752&t)){var n=this._fulfillmentHandler0 this._settlePromise0(this._rejectionHandler0,n,t),this._rejectPromises(e,n)}else{var r=this._rejectionHandler0 this._settlePromise0(this._fulfillmentHandler0,r,t),this._fulfillPromises(e,r)}this._setLength(0)}this._clearCancellationData()}function Ke(){var t=this._bitField return 0!=(33554432&t)?this._rejectionHandler0:0!=(16777216&t)?this._fulfillmentHandler0:void 0}function Je(t){this.promise._resolveCallback(t)}function Ye(t){this.promise._rejectCallback(t,!1)}function Ze(){}function tn(t,e,n){"use strict" e.exports=function(){var n,r=function(){return new f("circular promise resolution chain\n\n See http://goo.gl/MqrFmX\n")},i=function(){return new F.PromiseInspection(this._target())},o=function(t){return F.reject(new f(t))},a={},s=t("./util") n=s.isNode?ge:me,s.notEnumerableProp(F,"_getDomain",n) var c=t("./es5"),l=t("./async"),u=new l c.defineProperty(F,"_async",{value:u}) var p=t("./errors"),f=F.TypeError=p.TypeError F.RangeError=p.RangeError var h=F.CancellationError=p.CancellationError F.TimeoutError=p.TimeoutError,F.OperationalError=p.OperationalError,F.RejectionError=p.OperationalError,F.AggregateError=p.AggregateError var _=be,d={},v={},y=t("./thenables")(F,_),g=t("./promise_array")(F,_,y,o,ye),m=t("./context")(F),b=(m.create,t("./debuggability")(F,m)),C=(b.CapturedTrace,t("./finally")(F,y,v)),w=t("./catch_filter")(v),E=t("./nodeback"),k=s.errorObj,j=s.tryCatch function F(t){t!==_&&function(t,e){if(null==t||t.constructor!==F)throw new f("the promise constructor cannot be invoked directly\n\n See http://goo.gl/MqrFmX\n") if("function"!=typeof e)throw new f("expecting a function but got "+s.classString(e))}(this,t),this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._resolveFromExecutor(t),this._promiseCreated(),this._fireEvent("promiseCreated",this)}function T(t){var e=new F(_) e._fulfillmentHandler0=t,e._rejectionHandler0=t,e._promise0=t,e._receiver0=t}return F.prototype.toString=Ce,F.prototype.caught=F.prototype.catch=function(t){var e=arguments.length if(e>1){var n,r=new Array(e-1),i=0 for(n=0;n0&&"function"!=typeof t&&"function"!=typeof e){var n=".then() only accepts functions but was passed: "+s.classString(t) arguments.length>1&&(n+=", "+s.classString(e)),this._warn(n)}return this._then(t,e,void 0,void 0,void 0)},F.prototype.done=we,F.prototype.spread=function(t){return"function"!=typeof t?o("expecting a function but got "+s.classString(t)):this.all()._then(t,void 0,void 0,d,void 0)},F.prototype.toJSON=Ee,F.prototype.all=function(){return arguments.length>0&&this._warn(".all() was passed arguments but it does not take any"),new g(this).promise()},F.prototype.error=function(t){return this.caught(s.originatesFromRejection,t)},F.getNewLibraryCopy=e.exports,F.is=function(t){return t instanceof F},F.fromNode=F.fromCallback=function(t){var e=new F(_) e._captureStackTrace() var n=arguments.length>1&&!!Object(arguments[1]).multiArgs,r=j(t)(E(e,n)) return r===k&&e._rejectCallback(r.e,!0),e._isFateSealed()||e._setAsyncGuaranteed(),e},F.all=function(t){return new g(t).promise()},F.cast=function(t){var e=y(t) return e instanceof F||((e=new F(_))._captureStackTrace(),e._setFulfilled(),e._rejectionHandler0=t),e},F.resolve=F.fulfilled=F.cast,F.reject=F.rejected=function(t){var e=new F(_) return e._captureStackTrace(),e._rejectCallback(t,!0),e},F.setScheduler=function(t){if("function"!=typeof t)throw new f("expecting a function but got "+s.classString(t)) return u.setScheduler(t)},F.prototype._then=function(t,e,r,i,o){var a=void 0!==o,c=a?o:new F(_),l=this._target(),p=l._bitField a||(c._propagateFrom(this,3),c._captureStackTrace(),void 0===i&&0!=(2097152&this._bitField)&&(i=0!=(50397184&p)?this._boundValue():l===this?void 0:this._boundTo),this._fireEvent("promiseChained",this,c)) var f=n() if(0!=(50397184&p)){var d,v,y=l._settlePromiseCtx 0!=(33554432&p)?(v=l._rejectionHandler0,d=t):0!=(16777216&p)?(v=l._fulfillmentHandler0,d=e,l._unsetRejectionIsUnhandled()):(y=l._settlePromiseLateCancellationObserver,v=new h("late cancellation observer"),l._attachExtraTrace(v),d=e),u.invoke(y,l,{handler:null===f?d:"function"==typeof d&&s.domainBind(f,d),promise:c,receiver:i,value:v})}else l._addCallbacks(t,e,c,i,f) return c},F.prototype._length=ke,F.prototype._isFateSealed=je,F.prototype._isFollowing=Fe,F.prototype._setLength=Te,F.prototype._setFulfilled=Pe,F.prototype._setRejected=Se,F.prototype._setFollowing=xe,F.prototype._setIsFinal=Re,F.prototype._isFinal=Oe,F.prototype._unsetCancelled=Ae,F.prototype._setCancelled=Ie,F.prototype._setWillBeCancelled=Le,F.prototype._setAsyncGuaranteed=function(){u.hasCustomScheduler()||(this._bitField=134217728|this._bitField)},F.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[4*t-4+3] if(e!==a)return void 0===e&&this._isBound()?this._boundValue():e},F.prototype._promiseAt=Ne,F.prototype._fulfillmentHandlerAt=Ue,F.prototype._rejectionHandlerAt=Be,F.prototype._boundValue=He,F.prototype._migrateCallback0=function(t){t._bitField var e=t._fulfillmentHandler0,n=t._rejectionHandler0,r=t._promise0,i=t._receiverAt(0) void 0===i&&(i=a),this._addCallbacks(e,n,r,i,null)},F.prototype._migrateCallbackAt=function(t,e){var n=t._fulfillmentHandlerAt(e),r=t._rejectionHandlerAt(e),i=t._promiseAt(e),o=t._receiverAt(e) void 0===o&&(o=a),this._addCallbacks(n,r,i,o,null)},F.prototype._addCallbacks=function(t,e,n,r,i){var o=this._length() if(o>=65531&&(o=0,this._setLength(0)),0===o)this._promise0=n,this._receiver0=r,"function"==typeof t&&(this._fulfillmentHandler0=null===i?t:s.domainBind(i,t)),"function"==typeof e&&(this._rejectionHandler0=null===i?e:s.domainBind(i,e)) else{var a=4*o-4 this[a+2]=n,this[a+3]=r,"function"==typeof t&&(this[a+0]=null===i?t:s.domainBind(i,t)),"function"==typeof e&&(this[a+1]=null===i?e:s.domainBind(i,e))}return this._setLength(o+1),o},F.prototype._proxy=De,F.prototype._resolveCallback=function(t,e){if(0==(117506048&this._bitField)){if(t===this)return this._rejectCallback(r(),!1) var n=y(t,this) if(!(n instanceof F))return this._fulfill(t) e&&this._propagateFrom(n,2) var i=n._target() if(i!==this){var o=i._bitField if(0==(50397184&o)){var a=this._length() a>0&&i._migrateCallback0(this) for(var s=1;s>>16)){if(t===this){var n=r() return this._attachExtraTrace(n),this._reject(n)}this._setFulfilled(),this._rejectionHandler0=t,(65535&e)>0&&(0!=(134217728&e)?this._settlePromises():u.settlePromises(this),this._dereferenceTrace())}},F.prototype._reject=function(t){var e=this._bitField if(!((117506048&e)>>>16)){if(this._setRejected(),this._fulfillmentHandler0=t,this._isFinal())return u.fatalError(t,s.isNode);(65535&e)>0?u.settlePromises(this):this._ensurePossibleRejectionHandled()}},F.prototype._fulfillPromises=$e,F.prototype._rejectPromises=ze,F.prototype._settlePromises=Xe,F.prototype._settledValue=Ke,F.defer=F.pending=function(){return b.deprecated("Promise.defer","new Promise"),{promise:new F(_),resolve:Je,reject:Ye}},s.notEnumerableProp(F,"_makeSelfResolutionError",r),t("./method")(F,_,y,o,b),t("./bind")(F,_,y,b),t("./cancel")(F,g,o,b),t("./direct_resolve")(F),t("./synchronous_inspection")(F),t("./join")(F,g,y,_,u,n),F.Promise=F,F.version="3.5.3",s.toFastProperties(F),s.toFastProperties(F.prototype),T({a:1}),T({b:2}),T({c:3}),T(1),T(Ze),T(void 0),T(!1),T(new F(_)),b.setBounds(l.firstLineError,s.lastLineError),F}}function en(t){switch(t){case-2:return[] case-3:return{} case-6:return new Map}}function nn(){return this._length}function rn(){return this._promise}function on(){return null===this._values}function an(t){this._values=null,this._promise._fulfill(t)}function sn(){!this._isResolved()&&this._promise._isCancellable()&&(this._values=null,this._promise._cancel())}function cn(t){this._values=null,this._promise._rejectCallback(t,!1)}function ln(t,e){return this._values[e]=t,++this._totalResolved>=this._length&&(this._resolve(this._values),!0)}function un(){return this._cancel(),!0}function pn(t){return this._totalResolved++,this._reject(t),!0}function fn(){return!0}function hn(t){return t}function _n(t,e,n){"use strict" e.exports=function(e,n,r,i,o){var a=t("./util") a.isArray function s(t){var r=this._promise=new e(n) t instanceof e&&r._propagateFrom(t,3),r._setOnCancel(this),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}return a.inherits(s,o),s.prototype.length=nn,s.prototype.promise=rn,s.prototype._init=function t(n,o){var s=r(this._values,this._promise) if(s instanceof e){var c=(s=s._target())._bitField if(this._values=s,0==(50397184&c))return this._promise._setAsyncGuaranteed(),s._then(t,this._reject,void 0,this,o) if(0==(33554432&c))return 0!=(16777216&c)?this._reject(s._reason()):this._cancel() s=s._value()}if(null!==(s=a.asArray(s)))0!==s.length?this._iterate(s):-5===o?this._resolveEmptyArray():this._resolve(en(o)) else{var l=i("expecting an array or an iterable object but got "+a.classString(s)).reason() this._promise._rejectCallback(l,!1)}},s.prototype._iterate=function(t){var n=this.getActualLength(t.length) this._length=n,this._values=this.shouldCopyValues()?new Array(n):this._values for(var i=this._promise,o=!1,a=null,s=0;s10||t[0]>0}!function(e){if("object"==(void 0===t?"undefined":r(t))&&void 0!==n)n.exports=e() else if("function"==typeof define&&define.amd)define([],e) else{var i "undefined"!=typeof window?i=window:"undefined"!=typeof global?i=global:"undefined"!=typeof self&&(i=self),i.Promise=e()}}(function(){var t,e,n return i({1:[w,{"./queue":17,"./schedule":18,"./util":21}],2:[S,{}],3:[x,{"./promise":15}],4:[V,{"./util":21}],5:[Q,{"./es5":10,"./util":21}],6:[K,{}],7:[Qt,{"./errors":9,"./es5":10,"./util":21}],8:[zt,{}],9:[Xt,{"./es5":10,"./util":21}],10:[ne,{}],11:[le,{"./catch_filter":5,"./util":21}],12:[_e,{"./util":21}],13:[de,{"./util":21}],14:[ve,{"./errors":9,"./es5":10,"./util":21}],15:[tn,{"./async":1,"./bind":2,"./cancel":4,"./catch_filter":5,"./context":6,"./debuggability":7,"./direct_resolve":8,"./errors":9,"./es5":10,"./finally":11,"./join":12,"./method":13,"./nodeback":14,"./promise_array":16,"./synchronous_inspection":19,"./thenables":20,"./util":21}],16:[_n,{"./util":21}],17:[kn,{}],18:[Sn,{"./util":21}],19:[Gn,{}],20:[$n,{"./util":21}],21:[function(t,e,n){"use strict" var i=t("./es5"),o="undefined"==typeof navigator,a={e:{}},s,c="undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:void 0!==this?this:null function l(){try{var t=s return s=null,t.apply(this,arguments)}catch(t){return a.e=t,a}}function u(t){return s=t,l}var p=zn function f(t){return Xn(t)?new Error(tr(t)):t}function h(t,e,n){if(!i.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0 var r=Object.getOwnPropertyDescriptor(t,e) return null!=r?null==r.get&&null==r.set?r.value:n:void 0}function _(t,e,n){if(Xn(t))return t var r={value:n,configurable:!0,enumerable:!1,writable:!0} return i.defineProperty(t,e,r),t}var d=function(){var t=[Array.prototype,Object.prototype,Function.prototype],e=function(e){for(var n=0;n1,r=e.length>0&&!(1===e.length&&"constructor"===e[0]),o=v.test(t+"")&&i.names(t).length>0 if(n||r||o)return!0}return!1}catch(t){return!1}}function g(t){Yn.prototype=t var e=new Yn function n(){return r(e.foo)}return n(),n(),t}var m=/^[a-z$_][a-z$_0-9]*$/i function b(t){return m.test(t)}function C(t){try{_(t,"isOperational",!0)}catch(t){}}function w(t){return er(t)&&i.propertyIsWritable(t,"stack")}function E(t){if(w(t))return t try{throw new Error(tr(t))}catch(t){return t}}function k(t){return w(t)?t:new Error(tr(t))}var j="stack"in new Error?k:E function F(t,e,n){for(var r=i.names(t),o=0;o1?o-1:0),i=1;i=0;--r)n[r]!==e&&t.removeChild(n[r])},n.exports.bodyPromise=t(0)(function e(t){if(document.body)return t(document.body) requestAnimationFrame(function(){return e(t)})}),n.exports.origin="https://runkit.com"}) ,(function(n,e,t){function r(n){return function(n){if(Array.isArray(n)){for(var e=0,t=new Array(n.length);e0&&void 0!==arguments[0]?arguments[0]:d,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:v,t={next:0,pop:function(n){return[t[n],delete t[n]][0]}} return{create:function(){for(var e=arguments.length,r=new Array(e),o=0;o2?t-2:0),u=2;u0;){var s=e[n] e[n]=[],s.forEach(c)}r[n]=function(t){return t(i)}}}}}) ,(function(t,e,n){function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=[],r=!0,o=!1,i=void 0 try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{r||null==c.return||c.return()}finally{if(o)throw i}}return n}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}function o(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e2?n-2:0),o=2;o2?o-2:0),a=2;a=0||(a[r]=e[r]) return a}(e,t) if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e) for(n=0;n=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function c(e){for(var t=1;t2&&void 0!==arguments[2]?arguments[2]:O return!!n&&!console.error("The ".concat(e,' "').concat(a(r),'" has been deprecated. Please use ')+'"'.concat(a(n.replacement),'" instead. Find out more at ')+"".concat(n.reference))} function S(e){return[e.name,e]}function w(e,t){var r=a(t,2),n=r[0],o=r[1] return e[n]=o,e}var P={type:"object",properties:Object.assign.apply(Object,n(h.filter(function(e){return!e.deprecated}).map(function(e){return i({},e.name,e.schema)}))),required:h.map(function(e){return e.name}),additionalProperties:!1},A={$ref:"#/definitions/ExistingEmbedUUID"},x=function(e){return g.filter(function(t){return t.generate[e]}).map(function(t){var r,n=t.name,a=t.deprecated,u=t.schema return i(r={name:"".concat(e).concat(f(n))},"".concat(e,"terOf"),n),i(r,"deprecated",a&&function(e,t){var r=t.replacement,n=o(t,["replacement"]) return c({replacement:"".concat(e).concat(f(r))},n)}(e,a)),i(r,"parameterSchemas","get"===e?[A]:[A,u]),r})},E=x("set"),D=x("get"),I=s(p.methods).map(function(e){return e.static?e:(r=(t=e).parameterSchemas,c({},o(t,["parameterSchemas"]),{parameterSchemas:[A].concat(n(r))})) var t,r}) r.exports={events:y,methods:[].concat(n(E),n(D),n(I)),properties:g,initializationProperties:h,initializationPropertiesSchema:P,toDefaultProperties:function(e){return h.map(S).filter(function(t){var r=a(t,2),n=r[0],o=r[1] return!o.deprecated||u.call(e,n)&&!j("property",o)}).map(function(t){var r=a(t,2),n=r[0],o=r[1] return[n,void 0!==e[n]?e[n]:o.default]}).reduce(w,{})},deprecationWarning:j}}) ,(function(r,t,e){function n(r,t,e){return t in r?Object.defineProperty(r,t,{value:e,enumerable:!0,configurable:!0,writable:!0}):r[t]=e,r}function i(r,t){return function(r){if(Array.isArray(r))return r}(r)||function(r,t){var e=[],n=!0,i=!1,a=void 0 try{for(var u,o=r[Symbol.iterator]();!(n=(u=o.next()).done)&&(e.push(u.value),!t||e.length!==t);n=!0);}catch(r){i=!0,a=r}finally{try{n||null==o.return||o.return()}finally{if(i)throw a}}return e}(r,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance")}()}var a=t(0),u=a.deprecationWarning,o=a.events,f=a.initializationProperties,c=Array.prototype.filter function l(r){return"".concat(r.toLowerCase())}function s(r){return"-".concat(r.toLowerCase())}var p=function(r){return"data-".concat(r.replace(/^(UI|HTML|XML|[A-Z])/g,l).replace(/[A-Z]/g,s))},v={} function y(r){var t=r.name return/^data-env-.*/.test(t)}function h(r){var t=r.name,e=r.value return[t.replace("data-env-","").toLowerCase(),e]}function m(r){var t=i(r,2) return{name:t[0],value:t[1]}}function d(r){var t=i(r,2) t[0] return t[1]!==v}function g(r,t){var e=i(t,2),a=e[0],u=e[1] return Object.assign(r,n({},a,u))}function b(r){return r.scalar}function w(r){var t=i(r,2) t[0] return t[1]!==v}function O(r,t){var e=i(t,2),a=e[0],u=e[1] return Object.assign(r,n({},a,u))}function T(r,t){var e=r.datasetAttribute,n=r.deprecatedDatasetAttribute,i=n?u(n):v i!==v&&console.error("".concat(n," is deprecated, use ")+"".concat(e," instead.")) var a=u(e) return a===v?i:a function u(r){if(!t.hasAttribute(r))return v var e=t.getAttribute(r) return function(){var r return(r=window)[e].apply(r,arguments)}}}function A(r,t){var e=r.name,n=r.schema,i=p(e) return!t.hasAttribute(i)||u("attribute",r,p)?v:function(r,t,e){if("string"===r.type||"#/definitions/SemVerRange"===r.$ref||"#/definitions/CSSLengthPixels"===r.$ref)return e if("null"===r.type)return function(r,t,e){if(""===e)return null throw TypeError("".concat(t," must be null (empty string)."))}(0,t,e) if("boolean"===r.type)return function(r,t,e){if(void 0===e)return r.default if("true"===e)return!0 if("false"===e)return!1 throw TypeError("".concat(t,' must be either "true" or "false".'))}(r,t,e) if("integer"===r.type)return function(r,t,e){var n=parseFloat(e) if(n!=n||n!==Math.floor(n))throw TypeError("".concat(t," must be an integer.")) return n}(0,t,e) if(r.oneOf){var n=r.oneOf.map(function(r){return function(){return S(r,t,e)}}).map(E),i=(n.filter(L),n.length) if(i.length<0)throw n[0][1] if(i.length>1)throw TypeError("".concat(t," matched to many valid types.")) return n[0][1]}throw Error("DONT KNOW "+r.type)}(n,e,t.getAttribute(i))}e.exports=function(r){var t=c.call(r.attributes,y).map(h).map(m),e=o.map(function(t){return[t.handlerName,T(t,r)]}).filter(d).reduce(g,{}),n=Object.assign({},e,{environment:t}) return f.filter(b).map(function(t){return[t.name,A(t,r)]}).filter(w).reduce(O,n)} var E=function(r){try{return[!0,r()]}catch(r){return[!1,r]}} function L(r){var t=i(r,2),e=t[0] t[1] return e}function S(r,t,e){if(r.type==="string"||r.$ref==="#/definitions/SemVerRange"||r.$ref==="#/definitions/CSSLengthPixels")return e if(r.type==="null")return C(r,t,e) if(r.type==="boolean")return j(r,t,e) if(r.type==="integer")return N(r,t,e) function n(r){return function(){return S(r,t,e)}}if(!!r.oneOf){var i=r.oneOf.map(n).map(E) var a=i.filter(L) var u=i.length if(u.length<0)throw i[0][1] if(u.length>1)throw TypeError("".concat(t," matched to many valid types.")) return i[0][1]}throw Error("DONT KNOW "+r.type)}function C(r,t,e){if(e==="")return null throw TypeError("".concat(t," must be null (empty string)."))}function N(r,t,e){var n=parseFloat(e) if(n!==n||n!==Math.floor(n))throw TypeError("".concat(t," must be an integer.")) return n}function j(r,t,e){if(e===void 0)return r.default if(e==="true")return true if(e==="false")return false throw TypeError("".concat(t,' must be either "true" or "false".'))}}) ,function(exports, require, module) { module.exports = { "events": { "evaluate": { "description": "Called when a cell is evaluated." }, "load": { "description": "Called when the Embed has fully loaded. The function will be passed a reference to the Embed.", "deprecatedDatasetKey": "load-callback", "dataSchema": { "type": "NotebookEmbed" } }, "resize": { "description": "Called when the embed cell is resized.", "dataSchema": { "type": "object", "properties": { "height": { "type": "integer", "minimum": 0 } }, "additionalProperties": false } }, "save": { "description": "Called when the embed is saved." }, "URLChanged": { "description": "Called when the shareable URL or endpoint URL changes.", "dataSchema": { "type": "object", "properties": { "shareableURL": { "type": "string" }, "endpointURL": { "type": "string" } }, "additionalProperties": false } } }, "properties": { "autoGrow": { "schema": { "type": "boolean" }, "default": true, "generate": ["get", "set", "init"], "disabled": true }, "endpointURL": { "description": "In Endpoint mode, this is the url that will run this code when visited. See https://runkit.com/docs/endpoint.", "schema": { "type": "string" }, "generate": ["get"] }, "env": { "deprecated": { "replacement": "environment", "reference": "https://runkit.com/docs/embed" }, "schema": { "type": "array", "items": { "type": "string" } }, "generate": ["init"] }, "environment": { "description": "Environment variables for the execution environment. Available under `process.env`.", "schema": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string" }, "value": { "type": "string" } }, "additionalProperties": false } }, "default": [], "generate": ["get", "set", "init"] }, "evaluateOnLoad": { "description": "Evaluate the Embed when it finishes loading.", "schema": { "type": "boolean" }, "default": false, "generate": ["get", "init"] }, "gutterStyle": { "description": "Where the line numbers should appear.", "schema": { "type": "string", "enum": ["inside", "none", "outside"] }, "default": "outside", "generate": ["get", "set", "init"] }, "hidesActionButton": { "description": "Hides the \"▶ Run\" button. In Endpoint mode, Hides the endpoint URL.", "schema": { "type": "boolean" }, "default": false, "generate": ["get", "set", "init"] }, "hidesEndpointLogs": { "description": "In Endpoint mode, Hides the logs that would appear when hitting the Endpoint. See https://runkit.com/docs/endpoint.", "schema": { "type": "boolean" }, "default": false, "generate": ["get", "set", "init"] }, "hostURL": { "private": true, "schema": { "type": "string" }, "default": "", "generate": ["init"] }, "minHeight": { "description": "Minimum height of the embed in pixels. E.g. \"100px\".", "schema": { "$ref": "#/definitions/CSSLengthPixels" }, "default": "73px", "generate": ["get", "set", "init"] }, "mode": { "description": "When in default mode RunKit Embeds behave like a regular notebook and display outputs after each evaluation. When the Embed is in endpoint mode the outputs are replaced by endpoint logs and a URL is provided to run the Embed code. See https://runkit.com/docs/endpoint.", "schema": { "type": "string", "enum": ["endpoint", "default"] }, "default": "default", "generate": ["get", "set", "init"] }, "nodeVersion": { "description": "A semver range that the node engine should satisfy, e.g. \"4.0.x\" or \"> 6.9.2\".", "schema": { "$ref": "#/definitions/SemVerRange" }, "default": "10.x.x", "generate": ["get", "set", "init"] }, "source": { "description": "The source code of the Embed.", "schema": { "type": "string" }, "default": "", "generate": ["get", "set", "init"] }, "packageTimestamp": { "description": "The timestamp in UTC milliseconds to recreate the state of package availability. No packages published to npm after this time are available in this embed. Useful for reproducing bugs, or guaranteeing dependency versions. By default the timestamp is set to the time the embed is created.", "schema": { "oneOf": [ { "type": "integer", "minimum": 0 }, { "type": "null" } ] }, "default": null, "generate": ["get", "set", "init"] }, "preamble": { "description": "Code in the preamble field will not be displayed in the embed, but will be executed before running the code in the embed. For example, libraries that use RunKit for documentation often require their package in the preamble to avoid clutter in the embed code.", "schema": { "type": "string" }, "default": "", "generate": ["get", "set", "init"] }, "readOnly": { "schema": { "type": "boolean" }, "default": false, "generate": ["get", "set", "init"] }, "shareableURL": { "description": "A URL that can be used to share the Embed with other users.", "schema": { "type": "string" }, "generate": ["get"] }, "requirePath": { "description": "A path that can be used to require this Embed as a module in other Embeds or RunKit Notebook.", "schema": { "type": "string" }, "generate": ["get"] }, "styles": { "deprecated": { "replacement": "theme", "reference": "https://runkit.com/docs/embed" }, "schema": { "oneOf": [ { "type": "object" }, { "type": "null" } ] }, "default": null, "generate": ["get", "set", "init"] }, "syntaxTheme": { "deprecated": { "replacement": "theme", "reference": "https://runkit.com/docs/embed" }, "schema": { "type": "string" }, "default": "runkit-light", "generate": ["get", "set", "init"] }, "tabSize": { "schema": { "type": "integer", "minimum": 0 }, "default": 4, "generate": ["get", "set", "init"] }, "theme": { "schema": { "type": "string" }, "private": true, "default": "runkit-light", "generate": ["get", "set", "init"] }, "title": { "description": "The title of the RunKit Notebook when it is saved on RunKit.", "schema": { "type": "string" }, "default": "", "generate": ["get", "set", "init"] }, "UITheme": { "deprecated": { "replacement": "theme", "reference": "https://runkit.com/docs/embed" }, "schema": { "type": "string" }, "default": "runkit-light", "generate": ["get", "set", "init"] }, "UIStyles": { "deprecated": { "replacement": "theme", "reference": "https://runkit.com/docs/embed" }, "schema": { "oneOf": [ { "type": "object", "additionalProperties": false }, { "type": "null" } ] }, "default": null, "generate": ["get", "set", "init"] } }, "methods": { "create": { "static": true, "parameterSchemas": [ { "$ref": "#/definitions/NonExistingEmbedUUID" }, { "type": "string" }, { "$ref": "#/definitions/InitializationProperties" } ] }, "destroy": { "parameterSchemas": [] }, "evaluate": { "description": "Force the Embed to evaluate.", "parameterSchemas": [] }, "getMaximumAvailableNodeVersionInRange": { "static": true, "parameterSchemas": [ { "$ref": "#/definitions/SemVerRange" } ] } } } },(function(e,n,t){var r=n(1),o=n(0).onDOMContentLoaded function a(e){return new r(e)}function c(e){var n=e.textContent||e.innerText||"" if(""===n)return!1 var t=n.replace(/\r\n/g,"\n").replace(/\r/g,"\n").replace(/^(( )*\n)+/,"").split("\n"),r=t.length>0&&t[0],o=r?r.length-r.replace(/^\s+/,"").length:0,a=o>0&&new RegExp("^ {".concat(o,"}")) return t.map(function(e){return a?e.replace(a,""):e}).join("\n").trim()}t.exports={createNotebook:a,sourceFromElement:c,createFromScriptTag:function(e){o(function(){var t=e.getAttribute("data-element-id") if(t){var r=document.getElementById(t),o=c(r),i=Object.assign({},n(2)(e),{element:r,clearParentContents:!0},!1!==o&&{source:o}) return a(i)}})},version:"2.0.0"}}) ,(function(n,i){window.RunKit=window.RunKit||i(2),window.Tonic=window.Tonic||window.RunKit,window.RunKit.createFromScriptTag(i(1).enclosingScript),window.RunKit.getMaximumAvailableNodeVersionInRange=function(n){return new Promise(function(o){i(0).then(function(i){return o(i.invoke("getMaximumAvailableNodeVersionInRange",n))})})},window.RunKit.__nodeShouldEvaluateOnLoad=function(){return!0}}) ,(function(e,r,n){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}var u=r(1),a=r(0),c=Object.prototype.hasOwnProperty,i=[Error,ReferenceError,SyntaxError,TypeError],l={type:-1},f=function(e){return e()} function s(e,r,n,t,o){t.queue.length<=0&&a(function(){n({name:"invoke",invocations:t.queue.slice()}),t.queue=[]}) var c=t.nextUUID++ if(t.queue.push({UUID:c,oneWay:e,method:r,args:o}),!e)return new u(function(e,r){return t.callbacks[c]={resolve:e,reject:r}})}function y(e){return!v(e)}function v(e){if(!c.call(e,"value"))return!1 var r=e.value return null!==r&&"object"===t(r)&&"function"==typeof r.then}function p(e,r){try{if(!(r instanceof Error))return{UUID:e,error:l} var n=Object.getPrototypeOf(r).constructor return{UUID:e,error:{type:i.indexOf(n),message:r.message+""}}}catch(r){return{UUID:e,error:l}}}n.exports=function(e){var r=e.name,n=e.targetOrigin,t=e.targetWindow,u=e.methods,a=e.handle,l=function(e){return t.postMessage(function(e){for(var r=1;r1?r-1:0),t=1;t1?r-1:0),t=1;t0&&n({name:"results",results:e})},i=!0,l=!1,f=void 0 try{for(var s,m=function(){var e=s.value,r=e.UUID e.value.then(function(e){return[{UUID:r,value:e}]}).catch(function(e){return[p(r,e)]}).then(c)},b=u[Symbol.iterator]();!(i=(s=b.next()).done);i=!0)m()}catch(e){l=!0,f=e}finally{try{i||null==b.return||b.return()}finally{if(l)throw f}}c(a)}(r,u,l,b.invocations)}):void 0}}}) ,(function(t,e,n){var r,o,i=n.exports={} function u(){throw new Error("setTimeout has not been defined")}function c(){throw new Error("clearTimeout has not been defined")}function s(t){if(r===setTimeout)return setTimeout(t,0) if((r===u||!r)&&setTimeout)return r=setTimeout,setTimeout(t,0) try{return r(t,0)}catch(e){try{return r.call(null,t,0)}catch(e){return r.call(this,t,0)}}}!function(){try{r="function"==typeof setTimeout?setTimeout:u}catch(t){r=u}try{o="function"==typeof clearTimeout?clearTimeout:c}catch(t){o=c}}() var l,a=[],f=!1,h=-1 function m(){f&&l&&(f=!1,l.length?a=l.concat(a):h=-1,a.length&&p())}function p(){if(!f){var t=s(m) f=!0 for(var e=a.length;e;){for(l=a,a=[];++h1)for(var n=1;n { throw Error("Could not get global") })(); })())