{ "version": 3, "sources": [ "../../Users/cheahshen/AppData/Roaming/npm/node_modules/ksana-cli/node_modules/browserify/node_modules/browser-pack/_prelude.js", "index.js", "src/main.jsx", "src/s56-11.json", "src/versionselector.js", "../node_modules/diff/diff.js", "../node_modules/ksana2015-webruntime/downloader.js", "../node_modules/ksana2015-webruntime/html5fs.js", "../node_modules/ksana2015-webruntime/ksanagap.js", "../node_modules/ksana2015-webruntime/livereload.js", "../node_modules/ksana2015-webruntime/mkdirp.js" ], "names": [], "mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;;ACNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3mBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA", "file": "generated.js", "sourceRoot": "", "sourcesContent": [ "(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o/g, '>');\n n = n.replace(/\"/g, '"');\n\n return n;\n }\n\n // This function handles the presence of circular references by bailing out when encountering an\n // object that is already on the \"stack\" of items being processed.\n function canonicalize(obj, stack, replacementStack) {\n stack = stack || [];\n replacementStack = replacementStack || [];\n\n var i;\n\n for (i = 0; i < stack.length; i += 1) {\n if (stack[i] === obj) {\n return replacementStack[i];\n }\n }\n\n var canonicalizedObj;\n\n if ('[object Array]' === objectPrototypeToString.call(obj)) {\n stack.push(obj);\n canonicalizedObj = new Array(obj.length);\n replacementStack.push(canonicalizedObj);\n for (i = 0; i < obj.length; i += 1) {\n canonicalizedObj[i] = canonicalize(obj[i], stack, replacementStack);\n }\n stack.pop();\n replacementStack.pop();\n } else if (typeof obj === 'object' && obj !== null) {\n stack.push(obj);\n canonicalizedObj = {};\n replacementStack.push(canonicalizedObj);\n var sortedKeys = [],\n key;\n for (key in obj) {\n sortedKeys.push(key);\n }\n sortedKeys.sort();\n for (i = 0; i < sortedKeys.length; i += 1) {\n key = sortedKeys[i];\n canonicalizedObj[key] = canonicalize(obj[key], stack, replacementStack);\n }\n stack.pop();\n replacementStack.pop();\n } else {\n canonicalizedObj = obj;\n }\n return canonicalizedObj;\n }\n\n function buildValues(components, newString, oldString, useLongestToken) {\n var componentPos = 0,\n componentLen = components.length,\n newPos = 0,\n oldPos = 0;\n\n for (; componentPos < componentLen; componentPos++) {\n var component = components[componentPos];\n if (!component.removed) {\n if (!component.added && useLongestToken) {\n var value = newString.slice(newPos, newPos + component.count);\n value = map(value, function(value, i) {\n var oldValue = oldString[oldPos + i];\n return oldValue.length > value.length ? oldValue : value;\n });\n\n component.value = value.join('');\n } else {\n component.value = newString.slice(newPos, newPos + component.count).join('');\n }\n newPos += component.count;\n\n // Common case\n if (!component.added) {\n oldPos += component.count;\n }\n } else {\n component.value = oldString.slice(oldPos, oldPos + component.count).join('');\n oldPos += component.count;\n\n // Reverse add and remove so removes are output first to match common convention\n // The diffing algorithm is tied to add then remove output and this is the simplest\n // route to get the desired output with minimal overhead.\n if (componentPos && components[componentPos - 1].added) {\n var tmp = components[componentPos - 1];\n components[componentPos - 1] = components[componentPos];\n components[componentPos] = tmp;\n }\n }\n }\n\n return components;\n }\n\n function Diff(ignoreWhitespace) {\n this.ignoreWhitespace = ignoreWhitespace;\n }\n Diff.prototype = {\n diff: function(oldString, newString, callback) {\n var self = this;\n\n function done(value) {\n if (callback) {\n setTimeout(function() { callback(undefined, value); }, 0);\n return true;\n } else {\n return value;\n }\n }\n\n // Handle the identity case (this is due to unrolling editLength == 0\n if (newString === oldString) {\n return done([{ value: newString }]);\n }\n if (!newString) {\n return done([{ value: oldString, removed: true }]);\n }\n if (!oldString) {\n return done([{ value: newString, added: true }]);\n }\n\n newString = this.tokenize(newString);\n oldString = this.tokenize(oldString);\n\n var newLen = newString.length, oldLen = oldString.length;\n var editLength = 1;\n var maxEditLength = newLen + oldLen;\n var bestPath = [{ newPos: -1, components: [] }];\n\n // Seed editLength = 0, i.e. the content starts with the same values\n var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0);\n if (bestPath[0].newPos + 1 >= newLen && oldPos + 1 >= oldLen) {\n // Identity per the equality and tokenizer\n return done([{value: newString.join('')}]);\n }\n\n // Main worker method. checks all permutations of a given edit length for acceptance.\n function execEditLength() {\n for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\n var basePath;\n var addPath = bestPath[diagonalPath - 1],\n removePath = bestPath[diagonalPath + 1],\n oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n if (addPath) {\n // No one else is going to attempt to use this value, clear it\n bestPath[diagonalPath - 1] = undefined;\n }\n\n var canAdd = addPath && addPath.newPos + 1 < newLen,\n canRemove = removePath && 0 <= oldPos && oldPos < oldLen;\n if (!canAdd && !canRemove) {\n // If this path is a terminal then prune\n bestPath[diagonalPath] = undefined;\n continue;\n }\n\n // Select the diagonal that we want to branch from. We select the prior\n // path whose position in the new string is the farthest from the origin\n // and does not pass the bounds of the diff graph\n if (!canAdd || (canRemove && addPath.newPos < removePath.newPos)) {\n basePath = clonePath(removePath);\n self.pushComponent(basePath.components, undefined, true);\n } else {\n basePath = addPath; // No need to clone, we've pulled it from the list\n basePath.newPos++;\n self.pushComponent(basePath.components, true, undefined);\n }\n\n oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath);\n\n // If we have hit the end of both strings, then we are done\n if (basePath.newPos + 1 >= newLen && oldPos + 1 >= oldLen) {\n return done(buildValues(basePath.components, newString, oldString, self.useLongestToken));\n } else {\n // Otherwise track this path as a potential candidate and continue.\n bestPath[diagonalPath] = basePath;\n }\n }\n\n editLength++;\n }\n\n // Performs the length of edit iteration. Is a bit fugly as this has to support the\n // sync and async mode which is never fun. Loops over execEditLength until a value\n // is produced.\n if (callback) {\n (function exec() {\n setTimeout(function() {\n // This should not happen, but we want to be safe.\n /*istanbul ignore next */\n if (editLength > maxEditLength) {\n return callback();\n }\n\n if (!execEditLength()) {\n exec();\n }\n }, 0);\n }());\n } else {\n while (editLength <= maxEditLength) {\n var ret = execEditLength();\n if (ret) {\n return ret;\n }\n }\n }\n },\n\n pushComponent: function(components, added, removed) {\n var last = components[components.length - 1];\n if (last && last.added === added && last.removed === removed) {\n // We need to clone here as the component clone operation is just\n // as shallow array clone\n components[components.length - 1] = {count: last.count + 1, added: added, removed: removed };\n } else {\n components.push({count: 1, added: added, removed: removed });\n }\n },\n extractCommon: function(basePath, newString, oldString, diagonalPath) {\n var newLen = newString.length,\n oldLen = oldString.length,\n newPos = basePath.newPos,\n oldPos = newPos - diagonalPath,\n\n commonCount = 0;\n while (newPos + 1 < newLen && oldPos + 1 < oldLen && this.equals(newString[newPos + 1], oldString[oldPos + 1])) {\n newPos++;\n oldPos++;\n commonCount++;\n }\n\n if (commonCount) {\n basePath.components.push({count: commonCount});\n }\n\n basePath.newPos = newPos;\n return oldPos;\n },\n\n equals: function(left, right) {\n var reWhitespace = /\\S/;\n return left === right || (this.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right));\n },\n tokenize: function(value) {\n return value.split('');\n }\n };\n\n var CharDiff = new Diff();\n\n var WordDiff = new Diff(true);\n var WordWithSpaceDiff = new Diff();\n WordDiff.tokenize = WordWithSpaceDiff.tokenize = function(value) {\n return removeEmpty(value.split(/(\\s+|\\b)/));\n };\n\n var CssDiff = new Diff(true);\n CssDiff.tokenize = function(value) {\n return removeEmpty(value.split(/([{}:;,]|\\s+)/));\n };\n\n var LineDiff = new Diff();\n\n var TrimmedLineDiff = new Diff();\n TrimmedLineDiff.ignoreTrim = true;\n\n LineDiff.tokenize = TrimmedLineDiff.tokenize = function(value) {\n var retLines = [],\n lines = value.split(/^/m);\n for (var i = 0; i < lines.length; i++) {\n var line = lines[i],\n lastLine = lines[i - 1],\n lastLineLastChar = lastLine && lastLine[lastLine.length - 1];\n\n // Merge lines that may contain windows new lines\n if (line === '\\n' && lastLineLastChar === '\\r') {\n retLines[retLines.length - 1] = retLines[retLines.length - 1].slice(0, -1) + '\\r\\n';\n } else {\n if (this.ignoreTrim) {\n line = line.trim();\n // add a newline unless this is the last line.\n if (i < lines.length - 1) {\n line += '\\n';\n }\n }\n retLines.push(line);\n }\n }\n\n return retLines;\n };\n\n var PatchDiff = new Diff();\n PatchDiff.tokenize = function(value) {\n var ret = [],\n linesAndNewlines = value.split(/(\\n|\\r\\n)/);\n\n // Ignore the final empty token that occurs if the string ends with a new line\n if (!linesAndNewlines[linesAndNewlines.length - 1]) {\n linesAndNewlines.pop();\n }\n\n // Merge the content and line separators into single tokens\n for (var i = 0; i < linesAndNewlines.length; i++) {\n var line = linesAndNewlines[i];\n\n if (i % 2) {\n ret[ret.length - 1] += line;\n } else {\n ret.push(line);\n }\n }\n return ret;\n };\n\n var SentenceDiff = new Diff();\n SentenceDiff.tokenize = function(value) {\n return removeEmpty(value.split(/(\\S.+?[.!?])(?=\\s+|$)/));\n };\n\n var JsonDiff = new Diff();\n // Discriminate between two lines of pretty-printed, serialized JSON where one of them has a\n // dangling comma and the other doesn't. Turns out including the dangling comma yields the nicest output:\n JsonDiff.useLongestToken = true;\n JsonDiff.tokenize = LineDiff.tokenize;\n JsonDiff.equals = function(left, right) {\n return LineDiff.equals(left.replace(/,([\\r\\n])/g, '$1'), right.replace(/,([\\r\\n])/g, '$1'));\n };\n\n var JsDiff = {\n Diff: Diff,\n\n diffChars: function(oldStr, newStr, callback) { return CharDiff.diff(oldStr, newStr, callback); },\n diffWords: function(oldStr, newStr, callback) { return WordDiff.diff(oldStr, newStr, callback); },\n diffWordsWithSpace: function(oldStr, newStr, callback) { return WordWithSpaceDiff.diff(oldStr, newStr, callback); },\n diffLines: function(oldStr, newStr, callback) { return LineDiff.diff(oldStr, newStr, callback); },\n diffTrimmedLines: function(oldStr, newStr, callback) { return TrimmedLineDiff.diff(oldStr, newStr, callback); },\n\n diffSentences: function(oldStr, newStr, callback) { return SentenceDiff.diff(oldStr, newStr, callback); },\n\n diffCss: function(oldStr, newStr, callback) { return CssDiff.diff(oldStr, newStr, callback); },\n diffJson: function(oldObj, newObj, callback) {\n return JsonDiff.diff(\n typeof oldObj === 'string' ? oldObj : JSON.stringify(canonicalize(oldObj), undefined, ' '),\n typeof newObj === 'string' ? newObj : JSON.stringify(canonicalize(newObj), undefined, ' '),\n callback\n );\n },\n\n createTwoFilesPatch: function(oldFileName, newFileName, oldStr, newStr, oldHeader, newHeader) {\n var ret = [];\n\n if (oldFileName == newFileName) {\n ret.push('Index: ' + oldFileName);\n }\n ret.push('===================================================================');\n ret.push('--- ' + oldFileName + (typeof oldHeader === 'undefined' ? '' : '\\t' + oldHeader));\n ret.push('+++ ' + newFileName + (typeof newHeader === 'undefined' ? '' : '\\t' + newHeader));\n\n var diff = PatchDiff.diff(oldStr, newStr);\n diff.push({value: '', lines: []}); // Append an empty value to make cleanup easier\n\n // Formats a given set of lines for printing as context lines in a patch\n function contextLines(lines) {\n return map(lines, function(entry) { return ' ' + entry; });\n }\n\n // Outputs the no newline at end of file warning if needed\n function eofNL(curRange, i, current) {\n var last = diff[diff.length - 2],\n isLast = i === diff.length - 2,\n isLastOfType = i === diff.length - 3 && current.added !== last.added;\n\n // Figure out if this is the last line for the given file and missing NL\n if (!(/\\n$/.test(current.value)) && (isLast || isLastOfType)) {\n curRange.push('\\\\ No newline at end of file');\n }\n }\n\n var oldRangeStart = 0, newRangeStart = 0, curRange = [],\n oldLine = 1, newLine = 1;\n for (var i = 0; i < diff.length; i++) {\n var current = diff[i],\n lines = current.lines || current.value.replace(/\\n$/, '').split('\\n');\n current.lines = lines;\n\n if (current.added || current.removed) {\n // If we have previous context, start with that\n if (!oldRangeStart) {\n var prev = diff[i - 1];\n oldRangeStart = oldLine;\n newRangeStart = newLine;\n\n if (prev) {\n curRange = contextLines(prev.lines.slice(-4));\n oldRangeStart -= curRange.length;\n newRangeStart -= curRange.length;\n }\n }\n\n // Output our changes\n curRange.push.apply(curRange, map(lines, function(entry) {\n return (current.added ? '+' : '-') + entry;\n }));\n eofNL(curRange, i, current);\n\n // Track the updated file position\n if (current.added) {\n newLine += lines.length;\n } else {\n oldLine += lines.length;\n }\n } else {\n // Identical context lines. Track line changes\n if (oldRangeStart) {\n // Close out any changes that have been output (or join overlapping)\n if (lines.length <= 8 && i < diff.length - 2) {\n // Overlapping\n curRange.push.apply(curRange, contextLines(lines));\n } else {\n // end the range and output\n var contextSize = Math.min(lines.length, 4);\n ret.push(\n '@@ -' + oldRangeStart + ',' + (oldLine - oldRangeStart + contextSize)\n + ' +' + newRangeStart + ',' + (newLine - newRangeStart + contextSize)\n + ' @@');\n ret.push.apply(ret, curRange);\n ret.push.apply(ret, contextLines(lines.slice(0, contextSize)));\n if (lines.length <= 4) {\n eofNL(ret, i, current);\n }\n\n oldRangeStart = 0;\n newRangeStart = 0;\n curRange = [];\n }\n }\n oldLine += lines.length;\n newLine += lines.length;\n }\n }\n\n return ret.join('\\n') + '\\n';\n },\n\n createPatch: function(fileName, oldStr, newStr, oldHeader, newHeader) {\n return JsDiff.createTwoFilesPatch(fileName, fileName, oldStr, newStr, oldHeader, newHeader);\n },\n\n applyPatch: function(oldStr, uniDiff) {\n var diffstr = uniDiff.split('\\n'),\n hunks = [],\n i = 0,\n remEOFNL = false,\n addEOFNL = false;\n\n // Skip to the first change hunk\n while (i < diffstr.length && !(/^@@/.test(diffstr[i]))) {\n i++;\n }\n\n // Parse the unified diff\n for (; i < diffstr.length; i++) {\n if (diffstr[i][0] === '@') {\n var chnukHeader = diffstr[i].split(/@@ -(\\d+),(\\d+) \\+(\\d+),(\\d+) @@/);\n hunks.unshift({\n start: chnukHeader[3],\n oldlength: +chnukHeader[2],\n removed: [],\n newlength: chnukHeader[4],\n added: []\n });\n } else if (diffstr[i][0] === '+') {\n hunks[0].added.push(diffstr[i].substr(1));\n } else if (diffstr[i][0] === '-') {\n hunks[0].removed.push(diffstr[i].substr(1));\n } else if (diffstr[i][0] === ' ') {\n hunks[0].added.push(diffstr[i].substr(1));\n hunks[0].removed.push(diffstr[i].substr(1));\n } else if (diffstr[i][0] === '\\\\') {\n if (diffstr[i - 1][0] === '+') {\n remEOFNL = true;\n } else if (diffstr[i - 1][0] === '-') {\n addEOFNL = true;\n }\n }\n }\n\n // Apply the diff to the input\n var lines = oldStr.split('\\n');\n for (i = hunks.length - 1; i >= 0; i--) {\n var hunk = hunks[i];\n // Sanity check the input string. Bail if we don't match.\n for (var j = 0; j < hunk.oldlength; j++) {\n if (lines[hunk.start - 1 + j] !== hunk.removed[j]) {\n return false;\n }\n }\n Array.prototype.splice.apply(lines, [hunk.start - 1, hunk.oldlength].concat(hunk.added));\n }\n\n // Handle EOFNL insertion/removal\n if (remEOFNL) {\n while (!lines[lines.length - 1]) {\n lines.pop();\n }\n } else if (addEOFNL) {\n lines.push('');\n }\n return lines.join('\\n');\n },\n\n convertChangesToXML: function(changes) {\n var ret = [];\n for (var i = 0; i < changes.length; i++) {\n var change = changes[i];\n if (change.added) {\n ret.push('');\n } else if (change.removed) {\n ret.push('');\n }\n\n ret.push(escapeHTML(change.value));\n\n if (change.added) {\n ret.push('');\n } else if (change.removed) {\n ret.push('');\n }\n }\n return ret.join('');\n },\n\n // See: http://code.google.com/p/google-diff-match-patch/wiki/API\n convertChangesToDMP: function(changes) {\n var ret = [],\n change,\n operation;\n for (var i = 0; i < changes.length; i++) {\n change = changes[i];\n if (change.added) {\n operation = 1;\n } else if (change.removed) {\n operation = -1;\n } else {\n operation = 0;\n }\n\n ret.push([operation, change.value]);\n }\n return ret;\n },\n\n canonicalize: canonicalize\n };\n\n /*istanbul ignore next */\n /*global module */\n if (typeof module !== 'undefined' && module.exports) {\n module.exports = JsDiff;\n } else if (typeof define === 'function' && define.amd) {\n /*global define */\n define([], function() { return JsDiff; });\n } else if (typeof global.JsDiff === 'undefined') {\n global.JsDiff = JsDiff;\n }\n}(this));\n", "\r\nvar userCancel=false;\r\nvar files=[];\r\nvar totalDownloadByte=0;\r\nvar targetPath=\"\";\r\nvar tempPath=\"\";\r\nvar nfile=0;\r\nvar baseurl=\"\";\r\nvar result=\"\";\r\nvar downloading=false;\r\nvar startDownload=function(dbid,_baseurl,_files) { //return download id\r\n\tvar fs = require(\"fs\");\r\n\tvar path = require(\"path\");\r\n\r\n\t\r\n\tfiles=_files.split(\"\\uffff\");\r\n\tif (downloading) return false; //only one session\r\n\tuserCancel=false;\r\n\ttotalDownloadByte=0;\r\n\tnextFile();\r\n\tdownloading=true;\r\n\tbaseurl=_baseurl;\r\n\tif (baseurl[baseurl.length-1]!='/')baseurl+='/';\r\n\ttargetPath=ksanagap.rootPath+dbid+'/';\r\n\ttempPath=ksanagap.rootPath+\".tmp/\";\r\n\tresult=\"\";\r\n\treturn true;\r\n}\r\n\r\nvar nextFile=function() {\r\n\tsetTimeout(function(){\r\n\t\tif (nfile==files.length) {\r\n\t\t\tnfile++;\r\n\t\t\tendDownload();\r\n\t\t} else {\r\n\t\t\tdownloadFile(nfile++);\t\r\n\t\t}\r\n\t},100);\r\n}\r\n\r\nvar downloadFile=function(nfile) {\r\n\tvar url=baseurl+files[nfile];\r\n\tvar tmpfilename=tempPath+files[nfile];\r\n\tvar mkdirp = require(\"./mkdirp\");\r\n\tvar fs = require(\"fs\");\r\n\tvar http = require(\"http\");\r\n\r\n\tmkdirp.sync(path.dirname(tmpfilename));\r\n\tvar writeStream = fs.createWriteStream(tmpfilename);\r\n\tvar datalength=0;\r\n\tvar request = http.get(url, function(response) {\r\n\t\tresponse.on('data',function(chunk){\r\n\t\t\twriteStream.write(chunk);\r\n\t\t\ttotalDownloadByte+=chunk.length;\r\n\t\t\tif (userCancel) {\r\n\t\t\t\twriteStream.end();\r\n\t\t\t\tsetTimeout(function(){nextFile();},100);\r\n\t\t\t}\r\n\t\t});\r\n\t\tresponse.on(\"end\",function() {\r\n\t\t\twriteStream.end();\r\n\t\t\tsetTimeout(function(){nextFile();},100);\r\n\t\t});\r\n\t});\r\n}\r\n\r\nvar cancelDownload=function() {\r\n\tuserCancel=true;\r\n\tendDownload();\r\n}\r\nvar verify=function() {\r\n\treturn true;\r\n}\r\nvar endDownload=function() {\r\n\tnfile=files.length+1;//stop\r\n\tresult=\"cancelled\";\r\n\tdownloading=false;\r\n\tif (userCancel) return;\r\n\tvar fs = require(\"fs\");\r\n\tvar mkdirp = require(\"./mkdirp\");\r\n\r\n\tfor (var i=0;ifiles.length) return result;\r\n\telse return \"\";\r\n}\r\nvar downloadingFile=function() {\r\n\treturn nfile-1;\r\n}\r\n\r\nvar downloader={startDownload:startDownload, downloadedByte:downloadedByte,\r\n\tdownloadingFile:downloadingFile, cancelDownload:cancelDownload,doneDownload:doneDownload};\r\nmodule.exports=downloader;", "/* emulate filesystem on html5 browser */\r\nvar get_head=function(url,field,cb){\r\n\tvar xhr = new XMLHttpRequest();\r\n\txhr.open(\"HEAD\", url, true);\r\n\txhr.onreadystatechange = function() {\r\n\t\t\tif (this.readyState == this.DONE) {\r\n\t\t\t\tcb(xhr.getResponseHeader(field));\r\n\t\t\t} else {\r\n\t\t\t\tif (this.status!==200&&this.status!==206) {\r\n\t\t\t\t\tcb(\"\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t};\r\n\txhr.send();\r\n}\r\nvar get_date=function(url,cb) {\r\n\tget_head(url,\"Last-Modified\",function(value){\r\n\t\tcb(value);\r\n\t});\r\n}\r\nvar get_size=function(url, cb) {\r\n\tget_head(url,\"Content-Length\",function(value){\r\n\t\tcb(parseInt(value));\r\n\t});\r\n};\r\nvar checkUpdate=function(url,fn,cb) {\r\n\tif (!url) {\r\n\t\tcb(false);\r\n\t\treturn;\r\n\t}\r\n\tget_date(url,function(d){\r\n\t\tAPI.fs.root.getFile(fn, {create: false, exclusive: false}, function(fileEntry) {\r\n\t\t\tfileEntry.getMetadata(function(metadata){\r\n\t\t\t\tvar localDate=Date.parse(metadata.modificationTime);\r\n\t\t\t\tvar urlDate=Date.parse(d);\r\n\t\t\t\tcb(urlDate>localDate);\r\n\t\t\t});\r\n\t\t},function(){\r\n\t\t\tcb(false);\r\n\t\t});\r\n\t});\r\n}\r\nvar download=function(url,fn,cb,statuscb,context) {\r\n\t var totalsize=0,batches=null,written=0;\r\n\t var fileEntry=0, fileWriter=0;\r\n\t var createBatches=function(size) {\r\n\t\tvar bytes=1024*1024, out=[];\r\n\t\tvar b=Math.floor(size / bytes);\r\n\t\tvar last=size %bytes;\r\n\t\tfor (var i=0;i<=b;i++) {\r\n\t\t\tout.push(i*bytes);\r\n\t\t}\r\n\t\tout.push(b*bytes+last);\r\n\t\treturn out;\r\n\t }\r\n\t var finish=function() {\r\n\t\t rm(fn,function(){\r\n\t\t\t\tfileEntry.moveTo(fileEntry.filesystem.root, fn,function(){\r\n\t\t\t\t\tsetTimeout( cb.bind(context,false) , 0) ;\r\n\t\t\t\t},function(e){\r\n\t\t\t\t\tconsole.log(\"failed\",e)\r\n\t\t\t\t});\r\n\t\t },this);\r\n\t };\r\n\t\tvar tempfn=\"temp.kdb\";\r\n\t\tvar batch=function(b) {\r\n\t\tvar abort=false;\r\n\t\tvar xhr = new XMLHttpRequest();\r\n\t\tvar requesturl=url+\"?\"+Math.random();\r\n\t\txhr.open('get', requesturl, true);\r\n\t\txhr.setRequestHeader('Range', 'bytes='+batches[b]+'-'+(batches[b+1]-1));\r\n\t\txhr.responseType = 'blob';\r\n\t\txhr.addEventListener('load', function() {\r\n\t\t\tvar blob=this.response;\r\n\t\t\tfileEntry.createWriter(function(fileWriter) {\r\n\t\t\t\tfileWriter.seek(fileWriter.length);\r\n\t\t\t\tfileWriter.write(blob);\r\n\t\t\t\twritten+=blob.size;\r\n\t\t\t\tfileWriter.onwriteend = function(e) {\r\n\t\t\t\t\tif (statuscb) {\r\n\t\t\t\t\t\tabort=statuscb.apply(context,[ fileWriter.length / totalsize,totalsize ]);\r\n\t\t\t\t\t\tif (abort) setTimeout( cb.bind(context,false) , 0) ;\r\n\t\t\t\t \t}\r\n\t\t\t\t\tb++;\r\n\t\t\t\t\tif (!abort) {\r\n\t\t\t\t\t\tif (b-1) {\r\n\t\tcreateDir(API.fs.root, filename.substr(0,slash).split(\"/\"),function(){\r\n\t\t\tgetFile(filename);\r\n\t\t});\r\n\t} else {\r\n\t\tgetFile(filename);\r\n\t}\r\n}\r\n\r\nvar readdir=function(cb,context) {\r\n\tvar dirReader = API.fs.root.createReader();\r\n\tvar out=[],that=this;\r\n\tdirReader.readEntries(function(entries) {\r\n\t\tif (entries.length) {\r\n\t\t\tfor (var i = 0, entry; entry = entries[i]; ++i) {\r\n\t\t\t\tif (entry.isFile) {\r\n\t\t\t\t\tout.push([entry.name,entry.toURL ? entry.toURL() : entry.toURI()]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tAPI.files=out;\r\n\t\tif (cb) cb.apply(context,[out]);\r\n\t}, function(){\r\n\t\tif (cb) cb.apply(context,[null]);\r\n\t});\r\n}\r\nvar getFileURL=function(filename) {\r\n\tif (!API.files ) return null;\r\n\tvar file= API.files.filter(function(f){return f[0]==filename});\r\n\tif (file.length) return file[0][1];\r\n}\r\nvar rm=function(filename,cb,context) {\r\n\tvar url=getFileURL(filename);\r\n\tif (url) rmURL(url,cb,context);\r\n\telse if (cb) cb.apply(context,[false]);\r\n}\r\n\r\nvar rmURL=function(filename,cb,context) {\r\n\twebkitResolveLocalFileSystemURL(filename, function(fileEntry) {\r\n\t\tfileEntry.remove(function() {\r\n\t\t\tif (cb) cb.apply(context,[true]);\r\n\t\t}, console.error);\r\n\t}, function(e){\r\n\t\tif (cb) cb.apply(context,[false]);//no such file\r\n\t});\r\n}\r\nfunction errorHandler(e) {\r\n\tconsole.error('Error: ' +e.name+ \" \"+e.message);\r\n}\r\nvar initfs=function(grantedBytes,cb,context) {\r\n\twebkitRequestFileSystem(PERSISTENT, grantedBytes, function(fs) {\r\n\t\tAPI.fs=fs;\r\n\t\tAPI.quota=grantedBytes;\r\n\t\treaddir(function(){\r\n\t\t\tAPI.initialized=true;\r\n\t\t\tcb.apply(context,[grantedBytes,fs]);\r\n\t\t},context);\r\n\t}, errorHandler);\r\n}\r\nvar init=function(quota,cb,context) {\r\n\tnavigator.webkitPersistentStorage.requestQuota(quota,\r\n\t\t\tfunction(grantedBytes) {\r\n\t\t\t\tinitfs(grantedBytes,cb,context);\r\n\t\t}, errorHandler\r\n\t);\r\n}\r\nvar queryQuota=function(cb,context) {\r\n\tvar that=this;\r\n\tnavigator.webkitPersistentStorage.queryUsageAndQuota(\r\n\t function(usage,quota){\r\n\t\t\tinitfs(quota,function(){\r\n\t\t\t\tcb.apply(context,[usage,quota]);\r\n\t\t\t},context);\r\n\t});\r\n}\r\nvar API={\r\n\tinit:init\r\n\t,readdir:readdir\r\n\t,checkUpdate:checkUpdate\r\n\t,rm:rm\r\n\t,rmURL:rmURL\r\n\t,getFileURL:getFileURL\r\n\t,writeFile:writeFile\r\n\t,readFile:readFile\r\n\t,download:download\r\n\t,get_head:get_head\r\n\t,get_date:get_date\r\n\t,get_size:get_size\r\n\t,getDownloadSize:get_size\r\n\t,queryQuota:queryQuota\r\n}\r\nmodule.exports=API;\r\n", "var appname=\"installer\";\r\nif (typeof ksana==\"undefined\") {\r\n\twindow.ksana={platform:\"chrome\"};\r\n\tif (typeof process!==\"undefined\" && \r\n\t\tprocess.versions && process.versions[\"node-webkit\"]) {\r\n\t\twindow.ksana.platform=\"node-webkit\";\r\n\t}\r\n}\r\nvar switchApp=function(path) {\r\n\tvar fs=require(\"fs\");\r\n\tpath=\"../\"+path;\r\n\tappname=path;\r\n\tdocument.location.href= path+\"/index.html\"; \r\n\tprocess.chdir(path);\r\n}\r\nvar downloader={};\r\nvar rootPath=\"\";\r\n\r\nvar deleteApp=function(app) {\r\n\tconsole.error(\"not allow on PC, do it in File Explorer/ Finder\");\r\n}\r\nvar username=function() {\r\n\treturn \"\";\r\n}\r\nvar useremail=function() {\r\n\treturn \"\"\r\n}\r\nvar runtime_version=function() {\r\n\treturn \"1.4\";\r\n}\r\n\r\n//copy from liveupdate\r\nvar jsonp=function(url,dbid,callback,context) {\r\n var script=document.getElementById(\"jsonp2\");\r\n if (script) {\r\n script.parentNode.removeChild(script);\r\n }\r\n window.jsonp_handler=function(data) {\r\n if (typeof data==\"object\") {\r\n data.dbid=dbid;\r\n callback.apply(context,[data]); \r\n } \r\n }\r\n window.jsonp_error_handler=function() {\r\n console.error(\"url unreachable\",url);\r\n callback.apply(context,[null]);\r\n }\r\n script=document.createElement('script');\r\n script.setAttribute('id', \"jsonp2\");\r\n script.setAttribute('onerror', \"jsonp_error_handler()\");\r\n url=url+'?'+(new Date().getTime());\r\n script.setAttribute('src', url);\r\n document.getElementsByTagName('head')[0].appendChild(script); \r\n}\r\n\r\n\r\nvar loadKsanajs=function(){\r\n\r\n\tif (typeof process!=\"undefined\" && !process.browser) {\r\n\t\tvar ksanajs=require(\"fs\").readFileSync(\"./ksana.js\",\"utf8\").trim();\r\n\t\tdownloader=require(\"./downloader\");\r\n\t\tksana.js=JSON.parse(ksanajs.substring(14,ksanajs.length-1));\r\n\t\trootPath=process.cwd();\r\n\t\trootPath=require(\"path\").resolve(rootPath,\"..\").replace(/\\\\/g,\"/\")+'/';\r\n\t\tksana.ready=true;\r\n\t} else{\r\n\t\tvar url=window.location.origin+window.location.pathname.replace(\"index.html\",\"\")+\"ksana.js\";\r\n\t\tjsonp(url,appname,function(data){\r\n\t\t\tksana.js=data;\r\n\t\t\tksana.ready=true;\r\n\t\t});\r\n\t}\r\n}\r\n\r\nloadKsanajs();\r\n\r\nvar boot=function(appId,cb) {\r\n\tif (typeof appId==\"function\") {\r\n\t\tcb=appId;\r\n\t\tappId=\"unknownapp\";\r\n\t}\r\n\tif (!ksana.js && ksana.platform==\"node-webkit\") {\r\n\t\tloadKsanajs();\r\n\t}\r\n\tksana.appId=appId;\r\n\tif (ksana.ready) {\r\n\t\tcb();\r\n\t\treturn;\r\n\t}\r\n\tvar timer=setInterval(function(){\r\n\t\t\tif (ksana.ready){\r\n\t\t\t\tclearInterval(timer);\r\n\t\t\t\tcb();\r\n\t\t\t}\r\n\t\t},1000);\r\n}\r\n\r\n\r\nvar ksanagap={\r\n\tplatform:\"node-webkit\",\r\n\tstartDownload:downloader.startDownload,\r\n\tdownloadedByte:downloader.downloadedByte,\r\n\tdownloadingFile:downloader.downloadingFile,\r\n\tcancelDownload:downloader.cancelDownload,\r\n\tdoneDownload:downloader.doneDownload,\r\n\tswitchApp:switchApp,\r\n\trootPath:rootPath,\r\n\tdeleteApp: deleteApp,\r\n\tusername:username, //not support on PC\r\n\tuseremail:username,\r\n\truntime_version:runtime_version,\r\n\tboot:boot\r\n}\r\nmodule.exports=ksanagap;", "var started=false;\r\nvar timer=null;\r\nvar bundledate=null;\r\nvar get_date=require(\"./html5fs\").get_date;\r\nvar checkIfBundleUpdated=function() {\r\n\tget_date(\"bundle.js\",function(date){\r\n\t\tif (bundledate &&bundledate!=date){\r\n\t\t\tlocation.reload();\r\n\t\t}\r\n\t\tbundledate=date;\r\n\t});\r\n}\r\nvar livereload=function() {\r\n\tif(window.location.origin.indexOf(\"//127.0.0.1\")===-1) return;\r\n\r\n\tif (started) return;\r\n\r\n\ttimer1=setInterval(function(){\r\n\t\tcheckIfBundleUpdated();\r\n\t},2000);\r\n\tstarted=true;\r\n}\r\n\r\nmodule.exports=livereload;", "function mkdirP (p, mode, f, made) {\r\n var path = nodeRequire('path');\r\n var fs = nodeRequire('fs');\r\n\t\r\n if (typeof mode === 'function' || mode === undefined) {\r\n f = mode;\r\n mode = 0x1FF & (~process.umask());\r\n }\r\n if (!made) made = null;\r\n\r\n var cb = f || function () {};\r\n if (typeof mode === 'string') mode = parseInt(mode, 8);\r\n p = path.resolve(p);\r\n\r\n fs.mkdir(p, mode, function (er) {\r\n if (!er) {\r\n made = made || p;\r\n return cb(null, made);\r\n }\r\n switch (er.code) {\r\n case 'ENOENT':\r\n mkdirP(path.dirname(p), mode, function (er, made) {\r\n if (er) cb(er, made);\r\n else mkdirP(p, mode, cb, made);\r\n });\r\n break;\r\n\r\n // In the case of any other error, just see if there's a dir\r\n // there already. If so, then hooray! If not, then something\r\n // is borked.\r\n default:\r\n fs.stat(p, function (er2, stat) {\r\n // if the stat fails, then that's super weird.\r\n // let the original error be the failure reason.\r\n if (er2 || !stat.isDirectory()) cb(er, made)\r\n else cb(null, made);\r\n });\r\n break;\r\n }\r\n });\r\n}\r\n\r\nmkdirP.sync = function sync (p, mode, made) {\r\n var path = nodeRequire('path');\r\n var fs = nodeRequire('fs');\r\n if (mode === undefined) {\r\n mode = 0x1FF & (~process.umask());\r\n }\r\n if (!made) made = null;\r\n\r\n if (typeof mode === 'string') mode = parseInt(mode, 8);\r\n p = path.resolve(p);\r\n\r\n try {\r\n fs.mkdirSync(p, mode);\r\n made = made || p;\r\n }\r\n catch (err0) {\r\n switch (err0.code) {\r\n case 'ENOENT' :\r\n made = sync(path.dirname(p), mode, made);\r\n sync(p, mode, made);\r\n break;\r\n\r\n // In the case of any other error, just see if there's a dir\r\n // there already. If so, then hooray! If not, then something\r\n // is borked.\r\n default:\r\n var stat;\r\n try {\r\n stat = fs.statSync(p);\r\n }\r\n catch (err1) {\r\n throw err0;\r\n }\r\n if (!stat.isDirectory()) throw err0;\r\n break;\r\n }\r\n }\r\n\r\n return made;\r\n};\r\n\r\nmodule.exports = mkdirP.mkdirp = mkdirP.mkdirP = mkdirP;\r\n" ] }