quokka-atom
Advanced tools
Comparing version 1.0.17 to 1.0.18
@@ -1,1 +0,1 @@ | ||
module.exports=(function(e){function t(i){if(n[i])return n[i].exports;var s=n[i]={i:i,l:!1,exports:{}};return e[i].call(s.exports,s,s.exports,t),s.l=!0,s.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=16)})([(function(e,t){e.exports=require("path")}),(function(e,t,n){function i(e){function t(t){return p.apply(e,t)}function n(e,t){return this instanceof n?(m.apply(this,arguments),this):n.apply(Object.create(n.prototype),arguments)}function r(e,t){return this instanceof r?(y.apply(this,arguments),this):r.apply(Object.create(r.prototype),arguments)}function u(e,t,n,i){function r(e,t,n,i){return g(e,t,n,(function(a,c){!a||"EMFILE"!==a.code&&"ENFILE"!==a.code?("function"==typeof i&&i.apply(this,arguments),o()):s([r,[e,t,n,i]])}))}return"function"==typeof n&&(i=n,n=null),r(e,t,n,i)}a(e),e.gracefulify=i,e.FileReadStream=n,e.FileWriteStream=r,e.createReadStream=function(e,t){return new n(e,t)},e.createWriteStream=function(e,t){return new r(e,t)};var l=e.readFile;e.readFile=function(e,t,n){function i(e,t,n){return l(e,t,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?("function"==typeof n&&n.apply(this,arguments),o()):s([i,[e,t,n]])}))}return"function"==typeof t&&(n=t,t=null),i(e,t,n)};var f=e.writeFile;e.writeFile=function(e,t,n,i){function r(e,t,n,i){return f(e,t,n,(function(a){!a||"EMFILE"!==a.code&&"ENFILE"!==a.code?("function"==typeof i&&i.apply(this,arguments),o()):s([r,[e,t,n,i]])}))}return"function"==typeof n&&(i=n,n=null),r(e,t,n,i)};var d=e.appendFile;d&&(e.appendFile=function(e,t,n,i){function r(e,t,n,i){return d(e,t,n,(function(a){!a||"EMFILE"!==a.code&&"ENFILE"!==a.code?("function"==typeof i&&i.apply(this,arguments),o()):s([r,[e,t,n,i]])}))}return"function"==typeof n&&(i=n,n=null),r(e,t,n,i)});var p=e.readdir;if(e.readdir=function(e,n,i){var r=[e];return"function"!=typeof n?r.push(n):i=n,r.push((function(e,n){n&&n.sort&&n.sort(),!e||"EMFILE"!==e.code&&"ENFILE"!==e.code?("function"==typeof i&&i.apply(this,arguments),o()):s([t,[r]])})),t(r)},"v0.8"===process.version.substr(0,4)){var h=c(e);n=h.ReadStream,r=h.WriteStream}var m=e.ReadStream;n.prototype=Object.create(m.prototype),n.prototype.open=function(){var e=this;u(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))};var y=e.WriteStream;r.prototype=Object.create(y.prototype),r.prototype.open=function(){var e=this;u(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))},e.ReadStream=n,e.WriteStream=r;var g=e.open;return e.open=u,e}function s(e){f("ENQUEUE",e[0].name,e[1]),u.push(e)}function o(){var e=u.shift();e&&(f("RETRY",e[0].name,e[1]),e[0].apply(null,e[1]))}var r=n(5),a=n(19),c=n(21),u=[],l=n(23),f=function(){};l.debuglog&&(f=l.debuglog("gfs4")),e.exports=i(n(9)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&(e.exports=i(r)),e.exports.close=r.close=(function(e){return function(t,n){return e.call(r,t,(function(e){e||o(),"function"==typeof n&&n.apply(this,arguments)}))}})(r.close),e.exports.closeSync=r.closeSync=(function(e){return function(t){var n=e.apply(r,arguments);return o(),n}})(r.closeSync)}),(function(e,t,n){"use strict";t.fromCallback=function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise((t,n)=>{arguments[arguments.length]=((e,i)=>{if(e)return n(e);t(i)}),arguments.length++,e.apply(this,arguments)});e.apply(this,arguments)}),"name",{value:e.name})},t.fromPromise=function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then(e=>t(null,e),t)}),"name",{value:e.name})}}),(function(e,t,n){"use strict";const i=(0,n(2).fromCallback)(n(27)),s=n(28);e.exports={mkdirs:i,mkdirsSync:s,mkdirp:i,mkdirpSync:s,ensureDir:i,ensureDirSync:s}}),(function(e,t,n){"use strict";const i=n(2).fromPromise,s=n(8);e.exports={pathExists:i((function(e){return s.access(e).then(()=>!0).catch(()=>!1)})),pathExistsSync:s.existsSync}}),(function(e,t){e.exports=require("fs")}),(function(e,t,n){"use strict";const i=n(2).fromCallback,s=n(31);e.exports={remove:i(s),removeSync:s.sync}}),(function(e,t,n){"use strict";const i=n(2).fromCallback,s=n(33);e.exports={readJson:i(s.readFile),readJsonSync:s.readFileSync,writeJson:i(s.writeFile),writeJsonSync:s.writeFileSync}}),(function(e,t,n){const i=n(2).fromCallback,s=n(1),o=["access","appendFile","chmod","chown","close","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","link","lstat","mkdir","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"];"function"==typeof s.mkdtemp&&o.push("mkdtemp"),Object.keys(s).forEach(e=>{t[e]=s[e]}),o.forEach(e=>{t[e]=i(s[e])}),t.exists=function(e,t){return"function"==typeof t?s.exists(e,t):new Promise(t=>s.exists(e,t))},t.read=function(e,t,n,i,o,r){return"function"==typeof r?s.read(e,t,n,i,o,r):new Promise((r,a)=>{s.read(e,t,n,i,o,(e,t,n)=>{if(e)return a(e);r({bytesRead:t,buffer:n})})})},t.write=function(e,t,n,i,o,r){return"function"==typeof arguments[arguments.length-1]?s.write(e,t,n,i,o,r):"string"==typeof t?new Promise((o,r)=>{s.write(e,t,n,i,(e,t,n)=>{if(e)return r(e);o({bytesWritten:t,buffer:n})})}):new Promise((r,a)=>{s.write(e,t,n,i,o,(e,t,n)=>{if(e)return a(e);r({bytesWritten:t,buffer:n})})})}}),(function(e,t,n){"use strict";var i=n(5);e.exports=(function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)t={__proto__:e.__proto__};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t})(i)}),(function(e,t){e.exports=require("assert")}),(function(e,t,n){var i=n(1),s=n(0),o=n(26);e.exports=function(e,t,n,r){function a(e){if(M++,b)if(b instanceof RegExp){if(console.warn("Warning: fs-extra: Passing a RegExp filter is deprecated, use a function"),!b.test(e))return v(!0)}else if("function"==typeof b&&!b(e,t))return v(!0);return c(e)}function c(e){N++,(T?i.stat:i.lstat)(e,(function(t,n){if(t)return S(t);var i={name:e,mode:n.mode,mtime:n.mtime,atime:n.atime,stats:n};return n.isDirectory()?d(i):n.isFile()||n.isCharacterDevice()||n.isBlockDevice()?u(i):n.isSymbolicLink()?m(e):void 0}))}function u(e){var t=e.name.replace(w,E.replace("$","$$$$"));k(t,(function(n){n?l(e,t):C?f(t,(function(){l(e,t)})):O?S(Error(t+" already exists")):v()}))}function l(e,t){var n=i.createReadStream(e.name),s=i.createWriteStream(t,{mode:e.mode});n.on("error",S),s.on("error",S),x?x(n,s,e):s.on("open",(function(){n.pipe(s)})),s.once("close",(function(){i.chmod(t,e.mode,(function(n){if(n)return S(n);P?o.utimesMillis(t,e.atime,e.mtime,(function(e){return e?S(e):v()})):v()}))}))}function f(e,t){i.unlink(e,(function(e){return e?S(e):t()}))}function d(e){var t=e.name.replace(w,E.replace("$","$$$$"));k(t,(function(n){if(n)return p(e,t);h(e.name)}))}function p(e,t){i.mkdir(t,e.mode,(function(n){if(n)return S(n);i.chmod(t,e.mode,(function(t){if(t)return S(t);h(e.name)}))}))}function h(e){i.readdir(e,(function(t,n){return t?S(t):(n.forEach((function(t){a(s.join(e,t))})),v())}))}function m(e){var t=e.replace(w,E);i.readlink(e,(function(e,n){if(e)return S(e);y(n,t)}))}function y(e,t){T&&(e=s.resolve(_,e)),k(t,(function(n){if(n)return g(e,t);i.readlink(t,(function(n,i){return n?S(n):(T&&(i=s.resolve(_,i)),i===e?v():f(t,(function(){g(e,t)})))}))}))}function g(e,t){i.symlink(e,t,(function(e){return e?S(e):v()}))}function k(e,t){i.lstat(e,(function(e){return t(!!e&&"ENOENT"===e.code)}))}function S(e){if(!q&&void 0!==r)return q=!0,r(e)}function v(e){if(e||N--,L++,M===L&&0===N&&void 0!==r)return r(null)}r||(r=n,n={});var _=process.cwd(),w=s.resolve(_,e),E=s.resolve(_,t),b=n.filter,x=n.transform,C=n.overwrite;void 0===C&&(C=n.clobber),void 0===C&&(C=!0);var O=n.errorOnExist,T=n.dereference,P=!0===n.preserveTimestamps,M=0,L=0,N=0,q=!1;a(w)}}),(function(e,t){e.exports=require("os")}),(function(e,t,n){"use strict";function i(e){return(e=s.normalize(s.resolve(e)).split(s.sep)).length>0?e[0]:null}const s=n(0),o=/[<>:"|?*]/;e.exports={getRootPath:null,invalidWin32Path:function(e){const t=i(e);return e=e.replace(t,""),o.test(e)}}}),(function(e,t,n){e.exports={copySync:n(29)}}),(function(e,t){e.exports=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}}),(function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(0),s=n(17),o=n(12),r=300,a=3500,c=500,u=50,l="quokka";let f=0;class d{activate(e){var t=this;const i=this;this._$=e.atomViews.$,this._View=e.atomViews.View,this._statusBar=e.statusBar,this._Session=e.extendedCoreClient.Session,this._dmp=e.extendedCoreClient.dmp,this._CompositeDisposable=e.atom.CompositeDisposable,(this._disposables=new this._CompositeDisposable).add(atom.commands.add("atom-workspace",{"quokka:toggle-output":function(){return t.togglePanel()},"quokka:focus-output":function(){return t.togglePanel(!0)},"quokka:create-javascript-file":function(){return t._newFile("js")},"quokka:create-typescript-file":function(){return t._newFile("ts")},"quokka:stop-all":function(){return t._activeSessions.slice().forEach((function(e){return t._stop(e)}))}})),this._disposables.add(atom.commands.add("atom-text-editor",{"quokka:make-quokka-from-existing-file":function(e){i.makeQuokkaFromExistingFile(d._getEditor(e,this))},"quokka:stop-current":function(e){i.stopCurrent(d._getEditor(e,this))},"quokka:install-missing-package-only-for-quokka-file":function(e){i._installPackage(d._getEditor(e,this))},"quokka:install-missing-package-into-project":function(e){i._installPackage(d._getEditor(e,this),!0)}})),this._activeSessions=[],this._setupEnvironment(),(this._statusElement=this._$('<a tabindex="-1" style="outline:0;" />')).click((function(){return t.togglePanel()})),this._statusBar&&(this._statusBarTile=this._statusBar.addRightTile({item:this._statusElement[0],priority:-Infinity})),this._disposables.add({dispose:function(){i.stop(),i._panelView&&(i._panelView.hide(),i._panelView.deactivate()),i._statusBarTile&&i._statusBarTile.destroy()}}),this._panelView=new(n(46)(this._$,this._View,this._CompositeDisposable,this._dmp))({navigate:_.bind(this._navigate,this),installPackage:_.bind(this._installPackage,this),hasOpenedProject:atom.project.getPaths().length})}deactivate(){this._disposables.dispose()}togglePanel(e){e?this._panelView.focusPanel():this._panelView.togglePanel()}makeQuokkaFromExistingFile(e){if(!e)return;const t=this._activeSessions.find((function(t){return t.editor===e}));t&&this._stop(t),this._start(e)}stopCurrent(e){const t=this._activeSessions.find((function(t){return t.editor===e}))||this._activeSession;t&&this._stop(t)}_newFile(e){var t=this;const n=`_${e}Grammar`;this[n]||(this[n]=atom.grammars.getGrammars().find((function(t){return t.fileTypes.find((function(t){return t===e}))}))),atom.workspace.open("").then((function(e){t[n]&&e.setGrammar(t[n]),t._start(e)}))}_navigate(e,t){if(!e||!this._activeSession)return;let n,o;_.isNumber(t)?n=t:_.isArray(t)?(n=t[0],o=t[1]):_.isString(t)&&(n=(t=t.split(":"))[0]&&parseInt(t[0],10),o=t[1]&&parseInt(t[1],10)),_.isNumber(n)?n-=1:n=void 0,_.isNumber(o)||(o=void 0);const r=this._activeSession.editor,a=this._getProjectFile(r);if(e===this._activeSession.fileName)r.setCursorBufferPosition([n,o]),atom.workspace.paneForItem(r).activateItem(r),atom.workspace.getActivePane().activate();else if(a.root){const t=i.resolve(a.root,e);s.existsSync(t)&&atom.workspace.open(t,{initialLine:n,initialColumn:o})}}_installPackage(e,t){if(!e&&this._activeSession&&(e=this._activeSession.editor),!e)return;if(!this._activeSession)return void atom.notifications.addWarning(`Cannot install a package because quokka is not running.`,{dismissable:!0});const n=this._getProjectFile(e),i=n&&n.root;if(t&&!i)return void atom.notifications.addWarning(`Cannot install a package into project because quokka is running outside of an opened project.`);if(!this._pro)return void this._showNotification({text:"The feature is only available in 'Pro' edition.",type:"info",suggestProEdition:!0});if(!this._activeSession.stats||!this._activeSession.stats.errors)return void atom.notifications.addWarning(`No missing packages to install.`);const s=_.find(this._activeSession.stats.errors,(function(e){return e.missingPackage}));s&&s.missingPackage?(this._updateStatus(this._activeSession,"progress"),this._activeSession.runTests({file:this._activeSession.fileName,installPackage:{name:s.missingPackage,local:t}})):atom.notifications.addWarning(`No missing packages to install.`)}_getProjectFile(e){let t,n;var i=atom.project.relativizePath(e.getPath());return t=i[0],n=i[1],t&&n?{file:n,root:t}:(t=atom.project.getPaths()[0]||void 0)?{root:t}:void 0}_start(e){var t=this;this._updateConfigurationFromSettings();const n=new this._Session,i=new this._CompositeDisposable;i.add(atom.workspace.observeTextEditors((function(t){{if(t===e)return;const s=t.onDidSave((function(){return n.runTests({file:n.fileName})})),o={dispose:function(){t.disposables.remove(s),t.disposables.remove(o)}};t.disposables.add(o),t.disposables.add(s),i.add(s)}}))),n.disposable=i,n.id=++f,n.changes=[],n.fileName=l+d._getFileType(e);const s=this._getProjectFile(e),o=s&&s.root;s&&s.file&&s.root&&(n.fileName=s.file),n.editor=e,n.liveConsoleOutput=[],n.changedCursorPositionAtLeastOnce=!1,n.quokkaCoverageMarkers=Object.create(null),n.quokkaCoverageMarkerIdsToLineIds=Object.create(null),n.quokkaLineMessagesCSS=document.createElement("style"),n.quokkaLineMessagesCSS.type="text/css",n.quokkaLineMessagesCSS._lines=0,n.quokkaLineMessagesHideCSS=document.createElement("style"),n.quokkaLineMessagesHideCSS.type="text/css",n.quokkaLineMessagesHideCSS._lines={};const a=atom.views.getView(e).component.rootElement?atom.views.getView(e).component.rootElement.parentNode.children[0]:document.head;a.appendChild(n.quokkaLineMessagesCSS),a.appendChild(n.quokkaLineMessagesHideCSS);const c=e.addGutter({name:"quokka"}),u=this._$(atom.views.getView(c));n.gutter=c,this._activeSessions.push(n);const p={dispose:function(){e.disposables.remove(p),t._stop(n)}};e.disposables.add(p),i.add(e.getBuffer().onDidChange((function(t){n.isDisposed()||(t={start:Math.min(t.newRange.start.row,t.oldRange.start.row),end:Math.max(t.newRange.end.row,t.oldRange.end.row)},n.changes.push(t),n.changedCursorPositionAtLeastOnce&&d._hideInlineMessages(t,e,n))}))),i.add(e.onDidChangeCursorPosition((function(){n.changedCursorPositionAtLeastOnce=!0}))),i.add(e.onDidStopChanging((function(i){n.isDisposed()||!n.changes.length||i&&i.changes&&!i.changes.length&&!n.changedCursorPositionAtLeastOnce||(clearTimeout(t._statusUpdateTimeout),t._statusUpdateTimeout=setTimeout((function(){return t._updateStatus(n,"progress")}),r),n.fileChangedInEditor(n.fileName,e.getBuffer().getText(),{start:_.chain(n.changes).map((function(e){return e.start})).min().value()+1,end:_.chain(n.changes).map((function(e){return e.end})).max().value()+1}),n.changes=[])}))),n.start({localRoot:o,quokkaFolder:this._quokkaFolder,client:"Atom",fileName:n.fileName}),n.on("notification",(function(e){return t._showNotification(e)})),n.on("busy",(function(){clearTimeout(t._statusUpdateTimeout),t._statusUpdateTimeout=setTimeout((function(){return t._updateStatus(n,"progress")}),r),n.liveConsoleOutput=[],t._scheduleSessionIdleTimeout(n),t._panelView.newResultsExpectedSoon()})),n.on("stopped",(function(){return t._hideStatusIndicator()})),n.on("started",(function(){console.log(`[Quokka] #${n.id} Quokka.js started`),t._panelView.showPanel()})),n.on("stats",(function(e){e&&(t._panelView.resultsReport(e),n.stats=e),t._updateStatus(n),delete n.liveConsoleOutput,d._sessionIsActive(n)})),n.on("live",(function(e){n.fileChangedInEditor(n.fileName,n.editor.getBuffer().getText()),n.fileOpenedInEditor(n.fileName)})),n.on("configChanged",(function(e){t._pro=e&&e.pro,t._panelView.setHeaderData(e)})),n.on("documentUpdates",(function(e){return t._updateDocument(n,e)})),n.on("consoleError",(function(e){e&&e.split("\n").forEach((function(e){return e&&console.error(`[Quokka] #${n.id} ${e}`)})),n.emit("stats",e)})),n.on("consoleLog",(function(e){return e&&e.split("\n").forEach((function(e){return e&&console.log(`[Quokka] #${n.id} ${e}`)}))})),n.on("consoleOutput",(function(e){return t._displayLiveConsoleOutput(n,e)})),this._updateStatus(n,"progress"),i.add({dispose:function(){e.disposables.remove(p),u.off(),c.destroy(),_.each(n.quokkaCoverageMarkers,(function(t){return e.destroyMarker(t.id)})),n.stop(),delete n.editor,delete n.gutter,delete n.disposable,delete n.quokkaCoverageMarkers,delete n.quokkaCoverageMarkerIdsToLineIds,delete n.quokkaLineMessagesCSS,delete n.quokkaLineMessagesHideCSS,delete n.renderingQueue,n===t._activeSession&&delete t._activeSession,t._panelView.clearResults(),console.log(`[Quokka] #${n.id} Quokka.js stopped`)}})}_displayLiveConsoleOutput(e,t){var n=this;if(!e.liveConsoleOutput)return;const i=e.liveConsoleOutput.started;e.liveConsoleOutput=e.liveConsoleOutput.concat(t),e.liveConsoleOutput.started=i,e.liveConsoleOutput.started?e.displayLiveConsoleOutputTimeout||this._displayPendingLiveConsoleOutput(e):(e.liveConsoleOutput.started=!0,e.displayLiveConsoleOutputTimeout=setTimeout((function(){delete e.displayLiveConsoleOutputTimeout,e.liveConsoleOutput&&e.liveConsoleOutput.length&&(n._panelView.showHeaderOnly(),n._displayPendingLiveConsoleOutput(e))}),150))}_displayPendingLiveConsoleOutput(e){this._panelView.appendConsoleMessages(e.liveConsoleOutput),e.liveConsoleOutput.length=0}_hideStatusIndicator(){this._statusElement.text(""),this._statusElement.removeClass()}_updateStatus(e,t){let n;clearTimeout(this._statusUpdateTimeout),t||(t=_.isString(e.stats)?"failing":e.stats?e.stats.errors.length?"failing":"passing":"failing",n=e.stats&&e.stats.time),t&&(this._hideStatusIndicator(),"progress"===t?this._statusElement.addClass("quokka-status progress"):(this._statusElement.addClass("inline-block"),this._statusElement.text(("failing"===t?`\u2717`:`\u2714`)+(n?` ${n} ms`:"")))),this._activeSession=e}_scheduleSessionIdleTimeout(e){var t=this;d._clearIdleSessionTimeout(e),e.idleTimeout=setTimeout((function(){return t._sessionIsIdle(e)}),a)}_sessionIsIdle(e){e.gutter.hide(),delete e.stats,e.liveConsoleOutput&&!e.liveConsoleOutput.started&&this._panelView.showHeaderOnly()}_updateDocument(e,t){if(e.isDisposed())return;const n=e.editor,i=t[e.fileName];if(!i||!i.lines)return;const s=e.renderingQueue||{operations:[]};e.renderingQueue=s,i.fullUpdate&&(_.each(e.quokkaCoverageMarkers,(function(e){return n.destroyMarker(e.id)})),e.quokkaCoverageMarkers=Object.create(null),e.quokkaCoverageMarkerIdsToLineIds=Object.create(null),s.operations=[]);let o=0;_.each(i.lines,(function(t){o++;let i=e.quokkaCoverageMarkers[t.id],r=!1;i?t.del?(s.operations.push({editor:n,type:"delete",id:i.id,line:t}),r=!1):t.changed||t.num!==i.getBufferRange().start.row+1?(s.operations.push({editor:n,type:"delete",id:i.id,line:t}),r=!0):r=!1:t.del?(s.operations.push({editor:n,type:"delete",line:t}),r=!1):r=!0,r&&s.operations.push({editor:n,type:"create",line:t})})),i.allLines&&e.quokkaLineMessagesCSS._lines>o&&d._cleanUpLineMessagesCss(e),this._processMarkerOperationQueue(e)}_processMarkerOperationQueue(e){if(e.isDisposed()||!e.renderingQueue)return;let t=e.renderingQueue,n=t.operations.splice(0,c);if(n.length&&(e.quokkaLineMessagesCSS.innerHTML+=_.reduce(n,(function(t,n){let i=d._performMarkerOperation(e,n);return _.isString(i)&&(t+=i,e.quokkaLineMessagesCSS._lines++),t}),"")),e.renderingQueue.operations.length||e.changes&&e.changes.length||d._resetHideCSS(e),!t.operations.length)return void delete e.renderingQueue;let i=Math.floor(u*(n.length/c));setTimeout(_.bind(this._processMarkerOperationQueue,this,e),i)}_stop(e){e.disposable.dispose(),this._activeSessions.splice(this._activeSessions.findIndex((function(t){return t===e})),1),this._hideStatusIndicator(),this._panelView.hide()}_setupEnvironment(){this._quokkaFolder=i.join(o.homedir(),".quokka");try{s.existsSync(this._quokkaFolder)||s.mkdirSync(this._quokkaFolder)}catch(e){}const e=this._loadQuokkaConfig();!0!==e.pro&&!1!==e.pro&&this._showNotification({text:`You are using Quokka.js 'Community' edition (will always be free). Quokka.js 'Pro' (commercial) edition is not yet available, but you may use its features for free now.<br/><br/><a href="#" class="use-community-link">Use 'Community' features only</a><br/><a href="#" class="use-pro-link">Use 'Pro' features as well</a><br/><a href="https://quokkajs.com/pro">Learn more about 'Pro' features</a>`,type:"info"})}_showNotification(e){var t=this;let n=e.text,i=e.type;e.suggestProEdition&&(n+=`<br/><br/><a href="#" class="use-pro-link-start">Switch to 'Pro' edition (free beta)</a><br/><a href="https://quokkajs.com/pro">Learn more about 'Pro' features</a>`),0===n.indexOf("Can not start node.js process")&&(n=n.replace(/<[^>]*>/g,""),n+=`<br/><br/>You may use the <a href="https://quokkajs.com/docs/configuration.html#nodejs-version">"node" setting</a> to configure the location of node.`);const s=atom.notifications["add"+i.charAt(0).toUpperCase()+i.substr(1)](n,{dismissable:!0}),o=atom.views.getView(s);let r=this._$(o.element);r.length||(r=this._$(o));let a;return r.on("mousedown",".use-community-link",(function(){const e=t._loadQuokkaConfig();e.pro=!1,t._saveQuokkaConfig(e),s.dismiss()})),r.on("mousedown",".use-pro-link",(function(){const e=t._loadQuokkaConfig();e.pro=!0,t._saveQuokkaConfig(e),s.dismiss()})),r.on("mousedown",".use-pro-link-start",(function(){const e=t._loadQuokkaConfig();e.pro=!0,t._saveQuokkaConfig(e),s.dismiss(),t.makeQuokkaFromExistingFile(d._getEditor())})),a=s.onDidDismiss((function(){a&&a.dispose(),r.off("mousedown")})),s}_quokkaConfigPath(){return i.join(this._quokkaFolder,"config.json")}_loadQuokkaConfig(){const e=this._quokkaConfigPath();let t,n={};try{t=""+s.readFileSync(e),n=JSON.parse(t)}catch(e){t&&this._showNotification({text:"Looks like your quokka config.json file has invalid syntax, it should be a valid JSON file.",type:"warning"})}return n}_saveQuokkaConfig(e){s.writeFileSync(this._quokkaConfigPath(),JSON.stringify(e))}static _clearIdleSessionTimeout(e){e.idleTimeout&&(clearTimeout(e.idleTimeout),delete e.idleTimeout)}static _sessionIsActive(e){d._clearIdleSessionTimeout(e),!e.gutter.visible&&e.gutter.show()}static _markerOptions(){return{invalidate:"never"}}static _resetHideCSS(e){e.quokkaLineMessagesHideCSS.innerHTML="",e.quokkaLineMessagesHideCSS._lines={}}static _performMarkerOperation(e,t){const n=e.editor;let i=t.id,s=t.line;switch(t.type){case"create":{let t=n.markBufferPosition([s.num-1,0],d._markerOptions());e.quokkaCoverageMarkers[s.id]=t,e.quokkaCoverageMarkerIdsToLineIds[t.id]=s.id;let i=document.createElement("span");i.setAttribute("data-line",s.num),n.gutterWithName("quokka").decorateMarker(t,{class:"quokka-cov-"+s.state,item:i});let o=d._lineMessageCss(s);if(o)return n.decorateMarker(t,{type:"line",class:"ql"+(s.err?"e":"c")}),n.decorateMarker(t,{type:"line",class:"ql"+s.id}),o;break}case"delete":if(!i){let t=e.quokkaCoverageMarkers[s.id];t&&(i=t.id)}_.isUndefined(i)||(n.destroyMarker(i),delete e.quokkaCoverageMarkers[s.id],delete e.quokkaCoverageMarkerIdsToLineIds[i])}}static _lineMessageCss(e){if(e.err||e.log){let t=d._cssEscape(e.err||e.log);return".ql"+e.id+'::after{content:" '+t+'";}\n'}}static _cleanUpLineMessagesCss(e){let t=Object.create(null),n=0,i=(e.quokkaLineMessagesCSS.innerHTML||"").split("\n");i.reverse(),_.each(i,(function(i){try{if(!i)return;let s=parseInt(i.substring(3,i.indexOf(":")),10);!t[s]&&e.quokkaCoverageMarkers[s]&&(t[s]=i,n++)}catch(e){}})),e.quokkaLineMessagesCSS.innerHTML=_.reduce(t,(function(e,t){return e+=t+"\n"}),""),e.quokkaLineMessagesCSS._lines=n}static _hideInlineMessages(e,t,n){if(t!==atom.workspace.getActiveTextEditor())return;let i="";for(let s=Math.min(e.start,e.end),o=Math.min(s+5,Math.max(e.start,e.end)),r=s;r<=o;r++)_.each(t.findMarkers({startBufferRow:r}),(function(e){let t=n.quokkaCoverageMarkerIdsToLineIds[e.id];t&&!n.quokkaLineMessagesHideCSS._lines[t]&&(i+=d._lineWithoutMessage(t),n.quokkaLineMessagesHideCSS._lines[t]=!0)}));i&&(n.quokkaLineMessagesHideCSS.innerHTML+=i)}static _lineWithoutMessage(e){return".ql"+e+'::after{content:"";}\n'}static _getFileType(e){for(let t=0,n=e.getGrammar().fileTypes;t<n.length;t++){let e=n[t];if("ts"===e)return".ts";if("tsx"===e)return".tsx"}return".js"}static _getEditor(e,t){let n;return e&&e.target&&e.target.getModel?n=e.target.getModel():t&&t.getModel&&(n=t.getModel()),n&&n.getPath?n:n&&n.getActiveTextEditor?n.getActiveTextEditor():atom.workspace.getActiveTextEditor()}static _cssEscape(e){const t=e+"",n=t.length;let i,s=-1,o="";const r=t.charCodeAt(0);for(;++s<n;)(i=t.charCodeAt(s))>=1&&i<=31||127==i||0==s&&i>=48&&i<=57||1==s&&i>=48&&i<=57&&45==r?o+="\\"+i.toString(16)+" ":o+=i>=128||45==i||95==i||i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122?t.charAt(s):"\\"+t.charAt(s);return o}_updateConfigurationFromSettings(){let e="";try{e=this._loadQuokkaConfig().node}catch(e){}e?process.env.WALLABY_NODE=e:delete process.env.WALLABY_NODE}}t.default=new d}),(function(e,t,n){"use strict";const i=n(18),s={};i(s,n(8)),i(s,n(24)),i(s,n(14)),i(s,n(3)),i(s,n(6)),i(s,n(32)),i(s,n(36)),i(s,n(37)),i(s,n(38)),i(s,n(39)),i(s,n(45)),i(s,n(4)),e.exports=s}),(function(e,t,n){"use strict";e.exports=function(){const e=[].slice.call(arguments).filter(e=>e),t=e.shift();return e.forEach(e=>{Object.keys(e).forEach(n=>{t[n]=e[n]})}),t}}),(function(e,t,n){function i(e){e.lchmod=function(t,n,i){e.open(t,p.O_WRONLY|p.O_SYMLINK,n,(function(t,s){t?i&&i(t):e.fchmod(s,n,(function(t){e.close(s,(function(e){i&&i(t||e)}))}))}))},e.lchmodSync=function(t,n){var i,s=e.openSync(t,p.O_WRONLY|p.O_SYMLINK,n),o=!0;try{i=e.fchmodSync(s,n),o=!1}finally{if(o)try{e.closeSync(s)}catch(e){}else e.closeSync(s)}return i}}function s(e){p.hasOwnProperty("O_SYMLINK")?(e.lutimes=function(t,n,i,s){e.open(t,p.O_SYMLINK,(function(t,o){t?s&&s(t):e.futimes(o,n,i,(function(t){e.close(o,(function(e){s&&s(t||e)}))}))}))},e.lutimesSync=function(t,n,i){var s,o=e.openSync(t,p.O_SYMLINK),r=!0;try{s=e.futimesSync(o,n,i),r=!1}finally{if(r)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return s}):(e.lutimes=function(e,t,n,i){i&&process.nextTick(i)},e.lutimesSync=function(){})}function o(e){return e?function(t,n,i){return e.call(d,t,n,(function(e){f(e)&&(e=null),i&&i.apply(this,arguments)}))}:e}function r(e){return e?function(t,n){try{return e.call(d,t,n)}catch(e){if(!f(e))throw e}}:e}function a(e){return e?function(t,n,i,s){return e.call(d,t,n,i,(function(e){f(e)&&(e=null),s&&s.apply(this,arguments)}))}:e}function c(e){return e?function(t,n,i){try{return e.call(d,t,n,i)}catch(e){if(!f(e))throw e}}:e}function u(e){return e?function(t,n){return e.call(d,t,(function(e,t){if(!t)return n.apply(this,arguments);t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296),n&&n.apply(this,arguments)}))}:e}function l(e){return e?function(t){var n=e.call(d,t);return n.uid<0&&(n.uid+=4294967296),n.gid<0&&(n.gid+=4294967296),n}:e}function f(e){return!e||"ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code)}var d=n(9),p=n(20),h=process.cwd,m=null,y=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return m||(m=h.call(process)),m};try{process.cwd()}catch(e){}var g=process.chdir;process.chdir=function(e){m=null,g.call(process,e)},e.exports=function(e){p.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&i(e),e.lutimes||s(e),e.chown=a(e.chown),e.fchown=a(e.fchown),e.lchown=a(e.lchown),e.chmod=o(e.chmod),e.fchmod=o(e.fchmod),e.lchmod=o(e.lchmod),e.chownSync=c(e.chownSync),e.fchownSync=c(e.fchownSync),e.lchownSync=c(e.lchownSync),e.chmodSync=r(e.chmodSync),e.fchmodSync=r(e.fchmodSync),e.lchmodSync=r(e.lchmodSync),e.stat=u(e.stat),e.fstat=u(e.fstat),e.lstat=u(e.lstat),e.statSync=l(e.statSync),e.fstatSync=l(e.fstatSync),e.lstatSync=l(e.lstatSync),e.lchmod||(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){}),e.lchown||(e.lchown=function(e,t,n,i){i&&process.nextTick(i)},e.lchownSync=function(){}),"win32"===y&&(e.rename=(function(t){return function(n,i,s){var o=Date.now(),r=0;t(n,i,(function a(c){if(c&&("EACCES"===c.code||"EPERM"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(i,(function(e,o){e&&"ENOENT"===e.code?t(n,i,a):s(c)}))}),r),void(r<100&&(r+=10));s&&s(c)}))}})(e.rename)),e.read=(function(t){return function(n,i,s,o,r,a){var c;if(a&&"function"==typeof a){var u=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&u<10)return u++,t.call(e,n,i,s,o,r,c);a.apply(this,arguments)}}return t.call(e,n,i,s,o,r,c)}})(e.read),e.readSync=(function(t){return function(n,i,s,o,r){for(var a=0;;)try{return t.call(e,n,i,s,o,r)}catch(e){if("EAGAIN"===e.code&&a<10){a++;continue}throw e}}})(e.readSync)}}),(function(e,t){e.exports=require("constants")}),(function(e,t,n){var i=n(22).Stream;e.exports=function(e){function t(n,s){if(!(this instanceof t))return new t(n,s);i.call(this);var o=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,s=s||{};for(var r=Object.keys(s),a=0,c=r.length;a<c;a++){var u=r[a];this[u]=s[u]}if(this.encoding&&this.setEncoding(this.encoding),void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=Infinity;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw Error("start must be <= end");this.pos=this.start}null===this.fd?e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return o.emit("error",e),void(o.readable=!1);o.fd=t,o.emit("open",t),o._read()})):process.nextTick((function(){o._read()}))}function n(t,s){if(!(this instanceof n))return new n(t,s);i.call(this),this.path=t,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,s=s||{};for(var o=Object.keys(s),r=0,a=o.length;r<a;r++){var c=o[r];this[c]=s[c]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}return{ReadStream:t,WriteStream:n}}}),(function(e,t){e.exports=require("stream")}),(function(e,t){e.exports=require("util")}),(function(e,t,n){const i=n(2).fromCallback;e.exports={copy:i(n(25))}}),(function(e,t,n){"use strict";const i=n(1),s=n(0),o=n(11),r=n(3),a=n(4).pathExists;e.exports=function(e,t,n,c){"function"!=typeof n||c?("function"==typeof n||n instanceof RegExp)&&(n={filter:n}):(c=n,n={}),c=c||function(){},(n=n||{}).preserveTimestamps&&"ia32"===process.arch&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269`);const u=process.cwd();if(s.resolve(u,e)===s.resolve(u,t))return c(Error("Source and destination must not be the same."));i.lstat(e,(i,u)=>{if(i)return c(i);let l=null;if(u.isDirectory()){const e=t.split(s.sep);e.pop(),l=e.join(s.sep)}else l=s.dirname(t);a(l,(i,s)=>i?c(i):s?o(e,t,n,c):void r.mkdirs(l,i=>{if(i)return c(i);o(e,t,n,c)}))})}}),(function(e,t,n){"use strict";const i=n(1);n(12),n(0),e.exports={hasMillisRes:null,hasMillisResSync:null,timeRemoveMillis:null,utimesMillis:function(e,t,n,s){i.open(e,"r+",(e,o)=>{if(e)return s(e);i.futimes(o,t,n,e=>{i.close(o,t=>{s&&s(e||t)})})})}}}),(function(e,t,n){"use strict";function i(e,t,n,c){if("function"==typeof t?(n=t,t={}):t&&"object"==typeof t||(t={mode:t}),"win32"===process.platform&&r(e)){const t=Error(e+" contains invalid WIN32 path characters.");return t.code="EINVAL",n(t)}let u=t.mode;const l=t.fs||s;void 0===u&&(u=a&~process.umask()),c||(c=null),n=n||function(){},e=o.resolve(e),l.mkdir(e,u,s=>{if(!s)return c=c||e,n(null,c);switch(s.code){case"ENOENT":if(o.dirname(e)===e)return n(s);i(o.dirname(e),t,(s,o)=>{s?n(s,o):i(e,t,n,o)});break;default:l.stat(e,(e,t)=>{e||!t.isDirectory()?n(s,c):n(null,c)})}})}const s=n(1),o=n(0),r=n(13).invalidWin32Path,a=parseInt("0777",8);e.exports=i}),(function(e,t,n){"use strict";function i(e,t,n){t&&"object"==typeof t||(t={mode:t});let c=t.mode;const u=t.fs||s;if("win32"===process.platform&&r(e)){const t=Error(e+" contains invalid WIN32 path characters.");throw t.code="EINVAL",t}void 0===c&&(c=a&~process.umask()),n||(n=null),e=o.resolve(e);try{u.mkdirSync(e,c),n=n||e}catch(s){switch(s.code){case"ENOENT":if(o.dirname(e)===e)throw s;i(e,t,n=i(o.dirname(e),t,n));break;default:let r;try{r=u.statSync(e)}catch(e){throw s}if(!r.isDirectory())throw s}}return n}const s=n(1),o=n(0),r=n(13).invalidWin32Path,a=parseInt("0777",8);e.exports=i}),(function(e,t,n){"use strict";function i(e,t,n){("function"==typeof n||n instanceof RegExp)&&(n={filter:n}),(n=n||{}).recursive=!!n.recursive,n.clobber=!("clobber"in n&&!n.clobber),n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.dereference="dereference"in n&&!!n.dereference,n.preserveTimestamps="preserveTimestamps"in n&&!!n.preserveTimestamps,n.filter=n.filter||function(){return!0},n.preserveTimestamps&&"ia32"===process.arch&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269`);const c=n.recursive&&!n.dereference?s.lstatSync(e):s.statSync(e),u=o.dirname(t),l=s.existsSync(u);let f=!1;if(n.filter instanceof RegExp?(console.warn("Warning: fs-extra: Passing a RegExp filter is deprecated, use a function"),f=n.filter.test(e)):"function"==typeof n.filter&&(f=n.filter(e,t)),c.isFile()&&f)l||a.mkdirsSync(u),r(e,t,{overwrite:n.overwrite,errorOnExist:n.errorOnExist,preserveTimestamps:n.preserveTimestamps});else if(c.isDirectory()&&f)s.existsSync(t)||a.mkdirsSync(t),s.readdirSync(e).forEach(s=>{const r=n;r.recursive=!0,i(o.join(e,s),o.join(t,s),r)});else if(n.recursive&&c.isSymbolicLink()&&f){const n=s.readlinkSync(e);s.symlinkSync(n,t)}}const s=n(1),o=n(0),r=n(30),a=n(3);e.exports=i}),(function(e,t,n){"use strict";const i=n(1),s=n(15)(65536);e.exports=function(e,t,n){const o=n.overwrite,r=n.errorOnExist,a=n.preserveTimestamps;if(i.existsSync(t)){if(!o){if(r)throw Error(`${t} already exists`);return}i.unlinkSync(t)}const c=i.openSync(e,"r"),u=i.fstatSync(c),l=i.openSync(t,"w",u.mode);let f=1,d=0;for(;f>0;)f=i.readSync(c,s,0,65536,d),i.writeSync(l,s,0,f),d+=f;a&&i.futimesSync(l,u.atime,u.mtime),i.closeSync(c),i.closeSync(l)}}),(function(e,t,n){"use strict";function i(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(t=>{e[t]=e[t]||p[t],e[t+="Sync"]=e[t]||p[t]}),e.maxBusyTries=e.maxBusyTries||3}function s(e,t,n){let s=0;"function"==typeof t&&(n=t,t={}),m(e,"rimraf: missing path"),m.equal(typeof e,"string","rimraf: path should be a string"),m.equal(typeof n,"function","rimraf: callback function required"),m(t,"rimraf: invalid options argument provided"),m.equal(typeof t,"object","rimraf: options should be object"),i(t),o(e,t,(function i(r){if(r){if(("EBUSY"===r.code||"ENOTEMPTY"===r.code||"EPERM"===r.code)&&s<t.maxBusyTries){let n=100*++s;return setTimeout(()=>o(e,t,i),n)}"ENOENT"===r.code&&(r=null)}n(r)}))}function o(e,t,n){m(e),m(t),m("function"==typeof n),t.lstat(e,(i,s)=>i&&"ENOENT"===i.code?n(null):i&&"EPERM"===i.code&&y?r(e,t,i,n):s&&s.isDirectory()?c(e,t,i,n):void t.unlink(e,i=>{if(i){if("ENOENT"===i.code)return n(null);if("EPERM"===i.code)return y?r(e,t,i,n):c(e,t,i,n);if("EISDIR"===i.code)return c(e,t,i,n)}return n(i)}))}function r(e,t,n,i){m(e),m(t),m("function"==typeof i),n&&m(n instanceof Error),t.chmod(e,666,s=>{s?i("ENOENT"===s.code?null:n):t.stat(e,(s,o)=>{s?i("ENOENT"===s.code?null:n):o.isDirectory()?c(e,t,n,i):t.unlink(e,i)})})}function a(e,t,n){let i;m(e),m(t),n&&m(n instanceof Error);try{t.chmodSync(e,666)}catch(e){if("ENOENT"===e.code)return;throw n}try{i=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}i.isDirectory()?f(e,t,n):t.unlinkSync(e)}function c(e,t,n,i){m(e),m(t),n&&m(n instanceof Error),m("function"==typeof i),t.rmdir(e,s=>{!s||"ENOTEMPTY"!==s.code&&"EEXIST"!==s.code&&"EPERM"!==s.code?i(s&&"ENOTDIR"===s.code?n:s):u(e,t,i)})}function u(e,t,n){m(e),m(t),m("function"==typeof n),t.readdir(e,(i,o)=>{if(i)return n(i);let r,a=o.length;if(0===a)return t.rmdir(e,n);o.forEach(i=>{s(h.join(e,i),t,i=>{if(!r)return i?n(r=i):void(0==--a&&t.rmdir(e,n))})})})}function l(e,t){let n;i(t=t||{}),m(e,"rimraf: missing path"),m.equal(typeof e,"string","rimraf: path should be a string"),m(t,"rimraf: missing options"),m.equal(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&y&&a(e,t,n)}try{n&&n.isDirectory()?f(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return y?a(e,t,n):f(e,t,n);if("EISDIR"!==n.code)throw n;f(e,t,n)}}function f(e,t,n){m(e),m(t),n&&m(n instanceof Error);try{t.rmdirSync(e)}catch(i){if("ENOTDIR"===i.code)throw n;if("ENOTEMPTY"===i.code||"EEXIST"===i.code||"EPERM"===i.code)d(e,t);else if("ENOENT"!==i.code)throw i}}function d(e,t){m(e),m(t),t.readdirSync(e).forEach(n=>l(h.join(e,n),t));const n=y?100:1;let i=0;for(;;){let s=!0;try{return s=!1,t.rmdirSync(e,t)}finally{if(++i<n&&s)continue}}}const p=n(1),h=n(0),m=n(10),y="win32"===process.platform;e.exports=s,s.sync=l}),(function(e,t,n){"use strict";const i=n(2).fromCallback,s=n(7);s.outputJson=i(n(34)),s.outputJsonSync=n(35),s.outputJSON=s.outputJson,s.outputJSONSync=s.outputJsonSync,s.writeJSON=s.writeJson,s.writeJSONSync=s.writeJsonSync,s.readJSON=s.readJson,s.readJSONSync=s.readJsonSync,e.exports=s}),(function(e,t,n){function i(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var s;try{s=n(1)}catch(e){s=n(5)}var o={spaces:null,readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var o=(t=t||{}).fs||s,r=!0;"passParsingErrors"in t?r=t.passParsingErrors:"throws"in t&&(r=t.throws),o.readFile(e,t,(function(s,o){if(s)return n(s);o=i(o);var a;try{a=JSON.parse(o,t?t.reviver:null)}catch(t){return r?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,a)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||s,o=!0;"passParsingErrors"in t?o=t.passParsingErrors:"throws"in t&&(o=t.throws);try{var r=n.readFileSync(e,t);return r=i(r),JSON.parse(r,t.reviver)}catch(t){if(o)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,i){null==i&&(i=n,n={});var o=(n=n||{}).fs||s,r="object"==typeof n&&null!==n&&"spaces"in n?n.spaces:this.spaces,a="";try{a=JSON.stringify(t,n?n.replacer:null,r)+"\n"}catch(e){return void(i&&i(e,null))}o.writeFile(e,a,n,i)},writeFileSync:function(e,t,n){var i=(n=n||{}).fs||s,o="object"==typeof n&&null!==n&&"spaces"in n?n.spaces:this.spaces,r=JSON.stringify(t,n.replacer,o)+"\n";return i.writeFileSync(e,r,n)}};e.exports=o}),(function(e,t,n){"use strict";const i=n(0),s=n(3),o=n(4).pathExists,r=n(7);e.exports=function(e,t,n,a){"function"==typeof n&&(a=n,n={});const c=i.dirname(e);o(c,(i,o)=>i?a(i):o?r.writeJson(e,t,n,a):void s.mkdirs(c,i=>{if(i)return a(i);r.writeJson(e,t,n,a)}))}}),(function(e,t,n){"use strict";const i=n(1),s=n(0),o=n(3),r=n(7);e.exports=function(e,t,n){const a=s.dirname(e);i.existsSync(a)||o.mkdirsSync(a),r.writeJsonSync(e,t,n)}}),(function(e,t,n){"use strict";function i(e,t,n,o){function r(){f.resolve(e)===f.resolve(t)?u.access(e,o):c?u.rename(e,t,r=>{if(!r)return o();if("ENOTEMPTY"!==r.code&&"EEXIST"!==r.code){if("EPERM"!==r.code)return"EXDEV"!==r.code?o(r):void s(e,t,c,o);setTimeout(()=>{d(t,s=>{if(s)return o(s);n.overwrite=!1,i(e,t,n,o)})},200)}else d(t,s=>{if(s)return o(s);n.overwrite=!1,i(e,t,n,o)})}):u.link(e,t,n=>n?"EXDEV"===n.code||"EISDIR"===n.code||"EPERM"===n.code||"ENOTSUP"===n.code?s(e,t,c,o):o(n):u.unlink(e,o))}"function"==typeof n&&(o=n,n={});const c=n.overwrite||n.clobber||!1;a(e,t,(n,i)=>n?o(n):i?o(Error(`Cannot move '${e}' to a subdirectory of itself, '${t}'.`)):void p(f.dirname(t),e=>{if(e)return o(e);r()}))}function s(e,t,n,i){u.stat(e,(s,a)=>{if(s)return i(s);a.isDirectory()?r(e,t,n,i):o(e,t,n,i)})}function o(e,t,n,i){function s(){u.unlink(e,i)}const o=n?"w":"wx",a=u.createReadStream(e),c=u.createWriteStream(t,{flags:o});a.on("error",o=>{a.destroy(),c.destroy(),c.removeListener("close",s),u.unlink(t,()=>{"EISDIR"===o.code||"EPERM"===o.code?r(e,t,n,i):i(o)})}),c.on("error",e=>{a.destroy(),c.destroy(),c.removeListener("close",s),i(e)}),c.once("close",s),a.pipe(c)}function r(e,t,n,i){function s(){l(e,t,o,t=>{if(t)return i(t);d(e,i)})}const o={overwrite:!1};n?d(t,e=>{if(e)return i(e);s()}):s()}function a(e,t,n){u.stat(e,(i,s)=>{if(i)return n(i);if(s.isDirectory()){const i=t.split(f.dirname(e)+f.sep)[1];if(i){const s=i.split(f.sep)[0];return s?n(null,e!==t&&t.indexOf(e)>-1&&s===f.basename(e)):n(null,!1)}return n(null,!1)}return n(null,!1)})}const c=n(2).fromCallback,u=n(1),l=n(11),f=n(0),d=n(6).remove,p=n(3).mkdirs;e.exports={move:c(i)}}),(function(e,t,n){"use strict";function i(e,t,n){const o=(n=n||{}).overwrite||n.clobber||!1;if(e=u.resolve(e),t=u.resolve(t),e===t)return c.accessSync(e);if(a(e,t))throw Error(`Cannot move '${e}' into itself '${t}'.`);d(u.dirname(t)),(function(){if(o)try{c.renameSync(e,t)}catch(r){if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)return f(t),n.overwrite=!1,i(e,t,n);if("EXDEV"!==r.code)throw r;return s(e,t,o)}else try{c.linkSync(e,t),c.unlinkSync(e)}catch(n){if("EXDEV"===n.code||"EISDIR"===n.code||"EPERM"===n.code||"ENOTSUP"===n.code)return s(e,t,o);throw n}})()}function s(e,t,n){return c.statSync(e).isDirectory()?r(e,t,n):o(e,t,n)}function o(e,t,n){const i=p(65536),s=n?"w":"wx",o=c.openSync(e,"r"),r=c.fstatSync(o),a=c.openSync(t,s,r.mode);let u=1,l=0;for(;u>0;)u=c.readSync(o,i,0,65536,l),c.writeSync(a,i,0,u),l+=u;return c.closeSync(o),c.closeSync(a),c.unlinkSync(e)}function r(e,t,n){function i(){return l(e,t,s),f(e)}const s={overwrite:!1};n?(f(t),i()):i()}function a(e,t){try{return c.statSync(e).isDirectory()&&e!==t&&t.indexOf(e)>-1&&t.split(u.dirname(e)+u.sep)[1].split(u.sep)[0]===u.basename(e)}catch(e){return!1}}const c=n(1),u=n(0),l=n(14).copySync,f=n(6).removeSync,d=n(3).mkdirsSync,p=n(15);e.exports={moveSync:i}}),(function(e,t,n){"use strict";function i(e){let t;try{t=o.readdirSync(e)}catch(t){return a.mkdirsSync(e)}t.forEach(t=>{t=r.join(e,t),c.removeSync(t)})}const s=n(2).fromCallback,o=n(5),r=n(0),a=n(3),c=n(6),u=s((function(e,t){t=t||function(){},o.readdir(e,(n,i)=>{function s(){const e=i.pop();if(!e)return t();c.remove(e,e=>{if(e)return t(e);s()})}if(n)return a.mkdirs(e,t);i=i.map(t=>r.join(e,t)),s()})}));e.exports={emptyDirSync:i,emptydirSync:i,emptyDir:u,emptydir:u}}),(function(e,t,n){"use strict";const i=n(40),s=n(41),o=n(42);e.exports={createFile:i.createFile,createFileSync:i.createFileSync,ensureFile:i.createFile,ensureFileSync:i.createFileSync,createLink:s.createLink,createLinkSync:s.createLinkSync,ensureLink:s.createLink,ensureLinkSync:s.createLinkSync,createSymlink:o.createSymlink,createSymlinkSync:o.createSymlinkSync,ensureSymlink:o.createSymlink,ensureSymlinkSync:o.createSymlinkSync}}),(function(e,t,n){"use strict";const i=n(2).fromCallback,s=n(0),o=n(1),r=n(3),a=n(4).pathExists;e.exports={createFile:i((function(e,t){function n(){o.writeFile(e,"",e=>{if(e)return t(e);t()})}o.stat(e,(i,o)=>{if(!i&&o.isFile())return t();const c=s.dirname(e);a(c,(e,i)=>e?t(e):i?n():void r.mkdirs(c,e=>{if(e)return t(e);n()}))})})),createFileSync:function(e){let t;try{t=o.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=s.dirname(e);o.existsSync(n)||r.mkdirsSync(n),o.writeFileSync(e,"")}}}),(function(e,t,n){"use strict";const i=n(2).fromCallback,s=n(0),o=n(1),r=n(3),a=n(4).pathExists;e.exports={createLink:i((function(e,t,n){function i(e,t){o.link(e,t,e=>{if(e)return n(e);n(null)})}a(t,(c,u)=>c?n(c):u?n(null):void o.lstat(e,(o,c)=>{if(o)return o.message=o.message.replace("lstat","ensureLink"),n(o);const u=s.dirname(t);a(u,(s,o)=>s?n(s):o?i(e,t):void r.mkdirs(u,s=>{if(s)return n(s);i(e,t)}))}))})),createLinkSync:function(e,t,n){if(o.existsSync(t))return;try{o.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const i=s.dirname(t);return o.existsSync(i)?o.linkSync(e,t):(r.mkdirsSync(i),o.linkSync(e,t))}}}),(function(e,t,n){"use strict";const i=n(2).fromCallback,s=n(0),o=n(1),r=n(3),a=r.mkdirs,c=r.mkdirsSync,u=n(43),l=u.symlinkPaths,f=u.symlinkPathsSync,d=n(44),p=d.symlinkType,h=d.symlinkTypeSync,m=n(4).pathExists;e.exports={createSymlink:i((function(e,t,n,i){i="function"==typeof n?n:i,n="function"!=typeof n&&n,m(t,(r,c)=>r?i(r):c?i(null):void l(e,t,(r,c)=>{if(r)return i(r);e=c.toDst,p(c.toCwd,n,(n,r)=>{if(n)return i(n);const c=s.dirname(t);m(c,(n,s)=>n?i(n):s?o.symlink(e,t,r,i):void a(c,n=>{if(n)return i(n);o.symlink(e,t,r,i)}))})}))})),createSymlinkSync:function(e,t,n,i){if(i="function"==typeof n?n:i,n="function"!=typeof n&&n,o.existsSync(t))return;const r=f(e,t);e=r.toDst,n=h(r.toCwd,n);const a=s.dirname(t);return o.existsSync(a)?o.symlinkSync(e,t,n):(c(a),o.symlinkSync(e,t,n))}}}),(function(e,t,n){"use strict";const i=n(0),s=n(1),o=n(4).pathExists;e.exports={symlinkPaths:function(e,t,n){if(i.isAbsolute(e))return s.lstat(e,(t,i)=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e}));{const r=i.dirname(t),a=i.join(r,e);return o(a,(t,o)=>t?n(t):o?n(null,{toCwd:a,toDst:e}):s.lstat(e,(t,s)=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:i.relative(r,e)})))}},symlinkPathsSync:function(e,t){let n;if(i.isAbsolute(e)){if(!(n=s.existsSync(e)))throw Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const o=i.dirname(t),r=i.join(o,e);if(n=s.existsSync(r))return{toCwd:r,toDst:e};if(!(n=s.existsSync(e)))throw Error("relative srcpath does not exist");return{toCwd:e,toDst:i.relative(o,e)}}}}}),(function(e,t,n){"use strict";const i=n(1);e.exports={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);i.lstat(e,(e,i)=>{if(e)return n(null,"file");t=i&&i.isDirectory()?"dir":"file",n(null,t)})},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=i.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}}}),(function(e,t,n){"use strict";const i=n(2).fromCallback,s=n(1),o=n(0),r=n(3),a=n(4).pathExists;e.exports={outputFile:i((function(e,t,n,i){"function"==typeof n&&(i=n,n="utf8");const c=o.dirname(e);a(c,(o,a)=>o?i(o):a?s.writeFile(e,t,n,i):void r.mkdirs(c,o=>{if(o)return i(o);s.writeFile(e,t,n,i)}))})),outputFileSync:function(e,t,n){const i=o.dirname(e);if(s.existsSync(i))return s.writeFileSync.apply(s,arguments);r.mkdirsSync(i),s.writeFileSync.apply(s,arguments)}}}),(function(e,t,n){"use babel";const i=100,s=2e3,o=512e3;e.exports=function(e,t,r,a){const c=n(47)(a);class u extends t{static content(){return this.div({class:"quokka-results-view native-key-bindings",tabindex:-1,contenteditable:!0})}display(t){var n=this;let i=t.navigator,s=t.installer,a=t.blur,u=t.data,l=t.focus,f=this,d=c.html(u,t.hasOpenedProject);d&&d.length>o&&(d='<section class="error"><section class="header"><strong>Logging is stopped because too much data is being logged</strong></section></section>'+this.html(),t.stopLogging=!0),this.clearView(),this.html(d),this.on("click","a.loc",(function(t){let n=e(t.target);i(n.data("file"),n.data("loc"))})),this.on("click","a.install-package-quokka",(function(){return s()})),this.on("click","a.install-package-project",(function(){return s(void 0,!0)})),this.on("cut",(function(e){return e.preventDefault()})),this.on("paste",(function(e){return e.preventDefault()})),this.on("focus",(function(){n._disposables=new r,n._disposables.add(atom.commands.add(".quokka-results-view",{"tool-panel:unfocus":function(){return atom.workspace.getActivePane().activate()}})),f._range&&document.getSelection().addRange(f._range)})),this.on("blur",(function(e){try{const t=document.getSelection();f._range=t&&t.getRangeAt(0)}catch(e){delete f._range}f._disposables&&(f._disposables.dispose(),delete f._disposables),a&&a()})),this.on("keydown",(function(t){switch(t.which){case 13:let n=document.getSelection().anchorNode;return!!n&&!!(n=3===n.nodeType?n.parentNode:n)&&(((n=e(n)).hasClass("loc")||n.hasClass("all"))&&n.click(),!1);case 27:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 17:case 91:return!0;default:if((67===t.keyCode||65===t.keyCode)&&(t.ctrlKey||t.metaKey))return!0}return!1})),l&&this.focusView()}focusView(){this.is(":empty")||this.focus()}clearView(){this.off(),this.empty(),delete this._range,this._disposables&&(this._disposables.dispose(),delete this._disposables)}}return class extends t{static content(){let e=this;return e.div({class:"quokka-panel-view"},(function(){e.div({class:"quokka-panel-view-resizer"}),e.div({class:"quokka-panel-view-container"},(function(){e.header({class:"quokka-panel-view-header header"},(function(){e.span({class:"header-item subtle-info-message",outlet:"headerLabel"}),e.span({class:"header-item icons pull-right inline-block btn-group"},(function(){e.span({class:"icon icon-x",tabindex:-1,outlet:"hideButton"})}))})),e.section({class:"quokka-panel-view-content"},(function(){return e.subview("results",new u)}))}))}))}initialize(t){let n=this,s=_.bind(this._displayResults,this);this._displayResults=_.debounce(s,i),this._disposables=new r;let o=_.bind(this._resize,this);this.on("mousedown",".quokka-panel-view-resizer",(function(){e(document).on("mousemove",o),e(document).one("mouseup",(function(){e(document).off("mousemove",o),delete n._lastClientY}))})),(this._params=t||{}).results={},this.hideButton.click(_.bind(this.togglePanel,this)),this._disposables.add(atom.tooltips.add(this.hideButton,{title:"Toggle Quokka.js Output Panel",keyBindingCommand:"quokka:toggle-output",trigger:"hover"})),this._displayResults(this._params.focus)}togglePanel(e){this.toggle(),this._displayResults(e)}showPanel(){this._outputPanelAdded||(atom.workspace.addBottomPanel({item:this}),this._outputPanelAdded=!0),this.show(),this._displayResults()}focusPanel(){this.isVisible()?this.results.focusView():this.togglePanel(!0)}deactivate(){this._disposables.dispose()}setHeaderData(e){this.headerLabel.text(`Quokka (node: ${e.nodeVersion}${e.ts?`, TypeScript: ${e.ts.version&&"v"+e.ts.version||"unknown version"}`:""}${e.babel?`, babel: ${e.babel.version&&"v"+e.babel.version||"unknown version"}`:""})`)}showHeaderOnly(){this._params.results={},this._displayResults()}clearResults(){this._params.results={},this.results.clearView()}newResultsExpectedSoon(){delete this._stopLogging}appendConsoleMessages(e){this._stopLogging||(((this._params.results=this._params.results||{}).messages=(this._params.results.messages||[]).concat(e)).length>s&&this._params.results.messages.splice(0,this._params.results.messages.length-s),this._displayResults())}resultsReport(e){this._params.results=e,delete this._stopLogging,this._displayResults()}_displayResults(e){let t=this._params.results;if(!this.isVisible()||!t||this._stopLogging)return;let n={navigator:this._params.navigate,installer:this._params.installPackage,hasOpenedProject:this._params.hasOpenedProject,data:t,focus:e,results:!0};this.results.display(n),n.stopLogging&&(this._stopLogging=!0)}_resize(e){if(1===e.which){if(this._lastClientY){let t=this.height(),n=this._lastClientY-e.clientY;(n<0||n>0&&e.clientY<=this.offset().top)&&this.height(t+n)}this._lastClientY=e.clientY}}}}}),(function(e,t){"use babel";e.exports=function(e){return{html:function(e,t){const n=this;n._hasOpenedProject=t;let i="";return _.isString(e)?i+=n._error(e):_.isObject(e)&&(_.each(e.errors,(function(e){i+=n._error(e.message,e.stack,e.expected,e.actual,e.missingPackage)})),_.each(e.messages,(function(e){i+=n._message(e)}))),i},_error:function(e,t,n,i,s){const o=this;let r="";s&&(r=`<section class="error"><a class="install-package-quokka">Install "${s}" package for the current quokka file</a>`+(o._hasOpenedProject?`<br/><a class="install-package-project">Install "${s}" package into the project</a>`:"")+"</section>");let a="";return(n||i)&&(a=o._diff(n,i)+"<br/>"),r+'<section class="error">'+a+'<section class="header">'+o._escapeAndConvertToHtml(e)+"</section>"+_.reduce(t,(function(e,t){return e+=o._line(t)}),"")+"</section>"},_line:function(e){const t=this._escape(e.file),n=e.context&&this._escape(e.context)||"";return t?'<section class="line">at '+(n?'<span class="context">'+n+"</span> ":"")+'<a class="loc" data-file="'+t+'" data-loc="'+e.loc+'">'+t+":"+e.loc+"</a></section>":""},_message:function(e){let t="diff"===e.type;if(t){if(!e.context&&!e.actual&&!e.expected)return"";e.text=e.context,delete e.context}return(t?this._diff(e.expected,e.actual):"")+'<section class="message '+e.type+(t?" pad":"")+'"><span class="'+(t?"context":"text")+'">'+this._escapeAndConvertToHtml(e.text)+" </span>"+this._line(e)+"</section>"},_diff:function(t,n){try{return'<section class="diff" style="white-space: pre;">'+e.diff_prettyHtml(e.diff_wordMode(t||"",n||"")).replace(/¶<br>/g,"<br>").replace(/style="background:#e6ffe6;"/g,'class="status-added"').replace(/style="background:#ffe6e6;"/g,'class="status-removed"')+"</section>"}catch(e){return""}},_escape:function(e){return(""+(e||"")).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},_escapeAndConvertToHtml:function(e){return this._escape(e).replace(/(?:\r\n|\r|\n)/g,"<br/>").replace(/\t/g," ").replace(/\s/g," ")}}}})]).default; | ||
module.exports=(function(e){function t(i){if(n[i])return n[i].exports;var s=n[i]={i:i,l:!1,exports:{}};return e[i].call(s.exports,s,s.exports,t),s.l=!0,s.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=16)})([(function(e,t){e.exports=require("path")}),(function(e,t,n){function i(e){function t(t){return p.apply(e,t)}function n(e,t){return this instanceof n?(m.apply(this,arguments),this):n.apply(Object.create(n.prototype),arguments)}function r(e,t){return this instanceof r?(y.apply(this,arguments),this):r.apply(Object.create(r.prototype),arguments)}function u(e,t,n,i){function r(e,t,n,i){return g(e,t,n,(function(a,c){!a||"EMFILE"!==a.code&&"ENFILE"!==a.code?("function"==typeof i&&i.apply(this,arguments),o()):s([r,[e,t,n,i]])}))}return"function"==typeof n&&(i=n,n=null),r(e,t,n,i)}a(e),e.gracefulify=i,e.FileReadStream=n,e.FileWriteStream=r,e.createReadStream=function(e,t){return new n(e,t)},e.createWriteStream=function(e,t){return new r(e,t)};var l=e.readFile;e.readFile=function(e,t,n){function i(e,t,n){return l(e,t,(function(r){!r||"EMFILE"!==r.code&&"ENFILE"!==r.code?("function"==typeof n&&n.apply(this,arguments),o()):s([i,[e,t,n]])}))}return"function"==typeof t&&(n=t,t=null),i(e,t,n)};var f=e.writeFile;e.writeFile=function(e,t,n,i){function r(e,t,n,i){return f(e,t,n,(function(a){!a||"EMFILE"!==a.code&&"ENFILE"!==a.code?("function"==typeof i&&i.apply(this,arguments),o()):s([r,[e,t,n,i]])}))}return"function"==typeof n&&(i=n,n=null),r(e,t,n,i)};var d=e.appendFile;d&&(e.appendFile=function(e,t,n,i){function r(e,t,n,i){return d(e,t,n,(function(a){!a||"EMFILE"!==a.code&&"ENFILE"!==a.code?("function"==typeof i&&i.apply(this,arguments),o()):s([r,[e,t,n,i]])}))}return"function"==typeof n&&(i=n,n=null),r(e,t,n,i)});var p=e.readdir;if(e.readdir=function(e,n,i){var r=[e];return"function"!=typeof n?r.push(n):i=n,r.push((function(e,n){n&&n.sort&&n.sort(),!e||"EMFILE"!==e.code&&"ENFILE"!==e.code?("function"==typeof i&&i.apply(this,arguments),o()):s([t,[r]])})),t(r)},"v0.8"===process.version.substr(0,4)){var h=c(e);n=h.ReadStream,r=h.WriteStream}var m=e.ReadStream;n.prototype=Object.create(m.prototype),n.prototype.open=function(){var e=this;u(e.path,e.flags,e.mode,(function(t,n){t?(e.autoClose&&e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n),e.read())}))};var y=e.WriteStream;r.prototype=Object.create(y.prototype),r.prototype.open=function(){var e=this;u(e.path,e.flags,e.mode,(function(t,n){t?(e.destroy(),e.emit("error",t)):(e.fd=n,e.emit("open",n))}))},e.ReadStream=n,e.WriteStream=r;var g=e.open;return e.open=u,e}function s(e){f("ENQUEUE",e[0].name,e[1]),u.push(e)}function o(){var e=u.shift();e&&(f("RETRY",e[0].name,e[1]),e[0].apply(null,e[1]))}var r=n(5),a=n(19),c=n(21),u=[],l=n(23),f=function(){};l.debuglog&&(f=l.debuglog("gfs4")),e.exports=i(n(9)),process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&(e.exports=i(r)),e.exports.close=r.close=(function(e){return function(t,n){return e.call(r,t,(function(e){e||o(),"function"==typeof n&&n.apply(this,arguments)}))}})(r.close),e.exports.closeSync=r.closeSync=(function(e){return function(t){var n=e.apply(r,arguments);return o(),n}})(r.closeSync)}),(function(e,t,n){"use strict";t.fromCallback=function(e){return Object.defineProperty((function(){if("function"!=typeof arguments[arguments.length-1])return new Promise((t,n)=>{arguments[arguments.length]=((e,i)=>{if(e)return n(e);t(i)}),arguments.length++,e.apply(this,arguments)});e.apply(this,arguments)}),"name",{value:e.name})},t.fromPromise=function(e){return Object.defineProperty((function(){const t=arguments[arguments.length-1];if("function"!=typeof t)return e.apply(this,arguments);e.apply(this,arguments).then(e=>t(null,e),t)}),"name",{value:e.name})}}),(function(e,t,n){"use strict";const i=(0,n(2).fromCallback)(n(27)),s=n(28);e.exports={mkdirs:i,mkdirsSync:s,mkdirp:i,mkdirpSync:s,ensureDir:i,ensureDirSync:s}}),(function(e,t,n){"use strict";const i=n(2).fromPromise,s=n(8);e.exports={pathExists:i((function(e){return s.access(e).then(()=>!0).catch(()=>!1)})),pathExistsSync:s.existsSync}}),(function(e,t){e.exports=require("fs")}),(function(e,t,n){"use strict";const i=n(2).fromCallback,s=n(31);e.exports={remove:i(s),removeSync:s.sync}}),(function(e,t,n){"use strict";const i=n(2).fromCallback,s=n(33);e.exports={readJson:i(s.readFile),readJsonSync:s.readFileSync,writeJson:i(s.writeFile),writeJsonSync:s.writeFileSync}}),(function(e,t,n){const i=n(2).fromCallback,s=n(1),o=["access","appendFile","chmod","chown","close","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchown","link","lstat","mkdir","open","readFile","readdir","readlink","realpath","rename","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"];"function"==typeof s.mkdtemp&&o.push("mkdtemp"),Object.keys(s).forEach(e=>{t[e]=s[e]}),o.forEach(e=>{t[e]=i(s[e])}),t.exists=function(e,t){return"function"==typeof t?s.exists(e,t):new Promise(t=>s.exists(e,t))},t.read=function(e,t,n,i,o,r){return"function"==typeof r?s.read(e,t,n,i,o,r):new Promise((r,a)=>{s.read(e,t,n,i,o,(e,t,n)=>{if(e)return a(e);r({bytesRead:t,buffer:n})})})},t.write=function(e,t,n,i,o,r){return"function"==typeof arguments[arguments.length-1]?s.write(e,t,n,i,o,r):"string"==typeof t?new Promise((o,r)=>{s.write(e,t,n,i,(e,t,n)=>{if(e)return r(e);o({bytesWritten:t,buffer:n})})}):new Promise((r,a)=>{s.write(e,t,n,i,o,(e,t,n)=>{if(e)return a(e);r({bytesWritten:t,buffer:n})})})}}),(function(e,t,n){"use strict";var i=n(5);e.exports=(function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Object)t={__proto__:e.__proto__};else var t=Object.create(null);return Object.getOwnPropertyNames(e).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n))})),t})(i)}),(function(e,t){e.exports=require("assert")}),(function(e,t,n){var i=n(1),s=n(0),o=n(26);e.exports=function(e,t,n,r){function a(e){if(L++,E)if(E instanceof RegExp){if(console.warn("Warning: fs-extra: Passing a RegExp filter is deprecated, use a function"),!E.test(e))return S(!0)}else if("function"==typeof E&&!E(e,t))return S(!0);return c(e)}function c(e){q++,(T?i.stat:i.lstat)(e,(function(t,n){if(t)return _(t);var i={name:e,mode:n.mode,mtime:n.mtime,atime:n.atime,stats:n};return n.isDirectory()?d(i):n.isFile()||n.isCharacterDevice()||n.isBlockDevice()?u(i):n.isSymbolicLink()?m(e):void 0}))}function u(e){var t=e.name.replace(w,b.replace("$","$$$$"));k(t,(function(n){n?l(e,t):C?f(t,(function(){l(e,t)})):O?_(Error(t+" already exists")):S()}))}function l(e,t){var n=i.createReadStream(e.name),s=i.createWriteStream(t,{mode:e.mode});n.on("error",_),s.on("error",_),x?x(n,s,e):s.on("open",(function(){n.pipe(s)})),s.once("close",(function(){i.chmod(t,e.mode,(function(n){if(n)return _(n);P?o.utimesMillis(t,e.atime,e.mtime,(function(e){return e?_(e):S()})):S()}))}))}function f(e,t){i.unlink(e,(function(e){return e?_(e):t()}))}function d(e){var t=e.name.replace(w,b.replace("$","$$$$"));k(t,(function(n){if(n)return p(e,t);h(e.name)}))}function p(e,t){i.mkdir(t,e.mode,(function(n){if(n)return _(n);i.chmod(t,e.mode,(function(t){if(t)return _(t);h(e.name)}))}))}function h(e){i.readdir(e,(function(t,n){return t?_(t):(n.forEach((function(t){a(s.join(e,t))})),S())}))}function m(e){var t=e.replace(w,b);i.readlink(e,(function(e,n){if(e)return _(e);y(n,t)}))}function y(e,t){T&&(e=s.resolve(v,e)),k(t,(function(n){if(n)return g(e,t);i.readlink(t,(function(n,i){return n?_(n):(T&&(i=s.resolve(v,i)),i===e?S():f(t,(function(){g(e,t)})))}))}))}function g(e,t){i.symlink(e,t,(function(e){return e?_(e):S()}))}function k(e,t){i.lstat(e,(function(e){return t(!!e&&"ENOENT"===e.code)}))}function _(e){if(!N&&void 0!==r)return N=!0,r(e)}function S(e){if(e||q--,M++,L===M&&0===q&&void 0!==r)return r(null)}r||(r=n,n={});var v=process.cwd(),w=s.resolve(v,e),b=s.resolve(v,t),E=n.filter,x=n.transform,C=n.overwrite;void 0===C&&(C=n.clobber),void 0===C&&(C=!0);var O=n.errorOnExist,T=n.dereference,P=!0===n.preserveTimestamps,L=0,M=0,q=0,N=!1;a(w)}}),(function(e,t){e.exports=require("os")}),(function(e,t,n){"use strict";function i(e){return(e=s.normalize(s.resolve(e)).split(s.sep)).length>0?e[0]:null}const s=n(0),o=/[<>:"|?*]/;e.exports={getRootPath:null,invalidWin32Path:function(e){const t=i(e);return e=e.replace(t,""),o.test(e)}}}),(function(e,t,n){e.exports={copySync:n(29)}}),(function(e,t){e.exports=function(e){if("function"==typeof Buffer.allocUnsafe)try{return Buffer.allocUnsafe(e)}catch(t){return new Buffer(e)}return new Buffer(e)}}),(function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const i=n(0),s=n(17),o=n(12),r=300,a=3500,c=500,u=50,l="quokka";let f=0;class d{activate(e){var t=this;const i=this;this._$=e.atomViews.$,this._View=e.atomViews.View,this._TextEditorView=e.atomViews.TextEditorView,this._statusBar=e.statusBar,this._Session=e.extendedCoreClient.Session,this._dmp=e.extendedCoreClient.dmp,this._utils=e.extendedCoreClient.utils,this._CompositeDisposable=e.atom.CompositeDisposable,(this._disposables=new this._CompositeDisposable).add(atom.commands.add("atom-workspace",{"quokka:toggle-output":function(){return t.togglePanel()},"quokka:focus-output":function(){return t.togglePanel(!0)},"quokka:create-javascript-file":function(){return t._newFile("js")},"quokka:create-typescript-file":function(){return t._newFile("ts")},"quokka:stop-all":function(){return t._stopAll()},"quokka:manage-license":function(e){return t._showLicense()},"quokka:switch-to-pro-edition":function(e){return t._switchEdition(!0,t._activeSession)},"quokka:switch-to-community-edition":function(e){return t._switchEdition(!1,t._activeSession)}})),this._disposables.add(atom.commands.add("atom-text-editor",{"quokka:make-quokka-from-existing-file":function(e){i.makeQuokkaFromExistingFile(d._getEditor(e,this))},"quokka:stop-current":function(e){i.stopCurrent(d._getEditor(e,this))},"quokka:install-missing-package-only-for-quokka-file":function(e){i._installPackage(d._getEditor(e,this))},"quokka:install-missing-package-into-project":function(e){i._installPackage(d._getEditor(e,this),!0)}})),this._activeSessions=[],this._setupEnvironment(),(this._statusElement=this._$('<a tabindex="-1" style="outline:0;" />')).click((function(){return t.togglePanel()})),this._statusBar&&(this._statusBarTile=this._statusBar.addRightTile({item:this._statusElement[0],priority:-Infinity})),this._disposables.add({dispose:function(){t._stopAll(),i._panelView&&(i._panelView.hide(),i._panelView.deactivate()),i._statusBarTile&&i._statusBarTile.destroy()}}),this._panelView=new(n(46)(this._$,this._View,this._CompositeDisposable,this._dmp))({navigate:_.bind(this._navigate,this),installPackage:_.bind(this._installPackage,this),hasOpenedProject:atom.project.getPaths().length})}_showLicense(e){var t=this;const i=new(n(48)(this._$,this._View,this._TextEditorView,this._CompositeDisposable,s));let o=atom.workspace.addModalPanel({item:i});i.display({keyFilePath:this._lkp,parseKey:this._utils.parseKey,closeView:function(n){o.destroy(),n&&(e&&e.dismiss(),t._switchEdition(!0,t._activeSession))}}),setImmediate((function(){return i.focusView()}))}_switchEdition(e,t){const n=this._loadQuokkaConfig();if(n.pro=!!e,this._saveQuokkaConfig(n),t&&!t.isDisposed()){const e=t.editor;this._stopAll(),this._start(e)}}deactivate(){this._disposables.dispose()}togglePanel(e){e?this._panelView.focusPanel():this._panelView.togglePanel()}makeQuokkaFromExistingFile(e){if(!e)return;const t=this._activeSessions.find((function(t){return t.editor===e}));t&&this._stop(t),this._start(e)}stopCurrent(e){const t=this._activeSessions.find((function(t){return t.editor===e}))||this._activeSession;t&&this._stop(t)}_newFile(e){var t=this;const n=`_${e}Grammar`;this[n]||(this[n]=atom.grammars.getGrammars().find((function(t){return t.fileTypes.find((function(t){return t===e}))}))),atom.workspace.open("").then((function(e){t[n]&&e.setGrammar(t[n]),t._start(e)}))}_navigate(e,t){if(!e||!this._activeSession)return;let n,o;_.isNumber(t)?n=t:_.isArray(t)?(n=t[0],o=t[1]):_.isString(t)&&(n=(t=t.split(":"))[0]&&parseInt(t[0],10),o=t[1]&&parseInt(t[1],10)),_.isNumber(n)?n-=1:n=void 0,_.isNumber(o)||(o=void 0);const r=this._activeSession.editor,a=this._getProjectFile(r);if(e===this._activeSession.fileName)r.setCursorBufferPosition([n,o]),atom.workspace.paneForItem(r).activateItem(r),atom.workspace.getActivePane().activate();else if(a.root){const t=i.resolve(a.root,e);s.existsSync(t)&&atom.workspace.open(t,{initialLine:n,initialColumn:o})}}_installPackage(e,t){if(!e&&this._activeSession&&(e=this._activeSession.editor),!e)return;if(!this._activeSession)return void atom.notifications.addWarning(`Cannot install a package because quokka is not running.`,{dismissable:!0});const n=this._getProjectFile(e),i=n&&n.root;if(t&&!i)return void atom.notifications.addWarning(`Cannot install a package into project because quokka is running outside of an opened project.`);if(!this._pro)return void this._showNotification({text:"The feature is only available in 'Pro' edition.",type:"info",suggestProEdition:!0});if(!this._activeSession.stats||!this._activeSession.stats.errors)return void atom.notifications.addWarning(`No missing packages to install.`);const s=_.find(this._activeSession.stats.errors,(function(e){return e.missingPackage}));s&&s.missingPackage?(this._updateStatus(this._activeSession,"progress"),this._activeSession.runTests({file:this._activeSession.fileName,installPackage:{name:s.missingPackage,local:t}})):atom.notifications.addWarning(`No missing packages to install.`)}_getProjectFile(e){let t,n;var i=atom.project.relativizePath(e.getPath());return t=i[0],n=i[1],t&&n?{file:n,root:t}:(t=atom.project.getPaths()[0]||void 0)?{root:t}:void 0}_start(e){var t=this;this._updateConfigurationFromSettings();const n=new this._Session,i=new this._CompositeDisposable;i.add(atom.workspace.observeTextEditors((function(t){{if(t===e)return;const s=t.onDidSave((function(){return n.runTests({file:n.fileName})})),o={dispose:function(){t.disposables.remove(s),t.disposables.remove(o)}};t.disposables.add(o),t.disposables.add(s),i.add(s)}}))),n.disposable=i,n.id=++f,n.changes=[],n.fileName=l+d._getFileType(e);const s=this._getProjectFile(e),o=s&&s.root;s&&s.file&&s.root&&(n.fileName=s.file),n.editor=e,n.liveConsoleOutput=[],n.changedCursorPositionAtLeastOnce=!1,n.quokkaCoverageMarkers=Object.create(null),n.quokkaCoverageMarkerIdsToLineIds=Object.create(null),n.quokkaLineMessagesCSS=document.createElement("style"),n.quokkaLineMessagesCSS.type="text/css",n.quokkaLineMessagesCSS._lines=0,n.quokkaLineMessagesHideCSS=document.createElement("style"),n.quokkaLineMessagesHideCSS.type="text/css",n.quokkaLineMessagesHideCSS._lines={};const a=atom.views.getView(e).component.rootElement?atom.views.getView(e).component.rootElement.parentNode.children[0]:document.head;a.appendChild(n.quokkaLineMessagesCSS),a.appendChild(n.quokkaLineMessagesHideCSS);const c=e.addGutter({name:"quokka"}),u=this._$(atom.views.getView(c));n.gutter=c,this._activeSessions.push(n);const p={dispose:function(){e.disposables.remove(p),t._stop(n)}};e.disposables.add(p),i.add(e.getBuffer().onDidChange((function(t){n.isDisposed()||(t={start:Math.min(t.newRange.start.row,t.oldRange.start.row),end:Math.max(t.newRange.end.row,t.oldRange.end.row)},n.changes.push(t),n.changedCursorPositionAtLeastOnce&&d._hideInlineMessages(t,e,n))}))),i.add(e.onDidChangeCursorPosition((function(){n.changedCursorPositionAtLeastOnce=!0}))),i.add(e.onDidStopChanging((function(i){n.isDisposed()||!n.changes.length||i&&i.changes&&!i.changes.length&&!n.changedCursorPositionAtLeastOnce||(clearTimeout(t._statusUpdateTimeout),t._statusUpdateTimeout=setTimeout((function(){return t._updateStatus(n,"progress")}),r),n.fileChangedInEditor(n.fileName,e.getBuffer().getText(),{start:_.chain(n.changes).map((function(e){return e.start})).min().value()+1,end:_.chain(n.changes).map((function(e){return e.end})).max().value()+1}),n.changes=[])}))),n.start({localRoot:o,quokkaFolder:this._quokkaFolder,client:"Atom",fileName:n.fileName}),n.on("notification",(function(e){return t._showNotification(e)})),n.on("busy",(function(){clearTimeout(t._statusUpdateTimeout),t._statusUpdateTimeout=setTimeout((function(){return t._updateStatus(n,"progress")}),r),n.liveConsoleOutput=[],t._scheduleSessionIdleTimeout(n),t._panelView.newResultsExpectedSoon()})),n.on("stopped",(function(e){t._stop(n),t._hideStatusIndicator(),e.deactivate&&(t._stopAll(),atom.packages.getLoadedPackage("atom-quokka").deactivate())})),n.on("started",(function(){console.log(`[Quokka] #${n.id} Quokka.js started`),t._panelView.showPanel()})),n.on("stats",(function(e){e&&(t._panelView.resultsReport(e),n.stats=e),t._updateStatus(n),delete n.liveConsoleOutput,d._sessionIsActive(n)})),n.on("live",(function(e){n.fileChangedInEditor(n.fileName,n.editor.getBuffer().getText()),n.fileOpenedInEditor(n.fileName)})),n.on("configChanged",(function(e){t._pro=e&&e.pro,t._panelView.setHeaderData(e)})),n.on("documentUpdates",(function(e){return t._updateDocument(n,e)})),n.on("consoleError",(function(e){e&&e.split("\n").forEach((function(e){return e&&console.error(`[Quokka] #${n.id} ${e}`)})),n.emit("stats",e)})),n.on("consoleLog",(function(e){return e&&e.split("\n").forEach((function(e){return e&&console.log(`[Quokka] #${n.id} ${e}`)}))})),n.on("consoleOutput",(function(e){return t._displayLiveConsoleOutput(n,e)})),this._updateStatus(n,"progress"),i.add({dispose:function(){e.disposables.remove(p),u.off(),c.destroy(),_.each(n.quokkaCoverageMarkers,(function(t){return e.destroyMarker(t.id)})),n.stop(),delete n.editor,delete n.gutter,delete n.disposable,delete n.quokkaCoverageMarkers,delete n.quokkaCoverageMarkerIdsToLineIds,delete n.quokkaLineMessagesCSS,delete n.quokkaLineMessagesHideCSS,delete n.renderingQueue,n===t._activeSession&&delete t._activeSession,t._panelView.clearResults(),console.log(`[Quokka] #${n.id} Quokka.js stopped`)}})}_stopAll(){var e=this;this._activeSessions.slice().forEach((function(t){return e._stop(t)}))}_displayLiveConsoleOutput(e,t){var n=this;if(!e.liveConsoleOutput)return;const i=e.liveConsoleOutput.started;e.liveConsoleOutput=e.liveConsoleOutput.concat(t),e.liveConsoleOutput.started=i,e.liveConsoleOutput.started?e.displayLiveConsoleOutputTimeout||this._displayPendingLiveConsoleOutput(e):(e.liveConsoleOutput.started=!0,e.displayLiveConsoleOutputTimeout=setTimeout((function(){delete e.displayLiveConsoleOutputTimeout,e.liveConsoleOutput&&e.liveConsoleOutput.length&&(n._panelView.showHeaderOnly(),n._displayPendingLiveConsoleOutput(e))}),150))}_displayPendingLiveConsoleOutput(e){this._panelView.appendConsoleMessages(e.liveConsoleOutput),e.liveConsoleOutput.length=0}_hideStatusIndicator(){this._statusElement.text(""),this._statusElement.removeClass()}_updateStatus(e,t){let n;clearTimeout(this._statusUpdateTimeout),t||(t=_.isString(e.stats)?"failing":e.stats?e.stats.errors.length?"failing":"passing":"failing",n=e.stats&&e.stats.time),t&&(this._hideStatusIndicator(),"progress"===t?this._statusElement.addClass("quokka-status progress"):(this._statusElement.addClass("inline-block"),this._statusElement.text(("failing"===t?`\u2717`:`\u2714`)+(n?` ${n} ms`:"")))),this._activeSession=e}_scheduleSessionIdleTimeout(e){var t=this;d._clearIdleSessionTimeout(e),e.idleTimeout=setTimeout((function(){return t._sessionIsIdle(e)}),a)}_sessionIsIdle(e){e.gutter.hide(),delete e.stats,e.liveConsoleOutput&&!e.liveConsoleOutput.started&&this._panelView.showHeaderOnly()}_updateDocument(e,t){if(e.isDisposed())return;const n=e.editor,i=t[e.fileName];if(!i||!i.lines)return;const s=e.renderingQueue||{operations:[]};e.renderingQueue=s,i.fullUpdate&&(_.each(e.quokkaCoverageMarkers,(function(e){return n.destroyMarker(e.id)})),e.quokkaCoverageMarkers=Object.create(null),e.quokkaCoverageMarkerIdsToLineIds=Object.create(null),s.operations=[]);let o=0;_.each(i.lines,(function(t){o++;let i=e.quokkaCoverageMarkers[t.id],r=!1;i?t.del?(s.operations.push({editor:n,type:"delete",id:i.id,line:t}),r=!1):t.changed||t.num!==i.getBufferRange().start.row+1?(s.operations.push({editor:n,type:"delete",id:i.id,line:t}),r=!0):r=!1:t.del?(s.operations.push({editor:n,type:"delete",line:t}),r=!1):r=!0,r&&s.operations.push({editor:n,type:"create",line:t})})),i.allLines&&e.quokkaLineMessagesCSS._lines>o&&d._cleanUpLineMessagesCss(e),this._processMarkerOperationQueue(e)}_processMarkerOperationQueue(e){if(e.isDisposed()||!e.renderingQueue)return;let t=e.renderingQueue,n=t.operations.splice(0,c);if(n.length&&(e.quokkaLineMessagesCSS.innerHTML+=_.reduce(n,(function(t,n){let i=d._performMarkerOperation(e,n);return _.isString(i)&&(t+=i,e.quokkaLineMessagesCSS._lines++),t}),"")),e.renderingQueue.operations.length||e.changes&&e.changes.length||d._resetHideCSS(e),!t.operations.length)return void delete e.renderingQueue;let i=Math.floor(u*(n.length/c));setTimeout(_.bind(this._processMarkerOperationQueue,this,e),i)}_stop(e){e.disposable.dispose(),this._activeSessions.splice(this._activeSessions.findIndex((function(t){return t===e})),1),this._hideStatusIndicator(),this._panelView.hide()}_setupEnvironment(){this._quokkaFolder=i.join(o.homedir(),".quokka"),this._lkp=i.join(this._quokkaFolder,".qlc");try{s.existsSync(this._quokkaFolder)||s.mkdirSync(this._quokkaFolder)}catch(e){}const e=this._loadQuokkaConfig();!0!==e.pro&&!1!==e.pro&&this._showNotification({text:`You are using Quokka.js 'Community' edition (free). Quokka.js 'Pro' edition with some advanced features is also available.<br/><br/><a href="#" class="use-community-link">Use 'Community' features only</a><br/><a href="#" class="use-pro-link">Try 'Pro' features as well</a><br/><a href="https://quokkajs.com/pro">Learn more about 'Pro' features</a>`,type:"info"})}_showNotification(e){var t=this;let n=e.text,i=e.type;e.suggestProEdition?n+=`<br/><br/><a href="#" class="use-pro-link-start">Switch to 'Pro' edition</a><br/><a href="https://quokkajs.com/pro">Learn more about 'Pro' features</a>`:~n.indexOf("purchase")&&(n+=`<br/><a href="#" class="use-community-link">Switch to 'Community' edition</a>`),0===n.indexOf("Can not start node.js process")&&(n=n.replace(/<[^>]*>/g,""),n+=`<br/><br/>You may use the <a href="https://quokkajs.com/docs/configuration.html#nodejs-version">"node" setting</a> to configure the location of node.`);const s=atom.notifications["add"+i.charAt(0).toUpperCase()+i.substr(1)](n,{dismissable:!0}),o=atom.views.getView(s);let r=this._$(o.element);r.length||(r=this._$(o));let a;return r.on("mousedown",".use-community-link",(function(){t._switchEdition(!1,t._activeSession),s.dismiss()})),r.on("mousedown",".use-pro-link",(function(){t._switchEdition(!0,t._activeSession),s.dismiss()})),r.on("mousedown",".use-pro-link-start",(function(){t._switchEdition(!0,t._activeSession),s.dismiss()})),r.on("mousedown",".activate-link",(function(){t._showLicense(s)})),r.on("mousedown",".continue-trial-link",(function(){s.dismiss(),t._activeSession&&!t._activeSession.isDisposed()&&t._activeSession.continueTrial()})),a=s.onDidDismiss((function(){a&&a.dispose(),r.off("mousedown")})),s}_quokkaConfigPath(){return i.join(this._quokkaFolder,"config.json")}_loadQuokkaConfig(){const e=this._quokkaConfigPath();let t,n={};try{t=""+s.readFileSync(e),n=JSON.parse(t)}catch(e){t&&this._showNotification({text:"Looks like your quokka config.json file has invalid syntax, it should be a valid JSON file.",type:"warning"})}return n}_saveQuokkaConfig(e){s.writeFileSync(this._quokkaConfigPath(),JSON.stringify(e))}static _clearIdleSessionTimeout(e){e.idleTimeout&&(clearTimeout(e.idleTimeout),delete e.idleTimeout)}static _sessionIsActive(e){d._clearIdleSessionTimeout(e),!e.gutter.visible&&e.gutter.show()}static _markerOptions(){return{invalidate:"never"}}static _resetHideCSS(e){e.quokkaLineMessagesHideCSS.innerHTML="",e.quokkaLineMessagesHideCSS._lines={}}static _performMarkerOperation(e,t){const n=e.editor;let i=t.id,s=t.line;switch(t.type){case"create":{let t=n.markBufferPosition([s.num-1,0],d._markerOptions());e.quokkaCoverageMarkers[s.id]=t,e.quokkaCoverageMarkerIdsToLineIds[t.id]=s.id;let i=document.createElement("span");i.setAttribute("data-line",s.num),n.gutterWithName("quokka").decorateMarker(t,{class:"quokka-cov-"+s.state,item:i});let o=d._lineMessageCss(s);if(o)return n.decorateMarker(t,{type:"line",class:"ql"+(s.err?"e":"c")}),n.decorateMarker(t,{type:"line",class:"ql"+s.id}),o;break}case"delete":if(!i){let t=e.quokkaCoverageMarkers[s.id];t&&(i=t.id)}_.isUndefined(i)||(n.destroyMarker(i),delete e.quokkaCoverageMarkers[s.id],delete e.quokkaCoverageMarkerIdsToLineIds[i])}}static _lineMessageCss(e){if(e.err||e.log){let t=d._cssEscape(e.err||e.log);return".ql"+e.id+'::after{content:" '+t+'";}\n'}}static _cleanUpLineMessagesCss(e){let t=Object.create(null),n=0,i=(e.quokkaLineMessagesCSS.innerHTML||"").split("\n");i.reverse(),_.each(i,(function(i){try{if(!i)return;let s=parseInt(i.substring(3,i.indexOf(":")),10);!t[s]&&e.quokkaCoverageMarkers[s]&&(t[s]=i,n++)}catch(e){}})),e.quokkaLineMessagesCSS.innerHTML=_.reduce(t,(function(e,t){return e+=t+"\n"}),""),e.quokkaLineMessagesCSS._lines=n}static _hideInlineMessages(e,t,n){if(t!==atom.workspace.getActiveTextEditor())return;let i="";for(let s=Math.min(e.start,e.end),o=Math.min(s+5,Math.max(e.start,e.end)),r=s;r<=o;r++)_.each(t.findMarkers({startBufferRow:r}),(function(e){let t=n.quokkaCoverageMarkerIdsToLineIds[e.id];t&&!n.quokkaLineMessagesHideCSS._lines[t]&&(i+=d._lineWithoutMessage(t),n.quokkaLineMessagesHideCSS._lines[t]=!0)}));i&&(n.quokkaLineMessagesHideCSS.innerHTML+=i)}static _lineWithoutMessage(e){return".ql"+e+'::after{content:"";}\n'}static _getFileType(e){for(let t=0,n=e.getGrammar().fileTypes;t<n.length;t++){let e=n[t];if("ts"===e)return".ts";if("tsx"===e)return".tsx"}return".js"}static _getEditor(e,t){let n;return e&&e.target&&e.target.getModel?n=e.target.getModel():t&&t.getModel&&(n=t.getModel()),n&&n.getPath?n:n&&n.getActiveTextEditor?n.getActiveTextEditor():atom.workspace.getActiveTextEditor()}static _cssEscape(e){const t=e+"",n=t.length;let i,s=-1,o="";const r=t.charCodeAt(0);for(;++s<n;)(i=t.charCodeAt(s))>=1&&i<=31||127==i||0==s&&i>=48&&i<=57||1==s&&i>=48&&i<=57&&45==r?o+="\\"+i.toString(16)+" ":o+=i>=128||45==i||95==i||i>=48&&i<=57||i>=65&&i<=90||i>=97&&i<=122?t.charAt(s):"\\"+t.charAt(s);return o}_updateConfigurationFromSettings(){let e="";try{e=this._loadQuokkaConfig().node}catch(e){}e?process.env.WALLABY_NODE=e:delete process.env.WALLABY_NODE}}t.default=new d}),(function(e,t,n){"use strict";const i=n(18),s={};i(s,n(8)),i(s,n(24)),i(s,n(14)),i(s,n(3)),i(s,n(6)),i(s,n(32)),i(s,n(36)),i(s,n(37)),i(s,n(38)),i(s,n(39)),i(s,n(45)),i(s,n(4)),e.exports=s}),(function(e,t,n){"use strict";e.exports=function(){const e=[].slice.call(arguments).filter(e=>e),t=e.shift();return e.forEach(e=>{Object.keys(e).forEach(n=>{t[n]=e[n]})}),t}}),(function(e,t,n){function i(e){e.lchmod=function(t,n,i){e.open(t,p.O_WRONLY|p.O_SYMLINK,n,(function(t,s){t?i&&i(t):e.fchmod(s,n,(function(t){e.close(s,(function(e){i&&i(t||e)}))}))}))},e.lchmodSync=function(t,n){var i,s=e.openSync(t,p.O_WRONLY|p.O_SYMLINK,n),o=!0;try{i=e.fchmodSync(s,n),o=!1}finally{if(o)try{e.closeSync(s)}catch(e){}else e.closeSync(s)}return i}}function s(e){p.hasOwnProperty("O_SYMLINK")?(e.lutimes=function(t,n,i,s){e.open(t,p.O_SYMLINK,(function(t,o){t?s&&s(t):e.futimes(o,n,i,(function(t){e.close(o,(function(e){s&&s(t||e)}))}))}))},e.lutimesSync=function(t,n,i){var s,o=e.openSync(t,p.O_SYMLINK),r=!0;try{s=e.futimesSync(o,n,i),r=!1}finally{if(r)try{e.closeSync(o)}catch(e){}else e.closeSync(o)}return s}):(e.lutimes=function(e,t,n,i){i&&process.nextTick(i)},e.lutimesSync=function(){})}function o(e){return e?function(t,n,i){return e.call(d,t,n,(function(e){f(e)&&(e=null),i&&i.apply(this,arguments)}))}:e}function r(e){return e?function(t,n){try{return e.call(d,t,n)}catch(e){if(!f(e))throw e}}:e}function a(e){return e?function(t,n,i,s){return e.call(d,t,n,i,(function(e){f(e)&&(e=null),s&&s.apply(this,arguments)}))}:e}function c(e){return e?function(t,n,i){try{return e.call(d,t,n,i)}catch(e){if(!f(e))throw e}}:e}function u(e){return e?function(t,n){return e.call(d,t,(function(e,t){if(!t)return n.apply(this,arguments);t.uid<0&&(t.uid+=4294967296),t.gid<0&&(t.gid+=4294967296),n&&n.apply(this,arguments)}))}:e}function l(e){return e?function(t){var n=e.call(d,t);return n.uid<0&&(n.uid+=4294967296),n.gid<0&&(n.gid+=4294967296),n}:e}function f(e){return!e||"ENOSYS"===e.code||!(process.getuid&&0===process.getuid()||"EINVAL"!==e.code&&"EPERM"!==e.code)}var d=n(9),p=n(20),h=process.cwd,m=null,y=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){return m||(m=h.call(process)),m};try{process.cwd()}catch(e){}var g=process.chdir;process.chdir=function(e){m=null,g.call(process,e)},e.exports=function(e){p.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)&&i(e),e.lutimes||s(e),e.chown=a(e.chown),e.fchown=a(e.fchown),e.lchown=a(e.lchown),e.chmod=o(e.chmod),e.fchmod=o(e.fchmod),e.lchmod=o(e.lchmod),e.chownSync=c(e.chownSync),e.fchownSync=c(e.fchownSync),e.lchownSync=c(e.lchownSync),e.chmodSync=r(e.chmodSync),e.fchmodSync=r(e.fchmodSync),e.lchmodSync=r(e.lchmodSync),e.stat=u(e.stat),e.fstat=u(e.fstat),e.lstat=u(e.lstat),e.statSync=l(e.statSync),e.fstatSync=l(e.fstatSync),e.lstatSync=l(e.lstatSync),e.lchmod||(e.lchmod=function(e,t,n){n&&process.nextTick(n)},e.lchmodSync=function(){}),e.lchown||(e.lchown=function(e,t,n,i){i&&process.nextTick(i)},e.lchownSync=function(){}),"win32"===y&&(e.rename=(function(t){return function(n,i,s){var o=Date.now(),r=0;t(n,i,(function a(c){if(c&&("EACCES"===c.code||"EPERM"===c.code)&&Date.now()-o<6e4)return setTimeout((function(){e.stat(i,(function(e,o){e&&"ENOENT"===e.code?t(n,i,a):s(c)}))}),r),void(r<100&&(r+=10));s&&s(c)}))}})(e.rename)),e.read=(function(t){return function(n,i,s,o,r,a){var c;if(a&&"function"==typeof a){var u=0;c=function(l,f,d){if(l&&"EAGAIN"===l.code&&u<10)return u++,t.call(e,n,i,s,o,r,c);a.apply(this,arguments)}}return t.call(e,n,i,s,o,r,c)}})(e.read),e.readSync=(function(t){return function(n,i,s,o,r){for(var a=0;;)try{return t.call(e,n,i,s,o,r)}catch(e){if("EAGAIN"===e.code&&a<10){a++;continue}throw e}}})(e.readSync)}}),(function(e,t){e.exports=require("constants")}),(function(e,t,n){var i=n(22).Stream;e.exports=function(e){function t(n,s){if(!(this instanceof t))return new t(n,s);i.call(this);var o=this;this.path=n,this.fd=null,this.readable=!0,this.paused=!1,this.flags="r",this.mode=438,this.bufferSize=65536,s=s||{};for(var r=Object.keys(s),a=0,c=r.length;a<c;a++){var u=r[a];this[u]=s[u]}if(this.encoding&&this.setEncoding(this.encoding),void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(void 0===this.end)this.end=Infinity;else if("number"!=typeof this.end)throw TypeError("end must be a Number");if(this.start>this.end)throw Error("start must be <= end");this.pos=this.start}null===this.fd?e.open(this.path,this.flags,this.mode,(function(e,t){if(e)return o.emit("error",e),void(o.readable=!1);o.fd=t,o.emit("open",t),o._read()})):process.nextTick((function(){o._read()}))}function n(t,s){if(!(this instanceof n))return new n(t,s);i.call(this),this.path=t,this.fd=null,this.writable=!0,this.flags="w",this.encoding="binary",this.mode=438,this.bytesWritten=0,s=s||{};for(var o=Object.keys(s),r=0,a=o.length;r<a;r++){var c=o[r];this[c]=s[c]}if(void 0!==this.start){if("number"!=typeof this.start)throw TypeError("start must be a Number");if(this.start<0)throw Error("start must be >= zero");this.pos=this.start}this.busy=!1,this._queue=[],null===this.fd&&(this._open=e.open,this._queue.push([this._open,this.path,this.flags,this.mode,void 0]),this.flush())}return{ReadStream:t,WriteStream:n}}}),(function(e,t){e.exports=require("stream")}),(function(e,t){e.exports=require("util")}),(function(e,t,n){const i=n(2).fromCallback;e.exports={copy:i(n(25))}}),(function(e,t,n){"use strict";const i=n(1),s=n(0),o=n(11),r=n(3),a=n(4).pathExists;e.exports=function(e,t,n,c){"function"!=typeof n||c?("function"==typeof n||n instanceof RegExp)&&(n={filter:n}):(c=n,n={}),c=c||function(){},(n=n||{}).preserveTimestamps&&"ia32"===process.arch&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269`);const u=process.cwd();if(s.resolve(u,e)===s.resolve(u,t))return c(Error("Source and destination must not be the same."));i.lstat(e,(i,u)=>{if(i)return c(i);let l=null;if(u.isDirectory()){const e=t.split(s.sep);e.pop(),l=e.join(s.sep)}else l=s.dirname(t);a(l,(i,s)=>i?c(i):s?o(e,t,n,c):void r.mkdirs(l,i=>{if(i)return c(i);o(e,t,n,c)}))})}}),(function(e,t,n){"use strict";const i=n(1);n(12),n(0),e.exports={hasMillisRes:null,hasMillisResSync:null,timeRemoveMillis:null,utimesMillis:function(e,t,n,s){i.open(e,"r+",(e,o)=>{if(e)return s(e);i.futimes(o,t,n,e=>{i.close(o,t=>{s&&s(e||t)})})})}}}),(function(e,t,n){"use strict";function i(e,t,n,c){if("function"==typeof t?(n=t,t={}):t&&"object"==typeof t||(t={mode:t}),"win32"===process.platform&&r(e)){const t=Error(e+" contains invalid WIN32 path characters.");return t.code="EINVAL",n(t)}let u=t.mode;const l=t.fs||s;void 0===u&&(u=a&~process.umask()),c||(c=null),n=n||function(){},e=o.resolve(e),l.mkdir(e,u,s=>{if(!s)return c=c||e,n(null,c);switch(s.code){case"ENOENT":if(o.dirname(e)===e)return n(s);i(o.dirname(e),t,(s,o)=>{s?n(s,o):i(e,t,n,o)});break;default:l.stat(e,(e,t)=>{e||!t.isDirectory()?n(s,c):n(null,c)})}})}const s=n(1),o=n(0),r=n(13).invalidWin32Path,a=parseInt("0777",8);e.exports=i}),(function(e,t,n){"use strict";function i(e,t,n){t&&"object"==typeof t||(t={mode:t});let c=t.mode;const u=t.fs||s;if("win32"===process.platform&&r(e)){const t=Error(e+" contains invalid WIN32 path characters.");throw t.code="EINVAL",t}void 0===c&&(c=a&~process.umask()),n||(n=null),e=o.resolve(e);try{u.mkdirSync(e,c),n=n||e}catch(s){switch(s.code){case"ENOENT":if(o.dirname(e)===e)throw s;i(e,t,n=i(o.dirname(e),t,n));break;default:let r;try{r=u.statSync(e)}catch(e){throw s}if(!r.isDirectory())throw s}}return n}const s=n(1),o=n(0),r=n(13).invalidWin32Path,a=parseInt("0777",8);e.exports=i}),(function(e,t,n){"use strict";function i(e,t,n){("function"==typeof n||n instanceof RegExp)&&(n={filter:n}),(n=n||{}).recursive=!!n.recursive,n.clobber=!("clobber"in n&&!n.clobber),n.overwrite="overwrite"in n?!!n.overwrite:n.clobber,n.dereference="dereference"in n&&!!n.dereference,n.preserveTimestamps="preserveTimestamps"in n&&!!n.preserveTimestamps,n.filter=n.filter||function(){return!0},n.preserveTimestamps&&"ia32"===process.arch&&console.warn(`fs-extra: Using the preserveTimestamps option in 32-bit node is not recommended;\n\n see https://github.com/jprichardson/node-fs-extra/issues/269`);const c=n.recursive&&!n.dereference?s.lstatSync(e):s.statSync(e),u=o.dirname(t),l=s.existsSync(u);let f=!1;if(n.filter instanceof RegExp?(console.warn("Warning: fs-extra: Passing a RegExp filter is deprecated, use a function"),f=n.filter.test(e)):"function"==typeof n.filter&&(f=n.filter(e,t)),c.isFile()&&f)l||a.mkdirsSync(u),r(e,t,{overwrite:n.overwrite,errorOnExist:n.errorOnExist,preserveTimestamps:n.preserveTimestamps});else if(c.isDirectory()&&f)s.existsSync(t)||a.mkdirsSync(t),s.readdirSync(e).forEach(s=>{const r=n;r.recursive=!0,i(o.join(e,s),o.join(t,s),r)});else if(n.recursive&&c.isSymbolicLink()&&f){const n=s.readlinkSync(e);s.symlinkSync(n,t)}}const s=n(1),o=n(0),r=n(30),a=n(3);e.exports=i}),(function(e,t,n){"use strict";const i=n(1),s=n(15)(65536);e.exports=function(e,t,n){const o=n.overwrite,r=n.errorOnExist,a=n.preserveTimestamps;if(i.existsSync(t)){if(!o){if(r)throw Error(`${t} already exists`);return}i.unlinkSync(t)}const c=i.openSync(e,"r"),u=i.fstatSync(c),l=i.openSync(t,"w",u.mode);let f=1,d=0;for(;f>0;)f=i.readSync(c,s,0,65536,d),i.writeSync(l,s,0,f),d+=f;a&&i.futimesSync(l,u.atime,u.mtime),i.closeSync(c),i.closeSync(l)}}),(function(e,t,n){"use strict";function i(e){["unlink","chmod","stat","lstat","rmdir","readdir"].forEach(t=>{e[t]=e[t]||p[t],e[t+="Sync"]=e[t]||p[t]}),e.maxBusyTries=e.maxBusyTries||3}function s(e,t,n){let s=0;"function"==typeof t&&(n=t,t={}),m(e,"rimraf: missing path"),m.equal(typeof e,"string","rimraf: path should be a string"),m.equal(typeof n,"function","rimraf: callback function required"),m(t,"rimraf: invalid options argument provided"),m.equal(typeof t,"object","rimraf: options should be object"),i(t),o(e,t,(function i(r){if(r){if(("EBUSY"===r.code||"ENOTEMPTY"===r.code||"EPERM"===r.code)&&s<t.maxBusyTries){let n=100*++s;return setTimeout(()=>o(e,t,i),n)}"ENOENT"===r.code&&(r=null)}n(r)}))}function o(e,t,n){m(e),m(t),m("function"==typeof n),t.lstat(e,(i,s)=>i&&"ENOENT"===i.code?n(null):i&&"EPERM"===i.code&&y?r(e,t,i,n):s&&s.isDirectory()?c(e,t,i,n):void t.unlink(e,i=>{if(i){if("ENOENT"===i.code)return n(null);if("EPERM"===i.code)return y?r(e,t,i,n):c(e,t,i,n);if("EISDIR"===i.code)return c(e,t,i,n)}return n(i)}))}function r(e,t,n,i){m(e),m(t),m("function"==typeof i),n&&m(n instanceof Error),t.chmod(e,666,s=>{s?i("ENOENT"===s.code?null:n):t.stat(e,(s,o)=>{s?i("ENOENT"===s.code?null:n):o.isDirectory()?c(e,t,n,i):t.unlink(e,i)})})}function a(e,t,n){let i;m(e),m(t),n&&m(n instanceof Error);try{t.chmodSync(e,666)}catch(e){if("ENOENT"===e.code)return;throw n}try{i=t.statSync(e)}catch(e){if("ENOENT"===e.code)return;throw n}i.isDirectory()?f(e,t,n):t.unlinkSync(e)}function c(e,t,n,i){m(e),m(t),n&&m(n instanceof Error),m("function"==typeof i),t.rmdir(e,s=>{!s||"ENOTEMPTY"!==s.code&&"EEXIST"!==s.code&&"EPERM"!==s.code?i(s&&"ENOTDIR"===s.code?n:s):u(e,t,i)})}function u(e,t,n){m(e),m(t),m("function"==typeof n),t.readdir(e,(i,o)=>{if(i)return n(i);let r,a=o.length;if(0===a)return t.rmdir(e,n);o.forEach(i=>{s(h.join(e,i),t,i=>{if(!r)return i?n(r=i):void(0==--a&&t.rmdir(e,n))})})})}function l(e,t){let n;i(t=t||{}),m(e,"rimraf: missing path"),m.equal(typeof e,"string","rimraf: path should be a string"),m(t,"rimraf: missing options"),m.equal(typeof t,"object","rimraf: options should be object");try{n=t.lstatSync(e)}catch(n){if("ENOENT"===n.code)return;"EPERM"===n.code&&y&&a(e,t,n)}try{n&&n.isDirectory()?f(e,t,null):t.unlinkSync(e)}catch(n){if("ENOENT"===n.code)return;if("EPERM"===n.code)return y?a(e,t,n):f(e,t,n);if("EISDIR"!==n.code)throw n;f(e,t,n)}}function f(e,t,n){m(e),m(t),n&&m(n instanceof Error);try{t.rmdirSync(e)}catch(i){if("ENOTDIR"===i.code)throw n;if("ENOTEMPTY"===i.code||"EEXIST"===i.code||"EPERM"===i.code)d(e,t);else if("ENOENT"!==i.code)throw i}}function d(e,t){m(e),m(t),t.readdirSync(e).forEach(n=>l(h.join(e,n),t));const n=y?100:1;let i=0;for(;;){let s=!0;try{return s=!1,t.rmdirSync(e,t)}finally{if(++i<n&&s)continue}}}const p=n(1),h=n(0),m=n(10),y="win32"===process.platform;e.exports=s,s.sync=l}),(function(e,t,n){"use strict";const i=n(2).fromCallback,s=n(7);s.outputJson=i(n(34)),s.outputJsonSync=n(35),s.outputJSON=s.outputJson,s.outputJSONSync=s.outputJsonSync,s.writeJSON=s.writeJson,s.writeJSONSync=s.writeJsonSync,s.readJSON=s.readJson,s.readJSONSync=s.readJsonSync,e.exports=s}),(function(e,t,n){function i(e){return Buffer.isBuffer(e)&&(e=e.toString("utf8")),e=e.replace(/^\uFEFF/,"")}var s;try{s=n(1)}catch(e){s=n(5)}var o={spaces:null,readFile:function(e,t,n){null==n&&(n=t,t={}),"string"==typeof t&&(t={encoding:t});var o=(t=t||{}).fs||s,r=!0;"passParsingErrors"in t?r=t.passParsingErrors:"throws"in t&&(r=t.throws),o.readFile(e,t,(function(s,o){if(s)return n(s);o=i(o);var a;try{a=JSON.parse(o,t?t.reviver:null)}catch(t){return r?(t.message=e+": "+t.message,n(t)):n(null,null)}n(null,a)}))},readFileSync:function(e,t){"string"==typeof(t=t||{})&&(t={encoding:t});var n=t.fs||s,o=!0;"passParsingErrors"in t?o=t.passParsingErrors:"throws"in t&&(o=t.throws);try{var r=n.readFileSync(e,t);return r=i(r),JSON.parse(r,t.reviver)}catch(t){if(o)throw t.message=e+": "+t.message,t;return null}},writeFile:function(e,t,n,i){null==i&&(i=n,n={});var o=(n=n||{}).fs||s,r="object"==typeof n&&null!==n&&"spaces"in n?n.spaces:this.spaces,a="";try{a=JSON.stringify(t,n?n.replacer:null,r)+"\n"}catch(e){return void(i&&i(e,null))}o.writeFile(e,a,n,i)},writeFileSync:function(e,t,n){var i=(n=n||{}).fs||s,o="object"==typeof n&&null!==n&&"spaces"in n?n.spaces:this.spaces,r=JSON.stringify(t,n.replacer,o)+"\n";return i.writeFileSync(e,r,n)}};e.exports=o}),(function(e,t,n){"use strict";const i=n(0),s=n(3),o=n(4).pathExists,r=n(7);e.exports=function(e,t,n,a){"function"==typeof n&&(a=n,n={});const c=i.dirname(e);o(c,(i,o)=>i?a(i):o?r.writeJson(e,t,n,a):void s.mkdirs(c,i=>{if(i)return a(i);r.writeJson(e,t,n,a)}))}}),(function(e,t,n){"use strict";const i=n(1),s=n(0),o=n(3),r=n(7);e.exports=function(e,t,n){const a=s.dirname(e);i.existsSync(a)||o.mkdirsSync(a),r.writeJsonSync(e,t,n)}}),(function(e,t,n){"use strict";function i(e,t,n,o){function r(){f.resolve(e)===f.resolve(t)?u.access(e,o):c?u.rename(e,t,r=>{if(!r)return o();if("ENOTEMPTY"!==r.code&&"EEXIST"!==r.code){if("EPERM"!==r.code)return"EXDEV"!==r.code?o(r):void s(e,t,c,o);setTimeout(()=>{d(t,s=>{if(s)return o(s);n.overwrite=!1,i(e,t,n,o)})},200)}else d(t,s=>{if(s)return o(s);n.overwrite=!1,i(e,t,n,o)})}):u.link(e,t,n=>n?"EXDEV"===n.code||"EISDIR"===n.code||"EPERM"===n.code||"ENOTSUP"===n.code?s(e,t,c,o):o(n):u.unlink(e,o))}"function"==typeof n&&(o=n,n={});const c=n.overwrite||n.clobber||!1;a(e,t,(n,i)=>n?o(n):i?o(Error(`Cannot move '${e}' to a subdirectory of itself, '${t}'.`)):void p(f.dirname(t),e=>{if(e)return o(e);r()}))}function s(e,t,n,i){u.stat(e,(s,a)=>{if(s)return i(s);a.isDirectory()?r(e,t,n,i):o(e,t,n,i)})}function o(e,t,n,i){function s(){u.unlink(e,i)}const o=n?"w":"wx",a=u.createReadStream(e),c=u.createWriteStream(t,{flags:o});a.on("error",o=>{a.destroy(),c.destroy(),c.removeListener("close",s),u.unlink(t,()=>{"EISDIR"===o.code||"EPERM"===o.code?r(e,t,n,i):i(o)})}),c.on("error",e=>{a.destroy(),c.destroy(),c.removeListener("close",s),i(e)}),c.once("close",s),a.pipe(c)}function r(e,t,n,i){function s(){l(e,t,o,t=>{if(t)return i(t);d(e,i)})}const o={overwrite:!1};n?d(t,e=>{if(e)return i(e);s()}):s()}function a(e,t,n){u.stat(e,(i,s)=>{if(i)return n(i);if(s.isDirectory()){const i=t.split(f.dirname(e)+f.sep)[1];if(i){const s=i.split(f.sep)[0];return s?n(null,e!==t&&t.indexOf(e)>-1&&s===f.basename(e)):n(null,!1)}return n(null,!1)}return n(null,!1)})}const c=n(2).fromCallback,u=n(1),l=n(11),f=n(0),d=n(6).remove,p=n(3).mkdirs;e.exports={move:c(i)}}),(function(e,t,n){"use strict";function i(e,t,n){const o=(n=n||{}).overwrite||n.clobber||!1;if(e=u.resolve(e),t=u.resolve(t),e===t)return c.accessSync(e);if(a(e,t))throw Error(`Cannot move '${e}' into itself '${t}'.`);d(u.dirname(t)),(function(){if(o)try{c.renameSync(e,t)}catch(r){if("ENOTEMPTY"===r.code||"EEXIST"===r.code||"EPERM"===r.code)return f(t),n.overwrite=!1,i(e,t,n);if("EXDEV"!==r.code)throw r;return s(e,t,o)}else try{c.linkSync(e,t),c.unlinkSync(e)}catch(n){if("EXDEV"===n.code||"EISDIR"===n.code||"EPERM"===n.code||"ENOTSUP"===n.code)return s(e,t,o);throw n}})()}function s(e,t,n){return c.statSync(e).isDirectory()?r(e,t,n):o(e,t,n)}function o(e,t,n){const i=p(65536),s=n?"w":"wx",o=c.openSync(e,"r"),r=c.fstatSync(o),a=c.openSync(t,s,r.mode);let u=1,l=0;for(;u>0;)u=c.readSync(o,i,0,65536,l),c.writeSync(a,i,0,u),l+=u;return c.closeSync(o),c.closeSync(a),c.unlinkSync(e)}function r(e,t,n){function i(){return l(e,t,s),f(e)}const s={overwrite:!1};n?(f(t),i()):i()}function a(e,t){try{return c.statSync(e).isDirectory()&&e!==t&&t.indexOf(e)>-1&&t.split(u.dirname(e)+u.sep)[1].split(u.sep)[0]===u.basename(e)}catch(e){return!1}}const c=n(1),u=n(0),l=n(14).copySync,f=n(6).removeSync,d=n(3).mkdirsSync,p=n(15);e.exports={moveSync:i}}),(function(e,t,n){"use strict";function i(e){let t;try{t=o.readdirSync(e)}catch(t){return a.mkdirsSync(e)}t.forEach(t=>{t=r.join(e,t),c.removeSync(t)})}const s=n(2).fromCallback,o=n(5),r=n(0),a=n(3),c=n(6),u=s((function(e,t){t=t||function(){},o.readdir(e,(n,i)=>{function s(){const e=i.pop();if(!e)return t();c.remove(e,e=>{if(e)return t(e);s()})}if(n)return a.mkdirs(e,t);i=i.map(t=>r.join(e,t)),s()})}));e.exports={emptyDirSync:i,emptydirSync:i,emptyDir:u,emptydir:u}}),(function(e,t,n){"use strict";const i=n(40),s=n(41),o=n(42);e.exports={createFile:i.createFile,createFileSync:i.createFileSync,ensureFile:i.createFile,ensureFileSync:i.createFileSync,createLink:s.createLink,createLinkSync:s.createLinkSync,ensureLink:s.createLink,ensureLinkSync:s.createLinkSync,createSymlink:o.createSymlink,createSymlinkSync:o.createSymlinkSync,ensureSymlink:o.createSymlink,ensureSymlinkSync:o.createSymlinkSync}}),(function(e,t,n){"use strict";const i=n(2).fromCallback,s=n(0),o=n(1),r=n(3),a=n(4).pathExists;e.exports={createFile:i((function(e,t){function n(){o.writeFile(e,"",e=>{if(e)return t(e);t()})}o.stat(e,(i,o)=>{if(!i&&o.isFile())return t();const c=s.dirname(e);a(c,(e,i)=>e?t(e):i?n():void r.mkdirs(c,e=>{if(e)return t(e);n()}))})})),createFileSync:function(e){let t;try{t=o.statSync(e)}catch(e){}if(t&&t.isFile())return;const n=s.dirname(e);o.existsSync(n)||r.mkdirsSync(n),o.writeFileSync(e,"")}}}),(function(e,t,n){"use strict";const i=n(2).fromCallback,s=n(0),o=n(1),r=n(3),a=n(4).pathExists;e.exports={createLink:i((function(e,t,n){function i(e,t){o.link(e,t,e=>{if(e)return n(e);n(null)})}a(t,(c,u)=>c?n(c):u?n(null):void o.lstat(e,(o,c)=>{if(o)return o.message=o.message.replace("lstat","ensureLink"),n(o);const u=s.dirname(t);a(u,(s,o)=>s?n(s):o?i(e,t):void r.mkdirs(u,s=>{if(s)return n(s);i(e,t)}))}))})),createLinkSync:function(e,t,n){if(o.existsSync(t))return;try{o.lstatSync(e)}catch(e){throw e.message=e.message.replace("lstat","ensureLink"),e}const i=s.dirname(t);return o.existsSync(i)?o.linkSync(e,t):(r.mkdirsSync(i),o.linkSync(e,t))}}}),(function(e,t,n){"use strict";const i=n(2).fromCallback,s=n(0),o=n(1),r=n(3),a=r.mkdirs,c=r.mkdirsSync,u=n(43),l=u.symlinkPaths,f=u.symlinkPathsSync,d=n(44),p=d.symlinkType,h=d.symlinkTypeSync,m=n(4).pathExists;e.exports={createSymlink:i((function(e,t,n,i){i="function"==typeof n?n:i,n="function"!=typeof n&&n,m(t,(r,c)=>r?i(r):c?i(null):void l(e,t,(r,c)=>{if(r)return i(r);e=c.toDst,p(c.toCwd,n,(n,r)=>{if(n)return i(n);const c=s.dirname(t);m(c,(n,s)=>n?i(n):s?o.symlink(e,t,r,i):void a(c,n=>{if(n)return i(n);o.symlink(e,t,r,i)}))})}))})),createSymlinkSync:function(e,t,n,i){if(i="function"==typeof n?n:i,n="function"!=typeof n&&n,o.existsSync(t))return;const r=f(e,t);e=r.toDst,n=h(r.toCwd,n);const a=s.dirname(t);return o.existsSync(a)?o.symlinkSync(e,t,n):(c(a),o.symlinkSync(e,t,n))}}}),(function(e,t,n){"use strict";const i=n(0),s=n(1),o=n(4).pathExists;e.exports={symlinkPaths:function(e,t,n){if(i.isAbsolute(e))return s.lstat(e,(t,i)=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:e}));{const r=i.dirname(t),a=i.join(r,e);return o(a,(t,o)=>t?n(t):o?n(null,{toCwd:a,toDst:e}):s.lstat(e,(t,s)=>t?(t.message=t.message.replace("lstat","ensureSymlink"),n(t)):n(null,{toCwd:e,toDst:i.relative(r,e)})))}},symlinkPathsSync:function(e,t){let n;if(i.isAbsolute(e)){if(!(n=s.existsSync(e)))throw Error("absolute srcpath does not exist");return{toCwd:e,toDst:e}}{const o=i.dirname(t),r=i.join(o,e);if(n=s.existsSync(r))return{toCwd:r,toDst:e};if(!(n=s.existsSync(e)))throw Error("relative srcpath does not exist");return{toCwd:e,toDst:i.relative(o,e)}}}}}),(function(e,t,n){"use strict";const i=n(1);e.exports={symlinkType:function(e,t,n){if(n="function"==typeof t?t:n,t="function"!=typeof t&&t)return n(null,t);i.lstat(e,(e,i)=>{if(e)return n(null,"file");t=i&&i.isDirectory()?"dir":"file",n(null,t)})},symlinkTypeSync:function(e,t){let n;if(t)return t;try{n=i.lstatSync(e)}catch(e){return"file"}return n&&n.isDirectory()?"dir":"file"}}}),(function(e,t,n){"use strict";const i=n(2).fromCallback,s=n(1),o=n(0),r=n(3),a=n(4).pathExists;e.exports={outputFile:i((function(e,t,n,i){"function"==typeof n&&(i=n,n="utf8");const c=o.dirname(e);a(c,(o,a)=>o?i(o):a?s.writeFile(e,t,n,i):void r.mkdirs(c,o=>{if(o)return i(o);s.writeFile(e,t,n,i)}))})),outputFileSync:function(e,t,n){const i=o.dirname(e);if(s.existsSync(i))return s.writeFileSync.apply(s,arguments);r.mkdirsSync(i),s.writeFileSync.apply(s,arguments)}}}),(function(e,t,n){"use babel";const i=100,s=2e3,o=512e3;e.exports=function(e,t,r,a){const c=n(47)(a);class u extends t{static content(){return this.div({class:"quokka-results-view native-key-bindings",tabindex:-1,contenteditable:!0})}display(t){var n=this;let i=t.navigator,s=t.installer,a=t.blur,u=t.data,l=t.focus,f=this,d=c.html(u,t.hasOpenedProject);d&&d.length>o&&(d='<section class="error"><section class="header"><strong>Logging is stopped because too much data is being logged</strong></section></section>'+this.html(),t.stopLogging=!0),this.clearView(),this.html(d),this.on("click","a.loc",(function(t){let n=e(t.target);i(n.data("file"),n.data("loc"))})),this.on("click","a.install-package-quokka",(function(){return s()})),this.on("click","a.install-package-project",(function(){return s(void 0,!0)})),this.on("cut",(function(e){return e.preventDefault()})),this.on("paste",(function(e){return e.preventDefault()})),this.on("focus",(function(){n._disposables=new r,n._disposables.add(atom.commands.add(".quokka-results-view",{"tool-panel:unfocus":function(){return atom.workspace.getActivePane().activate()}})),f._range&&document.getSelection().addRange(f._range)})),this.on("blur",(function(e){try{const t=document.getSelection();f._range=t&&t.getRangeAt(0)}catch(e){delete f._range}f._disposables&&(f._disposables.dispose(),delete f._disposables),a&&a()})),this.on("keydown",(function(t){switch(t.which){case 13:let n=document.getSelection().anchorNode;return!!n&&!!(n=3===n.nodeType?n.parentNode:n)&&(((n=e(n)).hasClass("loc")||n.hasClass("all"))&&n.click(),!1);case 27:case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 17:case 91:return!0;default:if((67===t.keyCode||65===t.keyCode)&&(t.ctrlKey||t.metaKey))return!0}return!1})),l&&this.focusView()}focusView(){this.is(":empty")||this.focus()}clearView(){this.off(),this.empty(),delete this._range,this._disposables&&(this._disposables.dispose(),delete this._disposables)}}return class extends t{static content(){let e=this;return e.div({class:"quokka-panel-view"},(function(){e.div({class:"quokka-panel-view-resizer"}),e.div({class:"quokka-panel-view-container"},(function(){e.header({class:"quokka-panel-view-header header"},(function(){e.span({class:"header-item subtle-info-message",outlet:"headerLabel"}),e.span({class:"header-item icons pull-right inline-block btn-group"},(function(){e.span({class:"icon icon-x",tabindex:-1,outlet:"hideButton"})}))})),e.section({class:"quokka-panel-view-content"},(function(){return e.subview("results",new u)}))}))}))}initialize(t){let n=this,s=_.bind(this._displayResults,this);this._displayResults=_.debounce(s,i),this._disposables=new r;let o=_.bind(this._resize,this);this.on("mousedown",".quokka-panel-view-resizer",(function(){e(document).on("mousemove",o),e(document).one("mouseup",(function(){e(document).off("mousemove",o),delete n._lastClientY}))})),(this._params=t||{}).results={},this.hideButton.click(_.bind(this.togglePanel,this)),this._disposables.add(atom.tooltips.add(this.hideButton,{title:"Toggle Quokka.js Output Panel",keyBindingCommand:"quokka:toggle-output",trigger:"hover"})),this._displayResults(this._params.focus)}togglePanel(e){this.toggle(),this._displayResults(e)}showPanel(){this._outputPanelAdded||(atom.workspace.addBottomPanel({item:this}),this._outputPanelAdded=!0),this.show(),this._displayResults()}focusPanel(){this.isVisible()?this.results.focusView():this.togglePanel(!0)}deactivate(){this._disposables.dispose()}setHeaderData(e){this.headerLabel.text(`Quokka (node: ${e.nodeVersion}${e.ts?`, TypeScript: ${e.ts.version&&"v"+e.ts.version||"unknown version"}`:""}${e.babel?`, babel: ${e.babel.version&&"v"+e.babel.version||"unknown version"}`:""})`)}showHeaderOnly(){this._params.results={},this._displayResults()}clearResults(){this._params.results={},this.results.clearView()}newResultsExpectedSoon(){delete this._stopLogging}appendConsoleMessages(e){this._stopLogging||(((this._params.results=this._params.results||{}).messages=(this._params.results.messages||[]).concat(e)).length>s&&this._params.results.messages.splice(0,this._params.results.messages.length-s),this._displayResults())}resultsReport(e){this._params.results=e,delete this._stopLogging,this._displayResults()}_displayResults(e){let t=this._params.results;if(!this.isVisible()||!t||this._stopLogging)return;let n={navigator:this._params.navigate,installer:this._params.installPackage,hasOpenedProject:this._params.hasOpenedProject,data:t,focus:e,results:!0};this.results.display(n),n.stopLogging&&(this._stopLogging=!0)}_resize(e){if(1===e.which){if(this._lastClientY){let t=this.height(),n=this._lastClientY-e.clientY;(n<0||n>0&&e.clientY<=this.offset().top)&&this.height(t+n)}this._lastClientY=e.clientY}}}}}),(function(e,t){"use babel";e.exports=function(e){return{html:function(e,t){const n=this;n._hasOpenedProject=t;let i="";return _.isString(e)?i+=n._error(e):_.isObject(e)&&(_.each(e.errors,(function(e){i+=n._error(e.message,e.stack,e.expected,e.actual,e.missingPackage)})),_.each(e.messages,(function(e){i+=n._message(e)}))),i},_error:function(e,t,n,i,s){const o=this;let r="";s&&(r=`<section class="error"><a class="install-package-quokka">Install "${s}" package for the current quokka file</a>`+(o._hasOpenedProject?`<br/><a class="install-package-project">Install "${s}" package into the project</a>`:"")+"</section>");let a="";return(n||i)&&(a=o._diff(n,i)+"<br/>"),r+'<section class="error">'+a+'<section class="header">'+o._escapeAndConvertToHtml(e)+"</section>"+_.reduce(t,(function(e,t){return e+=o._line(t)}),"")+"</section>"},_line:function(e){const t=this._escape(e.file),n=e.context&&this._escape(e.context)||"";return t?'<section class="line">at '+(n?'<span class="context">'+n+"</span> ":"")+'<a class="loc" data-file="'+t+'" data-loc="'+e.loc+'">'+t+":"+e.loc+"</a></section>":""},_message:function(e){let t="diff"===e.type;if(t){if(!e.context&&!e.actual&&!e.expected)return"";e.text=e.context,delete e.context}return(t?this._diff(e.expected,e.actual):"")+'<section class="message '+e.type+(t?" pad":"")+'"><span class="'+(t?"context":"text")+'">'+this._escapeAndConvertToHtml(e.text)+" </span>"+this._line(e)+"</section>"},_diff:function(t,n){try{return'<section class="diff" style="white-space: pre;">'+e.diff_prettyHtml(e.diff_wordMode(t||"",n||"")).replace(/¶<br>/g,"<br>").replace(/style="background:#e6ffe6;"/g,'class="status-added"').replace(/style="background:#ffe6e6;"/g,'class="status-removed"')+"</section>"}catch(e){return""}},_escape:function(e){return(""+(e||"")).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},_escapeAndConvertToHtml:function(e){return this._escape(e).replace(/(?:\r\n|\r|\n)/g,"<br/>").replace(/\t/g," ").replace(/\s/g," ")}}}}),(function(e,t){"use babel";let n=["January","February","March","April","May","June","July","August","September","October","November","December"];e.exports=function(e,t,i,s,o){return class e extends t{static content(){let e=this;return e.div({class:"block"},(function(){e.div({class:"block"},(function(){e.span("Registered to: "),e.span({outlet:"licensee",class:"text-success"},"")})),e.div({class:"block"},(function(){e.span("Free upgrades until: "),e.span({outlet:"expiration",class:"text-success"},"")})),e.div({class:"block"},(function(){e.label("License key:"),e.subview("licenseKey",new i({mini:!0}))})),e.div({class:"block"},(function(){e.button({class:"btn inline-block",outlet:"saveButton"},"Apply"),e.button({class:"btn inline-block",outlet:"cancelButton"},"Cancel")}))}))}display(t){let n=this;this._disposables=new s;let i=function(e){n._disposables.dispose(),delete n._disposables,t.closeView(e)},r=this.licenseKey.model;this.cancelButton.click((function(){return i()})),this.saveButton.click((function(){let s=n._originalLicenseKey,a=r.getText()||"",c=!!e._parseKey(s,t.parseKey),u=!!e._parseKey(a,t.parseKey),l=!1;if(u||!a&&c)try{o.writeFileSync(t.keyFilePath,a),l=u}catch(e){atom.notifications.addError(e.message,{dismissable:!0}),l=!1}i(l)})),this._originalLicenseKey="";try{this._originalLicenseKey=""+o.readFileSync(t.keyFilePath)}catch(e){}this._originalLicenseKey.length>100&&(r.setText(this._originalLicenseKey),this._updateLicenseDetails(r,t.parseKey)),this._disposables.add(r.onDidChange((function(){return n._updateLicenseDetails(r,t.parseKey)})))}_updateLicenseDetails(t,i){let s=e._parseKey(t.getText(),i);if(this.licensee.text(""),this.expiration.text(""),s){this.licensee.text(s.licensee);let e=s.expiration;try{let t=s.expiration.split("/");3===t.length&&(e=(e=new Date(t[1]+"/"+t[0]+"/"+t[2])).getDate()+" "+n[e.getMonth()]+" "+e.getFullYear())}catch(e){}this.expiration.text(e)}}static _parseKey(e,t){if(_.isString(e))try{let n=t(e);if(n.licenseeName&&n.expirationDateString&&~n.licensedProduct.indexOf("Quokka"))return{licensee:n.licenseeName,expiration:n.expirationDateString}}catch(e){return}}focusView(){this.licenseKey.focus()}}}})]).default; |
{ | ||
"name": "quokka-atom", | ||
"version": "1.0.17", | ||
"version": "1.0.18", | ||
"main": "./index.js", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -5,3 +5,3 @@ const path = require('path'); | ||
download(`https://wallabyjs.gallery.vsassets.io/_apis/public/gallery/publisher/WallabyJs/extension/quokka-vscode/1.0.65/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage`, 'build', {extract: true}).then(function () { | ||
download(`https://wallabyjs.gallery.vsassets.io/_apis/public/gallery/publisher/WallabyJs/extension/quokka-vscode/1.0.67/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage`, 'build', {extract: true}).then(function () { | ||
del([ | ||
@@ -8,0 +8,0 @@ path.join(__dirname, '../build/*.*'), |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
58470
1