-
Notifications
You must be signed in to change notification settings - Fork 47
/
demoit.js
366 lines (293 loc) · 87 KB
/
demoit.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 0);
/******/ })
/************************************************************************/
/******/ ({
/***/ "./node_modules/@babel/runtime/helpers/arrayWithHoles.js":
/*!***************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nmodule.exports = _arrayWithHoles;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/arrayWithHoles.js?");
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js":
/*!*****************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
\*****************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nfunction _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}\n\nmodule.exports = _asyncToGenerator;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/asyncToGenerator.js?");
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/defineProperty.js":
/*!***************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***!
\***************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/defineProperty.js?");
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js":
/*!*********************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
\*********************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("function _iterableToArrayLimit(arr, i) {\n var _arr = [];\n var _n = true;\n var _d = false;\n var _e = undefined;\n\n try {\n for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nmodule.exports = _iterableToArrayLimit;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js?");
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/nonIterableRest.js":
/*!****************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
\****************************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance\");\n}\n\nmodule.exports = _nonIterableRest;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/nonIterableRest.js?");
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/objectSpread.js":
/*!*************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/objectSpread.js ***!
\*************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("var defineProperty = __webpack_require__(/*! ./defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n\nfunction _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? arguments[i] : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}\n\nmodule.exports = _objectSpread;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/objectSpread.js?");
/***/ }),
/***/ "./node_modules/@babel/runtime/helpers/slicedToArray.js":
/*!**************************************************************!*\
!*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***!
\**************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles */ \"./node_modules/@babel/runtime/helpers/arrayWithHoles.js\");\n\nvar iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit */ \"./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js\");\n\nvar nonIterableRest = __webpack_require__(/*! ./nonIterableRest */ \"./node_modules/@babel/runtime/helpers/nonIterableRest.js\");\n\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || nonIterableRest();\n}\n\nmodule.exports = _slicedToArray;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/slicedToArray.js?");
/***/ }),
/***/ "./node_modules/@babel/runtime/regenerator/index.js":
/*!**********************************************************!*\
!*** ./node_modules/@babel/runtime/regenerator/index.js ***!
\**********************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("module.exports = __webpack_require__(/*! regenerator-runtime */ \"./node_modules/regenerator-runtime/runtime-module.js\");\n\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/regenerator/index.js?");
/***/ }),
/***/ "./node_modules/regenerator-runtime/runtime-module.js":
/*!************************************************************!*\
!*** ./node_modules/regenerator-runtime/runtime-module.js ***!
\************************************************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n// This method of obtaining a reference to the global object needs to be\n// kept identical to the way it is obtained in runtime.js\nvar g = (function() {\n return this || (typeof self === \"object\" && self);\n})() || Function(\"return this\")();\n\n// Use `getOwnPropertyNames` because not all browsers support calling\n// `hasOwnProperty` on the global `self` object in a worker. See #183.\nvar hadRuntime = g.regeneratorRuntime &&\n Object.getOwnPropertyNames(g).indexOf(\"regeneratorRuntime\") >= 0;\n\n// Save the old regeneratorRuntime in case it needs to be restored later.\nvar oldRuntime = hadRuntime && g.regeneratorRuntime;\n\n// Force reevalutation of runtime.js.\ng.regeneratorRuntime = undefined;\n\nmodule.exports = __webpack_require__(/*! ./runtime */ \"./node_modules/regenerator-runtime/runtime.js\");\n\nif (hadRuntime) {\n // Restore the original runtime.\n g.regeneratorRuntime = oldRuntime;\n} else {\n // Remove the global property added by runtime.js.\n try {\n delete g.regeneratorRuntime;\n } catch(e) {\n g.regeneratorRuntime = undefined;\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/regenerator-runtime/runtime-module.js?");
/***/ }),
/***/ "./node_modules/regenerator-runtime/runtime.js":
/*!*****************************************************!*\
!*** ./node_modules/regenerator-runtime/runtime.js ***!
\*****************************************************/
/*! no static exports found */
/***/ (function(module, exports) {
eval("/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n!(function(global) {\n \"use strict\";\n\n var Op = Object.prototype;\n var hasOwn = Op.hasOwnProperty;\n var undefined; // More compressible than void 0.\n var $Symbol = typeof Symbol === \"function\" ? Symbol : {};\n var iteratorSymbol = $Symbol.iterator || \"@@iterator\";\n var asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\";\n var toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n var inModule = typeof module === \"object\";\n var runtime = global.regeneratorRuntime;\n if (runtime) {\n if (inModule) {\n // If regeneratorRuntime is defined globally and we're in a module,\n // make the exports object identical to regeneratorRuntime.\n module.exports = runtime;\n }\n // Don't bother evaluating the rest of this file if the runtime was\n // already defined globally.\n return;\n }\n\n // Define the runtime globally (as expected by generated code) as either\n // module.exports (if we're in a module) or a new, empty object.\n runtime = global.regeneratorRuntime = inModule ? module.exports : {};\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n // If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;\n var generator = Object.create(protoGenerator.prototype);\n var context = new Context(tryLocsList || []);\n\n // The ._invoke method unifies the implementations of the .next,\n // .throw, and .return methods.\n generator._invoke = makeInvokeMethod(innerFn, self, context);\n\n return generator;\n }\n runtime.wrap = wrap;\n\n // Try/catch helper to minimize deoptimizations. Returns a completion\n // record like context.tryEntries[i].completion. This interface could\n // have been (and was previously) designed to take a closure to be\n // invoked without arguments, but in all the cases we care about we\n // already have an existing method we want to call, so there's no need\n // to create a new function object. We can even get away with assuming\n // the method takes exactly one argument, since that happens to be true\n // in every case, so we don't have to touch the arguments object. The\n // only additional allocation required is the completion record, which\n // has a stable shape and so hopefully should be cheap to allocate.\n function tryCatch(fn, obj, arg) {\n try {\n return { type: \"normal\", arg: fn.call(obj, arg) };\n } catch (err) {\n return { type: \"throw\", arg: err };\n }\n }\n\n var GenStateSuspendedStart = \"suspendedStart\";\n var GenStateSuspendedYield = \"suspendedYield\";\n var GenStateExecuting = \"executing\";\n var GenStateCompleted = \"completed\";\n\n // Returning this object from the innerFn has the same effect as\n // breaking out of the dispatch switch statement.\n var ContinueSentinel = {};\n\n // Dummy constructor functions that we use as the .constructor and\n // .constructor.prototype properties for functions that return Generator\n // objects. For full spec compliance, you may wish to configure your\n // minifier not to mangle the names of these two functions.\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n\n // This is a polyfill for %IteratorPrototype% for environments that\n // don't natively support it.\n var IteratorPrototype = {};\n IteratorPrototype[iteratorSymbol] = function () {\n return this;\n };\n\n var getProto = Object.getPrototypeOf;\n var NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n if (NativeIteratorPrototype &&\n NativeIteratorPrototype !== Op &&\n hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {\n // This environment has a native %IteratorPrototype%; use it instead\n // of the polyfill.\n IteratorPrototype = NativeIteratorPrototype;\n }\n\n var Gp = GeneratorFunctionPrototype.prototype =\n Generator.prototype = Object.create(IteratorPrototype);\n GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype;\n GeneratorFunctionPrototype.constructor = GeneratorFunction;\n GeneratorFunctionPrototype[toStringTagSymbol] =\n GeneratorFunction.displayName = \"GeneratorFunction\";\n\n // Helper for defining the .next, .throw, and .return methods of the\n // Iterator interface in terms of a single ._invoke method.\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function(method) {\n prototype[method] = function(arg) {\n return this._invoke(method, arg);\n };\n });\n }\n\n runtime.isGeneratorFunction = function(genFun) {\n var ctor = typeof genFun === \"function\" && genFun.constructor;\n return ctor\n ? ctor === GeneratorFunction ||\n // For the native GeneratorFunction constructor, the best we can\n // do is to check its .name property.\n (ctor.displayName || ctor.name) === \"GeneratorFunction\"\n : false;\n };\n\n runtime.mark = function(genFun) {\n if (Object.setPrototypeOf) {\n Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);\n } else {\n genFun.__proto__ = GeneratorFunctionPrototype;\n if (!(toStringTagSymbol in genFun)) {\n genFun[toStringTagSymbol] = \"GeneratorFunction\";\n }\n }\n genFun.prototype = Object.create(Gp);\n return genFun;\n };\n\n // Within the body of any async function, `await x` is transformed to\n // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test\n // `hasOwn.call(value, \"__await\")` to determine if the yielded value is\n // meant to be awaited.\n runtime.awrap = function(arg) {\n return { __await: arg };\n };\n\n function AsyncIterator(generator) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n if (record.type === \"throw\") {\n reject(record.arg);\n } else {\n var result = record.arg;\n var value = result.value;\n if (value &&\n typeof value === \"object\" &&\n hasOwn.call(value, \"__await\")) {\n return Promise.resolve(value.__await).then(function(value) {\n invoke(\"next\", value, resolve, reject);\n }, function(err) {\n invoke(\"throw\", err, resolve, reject);\n });\n }\n\n return Promise.resolve(value).then(function(unwrapped) {\n // When a yielded Promise is resolved, its final value becomes\n // the .value of the Promise<{value,done}> result for the\n // current iteration.\n result.value = unwrapped;\n resolve(result);\n }, function(error) {\n // If a rejected Promise was yielded, throw the rejection back\n // into the async generator function so it can be handled there.\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n }\n\n var previousPromise;\n\n function enqueue(method, arg) {\n function callInvokeWithMethodAndArg() {\n return new Promise(function(resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise =\n // If enqueue has been called before, then we want to wait until\n // all previous Promises have been resolved before calling invoke,\n // so that results are always delivered in the correct order. If\n // enqueue has not been called before, then it is important to\n // call invoke immediately, without waiting on a callback to fire,\n // so that the async generator function has the opportunity to do\n // any necessary setup in a predictable way. This predictability\n // is why the Promise constructor synchronously invokes its\n // executor callback, and why async functions synchronously\n // execute code before the first await. Since we implement simple\n // async functions in terms of async generators, it is especially\n // important to get this right, even though it requires care.\n previousPromise ? previousPromise.then(\n callInvokeWithMethodAndArg,\n // Avoid propagating failures to Promises returned by later\n // invocations of the iterator.\n callInvokeWithMethodAndArg\n ) : callInvokeWithMethodAndArg();\n }\n\n // Define the unified helper method that is used to implement .next,\n // .throw, and .return (see defineIteratorMethods).\n this._invoke = enqueue;\n }\n\n defineIteratorMethods(AsyncIterator.prototype);\n AsyncIterator.prototype[asyncIteratorSymbol] = function () {\n return this;\n };\n runtime.AsyncIterator = AsyncIterator;\n\n // Note that simple async functions are implemented on top of\n // AsyncIterator objects; they just return a Promise for the value of\n // the final result produced by the iterator.\n runtime.async = function(innerFn, outerFn, self, tryLocsList) {\n var iter = new AsyncIterator(\n wrap(innerFn, outerFn, self, tryLocsList)\n );\n\n return runtime.isGeneratorFunction(outerFn)\n ? iter // If outerFn is a generator, return the full iterator.\n : iter.next().then(function(result) {\n return result.done ? result.value : iter.next();\n });\n };\n\n function makeInvokeMethod(innerFn, self, context) {\n var state = GenStateSuspendedStart;\n\n return function invoke(method, arg) {\n if (state === GenStateExecuting) {\n throw new Error(\"Generator is already running\");\n }\n\n if (state === GenStateCompleted) {\n if (method === \"throw\") {\n throw arg;\n }\n\n // Be forgiving, per 25.3.3.3.3 of the spec:\n // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume\n return doneResult();\n }\n\n context.method = method;\n context.arg = arg;\n\n while (true) {\n var delegate = context.delegate;\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (context.method === \"next\") {\n // Setting context._sent for legacy support of Babel's\n // function.sent implementation.\n context.sent = context._sent = context.arg;\n\n } else if (context.method === \"throw\") {\n if (state === GenStateSuspendedStart) {\n state = GenStateCompleted;\n throw context.arg;\n }\n\n context.dispatchException(context.arg);\n\n } else if (context.method === \"return\") {\n context.abrupt(\"return\", context.arg);\n }\n\n state = GenStateExecuting;\n\n var record = tryCatch(innerFn, self, context);\n if (record.type === \"normal\") {\n // If an exception is thrown from innerFn, we leave state ===\n // GenStateExecuting and loop back for another invocation.\n state = context.done\n ? GenStateCompleted\n : GenStateSuspendedYield;\n\n if (record.arg === ContinueSentinel) {\n continue;\n }\n\n return {\n value: record.arg,\n done: context.done\n };\n\n } else if (record.type === \"throw\") {\n state = GenStateCompleted;\n // Dispatch the exception by looping back around to the\n // context.dispatchException(context.arg) call above.\n context.method = \"throw\";\n context.arg = record.arg;\n }\n }\n };\n }\n\n // Call delegate.iterator[context.method](context.arg) and handle the\n // result, either by returning a { value, done } result from the\n // delegate iterator, or by modifying context.method and context.arg,\n // setting context.delegate to null, and returning the ContinueSentinel.\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n if (method === undefined) {\n // A .throw or .return when the delegate iterator has no .throw\n // method always terminates the yield* loop.\n context.delegate = null;\n\n if (context.method === \"throw\") {\n if (delegate.iterator.return) {\n // If the delegate iterator has a return method, give it a\n // chance to clean up.\n context.method = \"return\";\n context.arg = undefined;\n maybeInvokeDelegate(delegate, context);\n\n if (context.method === \"throw\") {\n // If maybeInvokeDelegate(context) changed context.method from\n // \"return\" to \"throw\", let that override the TypeError below.\n return ContinueSentinel;\n }\n }\n\n context.method = \"throw\";\n context.arg = new TypeError(\n \"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n\n if (record.type === \"throw\") {\n context.method = \"throw\";\n context.arg = record.arg;\n context.delegate = null;\n return ContinueSentinel;\n }\n\n var info = record.arg;\n\n if (! info) {\n context.method = \"throw\";\n context.arg = new TypeError(\"iterator result is not an object\");\n context.delegate = null;\n return ContinueSentinel;\n }\n\n if (info.done) {\n // Assign the result of the finished delegate to the temporary\n // variable specified by delegate.resultName (see delegateYield).\n context[delegate.resultName] = info.value;\n\n // Resume execution at the desired location (see delegateYield).\n context.next = delegate.nextLoc;\n\n // If context.method was \"throw\" but the delegate handled the\n // exception, let the outer generator proceed normally. If\n // context.method was \"next\", forget context.arg since it has been\n // \"consumed\" by the delegate iterator. If context.method was\n // \"return\", allow the original .return call to continue in the\n // outer generator.\n if (context.method !== \"return\") {\n context.method = \"next\";\n context.arg = undefined;\n }\n\n } else {\n // Re-yield the result returned by the delegate method.\n return info;\n }\n\n // The delegate iterator is finished, so forget it and continue with\n // the outer generator.\n context.delegate = null;\n return ContinueSentinel;\n }\n\n // Define Generator.prototype.{next,throw,return} in terms of the\n // unified ._invoke helper method.\n defineIteratorMethods(Gp);\n\n Gp[toStringTagSymbol] = \"Generator\";\n\n // A Generator should always return itself as the iterator object when the\n // @@iterator function is called on it. Some browsers' implementations of the\n // iterator prototype chain incorrectly implement this, causing the Generator\n // object to not be returned from this call. This ensures that doesn't happen.\n // See https://github.com/facebook/regenerator/issues/274 for more details.\n Gp[iteratorSymbol] = function() {\n return this;\n };\n\n Gp.toString = function() {\n return \"[object Generator]\";\n };\n\n function pushTryEntry(locs) {\n var entry = { tryLoc: locs[0] };\n\n if (1 in locs) {\n entry.catchLoc = locs[1];\n }\n\n if (2 in locs) {\n entry.finallyLoc = locs[2];\n entry.afterLoc = locs[3];\n }\n\n this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\";\n delete record.arg;\n entry.completion = record;\n }\n\n function Context(tryLocsList) {\n // The root entry object (effectively a try statement without a catch\n // or a finally block) gives us a place to store values thrown from\n // locations where there is no enclosing try statement.\n this.tryEntries = [{ tryLoc: \"root\" }];\n tryLocsList.forEach(pushTryEntry, this);\n this.reset(true);\n }\n\n runtime.keys = function(object) {\n var keys = [];\n for (var key in object) {\n keys.push(key);\n }\n keys.reverse();\n\n // Rather than returning an object with a next method, we keep\n // things simple and return the next function itself.\n return function next() {\n while (keys.length) {\n var key = keys.pop();\n if (key in object) {\n next.value = key;\n next.done = false;\n return next;\n }\n }\n\n // To avoid creating an additional object, we just hang the .value\n // and .done properties off the next function object itself. This\n // also ensures that the minifier will not anonymize the function.\n next.done = true;\n return next;\n };\n };\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) {\n return iteratorMethod.call(iterable);\n }\n\n if (typeof iterable.next === \"function\") {\n return iterable;\n }\n\n if (!isNaN(iterable.length)) {\n var i = -1, next = function next() {\n while (++i < iterable.length) {\n if (hasOwn.call(iterable, i)) {\n next.value = iterable[i];\n next.done = false;\n return next;\n }\n }\n\n next.value = undefined;\n next.done = true;\n\n return next;\n };\n\n return next.next = next;\n }\n }\n\n // Return an iterator with no values.\n return { next: doneResult };\n }\n runtime.values = values;\n\n function doneResult() {\n return { value: undefined, done: true };\n }\n\n Context.prototype = {\n constructor: Context,\n\n reset: function(skipTempReset) {\n this.prev = 0;\n this.next = 0;\n // Resetting context._sent for legacy support of Babel's\n // function.sent implementation.\n this.sent = this._sent = undefined;\n this.done = false;\n this.delegate = null;\n\n this.method = \"next\";\n this.arg = undefined;\n\n this.tryEntries.forEach(resetTryEntry);\n\n if (!skipTempReset) {\n for (var name in this) {\n // Not sure about the optimal order of these conditions:\n if (name.charAt(0) === \"t\" &&\n hasOwn.call(this, name) &&\n !isNaN(+name.slice(1))) {\n this[name] = undefined;\n }\n }\n }\n },\n\n stop: function() {\n this.done = true;\n\n var rootEntry = this.tryEntries[0];\n var rootRecord = rootEntry.completion;\n if (rootRecord.type === \"throw\") {\n throw rootRecord.arg;\n }\n\n return this.rval;\n },\n\n dispatchException: function(exception) {\n if (this.done) {\n throw exception;\n }\n\n var context = this;\n function handle(loc, caught) {\n record.type = \"throw\";\n record.arg = exception;\n context.next = loc;\n\n if (caught) {\n // If the dispatched exception was caught by a catch block,\n // then let that catch block handle the exception normally.\n context.method = \"next\";\n context.arg = undefined;\n }\n\n return !! caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n var record = entry.completion;\n\n if (entry.tryLoc === \"root\") {\n // Exception thrown outside of any try block that could handle\n // it, so set the completion value of the entire function to\n // throw the exception.\n return handle(\"end\");\n }\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\");\n var hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n } else if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) {\n return handle(entry.catchLoc, true);\n }\n\n } else if (hasFinally) {\n if (this.prev < entry.finallyLoc) {\n return handle(entry.finallyLoc);\n }\n\n } else {\n throw new Error(\"try statement without catch or finally\");\n }\n }\n }\n },\n\n abrupt: function(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc <= this.prev &&\n hasOwn.call(entry, \"finallyLoc\") &&\n this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n if (finallyEntry &&\n (type === \"break\" ||\n type === \"continue\") &&\n finallyEntry.tryLoc <= arg &&\n arg <= finallyEntry.finallyLoc) {\n // Ignore the finally entry if control is not jumping to a\n // location outside the try/catch block.\n finallyEntry = null;\n }\n\n var record = finallyEntry ? finallyEntry.completion : {};\n record.type = type;\n record.arg = arg;\n\n if (finallyEntry) {\n this.method = \"next\";\n this.next = finallyEntry.finallyLoc;\n return ContinueSentinel;\n }\n\n return this.complete(record);\n },\n\n complete: function(record, afterLoc) {\n if (record.type === \"throw\") {\n throw record.arg;\n }\n\n if (record.type === \"break\" ||\n record.type === \"continue\") {\n this.next = record.arg;\n } else if (record.type === \"return\") {\n this.rval = this.arg = record.arg;\n this.method = \"return\";\n this.next = \"end\";\n } else if (record.type === \"normal\" && afterLoc) {\n this.next = afterLoc;\n }\n\n return ContinueSentinel;\n },\n\n finish: function(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) {\n this.complete(entry.completion, entry.afterLoc);\n resetTryEntry(entry);\n return ContinueSentinel;\n }\n }\n },\n\n \"catch\": function(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n if (record.type === \"throw\") {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n return thrown;\n }\n }\n\n // The context.catch method must only be called with a location\n // argument that corresponds to a known catch block.\n throw new Error(\"illegal catch attempt\");\n },\n\n delegateYield: function(iterable, resultName, nextLoc) {\n this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n };\n\n if (this.method === \"next\") {\n // Deliberately forget the last sent value so that we don't\n // accidentally pass it on to the delegate.\n this.arg = undefined;\n }\n\n return ContinueSentinel;\n }\n };\n})(\n // In sloppy mode, unbound `this` refers to the global object, fallback to\n // Function constructor if we're in global strict mode. That is sadly a form\n // of indirect eval which violates Content Security Policy.\n (function() {\n return this || (typeof self === \"object\" && self);\n })() || Function(\"return this\")()\n);\n\n\n//# sourceURL=webpack:///./node_modules/regenerator-runtime/runtime.js?");
/***/ }),
/***/ "./src/console.js":
/*!************************!*\
!*** ./src/console.js ***!
\************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return logger; });\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ \"./src/utils.js\");\n\n\nfunction htmlEncode(str) {\n return str.replace(/[&<>\"']/g, function ($0) {\n return \"&\" + {\n \"&\": \"amp\",\n \"<\": \"lt\",\n \">\": \"gt\",\n '\"': \"quot\",\n \"'\": \"#39\"\n }[$0] + \";\";\n });\n}\n\nfunction logger() {\n var element = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[\"el\"])('.console');\n var empty = true;\n\n var add = function add(something) {\n var node = document.createElement('div');\n var text = htmlEncode(something.toString());\n node.innerHTML = '<p>' + text + '</p>';\n\n if (empty) {\n element.innerHTML = '';\n empty = false;\n }\n\n element.appendChild(node);\n };\n\n (function () {\n var originalError = console.error;\n var originalLog = console.log;\n var originalWarning = console.warn;\n var originalInfo = console.info;\n var originalClear = console.clear;\n\n console.error = function (error) {\n add(error.toString() + error.stack);\n originalError.apply(console, arguments);\n };\n\n console.log = function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n args.forEach(add);\n originalLog.apply(console, args);\n };\n\n console.warn = function () {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n args.forEach(add);\n originalWarning.apply(console, args);\n };\n\n console.info = function () {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n args.forEach(add);\n originalInfo.apply(console, args);\n };\n\n console.clear = function () {\n element.innerHTML = '';\n\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n\n originalClear.apply(console, args);\n };\n })();\n\n return {\n clear: function clear() {\n empty = true;\n element.innerHTML = '<div class=\"hint\">console.log</div>';\n }\n };\n}\n\n//# sourceURL=webpack:///./src/console.js?");
/***/ }),
/***/ "./src/dependenciesManager.js":
/*!************************************!*\
!*** ./src/dependenciesManager.js ***!
\************************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return dependenciesManager; });\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ \"./src/utils.js\");\n\n\n\nfunction dependenciesManager(storage, callback) {\n var toggleButton = Object(_utils__WEBPACK_IMPORTED_MODULE_2__[\"el\"])('.dependencies');\n var panel = Object(_utils__WEBPACK_IMPORTED_MODULE_2__[\"el\"])('.manage-dependencies');\n var closeButton = Object(_utils__WEBPACK_IMPORTED_MODULE_2__[\"el\"])('.manage-dependencies .cancel');\n var saveButton = Object(_utils__WEBPACK_IMPORTED_MODULE_2__[\"el\"])('.manage-dependencies .save');\n var list = Object(_utils__WEBPACK_IMPORTED_MODULE_2__[\"el\"])('.dependencies-list');\n toggleButton.addEventListener('click', function () {\n panel.style.display = 'block';\n list.value = storage.getDependencies().join('\\n');\n });\n closeButton.addEventListener('click', function () {\n panel.style.display = 'none';\n });\n saveButton.addEventListener('click',\n /*#__PURE__*/\n _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(\n /*#__PURE__*/\n _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n storage.setDependencies(list.value.split(/\\r?\\n/).filter(function (dep) {\n return dep !== '' || dep !== '\\n';\n }));\n saveButton.innerHTML = 'loading dependencies ...';\n saveButton.disabled = true;\n _context.next = 5;\n return callback();\n\n case 5:\n panel.style.display = 'none';\n saveButton.innerHTML = 'Save';\n saveButton.disabled = false;\n\n case 8:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n })));\n}\n\n//# sourceURL=webpack:///./src/dependenciesManager.js?");
/***/ }),
/***/ "./src/editFile.js":
/*!*************************!*\
!*** ./src/editFile.js ***!
\*************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return editFile; });\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ \"./src/utils.js\");\n\nfunction editFile(storage) {\n var panel = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[\"el\"])('.edit-file');\n var filenameInput = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[\"el\"])('.edit-file input[name=\"filename\"]');\n var saveButton = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[\"el\"])('.edit-file .save');\n var cancelButton = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[\"el\"])('.edit-file .cancel');\n var deleteButton = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[\"el\"])('.edit-file .delete');\n var currentEditedFileIndex;\n var callback;\n saveButton.addEventListener('click', function () {\n storage.editFile(currentEditedFileIndex, {\n filename: filenameInput.value\n });\n filenameInput.value = '';\n panel.style.display = 'none';\n callback('rename');\n });\n cancelButton.addEventListener('click', function () {\n filenameInput.value = '';\n panel.style.display = 'none';\n });\n deleteButton.addEventListener('click', function () {\n storage.deleteFile(currentEditedFileIndex);\n filenameInput.value = '';\n panel.style.display = 'none';\n callback('delete');\n });\n return function (index, cb) {\n var currentFile = storage.getFileAt(index);\n deleteButton.style.display = storage.getFiles().length > 1 ? 'block' : 'none';\n currentEditedFileIndex = index;\n callback = cb;\n filenameInput.value = currentFile.filename;\n panel.style.display = 'block';\n filenameInput.focus();\n };\n}\n\n//# sourceURL=webpack:///./src/editFile.js?");
/***/ }),
/***/ "./src/editor.js":
/*!***********************!*\
!*** ./src/editor.js ***!
\***********************/
/*! exports provided: createEditor, loadEditorTheme */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createEditor\", function() { return createEditor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadEditorTheme\", function() { return loadEditorTheme; });\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/objectSpread */ \"./node_modules/@babel/runtime/helpers/objectSpread.js\");\n/* harmony import */ var _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ \"./src/utils.js\");\n\n\n\n\nvar createEditor =\n/*#__PURE__*/\nfunction () {\n var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()(\n /*#__PURE__*/\n _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(editorSettings, value, onSave, onChange) {\n var container, editor, save, change;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n container = Object(_utils__WEBPACK_IMPORTED_MODULE_3__[\"el\"])('.js-code-editor');\n editor = CodeMirror(container, _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_1___default()({\n value: value || '',\n mode: 'jsx',\n tabSize: 2,\n lineNumbers: false,\n autofocus: true,\n foldGutter: false,\n gutters: [],\n styleSelectedText: true\n }, editorSettings));\n\n save = function save() {\n return onSave(editor.getValue());\n };\n\n change = function change() {\n return onChange(editor.getValue());\n };\n\n editor.on('change', change);\n editor.setOption(\"extraKeys\", {\n 'Ctrl-S': save,\n 'Cmd-S': save\n });\n CodeMirror.normalizeKeyMap();\n editor.focus();\n return _context.abrupt(\"return\", editor);\n\n case 9:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n return function createEditor(_x, _x2, _x3, _x4) {\n return _ref.apply(this, arguments);\n };\n}();\nvar loadEditorTheme =\n/*#__PURE__*/\nfunction () {\n var _ref3 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()(\n /*#__PURE__*/\n _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee2(_ref2) {\n var theme, res, css;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n theme = _ref2.theme;\n _context2.prev = 1;\n _context2.next = 4;\n return fetch(\"\".concat(Object(_utils__WEBPACK_IMPORTED_MODULE_3__[\"getDistFolderURL\"])(), \"vendor/codemirror/theme/\").concat(theme, \".css\"));\n\n case 4:\n res = _context2.sent;\n _context2.next = 7;\n return res.text();\n\n case 7:\n css = _context2.sent;\n Object(_utils__WEBPACK_IMPORTED_MODULE_3__[\"addStyleString\"])(css);\n _context2.next = 14;\n break;\n\n case 11:\n _context2.prev = 11;\n _context2.t0 = _context2[\"catch\"](1);\n console.log(_context2.t0);\n\n case 14:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this, [[1, 11]]);\n }));\n\n return function loadEditorTheme(_x5) {\n return _ref3.apply(this, arguments);\n };\n}();\n\n//# sourceURL=webpack:///./src/editor.js?");
/***/ }),
/***/ "./src/execute.js":
/*!************************!*\
!*** ./src/execute.js ***!
\************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return executeCode; });\n/* harmony import */ var _transpile__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./transpile */ \"./src/transpile.js\");\n\nfunction executeCode(code) {\n try {\n new Function(Object(_transpile__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(code))();\n } catch (error) {\n console.error(error);\n }\n}\n\n//# sourceURL=webpack:///./src/execute.js?");
/***/ }),
/***/ "./src/index.js":
/*!**********************!*\
!*** ./src/index.js ***!
\**********************/
/*! no exports provided */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _storage__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./storage */ \"./src/storage.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ \"./src/utils.js\");\n/* harmony import */ var _editor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./editor */ \"./src/editor.js\");\n/* harmony import */ var _console__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./console */ \"./src/console.js\");\n/* harmony import */ var _screenSplit__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./screenSplit */ \"./src/screenSplit.js\");\n/* harmony import */ var _navigation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./navigation */ \"./src/navigation.js\");\n/* harmony import */ var _execute__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./execute */ \"./src/execute.js\");\n/* harmony import */ var _teardown__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./teardown */ \"./src/teardown.js\");\n/* harmony import */ var _editFile__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./editFile */ \"./src/editFile.js\");\n/* harmony import */ var _storageManager__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./storageManager */ \"./src/storageManager.js\");\n/* harmony import */ var _dependenciesManager__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./dependenciesManager */ \"./src/dependenciesManager.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\nwindow.onload =\n/*#__PURE__*/\n_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(\n/*#__PURE__*/\n_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee7() {\n var storage, _storage$getCurrentFi, initialEditorValue, cleanUp, editFilePanel, editor, loadFileInEditor, renderNavigation;\n\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee7$(_context7) {\n while (1) {\n switch (_context7.prev = _context7.next) {\n case 0:\n Object(_screenSplit__WEBPACK_IMPORTED_MODULE_6__[\"default\"])();\n _context7.next = 3;\n return Object(_storage__WEBPACK_IMPORTED_MODULE_2__[\"default\"])();\n\n case 3:\n storage = _context7.sent;\n _storage$getCurrentFi = storage.getCurrentFile(), initialEditorValue = _storage$getCurrentFi.content;\n cleanUp = Object(_teardown__WEBPACK_IMPORTED_MODULE_9__[\"default\"])(Object(_console__WEBPACK_IMPORTED_MODULE_5__[\"default\"])());\n editFilePanel = Object(_editFile__WEBPACK_IMPORTED_MODULE_10__[\"default\"])(storage);\n Object(_storageManager__WEBPACK_IMPORTED_MODULE_11__[\"default\"])(storage);\n _context7.next = 10;\n return Object(_utils__WEBPACK_IMPORTED_MODULE_3__[\"loadDependencies\"])(storage.getDependencies());\n\n case 10:\n _context7.next = 12;\n return Object(_editor__WEBPACK_IMPORTED_MODULE_4__[\"loadEditorTheme\"])(storage.getEditorSettings());\n\n case 12:\n _context7.next = 14;\n return Object(_editor__WEBPACK_IMPORTED_MODULE_4__[\"createEditor\"])(storage.getEditorSettings(), initialEditorValue,\n /*#__PURE__*/\n function () {\n var _onSave = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(\n /*#__PURE__*/\n _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(code) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return cleanUp();\n\n case 2:\n storage.editCurrentFile({\n content: code,\n editing: false\n });\n renderNavigation();\n Object(_execute__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(code);\n\n case 5:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n return function onSave(_x) {\n return _onSave.apply(this, arguments);\n };\n }(), function onChange(code) {\n storage.editCurrentFile({\n editing: true\n });\n renderNavigation();\n });\n\n case 14:\n editor = _context7.sent;\n\n loadFileInEditor =\n /*#__PURE__*/\n function () {\n var _ref2 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(\n /*#__PURE__*/\n _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee2(file) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return cleanUp();\n\n case 2:\n editor.setValue(file.content);\n editor.focus(); // we have to do this because we fire the onChange handler of the editor which sets editing=true;\n\n storage.editCurrentFile({\n editing: false\n });\n Object(_execute__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(file.content);\n renderNavigation();\n\n case 7:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n\n return function loadFileInEditor(_x2) {\n return _ref2.apply(this, arguments);\n };\n }();\n\n renderNavigation = Object(_navigation__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(storage,\n /*#__PURE__*/\n function () {\n var _showFile = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(\n /*#__PURE__*/\n _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee3(index) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n loadFileInEditor(storage.changeActiveFile(index));\n\n case 1:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3, this);\n }));\n\n return function showFile(_x3) {\n return _showFile.apply(this, arguments);\n };\n }(),\n /*#__PURE__*/\n function () {\n var _newFile = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(\n /*#__PURE__*/\n _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee4() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n loadFileInEditor(storage.addNewFile());\n\n case 1:\n case \"end\":\n return _context4.stop();\n }\n }\n }, _callee4, this);\n }));\n\n return function newFile() {\n return _newFile.apply(this, arguments);\n };\n }(), function editFile(index) {\n editFilePanel(index,\n /*#__PURE__*/\n function () {\n var _ref3 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(\n /*#__PURE__*/\n _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee5(action) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee5$(_context5) {\n while (1) {\n switch (_context5.prev = _context5.next) {\n case 0:\n renderNavigation();\n\n if (action === 'delete') {\n loadFileInEditor(storage.getCurrentFile());\n }\n\n editor.focus();\n\n case 3:\n case \"end\":\n return _context5.stop();\n }\n }\n }, _callee5, this);\n }));\n\n return function (_x4) {\n return _ref3.apply(this, arguments);\n };\n }());\n });\n Object(_dependenciesManager__WEBPACK_IMPORTED_MODULE_12__[\"default\"])(storage,\n /*#__PURE__*/\n _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(\n /*#__PURE__*/\n _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee6() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee6$(_context6) {\n while (1) {\n switch (_context6.prev = _context6.next) {\n case 0:\n _context6.next = 2;\n return Object(_utils__WEBPACK_IMPORTED_MODULE_3__[\"loadDependencies\"])(storage.getDependencies());\n\n case 2:\n case \"end\":\n return _context6.stop();\n }\n }\n }, _callee6, this);\n })));\n\n if (initialEditorValue) {\n Object(_execute__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(initialEditorValue);\n }\n\n document.querySelector('.container').style.opacity = 1;\n\n case 20:\n case \"end\":\n return _context7.stop();\n }\n }\n }, _callee7, this);\n}));\n\n//# sourceURL=webpack:///./src/index.js?");
/***/ }),
/***/ "./src/navigation.js":
/*!***************************!*\
!*** ./src/navigation.js ***!
\***************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return navigation; });\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ \"./src/utils.js\");\n\nfunction navigation(storage, showFile, newFile, editFile) {\n var navigation = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[\"el\"])('.files .nav');\n\n var render = function render() {\n var items = []; // current files\n\n items.push('<ul>');\n storage.getFiles().forEach(function (_ref, idx) {\n var filename = _ref.filename,\n editing = _ref.editing;\n items.push(\"<li><a href=\\\"javascript:window.showFile(\".concat(idx, \");void(0);\\\" \").concat(storage.isCurrentIndex(idx) ? 'class=\"active\"' : '', \"\\\" oncontextmenu=\\\"javascript:window.editFile(\").concat(idx, \");return false;\\\">\").concat(filename).concat(editing ? ' *' : '', \"</a></li>\"));\n });\n items.push('</ul>'); // icons\n\n items.push('<ul class=\"with-icons\"><li><a href=\"javascript:window.newFile()\"><svg width=\"24\" height=\"24\" viewBox=\"0 0 1792 1792\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M1600 736v192q0 40-28 68t-68 28h-416v416q0 40-28 68t-68 28h-192q-40 0-68-28t-28-68v-416h-416q-40 0-68-28t-28-68v-192q0-40 28-68t68-28h416v-416q0-40 28-68t68-28h192q40 0 68 28t28 68v416h416q40 0 68 28t28 68z\"/></svg></a></li></ul>');\n navigation.innerHTML = items.join('');\n };\n\n render();\n\n window.showFile = function (index) {\n return showFile(index);\n };\n\n window.editFile = function (index) {\n return editFile(index);\n };\n\n window.newFile = function () {\n return newFile();\n };\n\n return render;\n}\n\n//# sourceURL=webpack:///./src/navigation.js?");
/***/ }),
/***/ "./src/screenSplit.js":
/*!****************************!*\
!*** ./src/screenSplit.js ***!
\****************************/
/*! exports provided: LOCAL_STORAGE_SPLIT_SIZES_KEY, default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LOCAL_STORAGE_SPLIT_SIZES_KEY\", function() { return LOCAL_STORAGE_SPLIT_SIZES_KEY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return screenSplit; });\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__);\n\nvar LOCAL_STORAGE_SPLIT_SIZES_KEY = 'demoit-split-sizes-v2';\nfunction screenSplit() {\n var isLocalStorageAvailable = typeof window.localStorage !== 'undefined';\n var defaultValues = [25, 75, 75, 25];\n\n var getSizes = function getSizes() {\n if (isLocalStorageAvailable) {\n var valueInStorage = localStorage.getItem(LOCAL_STORAGE_SPLIT_SIZES_KEY);\n\n if (valueInStorage) {\n valueInStorage = valueInStorage.split(',');\n\n if (valueInStorage.length === 4) {\n return valueInStorage.map(Number);\n }\n }\n }\n\n return defaultValues;\n };\n\n var _getSizes = getSizes(),\n _getSizes2 = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default()(_getSizes, 4),\n A = _getSizes2[0],\n B = _getSizes2[1],\n C = _getSizes2[2],\n D = _getSizes2[3];\n\n var mainSplit = Split(['.left', '.right'], {\n sizes: [A, B],\n gutterSize: 4\n });\n var leftSplit = Split(['.output', '.console'], {\n sizes: [C, D],\n gutterSize: 4,\n direction: 'vertical'\n });\n isLocalStorageAvailable && setInterval(function () {\n localStorage.setItem(LOCAL_STORAGE_SPLIT_SIZES_KEY, mainSplit.getSizes().join(',') + ',' + leftSplit.getSizes().join(','));\n }, 4000);\n}\n\n//# sourceURL=webpack:///./src/screenSplit.js?");
/***/ }),
/***/ "./src/storage.js":
/*!************************!*\
!*** ./src/storage.js ***!
\************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return createStorage; });\n/* harmony import */ var _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/objectSpread */ \"./node_modules/@babel/runtime/helpers/objectSpread.js\");\n/* harmony import */ var _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ \"./src/utils.js\");\n/* harmony import */ var _storageManager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./storageManager */ \"./src/storageManager.js\");\n\n\n\n\n\nvar LS_KEY = 'DEMOIT_v1';\nvar EMPTY_FILE = {\n content: '',\n filename: 'untitled.js',\n editing: false\n};\nvar DEFAULT_SETTINGS = {\n editor: {\n theme: 'material'\n },\n dependencies: [],\n files: []\n};\n\nvar resolveSettings =\n/*#__PURE__*/\nfunction () {\n var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()(\n /*#__PURE__*/\n _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee() {\n var res, settings;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n _context.next = 3;\n return fetch('./settings.json');\n\n case 3:\n res = _context.sent;\n _context.next = 6;\n return res.json();\n\n case 6:\n return _context.abrupt(\"return\", _context.sent);\n\n case 9:\n _context.prev = 9;\n _context.t0 = _context[\"catch\"](0);\n\n case 11:\n if (!Object(_utils__WEBPACK_IMPORTED_MODULE_3__[\"isLocalStorageAvailable\"])()) {\n _context.next = 22;\n break;\n }\n\n settings = localStorage.getItem(LS_KEY);\n _context.prev = 13;\n\n if (!settings) {\n _context.next = 16;\n break;\n }\n\n return _context.abrupt(\"return\", JSON.parse(settings));\n\n case 16:\n _context.next = 22;\n break;\n\n case 18:\n _context.prev = 18;\n _context.t1 = _context[\"catch\"](13);\n console.error(\"There is some data in the local storage under the \".concat(LS_KEY, \" key. However, it is not a valid JSON.\"));\n return _context.abrupt(\"return\", DEFAULT_SETTINGS);\n\n case 22:\n return _context.abrupt(\"return\", DEFAULT_SETTINGS);\n\n case 23:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this, [[0, 9], [13, 18]]);\n }));\n\n return function resolveSettings() {\n return _ref.apply(this, arguments);\n };\n}();\n\nvar resolveActiveFileIndex = function resolveActiveFileIndex(files) {\n var hash = location.hash.replace(/^#/, '');\n\n if (hash !== '') {\n var found = files.findIndex(function (_ref2) {\n var filename = _ref2.filename;\n return filename === hash;\n });\n\n if (found >= 0) {\n return found;\n }\n }\n\n return 0;\n};\n\nfunction createStorage() {\n return _createStorage.apply(this, arguments);\n}\n\nfunction _createStorage() {\n _createStorage = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()(\n /*#__PURE__*/\n _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee2() {\n var localStorageAvailable, settings, activeFileIndex, api;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n localStorageAvailable = Object(_utils__WEBPACK_IMPORTED_MODULE_3__[\"isLocalStorageAvailable\"])();\n _context2.next = 3;\n return resolveSettings();\n\n case 3:\n settings = _context2.sent;\n activeFileIndex = resolveActiveFileIndex(settings.files);\n api = {\n setCurrentIndex: function setCurrentIndex(idx) {\n activeFileIndex = idx;\n location.hash = settings.files[idx].filename;\n },\n isCurrentIndex: function isCurrentIndex(idx) {\n return activeFileIndex === idx;\n },\n dump: function dump() {\n return settings;\n },\n getDependencies: function getDependencies() {\n return settings.dependencies;\n },\n setDependencies: function setDependencies(dependencies) {\n settings.dependencies = dependencies;\n },\n getEditorSettings: function getEditorSettings() {\n return settings.editor;\n },\n getFiles: function getFiles() {\n return settings.files;\n },\n getCurrentFile: function getCurrentFile() {\n return this.getFiles()[activeFileIndex];\n },\n getFileAt: function getFileAt(index) {\n return this.getFiles()[index];\n },\n makeSureOneFileAtLeast: function makeSureOneFileAtLeast() {\n if (this.getFiles().length === 0) {\n settings.files.push(EMPTY_FILE);\n this.setCurrentIndex(0);\n }\n },\n editFile: function editFile(index, updates) {\n settings.files[index] = _babel_runtime_helpers_objectSpread__WEBPACK_IMPORTED_MODULE_0___default()({}, settings.files[index], updates);\n\n if (localStorageAvailable) {\n localStorage.setItem(LS_KEY, JSON.stringify(settings));\n }\n },\n editCurrentFile: function editCurrentFile(updates) {\n this.editFile(activeFileIndex, updates);\n },\n changeActiveFile: function changeActiveFile(index) {\n this.setCurrentIndex(index);\n return this.getCurrentFile();\n },\n addNewFile: function addNewFile() {\n settings.files.push(EMPTY_FILE);\n return this.changeActiveFile(settings.files.length - 1);\n },\n deleteFile: function deleteFile(index) {\n if (index === activeFileIndex) {\n this.setCurrentIndex(0);\n settings.files.splice(index, 1);\n } else {\n var currentFile = this.getCurrentFile();\n settings.files.splice(index, 1);\n this.setCurrentIndex(this.getFiles().findIndex(function (file) {\n return file === currentFile;\n }) || 0);\n }\n }\n };\n api.makeSureOneFileAtLeast();\n return _context2.abrupt(\"return\", api);\n\n case 8:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n return _createStorage.apply(this, arguments);\n}\n\n//# sourceURL=webpack:///./src/storage.js?");
/***/ }),
/***/ "./src/storageManager.js":
/*!*******************************!*\
!*** ./src/storageManager.js ***!
\*******************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return storageManager; });\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ \"./src/utils.js\");\n\nfunction storageManager(storage) {\n var manageStorageButton = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[\"el\"])('.storage');\n var manageStoragePanel = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[\"el\"])('.manage-storage');\n var closeManageStoragePanel = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[\"el\"])('.manage-storage .cancel');\n var settingsJSON = Object(_utils__WEBPACK_IMPORTED_MODULE_0__[\"el\"])('.settings-json');\n manageStorageButton.addEventListener('click', function () {\n manageStoragePanel.style.display = 'block';\n settingsJSON.value = JSON.stringify(storage.dump(), null, 2);\n });\n closeManageStoragePanel.addEventListener('click', function () {\n manageStoragePanel.style.display = 'none';\n });\n}\n\n//# sourceURL=webpack:///./src/storageManager.js?");
/***/ }),
/***/ "./src/teardown.js":
/*!*************************!*\
!*** ./src/teardown.js ***!
\*************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils */ \"./src/utils.js\");\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (_ref) {\n var clearConsole = _ref.clear;\n return (\n /*#__PURE__*/\n function () {\n var _teardown = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(\n /*#__PURE__*/\n _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee() {\n var output;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n clearConsole();\n output = Object(_utils__WEBPACK_IMPORTED_MODULE_2__[\"el\"])('.output');\n\n if (typeof ReactDOM !== 'undefined') {\n ReactDOM.unmountComponentAtNode(output);\n }\n\n output.innerHTML = '<div class=\"hint\"><div id=\"output\" /></div>';\n\n case 4:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n return function teardown() {\n return _teardown.apply(this, arguments);\n };\n }()\n );\n});\n\n//# sourceURL=webpack:///./src/teardown.js?");
/***/ }),
/***/ "./src/transpile.js":
/*!**************************!*\
!*** ./src/transpile.js ***!
\**************************/
/*! exports provided: default */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return preprocess; });\nvar babelOptions = {\n presets: [\"react\", [\"es2015\", {\n \"modules\": false\n }]]\n};\nfunction preprocess(str) {\n var _Babel$transform = Babel.transform(str, babelOptions),\n code = _Babel$transform.code;\n\n return code;\n}\n\n//# sourceURL=webpack:///./src/transpile.js?");
/***/ }),
/***/ "./src/utils.js":
/*!**********************!*\
!*** ./src/utils.js ***!
\**********************/
/*! exports provided: el, addStyleString, addScriptString, addJSFile, addCSSFile, debounce, getSettings, loadDependencies, basename, getDistFolderURL, isLocalStorageAvailable */
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"el\", function() { return el; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"addStyleString\", function() { return addStyleString; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"addScriptString\", function() { return addScriptString; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"addJSFile\", function() { return addJSFile; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"addCSSFile\", function() { return addCSSFile; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"debounce\", function() { return debounce; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getSettings\", function() { return getSettings; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadDependencies\", function() { return loadDependencies; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"basename\", function() { return basename; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDistFolderURL\", function() { return getDistFolderURL; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isLocalStorageAvailable\", function() { return isLocalStorageAvailable; });\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n\n\nvar el = function el(sel) {\n return document.querySelector(sel);\n};\nvar addStyleString = function addStyleString(str) {\n var node = document.createElement('style');\n node.innerHTML = str;\n document.body.appendChild(node);\n};\nvar addScriptString = function addScriptString(str) {\n var node = document.createElement('script');\n node.innerHTML = str;\n document.body.appendChild(node);\n};\nvar LOADED_FILES_CACHE = {};\nvar addJSFile = function addJSFile(path, done) {\n if (LOADED_FILES_CACHE[path]) return done();\n var node = document.createElement('script');\n node.src = path;\n node.addEventListener('load', function () {\n LOADED_FILES_CACHE[path] = true;\n done();\n });\n document.body.appendChild(node);\n};\nvar addCSSFile = function addCSSFile(path, done) {\n if (LOADED_FILES_CACHE[path]) return done();\n var node = document.createElement('link');\n node.setAttribute('rel', 'stylesheet');\n node.setAttribute('type', 'text/css');\n node.setAttribute('href', path);\n node.addEventListener('load', function () {\n LOADED_FILES_CACHE[path] = true;\n done();\n });\n document.body.appendChild(node);\n};\nvar debounce = function debounce(func, wait, immediate) {\n var timeout;\n return function () {\n var context = this,\n args = arguments;\n\n var later = function later() {\n timeout = null;\n if (!immediate) func.apply(context, args);\n };\n\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) func.apply(context, args);\n };\n};\nvar getSettings =\n/*#__PURE__*/\nfunction () {\n var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(\n /*#__PURE__*/\n _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(file) {\n var res;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.prev = 0;\n _context.next = 3;\n return fetch(file);\n\n case 3:\n res = _context.sent;\n _context.next = 6;\n return res.json();\n\n case 6:\n return _context.abrupt(\"return\", _context.sent);\n\n case 9:\n _context.prev = 9;\n _context.t0 = _context[\"catch\"](0);\n return _context.abrupt(\"return\", {\n editor: {\n theme: 'material'\n },\n dependencies: []\n });\n\n case 12:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this, [[0, 9]]);\n }));\n\n return function getSettings(_x) {\n return _ref.apply(this, arguments);\n };\n}();\nvar loadDependencies =\n/*#__PURE__*/\nfunction () {\n var _ref2 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()(\n /*#__PURE__*/\n _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee2(dependencies) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", Promise.all(dependencies.map(function (resource) {\n return new Promise(function (done) {\n var extension = resource.split('.').pop().toLowerCase();\n\n if (extension === 'js') {\n addJSFile(resource, done);\n } else if (extension === 'css') {\n addCSSFile(resource);\n done();\n } else {\n done();\n }\n });\n })));\n\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n\n return function loadDependencies(_x2) {\n return _ref2.apply(this, arguments);\n };\n}();\nvar basename = function basename(path) {\n return path.split('/').reverse()[0];\n};\nvar getDistFolderURL = function getDistFolderURL() {\n try {\n return [].slice.call(document.querySelectorAll('script[src]')).map(function (_ref3) {\n var src = _ref3.src;\n return src;\n }).find(function (url) {\n return url.match('demoit.js');\n }).replace('demoit.js', '');\n } catch (error) {\n return './';\n }\n};\nvar isLocalStorageAvailable = function isLocalStorageAvailable() {\n var test = 'test';\n\n try {\n localStorage.setItem(test, test);\n localStorage.removeItem(test);\n return true;\n } catch (e) {\n return false;\n }\n};\n\n//# sourceURL=webpack:///./src/utils.js?");
/***/ }),
/***/ 0:
/*!****************************!*\
!*** multi ./src/index.js ***!
\****************************/
/*! no static exports found */
/***/ (function(module, exports, __webpack_require__) {
eval("module.exports = __webpack_require__(/*! ./src/index.js */\"./src/index.js\");\n\n\n//# sourceURL=webpack:///multi_./src/index.js?");
/***/ })
/******/ });