diff --git a/.gitignore b/.gitignore index 8a2ca180..29f916f0 100644 --- a/.gitignore +++ b/.gitignore @@ -19,7 +19,7 @@ backups/ # ignore config files config.json -public/js/common.js +public/js/config.js .sequelizerc # ignore webpack build diff --git a/AUTHORS b/AUTHORS index cec831b8..e366b8e9 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,10 +1,26 @@ List of HackMD contributors. +Bartlomiej Szala +Dmytro Kytsmen Fabien Meghazi Ikumi Shimizu +ivanorsolic Jason Croft Jannik Lorenz +Jordan Matelsky +Lapinot +Laura Kyle +Marcelo Alencar +Martijnpold +Massimo Ghinassi Max Wu +Ömer Erdinç Yağmurlu +p0v1n0m +Pablo Guerrero Peter Dave Hello +Qubo +Sergio Valverde +Yukai Huang +Zacharias Traianos Zankio 葉家郡 \ No newline at end of file diff --git a/README.md b/README.md index 3443e1d5..4659ae33 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Browsers Requirement Prerequisite --- -- Node.js 4.x or up (test up to 6.2.2) +- Node.js 4.x or up (test up to 6.7.0) - Database (PostgreSQL, MySQL, MariaDB, SQLite, MSSQL) - npm and bower @@ -83,10 +83,10 @@ There are some configs you need to change in the files below ``` ./config.json --- for server settings -./public/js/common.js --- for client settings +./public/js/config.js --- for client settings ``` -Client settings `common.js` +Client settings `config.js` --- | variables | example values | description | @@ -101,10 +101,27 @@ Environment variables (will overwrite other server configs) | variables | example values | description | | --------- | ------ | ----------- | | NODE_ENV | `production` or `development` | set current environment (will apply corresponding settings in the `config.json`) | -| DOMAIN | `hackmd.io` | domain name | -| URL_PATH | `hackmd` | sub url path, like `www.example.com/` | -| PORT | `80` | web app port | | DEBUG | `true` or `false` | set debug mode, show more logs | +| HMD_DOMAIN | `hackmd.io` | domain name | +| HMD_URL_PATH | `hackmd` | sub url path, like `www.example.com/` | +| HMD_PORT | `80` | web app port | +| HMD_ALLOW_ORIGIN | `localhost, hackmd.io` | domain name whitelist (use comma to separate) | +| HMD_PROTOCOL_USESSL | `true` or `false` | set to use ssl protocol for resources path (only applied when domain is set) | +| HMD_URL_ADDPORT | `true` or `false` | set to add port on callback url (port 80 or 443 won't applied) (only applied when domain is set) | +| HMD_FACEBOOK_CLIENTID | no example | Facebook API client id | +| HMD_FACEBOOK_CLIENTSECRET | no example | Facebook API client secret | +| HMD_TWITTER_CONSUMERKEY | no example | Twitter API consumer key | +| HMD_TWITTER_CONSUMERSECRET | no example | Twitter API consumer secret | +| HMD_GITHUB_CLIENTID | no example | GitHub API client id | +| HMD_GITHUB_CLIENTSECRET | no example | GitHub API client secret | +| HMD_GITLAB_BASEURL | no example | GitLab authentication endpoint, set to use other endpoint than GitLab.com (optional) | +| HMD_GITLAB_CLIENTID | no example | GitLab API client id | +| HMD_GITLAB_CLIENTSECRET | no example | GitLab API client secret | +| HMD_DROPBOX_CLIENTID | no example | Dropbox API client id | +| HMD_DROPBOX_CLIENTSECRET | no example | Dropbox API client secret | +| HMD_GOOGLE_CLIENTID | no example | Google API client id | +| HMD_GOOGLE_CLIENTSECRET | no example | Google API client secret | +| HMD_IMGUR_CLIENTID | no example | Imgur API client id | Server settings `config.json` --- @@ -117,8 +134,8 @@ Server settings `config.json` | port | `80` | web app port | | alloworigin | `['localhost']` | domain name whitelist | | usessl | `true` or `false` | set to use ssl server (if true will auto turn on `protocolusessl`) | -| protocolusessl | `true` or `false` | set to use ssl protocol for resources path | -| urladdport | `true` or `false` | set to add port on callback url (port 80 or 443 won't applied) | +| protocolusessl | `true` or `false` | set to use ssl protocol for resources path (only applied when domain is set) | +| urladdport | `true` or `false` | set to add port on callback url (port 80 or 443 won't applied) (only applied when domain is set) | | usecdn | `true` or `false` | set to use CDN resources or not | | db | `{ "dialect": "sqlite", "storage": "./db.hackmd.sqlite" }` | set the db configs, [see more here](http://sequelize.readthedocs.org/en/latest/api/sequelize/) | | sslkeypath | `./cert/client.key` | ssl key path (only need when you set usessl) | @@ -144,11 +161,11 @@ Server settings `config.json` Third-party integration api key settings --- -| service | file path | description | +| service | settings location | description | | ------- | --------- | ----------- | -| facebook, twitter, github, gitlab, dropbox, google | `config.json` | for signin | -| imgur | `config.json` | for image upload | -| google drive, dropbox | `public/js/common.js` | for export and import | +| facebook, twitter, github, gitlab, dropbox, google | environment variables or `config.json` | for signin | +| imgur | environment variables or `config.json` | for image upload | +| google drive, dropbox | `public/js/config.js` | for export and import | Third-party integration oauth callback urls --- diff --git a/app.js b/app.js index e18a2f0b..b877bc8f 100644 --- a/app.js +++ b/app.js @@ -22,6 +22,7 @@ var i18n = require('i18n'); var config = require("./lib/config.js"); var logger = require("./lib/logger.js"); var auth = require("./lib/auth.js"); +var history = require("./lib/history.js"); var response = require("./lib/response.js"); var models = require("./lib/models"); @@ -94,7 +95,7 @@ app.use(helmet.hsts({ })); i18n.configure({ - locales: ['en', 'zh', 'fr', 'de', 'ja', 'es', 'el', 'pt'], + locales: ['en', 'zh', 'fr', 'de', 'ja', 'es', 'el', 'pt', 'it', 'tr', 'ru', 'nl', 'hr', 'pl', 'uk'], cookie: 'locale', directory: __dirname + '/locales' }); @@ -365,56 +366,15 @@ app.get('/logout', function (req, res) { res.redirect(config.serverurl + '/'); }); //get history -app.get('/history', function (req, res) { - if (req.isAuthenticated()) { - models.User.findOne({ - where: { - id: req.user.id - } - }).then(function (user) { - if (!user) - return response.errorNotFound(res); - var history = []; - if (user.history) - history = JSON.parse(user.history); - res.send({ - history: history - }); - if (config.debug) - logger.info('read history success: ' + user.id); - }).catch(function (err) { - logger.error('read history failed: ' + err); - return response.errorInternalError(res); - }); - } else { - return response.errorForbidden(res); - } -}); +app.get('/history', history.historyGet); //post history -app.post('/history', urlencodedParser, function (req, res) { - if (req.isAuthenticated()) { - if (config.debug) - logger.info('SERVER received history from [' + req.user.id + ']: ' + req.body.history); - models.User.update({ - history: req.body.history - }, { - where: { - id: req.user.id - } - }).then(function (count) { - if (!count) - return response.errorNotFound(res); - if (config.debug) - logger.info("write user history success: " + req.user.id); - }).catch(function (err) { - logger.error('write history failed: ' + err); - return response.errorInternalError(res); - }); - res.end(); - } else { - return response.errorForbidden(res); - } -}); +app.post('/history', urlencodedParser, history.historyPost); +//post history by note id +app.post('/history/:noteId', urlencodedParser, history.historyPost); +//delete history +app.delete('/history', history.historyDelete); +//delete history by note id +app.delete('/history/:noteId', history.historyDelete); //get me info app.get('/me', function (req, res) { if (req.isAuthenticated()) { @@ -522,9 +482,9 @@ function startListen() { // sync db then start listen models.sequelize.sync().then(function () { // check if realtime is ready - if (realtime.isReady()) { + if (history.isReady() && realtime.isReady()) { models.Revision.checkAllNotesRevision(function (err, notes) { - if (err) return new Error(err); + if (err) throw new Error(err); if (!notes || notes.length <= 0) return startListen(); }); } @@ -549,9 +509,9 @@ process.on('SIGINT', function () { socket.disconnect(true); }); var checkCleanTimer = setInterval(function () { - if (realtime.isReady()) { + if (history.isReady() && realtime.isReady()) { models.Revision.checkAllNotesRevision(function (err, notes) { - if (err) return new Error(err); + if (err) throw new Error(err); if (notes.length <= 0) { clearInterval(checkCleanTimer); return process.exit(0); diff --git a/bin/setup b/bin/setup index 66279e81..8cd20dc7 100755 --- a/bin/setup +++ b/bin/setup @@ -25,8 +25,8 @@ if [ ! -f config.json ]; then cp config.json.example config.json fi -if [ ! -f publis/js/common.js ]; then - cp public/js/common.js.example public/js/common.js +if [ ! -f publis/js/config.js ]; then + cp public/js/config.js.example public/js/config.js fi if [ ! -f .sequelizerc ]; then @@ -43,7 +43,7 @@ Edit the following config file to setup hackmd server and client. Read more info at https://github.com/hackmdio/hackmd#configuration-files * config.json -- server config -* public/js/common.js -- client config +* public/js/config.js -- client config * .sequelizerc -- db config EOF diff --git a/bower.json b/bower.json index 728a220b..d9923e2c 100644 --- a/bower.json +++ b/bower.json @@ -20,20 +20,19 @@ "Ionicons": "ionicons#~2.0.1", "reveal.js": "~3.3.0", "spin.js": "~2.3.2", - "moment": "~2.14.1", + "moment": "~2.15.1", "handlebars": "~4.0.5", "js-yaml": "~3.6.1", - "raphael": "~2.2.1", - "xss": "~0.2.13", + "raphael": "~2.2.6", "mermaid": "^6.0.0", "MathJax": "^2.6.1", "octicons": "~3.5.0", - "velocity": "^1.2.3", + "velocity": "^1.3.1", "randomcolor": "randomColor#^0.4.4", "Idle.Js": "idle.js#^1.0.0", "gist-embed": "*" }, "resolutions": { - "jquery": "~3.1.0" + "jquery": "~3.1.1" } } diff --git a/lib/config.js b/lib/config.js index 588128a7..63114975 100644 --- a/lib/config.js +++ b/lib/config.js @@ -7,16 +7,17 @@ var config = require(path.join(__dirname, '..', 'config.json'))[env]; var debug = process.env.DEBUG ? (process.env.DEBUG === 'true') : ((typeof config.debug === 'boolean') ? config.debug : (env === 'development')); // url -var domain = process.env.DOMAIN || config.domain || ''; -var urlpath = process.env.URL_PATH || config.urlpath || ''; -var port = process.env.PORT || config.port || 3000; -var alloworigin = config.alloworigin || ['localhost']; +var domain = process.env.DOMAIN || process.env.HMD_DOMAIN || config.domain || ''; +var urlpath = process.env.URL_PATH || process.env.HMD_URL_PATH || config.urlpath || ''; +var port = process.env.PORT || process.env.HMD_PORT || config.port || 3000; +var alloworigin = process.env.HMD_ALLOW_ORIGIN ? process.env.HMD_ALLOW_ORIGIN.split(',') : (config.alloworigin || ['localhost']); var usessl = !!config.usessl; -var protocolusessl = (config.usessl === true && typeof config.protocolusessl === 'undefined') ? true : !!config.protocolusessl; -var urladdport = !!config.urladdport; +var protocolusessl = (usessl === true && typeof process.env.HMD_PROTOCOL_USESSL === 'undefined' && typeof config.protocolusessl === 'undefined') + ? true : (process.env.HMD_PROTOCOL_USESSL ? (process.env.HMD_PROTOCOL_USESSL === 'true') : !!config.protocolusessl); +var urladdport = process.env.HMD_URL_ADDPORT ? (process.env.HMD_URL_ADDPORT === 'true') : !!config.urladdport; -var usecdn = !!config.usecdn; +var usecdn = process.env.HMD_USECDN ? (process.env.HMD_USECDN === 'true') : !!config.usecdn; // db var db = config.db || { @@ -56,13 +57,32 @@ var heartbeattimeout = config.heartbeattimeout || 5000; var documentmaxlength = config.documentmaxlength || 100000; // auth -var facebook = config.facebook || false; -var twitter = config.twitter || false; -var github = config.github || false; -var gitlab = config.gitlab || false; -var dropbox = config.dropbox || false; -var google = config.google || false; -var imgur = config.imgur || false; +var facebook = (process.env.HMD_FACEBOOK_CLIENTID && process.env.HMD_FACEBOOK_CLIENTSECRET) ? { + clientID: process.env.HMD_FACEBOOK_CLIENTID, + clientSecret: process.env.HMD_FACEBOOK_CLIENTSECRET +} : config.facebook || false; +var twitter = (process.env.HMD_TWITTER_CONSUMERKEY && process.env.HMD_TWITTER_CONSUMERSECRET) ? { + consumerKey: process.env.HMD_TWITTER_CONSUMERKEY, + consumerSecret: process.env.HMD_TWITTER_CONSUMERSECRET +} : config.twitter || false; +var github = (process.env.HMD_GITHUB_CLIENTID && process.env.HMD_GITHUB_CLIENTSECRET) ? { + clientID: process.env.HMD_GITHUB_CLIENTID, + clientSecret: process.env.HMD_GITHUB_CLIENTSECRET +} : config.github || false; +var gitlab = (process.env.HMD_GITLAB_CLIENTID && process.env.HMD_GITLAB_CLIENTSECRET) ? { + baseURL: process.env.HMD_GITLAB_BASEURL, + clientID: process.env.HMD_GITLAB_CLIENTID, + clientSecret: process.env.HMD_GITLAB_CLIENTSECRET +} : config.gitlab || false; +var dropbox = (process.env.HMD_DROPBOX_CLIENTID && process.env.HMD_DROPBOX_CLIENTSECRET) ? { + clientID: process.env.HMD_DROPBOX_CLIENTID, + clientSecret: process.env.HMD_DROPBOX_CLIENTSECRET +} : config.dropbox || false; +var google = (process.env.HMD_GOOGLE_CLIENTID && process.env.HMD_GOOGLE_CLIENTSECRET) ? { + clientID: process.env.HMD_GOOGLE_CLIENTID, + clientSecret: process.env.HMD_GOOGLE_CLIENTSECRET +} : config.google || false; +var imgur = process.env.HMD_IMGUR_CLIENTID || config.imgur || false; function getserverurl() { var url = ''; @@ -77,8 +97,8 @@ function getserverurl() { return url; } -var version = '0.4.4'; -var minimumCompatibleVersion = '0.4.4'; +var version = '0.4.5'; +var minimumCompatibleVersion = '0.4.5'; var maintenance = true; var cwd = path.join(__dirname, '..'); diff --git a/lib/history.js b/lib/history.js new file mode 100644 index 00000000..4a3bbe1e --- /dev/null +++ b/lib/history.js @@ -0,0 +1,225 @@ +//history +//external modules +var async = require('async'); +var moment = require('moment'); + +//core +var config = require("./config.js"); +var logger = require("./logger.js"); +var response = require("./response.js"); +var models = require("./models"); + +//public +var History = { + historyGet: historyGet, + historyPost: historyPost, + historyDelete: historyDelete, + isReady: isReady, + updateHistory: updateHistory +}; + +var caches = {}; +//update when the history is dirty +var updater = setInterval(function () { + var deleted = []; + async.each(Object.keys(caches), function (key, callback) { + var cache = caches[key]; + if (cache.isDirty) { + if (config.debug) logger.info("history updater found dirty history: " + key); + var history = parseHistoryToArray(cache.history); + finishUpdateHistory(key, history, function (err, count) { + if (err) return callback(err, null); + if (!count) return callback(null, null); + cache.isDirty = false; + cache.updateAt = Date.now(); + return callback(null, null); + }); + } else { + if (moment().isAfter(moment(cache.updateAt).add(5, 'minutes'))) { + deleted.push(key); + } + return callback(null, null); + } + }, function (err) { + if (err) return logger.error('history updater error', err); + }); + // delete specified caches + for (var i = 0, l = deleted.length; i < l; i++) { + caches[deleted[i]].history = {}; + delete caches[deleted[i]]; + } +}, 1000); + +function finishUpdateHistory(userid, history, callback) { + models.User.update({ + history: JSON.stringify(history) + }, { + where: { + id: userid + } + }).then(function (count) { + return callback(null, count); + }).catch(function (err) { + return callback(err, null); + }); +} + +function isReady() { + var dirtyCount = 0; + async.each(Object.keys(caches), function (key, callback) { + if (caches[key].isDirty) dirtyCount++; + return callback(null, null); + }, function (err) { + if (err) return logger.error('history ready check error', err); + }); + return dirtyCount > 0 ? false : true; +} + +function getHistory(userid, callback) { + if (caches[userid]) { + return callback(null, caches[userid].history); + } else { + models.User.findOne({ + where: { + id: userid + } + }).then(function (user) { + if (!user) + return callback(null, null); + var history = []; + if (user.history) + history = JSON.parse(user.history); + if (config.debug) + logger.info('read history success: ' + user.id); + setHistory(userid, history); + return callback(null, history); + }).catch(function (err) { + logger.error('read history failed: ' + err); + return callback(err, null); + }); + } +} + +function setHistory(userid, history) { + if (Array.isArray(history)) history = parseHistoryToObject(history); + if (!caches[userid]) { + caches[userid] = { + history: {}, + isDirty: false, + updateAt: Date.now() + }; + } + caches[userid].history = history; +} + +function updateHistory(userid, noteId, document) { + if (userid && noteId && typeof document !== 'undefined') { + getHistory(userid, function (err, history) { + if (err || !history) return; + if (!caches[userid].history[noteId]) { + caches[userid].history[noteId] = {}; + } + var noteHistory = caches[userid].history[noteId]; + var noteInfo = models.Note.parseNoteInfo(document); + noteHistory.id = noteId; + noteHistory.text = noteInfo.title; + noteHistory.time = moment().valueOf(); + noteHistory.tags = noteInfo.tags; + caches[userid].isDirty = true; + }); + } +} + +function parseHistoryToArray(history) { + var _history = []; + Object.keys(history).forEach(function (key) { + var item = history[key]; + _history.push(item); + }); + return _history; +} + +function parseHistoryToObject(history) { + var _history = {}; + for (var i = 0, l = history.length; i < l; i++) { + var item = history[i]; + _history[item.id] = item; + } + return _history; +} + +function historyGet(req, res) { + if (req.isAuthenticated()) { + getHistory(req.user.id, function (err, history) { + if (err) return response.errorInternalError(res); + if (!history) return response.errorNotFound(res); + res.send({ + history: parseHistoryToArray(history) + }); + }); + } else { + return response.errorForbidden(res); + } +} + +function historyPost(req, res) { + if (req.isAuthenticated()) { + var noteId = req.params.noteId; + if (!noteId) { + if (typeof req.body['history'] === 'undefined') return response.errorBadRequest(res); + if (config.debug) + logger.info('SERVER received history from [' + req.user.id + ']: ' + req.body.history); + try { + var history = JSON.parse(req.body.history); + } catch (err) { + return response.errorBadRequest(res); + } + if (Array.isArray(history)) { + setHistory(req.user.id, history); + caches[req.user.id].isDirty = true; + res.end(); + } else { + return response.errorBadRequest(res); + } + } else { + if (typeof req.body['pinned'] === 'undefined') return response.errorBadRequest(res); + getHistory(req.user.id, function (err, history) { + if (err) return response.errorInternalError(res); + if (!history) return response.errorNotFound(res); + if (!caches[req.user.id].history[noteId]) return response.errorNotFound(res); + if (req.body.pinned === 'true' || req.body.pinned === 'false') { + caches[req.user.id].history[noteId].pinned = (req.body.pinned === 'true'); + caches[req.user.id].isDirty = true; + res.end(); + } else { + return response.errorBadRequest(res); + } + }); + } + } else { + return response.errorForbidden(res); + } +} + +function historyDelete(req, res) { + if (req.isAuthenticated()) { + var noteId = req.params.noteId; + if (!noteId) { + setHistory(req.user.id, []); + caches[req.user.id].isDirty = true; + res.end(); + } else { + getHistory(req.user.id, function (err, history) { + if (err) return response.errorInternalError(res); + if (!history) return response.errorNotFound(res); + delete caches[req.user.id].history[noteId]; + caches[req.user.id].isDirty = true; + res.end(); + }); + } + } else { + return response.errorForbidden(res); + } +} + +module.exports = History; \ No newline at end of file diff --git a/lib/migrations/20161009040430-support-delete-note.js b/lib/migrations/20161009040430-support-delete-note.js new file mode 100644 index 00000000..f478b6fe --- /dev/null +++ b/lib/migrations/20161009040430-support-delete-note.js @@ -0,0 +1,11 @@ +'use strict'; + +module.exports = { + up: function (queryInterface, Sequelize) { + queryInterface.addColumn('Notes', 'deletedAt', Sequelize.DATE); + }, + + down: function (queryInterface, Sequelize) { + queryInterface.removeColumn('Notes', 'deletedAt', Sequelize.DATE); + } +}; diff --git a/lib/models/note.js b/lib/models/note.js index d1c073e9..7fdc5645 100644 --- a/lib/models/note.js +++ b/lib/models/note.js @@ -11,11 +11,17 @@ var shortId = require('shortid'); var Sequelize = require("sequelize"); var async = require('async'); var moment = require('moment'); +var DiffMatchPatch = require('diff-match-patch'); +var dmp = new DiffMatchPatch(); +var S = require('string'); // core var config = require("../config.js"); var logger = require("../logger.js"); +//ot +var ot = require("../ot/index.js"); + // permission types var permissionTypes = ["freely", "editable", "locked", "private"]; @@ -61,6 +67,7 @@ module.exports = function (sequelize, DataTypes) { type: DataTypes.DATE } }, { + paranoid: true, classMethods: { associate: function (models) { Note.belongsTo(models.User, { @@ -115,6 +122,7 @@ module.exports = function (sequelize, DataTypes) { var fsModifiedTime = moment(fs.statSync(filePath).mtime); var dbModifiedTime = moment(note.lastchangeAt || note.createdAt); var body = fs.readFileSync(filePath, 'utf8'); + var contentLength = body.length; var title = Note.parseNoteTitle(body); body = LZString.compressToBase64(body); title = LZString.compressToBase64(title); @@ -126,7 +134,20 @@ module.exports = function (sequelize, DataTypes) { }).then(function (note) { sequelize.models.Revision.saveNoteRevision(note, function (err, revision) { if (err) return _callback(err, null); - return callback(null, note.id); + // update authorship on after making revision of docs + var patch = dmp.patch_fromText(LZString.decompressFromBase64(revision.patch)); + var operations = Note.transformPatchToOperations(patch, contentLength); + var authorship = note.authorship ? JSON.parse(LZString.decompressFromBase64(note.authorship)) : []; + for (var i = 0; i < operations.length; i++) { + authorship = Note.updateAuthorshipByOperation(operations[i], null, authorship); + } + note.update({ + authorship: LZString.compressToBase64(JSON.stringify(authorship)) + }).then(function (note) { + return callback(null, note.id); + }).catch(function (err) { + return _callback(err, null); + }); }); }).catch(function (err) { return _callback(err, null); @@ -198,8 +219,7 @@ module.exports = function (sequelize, DataTypes) { return callback(null, null); }); }, - parseNoteTitle: function (body) { - var title = ""; + parseNoteInfo: function (body) { var meta = null; try { var obj = metaMarked(body); @@ -209,13 +229,33 @@ module.exports = function (sequelize, DataTypes) { //na } if (!meta) meta = {}; + var $ = cheerio.load(md.render(body)); + return { + title: Note.extractNoteTitle(meta, $), + tags: Note.extractNoteTags(meta, $) + }; + }, + parseNoteTitle: function (body) { + var meta = null; + try { + var obj = metaMarked(body); + body = obj.markdown; + meta = obj.meta; + } catch (err) { + //na + } + if (!meta) meta = {}; + var $ = cheerio.load(md.render(body)); + return Note.extractNoteTitle(meta, $); + }, + extractNoteTitle: function (meta, $) { + var title = ""; if (meta.title && (typeof meta.title == "string" || typeof meta.title == "number")) { title = meta.title; } else { - var $ = cheerio.load(md.render(body)); var h1s = $("h1"); if (h1s.length > 0 && h1s.first().text().split('\n').length == 1) - title = h1s.first().text(); + title = S(h1s.first().text()).stripTags().s; } if (!title) title = "Untitled"; return title; @@ -230,6 +270,40 @@ module.exports = function (sequelize, DataTypes) { title = !title || title == "Untitled" ? "HackMD - Collaborative markdown notes" : title + " - HackMD"; return title; }, + extractNoteTags: function (meta, $) { + var tags = []; + var rawtags = []; + if (meta.tags && (typeof meta.tags == "string" || typeof meta.tags == "number")) { + var metaTags = ('' + meta.tags).split(','); + for (var i = 0; i < metaTags.length; i++) { + var text = metaTags[i].trim(); + if (text) rawtags.push(text); + } + } else { + var h6s = $("h6"); + h6s.each(function (key, value) { + if (/^tags/gmi.test($(value).text())) { + var codes = $(value).find("code"); + for (var i = 0; i < codes.length; i++) { + var text = $(codes[i]).html().trim(); + if (text) rawtags.push(text); + } + } + }); + } + for (var i = 0; i < rawtags.length; i++) { + var found = false; + for (var j = 0; j < tags.length; j++) { + if (tags[j] == rawtags[i]) { + found = true; + break; + } + } + if (!found) + tags.push(rawtags[i]); + } + return tags; + }, parseMeta: function (meta) { var _meta = {}; if (meta) { @@ -247,6 +321,162 @@ module.exports = function (sequelize, DataTypes) { _meta.slideOptions = meta.slideOptions; } return _meta; + }, + updateAuthorshipByOperation: function (operation, userId, authorships) { + var index = 0; + var timestamp = Date.now(); + for (var i = 0; i < operation.length; i++) { + var op = operation[i]; + if (ot.TextOperation.isRetain(op)) { + index += op; + } else if (ot.TextOperation.isInsert(op)) { + var opStart = index; + var opEnd = index + op.length; + var inserted = false; + // authorship format: [userId, startPos, endPos, createdAt, updatedAt] + if (authorships.length <= 0) authorships.push([userId, opStart, opEnd, timestamp, timestamp]); + else { + for (var j = 0; j < authorships.length; j++) { + var authorship = authorships[j]; + if (!inserted) { + var nextAuthorship = authorships[j + 1] || -1; + if (nextAuthorship != -1 && nextAuthorship[1] >= opEnd || j >= authorships.length - 1) { + if (authorship[1] < opStart && authorship[2] > opStart) { + // divide + var postLength = authorship[2] - opStart; + authorship[2] = opStart; + authorship[4] = timestamp; + authorships.splice(j + 1, 0, [userId, opStart, opEnd, timestamp, timestamp]); + authorships.splice(j + 2, 0, [authorship[0], opEnd, opEnd + postLength, authorship[3], timestamp]); + j += 2; + inserted = true; + } else if (authorship[1] >= opStart) { + authorships.splice(j, 0, [userId, opStart, opEnd, timestamp, timestamp]); + j += 1; + inserted = true; + } else if (authorship[2] <= opStart) { + authorships.splice(j + 1, 0, [userId, opStart, opEnd, timestamp, timestamp]); + j += 1; + inserted = true; + } + } + } + if (authorship[1] >= opStart) { + authorship[1] += op.length; + authorship[2] += op.length; + } + } + } + index += op.length; + } else if (ot.TextOperation.isDelete(op)) { + var opStart = index; + var opEnd = index - op; + if (operation.length == 1) { + authorships = []; + } else if (authorships.length > 0) { + for (var j = 0; j < authorships.length; j++) { + var authorship = authorships[j]; + if (authorship[1] >= opStart && authorship[1] <= opEnd && authorship[2] >= opStart && authorship[2] <= opEnd) { + authorships.splice(j, 1); + j -= 1; + } else if (authorship[1] < opStart && authorship[1] < opEnd && authorship[2] > opStart && authorship[2] > opEnd) { + authorship[2] += op; + authorship[4] = timestamp; + } else if (authorship[2] >= opStart && authorship[2] <= opEnd) { + authorship[2] = opStart; + authorship[4] = timestamp; + } else if (authorship[1] >= opStart && authorship[1] <= opEnd) { + authorship[1] = opEnd; + authorship[4] = timestamp; + } + if (authorship[1] >= opEnd) { + authorship[1] += op; + authorship[2] += op; + } + } + } + index += op; + } + } + // merge + for (var j = 0; j < authorships.length; j++) { + var authorship = authorships[j]; + for (var k = j + 1; k < authorships.length; k++) { + var nextAuthorship = authorships[k]; + if (nextAuthorship && authorship[0] === nextAuthorship[0] && authorship[2] === nextAuthorship[1]) { + var minTimestamp = Math.min(authorship[3], nextAuthorship[3]); + var maxTimestamp = Math.max(authorship[3], nextAuthorship[3]); + authorships.splice(j, 1, [authorship[0], authorship[1], nextAuthorship[2], minTimestamp, maxTimestamp]); + authorships.splice(k, 1); + j -= 1; + break; + } + } + } + // clear + for (var j = 0; j < authorships.length; j++) { + var authorship = authorships[j]; + if (!authorship[0]) { + authorships.splice(j, 1); + j -= 1; + } + } + return authorships; + }, + transformPatchToOperations: function (patch, contentLength) { + var operations = []; + if (patch.length > 0) { + // calculate original content length + for (var j = patch.length - 1; j >= 0; j--) { + var p = patch[j]; + for (var i = 0; i < p.diffs.length; i++) { + var diff = p.diffs[i]; + switch(diff[0]) { + case 1: // insert + contentLength -= diff[1].length; + break; + case -1: // delete + contentLength += diff[1].length; + break; + } + } + } + // generate operations + var bias = 0; + var lengthBias = 0; + for (var j = 0; j < patch.length; j++) { + var operation = []; + var p = patch[j]; + var currIndex = p.start1; + var currLength = contentLength - bias; + for (var i = 0; i < p.diffs.length; i++) { + var diff = p.diffs[i]; + switch(diff[0]) { + case 0: // retain + if (i == 0) // first + operation.push(currIndex + diff[1].length); + else if (i != p.diffs.length - 1) // mid + operation.push(diff[1].length); + else // last + operation.push(currLength + lengthBias - currIndex); + currIndex += diff[1].length; + break; + case 1: // insert + operation.push(diff[1]); + lengthBias += diff[1].length; + currIndex += diff[1].length; + break; + case -1: // delete + operation.push(-diff[1].length); + bias += diff[1].length; + currIndex += diff[1].length; + break; + } + } + operations.push(operation); + } + } + return operations; } }, hooks: { diff --git a/lib/ot/editor-socketio-server.js b/lib/ot/editor-socketio-server.js index 45ed5036..d062fa19 100755 --- a/lib/ot/editor-socketio-server.js +++ b/lib/ot/editor-socketio-server.js @@ -55,7 +55,15 @@ EditorSocketIOServer.prototype.addClient = function (socket) { if (typeof self.operationCallback === 'function') self.operationCallback(socket, operation); } catch (err) { - socket.disconnect(true); + setTimeout(function() { + var docOut = { + str: self.document, + revision: self.operations.length, + clients: self.users, + force: true + }; + socket.emit('doc', LZString.compressToUTF16(JSON.stringify(docOut))); + }, 100); } }); }); diff --git a/lib/realtime.js b/lib/realtime.js index 0c68a256..ea3735a6 100644 --- a/lib/realtime.js +++ b/lib/realtime.js @@ -13,6 +13,7 @@ var moment = require('moment'); //core var config = require("./config.js"); var logger = require("./logger.js"); +var history = require("./history.js"); var models = require("./models"); //ot @@ -63,6 +64,7 @@ function secure(socket, next) { function emitCheck(note) { var out = { + title: note.title, updatetime: note.updatetime, lastchangeuser: note.lastchangeuser, lastchangeuserprofile: note.lastchangeuserprofile, @@ -148,7 +150,7 @@ function updateNote(note, callback) { function finishUpdateNote(note, _note, callback) { if (!note || !note.server) return callback(null, null); var body = note.server.document; - var title = models.Note.parseNoteTitle(body); + var title = note.title = models.Note.parseNoteTitle(body); title = LZString.compressToBase64(title); body = LZString.compressToBase64(body); var values = { @@ -312,6 +314,7 @@ function emitRefresh(socket) { if (!noteId || !notes[noteId]) return; var note = notes[noteId]; var out = { + title: note.title, docmaxlength: config.documentmaxlength, owner: note.owner, ownerprofile: note.ownerprofile, @@ -327,6 +330,15 @@ function emitRefresh(socket) { socket.emit('refresh', out); } +function isDuplicatedInSocketQueue(queue, socket) { + for (var i = 0; i < queue.length; i++) { + if (queue[i] && queue[i].id == socket.id) { + return true; + } + } + return false; +} + function clearSocketQueue(queue, socket) { for (var i = 0; i < queue.length; i++) { if (!queue[i] || queue[i].id == socket.id) { @@ -381,6 +393,12 @@ function finishConnection(socket, note, user) { note.server.setName(socket, user.name); note.server.setColor(socket, user.color); + // update user note history + setTimeout(function () { + var noteId = note.alias ? note.alias : LZString.compressToBase64(note.id); + history.updateHistory(user.userid, noteId, note.server.document); + }, 0); + emitOnlineUsers(socket); emitRefresh(socket); @@ -459,6 +477,8 @@ function startConnection(socket) { notes[noteId] = { id: noteId, + alias: note.alias, + title: LZString.decompressFromBase64(note.title), owner: owner, ownerprofile: ownerprofile, permission: note.permission, @@ -509,17 +529,23 @@ function disconnect(socket) { var noteId = socket.noteId; var note = notes[noteId]; if (note) { + // delete user in users delete note.users[socket.id]; + // remove sockets in the note socks do { var index = note.socks.indexOf(socket); if (index != -1) { note.socks.splice(index, 1); } } while (index != -1); + // remove note in notes if no user inside if (Object.keys(note.users).length <= 0) { if (note.server.isDirty) { updateNote(note, function (err, _note) { if (err) return logger.error('disconnect note failed: ' + err); + // clear server before delete to avoid memory leaks + note.server.document = ""; + note.server.operations = []; delete note.server; delete notes[noteId]; if (config.debug) { @@ -640,108 +666,15 @@ function operationCallback(socket, operation) { return logger.error('operation callback failed: ' + err); }); } + // update user note history + setTimeout(function() { + var noteId = note.alias ? note.alias : LZString.compressToBase64(note.id); + history.updateHistory(userId, noteId, note.server.document); + }, 0); + } // save authorship - var index = 0; - var authorships = note.authorship; - var timestamp = Date.now(); - for (var i = 0; i < operation.length; i++) { - var op = operation[i]; - if (ot.TextOperation.isRetain(op)) { - index += op; - } else if (ot.TextOperation.isInsert(op)) { - var opStart = index; - var opEnd = index + op.length; - var inserted = false; - // authorship format: [userId, startPos, endPos, createdAt, updatedAt] - if (authorships.length <= 0) authorships.push([userId, opStart, opEnd, timestamp, timestamp]); - else { - for (var j = 0; j < authorships.length; j++) { - var authorship = authorships[j]; - if (!inserted) { - var nextAuthorship = authorships[j + 1] || -1; - if (nextAuthorship != -1 && nextAuthorship[1] >= opEnd || j >= authorships.length - 1) { - if (authorship[1] < opStart && authorship[2] > opStart) { - // divide - var postLength = authorship[2] - opStart; - authorship[2] = opStart; - authorship[4] = timestamp; - authorships.splice(j + 1, 0, [userId, opStart, opEnd, timestamp, timestamp]); - authorships.splice(j + 2, 0, [authorship[0], opEnd, opEnd + postLength, authorship[3], timestamp]); - j += 2; - inserted = true; - } else if (authorship[1] >= opStart) { - authorships.splice(j, 0, [userId, opStart, opEnd, timestamp, timestamp]); - j += 1; - inserted = true; - } else if (authorship[2] <= opStart) { - authorships.splice(j + 1, 0, [userId, opStart, opEnd, timestamp, timestamp]); - j += 1; - inserted = true; - } - } - } - if (authorship[1] >= opStart) { - authorship[1] += op.length; - authorship[2] += op.length; - } - } - } - index += op.length; - } else if (ot.TextOperation.isDelete(op)) { - var opStart = index; - var opEnd = index - op; - if (operation.length == 1) { - authorships = []; - } else if (authorships.length > 0) { - for (var j = 0; j < authorships.length; j++) { - var authorship = authorships[j]; - if (authorship[1] >= opStart && authorship[1] <= opEnd && authorship[2] >= opStart && authorship[2] <= opEnd) { - authorships.splice(j, 1); - j -= 1; - } else if (authorship[1] < opStart && authorship[1] < opEnd && authorship[2] > opStart && authorship[2] > opEnd) { - authorship[2] += op; - authorship[4] = timestamp; - } else if (authorship[2] >= opStart && authorship[2] <= opEnd) { - authorship[2] = opStart; - authorship[4] = timestamp; - } else if (authorship[1] >= opStart && authorship[1] <= opEnd) { - authorship[1] = opEnd; - authorship[4] = timestamp; - } - if (authorship[1] >= opEnd) { - authorship[1] += op; - authorship[2] += op; - } - } - } - index += op; - } - } - // merge - for (var j = 0; j < authorships.length; j++) { - var authorship = authorships[j]; - for (var k = j + 1; k < authorships.length; k++) { - var nextAuthorship = authorships[k]; - if (nextAuthorship && authorship[0] === nextAuthorship[0] && authorship[2] === nextAuthorship[1]) { - var minTimestamp = Math.min(authorship[3], nextAuthorship[3]); - var maxTimestamp = Math.max(authorship[3], nextAuthorship[3]); - authorships.splice(j, 1, [authorship[0], authorship[1], nextAuthorship[2], minTimestamp, maxTimestamp]); - authorships.splice(k, 1); - j -= 1; - break; - } - } - } - // clear - for (var j = 0; j < authorships.length; j++) { - var authorship = authorships[j]; - if (!authorship[0]) { - authorships.splice(j, 1); - j -= 1; - } - } - note.authorship = authorships; + note.authorship = models.Note.updateAuthorshipByOperation(operation, userId, note.authorship); } function connection(socket) { @@ -753,6 +686,8 @@ function connection(socket) { if (!noteId) { return failConnection(404, 'note id not found', socket); } + + if (isDuplicatedInSocketQueue(socket, connectionSocketQueue)) return; // store noteId in this socket session socket.noteId = noteId; @@ -864,6 +799,35 @@ function connection(socket) { } }); + // delete a note + socket.on('delete', function () { + //need login to do more actions + if (socket.request.user && socket.request.user.logged_in) { + var noteId = socket.noteId; + if (!noteId || !notes[noteId]) return; + var note = notes[noteId]; + //Only owner can delete note + if (note.owner && note.owner == socket.request.user.id) { + models.Note.destroy({ + where: { + id: noteId + } + }).then(function (count) { + if (!count) return; + for (var i = 0, l = note.socks.length; i < l; i++) { + var sock = note.socks[i]; + if (typeof sock !== 'undefined' && sock) { + sock.emit('delete'); + return sock.disconnect(true); + } + } + }).catch(function (err) { + return logger.error('delete note failed: ' + err); + }); + } + } + }); + //reveiced when user logout or changed socket.on('user changed', function () { logger.info('user changed'); @@ -929,6 +893,7 @@ function connection(socket) { //when a new client disconnect socket.on('disconnect', function () { + if (isDuplicatedInSocketQueue(socket, disconnectSocketQueue)) return; disconnectSocketQueue.push(socket); disconnect(socket); }); diff --git a/lib/response.js b/lib/response.js index 796f951f..fa97f157 100755 --- a/lib/response.js +++ b/lib/response.js @@ -33,6 +33,9 @@ var response = { errorNotFound: function (res) { responseError(res, "404", "Not Found", "oops."); }, + errorBadRequest: function (res) { + responseError(res, "400", "Bad Request", "something not right."); + }, errorInternalError: function (res) { responseError(res, "500", "Internal Error", "wtf."); }, @@ -205,6 +208,9 @@ function showPublishNote(req, res, next) { url: origin, body: text, useCDN: config.usecdn, + owner: note.owner ? note.owner.id : null, + ownerprofile: note.owner ? models.User.parseProfile(note.owner.profile) : null, + lastchangeuser: note.lastchangeuser ? note.lastchangeuser.id : null, lastchangeuserprofile: note.lastchangeuser ? models.User.parseProfile(note.lastchangeuser.profile) : null, robots: meta.robots || false, //default allow robots GA: meta.GA, @@ -332,6 +338,13 @@ function actionRevision(req, res, note) { if (!content) { return response.errorNotFound(res); } + res.set({ + 'Access-Control-Allow-Origin': '*', //allow CORS as API + 'Access-Control-Allow-Headers': 'Range', + 'Access-Control-Expose-Headers': 'Cache-Control, Content-Encoding, Content-Range', + 'Cache-Control': 'private', // only cache by client + 'X-Robots-Tag': 'noindex, nofollow' // prevent crawling + }); res.send(content); }); } else { @@ -346,6 +359,13 @@ function actionRevision(req, res, note) { var out = { revision: data }; + res.set({ + 'Access-Control-Allow-Origin': '*', //allow CORS as API + 'Access-Control-Allow-Headers': 'Range', + 'Access-Control-Expose-Headers': 'Cache-Control, Content-Encoding, Content-Range', + 'Cache-Control': 'private', // only cache by client + 'X-Robots-Tag': 'noindex, nofollow' // prevent crawling + }); res.send(out); }); } @@ -576,6 +596,9 @@ function showPublishSlide(req, res, next) { slides: slides, meta: JSON.stringify(obj.meta || {}), useCDN: config.usecdn, + owner: note.owner ? note.owner.id : null, + ownerprofile: note.owner ? models.User.parseProfile(note.owner.profile) : null, + lastchangeuser: note.lastchangeuser ? note.lastchangeuser.id : null, lastchangeuserprofile: note.lastchangeuser ? models.User.parseProfile(note.lastchangeuser.profile) : null, robots: meta.robots || false, //default allow robots GA: meta.GA, diff --git a/locales/hr.json b/locales/hr.json new file mode 100644 index 00000000..e8b4a6fb --- /dev/null +++ b/locales/hr.json @@ -0,0 +1,104 @@ +{ + "Collaborative markdown notes": "Kolaborativne markdown bilješke", + "Realtime collaborative markdown notes on all platforms.": "Kolaborativne markdown bilješke na svim platformama u realnom vremenu.", + "Best way to write and share your knowledge in markdown.": "Najbolji način za pisanje i dijeljenje svog znanja u markdown-u.", + "Intro": "Uvod", + "History": "Povijest", + "New guest note": "Nova bilješka gosta", + "Collaborate with URL": "Kolaboracija sa URL-om", + "Support charts and MathJax": "Support charts and MathJax", + "Support slide mode": "Način podrške slajda", + "Sign In": "Prijavu se", + "Below is the history from browser": "Ispod je povijest preglednika", + "Welcome!": "Dobrodošli!", + "New note": "Nova bilješka", + "or": "ili", + "Sign Out": "Odjavi se", + "Explore all features": "Istraži sve značajke", + "Select tags...": "Odaberi oznake...", + "Search keyword...": "Pretraži ključnu riječ...", + "Sort by title": "Sortiraj po naslovu", + "Title": "Naslov", + "Sort by time": "Sortiraj po vremenu", + "Time": "Vrijeme", + "Export history": "Izvezi povijest", + "Import history": "Uvezi povijest", + "Clear history": "Očisti povijest", + "Refresh history": "Osvježi povijest", + "No history": "Nema povijesti", + "Import from browser": "Uvezi iz preglednika", + "Releases": "Izdanja", + "Are you sure?": "Jeste li sigurni?", + "Cancel": "Odustani", + "Yes, do it!": "Da, učini to!", + "Choose method": "Izaberi metodu", + "Sign in via %s": "Prijavi se pomoću %s", + "New": "Novo", + "Publish": "Objavi", + "Extra": "Dodatno", + "Revision": "Revizija", + "Slide Mode": "Način slajda", + "Export": "Izvoz", + "Import": "Uvoz", + "Clipboard": "Međuspremnik", + "Download": "Preuzimanje", + "Raw HTML": "Raw HTML", + "Edit": "Uredi", + "View": "Pregledaj", + "Both": "Oboje", + "Help": "Pomoć", + "Upload Image": "Prenesi sliku", + "Menu": "Meni", + "This page need refresh": "Ovu stranicu je potrebno osvježiti", + "You have an incompatible client version.": "Imate nekompatibilnu verziju klijenta.", + "Refresh to update.": "Osvježite za ažuriranje.", + "New version available!": "Nova verzija dostupna!", + "See releases notes here": "Pogledajte bilješke izdanja ovdje", + "Refresh to enjoy new features.": "Osvježi za nove značajke.", + "Your user state has changed.": "Stanje Vašeg korisnika se promijenilo.", + "Refresh to load new user state.": "Osvježi za učitavanje novog stanja korisnika.", + "Refresh": "Osvježi", + "Contacts": "Kontakti", + "Report an issue": "Prijavi problem", + "Send us email": "Pošalji nam email", + "Documents": "Dokumenti", + "Features": "Značajke", + "YAML Metadata": "YAML Metadata", + "Slide Example": "Primjer slajda", + "Cheatsheet": "Cheatsheet", + "Example": "Primjer", + "Syntax": "Sintaksa", + "Header": "Zaglavlje", + "Unordered List": "Neuređeni popis", + "Ordered List": "Uređeni popis", + "Todo List": "Popis obaveza", + "Blockquote": "Blockquote", + "Bold font": "Bold font", + "Italics font": "Kurzivan font", + "Strikethrough": "Precrtano", + "Inserted text": "Umetnuti tekst", + "Marked text": "Označeni tekst", + "Link": "Link", + "Image": "Slika", + "Code": "Kod", + "Externals": "Vanjski izgled", + "This is a alert area.": "Ovo je područje upozorenja.", + "Revert": "Vrati", + "Import from clipboard": "Uvezi iz međuspremnika", + "Paste your markdown or webpage here...": "Zalijepi svoj markdown ili web stranicu ovdje...", + "Clear": "Očisti", + "This note is locked": "Ova bilješka je zaključana", + "Sorry, only owner can edit this note.": "Žao nam je, samo vlasnik ove bilješke ju može uređivati.", + "OK": "OK", + "Reach the limit": "Dosegni granicu", + "Sorry, you've reached the max length this note can be.": "Žao nam je, dosegli ste maksimalnu moguću duljinu ove bilješke.", + "Please reduce the content or divide it to more notes, thank you!": "Molimo Vas smanjite sardžaj ili ga podijelite na više bilješki, hvala!", + "Import from Gist": "Uvezi iz Gist-a", + "Paste your gist url here...": "Zalijepi svoj gist url ovdje...", + "Import from Snippet": "Uvezi iz isječka", + "Select From Available Projects": "Odaberi iz raspoloživih projekta", + "Select From Available Snippets": "Odaberi iz raspoloživih isječaka", + "OR": "ILI", + "Export to Snippet": "Izvoz u isječak", + "Select Visibility Level": "Odaberi razinu vidljivosti" +} \ No newline at end of file diff --git a/locales/pl.json b/locales/pl.json new file mode 100644 index 00000000..e5734508 --- /dev/null +++ b/locales/pl.json @@ -0,0 +1,104 @@ +{ + "Collaborative markdown notes": "Wspólne markdown notatki", + "Realtime collaborative markdown notes on all platforms.": "Rzeczywiste wspólne markdown notatki dla wszystkich platform", + "Best way to write and share your knowledge in markdown.": "Najlepszy sposób na pisanie i dzielenie się swoją wiedzą w markdown.", + "Intro": "Intro", + "History": "Historia", + "New guest note": "Nowa notatka gościa", + "Collaborate with URL": "Wspólnie z URL", + "Support charts and MathJax": "Support charts and MathJax", + "Support slide mode": "Support slide mode", + "Sign In": "Zaloguj się", + "Below is the history from browser": "Historia z przeglądarki poniżej", + "Welcome!": "Witam!", + "New note": "Nowa notatka", + "or": "lub", + "Sign Out": "Wyloguj się", + "Explore all features": "Przeglądaj wszystkie funkcje", + "Select tags...": "Wybierz tagi...", + "Search keyword...": "Znajdź kluczowe słowo...", + "Sort by title": "Sortuj według tytułu", + "Title": "Tytuł", + "Sort by time": "Sortuj według czasu", + "Time": "Czas", + "Export history": "Eksportuj historię", + "Import history": "Importuj historię", + "Clear history": "Wyczyść historię", + "Refresh history": "Odśwież historię", + "No history": "Brak histori", + "Import from browser": "Importuj z przeglądarki", + "Releases": "Wydania", + "Are you sure?": "Jesteś pewny?", + "Cancel": "Anuluj", + "Yes, do it!": "Tak, zrób to!", + "Choose method": "Wybierz metodę", + "Sign in via %s": "Zaloguj się poprzez %s", + "New": "Nowy", + "Publish": "Publikuj", + "Extra": "Ekstra", + "Revision": "Korekta", + "Slide Mode": "Tryb slajdów", + "Export": "Eksport", + "Import": "Import", + "Clipboard": "Schowek", + "Download": "Pobierz", + "Raw HTML": "Raw HTML", + "Edit": "Edytuj", + "View": "Pogląd", + "Both": "Both", + "Help": "Pomoc", + "Upload Image": "Prześlij zdjęcie", + "Menu": "Menu", + "This page need refresh": "Strona wymaga odświeżenia", + "You have an incompatible client version.": "Posiadasz niezgodną wersję kliencką.", + "Refresh to update.": "Odświerz aby zaktualizować.", + "New version available!": "Nowa wersja dostępna!", + "See releases notes here": "Zobacz informacje o wydaniach tutaj", + "Refresh to enjoy new features.": "Odśwież, aby korzystać z nowych funkcji.", + "Your user state has changed.": "Stan twojego użytkownika się zmienił.", + "Refresh to load new user state.": "Odśwież aby załadować nowy stan użytkownika.", + "Refresh": "Odśwież", + "Contacts": "Kontakty", + "Report an issue": "Zgłoś błąd", + "Send us email": "Wyślij nam email", + "Documents": "Dokumenty", + "Features": "Funkcje", + "YAML Metadata": "YAML Meta dane", + "Slide Example": "Przykład slajdu", + "Cheatsheet": "Ściągawka", + "Example": "Przykład", + "Syntax": "Składnia", + "Header": "Nagłówek", + "Unordered List": "Nie posortowana lista", + "Ordered List": "Posortowana lista", + "Todo List": "Todo lista", + "Blockquote": "Cytat blokowy", + "Bold font": "Czcionka pogrubiona", + "Italics font": "Czcionka pochylona", + "Strikethrough": "Przekreślenie", + "Inserted text": "Wstawiony tekst", + "Marked text": "Zaznaczony tekst", + "Link": "Odnośnik", + "Image": "Zdjęcie", + "Code": "Kod", + "Externals": "Zewnętrzne", + "This is a alert area.": "This is a alert area.", + "Revert": "Cofnij", + "Import from clipboard": "Importuj ze schowka", + "Paste your markdown or webpage here...": "Wklej markdown lub stronę tutaj...", + "Clear": "Wyczyść", + "This note is locked": "Notatka jest zablokowana", + "Sorry, only owner can edit this note.": "Tylko właściciel może edytować tą notatkę.", + "OK": "OK", + "Reach the limit": "Osiągnięto limit", + "Sorry, you've reached the max length this note can be.": "Niestety, osiągnięto maksymalną długość notatki.", + "Please reduce the content or divide it to more notes, thank you!": "Proszę zmniejszyć zawartość notatki lub podzielić ją na kilka notatek, dziękuję!", + "Import from Gist": "Importuj z Gist", + "Paste your gist url here...": "Wklej gist url tutaj...", + "Import from Snippet": "Importuj z Snippet", + "Select From Available Projects": "Wybierz z dostępnych projektów", + "Select From Available Snippets": "Wybierz z dostępnych Snippets", + "OR": "LUB", + "Export to Snippet": "Eksportuj do Snippet", + "Select Visibility Level": "Wybierz poziom widoczności" +} diff --git a/locales/uk.json b/locales/uk.json new file mode 100644 index 00000000..0afc8796 --- /dev/null +++ b/locales/uk.json @@ -0,0 +1,104 @@ +{ + "Collaborative markdown notes": "Спільні примітки щодо знижок", + "Realtime collaborative markdown notes on all platforms.": "Спільні примітки щодо знижок в реальному часі на всіх платформах.", + "Best way to write and share your knowledge in markdown.": "Кращий спосіб, щоб записувати і ділитись своїми знаннями щодо знижок в реальному часі.", + "Intro": "Вступ", + "History": "Історія", + "New guest note": "Примітка нового гостя", + "Collaborate with URL": "Спільна робота по URL", + "Support charts and MathJax": "Підтримка графіків і MathJax", + "Support slide mode": "Підтримка режиму слайдера", + "Sign In": "Ввійти", + "Below is the history from browser": "Нижче показана історія браузера", + "Welcome!": "Ласкаво просимо!", + "New note": "Нова примітка", + "or": "або", + "Sign Out": "Вийти", + "Explore all features": "Дослідити всі можливості", + "Select tags...": "Вибрати теги...", + "Search keyword...": "Пошук...", + "Sort by title": "Сортувати по заголовку", + "Title": "Заголовок", + "Sort by time": "Сортувати по часу", + "Time": "Час", + "Export history": "Еспортувати історію", + "Import history": "Імпортувати історію", + "Clear history": "Очистити історію", + "Refresh history": "Оновити історію", + "No history": "Історія відсутня", + "Import from browser": "Імпортувати з браузера", + "Releases": "Релізи", + "Are you sure?": "Ви впевнені?", + "Cancel": "Відмінити", + "Yes, do it!": "Так, зробити це!", + "Choose method": "Вибрати метод", + "Sign in via %s": "Увійти за допомогою %s", + "New": "Нова", + "Publish": "Опублікувати", + "Extra": "Дотатково", + "Revision": "Ревізія", + "Slide Mode": "Режим слайдера", + "Export": "Експорт", + "Import": "Імпорт", + "Clipboard": "Буфер обміну", + "Download": "Завантажити", + "Raw HTML": "Raw HTML", + "Edit": "Редагувати", + "View": "Вигляд", + "Both": "Обоє", + "Help": "Допомога", + "Upload Image": "Завантажити зображення", + "Menu": "Меню", + "This page need refresh": "Цю сторінку необхідно обновити", + "You have an incompatible client version.": "Ви використовуєте несумісну версію клієнта.", + "Refresh to update.": "Оновіть сторінку для оновлення.", + "New version available!": "Нова версія доступна!", + "See releases notes here": "Огляньте деталі оновлень тут", + "Refresh to enjoy new features.": "Оновіть, щоб насолоджуватись новими можливостями.", + "Your user state has changed.": "Ваш акаунт змінено.", + "Refresh to load new user state.": "Оновіть, щоб завантажити зміни акаунта.", + "Refresh": "Оновити", + "Contacts": "Контакти", + "Report an issue": "Повідомити про проблему", + "Send us email": "Відправити нам лист", + "Documents": "Документи", + "Features": "Можливості", + "YAML Metadata": "Метадані YAML", + "Slide Example": "Приклад слайдера", + "Cheatsheet": "Шпаргалка", + "Example": "Приклад", + "Syntax": "Синтаксис", + "Header": "Заголовок", + "Unordered List": "Маркований список", + "Ordered List": "Нумерований список", + "Todo List": "Список завдань", + "Blockquote": "Цитата", + "Bold font": "Жирний шрифт", + "Italics font": "Курсив", + "Strikethrough": "Перекреслений", + "Inserted text": "Підкреслений текст", + "Marked text": "Виділений текст", + "Link": "Посилання", + "Image": "Зображення", + "Code": "Код", + "Externals": "Зовнішнє", + "This is a alert area.": "Це область повідомлення.", + "Revert": "Відмінити", + "Import from clipboard": "Імпорт з буферу обміну", + "Paste your markdown or webpage here...": "Вставте ваш markdown або веб-сторінку тут...", + "Clear": "Очистити", + "This note is locked": "Ця замітка заблокована", + "Sorry, only owner can edit this note.": "Вибачте, лише власник може редагувати цю замітку.", + "OK": "OK", + "Reach the limit": "Досягнено ліміту", + "Sorry, you've reached the max length this note can be.": "Нажаль, ви досягли максимальної довжини замітки.", + "Please reduce the content or divide it to more notes, thank you!": "Будь-ласка, зменшіть розмір вмісту або розділіть його на декілька заміток!", + "Import from Gist": "Імпортувати з Gist", + "Paste your gist url here...": "Вставте посилання на ваш gist тут...", + "Import from Snippet": "Імпортувати фрагмент коду", + "Select From Available Projects": "Виберіть з доступних проектів", + "Select From Available Snippets": "Виберіть з доступних фрагментів коду", + "OR": "АБО", + "Export to Snippet": "Експорт фрагменту коду", + "Select Visibility Level": "Вибрати рівень видимості" +} diff --git a/package.json b/package.json index 68a2e43b..1b2cc8d7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "hackmd", - "version": "0.4.4", + "version": "0.4.5", "description": "Realtime collaborative markdown notes on all platforms.", "main": "app.js", "license": "MIT", @@ -10,26 +10,26 @@ }, "dependencies": { "async": "^2.0.1", - "blueimp-md5": "^2.3.0", + "blueimp-md5": "^2.4.0", "body-parser": "^1.15.2", "bootstrap": "^3.3.7", "chance": "^1.0.4", - "cheerio": "^0.20.0", + "cheerio": "^0.22.0", "compression": "^1.6.2", - "connect-session-sequelize": "^3.1.0", + "connect-session-sequelize": "^3.2.0", "cookie": "0.3.1", "cookie-parser": "1.4.3", "diff-match-patch": "git+https://github.com/hackmdio/diff-match-patch.git", - "ejs": "^2.5.1", + "ejs": "^2.5.2", "emojify.js": "^1.1.0", "express": ">=4.14", - "express-session": "^1.14.0", + "express-session": "^1.14.1", "file-saver": "^1.3.3", "flowchart.js": "^1.6.3", "formidable": "^1.0.17", "gist-embed": "github:yukaii/gist-embed", "handlebars": "^4.0.5", - "helmet": "^2.1.2", + "helmet": "^2.3.0", "highlight.js": "^9.7.0", "i18n": "^0.8.3", "imgur": "git+https://github.com/hackmdio/node-imgur.git", @@ -44,9 +44,10 @@ "jsdom-nogyp": "^0.8.3", "keymaster": "^1.6.2", "list.js": "^1.2.0", + "list.pagination.js": "^0.1.1", "lodash": "^4.16.4", "lz-string": "1.4.4", - "markdown-it": "^7.0.1", + "markdown-it": "^8.0.0", "markdown-it-abbr": "^1.0.4", "markdown-it-container": "^2.0.0", "markdown-it-deflist": "^2.0.1", @@ -59,9 +60,9 @@ "markdown-it-sub": "^1.0.0", "markdown-it-sup": "^1.0.0", "markdown-pdf": "^7.0.0", - "meta-marked": "^0.4.1", + "meta-marked": "^0.4.2", "method-override": "^2.3.6", - "moment": "^2.14.1", + "moment": "^2.15.1", "morgan": "^1.7.0", "mysql": "^2.11.1", "node-uuid": "^1.4.7", @@ -74,19 +75,19 @@ "passport-twitter": "^1.0.4", "passport.socketio": "^3.6.2", "pdfobject": "^2.0.201604172", - "pg": "^6.0.3", + "pg": "^6.1.0", "pg-hstore": "^2.3.2", "prismjs": "^1.5.1", "randomcolor": "^0.4.4", "raphael": "github:dmitrybaranovskiy/raphael", - "request": "^2.74.0", + "request": "^2.75.0", "reveal.js": "3.3.0", - "sequelize": "^3.23.6", + "sequelize": "^3.24.3", "sequelize-cli": "^2.4.0", "shortid": "2.2.6", - "socket.io": "1.4.8", + "socket.io": "1.5.0", "socket.io-client": "^1.4.8", - "sqlite3": "^3.1.4", + "sqlite3": "^3.1.6", "store": "^1.3.20", "string": "^3.3.1", "tedious": "^1.14.0", diff --git a/public/apple-touch-icon.png b/public/apple-touch-icon.png index 2f4e0264..6978e262 100644 Binary files a/public/apple-touch-icon.png and b/public/apple-touch-icon.png differ diff --git a/public/docs/release-notes.md b/public/docs/release-notes.md index 7067bb7e..afe843e5 100755 --- a/public/docs/release-notes.md +++ b/public/docs/release-notes.md @@ -1,6 +1,66 @@ Release Notes === + 0.4.5 `latte` 2016-10-11 01:22 +--- +### Features ++ Add more environment variables for server configuration ++ Add setup script for getting started ++ Add support of deleting note ++ Add support of shortcut keys which can add and remove symbol surround text ++ Add support of shortcut keys for changing mode ++ Add support of i18n (English, Chinese, French, German, Japanese, Spanish, Portuguese, Greek, Italian, Turkish, Russian, Dutch, Croatian, Polish, Ukrainian) ++ Add support of note info API ++ Add support of disqus via yaml-metadata + +### Enhancements +* Optimize png images by using zopflipng +* Update CodeMirror to 5.19.0 and rename jade to pug +* Update to add cache to history and improve its performance +* Update default indent to use spaces instead of tabs +* Improve syntax highlighting performance +* Update to make client handle syncing error better, use delay to avoid wrong document revision +* Update to allow CORS as API on revision actions +* Update to support showing owner on the infobar +* Update to prevent duplicate client push in queue to lower down server loading +* Reduce update view debounce time to make preview refresh quicker +* Update help modal cheatsheet font styles to make it more clear on spaces +* Update to add revision saving policy +* Update to support tiddlywiki and mediawiki syntax highlighting in editor +* Update to support save mode to url and vise versa +* Update edit and publish icon and change toggle icon for UX +* Improve authorship markers update performance +* Update slide mode to show extra info and support url actions +* Change the last change user saving strategy +* Update to support data uri in src attribute of image tag +* Improve index layout and UX with UI adjustments +* Update XSS policy to allow iframe and link with custom protocol +* Update markdown styles to follow github latest layout styles +* Update slide mode, now respect all meta settings and update default styles +* Update to make ToC menu always accessible without scrolling +* Update to make doc only update while filesystem content not match db content + +### Fixes +* Fix README and features document format and grammar issues +* Fix some potential memory leaks bugs +* Fix history storage might not fallback correctly +* Fix to make mathjax expression display in editor correctly (not italic) +* Fix note title might have unstriped html tags +* Fix client reconnect should resend last operation +* Fix a bug when setting both maxAge and expires may cause user can't signin +* Fix text complete extra tags for blockquote and referrals +* Fix bug that when window close will make ajax fail and cause cookies set to wrong state +* Fix markdown render might fall into regex infinite loop +* Fix syntax error caused by element contain special characters +* Fix reference error caused by some scripts loading order +* Fix ToC id naming to avoid possible overlap with user ToC +* Fix header nav bar rwd detect element should use div tag or it might glitch the layout +* Fix textcomplete of extra tags for blockquote not match space character in the between +* Fix text-shadow for text antialiased might cause IE or Edge text cutoff + +### Removes +- Cancel updating history on page unload + 0.4.4 `mocha` 2016-08-02 17:10 --- ### Features diff --git a/public/favicon.png b/public/favicon.png index bfc7ec8c..1600e49c 100644 Binary files a/public/favicon.png and b/public/favicon.png differ diff --git a/public/hackmd-icon-1024.png b/public/hackmd-icon-1024.png index b3e8d2fe..eebdcf78 100644 Binary files a/public/hackmd-icon-1024.png and b/public/hackmd-icon-1024.png differ diff --git a/public/js/common.js.example b/public/js/common.js similarity index 89% rename from public/js/common.js.example rename to public/js/common.js index 1c6a1c9c..19455f3d 100644 --- a/public/js/common.js.example +++ b/public/js/common.js @@ -1,20 +1,18 @@ +var config = require('./config'); +var domain = config.domain; // domain name +var urlpath = config.urlpath; // sub url path, like: www.example.com/ +var debug = config.debug; +var GOOGLE_API_KEY = config.GOOGLE_API_KEY; +var GOOGLE_CLIENT_ID = config.GOOGLE_CLIENT_ID; +var DROPBOX_APP_KEY = config.DROPBOX_APP_KEY; + //common -var domain = ''; // domain name -var urlpath = ''; // sub url path, like: www.example.com/ -//settings -var debug = false; - -var GOOGLE_API_KEY = ''; -var GOOGLE_CLIENT_ID = ''; - -var DROPBOX_APP_KEY = ''; - var port = window.location.port; var serverurl = window.location.protocol + '//' + (domain ? domain : window.location.hostname) + (port ? ':' + port : '') + (urlpath ? '/' + urlpath : ''); var noteid = urlpath ? window.location.pathname.slice(urlpath.length + 1, window.location.pathname.length).split('/')[1] : window.location.pathname.split('/')[1]; var noteurl = serverurl + '/' + noteid; -var version = '0.4.4'; +var version = '0.4.5'; var checkAuth = false; var profile = null; diff --git a/public/js/config.js.example b/public/js/config.js.example new file mode 100644 index 00000000..00c4f498 --- /dev/null +++ b/public/js/config.js.example @@ -0,0 +1,19 @@ +//config +var domain = ''; // domain name +var urlpath = ''; // sub url path, like: www.example.com/ +//settings +var debug = false; + +var GOOGLE_API_KEY = ''; +var GOOGLE_CLIENT_ID = ''; + +var DROPBOX_APP_KEY = ''; + +module.exports = { + domain: domain, + urlpath: urlpath, + debug: debug, + GOOGLE_API_KEY: GOOGLE_API_KEY, + GOOGLE_CLIENT_ID: GOOGLE_CLIENT_ID, + DROPBOX_APP_KEY: DROPBOX_APP_KEY +}; diff --git a/public/js/cover.js b/public/js/cover.js index 6346f144..7156bf27 100644 --- a/public/js/cover.js +++ b/public/js/cover.js @@ -35,7 +35,11 @@ var options = { \ \ \ - ' + ', + page: 18, + plugins: [ + ListPagination({}) + ] }; var historyList = new List('history', options); @@ -183,19 +187,32 @@ function parseHistoryCallback(list, notehistory) { pinned = false; item._values.pinned = false; } - getHistory(function (notehistory) { - for(var i = 0; i < notehistory.length; i++) { - if (notehistory[i].id == id) { - notehistory[i].pinned = pinned; - break; - } - } - saveHistory(notehistory); - if (pinned) - $this.addClass('active'); - else - $this.removeClass('active'); - }); + checkIfAuth(function () { + postHistoryToServer(id, { + pinned: pinned + }, function (err, result) { + if (!err) { + if (pinned) + $this.addClass('active'); + else + $this.removeClass('active'); + } + }); + }, function () { + getHistory(function (notehistory) { + for(var i = 0; i < notehistory.length; i++) { + if (notehistory[i].id == id) { + notehistory[i].pinned = pinned; + break; + } + } + saveHistory(notehistory); + if (pinned) + $this.addClass('active'); + else + $this.removeClass('active'); + }); + }) }); buildTagsFilter(filtertags); } @@ -216,23 +233,40 @@ var clearHistory = false; var deleteId = null; function deleteHistory() { - if (clearHistory) { - saveHistory([]); - historyList.clear(); - checkHistoryList(); - deleteId = null; - } else { - if (!deleteId) return; - getHistory(function (notehistory) { - var newnotehistory = removeHistory(deleteId, notehistory); - saveHistory(newnotehistory); - historyList.remove('id', deleteId); + checkIfAuth(function () { + deleteServerHistory(deleteId, function (err, result) { + if (!err) { + if (clearHistory) { + historyList.clear(); + checkHistoryList(); + } else { + historyList.remove('id', deleteId); + checkHistoryList(); + } + } + $('.delete-modal').modal('hide'); + deleteId = null; + clearHistory = false; + }); + }, function () { + if (clearHistory) { + saveHistory([]); + historyList.clear(); checkHistoryList(); deleteId = null; - }); - } - $('.delete-modal').modal('hide'); - clearHistory = false; + } else { + if (!deleteId) return; + getHistory(function (notehistory) { + var newnotehistory = removeHistory(deleteId, notehistory); + saveHistory(newnotehistory); + historyList.remove('id', deleteId); + checkHistoryList(); + deleteId = null; + }); + } + $('.delete-modal').modal('hide'); + clearHistory = false; + }); } $(".ui-delete-modal-confirm").click(function () { diff --git a/public/js/extra.js b/public/js/extra.js index 4c4e66d6..25f0b3b1 100644 --- a/public/js/extra.js +++ b/public/js/extra.js @@ -12,6 +12,7 @@ var lastchangeui = { user: $(".ui-lastchangeuser"), nouser: $(".ui-no-lastchangeuser") } +var ownerui = $(".ui-owner"); function updateLastChange() { if (!lastchangeui) return; @@ -46,6 +47,23 @@ function updateLastChangeUser() { } } +var owner = null; +var ownerprofile = null; +function updateOwner() { + if (ownerui) { + if (owner && ownerprofile && owner !== lastchangeuser) { + var icon = ownerui.children('i'); + icon.attr('title', ownerprofile.name).tooltip('fixTitle'); + var styleString = 'background-image:url(' + ownerprofile.photo + ')'; + if (ownerprofile.photo && icon.attr('style') !== styleString) + icon.attr('style', styleString); + ownerui.show(); + } else { + ownerui.hide(); + } + } +} + //get title function getTitle(view) { var title = ""; @@ -426,6 +444,33 @@ function finishView(view) { height: '400px' }); }); + //syntax highlighting + view.find("pre.raw").removeClass("raw") + .each(function (key, value) { + var langDiv = $(value).find('code.hljs'); + if (langDiv.length > 0) { + var reallang = langDiv[0].className.replace('hljs', '').trim(); + var codeDiv = $(value).find('.code'); + var code = ""; + if (codeDiv.length > 0) code = codeDiv.html(); + else code = langDiv.html(); + code = md.utils.unescapeAll(code); + if (reallang == "tiddlywiki" || reallang == "mediawiki") { + var result = { + value: Prism.highlight(code, Prism.languages.wiki) + }; + } else { + var languages = hljs.listLanguages(); + if (languages.indexOf(reallang) == -1) { + var result = hljs.highlightAuto(code); + } else { + var result = hljs.highlight(reallang, code); + } + } + if (codeDiv.length > 0) codeDiv.html(result.value); + else langDiv.html(result.value); + } + }); //render title document.title = renderTitle(view); } @@ -766,19 +811,9 @@ function highlightRender(code, lang) { } else if (lang == 'mermaid') { return '
' + code + '
'; } - var reallang = lang.replace(/\=$|\=\d+$|\=\+$/, ''); - if (reallang == "tiddlywiki" || reallang == "mediawiki") { - var result = { - value: Prism.highlight(code, Prism.languages.wiki) - }; - } else { - var languages = hljs.listLanguages(); - if (languages.indexOf(reallang) == -1) { - var result = hljs.highlightAuto(code); - } else { - var result = hljs.highlight(reallang, code); - } - } + var result = { + value: code + }; var showlinenumbers = /\=$|\=\d+$|\=\+$/.test(lang); if (showlinenumbers) { var startnumber = 1; @@ -878,7 +913,7 @@ md.renderer.rules.fence = function (tokens, idx, options, env, self) { return highlighted + '\n'; } - return '
'
+    return  '
'
         + highlighted
         + '
\n'; }; @@ -1050,5 +1085,6 @@ module.exports = { renderFilename: renderFilename, generateToc: generateToc, smoothHashScroll: smoothHashScroll, - scrollToHash: scrollToHash + scrollToHash: scrollToHash, + owner: owner }; diff --git a/public/js/history.js b/public/js/history.js index 192a40b3..91f3cccf 100644 --- a/public/js/history.js +++ b/public/js/history.js @@ -58,7 +58,7 @@ function saveHistoryToStorage(notehistory) { if (store.enabled) store.set('notehistory', JSON.stringify(notehistory)); else - saveHistoryToStorage(notehistory); + saveHistoryToCookie(notehistory); } function saveHistoryToCookie(notehistory) { @@ -107,8 +107,8 @@ function clearDuplicatedHistory(notehistory) { var id = notehistory[i].id.replace(/\=+$/, ''); var newId = newnotehistory[j].id.replace(/\=+$/, ''); if (id == newId || notehistory[i].id == newnotehistory[j].id || !notehistory[i].id || !newnotehistory[j].id) { - var time = moment(notehistory[i].time, 'MMMM Do YYYY, h:mm:ss a'); - var newTime = moment(newnotehistory[j].time, 'MMMM Do YYYY, h:mm:ss a'); + var time = (typeof notehistory[i].time === 'number' ? moment(notehistory[i].time) : moment(notehistory[i].time, 'MMMM Do YYYY, h:mm:ss a')); + var newTime = (typeof newnotehistory[i].time === 'number' ? moment(newnotehistory[i].time) : moment(newnotehistory[i].time, 'MMMM Do YYYY, h:mm:ss a')); if(time >= newTime) { newnotehistory[j] = notehistory[i]; } @@ -150,7 +150,8 @@ function removeHistory(id, notehistory) { function writeHistory(view) { checkIfAuth( function () { - writeHistoryToServer(view); + // no need to do this anymore, this will count from server-side + // writeHistoryToServer(view); }, function () { writeHistoryToStorage(view); @@ -176,8 +177,8 @@ function writeHistoryToServer(view) { var newnotehistory = generateHistory(view, notehistory); saveHistoryToServer(newnotehistory); }) - .fail(function () { - writeHistoryToStorage(view); + .fail(function (xhr, status, error) { + console.error(xhr.responseText); }); } @@ -257,7 +258,7 @@ function renderHistory(view) { return { id: id, text: title, - time: moment().format('MMMM Do YYYY, h:mm:ss a'), + time: moment().valueOf(), tags: tags }; } @@ -297,8 +298,8 @@ function getServerHistory(callback) { callback(data.history); } }) - .fail(function () { - getStorageHistory(callback); + .fail(function (xhr, status, error) { + console.error(xhr.responseText); }); } @@ -338,8 +339,8 @@ function parseServerToHistory(list, callback) { parseToHistory(list, data.history, callback); } }) - .fail(function () { - parseStorageToHistory(list, callback); + .fail(function (xhr, status, error) { + console.error(xhr.responseText); }); } @@ -368,9 +369,10 @@ function parseToHistory(list, notehistory, callback) { else if (notehistory && notehistory.length > 0) { for (var i = 0; i < notehistory.length; i++) { //parse time to timestamp and fromNow - notehistory[i].timestamp = moment(notehistory[i].time, 'MMMM Do YYYY, h:mm:ss a').valueOf(); - notehistory[i].fromNow = moment(notehistory[i].time, 'MMMM Do YYYY, h:mm:ss a').fromNow(); - notehistory[i].time = moment(notehistory[i].time, 'MMMM Do YYYY, h:mm:ss a').format('llll'); + var timestamp = (typeof notehistory[i].time === 'number' ? moment(notehistory[i].time) : moment(notehistory[i].time, 'MMMM Do YYYY, h:mm:ss a')); + notehistory[i].timestamp = timestamp.valueOf(); + notehistory[i].fromNow = timestamp.fromNow(); + notehistory[i].time = timestamp.format('llll'); if (notehistory[i].id && list.get('id', notehistory[i].id).length == 0) list.add(notehistory[i]); } @@ -378,6 +380,31 @@ function parseToHistory(list, notehistory, callback) { callback(list, notehistory); } +function postHistoryToServer(noteId, data, callback) { + $.post(serverurl + '/history/' + noteId, data) + .done(function (result) { + return callback(null, result); + }) + .fail(function (xhr, status, error) { + console.error(xhr.responseText); + return callback(error, null); + }); +} + +function deleteServerHistory(noteId, callback) { + $.ajax({ + url: serverurl + '/history' + (noteId ? '/' + noteId : ""), + type: 'DELETE' + }) + .done(function (result) { + return callback(null, result); + }) + .fail(function (xhr, status, error) { + console.error(xhr.responseText); + return callback(error, null); + }); +} + module.exports = { writeHistory: writeHistory, parseHistory: parseHistory, @@ -385,5 +412,7 @@ module.exports = { getHistory: getHistory, saveHistory: saveHistory, removeHistory: removeHistory, - parseStorageToHistory: parseStorageToHistory + parseStorageToHistory: parseStorageToHistory, + postHistoryToServer: postHistoryToServer, + deleteServerHistory: deleteServerHistory } diff --git a/public/js/index.js b/public/js/index.js index ae823c42..67499f86 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -62,6 +62,7 @@ var renderTOC = extra.renderTOC; var renderTitle = extra.renderTitle; var renderFilename = extra.renderFilename; var scrollToHash = extra.scrollToHash; +var owner = extra.owner; var historyModule = require('./history'); var writeHistory = historyModule.writeHistory; @@ -72,6 +73,7 @@ var preventXSS = renderer.preventXSS; var defaultTextHeight = 20; var viewportMargin = 20; var mac = CodeMirror.keyMap["default"] == CodeMirror.keyMap.macDefault; +var defaultEditorMode = 'gfm'; var defaultExtraKeys = { "F10": function (cm) { cm.setOption("fullScreen", !cm.getOption("fullScreen")); @@ -214,7 +216,7 @@ var cursorMenuThrottle = 50; var cursorActivityDebounce = 50; var cursorAnimatePeriod = 100; var supportContainers = ['success', 'info', 'warning', 'danger']; -var supportCodeModes = ['javascript', 'htmlmixed', 'htmlembedded', 'css', 'xml', 'clike', 'clojure', 'ruby', 'python', 'shell', 'php', 'sql', 'coffeescript', 'yaml', 'jade', 'lua', 'cmake', 'nginx', 'perl', 'sass', 'r', 'dockerfile', 'tiddlywiki', 'mediawiki']; +var supportCodeModes = ['javascript', 'htmlmixed', 'htmlembedded', 'css', 'xml', 'clike', 'clojure', 'ruby', 'python', 'shell', 'php', 'sql', 'coffeescript', 'yaml', 'pug', 'lua', 'cmake', 'nginx', 'perl', 'sass', 'r', 'dockerfile', 'tiddlywiki', 'mediawiki']; var supportCharts = ['sequence', 'flow', 'graphviz', 'mermaid']; var supportHeaders = [ { @@ -430,8 +432,8 @@ window.fileTypes = { var textit = document.getElementById("textit"); if (!textit) throw new Error("There was no textit area!"); window.editor = CodeMirror.fromTextArea(textit, { - mode: 'gfm', - backdrop: 'gfm', + mode: defaultEditorMode, + backdrop: defaultEditorMode, keyMap: "sublime", viewportMargin: viewportMargin, styleActiveLine: true, @@ -440,7 +442,6 @@ window.editor = CodeMirror.fromTextArea(textit, { showCursorWhenSelecting: true, highlightSelectionMatches: true, indentUnit: 4, - indentWithTabs: true, continueComments: "Enter", theme: "one-dark", inputStyle: "textarea", @@ -675,7 +676,7 @@ function setSpellcheck() { if (cookieSpellcheck === 'true' || cookieSpellcheck === true) { mode = 'spell-checker'; } else { - mode = 'gfm'; + mode = defaultEditorMode; } if (mode && mode !== editor.getOption('mode')) { editor.setOption('mode', mode); @@ -685,10 +686,10 @@ function setSpellcheck() { var spellcheckToggle = statusSpellcheck.find('.ui-spellcheck-toggle'); spellcheckToggle.click(function () { var mode = editor.getOption('mode'); - if (mode == "gfm") { + if (mode == defaultEditorMode) { mode = "spell-checker"; } else { - mode = "gfm"; + mode = defaultEditorMode; } if (mode && mode !== editor.getOption('mode')) { editor.setOption('mode', mode); @@ -700,7 +701,7 @@ function setSpellcheck() { }); function checkSpellcheck() { var mode = editor.getOption('mode'); - if (mode == "gfm") { + if (mode == defaultEditorMode) { spellcheckToggle.removeClass('active'); } else { spellcheckToggle.addClass('active'); @@ -748,7 +749,18 @@ function updateStatusBar() { statusCursor.text(cursorText); var fileText = ' — ' + editor.lineCount() + ' Lines'; statusFile.text(fileText); - statusLength.text('Length ' + editor.getValue().length); + var docLength = editor.getValue().length; + statusLength.text('Length ' + docLength); + if (docLength > (docmaxlength * 0.95)) { + statusLength.css('color', 'red'); + statusLength.attr('title', 'Your almost reach note max length limit.'); + } else if (docLength > (docmaxlength * 0.8)) { + statusLength.css('color', 'orange'); + statusLength.attr('title', 'You nearly fill the note, consider to make more pieces.'); + } else { + statusLength.css('color', 'white'); + statusLength.attr('title', 'You could write up to ' + docmaxlength + ' characters in this note.'); + } } //ui vars @@ -800,7 +812,8 @@ var ui = { editable: $(".ui-permission-editable"), locked: $(".ui-permission-locked"), private: $(".ui-permission-private") - } + }, + delete: $(".ui-delete-note") }, toc: { toc: $('.ui-toc'), @@ -989,7 +1002,7 @@ $(window).resize(function () { }); //when page unload $(window).on('unload', function () { - updateHistoryInner(); + //updateHistoryInner(); }); $(window).on('error', function () { //setNeedRefresh(); @@ -1817,7 +1830,7 @@ function initRevisionViewer() { if (revisionViewer) return; var revisionViewerTextArea = document.getElementById("revisionViewer"); revisionViewer = CodeMirror.fromTextArea(revisionViewerTextArea, { - mode: 'gfm', + mode: defaultEditorMode, viewportMargin: viewportMargin, lineNumbers: true, lineWrapping: true, @@ -2175,6 +2188,13 @@ ui.infobar.permission.locked.click(function () { ui.infobar.permission.private.click(function () { emitPermission("private"); }); +// delete note +ui.infobar.delete.click(function () { + $('.delete-modal').modal('show'); +}); +$('.ui-delete-modal-confirm').click(function () { + socket.emit('delete'); +}); function emitPermission(_permission) { if (_permission != permission) { @@ -2263,24 +2283,30 @@ socket.on('info', function (data) { console.error(data); switch (data.code) { case 403: - location.href = "./403"; + location.href = serverurl + "/403"; break; case 404: - location.href = "./404"; + location.href = serverurl + "/404"; break; case 500: - location.href = "./500"; + location.href = serverurl + "/500"; break; } }); socket.on('error', function (data) { console.error(data); if (data.message && data.message.indexOf('AUTH failed') === 0) - location.href = "./403"; + location.href = serverurl + "/403"; +}); +socket.on('delete', function () { + deleteServerHistory(noteid, function (err, data) { + if (!err) location.href = serverurl; + }); }); var retryOnDisconnect = false; var retryTimer = null; socket.on('maintenance', function () { + cmClient.revision = -1; retryOnDisconnect = true; }); socket.on('disconnect', function (data) { @@ -2310,8 +2336,6 @@ socket.on('connect', function (data) { personalInfo['id'] = socket.id; showStatus(statusType.connected); socket.emit('version'); - if (socket.id.indexOf('/') == -1) - socket.id = socket.nsp + '#' + socket.id; }); socket.on('version', function (data) { if (version != data.version) { @@ -2328,7 +2352,7 @@ var authorship = []; var authorshipMarks = {}; var authorMarks = {}; // temp variable var addTextMarkers = []; // temp variable -function updateLastInfo(data) { +function updateInfo(data) { //console.log(data); if (data.hasOwnProperty('createtime') && createtime !== data.createtime) { createtime = data.createtime; @@ -2338,10 +2362,16 @@ function updateLastInfo(data) { lastchangetime = data.updatetime; updateLastChange(); } + if (data.hasOwnProperty('owner') && owner !== data.owner) { + owner = data.owner; + ownerprofile = data.ownerprofile; + updateOwner(); + } if (data.hasOwnProperty('lastchangeuser') && lastchangeuser !== data.lastchangeuser) { lastchangeuser = data.lastchangeuser; lastchangeuserprofile = data.lastchangeuserprofile; updateLastChangeUser(); + updateOwner(); } if (data.hasOwnProperty('authors') && authors !== data.authors) { authors = data.authors; @@ -2391,7 +2421,7 @@ var addStyleRule = (function () { }()); function updateAuthorshipInner() { // ignore when ot not synced yet - if (Object.keys(cmClient.state).length > 0) return; + if (cmClient && Object.keys(cmClient.state).length > 0) return; authorMarks = {}; for (var i = 0; i < authorship.length; i++) { var atom = authorship[i]; @@ -2556,14 +2586,12 @@ socket.on('check', function (data) { data = LZString.decompressFromUTF16(data); data = JSON.parse(data); //console.log(data); - updateLastInfo(data); + updateInfo(data); }); socket.on('permission', function (data) { updatePermission(data.permission); }); var docmaxlength = null; -var otk = null; -var owner = null; var permission = null; socket.on('refresh', function (data) { data = LZString.decompressFromUTF16(data); @@ -2571,10 +2599,8 @@ socket.on('refresh', function (data) { //console.log(data); docmaxlength = data.docmaxlength; editor.setOption("maxLength", docmaxlength); - otk = data.otk; - owner = data.owner; + updateInfo(data); updatePermission(data.permission); - updateLastInfo(data); if (!loaded) { // auto change mode if no content detected var nocontent = editor.getValue().length <= 0; @@ -2617,16 +2643,14 @@ socket.on('doc', function (obj) { obj = LZString.decompressFromUTF16(obj); obj = JSON.parse(obj); var body = obj.str; - var bodyMismatch = (editor.getValue() != body); + var bodyMismatch = editor.getValue() !== body; + var setDoc = !cmClient || (cmClient && cmClient.revision === -1) || obj.force; saveInfo(); - if (bodyMismatch) { - if (cmClient) - cmClient.editorAdapter.ignoreNextChange = true; - if (body) - editor.setValue(body); - else - editor.setValue(""); + if (setDoc && bodyMismatch) { + if (cmClient) cmClient.editorAdapter.ignoreNextChange = true; + if (body) editor.setValue(body); + else editor.setValue(""); } if (!loaded) { @@ -2635,12 +2659,8 @@ socket.on('doc', function (obj) { ui.content.fadeIn(); } else { //if current doc is equal to the doc before disconnect - if (bodyMismatch) - editor.clearHistory(); - else { - if (lastInfo.history) - editor.setHistory(lastInfo.history); - } + if (setDoc && bodyMismatch) editor.clearHistory(); + else if (lastInfo.history) editor.setHistory(lastInfo.history); lastInfo.history = null; } @@ -2649,7 +2669,7 @@ socket.on('doc', function (obj) { obj.revision, obj.clients, new SocketIOAdapter(socket), new CodeMirrorAdapter(editor) ); - } else { + } else if (setDoc) { if (bodyMismatch) { cmClient.undoManager.undoStack.length = 0; cmClient.undoManager.redoStack.length = 0; @@ -2660,7 +2680,7 @@ socket.on('doc', function (obj) { cmClient.initializeClients(obj.clients); } - if (bodyMismatch) { + if (setDoc && bodyMismatch) { isDirty = true; updateView(); } diff --git a/public/js/syncscroll.js b/public/js/syncscroll.js index 644022de..511c5000 100644 --- a/public/js/syncscroll.js +++ b/public/js/syncscroll.js @@ -78,7 +78,7 @@ md.renderer.rules.fence = function (tokens, idx, options, env, self) { if (tokens[idx].map && tokens[idx].level === 0) { var startline = tokens[idx].map[0] + 1; var endline = tokens[idx].map[1]; - return '
'
+        return '
'
         + highlighted
         + '
\n'; } diff --git a/public/js/unused.js b/public/js/unused.js deleted file mode 100644 index 4ff5b280..00000000 --- a/public/js/unused.js +++ /dev/null @@ -1,45 +0,0 @@ - - //parse Youtube - result.find(".youtube").each(function (key, value) { - if (!$(value).attr('videoid')) return; - setSizebyAttr(this, this); - var icon = ''; - $(this).append(icon); - var videoid = $(value).attr('videoid'); - var thumbnail_src = '//img.youtube.com/vi/' + videoid + '/hqdefault.jpg'; - $(value).css('background-image', 'url(' + thumbnail_src + ')'); - $(this).click(function () { - imgPlayiframe(this, '//www.youtube.com/embed/'); - }); - }); - //parse vimeo - result.find(".vimeo").each(function (key, value) { - if (!$(value).attr('videoid')) return; - setSizebyAttr(this, this); - var icon = ''; - $(this).append(icon); - var videoid = $(value).attr('videoid'); - $.ajax({ - type: 'GET', - url: 'http://vimeo.com/api/v2/video/' + videoid + '.json', - jsonp: 'callback', - dataType: 'jsonp', - success: function (data) { - var thumbnail_src = data[0].thumbnail_large; - $(value).css('background-image', 'url(' + thumbnail_src + ')'); - } - }); - $(this).click(function () { - imgPlayiframe(this, '//player.vimeo.com/video/'); - }); - }); - //todo list - var lis = result[0].getElementsByTagName('li'); - for (var i = 0; i < lis.length; i++) { - var html = lis[i].innerHTML; - if (/^\s*\[[x ]\]\s*/.test(html)) { - lis[i].innerHTML = html.replace(/^\s*\[ \]\s*/, '') - .replace(/^\s*\[x\]\s*/, ''); - lis[i].setAttribute('class', 'task-list-item'); - } - } \ No newline at end of file diff --git a/public/vendor/codemirror/addon/comment/comment.js b/public/vendor/codemirror/addon/comment/comment.js index 2c4f975d..d71cf436 100644 --- a/public/vendor/codemirror/addon/comment/comment.js +++ b/public/vendor/codemirror/addon/comment/comment.js @@ -103,6 +103,7 @@ self.lineComment(from, to, options); return; } + if (/\bcomment\b/.test(self.getTokenTypeAt(Pos(from.line, 0)))) return var end = Math.min(to.line, self.lastLine()); if (end != from.line && to.ch == 0 && nonWS.test(self.getLine(end))) --end; @@ -140,7 +141,7 @@ var line = self.getLine(i); var found = line.indexOf(lineString); if (found > -1 && !/comment/.test(self.getTokenTypeAt(Pos(i, found + 1)))) found = -1; - if (found == -1 && (i != end || i == start) && nonWS.test(line)) break lineComment; + if (found == -1 && nonWS.test(line)) break lineComment; if (found > -1 && nonWS.test(line.slice(0, found))) break lineComment; lines.push(line); } @@ -162,13 +163,15 @@ var endString = options.blockCommentEnd || mode.blockCommentEnd; if (!startString || !endString) return false; var lead = options.blockCommentLead || mode.blockCommentLead; - var startLine = self.getLine(start), endLine = end == start ? startLine : self.getLine(end); - var open = startLine.indexOf(startString), close = endLine.lastIndexOf(endString); + var startLine = self.getLine(start), open = startLine.indexOf(startString) + if (open == -1) return false + var endLine = end == start ? startLine : self.getLine(end) + var close = endLine.indexOf(endString, end == start ? open + startString.length : 0); if (close == -1 && start != end) { endLine = self.getLine(--end); - close = endLine.lastIndexOf(endString); + close = endLine.indexOf(endString); } - if (open == -1 || close == -1 || + if (close == -1 || !/comment/.test(self.getTokenTypeAt(Pos(start, open + 1))) || !/comment/.test(self.getTokenTypeAt(Pos(end, close + 1)))) return false; diff --git a/public/vendor/codemirror/addon/fold/xml-fold.js b/public/vendor/codemirror/addon/fold/xml-fold.js index f8c67b89..75a9e305 100644 --- a/public/vendor/codemirror/addon/fold/xml-fold.js +++ b/public/vendor/codemirror/addon/fold/xml-fold.js @@ -21,8 +21,8 @@ function Iter(cm, line, ch, range) { this.line = line; this.ch = ch; this.cm = cm; this.text = cm.getLine(line); - this.min = range ? range.from : cm.firstLine(); - this.max = range ? range.to - 1 : cm.lastLine(); + this.min = range ? Math.max(range.from, cm.firstLine()) : cm.firstLine(); + this.max = range ? Math.min(range.to - 1, cm.lastLine()) : cm.lastLine(); } function tagAt(iter, ch) { diff --git a/public/vendor/codemirror/addon/hint/javascript-hint.js b/public/vendor/codemirror/addon/hint/javascript-hint.js index 7bcbf4a0..d7088c19 100644 --- a/public/vendor/codemirror/addon/hint/javascript-hint.js +++ b/public/vendor/codemirror/addon/hint/javascript-hint.js @@ -97,6 +97,15 @@ var coffeescriptKeywords = ("and break catch class continue delete do else extends false finally for " + "if in instanceof isnt new no not null of off on or return switch then throw true try typeof until void while with yes").split(" "); + function forAllProps(obj, callback) { + if (!Object.getOwnPropertyNames || !Object.getPrototypeOf) { + for (var name in obj) callback(name) + } else { + for (var o = obj; o; o = Object.getPrototypeOf(o)) + Object.getOwnPropertyNames(o).forEach(callback) + } + } + function getCompletions(token, context, keywords, options) { var found = [], start = token.string, global = options && options.globalScope || window; function maybeAdd(str) { @@ -106,7 +115,7 @@ if (typeof obj == "string") forEach(stringProps, maybeAdd); else if (obj instanceof Array) forEach(arrayProps, maybeAdd); else if (obj instanceof Function) forEach(funcProps, maybeAdd); - for (var name in obj) maybeAdd(name); + forAllProps(obj, maybeAdd) } if (context && context.length) { diff --git a/public/vendor/codemirror/addon/search/match-highlighter.js b/public/vendor/codemirror/addon/search/match-highlighter.js index 2121de41..73ba0e05 100644 --- a/public/vendor/codemirror/addon/search/match-highlighter.js +++ b/public/vendor/codemirror/addon/search/match-highlighter.js @@ -45,6 +45,7 @@ this.options[name] = (options && options.hasOwnProperty(name) ? options : defaults)[name] this.overlay = this.timeout = null; this.matchesonscroll = null; + this.active = false; } CodeMirror.defineOption("highlightSelectionMatches", false, function(cm, val, old) { @@ -53,16 +54,34 @@ clearTimeout(cm.state.matchHighlighter.timeout); cm.state.matchHighlighter = null; cm.off("cursorActivity", cursorActivity); + cm.off("focus", onFocus) } if (val) { - cm.state.matchHighlighter = new State(val); - highlightMatches(cm); + var state = cm.state.matchHighlighter = new State(val); + if (cm.hasFocus()) { + state.active = true + highlightMatches(cm) + } else { + cm.on("focus", onFocus) + } cm.on("cursorActivity", cursorActivity); } }); function cursorActivity(cm) { var state = cm.state.matchHighlighter; + if (state.active || cm.hasFocus()) scheduleHighlight(cm, state) + } + + function onFocus(cm) { + var state = cm.state.matchHighlighter + if (!state.active) { + state.active = true + scheduleHighlight(cm, state) + } + } + + function scheduleHighlight(cm, state) { clearTimeout(state.timeout); state.timeout = setTimeout(function() {highlightMatches(cm);}, state.options.delay); } diff --git a/public/vendor/codemirror/addon/search/search.js b/public/vendor/codemirror/addon/search/search.js index c005866f..753b1afe 100644 --- a/public/vendor/codemirror/addon/search/search.js +++ b/public/vendor/codemirror/addon/search/search.js @@ -136,8 +136,11 @@ }) }; persistentDialog(cm, queryDialog, q, searchNext, function(event, query) { - var cmd = CodeMirror.keyMap[cm.getOption("keyMap")][CodeMirror.keyName(event)]; - if (cmd == "findNext" || cmd == "findPrev") { + var keyName = CodeMirror.keyName(event) + var cmd = CodeMirror.keyMap[cm.getOption("keyMap")][keyName] + if (!cmd) cmd = cm.getOption('extraKeys')[keyName] + if (cmd == "findNext" || cmd == "findPrev" || + cmd == "findPersistentNext" || cmd == "findPersistentPrev") { CodeMirror.e_stop(event); startSearch(cm, getSearchState(cm), query); cm.execCommand(cmd); @@ -146,7 +149,7 @@ searchNext(query, event); } }); - if (immediate) { + if (immediate && q) { startSearch(cm, state, q); findNext(cm, rev); } diff --git a/public/vendor/codemirror/codemirror.min.js b/public/vendor/codemirror/codemirror.min.js index e4bf1f6e..7df6320f 100644 --- a/public/vendor/codemirror/codemirror.min.js +++ b/public/vendor/codemirror/codemirror.min.js @@ -1,16 +1,17 @@ -!function(e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else{if("function"==typeof define&&define.amd)return define([],e);(this||window).CodeMirror=e()}}(function(){"use strict";function e(n,r){if(!(this instanceof e))return new e(n,r);this.options=r=r?Di(r):{},Di(na,r,!1),p(r);var i=r.value;"string"==typeof i&&(i=new Ma(i,r.mode,null,r.lineSeparator)),this.doc=i;var o=new e.inputStyles[r.inputStyle](this),a=this.display=new t(n,i,o);a.wrapper.CodeMirror=this,c(this),s(this),r.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),r.autofocus&&!zo&&a.input.focus(),v(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new Oi,keySeq:null,specialChars:null};var l=this;xo&&wo<11&&setTimeout(function(){l.display.input.reset(!0)},20),$t(this),Yi(),wt(this),this.curOp.forceUpdate=!0,Qr(this,i),r.autofocus&&!zo||l.hasFocus()?setTimeout(Wi(bn,this),20):kn(this);for(var u in ra)ra.hasOwnProperty(u)&&ra[u](this,r[u],ia);w(this),r.finishInit&&r.finishInit(this);for(var f=0;ft.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}function p(e){var t=qi(e.gutters,"CodeMirror-linenumbers");t==-1&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function h(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Ue(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Ve(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function m(e,t,n){this.cm=n;var r=this.vert=$i("div",[$i("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=$i("div",[$i("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(r),e(i),Oa(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Oa(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,xo&&wo<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function g(){}function v(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&Ja(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new e.scrollbarModel[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),Oa(e,"mousedown",function(){t.state.focused&&setTimeout(function(){t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,n){"horizontal"==n?sn(t,e):an(t,e)},t),t.display.scrollbars.addClass&&es(t.display.wrapper,t.display.scrollbars.addClass)}function y(e,t){t||(t=h(e));var n=e.display.barWidth,r=e.display.barHeight;b(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&z(e),b(e,h(e)),n=e.display.barWidth,r=e.display.barHeight}function b(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}function k(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-$e(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=ii(t,r),a=ii(t,i);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;s=a&&(o=ii(t,oi(Jr(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function x(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=C(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Ht(e))return!1;w(e)&&(Dt(e),t.dims=I(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Do&&(o=wr(e.doc,o),a=_r(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Ft(e,o,a),n.viewOffset=oi(Jr(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var l=Ht(e);if(!s&&0==l&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=Vi();return l>4&&(n.lineDiv.style.display="none"),N(e,n.updateLineNumbers,t.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,c&&Vi()!=c&&c.offsetHeight&&c.focus(),Ui(n.cursorDiv),Ui(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,We(e,400)),n.updateLineNumbers=null,!0}function T(e,t){for(var n=t.viewport,r=!0;(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Ge(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Ue(e.display)-Xe(e),n.top)}),t.visible=k(e.display,e.doc,n),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&L(e,t);r=!1){z(e);var i=h(e);qe(e),y(e,i),E(e,i)}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function A(e,t){var n=new S(e,t);if(L(e,n)){z(e),T(e,n);var r=h(e);qe(e),y(e,r),E(e,r),n.finish()}}function E(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Ve(e)+"px"}function z(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r.001||l<-.001)&&(ni(o.line,i),O(o.line),o.rest))for(var c=0;c-1&&(d=!1),q(e,f,c,n)),d&&(Ui(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(_(e.options,c)))),s=f.node.nextSibling}else{var p=H(e,f,c,n);a.insertBefore(p,s)}c+=f.size}for(;s;)s=r(s)}function q(e,t,n,r){for(var i=0;i1)if(Fo&&Fo.text.join("\n")==t){if(r.ranges.length%Fo.text.length==0){l=[];for(var c=0;c=0;c--){var u=r.ranges[c],f=u.from(),d=u.to();u.empty()&&(n&&n>0?f=Wo(f.line,f.ch-n):e.state.overwrite&&!a?d=Wo(d.line,Math.min(Jr(o,d.line).text.length,d.ch+Ni(s).length)):Fo&&Fo.lineWise&&Fo.text.join("\n")==t&&(f=d=Wo(f.line,0)));var p=e.curOp.updateInput,h={from:f,to:d,text:l?l[c%l.length]:s,origin:i||(a?"paste":e.state.cutIncoming?"cut":"+input")};Tn(e.doc,h),Mi(e,"inputRead",e,h)}t&&!a&&ee(e,t),Wn(e),e.curOp.updateInput=p,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function J(e,t){var n=e.clipboardData&&e.clipboardData.getData("text/plain");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||zt(t,function(){Q(t,n,0,null,"paste")}),!0}function ee(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s-1){a=Fn(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Jr(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Fn(e,i.head.line,"smart"));a&&Mi(e,"electricInput",e,i.head.line)}}}function te(e){for(var t=[],n=[],r=0;r=0){var a=Z(o.from(),i.from()),s=X(o.to(),i.to()),l=o.empty()?i.from()==i.head:o.from()==o.head;r<=t&&--t,e.splice(--r,2,new de(l?s:a,l?a:s))}}return new fe(e,t)}function he(e,t){return new fe([new de(e,t||e)],0)}function me(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ge(e,t){if(t.linen?Wo(n,Jr(e,n).text.length):ve(t,Jr(e,t.line).text.length)}function ve(e,t){var n=e.ch;return null==n||n>t?Wo(e.line,t):n<0?Wo(e.line,0):e}function ye(e,t){return t>=e.first&&t=t.ch:s.to>t.ch))){if(i&&(qa(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var c,u=l.find(r<0?1:-1);if((r<0?l.inclusiveRight:l.inclusiveLeft)&&(u=Ne(e,u,-r,u&&u.line==t.line?o:null)),u&&u.line==t.line&&(c=Bo(u,n))&&(r<0?c<0:c>0))return Oe(e,u,t,r,i)}var f=l.find(r<0?-1:1);return(r<0?l.inclusiveLeft:l.inclusiveRight)&&(f=Ne(e,f,r,f.line==t.line?o:null)),f?Oe(e,f,t,r,i):null}}return t}function Ie(e,t,n,r,i){var o=r||1,a=Oe(e,t,n,o,i)||!i&&Oe(e,t,n,o,!0)||Oe(e,t,n,-o,i)||!i&&Oe(e,t,n,-o,!0);return a?a:(e.cantEdit=!0,Wo(e.first,0))}function Ne(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?ge(e,Wo(t.line-1)):null:n>0&&t.ch==(r||Jr(e,t.line)).text.length?t.line3&&(r(p,m.top,null,m.bottom),p=c,m.bottoml.bottom||f.bottom==l.bottom&&f.right>l.right)&&(l=f),p0?t.blinker=setInterval(function(){t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function We(e,t){e.doc.mode.startState&&e.doc.frontier=e.display.viewTo)){var n=+new Date+e.options.workTime,r=ua(t.mode,He(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength,l=Pr(e,o,s?ua(t.mode,r):r,!0);o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var f=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),d=0;!f&&dn)return We(e,e.options.workDelay),!0}),i.length&&zt(e,function(){for(var t=0;ta;--s){if(s<=o.first)return o.first;var l=Jr(o,s-1);if(l.stateAfter&&(!n||s<=o.frontier))return s;var c=Fa(l.text,null,e.options.tabSize);(null==i||r>c)&&(i=s-1,r=c)}return i}function He(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return!0;var o=Fe(e,t,n),a=o>r.first&&Jr(r,o-1).stateAfter;return a=a?ua(r.mode,a):fa(r.mode),r.iter(o,t,function(n){jr(e,n.text,a);var s=o==t-1||o%5==0||o>=i.viewFrom&&o2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Ye(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;rn)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Qe(e,t){t=kr(t);var n=ri(t),r=e.display.externalMeasured=new qt(e.doc,t,n);r.lineN=n;var i=r.built=Wr(e,r);return r.text=i.pre,Ki(e.display.lineMeasure,i.pre),r}function Je(e,t,n,r){return nt(e,tt(e,t),n,r)}function et(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(o=c-l,i=o-1,t>=c&&(a="right")),null!=i){if(r=e[s+2],l==c&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;s&&e[s-2]==e[s-3]&&e[s-1].insertLeft;)r=e[(s-=3)+2],a="left";if("right"==n&&i==c-l)for(;s=0&&(n=e[r]).left==n.right;r--);return n}function ot(e,t,n,r){var i,o=rt(t.map,n,r),a=o.node,s=o.start,l=o.end,c=o.collapse;if(3==a.nodeType){for(var u=0;u<4;u++){for(;s&&Hi(t.line.text.charAt(o.coverStart+s));)--s;for(;o.coverStart+l0&&(c=r="right");var f;i=e.options.lineWrapping&&(f=a.getClientRects()).length>1?f["right"==r?f.length-1:0]:a.getBoundingClientRect()}if(xo&&wo<9&&!s&&(!i||!i.left&&!i.right)){var d=a.parentNode.getClientRects()[0];i=d?{left:d.left,right:d.left+xt(e.display),top:d.top,bottom:d.bottom}:Ko}for(var p=i.top-t.rect.top,h=i.bottom-t.rect.top,m=(p+h)/2,g=t.view.measure.heights,u=0;un.from?a(e-1):a(e,r)}r=r||Jr(e.doc,t.line),i||(i=tt(e,r));var l=ai(r),c=t.ch;if(!l)return a(c);var u=fo(l,c),f=s(c,u);return null!=ls&&(f.other=s(c,ls)),f}function gt(e,t){var n=0,t=ge(e.doc,t);e.options.lineWrapping||(n=xt(e.display)*t.ch);var r=Jr(e.doc,t.line),i=oi(r)+$e(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function vt(e,t,n,r){var i=Wo(e,t);return i.xRel=r,n&&(i.outside=!0),i}function yt(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return vt(r.first,0,!0,-1);var i=ii(r,n),o=r.first+r.size-1;if(i>o)return vt(r.first+r.size-1,Jr(r,o).text.length,!0,1);t<0&&(t=0);for(var a=Jr(r,i);;){var s=bt(e,a,i,t,n),l=yr(a),c=l&&l.find(0,!0);if(!l||!(s.ch>c.from.ch||s.ch==c.from.ch&&s.xRel>0))return s;i=ri(a=c.to.line)}}function bt(e,t,n,r,i){function o(r){var i=mt(e,Wo(n,r),"line",t,c);return s=!0,a>i.bottom?i.left-l:ag)return vt(n,p,v,1);for(;;){if(u?p==d||p==ho(t,d,1):p-d<=1){var y=r0&&y1){var x=nt(e,c,y,"right");a<=x.bottom&&a>=x.top&&Math.abs(r-x.right)1?1:0);return w}var _=Math.ceil(f/2),C=d+_;if(u){C=d;for(var S=0;S<_;++S)C=ho(t,C,1)}var M=o(C);M>r?(p=C,g=M,(v=s)&&(g+=1e3),f=_):(d=C,h=M,m=s,f-=_)}}function kt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Ho){Ho=$i("pre");for(var t=0;t<49;++t)Ho.appendChild(document.createTextNode("x")),Ho.appendChild($i("br"));Ho.appendChild(document.createTextNode("x"))}Ki(e.measure,Ho);var n=Ho.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),Ui(e.measure),n||1}function xt(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=$i("span","xxxxxxxxxx"),n=$i("pre",[t]);Ki(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function wt(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Go},Vo?Vo.ops.push(e.curOp):e.curOp.ownsGroup=Vo={ops:[e.curOp],delayedCallbacks:[]}}function _t(e){var t=e.delayedCallbacks,n=0;do{for(;n=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new S(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Lt(e){e.updatedDisplay=e.mustUpdate&&L(e.cm,e.update)}function Tt(e){var t=e.cm,n=t.display;e.updatedDisplay&&z(t),e.barMeasure=h(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Je(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Ve(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Ge(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection(e.focus))}function At(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeftt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Do&&wr(e.doc,t)i.viewFrom?Dt(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)Dt(e);else if(t<=i.viewFrom){var o=Bt(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):Dt(e)}else if(n>=i.viewTo){var o=Bt(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):Dt(e)}else{var a=Bt(e,t,t,-1),s=Bt(e,n,n+r,1);a&&s?(i.view=i.view.slice(0,a.index).concat(Pt(e,a.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):Dt(e)}var l=i.externalMeasured;l&&(n=i.lineN&&t=r.viewTo)){var o=r.view[Wt(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);qi(a,n)==-1&&a.push(n)}}}function Dt(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Wt(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var n=e.display.view,r=0;r0){if(o==a.length-1)return null;i=l+a[o].size-t,o++}else i=l-t;t+=i,n+=i}for(;wr(e.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function Ft(e,t,n){var r=e.display,i=r.view;0==i.length||t>=r.viewTo||n<=r.viewFrom?(r.view=Pt(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Pt(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Wt(e,n)))),r.viewTo=n}function Ht(e){for(var t=e.display.view,n=0,r=0;r400}var i=e.display;Oa(i.scroller,"mousedown",Ot(e,Xt)),xo&&wo<11?Oa(i.scroller,"dblclick",Ot(e,function(t){if(!Ti(e,t)){var n=Gt(e,t);if(n&&!en(e,t)&&!Vt(e.display,t)){Aa(t);var r=e.findWordAt(n);xe(e.doc,r.anchor,r.head)}}})):Oa(i.scroller,"dblclick",function(t){Ti(e,t)||Aa(t)}),Ro||Oa(i.scroller,"contextmenu",function(t){xn(e,t)});var o,a={end:0};Oa(i.scroller,"touchstart",function(t){if(!Ti(e,t)&&!n(t)){clearTimeout(o);var r=+new Date;i.activeTouch={start:r,moved:!1,prev:r-a.end<=300?a:null},1==t.touches.length&&(i.activeTouch.left=t.touches[0].pageX,i.activeTouch.top=t.touches[0].pageY)}}),Oa(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),Oa(i.scroller,"touchend",function(n){var o=i.activeTouch;if(o&&!Vt(i,n)&&null!=o.left&&!o.moved&&new Date-o.start<300){var a,s=e.coordsChar(i.activeTouch,"page");a=!o.prev||r(o,o.prev)?new de(s,s):!o.prev.prev||r(o,o.prev.prev)?e.findWordAt(s):new de(Wo(s.line,0),ge(e.doc,Wo(s.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),Aa(n)}t()}),Oa(i.scroller,"touchcancel",t),Oa(i.scroller,"scroll",function(){i.scroller.clientHeight&&(an(e,i.scroller.scrollTop),sn(e,i.scroller.scrollLeft,!0),qa(e,"scroll",e))}),Oa(i.scroller,"mousewheel",function(t){ln(e,t)}),Oa(i.scroller,"DOMMouseScroll",function(t){ln(e,t)}),Oa(i.wrapper,"scroll",function(){i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(t){Ti(e,t)||za(t)},over:function(t){Ti(e,t)||(rn(e,t),za(t))},start:function(t){nn(e,t)},drop:Ot(e,tn),leave:function(t){Ti(e,t)||on(e)}};var s=i.input.getField();Oa(s,"keyup",function(t){gn.call(e,t)}),Oa(s,"keydown",Ot(e,hn)),Oa(s,"keypress",Ot(e,vn)),Oa(s,"focus",Wi(bn,e)),Oa(s,"blur",Wi(kn,e))}function Ut(t,n,r){var i=r&&r!=e.Init;if(!n!=!i){var o=t.display.dragFunctions,a=n?Oa:Na;a(t.display.scroller,"dragstart",o.start),a(t.display.scroller,"dragenter",o.enter),a(t.display.scroller,"dragover",o.over),a(t.display.scroller,"dragleave",o.leave),a(t.display.scroller,"drop",o.drop)}}function Kt(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function Vt(e,t){for(var n=_i(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Gt(e,t,n,r){var i=e.display;if(!n&&"true"==_i(t).getAttribute("cm-not-content"))return null;var o,a,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,a=t.clientY-s.top}catch(t){return null}var l,c=yt(e,o,a);if(r&&1==c.xRel&&(l=Jr(e.doc,c.line).text).length==c.ch){var u=Fa(l,l.length,e.options.tabSize)-l.length;c=Wo(c.line,Math.max(0,Math.round((o-Ke(e.display).left)/xt(e.display))-u))}return c}function Xt(e){var t=this,n=t.display;if(!(Ti(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.shift=e.shiftKey,Vt(n,e))return void(_o||(n.scroller.draggable=!1,setTimeout(function(){n.scroller.draggable=!0},100)));if(!en(t,e)){var r=Gt(t,e);switch(window.focus(),Ci(e)){case 1:t.state.selectingText?t.state.selectingText(e):r?Zt(t,e,r):_i(e)==n.scroller&&Aa(e);break;case 2:_o&&(t.state.lastMiddleDown=+new Date),r&&xe(t.doc,r),setTimeout(function(){n.input.focus()},20),Aa(e);break;case 3:Ro?xn(t,e):yn(t)}}}}function Zt(e,t,n){xo?setTimeout(Wi(Y,e),0):e.curOp.focus=Vi();var r,i=+new Date;Uo&&Uo.time>i-400&&0==Bo(Uo.pos,n)?r="triple":$o&&$o.time>i-400&&0==Bo($o.pos,n)?(r="double",Uo={time:i,pos:n}):(r="single",$o={time:i,pos:n});var o,a=e.doc.sel,s=Oo?t.metaKey:t.ctrlKey;e.options.dragDrop&&ns&&!e.isReadOnly()&&"single"==r&&(o=a.contains(n))>-1&&(Bo((o=a.ranges[o]).from(),n)<0||n.xRel>0)&&(Bo(o.to(),n)>0||n.xRel<0)?Yt(e,t,n,s):Qt(e,t,n,r,s)}function Yt(e,t,n,r){var i=e.display,o=+new Date,a=Ot(e,function(s){_o&&(i.scroller.draggable=!1),e.state.draggingText=!1,Na(document,"mouseup",a),Na(i.scroller,"drop",a),Math.abs(t.clientX-s.clientX)+Math.abs(t.clientY-s.clientY)<10&&(Aa(s),!r&&+new Date-200y&&i.push(new de(Wo(h,y),Wo(h,Ha(v,p,o))))}i.length||i.push(new de(n,n)),Le(c,pe(d.ranges.slice(0,f).concat(i),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b=u,k=b.anchor,x=t;if("single"!=r){if("double"==r)var w=e.findWordAt(t);else var w=new de(Wo(t.line,0),ge(c,Wo(t.line+1,0)));Bo(w.anchor,k)>0?(x=w.head,k=Z(b.from(),w.anchor)):(x=w.anchor,k=X(b.to(),w.head))}var i=d.ranges.slice(0);i[f]=new de(ge(c,k),x),Le(c,pe(i,f),Wa)}}function a(t){var n=++y,i=Gt(e,t,!0,"rect"==r);if(i)if(0!=Bo(i,g)){e.curOp.focus=Vi(),o(i);var s=k(l,c);(i.line>=s.to||i.linev.bottom?20:0;u&&setTimeout(Ot(e,function(){y==n&&(l.scroller.scrollTop+=u,a(t))}),50)}}function s(t){e.state.selectingText=!1,y=1/0,Aa(t),l.input.focus(),Na(document,"mousemove",b),Na(document,"mouseup",x),c.history.lastSelOrigin=null}var l=e.display,c=e.doc;Aa(t);var u,f,d=c.sel,p=d.ranges;if(i&&!t.shiftKey?(f=c.sel.contains(n),u=f>-1?p[f]:new de(n,n)):(u=c.sel.primary(),f=c.sel.primIndex),Io?t.shiftKey&&t.metaKey:t.altKey)r="rect",i||(u=new de(n,n)),n=Gt(e,t,!0,!0),f=-1;else if("double"==r){var h=e.findWordAt(n);u=e.display.shift||c.extend?ke(c,u,h.anchor,h.head):h}else if("triple"==r){var m=new de(Wo(n.line,0),ge(c,Wo(n.line+1,0)));u=e.display.shift||c.extend?ke(c,u,m.anchor,m.head):m}else u=ke(c,u,n);i?f==-1?(f=p.length,Le(c,pe(p.concat([u]),f),{scroll:!1,origin:"*mouse"})):p.length>1&&p[f].empty()&&"single"==r&&!t.shiftKey?(Le(c,pe(p.slice(0,f).concat(p.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),d=c.sel):_e(c,f,u,Wa):(f=0,Le(c,new fe([u],0),Wa),d=c.sel);var g=n,v=l.wrapper.getBoundingClientRect(),y=0,b=Ot(e,function(e){Ci(e)?a(e):s(e)}),x=Ot(e,s);e.state.selectingText=x,Oa(document,"mousemove",b),Oa(document,"mouseup",x)}function Jt(e,t,n,r){try{var i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Aa(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!Ei(e,n))return wi(t);o-=s.top-a.viewOffset;for(var l=0;l=i){var u=ii(e.doc,o),f=e.options.gutters[l];return qa(e,n,e,u,f,t),wi(t)}}}function en(e,t){return Jt(e,t,"gutterClick",!0)}function tn(e){var t=this;if(on(t),!Ti(t,e)&&!Vt(t.display,e)){Aa(e),xo&&(Xo=+new Date);var n=Gt(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,s=function(e,r){if(!t.options.allowDropFileTypes||qi(t.options.allowDropFileTypes,e.type)!=-1){var s=new FileReader;s.onload=Ot(t,function(){var e=s.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[r]=e,++a==i){n=ge(t.doc,n);var l={from:n,to:n,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};Tn(t.doc,l),Me(t.doc,he(n,ta(l)))}}),s.readAsText(e)}},l=0;l-1)return t.state.draggingText(e),void setTimeout(function(){t.display.input.focus()},20);try{var o=e.dataTransfer.getData("Text");if(o){if(t.state.draggingText&&!t.state.draggingText.copy)var c=t.listSelections();if(Te(t.doc,he(n,n)),c)for(var l=0;la.clientWidth,l=a.scrollHeight>a.clientHeight;if(r&&s||i&&l){if(i&&Oo&&_o)e:for(var c=t.target,u=o.view;c!=a;c=c.parentNode)for(var f=0;f=0;--i)An(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text});else An(e,t)}}function An(e,t){if(1!=t.text.length||""!=t.text[0]||0!=Bo(t.from,t.to)){var n=Cn(e,t);fi(e,t,n,e.cm?e.cm.curOp.id:NaN),On(e,t,n,sr(e,t));var r=[];Yr(e,function(e,n){n||qi(r,e.history)!=-1||(xi(e.history,t),r.push(e.history)),On(e,t,null,sr(e,t))})}}function En(e,t,n){if(!e.cm||!e.cm.state.suppressEdits||n){for(var r,i=e.history,o=e.sel,a="undo"==t?i.done:i.undone,s="undo"==t?i.undone:i.done,l=0;l=0;--l){var f=r.changes[l];if(f.origin=t,u&&!Ln(e,f,!1))return void(a.length=0);c.push(li(e,f));var d=l?Cn(e,f):Ni(a);On(e,f,d,cr(e,f)),!l&&e.cm&&e.cm.scrollIntoView({from:f.from,to:ta(f)});var p=[];Yr(e,function(e,t){t||qi(p,e.history)!=-1||(xi(e.history,f),p.push(e.history)),On(e,f,null,cr(e,f))})}}}}function zn(e,t){if(0!=t&&(e.first+=t,e.sel=new fe(Pi(e.sel.ranges,function(e){return new de(Wo(e.anchor.line+t,e.anchor.ch),Wo(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Rt(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:Wo(o,Jr(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ei(e,t.from,t.to),n||(n=Cn(e,t)),e.cm?In(e.cm,t,r):Gr(e,t,r),Te(e,n,Da)}}function In(e,t,n){var r=e.doc,i=e.display,a=t.from,s=t.to,l=!1,c=a.line;e.options.lineWrapping||(c=ri(kr(Jr(r,a.line))),r.iter(c,s.line+1,function(e){if(e==i.maxLine)return l=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Ai(e),Gr(r,t,n,o(e)),e.options.lineWrapping||(r.iter(c,a.line+t.text.length,function(e){var t=f(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),r.frontier=Math.min(r.frontier,a.line),We(e,400);var u=t.text.length-(s.line-a.line)-1;t.full?Rt(e):a.line!=s.line||1!=t.text.length||Vr(e.doc,t)?Rt(e,a.line,s.line+1,u):jt(e,a.line,"text");var d=Ei(e,"changes"),p=Ei(e,"change");if(p||d){var h={from:a,to:s,text:t.text,removed:t.removed,origin:t.origin};p&&Mi(e,"change",e,h),d&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function Nn(e,t,n,r,i){if(r||(r=n),Bo(r,n)<0){var o=r;r=n,n=o}"string"==typeof t&&(t=e.splitLines(t)),Tn(e,{from:n,to:r,text:t,origin:i})}function qn(e,t){if(!Ti(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!Ao){var o=$i("div","​",null,"position: absolute; top: "+(t.top-n.viewOffset-$e(e.display))+"px; height: "+(t.bottom-t.top+Ve(e)+n.barHeight)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function Pn(e,t,n,r){null==r&&(r=0);for(var i=0;i<5;i++){var o=!1,a=mt(e,t),s=n&&n!=t?mt(e,n):a,l=jn(e,Math.min(a.left,s.left),Math.min(a.top,s.top)-r,Math.max(a.left,s.left),Math.max(a.bottom,s.bottom)+r),c=e.doc.scrollTop,u=e.doc.scrollLeft;if(null!=l.scrollTop&&(an(e,l.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(o=!0)),null!=l.scrollLeft&&(sn(e,l.scrollLeft),Math.abs(e.doc.scrollLeft-u)>1&&(o=!0)),!o)break}return a}function Rn(e,t,n,r,i){var o=jn(e,t,n,r,i);null!=o.scrollTop&&an(e,o.scrollTop),null!=o.scrollLeft&&sn(e,o.scrollLeft)}function jn(e,t,n,r,i){var o=e.display,a=kt(e.display);n<0&&(n=0);var s=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,l=Xe(e),c={};i-n>l&&(i=n+l);var u=e.doc.height+Ue(o),f=nu-a;if(ns+l){var p=Math.min(n,(d?u:i)-l);p!=s&&(c.scrollTop=p); -}var h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,m=Ge(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),g=r-t>m;return g&&(r=t+m),t<10?c.scrollLeft=0:tm+h-3&&(c.scrollLeft=r+(g?0:10)-m),c}function Dn(e,t,n){null==t&&null==n||Bn(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=n&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+n)}function Wn(e){Bn(e);var t=e.getCursor(),n=t,r=t;e.options.lineWrapping||(n=t.ch?Wo(t.line,t.ch-1):t,r=Wo(t.line,t.ch+1)),e.curOp.scrollToPos={from:n,to:r,margin:e.options.cursorScrollMargin,isCursor:!0}}function Bn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=gt(e,t.from),r=gt(e,t.to),i=jn(e,Math.min(n.left,r.left),Math.min(n.top,r.top)-t.margin,Math.max(n.right,r.right),Math.max(n.bottom,r.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function Fn(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=He(e,t):n="prev");var a=e.options.tabSize,s=Jr(o,t),l=Fa(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&(c=o.mode.indent(i,s.text.slice(u.length),s.text),c==ja||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?Fa(Jr(o,t-1).text,null,a):0:"add"==n?c=l+e.options.indentUnit:"subtract"==n?c=l-e.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var f="",d=0;if(e.options.indentWithTabs)for(var p=Math.floor(c/a);p;--p)d+=a,f+="\t";if(d=0;t--)Nn(e.doc,"",r[t].from,r[t].to,"+delete");Wn(e)})}function Un(e,t,n,r,i){function o(){var t=s+n;return!(t=e.first+e.size)&&(s=t,u=Jr(e,t))}function a(e){var t=(i?ho:mo)(u,l,n,!0);if(null==t){if(e||!o())return!1;l=i?(n<0?ao:oo)(u):n<0?u.text.length:0}else l=t;return!0}var s=t.line,l=t.ch,c=n,u=Jr(e,s);if("char"==r)a();else if("column"==r)a(!0);else if("word"==r||"group"==r)for(var f=null,d="group"==r,p=e.cm&&e.cm.getHelper(t,"wordChars"),h=!0;!(n<0)||a(!h);h=!1){var m=u.text.charAt(l)||"\n",g=Bi(m,p)?"w":d&&"\n"==m?"n":!d||/\s/.test(m)?null:"p";if(!d||h||g||(g="s"),f&&f!=g){n<0&&(n=1,a());break}if(g&&(f=g),n>0&&!a(!h))break}var v=Ie(e,Wo(s,l),t,c,!0);return Bo(t,v)||(v.hitSide=!0),v}function Kn(e,t,n,r){var i,o=e.doc,a=t.left;if("page"==r){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);i=t.top+n*(s-(n<0?1.5:.5)*kt(e.display))}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;;){var l=yt(e,a,i);if(!l.outside)break;if(n<0?i<=0:i>=o.height){l.hitSide=!0;break}i+=5*n}return l}function Vn(t,n,r,i){e.defaults[t]=n,r&&(ra[t]=i?function(e,t,n){n!=ia&&r(e,t,n)}:r)}function Gn(e){for(var t,n,r,i,o=e.split(/-(?!$)/),e=o[o.length-1],a=0;a0||0==a&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=$i("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(br(e,t.line,t,n,o)||t.line!=n.line&&br(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Do=!0}o.addToHistory&&fi(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,c=e.cm;if(e.iter(l,n.line+1,function(e){c&&o.collapsed&&!c.options.lineWrapping&&kr(e)==c.display.maxLine&&(s=!0),o.collapsed&&l!=t.line&&ni(e,0),ir(e,new tr(o,l==t.line?t.ch:null,l==n.line?n.ch:null)),++l}),o.collapsed&&e.iter(t.line,n.line+1,function(t){Cr(e,t)&&ni(t,0)}),o.clearOnEnter&&Oa(o,"beforeCursorEnter",function(){o.clear()}),o.readOnly&&(jo=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ya,o.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),o.collapsed)Rt(c,t.line,n.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var u=t.line;u<=n.line;u++)jt(c,u,"text");o.atomic&&Ee(c.doc),Mi(c,"markerAdded",c,o)}return o}function Yn(e,t,n,r,i){r=Di(r),r.shared=!1;var o=[Zn(e,t,n,r,i)],a=o[0],s=r.widgetNode;return Yr(e,function(e){s&&(r.widgetNode=s.cloneNode(!0)),o.push(Zn(e,ge(e,t),ge(e,n),r,i));for(var l=0;l=t:o.to>t);(r||(r=[])).push(new tr(a,o.from,l?null:o.to))}}return r}function ar(e,t,n){if(e)for(var r,i=0;i=t:o.to>t);if(s||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from0&&s)for(var f=0;f0)){var u=[l,1],f=Bo(c.from,s.from),d=Bo(c.to,s.to);(f<0||!a.inclusiveLeft&&!f)&&u.push({from:c.from,to:s.from}),(d>0||!a.inclusiveRight&&!d)&&u.push({from:s.to,to:c.to}),i.splice.apply(i,u),l+=u.length-1}}return i}function fr(e){var t=e.markedSpans;if(t){for(var n=0;n=0&&f<=0||u<=0&&f>=0)&&(u<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?Bo(c.to,n)>=0:Bo(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?Bo(c.from,r)<=0:Bo(c.from,r)<0)))return!0}}}function kr(e){for(var t;t=vr(e);)e=t.find(-1,!0).line;return e}function xr(e){for(var t,n;t=yr(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function wr(e,t){var n=Jr(e,t),r=kr(n);return n==r?t:ri(r)}function _r(e,t){if(t>e.lastLine())return t;var n,r=Jr(e,t);if(!Cr(e,r))return t;for(;n=yr(r);)r=n.find(1,!0).line;return ri(r)+1}function Cr(e,t){var n=Do&&t.markedSpans;if(n)for(var r,i=0;in.start)return a}throw new Error("Mode "+t.name+" failed to advance stream.")}function Nr(e,t,n,r){function i(e){return{start:f.start,end:f.pos,string:f.current(),type:o||null,state:e?ua(a.mode,u):u}}var o,a=e.doc,s=a.mode;t=ge(a,t);var l,c=Jr(a,t.line),u=He(e,t.line,n),f=new va(c.text,e.options.tabSize);for(r&&(l=[]);(r||f.pose.options.maxHighlightLength?(s=!1,a&&jr(e,t,r,f.pos),f.pos=t.length,l=null):l=zr(Ir(n,f,r,d),o),d){var p=d[0].name;p&&(l="m-"+(l?p+" "+l:p))}if(!s||u!=l){for(;ce&&i.splice(l,1,e,i[l+1],r),l+=2,c=Math.min(e,r)}if(t)if(s.opaque)i.splice(n,l-n,e,"cm-overlay "+t),l=n+2;else for(;ne.options.maxHighlightLength?ua(e.doc.mode,r):r);t.stateAfter=r,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.frontier&&e.doc.frontier++}return t.styles}function jr(e,t,n,r){var i=e.doc.mode,o=new va(t,e.options.tabSize);for(o.start=o.pos=r||0,""==t&&Or(i,n);!o.eol();)Ir(i,o,n),o.start=o.pos}function Dr(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Ca:_a;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Wr(e,t){var n=$i("span",null,null,_o?"padding-right: .1px":null),r={pre:$i("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(xo||_o)&&e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o,a=i?t.rest[i-1]:t.line;r.pos=0,r.addToken=Fr,eo(e.display.measure)&&(o=ai(a))&&(r.addToken=$r(r.addToken,o)),r.map=[];var s=t!=e.display.externalMeasured&&ri(a);Kr(a,r,Rr(e,a,s)),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=Xi(a.styleClasses.bgClass,r.bgClass||"")),a.styleClasses.textClass&&(r.textClass=Xi(a.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Ji(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(_o){var l=r.content.lastChild;(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return qa(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=Xi(r.pre.className,r.textClass||"")),r}function Br(e){var t=$i("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Fr(e,t,n,r,i,o,a){if(t){var s=e.splitSpaces?Hr(t,e.trailingSpace):t,l=e.cm.state.specialChars,c=!1;if(l.test(t))for(var u=document.createDocumentFragment(),f=0;;){l.lastIndex=f;var d=l.exec(t),p=d?d.index-f:t.length-f;if(p){var h=document.createTextNode(s.slice(f,f+p));xo&&wo<9?u.appendChild($i("span",[h])):u.appendChild(h),e.map.push(e.pos,e.pos+p,h),e.col+=p,e.pos+=p}if(!d)break;if(f+=p+1,"\t"==d[0]){var m=e.cm.options.tabSize,g=m-e.col%m,h=u.appendChild($i("span",Ii(g),"cm-tab"));h.setAttribute("role","presentation"),h.setAttribute("cm-text","\t"),e.col+=g}else if("\r"==d[0]||"\n"==d[0]){var h=u.appendChild($i("span","\r"==d[0]?"␍":"␤","cm-invalidchar"));h.setAttribute("cm-text",d[0]),e.col+=1}else{var h=e.cm.options.specialCharPlaceholder(d[0]);h.setAttribute("cm-text",d[0]),xo&&wo<9?u.appendChild($i("span",[h])):u.appendChild(h),e.col+=1}e.map.push(e.pos,e.pos+1,h),e.pos++}else{e.col+=t.length;var u=document.createTextNode(s);e.map.push(e.pos,e.pos+t.length,u),xo&&wo<9&&(c=!0),e.pos+=t.length}if(e.trailingSpace=32==s.charCodeAt(t.length-1),n||r||i||c||a){var v=n||"";r&&(v+=r),i&&(v+=i);var y=$i("span",[u],v,a);return o&&(y.title=o),e.content.appendChild(y)}e.content.appendChild(u)}}function Hr(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;ic&&d.from<=c)break}if(d.to>=u)return e(n,r,i,o,a,s,l);e(n,r.slice(0,d.to-c),i,o,null,s,l),o=null,r=r.slice(d.to-c),c=d.to}}}function Ur(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function Kr(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,l,c,u,f,d,p=i.length,h=0,m=1,g="",v=0;;){if(v==h){l=c=u=f=s="",d=null,v=1/0;for(var y,b=[],k=0;kh||w.collapsed&&x.to==h&&x.from==h)?(null!=x.to&&x.to!=h&&v>x.to&&(v=x.to,c=""),w.className&&(l+=" "+w.className),w.css&&(s=(s?s+";":"")+w.css),w.startStyle&&x.from==h&&(u+=" "+w.startStyle),w.endStyle&&x.to==v&&(y||(y=[])).push(w.endStyle,x.to),w.title&&!f&&(f=w.title),w.collapsed&&(!d||mr(d.marker,w)<0)&&(d=x)):x.from>h&&v>x.from&&(v=x.from)}if(y)for(var k=0;k=p)break;for(var _=Math.min(p,v);;){if(g){var C=h+g.length;if(!d){var S=C>_?g.slice(0,_-h):g;t.addToken(t,S,a?a+l:l,u,h+S.length==v?c:"",f,s)}if(C>=_){g=g.slice(_-h),h=_;break}h=C,u=""}g=i.slice(o,o=n[m++]),a=Dr(n[m++],t.cm.options)}}else for(var m=1;m1&&e.remove(s.line+1,h-1),e.insert(s.line+1,m)}Mi(e,"change",e,t)}function Xr(e){this.lines=e,this.parent=null;for(var t=0,n=0;t=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Ni(e.done)):void 0}function fi(e,t,n,r){if("ignoreHistory"!=t.origin){var i=e.history;i.undone.length=0;var o,a=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>a-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=ui(i,i.lastOp==r))){var s=Ni(o.changes);0==Bo(t.from,t.to)&&0==Bo(t.from,s.to)?s.to=ta(t):o.changes.push(li(e,t))}else{var l=Ni(i.done);for(l&&l.ranges||hi(e.sel,i.done),o={changes:[li(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,s||qa(e,"historyAdded")}}function di(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function pi(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||di(e,o,Ni(i.done),t))?i.done[i.done.length-1]=t:hi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&ci(i.undone)}function hi(e,t){var n=Ni(t);n&&n.ranges&&n.equals(e)||t.push(e)}function mi(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o})}function gi(e){if(!e)return null;for(var t,n=0;n-1&&(Ni(s)[f]=u[f],delete u[f])}}}return i}function bi(e,t,n,r){n0?r.slice():Ia:r||Ia}function Mi(e,t){function n(e){return function(){e.apply(null,o)}}var r=Si(e,t,!1);if(r.length){var i,o=Array.prototype.slice.call(arguments,2);Vo?i=Vo.delayedCallbacks:Pa?i=Pa:(i=Pa=[],setTimeout(Li,0));for(var a=0;a0}function zi(e){e.prototype.on=function(e,t){Oa(this,e,t)},e.prototype.off=function(e,t){Na(this,e,t)}}function Oi(){this.id=null}function Ii(e){for(;$a.length<=e;)$a.push(Ni($a)+" ");return $a[e]}function Ni(e){return e[e.length-1]}function qi(e,t){for(var n=0;n-1&&Ga(e))||t.test(e):Ga(e)}function Fi(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function Hi(e){return e.charCodeAt(0)>=768&&Xa.test(e)}function $i(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o0;--t)e.removeChild(e.firstChild);return e}function Ki(e,t){return Ui(e).appendChild(t)}function Vi(){for(var e=document.activeElement;e&&e.root&&e.root.activeElement;)e=e.root.activeElement;return e}function Gi(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function Xi(e,t){for(var n=e.split(" "),r=0;r2&&!(xo&&wo<8))}var n=Ya?$i("span","​"):$i("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function eo(e){if(null!=Qa)return Qa;var t=Ki(e,document.createTextNode("AخA")),n=Ka(t,0,1).getBoundingClientRect(),r=Ka(t,1,2).getBoundingClientRect();return Ui(e),!(!n||n.left==n.right)&&(Qa=r.right-n.right<3)}function to(e){if(null!=as)return as;var t=Ki(e,$i("span","x")),n=t.getBoundingClientRect(),r=Ka(t,0,1).getBoundingClientRect();return as=Math.abs(n.left-r.left)>1}function no(e,t,n,r){if(!e)return r(t,n,"ltr");for(var i=!1,o=0;ot||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr"),i=!0)}i||r(t,n,"ltr")}function ro(e){return e.level%2?e.to:e.from}function io(e){return e.level%2?e.from:e.to}function oo(e){var t=ai(e);return t?ro(t[0]):0}function ao(e){var t=ai(e);return t?io(Ni(t)):e.text.length}function so(e,t){var n=Jr(e.doc,t),r=kr(n);r!=n&&(t=ri(r));var i=ai(r),o=i?i[0].level%2?ao(r):oo(r):0;return Wo(t,o)}function lo(e,t){for(var n,r=Jr(e.doc,t);n=yr(r);)r=n.find(1,!0).line,t=null;var i=ai(r),o=i?i[0].level%2?oo(r):ao(r):r.text.length;return Wo(null==t?ri(r):t,o)}function co(e,t){var n=so(e,t.line),r=Jr(e.doc,n.line),i=ai(r);if(!i||0==i[0].level){var o=Math.max(0,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return Wo(n.line,a?0:o)}return n}function uo(e,t,n){var r=e[0].level;return t==r||n!=r&&tt)return r;if(i.from==t||i.to==t){if(null!=n)return uo(e,i.level,e[n].level)?(i.from!=i.to&&(ls=n),r):(i.from!=i.to&&(ls=r),n);n=r}}return n}function po(e,t,n,r){if(!r)return t+n;do t+=n;while(t>0&&Hi(e.text.charAt(t)));return t}function ho(e,t,n,r){var i=ai(e);if(!i)return mo(e,t,n,r);for(var o=fo(i,t),a=i[o],s=po(e,t,a.level%2?-n:n,r);;){if(s>a.from&&s0==a.level%2?a.to:a.from);if(a=i[o+=n],!a)return null;s=n>0==a.level%2?po(e,a.to,-1,r):po(e,a.from,1,r)}}function mo(e,t,n,r){var i=t+n;if(r)for(;i>0&&Hi(e.text.charAt(i));)i+=n;return i<0||i>e.text.length?null:i}var go=navigator.userAgent,vo=navigator.platform,yo=/gecko\/\d/i.test(go),bo=/MSIE \d/.test(go),ko=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(go),xo=bo||ko,wo=xo&&(bo?document.documentMode||6:ko[1]),_o=/WebKit\//.test(go),Co=_o&&/Qt\/\d+\.\d+/.test(go),So=/Chrome\//.test(go),Mo=/Opera\//.test(go),Lo=/Apple Computer/.test(navigator.vendor),To=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(go),Ao=/PhantomJS/.test(go),Eo=/AppleWebKit/.test(go)&&/Mobile\/\w+/.test(go),zo=Eo||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(go),Oo=Eo||/Mac/.test(vo),Io=/\bCrOS\b/.test(go),No=/win/i.test(vo),qo=Mo&&go.match(/Version\/(\d*\.\d*)/);qo&&(qo=Number(qo[1])),qo&&qo>=15&&(Mo=!1,_o=!0);var Po=Oo&&(Co||Mo&&(null==qo||qo<12.11)),Ro=yo||xo&&wo>=9,jo=!1,Do=!1;m.prototype=Di({update:function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+o+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:n?r:0,bottom:t?r:0}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},setScrollTop:function(e){ -this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},zeroWidthHack:function(){var e=Oo&&!To?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Oi,this.disableVert=new Oi},enableZeroWidthBar:function(e,t){function n(){var r=e.getBoundingClientRect(),i=document.elementFromPoint(r.left+1,r.bottom-1);i!=e?e.style.pointerEvents="none":t.set(1e3,n)}e.style.pointerEvents="auto",t.set(1e3,n)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},m.prototype),g.prototype=Di({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},g.prototype),e.scrollbarModel={"native":m,"null":g},S.prototype.signal=function(e,t){Ei(e,t)&&this.events.push(arguments)},S.prototype.finish=function(){for(var e=0;e=9&&n.hasSelection&&(n.hasSelection=null),n.poll()}),Oa(o,"paste",function(e){Ti(r,e)||J(e,r)||(r.state.pasteIncoming=!0,n.fastPoll())}),Oa(o,"cut",t),Oa(o,"copy",t),Oa(e.scroller,"paste",function(t){Vt(e,t)||Ti(r,t)||(r.state.pasteIncoming=!0,n.focus())}),Oa(e.lineSpace,"selectstart",function(t){Vt(e,t)||Aa(t)}),Oa(o,"compositionstart",function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Oa(o,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},prepareSelection:function(){var e=this.cm,t=e.display,n=e.doc,r=Pe(e);if(e.options.moveInputWithCursor){var i=mt(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},showSelection:function(e){var t=this.cm,n=t.display;Ki(n.cursorDiv,e.cursors),Ki(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},reset:function(e){if(!this.contextMenuPending){var t,n,r=this.cm,i=r.doc;if(r.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=os&&(o.to().line-o.from().line>100||(n=r.getSelection()).length>1e3);var a=t?"-":n||r.getSelection();this.composing||(this.textarea.value=a),r.state.focused&&Ua(this.textarea),xo&&wo>=9&&(this.hasSelection=a)}else e||(this.composing||(this.prevInput=this.textarea.value=""),xo&&wo>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!zo||Vi()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;e.pollingFast||e.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},fastPoll:function(){function e(){var r=n.poll();r||t?(n.pollingFast=!1,n.slowPoll()):(t=!0,n.polling.set(60,e))}var t=!1,n=this;n.pollingFast=!0,n.polling.set(20,e)},poll:function(){var e=this.cm,t=this.textarea,n=this.prevInput;if(this.contextMenuPending||!e.state.focused||is(t)&&!n&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var r=t.value;if(r==n&&!e.somethingSelected())return!1;if(xo&&wo>=9&&this.hasSelection===r||Oo&&/[\uf700-\uf7ff]/.test(r))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var i=r.charCodeAt(0);if(8203!=i||n||(n="​"),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var o=0,a=Math.min(n.length,r.length);o1e3||r.indexOf("\n")>-1?t.value=s.prevInput="":s.prevInput=r,s.composing&&(s.composing.range.clear(),s.composing.range=e.markText(s.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){xo&&wo>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(e){function t(){if(null!=a.selectionStart){var e=i.somethingSelected(),t="​"+(e?a.value:"");a.value="⇚",a.value=t,r.prevInput=e?"":"​",a.selectionStart=1,a.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function n(){if(r.contextMenuPending=!1,r.wrapper.style.cssText=f,a.style.cssText=u,xo&&wo<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=l),null!=a.selectionStart){(!xo||xo&&wo<9)&&t();var e=0,n=function(){o.selForContextMenu==i.doc.sel&&0==a.selectionStart&&a.selectionEnd>0&&"​"==r.prevInput?Ot(i,da.selectAll)(i):e++<10?o.detectingSelectAll=setTimeout(n,500):o.input.reset()};o.detectingSelectAll=setTimeout(n,200)}}var r=this,i=r.cm,o=i.display,a=r.textarea,s=Gt(i,e),l=o.scroller.scrollTop;if(s&&!Mo){var c=i.options.resetSelectionOnContextMenu;c&&i.doc.sel.contains(s)==-1&&Ot(i,Le)(i.doc,he(s),Da);var u=a.style.cssText,f=r.wrapper.style.cssText;r.wrapper.style.cssText="position: absolute";var d=r.wrapper.getBoundingClientRect();if(a.style.cssText="position: absolute; width: 30px; height: 30px; top: "+(e.clientY-d.top-5)+"px; left: "+(e.clientX-d.left-5)+"px; z-index: 1000; background: "+(xo?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",_o)var p=window.scrollY;if(o.input.focus(),_o&&window.scrollTo(null,p),o.input.reset(),i.somethingSelected()||(a.value=r.prevInput=" "),r.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),xo&&wo>=9&&t(),Ro){za(e);var h=function(){Na(window,"mouseup",h),setTimeout(n,20)};Oa(window,"mouseup",h)}else setTimeout(n,50)}},readOnlyChanged:function(e){e||this.reset()},setUneditable:Ri,needsContentAttribute:!1},re.prototype),oe.prototype=Di({init:function(e){function t(e){if(!Ti(r,e)){if(r.somethingSelected())Fo={lineWise:!1,text:r.getSelections()},"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=te(r);Fo={lineWise:!0,text:t.text},"cut"==e.type&&r.operation(function(){r.setSelections(t.ranges,0,Da),r.replaceSelection("",null,"cut")})}if(e.clipboardData&&!Eo)e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/plain",Fo.text.join("\n"));else{var n=ie(),i=n.firstChild;r.display.lineSpace.insertBefore(n,r.display.lineSpace.firstChild),i.value=Fo.text.join("\n");var o=document.activeElement;Ua(i),setTimeout(function(){r.display.lineSpace.removeChild(n),o.focus()},50)}}}var n=this,r=n.cm,i=n.div=e.lineDiv;ne(i),Oa(i,"paste",function(e){Ti(r,e)||J(e,r)}),Oa(i,"compositionstart",function(e){var t=e.data;if(n.composing={sel:r.doc.sel,data:t,startData:t},t){var i=r.doc.sel.primary(),o=r.getLine(i.head.line),a=o.indexOf(t,Math.max(0,i.head.ch-t.length));a>-1&&a<=i.head.ch&&(n.composing.sel=he(Wo(i.head.line,a),Wo(i.head.line,a+t.length)))}}),Oa(i,"compositionupdate",function(e){n.composing.data=e.data}),Oa(i,"compositionend",function(e){var t=n.composing;t&&(e.data==t.startData||/\u200b/.test(e.data)||(t.data=e.data),setTimeout(function(){t.handled||n.applyComposition(t),n.composing==t&&(n.composing=null)},50))}),Oa(i,"touchstart",function(){n.forceCompositionEnd()}),Oa(i,"input",function(){n.composing||!r.isReadOnly()&&n.pollContent()||zt(n.cm,function(){Rt(r)})}),Oa(i,"copy",t),Oa(i,"cut",t)},prepareSelection:function(){var e=Pe(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),n=le(this.cm,e.anchorNode,e.anchorOffset),r=le(this.cm,e.focusNode,e.focusOffset);if(!n||n.bad||!r||r.bad||0!=Bo(Z(n,r),t.from())||0!=Bo(X(n,r),t.to())){var i=ae(this.cm,t.from()),o=ae(this.cm,t.to());if(i||o){var a=this.cm.display.view,s=e.rangeCount&&e.getRangeAt(0);if(i){if(!o){var l=a[a.length-1].measure,c=l.maps?l.maps[l.maps.length-1]:l.map;o={node:c[c.length-1],offset:c[c.length-2]-c[c.length-3]}}}else i={node:a[0].measure.map[2],offset:0};try{var u=Ka(i.node,i.offset,o.offset,o.node)}catch(f){}u&&(!yo&&this.cm.state.focused?(e.collapse(i.node,i.offset),u.collapsed||e.addRange(u)):(e.removeAllRanges(),e.addRange(u)),s&&null==e.anchorNode?e.addRange(s):yo&&this.startGracePeriod()),this.rememberSelection()}}},startGracePeriod:function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){e.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(e){Ki(this.cm.display.cursorDiv,e.cursors),Ki(this.cm.display.selectionDiv,e.selection)},rememberSelection:function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},selectionInEditor:function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return Za(this.div,t)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():zt(this.cm,function(){t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},selectionChanged:function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;this.rememberSelection();var n=le(t,e.anchorNode,e.anchorOffset),r=le(t,e.focusNode,e.focusOffset);n&&r&&zt(t,function(){Le(t.doc,he(n,r),Da),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}},pollContent:function(){var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.linet.viewTo-1)return!1;var o;if(r.line==t.viewFrom||0==(o=Wt(e,r.line)))var a=ri(t.view[0].line),s=t.view[0].node;else var a=ri(t.view[o].line),s=t.view[o-1].node.nextSibling;var l=Wt(e,i.line);if(l==t.view.length-1)var c=t.viewTo-1,u=t.lineDiv.lastChild;else var c=ri(t.view[l+1].line)-1,u=t.view[l+1].node.previousSibling;for(var f=e.doc.splitLines(ue(e,s,u,a,c)),d=ei(e.doc,Wo(a,0),Wo(c,Jr(e.doc,c).text.length));f.length>1&&d.length>1;)if(Ni(f)==Ni(d))f.pop(),d.pop(),c--;else{if(f[0]!=d[0])break;f.shift(),d.shift(),a++}for(var p=0,h=0,m=f[0],g=d[0],v=Math.min(m.length,g.length);p1||f[0]||Bo(x,w)?(Nn(e.doc,f,x,w,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(e){this.cm.isReadOnly()?Ot(this.cm,Rt)(this.cm):e.data&&e.data!=e.startData&&Ot(this.cm,Q)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.contentEditable="false"},onKeyPress:function(e){e.preventDefault(),this.cm.isReadOnly()||Ot(this.cm,Q)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},readOnlyChanged:function(e){this.div.contentEditable=String("nocursor"!=e)},onContextMenu:Ri,resetPosition:Ri,needsContentAttribute:!0},oe.prototype),e.inputStyles={textarea:re,contenteditable:oe},fe.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t=0&&Bo(e,r.to())<=0)return n}return-1}},de.prototype={from:function(){return Z(this.anchor,this.head)},to:function(){return X(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Ho,$o,Uo,Ko={left:0,right:0,top:0,bottom:0},Vo=null,Go=0,Xo=0,Zo=0,Yo=null;xo?Yo=-.53:yo?Yo=15:So?Yo=-.7:Lo&&(Yo=-1/3);var Qo=function(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}};e.wheelEventPixels=function(e){var t=Qo(e);return t.x*=Yo,t.y*=Yo,t};var Jo=new Oi,ea=null,ta=e.changeEnd=function(e){return e.text?Wo(e.from.line+e.text.length-1,Ni(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var n=this.options,r=n[e];n[e]==t&&"mode"!=e||(n[e]=t,ra.hasOwnProperty(e)&&Ot(this,ra[e])(this,t,r))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Xn(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;nn&&(Fn(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Wn(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l0&&_e(this.doc,r,new de(o,c[r].to()),Da)}}}),getTokenAt:function(e,t){return Nr(this,e,t)},getLineTokens:function(e,t){return Nr(this,Wo(e),t,!0)},getTokenTypeAt:function(e){e=ge(this.doc,e);var t,n=Rr(this,Jr(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]i&&(e=i,r=!0),n=Jr(this.doc,e)}else n=e;return dt(this,n,{top:0,left:0},t||"page").top+(r?this.doc.height-oi(n):0)},defaultTextHeight:function(){return kt(this.display)},defaultCharWidth:function(){return xt(this.display)},setGutterMarker:It(function(e,t,n){return Hn(this.doc,e,"gutter",function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&Fi(r)&&(e.gutterMarkers=null),!0})}),clearGutter:It(function(e){var t=this,n=t.doc,r=n.first;n.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&(n.gutterMarkers[e]=null,jt(t,r,"gutter"),Fi(n.gutterMarkers)&&(n.gutterMarkers=null)),++r})}),lineInfo:function(e){if("number"==typeof e){if(!ye(this.doc,e))return null;var t=e;if(e=Jr(this.doc,e),!e)return null}else{var t=ri(e);if(null==t)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display;e=mt(this,ge(this.doc,e));var a=e.bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)a=e.top;else if("above"==r||"near"==r){var l=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(a=e.bottom),s+t.offsetWidth>c&&(s=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),n&&Rn(this,s,a,s+t.offsetWidth,a+t.offsetHeight)},triggerOnKeyDown:It(hn),triggerOnKeyPress:It(vn),triggerOnKeyUp:gn,execCommand:function(e){if(da.hasOwnProperty(e))return da[e].call(null,this)},triggerElectric:It(function(e){ee(this,e)}),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=0,a=ge(this.doc,e);o0&&s(n.charAt(r-1));)--r;for(;i.5)&&a(this),qa(this,"refresh",this)}),swapDoc:It(function(e){var t=this.doc;return t.cm=null,Qr(this,e),ct(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Mi(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},zi(e);var na=e.defaults={},ra=e.optionHandlers={},ia=e.Init={toString:function(){return"CodeMirror.Init"}};Vn("value","",function(e,t){e.setValue(t)},!0),Vn("mode",null,function(e,t){e.doc.modeOption=t,n(e)},!0),Vn("indentUnit",2,n,!0),Vn("indentWithTabs",!1),Vn("smartIndent",!0),Vn("tabSize",4,function(e){r(e),ct(e),Rt(e)},!0),Vn("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(o==-1)break;i=o+t.length,n.push(Wo(r,o))}r++});for(var i=n.length-1;i>=0;i--)Nn(e.doc,t,n[i],Wo(n[i].line,n[i].ch+t.length))}}),Vn("specialChars",/[\u0000-\u001f\u007f\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,n,r){t.state.specialChars=new RegExp(n.source+(n.test("\t")?"":"|\t"),"g"),r!=e.Init&&t.refresh()}),Vn("specialCharPlaceholder",Br,function(e){e.refresh()},!0),Vn("electricChars",!0),Vn("inputStyle",zo?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),Vn("rtlMoveVisually",!No),Vn("wholeLineUpdateBefore",!0),Vn("theme","default",function(e){s(e),l(e)},!0),Vn("keyMap","default",function(t,n,r){var i=Xn(n),o=r!=e.Init&&Xn(r);o&&o.detach&&o.detach(t,i),i.attach&&i.attach(t,o||null)}),Vn("extraKeys",null),Vn("lineWrapping",!1,i,!0),Vn("gutters",[],function(e){p(e.options),l(e)},!0),Vn("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?C(e.display)+"px":"0",e.refresh()},!0),Vn("coverGutterNextToScrollbar",!1,function(e){y(e)},!0),Vn("scrollbarStyle","native",function(e){v(e),y(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),Vn("lineNumbers",!1,function(e){p(e.options),l(e)},!0),Vn("firstLineNumber",1,l,!0),Vn("lineNumberFormatter",function(e){return e},l,!0),Vn("showCursorWhenSelecting",!1,qe,!0),Vn("resetSelectionOnContextMenu",!0),Vn("lineWiseCopyCut",!0),Vn("readOnly",!1,function(e,t){"nocursor"==t?(kn(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),Vn("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),Vn("dragDrop",!0,Ut),Vn("allowDropFileTypes",null),Vn("cursorBlinkRate",530),Vn("cursorScrollMargin",0),Vn("cursorHeight",1,qe,!0),Vn("singleCursorHeightPerLine",!0,qe,!0),Vn("workTime",100),Vn("workDelay",100),Vn("flattenSpans",!0,r,!0),Vn("addModeClass",!1,r,!0),Vn("pollInterval",100),Vn("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),Vn("historyEventDelay",1250),Vn("viewportMargin",10,function(e){e.refresh()},!0),Vn("maxHighlightLength",1e4,r,!0),Vn("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),Vn("tabindex",null,function(e,t){e.display.input.getField().tabIndex=t||""}),Vn("autofocus",null);var oa=e.modes={},aa=e.mimeModes={};e.defineMode=function(t,n){e.defaults.mode||"null"==t||(e.defaults.mode=t),arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),oa[t]=n},e.defineMIME=function(e,t){aa[e]=t},e.resolveMode=function(t){if("string"==typeof t&&aa.hasOwnProperty(t))t=aa[t];else if(t&&"string"==typeof t.name&&aa.hasOwnProperty(t.name)){var n=aa[t.name];"string"==typeof n&&(n={name:n}),t=ji(n,t),t.name=n.name}else if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return"string"==typeof t?{name:t}:t||{name:"null"}},e.getMode=function(t,n){var n=e.resolveMode(n),r=oa[n.name];if(!r)return e.getMode(t,"text/plain");var i=r(t,n);if(sa.hasOwnProperty(n.name)){var o=sa[n.name];for(var a in o)o.hasOwnProperty(a)&&(i.hasOwnProperty(a)&&(i["_"+a]=i[a]),i[a]=o[a])}if(i.name=n.name,n.helperType&&(i.helperType=n.helperType),n.modeProps)for(var a in n.modeProps)i[a]=n.modeProps[a];return i},e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var sa=e.modeExtensions={};e.extendMode=function(e,t){var n=sa.hasOwnProperty(e)?sa[e]:sa[e]={};Di(t,n)},e.defineExtension=function(t,n){e.prototype[t]=n},e.defineDocExtension=function(e,t){Ma.prototype[e]=t},e.defineOption=Vn;var la=[];e.defineInitHook=function(e){la.push(e)};var ca=e.helpers={};e.registerHelper=function(t,n,r){ca.hasOwnProperty(t)||(ca[t]=e[t]={_global:[]}),ca[t][n]=r},e.registerGlobalHelper=function(t,n,r,i){e.registerHelper(t,n,i),ca[t]._global.push({pred:r,val:i})};var ua=e.copyState=function(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n},fa=e.startState=function(e,t,n){return!e.startState||e.startState(t,n)};e.innerMode=function(e,t){for(;e.innerMode;){var n=e.innerMode(t);if(!n||n.mode==e)break;t=n.state,e=n.mode}return n||{mode:e,state:t}};var da=e.commands={selectAll:function(e){e.setSelection(Wo(e.firstLine(),0),Wo(e.lastLine()),Da)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Da)},killLine:function(e){$n(e,function(t){if(t.empty()){var n=Jr(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new Wo(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),Wo(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Jr(e.doc,i.line-1).text;a&&e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),Wo(i.line-1,a.length-1),Wo(i.line,1),"+transpose")}n.push(new de(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){zt(e,function(){for(var t=e.listSelections().length,n=0;n=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){if(this.post},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos0?null:(r&&t!==!1&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);if(i(o)==i(e))return t!==!1&&(this.pos+=e.length),!0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};var ya=0,ba=e.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ya};zi(ba),ba.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&wt(e),Ei(this,"clear")){var n=this.find();n&&Mi(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=l,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Rt(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ee(e.doc)),e&&Mi(e,"markerCleared",e,this),t&&Ct(e),this.parent&&this.parent.clear()}},ba.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var n,r,i=0;i1||!(this.children[0]instanceof Xr))){var s=[];this.collapse(s),this.children=[new Xr(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var a=i.lines.length%25+25,s=a;s10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r=0;o--)Tn(this,r[o]);s?Me(this,s):this.cm&&Wn(this.cm)}),undo:Nt(function(){En(this,"undo")}),redo:Nt(function(){En(this,"redo")}),undoSelection:Nt(function(){En(this,"undo",!0)}),redoSelection:Nt(function(){En(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=ge(this,e),t=ge(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var s=0;s=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;re?(t=e,!0):(e-=o,void++n)}),ge(this,Wo(n,t))},indexFromPos:function(e){e=ge(this,e);var t=e.ch;if(e.linet&&(t=e.from),null!=e.to&&e.to=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}},Ha=e.findColumn=function(e,t,n){for(var r=0,i=0;;){var o=e.indexOf("\t",r);o==-1&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}},$a=[""],Ua=function(e){e.select()};Eo?Ua=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:xo&&(Ua=function(e){try{e.select()}catch(t){}});var Ka,Va=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Ga=e.isWordChar=function(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Va.test(e))},Xa=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;Ka=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var Za=e.contains=function(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do if(11==t.nodeType&&(t=t.host),t==e)return!0;while(t=t.parentNode)};xo&&wo<11&&(Vi=function(){try{return document.activeElement}catch(e){return document.body}});var Ya,Qa,Ja=e.rmClass=function(e,t){var n=e.className,r=Gi(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}},es=e.addClass=function(e,t){var n=e.className;Gi(t).test(n)||(e.className+=(n?" ":"")+t)},ts=!1,ns=function(){if(xo&&wo<9)return!1;var e=$i("div");return"draggable"in e||"dragDrop"in e}(),rs=e.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);i==-1&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");a!=-1?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},is=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(n){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},os=function(){var e=$i("div");return"oncopy"in e||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),as=null,ss=e.keyNames={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};!function(){for(var e=0;e<10;e++)ss[e+48]=ss[e+96]=String(e);for(var e=65;e<=90;e++)ss[e]=String.fromCharCode(e);for(var e=1;e<=12;e++)ss[e+111]=ss[e+63235]="F"+e}();var ls,cs=function(){function e(e){return e<=247?n.charAt(e):1424<=e&&e<=1524?"R":1536<=e&&e<=1773?r.charAt(e-1536):1774<=e&&e<=2220?"r":8192<=e&&e<=8203?"w":8204==e?"b":"L"}function t(e,t,n){this.level=e,this.from=t,this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",r="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,s=/[Lb1n]/,l=/[1n]/,c="L";return function(n){if(!i.test(n))return!1;for(var r,u=n.length,f=[],d=0;d2){r.pending=[];for(var d=2;d-1)return e.Pass;var a=r.indent.length-1,s=t[r.state];e:for(;;){for(var c=0;c-1?i+t.length:i}var o=t.exec(n?e.slice(n):e);return o?o.index+n+(r?o[0].length:0):-1}var r=Array.prototype.slice.call(arguments,1);return{startState:function(){return{outer:e.startState(t),innerActive:null,inner:null}},copyState:function(n){return{outer:e.copyState(t,n.outer),innerActive:n.innerActive,inner:n.innerActive&&e.copyState(n.innerActive.mode,n.inner)}},token:function(i,o){if(o.innerActive){var a=o.innerActive,s=i.string;if(!a.close&&i.sol())return o.innerActive=o.inner=null,this.token(i,o);var l=a.close?n(s,a.close,i.pos,a.parseDelimiters):-1;if(l==i.pos&&!a.parseDelimiters)return i.match(a.close),o.innerActive=o.inner=null,a.delimStyle&&a.delimStyle+" "+a.delimStyle+"-close";l>-1&&(i.string=s.slice(0,l));var c=a.mode.token(i,o.inner);return l>-1&&(i.string=s),l==i.pos&&a.parseDelimiters&&(o.innerActive=o.inner=null),a.innerStyle&&(c=c?c+" "+a.innerStyle:a.innerStyle),c}for(var u=1/0,s=i.string,f=0;f-1)return u=n(l,c,u),{from:r(o.line,u),to:r(o.line,u+a.length)}}else{var l=e.getLine(o.line).slice(o.ch),c=s(l),u=c.indexOf(t);if(u>-1)return u=n(l,c,u)+o.ch,{from:r(o.line,u),to:r(o.line,u+a.length)}}}:this.matches=function(){};else{var c=a.split("\n");this.matches=function(t,n){var i=l.length-1;if(t){if(n.line-(l.length-1)=1;--u,--a)if(l[u]!=s(e.getLine(a)))return;var f=e.getLine(a),d=f.length-c[0].length;if(s(f.slice(d))!=l[0])return;return{from:r(a,d),to:o}}if(!(n.line+(l.length-1)>e.lastLine())){var f=e.getLine(n.line),d=f.length-c[0].length;if(s(f.slice(d))==l[0]){for(var p=r(n.line,d),a=n.line+1,u=1;un))return r;--r}}}var r=e.Pos;t.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){function t(e){var t=r(e,0);return n.pos={from:t,to:t},n.atOccurrence=!1,!1}for(var n=this,i=this.doc.clipPos(e?this.pos.from:this.pos.to);;){if(this.pos=this.matches(e,i))return this.atOccurrence=!0,this.pos.match||!0;if(e){if(!i.line)return t(0);i=r(i.line-1,this.doc.getLine(i.line-1).length)}else{var o=this.doc.lineCount();if(i.line==o-1)return t(o);i=r(i.line+1,0)}}},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(t,n){if(this.atOccurrence){var i=e.splitLines(t);this.doc.replaceRange(i,this.pos.from,this.pos.to,n),this.pos.to=r(this.pos.from.line+i.length-1,i[i.length-1].length+(1==i.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",function(e,n,r){return new t(this.doc,e,n,r)}),e.defineDocExtension("getSearchCursor",function(e,n,r){return new t(this,e,n,r)}),e.defineExtension("selectMatches",function(t,n){for(var r=[],i=this.getSearchCursor(t,this.getCursor("from"),n);i.findNext()&&!(e.cmpPos(i.to(),this.getCursor("to"))>0);)r.push({anchor:i.from(),head:i.to()});r.length&&this.setSelections(r,0)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./searchcursor"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../dialog/dialog"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){return"string"==typeof e?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),t?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(t){e.lastIndex=t.pos;var n=e.exec(t.string);return n&&n.index==t.pos?(t.pos+=n[0].length||1,"searching"):void(n?t.pos=n.index:t.skipToEnd())}}}function n(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function r(e){return e.state.search||(e.state.search=new n)}function i(e){return"string"==typeof e&&e==e.toLowerCase()}function o(e,t,n){return e.getSearchCursor(t,n,i(t))}function a(e,t,n,r,i){e.openDialog(t,r,{value:n,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){h(e)},onKeyDown:i})}function s(e,t,n,r,i){e.openDialog?e.openDialog(t,i,{value:r,selectValueOnOpen:!0}):i(prompt(n,r))}function l(e,t,n,r){e.openConfirm?e.openConfirm(t,r):confirm(n)&&r[0]()}function c(e){return e.replace(/\\(.)/g,function(e,t){return"n"==t?"\n":"r"==t?"\r":t})}function u(e){var t=e.match(/^\/(.*)\/([a-z]*)$/);if(t)try{e=new RegExp(t[1],t[2].indexOf("i")==-1?"":"i")}catch(n){}else e=c(e);return("string"==typeof e?""==e:e.test(""))&&(e=/x^/),e}function f(e,n,r){n.queryText=r,n.query=u(r),e.removeOverlay(n.overlay,i(n.query)),n.overlay=t(n.query,i(n.query)),e.addOverlay(n.overlay),e.showMatchesOnScrollbar&&(n.annotate&&(n.annotate.clear(),n.annotate=null),n.annotate=e.showMatchesOnScrollbar(n.query,i(n.query)))}function d(t,n,i,o){var l=r(t);if(l.query)return p(t,n);var c=t.getSelection()||l.lastQuery;if(i&&t.openDialog){var u=null,d=function(n,r){e.e_stop(r),n&&(n!=l.queryText&&(f(t,l,n),l.posFrom=l.posTo=t.getCursor()),u&&(u.style.opacity=1),p(t,r.shiftKey,function(e,n){var r;n.line<3&&document.querySelector&&(r=t.display.wrapper.querySelector(".CodeMirror-dialog"))&&r.getBoundingClientRect().bottom-4>t.cursorCoords(n,"window").top&&((u=r).style.opacity=.4)}))};a(t,v,c,d,function(n,i){var o=e.keyMap[t.getOption("keyMap")][e.keyName(n)];"findNext"==o||"findPrev"==o?(e.e_stop(n),f(t,r(t),i),t.execCommand(o)):"find"!=o&&"findPersistent"!=o||(e.e_stop(n),d(i,n))}),o&&(f(t,l,c),p(t,n))}else s(t,v,"Search for:",c,function(e){e&&!l.query&&t.operation(function(){f(t,l,e),l.posFrom=l.posTo=t.getCursor(),p(t,n)})})}function p(t,n,i){t.operation(function(){var a=r(t),s=o(t,a.query,n?a.posFrom:a.posTo);(s.find(n)||(s=o(t,a.query,n?e.Pos(t.lastLine()):e.Pos(t.firstLine(),0)),s.find(n)))&&(t.setSelection(s.from(),s.to()),t.scrollIntoView({from:s.from(),to:s.to()},20),a.posFrom=s.from(),a.posTo=s.to(),i&&i(s.from(),s.to()))})}function h(e){e.operation(function(){var t=r(e);t.lastQuery=t.query,t.query&&(t.query=t.queryText=null,e.removeOverlay(t.overlay),t.annotate&&(t.annotate.clear(),t.annotate=null))})}function m(e,t,n){e.operation(function(){for(var r=o(e,t);r.findNext();)if("string"!=typeof t){var i=e.getRange(r.from(),r.to()).match(t);r.replace(n.replace(/\$(\d)/g,function(e,t){return i[t]}))}else r.replace(n)})}function g(e,t){if(!e.getOption("readOnly")){var n=e.getSelection()||r(e).lastQuery,i=t?"Replace all:":"Replace:";s(e,i+y,i,n,function(n){n&&(n=u(n),s(e,b,"Replace with:","",function(r){if(r=c(r),t)m(e,n,r);else{h(e);var i=o(e,n,e.getCursor("from")),a=function(){var t,c=i.from();!(t=i.findNext())&&(i=o(e,n),!(t=i.findNext())||c&&i.from().line==c.line&&i.from().ch==c.ch)||(e.setSelection(i.from(),i.to()),e.scrollIntoView({from:i.from(),to:i.to()}),l(e,k,"Replace?",[function(){s(t)},a,function(){m(e,n,r)}]))},s=function(e){i.replace("string"==typeof n?r:r.replace(/\$(\d)/g,function(t,n){return e[n]})),a()};a()}}))})}}var v='Search: (Use /re/ syntax for regexp search)',y=' (Use /re/ syntax for regexp search)',b='With: ',k="Replace? ";e.commands.find=function(e){h(e),d(e)},e.commands.findPersistent=function(e){h(e),d(e,!1,!0)},e.commands.findPersistentNext=function(e){d(e,!1,!0,!0)},e.commands.findPersistentPrev=function(e){d(e,!0,!0,!0)},e.commands.findNext=d,e.commands.findPrev=function(e){d(e,!0)},e.commands.clearSearch=h,e.commands.replace=g,e.commands.replaceAll=function(e){g(e,!0)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../dialog/dialog"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n,r,i){e.openDialog?e.openDialog(t,i,{value:r,selectValueOnOpen:!0}):i(prompt(n,r))}function n(e,t){var n=Number(t);return/^[-+]/.test(t)?e.getCursor().line+n:n-1}var r='Jump to line: (Use line:column or scroll% syntax)';e.commands.jumpToLine=function(e){var i=e.getCursor();t(e,r,"Jump to line:",i.line+1+":"+i.ch,function(t){if(t){var r;if(r=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(t))e.setCursor(n(e,r[1]),Number(r[2]));else if(r=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(t)){var o=Math.round(e.lineCount()*Number(r[1])/100);/^[-+]/.test(r[1])&&(o=i.line+o+1),e.setCursor(o-1,i.ch)}else(r=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(t))&&e.setCursor(n(e,r[1]),i.ch)}})},e.keyMap["default"]["Alt-G"]="jumpToLine"}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./searchcursor"),require("../scroll/annotatescrollbar")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../scroll/annotatescrollbar"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n,r){this.cm=e,this.options=r;var i={listenForChanges:!1};for(var o in r)i[o]=r[o];i.className||(i.className="CodeMirror-search-match"),this.annotation=e.annotateScrollbar(i),this.query=t,this.caseFold=n,this.gap={from:e.firstLine(),to:e.lastLine()+1},this.matches=[],this.update=null,this.findMatches(),this.annotation.update(this.matches);var a=this;e.on("change",this.changeHandler=function(e,t){a.onChange(t)})}function n(e,t,n){return e<=t?e:Math.max(t,e+n)}e.defineExtension("showMatchesOnScrollbar",function(e,n,r){return"string"==typeof r&&(r={className:r}),r||(r={}),new t(this,e,n,r)});var r=1e3;t.prototype.findMatches=function(){if(this.gap){for(var t=0;t=this.gap.to)break;n.to.line>=this.gap.from&&this.matches.splice(t--,1)}for(var i=this.cm.getSearchCursor(this.query,e.Pos(this.gap.from,0),this.caseFold),o=this.options&&this.options.maxMatches||r;i.findNext();){var n={from:i.from(),to:i.to()};if(n.from.line>=this.gap.to)break;if(this.matches.splice(t++,0,n),this.matches.length>o)break}this.gap=null}},t.prototype.onChange=function(t){var r=t.from.line,i=e.changeEnd(t).line,o=i-t.to.line;if(this.gap?(this.gap.from=Math.min(n(this.gap.from,r,o),t.from.line),this.gap.to=Math.max(n(this.gap.to,r,o),t.from.line)):this.gap={from:t.from.line,to:i+1},o)for(var a=0;a=t.options.minChars&&r(e,d,!1,t.options.style)}})}function a(e,t,n){var r=e.getRange(t,n);if(null!==r.match(/^\w+$/)){if(t.ch>0){var i={line:t.line,ch:t.ch-1},o=e.getRange(i,t);if(null===o.match(/\W/))return!1}if(n.chr.right?1:0:t.clientYr.bottom?1:0,o.moveTo(o.pos+n*o.screen)}),e.on(this.node,"mousewheel",i),e.on(this.node,"DOMMouseScroll",i)}function n(e,n,r){this.addClass=e,this.horiz=new t(e,"horizontal",r),n(this.horiz.node),this.vert=new t(e,"vertical",r),n(this.vert.node),this.width=null}t.prototype.setPos=function(e,t){return e<0&&(e=0),e>this.total-this.screen&&(e=this.total-this.screen),!(!t&&e==this.pos)&&(this.pos=e,this.inner.style["horizontal"==this.orientation?"left":"top"]=e*(this.size/this.total)+"px",!0)},t.prototype.moveTo=function(e){this.setPos(e)&&this.scroll(e,this.orientation)};var r=10;t.prototype.update=function(e,t,n){var i=this.screen!=t||this.total!=e||this.size!=n;i&&(this.screen=t,this.total=e,this.size=n);var o=this.screen*(this.size/this.total);oe.clientWidth+1,i=e.scrollHeight>e.clientHeight+1;return this.vert.node.style.display=i?"block":"none",this.horiz.node.style.display=r?"block":"none",i&&(this.vert.update(e.scrollHeight,e.clientHeight,e.viewHeight-(r?n:0)),this.vert.node.style.bottom=r?n+"px":"0"),r&&(this.horiz.update(e.scrollWidth,e.clientWidth,e.viewWidth-(i?n:0)-e.barLeft),this.horiz.node.style.right=i?n+"px":"0",this.horiz.node.style.left=e.barLeft+"px"),{right:i?n:0,bottom:r?n:0}},n.prototype.setScrollTop=function(e){this.vert.setPos(e)},n.prototype.setScrollLeft=function(e){this.horiz.setPos(e)},n.prototype.clear=function(){var e=this.horiz.node.parentNode;e.removeChild(this.horiz.node),e.removeChild(this.vert.node)},e.scrollbarModel.simple=function(e,t){return new n("CodeMirror-simplescroll",e,t)},e.scrollbarModel.overlay=function(e,t){return new n("CodeMirror-overlayscroll",e,t)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){function n(e){clearTimeout(r.doRedraw),r.doRedraw=setTimeout(function(){r.redraw()},e)}this.cm=e,this.options=t,this.buttonHeight=t.scrollButtonHeight||e.getOption("scrollButtonHeight"),this.annotations=[],this.doRedraw=this.doUpdate=null,this.div=e.getWrapperElement().appendChild(document.createElement("div")),this.div.style.cssText="position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none",this.computeScale();var r=this;e.on("refresh",this.resizeHandler=function(){clearTimeout(r.doUpdate),r.doUpdate=setTimeout(function(){r.computeScale()&&n(20)},100)}),e.on("markerAdded",this.resizeHandler),e.on("markerCleared",this.resizeHandler),t.listenForChanges!==!1&&e.on("change",this.changeHandler=function(){n(250)})}e.defineExtension("annotateScrollbar",function(e){return"string"==typeof e&&(e={className:e}),new t(this,e)}),e.defineOption("scrollButtonHeight",0),t.prototype.computeScale=function(){var e=this.cm,t=(e.getWrapperElement().clientHeight-e.display.barHeight-2*this.buttonHeight)/e.getScrollerElement().scrollHeight;if(t!=this.hScale)return this.hScale=t,!0},t.prototype.update=function(e){this.annotations=e,this.redraw()},t.prototype.redraw=function(e){function t(e,t){if(l!=e.line&&(l=e.line,c=n.getLineHandle(l)),a&&c.height>s)return n.charCoords(e,"local")[t?"top":"bottom"];var r=n.heightAtLine(c,"local");return r+(t?0:c.height)}e!==!1&&this.computeScale();var n=this.cm,r=this.hScale,i=document.createDocumentFragment(),o=this.annotations,a=n.getOption("lineWrapping"),s=a&&1.5*n.defaultTextHeight(),l=null,c=null;if(n.display.barWidth)for(var u,f=0;fh+.9));)d=o[++f],h=t(d.to,!1)*r;if(h!=p){var m=Math.max(h-p,3),g=i.appendChild(document.createElement("div"));g.style.cssText="position: absolute; right: 0px; width: "+Math.max(1.5*n.display.barWidth,2)+"px; top: "+(p+this.buttonHeight)+"px; height: "+m+"px",g.className=this.options.className,d.id&&g.setAttribute("annotation-id",d.id)}}this.div.textContent="",this.div.appendChild(i)},t.prototype.clear=function(){this.cm.off("refresh",this.resizeHandler),this.cm.off("markerAdded",this.resizeHandler),this.cm.off("markerCleared",this.resizeHandler),this.changeHandler&&this.cm.off("change",this.changeHandler),this.div.parentNode.removeChild(this.div)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,n,r){this.cm=e,this.node=t,this.options=n,this.height=r,this.cleared=!1}function n(e){var t=e.getWrapperElement(),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r=parseInt(n.height),i=e.state.panels={setHeight:t.style.height,heightLeft:r,panels:0,wrapper:document.createElement("div")};t.parentNode.insertBefore(i.wrapper,t);var o=e.hasFocus();i.wrapper.appendChild(t),o&&e.focus(),e._setSize=e.setSize,null!=r&&(e.setSize=function(t,n){if(null==n)return this._setSize(t,n);if(i.setHeight=n,"number"!=typeof n){var o=/^(\d+\.?\d*)px$/.exec(n);o?n=Number(o[1]):(i.wrapper.style.height=n,n=i.wrapper.offsetHeight,i.wrapper.style.height="")}e._setSize(t,i.heightLeft+=n-r),r=n})}function r(e){var t=e.state.panels;e.state.panels=null;var n=e.getWrapperElement();t.wrapper.parentNode.replaceChild(n,t.wrapper),n.style.height=t.setHeight,e.setSize=e._setSize,e.setSize()}e.defineExtension("addPanel",function(e,r){r=r||{},this.state.panels||n(this);var i=this.state.panels,o=i.wrapper,a=this.getWrapperElement();r.after instanceof t&&!r.after.cleared?o.insertBefore(e,r.before.node.nextSibling):r.before instanceof t&&!r.before.cleared?o.insertBefore(e,r.before.node):r.replace instanceof t&&!r.replace.cleared?(o.insertBefore(e,r.replace.node),r.replace.clear()):"bottom"==r.position?o.appendChild(e):"before-bottom"==r.position?o.insertBefore(e,a.nextSibling):"after-top"==r.position?o.insertBefore(e,a):o.insertBefore(e,o.firstChild);var s=r&&r.height||e.offsetHeight;return this._setSize(null,i.heightLeft-=s),i.panels++,new t(this,e,r,s)}),t.prototype.clear=function(){if(!this.cleared){this.cleared=!0;var e=this.cm.state.panels;this.cm._setSize(null,e.heightLeft+=this.height),e.wrapper.removeChild(this.node),0==--e.panels&&r(this.cm)}},t.prototype.changed=function(e){var t=null==e?this.node.offsetHeight:e,n=this.cm.state.panels;this.cm._setSize(null,n.height+=t-this.height),this.height=t}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function n(e){t(e);var n=e.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.className="CodeMirror-placeholder";var r=e.getOption("placeholder");"string"==typeof r&&(r=document.createTextNode(r)),n.appendChild(r),e.display.lineSpace.insertBefore(n,e.display.lineSpace.firstChild)}function r(e){o(e)&&n(e)}function i(e){var r=e.getWrapperElement(),i=o(e);r.className=r.className.replace(" CodeMirror-empty","")+(i?" CodeMirror-empty":""),i?n(e):t(e)}function o(e){return 1===e.lineCount()&&""===e.getLine(0)}e.defineOption("placeholder","",function(n,o,a){var s=a&&a!=e.Init;if(o&&!s)n.on("blur",r),n.on("change",i),n.on("swapDoc",i),i(n);else if(!o&&s){n.off("blur",r),n.off("change",i),n.off("swapDoc",i),t(n);var l=n.getWrapperElement();l.className=l.className.replace(" CodeMirror-empty","")}o&&!n.hasFocus()&&r(n)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){var t=e.getWrapperElement();e.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:t.style.width,height:t.style.height},t.style.width="",t.style.height="auto",t.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",e.refresh()}function n(e){var t=e.getWrapperElement();t.className=t.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var n=e.state.fullScreenRestore;t.style.width=n.width,t.style.height=n.height,window.scrollTo(n.scrollLeft,n.scrollTop),e.refresh()}e.defineOption("fullScreen",!1,function(r,i,o){o==e.Init&&(o=!1),!o!=!i&&(i?t(r):n(r))})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(t,r){function i(){t.display.wrapper.offsetHeight?(n(t,r),t.display.lastWrapHeight!=t.display.wrapper.clientHeight&&t.refresh()):r.timeout=setTimeout(i,r.delay)}r.timeout=setTimeout(i,r.delay),r.hurry=function(){clearTimeout(r.timeout),r.timeout=setTimeout(i,50)},e.on(window,"mouseup",r.hurry),e.on(window,"keyup",r.hurry)}function n(t,n){clearTimeout(n.timeout),e.off(window,"mouseup",n.hurry),e.off(window,"keyup",n.hurry)}e.defineOption("autoRefresh",!1,function(e,r){e.state.autoRefresh&&(n(e,e.state.autoRefresh),e.state.autoRefresh=null),r&&0==e.display.wrapper.offsetHeight&&t(e,e.state.autoRefresh={delay:r.delay||250})})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,n){var r,i=e.getWrapperElement();return r=i.appendChild(document.createElement("div")),n?r.className="CodeMirror-dialog CodeMirror-dialog-bottom":r.className="CodeMirror-dialog CodeMirror-dialog-top","string"==typeof t?r.innerHTML=t:r.appendChild(t),r}function n(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}e.defineExtension("openDialog",function(r,i,o){function a(e){if("string"==typeof e)f.value=e;else{if(c)return;c=!0,l.parentNode.removeChild(l),u.focus(),o.onClose&&o.onClose(l)}}o||(o={}),n(this,null);var s,l=t(this,r,o.bottom),c=!1,u=this,f=l.getElementsByTagName("input")[0];return f?(f.focus(),o.value&&(f.value=o.value,o.selectValueOnOpen!==!1&&f.select()),o.onInput&&e.on(f,"input",function(e){o.onInput(e,f.value,a)}),o.onKeyUp&&e.on(f,"keyup",function(e){o.onKeyUp(e,f.value,a)}),e.on(f,"keydown",function(t){o&&o.onKeyDown&&o.onKeyDown(t,f.value,a)||((27==t.keyCode||o.closeOnEnter!==!1&&13==t.keyCode)&&(f.blur(),e.e_stop(t),a()),13==t.keyCode&&i(f.value,t))}),o.closeOnBlur!==!1&&e.on(f,"blur",a)):(s=l.getElementsByTagName("button")[0])&&(e.on(s,"click",function(){a(),u.focus()}),o.closeOnBlur!==!1&&e.on(s,"blur",a),s.focus()),a}),e.defineExtension("openConfirm",function(r,i,o){function a(){c||(c=!0,s.parentNode.removeChild(s),u.focus())}n(this,null);var s=t(this,r,o&&o.bottom),l=s.getElementsByTagName("button"),c=!1,u=this,f=1;l[0].focus();for(var d=0;d=0&&s[o.text.charAt(l)]||s[o.text.charAt(++l)];if(!c)return null;var u=">"==c.charAt(1)?1:-1;if(r&&u>0!=(l==t.ch))return null;var f=e.getTokenTypeAt(a(t.line,l+1)),d=n(e,a(t.line,l+(u>0?1:0)),u,f||null,i);return null==d?null:{from:a(t.line,l),to:d&&d.pos,match:d&&d.ch==c.charAt(0),forward:u>0}}function n(e,t,n,r,i){for(var o=i&&i.maxScanLineLength||1e4,l=i&&i.maxScanLines||1e3,c=[],u=i&&i.bracketRegex?i.bracketRegex:/[(){}[\]]/,f=n>0?Math.min(t.line+l,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-l),d=t.line;d!=f;d+=n){var p=e.getLine(d);if(p){var h=n>0?0:p.length-1,m=n>0?p.length:-1;if(!(p.length>o))for(d==t.line&&(h=t.ch-(n<0?1:0));h!=m;h+=n){var g=p.charAt(h);if(u.test(g)&&(void 0===r||e.getTokenTypeAt(a(d,h+1))==r)){var v=s[g];if(">"==v.charAt(1)==n>0)c.push(g);else{if(!c.length)return{pos:a(d,h),ch:g};c.pop()}}}}}return d-n!=(n>0?e.lastLine():e.firstLine())&&null}function r(e,n,r){for(var i=e.state.matchBrackets.maxHighlightLineLength||1e3,s=[],l=e.listSelections(),c=0;c",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},l=null;e.defineOption("matchBrackets",!1,function(t,n,r){r&&r!=e.Init&&(t.off("cursorActivity",i),l&&(l(),l=null)),n&&(t.state.matchBrackets="object"==typeof n?n:{},t.on("cursorActivity",i))}),e.defineExtension("matchBrackets",function(){r(this,!0)}),e.defineExtension("findMatchingBracket",function(e,n,r){return t(this,e,n,r)}),e.defineExtension("scanForBracket",function(e,t,r,i){return n(this,e,t,r,i)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t){return"pairs"==t&&"string"==typeof e?e:"object"==typeof e&&null!=e[t]?e[t]:f[t]}function n(e){return function(t){return s(t,e)}}function r(e){var t=e.state.closeBrackets;if(!t)return null;var n=e.getModeAt(e.getCursor());return n.closeBrackets||t}function i(n){var i=r(n);if(!i||n.getOption("disableInput"))return e.Pass;for(var o=t(i,"pairs"),a=n.listSelections(),s=0;s=0;s--){var u=a[s].head;n.replaceRange("",d(u.line,u.ch-1),d(u.line,u.ch+1),"+delete")}}function o(n){var i=r(n),o=i&&t(i,"explode");if(!o||n.getOption("disableInput"))return e.Pass;for(var a=n.listSelections(),s=0;s0;return{anchor:new d(t.anchor.line,t.anchor.ch+(n?-1:1)),head:new d(t.head.line,t.head.ch+(n?1:-1))}}function s(n,i){var o=r(n);if(!o||n.getOption("disableInput"))return e.Pass;var s=t(o,"pairs"),c=s.indexOf(i);if(c==-1)return e.Pass;for(var f,p=t(o,"triples"),h=s.charAt(c+1)==i,m=n.listSelections(),g=c%2==0,v=0;v1&&p.indexOf(i)>=0&&n.getRange(d(k.line,k.ch-2),k)==i+i&&(k.ch<=2||n.getRange(d(k.line,k.ch-3),d(k.line,k.ch-2))!=i))y="addFour";else if(h){if(e.isWordChar(x)||!u(n,k,i))return e.Pass;y="both"}else{if(!g||n.getLine(k.line).length!=k.ch&&!l(x,s)&&!/\s/.test(x))return e.Pass;y="both"}else y=p.indexOf(i)>=0&&n.getRange(k,d(k.line,k.ch+3))==i+i+i?"skipThree":"skip";if(f){if(f!=y)return e.Pass}else f=y}var w=c%2?s.charAt(c-1):i,_=c%2?i:s.charAt(c+1);n.operation(function(){if("skip"==f)n.execCommand("goCharRight");else if("skipThree"==f)for(var e=0;e<3;e++)n.execCommand("goCharRight");else if("surround"==f){for(var t=n.getSelections(),e=0;e-1&&n%2==1}function c(e,t){var n=e.getRange(d(t.line,t.ch-1),d(t.line,t.ch+1));return 2==n.length?n:null}function u(t,n,r){var i=t.getLine(n.line),o=t.getTokenAt(n);if(/\bstring2?\b/.test(o.type))return!1;var a=new e.StringStream(i.slice(0,n.ch)+r+i.slice(n.ch),4);for(a.pos=a.start=o.start;;){var s=t.getMode().token(a,o.state);if(a.pos>=n.ch+1)return/\bstring2?\b/.test(s);a.start=a.pos}}var f={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},d=e.Pos;e.defineOption("autoCloseBrackets",!1,function(t,n,r){r&&r!=e.Init&&(t.removeKeyMap(h),t.state.closeBrackets=null),n&&(t.state.closeBrackets=n,t.addKeyMap(h))});for(var p=f.pairs+"`",h={Backspace:i,Enter:o},m=0;mc.ch&&(v=v.slice(0,v.length-u.end+c.ch));var y=v.toLowerCase();if(!v||"string"==u.type&&(u.end!=c.ch||!/[\"\']/.test(u.string.charAt(u.string.length-1))||1==u.string.length)||"tag"==u.type&&"closeTag"==d.type||u.string.indexOf("/")==u.string.length-1||m&&i(m,y)>-1||o(t,v,c,d,!0))return e.Pass;var b=g&&i(g,y)>-1;r[l]={indent:b,text:">"+(b?"\n\n":"")+"",newPos:b?e.Pos(c.line+1,0):e.Pos(c.line,c.ch+1)}}for(var l=n.length-1;l>=0;l--){var k=r[l];t.replaceRange(k.text,n[l].head,n[l].anchor,"+insert");var x=t.listSelections().slice(0);x[l]={head:k.newPos,anchor:k.newPos},t.setSelections(x),k.indent&&(t.indentLine(k.newPos.line,null,!0),t.indentLine(k.newPos.line+1,null,!0))}}function n(t,n){for(var r=t.listSelections(),i=[],a=n?"/":""!=t.getLine(l.line).charAt(c.end)&&(d+=">"),i[s]=d}t.replaceSelections(i),r=t.listSelections();for(var s=0;s'"]=function(e){return t(e)}),n.addKeyMap(a)}});var a=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],s=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];e.commands.closeTag=function(e){return n(e)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var t=/^(\s*)(>[> ]*|[*+-]\s|(\d+)([.)]))(\[\s\]\s|\[x\]\s|\s*)/,n=/^(\s*)(>[> ]*|[*+-]\s|(\d+)[.)])(\[\s\]\s*|\[x\]\s|\s*)$/,r=/[*+-]\s/;e.commands.newlineAndIndentContinueMarkdownList=function(i){if(i.getOption("disableInput"))return e.Pass;for(var o=i.listSelections(),a=[],s=0;s")>=0?p[2]:parseInt(p[3],10)+1+p[4];m=m.replace("[x]","[ ]"),a[s]="\n"+h+g+m}}i.replaceSelections(a)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){var t=e.search(i);return t==-1?0:t}function n(e,t,n){return/\bstring\b/.test(e.getTokenTypeAt(o(t.line,0)))&&!/^[\'\"`]/.test(n)}var r={},i=/[^\s\u00a0]/,o=e.Pos;e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension("toggleComment",function(e){e||(e=r);for(var t=this,n=1/0,i=this.listSelections(),a=null,s=i.length-1;s>=0;s--){var l=i[s].from(),c=i[s].to();l.line>=n||(c.line>=n&&(c=o(n,0)),n=l.line,null==a?t.uncomment(l,c,e)?a="un":(t.lineComment(l,c,e),a="line"):"un"==a?t.uncomment(l,c,e):t.lineComment(l,c,e))}}),e.defineExtension("lineComment",function(e,a,s){s||(s=r);var l=this,c=l.getModeAt(e),u=l.getLine(e.line);if(null!=u&&!n(l,e,u)){var f=s.lineComment||c.lineComment;if(!f)return void((s.blockCommentStart||c.blockCommentStart)&&(s.fullLines=!0,l.blockComment(e,a,s)));var d=Math.min(0!=a.ch||a.line==e.line?a.line+1:a.line,l.lastLine()+1),p=null==s.padding?" ":s.padding,h=s.commentBlankLines||e.line==a.line;l.operation(function(){if(s.indent){for(var n=null,r=e.line;rc.length)&&(n=c)}for(var r=e.line;ru||a.operation(function(){if(0!=n.fullLines){var r=i.test(a.getLine(u));a.replaceRange(f+c,o(u)),a.replaceRange(l+f,o(e.line,0));var d=n.blockCommentLead||s.blockCommentLead;if(null!=d)for(var p=e.line+1;p<=u;++p)(p!=u||r)&&a.replaceRange(d+f,o(p,0))}else a.replaceRange(c,t),a.replaceRange(l,e)})}),e.defineExtension("uncomment",function(e,t,n){n||(n=r);var a,s=this,l=s.getModeAt(e),c=Math.min(0!=t.ch||t.line==e.line?t.line:t.line-1,s.lastLine()),u=Math.min(e.line,c),f=n.lineComment||l.lineComment,d=[],p=null==n.padding?" ":n.padding;e:if(f){for(var h=u;h<=c;++h){var m=s.getLine(h),g=m.indexOf(f);if(g>-1&&!/comment/.test(s.getTokenTypeAt(o(h,g+1)))&&(g=-1),g==-1&&(h!=c||h==u)&&i.test(m))break e;if(g>-1&&i.test(m.slice(0,g)))break e;d.push(m)}if(s.operation(function(){for(var e=u;e<=c;++e){var t=d[e-u],n=t.indexOf(f),r=n+f.length;n<0||(t.slice(r,r+p.length)==p&&(r+=p.length),a=!0,s.replaceRange("",o(e,n),o(e,r)))}}),a)return!0}var v=n.blockCommentStart||l.blockCommentStart,y=n.blockCommentEnd||l.blockCommentEnd;if(!v||!y)return!1;var b=n.blockCommentLead||l.blockCommentLead,k=s.getLine(u),x=c==u?k:s.getLine(c),w=k.indexOf(v),_=x.lastIndexOf(y);if(_==-1&&u!=c&&(x=s.getLine(--c),_=x.lastIndexOf(y)),w==-1||_==-1||!/comment/.test(s.getTokenTypeAt(o(u,w+1)))||!/comment/.test(s.getTokenTypeAt(o(c,_+1))))return!1;var C=k.lastIndexOf(v,e.ch),S=C==-1?-1:k.slice(0,e.ch).indexOf(y,C+v.length);if(C!=-1&&S!=-1&&S+y.length!=e.ch)return!1;S=x.indexOf(y,t.ch);var M=x.slice(t.ch).lastIndexOf(v,S-t.ch);return C=S==-1||M==-1?-1:t.ch+M,(S==-1||C==-1||C==t.ch)&&(s.operation(function(){s.replaceRange("",o(c,_-(p&&x.slice(_-p.length,_)==p?p.length:0)),o(c,_+y.length));var e=w+v.length;if(p&&k.slice(e,e+p.length)==p&&(e+=p.length),s.replaceRange("",o(u,w),o(u,e)),b)for(var t=u+1;t<=c;++t){var n=s.getLine(t),r=n.indexOf(b);if(r!=-1&&!i.test(n.slice(0,r))){var a=r+b.length;p&&n.slice(a,a+p.length)==p&&(a+=p.length),s.replaceRange("",o(t,r),o(t,a))}}}),!0)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(t){if(t.getOption("disableInput"))return e.Pass;for(var r,i=t.listSelections(),o=[],a=0;a=d);else if(0==l.string.indexOf(r.blockCommentStart)){if(u=p.slice(0,l.start),!/^\s*$/.test(u)){u="";for(var h=0;hl.start&&/^\s*$/.test(p.slice(0,f))&&(u=p.slice(0,f));null!=u&&(u+=r.blockCommentContinue)}if(null==u&&r.lineComment&&n(t)){var m=t.getLine(s.line),f=m.indexOf(r.lineComment);f>-1&&(u=m.slice(0,f),/\S/.test(u)?u=null:u+=r.lineComment+m.slice(f+r.lineComment.length).match(/^\s*/)[0])}if(null==u)return e.Pass;o[a]="\n"+u}t.operation(function(){for(var e=i.length-1;e>=0;e--)t.replaceRange(o[e],i[e].from(),i[e].to(),"+insert")})}function n(e){var t=e.getOption("continueComments");return!t||"object"!=typeof t||t.continueLineComment!==!1}for(var r=["clike","css","javascript"],i=0;io;--i){var a=e.getLine(i);if(r&&r.test(a))break;if(!/\S/.test(a)){++i;break}}for(var s=n.paragraphEnd||e.getHelper(t,"paragraphEnd"),l=t.line+1,c=e.lastLine();l<=c;++l){var a=e.getLine(l);if(s&&s.test(a)){++l;break}if(!/\S/.test(a))break}return{from:i,to:l}}function n(e,t,n,r){for(var i=t;i0&&!n.test(e.slice(i-1,i+1));--i);for(var o=!0;;o=!1){var a=i;if(r)for(;" "==e.charAt(a-1);)--a;if(0!=a||!o)return{from:a,to:i};i=t}}function r(t,r,o,a){r=t.clipPos(r),o=t.clipPos(o);var s=a.column||80,l=a.wrapOn||/\s\S|-[^\.\d]/,c=a.killTrailingSpace!==!1,u=[],f="",d=r.line,p=t.getRange(r,o,!1);if(!p.length)return null;for(var h=p[0].match(/^[ \t]*/)[0],m=0;ms&&h==b&&n(f,s,l,c);k&&k.from==v&&k.to==v+y?(f=h+g,++d):u.push({text:[y?" ":""],from:i(d,v),to:i(d+1,b.length)})}for(;f.length>s;){var x=n(f,s,l,c);u.push({text:["",h],from:i(d,x.from),to:i(d,x.to)}),f=h+f.slice(x.to),++d}}return u.length&&t.operation(function(){for(var n=0;n=0;a--){var s,l=n[a];if(l.empty()){var c=t(e,l.head,{});s={from:i(c.from,0),to:i(c.to-1)}}else s={from:l.from(),to:l.to()};s.to.line>=o||(o=s.from.line,r(e,s.from,s.to,{}))}})},e.defineExtension("wrapRange",function(e,t,n){return r(this,e,t,n||{})}),e.defineExtension("wrapParagraphsInRange",function(e,n,o){o=o||{};for(var a=this,s=[],l=e.line;l<=n.line;){var c=t(a,i(l,0),o);s.push(c),l=c.to}var u=!1;return s.length&&a.operation(function(){for(var e=s.length-1;e>=0;--e)u=u||r(a,i(s[e].from,0),i(s[e].to-1),o)}),u})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(t,i,o,a){function s(e){var n=l(t,i);if(!n||n.to.line-n.from.linet.firstLine();)i=e.Pos(i.line-1,0),u=s(!1);if(u&&!u.cleared&&"unfold"!==a){var f=n(t,o);e.on(f,"mousedown",function(t){d.clear(),e.e_preventDefault(t)});var d=t.markText(u.from,u.to,{replacedWith:f,clearOnEnter:r(t,o,"clearOnEnter"),__isFold:!0});d.on("clear",function(n,r){e.signal(t,"unfold",t,n,r)}),e.signal(t,"fold",t,u.from,u.to)}}function n(e,t){var n=r(e,t,"widget");if("string"==typeof n){var i=document.createTextNode(n);n=document.createElement("span"),n.appendChild(i),n.className="CodeMirror-foldmarker"}return n}function r(e,t,n){if(t&&void 0!==t[n])return t[n];var r=e.options.foldOptions;return r&&void 0!==r[n]?r[n]:i[n]}e.newFoldFunction=function(e,n){return function(r,i){t(r,i,{rangeFinder:e,widget:n})}},e.defineExtension("foldCode",function(e,n,r){t(this,e,n,r)}),e.defineExtension("isFolded",function(e){for(var t=this.findMarksAt(e),n=0;nt.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));if(/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"keyword"!=r.type||"import"!=r.string)return null;for(var i=n,o=Math.min(t.lastLine(),n+10);i<=o;++i){var a=t.getLine(i),s=a.indexOf(";");if(s!=-1)return{startCh:r.end,end:e.Pos(i,s)}}}var i,o=n.line,a=r(o);if(!a||r(o-1)||(i=r(o-2))&&i.end.line==o-1)return null;for(var s=a.end;;){var l=r(s.line+1);if(null==l)break;s=l.end}return{from:t.clipPos(e.Pos(o,a.startCh+1)),to:s}}),e.registerHelper("fold","include",function(t,n){function r(n){if(nt.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));return/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"meta"==r.type&&"#include"==r.string.slice(0,8)?r.start+8:void 0}var i=n.line,o=r(i);if(null==o||null!=r(i-1))return null;for(var a=i;;){var s=r(a+1);if(null==s)break;++a}return{from:e.Pos(i,o+1),to:t.clipPos(e.Pos(a))}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./foldcode")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./foldcode"],e):e(CodeMirror)}(function(e){"use strict";function t(e){this.options=e,this.from=this.to=0}function n(e){return e===!0&&(e={}),null==e.gutter&&(e.gutter="CodeMirror-foldgutter"),null==e.indicatorOpen&&(e.indicatorOpen="CodeMirror-foldgutter-open"),null==e.indicatorFolded&&(e.indicatorFolded="CodeMirror-foldgutter-folded"),e}function r(e,t){for(var n=e.findMarks(f(t,0),f(t+1,0)),r=0;r=s&&(n=i(o.indicatorOpen))}e.setGutterMarker(t,o.gutter,n),++a})}function a(e){var t=e.getViewport(),n=e.state.foldGutter;n&&(e.operation(function(){o(e,t.from,t.to)}),n.from=t.from,n.to=t.to)}function s(e,t,n){var i=e.state.foldGutter;if(i){var o=i.options;if(n==o.gutter){var a=r(e,t);a?a.clear():e.foldCode(f(t,0),o.rangeFinder)}}}function l(e){var t=e.state.foldGutter;if(t){var n=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){a(e)},n.foldOnChangeTimeSpan||600)}}function c(e){var t=e.state.foldGutter;if(t){var n=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){var n=e.getViewport();t.from==t.to||n.from-t.to>20||t.from-n.to>20?a(e):e.operation(function(){n.fromt.to&&(o(e,t.to,n.to),t.to=n.to)})},n.updateViewportTimeSpan||400)}}function u(e,t){var n=e.state.foldGutter;if(n){var r=t.line;r>=n.from&&r=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function o(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function a(e){for(;;){var t=e.text.indexOf(">",e.ch);if(t==-1){if(i(e))continue;return}{if(r(e,t+1)){var n=e.text.lastIndexOf("/",t),o=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,o?"selfClose":"regular"}e.ch=t+1}}}function s(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(t==-1){if(o(e))continue;return}if(r(e,t+1)){m.lastIndex=t,e.ch=t;var n=m.exec(e.text);if(n&&n.index==t)return n}else e.ch=t}}function l(e){for(;;){m.lastIndex=e.ch;var t=m.exec(e.text);if(!t){if(i(e))continue;return}{if(r(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}}function c(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(t==-1){if(o(e))continue;return}{if(r(e,t+1)){var n=e.text.lastIndexOf("/",t),i=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,i?"selfClose":"regular"}e.ch=t}}}function u(e,t){for(var n=[];;){var r,i=l(e),o=e.line,s=e.ch-(i?i[0].length:0);if(!i||!(r=a(e)))return;if("selfClose"!=r)if(i[1]){for(var c=n.length-1;c>=0;--c)if(n[c]==i[2]){n.length=c;break}if(c<0&&(!t||t==i[2]))return{tag:i[2],from:d(o,s),to:d(e.line,e.ch)}}else n.push(i[2])}}function f(e,t){for(var n=[];;){var r=c(e);if(!r)return;if("selfClose"!=r){var i=e.line,o=e.ch,a=s(e);if(!a)return;if(a[1])n.push(a[2]);else{for(var l=n.length-1;l>=0;--l)if(n[l]==a[2]){n.length=l;break}if(l<0&&(!t||t==a[2]))return{tag:a[2],from:d(e.line,e.ch),to:d(i,o)}}}else s(e)}}var d=e.Pos,p="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",h=p+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",m=new RegExp("<(/?)(["+p+"]["+h+"]*)","g");e.registerHelper("fold","xml",function(e,t){for(var r=new n(e,t.line,0);;){var i,o=l(r);if(!o||r.line!=t.line||!(i=a(r)))return;if(!o[1]&&"selfClose"!=i){var s=d(r.line,r.ch),c=u(r,o[2]);return c&&{from:s,to:c.from}}}}),e.findMatchingTag=function(e,r,i){var o=new n(e,r.line,r.ch,i);if(o.text.indexOf(">")!=-1||o.text.indexOf("<")!=-1){var l=a(o),c=l&&d(o.line,o.ch),p=l&&s(o);if(l&&p&&!(t(o,r)>0)){var h={from:d(o.line,o.ch),to:c,tag:p[2]};return"selfClose"==l?{open:h,close:null,at:"open"}:p[1]?{open:f(o,p[2]),close:h,at:"close"}:(o=new n(e,c.line,c.ch,i),{open:h,close:u(o,p[2]),at:"open"})}}},e.findEnclosingTag=function(e,t,r){for(var i=new n(e,t.line,t.ch,r);;){var o=f(i);if(!o)break;var a=new n(e,t.line,t.ch,r),s=u(a,o.tag);if(s)return{open:o,close:s}}},e.scanForClosingTag=function(e,t,r,i){var o=new n(e,t.line,t.ch,i?{from:0,to:i}:null);return u(o,r)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1};e.defineMode("xml",function(r,i){function o(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();if("<"==r)return e.eat("!")?e.eat("[")?e.match("CDATA[")?n(l("atom","]]>")):null:e.match("--")?n(l("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(c(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=l("meta","?>"),"meta"):(M=e.eat("/")?"closeTag":"openTag",t.tokenize=a,"tag bracket");if("&"==r){var i;return i=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"), -i?"atom":"error"}return e.eatWhile(/[^&<]/),null}function a(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=o,M=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return M="equals",null;if("<"==n){t.tokenize=o,t.state=p,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=s(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function s(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=a;break}return"string"};return t.isInAttribute=!0,t}function l(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=o;break}n.next()}return e}}function c(e){return function(t,n){for(var r;null!=(r=t.next());){if("<"==r)return n.tokenize=c(e+1),n.tokenize(t,n);if(">"==r){if(1==e){n.tokenize=o;break}return n.tokenize=c(e-1),n.tokenize(t,n)}}return"meta"}}function u(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(_.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function f(e){e.context&&(e.context=e.context.prev)}function d(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!_.contextGrabbers.hasOwnProperty(n)||!_.contextGrabbers[n].hasOwnProperty(t))return;f(e)}}function p(e,t,n){return"openTag"==e?(n.tagStart=t.column(),h):"closeTag"==e?m:p}function h(e,t,n){return"word"==e?(n.tagName=t.current(),L="tag",y):(L="error",h)}function m(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&_.implicitlyClosed.hasOwnProperty(n.context.tagName)&&f(n),n.context&&n.context.tagName==r||_.matchClosing===!1?(L="tag",g):(L="tag error",v)}return L="error",v}function g(e,t,n){return"endTag"!=e?(L="error",g):(f(n),p)}function v(e,t,n){return L="error",g(e,t,n)}function y(e,t,n){if("word"==e)return L="attribute",b;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||_.autoSelfClosers.hasOwnProperty(r)?d(n,r):(d(n,r),n.context=new u(n,r,i==n.indented)),p}return L="error",y}function b(e,t,n){return"equals"==e?k:(_.allowMissing||(L="error"),y(e,t,n))}function k(e,t,n){return"string"==e?x:"word"==e&&_.allowUnquoted?(L="string",y):(L="error",y(e,t,n))}function x(e,t,n){return"string"==e?x:y(e,t,n)}var w=r.indentUnit,_={},C=i.htmlMode?t:n;for(var S in C)_[S]=C[S];for(var S in i)_[S]=i[S];var M,L;return o.isInText=!0,{startState:function(e){var t={tokenize:o,state:p,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;M=null;var n=t.tokenize(e,t);return(n||M)&&"comment"!=n&&(L=null,t.state=t.state(M||n,e,t),L&&(n="error"==L?n+" error":L)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+w;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=a&&t.tokenize!=o)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return _.multilineTagIndentPastTag!==!1?t.tagStart+t.tagName.length+2:t.tagStart+w*(_.multilineTagIndentFactor||1);if(_.alignCDATA&&/$/,blockCommentStart:"",configuration:_.htmlMode?"html":"xml",helperType:_.htmlMode?"html":"xml",skipAttribute:function(e){e.state==k&&(e.state=y)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../meta")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../meta"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("markdown",function(t,n){function r(n){if(e.findModeByName){var r=e.findModeByName(n);r&&(n=r.mime||r.mimes[0])}var i=e.getMode(t,n);return"null"==i.name?null:i}function i(e,t,n){return t.f=t.inline=n,n(e,t)}function o(e,t,n){return t.f=t.block=n,n(e,t)}function a(e){return!e||!/\S/.test(e.string)}function s(e){return e.linkTitle=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,e.indentedCode=!1,w&&e.f==c&&(e.f=h,e.block=l),e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.prevLine=e.thisLine,e.thisLine=null,null}function l(t,o){var s=t.sol(),l=o.list!==!1,c=o.indentedCode;o.indentedCode=!1,l&&(o.indentationDiff>=0?(o.indentationDiff<4&&(o.indentation-=o.indentationDiff),o.list=null):o.indentation>0?o.list=null:o.list=!1);var f=null;if(o.indentationDiff>=4)return t.skipToEnd(),c||a(o.prevLine)?(o.indentation-=4,o.indentedCode=!0,_.code):null;if(t.eatSpace())return null;if((f=t.match(A))&&f[1].length<=6)return o.header=f[1].length,n.highlightFormatting&&(o.formatting="header"),o.f=o.inline,d(o);if(!(a(o.prevLine)||o.quote||l||c)&&(f=t.match(E)))return o.header="="==f[0].charAt(0)?1:2,n.highlightFormatting&&(o.formatting="header"),o.f=o.inline,d(o);if(t.eat(">"))return o.quote=s?1:o.quote+1,n.highlightFormatting&&(o.formatting="quote"),t.eatSpace(),d(o);if("["===t.peek())return i(t,o,y);if(t.match(S,!0))return o.hr=!0,_.hr;if((a(o.prevLine)||l)&&(t.match(M,!1)||t.match(L,!1))){var p=null;for(t.match(M,!0)?p="ul":(t.match(L,!0),p="ol"),o.indentation=t.column()+t.current().length,o.list=!0;o.listStack&&t.column()")>-1)&&(n.f=h,n.block=l,n.htmlState=null)}return r}function u(e,t){return t.fencedChars&&e.match(t.fencedChars,!1)?(t.localMode=t.localState=null,t.f=t.block=f,null):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),_.code)}function f(e,t){e.match(t.fencedChars),t.block=l,t.f=h,t.fencedChars=null,n.highlightFormatting&&(t.formatting="code-block"),t.code=1;var r=d(t);return t.code=0,r}function d(e){var t=[];if(e.formatting){t.push(_.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var r=0;r=e.quote?t.push(_.formatting+"-"+e.formatting[r]+"-"+e.quote):t.push("error"))}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref?t.push(_.linkHref,"url"):(e.strong&&t.push(_.strong),e.em&&t.push(_.em),e.strikethrough&&t.push(_.strikethrough),e.linkText&&t.push(_.linkText),e.code&&t.push(_.code),e.image&&t.push(_.image),e.imageAltText&&t.push(_.imageAltText,"link"),e.imageMarker&&t.push(_.imageMarker)),e.header&&t.push(_.header,_.header+"-"+e.header),e.quote&&(t.push(_.quote),!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(_.quote+"-"+e.quote):t.push(_.quote+"-"+n.maxBlockquoteDepth)),e.list!==!1){var i=(e.listStack.length-1)%3;i?1===i?t.push(_.list2):t.push(_.list3):t.push(_.list1)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function p(e,t){if(e.match(z,!0))return d(t)}function h(t,r){var i=r.text(t,r);if("undefined"!=typeof i)return i;if(r.list)return r.list=null,d(r);if(r.taskList){var a="x"!==t.match(T,!0)[1];return a?r.taskOpen=!0:r.taskClosed=!0,n.highlightFormatting&&(r.formatting="task"),r.taskList=!1,d(r)}if(r.taskOpen=!1,r.taskClosed=!1,r.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(r.formatting="header"),d(r);var s=t.sol(),l=t.next();if(r.linkTitle){r.linkTitle=!1;var u=l;"("===l&&(u=")"),u=(u+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var f="^\\s*(?:[^"+u+"\\\\]+|\\\\\\\\|\\\\.)"+u;if(t.match(new RegExp(f),!0))return _.linkHref}if("`"===l){var p=r.formatting;n.highlightFormatting&&(r.formatting="code"),t.eatWhile("`");var h=t.current().length;if(0==r.code)return r.code=h,d(r);if(h==r.code){var v=d(r);return r.code=0,v}return r.formatting=p,d(r)}if(r.code)return d(r);if("\\"===l&&(t.next(),n.highlightFormatting)){var y=d(r),b=_.formatting+"-escape";return y?y+" "+b:b}if("!"===l&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return r.imageMarker=!0,r.image=!0,n.highlightFormatting&&(r.formatting="image"),d(r);if("["===l&&r.imageMarker)return r.imageMarker=!1,r.imageAltText=!0,n.highlightFormatting&&(r.formatting="image"),d(r);if("]"===l&&r.imageAltText){n.highlightFormatting&&(r.formatting="image");var y=d(r);return r.imageAltText=!1,r.image=!1,r.inline=r.f=g,y}if("["===l&&t.match(/[^\]]*\](\(.*\)| ?\[.*?\])/,!1)&&!r.image)return r.linkText=!0,n.highlightFormatting&&(r.formatting="link"),d(r);if("]"===l&&r.linkText&&t.match(/\(.*?\)| ?\[.*?\]/,!1)){n.highlightFormatting&&(r.formatting="link");var y=d(r);return r.linkText=!1,r.inline=r.f=g,y}if("<"===l&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=m,n.highlightFormatting&&(r.formatting="link");var y=d(r);return y?y+=" ":y="",y+_.linkInline}if("<"===l&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=m,n.highlightFormatting&&(r.formatting="link");var y=d(r);return y?y+=" ":y="",y+_.linkEmail}if("<"===l&&t.match(/^(!--|\w)/,!1)){var k=t.string.indexOf(">",t.pos);if(k!=-1){var w=t.string.substring(t.start,k);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(w)&&(r.md_inside=!0)}return t.backUp(1),r.htmlState=e.startState(x),o(t,r,c)}if("<"===l&&t.match(/^\/\w*?>/))return r.md_inside=!1,"tag";var C=!1;if(!n.underscoresBreakWords&&"_"===l&&"_"!==t.peek()&&t.match(/(\w)/,!1)){var S=t.pos-2;if(S>=0){var M=t.string.charAt(S);"_"!==M&&M.match(/(\w)/,!1)&&(C=!0)}}if("*"===l||"_"===l&&!C)if(s&&" "===t.peek());else{if(r.strong===l&&t.eat(l)){n.highlightFormatting&&(r.formatting="strong");var v=d(r);return r.strong=!1,v}if(!r.strong&&t.eat(l))return r.strong=l,n.highlightFormatting&&(r.formatting="strong"),d(r);if(r.em===l){n.highlightFormatting&&(r.formatting="em");var v=d(r);return r.em=!1,v}if(!r.em)return r.em=l,n.highlightFormatting&&(r.formatting="em"),d(r)}else if(" "===l&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return d(r);t.backUp(1)}if(n.strikethrough)if("~"===l&&t.eatWhile(l)){if(r.strikethrough){n.highlightFormatting&&(r.formatting="strikethrough");var v=d(r);return r.strikethrough=!1,v}if(t.match(/^[^\s]/,!1))return r.strikethrough=!0,n.highlightFormatting&&(r.formatting="strikethrough"),d(r)}else if(" "===l&&t.match(/^~~/,!0)){if(" "===t.peek())return d(r);t.backUp(2)}return" "===l&&(t.match(/ +$/,!1)?r.trailingSpace++:r.trailingSpace&&(r.trailingSpaceNewLine=!0)),d(r)}function m(e,t){var r=e.next();if(">"===r){t.f=t.inline=h,n.highlightFormatting&&(t.formatting="link");var i=d(t);return i?i+=" ":i="",i+_.linkInline}return e.match(/^[^>]+/,!0),_.linkInline}function g(e,t){if(e.eatSpace())return null;var r=e.next();return"("===r||"["===r?(t.f=t.inline=v("("===r?")":"]",0),n.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,d(t)):"error"}function v(e){return function(t,r){var i=t.next();if(i===e){r.f=r.inline=h,n.highlightFormatting&&(r.formatting="link-string");var o=d(r);return r.linkHref=!1,o}return t.match(I[e]),r.linkHref=!0,d(r)}}function y(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=b,e.next(),n.highlightFormatting&&(t.formatting="link"),t.linkText=!0,d(t)):i(e,t,h)}function b(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=k,n.highlightFormatting&&(t.formatting="link");var r=d(t);return t.linkText=!1,r}return e.match(/^([^\]\\]|\\.)+/,!0),_.linkText}function k(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=h,_.linkHref+" url")}var x=e.getMode(t,"text/html"),w="null"==x.name;void 0===n.highlightFormatting&&(n.highlightFormatting=!1),void 0===n.maxBlockquoteDepth&&(n.maxBlockquoteDepth=0),void 0===n.underscoresBreakWords&&(n.underscoresBreakWords=!0),void 0===n.taskLists&&(n.taskLists=!1),void 0===n.strikethrough&&(n.strikethrough=!1),void 0===n.tokenTypeOverrides&&(n.tokenTypeOverrides={});var _={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough"};for(var C in _)_.hasOwnProperty(C)&&n.tokenTypeOverrides[C]&&(_[C]=n.tokenTypeOverrides[C]);var S=/^([*\-_])(?:\s*\1){2,}\s*$/,M=/^[*\-+]\s+/,L=/^[0-9]+([.)])\s+/,T=/^\[(x| )\](?=\s)/,A=n.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,E=/^ *(?:\={1,}|-{1,})\s*$/,z=/^[^#!\[\]*_\\<>` "'(~]+/,O=new RegExp("^("+(n.fencedCodeBlocks===!0?"~~~+|```+":n.fencedCodeBlocks)+")[ \\t]*([\\w+#-]*)"),I={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\\]]|\\.)*\])*?(?=\])/},N={startState:function(){return{f:l,prevLine:null,thisLine:null,block:l,htmlState:null,indentation:0,inline:h,text:p,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,fencedChars:null}},copyState:function(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&e.copyState(x,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkTitle:t.linkTitle,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,header:t.header,hr:t.hr,taskList:t.taskList,list:t.list,listStack:t.listStack.slice(0),quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedChars:t.fencedChars}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine){var n=t.header||t.hr;if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0)||n){if(s(t),!n)return null;t.prevLine=null}t.prevLine=t.thisLine,t.thisLine=e,t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.f=t.block;var r=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length;if(t.indentationDiff=Math.min(r-t.indentation,4),t.indentation=t.indentation+t.indentationDiff,r>0)return null}return t.f(e,t)},innerMode:function(e){return e.block==c?{state:e.htmlState,mode:x}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:N}},blankLine:s,getType:d,fold:"markdown"};return N},"xml"),e.defineMIME("text/x-markdown","markdown")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../markdown/markdown"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],e):e(CodeMirror)}(function(e){"use strict";var t=/^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i;e.defineMode("gfm",function(n,r){function i(e){return e.code=!1,null}var o=0,a={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(e){return{code:e.code,codeBlock:e.codeBlock,ateSpace:e.ateSpace}},token:function(e,n){if(n.combineTokens=null,n.codeBlock)return e.match(/^```+/)?(n.codeBlock=!1,null):(e.skipToEnd(),null);if(e.sol()&&(n.code=!1),e.sol()&&e.match(/^```+/))return e.skipToEnd(),n.codeBlock=!0,null;if("`"===e.peek()){e.next();var i=e.pos;e.eatWhile("`");var a=1+e.pos-i;return n.code?a===o&&(n.code=!1):(o=a,n.code=!0),null}if(n.code)return e.next(),null;if(e.eatSpace())return n.ateSpace=!0,null;if((e.sol()||n.ateSpace)&&(n.ateSpace=!1,r.gitHubSpice!==!1)){if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/))return n.combineTokens=!0,"link";if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return n.combineTokens=!0,"link"}return e.match(t)&&"]("!=e.string.slice(e.start-2,e.start)&&(0==e.start||/\W/.test(e.string.charAt(e.start-1)))?(n.combineTokens=!0,"link"):(e.next(),null)},blankLine:i},s={underscoresBreakWords:!1,taskLists:!0,fencedCodeBlocks:"```",strikethrough:!0};for(var l in r)s[l]=r[l];return s.name="markdown",e.overlayMode(e.getMode(n,s),a)},"markdown"),e.defineMIME("text/x-gfm","gfm")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n){return/^(?:operator|sof|keyword c|case|new|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}e.defineMode("javascript",function(n,r){function i(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}function o(e,t,n){return be=e,ke=n,t}function a(e,n){var r=e.next();if('"'==r||"'"==r)return n.tokenize=s(r),n.tokenize(e,n);if("."==r&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return o("number","number");if("."==r&&e.match(".."))return o("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return o(r);if("="==r&&e.eat(">"))return o("=>","operator");if("0"==r&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),o("number","number");if("0"==r&&e.eat(/o/i))return e.eatWhile(/[0-7]/i),o("number","number");if("0"==r&&e.eat(/b/i))return e.eatWhile(/[01]/i),o("number","number");if(/\d/.test(r))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),o("number","number");if("/"==r)return e.eat("*")?(n.tokenize=l,l(e,n)):e.eat("/")?(e.skipToEnd(),o("comment","comment")):t(e,n,1)?(i(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),o("regexp","string-2")):(e.eatWhile(Te),o("operator","operator",e.current()));if("`"==r)return n.tokenize=c,c(e,n);if("#"==r)return e.skipToEnd(),o("error","error");if(Te.test(r))return e.eatWhile(Te),o("operator","operator",e.current());if(Me.test(r)){e.eatWhile(Me);var a=e.current(),u=Le.propertyIsEnumerable(a)&&Le[a];return u&&"."!=n.lastType?o(u.type,u.style,a):o("variable","variable",a)}}function s(e){return function(t,n){var r,i=!1;if(_e&&"@"==t.peek()&&t.match(Ae))return n.tokenize=a,o("jsonld-keyword","meta");for(;null!=(r=t.next())&&(r!=e||i);)i=!i&&"\\"==r;return i||(n.tokenize=a),o("string","string")}}function l(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=a;break}r="*"==n}return o("comment","comment")}function c(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=a;break}r=!r&&"\\"==n}return o("quasi","string-2",e.current())}function u(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(n<0)){for(var r=0,i=!1,o=n-1;o>=0;--o){var a=e.string.charAt(o),s=Ee.indexOf(a);if(s>=0&&s<3){if(!r){++o;break}if(0==--r){"("==a&&(i=!0);break}}else if(s>=3&&s<6)++r;else if(Me.test(a))i=!0;else{if(/["'\/]/.test(a))return;if(i&&!r){++o;break}}}i&&!r&&(t.fatArrowAt=o)}}function f(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function d(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(var n=r.vars;n;n=n.next)if(n.name==t)return!0}function p(e,t,n,r,i){var o=e.cc;for(Oe.state=e,Oe.stream=i,Oe.marked=null,Oe.cc=o,Oe.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var a=o.length?o.pop():Ce?_:w;if(a(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return Oe.marked?Oe.marked:"variable"==n&&d(e,r)?"variable-2":t}}}function h(){for(var e=arguments.length-1;e>=0;e--)Oe.cc.push(arguments[e])}function m(){return h.apply(null,arguments),!0}function g(e){function t(t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}var n=Oe.state;if(Oe.marked="def",n.context){if(t(n.localVars))return;n.localVars={name:e,next:n.localVars}}else{if(t(n.globalVars))return;r.globalVars&&(n.globalVars={name:e,next:n.globalVars})}}function v(){Oe.state.context={prev:Oe.state.context,vars:Oe.state.localVars},Oe.state.localVars=Ie}function y(){Oe.state.localVars=Oe.state.context.vars,Oe.state.context=Oe.state.context.prev}function b(e,t){var n=function(){var n=Oe.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new f(r,Oe.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function k(){var e=Oe.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function x(e){function t(n){return n==e?m():";"==e?h():m(t)}return t}function w(e,t){return"var"==e?m(b("vardef",t.length),X,x(";"),k):"keyword a"==e?m(b("form"),_,w,k):"keyword b"==e?m(b("form"),w,k):"{"==e?m(b("}"),$,k):";"==e?m():"if"==e?("else"==Oe.state.lexical.info&&Oe.state.cc[Oe.state.cc.length-1]==k&&Oe.state.cc.pop()(),m(b("form"),_,w,k,ee)):"function"==e?m(ae):"for"==e?m(b("form"),te,w,k):"variable"==e?m(b("stat"),R):"switch"==e?m(b("form"),_,b("}","switch"),x("{"),$,k,k):"case"==e?m(_,x(":")):"default"==e?m(x(":")):"catch"==e?m(b("form"),v,x("("),se,x(")"),w,k,y):"class"==e?m(b("form"),le,k):"export"==e?m(b("stat"),de,k):"import"==e?m(b("stat"),pe,k):"module"==e?m(b("form"),Z,b("}"),x("{"),$,k,k):"async"==e?m(w):h(b("stat"),_,x(";"),k)}function _(e){return S(e,!1)}function C(e){return S(e,!0)}function S(e,t){if(Oe.state.fatArrowAt==Oe.stream.start){var n=t?I:O;if("("==e)return m(v,b(")"),F(Z,")"),k,x("=>"),n,y);if("variable"==e)return h(v,Z,x("=>"),n,y)}var r=t?A:T;return ze.hasOwnProperty(e)?m(r):"function"==e?m(ae,r):"keyword c"==e||"async"==e?m(t?L:M):"("==e?m(b(")"),M,x(")"),k,r):"operator"==e||"spread"==e?m(t?C:_):"["==e?m(b("]"),ve,k,r):"{"==e?H(D,"}",null,r):"quasi"==e?h(E,r):"new"==e?m(N(t)):m()}function M(e){return e.match(/[;\}\)\],]/)?h():h(_)}function L(e){return e.match(/[;\}\)\],]/)?h():h(C)}function T(e,t){return","==e?m(_):A(e,t,!1)}function A(e,t,n){var r=0==n?T:A,i=0==n?_:C;return"=>"==e?m(v,n?I:O,y):"operator"==e?/\+\+|--/.test(t)?m(r):"?"==t?m(_,x(":"),i):m(i):"quasi"==e?h(E,r):";"!=e?"("==e?H(C,")","call",r):"."==e?m(j,r):"["==e?m(b("]"),M,x("]"),k,r):void 0:void 0}function E(e,t){return"quasi"!=e?h():"${"!=t.slice(t.length-2)?m(E):m(_,z)}function z(e){if("}"==e)return Oe.marked="string-2",Oe.state.tokenize=c,m(E)}function O(e){return u(Oe.stream,Oe.state),h("{"==e?w:_)}function I(e){return u(Oe.stream,Oe.state),h("{"==e?w:C)}function N(e){return function(t){return"."==t?m(e?P:q):h(e?C:_)}}function q(e,t){if("target"==t)return Oe.marked="keyword",m(T)}function P(e,t){if("target"==t)return Oe.marked="keyword",m(A)}function R(e){return":"==e?m(k,w):h(T,x(";"),k)}function j(e){if("variable"==e)return Oe.marked="property",m()}function D(e,t){return"async"==e?m(D):"variable"==e||"keyword"==Oe.style?(Oe.marked="property",m("get"==t||"set"==t?W:B)):"number"==e||"string"==e?(Oe.marked=_e?"property":Oe.style+" property",m(B)):"jsonld-keyword"==e?m(B):"modifier"==e?m(D):"["==e?m(_,x("]"),B):"spread"==e?m(_):void 0}function W(e){return"variable"!=e?h(B):(Oe.marked="property",m(ae))}function B(e){return":"==e?m(C):"("==e?h(ae):void 0}function F(e,t){function n(r,i){if(","==r){var o=Oe.state.lexical;return"call"==o.info&&(o.pos=(o.pos||0)+1),m(function(n,r){return n==t||r==t?h():h(e)},n)}return r==t||i==t?m():m(x(t))}return function(r,i){return r==t||i==t?m():h(e,n)}}function H(e,t,n){for(var r=3;r"),G):"["==e?m(x("]"),G):void 0}function X(){return h(Z,U,Q,J)}function Z(e,t){return"modifier"==e?m(Z):"variable"==e?(g(t),m()):"spread"==e?m(Z):"["==e?H(Z,"]"):"{"==e?H(Y,"}"):void 0}function Y(e,t){return"variable"!=e||Oe.stream.match(/^\s*:/,!1)?("variable"==e&&(Oe.marked="property"),"spread"==e?m(Z):"}"==e?h():m(x(":"),Z,Q)):(g(t),m(Q))}function Q(e,t){if("="==t)return m(C)}function J(e){if(","==e)return m(X)}function ee(e,t){if("keyword b"==e&&"else"==t)return m(b("form","else"),w,k)}function te(e){if("("==e)return m(b(")"),ne,x(")"),k)}function ne(e){return"var"==e?m(X,x(";"),ie):";"==e?m(ie):"variable"==e?m(re):h(_,x(";"),ie)}function re(e,t){return"in"==t||"of"==t?(Oe.marked="keyword",m(_)):m(T,ie)}function ie(e,t){return";"==e?m(oe):"in"==t||"of"==t?(Oe.marked="keyword",m(_)):h(_,x(";"),oe)}function oe(e){")"!=e&&m(_)}function ae(e,t){return"*"==t?(Oe.marked="keyword",m(ae)):"variable"==e?(g(t),m(ae)):"("==e?m(v,b(")"),F(se,")"),k,U,w,y):void 0}function se(e){return"spread"==e?m(se):h(Z,U,K)}function le(e,t){if("variable"==e)return g(t),m(ce)}function ce(e,t){return"extends"==t?m(_,ce):"{"==e?m(b("}"),ue,k):void 0}function ue(e,t){return"variable"==e||"keyword"==Oe.style?"static"==t?(Oe.marked="keyword",m(ue)):(Oe.marked="property","get"==t||"set"==t?m(fe,ae,ue):m(ae,ue)):"*"==t?(Oe.marked="keyword",m(ue)):";"==e?m(ue):"}"==e?m():void 0}function fe(e){return"variable"!=e?h():(Oe.marked="property",m())}function de(e,t){return"*"==t?(Oe.marked="keyword",m(ge,x(";"))):"default"==t?(Oe.marked="keyword",m(_,x(";"))):h(w)}function pe(e){return"string"==e?m():h(he,ge)}function he(e,t){return"{"==e?H(he,"}"):("variable"==e&&g(t),"*"==t&&(Oe.marked="keyword"),m(me))}function me(e,t){if("as"==t)return Oe.marked="keyword",m(he)}function ge(e,t){if("from"==t)return Oe.marked="keyword",m(_)}function ve(e){return"]"==e?m():h(F(C,"]"))}function ye(e,t){return"operator"==e.lastType||","==e.lastType||Te.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}var be,ke,xe=n.indentUnit,we=r.statementIndent,_e=r.jsonld,Ce=r.json||_e,Se=r.typescript,Me=r.wordCharacters||/[\w$\xa1-\uffff]/,Le=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("operator"),o={type:"atom",style:"atom"},a={"if":e("if"),"while":t,"with":t,"else":n,"do":n,"try":n,"finally":n,"return":r,"break":r,"continue":r,"new":e("new"),"delete":r,"throw":r,"debugger":r,"var":e("var"),"const":e("var"),"let":e("var"),"function":e("function"),"catch":e("catch"),"for":e("for"),"switch":e("switch"),"case":e("case"),"default":e("default"),"in":i,"typeof":i,"instanceof":i,"true":o,"false":o,"null":o,undefined:o,NaN:o,Infinity:o,"this":e("this"),"class":e("class"),"super":e("atom"),"yield":r,"export":e("export"),"import":e("import"),"extends":r,await:r,async:e("async")};if(Se){var s={type:"variable",style:"variable-3"},l={"interface":e("class"),"implements":r,namespace:r,module:e("module"),"enum":e("module"),"public":e("modifier"),"private":e("modifier"),"protected":e("modifier"),"abstract":e("modifier"),as:i,string:s,number:s,"boolean":s,any:s};for(var c in l)a[c]=l[c]}return a}(),Te=/[+\-*&%=<>!?|~^]/,Ae=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Ee="([{}])",ze={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},Oe={state:null,column:null,marked:null,cc:null},Ie={name:"this",next:{name:"arguments"}};return k.lex=!0,{startState:function(e){var t={tokenize:a,lastType:"sof",cc:[],lexical:new f((e||0)-xe,0,"block",(!1)),localVars:r.localVars,context:r.localVars&&{vars:r.localVars},indented:e||0};return r.globalVars&&"object"==typeof r.globalVars&&(t.globalVars=r.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),u(e,t)),t.tokenize!=l&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==be?n:(t.lastType="operator"!=be||"++"!=ke&&"--"!=ke?be:"incdec",p(t,n,be,ke,e))},indent:function(t,n){if(t.tokenize==l)return e.Pass;if(t.tokenize!=a)return 0;var i=n&&n.charAt(0),o=t.lexical;if(!/^\s*else\b/.test(n))for(var s=t.cc.length-1;s>=0;--s){var c=t.cc[s];if(c==k)o=o.prev;else if(c!=ee)break}"stat"==o.type&&"}"==i&&(o=o.prev),we&&")"==o.type&&"stat"==o.prev.type&&(o=o.prev);var u=o.type,f=i==u;return"vardef"==u?o.indented+("operator"==t.lastType||","==t.lastType?o.info+1:0):"form"==u&&"{"==i?o.indented:"form"==u?o.indented+xe:"stat"==u?o.indented+(ye(t,n)?we||xe:0):"switch"!=o.info||f||0==r.doubleIndentSwitch?o.align?o.column+(f?0:1):o.indented+(f?0:xe):o.indented+(/^(?:case|default)\b/.test(n)?xe:2*xe)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Ce?null:"/*",blockCommentEnd:Ce?null:"*/",lineComment:Ce?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:Ce?"json":"javascript",jsonldMode:_e,jsonMode:Ce,expressionAllowed:t,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=_&&t!=C||e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},n=0;n*\/]/.test(n)?r(null,"select-op"):"."==n&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?r("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?r(null,n):"u"==n&&e.match(/rl(-prefix)?\(/)||"d"==n&&e.match("omain(")||"r"==n&&e.match("egexp(")?(e.backUp(1),t.tokenize=a,r("property","word")):/[\w\\\-]/.test(n)?(e.eatWhile(/[\w\\\-]/),r("property","word")):r(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),r("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?r("variable-2","variable-definition"):r("variable-2","variable")):e.match(/^\w+-/)?r("meta","meta"):void 0}function o(e){return function(t,n){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==i}return(i==e||!o&&")"!=e)&&(n.tokenize=null),r("string","string")}}function a(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=o(")"),r(null,"(")}function s(e,t,n){this.type=e,this.indent=t,this.prev=n}function l(e,t,n,r){return e.context=new s(n,t.indentation()+(r===!1?0:g),e.context),n}function c(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function u(e,t,n){return E[n.context.type](e,t,n)}function f(e,t,n,r){for(var i=r||1;i>0;i--)n.context=n.context.prev;return u(e,t,n)}function d(e){var t=e.current().toLowerCase();m=L.hasOwnProperty(t)?"atom":M.hasOwnProperty(t)?"keyword":"variable"}var p=n.inline;n.propertyKeywords||(n=e.resolveMode("text/css"));var h,m,g=t.indentUnit,v=n.tokenHooks,y=n.documentTypes||{},b=n.mediaTypes||{},k=n.mediaFeatures||{},x=n.mediaValueKeywords||{},w=n.propertyKeywords||{},_=n.nonStandardPropertyKeywords||{},C=n.fontProperties||{},S=n.counterDescriptors||{},M=n.colorKeywords||{},L=n.valueKeywords||{},T=n.allowNested,A=n.supportsAtComponent===!0,E={};return E.top=function(e,t,n){if("{"==e)return l(n,t,"block");if("}"==e&&n.context.prev)return c(n);if(A&&/@component/.test(e))return l(n,t,"atComponentBlock");if(/^@(-moz-)?document$/.test(e))return l(n,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/.test(e))return l(n,t,"atBlock");if(/^@(font-face|counter-style)/.test(e))return n.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return l(n,t,"at");if("hash"==e)m="builtin";else if("word"==e)m="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return l(n,t,"interpolation");if(":"==e)return"pseudo";if(T&&"("==e)return l(n,t,"parens")}return n.context.type},E.block=function(e,t,n){if("word"==e){var r=t.current().toLowerCase();return w.hasOwnProperty(r)?(m="property","maybeprop"):_.hasOwnProperty(r)?(m="string-2","maybeprop"):T?(m=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(m+=" error","maybeprop")}return"meta"==e?"block":T||"hash"!=e&&"qualifier"!=e?E.top(e,t,n):(m="error","block")},E.maybeprop=function(e,t,n){return":"==e?l(n,t,"prop"):u(e,t,n)},E.prop=function(e,t,n){if(";"==e)return c(n);if("{"==e&&T)return l(n,t,"propBlock");if("}"==e||"{"==e)return f(e,t,n);if("("==e)return l(n,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)d(t);else if("interpolation"==e)return l(n,t,"interpolation")}else m+=" error";return"prop"},E.propBlock=function(e,t,n){return"}"==e?c(n):"word"==e?(m="property","maybeprop"):n.context.type},E.parens=function(e,t,n){return"{"==e||"}"==e?f(e,t,n):")"==e?c(n):"("==e?l(n,t,"parens"):"interpolation"==e?l(n,t,"interpolation"):("word"==e&&d(t),"parens")},E.pseudo=function(e,t,n){return"word"==e?(m="variable-3",n.context.type):u(e,t,n)},E.documentTypes=function(e,t,n){return"word"==e&&y.hasOwnProperty(t.current())?(m="tag",n.context.type):E.atBlock(e,t,n)},E.atBlock=function(e,t,n){if("("==e)return l(n,t,"atBlock_parens");if("}"==e||";"==e)return f(e,t,n);if("{"==e)return c(n)&&l(n,t,T?"block":"top");if("interpolation"==e)return l(n,t,"interpolation");if("word"==e){var r=t.current().toLowerCase();m="only"==r||"not"==r||"and"==r||"or"==r?"keyword":b.hasOwnProperty(r)?"attribute":k.hasOwnProperty(r)?"property":x.hasOwnProperty(r)?"keyword":w.hasOwnProperty(r)?"property":_.hasOwnProperty(r)?"string-2":L.hasOwnProperty(r)?"atom":M.hasOwnProperty(r)?"keyword":"error"}return n.context.type},E.atComponentBlock=function(e,t,n){return"}"==e?f(e,t,n):"{"==e?c(n)&&l(n,t,T?"block":"top",!1):("word"==e&&(m="error"),n.context.type)},E.atBlock_parens=function(e,t,n){return")"==e?c(n):"{"==e||"}"==e?f(e,t,n,2):E.atBlock(e,t,n)},E.restricted_atBlock_before=function(e,t,n){return"{"==e?l(n,t,"restricted_atBlock"):"word"==e&&"@counter-style"==n.stateArg?(m="variable","restricted_atBlock_before"):u(e,t,n)},E.restricted_atBlock=function(e,t,n){return"}"==e?(n.stateArg=null,c(n)):"word"==e?(m="@font-face"==n.stateArg&&!C.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==n.stateArg&&!S.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},E.keyframes=function(e,t,n){return"word"==e?(m="variable","keyframes"):"{"==e?l(n,t,"top"):u(e,t,n)},E.at=function(e,t,n){return";"==e?c(n):"{"==e||"}"==e?f(e,t,n):("word"==e?m="tag":"hash"==e&&(m="builtin"),"at")},E.interpolation=function(e,t,n){return"}"==e?c(n):"{"==e||";"==e?f(e,t,n):("word"==e?m="variable":"variable"!=e&&"("!=e&&")"!=e&&(m="error"),"interpolation")},{startState:function(e){return{tokenize:null,state:p?"block":"top",stateArg:null,context:new s(p?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||i)(e,t);return n&&"object"==typeof n&&(h=n[1],n=n[0]),m=n,t.state=E[t.state](h,e,t),m},indent:function(e,t){var n=e.context,r=t&&t.charAt(0),i=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev),n.prev&&("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=r||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=r||"at"!=n.type&&"atBlock"!=n.type)||(i=Math.max(0,n.indent-g),n=n.prev):(n=n.prev,i=n.indent)),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}});var r=["domain","regexp","url","url-prefix"],i=t(r),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],a=t(o),s=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],l=t(s),c=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],u=t(c),f=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],d=t(f),p=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],h=t(p),m=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],g=t(m),v=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],y=t(v),b=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],k=t(b),x=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],w=t(x),_=r.concat(o).concat(s).concat(c).concat(f).concat(p).concat(b).concat(x);e.registerHelper("hintWords","css",_),e.defineMIME("text/css",{documentTypes:i,mediaTypes:a,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:d,nonStandardPropertyKeywords:h,fontProperties:g,counterDescriptors:y,colorKeywords:k,valueKeywords:w,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=n,n(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:a,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:d,nonStandardPropertyKeywords:h,colorKeywords:k,valueKeywords:w,fontProperties:g,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=n,n(e,t)):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/)&&[null,"{"]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:a,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:d,nonStandardPropertyKeywords:h,colorKeywords:k,valueKeywords:w,fontProperties:g,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=n,n(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:i,mediaTypes:a,mediaFeatures:l,propertyKeywords:d,nonStandardPropertyKeywords:h,fontProperties:g,counterDescriptors:y,colorKeywords:k,valueKeywords:w,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=n,n(e,t))}},name:"css",helperType:"gss"})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n){var r=e.current(),i=r.search(t);return i>-1?e.backUp(r.length-i):r.match(/<\/?$/)&&(e.backUp(r.length),e.match(t,!1)||e.match(r)),n}function n(e){var t=l[e];return t?t:l[e]=new RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")}function r(e,t){var r=e.match(n(t));return r?r[2]:""}function i(e,t){return new RegExp((t?"^":"")+"","i")}function o(e,t){for(var n in e)for(var r=t[n]||(t[n]=[]),i=e[n],o=i.length-1;o>=0;o--)r.unshift(i[o])}function a(e,t){for(var n=0;n\s\/]/.test(r.current())&&(s=o.htmlState.tagName&&o.htmlState.tagName.toLowerCase())&&u.hasOwnProperty(s))o.inTag=s+" ";else if(o.inTag&&d&&/>$/.test(r.current())){var p=/^([\S]+) (.*)/.exec(o.inTag);o.inTag=null;var h=">"==r.current()&&a(u[p[1]],p[2]),m=e.getMode(n,h),g=i(p[1],!0),v=i(p[1],!1);o.token=function(e,n){return e.match(g,!1)?(n.token=l,n.localState=n.localMode=null,null):t(e,v,n.localMode.token(e,n.localState))},o.localMode=m,o.localState=e.startState(m,c.indent(o.htmlState,""))}else o.inTag&&(o.inTag+=r.current(),r.eol()&&(o.inTag+=" "));return f}var c=e.getMode(n,{name:"xml",htmlMode:!0,multilineTagIndentFactor:r.multilineTagIndentFactor,multilineTagIndentPastTag:r.multilineTagIndentPastTag}),u={},f=r&&r.tags,d=r&&r.scriptTypes;if(o(s,u),f&&o(f,u),d)for(var p=d.length-1;p>=0;p--)u.script.unshift(["type",d[p].matches,d[p].mode]);return{startState:function(){var t=e.startState(c);return{token:l,inTag:null,localMode:null,localState:null,htmlState:t}},copyState:function(t){var n;return t.localState&&(n=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:n,htmlState:e.copyState(c,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,n){return!t.localMode||/^\s*<\//.test(n)?c.indent(t.htmlState,n):t.localMode.indent?t.localMode.indent(t.localState,n):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||c}}}},"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../../addon/mode/multiplex")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../../addon/mode/multiplex"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("htmlembedded",function(t,n){return e.multiplexingMode(e.getMode(t,"htmlmixed"),{open:n.open||n.scriptStartRegex||"<%",close:n.close||n.scriptEndRegex||"%>",mode:e.getMode(t,n.scriptingModeSpec)})},"htmlmixed"),e.defineMIME("application/x-ejs",{name:"htmlembedded",scriptingModeSpec:"javascript"}),e.defineMIME("application/x-aspx",{name:"htmlembedded",scriptingModeSpec:"text/x-csharp"}),e.defineMIME("application/x-jsp",{name:"htmlembedded",scriptingModeSpec:"text/x-java"}),e.defineMIME("application/x-erb",{name:"htmlembedded",scriptingModeSpec:"ruby"})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.info=r,this.align=i,this.prev=o}function n(e,n,r,i){var o=e.indented;return e.context&&"statement"!=e.context.type&&"statement"!=r&&(o=e.context.indented),e.context=new t(o,n,r,i,null,e.context)}function r(e){var t=e.context.type;return")"!=t&&"]"!=t&&"}"!=t||(e.indented=e.context.indented),e.context=e.context.prev}function i(e,t,n){return"variable"==t.prevToken||"variable-3"==t.prevToken||(!!/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(e.string.slice(0,n))||(!(!t.typeAtEndOfLine||e.column()!=e.indentation())||void 0))}function o(e){for(;;){if(!e||"top"==e.type)return!0;if("}"==e.type&&"namespace"!=e.prev.info)return!1;e=e.prev}}function a(e){for(var t={},n=e.split(" "),r=0;r!?|\/]/,I=l.endStatement||/^[;:,]$/;return{startState:function(e){return{tokenize:null,context:new t((e||0)-m,0,"top",null,(!1)),indented:0,startOfLine:!0,prevToken:null}},token:function(e,t){var a=t.context;if(e.sol()&&(null==a.align&&(a.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return d(e,t), -null;p=h=null;var s=(t.tokenize||c)(e,t);if("comment"==s||"meta"==s)return s;if(null==a.align&&(a.align=!0),I.test(p))for(;"statement"==t.context.type;)r(t);else if("{"==p)n(t,e.column(),"}");else if("["==p)n(t,e.column(),"]");else if("("==p)n(t,e.column(),")");else if("}"==p){for(;"statement"==a.type;)a=r(t);for("}"==a.type&&(a=r(t));"statement"==a.type;)a=r(t)}else p==a.type?r(t):M&&(("}"==a.type||"top"==a.type)&&";"!=p||"statement"==a.type&&"newstatement"==p)&&n(t,e.column(),"statement",e.current());if("variable"==s&&("def"==t.prevToken||l.typeFirstDefinitions&&i(e,t,e.start)&&o(t.context)&&e.match(/^\s*\(/,!1))&&(s="def"),C.token){var u=C.token(e,t,s);void 0!==u&&(s=u)}return"def"==s&&l.styleDefs===!1&&(s="variable"),t.startOfLine=!1,t.prevToken=h?"def":s||p,d(e,t),s},indent:function(t,n){if(t.tokenize!=c&&null!=t.tokenize||t.typeAtEndOfLine)return e.Pass;var r=t.context,i=n&&n.charAt(0);if("statement"==r.type&&"}"==i&&(r=r.prev),l.dontIndentStatements)for(;"statement"==r.type&&l.dontIndentStatements.test(r.info);)r=r.prev;if(C.indent){var o=C.indent(t,r,n);if("number"==typeof o)return o}var a=i==r.type,s=r.prev&&"switch"==r.prev.info;if(l.allmanIndentation&&/[{(]/.test(i)){for(;"top"!=r.type&&"}"!=r.type;)r=r.prev;return r.indented}return"statement"==r.type?r.indented+("{"==i?0:g):!r.align||v&&")"==r.type?")"!=r.type||a?r.indented+(a?0:m)+(a||!s||/^(?:case|default)\b/.test(n)?0:m):r.indented+g:r.column+(a?0:1)},electricInput:L?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});var b="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile",k="int long char short double float unsigned signed void size_t ptrdiff_t";m(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:a(b),types:a(k+" bool _Complex _Bool float_t double_t intptr_t intmax_t int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t uint32_t uint64_t"),blockKeywords:a("case do else for if switch while struct"),defKeywords:a("struct"),typeFirstDefinitions:!0,atoms:a("null true false"),hooks:{"#":l,"*":c},modeProps:{fold:["brace","include"]}}),m(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:a(b+" asm dynamic_cast namespace reinterpret_cast try explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override"),types:a(k+" bool wchar_t"),blockKeywords:a("catch class do else finally for if struct switch try while"),defKeywords:a("class namespace struct enum union"),typeFirstDefinitions:!0,atoms:a("true false null"),dontIndentStatements:/^template$/,hooks:{"#":l,"*":c,u:f,U:f,L:f,R:f,0:u,1:u,2:u,3:u,4:u,5:u,6:u,7:u,8:u,9:u,token:function(e,t,n){if("variable"==n&&"("==e.peek()&&(";"==t.prevToken||null==t.prevToken||"}"==t.prevToken)&&d(e.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),m("text/x-java",{name:"clike",keywords:a("abstract assert break case catch class const continue default do else enum extends final finally float for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while"),types:a("byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:a("catch class do else finally for if switch try while"),defKeywords:a("class interface package enum"),typeFirstDefinitions:!0,atoms:a("true false null"),endStatement:/^[;:]$/,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"}},modeProps:{fold:["brace","import"]}}),m("text/x-csharp",{name:"clike",keywords:a("abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),types:a("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),blockKeywords:a("catch class do else finally for foreach if struct switch try while"),defKeywords:a("class interface namespace struct var"),typeFirstDefinitions:!0,atoms:a("true false null"),hooks:{"@":function(e,t){return e.eat('"')?(t.tokenize=p,p(e,t)):(e.eatWhile(/[\w\$_]/),"meta")}}}),m("text/x-scala",{name:"clike",keywords:a("abstract case catch class def do else extends final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ : = => <- <: <% >: # @ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble :: #:: "),types:a("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:a("catch class do else finally for forSome if match switch try while"),defKeywords:a("class def object package trait type val var"),atoms:a("true false null"),indentStatements:!1,indentSwitch:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return!!e.match('""')&&(t.tokenize=g,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},"=":function(e,n){var r=n.context;return!("}"!=r.type||!r.align||!e.eat(">"))&&(n.context=new t(r.indented,r.column,r.type,r.info,null,r.prev),"operator")}},modeProps:{closeBrackets:{triples:'"'}}}),m("text/x-kotlin",{name:"clike",keywords:a("package as typealias class interface this super val var fun for is in This throw return break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix"),types:a("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,blockKeywords:a("catch class do else finally for if where try while enum"),defKeywords:a("class val var object package interface fun"),atoms:a("true false null this"),hooks:{'"':function(e,t){return t.tokenize=v(e.match('""')),t.tokenize(e,t)}},modeProps:{closeBrackets:{triples:'"'}}}),m(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:a("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:a("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:a("for while do if else struct"),builtin:a("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:a("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":l},modeProps:{fold:["brace","include"]}}),m("text/x-nesc",{name:"clike",keywords:a(b+"as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:a(k),blockKeywords:a("case do else for if switch while struct"),atoms:a("null true false"),hooks:{"#":l},modeProps:{fold:["brace","include"]}}),m("text/x-objectivec",{name:"clike",keywords:a(b+"inline restrict _Bool _Complex _Imaginary BOOL Class bycopy byref id IMP in inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),types:a(k),atoms:a("YES NO NULL NILL ON OFF true false"),hooks:{"@":function(e){return e.eatWhile(/[\w\$]/),"keyword"},"#":l,indent:function(e,t,n){if("statement"==t.type&&/^@\w/.test(n))return t.indented}},modeProps:{fold:"brace"}}),m("text/x-squirrel",{name:"clike",keywords:a("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:a(k),blockKeywords:a("case catch class else for foreach if switch try while"),defKeywords:a("function local class"),typeFirstDefinitions:!0,atoms:a("true false null"),hooks:{"#":l},modeProps:{fold:["brace","include"]}});var x=null;m("text/x-ceylon",{name:"clike",keywords:a("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(e){var t=e.charAt(0);return t===t.toUpperCase()&&t!==t.toLowerCase()},blockKeywords:a("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:a("class dynamic function interface module object package value"),builtin:a("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:a("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return t.tokenize=y(e.match('""')?"triple":"single"),t.tokenize(e,t)},"`":function(e,t){return!(!x||!e.match("`"))&&(t.tokenize=x,x=null,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(e,t,n){if(("variable"==n||"variable-3"==n)&&"."==t.prevToken)return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("clojure",function(e){function t(e){for(var t={},n=e.split(" "),r=0;r ->> doto and or dosync doseq dotimes dorun doall load import unimport ns in-ns refer try catch finally throw with-open with-local-vars binding gen-class gen-and-load-class gen-and-save-class handler-case handle"),k=t("* *' *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* *command-line-args* *compile-files* *compile-path* *compiler-options* *data-readers* *e *err* *file* *flush-on-newline* *fn-loader* *in* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *source-path* *unchecked-math* *use-context-classloader* *verbose-defrecords* *warn-on-reflection* + +' - -' -> ->> ->ArrayChunk ->Vec ->VecNode ->VecSeq -cache-protocol-fn -reset-methods .. / < <= = == > >= EMPTY-NODE accessor aclone add-classpath add-watch agent agent-error agent-errors aget alength alias all-ns alter alter-meta! alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 bases bean bigdec bigint biginteger binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* bound? butlast byte byte-array bytes case cat cast char char-array char-escape-string char-name-string char? chars chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement completing concat cond condp conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec dec' decimal? declare dedupe default-data-readers definline definterface defmacro defmethod defmulti defn defn- defonce defprotocol defrecord defstruct deftype delay delay? deliver denominator deref derive descendants destructure disj disj! dissoc dissoc! distinct distinct? doall dorun doseq dosync dotimes doto double double-array doubles drop drop-last drop-while eduction empty empty? ensure enumeration-seq error-handler error-mode eval even? every-pred every? ex-data ex-info extend extend-protocol extend-type extenders extends? false? ffirst file-seq filter filterv find find-keyword find-ns find-protocol-impl find-protocol-method find-var first flatten float float-array float? floats flush fn fn? fnext fnil for force format frequencies future future-call future-cancel future-cancelled? future-done? future? gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator group-by hash hash-combine hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc inc' init-proxy instance? int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt keep keep-indexed key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array make-hierarchy map map-indexed map? mapcat mapv max max-key memfn memoize merge merge-with meta method-sig methods min min-key mod munge name namespace namespace-munge neg? newline next nfirst nil? nnext not not-any? not-empty not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias ns-unmap nth nthnext nthrest num number? numerator object-array odd? or parents partial partition partition-all partition-by pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers primitives-classnames print print-ctor print-dup print-method print-simple print-str printf println println-str prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot rand rand-int rand-nth random-sample range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern re-seq read read-line read-string realized? reduce reduce-kv reductions ref ref-history-count ref-max-history ref-min-history ref-set refer refer-clojure reify release-pending-sends rem remove remove-all-methods remove-method remove-ns remove-watch repeat repeatedly replace replicate require reset! reset-meta! resolve rest restart-agent resultset-seq reverse reversible? rseq rsubseq satisfies? second select-keys send send-off seq seq? seque sequence sequential? set set-error-handler! set-error-mode! set-validator! set? short short-array shorts shuffle shutdown-agents slurp some some-fn sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-symbol? spit split-at split-with str string? struct struct-map subs subseq subvec supers swap! symbol symbol? sync take take-last take-nth take-while test the-ns thread-bound? time to-array to-array-2d trampoline transduce transient tree-seq true? type unchecked-add unchecked-add-int unchecked-byte unchecked-char unchecked-dec unchecked-dec-int unchecked-divide-int unchecked-double unchecked-float unchecked-inc unchecked-inc-int unchecked-int unchecked-long unchecked-multiply unchecked-multiply-int unchecked-negate unchecked-negate-int unchecked-remainder-int unchecked-short unchecked-subtract unchecked-subtract-int underive unquote unquote-splicing update update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector-of vector? volatile! volatile? vreset! vswap! when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context with-local-vars with-meta with-open with-out-str with-precision with-redefs with-redefs-fn xml-seq zero? zipmap *default-data-reader-fn* as-> cond-> cond->> reduced reduced? send-via set-agent-send-executor! set-agent-send-off-executor! some-> some->>"),x=t("ns fn def defn defmethod bound-fn if if-not case condp when while when-not when-first do future comment doto locking proxy with-open with-precision reify deftype defrecord defprotocol extend extend-protocol extend-type try catch let letfn binding loop for doseq dotimes when-let if-let defstruct struct-map assoc testing deftest handler-case handle dotrace deftrace"),w={digit:/\d/,digit_or_colon:/[\d:]/,hex:/[0-9a-f]/i,sign:/[+-]/,exponent:/e/i,keyword_char:/[^\s\(\[\;\)\]]/,symbol:/[\w*+!\-\._?:<>\/\xa1-\uffff]/,block_indent:/^(?:def|with)[^\/]+$|\/(?:def|with)/};return{startState:function(){return{indentStack:null,indentation:0,mode:!1}},token:function(e,t){if(null==t.indentStack&&e.sol()&&(t.indentation=e.indentation()),"string"!=t.mode&&e.eatSpace())return null;var n=null;switch(t.mode){case"string":for(var _,C=!1;null!=(_=e.next());){if('"'==_&&!C){t.mode=!1;break}C=!C&&"\\"==_}n=c;break;default:var S=e.next();if('"'==S)t.mode="string",n=c;else if("\\"==S)a(e),n=u;else if("'"!=S||w.digit_or_colon.test(e.peek()))if(";"==S)e.skipToEnd(),n=l;else if(o(S,e))n=d;else if("("==S||"["==S||"{"==S){var M,L="",T=e.column();if("("==S)for(;null!=(M=e.eat(w.keyword_char));)L+=M;L.length>0&&(x.propertyIsEnumerable(L)||w.block_indent.test(L))?r(t,T+g,S):(e.eatSpace(),e.eol()||";"==e.peek()?r(t,T+v,S):r(t,T+e.current().length,S)),e.backUp(e.current().length-1),n=p}else if(")"==S||"]"==S||"}"==S)n=p,null!=t.indentStack&&t.indentStack.type==(")"==S?"(":"]"==S?"[":"{")&&i(t);else{if(":"==S)return e.eatWhile(w.symbol),f;e.eatWhile(w.symbol),n=b&&b.propertyIsEnumerable(e.current())?h:k&&k.propertyIsEnumerable(e.current())?s:y&&y.propertyIsEnumerable(e.current())?f:m}else n=f}return n},indent:function(e){return null==e.indentStack?e.indentation:e.indentStack.indent},closeBrackets:{pairs:'()[]{}""'},lineComment:";;"}}),e.defineMIME("text/x-clojure","clojure"),e.defineMIME("text/x-clojurescript","clojure"),e.defineMIME("application/edn","clojure")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("ruby",function(e){function t(e){for(var t={},n=0,r=e.length;n]/)?(e.eat(/[\<\>]/),"atom"):e.eat(/[\+\-\*\/\&\|\:\!]/)?"atom":e.eat(/[a-zA-Z$@_\xa1-\uffff]/)?(e.eatWhile(/[\w$\xa1-\uffff]/),e.eat(/[\?\!\=]/),"atom"):"operator";if("@"==i&&e.match(/^@?[a-zA-Z_\xa1-\uffff]/))return e.eat("@"),e.eatWhile(/[\w\xa1-\uffff]/),"variable-2";if("$"==i)return e.eat(/[a-zA-Z_]/)?e.eatWhile(/[\w]/):e.eat(/\d/)?e.eat(/\d/):e.next(),"variable-3";if(/[a-zA-Z_\xa1-\uffff]/.test(i))return e.eatWhile(/[\w\xa1-\uffff]/),e.eat(/[\?\!]/),e.eat(":")?"atom":"ident";if("|"!=i||!t.varList&&"{"!=t.lastTok&&"do"!=t.lastTok){if(/[\(\)\[\]{}\\;]/.test(i))return c=i,null;if("-"==i&&e.eat(">"))return"arrow";if(/[=+\-\/*:\.^%<>~|]/.test(i)){var v=e.eatWhile(/[=+\-\/*:\.^%<>~|]/);return"."!=i||v||(c="."),"operator"}return null}return c="|",null}function i(e){return e||(e=1),function(t,n){if("}"==t.peek()){if(1==e)return n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n);n.tokenize[n.tokenize.length-1]=i(e-1)}else"{"==t.peek()&&(n.tokenize[n.tokenize.length-1]=i(e+1));return r(t,n)}}function o(){var e=!1;return function(t,n){return e?(n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n)):(e=!0,r(t,n))}}function a(e,t,n,r){return function(a,s){var l,c=!1;for("read-quoted-paused"===s.context.type&&(s.context=s.context.prev,a.eat("}"));null!=(l=a.next());){if(l==e&&(r||!c)){s.tokenize.pop();break}if(n&&"#"==l&&!c){if(a.eat("{")){"}"==e&&(s.context={prev:s.context,type:"read-quoted-paused"}),s.tokenize.push(i());break}if(/[@\$]/.test(a.peek())){s.tokenize.push(o());break}}c=!c&&"\\"==l}return t}}function s(e){return function(t,n){return t.match(e)?n.tokenize.pop():t.skipToEnd(),"string"}}function l(e,t){return e.sol()&&e.match("=end")&&e.eol()&&t.tokenize.pop(),e.skipToEnd(),"comment"}var c,u=t(["alias","and","BEGIN","begin","break","case","class","def","defined?","do","else","elsif","END","end","ensure","false","for","if","in","module","next","not","or","redo","rescue","retry","return","self","super","then","true","undef","unless","until","when","while","yield","nil","raise","throw","catch","fail","loop","callcc","caller","lambda","proc","public","protected","private","require","load","require_relative","extend","autoload","__END__","__FILE__","__LINE__","__dir__"]),f=t(["def","class","case","for","while","until","module","then","catch","loop","proc","begin"]),d=t(["end","until"]),p={"[":"]","{":"}","(":")"};return{startState:function(){return{tokenize:[r],indented:0,context:{type:"top",indented:-e.indentUnit},continuedLine:!1,lastTok:null,varList:!1}},token:function(e,t){c=null,e.sol()&&(t.indented=e.indentation());var n,r=t.tokenize[t.tokenize.length-1](e,t),i=c;if("ident"==r){var o=e.current();r="."==t.lastTok?"property":u.propertyIsEnumerable(e.current())?"keyword":/^[A-Z]/.test(o)?"tag":"def"==t.lastTok||"class"==t.lastTok||t.varList?"def":"variable","keyword"==r&&(i=o,f.propertyIsEnumerable(o)?n="indent":d.propertyIsEnumerable(o)?n="dedent":"if"!=o&&"unless"!=o||e.column()!=e.indentation()?"do"==o&&t.context.indentedr?f(t):i0&&p(e,t)&&(o+=" "+m),o}return c(e,t)}function c(e,t){if(e.eatSpace())return null;var n=e.peek();if("#"==n)return e.skipToEnd(),"comment";if(e.match(/^[0-9\.]/,!1)){var i=!1;if(e.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)&&(i=!0),e.match(/^\d+\.\d*/)&&(i=!0),e.match(/^\.\d+/)&&(i=!0),i)return e.eat(/J/i),"number";var o=!1;if(e.match(/^0x[0-9a-f]+/i)&&(o=!0),e.match(/^0b[01]+/i)&&(o=!0),e.match(/^0o[0-7]+/i)&&(o=!0),e.match(/^[1-9]\d*(e[\+\-]?\d+)?/)&&(e.eat(/J/i),o=!0),e.match(/^0(?![\dx])/i)&&(o=!0),o)return e.eat(/L/i),"number"}return e.match(M)?(t.tokenize=u(e.current()),t.tokenize(e,t)):e.match(b)||e.match(y)?"punctuation":e.match(v)||e.match(C)?"operator":e.match(g)?"punctuation":"."==t.lastToken&&e.match(S)?"property":e.match(L)||e.match(r)?"keyword":e.match(T)?"builtin":e.match(/^(self|cls)\b/)?"variable-2":e.match(S)?"def"==t.lastToken||"class"==t.lastToken?"def":"variable":(e.next(),m)}function u(e){function t(t,i){for(;!t.eol();)if(t.eatWhile(/[^'"\\]/),t.eat("\\")){if(t.next(),n&&t.eol())return r}else{if(t.match(e))return i.tokenize=l,r;t.eat(/['"]/)}if(n){if(s.singleLineStringErrors)return m;i.tokenize=l}return r}for(;"rub".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var n=1==e.length,r="string";return t.isString=!0,t}function f(e){for(;"py"!=n(e).type;)e.scopes.pop();e.scopes.push({offset:n(e).offset+a.indentUnit,type:"py",align:null})}function d(e,t,n){var r=e.match(/^([\s\[\{\(]|#.*)*$/,!1)?null:e.column()+1;t.scopes.push({offset:t.indent+k,type:n,align:r})}function p(e,t){for(var r=e.indentation();t.scopes.length>1&&n(t).offset>r;){if("py"!=n(t).type)return!0;t.scopes.pop()}return n(t).offset!=r}function h(e,t){e.sol()&&(t.beginningOfLine=!0);var r=t.tokenize(e,t),i=e.current();if(t.beginningOfLine&&"@"==i)return e.match(S,!1)?"meta":_?"operator":m;/\S/.test(i)&&(t.beginningOfLine=!1),"variable"!=r&&"builtin"!=r||"meta"!=t.lastToken||(r="meta"),"pass"!=i&&"return"!=i||(t.dedent+=1),"lambda"==i&&(t.lambda=!0),":"!=i||t.lambda||"py"!=n(t).type||f(t);var o=1==i.length?"[({".indexOf(i):-1;if(o!=-1&&d(e,t,"])}".slice(o,o+1)),o="])}".indexOf(i),o!=-1){if(n(t).type!=i)return m;t.indent=t.scopes.pop().offset-k}return t.dedent>0&&e.eol()&&"py"==n(t).type&&(t.scopes.length>1&&t.scopes.pop(),t.dedent-=1),r}var m="error",g=s.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.]/,v=s.doubleOperators||/^([!<>]==|<>|<<|>>|\/\/|\*\*)/,y=s.doubleDelimiters||/^(\+=|\-=|\*=|%=|\/=|&=|\|=|\^=)/,b=s.tripleDelimiters||/^(\/\/=|>>=|<<=|\*\*=)/,k=s.hangingIndent||a.indentUnit,x=i,w=o;void 0!=s.extra_keywords&&(x=x.concat(s.extra_keywords)),void 0!=s.extra_builtins&&(w=w.concat(s.extra_builtins)); -var _=s.version&&3==parseInt(s.version,10);if(_){var C=s.singleOperators||/^[\+\-\*\/%&|\^~<>!@]/,S=s.identifiers||/^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/;x=x.concat(["nonlocal","False","True","None","async","await"]),w=w.concat(["ascii","bytes","exec","print"]);var M=new RegExp("^(([rbuf]|(br))?('{3}|\"{3}|['\"]))","i")}else{var C=s.singleOperators||/^[\+\-\*\/%&|\^~<>!]/,S=s.identifiers||/^[_A-Za-z][_A-Za-z0-9]*/;x=x.concat(["exec","print"]),w=w.concat(["apply","basestring","buffer","cmp","coerce","execfile","file","intern","long","raw_input","reduce","reload","unichr","unicode","xrange","False","True","None"]);var M=new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))","i")}var L=t(x),T=t(w),A={startState:function(e){return{tokenize:l,scopes:[{offset:e||0,type:"py",align:null}],indent:e||0,lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=t.errorToken;n&&(t.errorToken=!1);var r=h(e,t);return r&&"comment"!=r&&(t.lastToken="keyword"==r||"punctuation"==r?e.current():r),"punctuation"==r&&(r=null),e.eol()&&t.lambda&&(t.lambda=!1),n?r+" "+m:r},indent:function(t,r){if(t.tokenize!=l)return t.tokenize.isString?e.Pass:0;var i=n(t),o=i.type==r.charAt(0);return null!=i.align?i.align-(o?1:0):i.offset-(o?k:0)},electricInput:/^\s*[\}\]\)]$/,closeBrackets:{triples:"'\""},lineComment:"#",fold:"indent"};return A}),e.defineMIME("text/x-python","python");var a=function(e){return e.split(" ")};e.defineMIME("text/x-cython",{name:"python",extra_keywords:a("by cdef cimport cpdef ctypedef enum exceptextern gil include nogil property publicreadonly struct union DEF IF ELIF ELSE")})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("shell",function(){function e(e,t){for(var n=t.split(" "),r=0;r1&&e.eat("$");var i=e.next(),o=/\w/;return"{"===i&&(o=/[^}]/),"("===i?(t.tokens[0]=n(")"),r(e,t)):(/\d/.test(i)||(e.eatWhile(o),e.eat("}")),t.tokens.shift(),"def")};return{startState:function(){return{tokens:[]}},token:function(e,t){return r(e,t)},lineComment:"#",fold:"brace"}}),e.defineMIME("text/x-sh","shell")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../clike/clike"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},n=e.split(" "),r=0;r\w/,!1)&&(t.tokenize=n([[["->",null]],[[/[\w]+/,"variable"]]],r,i)),"variable-2";for(var o=!1;!e.eol()&&(o||i===!1||!e.match("{$",!1)&&!e.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,!1));){if(!o&&e.match(r)){t.tokenize=null,t.tokStack.pop(),t.tokStack.pop();break}o="\\"==e.next()&&!o}return"string"}var o="abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent yield insteadof finally",a="true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__",s="func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents file_put_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists array_intersect_key array_combine array_column pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";e.registerHelper("hintWords","php",[o,a,s].join(" ").split(" ")),e.registerHelper("wordChars","php",/[\w$]/);var l={name:"clike",helperType:"php",keywords:t(o),blockKeywords:t("catch do else elseif for foreach if switch try while finally"),defKeywords:t("class function interface namespace trait"),atoms:t(a),builtin:t(s),multiLineStrings:!0,hooks:{$:function(e){return e.eatWhile(/[\w\$_]/),"variable-2"},"<":function(e,t){var n;if(n=e.match(/<<\s*/)){var i=e.eat(/['"]/);e.eatWhile(/[\w\.]/);var o=e.current().slice(n[0].length+(i?2:1));if(i&&e.eat(i),o)return(t.tokStack||(t.tokStack=[])).push(o,0),t.tokenize=r(o,"'"!=i),"string"}return!1},"#":function(e){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"},"/":function(e){if(e.eat("/")){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"}return!1},'"':function(e,t){return(t.tokStack||(t.tokStack=[])).push('"',0),t.tokenize=r('"'),"string"},"{":function(e,t){return t.tokStack&&t.tokStack.length&&t.tokStack[t.tokStack.length-1]++,!1},"}":function(e,t){return t.tokStack&&t.tokStack.length>0&&!--t.tokStack[t.tokStack.length-1]&&(t.tokenize=r(t.tokStack[t.tokStack.length-2])),!1}}};e.defineMode("php",function(t,n){function r(t,n){var r=n.curMode==o;if(t.sol()&&n.pending&&'"'!=n.pending&&"'"!=n.pending&&(n.pending=null),r)return r&&null==n.php.tokenize&&t.match("?>")?(n.curMode=i,n.curState=n.html,n.php.context.prev||(n.php=null),"meta"):o.token(t,n.curState);if(t.match(/^<\?\w*/))return n.curMode=o,n.php||(n.php=e.startState(o,i.indent(n.html,""))),n.curState=n.php,"meta";if('"'==n.pending||"'"==n.pending){for(;!t.eol()&&t.next()!=n.pending;);var a="string"}else if(n.pending&&t.pos/.test(l)?n.pending=s[0]:n.pending={end:t.pos,style:a},t.backUp(l.length-c)),a}var i=e.getMode(t,"text/html"),o=e.getMode(t,l);return{startState:function(){var t=e.startState(i),r=n.startOpen?e.startState(o):null;return{html:t,php:r,curMode:n.startOpen?o:i,curState:n.startOpen?r:t,pending:null}},copyState:function(t){var n,r=t.html,a=e.copyState(i,r),s=t.php,l=s&&e.copyState(o,s);return n=t.curMode==i?a:l,{html:a,php:l,curMode:t.curMode,curState:n,pending:t.pending}},token:r,indent:function(e,t){return e.curMode!=o&&/^\s*<\//.test(t)||e.curMode==o&&/^\?>/.test(t)?i.indent(e.html,t):e.curMode.indent(e.curState,t)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(e){return{state:e.curState,mode:e.curMode}}}},"htmlmixed","clike"),e.defineMIME("application/x-httpd-php","php"),e.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),e.defineMIME("text/x-php",l)}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("sql",function(t,n){function r(e,t){var n=e.next();if(h[n]){var r=h[n](e,t);if(r!==!1)return r}if(1==p.hexNumber&&("0"==n&&e.match(/^[xX][0-9a-fA-F]+/)||("x"==n||"X"==n)&&e.match(/^'[0-9a-fA-F]+'/)))return"number";if(1==p.binaryNumber&&(("b"==n||"B"==n)&&e.match(/^'[01]+'/)||"0"==n&&e.match(/^b[01]+/)))return"number";if(n.charCodeAt(0)>47&&n.charCodeAt(0)<58)return e.match(/^[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/),1==p.decimallessFloat&&e.eat("."),"number";if("?"==n&&(e.eatSpace()||e.eol()||e.eat(";")))return"variable-3";if("'"==n||'"'==n&&p.doubleQuote)return t.tokenize=i(n),t.tokenize(e,t);if((1==p.nCharCast&&("n"==n||"N"==n)||1==p.charsetCast&&"_"==n&&e.match(/[a-z][a-z0-9]*/i))&&("'"==e.peek()||'"'==e.peek()))return"keyword";if(/^[\(\),\;\[\]]/.test(n))return null;if(p.commentSlashSlash&&"/"==n&&e.eat("/"))return e.skipToEnd(),"comment";if(p.commentHash&&"#"==n||"-"==n&&e.eat("-")&&(!p.commentSpaceRequired||e.eat(" ")))return e.skipToEnd(),"comment";if("/"==n&&e.eat("*"))return t.tokenize=o,t.tokenize(e,t);if("."!=n){if(d.test(n))return e.eatWhile(d),null;if("{"==n&&(e.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/)||e.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/)))return"number";e.eatWhile(/^[_\w\d]/);var a=e.current().toLowerCase();return m.hasOwnProperty(a)&&(e.match(/^( )+'[^']*'/)||e.match(/^( )+"[^"]*"/))?"number":c.hasOwnProperty(a)?"atom":u.hasOwnProperty(a)?"builtin":f.hasOwnProperty(a)?"keyword":l.hasOwnProperty(a)?"string-2":null}return 1==p.zerolessFloat&&e.match(/^(?:\d+(?:e[+-]?\d+)?)/i)?"number":1==p.ODBCdotTable&&e.match(/^[a-zA-Z_]+/)?"variable-2":void 0}function i(e){return function(t,n){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){n.tokenize=r;break}o=!o&&"\\"==i}return"string"}}function o(e,t){for(;;){if(!e.skipTo("*")){e.skipToEnd();break}if(e.next(),e.eat("/")){t.tokenize=r;break}}return"comment"}function a(e,t,n){t.context={prev:t.context,indent:e.indentation(),col:e.column(),type:n}}function s(e){e.indent=e.context.indent,e.context=e.context.prev}var l=n.client||{},c=n.atoms||{"false":!0,"true":!0,"null":!0},u=n.builtin||{},f=n.keywords||{},d=n.operatorChars||/^[*+\-%<>!=&|~^]/,p=n.support||{},h=n.hooks||{},m=n.dateSQL||{date:!0,time:!0,timestamp:!0};return{startState:function(){return{tokenize:r,context:null}},token:function(e,t){if(e.sol()&&t.context&&null==t.context.align&&(t.context.align=!1),e.eatSpace())return null;var n=t.tokenize(e,t);if("comment"==n)return n;t.context&&null==t.context.align&&(t.context.align=!0);var r=e.current();return"("==r?a(e,t,")"):"["==r?a(e,t,"]"):t.context&&t.context.type==r&&s(t),n},indent:function(n,r){var i=n.context;if(!i)return e.Pass;var o=r.charAt(0)==i.type;return i.align?i.col+(o?0:1):i.indent+(o?0:t.indentUnit)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:p.commentSlashSlash?"//":p.commentHash?"#":null}}),function(){function t(e){for(var t;null!=(t=e.next());)if("`"==t&&!e.eat("`"))return"variable-2";return e.backUp(e.current().length-1),e.eatWhile(/\w/)?"variable-2":null}function n(e){return e.eat("@")&&(e.match(/^session\./),e.match(/^local\./),e.match(/^global\./)),e.eat("'")?(e.match(/^.*'/),"variable-2"):e.eat('"')?(e.match(/^.*"/),"variable-2"):e.eat("`")?(e.match(/^.*`/),"variable-2"):e.match(/^[0-9a-zA-Z$\.\_]+/)?"variable-2":null}function r(e){return e.eat("N")?"atom":e.match(/^[a-zA-Z.#!?]/)?"variable-2":null}function i(e){for(var t={},n=e.split(" "),r=0;r!=]/,dateSQL:i("date time timestamp"),support:i("ODBCdotTable doubleQuote binaryNumber hexNumber")}),e.defineMIME("text/x-mssql",{name:"sql",client:i("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:i(o+"begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered declare"),builtin:i("bigint numeric bit smallint decimal smallmoney int tinyint money float real char varchar text nchar nvarchar ntext binary varbinary image cursor timestamp hierarchyid uniqueidentifier sql_variant xml table "),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:i("date datetimeoffset datetime2 smalldatetime datetime time"),hooks:{"@":n}}),e.defineMIME("text/x-mysql",{name:"sql",client:i("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:i(o+"accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group group_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:i("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:i("date time timestamp"),support:i("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":n,"`":t,"\\":r}}),e.defineMIME("text/x-mariadb",{name:"sql",client:i("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:i(o+"accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:i("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:i("date time timestamp"),support:i("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":n,"`":t,"\\":r}}),e.defineMIME("text/x-cassandra",{name:"sql",client:{},keywords:i("add all allow alter and any apply as asc authorize batch begin by clustering columnfamily compact consistency count create custom delete desc distinct drop each_quorum exists filtering from grant if in index insert into key keyspace keyspaces level limit local_one local_quorum modify nan norecursive nosuperuser not of on one order password permission permissions primary quorum rename revoke schema select set storage superuser table three to token truncate ttl two type unlogged update use user users using values where with writetime"),builtin:i("ascii bigint blob boolean counter decimal double float frozen inet int list map static text timestamp timeuuid tuple uuid varchar varint"),atoms:i("false true infinity NaN"),operatorChars:/^[<>=]/,dateSQL:{},support:i("commentSlashSlash decimallessFloat"),hooks:{}}),e.defineMIME("text/x-plsql",{name:"sql",client:i("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"),keywords:i("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"), -builtin:i("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least length lengthb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"),operatorChars:/^[*+\-%<>!=~]/,dateSQL:i("date time timestamp"),support:i("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")}),e.defineMIME("text/x-hive",{name:"sql",keywords:i("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external false fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger true unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with"),builtin:i("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:i("date timestamp"),support:i("ODBCdotTable doubleQuote binaryNumber hexNumber")}),e.defineMIME("text/x-pgsql",{name:"sql",client:i("source"),keywords:i(o+"a abort abs absent absolute access according action ada add admin after aggregate all allocate also always analyse analyze any are array array_agg array_max_cardinality asensitive assertion assignment asymmetric at atomic attribute attributes authorization avg backward base64 before begin begin_frame begin_partition bernoulli binary bit_length blob blocked bom both breadth c cache call called cardinality cascade cascaded case cast catalog catalog_name ceil ceiling chain characteristics characters character_length character_set_catalog character_set_name character_set_schema char_length check checkpoint class class_origin clob close cluster coalesce cobol collate collation collation_catalog collation_name collation_schema collect column columns column_name command_function command_function_code comment comments commit committed concurrently condition condition_number configuration conflict connect connection connection_name constraint constraints constraint_catalog constraint_name constraint_schema constructor contains content continue control conversion convert copy corr corresponding cost covar_pop covar_samp cross csv cube cume_dist current current_catalog current_date current_default_transform_group current_path current_role current_row current_schema current_time current_timestamp current_transform_group_for_type current_user cursor cursor_name cycle data database datalink datetime_interval_code datetime_interval_precision day db deallocate dec declare default defaults deferrable deferred defined definer degree delimiter delimiters dense_rank depth deref derived describe descriptor deterministic diagnostics dictionary disable discard disconnect dispatch dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue do document domain dynamic dynamic_function dynamic_function_code each element else empty enable encoding encrypted end end-exec end_frame end_partition enforced enum equals escape event every except exception exclude excluding exclusive exec execute exists exp explain expression extension external extract false family fetch file filter final first first_value flag float floor following for force foreign fortran forward found frame_row free freeze fs full function functions fusion g general generated get global go goto grant granted greatest grouping groups handler header hex hierarchy hold hour id identity if ignore ilike immediate immediately immutable implementation implicit import including increment indent index indexes indicator inherit inherits initially inline inner inout input insensitive instance instantiable instead integrity intersect intersection invoker isnull isolation k key key_member key_type label lag language large last last_value lateral lead leading leakproof least left length level library like_regex link listen ln load local localtime localtimestamp location locator lock locked logged lower m map mapping match matched materialized max maxvalue max_cardinality member merge message_length message_octet_length message_text method min minute minvalue mod mode modifies module month more move multiset mumps name names namespace national natural nchar nclob nesting new next nfc nfd nfkc nfkd nil no none normalize normalized nothing notify notnull nowait nth_value ntile null nullable nullif nulls number object occurrences_regex octets octet_length of off offset oids old only open operator option options ordering ordinality others out outer output over overlaps overlay overriding owned owner p pad parameter parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partial partition pascal passing passthrough password percent percentile_cont percentile_disc percent_rank period permission placing plans pli policy portion position position_regex power precedes preceding prepare prepared preserve primary prior privileges procedural procedure program public quote range rank read reads reassign recheck recovery recursive ref references referencing refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release rename repeatable replace replica requiring reset respect restart restore restrict result return returned_cardinality returned_length returned_octet_length returned_sqlstate returning returns revoke right role rollback rollup routine routine_catalog routine_name routine_schema row rows row_count row_number rule savepoint scale schema schema_name scope scope_catalog scope_name scope_schema scroll search second section security selective self sensitive sequence sequences serializable server server_name session session_user setof sets share show similar simple size skip snapshot some source space specific specifictype specific_name sql sqlcode sqlerror sqlexception sqlstate sqlwarning sqrt stable standalone start state statement static statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset substring substring_regex succeeds sum symmetric sysid system system_time system_user t tables tablesample tablespace table_name temp template temporary then ties timezone_hour timezone_minute to token top_level_count trailing transaction transactions_committed transactions_rolled_back transaction_active transform transforms translate translate_regex translation treat trigger trigger_catalog trigger_name trigger_schema trim trim_array true truncate trusted type types uescape unbounded uncommitted under unencrypted unique unknown unlink unlisten unlogged unnamed unnest until untyped upper uri usage user user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema using vacuum valid validate validator value value_of varbinary variadic var_pop var_samp verbose version versioning view views volatile when whenever whitespace width_bucket window within work wrapper write xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate year yes loop repeat"),builtin:i("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float8 inet integer int int4 interval json jsonb line lseg macaddr money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:i("date time timestamp"),support:i("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast")}),e.defineMIME("text/x-gql",{name:"sql",keywords:i("ancestor and asc by contains desc descendant distinct from group has in is limit offset on order select superset where"),atoms:i("false true"),builtin:i("blob datetime first key __key__ string integer double boolean null"),operatorChars:/^[*+\-%<>!=]/})}()}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("coffeescript",function(e,t){function n(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function r(e,t){if(e.sol()){null===t.scope.align&&(t.scope.align=!1);var n=t.scope.offset;if(e.eatSpace()){var r=e.indentation();return r>n&&"coffee"==t.scope.type?"indent":r0&&s(e,t)}if(e.eatSpace())return null;var a=e.peek();if(e.match("####"))return e.skipToEnd(),"comment";if(e.match("###"))return t.tokenize=o,t.tokenize(e,t);if("#"===a)return e.skipToEnd(),"comment";if(e.match(/^-?[0-9\.]/,!1)){var l=!1;if(e.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)&&(l=!0),e.match(/^-?\d+\.\d*/)&&(l=!0),e.match(/^-?\.\d+/)&&(l=!0),l)return"."==e.peek()&&e.backUp(1),"number";var m=!1;if(e.match(/^-?0x[0-9a-f]+/i)&&(m=!0),e.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)&&(m=!0),e.match(/^-?0(?![\dx])/i)&&(m=!0),m)return"number"}if(e.match(y))return t.tokenize=i(e.current(),!1,"string"),t.tokenize(e,t);if(e.match(b)){if("/"!=e.current()||e.match(/^.*\//,!1))return t.tokenize=i(e.current(),!0,"string-2"),t.tokenize(e,t);e.backUp(1)}return e.match(u)||e.match(h)?"operator":e.match(f)?"punctuation":e.match(x)?"atom":e.match(p)||t.prop&&e.match(d)?"property":e.match(v)?"keyword":e.match(d)?"variable":(e.next(),c)}function i(e,n,i){return function(o,a){for(;!o.eol();)if(o.eatWhile(/[^'"\/\\]/),o.eat("\\")){if(o.next(),n&&o.eol())return i}else{if(o.match(e))return a.tokenize=r,i;o.eat(/['"\/]/)}return n&&(t.singleLineStringErrors?i=c:a.tokenize=r),i}}function o(e,t){for(;!e.eol();){if(e.eatWhile(/[^#]/),e.match("###")){t.tokenize=r;break}e.eatWhile("#")}return"comment"}function a(t,n,r){r=r||"coffee";for(var i=0,o=!1,a=null,s=n.scope;s;s=s.prev)if("coffee"===s.type||"}"==s.type){i=s.offset+e.indentUnit;break}"coffee"!==r?(o=null,a=t.column()+t.current().length):n.scope.align&&(n.scope.align=!1),n.scope={offset:i,type:r,prev:n.scope,align:o,alignOffset:a}}function s(e,t){if(t.scope.prev){if("coffee"===t.scope.type){for(var n=e.indentation(),r=!1,i=t.scope;i;i=i.prev)if(n===i.offset){r=!0;break}if(!r)return!0;for(;t.scope.prev&&t.scope.offset!==n;)t.scope=t.scope.prev;return!1}return t.scope=t.scope.prev,!1}}function l(e,t){var n=t.tokenize(e,t),r=e.current();"return"===r&&(t.dedent=!0),(("->"===r||"=>"===r)&&e.eol()||"indent"===n)&&a(e,t);var i="[({".indexOf(r);if(i!==-1&&a(e,t,"])}".slice(i,i+1)),m.exec(r)&&a(e,t),"then"==r&&s(e,t),"dedent"===n&&s(e,t))return c;if(i="])}".indexOf(r),i!==-1){for(;"coffee"==t.scope.type&&t.scope.prev;)t.scope=t.scope.prev;t.scope.type==r&&(t.scope=t.scope.prev)}return t.dedent&&e.eol()&&("coffee"==t.scope.type&&t.scope.prev&&(t.scope=t.scope.prev),t.dedent=!1),n}var c="error",u=/^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?|(or|and|\|\||&&|\?)=)/,f=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/,d=/^[_A-Za-z$][_A-Za-z$0-9]*/,p=/^@[_A-Za-z$][_A-Za-z$0-9]*/,h=n(["and","or","not","is","isnt","in","instanceof","typeof"]),m=["for","while","loop","if","unless","else","switch","try","catch","finally","class"],g=["break","by","continue","debugger","delete","do","in","of","new","return","then","this","@","throw","when","until","extends"],v=n(m.concat(g));m=n(m);var y=/^('{3}|\"{3}|['\"])/,b=/^(\/{3}|\/)/,k=["Infinity","NaN","undefined","null","true","false","on","off","yes","no"],x=n(k),w={startState:function(e){return{tokenize:r,scope:{offset:e||0,type:"coffee",prev:null,align:!1},prop:!1,dedent:0}},token:function(e,t){var n=null===t.scope.align&&t.scope;n&&e.sol()&&(n.align=!1);var r=l(e,t);return r&&"comment"!=r&&(n&&(n.align=!0),t.prop="punctuation"==r&&"."==e.current()),r},indent:function(e,t){if(e.tokenize!=r)return 0;var n=e.scope,i=t&&"])}".indexOf(t.charAt(0))>-1;if(i)for(;"coffee"==n.type&&n.prev;)n=n.prev;var o=i&&n.type===t.charAt(0);return n.align?n.alignOffset-(o?1:0):(o?n.prev:n).offset},lineComment:"#",fold:"indent"};return w}),e.defineMIME("text/x-coffeescript","coffeescript"),e.defineMIME("text/coffeescript","coffeescript")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("yaml",function(){var e=["true","false","on","off","yes","no"],t=new RegExp("\\b(("+e.join(")|(")+"))$","i");return{token:function(e,n){var r=e.peek(),i=n.escaped;if(n.escaped=!1,"#"==r&&(0==e.pos||/\s/.test(e.string.charAt(e.pos-1))))return e.skipToEnd(),"comment";if(e.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(n.literal&&e.indentation()>n.keyCol)return e.skipToEnd(),"string";if(n.literal&&(n.literal=!1),e.sol()){if(n.keyCol=0,n.pair=!1,n.pairStart=!1,e.match(/---/))return"def";if(e.match(/\.\.\./))return"def";if(e.match(/\s*-\s+/))return"meta"}if(e.match(/^(\{|\}|\[|\])/))return"{"==r?n.inlinePairs++:"}"==r?n.inlinePairs--:"["==r?n.inlineList++:n.inlineList--,"meta";if(n.inlineList>0&&!i&&","==r)return e.next(),"meta";if(n.inlinePairs>0&&!i&&","==r)return n.keyCol=0,n.pair=!1,n.pairStart=!1,e.next(),"meta";if(n.pairStart){if(e.match(/^\s*(\||\>)\s*/))return n.literal=!0,"meta";if(e.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if(0==n.inlinePairs&&e.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(n.inlinePairs>0&&e.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(e.match(t))return"keyword"}return!n.pair&&e.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(n.pair=!0,n.keyCol=e.indentation(),"atom"):n.pair&&e.match(/^:\s*/)?(n.pairStart=!0,"meta"):(n.pairStart=!1,n.escaped="\\"==r,e.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}}}}),e.defineMIME("text/x-yaml","yaml")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../javascript/javascript"),require("../css/css"),require("../htmlmixed/htmlmixed")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../javascript/javascript","../css/css","../htmlmixed/htmlmixed"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("jade",function(t){function n(){this.javaScriptLine=!1,this.javaScriptLineExcludesColon=!1,this.javaScriptArguments=!1,this.javaScriptArgumentsDepth=0,this.isInterpolating=!1,this.interpolationNesting=0,this.jsState=e.startState(Y),this.restOfLine="",this.isIncludeFiltered=!1,this.isEach=!1,this.lastTag="",this.scriptType="",this.isAttrs=!1,this.attrsNest=[],this.inAttributeName=!0,this.attributeIsType=!1,this.attrValue="",this.indentOf=1/0,this.indentToken="",this.innerMode=null,this.innerState=null,this.innerModeForLine=!1}function r(e,t){if(e.sol()&&(t.javaScriptLine=!1,t.javaScriptLineExcludesColon=!1),t.javaScriptLine){if(t.javaScriptLineExcludesColon&&":"===e.peek())return t.javaScriptLine=!1,void(t.javaScriptLineExcludesColon=!1);var n=Y.token(e,t.jsState);return e.eol()&&(t.javaScriptLine=!1),n||!0}}function i(e,t){if(t.javaScriptArguments){if(0===t.javaScriptArgumentsDepth&&"("!==e.peek())return void(t.javaScriptArguments=!1);if("("===e.peek()?t.javaScriptArgumentsDepth++:")"===e.peek()&&t.javaScriptArgumentsDepth--,0===t.javaScriptArgumentsDepth)return void(t.javaScriptArguments=!1);var n=Y.token(e,t.jsState);return n||!0}}function o(e){if(e.match(/^yield\b/))return"keyword"}function a(e){if(e.match(/^(?:doctype) *([^\n]+)?/))return V}function s(e,t){if(e.match("#{"))return t.isInterpolating=!0,t.interpolationNesting=0,"punctuation"}function l(e,t){if(t.isInterpolating){if("}"===e.peek()){if(t.interpolationNesting--,t.interpolationNesting<0)return e.next(),t.isInterpolating=!1,"punctuation"}else"{"===e.peek()&&t.interpolationNesting++;return Y.token(e,t.jsState)||!0}}function c(e,t){if(e.match(/^case\b/))return t.javaScriptLine=!0,K}function u(e,t){if(e.match(/^when\b/))return t.javaScriptLine=!0,t.javaScriptLineExcludesColon=!0,K}function f(e){if(e.match(/^default\b/))return K}function d(e,t){if(e.match(/^extends?\b/))return t.restOfLine="string",K}function p(e,t){if(e.match(/^append\b/))return t.restOfLine="variable",K}function h(e,t){if(e.match(/^prepend\b/))return t.restOfLine="variable",K}function m(e,t){if(e.match(/^block\b *(?:(prepend|append)\b)?/))return t.restOfLine="variable",K}function g(e,t){if(e.match(/^include\b/))return t.restOfLine="string",K}function v(e,t){if(e.match(/^include:([a-zA-Z0-9\-]+)/,!1)&&e.match("include"))return t.isIncludeFiltered=!0,K}function y(e,t){if(t.isIncludeFiltered){var n=L(e,t);return t.isIncludeFiltered=!1,t.restOfLine="string",n}}function b(e,t){if(e.match(/^mixin\b/))return t.javaScriptLine=!0,K}function k(e,t){return e.match(/^\+([-\w]+)/)?(e.match(/^\( *[-\w]+ *=/,!1)||(t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0),"variable"):e.match(/^\+#{/,!1)?(e.next(),t.mixinCallAfter=!0,s(e,t)):void 0}function x(e,t){if(t.mixinCallAfter)return t.mixinCallAfter=!1,e.match(/^\( *[-\w]+ *=/,!1)||(t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0),!0}function w(e,t){if(e.match(/^(if|unless|else if|else)\b/))return t.javaScriptLine=!0,K}function _(e,t){if(e.match(/^(- *)?(each|for)\b/))return t.isEach=!0,K}function C(e,t){if(t.isEach){if(e.match(/^ in\b/))return t.javaScriptLine=!0,t.isEach=!1,K;if(e.sol()||e.eol())t.isEach=!1;else if(e.next()){for(;!e.match(/^ in\b/,!1)&&e.next(););return"variable"}}}function S(e,t){if(e.match(/^while\b/))return t.javaScriptLine=!0,K}function M(e,t){var n;if(n=e.match(/^(\w(?:[-:\w]*\w)?)\/?/))return t.lastTag=n[1].toLowerCase(),"script"===t.lastTag&&(t.scriptType="application/javascript"),"tag"}function L(n,r){if(n.match(/^:([\w\-]+)/)){var i;return t&&t.innerModes&&(i=t.innerModes(n.current().substring(1))),i||(i=n.current().substring(1)),"string"==typeof i&&(i=e.getMode(t,i)),W(n,r,i),"atom"}}function T(e,t){if(e.match(/^(!?=|-)/))return t.javaScriptLine=!0,"punctuation"}function A(e){if(e.match(/^#([\w-]+)/))return G}function E(e){if(e.match(/^\.([\w-]+)/))return X}function z(e,t){if("("==e.peek())return e.next(),t.isAttrs=!0,t.attrsNest=[],t.inAttributeName=!0,t.attrValue="",t.attributeIsType=!1,"punctuation"}function O(t,n){if(n.isAttrs){if(Z[t.peek()]&&n.attrsNest.push(Z[t.peek()]),n.attrsNest[n.attrsNest.length-1]===t.peek())n.attrsNest.pop();else if(t.eat(")"))return n.isAttrs=!1,"punctuation";if(n.inAttributeName&&t.match(/^[^=,\)!]+/))return"="!==t.peek()&&"!"!==t.peek()||(n.inAttributeName=!1,n.jsState=e.startState(Y),"script"===n.lastTag&&"type"===t.current().trim().toLowerCase()?n.attributeIsType=!0:n.attributeIsType=!1),"attribute";var r=Y.token(t,n.jsState);if(n.attributeIsType&&"string"===r&&(n.scriptType=t.current().toString()),0===n.attrsNest.length&&("string"===r||"variable"===r||"keyword"===r))try{return Function("","var x "+n.attrValue.replace(/,\s*$/,"").replace(/^!/,"")),n.inAttributeName=!0,n.attrValue="",t.backUp(t.current().length),O(t,n)}catch(i){}return n.attrValue+=t.current(),r||!0}}function I(e,t){if(e.match(/^&attributes\b/))return t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0,"keyword"}function N(e){if(e.sol()&&e.eatSpace())return"indent"}function q(e,t){if(e.match(/^ *\/\/(-)?([^\n]*)/))return t.indentOf=e.indentation(),t.indentToken="comment","comment"}function P(e){if(e.match(/^: */))return"colon"}function R(e,t){return e.match(/^(?:\| ?| )([^\n]+)/)?"string":e.match(/^(<[^\n]*)/,!1)?(W(e,t,"htmlmixed"),t.innerModeForLine=!0,B(e,t,!0)):void 0}function j(e,t){if(e.eat(".")){var n=null;return"script"===t.lastTag&&t.scriptType.toLowerCase().indexOf("javascript")!=-1?n=t.scriptType.toLowerCase().replace(/"|'/g,""):"style"===t.lastTag&&(n="css"),W(e,t,n),"dot"}}function D(e){return e.next(),null}function W(n,r,i){i=e.mimeModes[i]||i,i=t.innerModes?t.innerModes(i)||i:i,i=e.mimeModes[i]||i,i=e.getMode(t,i),r.indentOf=n.indentation(),i&&"null"!==i.name?r.innerMode=i:r.indentToken="string"}function B(t,n,r){return t.indentation()>n.indentOf||n.innerModeForLine&&!t.sol()||r?n.innerMode?(n.innerState||(n.innerState=n.innerMode.startState?e.startState(n.innerMode,t.indentation()):{}),t.hideFirstChars(n.indentOf+2,function(){return n.innerMode.token(t,n.innerState)||!0})):(t.skipToEnd(),n.indentToken):void(t.sol()&&(n.indentOf=1/0,n.indentToken=null,n.innerMode=null,n.innerState=null))}function F(e,t){if(e.sol()&&(t.restOfLine=""),t.restOfLine){e.skipToEnd();var n=t.restOfLine;return t.restOfLine="",n}}function H(){return new n}function $(e){return e.copy()}function U(e,t){var n=B(e,t)||F(e,t)||l(e,t)||y(e,t)||C(e,t)||O(e,t)||r(e,t)||i(e,t)||x(e,t)||o(e,t)||a(e,t)||s(e,t)||c(e,t)||u(e,t)||f(e,t)||d(e,t)||p(e,t)||h(e,t)||m(e,t)||g(e,t)||v(e,t)||b(e,t)||k(e,t)||w(e,t)||_(e,t)||S(e,t)||M(e,t)||L(e,t)||T(e,t)||A(e,t)||E(e,t)||z(e,t)||I(e,t)||N(e,t)||R(e,t)||q(e,t)||P(e,t)||j(e,t)||D(e,t);return n===!0?null:n}var K="keyword",V="meta",G="builtin",X="qualifier",Z={"{":"}","(":")","[":"]"},Y=e.getMode(t,"javascript");return n.prototype.copy=function(){var t=new n;return t.javaScriptLine=this.javaScriptLine,t.javaScriptLineExcludesColon=this.javaScriptLineExcludesColon,t.javaScriptArguments=this.javaScriptArguments,t.javaScriptArgumentsDepth=this.javaScriptArgumentsDepth,t.isInterpolating=this.isInterpolating,t.interpolationNesting=this.interpolationNesting,t.jsState=e.copyState(Y,this.jsState),t.innerMode=this.innerMode,this.innerMode&&this.innerState&&(t.innerState=e.copyState(this.innerMode,this.innerState)),t.restOfLine=this.restOfLine,t.isIncludeFiltered=this.isIncludeFiltered,t.isEach=this.isEach,t.lastTag=this.lastTag,t.scriptType=this.scriptType,t.isAttrs=this.isAttrs,t.attrsNest=this.attrsNest.slice(),t.inAttributeName=this.inAttributeName,t.attributeIsType=this.attributeIsType,t.attrValue=this.attrValue,t.indentOf=this.indentOf,t.indentToken=this.indentToken,t.innerModeForLine=this.innerModeForLine,t},{startState:H,copyState:$,token:U}},"javascript","css","htmlmixed"),e.defineMIME("text/x-jade","jade")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("lua",function(e,t){function n(e){return new RegExp("^(?:"+e.join("|")+")","i")}function r(e){return new RegExp("^(?:"+e.join("|")+")$","i")}function i(e){for(var t=0;e.eat("=");)++t;return e.eat("["),t}function o(e,t){var n=e.next();return"-"==n&&e.eat("-")?e.eat("[")&&e.eat("[")?(t.cur=a(i(e),"comment"))(e,t):(e.skipToEnd(),"comment"):'"'==n||"'"==n?(t.cur=s(n))(e,t):"["==n&&/[\[=]/.test(e.peek())?(t.cur=a(i(e),"string"))(e,t):/\d/.test(n)?(e.eatWhile(/[\w.%]/),"number"):/[\w_]/.test(n)?(e.eatWhile(/[\w\\\-_.]/),"variable"):null}function a(e,t){return function(n,r){for(var i,a=null;null!=(i=n.next());)if(null==a)"]"==i&&(a=0);else if("="==i)++a;else{if("]"==i&&a==e){r.cur=o;break}a=null}return t}}function s(e){return function(t,n){for(var r,i=!1;null!=(r=t.next())&&(r!=e||i);)i=!i&&"\\"==r;return i||(n.cur=o),"string"}}var l=e.indentUnit,c=r(t.specials||[]),u=r(["_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load","loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require","select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall","coroutine.create","coroutine.resume","coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield","debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable","debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable","debug.setupvalue","debug.traceback","close","flush","lines","read","seek","setvbuf","write","io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin","io.stdout","io.tmpfile","io.type","io.write","math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg","math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max","math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh","math.sqrt","math.tan","math.tanh","os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale","os.time","os.tmpname","package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload","package.seeall","string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub","string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper","table.concat","table.insert","table.maxn","table.remove","table.sort"]),f=r(["and","break","elseif","false","nil","not","or","return","true","function","end","if","then","else","do","while","repeat","until","for","in","local"]),d=r(["function","if","repeat","do","\\(","{"]),p=r(["end","until","\\)","}"]),h=n(["end","until","\\)","}","else","elseif"]);return{startState:function(e){return{basecol:e||0,indentDepth:0,cur:o}},token:function(e,t){if(e.eatSpace())return null;var n=t.cur(e,t),r=e.current();return"variable"==n&&(f.test(r)?n="keyword":u.test(r)?n="builtin":c.test(r)&&(n="variable-2")),"comment"!=n&&"string"!=n&&(d.test(r)?++t.indentDepth:p.test(r)&&--t.indentDepth),n},indent:function(e,t){var n=h.test(t);return e.basecol+l*(e.indentDepth-(n?1:0))},lineComment:"--",blockCommentStart:"--[[",blockCommentEnd:"]]"}}),e.defineMIME("text/x-lua","lua")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("cmake",function(){function e(e,t){for(var n,r,i=!1;!e.eol()&&(n=e.next())!=t.pending;){if("$"===n&&"\\"!=r&&'"'==t.pending){i=!0;break}r=n}return i&&e.backUp(1),n==t.pending?t.continueString=!1:t.continueString=!0,"string"}function t(t,r){var i=t.next();return"$"===i?t.match(n)?"variable-2":"variable":r.continueString?(t.backUp(1),e(t,r)):t.match(/(\s+)?\w+\(/)||t.match(/(\s+)?\w+\ \(/)?(t.backUp(1),"def"):"#"==i?(t.skipToEnd(),"comment"):"'"==i||'"'==i?(r.pending=i,e(t,r)):"("==i||")"==i?"bracket":i.match(/[0-9]/)?"number":(t.eatWhile(/[\w-]/),null)}var n=/({)?[a-zA-Z0-9_]+(})?/;return{startState:function(){var e={};return e.inDefinition=!1,e.inInclude=!1,e.continueString=!1,e.pending=!1,e},token:function(e,n){return e.eatSpace()?null:t(e,n)}}}),e.defineMIME("text/x-cmake","cmake")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("nginx",function(e){function t(e){for(var t={},n=e.split(" "),r=0;r*\/]/.test(s)?n(null,"select-op"):/[;{}:\[\]]/.test(s)?n(null,s):(e.eatWhile(/[\w\\\-]/),n("variable","variable")):n(null,"compare"):void n(null,"compare")}function i(e,t){for(var i,o=!1;null!=(i=e.next());){if(o&&"/"==i){t.tokenize=r;break}o="*"==i}return n("comment","comment")}function o(e,t){for(var i,o=0;null!=(i=e.next());){if(o>=2&&">"==i){t.tokenize=r;break}o="-"==i?o+1:0}return n("comment","comment")}function a(e){return function(t,i){for(var o,a=!1;null!=(o=t.next())&&(o!=e||a);)a=!a&&"\\"==o;return a||(i.tokenize=r),n("string","string")}}var s,l=t("break return rewrite set accept_mutex accept_mutex_delay access_log add_after_body add_before_body add_header addition_types aio alias allow ancient_browser ancient_browser_value auth_basic auth_basic_user_file auth_http auth_http_header auth_http_timeout autoindex autoindex_exact_size autoindex_localtime charset charset_types client_body_buffer_size client_body_in_file_only client_body_in_single_buffer client_body_temp_path client_body_timeout client_header_buffer_size client_header_timeout client_max_body_size connection_pool_size create_full_put_path daemon dav_access dav_methods debug_connection debug_points default_type degradation degrade deny devpoll_changes devpoll_events directio directio_alignment empty_gif env epoll_events error_log eventport_events expires fastcgi_bind fastcgi_buffer_size fastcgi_buffers fastcgi_busy_buffers_size fastcgi_cache fastcgi_cache_key fastcgi_cache_methods fastcgi_cache_min_uses fastcgi_cache_path fastcgi_cache_use_stale fastcgi_cache_valid fastcgi_catch_stderr fastcgi_connect_timeout fastcgi_hide_header fastcgi_ignore_client_abort fastcgi_ignore_headers fastcgi_index fastcgi_intercept_errors fastcgi_max_temp_file_size fastcgi_next_upstream fastcgi_param fastcgi_pass_header fastcgi_pass_request_body fastcgi_pass_request_headers fastcgi_read_timeout fastcgi_send_lowat fastcgi_send_timeout fastcgi_split_path_info fastcgi_store fastcgi_store_access fastcgi_temp_file_write_size fastcgi_temp_path fastcgi_upstream_fail_timeout fastcgi_upstream_max_fails flv geoip_city geoip_country google_perftools_profiles gzip gzip_buffers gzip_comp_level gzip_disable gzip_hash gzip_http_version gzip_min_length gzip_no_buffer gzip_proxied gzip_static gzip_types gzip_vary gzip_window if_modified_since ignore_invalid_headers image_filter image_filter_buffer image_filter_jpeg_quality image_filter_transparency imap_auth imap_capabilities imap_client_buffer index ip_hash keepalive_requests keepalive_timeout kqueue_changes kqueue_events large_client_header_buffers limit_conn limit_conn_log_level limit_rate limit_rate_after limit_req limit_req_log_level limit_req_zone limit_zone lingering_time lingering_timeout lock_file log_format log_not_found log_subrequest map_hash_bucket_size map_hash_max_size master_process memcached_bind memcached_buffer_size memcached_connect_timeout memcached_next_upstream memcached_read_timeout memcached_send_timeout memcached_upstream_fail_timeout memcached_upstream_max_fails merge_slashes min_delete_depth modern_browser modern_browser_value msie_padding msie_refresh multi_accept open_file_cache open_file_cache_errors open_file_cache_events open_file_cache_min_uses open_file_cache_valid open_log_file_cache output_buffers override_charset perl perl_modules perl_require perl_set pid pop3_auth pop3_capabilities port_in_redirect postpone_gzipping postpone_output protocol proxy proxy_bind proxy_buffer proxy_buffer_size proxy_buffering proxy_buffers proxy_busy_buffers_size proxy_cache proxy_cache_key proxy_cache_methods proxy_cache_min_uses proxy_cache_path proxy_cache_use_stale proxy_cache_valid proxy_connect_timeout proxy_headers_hash_bucket_size proxy_headers_hash_max_size proxy_hide_header proxy_ignore_client_abort proxy_ignore_headers proxy_intercept_errors proxy_max_temp_file_size proxy_method proxy_next_upstream proxy_pass_error_message proxy_pass_header proxy_pass_request_body proxy_pass_request_headers proxy_read_timeout proxy_redirect proxy_send_lowat proxy_send_timeout proxy_set_body proxy_set_header proxy_ssl_session_reuse proxy_store proxy_store_access proxy_temp_file_write_size proxy_temp_path proxy_timeout proxy_upstream_fail_timeout proxy_upstream_max_fails random_index read_ahead real_ip_header recursive_error_pages request_pool_size reset_timedout_connection resolver resolver_timeout rewrite_log rtsig_overflow_events rtsig_overflow_test rtsig_overflow_threshold rtsig_signo satisfy secure_link_secret send_lowat send_timeout sendfile sendfile_max_chunk server_name_in_redirect server_names_hash_bucket_size server_names_hash_max_size server_tokens set_real_ip_from smtp_auth smtp_capabilities smtp_client_buffer smtp_greeting_delay so_keepalive source_charset ssi ssi_ignore_recycled_buffers ssi_min_file_chunk ssi_silent_errors ssi_types ssi_value_length ssl ssl_certificate ssl_certificate_key ssl_ciphers ssl_client_certificate ssl_crl ssl_dhparam ssl_engine ssl_prefer_server_ciphers ssl_protocols ssl_session_cache ssl_session_timeout ssl_verify_client ssl_verify_depth starttls stub_status sub_filter sub_filter_once sub_filter_types tcp_nodelay tcp_nopush thread_stack_size timeout timer_resolution types_hash_bucket_size types_hash_max_size underscores_in_headers uninitialized_variable_warn use user userid userid_domain userid_expires userid_mark userid_name userid_p3p userid_path userid_service valid_referers variables_hash_bucket_size variables_hash_max_size worker_connections worker_cpu_affinity worker_priority worker_processes worker_rlimit_core worker_rlimit_nofile worker_rlimit_sigpending worker_threads working_directory xclient xml_entities xslt_stylesheet xslt_typesdrew@li229-23"),c=t("http mail events server types location upstream charset_map limit_except if geo map"),u=t("include root server server_name listen internal proxy_pass memcached_pass fastcgi_pass try_files"),f=e.indentUnit; -return{startState:function(e){return{tokenize:r,baseIndent:e||0,stack:[]}},token:function(e,t){if(e.eatSpace())return null;s=null;var n=t.tokenize(e,t),r=t.stack[t.stack.length-1];return"hash"==s&&"rule"==r?n="atom":"variable"==n&&("rule"==r?n="number":r&&"@media{"!=r||(n="tag")),"rule"==r&&/^[\{\};]$/.test(s)&&t.stack.pop(),"{"==s?"@media"==r?t.stack[t.stack.length-1]="@media{":t.stack.push("{"):"}"==s?t.stack.pop():"@media"==s?t.stack.push("@media"):"{"==r&&"comment"!=s&&t.stack.push("rule"),n},indent:function(e,t){var n=e.stack.length;return/^\}/.test(t)&&(n-="rule"==e.stack[e.stack.length-1]?2:1),e.baseIndent+n*f},electricChars:"}"}}),e.defineMIME("text/x-nginx-conf","nginx")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){return e.string.charAt(e.pos+(t||0))}function n(e,t){if(t){var n=e.pos-t;return e.string.substr(n>=0?n:0,t)}return e.string.substr(0,e.pos-1)}function r(e,t){var n=e.string.length,r=n-e.pos+1;return e.string.substr(e.pos,t&&t=(n=e.string.length-1)?e.pos=n:e.pos=r}e.defineMode("perl",function(){function e(e,t,n,r,i){return t.chain=null,t.style=null,t.tail=null,t.tokenize=function(e,t){for(var o,s=!1,l=0;o=e.next();){if(o===n[l]&&!s)return void 0!==n[++l]?(t.chain=n[l],t.style=r,t.tail=i):i&&e.eatWhile(i),t.tokenize=a,r;s=!s&&"\\"==o}return r},t.tokenize(e,t)}function o(e,t,n){return t.tokenize=function(e,t){return e.string==n&&(t.tokenize=a),e.skipToEnd(),"string"},t.tokenize(e,t)}function a(a,u){if(a.eatSpace())return null;if(u.chain)return e(a,u,u.chain,u.style,u.tail);if(a.match(/^\-?[\d\.]/,!1)&&a.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/))return"number";if(a.match(/^<<(?=\w)/))return a.eatWhile(/\w/),o(a,u,a.current().substr(2));if(a.sol()&&a.match(/^\=item(?!\w)/))return o(a,u,"=cut");var f=a.next();if('"'==f||"'"==f){if(n(a,3)=="<<"+f){var d=a.pos;a.eatWhile(/\w/);var p=a.current().substr(1);if(p&&a.eat(f))return o(a,u,p);a.pos=d}return e(a,u,[f],"string")}if("q"==f){var h=t(a,-2);if(!h||!/\w/.test(h))if(h=t(a,0),"x"==h){if(h=t(a,1),"("==h)return i(a,2),e(a,u,[")"],l,c);if("["==h)return i(a,2),e(a,u,["]"],l,c);if("{"==h)return i(a,2),e(a,u,["}"],l,c);if("<"==h)return i(a,2),e(a,u,[">"],l,c);if(/[\^'"!~\/]/.test(h))return i(a,1),e(a,u,[a.eat(h)],l,c)}else if("q"==h){if(h=t(a,1),"("==h)return i(a,2),e(a,u,[")"],"string");if("["==h)return i(a,2),e(a,u,["]"],"string");if("{"==h)return i(a,2),e(a,u,["}"],"string");if("<"==h)return i(a,2),e(a,u,[">"],"string");if(/[\^'"!~\/]/.test(h))return i(a,1),e(a,u,[a.eat(h)],"string")}else if("w"==h){if(h=t(a,1),"("==h)return i(a,2),e(a,u,[")"],"bracket");if("["==h)return i(a,2),e(a,u,["]"],"bracket");if("{"==h)return i(a,2),e(a,u,["}"],"bracket");if("<"==h)return i(a,2),e(a,u,[">"],"bracket");if(/[\^'"!~\/]/.test(h))return i(a,1),e(a,u,[a.eat(h)],"bracket")}else if("r"==h){if(h=t(a,1),"("==h)return i(a,2),e(a,u,[")"],l,c);if("["==h)return i(a,2),e(a,u,["]"],l,c);if("{"==h)return i(a,2),e(a,u,["}"],l,c);if("<"==h)return i(a,2),e(a,u,[">"],l,c);if(/[\^'"!~\/]/.test(h))return i(a,1),e(a,u,[a.eat(h)],l,c)}else if(/[\^'"!~\/(\[{<]/.test(h)){if("("==h)return i(a,1),e(a,u,[")"],"string");if("["==h)return i(a,1),e(a,u,["]"],"string");if("{"==h)return i(a,1),e(a,u,["}"],"string");if("<"==h)return i(a,1),e(a,u,[">"],"string");if(/[\^'"!~\/]/.test(h))return e(a,u,[a.eat(h)],"string")}}if("m"==f){var h=t(a,-2);if((!h||!/\w/.test(h))&&(h=a.eat(/[(\[{<\^'"!~\/]/))){if(/[\^'"!~\/]/.test(h))return e(a,u,[h],l,c);if("("==h)return e(a,u,[")"],l,c);if("["==h)return e(a,u,["]"],l,c);if("{"==h)return e(a,u,["}"],l,c);if("<"==h)return e(a,u,[">"],l,c)}}if("s"==f){var h=/[\/>\]})\w]/.test(t(a,-2));if(!h&&(h=a.eat(/[(\[{<\^'"!~\/]/)))return"["==h?e(a,u,["]","]"],l,c):"{"==h?e(a,u,["}","}"],l,c):"<"==h?e(a,u,[">",">"],l,c):"("==h?e(a,u,[")",")"],l,c):e(a,u,[h,h],l,c)}if("y"==f){var h=/[\/>\]})\w]/.test(t(a,-2));if(!h&&(h=a.eat(/[(\[{<\^'"!~\/]/)))return"["==h?e(a,u,["]","]"],l,c):"{"==h?e(a,u,["}","}"],l,c):"<"==h?e(a,u,[">",">"],l,c):"("==h?e(a,u,[")",")"],l,c):e(a,u,[h,h],l,c)}if("t"==f){var h=/[\/>\]})\w]/.test(t(a,-2));if(!h&&(h=a.eat("r"),h&&(h=a.eat(/[(\[{<\^'"!~\/]/))))return"["==h?e(a,u,["]","]"],l,c):"{"==h?e(a,u,["}","}"],l,c):"<"==h?e(a,u,[">",">"],l,c):"("==h?e(a,u,[")",")"],l,c):e(a,u,[h,h],l,c)}if("`"==f)return e(a,u,[f],"variable-2");if("/"==f)return/~\s*$/.test(n(a))?e(a,u,[f],l,c):"operator";if("$"==f){var d=a.pos;if(a.eatWhile(/\d/)||a.eat("{")&&a.eatWhile(/\d/)&&a.eat("}"))return"variable-2";a.pos=d}if(/[$@%]/.test(f)){var d=a.pos;if(a.eat("^")&&a.eat(/[A-Z]/)||!/[@$%&]/.test(t(a,-2))&&a.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){var h=a.current();if(s[h])return"variable-2"}a.pos=d}if(/[$@%&]/.test(f)&&(a.eatWhile(/[\w$\[\]]/)||a.eat("{")&&a.eatWhile(/[\w$\[\]]/)&&a.eat("}"))){var h=a.current();return s[h]?"variable-2":"variable"}if("#"==f&&"$"!=t(a,-2))return a.skipToEnd(),"comment";if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(f)){var d=a.pos;if(a.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/),s[a.current()])return"operator";a.pos=d}if("_"==f&&1==a.pos){if("_END__"==r(a,6))return e(a,u,["\0"],"comment");if("_DATA__"==r(a,7))return e(a,u,["\0"],"variable-2");if("_C__"==r(a,7))return e(a,u,["\0"],"string")}if(/\w/.test(f)){var d=a.pos;if("{"==t(a,-2)&&("}"==t(a,0)||a.eatWhile(/\w/)&&"}"==t(a,0)))return"string";a.pos=d}if(/[A-Z]/.test(f)){var m=t(a,-2),d=a.pos;if(a.eatWhile(/[A-Z_]/),!/[\da-z]/.test(t(a,0))){var h=s[a.current()];return h?(h[1]&&(h=h[0]),":"!=m?1==h?"keyword":2==h?"def":3==h?"atom":4==h?"operator":5==h?"variable-2":"meta":"meta"):"meta"}a.pos=d}if(/[a-zA-Z_]/.test(f)){var m=t(a,-2);a.eatWhile(/\w/);var h=s[a.current()];return h?(h[1]&&(h=h[0]),":"!=m?1==h?"keyword":2==h?"def":3==h?"atom":4==h?"operator":5==h?"variable-2":"meta":"meta"):"meta"}return null}var s={"->":4,"++":4,"--":4,"**":4,"=~":4,"!~":4,"*":4,"/":4,"%":4,x:4,"+":4,"-":4,".":4,"<<":4,">>":4,"<":4,">":4,"<=":4,">=":4,lt:4,gt:4,le:4,ge:4,"==":4,"!=":4,"<=>":4,eq:4,ne:4,cmp:4,"~~":4,"&":4,"|":4,"^":4,"&&":4,"||":4,"//":4,"..":4,"...":4,"?":4,":":4,"=":4,"+=":4,"-=":4,"*=":4,",":4,"=>":4,"::":4,not:4,and:4,or:4,xor:4,BEGIN:[5,1],END:[5,1],PRINT:[5,1],PRINTF:[5,1],GETC:[5,1],READ:[5,1],READLINE:[5,1],DESTROY:[5,1],TIE:[5,1],TIEHANDLE:[5,1],UNTIE:[5,1],STDIN:5,STDIN_TOP:5,STDOUT:5,STDOUT_TOP:5,STDERR:5,STDERR_TOP:5,$ARG:5,$_:5,"@ARG":5,"@_":5,$LIST_SEPARATOR:5,'$"':5,$PROCESS_ID:5,$PID:5,$$:5,$REAL_GROUP_ID:5,$GID:5,"$(":5,$EFFECTIVE_GROUP_ID:5,$EGID:5,"$)":5,$PROGRAM_NAME:5,$0:5,$SUBSCRIPT_SEPARATOR:5,$SUBSEP:5,"$;":5,$REAL_USER_ID:5,$UID:5,"$<":5,$EFFECTIVE_USER_ID:5,$EUID:5,"$>":5,$a:5,$b:5,$COMPILING:5,"$^C":5,$DEBUGGING:5,"$^D":5,"${^ENCODING}":5,$ENV:5,"%ENV":5,$SYSTEM_FD_MAX:5,"$^F":5,"@F":5,"${^GLOBAL_PHASE}":5,"$^H":5,"%^H":5,"@INC":5,"%INC":5,$INPLACE_EDIT:5,"$^I":5,"$^M":5,$OSNAME:5,"$^O":5,"${^OPEN}":5,$PERLDB:5,"$^P":5,$SIG:5,"%SIG":5,$BASETIME:5,"$^T":5,"${^TAINT}":5,"${^UNICODE}":5,"${^UTF8CACHE}":5,"${^UTF8LOCALE}":5,$PERL_VERSION:5,"$^V":5,"${^WIN32_SLOPPY_STAT}":5,$EXECUTABLE_NAME:5,"$^X":5,$1:5,$MATCH:5,"$&":5,"${^MATCH}":5,$PREMATCH:5,"$`":5,"${^PREMATCH}":5,$POSTMATCH:5,"$'":5,"${^POSTMATCH}":5,$LAST_PAREN_MATCH:5,"$+":5,$LAST_SUBMATCH_RESULT:5,"$^N":5,"@LAST_MATCH_END":5,"@+":5,"%LAST_PAREN_MATCH":5,"%+":5,"@LAST_MATCH_START":5,"@-":5,"%LAST_MATCH_START":5,"%-":5,$LAST_REGEXP_CODE_RESULT:5,"$^R":5,"${^RE_DEBUG_FLAGS}":5,"${^RE_TRIE_MAXBUF}":5,$ARGV:5,"@ARGV":5,ARGV:5,ARGVOUT:5,$OUTPUT_FIELD_SEPARATOR:5,$OFS:5,"$,":5,$INPUT_LINE_NUMBER:5,$NR:5,"$.":5,$INPUT_RECORD_SEPARATOR:5,$RS:5,"$/":5,$OUTPUT_RECORD_SEPARATOR:5,$ORS:5,"$\\":5,$OUTPUT_AUTOFLUSH:5,"$|":5,$ACCUMULATOR:5,"$^A":5,$FORMAT_FORMFEED:5,"$^L":5,$FORMAT_PAGE_NUMBER:5,"$%":5,$FORMAT_LINES_LEFT:5,"$-":5,$FORMAT_LINE_BREAK_CHARACTERS:5,"$:":5,$FORMAT_LINES_PER_PAGE:5,"$=":5,$FORMAT_TOP_NAME:5,"$^":5,$FORMAT_NAME:5,"$~":5,"${^CHILD_ERROR_NATIVE}":5,$EXTENDED_OS_ERROR:5,"$^E":5,$EXCEPTIONS_BEING_CAUGHT:5,"$^S":5,$WARNING:5,"$^W":5,"${^WARNING_BITS}":5,$OS_ERROR:5,$ERRNO:5,"$!":5,"%OS_ERROR":5,"%ERRNO":5,"%!":5,$CHILD_ERROR:5,"$?":5,$EVAL_ERROR:5,"$@":5,$OFMT:5,"$#":5,"$*":5,$ARRAY_BASE:5,"$[":5,$OLD_PERL_VERSION:5,"$]":5,"if":[1,1],elsif:[1,1],"else":[1,1],"while":[1,1],unless:[1,1],"for":[1,1],foreach:[1,1],abs:1,accept:1,alarm:1,atan2:1,bind:1,binmode:1,bless:1,bootstrap:1,"break":1,caller:1,chdir:1,chmod:1,chomp:1,chop:1,chown:1,chr:1,chroot:1,close:1,closedir:1,connect:1,"continue":[1,1],cos:1,crypt:1,dbmclose:1,dbmopen:1,"default":1,defined:1,"delete":1,die:1,"do":1,dump:1,each:1,endgrent:1,endhostent:1,endnetent:1,endprotoent:1,endpwent:1,endservent:1,eof:1,eval:1,exec:1,exists:1,exit:1,exp:1,fcntl:1,fileno:1,flock:1,fork:1,format:1,formline:1,getc:1,getgrent:1,getgrgid:1,getgrnam:1,gethostbyaddr:1,gethostbyname:1,gethostent:1,getlogin:1,getnetbyaddr:1,getnetbyname:1,getnetent:1,getpeername:1,getpgrp:1,getppid:1,getpriority:1,getprotobyname:1,getprotobynumber:1,getprotoent:1,getpwent:1,getpwnam:1,getpwuid:1,getservbyname:1,getservbyport:1,getservent:1,getsockname:1,getsockopt:1,given:1,glob:1,gmtime:1,"goto":1,grep:1,hex:1,"import":1,index:1,"int":1,ioctl:1,join:1,keys:1,kill:1,last:1,lc:1,lcfirst:1,length:1,link:1,listen:1,local:2,localtime:1,lock:1,log:1,lstat:1,m:null,map:1,mkdir:1,msgctl:1,msgget:1,msgrcv:1,msgsnd:1,my:2,"new":1,next:1,no:1,oct:1,open:1,opendir:1,ord:1,our:2,pack:1,"package":1,pipe:1,pop:1,pos:1,print:1,printf:1,prototype:1,push:1,q:null,qq:null,qr:null,quotemeta:null,qw:null,qx:null,rand:1,read:1,readdir:1,readline:1,readlink:1,readpipe:1,recv:1,redo:1,ref:1,rename:1,require:1,reset:1,"return":1,reverse:1,rewinddir:1,rindex:1,rmdir:1,s:null,say:1,scalar:1,seek:1,seekdir:1,select:1,semctl:1,semget:1,semop:1,send:1,setgrent:1,sethostent:1,setnetent:1,setpgrp:1,setpriority:1,setprotoent:1,setpwent:1,setservent:1,setsockopt:1,shift:1,shmctl:1,shmget:1,shmread:1,shmwrite:1,shutdown:1,sin:1,sleep:1,socket:1,socketpair:1,sort:1,splice:1,split:1,sprintf:1,sqrt:1,srand:1,stat:1,state:1,study:1,sub:1,substr:1,symlink:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,tell:1,telldir:1,tie:1,tied:1,time:1,times:1,tr:null,truncate:1,uc:1,ucfirst:1,umask:1,undef:1,unlink:1,unpack:1,unshift:1,untie:1,use:1,utime:1,values:1,vec:1,wait:1,waitpid:1,wantarray:1,warn:1,when:1,write:1,y:null},l="string-2",c=/[goseximacplud]/;return{startState:function(){return{tokenize:a,chain:null,style:null,tail:null}},token:function(e,t){return(t.tokenize||a)(e,t)},lineComment:"#"}}),e.registerHelper("wordChars","perl",/[\w$]/),e.defineMIME("text/x-perl","perl")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("sass",function(e){function t(e){return new RegExp("^"+e.join("|"))}function n(e,t){var n=e.peek();return")"===n?(e.next(),t.tokenizer=l,"operator"):"("===n?(e.next(),e.eatSpace(),"operator"):"'"===n||'"'===n?(t.tokenizer=i(e.next()),"string"):(t.tokenizer=i(")",!1),"string")}function r(e,t){return function(n,r){return n.sol()&&n.indentation()<=e?(r.tokenizer=l,l(n,r)):(t&&n.skipTo("*/")?(n.next(),n.next(),r.tokenizer=l):n.skipToEnd(),"comment")}}function i(e,t){function n(r,i){var a=r.next(),s=r.peek(),c=r.string.charAt(r.pos-2),u="\\"!==a&&s===e||a===e&&"\\"!==c;return u?(a!==e&&t&&r.next(),i.tokenizer=l,"string"):"#"===a&&"{"===s?(i.tokenizer=o(n),r.next(),"operator"):"string"}return null==t&&(t=!0),n}function o(e){return function(t,n){return"}"===t.peek()?(t.next(),n.tokenizer=e,"operator"):l(t,n)}}function a(t){if(0==t.indentCount){t.indentCount++;var n=t.scopes[0].offset,r=n+e.indentUnit;t.scopes.unshift({offset:r})}}function s(e){1!=e.scopes.length&&e.scopes.shift()}function l(e,t){var c=e.peek();if(e.match("/*"))return t.tokenizer=r(e.indentation(),!0),t.tokenizer(e,t);if(e.match("//"))return t.tokenizer=r(e.indentation(),!1),t.tokenizer(e,t);if(e.match("#{"))return t.tokenizer=o(l),"operator";if('"'===c||"'"===c)return e.next(),t.tokenizer=i(c),"string";if(t.cursorHalf){if("#"===c&&(e.next(),e.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)))return e.peek()||(t.cursorHalf=0),"number";if(e.match(/^-?[0-9\.]+/))return e.peek()||(t.cursorHalf=0),"number";if(e.match(/^(px|em|in)\b/))return e.peek()||(t.cursorHalf=0),"unit";if(e.match(f))return e.peek()||(t.cursorHalf=0),"keyword";if(e.match(/^url/)&&"("===e.peek())return t.tokenizer=n,e.peek()||(t.cursorHalf=0),"atom";if("$"===c)return e.next(),e.eatWhile(/[\w-]/),e.peek()||(t.cursorHalf=0),"variable-3";if("!"===c)return e.next(),e.peek()||(t.cursorHalf=0),e.match(/^[\w]+/)?"keyword":"operator";if(e.match(p))return e.peek()||(t.cursorHalf=0),"operator";if(e.eatWhile(/[\w-]/))return e.peek()||(t.cursorHalf=0),"attribute";if(!e.peek())return t.cursorHalf=0,null}else{if("."===c){if(e.next(),e.match(/^[\w-]+/))return a(t),"atom";if("#"===e.peek())return a(t),"atom"}if("#"===c){if(e.next(),e.match(/^[\w-]+/))return a(t),"atom";if("#"===e.peek())return a(t),"atom"}if("$"===c)return e.next(),e.eatWhile(/[\w-]/),"variable-2";if(e.match(/^-?[0-9\.]+/))return"number";if(e.match(/^(px|em|in)\b/))return"unit";if(e.match(f))return"keyword";if(e.match(/^url/)&&"("===e.peek())return t.tokenizer=n,"atom";if("="===c&&e.match(/^=[\w-]+/))return a(t),"meta";if("+"===c&&e.match(/^\+[\w-]+/))return"variable-3";if("@"===c&&e.match(/@extend/)&&(e.match(/\s*[\w]/)||s(t)),e.match(/^@(else if|if|media|else|for|each|while|mixin|function)/))return a(t),"meta";if("@"===c)return e.next(),e.eatWhile(/[\w-]/),"meta";if(e.eatWhile(/[\w-]/))return e.match(/ *: *[\w-\+\$#!\("']/,!1)?"property":e.match(/ *:/,!1)?(a(t),t.cursorHalf=1,"atom"):e.match(/ *,/,!1)?"atom":(a(t),"atom");if(":"===c)return e.match(h)?"keyword":(e.next(),t.cursorHalf=1,"operator")}return e.match(p)?"operator":(e.next(),null)}function c(t,n){t.sol()&&(n.indentCount=0);var r=n.tokenizer(t,n),i=t.current();if("@return"!==i&&"}"!==i||s(n),null!==r){for(var o=t.pos-i.length,a=o+e.indentUnit*n.indentCount,l=[],c=0;c","<","==",">=","<=","\\+","-","\\!=","/","\\*","%","and","or","not",";","\\{","\\}",":"],p=t(d),h=/^::?[a-zA-Z_][\w\-]*/;return{startState:function(){return{tokenizer:l,scopes:[{offset:0,type:"sass"}],indentCount:0,cursorHalf:0,definedVars:[],definedMixins:[]}},token:function(e,t){var n=c(e,t);return t.lastToken={style:n,content:e.current()},n},indent:function(e){return e.scopes[0].offset}}}),e.defineMIME("text/x-sass","sass")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.registerHelper("wordChars","r",/[\w.]/),e.defineMode("r",function(e){function t(e){for(var t=e.split(" "),n={},r=0;r=!&|~$:]/;return{startState:function(){return{tokenize:n,ctx:{type:"top",indent:-e.indentUnit,align:!1},indent:0,afterIdent:!1}},token:function(e,t){if(e.sol()&&(null==t.ctx.align&&(t.ctx.align=!1),t.indent=e.indentation()),e.eatSpace())return null;var n=t.tokenize(e,t);"comment"!=n&&null==t.ctx.align&&(t.ctx.align=!0);var r=t.ctx.type;return";"!=a&&"{"!=a&&"}"!=a||"block"!=r||o(t),"{"==a?i(t,"}",e):"("==a?(i(t,")",e),t.afterIdent&&(t.ctx.argList=!0)):"["==a?i(t,"]",e):"block"==a?i(t,"block",e):a==r&&o(t),t.afterIdent="variable"==n||"keyword"==n,n},indent:function(t,r){if(t.tokenize!=n)return 0;var i=r&&r.charAt(0),o=t.ctx,a=i==o.type;return"block"==o.type?o.indent+("{"==i?0:e.indentUnit):o.align?o.column+(a?0:1):o.indent+(a?0:e.indentUnit)},lineComment:"#"}}),e.defineMIME("text/x-rsrc","r")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../../addon/mode/simple")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../addon/mode/simple"],e):e(CodeMirror)}(function(e){"use strict";var t=["from","maintainer","run","cmd","expose","env","add","copy","entrypoint","volume","user","workdir","onbuild"],n="("+t.join("|")+")",r=new RegExp(n+"\\s*$","i"),i=new RegExp(n+"(\\s+)","i");e.defineSimpleMode("dockerfile",{start:[{regex:/#.*$/,token:"comment"},{regex:r,token:"variable-2"},{regex:i,token:["variable-2",null],next:"arguments"},{regex:/./,token:null}],arguments:[{regex:/#.*$/,token:"error",next:"start"},{regex:/[^#]+\\$/,token:null},{regex:/[^#]+/,token:null,next:"start"},{regex:/$/,token:null,next:"start"},{token:null,next:"start"}],meta:{lineComment:"#"}}),e.defineMIME("text/x-dockerfile","dockerfile")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("tiddlywiki",function(){function e(e,t,n){return t.tokenize=n,n(e,t)}function t(t,u){var x=t.sol(),w=t.peek();if(u.block=!1,x&&/[<\/\*{}\-]/.test(w)){if(t.match(k))return u.block=!0,e(t,u,i);if(t.match(m))return"quote";if(t.match(p)||t.match(h))return"comment";if(t.match(g)||t.match(v)||t.match(y)||t.match(b))return"comment";if(t.match(d))return"hr"}if(t.next(),x&&/[\/\*!#;:>|]/.test(w)){if("!"==w)return t.skipToEnd(),"header";if("*"==w)return t.eatWhile("*"),"comment";if("#"==w)return t.eatWhile("#"),"comment";if(";"==w)return t.eatWhile(";"),"comment";if(":"==w)return t.eatWhile(":"),"comment";if(">"==w)return t.eatWhile(">"),"quote";if("|"==w)return"header"}if("{"==w&&t.match(/\{\{/))return e(t,u,i);if(/[hf]/i.test(w)&&/[ti]/i.test(t.peek())&&t.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i))return"link";if('"'==w)return"string";if("~"==w)return"brace";if(/[\[\]]/.test(w)&&t.match(w))return"brace";if("@"==w)return t.eatWhile(f),"link";if(/\d/.test(w))return t.eatWhile(/\d/),"number";if("/"==w){if(t.eat("%"))return e(t,u,n);if(t.eat("/"))return e(t,u,o)}if("_"==w&&t.eat("_"))return e(t,u,a);if("-"==w&&t.eat("-")){if(" "!=t.peek())return e(t,u,s);if(" "==t.peek())return"brace"}return"'"==w&&t.eat("'")?e(t,u,r):"<"==w&&t.eat("<")?e(t,u,l):(t.eatWhile(/[\w\$_]/),c.propertyIsEnumerable(t.current())?"keyword":null)}function n(e,n){for(var r,i=!1;r=e.next();){if("/"==r&&i){n.tokenize=t;break}i="%"==r}return"comment"}function r(e,n){for(var r,i=!1;r=e.next();){if("'"==r&&i){n.tokenize=t;break}i="'"==r}return"strong"}function i(e,n){var r=n.block;return r&&e.current()?"comment":!r&&e.match(w)?(n.tokenize=t,"comment"):r&&e.sol()&&e.match(x)?(n.tokenize=t,"comment"):(e.next(),"comment")}function o(e,n){for(var r,i=!1;r=e.next();){if("/"==r&&i){n.tokenize=t;break}i="/"==r}return"em"}function a(e,n){for(var r,i=!1;r=e.next();){if("_"==r&&i){n.tokenize=t;break}i="_"==r}return"underlined"}function s(e,n){for(var r,i=!1;r=e.next();){if("-"==r&&i){n.tokenize=t;break}i="-"==r}return"strikethrough"}function l(e,n){if("<<"==e.current())return"macro";var r=e.next();return r?">"==r&&">"==e.peek()?(e.next(),n.tokenize=t,"macro"):(e.eatWhile(/[\w\$_]/),u.propertyIsEnumerable(e.current())?"keyword":null):(n.tokenize=t,null)}var c={},u={allTags:!0,closeAll:!0,list:!0,newJournal:!0,newTiddler:!0,permaview:!0,saveChanges:!0,search:!0,slider:!0,tabs:!0,tag:!0,tagging:!0,tags:!0,tiddler:!0,timeline:!0,today:!0,version:!0,option:!0,"with":!0,filter:!0},f=/[\w_\-]/i,d=/^\-\-\-\-+$/,p=/^\/\*\*\*$/,h=/^\*\*\*\/$/,m=/^<<<$/,g=/^\/\/\{\{\{$/,v=/^\/\/\}\}\}$/,y=/^$/,b=/^$/,k=/^\{\{\{$/,x=/^\}\}\}$/,w=/.*?\}\}\}/;return{startState:function(){return{tokenize:t}},token:function(e,t){if(e.eatSpace())return null;var n=t.tokenize(e,t);return n}}}),e.defineMIME("text/x-tiddlywiki","tiddlywiki")}),function(e){e(CodeMirror)}(function(e){"use strict";function t(e,t,n){var r;return r=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),r?n+=" mw-mnemonic":t}function n(e,n){return function(r,i,o){o&&r.sol()?i.ownLine=!0:o===!1&&i.ownLine&&(i.ownLine=!1);var a=i.ownLine?n:e;return r.match(/[^&]+/)?a:(r.next(),t(r,a,a))}}e.defineMode("mediawiki",function(n){function r(e,t,n){return t.isBold&&(e+=" strong"),t.isItalic&&(e+=" em"),i(e,t,n)}function i(e,t,n){var r="";switch(t.nTemplate){case 0:break;case 1:r+="-template";break;case 2:r+="-template2";break;default:r+="-template3"}switch(t.nExt){case 0:break;case 1:r+="-ext";break;case 2:r+="-ext2";break;default:r+="-ext3"}return t.nLink>0&&(r+="-link"),""!==r&&(e="mw"+r+"-ground "+e),n&&t[n]--,e}function o(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=r.stack.pop();break}n.next()}return i(e,r)}}function a(e){return function(t,n){return t.skipToEnd(),n.tokenize=n.stack.pop(),i(e,n)}}function s(e,t){return function(n,r){return r.tokenize=r.stack.pop(),n.eat(e)?i(t,r):i("error",r)}}function l(e){return function(t,n){return t.match(/[^&<\[\{~]+/)?(t.eol()&&(t.backUp(e),n.tokenize=a("mw-section-header")),null):E("","")(t,n)}}function c(e,t){return e.match(/[^\{\}\|]+/)?i("mw-templatevariable-name",t):e.eat("|")?(t.tokenize=u,i("mw-templatevariable-delimiter",t)):e.match("}}}")?(t.tokenize=t.stack.pop(),i("mw-templatevariable-bracket",t)):e.match("{{{")?(t.stack.push(t.tokenize),i("mw-templatevariable-bracket",t)):(e.next(),i("mw-templatevariable-name",t))}function u(e,t){return e.match(/[^\{\}\[<\&~]+/)?i("mw-templatevariable",t):e.match("}}}")?(t.tokenize=t.stack.pop(),i("mw-templatevariable-bracket",t)):E("mw-templatevariable","")(e,t)}function f(e,t){return e.match(/#?[^\:\}\{~]+/)?i("mw-parserfunction-name",t):e.eat(":")?(t.tokenize=d,i("mw-parserfunction-delimiter",t)):e.match("}}")?(t.tokenize=t.stack.pop(),i("mw-parserfunction-bracket",t,"nExt")):E("mw-parserfunction","")(e,t)}function d(e,t){return e.match(/[^\|\}\{\[<\&~]+/)?i("mw-parserfunction",t):e.eat("|")?i("mw-parserfunction-delimiter",t):e.match("}}")?(t.tokenize=t.stack.pop(),i("mw-parserfunction-bracket",t,"nExt")):E("mw-parserfunction","")(e,t)}function p(e){return function(t,n){return t.match(/[\s\u00a0]*\|[\s\u00a0]*/)?(n.tokenize=h(!0),i("mw-template-delimiter",n)):t.match(/[\s\u00a0]*\}\}/)?(n.tokenize=n.stack.pop(),i("mw-template-bracket",n,"nTemplate")):e&&t.sol()?(n.nTemplate--,void(n.tokenize=n.stack.pop())):t.match(/[\s\u00a0]*[^\s\u00a0\|\}<\{\&~]+/)?(n.tokenize=p(!0),i("mw-template-name mw-pagename",n)):t.eatSpace()?t.eol()===!0?i("mw-template-name",n):i("mw-template-name mw-pagename",n):E("mw-template-name mw-pagename","mw-template-name-mnemonic mw-pagename")(t,n)}}function h(e){return function(t,n){return e&&t.eatWhile(/[^=\|\}\{\[<\&~]/)?t.eat("=")?(n.tokenize=h(!1),i("mw-template-argument-name",n)):i("mw-template",n):t.eatWhile(/[^\|\}\{\[<\&~]/)?i("mw-template",n):t.eat("|")?(n.tokenize=h(!0),i("mw-template-delimiter",n)):t.match("}}")?(n.tokenize=n.stack.pop(),i("mw-template-bracket",n,"nTemplate")):E("mw-template","")(t,n)}}function m(e){return function(t,n){for(;e>0;)e--,t.next();return t.eol()?(n.nLink--,n.tokenize=n.stack.pop()):n.tokenize=g,i("mw-extlink-protocol",n)}}function g(e,t){return e.sol()?(t.nLink--,void(t.tokenize=t.stack.pop())):e.match(/[\s\u00a0]*\]/)?(t.tokenize=t.stack.pop(),i("mw-extlink-bracket",t,"nLink")):e.eatSpace()?(t.tokenize=v,r("",t)):e.match(/[^\s\u00a0\]\{\&~]+/)||e.eatSpace()?r("mw-extlink",t):E("mw-extlink","")(e,t)}function v(e,t){return e.sol()?(t.nLink--,void(t.tokenize=t.stack.pop())):e.eat("]")?(t.tokenize=t.stack.pop(),i("mw-extlink-bracket",t,"nLink")):e.match(/[^'\]\{\&~]+/)?r("mw-extlink-text",t):E("mw-extlink-text","")(e,t)}function y(e,t){return e.sol()?(t.nLink--,void(t.tokenize=t.stack.pop())):e.match(/[\s\u00a0]*#[\s\u00a0]*/)?(t.tokenize=b,i("mw-link",t)):e.match(/[\s\u00a0]*\|[\s\u00a0]*/)?(t.tokenize=k(),i("mw-link-delimiter",t)):e.match(/[\s\u00a0]*\]\]/)?(t.tokenize=t.stack.pop(),i("mw-link-bracket",t,"nLink")):e.match(/[\s\u00a0]*[^\s\u00a0#\|\]\&~\{]+/)||e.eatSpace()?r("mw-link-pagename mw-pagename",t):E("mw-link-pagename mw-pagename","mw-pagename")(e,t)}function b(e,t){return e.sol()?(t.nLink--,void(t.tokenize=t.stack.pop())):e.match(/[^\|\]\&~\{\}]+/)?i("mw-link-tosection",t):e.eat("|")?(t.tokenize=k(),i("mw-link-delimiter",t)):e.match("]]")?(t.tokenize=t.stack.pop(),i("mw-link-bracket",t,"nLink")):E("mw-link-tosection","")(e,t)}function k(){var e,t;return function(n,o){if(n.match("]]"))return o.tokenize=o.stack.pop(),i("mw-link-bracket",o,"nLink");if(n.match("'''"))return e=!e,i("mw-link-text mw-apostrophes",o);if(n.match("''"))return t=!t,i("mw-link-text mw-apostrophes",o);var a="mw-link-text";return e&&(a+=" strong"),t&&(a+=" em"),n.match(/[^'\]\{\&~]+/)?r(a,o):E(a,"")(n,o)}}function x(e,t,n){return function(r,o){for(var a="";e>0;)e--,a+=r.next();return r.eol()?(o.tokenize=o.stack.pop(),i(n?"mw-htmltag-name":"mw-exttag-name",o)):(r.eatSpace(),r.eol()?(o.tokenize=o.stack.pop(),i(n?"mw-htmltag-name":"mw-exttag-name",o)):n?(t?o.tokenize=s(">","mw-htmltag-bracket"):o.tokenize=w(a),i("mw-htmltag-name",o)):(t?o.tokenize=s(">","mw-exttag-bracket"):o.tokenize=_(a),i("mw-exttag-name",o)))}}function w(e){return function(t,n){return t.match(/[^>\/<\{\&~]+/)?i("mw-htmltag-attribute",n):t.eat(">")?(n.InHtmlTag.push(e),n.tokenize=n.stack.pop(),i("mw-htmltag-bracket",n)):t.match("/>")?(n.tokenize=n.stack.pop(),i("mw-htmltag-bracket",n)):E("mw-htmltag-attribute","")(t,n)}}function _(t){return function(r,o){return r.match(/[^>\/<\{\&~]+/)?i("mw-exttag-attribute",o):r.eat(">")?(o.extName=t,n.mwextMode&&t in n.mwextMode.tag&&(o.extMode=e.getMode(n,n.mwextMode.tag[t]),o.extState=e.startState(o.extMode)),o.tokenize=C(t),i("mw-exttag-bracket",o)):r.match("/>")?(o.tokenize=o.stack.pop(),i("mw-exttag-bracket",o)):E("mw-exttag-attribute","")(r,o)}}function C(e){return function(t,n){var r,i=!1,o=t.pos,a=new RegExp(""),s=a.exec(o?t.string.slice(o):t.string);if(s){if(0===s.index)return n.tokenize=S(e),n.extName=!1,n.extMode!==!1&&(n.extMode=!1,n.extState=!1),n.tokenize(t,n);r=s.index+o,i=t.string,t.string=i.slice(0,r)}return n.stack.push(n.tokenize),n.tokenize=M(i),n.tokenize(t,n)}}function S(e){return function(t,n){return t.next(),t.next(),n.tokenize=x(e.length,!0,!1),i("mw-exttag-bracket",n)}}function M(e){return function(t,n){var r;return n.extMode===!1?(r=e===!1&&t.sol()?"line-cm-mw-exttag":"mw-exttag",t.skipToEnd()):(r=(e===!1&&t.sol()?"line-cm-mw-tag-":"mw-tag-")+n.extName,r+=" "+n.extMode.token(t,n.extState,e===!1)),t.eol()&&(e!==!1&&(t.string=e),n.tokenize=n.stack.pop()),i(r,n)}}function L(e,t){return e.sol()?(t.tokenize=T,T(e,t)):E("mw-table-definition","")(e,t)}function T(e,t){if(e.sol()){if(e.eat("|"))return e.eat("-")?(e.eatSpace(),t.tokenize=L,i("mw-table-delimiter",t)):e.eat("}")?(t.tokenize=t.stack.pop(),i("mw-table-bracket",t)):(e.eatSpace(),t.tokenize=A(!0,!1),i("mw-table-delimiter",t));if(e.eat("!"))return e.eatSpace(),t.tokenize=A(!0,!0),i("mw-table-delimiter",t)}return E("","")(e,t)}function A(e,t){return function(n,o){if(n.sol()){var a=n.peek();if("|"===a||"!"===a)return o.tokenize=T,o.tokenize(n,o);o.isBold=!1,o.isItalic=!1}else{if(n.match(/[^'\|\{\[<\&~]+/))return r(t?"strong":"",o);if(n.match("||")||t&&n.match("!!")||e&&n.eat("|"))return o.isBold=!1,o.isItalic=!1,e&&(o.tokenize=A(!1,t)),i("mw-table-delimiter",o)}return E(t?"strong":"",t?"strong":"")(n,o)}}function E(e,a){return function(s,u){function d(e){return u.stack.push(u.tokenize),u.tokenize=e,e(s,u)}var h=s.sol(),g=s.next();if(h)switch(u.isBold=!1,u.isItalic=!1,g){case" ":return"mw-skipformatting";case"-":if(s.match("---"))return"mw-hr";break;case"=":var v=s.match(/(={0,5})(.+?(=\1\s*))$/);if(v)return s.backUp(v[2].length),u.stack.push(u.tokenize),u.tokenize=l(v[3].length),"mw-section-header line-cm-mw-section-"+(v[1].length+1);break;case"*":case"#":if(s.match(/[\*#]*:*/))return"mw-list";break;case":":if(s.match(/:*[\*#]*/))return"mw-indenting";break;case"{":if(s.eat("|"))return s.eatSpace(),u.stack.push(u.tokenize),u.tokenize=L,"mw-table-bracket"}switch(g){case"&":return r(t(s,e,a),u);case"'":if(s.match("''"))return u.isBold=!u.isBold,i("mw-apostrophes",u);if(s.eat("'"))return u.isItalic=!u.isItalic,i("mw-apostrophes",u);break;case"[":if(s.eat("[")){if(s.eatSpace(),/[^\]\|\[]/.test(s.peek()))return u.nLink++,u.stack.push(u.tokenize),u.tokenize=y,i("mw-link-bracket",u)}else{var b=s.match(z);if(b)return u.nLink++,s.backUp(b[0].length),u.stack.push(u.tokenize),u.tokenize=m(b[0].length),i("mw-extlink-bracket",u)}break;case"{":if(s.match("{{"))return s.eatSpace(),u.stack.push(u.tokenize),u.tokenize=c,i("mw-templatevariable-bracket",u);if(s.match(/\{[\s\u00a0]*/)){if("#"===s.peek())return u.nExt++,u.stack.push(u.tokenize),u.tokenize=f,i("mw-parserfunction-bracket",u);var k=s.match(/([^\s\u00a0\}\[\]<\{\'\|\&\:]+)(\:|[\s\u00a0]*)(\}\}?)?(.)?/);return k&&(s.backUp(k[0].length),(":"===k[2]||void 0===k[4]||"}}"===k[3])&&n.mwextFunctionSynonyms&&(k[1].toLowerCase()in n.mwextFunctionSynonyms[0]||k[1]in n.mwextFunctionSynonyms[1]))?(u.nExt++,u.stack.push(u.tokenize),u.tokenize=f,i("mw-parserfunction-bracket",u)):(u.nTemplate++,u.stack.push(u.tokenize),u.tokenize=p(!1),i("mw-template-bracket",u))}break;case"<":if(s.match("!--"))return d(o("mw-comment","-->"));var w=!!s.eat("/"),_=s.match(/[^>\/\s\u00a0\.\*\,\[\]\{\}\$\^\+\?\|\/\\'`~<=!@#%&\(\)-]+/);if(_){if(_=_[0].toLowerCase(),n.mwextTags&&_ in n.mwextTags)return w===!0?"error":(s.backUp(_.length),u.stack.push(u.tokenize),u.tokenize=x(_.length,w,!1),i("mw-exttag-bracket",u));if(_ in O)return w===!0&&_!==u.InHtmlTag.pop()?"error":(s.backUp(_.length),u.stack.push(u.tokenize),u.tokenize=x(_.length,w,!0),i("mw-htmltag-bracket",u));s.backUp(_.length)}break;case"~":if(s.match(/~{2,4}/))return"mw-signature"}s.match(/[^\s\u00a0_>\}\[\]<\{\'\|\&\:~]+/);var C=r(e,u);return C}}var z=new RegExp(n.mwextUrlProtocols,"i"),O={b:!0,bdi:!0,del:!0,i:!0,ins:!0,u:!0,font:!0,big:!0,small:!0,sub:!0,sup:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,cite:!0,code:!0,em:!0,s:!0,strike:!0,strong:!0,tt:!0,"var":!0,div:!0,center:!0,blockquote:!0,ol:!0,ul:!0,dl:!0,table:!0,caption:!0,pre:!0,ruby:!0,rb:!0,rp:!0,rt:!0,rtc:!0,p:!0,span:!0,abbr:!0,dfn:!0,kbd:!0,samp:!0, -data:!0,time:!0,mark:!0,br:!0,wbr:!0,hr:!0,li:!0,dt:!0,dd:!0,td:!0,th:!0,tr:!0,noinclude:!0,includeonly:!0,onlyinclude:!0};return{startState:function(){return{tokenize:E("",""),stack:[],InHtmlTag:[],isBold:!1,isItalic:!1,extName:!1,extMode:!1,extState:!1,nTemplate:0,nLink:0,nExt:0}},copyState:function(t){return{tokenize:t.tokenize,stack:t.stack.concat([]),InHtmlTag:t.InHtmlTag.concat([]),isBold:t.isBold,isItalic:t.isItalic,extName:t.extName,extMode:t.extMode,extState:t.extMode!==!1&&e.copyState(t.extMode,t.extState),nTemplate:t.nTemplate,nLink:t.nLink,nExt:t.nExt}},token:function(e,t){return t.tokenize(e,t)},blankLine:function(e){if(e.extName){if(e.extMode){var t="";return e.extMode.blankLine&&(t=" "+e.extMode.blankLine(e.extState)),"line-cm-mw-tag-"+e.extName+t}return"line-cm-mw-exttag"}}}}),e.defineMIME("text/mediawiki","mediawiki"),e.defineMode("mw-tag-pre",function(){return{startState:function(){return{}},token:n("mw-tag-pre","line-cm-mw-tag-pre")}}),e.defineMode("mw-tag-nowiki",function(){return{startState:function(){return{}},token:n("mw-tag-nowiki","line-cm-mw-tag-nowiki")}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../lib/codemirror")):"function"==typeof define&&define.amd?define(["../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){return e.line==t.line&&e.ch==t.ch}function n(e){N.push(e),N.length>50&&N.shift()}function r(e){return N.length?void(N[N.length-1]+=e):n(e)}function i(e){return N[N.length-(e?Math.min(e,1):1)]||""}function o(){return N.length>1&&N.pop(),i()}function a(e,i,o,a,s){null==s&&(s=e.getRange(i,o)),a&&q&&q.cm==e&&t(i,q.pos)&&e.isClean(q.gen)?r(s):n(s),e.replaceRange("",i,o,"+delete"),q=a?{cm:e,pos:i,gen:e.changeGeneration()}:null}function s(e,t,n){return e.findPosH(t,n,"char",!0)}function l(e,t,n){return e.findPosH(t,n,"word",!0)}function c(e,t,n){return e.findPosV(t,n,"line",e.doc.sel.goalColumn)}function u(e,t,n){return e.findPosV(t,n,"page",e.doc.sel.goalColumn)}function f(e,t,n){for(var r=t.line,i=e.getLine(r),o=/\S/.test(n<0?i.slice(0,t.ch):i.slice(t.ch)),a=e.firstLine(),s=e.lastLine();;){if(r+=n,rs)return e.clipPos(I(r-n,n<0?0:null));i=e.getLine(r);var l=/\S/.test(i);if(l)o=!0;else if(o)return I(r,0)}}function d(e,t,n){for(var r=t.line,i=t.ch,o=e.getLine(t.line),a=!1;;){var s=o.charAt(i+(n<0?-1:0));if(s){if(a&&/[!?.]/.test(s))return I(r,i+(n>0?1:0));a||(a=/\w/.test(s)),i+=n}else{if(r==(n<0?e.firstLine():e.lastLine()))return I(r,i);if(o=e.getLine(r+n),!/\S/.test(o))return I(r,i);r+=n,i=n<0?o.length:0}}}function p(e,n,r){var i;if(e.findMatchingBracket&&(i=e.findMatchingBracket(n,!0))&&i.match&&(i.forward?1:-1)==r)return r>0?I(i.to.line,i.to.ch+1):i.to;for(var o=!0;;o=!1){var a=e.getTokenAt(n),s=I(n.line,r<0?a.start:a.end);if(!(o&&r>0&&a.end==n.ch)&&/\w/.test(a.string))return s;var l=e.findPosH(s,r,"char");if(t(s,l))return n;n=l}}function h(e,t){var n=e.state.emacsPrefix;return n?(w(e),"-"==n?-1:Number(n)):t?null:1}function m(e){var t="string"==typeof e?function(t){t.execCommand(e)}:e;return function(e){var n=h(e);t(e);for(var r=1;r1&&"+input"==t.origin){for(var r=t.text.join("\n"),i="",o=1;o',n,{bottom:!0}):n(prompt(t,""))}function A(e,t){var n=e.getCursor(),r=e.findPosH(n,1,"word");e.replaceRange(t(e.getRange(n,r)),n,r),e.setCursor(r)}function E(e){for(var t=e.getCursor(),n=t.line,r=t.ch,i=[];n>=e.firstLine();){for(var o=e.getLine(n),a=null==r?o.length:r;a>0;){var r=o.charAt(--a);if(")"==r)i.push("(");else if("]"==r)i.push("[");else if("}"==r)i.push("{");else if(/[\(\{\[]/.test(r)&&(!i.length||i.pop()!=r))return e.extendSelection(I(n,a))}--n,r=null}}function z(e){e.execCommand("clearSearch"),L(e)}function O(e){j[e]=function(t){k(t,e)},R["Ctrl-"+e]=function(t){k(t,e)},P["Ctrl-"+e]=!0}for(var I=e.Pos,N=[],q=null,P={"Alt-G":!0,"Ctrl-X":!0,"Ctrl-Q":!0,"Ctrl-U":!0},R=e.keyMap.emacs=e.normalizeKeyMap({"Ctrl-W":function(e){a(e,e.getCursor("start"),e.getCursor("end"))},"Ctrl-K":m(function(e){var t=e.getCursor(),n=e.clipPos(I(t.line)),r=e.getRange(t,n);/\S/.test(r)||(r+="\n",n=I(t.line+1,0)),a(e,t,n,!0,r)}),"Alt-W":function(e){n(e.getSelection()),L(e)},"Ctrl-Y":function(e){var t=e.getCursor();e.replaceRange(i(h(e)),t,t,"paste"),e.setSelection(t,e.getCursor())},"Alt-Y":function(e){e.replaceSelection(o(),"around","paste")},"Ctrl-Space":M,"Ctrl-Shift-2":M,"Ctrl-F":v(s,1),"Ctrl-B":v(s,-1),Right:v(s,1),Left:v(s,-1),"Ctrl-D":function(e){y(e,s,1)},Delete:function(e){b(e)||y(e,s,1)},"Ctrl-H":function(e){y(e,s,-1)},Backspace:function(e){b(e)||y(e,s,-1)},"Alt-F":v(l,1),"Alt-B":v(l,-1),"Alt-D":function(e){y(e,l,1)},"Alt-Backspace":function(e){y(e,l,-1)},"Ctrl-N":v(c,1),"Ctrl-P":v(c,-1),Down:v(c,1),Up:v(c,-1),"Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd",End:"goLineEnd",Home:"goLineStart","Alt-V":v(u,-1),"Ctrl-V":v(u,1),PageUp:v(u,-1),PageDown:v(u,1),"Ctrl-Up":v(f,-1),"Ctrl-Down":v(f,1),"Alt-A":v(d,-1),"Alt-E":v(d,1),"Alt-K":function(e){y(e,d,1)},"Ctrl-Alt-K":function(e){y(e,p,1)},"Ctrl-Alt-Backspace":function(e){y(e,p,-1)},"Ctrl-Alt-F":v(p,1),"Ctrl-Alt-B":v(p,-1),"Shift-Ctrl-Alt-2":function(e){var t=e.getCursor();e.setSelection(g(e,t,p,1),t)},"Ctrl-Alt-T":function(e){var t=p(e,e.getCursor(),-1),n=p(e,t,1),r=p(e,n,1),i=p(e,r,-1);e.replaceRange(e.getRange(i,r)+e.getRange(n,i)+e.getRange(t,n),t,r)},"Ctrl-Alt-U":m(E),"Alt-Space":function(e){for(var t=e.getCursor(),n=t.ch,r=t.ch,i=e.getLine(t.line);n&&/\s/.test(i.charAt(n-1));)--n;for(;r0?e.setCursor(t-1):void T(e,"Goto line",function(t){var n;t&&!isNaN(n=Number(t))&&n==(0|n)&&n>0&&e.setCursor(n-1)})},"Ctrl-X Tab":function(e){e.indentSelection(h(e,!0)||e.getOption("indentUnit"))},"Ctrl-X Ctrl-X":function(e){e.setSelection(e.getCursor("head"),e.getCursor("anchor"))},"Ctrl-X Ctrl-S":"save","Ctrl-X Ctrl-W":"save","Ctrl-X S":"saveAll","Ctrl-X F":"open","Ctrl-X U":m("undo"),"Ctrl-X K":"close","Ctrl-X Delete":function(e){a(e,e.getCursor(),d(e,e.getCursor(),1),!0)},"Ctrl-X H":"selectAll","Ctrl-Q Tab":m("insertTab"),"Ctrl-U":C}),j={"Ctrl-G":w},D=0;D<10;++D)O(String(D));O("-")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../lib/codemirror"),require("../addon/search/searchcursor"),require("../addon/edit/matchbrackets")):"function"==typeof define&&define.amd?define(["../lib/codemirror","../addon/search/searchcursor","../addon/edit/matchbrackets"],e):e(CodeMirror)}(function(e){"use strict";function t(t,n,r){if(r<0&&0==n.ch)return t.clipPos(d(n.line-1));var i=t.getLine(n.line);if(r>0&&n.ch>=i.length)return t.clipPos(d(n.line+1,0));for(var o,a="start",s=n.ch,l=r<0?0:i.length,c=0;s!=l;s+=r,c++){var u=i.charAt(r<0?s-1:s),f="_"!=u&&e.isWordChar(u)?"w":"o";if("w"==f&&u.toUpperCase()==u&&(f="W"),"start"==a)"o"!=f&&(a="in",o=f);else if("in"==a&&o!=f){if("w"==o&&"W"==f&&r<0&&s--,"W"==o&&"w"==f&&r>0){o="w";continue}break}}return d(n.line,s)}function n(e,n){e.extendSelectionsBy(function(r){return e.display.shift||e.doc.extend||r.empty()?t(e.doc,r.head,n):n<0?r.from():r.to()})}function r(t,n){return t.isReadOnly()?e.Pass:(t.operation(function(){for(var e=t.listSelections().length,r=[],i=-1,o=0;o=0;s--){var l=r[o[s]];if(!(c&&e.cmpPos(l.head,c)>0)){var u=i(t,l.head);c=u.from,t.replaceRange(n(u.word),u.from,u.to)}}})}function l(t){var n=t.getCursor("from"),r=t.getCursor("to");if(0==e.cmpPos(n,r)){var o=i(t,n);if(!o.word)return;n=o.from,r=o.to}return{from:n,to:r,query:t.getRange(n,r),word:o}}function c(e,t){var n=l(e);if(n){var r=n.query,i=e.getSearchCursor(r,t?n.to:n.from);(t?i.findNext():i.findPrevious())?e.setSelection(i.from(),i.to()):(i=e.getSearchCursor(r,t?d(e.firstLine(),0):e.clipPos(d(e.lastLine()))),(t?i.findNext():i.findPrevious())?e.setSelection(i.from(),i.to()):n.word&&e.setSelection(n.from,n.to))}}var u=e.keyMap.sublime={fallthrough:"default"},f=e.commands,d=e.Pos,p=e.keyMap["default"]==e.keyMap.macDefault,h=p?"Cmd-":"Ctrl-",m=p?"Ctrl-":"Alt-";f[u[m+"Left"]="goSubwordLeft"]=function(e){n(e,-1)},f[u[m+"Right"]="goSubwordRight"]=function(e){n(e,1)},p&&(u["Cmd-Left"]="goLineStartSmart");var g=p?"Ctrl-Alt-":"Ctrl-";f[u[g+"Up"]="scrollLineUp"]=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top+t.clientHeight,"local");e.getCursor().line>=n&&e.execCommand("goLineUp")}e.scrollTo(null,t.top-e.defaultTextHeight())},f[u[g+"Down"]="scrollLineDown"]=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top,"local")+1;e.getCursor().line<=n&&e.execCommand("goLineDown")}e.scrollTo(null,t.top+e.defaultTextHeight())},f[u["Shift-"+h+"L"]="splitSelectionByLine"]=function(e){for(var t=e.listSelections(),n=[],r=0;ri.line&&a==o.line&&0==o.ch||n.push({anchor:a==i.line?i:d(a,0),head:a==o.line?o:d(a)});e.setSelections(n,0)},u["Shift-Tab"]="indentLess",f[u.Esc="singleSelectionTop"]=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},f[u[h+"L"]="selectLine"]=function(e){for(var t=e.listSelections(),n=[],r=0;ri?r.push(l,c):r.length&&(r[r.length-1]=c),i=c}t.operation(function(){for(var e=0;et.lastLine()?t.replaceRange("\n"+a,d(t.lastLine()),null,"+swapLine"):t.replaceRange(a+"\n",d(i,0),null,"+swapLine")}t.setSelections(o),t.scrollIntoView()})},f[u[y+"Down"]="swapLineDown"]=function(t){if(t.isReadOnly())return e.Pass;for(var n=t.listSelections(),r=[],i=t.lastLine()+1,o=n.length-1;o>=0;o--){var a=n[o],s=a.to().line+1,l=a.from().line;0!=a.to().ch||a.empty()||s--,s=0;e-=2){var n=r[e],i=r[e+1],o=t.getLine(n);n==t.lastLine()?t.replaceRange("",d(n-1),d(n),"+swapLine"):t.replaceRange("",d(n,0),d(n+1,0),"+swapLine"),t.replaceRange(o+"\n",d(i,0),null,"+swapLine")}t.scrollIntoView()})},f[u[h+"/"]="toggleCommentIndented"]=function(e){e.toggleComment({indent:!0})},f[u[h+"J"]="joinLines"]=function(e){for(var t=e.listSelections(),n=[],r=0;r=0;i--){var o=n[i].head,a=t.getRange({line:o.line,ch:0},o),s=e.countColumn(a,null,t.getOption("tabSize")),l=t.findPosH(o,-1,"char",!1);if(a&&!/\S/.test(a)&&s%r==0){var c=new d(o.line,e.findColumn(a,s-r,r));c.ch!=o.ch&&(l=c)}t.replaceRange("",l,o,"+delete")}})},f[u[b+h+"K"]="delLineRight"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange("",t[n].anchor,d(t[n].to().line),"+delete");e.scrollIntoView()})},f[u[b+h+"U"]="upcaseAtCursor"]=function(e){s(e,function(e){return e.toUpperCase()})},f[u[b+h+"L"]="downcaseAtCursor"]=function(e){s(e,function(e){return e.toLowerCase()})},f[u[b+h+"Space"]="setSublimeMark"]=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},f[u[b+h+"A"]="selectToSublimeMark"]=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},f[u[b+h+"W"]="deleteToSublimeMark"]=function(t){var n=t.state.sublimeMark&&t.state.sublimeMark.find();if(n){var r=t.getCursor(),i=n;if(e.cmpPos(r,i)>0){var o=i;i=r,r=o}t.state.sublimeKilled=t.getRange(r,i),t.replaceRange("",r,i)}},f[u[b+h+"X"]="swapWithSublimeMark"]=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&(e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor()),e.setCursor(t))},f[u[b+h+"Y"]="sublimeYank"]=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},u[b+h+"G"]="clearBookmarks",f[u[b+h+"C"]="showInCenter"]=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)};var k=p?"Ctrl-Shift-":"Ctrl-Alt-";f[u[k+"Up"]="selectLinesUpward"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=0;ne.firstLine()&&e.addSelection(d(r.head.line-1,r.head.ch))}})},f[u[k+"Down"]="selectLinesDownward"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=0;n",type:"keyToKey",toKeys:"h"},{keys:"",type:"keyToKey",toKeys:"l"},{keys:"",type:"keyToKey",toKeys:"k"},{keys:"",type:"keyToKey",toKeys:"j"},{keys:"",type:"keyToKey",toKeys:"l"},{keys:"",type:"keyToKey",toKeys:"h",context:"normal"},{keys:"",type:"keyToKey",toKeys:"W"},{keys:"",type:"keyToKey",toKeys:"B",context:"normal"},{keys:"",type:"keyToKey",toKeys:"w"},{keys:"",type:"keyToKey",toKeys:"b",context:"normal"},{keys:"",type:"keyToKey",toKeys:"j"},{keys:"",type:"keyToKey",toKeys:"k"},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:"",context:"insert"},{keys:"",type:"keyToKey",toKeys:"",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"",type:"keyToKey",toKeys:"0"},{keys:"",type:"keyToKey",toKeys:"$"},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"",type:"motion",motion:"moveByScroll",motionArgs:{forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0,toJumplist:!0}},{keys:"f",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r",type:"action",action:"replace",isEdit:!0},{keys:"@",type:"action",action:"replayMacro"},{keys:"q",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0}},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual",isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"",type:"action",action:"redo"},{keys:"m",type:"action",action:"setMark"},{keys:'"',type:"action",action:"setRegister"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"a",type:"motion",motion:"textObjectManipulation"},{keys:"i",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0, -toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],n=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"unmap"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"delmarks",shortName:"delm"},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"global",shortName:"g"}],r=e.Pos,i=function(){function i(t){t.setOption("disableInput",!0),t.setOption("showCursorWhenSelecting",!1),e.signal(t,"vim-mode-change",{mode:"normal"}),t.on("cursorActivity",et),_(t),e.on(t.getInputField(),"paste",u(t))}function o(t){t.setOption("disableInput",!1),t.off("cursorActivity",et),e.off(t.getInputField(),"paste",u(t)),t.state.vim=null}function a(t,n){this==e.keyMap.vim&&e.rmClass(t.getWrapperElement(),"cm-fat-cursor"),n&&n.attach==s||o(t,!1)}function s(t,n){this==e.keyMap.vim&&e.addClass(t.getWrapperElement(),"cm-fat-cursor"),n&&n.attach==s||i(t)}function l(t,n){if(n){if(this[t])return this[t];var r=c(t);if(!r)return!1;var i=e.Vim.findKey(n,r);return"function"==typeof i&&e.signal(n,"vim-keypress",r),i}}function c(e){if("'"==e.charAt(0))return e.charAt(1);var t=e.split(/-(?!$)/),n=t[t.length-1];if(1==t.length&&1==t[0].length)return!1;if(2==t.length&&"Shift"==t[0]&&1==n.length)return!1;for(var r=!1,i=0;i")}function u(e){var t=e.state.vim;return t.onPasteFn||(t.onPasteFn=function(){t.insertMode||(e.setCursor(R(e.getCursor(),0,1)),Mt.enterInsertMode(e,{},t))}),t.onPasteFn}function f(e,t){for(var n=[],r=e;r=e.firstLine()&&t<=e.lastLine()}function p(e){return/^[a-z]$/.test(e)}function h(e){return"()[]{}".indexOf(e)!=-1}function m(e){return ct.test(e)}function g(e){return/^[A-Z]$/.test(e)}function v(e){return/^\s*$/.test(e)}function y(e,t){for(var n=0;n"==t.slice(-11)){var n=t.length-11,r=e.slice(0,n),i=t.slice(0,n);return r==i&&e.length>n?"full":0==i.indexOf(r)&&"partial"}return e==t?"full":0==t.indexOf(e)&&"partial"}function B(e){var t=/^.*(<[\w\-]+>)$/.exec(e),n=t?t[1]:e.slice(-1);if(n.length>1)switch(n){case"":n="\n";break;case"":n=" "}return n}function F(e,t,n){return function(){for(var r=0;r2&&(t=K.apply(void 0,Array.prototype.slice.call(arguments,1))),U(e,t)?e:t}function V(e,t){return arguments.length>2&&(t=V.apply(void 0,Array.prototype.slice.call(arguments,1))),U(e,t)?t:e}function G(e,t,n){var r=U(e,t),i=U(t,n);return r&&i}function X(e,t){return e.getLine(t).length}function Z(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function Y(e){return e.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function Q(e,t,n){var i=X(e,t),o=new Array(n-i+1).join(" ");e.setCursor(r(t,i)),e.replaceRange(o,e.getCursor())}function J(e,t){var n=[],i=e.listSelections(),o=H(e.clipPos(t)),a=!$(t,o),s=e.getCursor("head"),l=te(i,s),c=$(i[l].head,i[l].anchor),u=i.length-1,f=u-l>l?u:0,d=i[f].anchor,p=Math.min(d.line,o.line),h=Math.max(d.line,o.line),m=d.ch,g=o.ch,v=i[f].head.ch-m,y=g-m;v>0&&y<=0?(m++,a||g--):v<0&&y>=0?(m--,c||g++):v<0&&y==-1&&(m--,g++);for(var b=p;b<=h;b++){var k={anchor:new r(b,m),head:new r(b,g)};n.push(k)}return l=o.line==h?n.length-1:0,e.setSelections(n),t.ch=g,d.ch=m,d}function ee(e,t,n){for(var r=[],i=0;ic&&(o.line=c),o.ch=X(e,o.line)}return{ranges:[{anchor:a,head:o}],primary:0}}if("block"==n){for(var u=Math.min(a.line,o.line),f=Math.min(a.ch,o.ch),d=Math.max(a.line,o.line),p=Math.max(a.ch,o.ch)+1,h=d-u+1,m=o.line==u?0:h-1,g=[],v=0;v0&&o&&v(o);o=i.pop())n.line--,n.ch=0;o?(n.line--,n.ch=X(e,n.line)):n.ch=0}}function ue(e,t,n){t.ch=0,n.ch=0,n.line++}function fe(e){if(!e)return 0;var t=e.search(/\S/);return t==-1?e.length:t}function de(e,t,n,i,o){for(var a=se(e),s=e.getLine(a.line),l=a.ch,c=o?ut[0]:ft[0];!c(s.charAt(l));)if(l++,l>=s.length)return null;i?c=ft[0]:(c=ut[0],c(s.charAt(l))||(c=ut[1]));for(var u=l,f=l;c(s.charAt(u))&&u=0;)f--;if(f++,t){for(var d=u;/\s/.test(s.charAt(u))&&u0;)f--;f||(f=p)}}return{start:r(a.line,f),end:r(a.line,u)}}function pe(e,t,n){$(t,n)||kt.jumpList.add(e,t,n)}function he(e,t){kt.lastCharacterSearch.increment=e,kt.lastCharacterSearch.forward=t.forward,kt.lastCharacterSearch.selectedCharacter=t.selectedCharacter}function me(e,t,n,i){var o=H(e.getCursor()),a=n?1:-1,s=n?e.lineCount():-1,l=o.ch,c=o.line,u=e.getLine(c),f={lineText:u,nextCh:u.charAt(l),lastCh:null,index:l,symb:i,reverseSymb:(n?{")":"(","}":"{"}:{"(":")","{":"}"})[i],forward:n,depth:0,curMoveThrough:!1},d=Lt[i];if(!d)return o;var p=Tt[d].init,h=Tt[d].isComplete;for(p&&p(f);c!==s&&t;){if(f.index+=a,f.nextCh=f.lineText.charAt(f.index),!f.nextCh){if(c+=a,f.lineText=e.getLine(c)||"",a>0)f.index=0;else{var m=f.lineText.length;f.index=m>0?m-1:0}f.nextCh=f.lineText.charAt(f.index)}h(f)&&(o.line=c,o.ch=f.index,t--)}return f.nextCh||f.curMoveThrough?r(c,f.index):o}function ge(e,t,n,r,i){var o=t.line,a=t.ch,s=e.getLine(o),l=n?1:-1,c=r?ft:ut;if(i&&""==s){if(o+=l,s=e.getLine(o),!d(e,o))return null;a=n?0:s.length}for(;;){if(i&&""==s)return{from:0,to:0,line:o};for(var u=l>0?s.length:-1,f=u,p=u;a!=u;){for(var h=!1,m=0;m0?0:s.length}}function ve(e,t,n,i,o,a){var s=H(t),l=[];(i&&!o||!i&&o)&&n++;for(var c=!(i&&o),u=0;u0;)s(p,i)&&n--,p+=i;return new r(p,0)}var h=e.state.vim;if(h.visualLine&&s(u,1,!0)){var m=h.sel.anchor;s(m.line,-1,!0)&&(o&&m.line==u||(u+=1))}var g=a(u);for(p=u;p<=d&&n;p++)s(p,1,!0)&&(o&&a(p)==g||n--);for(c=new r(p,0),p>d&&!g?g=!0:o=!1,p=u;p>f&&(o&&a(p)!=g&&p!=u||!s(p,-1,!0));p--);return l=new r(p,0),{start:l,end:c}}function _e(e,t,n,i){var o,a,s=t,l={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/}[n],c={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{"}[n],u=e.getLine(s.line).charAt(s.ch),f=u===c?1:0;if(o=e.scanForBracket(r(s.line,s.ch+f),-1,null,{bracketRegex:l}),a=e.scanForBracket(r(s.line,s.ch+f),1,null,{bracketRegex:l}),!o||!a)return{start:s,end:s};if(o=o.pos,a=a.pos,o.line==a.line&&o.ch>a.ch||o.line>a.line){var d=o;o=a,a=d}return i?a.ch+=1:o.ch+=1,{start:o,end:a}}function Ce(e,t,n,i){var o,a,s,l,c=H(t),u=e.getLine(c.line),f=u.split(""),d=f.indexOf(n);if(c.ch-1&&!o;s--)f[s]==n&&(o=s+1);else o=c.ch+1;if(o&&!a)for(s=o,l=f.length;s'+t+"",{bottom:!0,duration:5e3}):alert(t)}function qe(e,t){var n=''+(e||"")+'';return t&&(n+=' '+t+""),n}function Pe(e,t){var n=(t.prefix||"")+" "+(t.desc||""),r=qe(t.prefix,t.desc);Le(e,r,n,t.onClose,t)}function Re(e,t){if(e instanceof RegExp&&t instanceof RegExp){for(var n=["global","multiline","ignoreCase","source"],r=0;r=t&&e<=n:e==t}function $e(e){var t=e.getScrollInfo(),n=6,r=10,i=e.coordsChar({left:0,top:n+t.top},"local"),o=t.clientHeight-r+t.top,a=e.coordsChar({left:0,top:o},"local");return{top:i.line,bottom:a.line}}function Ue(t,n,r,i,o,a,s,l,c){function u(){t.operation(function(){for(;!m;)f(),d();p()})}function f(){var e=t.getRange(a.from(),a.to()),n=e.replace(s,l);a.replace(n)}function d(){for(;a.findNext()&&He(a.from(),i,o);)if(r||!g||a.from().line!=g.line)return t.scrollIntoView(a.from(),30),t.setSelection(a.from(),a.to()),g=a.from(),void(m=!1);m=!0}function p(e){if(e&&e(),t.focus(),g){t.setCursor(g);var n=t.state.vim;n.exMode=!1,n.lastHPos=n.lastHSPos=g.ch}c&&c()}function h(n,r,i){e.e_stop(n);var o=e.keyName(n);switch(o){case"Y":f(),d();break;case"N":d();break;case"A":var a=c;c=void 0,t.operation(u),c=a;break;case"L":f();case"Q":case"Esc":case"Ctrl-C":case"Ctrl-[":p(i)}return m&&p(i),!0}t.state.vim.exMode=!0;var m=!1,g=a.from();return d(),m?void Ne(t,"No matches for "+s.source):n?void Pe(t,{prefix:"replace with "+l+" (y/n/a/q/l)",onKeyDown:h}):(u(),void(c&&c()))}function Ke(t){var n=t.state.vim,r=kt.macroModeState,i=kt.registerController.getRegister("."),o=r.isPlaying,a=r.lastInsertModeChanges,s=[];if(!o){for(var l=a.inVisualBlock?n.lastSelection.visualBlock.height:1,c=a.changes,s=[],u=0;u1&&(ot(t,n,n.insertModeRepeat-1,!0),n.lastEditInputState.repeatOverride=n.insertModeRepeat),delete n.insertModeRepeat,n.insertMode=!1,t.setCursor(t.getCursor().line,t.getCursor().ch-1),t.setOption("keyMap","vim"),t.setOption("disableInput",!0),t.toggleOverwrite(!1),i.setText(a.changes.join("")),e.signal(t,"vim-mode-change",{mode:"normal"}),r.isRecording&&Ye(r)}function Ve(e){t.unshift(e)}function Ge(e,t,n,r,i){var o={keys:e,type:t};o[t]=n,o[t+"Args"]=r;for(var a in i)o[a]=i[a];Ve(o)}function Xe(t,n,r,i){var o=kt.registerController.getRegister(i);if(":"==i)return o.keyBuffer[0]&&Nt.processCommand(t,o.keyBuffer[0]),void(r.isPlaying=!1);var a=o.keyBuffer,s=0;r.isPlaying=!0,r.replaySearchQueries=o.searchQueries.slice(0);for(var l=0;l|<\w+>|./.exec(f),u=c[0],f=f.substring(c.index+u.length),e.Vim.handleKey(t,u,"macro"),n.insertMode){var d=o.insertModeChanges[s++].changes;kt.macroModeState.lastInsertModeChanges.changes=d,at(t,d,1),Ke(t)}r.isPlaying=!1}function Ze(e,t){if(!e.isPlaying){var n=e.latestRegister,r=kt.registerController.getRegister(n);r&&r.pushText(t)}}function Ye(e){if(!e.isPlaying){var t=e.latestRegister,n=kt.registerController.getRegister(t);n&&n.pushInsertModeChanges&&n.pushInsertModeChanges(e.lastInsertModeChanges)}}function Qe(e,t){if(!e.isPlaying){var n=e.latestRegister,r=kt.registerController.getRegister(n);r&&r.pushSearchQuery&&r.pushSearchQuery(t)}}function Je(e,t){var n=kt.macroModeState,r=n.lastInsertModeChanges;if(!n.isPlaying)for(;t;){if(r.expectCursorActivityForChange=!0,"+input"==t.origin||"paste"==t.origin||void 0===t.origin){var i=t.text.join("\n");r.changes.push(i)}t=t.next}}function et(e){var t=e.state.vim;if(t.insertMode){var n=kt.macroModeState;if(n.isPlaying)return;var r=n.lastInsertModeChanges;r.expectCursorActivityForChange?r.expectCursorActivityForChange=!1:r.changes=[]}else e.curOp.isVimOp||nt(e,t);t.visualMode&&tt(e)}function tt(e){var t=e.state.vim,n=q(e,H(t.sel.head)),r=R(n,0,1);t.fakeCursor&&t.fakeCursor.clear(),t.fakeCursor=e.markText(n,r,{className:"cm-animate-fat-cursor"})}function nt(t,n){var r=t.getCursor("anchor"),i=t.getCursor("head");if(n.visualMode&&!t.somethingSelected()?le(t,!1):n.visualMode||n.insertMode||!t.somethingSelected()||(n.visualMode=!0,n.visualLine=!1,e.signal(t,"vim-mode-change",{mode:"visual"})),n.visualMode){var o=U(i,r)?0:-1,a=U(i,r)?-1:0;i=R(i,0,o),r=R(r,0,a),n.sel={anchor:r,head:i},ke(t,n,"<",K(i,r)),ke(t,n,">",V(i,r))}else n.insertMode||(n.lastHPos=t.getCursor().ch)}function rt(e){this.keyName=e}function it(t){function n(){return i.changes.push(new rt(o)),!0}var r=kt.macroModeState,i=r.lastInsertModeChanges,o=e.keyName(t);o&&(o.indexOf("Delete")==-1&&o.indexOf("Backspace")==-1||e.lookupKey(o,"vim-insert",n))}function ot(e,t,n,r){function i(){s?_t.processAction(e,t,t.lastEditActionCommand):_t.evalInput(e,t)}function o(n){if(a.lastInsertModeChanges.changes.length>0){n=t.lastEditActionCommand?n:1;var r=a.lastInsertModeChanges;at(e,r.changes,n)}}var a=kt.macroModeState;a.isPlaying=!0;var s=!!t.lastEditActionCommand,l=t.inputState;if(t.inputState=t.lastEditInputState,s&&t.lastEditActionCommand.interlaceInsertRepeat)for(var c=0;c"]),gt=[].concat(dt,pt,ht,["-",'"',".",":","/"]),vt={};b("filetype",void 0,"string",["ft"],function(e,t){if(void 0!==t){if(void 0===e){var n=t.getOption("mode");return"null"==n?"":n}var n=""==e?"null":e;t.setOption("mode",n)}});var yt=function(){function e(e,t,s){function l(t){var i=++r%n,o=a[i];o&&o.clear(),a[i]=e.setBookmark(t)}var c=r%n,u=a[c];if(u){var f=u.find();f&&!$(f,t)&&l(t)}else l(t);l(s),i=r,o=r-n+1,o<0&&(o=0)}function t(e,t){r+=t,r>i?r=i:r0?1:-1,u=e.getCursor();do if(r+=c,s=a[(n+r)%n],s&&(l=s.find())&&!$(u,l))break;while(ro)}return s}var n=100,r=-1,i=0,o=0,a=new Array(n);return{cachedCursor:void 0,add:e,move:t}},bt=function(e){return e?{changes:e.changes,expectCursorActivityForChange:e.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};w.prototype={exitMacroRecordMode:function(){var e=kt.macroModeState;e.onRecordingDone&&e.onRecordingDone(),e.onRecordingDone=void 0,e.isRecording=!1},enterMacroRecordMode:function(e,t){var n=kt.registerController.getRegister(t);n&&(n.clear(),this.latestRegister=t,e.openDialog&&(this.onRecordingDone=e.openDialog("(recording)["+t+"]",null,{bottom:!0})),this.isRecording=!0)}};var kt,xt,wt={buildKeyMap:function(){},getRegisterController:function(){return kt.registerController},resetVimGlobalState_:C,getVimGlobalState_:function(){return kt},maybeInitVimState_:_,suppressErrorLogging:!1,InsertModeKey:rt,map:function(e,t,n){Nt.map(e,t,n)},unmap:function(e,t){Nt.unmap(e,t)},setOption:k,getOption:x,defineOption:b,defineEx:function(e,t,n){if(t){if(0!==e.indexOf(t))throw new Error('(Vim.defineEx) "'+t+'" is not a prefix of "'+e+'", command not registered')}else t=e;It[e]=n,Nt.commandMap_[t]={name:e,shortName:t,type:"api"}},handleKey:function(e,t,n){var r=this.findKey(e,t,n);if("function"==typeof r)return r()},findKey:function(n,r,i){function o(){var e=kt.macroModeState;if(e.isRecording){if("q"==r)return e.exitMacroRecordMode(),M(n),!0;"mapping"!=i&&Ze(e,r)}}function a(){if(""==r)return M(n),f.visualMode?le(n):f.insertMode&&Ke(n),!0}function s(t){for(var i;t;)i=/<\w+-.+?>|<\w+>|./.exec(t),r=i[0],t=t.substring(i.index+r.length),e.Vim.handleKey(n,r,"mapping")}function l(){if(a())return!0;for(var e=f.inputState.keyBuffer=f.inputState.keyBuffer+r,i=1==r.length,o=_t.matchCommand(e,t,f.inputState,"insert");e.length>1&&"full"!=o.type;){var e=f.inputState.keyBuffer=e.slice(1),s=_t.matchCommand(e,t,f.inputState,"insert");"none"!=s.type&&(o=s)}if("none"==o.type)return M(n),!1;if("partial"==o.type)return xt&&window.clearTimeout(xt),xt=window.setTimeout(function(){f.insertMode&&f.inputState.keyBuffer&&M(n)},x("insertModeEscKeysTimeout")),!i;if(xt&&window.clearTimeout(xt),i){var l=n.getCursor();n.replaceRange("",R(l,0,-(e.length-1)),l,"+input")}return M(n),o.command}function c(){if(o()||a())return!0;var e=f.inputState.keyBuffer=f.inputState.keyBuffer+r;if(/^[1-9]\d*$/.test(e))return!0;var i=/^(\d*)(.*)$/.exec(e);if(!i)return M(n),!1;var s=f.visualMode?"visual":"normal",l=_t.matchCommand(i[2]||i[1],t,f.inputState,s);if("none"==l.type)return M(n),!1;if("partial"==l.type)return!0;f.inputState.keyBuffer="";var i=/^(\d*)(.*)$/.exec(e);return i[1]&&"0"!=i[1]&&f.inputState.pushRepeatDigit(i[1]),l.command}var u,f=_(n);return u=f.insertMode?l():c(),u===!1?void 0:u===!0?function(){}:function(){return n.operation(function(){n.curOp.isVimOp=!0;try{"keyToKey"==u.type?s(u.toKeys):_t.processCommand(n,f,u)}catch(t){throw n.state.vim=void 0,_(n),e.Vim.suppressErrorLogging||console.log(t),t}return!0})}},handleEx:function(e,t){Nt.processCommand(e,t)},defineMotion:z,defineAction:N,defineOperator:I,mapCommand:Ge,_mapCommand:Ve,defineRegister:T,exitVisualMode:le,exitInsertMode:Ke};S.prototype.pushRepeatDigit=function(e){this.operator?this.motionRepeat=this.motionRepeat.concat(e):this.prefixRepeat=this.prefixRepeat.concat(e)},S.prototype.getRepeat=function(){var e=0;return(this.prefixRepeat.length>0||this.motionRepeat.length>0)&&(e=1,this.prefixRepeat.length>0&&(e*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(e*=parseInt(this.motionRepeat.join(""),10))),e},L.prototype={setText:function(e,t,n){this.keyBuffer=[e||""],this.linewise=!!t,this.blockwise=!!n},pushText:function(e,t){t&&(this.linewise||this.keyBuffer.push("\n"),this.linewise=!0),this.keyBuffer.push(e)},pushInsertModeChanges:function(e){this.insertModeChanges.push(bt(e))},pushSearchQuery:function(e){this.searchQueries.push(e)},clear:function(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1},toString:function(){return this.keyBuffer.join("")}},A.prototype={pushText:function(e,t,n,r,i){r&&"\n"==n.charAt(0)&&(n=n.slice(1)+"\n"),r&&"\n"!==n.charAt(n.length-1)&&(n+="\n");var o=this.isValidRegister(e)?this.getRegister(e):null;if(!o){switch(t){case"yank":this.registers[0]=new L(n,r,i);break;case"delete":case"change":n.indexOf("\n")==-1?this.registers["-"]=new L(n,r):(this.shiftNumericRegisters_(),this.registers[1]=new L(n,r))}return void this.unnamedRegister.setText(n,r,i)}var a=g(e);a?o.pushText(n,r):o.setText(n,r,i),this.unnamedRegister.setText(o.toString(),r)},getRegister:function(e){return this.isValidRegister(e)?(e=e.toLowerCase(),this.registers[e]||(this.registers[e]=new L),this.registers[e]):this.unnamedRegister},isValidRegister:function(e){return e&&y(e,gt)},shiftNumericRegisters_:function(){for(var e=9;e>=2;e--)this.registers[e]=this.getRegister(""+(e-1))}},E.prototype={nextMatch:function(e,t){var n=this.historyBuffer,r=t?-1:1;null===this.initialPrefix&&(this.initialPrefix=e);for(var i=this.iterator+r;t?i>=0:i=n.length?(this.iterator=n.length,this.initialPrefix):i<0?e:void 0},pushInput:function(e){var t=this.historyBuffer.indexOf(e);t>-1&&this.historyBuffer.splice(t,1),e.length&&this.historyBuffer.push(e)},reset:function(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}};var _t={matchCommand:function(e,t,n,r){var i=D(e,t,r,n);if(!i.full&&!i.partial)return{type:"none"};if(!i.full&&i.partial)return{type:"partial"};for(var o,a=0;a"==o.keys.slice(-11)&&(n.selectedCharacter=B(e)),{type:"full",command:o}},processCommand:function(e,t,n){switch(t.inputState.repeatOverride=n.repeatOverride,n.type){case"motion":this.processMotion(e,t,n);break;case"operator":this.processOperator(e,t,n);break;case"operatorMotion":this.processOperatorMotion(e,t,n);break;case"action":this.processAction(e,t,n);break;case"search":this.processSearch(e,t,n);break;case"ex":case"keyToEx":this.processEx(e,t,n)}},processMotion:function(e,t,n){t.inputState.motion=n.motion,t.inputState.motionArgs=P(n.motionArgs),this.evalInput(e,t)},processOperator:function(e,t,n){var r=t.inputState;if(r.operator){if(r.operator==n.operator)return r.motion="expandToLine",r.motionArgs={linewise:!0},void this.evalInput(e,t);M(e)}r.operator=n.operator,r.operatorArgs=P(n.operatorArgs),t.visualMode&&this.evalInput(e,t)},processOperatorMotion:function(e,t,n){var r=t.visualMode,i=P(n.operatorMotionArgs);i&&r&&i.visualLine&&(t.visualLine=!0),this.processOperator(e,t,n),r||this.processMotion(e,t,n)},processAction:function(e,t,n){var r=t.inputState,i=r.getRepeat(),o=!!i,a=P(n.actionArgs)||{};r.selectedCharacter&&(a.selectedCharacter=r.selectedCharacter),n.operator&&this.processOperator(e,t,n),n.motion&&this.processMotion(e,t,n),(n.motion||n.operator)&&this.evalInput(e,t),a.repeat=i||1,a.repeatIsExplicit=o,a.registerName=r.registerName,M(e),t.lastMotion=null,n.isEdit&&this.recordLastEdit(t,r,n),Mt[n.action](e,a,t)},processSearch:function(t,n,r){function i(e,i,o){kt.searchHistoryController.pushInput(e),kt.searchHistoryController.reset();try{je(t,e,i,o)}catch(a){return Ne(t,"Invalid regex: "+e),void M(t)}_t.processMotion(t,n,{type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:r.searchArgs.toJumplist}})}function o(e){t.scrollTo(d.left,d.top),i(e,!0,!0);var n=kt.macroModeState;n.isRecording&&Qe(n,e)}function a(n,r,i){var o,a=e.keyName(n);"Up"==a||"Down"==a?(o="Up"==a,r=kt.searchHistoryController.nextMatch(r,o)||"",i(r)):"Left"!=a&&"Right"!=a&&"Ctrl"!=a&&"Alt"!=a&&"Shift"!=a&&kt.searchHistoryController.reset();var s;try{s=je(t,r,!0,!0)}catch(n){}s?t.scrollIntoView(Be(t,!l,s),30):(Fe(t),t.scrollTo(d.left,d.top))}function s(n,r,i){var o=e.keyName(n);"Esc"==o||"Ctrl-C"==o||"Ctrl-["==o||"Backspace"==o&&""==r?(kt.searchHistoryController.pushInput(r), -kt.searchHistoryController.reset(),je(t,f),Fe(t),t.scrollTo(d.left,d.top),e.e_stop(n),M(t),i(),t.focus()):"Ctrl-U"==o&&(e.e_stop(n),i(""))}if(t.getSearchCursor){var l=r.searchArgs.forward,c=r.searchArgs.wholeWordOnly;Me(t).setReversed(!l);var u=l?"/":"?",f=Me(t).getQuery(),d=t.getScrollInfo();switch(r.searchArgs.querySrc){case"prompt":var p=kt.macroModeState;if(p.isPlaying){var h=p.replaySearchQueries.shift();i(h,!0,!1)}else Pe(t,{onClose:o,prefix:u,desc:zt,onKeyUp:a,onKeyDown:s});break;case"wordUnderCursor":var m=de(t,!1,!0,!1,!0),g=!0;if(m||(m=de(t,!1,!0,!1,!1),g=!1),!m)return;var h=t.getLine(m.start.line).substring(m.start.ch,m.end.ch);h=g&&c?"\\b"+h+"\\b":Y(h),kt.jumpList.cachedCursor=t.getCursor(),t.setCursor(m.start),i(h,!0,!1)}}},processEx:function(t,n,r){function i(e){kt.exCommandHistoryController.pushInput(e),kt.exCommandHistoryController.reset(),Nt.processCommand(t,e)}function o(n,r,i){var o,a=e.keyName(n);("Esc"==a||"Ctrl-C"==a||"Ctrl-["==a||"Backspace"==a&&""==r)&&(kt.exCommandHistoryController.pushInput(r),kt.exCommandHistoryController.reset(),e.e_stop(n),M(t),i(),t.focus()),"Up"==a||"Down"==a?(o="Up"==a,r=kt.exCommandHistoryController.nextMatch(r,o)||"",i(r)):"Ctrl-U"==a?(e.e_stop(n),i("")):"Left"!=a&&"Right"!=a&&"Ctrl"!=a&&"Alt"!=a&&"Shift"!=a&&kt.exCommandHistoryController.reset()}"keyToEx"==r.type?Nt.processCommand(t,r.exArgs.input):n.visualMode?Pe(t,{onClose:i,prefix:":",value:"'<,'>",onKeyDown:o}):Pe(t,{onClose:i,prefix:":",onKeyDown:o})},evalInput:function(e,t){var n,i,o,a=t.inputState,s=a.motion,l=a.motionArgs||{},c=a.operator,u=a.operatorArgs||{},f=a.registerName,d=t.sel,p=H(t.visualMode?q(e,d.head):e.getCursor("head")),h=H(t.visualMode?q(e,d.anchor):e.getCursor("anchor")),m=H(p),g=H(h);if(c&&this.recordLastEdit(t,a),o=void 0!==a.repeatOverride?a.repeatOverride:a.getRepeat(),o>0&&l.explicitRepeat?l.repeatIsExplicit=!0:(l.noRepeat||!l.explicitRepeat&&0===o)&&(o=1,l.repeatIsExplicit=!1),a.selectedCharacter&&(l.selectedCharacter=u.selectedCharacter=a.selectedCharacter),l.repeat=o,M(e),s){var v=Ct[s](e,p,l,t);if(t.lastMotion=Ct[s],!v)return;if(l.toJumplist){var y=kt.jumpList,b=y.cachedCursor;b?(pe(e,b,v),delete y.cachedCursor):pe(e,p,v)}v instanceof Array?(i=v[0],n=v[1]):n=v,n||(n=H(p)),t.visualMode?(t.visualBlock&&n.ch===1/0||(n=q(e,n,t.visualBlock)),i&&(i=q(e,i,!0)),i=i||g,d.anchor=i,d.head=n,oe(e),ke(e,t,"<",U(i,n)?i:n),ke(e,t,">",U(i,n)?n:i)):c||(n=q(e,n),e.setCursor(n.line,n.ch))}if(c){if(u.lastSel){i=g;var k=u.lastSel,x=Math.abs(k.head.line-k.anchor.line),w=Math.abs(k.head.ch-k.anchor.ch);n=k.visualLine?r(g.line+x,g.ch):k.visualBlock?r(g.line+x,g.ch+w):k.head.line==k.anchor.line?r(g.line,g.ch+w):r(g.line+x,g.ch),t.visualMode=!0,t.visualLine=k.visualLine,t.visualBlock=k.visualBlock,d=t.sel={anchor:i,head:n},oe(e)}else t.visualMode&&(u.lastSel={anchor:H(d.anchor),head:H(d.head),visualBlock:t.visualBlock,visualLine:t.visualLine});var _,C,S,L,T;if(t.visualMode){if(_=K(d.head,d.anchor),C=V(d.head,d.anchor),S=t.visualLine||u.linewise,L=t.visualBlock?"block":S?"line":"char",T=ae(e,{anchor:_,head:C},L),S){var A=T.ranges;if("block"==L)for(var E=0;Eu&&o.line==u?this.moveToEol(e,t,n,i):(n.toFirstChar&&(a=fe(e.getLine(l)),i.lastHPos=a),i.lastHSPos=e.charCoords(r(l,a),"div").left,r(l,a))},moveByDisplayLines:function(e,t,n,i){var o=t;switch(i.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:i.lastHSPos=e.charCoords(o,"div").left}var a=n.repeat,s=e.findPosV(o,n.forward?a:-a,"line",i.lastHSPos);if(s.hitSide)if(n.forward)var l=e.charCoords(s,"div"),c={top:l.top+8,left:i.lastHSPos},s=e.coordsChar(c,"div");else{var u=e.charCoords(r(e.firstLine(),0),"div");u.left=i.lastHSPos,s=e.coordsChar(u,"div")}return i.lastHPos=s.ch,s},moveByPage:function(e,t,n){var r=t,i=n.repeat;return e.findPosV(r,n.forward?i:-i,"page")},moveByParagraph:function(e,t,n){var r=n.forward?1:-1;return we(e,t,n.repeat,r)},moveByScroll:function(e,t,n,r){var i=e.getScrollInfo(),o=null,a=n.repeat;a||(a=i.clientHeight/(2*e.defaultTextHeight()));var s=e.charCoords(t,"local");n.repeat=a;var o=Ct.moveByDisplayLines(e,t,n,r);if(!o)return null;var l=e.charCoords(o,"local");return e.scrollTo(null,i.top+l.top-s.top),o},moveByWords:function(e,t,n){return ve(e,t,n.repeat,!!n.forward,!!n.wordEnd,!!n.bigWord)},moveTillCharacter:function(e,t,n){var r=n.repeat,i=ye(e,r,n.forward,n.selectedCharacter),o=n.forward?-1:1;return he(o,n),i?(i.ch+=o,i):null},moveToCharacter:function(e,t,n){var r=n.repeat;return he(0,n),ye(e,r,n.forward,n.selectedCharacter)||t},moveToSymbol:function(e,t,n){var r=n.repeat;return me(e,r,n.forward,n.selectedCharacter)||t},moveToColumn:function(e,t,n,r){var i=n.repeat;return r.lastHPos=i-1,r.lastHSPos=e.charCoords(t,"div").left,be(e,i)},moveToEol:function(e,t,n,i){var o=t;i.lastHPos=1/0;var a=r(o.line+n.repeat-1,1/0),s=e.clipPos(a);return s.ch--,i.lastHSPos=e.charCoords(s,"div").left,a},moveToFirstNonWhiteSpaceCharacter:function(e,t){var n=t;return r(n.line,fe(e.getLine(n.line)))},moveToMatchedSymbol:function(e,t){var n,i=t,o=i.line,a=i.ch,s=e.getLine(o);do if(n=s.charAt(a++),n&&h(n)){var l=e.getTokenTypeAt(r(o,a));if("string"!==l&&"comment"!==l)break}while(n);if(n){var c=e.findMatchingBracket(r(o,a));return c.to}return i},moveToStartOfLine:function(e,t){return r(t.line,0)},moveToLineOrEdgeOfDocument:function(e,t,n){var i=n.forward?e.lastLine():e.firstLine();return n.repeatIsExplicit&&(i=n.repeat-e.getOption("firstLineNumber")),r(i,fe(e.getLine(i)))},textObjectManipulation:function(e,t,n,r){var i={"(":")",")":"(","{":"}","}":"{","[":"]","]":"["},o={"'":!0,'"':!0},a=n.selectedCharacter;"b"==a?a="(":"B"==a&&(a="{");var s,l=!n.textObjectInner;if(i[a])s=_e(e,t,a,l);else if(o[a])s=Ce(e,t,a,l);else if("W"===a)s=de(e,l,!0,!0);else if("w"===a)s=de(e,l,!0,!1);else{if("p"!==a)return null;if(s=we(e,t,n.repeat,0,l),n.linewise=!0,r.visualMode)r.visualLine||(r.visualLine=!0);else{var c=r.inputState.operatorArgs;c&&(c.linewise=!0),s.end.line--}}return e.state.vim.visualMode?ie(e,s.start,s.end):[s.start,s.end]},repeatLastCharacterSearch:function(e,t,n){var r=kt.lastCharacterSearch,i=n.repeat,o=n.forward===r.forward,a=(r.increment?1:0)*(o?-1:1);e.moveH(-a,"char"),n.inclusive=!!o;var s=ye(e,i,o,r.selectedCharacter);return s?(s.ch+=a,s):(e.moveH(a,"char"),t)}},St={change:function(t,n,i){var o,a,s=t.state.vim;if(kt.macroModeState.lastInsertModeChanges.inVisualBlock=s.visualBlock,s.visualMode){a=t.getSelection();var l=O("",i.length);t.replaceSelections(l),o=K(i[0].head,i[0].anchor)}else{var c=i[0].anchor,u=i[0].head;a=t.getRange(c,u);var f=s.lastEditInputState||{};if("moveByWords"==f.motion&&!v(a)){var d=/\s+$/.exec(a);d&&f.motionArgs&&f.motionArgs.forward&&(u=R(u,0,-d[0].length),a=a.slice(0,-d[0].length))}var p=new r(c.line-1,Number.MAX_VALUE),h=t.firstLine()==t.lastLine();u.line>t.lastLine()&&n.linewise&&!h?t.replaceRange("",p,u):t.replaceRange("",c,u),n.linewise&&(h||(t.setCursor(p),e.commands.newlineAndIndent(t)),c.ch=Number.MAX_VALUE),o=c}kt.registerController.pushText(n.registerName,"change",a,n.linewise,i.length>1),Mt.enterInsertMode(t,{head:o},t.state.vim)},"delete":function(e,t,n){var i,o,a=e.state.vim;if(a.visualBlock){o=e.getSelection();var s=O("",n.length);e.replaceSelections(s),i=n[0].anchor}else{var l=n[0].anchor,c=n[0].head;t.linewise&&c.line!=e.firstLine()&&l.line==e.lastLine()&&l.line==c.line-1&&(l.line==e.firstLine()?l.ch=0:l=r(l.line-1,X(e,l.line-1))),o=e.getRange(l,c),e.replaceRange("",l,c),i=l,t.linewise&&(i=Ct.moveToFirstNonWhiteSpaceCharacter(e,l))}return kt.registerController.pushText(t.registerName,"delete",o,t.linewise,a.visualBlock),q(e,i)},indent:function(e,t,n){var r=e.state.vim,i=n[0].anchor.line,o=r.visualBlock?n[n.length-1].anchor.line:n[0].head.line,a=r.visualMode?t.repeat:1;t.linewise&&o--;for(var s=i;s<=o;s++)for(var l=0;lc.top?(l.line+=(s-c.top)/i,l.line=Math.ceil(l.line),e.setCursor(l),c=e.charCoords(l,"local"),e.scrollTo(null,c.top)):e.scrollTo(null,s);else{var u=s+e.getScrollInfo().clientHeight;u=a.anchor.line?R(a.head,0,1):r(a.anchor.line,0);else if("inplace"==o&&i.visualMode)return;t.setOption("disableInput",!1),n&&n.replace?(t.toggleOverwrite(!0),t.setOption("keyMap","vim-replace"),e.signal(t,"vim-mode-change",{mode:"replace"})):(t.toggleOverwrite(!1),t.setOption("keyMap","vim-insert"),e.signal(t,"vim-mode-change",{mode:"insert"})),kt.macroModeState.isPlaying||(t.on("change",Je),e.on(t.getInputField(),"keydown",it)),i.visualMode&&le(t),ee(t,s,l)}},toggleVisualMode:function(t,n,i){var o,a=n.repeat,s=t.getCursor();i.visualMode?i.visualLine^n.linewise||i.visualBlock^n.blockwise?(i.visualLine=!!n.linewise,i.visualBlock=!!n.blockwise,e.signal(t,"vim-mode-change",{mode:"visual",subMode:i.visualLine?"linewise":i.visualBlock?"blockwise":""}),oe(t)):le(t):(i.visualMode=!0,i.visualLine=!!n.linewise,i.visualBlock=!!n.blockwise,o=q(t,r(s.line,s.ch+a-1),!0),i.sel={anchor:s,head:o},e.signal(t,"vim-mode-change",{mode:"visual",subMode:i.visualLine?"linewise":i.visualBlock?"blockwise":""}),oe(t),ke(t,i,"<",K(s,o)),ke(t,i,">",V(s,o)))},reselectLastSelection:function(t,n,r){var i=r.lastSelection;if(r.visualMode&&re(t,r),i){var o=i.anchorMark.find(),a=i.headMark.find();if(!o||!a)return;r.sel={anchor:o,head:a},r.visualMode=!0,r.visualLine=i.visualLine,r.visualBlock=i.visualBlock,oe(t),ke(t,r,"<",K(o,a)),ke(t,r,">",V(o,a)),e.signal(t,"vim-mode-change",{mode:"visual",subMode:r.visualLine?"linewise":r.visualBlock?"blockwise":""})}},joinLines:function(e,t,n){var i,o;if(n.visualMode){if(i=e.getCursor("anchor"),o=e.getCursor("head"),U(o,i)){var a=o;o=i,i=a}o.ch=X(e,o.line)-1}else{var s=Math.max(t.repeat,2);i=e.getCursor(),o=q(e,r(i.line+s-1,1/0))}for(var l=0,c=i.line;c1)var a=Array(t.repeat+1).join(a);var h=o.linewise,m=o.blockwise;if(h)n.visualMode?a=n.visualLine?a.slice(0,-1):"\n"+a.slice(0,a.length-1)+"\n":t.after?(a="\n"+a.slice(0,a.length-1),i.ch=X(e,i.line)):i.ch=0;else{if(m){a=a.split("\n");for(var g=0;ge.lastLine()&&e.replaceRange("\n",r(M,0));var L=X(e,M);Lu.length&&(o=u.length),a=r(l.line,o)}if("\n"==s)i.visualMode||t.replaceRange("",l,a),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(t);else{var f=t.getRange(l,a);if(f=f.replace(/[^\n]/g,s),i.visualBlock){var d=new Array(t.getOption("tabSize")+1).join(" ");f=t.getSelection(),f=f.replace(/\t/g,d).replace(/[^\n]/g,s).split("\n"),t.replaceSelections(f)}else t.replaceRange(f,l,a);i.visualMode?(l=U(c[0].anchor,c[0].head)?c[0].anchor:c[0].head,t.setCursor(l),le(t,!1)):t.setCursor(R(a,0,-1))}},incrementNumberToken:function(e,t){for(var n,i,o,a,s,l=e.getCursor(),c=e.getLine(l.line),u=/-?\d+/g;null!==(n=u.exec(c))&&(s=n[0],i=n.index,o=i+s.length,!(l.ch=1)return!0}else e.nextCh===e.reverseSymb&&e.depth--;return!1}},section:{init:function(e){e.curMoveThrough=!0,e.symb=(e.forward?"]":"[")===e.symb?"{":"}"},isComplete:function(e){return 0===e.index&&e.nextCh===e.symb}},comment:{isComplete:function(e){var t="*"===e.lastCh&&"/"===e.nextCh;return e.lastCh=e.nextCh,t}},method:{init:function(e){e.symb="m"===e.symb?"{":"}",e.reverseSymb="{"===e.symb?"}":"{"},isComplete:function(e){return e.nextCh===e.symb}},preprocess:{init:function(e){e.index=0},isComplete:function(e){if("#"===e.nextCh){var t=e.lineText.match(/#(\w+)/)[1];if("endif"===t){if(e.forward&&0===e.depth)return!0;e.depth++}else if("if"===t){if(!e.forward&&0===e.depth)return!0;e.depth--}if("else"===t&&0===e.depth)return!0}return!1}}};b("pcre",!0,"boolean"),Se.prototype={getQuery:function(){return kt.query},setQuery:function(e){kt.query=e},getOverlay:function(){return this.searchOverlay},setOverlay:function(e){this.searchOverlay=e},isReversed:function(){return kt.isReversed},setReversed:function(e){kt.isReversed=e},getScrollbarAnnotate:function(){return this.annotate},setScrollbarAnnotate:function(e){this.annotate=e}};var At={"\\n":"\n","\\r":"\r","\\t":"\t"},Et={"\\/":"/","\\\\":"\\","\\n":"\n","\\r":"\r","\\t":"\t"},zt="(Javascript regexp)",Ot=function(){this.buildCommandMap_()};Ot.prototype={processCommand:function(e,t,n){var r=this;e.operation(function(){e.curOp.isVimOp=!0,r._processCommand(e,t,n)})},_processCommand:function(t,n,r){var i=t.state.vim,o=kt.registerController.getRegister(":"),a=o.toString();i.visualMode&&le(t);var s=new e.StringStream(n);o.setText(n);var l=r||{};l.input=n;try{this.parseInput_(t,s,l)}catch(c){throw Ne(t,c),c}var u,f;if(l.commandName){if(u=this.matchCommand_(l.commandName)){if(f=u.name,u.excludeFromCommandHistory&&o.setText(a),this.parseCommandArgs_(s,l,u),"exToKey"==u.type){for(var d=0;d0;t--){var n=e.substring(0,t);if(this.commandMap_[n]){var r=this.commandMap_[n];if(0===r.name.indexOf(e))return r}}return null},buildCommandMap_:function(){this.commandMap_={};for(var e=0;e
";if(n){var o;n=n.join("");for(var a=0;a"}}else for(var o in r){var l=r[o].toString();l.length&&(i+='"'+o+" "+l+"
")}Ne(e,i)},sort:function(t,n){function i(){if(n.argString){var t=new e.StringStream(n.argString);if(t.eat("!")&&(a=!0),t.eol())return;if(!t.eatSpace())return"Invalid arguments";var r=t.match(/[a-z]+/);if(r){r=r[0],s=r.indexOf("i")!=-1,l=r.indexOf("u")!=-1;var i=r.indexOf("d")!=-1&&1,o=r.indexOf("x")!=-1&&1,u=r.indexOf("o")!=-1&&1;if(i+o+u>1)return"Invalid arguments";c=i&&"decimal"||o&&"hex"||u&&"octal"}if(t.match(/\/.*\//))return"patterns not supported"}}function o(e,t){if(a){var n;n=e,e=t,t=n}s&&(e=e.toLowerCase(),t=t.toLowerCase());var r=c&&g.exec(e),i=c&&g.exec(t);return r?(r=parseInt((r[1]+r[2]).toLowerCase(),v),i=parseInt((i[1]+i[2]).toLowerCase(),v),r-i):e")}if(!r)return void Ne(e,f);var h=0,m=function(){if(h=u)return void Ne(t,"Invalid argument: "+n.argString.substring(o));for(var f=0;f<=u-c;f++){var d=String.fromCharCode(c+f);delete r.marks[d]}}else delete r.marks[a]}}},Nt=new Ot;return e.keyMap.vim={attach:s,detach:a,call:l},b("insertModeEscKeysTimeout",200,"number"),e.keyMap["vim-insert"]={fallthrough:["default"],attach:s,detach:a,call:l},e.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:s,detach:a,call:l},C(),wt};e.Vim=i()}); \ No newline at end of file +!function(e){if("object"==typeof exports&&"object"==typeof module)module.exports=e();else{if("function"==typeof define&&define.amd)return define([],e);(this||window).CodeMirror=e()}}(function(){"use strict";function e(n,r){if(!(this instanceof e))return new e(n,r);this.options=r=r?Wi(r):{},Wi(ra,r,!1),p(r);var i=r.value;"string"==typeof i&&(i=new La(i,r.mode,null,r.lineSeparator)),this.doc=i;var o=new e.inputStyles[r.inputStyle](this),a=this.display=new t(n,i,o);a.wrapper.CodeMirror=this,c(this),s(this),r.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),r.autofocus&&!Oo&&a.input.focus(),v(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:!1,cutIncoming:!1,selectingText:!1,draggingText:!1,highlight:new Oi,keySeq:null,specialChars:null};var l=this;wo&&_o<11&&setTimeout(function(){l.display.input.reset(!0)},20),$t(this),Qi(),wt(this),this.curOp.forceUpdate=!0,Qr(this,i),r.autofocus&&!Oo||l.hasFocus()?setTimeout(Bi(bn,this),20):kn(this);for(var u in ia)ia.hasOwnProperty(u)&&ia[u](this,r[u],oa);w(this),r.finishInit&&r.finishInit(this);for(var f=0;ft.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}function p(e){var t=qi(e.gutters,"CodeMirror-linenumbers");t==-1&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function h(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Ue(e.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:e.options.fixedGutter?n:0,docHeight:r,scrollHeight:r+Ve(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function m(e,t,n){this.cm=n;var r=this.vert=Ui("div",[Ui("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=Ui("div",[Ui("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(r),e(i),Ia(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Ia(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,wo&&_o<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function g(){}function v(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&es(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new e.scrollbarModel[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),Ia(e,"mousedown",function(){t.state.focused&&setTimeout(function(){t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,n){"horizontal"==n?sn(t,e):an(t,e)},t),t.display.scrollbars.addClass&&ts(t.display.wrapper,t.display.scrollbars.addClass)}function y(e,t){t||(t=h(e));var n=e.display.barWidth,r=e.display.barHeight;b(e,t);for(var i=0;i<4&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&z(e),b(e,h(e)),n=e.display.barWidth,r=e.display.barHeight}function b(e,t){var n=e.display,r=n.scrollbars.update(t);n.sizer.style.paddingRight=(n.barWidth=r.right)+"px",n.sizer.style.paddingBottom=(n.barHeight=r.bottom)+"px",n.heightForcer.style.borderBottom=r.bottom+"px solid transparent",r.right&&r.bottom?(n.scrollbarFiller.style.display="block",n.scrollbarFiller.style.height=r.bottom+"px",n.scrollbarFiller.style.width=r.right+"px"):n.scrollbarFiller.style.display="",r.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(n.gutterFiller.style.display="block",n.gutterFiller.style.height=r.bottom+"px",n.gutterFiller.style.width=t.gutterWidth+"px"):n.gutterFiller.style.display=""}function k(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-$e(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=ii(t,r),a=ii(t,i);if(n&&n.ensure){var s=n.ensure.from.line,l=n.ensure.to.line;s=a&&(o=ii(t,oi(Jr(t,l))-e.wrapper.clientHeight),a=l)}return{from:o,to:Math.max(a,o+1)}}function x(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=C(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==Ht(e))return!1;w(e)&&(Dt(e),t.dims=I(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Wo&&(o=wr(e.doc,o),a=_r(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Ft(e,o,a),n.viewOffset=oi(Jr(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var l=Ht(e);if(!s&&0==l&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var c=Gi();return l>4&&(n.lineDiv.style.display="none"),N(e,n.updateLineNumbers,t.dims),l>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,c&&Gi()!=c&&c.offsetHeight&&c.focus(),Ki(n.cursorDiv),Ki(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,We(e,400)),n.updateLineNumbers=null,!0}function T(e,t){for(var n=t.viewport,r=!0;(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Ge(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Ue(e.display)-Xe(e),n.top)}),t.visible=k(e.display,e.doc,n),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&L(e,t);r=!1){z(e);var i=h(e);qe(e),y(e,i),E(e,i)}t.signal(e,"update",e),e.display.viewFrom==e.display.reportedViewFrom&&e.display.viewTo==e.display.reportedViewTo||(t.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function A(e,t){var n=new S(e,t);if(L(e,n)){z(e),T(e,n);var r=h(e);qe(e),y(e,r),E(e,r),n.finish()}}function E(e,t){e.display.sizer.style.minHeight=t.docHeight+"px",e.display.heightForcer.style.top=t.docHeight+"px",e.display.gutters.style.height=t.docHeight+e.display.barHeight+Ve(e)+"px"}function z(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;r.001||l<-.001)&&(ni(o.line,i),O(o.line),o.rest))for(var c=0;c-1&&(d=!1),q(e,f,c,n)),d&&(Ki(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(_(e.options,c)))),s=f.node.nextSibling}else{var p=H(e,f,c,n);a.insertBefore(p,s)}c+=f.size}for(;s;)s=r(s)}function q(e,t,n,r){for(var i=0;i1)if(Ho&&Ho.text.join("\n")==t){if(r.ranges.length%Ho.text.length==0){l=[];for(var c=0;c=0;c--){var u=r.ranges[c],f=u.from(),d=u.to();u.empty()&&(n&&n>0?f=Bo(f.line,f.ch-n):e.state.overwrite&&!a?d=Bo(d.line,Math.min(Jr(o,d.line).text.length,d.ch+Ni(s).length)):Ho&&Ho.lineWise&&Ho.text.join("\n")==t&&(f=d=Bo(f.line,0)));var p=e.curOp.updateInput,h={from:f,to:d,text:l?l[c%l.length]:s,origin:i||(a?"paste":e.state.cutIncoming?"cut":"+input")};Tn(e.doc,h),Mi(e,"inputRead",e,h)}t&&!a&&ee(e,t),Wn(e),e.curOp.updateInput=p,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function J(e,t){var n=e.clipboardData&&e.clipboardData.getData("Text");if(n)return e.preventDefault(),t.isReadOnly()||t.options.disableInput||zt(t,function(){Q(t,n,0,null,"paste")}),!0}function ee(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s-1){a=Fn(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Jr(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Fn(e,i.head.line,"smart"));a&&Mi(e,"electricInput",e,i.head.line)}}}function te(e){for(var t=[],n=[],r=0;r=0){var a=Z(o.from(),i.from()),s=X(o.to(),i.to()),l=o.empty()?i.from()==i.head:o.from()==o.head;r<=t&&--t,e.splice(--r,2,new de(l?s:a,l?a:s))}}return new fe(e,t)}function he(e,t){return new fe([new de(e,t||e)],0)}function me(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function ge(e,t){if(t.linen?Bo(n,Jr(e,n).text.length):ve(t,Jr(e,t.line).text.length)}function ve(e,t){var n=e.ch;return null==n||n>t?Bo(e.line,t):n<0?Bo(e.line,0):e}function ye(e,t){return t>=e.first&&t=t.ch:s.to>t.ch))){if(i&&(Pa(l,"beforeCursorEnter"),l.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!l.atomic)continue;if(n){var c,u=l.find(r<0?1:-1);if((r<0?l.inclusiveRight:l.inclusiveLeft)&&(u=Ne(e,u,-r,u&&u.line==t.line?o:null)),u&&u.line==t.line&&(c=Fo(u,n))&&(r<0?c<0:c>0))return Oe(e,u,t,r,i)}var f=l.find(r<0?-1:1);return(r<0?l.inclusiveLeft:l.inclusiveRight)&&(f=Ne(e,f,r,f.line==t.line?o:null)),f?Oe(e,f,t,r,i):null}}return t}function Ie(e,t,n,r,i){var o=r||1,a=Oe(e,t,n,o,i)||!i&&Oe(e,t,n,o,!0)||Oe(e,t,n,-o,i)||!i&&Oe(e,t,n,-o,!0);return a?a:(e.cantEdit=!0,Bo(e.first,0))}function Ne(e,t,n,r){return n<0&&0==t.ch?t.line>e.first?ge(e,Bo(t.line-1)):null:n>0&&t.ch==(r||Jr(e,t.line)).text.length?t.line3&&(r(p,m.top,null,m.bottom),p=c,m.bottoml.bottom||f.bottom==l.bottom&&f.right>l.right)&&(l=f),p0?t.blinker=setInterval(function(){t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function We(e,t){e.doc.mode.startState&&e.doc.frontier=e.display.viewTo)){var n=+new Date+e.options.workTime,r=fa(t.mode,He(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength,l=Pr(e,o,s?fa(t.mode,r):r,!0);o.styles=l.styles;var c=o.styleClasses,u=l.classes;u?o.styleClasses=u:c&&(o.styleClasses=null);for(var f=!a||a.length!=o.styles.length||c!=u&&(!c||!u||c.bgClass!=u.bgClass||c.textClass!=u.textClass),d=0;!f&&dn)return We(e,e.options.workDelay),!0}),i.length&&zt(e,function(){for(var t=0;ta;--s){if(s<=o.first)return o.first;var l=Jr(o,s-1);if(l.stateAfter&&(!n||s<=o.frontier))return s;var c=Ha(l.text,null,e.options.tabSize);(null==i||r>c)&&(i=s-1,r=c)}return i}function He(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return!0;var o=Fe(e,t,n),a=o>r.first&&Jr(r,o-1).stateAfter;return a=a?fa(r.mode,a):da(r.mode),r.iter(o,t,function(n){jr(e,n.text,a);var s=o==t-1||o%5==0||o>=i.viewFrom&&o2&&o.push((l.bottom+c.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Ye(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;rn)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Qe(e,t){t=kr(t);var n=ri(t),r=e.display.externalMeasured=new qt(e.doc,t,n);r.lineN=n;var i=r.built=Wr(e,r);return r.text=i.pre,Vi(e.display.lineMeasure,i.pre),r}function Je(e,t,n,r){return nt(e,tt(e,t),n,r)}function et(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt)&&(o=c-l,i=o-1,t>=c&&(a="right")),null!=i){if(r=e[s+2],l==c&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;s&&e[s-2]==e[s-3]&&e[s-1].insertLeft;)r=e[(s-=3)+2],a="left";if("right"==n&&i==c-l)for(;s=0&&(n=e[r]).left==n.right;r--);return n}function ot(e,t,n,r){var i,o=rt(t.map,n,r),a=o.node,s=o.start,l=o.end,c=o.collapse;if(3==a.nodeType){for(var u=0;u<4;u++){for(;s&&$i(t.line.text.charAt(o.coverStart+s));)--s;for(;o.coverStart+l0&&(c=r="right");var f;i=e.options.lineWrapping&&(f=a.getClientRects()).length>1?f["right"==r?f.length-1:0]:a.getBoundingClientRect()}if(wo&&_o<9&&!s&&(!i||!i.left&&!i.right)){var d=a.parentNode.getClientRects()[0];i=d?{left:d.left,right:d.left+xt(e.display),top:d.top,bottom:d.bottom}:Vo}for(var p=i.top-t.rect.top,h=i.bottom-t.rect.top,m=(p+h)/2,g=t.view.measure.heights,u=0;un.from?a(e-1):a(e,r)}r=r||Jr(e.doc,t.line),i||(i=tt(e,r));var l=ai(r),c=t.ch;if(!l)return a(c);var u=po(l,c),f=s(c,u);return null!=cs&&(f.other=s(c,cs)),f}function gt(e,t){var n=0,t=ge(e.doc,t);e.options.lineWrapping||(n=xt(e.display)*t.ch);var r=Jr(e.doc,t.line),i=oi(r)+$e(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function vt(e,t,n,r){var i=Bo(e,t);return i.xRel=r,n&&(i.outside=!0),i}function yt(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,n<0)return vt(r.first,0,!0,-1);var i=ii(r,n),o=r.first+r.size-1;if(i>o)return vt(r.first+r.size-1,Jr(r,o).text.length,!0,1);t<0&&(t=0);for(var a=Jr(r,i);;){var s=bt(e,a,i,t,n),l=yr(a),c=l&&l.find(0,!0);if(!l||!(s.ch>c.from.ch||s.ch==c.from.ch&&s.xRel>0))return s;i=ri(a=c.to.line)}}function bt(e,t,n,r,i){function o(r){var i=mt(e,Bo(n,r),"line",t,c);return s=!0,a>i.bottom?i.left-l:ag)return vt(n,p,v,1);for(;;){if(u?p==d||p==mo(t,d,1):p-d<=1){var y=r0&&y1){var x=nt(e,c,y,"right");a<=x.bottom&&a>=x.top&&Math.abs(r-x.right)1?1:0);return w}var _=Math.ceil(f/2),C=d+_;if(u){C=d;for(var S=0;S<_;++S)C=mo(t,C,1)}var M=o(C);M>r?(p=C,g=M,(v=s)&&(g+=1e3),f=_):(d=C,h=M,m=s,f-=_)}}function kt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==$o){$o=Ui("pre");for(var t=0;t<49;++t)$o.appendChild(document.createTextNode("x")),$o.appendChild(Ui("br"));$o.appendChild(document.createTextNode("x"))}Vi(e.measure,$o);var n=$o.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),Ki(e.measure),n||1}function xt(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=Ui("span","xxxxxxxxxx"),n=Ui("pre",[t]);Vi(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function wt(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Xo},Go?Go.ops.push(e.curOp):e.curOp.ownsGroup=Go={ops:[e.curOp],delayedCallbacks:[]}}function _t(e){var t=e.delayedCallbacks,n=0;do{for(;n=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new S(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Lt(e){e.updatedDisplay=e.mustUpdate&&L(e.cm,e.update)}function Tt(e){var t=e.cm,n=t.display;e.updatedDisplay&&z(t),e.barMeasure=h(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=Je(t,n.maxLine,n.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(n.scroller.clientWidth,n.sizer.offsetLeft+e.adjustWidthTo+Ve(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Ge(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection(e.focus))}function At(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeftt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Wo&&wr(e.doc,t)i.viewFrom?Dt(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)Dt(e);else if(t<=i.viewFrom){var o=Bt(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):Dt(e)}else if(n>=i.viewTo){var o=Bt(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):Dt(e)}else{var a=Bt(e,t,t,-1),s=Bt(e,n,n+r,1);a&&s?(i.view=i.view.slice(0,a.index).concat(Pt(e,a.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):Dt(e)}var l=i.externalMeasured;l&&(n=i.lineN&&t=r.viewTo)){var o=r.view[Wt(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);qi(a,n)==-1&&a.push(n)}}}function Dt(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Wt(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var n=e.display.view,r=0;r0){if(o==a.length-1)return null;i=l+a[o].size-t,o++}else i=l-t;t+=i,n+=i}for(;wr(e.doc,n)!=n;){if(o==(r<0?0:a.length-1))return null;n+=r*a[o-(r<0?1:0)].size,o+=r}return{index:o,lineN:n}}function Ft(e,t,n){var r=e.display,i=r.view;0==i.length||t>=r.viewTo||n<=r.viewFrom?(r.view=Pt(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Pt(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Wt(e,n)))),r.viewTo=n}function Ht(e){for(var t=e.display.view,n=0,r=0;r400}var i=e.display;Ia(i.scroller,"mousedown",Ot(e,Xt)),wo&&_o<11?Ia(i.scroller,"dblclick",Ot(e,function(t){if(!Ti(e,t)){var n=Gt(e,t);if(n&&!en(e,t)&&!Vt(e.display,t)){Ea(t);var r=e.findWordAt(n);xe(e.doc,r.anchor,r.head)}}})):Ia(i.scroller,"dblclick",function(t){Ti(e,t)||Ea(t)}),jo||Ia(i.scroller,"contextmenu",function(t){xn(e,t)});var o,a={end:0};Ia(i.scroller,"touchstart",function(t){if(!Ti(e,t)&&!n(t)){clearTimeout(o);var r=+new Date;i.activeTouch={start:r,moved:!1,prev:r-a.end<=300?a:null},1==t.touches.length&&(i.activeTouch.left=t.touches[0].pageX,i.activeTouch.top=t.touches[0].pageY)}}),Ia(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),Ia(i.scroller,"touchend",function(n){var o=i.activeTouch;if(o&&!Vt(i,n)&&null!=o.left&&!o.moved&&new Date-o.start<300){var a,s=e.coordsChar(i.activeTouch,"page");a=!o.prev||r(o,o.prev)?new de(s,s):!o.prev.prev||r(o,o.prev.prev)?e.findWordAt(s):new de(Bo(s.line,0),ge(e.doc,Bo(s.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),Ea(n)}t()}),Ia(i.scroller,"touchcancel",t),Ia(i.scroller,"scroll",function(){i.scroller.clientHeight&&(an(e,i.scroller.scrollTop),sn(e,i.scroller.scrollLeft,!0),Pa(e,"scroll",e))}),Ia(i.scroller,"mousewheel",function(t){ln(e,t)}),Ia(i.scroller,"DOMMouseScroll",function(t){ln(e,t)}),Ia(i.wrapper,"scroll",function(){i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(t){Ti(e,t)||Oa(t)},over:function(t){Ti(e,t)||(rn(e,t),Oa(t))},start:function(t){nn(e,t)},drop:Ot(e,tn),leave:function(t){Ti(e,t)||on(e)}};var s=i.input.getField();Ia(s,"keyup",function(t){gn.call(e,t)}),Ia(s,"keydown",Ot(e,hn)),Ia(s,"keypress",Ot(e,vn)),Ia(s,"focus",function(t){bn(e,t)}),Ia(s,"blur",function(t){kn(e,t)})}function Ut(t,n,r){var i=r&&r!=e.Init;if(!n!=!i){var o=t.display.dragFunctions,a=n?Ia:qa;a(t.display.scroller,"dragstart",o.start),a(t.display.scroller,"dragenter",o.enter),a(t.display.scroller,"dragover",o.over),a(t.display.scroller,"dragleave",o.leave),a(t.display.scroller,"drop",o.drop)}}function Kt(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function Vt(e,t){for(var n=_i(t);n!=e.wrapper;n=n.parentNode)if(!n||1==n.nodeType&&"true"==n.getAttribute("cm-ignore-events")||n.parentNode==e.sizer&&n!=e.mover)return!0}function Gt(e,t,n,r){var i=e.display;if(!n&&"true"==_i(t).getAttribute("cm-not-content"))return null;var o,a,s=i.lineSpace.getBoundingClientRect();try{o=t.clientX-s.left,a=t.clientY-s.top}catch(t){return null}var l,c=yt(e,o,a);if(r&&1==c.xRel&&(l=Jr(e.doc,c.line).text).length==c.ch){var u=Ha(l,l.length,e.options.tabSize)-l.length;c=Bo(c.line,Math.max(0,Math.round((o-Ke(e.display).left)/xt(e.display))-u))}return c}function Xt(e){var t=this,n=t.display;if(!(Ti(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.shift=e.shiftKey,Vt(n,e))return void(Co||(n.scroller.draggable=!1,setTimeout(function(){n.scroller.draggable=!0},100)));if(!en(t,e)){var r=Gt(t,e);switch(window.focus(),Ci(e)){case 1:t.state.selectingText?t.state.selectingText(e):r?Zt(t,e,r):_i(e)==n.scroller&&Ea(e);break;case 2:Co&&(t.state.lastMiddleDown=+new Date),r&&xe(t.doc,r),setTimeout(function(){n.input.focus()},20),Ea(e);break;case 3:jo?xn(t,e):yn(t)}}}}function Zt(e,t,n){wo?setTimeout(Bi(Y,e),0):e.curOp.focus=Gi();var r,i=+new Date;Ko&&Ko.time>i-400&&0==Fo(Ko.pos,n)?r="triple":Uo&&Uo.time>i-400&&0==Fo(Uo.pos,n)?(r="double",Ko={time:i,pos:n}):(r="single",Uo={time:i,pos:n});var o,a=e.doc.sel,s=Io?t.metaKey:t.ctrlKey;e.options.dragDrop&&rs&&!e.isReadOnly()&&"single"==r&&(o=a.contains(n))>-1&&(Fo((o=a.ranges[o]).from(),n)<0||n.xRel>0)&&(Fo(o.to(),n)>0||n.xRel<0)?Yt(e,t,n,s):Qt(e,t,n,r,s)}function Yt(e,t,n,r){var i=e.display,o=+new Date,a=Ot(e,function(s){Co&&(i.scroller.draggable=!1),e.state.draggingText=!1,qa(document,"mouseup",a),qa(i.scroller,"drop",a),Math.abs(t.clientX-s.clientX)+Math.abs(t.clientY-s.clientY)<10&&(Ea(s),!r&&+new Date-200y&&i.push(new de(Bo(h,y),Bo(h,$a(v,p,o))))}i.length||i.push(new de(n,n)),Le(c,pe(d.ranges.slice(0,f).concat(i),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b=u,k=b.anchor,x=t;if("single"!=r){if("double"==r)var w=e.findWordAt(t);else var w=new de(Bo(t.line,0),ge(c,Bo(t.line+1,0)));Fo(w.anchor,k)>0?(x=w.head,k=Z(b.from(),w.anchor)):(x=w.anchor,k=X(b.to(),w.head))}var i=d.ranges.slice(0);i[f]=new de(ge(c,k),x),Le(c,pe(i,f),Ba)}}function a(t){var n=++y,i=Gt(e,t,!0,"rect"==r);if(i)if(0!=Fo(i,g)){e.curOp.focus=Gi(),o(i);var s=k(l,c);(i.line>=s.to||i.linev.bottom?20:0;u&&setTimeout(Ot(e,function(){y==n&&(l.scroller.scrollTop+=u,a(t))}),50)}}function s(t){e.state.selectingText=!1,y=1/0,Ea(t),l.input.focus(),qa(document,"mousemove",b),qa(document,"mouseup",x),c.history.lastSelOrigin=null}var l=e.display,c=e.doc;Ea(t);var u,f,d=c.sel,p=d.ranges;if(i&&!t.shiftKey?(f=c.sel.contains(n),u=f>-1?p[f]:new de(n,n)):(u=c.sel.primary(),f=c.sel.primIndex),No?t.shiftKey&&t.metaKey:t.altKey)r="rect",i||(u=new de(n,n)),n=Gt(e,t,!0,!0),f=-1;else if("double"==r){var h=e.findWordAt(n);u=e.display.shift||c.extend?ke(c,u,h.anchor,h.head):h}else if("triple"==r){var m=new de(Bo(n.line,0),ge(c,Bo(n.line+1,0)));u=e.display.shift||c.extend?ke(c,u,m.anchor,m.head):m}else u=ke(c,u,n);i?f==-1?(f=p.length,Le(c,pe(p.concat([u]),f),{scroll:!1,origin:"*mouse"})):p.length>1&&p[f].empty()&&"single"==r&&!t.shiftKey?(Le(c,pe(p.slice(0,f).concat(p.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),d=c.sel):_e(c,f,u,Ba):(f=0,Le(c,new fe([u],0),Ba),d=c.sel);var g=n,v=l.wrapper.getBoundingClientRect(),y=0,b=Ot(e,function(e){Ci(e)?a(e):s(e)}),x=Ot(e,s);e.state.selectingText=x,Ia(document,"mousemove",b),Ia(document,"mouseup",x)}function Jt(e,t,n,r){try{var i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Ea(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!Ei(e,n))return wi(t);o-=s.top-a.viewOffset;for(var l=0;l=i){var u=ii(e.doc,o),f=e.options.gutters[l];return Pa(e,n,e,u,f,t),wi(t)}}}function en(e,t){return Jt(e,t,"gutterClick",!0)}function tn(e){var t=this;if(on(t),!Ti(t,e)&&!Vt(t.display,e)){Ea(e),wo&&(Zo=+new Date);var n=Gt(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var i=r.length,o=Array(i),a=0,s=function(e,r){if(!t.options.allowDropFileTypes||qi(t.options.allowDropFileTypes,e.type)!=-1){var s=new FileReader;s.onload=Ot(t,function(){var e=s.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[r]=e,++a==i){n=ge(t.doc,n);var l={from:n,to:n,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};Tn(t.doc,l),Me(t.doc,he(n,na(l)))}}),s.readAsText(e)}},l=0;l-1)return t.state.draggingText(e),void setTimeout(function(){t.display.input.focus()},20);try{var o=e.dataTransfer.getData("Text");if(o){if(t.state.draggingText&&!t.state.draggingText.copy)var c=t.listSelections();if(Te(t.doc,he(n,n)),c)for(var l=0;la.clientWidth,l=a.scrollHeight>a.clientHeight;if(r&&s||i&&l){if(i&&Io&&Co)e:for(var c=t.target,u=o.view;c!=a;c=c.parentNode)for(var f=0;f=0;--i)An(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text});else An(e,t)}}function An(e,t){if(1!=t.text.length||""!=t.text[0]||0!=Fo(t.from,t.to)){var n=Cn(e,t);fi(e,t,n,e.cm?e.cm.curOp.id:NaN),On(e,t,n,sr(e,t));var r=[];Yr(e,function(e,n){n||qi(r,e.history)!=-1||(xi(e.history,t),r.push(e.history)),On(e,t,null,sr(e,t))})}}function En(e,t,n){if(!e.cm||!e.cm.state.suppressEdits||n){for(var r,i=e.history,o=e.sel,a="undo"==t?i.done:i.undone,s="undo"==t?i.undone:i.done,l=0;l=0;--l){var f=r.changes[l];if(f.origin=t,u&&!Ln(e,f,!1))return void(a.length=0);c.push(li(e,f));var d=l?Cn(e,f):Ni(a);On(e,f,d,cr(e,f)),!l&&e.cm&&e.cm.scrollIntoView({from:f.from,to:na(f)});var p=[];Yr(e,function(e,t){t||qi(p,e.history)!=-1||(xi(e.history,f),p.push(e.history)),On(e,f,null,cr(e,f))})}}}}function zn(e,t){if(0!=t&&(e.first+=t,e.sel=new fe(Pi(e.sel.ranges,function(e){return new de(Bo(e.anchor.line+t,e.anchor.ch),Bo(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Rt(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:Bo(o,Jr(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=ei(e,t.from,t.to),n||(n=Cn(e,t)),e.cm?In(e.cm,t,r):Gr(e,t,r),Te(e,n,Wa)}}function In(e,t,n){var r=e.doc,i=e.display,a=t.from,s=t.to,l=!1,c=a.line;e.options.lineWrapping||(c=ri(kr(Jr(r,a.line))),r.iter(c,s.line+1,function(e){if(e==i.maxLine)return l=!0,!0})),r.sel.contains(t.from,t.to)>-1&&Ai(e),Gr(r,t,n,o(e)),e.options.lineWrapping||(r.iter(c,a.line+t.text.length,function(e){var t=f(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,l=!1)}),l&&(e.curOp.updateMaxLine=!0)),r.frontier=Math.min(r.frontier,a.line),We(e,400);var u=t.text.length-(s.line-a.line)-1;t.full?Rt(e):a.line!=s.line||1!=t.text.length||Vr(e.doc,t)?Rt(e,a.line,s.line+1,u):jt(e,a.line,"text");var d=Ei(e,"changes"),p=Ei(e,"change");if(p||d){var h={from:a,to:s,text:t.text,removed:t.removed,origin:t.origin};p&&Mi(e,"change",e,h),d&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function Nn(e,t,n,r,i){if(r||(r=n),Fo(r,n)<0){var o=r;r=n,n=o}"string"==typeof t&&(t=e.splitLines(t)),Tn(e,{from:n,to:r,text:t,origin:i})}function qn(e,t){if(!Ti(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),i=null;if(t.top+r.top<0?i=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(i=!1),null!=i&&!Eo){var o=Ui("div","​",null,"position: absolute; top: "+(t.top-n.viewOffset-$e(e.display))+"px; height: "+(t.bottom-t.top+Ve(e)+n.barHeight)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function Pn(e,t,n,r){null==r&&(r=0);for(var i=0;i<5;i++){var o=!1,a=mt(e,t),s=n&&n!=t?mt(e,n):a,l=jn(e,Math.min(a.left,s.left),Math.min(a.top,s.top)-r,Math.max(a.left,s.left),Math.max(a.bottom,s.bottom)+r),c=e.doc.scrollTop,u=e.doc.scrollLeft;if(null!=l.scrollTop&&(an(e,l.scrollTop),Math.abs(e.doc.scrollTop-c)>1&&(o=!0)),null!=l.scrollLeft&&(sn(e,l.scrollLeft),Math.abs(e.doc.scrollLeft-u)>1&&(o=!0)),!o)break}return a}function Rn(e,t,n,r,i){var o=jn(e,t,n,r,i);null!=o.scrollTop&&an(e,o.scrollTop),null!=o.scrollLeft&&sn(e,o.scrollLeft)}function jn(e,t,n,r,i){var o=e.display,a=kt(e.display);n<0&&(n=0);var s=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,l=Xe(e),c={};i-n>l&&(i=n+l);var u=e.doc.height+Ue(o),f=nu-a; +if(ns+l){var p=Math.min(n,(d?u:i)-l);p!=s&&(c.scrollTop=p)}var h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,m=Ge(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),g=r-t>m;return g&&(r=t+m),t<10?c.scrollLeft=0:tm+h-3&&(c.scrollLeft=r+(g?0:10)-m),c}function Dn(e,t,n){null==t&&null==n||Bn(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=n&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+n)}function Wn(e){Bn(e);var t=e.getCursor(),n=t,r=t;e.options.lineWrapping||(n=t.ch?Bo(t.line,t.ch-1):t,r=Bo(t.line,t.ch+1)),e.curOp.scrollToPos={from:n,to:r,margin:e.options.cursorScrollMargin,isCursor:!0}}function Bn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=gt(e,t.from),r=gt(e,t.to),i=jn(e,Math.min(n.left,r.left),Math.min(n.top,r.top)-t.margin,Math.max(n.right,r.right),Math.max(n.bottom,r.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function Fn(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=He(e,t):n="prev");var a=e.options.tabSize,s=Jr(o,t),l=Ha(s.text,null,a);s.stateAfter&&(s.stateAfter=null);var c,u=s.text.match(/^\s*/)[0];if(r||/\S/.test(s.text)){if("smart"==n&&(c=o.mode.indent(i,s.text.slice(u.length),s.text),c==Da||c>150)){if(!r)return;n="prev"}}else c=0,n="not";"prev"==n?c=t>o.first?Ha(Jr(o,t-1).text,null,a):0:"add"==n?c=l+e.options.indentUnit:"subtract"==n?c=l-e.options.indentUnit:"number"==typeof n&&(c=l+n),c=Math.max(0,c);var f="",d=0;if(e.options.indentWithTabs)for(var p=Math.floor(c/a);p;--p)d+=a,f+="\t";if(d=0;t--)Nn(e.doc,"",r[t].from,r[t].to,"+delete");Wn(e)})}function Un(e,t,n,r,i){function o(){var t=s+n;return!(t=e.first+e.size)&&(s=t,u=Jr(e,t))}function a(e){var t=(i?mo:go)(u,l,n,!0);if(null==t){if(e||!o())return!1;l=i?(n<0?so:ao)(u):n<0?u.text.length:0}else l=t;return!0}var s=t.line,l=t.ch,c=n,u=Jr(e,s);if("char"==r)a();else if("column"==r)a(!0);else if("word"==r||"group"==r)for(var f=null,d="group"==r,p=e.cm&&e.cm.getHelper(t,"wordChars"),h=!0;!(n<0)||a(!h);h=!1){var m=u.text.charAt(l)||"\n",g=Fi(m,p)?"w":d&&"\n"==m?"n":!d||/\s/.test(m)?null:"p";if(!d||h||g||(g="s"),f&&f!=g){n<0&&(n=1,a());break}if(g&&(f=g),n>0&&!a(!h))break}var v=Ie(e,Bo(s,l),t,c,!0);return Fo(t,v)||(v.hitSide=!0),v}function Kn(e,t,n,r){var i,o=e.doc,a=t.left;if("page"==r){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),l=Math.max(s-.5*kt(e.display),3);i=(n>0?t.bottom:t.top)+n*l}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;;){var c=yt(e,a,i);if(!c.outside)break;if(n<0?i<=0:i>=o.height){c.hitSide=!0;break}i+=5*n}return c}function Vn(t,n,r,i){e.defaults[t]=n,r&&(ia[t]=i?function(e,t,n){n!=oa&&r(e,t,n)}:r)}function Gn(e){for(var t,n,r,i,o=e.split(/-(?!$)/),e=o[o.length-1],a=0;a0||0==a&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=Ui("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(br(e,t.line,t,n,o)||t.line!=n.line&&br(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Wo=!0}o.addToHistory&&fi(e,{from:t,to:n,origin:"markText"},e.sel,NaN);var s,l=t.line,c=e.cm;if(e.iter(l,n.line+1,function(e){c&&o.collapsed&&!c.options.lineWrapping&&kr(e)==c.display.maxLine&&(s=!0),o.collapsed&&l!=t.line&&ni(e,0),ir(e,new tr(o,l==t.line?t.ch:null,l==n.line?n.ch:null)),++l}),o.collapsed&&e.iter(t.line,n.line+1,function(t){Cr(e,t)&&ni(t,0)}),o.clearOnEnter&&Ia(o,"beforeCursorEnter",function(){o.clear()}),o.readOnly&&(Do=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ba,o.atomic=!0),c){if(s&&(c.curOp.updateMaxLine=!0),o.collapsed)Rt(c,t.line,n.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var u=t.line;u<=n.line;u++)jt(c,u,"text");o.atomic&&Ee(c.doc),Mi(c,"markerAdded",c,o)}return o}function Yn(e,t,n,r,i){r=Wi(r),r.shared=!1;var o=[Zn(e,t,n,r,i)],a=o[0],s=r.widgetNode;return Yr(e,function(e){s&&(r.widgetNode=s.cloneNode(!0)),o.push(Zn(e,ge(e,t),ge(e,n),r,i));for(var l=0;l=t:o.to>t);(r||(r=[])).push(new tr(a,o.from,l?null:o.to))}}return r}function ar(e,t,n){if(e)for(var r,i=0;i=t:o.to>t);if(s||o.from==t&&"bookmark"==a.type&&(!n||o.marker.insertLeft)){var l=null==o.from||(a.inclusiveLeft?o.from<=t:o.from0&&s)for(var f=0;f0)){var u=[l,1],f=Fo(c.from,s.from),d=Fo(c.to,s.to);(f<0||!a.inclusiveLeft&&!f)&&u.push({from:c.from,to:s.from}),(d>0||!a.inclusiveRight&&!d)&&u.push({from:s.to,to:c.to}),i.splice.apply(i,u),l+=u.length-1}}return i}function fr(e){var t=e.markedSpans;if(t){for(var n=0;n=0&&f<=0||u<=0&&f>=0)&&(u<=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?Fo(c.to,n)>=0:Fo(c.to,n)>0)||u>=0&&(l.marker.inclusiveRight&&i.inclusiveLeft?Fo(c.from,r)<=0:Fo(c.from,r)<0)))return!0}}}function kr(e){for(var t;t=vr(e);)e=t.find(-1,!0).line;return e}function xr(e){for(var t,n;t=yr(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function wr(e,t){var n=Jr(e,t),r=kr(n);return n==r?t:ri(r)}function _r(e,t){if(t>e.lastLine())return t;var n,r=Jr(e,t);if(!Cr(e,r))return t;for(;n=yr(r);)r=n.find(1,!0).line;return ri(r)+1}function Cr(e,t){var n=Wo&&t.markedSpans;if(n)for(var r,i=0;in.start)return a}throw new Error("Mode "+t.name+" failed to advance stream.")}function Nr(e,t,n,r){function i(e){return{start:f.start,end:f.pos,string:f.current(),type:o||null,state:e?fa(a.mode,u):u}}var o,a=e.doc,s=a.mode;t=ge(a,t);var l,c=Jr(a,t.line),u=He(e,t.line,n),f=new ya(c.text,e.options.tabSize);for(r&&(l=[]);(r||f.pose.options.maxHighlightLength?(s=!1,a&&jr(e,t,r,f.pos),f.pos=t.length,l=null):l=zr(Ir(n,f,r,d),o),d){var p=d[0].name;p&&(l="m-"+(l?p+" "+l:p))}if(!s||u!=l){for(;ce&&i.splice(l,1,e,i[l+1],r),l+=2,c=Math.min(e,r)}if(t)if(s.opaque)i.splice(n,l-n,e,"cm-overlay "+t),l=n+2;else for(;ne.options.maxHighlightLength?fa(e.doc.mode,r):r);t.stateAfter=r,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.frontier&&e.doc.frontier++}return t.styles}function jr(e,t,n,r){var i=e.doc.mode,o=new ya(t,e.options.tabSize);for(o.start=o.pos=r||0,""==t&&Or(i,n);!o.eol();)Ir(i,o,n),o.start=o.pos}function Dr(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Sa:Ca;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Wr(e,t){var n=Ui("span",null,null,Co?"padding-right: .1px":null),r={pre:Ui("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:(wo||Co)&&e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o,a=i?t.rest[i-1]:t.line;r.pos=0,r.addToken=Fr,to(e.display.measure)&&(o=ai(a))&&(r.addToken=$r(r.addToken,o)),r.map=[];var s=t!=e.display.externalMeasured&&ri(a);Kr(a,r,Rr(e,a,s)),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=Zi(a.styleClasses.bgClass,r.bgClass||"")),a.styleClasses.textClass&&(r.textClass=Zi(a.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(eo(e.display.measure))),0==i?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(Co){var l=r.content.lastChild;(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab"))&&(r.content.className="cm-tab-wrap-hack")}return Pa(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=Zi(r.pre.className,r.textClass||"")),r}function Br(e){var t=Ui("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Fr(e,t,n,r,i,o,a){if(t){var s=e.splitSpaces?Hr(t,e.trailingSpace):t,l=e.cm.state.specialChars,c=!1;if(l.test(t))for(var u=document.createDocumentFragment(),f=0;;){l.lastIndex=f;var d=l.exec(t),p=d?d.index-f:t.length-f;if(p){var h=document.createTextNode(s.slice(f,f+p));wo&&_o<9?u.appendChild(Ui("span",[h])):u.appendChild(h),e.map.push(e.pos,e.pos+p,h),e.col+=p,e.pos+=p}if(!d)break;if(f+=p+1,"\t"==d[0]){var m=e.cm.options.tabSize,g=m-e.col%m,h=u.appendChild(Ui("span",Ii(g),"cm-tab"));h.setAttribute("role","presentation"),h.setAttribute("cm-text","\t"),e.col+=g}else if("\r"==d[0]||"\n"==d[0]){var h=u.appendChild(Ui("span","\r"==d[0]?"␍":"␤","cm-invalidchar"));h.setAttribute("cm-text",d[0]),e.col+=1}else{var h=e.cm.options.specialCharPlaceholder(d[0]);h.setAttribute("cm-text",d[0]),wo&&_o<9?u.appendChild(Ui("span",[h])):u.appendChild(h),e.col+=1}e.map.push(e.pos,e.pos+1,h),e.pos++}else{e.col+=t.length;var u=document.createTextNode(s);e.map.push(e.pos,e.pos+t.length,u),wo&&_o<9&&(c=!0),e.pos+=t.length}if(e.trailingSpace=32==s.charCodeAt(t.length-1),n||r||i||c||a){var v=n||"";r&&(v+=r),i&&(v+=i);var y=Ui("span",[u],v,a);return o&&(y.title=o),e.content.appendChild(y)}e.content.appendChild(u)}}function Hr(e,t){if(e.length>1&&!/ /.test(e))return e;for(var n=t,r="",i=0;ic&&d.from<=c)break}if(d.to>=u)return e(n,r,i,o,a,s,l);e(n,r.slice(0,d.to-c),i,o,null,s,l),o=null,r=r.slice(d.to-c),c=d.to}}}function Ur(e,t,n,r){var i=!r&&n.widgetNode;i&&e.map.push(e.pos,e.pos+t,i),!r&&e.cm.display.input.needsContentAttribute&&(i||(i=e.content.appendChild(document.createElement("span"))),i.setAttribute("cm-marker",n.id)),i&&(e.cm.display.input.setUneditable(i),e.content.appendChild(i)),e.pos+=t,e.trailingSpace=!1}function Kr(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,l,c,u,f,d,p=i.length,h=0,m=1,g="",v=0;;){if(v==h){l=c=u=f=s="",d=null,v=1/0;for(var y,b=[],k=0;kh||w.collapsed&&x.to==h&&x.from==h)?(null!=x.to&&x.to!=h&&v>x.to&&(v=x.to,c=""),w.className&&(l+=" "+w.className),w.css&&(s=(s?s+";":"")+w.css),w.startStyle&&x.from==h&&(u+=" "+w.startStyle),w.endStyle&&x.to==v&&(y||(y=[])).push(w.endStyle,x.to),w.title&&!f&&(f=w.title),w.collapsed&&(!d||mr(d.marker,w)<0)&&(d=x)):x.from>h&&v>x.from&&(v=x.from)}if(y)for(var k=0;k=p)break;for(var _=Math.min(p,v);;){if(g){var C=h+g.length;if(!d){var S=C>_?g.slice(0,_-h):g;t.addToken(t,S,a?a+l:l,u,h+S.length==v?c:"",f,s)}if(C>=_){g=g.slice(_-h),h=_;break}h=C,u=""}g=i.slice(o,o=n[m++]),a=Dr(n[m++],t.cm.options)}}else for(var m=1;m1&&e.remove(s.line+1,h-1),e.insert(s.line+1,m)}Mi(e,"change",e,t)}function Xr(e){this.lines=e,this.parent=null;for(var t=0,n=0;t=e.size)throw new Error("There is no line "+(t+e.first)+" in the document.");for(var n=e;!n.lines;)for(var r=0;;++r){var i=n.children[r],o=i.chunkSize();if(t1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Ni(e.done)):void 0}function fi(e,t,n,r){if("ignoreHistory"!=t.origin){var i=e.history;i.undone.length=0;var o,a=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>a-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=ui(i,i.lastOp==r))){var s=Ni(o.changes);0==Fo(t.from,t.to)&&0==Fo(t.from,s.to)?s.to=na(t):o.changes.push(li(e,t))}else{var l=Ni(i.done);for(l&&l.ranges||hi(e.sel,i.done),o={changes:[li(e,t)],generation:i.generation},i.done.push(o);i.done.length>i.undoDepth;)i.done.shift(),i.done[0].ranges||i.done.shift()}i.done.push(n),i.generation=++i.maxGeneration,i.lastModTime=i.lastSelTime=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,s||Pa(e,"historyAdded")}}function di(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function pi(e,t,n,r){var i=e.history,o=r&&r.origin;n==i.lastSelOp||o&&i.lastSelOrigin==o&&(i.lastModTime==i.lastSelTime&&i.lastOrigin==o||di(e,o,Ni(i.done),t))?i.done[i.done.length-1]=t:hi(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&ci(i.undone)}function hi(e,t){var n=Ni(t);n&&n.ranges&&n.equals(e)||t.push(e)}function mi(e,t,n,r){var i=t["spans_"+e.id],o=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((i||(i=t["spans_"+e.id]={}))[o]=n.markedSpans),++o})}function gi(e){if(!e)return null;for(var t,n=0;n-1&&(Ni(s)[f]=u[f],delete u[f])}}}return i}function bi(e,t,n,r){n0?r.slice():Na:r||Na}function Mi(e,t){function n(e){return function(){e.apply(null,o)}}var r=Si(e,t,!1);if(r.length){var i,o=Array.prototype.slice.call(arguments,2);Go?i=Go.delayedCallbacks:Ra?i=Ra:(i=Ra=[],setTimeout(Li,0));for(var a=0;a0}function zi(e){e.prototype.on=function(e,t){Ia(this,e,t)},e.prototype.off=function(e,t){qa(this,e,t)}}function Oi(){this.id=null}function Ii(e){for(;Ua.length<=e;)Ua.push(Ni(Ua)+" ");return Ua[e]}function Ni(e){return e[e.length-1]}function qi(e,t){for(var n=0;n-1&&Xa(e))||t.test(e):Xa(e)}function Hi(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function $i(e){return e.charCodeAt(0)>=768&&Za.test(e)}function Ui(e,t,n,r){var i=document.createElement(e);if(n&&(i.className=n),r&&(i.style.cssText=r),"string"==typeof t)i.appendChild(document.createTextNode(t));else if(t)for(var o=0;o0;--t)e.removeChild(e.firstChild);return e}function Vi(e,t){return Ki(e).appendChild(t)}function Gi(){for(var e=document.activeElement;e&&e.root&&e.root.activeElement;)e=e.root.activeElement;return e}function Xi(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function Zi(e,t){for(var n=e.split(" "),r=0;r2&&!(wo&&_o<8))}var n=Qa?Ui("span","​"):Ui("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function to(e){if(null!=Ja)return Ja;var t=Vi(e,document.createTextNode("AخA")),n=Va(t,0,1).getBoundingClientRect(),r=Va(t,1,2).getBoundingClientRect();return Ki(e),!(!n||n.left==n.right)&&(Ja=r.right-n.right<3)}function no(e){if(null!=ss)return ss;var t=Vi(e,Ui("span","x")),n=t.getBoundingClientRect(),r=Va(t,0,1).getBoundingClientRect();return ss=Math.abs(n.left-r.left)>1}function ro(e,t,n,r){if(!e)return r(t,n,"ltr");for(var i=!1,o=0;ot||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr"),i=!0)}i||r(t,n,"ltr")}function io(e){return e.level%2?e.to:e.from}function oo(e){return e.level%2?e.from:e.to}function ao(e){var t=ai(e);return t?io(t[0]):0}function so(e){var t=ai(e);return t?oo(Ni(t)):e.text.length}function lo(e,t){var n=Jr(e.doc,t),r=kr(n);r!=n&&(t=ri(r));var i=ai(r),o=i?i[0].level%2?so(r):ao(r):0;return Bo(t,o)}function co(e,t){for(var n,r=Jr(e.doc,t);n=yr(r);)r=n.find(1,!0).line,t=null;var i=ai(r),o=i?i[0].level%2?ao(r):so(r):r.text.length;return Bo(null==t?ri(r):t,o)}function uo(e,t){var n=lo(e,t.line),r=Jr(e.doc,n.line),i=ai(r);if(!i||0==i[0].level){var o=Math.max(0,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=o&&t.ch;return Bo(n.line,a?0:o)}return n}function fo(e,t,n){var r=e[0].level;return t==r||n!=r&&tt)return r;if(i.from==t||i.to==t){if(null!=n)return fo(e,i.level,e[n].level)?(i.from!=i.to&&(cs=n),r):(i.from!=i.to&&(cs=r),n);n=r}}return n}function ho(e,t,n,r){if(!r)return t+n;do t+=n;while(t>0&&$i(e.text.charAt(t)));return t}function mo(e,t,n,r){var i=ai(e);if(!i)return go(e,t,n,r);for(var o=po(i,t),a=i[o],s=ho(e,t,a.level%2?-n:n,r);;){if(s>a.from&&s0==a.level%2?a.to:a.from);if(a=i[o+=n],!a)return null;s=n>0==a.level%2?ho(e,a.to,-1,r):ho(e,a.from,1,r)}}function go(e,t,n,r){var i=t+n;if(r)for(;i>0&&$i(e.text.charAt(i));)i+=n;return i<0||i>e.text.length?null:i}var vo=navigator.userAgent,yo=navigator.platform,bo=/gecko\/\d/i.test(vo),ko=/MSIE \d/.test(vo),xo=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(vo),wo=ko||xo,_o=wo&&(ko?document.documentMode||6:xo[1]),Co=/WebKit\//.test(vo),So=Co&&/Qt\/\d+\.\d+/.test(vo),Mo=/Chrome\//.test(vo),Lo=/Opera\//.test(vo),To=/Apple Computer/.test(navigator.vendor),Ao=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(vo),Eo=/PhantomJS/.test(vo),zo=/AppleWebKit/.test(vo)&&/Mobile\/\w+/.test(vo),Oo=zo||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(vo),Io=zo||/Mac/.test(yo),No=/\bCrOS\b/.test(vo),qo=/win/i.test(yo),Po=Lo&&vo.match(/Version\/(\d*\.\d*)/);Po&&(Po=Number(Po[1])),Po&&Po>=15&&(Lo=!1,Co=!0);var Ro=Io&&(So||Lo&&(null==Po||Po<12.11)),jo=bo||wo&&_o>=9,Do=!1,Wo=!1;m.prototype=Wi({update:function(e){var t=e.scrollWidth>e.clientWidth+1,n=e.scrollHeight>e.clientHeight+1,r=e.nativeBarWidth;if(n){this.vert.style.display="block",this.vert.style.bottom=t?r+"px":"0";var i=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+i)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(t){this.horiz.style.display="block",this.horiz.style.right=n?r+"px":"0",this.horiz.style.left=e.barLeft+"px";var o=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+o+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(0==r&&this.zeroWidthHack(),this.checkedZeroWidth=!0), +{right:n?r:0,bottom:t?r:0}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},zeroWidthHack:function(){var e=Io&&!Ao?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Oi,this.disableVert=new Oi},enableZeroWidthBar:function(e,t){function n(){var r=e.getBoundingClientRect(),i=document.elementFromPoint(r.left+1,r.bottom-1);i!=e?e.style.pointerEvents="none":t.set(1e3,n)}e.style.pointerEvents="auto",t.set(1e3,n)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},m.prototype),g.prototype=Wi({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},g.prototype),e.scrollbarModel={"native":m,"null":g},S.prototype.signal=function(e,t){Ei(e,t)&&this.events.push(arguments)},S.prototype.finish=function(){for(var e=0;e=9&&n.hasSelection&&(n.hasSelection=null),n.poll()}),Ia(o,"paste",function(e){Ti(r,e)||J(e,r)||(r.state.pasteIncoming=!0,n.fastPoll())}),Ia(o,"cut",t),Ia(o,"copy",t),Ia(e.scroller,"paste",function(t){Vt(e,t)||Ti(r,t)||(r.state.pasteIncoming=!0,n.focus())}),Ia(e.lineSpace,"selectstart",function(t){Vt(e,t)||Ea(t)}),Ia(o,"compositionstart",function(){var e=r.getCursor("from");n.composing&&n.composing.range.clear(),n.composing={start:e,range:r.markText(e,r.getCursor("to"),{className:"CodeMirror-composing"})}}),Ia(o,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},prepareSelection:function(){var e=this.cm,t=e.display,n=e.doc,r=Pe(e);if(e.options.moveInputWithCursor){var i=mt(e,n.sel.primary().head,"div"),o=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,i.top+a.top-o.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,i.left+a.left-o.left))}return r},showSelection:function(e){var t=this.cm,n=t.display;Vi(n.cursorDiv,e.cursors),Vi(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},reset:function(e){if(!this.contextMenuPending){var t,n,r=this.cm,i=r.doc;if(r.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=as&&(o.to().line-o.from().line>100||(n=r.getSelection()).length>1e3);var a=t?"-":n||r.getSelection();this.composing||(this.textarea.value=a),r.state.focused&&Ka(this.textarea),wo&&_o>=9&&(this.hasSelection=a)}else e||(this.composing||(this.prevInput=this.textarea.value=""),wo&&_o>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!Oo||Gi()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;e.pollingFast||e.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},fastPoll:function(){function e(){var r=n.poll();r||t?(n.pollingFast=!1,n.slowPoll()):(t=!0,n.polling.set(60,e))}var t=!1,n=this;n.pollingFast=!0,n.polling.set(20,e)},poll:function(){var e=this.cm,t=this.textarea,n=this.prevInput;if(this.contextMenuPending||!e.state.focused||os(t)&&!n&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var r=t.value;if(r==n&&!e.somethingSelected())return!1;if(wo&&_o>=9&&this.hasSelection===r||Io&&/[\uf700-\uf7ff]/.test(r))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var i=r.charCodeAt(0);if(8203!=i||n||(n="​"),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var o=0,a=Math.min(n.length,r.length);o1e3||r.indexOf("\n")>-1?t.value=s.prevInput="":s.prevInput=r,s.composing&&(s.composing.range.clear(),s.composing.range=e.markText(s.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){wo&&_o>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(e){function t(){if(null!=a.selectionStart){var e=i.somethingSelected(),t="​"+(e?a.value:"");a.value="⇚",a.value=t,r.prevInput=e?"":"​",a.selectionStart=1,a.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function n(){if(r.contextMenuPending=!1,r.wrapper.style.cssText=f,a.style.cssText=u,wo&&_o<9&&o.scrollbars.setScrollTop(o.scroller.scrollTop=l),null!=a.selectionStart){(!wo||wo&&_o<9)&&t();var e=0,n=function(){o.selForContextMenu==i.doc.sel&&0==a.selectionStart&&a.selectionEnd>0&&"​"==r.prevInput?Ot(i,pa.selectAll)(i):e++<10?o.detectingSelectAll=setTimeout(n,500):o.input.reset()};o.detectingSelectAll=setTimeout(n,200)}}var r=this,i=r.cm,o=i.display,a=r.textarea,s=Gt(i,e),l=o.scroller.scrollTop;if(s&&!Lo){var c=i.options.resetSelectionOnContextMenu;c&&i.doc.sel.contains(s)==-1&&Ot(i,Le)(i.doc,he(s),Wa);var u=a.style.cssText,f=r.wrapper.style.cssText;r.wrapper.style.cssText="position: absolute";var d=r.wrapper.getBoundingClientRect();if(a.style.cssText="position: absolute; width: 30px; height: 30px; top: "+(e.clientY-d.top-5)+"px; left: "+(e.clientX-d.left-5)+"px; z-index: 1000; background: "+(wo?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",Co)var p=window.scrollY;if(o.input.focus(),Co&&window.scrollTo(null,p),o.input.reset(),i.somethingSelected()||(a.value=r.prevInput=" "),r.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),wo&&_o>=9&&t(),jo){Oa(e);var h=function(){qa(window,"mouseup",h),setTimeout(n,20)};Ia(window,"mouseup",h)}else setTimeout(n,50)}},readOnlyChanged:function(e){e||this.reset()},setUneditable:ji,needsContentAttribute:!1},re.prototype),oe.prototype=Wi({init:function(e){function t(e){if(!Ti(r,e)){if(r.somethingSelected())Ho={lineWise:!1,text:r.getSelections()},"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=te(r);Ho={lineWise:!0,text:t.text},"cut"==e.type&&r.operation(function(){r.setSelections(t.ranges,0,Wa),r.replaceSelection("",null,"cut")})}if(e.clipboardData){e.clipboardData.clearData();var o=Ho.text.join("\n");if(e.clipboardData.setData("Text",o),e.clipboardData.getData("Text")==o)return void e.preventDefault()}var a=ie(),s=a.firstChild;r.display.lineSpace.insertBefore(a,r.display.lineSpace.firstChild),s.value=Ho.text.join("\n");var l=document.activeElement;Ka(s),setTimeout(function(){r.display.lineSpace.removeChild(a),l.focus(),l==i&&n.showPrimarySelection()},50)}}var n=this,r=n.cm,i=n.div=e.lineDiv;ne(i,r.options.spellcheck),Ia(i,"paste",function(e){Ti(r,e)||J(e,r)||_o<=11&&setTimeout(Ot(r,function(){n.pollContent()||Rt(r)}),20)}),Ia(i,"compositionstart",function(e){var t=e.data;if(n.composing={sel:r.doc.sel,data:t,startData:t},t){var i=r.doc.sel.primary(),o=r.getLine(i.head.line),a=o.indexOf(t,Math.max(0,i.head.ch-t.length));a>-1&&a<=i.head.ch&&(n.composing.sel=he(Bo(i.head.line,a),Bo(i.head.line,a+t.length)))}}),Ia(i,"compositionupdate",function(e){n.composing.data=e.data}),Ia(i,"compositionend",function(e){var t=n.composing;t&&(e.data==t.startData||/\u200b/.test(e.data)||(t.data=e.data),setTimeout(function(){t.handled||n.applyComposition(t),n.composing==t&&(n.composing=null)},50))}),Ia(i,"touchstart",function(){n.forceCompositionEnd()}),Ia(i,"input",function(){n.composing||!r.isReadOnly()&&n.pollContent()||zt(n.cm,function(){Rt(r)})}),Ia(i,"copy",t),Ia(i,"cut",t)},prepareSelection:function(){var e=Pe(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e,t){e&&this.cm.display.view.length&&((e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e))},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),n=le(this.cm,e.anchorNode,e.anchorOffset),r=le(this.cm,e.focusNode,e.focusOffset);if(!n||n.bad||!r||r.bad||0!=Fo(Z(n,r),t.from())||0!=Fo(X(n,r),t.to())){var i=ae(this.cm,t.from()),o=ae(this.cm,t.to());if(i||o){var a=this.cm.display.view,s=e.rangeCount&&e.getRangeAt(0);if(i){if(!o){var l=a[a.length-1].measure,c=l.maps?l.maps[l.maps.length-1]:l.map;o={node:c[c.length-1],offset:c[c.length-2]-c[c.length-3]}}}else i={node:a[0].measure.map[2],offset:0};try{var u=Va(i.node,i.offset,o.offset,o.node)}catch(f){}u&&(!bo&&this.cm.state.focused?(e.collapse(i.node,i.offset),u.collapsed||e.addRange(u)):(e.removeAllRanges(),e.addRange(u)),s&&null==e.anchorNode?e.addRange(s):bo&&this.startGracePeriod()),this.rememberSelection()}}},startGracePeriod:function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){e.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(e){Vi(this.cm.display.cursorDiv,e.cursors),Vi(this.cm.display.selectionDiv,e.selection)},rememberSelection:function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},selectionInEditor:function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return Ya(this.div,t)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():zt(this.cm,function(){t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},selectionChanged:function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;this.rememberSelection();var n=le(t,e.anchorNode,e.anchorOffset),r=le(t,e.focusNode,e.focusOffset);n&&r&&zt(t,function(){Le(t.doc,he(n,r),Wa),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}},pollContent:function(){var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.linet.viewTo-1)return!1;var o;if(r.line==t.viewFrom||0==(o=Wt(e,r.line)))var a=ri(t.view[0].line),s=t.view[0].node;else var a=ri(t.view[o].line),s=t.view[o-1].node.nextSibling;var l=Wt(e,i.line);if(l==t.view.length-1)var c=t.viewTo-1,u=t.lineDiv.lastChild;else var c=ri(t.view[l+1].line)-1,u=t.view[l+1].node.previousSibling;for(var f=e.doc.splitLines(ue(e,s,u,a,c)),d=ei(e.doc,Bo(a,0),Bo(c,Jr(e.doc,c).text.length));f.length>1&&d.length>1;)if(Ni(f)==Ni(d))f.pop(),d.pop(),c--;else{if(f[0]!=d[0])break;f.shift(),d.shift(),a++}for(var p=0,h=0,m=f[0],g=d[0],v=Math.min(m.length,g.length);p1||f[0]||Fo(x,w)?(Nn(e.doc,f,x,w,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(e){this.cm.isReadOnly()?Ot(this.cm,Rt)(this.cm):e.data&&e.data!=e.startData&&Ot(this.cm,Q)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.contentEditable="false"},onKeyPress:function(e){e.preventDefault(),this.cm.isReadOnly()||Ot(this.cm,Q)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},readOnlyChanged:function(e){this.div.contentEditable=String("nocursor"!=e)},onContextMenu:ji,resetPosition:ji,needsContentAttribute:!0},oe.prototype),e.inputStyles={textarea:re,contenteditable:oe},fe.prototype={primary:function(){return this.ranges[this.primIndex]},equals:function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var t=0;t=0&&Fo(e,r.to())<=0)return n}return-1}},de.prototype={from:function(){return Z(this.anchor,this.head)},to:function(){return X(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var $o,Uo,Ko,Vo={left:0,right:0,top:0,bottom:0},Go=null,Xo=0,Zo=0,Yo=0,Qo=null;wo?Qo=-.53:bo?Qo=15:Mo?Qo=-.7:To&&(Qo=-1/3);var Jo=function(e){var t=e.wheelDeltaX,n=e.wheelDeltaY;return null==t&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(t=e.detail),null==n&&e.detail&&e.axis==e.VERTICAL_AXIS?n=e.detail:null==n&&(n=e.wheelDelta),{x:t,y:n}};e.wheelEventPixels=function(e){var t=Jo(e);return t.x*=Qo,t.y*=Qo,t};var ea=new Oi,ta=null,na=e.changeEnd=function(e){return e.text?Bo(e.from.line+e.text.length-1,Ni(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var n=this.options,r=n[e];n[e]==t&&"mode"!=e||(n[e]=t,ia.hasOwnProperty(e)&&Ot(this,ia[e])(this,t,r))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Xn(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;nn&&(Fn(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Wn(this));else{var o=i.from(),a=i.to(),s=Math.max(n,o.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var l=s;l0&&_e(this.doc,r,new de(o,c[r].to()),Wa)}}}),getTokenAt:function(e,t){return Nr(this,e,t)},getLineTokens:function(e,t){return Nr(this,Bo(e),t,!0)},getTokenTypeAt:function(e){e=ge(this.doc,e);var t,n=Rr(this,Jr(this.doc,e.line)),r=0,i=(n.length-1)/2,o=e.ch;if(0==o)t=n[2];else for(;;){var a=r+i>>1;if((a?n[2*a-1]:0)>=o)i=a;else{if(!(n[2*a+1]i&&(e=i,r=!0),n=Jr(this.doc,e)}else n=e;return dt(this,n,{top:0,left:0},t||"page").top+(r?this.doc.height-oi(n):0)},defaultTextHeight:function(){return kt(this.display)},defaultCharWidth:function(){return xt(this.display)},setGutterMarker:It(function(e,t,n){return Hn(this.doc,e,"gutter",function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&Hi(r)&&(e.gutterMarkers=null),!0})}),clearGutter:It(function(e){var t=this,n=t.doc,r=n.first;n.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&(n.gutterMarkers[e]=null,jt(t,r,"gutter"),Hi(n.gutterMarkers)&&(n.gutterMarkers=null)),++r})}),lineInfo:function(e){if("number"==typeof e){if(!ye(this.doc,e))return null;var t=e;if(e=Jr(this.doc,e),!e)return null}else{var t=ri(e);if(null==t)return null}return{line:t,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display;e=mt(this,ge(this.doc,e));var a=e.bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)a=e.top;else if("above"==r||"near"==r){var l=Math.max(o.wrapper.clientHeight,this.doc.height),c=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>l)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=l&&(a=e.bottom),s+t.offsetWidth>c&&(s=c-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),n&&Rn(this,s,a,s+t.offsetWidth,a+t.offsetHeight)},triggerOnKeyDown:It(hn),triggerOnKeyPress:It(vn),triggerOnKeyUp:gn,execCommand:function(e){if(pa.hasOwnProperty(e))return pa[e].call(null,this)},triggerElectric:It(function(e){ee(this,e)}),findPosH:function(e,t,n,r){var i=1;t<0&&(i=-1,t=-t);for(var o=0,a=ge(this.doc,e);o0&&s(n.charAt(r-1));)--r;for(;i.5)&&a(this),Pa(this,"refresh",this)}),swapDoc:It(function(e){var t=this.doc;return t.cm=null,Qr(this,e),ct(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Mi(this,"swapDoc",this,t),t}),getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},zi(e);var ra=e.defaults={},ia=e.optionHandlers={},oa=e.Init={toString:function(){return"CodeMirror.Init"}};Vn("value","",function(e,t){e.setValue(t)},!0),Vn("mode",null,function(e,t){e.doc.modeOption=t,n(e)},!0),Vn("indentUnit",2,n,!0),Vn("indentWithTabs",!1),Vn("smartIndent",!0),Vn("tabSize",4,function(e){r(e),ct(e),Rt(e)},!0),Vn("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter(function(e){for(var i=0;;){var o=e.text.indexOf(t,i);if(o==-1)break;i=o+t.length,n.push(Bo(r,o))}r++});for(var i=n.length-1;i>=0;i--)Nn(e.doc,t,n[i],Bo(n[i].line,n[i].ch+t.length))}}),Vn("specialChars",/[\u0000-\u001f\u007f\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,n,r){t.state.specialChars=new RegExp(n.source+(n.test("\t")?"":"|\t"),"g"),r!=e.Init&&t.refresh()}),Vn("specialCharPlaceholder",Br,function(e){e.refresh()},!0),Vn("electricChars",!0),Vn("inputStyle",Oo?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),Vn("spellcheck",!1,function(e,t){e.getInputField().spellcheck=t},!0),Vn("rtlMoveVisually",!qo),Vn("wholeLineUpdateBefore",!0),Vn("theme","default",function(e){s(e),l(e)},!0),Vn("keyMap","default",function(t,n,r){var i=Xn(n),o=r!=e.Init&&Xn(r);o&&o.detach&&o.detach(t,i),i.attach&&i.attach(t,o||null)}),Vn("extraKeys",null),Vn("lineWrapping",!1,i,!0),Vn("gutters",[],function(e){p(e.options),l(e)},!0),Vn("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?C(e.display)+"px":"0",e.refresh()},!0),Vn("coverGutterNextToScrollbar",!1,function(e){y(e)},!0),Vn("scrollbarStyle","native",function(e){v(e),y(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),Vn("lineNumbers",!1,function(e){p(e.options),l(e)},!0),Vn("firstLineNumber",1,l,!0),Vn("lineNumberFormatter",function(e){return e},l,!0),Vn("showCursorWhenSelecting",!1,qe,!0),Vn("resetSelectionOnContextMenu",!0),Vn("lineWiseCopyCut",!0),Vn("readOnly",!1,function(e,t){"nocursor"==t?(kn(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),Vn("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),Vn("dragDrop",!0,Ut),Vn("allowDropFileTypes",null),Vn("cursorBlinkRate",530),Vn("cursorScrollMargin",0),Vn("cursorHeight",1,qe,!0),Vn("singleCursorHeightPerLine",!0,qe,!0),Vn("workTime",100),Vn("workDelay",100),Vn("flattenSpans",!0,r,!0),Vn("addModeClass",!1,r,!0),Vn("pollInterval",100),Vn("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),Vn("historyEventDelay",1250),Vn("viewportMargin",10,function(e){e.refresh()},!0),Vn("maxHighlightLength",1e4,r,!0),Vn("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),Vn("tabindex",null,function(e,t){e.display.input.getField().tabIndex=t||""}),Vn("autofocus",null);var aa=e.modes={},sa=e.mimeModes={};e.defineMode=function(t,n){e.defaults.mode||"null"==t||(e.defaults.mode=t),arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),aa[t]=n},e.defineMIME=function(e,t){sa[e]=t},e.resolveMode=function(t){if("string"==typeof t&&sa.hasOwnProperty(t))t=sa[t];else if(t&&"string"==typeof t.name&&sa.hasOwnProperty(t.name)){var n=sa[t.name];"string"==typeof n&&(n={name:n}),t=Di(n,t),t.name=n.name}else{if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+json$/.test(t))return e.resolveMode("application/json")}return"string"==typeof t?{name:t}:t||{name:"null"}},e.getMode=function(t,n){var n=e.resolveMode(n),r=aa[n.name];if(!r)return e.getMode(t,"text/plain");var i=r(t,n);if(la.hasOwnProperty(n.name)){var o=la[n.name];for(var a in o)o.hasOwnProperty(a)&&(i.hasOwnProperty(a)&&(i["_"+a]=i[a]),i[a]=o[a])}if(i.name=n.name,n.helperType&&(i.helperType=n.helperType),n.modeProps)for(var a in n.modeProps)i[a]=n.modeProps[a];return i},e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var la=e.modeExtensions={};e.extendMode=function(e,t){var n=la.hasOwnProperty(e)?la[e]:la[e]={};Wi(t,n)},e.defineExtension=function(t,n){e.prototype[t]=n},e.defineDocExtension=function(e,t){La.prototype[e]=t},e.defineOption=Vn;var ca=[];e.defineInitHook=function(e){ca.push(e)};var ua=e.helpers={};e.registerHelper=function(t,n,r){ua.hasOwnProperty(t)||(ua[t]=e[t]={_global:[]}),ua[t][n]=r},e.registerGlobalHelper=function(t,n,r,i){e.registerHelper(t,n,i),ua[t]._global.push({pred:r,val:i})};var fa=e.copyState=function(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var i=t[r];i instanceof Array&&(i=i.concat([])),n[r]=i}return n},da=e.startState=function(e,t,n){return!e.startState||e.startState(t,n)};e.innerMode=function(e,t){for(;e.innerMode;){var n=e.innerMode(t);if(!n||n.mode==e)break;t=n.state,e=n.mode}return n||{mode:e,state:t}};var pa=e.commands={selectAll:function(e){e.setSelection(Bo(e.firstLine(),0),Bo(e.lastLine()),Wa)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Wa)},killLine:function(e){$n(e,function(t){if(t.empty()){var n=Jr(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new Bo(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),Bo(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Jr(e.doc,i.line-1).text;a&&e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),Bo(i.line-1,a.length-1),Bo(i.line,1),"+transpose")}n.push(new de(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){zt(e,function(){for(var t=e.listSelections().length,n=0;n=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){if(this.post},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos0?null:(r&&t!==!1&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);if(i(o)==i(e))return t!==!1&&(this.pos+=e.length),!0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};var ba=0,ka=e.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ba};zi(ka),ka.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&wt(e),Ei(this,"clear")){var n=this.find();n&&Mi(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=l,e.display.maxLineLength=c,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Rt(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ee(e.doc)),e&&Mi(e,"markerCleared",e,this),t&&Ct(e),this.parent&&this.parent.clear()}},ka.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var n,r,i=0;i1||!(this.children[0]instanceof Xr))){var s=[];this.collapse(s),this.children=[new Xr(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var a=i.lines.length%25+25,s=a;s10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;r=0;o--)Tn(this,r[o]);s?Me(this,s):this.cm&&Wn(this.cm)}),undo:Nt(function(){En(this,"undo")}),redo:Nt(function(){En(this,"redo")}),undoSelection:Nt(function(){En(this,"undo",!0)}),redoSelection:Nt(function(){En(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=ge(this,e),t=ge(this,t);var r=[],i=e.line;return this.iter(e.line,t.line+1,function(o){var a=o.markedSpans;if(a)for(var s=0;s=l.to||null==l.from&&i!=e.line||null!=l.from&&i==t.line&&l.from>=t.ch||n&&!n(l.marker)||r.push(l.marker.parent||l.marker)}++i}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;re?(t=e,!0):(e-=o,void++n)}),ge(this,Bo(n,t))},indexFromPos:function(e){e=ge(this,e);var t=e.ch;if(e.linet&&(t=e.from),null!=e.to&&e.to=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}},$a=e.findColumn=function(e,t,n){for(var r=0,i=0;;){var o=e.indexOf("\t",r);o==-1&&(o=e.length);var a=o-r;if(o==e.length||i+a>=t)return r+Math.min(a,t-i);if(i+=o-r,i+=n-i%n,r=o+1,i>=t)return r}},Ua=[""],Ka=function(e){e.select()};zo?Ka=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:wo&&(Ka=function(e){try{e.select()}catch(t){}});var Va,Ga=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Xa=e.isWordChar=function(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Ga.test(e))},Za=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;Va=document.createRange?function(e,t,n,r){var i=document.createRange();return i.setEnd(r||e,n),i.setStart(e,t),i}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var Ya=e.contains=function(e,t){if(3==t.nodeType&&(t=t.parentNode),e.contains)return e.contains(t);do if(11==t.nodeType&&(t=t.host),t==e)return!0;while(t=t.parentNode)};wo&&_o<11&&(Gi=function(){try{return document.activeElement}catch(e){return document.body}});var Qa,Ja,es=e.rmClass=function(e,t){var n=e.className,r=Xi(t).exec(n);if(r){var i=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(i?r[1]+i:"")}},ts=e.addClass=function(e,t){var n=e.className;Xi(t).test(n)||(e.className+=(n?" ":"")+t)},ns=!1,rs=function(){if(wo&&_o<9)return!1;var e=Ui("div");return"draggable"in e||"dragDrop"in e}(),is=e.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;t<=r;){var i=e.indexOf("\n",t);i==-1&&(i=e.length);var o=e.slice(t,"\r"==e.charAt(i-1)?i-1:i),a=o.indexOf("\r");a!=-1?(n.push(o.slice(0,a)),t+=a+1):(n.push(o),t=i+1)}return n}:function(e){return e.split(/\r\n?|\n/)},os=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(n){}return!(!t||t.parentElement()!=e)&&0!=t.compareEndPoints("StartToEnd",t)},as=function(){var e=Ui("div");return"oncopy"in e||(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),ss=null,ls=e.keyNames={3:"Enter",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",127:"Delete",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};!function(){for(var e=0;e<10;e++)ls[e+48]=ls[e+96]=String(e);for(var e=65;e<=90;e++)ls[e]=String.fromCharCode(e);for(var e=1;e<=12;e++)ls[e+111]=ls[e+63235]="F"+e}();var cs,us=function(){function e(e){return e<=247?n.charAt(e):1424<=e&&e<=1524?"R":1536<=e&&e<=1773?r.charAt(e-1536):1774<=e&&e<=2220?"r":8192<=e&&e<=8203?"w":8204==e?"b":"L"}function t(e,t,n){this.level=e,this.from=t,this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",r="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,s=/[Lb1n]/,l=/[1n]/,c="L";return function(n){if(!i.test(n))return!1;for(var r,u=n.length,f=[],d=0;d2){r.pending=[];for(var d=2;d-1)return e.Pass;var a=r.indent.length-1,s=t[r.state];e:for(;;){for(var c=0;c-1?i+t.length:i}var o=t.exec(n?e.slice(n):e);return o?o.index+n+(r?o[0].length:0):-1}var r=Array.prototype.slice.call(arguments,1);return{startState:function(){return{outer:e.startState(t),innerActive:null,inner:null}},copyState:function(n){return{outer:e.copyState(t,n.outer),innerActive:n.innerActive,inner:n.innerActive&&e.copyState(n.innerActive.mode,n.inner)}},token:function(i,o){if(o.innerActive){var a=o.innerActive,s=i.string;if(!a.close&&i.sol())return o.innerActive=o.inner=null,this.token(i,o);var l=a.close?n(s,a.close,i.pos,a.parseDelimiters):-1;if(l==i.pos&&!a.parseDelimiters)return i.match(a.close),o.innerActive=o.inner=null,a.delimStyle&&a.delimStyle+" "+a.delimStyle+"-close";l>-1&&(i.string=s.slice(0,l));var c=a.mode.token(i,o.inner);return l>-1&&(i.string=s),l==i.pos&&a.parseDelimiters&&(o.innerActive=o.inner=null),a.innerStyle&&(c=c?c+" "+a.innerStyle:a.innerStyle),c}for(var u=1/0,s=i.string,f=0;f-1)return u=n(l,c,u),{from:r(o.line,u),to:r(o.line,u+a.length)}}else{var l=e.getLine(o.line).slice(o.ch),c=s(l),u=c.indexOf(t);if(u>-1)return u=n(l,c,u)+o.ch,{from:r(o.line,u),to:r(o.line,u+a.length)}}}:this.matches=function(){};else{var c=a.split("\n");this.matches=function(t,n){var i=l.length-1;if(t){if(n.line-(l.length-1)=1;--u,--a)if(l[u]!=s(e.getLine(a)))return;var f=e.getLine(a),d=f.length-c[0].length;if(s(f.slice(d))!=l[0])return;return{from:r(a,d),to:o}}if(!(n.line+(l.length-1)>e.lastLine())){var f=e.getLine(n.line),d=f.length-c[0].length;if(s(f.slice(d))==l[0]){for(var p=r(n.line,d),a=n.line+1,u=1;un))return r;--r}}}var r=e.Pos;t.prototype={findNext:function(){return this.find(!1)},findPrevious:function(){return this.find(!0)},find:function(e){function t(e){var t=r(e,0);return n.pos={from:t,to:t},n.atOccurrence=!1,!1}for(var n=this,i=this.doc.clipPos(e?this.pos.from:this.pos.to);;){if(this.pos=this.matches(e,i))return this.atOccurrence=!0,this.pos.match||!0;if(e){if(!i.line)return t(0);i=r(i.line-1,this.doc.getLine(i.line-1).length)}else{var o=this.doc.lineCount();if(i.line==o-1)return t(o);i=r(i.line+1,0)}}},from:function(){if(this.atOccurrence)return this.pos.from},to:function(){if(this.atOccurrence)return this.pos.to},replace:function(t,n){if(this.atOccurrence){var i=e.splitLines(t);this.doc.replaceRange(i,this.pos.from,this.pos.to,n),this.pos.to=r(this.pos.from.line+i.length-1,i[i.length-1].length+(1==i.length?this.pos.from.ch:0))}}},e.defineExtension("getSearchCursor",function(e,n,r){return new t(this.doc,e,n,r)}),e.defineDocExtension("getSearchCursor",function(e,n,r){return new t(this,e,n,r)}),e.defineExtension("selectMatches",function(t,n){for(var r=[],i=this.getSearchCursor(t,this.getCursor("from"),n);i.findNext()&&!(e.cmpPos(i.to(),this.getCursor("to"))>0);)r.push({anchor:i.from(),head:i.to()});r.length&&this.setSelections(r,0)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./searchcursor"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../dialog/dialog"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){return"string"==typeof e?e=new RegExp(e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&"),t?"gi":"g"):e.global||(e=new RegExp(e.source,e.ignoreCase?"gi":"g")),{token:function(t){e.lastIndex=t.pos;var n=e.exec(t.string);return n&&n.index==t.pos?(t.pos+=n[0].length||1,"searching"):void(n?t.pos=n.index:t.skipToEnd())}}}function n(){this.posFrom=this.posTo=this.lastQuery=this.query=null,this.overlay=null}function r(e){return e.state.search||(e.state.search=new n)}function i(e){return"string"==typeof e&&e==e.toLowerCase()}function o(e,t,n){return e.getSearchCursor(t,n,i(t))}function a(e,t,n,r,i){e.openDialog(t,r,{value:n,selectValueOnOpen:!0,closeOnEnter:!1,onClose:function(){h(e)},onKeyDown:i})}function s(e,t,n,r,i){e.openDialog?e.openDialog(t,i,{value:r,selectValueOnOpen:!0}):i(prompt(n,r))}function l(e,t,n,r){e.openConfirm?e.openConfirm(t,r):confirm(n)&&r[0]()}function c(e){return e.replace(/\\(.)/g,function(e,t){return"n"==t?"\n":"r"==t?"\r":t})}function u(e){var t=e.match(/^\/(.*)\/([a-z]*)$/);if(t)try{e=new RegExp(t[1],t[2].indexOf("i")==-1?"":"i")}catch(n){}else e=c(e);return("string"==typeof e?""==e:e.test(""))&&(e=/x^/),e}function f(e,n,r){n.queryText=r,n.query=u(r),e.removeOverlay(n.overlay,i(n.query)),n.overlay=t(n.query,i(n.query)),e.addOverlay(n.overlay),e.showMatchesOnScrollbar&&(n.annotate&&(n.annotate.clear(),n.annotate=null),n.annotate=e.showMatchesOnScrollbar(n.query,i(n.query)))}function d(t,n,i,o){var l=r(t);if(l.query)return p(t,n);var c=t.getSelection()||l.lastQuery;if(i&&t.openDialog){var u=null,d=function(n,r){e.e_stop(r),n&&(n!=l.queryText&&(f(t,l,n),l.posFrom=l.posTo=t.getCursor()),u&&(u.style.opacity=1),p(t,r.shiftKey,function(e,n){var r;n.line<3&&document.querySelector&&(r=t.display.wrapper.querySelector(".CodeMirror-dialog"))&&r.getBoundingClientRect().bottom-4>t.cursorCoords(n,"window").top&&((u=r).style.opacity=.4)}))};a(t,v,c,d,function(n,i){var o=e.keyName(n),a=e.keyMap[t.getOption("keyMap")][o];a||(a=t.getOption("extraKeys")[o]),"findNext"==a||"findPrev"==a||"findPersistentNext"==a||"findPersistentPrev"==a?(e.e_stop(n),f(t,r(t),i),t.execCommand(a)):"find"!=a&&"findPersistent"!=a||(e.e_stop(n),d(i,n))}),o&&c&&(f(t,l,c),p(t,n))}else s(t,v,"Search for:",c,function(e){e&&!l.query&&t.operation(function(){f(t,l,e),l.posFrom=l.posTo=t.getCursor(),p(t,n)})})}function p(t,n,i){t.operation(function(){var a=r(t),s=o(t,a.query,n?a.posFrom:a.posTo);(s.find(n)||(s=o(t,a.query,n?e.Pos(t.lastLine()):e.Pos(t.firstLine(),0)),s.find(n)))&&(t.setSelection(s.from(),s.to()),t.scrollIntoView({from:s.from(),to:s.to()},20),a.posFrom=s.from(),a.posTo=s.to(),i&&i(s.from(),s.to()))})}function h(e){e.operation(function(){var t=r(e);t.lastQuery=t.query,t.query&&(t.query=t.queryText=null,e.removeOverlay(t.overlay),t.annotate&&(t.annotate.clear(),t.annotate=null))})}function m(e,t,n){e.operation(function(){for(var r=o(e,t);r.findNext();)if("string"!=typeof t){var i=e.getRange(r.from(),r.to()).match(t);r.replace(n.replace(/\$(\d)/g,function(e,t){return i[t]}))}else r.replace(n)})}function g(e,t){if(!e.getOption("readOnly")){var n=e.getSelection()||r(e).lastQuery,i=t?"Replace all:":"Replace:";s(e,i+y,i,n,function(n){n&&(n=u(n),s(e,b,"Replace with:","",function(r){if(r=c(r),t)m(e,n,r);else{h(e);var i=o(e,n,e.getCursor("from")),a=function(){var t,c=i.from();!(t=i.findNext())&&(i=o(e,n),!(t=i.findNext())||c&&i.from().line==c.line&&i.from().ch==c.ch)||(e.setSelection(i.from(),i.to()),e.scrollIntoView({from:i.from(),to:i.to()}),l(e,k,"Replace?",[function(){s(t)},a,function(){m(e,n,r)}]))},s=function(e){i.replace("string"==typeof n?r:r.replace(/\$(\d)/g,function(t,n){return e[n]})),a()};a()}}))})}}var v='Search: (Use /re/ syntax for regexp search)',y=' (Use /re/ syntax for regexp search)',b='With: ',k="Replace? ";e.commands.find=function(e){h(e),d(e)},e.commands.findPersistent=function(e){h(e),d(e,!1,!0)},e.commands.findPersistentNext=function(e){d(e,!1,!0,!0)},e.commands.findPersistentPrev=function(e){d(e,!0,!0,!0)},e.commands.findNext=d,e.commands.findPrev=function(e){d(e,!0)},e.commands.clearSearch=h,e.commands.replace=g,e.commands.replaceAll=function(e){g(e,!0)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../dialog/dialog")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../dialog/dialog"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n,r,i){e.openDialog?e.openDialog(t,i,{value:r,selectValueOnOpen:!0}):i(prompt(n,r))}function n(e,t){var n=Number(t);return/^[-+]/.test(t)?e.getCursor().line+n:n-1}var r='Jump to line: (Use line:column or scroll% syntax)';e.commands.jumpToLine=function(e){var i=e.getCursor();t(e,r,"Jump to line:",i.line+1+":"+i.ch,function(t){if(t){var r;if(r=/^\s*([\+\-]?\d+)\s*\:\s*(\d+)\s*$/.exec(t))e.setCursor(n(e,r[1]),Number(r[2]));else if(r=/^\s*([\+\-]?\d+(\.\d+)?)\%\s*/.exec(t)){var o=Math.round(e.lineCount()*Number(r[1])/100);/^[-+]/.test(r[1])&&(o=i.line+o+1),e.setCursor(o-1,i.ch)}else(r=/^\s*\:?\s*([\+\-]?\d+)\s*/.exec(t))&&e.setCursor(n(e,r[1]),i.ch)}})},e.keyMap["default"]["Alt-G"]="jumpToLine"}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./searchcursor"),require("../scroll/annotatescrollbar")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./searchcursor","../scroll/annotatescrollbar"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n,r){this.cm=e,this.options=r;var i={listenForChanges:!1};for(var o in r)i[o]=r[o];i.className||(i.className="CodeMirror-search-match"),this.annotation=e.annotateScrollbar(i),this.query=t,this.caseFold=n,this.gap={from:e.firstLine(),to:e.lastLine()+1},this.matches=[],this.update=null,this.findMatches(),this.annotation.update(this.matches);var a=this;e.on("change",this.changeHandler=function(e,t){a.onChange(t)})}function n(e,t,n){return e<=t?e:Math.max(t,e+n)}e.defineExtension("showMatchesOnScrollbar",function(e,n,r){return"string"==typeof r&&(r={className:r}),r||(r={}),new t(this,e,n,r)});var r=1e3;t.prototype.findMatches=function(){if(this.gap){for(var t=0;t=this.gap.to)break;n.to.line>=this.gap.from&&this.matches.splice(t--,1)}for(var i=this.cm.getSearchCursor(this.query,e.Pos(this.gap.from,0),this.caseFold),o=this.options&&this.options.maxMatches||r;i.findNext();){var n={from:i.from(),to:i.to()};if(n.from.line>=this.gap.to)break;if(this.matches.splice(t++,0,n),this.matches.length>o)break}this.gap=null}},t.prototype.onChange=function(t){var r=t.from.line,i=e.changeEnd(t).line,o=i-t.to.line;if(this.gap?(this.gap.from=Math.min(n(this.gap.from,r,o),t.from.line),this.gap.to=Math.max(n(this.gap.to,r,o),t.from.line)):this.gap={from:t.from.line,to:i+1},o)for(var a=0;a=t.options.minChars&&o(e,d,!1,t.options.style)}})}function l(e,t,n){var r=e.getRange(t,n);if(null!==r.match(/^\w+$/)){if(t.ch>0){var i={line:t.line,ch:t.ch-1},o=e.getRange(i,t);if(null===o.match(/\W/))return!1}if(n.chr.right?1:0:t.clientYr.bottom?1:0,o.moveTo(o.pos+n*o.screen)}),e.on(this.node,"mousewheel",i),e.on(this.node,"DOMMouseScroll",i)}function n(e,n,r){this.addClass=e,this.horiz=new t(e,"horizontal",r),n(this.horiz.node),this.vert=new t(e,"vertical",r),n(this.vert.node),this.width=null}t.prototype.setPos=function(e,t){return e<0&&(e=0),e>this.total-this.screen&&(e=this.total-this.screen),!(!t&&e==this.pos)&&(this.pos=e,this.inner.style["horizontal"==this.orientation?"left":"top"]=e*(this.size/this.total)+"px",!0)},t.prototype.moveTo=function(e){this.setPos(e)&&this.scroll(e,this.orientation)};var r=10;t.prototype.update=function(e,t,n){var i=this.screen!=t||this.total!=e||this.size!=n;i&&(this.screen=t,this.total=e,this.size=n);var o=this.screen*(this.size/this.total);oe.clientWidth+1,i=e.scrollHeight>e.clientHeight+1;return this.vert.node.style.display=i?"block":"none",this.horiz.node.style.display=r?"block":"none",i&&(this.vert.update(e.scrollHeight,e.clientHeight,e.viewHeight-(r?n:0)),this.vert.node.style.bottom=r?n+"px":"0"),r&&(this.horiz.update(e.scrollWidth,e.clientWidth,e.viewWidth-(i?n:0)-e.barLeft),this.horiz.node.style.right=i?n+"px":"0",this.horiz.node.style.left=e.barLeft+"px"),{right:i?n:0,bottom:r?n:0}},n.prototype.setScrollTop=function(e){this.vert.setPos(e)},n.prototype.setScrollLeft=function(e){this.horiz.setPos(e)},n.prototype.clear=function(){var e=this.horiz.node.parentNode;e.removeChild(this.horiz.node),e.removeChild(this.vert.node)},e.scrollbarModel.simple=function(e,t){return new n("CodeMirror-simplescroll",e,t)},e.scrollbarModel.overlay=function(e,t){return new n("CodeMirror-overlayscroll",e,t)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){function n(e){clearTimeout(r.doRedraw),r.doRedraw=setTimeout(function(){r.redraw()},e)}this.cm=e,this.options=t,this.buttonHeight=t.scrollButtonHeight||e.getOption("scrollButtonHeight"),this.annotations=[],this.doRedraw=this.doUpdate=null,this.div=e.getWrapperElement().appendChild(document.createElement("div")),this.div.style.cssText="position: absolute; right: 0; top: 0; z-index: 7; pointer-events: none",this.computeScale();var r=this;e.on("refresh",this.resizeHandler=function(){clearTimeout(r.doUpdate),r.doUpdate=setTimeout(function(){r.computeScale()&&n(20)},100)}),e.on("markerAdded",this.resizeHandler),e.on("markerCleared",this.resizeHandler),t.listenForChanges!==!1&&e.on("change",this.changeHandler=function(){n(250)})}e.defineExtension("annotateScrollbar",function(e){return"string"==typeof e&&(e={className:e}),new t(this,e)}),e.defineOption("scrollButtonHeight",0),t.prototype.computeScale=function(){var e=this.cm,t=(e.getWrapperElement().clientHeight-e.display.barHeight-2*this.buttonHeight)/e.getScrollerElement().scrollHeight;if(t!=this.hScale)return this.hScale=t,!0},t.prototype.update=function(e){this.annotations=e,this.redraw()},t.prototype.redraw=function(e){function t(e,t){if(l!=e.line&&(l=e.line,c=n.getLineHandle(l)),a&&c.height>s)return n.charCoords(e,"local")[t?"top":"bottom"];var r=n.heightAtLine(c,"local");return r+(t?0:c.height)}e!==!1&&this.computeScale();var n=this.cm,r=this.hScale,i=document.createDocumentFragment(),o=this.annotations,a=n.getOption("lineWrapping"),s=a&&1.5*n.defaultTextHeight(),l=null,c=null;if(n.display.barWidth)for(var u,f=0;fh+.9));)d=o[++f],h=t(d.to,!1)*r;if(h!=p){var m=Math.max(h-p,3),g=i.appendChild(document.createElement("div"));g.style.cssText="position: absolute; right: 0px; width: "+Math.max(1.5*n.display.barWidth,2)+"px; top: "+(p+this.buttonHeight)+"px; height: "+m+"px",g.className=this.options.className,d.id&&g.setAttribute("annotation-id",d.id)}}this.div.textContent="",this.div.appendChild(i)},t.prototype.clear=function(){this.cm.off("refresh",this.resizeHandler),this.cm.off("markerAdded",this.resizeHandler),this.cm.off("markerCleared",this.resizeHandler),this.changeHandler&&this.cm.off("change",this.changeHandler),this.div.parentNode.removeChild(this.div)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,n,r){this.cm=e,this.node=t,this.options=n,this.height=r,this.cleared=!1}function n(e){var t=e.getWrapperElement(),n=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,r=parseInt(n.height),i=e.state.panels={setHeight:t.style.height,heightLeft:r,panels:0,wrapper:document.createElement("div")};t.parentNode.insertBefore(i.wrapper,t);var o=e.hasFocus();i.wrapper.appendChild(t),o&&e.focus(),e._setSize=e.setSize,null!=r&&(e.setSize=function(t,n){if(null==n)return this._setSize(t,n);if(i.setHeight=n,"number"!=typeof n){var o=/^(\d+\.?\d*)px$/.exec(n);o?n=Number(o[1]):(i.wrapper.style.height=n,n=i.wrapper.offsetHeight,i.wrapper.style.height="")}e._setSize(t,i.heightLeft+=n-r),r=n})}function r(e){var t=e.state.panels;e.state.panels=null;var n=e.getWrapperElement();t.wrapper.parentNode.replaceChild(n,t.wrapper),n.style.height=t.setHeight,e.setSize=e._setSize,e.setSize()}e.defineExtension("addPanel",function(e,r){r=r||{},this.state.panels||n(this);var i=this.state.panels,o=i.wrapper,a=this.getWrapperElement();r.after instanceof t&&!r.after.cleared?o.insertBefore(e,r.before.node.nextSibling):r.before instanceof t&&!r.before.cleared?o.insertBefore(e,r.before.node):r.replace instanceof t&&!r.replace.cleared?(o.insertBefore(e,r.replace.node),r.replace.clear()):"bottom"==r.position?o.appendChild(e):"before-bottom"==r.position?o.insertBefore(e,a.nextSibling):"after-top"==r.position?o.insertBefore(e,a):o.insertBefore(e,o.firstChild);var s=r&&r.height||e.offsetHeight;return this._setSize(null,i.heightLeft-=s),i.panels++,new t(this,e,r,s)}),t.prototype.clear=function(){if(!this.cleared){this.cleared=!0;var e=this.cm.state.panels;this.cm._setSize(null,e.heightLeft+=this.height),e.wrapper.removeChild(this.node),0==--e.panels&&r(this.cm)}},t.prototype.changed=function(e){var t=null==e?this.node.offsetHeight:e,n=this.cm.state.panels;this.cm._setSize(null,n.height+=t-this.height),this.height=t}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e){e.state.placeholder&&(e.state.placeholder.parentNode.removeChild(e.state.placeholder),e.state.placeholder=null)}function n(e){t(e);var n=e.state.placeholder=document.createElement("pre");n.style.cssText="height: 0; overflow: visible",n.className="CodeMirror-placeholder";var r=e.getOption("placeholder");"string"==typeof r&&(r=document.createTextNode(r)),n.appendChild(r),e.display.lineSpace.insertBefore(n,e.display.lineSpace.firstChild)}function r(e){o(e)&&n(e)}function i(e){var r=e.getWrapperElement(),i=o(e);r.className=r.className.replace(" CodeMirror-empty","")+(i?" CodeMirror-empty":""),i?n(e):t(e)}function o(e){return 1===e.lineCount()&&""===e.getLine(0)}e.defineOption("placeholder","",function(n,o,a){var s=a&&a!=e.Init;if(o&&!s)n.on("blur",r),n.on("change",i),n.on("swapDoc",i),i(n);else if(!o&&s){n.off("blur",r),n.off("change",i),n.off("swapDoc",i),t(n);var l=n.getWrapperElement();l.className=l.className.replace(" CodeMirror-empty","")}o&&!n.hasFocus()&&r(n)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){var t=e.getWrapperElement();e.state.fullScreenRestore={scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,width:t.style.width,height:t.style.height},t.style.width="",t.style.height="auto",t.className+=" CodeMirror-fullscreen",document.documentElement.style.overflow="hidden",e.refresh()}function n(e){var t=e.getWrapperElement();t.className=t.className.replace(/\s*CodeMirror-fullscreen\b/,""),document.documentElement.style.overflow="";var n=e.state.fullScreenRestore;t.style.width=n.width,t.style.height=n.height,window.scrollTo(n.scrollLeft,n.scrollTop),e.refresh()}e.defineOption("fullScreen",!1,function(r,i,o){o==e.Init&&(o=!1),!o!=!i&&(i?t(r):n(r))})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(t,r){function i(){t.display.wrapper.offsetHeight?(n(t,r),t.display.lastWrapHeight!=t.display.wrapper.clientHeight&&t.refresh()):r.timeout=setTimeout(i,r.delay)}r.timeout=setTimeout(i,r.delay),r.hurry=function(){clearTimeout(r.timeout),r.timeout=setTimeout(i,50)},e.on(window,"mouseup",r.hurry),e.on(window,"keyup",r.hurry)}function n(t,n){clearTimeout(n.timeout),e.off(window,"mouseup",n.hurry),e.off(window,"keyup",n.hurry)}e.defineOption("autoRefresh",!1,function(e,r){e.state.autoRefresh&&(n(e,e.state.autoRefresh),e.state.autoRefresh=null),r&&0==e.display.wrapper.offsetHeight&&t(e,e.state.autoRefresh={delay:r.delay||250})})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t,n){var r,i=e.getWrapperElement();return r=i.appendChild(document.createElement("div")),n?r.className="CodeMirror-dialog CodeMirror-dialog-bottom":r.className="CodeMirror-dialog CodeMirror-dialog-top","string"==typeof t?r.innerHTML=t:r.appendChild(t),r}function n(e,t){e.state.currentNotificationClose&&e.state.currentNotificationClose(),e.state.currentNotificationClose=t}e.defineExtension("openDialog",function(r,i,o){function a(e){if("string"==typeof e)f.value=e;else{if(c)return;c=!0,l.parentNode.removeChild(l),u.focus(),o.onClose&&o.onClose(l)}}o||(o={}),n(this,null);var s,l=t(this,r,o.bottom),c=!1,u=this,f=l.getElementsByTagName("input")[0];return f?(f.focus(),o.value&&(f.value=o.value,o.selectValueOnOpen!==!1&&f.select()),o.onInput&&e.on(f,"input",function(e){o.onInput(e,f.value,a)}),o.onKeyUp&&e.on(f,"keyup",function(e){o.onKeyUp(e,f.value,a)}),e.on(f,"keydown",function(t){o&&o.onKeyDown&&o.onKeyDown(t,f.value,a)||((27==t.keyCode||o.closeOnEnter!==!1&&13==t.keyCode)&&(f.blur(),e.e_stop(t),a()),13==t.keyCode&&i(f.value,t)); +}),o.closeOnBlur!==!1&&e.on(f,"blur",a)):(s=l.getElementsByTagName("button")[0])&&(e.on(s,"click",function(){a(),u.focus()}),o.closeOnBlur!==!1&&e.on(s,"blur",a),s.focus()),a}),e.defineExtension("openConfirm",function(r,i,o){function a(){c||(c=!0,s.parentNode.removeChild(s),u.focus())}n(this,null);var s=t(this,r,o&&o.bottom),l=s.getElementsByTagName("button"),c=!1,u=this,f=1;l[0].focus();for(var d=0;d=0&&s[o.text.charAt(l)]||s[o.text.charAt(++l)];if(!c)return null;var u=">"==c.charAt(1)?1:-1;if(r&&u>0!=(l==t.ch))return null;var f=e.getTokenTypeAt(a(t.line,l+1)),d=n(e,a(t.line,l+(u>0?1:0)),u,f||null,i);return null==d?null:{from:a(t.line,l),to:d&&d.pos,match:d&&d.ch==c.charAt(0),forward:u>0}}function n(e,t,n,r,i){for(var o=i&&i.maxScanLineLength||1e4,l=i&&i.maxScanLines||1e3,c=[],u=i&&i.bracketRegex?i.bracketRegex:/[(){}[\]]/,f=n>0?Math.min(t.line+l,e.lastLine()+1):Math.max(e.firstLine()-1,t.line-l),d=t.line;d!=f;d+=n){var p=e.getLine(d);if(p){var h=n>0?0:p.length-1,m=n>0?p.length:-1;if(!(p.length>o))for(d==t.line&&(h=t.ch-(n<0?1:0));h!=m;h+=n){var g=p.charAt(h);if(u.test(g)&&(void 0===r||e.getTokenTypeAt(a(d,h+1))==r)){var v=s[g];if(">"==v.charAt(1)==n>0)c.push(g);else{if(!c.length)return{pos:a(d,h),ch:g};c.pop()}}}}}return d-n!=(n>0?e.lastLine():e.firstLine())&&null}function r(e,n,r){for(var i=e.state.matchBrackets.maxHighlightLineLength||1e3,s=[],l=e.listSelections(),c=0;c",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<"},l=null;e.defineOption("matchBrackets",!1,function(t,n,r){r&&r!=e.Init&&(t.off("cursorActivity",i),l&&(l(),l=null)),n&&(t.state.matchBrackets="object"==typeof n?n:{},t.on("cursorActivity",i))}),e.defineExtension("matchBrackets",function(){r(this,!0)}),e.defineExtension("findMatchingBracket",function(e,n,r){return t(this,e,n,r)}),e.defineExtension("scanForBracket",function(e,t,r,i){return n(this,e,t,r,i)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(e,t){return"pairs"==t&&"string"==typeof e?e:"object"==typeof e&&null!=e[t]?e[t]:f[t]}function n(e){return function(t){return s(t,e)}}function r(e){var t=e.state.closeBrackets;if(!t)return null;var n=e.getModeAt(e.getCursor());return n.closeBrackets||t}function i(n){var i=r(n);if(!i||n.getOption("disableInput"))return e.Pass;for(var o=t(i,"pairs"),a=n.listSelections(),s=0;s=0;s--){var u=a[s].head;n.replaceRange("",d(u.line,u.ch-1),d(u.line,u.ch+1),"+delete")}}function o(n){var i=r(n),o=i&&t(i,"explode");if(!o||n.getOption("disableInput"))return e.Pass;for(var a=n.listSelections(),s=0;s0;return{anchor:new d(t.anchor.line,t.anchor.ch+(n?-1:1)),head:new d(t.head.line,t.head.ch+(n?1:-1))}}function s(n,i){var o=r(n);if(!o||n.getOption("disableInput"))return e.Pass;var s=t(o,"pairs"),c=s.indexOf(i);if(c==-1)return e.Pass;for(var f,p=t(o,"triples"),h=s.charAt(c+1)==i,m=n.listSelections(),g=c%2==0,v=0;v1&&p.indexOf(i)>=0&&n.getRange(d(k.line,k.ch-2),k)==i+i&&(k.ch<=2||n.getRange(d(k.line,k.ch-3),d(k.line,k.ch-2))!=i))y="addFour";else if(h){if(e.isWordChar(x)||!u(n,k,i))return e.Pass;y="both"}else{if(!g||n.getLine(k.line).length!=k.ch&&!l(x,s)&&!/\s/.test(x))return e.Pass;y="both"}else y=p.indexOf(i)>=0&&n.getRange(k,d(k.line,k.ch+3))==i+i+i?"skipThree":"skip";if(f){if(f!=y)return e.Pass}else f=y}var w=c%2?s.charAt(c-1):i,_=c%2?i:s.charAt(c+1);n.operation(function(){if("skip"==f)n.execCommand("goCharRight");else if("skipThree"==f)for(var e=0;e<3;e++)n.execCommand("goCharRight");else if("surround"==f){for(var t=n.getSelections(),e=0;e-1&&n%2==1}function c(e,t){var n=e.getRange(d(t.line,t.ch-1),d(t.line,t.ch+1));return 2==n.length?n:null}function u(t,n,r){var i=t.getLine(n.line),o=t.getTokenAt(n);if(/\bstring2?\b/.test(o.type))return!1;var a=new e.StringStream(i.slice(0,n.ch)+r+i.slice(n.ch),4);for(a.pos=a.start=o.start;;){var s=t.getMode().token(a,o.state);if(a.pos>=n.ch+1)return/\bstring2?\b/.test(s);a.start=a.pos}}var f={pairs:"()[]{}''\"\"",triples:"",explode:"[]{}"},d=e.Pos;e.defineOption("autoCloseBrackets",!1,function(t,n,r){r&&r!=e.Init&&(t.removeKeyMap(h),t.state.closeBrackets=null),n&&(t.state.closeBrackets=n,t.addKeyMap(h))});for(var p=f.pairs+"`",h={Backspace:i,Enter:o},m=0;mc.ch&&(v=v.slice(0,v.length-u.end+c.ch));var y=v.toLowerCase();if(!v||"string"==u.type&&(u.end!=c.ch||!/[\"\']/.test(u.string.charAt(u.string.length-1))||1==u.string.length)||"tag"==u.type&&"closeTag"==d.type||u.string.indexOf("/")==u.string.length-1||m&&i(m,y)>-1||o(t,v,c,d,!0))return e.Pass;var b=g&&i(g,y)>-1;r[l]={indent:b,text:">"+(b?"\n\n":"")+"",newPos:b?e.Pos(c.line+1,0):e.Pos(c.line,c.ch+1)}}for(var l=n.length-1;l>=0;l--){var k=r[l];t.replaceRange(k.text,n[l].head,n[l].anchor,"+insert");var x=t.listSelections().slice(0);x[l]={head:k.newPos,anchor:k.newPos},t.setSelections(x),k.indent&&(t.indentLine(k.newPos.line,null,!0),t.indentLine(k.newPos.line+1,null,!0))}}function n(t,n){for(var r=t.listSelections(),i=[],a=n?"/":""!=t.getLine(l.line).charAt(c.end)&&(d+=">"),i[s]=d}t.replaceSelections(i),r=t.listSelections();for(var s=0;s'"]=function(e){return t(e)}),n.addKeyMap(a)}});var a=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],s=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];e.commands.closeTag=function(e){return n(e)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var t=/^(\s*)(>[> ]*|[*+-]\s|(\d+)([.)]))(\[\s\]\s|\[x\]\s|\s*)/,n=/^(\s*)(>[> ]*|[*+-]\s|(\d+)[.)])(\[\s\]\s*|\[x\]\s|\s*)$/,r=/[*+-]\s/;e.commands.newlineAndIndentContinueMarkdownList=function(i){if(i.getOption("disableInput"))return e.Pass;for(var o=i.listSelections(),a=[],s=0;s")>=0?p[2]:parseInt(p[3],10)+1+p[4];m=m.replace("[x]","[ ]"),a[s]="\n"+h+g+m}}i.replaceSelections(a)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){var t=e.search(i);return t==-1?0:t}function n(e,t,n){return/\bstring\b/.test(e.getTokenTypeAt(o(t.line,0)))&&!/^[\'\"`]/.test(n)}var r={},i=/[^\s\u00a0]/,o=e.Pos;e.commands.toggleComment=function(e){e.toggleComment()},e.defineExtension("toggleComment",function(e){e||(e=r);for(var t=this,n=1/0,i=this.listSelections(),a=null,s=i.length-1;s>=0;s--){var l=i[s].from(),c=i[s].to();l.line>=n||(c.line>=n&&(c=o(n,0)),n=l.line,null==a?t.uncomment(l,c,e)?a="un":(t.lineComment(l,c,e),a="line"):"un"==a?t.uncomment(l,c,e):t.lineComment(l,c,e))}}),e.defineExtension("lineComment",function(e,a,s){s||(s=r);var l=this,c=l.getModeAt(e),u=l.getLine(e.line);if(null!=u&&!n(l,e,u)){var f=s.lineComment||c.lineComment;if(!f)return void((s.blockCommentStart||c.blockCommentStart)&&(s.fullLines=!0,l.blockComment(e,a,s)));var d=Math.min(0!=a.ch||a.line==e.line?a.line+1:a.line,l.lastLine()+1),p=null==s.padding?" ":s.padding,h=s.commentBlankLines||e.line==a.line;l.operation(function(){if(s.indent){for(var n=null,r=e.line;rc.length)&&(n=c)}for(var r=e.line;ru||a.operation(function(){if(0!=n.fullLines){var r=i.test(a.getLine(u));a.replaceRange(f+c,o(u)),a.replaceRange(l+f,o(e.line,0));var d=n.blockCommentLead||s.blockCommentLead;if(null!=d)for(var p=e.line+1;p<=u;++p)(p!=u||r)&&a.replaceRange(d+f,o(p,0))}else a.replaceRange(c,t),a.replaceRange(l,e)})}}),e.defineExtension("uncomment",function(e,t,n){n||(n=r);var a,s=this,l=s.getModeAt(e),c=Math.min(0!=t.ch||t.line==e.line?t.line:t.line-1,s.lastLine()),u=Math.min(e.line,c),f=n.lineComment||l.lineComment,d=[],p=null==n.padding?" ":n.padding;e:if(f){for(var h=u;h<=c;++h){var m=s.getLine(h),g=m.indexOf(f);if(g>-1&&!/comment/.test(s.getTokenTypeAt(o(h,g+1)))&&(g=-1),g==-1&&i.test(m))break e;if(g>-1&&i.test(m.slice(0,g)))break e;d.push(m)}if(s.operation(function(){for(var e=u;e<=c;++e){var t=d[e-u],n=t.indexOf(f),r=n+f.length;n<0||(t.slice(r,r+p.length)==p&&(r+=p.length),a=!0,s.replaceRange("",o(e,n),o(e,r)))}}),a)return!0}var v=n.blockCommentStart||l.blockCommentStart,y=n.blockCommentEnd||l.blockCommentEnd;if(!v||!y)return!1;var b=n.blockCommentLead||l.blockCommentLead,k=s.getLine(u),x=k.indexOf(v);if(x==-1)return!1;var w=c==u?k:s.getLine(c),_=w.indexOf(y,c==u?x+v.length:0);if(_==-1&&u!=c&&(w=s.getLine(--c),_=w.indexOf(y)),_==-1||!/comment/.test(s.getTokenTypeAt(o(u,x+1)))||!/comment/.test(s.getTokenTypeAt(o(c,_+1))))return!1;var C=k.lastIndexOf(v,e.ch),S=C==-1?-1:k.slice(0,e.ch).indexOf(y,C+v.length);if(C!=-1&&S!=-1&&S+y.length!=e.ch)return!1;S=w.indexOf(y,t.ch);var M=w.slice(t.ch).lastIndexOf(v,S-t.ch);return C=S==-1||M==-1?-1:t.ch+M,(S==-1||C==-1||C==t.ch)&&(s.operation(function(){s.replaceRange("",o(c,_-(p&&w.slice(_-p.length,_)==p?p.length:0)),o(c,_+y.length));var e=x+v.length;if(p&&k.slice(e,e+p.length)==p&&(e+=p.length),s.replaceRange("",o(u,x),o(u,e)),b)for(var t=u+1;t<=c;++t){var n=s.getLine(t),r=n.indexOf(b);if(r!=-1&&!i.test(n.slice(0,r))){var a=r+b.length;p&&n.slice(a,a+p.length)==p&&(a+=p.length),s.replaceRange("",o(t,r),o(t,a))}}}),!0)})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){function t(t){if(t.getOption("disableInput"))return e.Pass;for(var r,i=t.listSelections(),o=[],a=0;a=d);else if(0==l.string.indexOf(r.blockCommentStart)){if(u=p.slice(0,l.start),!/^\s*$/.test(u)){u="";for(var h=0;hl.start&&/^\s*$/.test(p.slice(0,f))&&(u=p.slice(0,f));null!=u&&(u+=r.blockCommentContinue)}if(null==u&&r.lineComment&&n(t)){var m=t.getLine(s.line),f=m.indexOf(r.lineComment);f>-1&&(u=m.slice(0,f),/\S/.test(u)?u=null:u+=r.lineComment+m.slice(f+r.lineComment.length).match(/^\s*/)[0])}if(null==u)return e.Pass;o[a]="\n"+u}t.operation(function(){for(var e=i.length-1;e>=0;e--)t.replaceRange(o[e],i[e].from(),i[e].to(),"+insert")})}function n(e){var t=e.getOption("continueComments");return!t||"object"!=typeof t||t.continueLineComment!==!1}for(var r=["clike","css","javascript"],i=0;io;--i){var a=e.getLine(i);if(r&&r.test(a))break;if(!/\S/.test(a)){++i;break}}for(var s=n.paragraphEnd||e.getHelper(t,"paragraphEnd"),l=t.line+1,c=e.lastLine();l<=c;++l){var a=e.getLine(l);if(s&&s.test(a)){++l;break}if(!/\S/.test(a))break}return{from:i,to:l}}function n(e,t,n,r){for(var i=t;i0&&!n.test(e.slice(i-1,i+1));--i);for(var o=!0;;o=!1){var a=i;if(r)for(;" "==e.charAt(a-1);)--a;if(0!=a||!o)return{from:a,to:i};i=t}}function r(t,r,o,a){r=t.clipPos(r),o=t.clipPos(o);var s=a.column||80,l=a.wrapOn||/\s\S|-[^\.\d]/,c=a.killTrailingSpace!==!1,u=[],f="",d=r.line,p=t.getRange(r,o,!1);if(!p.length)return null;for(var h=p[0].match(/^[ \t]*/)[0],m=0;ms&&h==b&&n(f,s,l,c);k&&k.from==v&&k.to==v+y?(f=h+g,++d):u.push({text:[y?" ":""],from:i(d,v),to:i(d+1,b.length)})}for(;f.length>s;){var x=n(f,s,l,c);u.push({text:["",h],from:i(d,x.from),to:i(d,x.to)}),f=h+f.slice(x.to),++d}}return u.length&&t.operation(function(){for(var n=0;n=0;a--){var s,l=n[a];if(l.empty()){var c=t(e,l.head,{});s={from:i(c.from,0),to:i(c.to-1)}}else s={from:l.from(),to:l.to()};s.to.line>=o||(o=s.from.line,r(e,s.from,s.to,{}))}})},e.defineExtension("wrapRange",function(e,t,n){return r(this,e,t,n||{})}),e.defineExtension("wrapParagraphsInRange",function(e,n,o){o=o||{};for(var a=this,s=[],l=e.line;l<=n.line;){var c=t(a,i(l,0),o);s.push(c),l=c.to}var u=!1;return s.length&&a.operation(function(){for(var e=s.length-1;e>=0;--e)u=u||r(a,i(s[e].from,0),i(s[e].to-1),o)}),u})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(t,i,o,a){function s(e){var n=l(t,i);if(!n||n.to.line-n.from.linet.firstLine();)i=e.Pos(i.line-1,0),u=s(!1);if(u&&!u.cleared&&"unfold"!==a){var f=n(t,o);e.on(f,"mousedown",function(t){d.clear(),e.e_preventDefault(t)});var d=t.markText(u.from,u.to,{replacedWith:f,clearOnEnter:r(t,o,"clearOnEnter"),__isFold:!0});d.on("clear",function(n,r){e.signal(t,"unfold",t,n,r)}),e.signal(t,"fold",t,u.from,u.to)}}function n(e,t){var n=r(e,t,"widget");if("string"==typeof n){var i=document.createTextNode(n);n=document.createElement("span"),n.appendChild(i),n.className="CodeMirror-foldmarker"}return n}function r(e,t,n){if(t&&void 0!==t[n])return t[n];var r=e.options.foldOptions;return r&&void 0!==r[n]?r[n]:i[n]}e.newFoldFunction=function(e,n){return function(r,i){t(r,i,{rangeFinder:e,widget:n})}},e.defineExtension("foldCode",function(e,n,r){t(this,e,n,r)}),e.defineExtension("isFolded",function(e){for(var t=this.findMarksAt(e),n=0;nt.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));if(/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"keyword"!=r.type||"import"!=r.string)return null;for(var i=n,o=Math.min(t.lastLine(),n+10);i<=o;++i){var a=t.getLine(i),s=a.indexOf(";");if(s!=-1)return{startCh:r.end,end:e.Pos(i,s)}}}var i,o=n.line,a=r(o);if(!a||r(o-1)||(i=r(o-2))&&i.end.line==o-1)return null;for(var s=a.end;;){var l=r(s.line+1);if(null==l)break;s=l.end}return{from:t.clipPos(e.Pos(o,a.startCh+1)),to:s}}),e.registerHelper("fold","include",function(t,n){function r(n){if(nt.lastLine())return null;var r=t.getTokenAt(e.Pos(n,1));return/\S/.test(r.string)||(r=t.getTokenAt(e.Pos(n,r.end+1))),"meta"==r.type&&"#include"==r.string.slice(0,8)?r.start+8:void 0}var i=n.line,o=r(i);if(null==o||null!=r(i-1))return null;for(var a=i;;){var s=r(a+1);if(null==s)break;++a}return{from:e.Pos(i,o+1),to:t.clipPos(e.Pos(a))}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("./foldcode")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","./foldcode"],e):e(CodeMirror)}(function(e){"use strict";function t(e){this.options=e,this.from=this.to=0}function n(e){return e===!0&&(e={}),null==e.gutter&&(e.gutter="CodeMirror-foldgutter"),null==e.indicatorOpen&&(e.indicatorOpen="CodeMirror-foldgutter-open"),null==e.indicatorFolded&&(e.indicatorFolded="CodeMirror-foldgutter-folded"),e}function r(e,t){for(var n=e.findMarks(f(t,0),f(t+1,0)),r=0;r=s&&(n=i(o.indicatorOpen))}e.setGutterMarker(t,o.gutter,n),++a})}function a(e){var t=e.getViewport(),n=e.state.foldGutter;n&&(e.operation(function(){o(e,t.from,t.to)}),n.from=t.from,n.to=t.to)}function s(e,t,n){var i=e.state.foldGutter;if(i){var o=i.options;if(n==o.gutter){var a=r(e,t);a?a.clear():e.foldCode(f(t,0),o.rangeFinder)}}}function l(e){var t=e.state.foldGutter;if(t){var n=t.options;t.from=t.to=0,clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){a(e)},n.foldOnChangeTimeSpan||600)}}function c(e){var t=e.state.foldGutter;if(t){var n=t.options;clearTimeout(t.changeUpdate),t.changeUpdate=setTimeout(function(){var n=e.getViewport();t.from==t.to||n.from-t.to>20||t.from-n.to>20?a(e):e.operation(function(){n.fromt.to&&(o(e,t.to,n.to),t.to=n.to)})},n.updateViewportTimeSpan||400)}}function u(e,t){var n=e.state.foldGutter;if(n){var r=t.line;r>=n.from&&r=e.max))return e.ch=0,e.text=e.cm.getLine(++e.line),!0}function o(e){if(!(e.line<=e.min))return e.text=e.cm.getLine(--e.line),e.ch=e.text.length,!0}function a(e){for(;;){var t=e.text.indexOf(">",e.ch);if(t==-1){if(i(e))continue;return}{if(r(e,t+1)){var n=e.text.lastIndexOf("/",t),o=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,o?"selfClose":"regular"}e.ch=t+1}}}function s(e){for(;;){var t=e.ch?e.text.lastIndexOf("<",e.ch-1):-1;if(t==-1){if(o(e))continue;return}if(r(e,t+1)){m.lastIndex=t,e.ch=t;var n=m.exec(e.text);if(n&&n.index==t)return n}else e.ch=t}}function l(e){for(;;){m.lastIndex=e.ch;var t=m.exec(e.text);if(!t){if(i(e))continue;return}{if(r(e,t.index+1))return e.ch=t.index+t[0].length,t;e.ch=t.index+1}}}function c(e){for(;;){var t=e.ch?e.text.lastIndexOf(">",e.ch-1):-1;if(t==-1){if(o(e))continue;return}{if(r(e,t+1)){var n=e.text.lastIndexOf("/",t),i=n>-1&&!/\S/.test(e.text.slice(n+1,t));return e.ch=t+1,i?"selfClose":"regular"}e.ch=t}}}function u(e,t){for(var n=[];;){var r,i=l(e),o=e.line,s=e.ch-(i?i[0].length:0);if(!i||!(r=a(e)))return;if("selfClose"!=r)if(i[1]){for(var c=n.length-1;c>=0;--c)if(n[c]==i[2]){n.length=c;break}if(c<0&&(!t||t==i[2]))return{tag:i[2],from:d(o,s),to:d(e.line,e.ch)}}else n.push(i[2])}}function f(e,t){for(var n=[];;){var r=c(e);if(!r)return;if("selfClose"!=r){var i=e.line,o=e.ch,a=s(e);if(!a)return;if(a[1])n.push(a[2]);else{for(var l=n.length-1;l>=0;--l)if(n[l]==a[2]){n.length=l;break}if(l<0&&(!t||t==a[2]))return{tag:a[2],from:d(e.line,e.ch),to:d(i,o)}}}else s(e)}}var d=e.Pos,p="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",h=p+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",m=new RegExp("<(/?)(["+p+"]["+h+"]*)","g");e.registerHelper("fold","xml",function(e,t){for(var r=new n(e,t.line,0);;){var i,o=l(r);if(!o||r.line!=t.line||!(i=a(r)))return;if(!o[1]&&"selfClose"!=i){var s=d(r.line,r.ch),c=u(r,o[2]);return c&&{from:s,to:c.from}}}}),e.findMatchingTag=function(e,r,i){var o=new n(e,r.line,r.ch,i);if(o.text.indexOf(">")!=-1||o.text.indexOf("<")!=-1){var l=a(o),c=l&&d(o.line,o.ch),p=l&&s(o);if(l&&p&&!(t(o,r)>0)){var h={from:d(o.line,o.ch),to:c,tag:p[2]};return"selfClose"==l?{open:h,close:null,at:"open"}:p[1]?{open:f(o,p[2]),close:h,at:"close"}:(o=new n(e,c.line,c.ch,i),{open:h,close:u(o,p[2]),at:"open"})}}},e.findEnclosingTag=function(e,t,r){for(var i=new n(e,t.line,t.ch,r);;){var o=f(i);if(!o)break;var a=new n(e,t.line,t.ch,r),s=u(a,o.tag);if(s)return{open:o,close:s}}},e.scanForClosingTag=function(e,t,r,i){var o=new n(e,t.line,t.ch,i?{from:0,to:i}:null);return u(o,r)}}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";var t={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0, +h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},n={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,caseFold:!1};e.defineMode("xml",function(r,i){function o(e,t){function n(n){return t.tokenize=n,n(e,t)}var r=e.next();if("<"==r)return e.eat("!")?e.eat("[")?e.match("CDATA[")?n(l("atom","]]>")):null:e.match("--")?n(l("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(c(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=l("meta","?>"),"meta"):(M=e.eat("/")?"closeTag":"openTag",t.tokenize=a,"tag bracket");if("&"==r){var i;return i=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),i?"atom":"error"}return e.eatWhile(/[^&<]/),null}function a(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=o,M=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return M="equals",null;if("<"==n){t.tokenize=o,t.state=p,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=s(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function s(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=a;break}return"string"};return t.isInAttribute=!0,t}function l(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=o;break}n.next()}return e}}function c(e){return function(t,n){for(var r;null!=(r=t.next());){if("<"==r)return n.tokenize=c(e+1),n.tokenize(t,n);if(">"==r){if(1==e){n.tokenize=o;break}return n.tokenize=c(e-1),n.tokenize(t,n)}}return"meta"}}function u(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(_.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function f(e){e.context&&(e.context=e.context.prev)}function d(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!_.contextGrabbers.hasOwnProperty(n)||!_.contextGrabbers[n].hasOwnProperty(t))return;f(e)}}function p(e,t,n){return"openTag"==e?(n.tagStart=t.column(),h):"closeTag"==e?m:p}function h(e,t,n){return"word"==e?(n.tagName=t.current(),L="tag",y):(L="error",h)}function m(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&_.implicitlyClosed.hasOwnProperty(n.context.tagName)&&f(n),n.context&&n.context.tagName==r||_.matchClosing===!1?(L="tag",g):(L="tag error",v)}return L="error",v}function g(e,t,n){return"endTag"!=e?(L="error",g):(f(n),p)}function v(e,t,n){return L="error",g(e,t,n)}function y(e,t,n){if("word"==e)return L="attribute",b;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||_.autoSelfClosers.hasOwnProperty(r)?d(n,r):(d(n,r),n.context=new u(n,r,i==n.indented)),p}return L="error",y}function b(e,t,n){return"equals"==e?k:(_.allowMissing||(L="error"),y(e,t,n))}function k(e,t,n){return"string"==e?x:"word"==e&&_.allowUnquoted?(L="string",y):(L="error",y(e,t,n))}function x(e,t,n){return"string"==e?x:y(e,t,n)}var w=r.indentUnit,_={},C=i.htmlMode?t:n;for(var S in C)_[S]=C[S];for(var S in i)_[S]=i[S];var M,L;return o.isInText=!0,{startState:function(e){var t={tokenize:o,state:p,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;M=null;var n=t.tokenize(e,t);return(n||M)&&"comment"!=n&&(L=null,t.state=t.state(M||n,e,t),L&&(n="error"==L?n+" error":L)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+w;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=a&&t.tokenize!=o)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return _.multilineTagIndentPastTag!==!1?t.tagStart+t.tagName.length+2:t.tagStart+w*(_.multilineTagIndentFactor||1);if(_.alignCDATA&&/$/,blockCommentStart:"",configuration:_.htmlMode?"html":"xml",helperType:_.htmlMode?"html":"xml",skipAttribute:function(e){e.state==k&&(e.state=y)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../meta")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../meta"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("markdown",function(t,n){function r(n){if(e.findModeByName){var r=e.findModeByName(n);r&&(n=r.mime||r.mimes[0])}var i=e.getMode(t,n);return"null"==i.name?null:i}function i(e,t,n){return t.f=t.inline=n,n(e,t)}function o(e,t,n){return t.f=t.block=n,n(e,t)}function a(e){return!e||!/\S/.test(e.string)}function s(e){return e.linkTitle=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,e.indentedCode=!1,w&&e.f==c&&(e.f=h,e.block=l),e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.prevLine=e.thisLine,e.thisLine=null,null}function l(t,o){var s=t.sol(),l=o.list!==!1,c=o.indentedCode;o.indentedCode=!1,l&&(o.indentationDiff>=0?(o.indentationDiff<4&&(o.indentation-=o.indentationDiff),o.list=null):o.indentation>0?o.list=null:o.list=!1);var f=null;if(o.indentationDiff>=4)return t.skipToEnd(),c||a(o.prevLine)?(o.indentation-=4,o.indentedCode=!0,_.code):null;if(t.eatSpace())return null;if((f=t.match(A))&&f[1].length<=6)return o.header=f[1].length,n.highlightFormatting&&(o.formatting="header"),o.f=o.inline,d(o);if(!(a(o.prevLine)||o.quote||l||c)&&(f=t.match(E)))return o.header="="==f[0].charAt(0)?1:2,n.highlightFormatting&&(o.formatting="header"),o.f=o.inline,d(o);if(t.eat(">"))return o.quote=s?1:o.quote+1,n.highlightFormatting&&(o.formatting="quote"),t.eatSpace(),d(o);if("["===t.peek())return i(t,o,y);if(t.match(S,!0))return o.hr=!0,_.hr;if((a(o.prevLine)||l)&&(t.match(M,!1)||t.match(L,!1))){var p=null;for(t.match(M,!0)?p="ul":(t.match(L,!0),p="ol"),o.indentation=t.column()+t.current().length,o.list=!0;o.listStack&&t.column()")>-1)&&(n.f=h,n.block=l,n.htmlState=null)}return r}function u(e,t){return t.fencedChars&&e.match(t.fencedChars,!1)?(t.localMode=t.localState=null,t.f=t.block=f,null):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),t.math===-1?_.math:_.code)}function f(e,t){if(e.match(t.fencedChars),t.block=l,t.f=h,t.fencedChars=null,t.math===-1){t.formatting="math",t.math=1;var r=d(t);return t.math=0,r}n.highlightFormatting&&(t.formatting="code-block"),t.code=1;var r=d(t);return t.code=0,r}function d(e){var t=[];if(e.formatting){t.push(_.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var r=0;r=e.quote?t.push(_.formatting+"-"+e.formatting[r]+"-"+e.quote):t.push("error"))}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref?t.push(_.linkHref,"url"):(e.strong&&t.push(_.strong),e.em&&t.push(_.em),e.strikethrough&&t.push(_.strikethrough),e.linkText&&t.push(_.linkText),e.code&&t.push(_.code),e.math&&t.push(_.math),e.image&&t.push(_.image),e.imageAltText&&t.push(_.imageAltText,"link"),e.imageMarker&&t.push(_.imageMarker)),e.header&&t.push(_.header,_.header+"-"+e.header),e.quote&&(t.push(_.quote),!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(_.quote+"-"+e.quote):t.push(_.quote+"-"+n.maxBlockquoteDepth)),e.list!==!1){var i=(e.listStack.length-1)%3;i?1===i?t.push(_.list2):t.push(_.list3):t.push(_.list1)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function p(e,t){if(e.match(z,!0))return d(t)}function h(t,r){var i=r.text(t,r);if("undefined"!=typeof i)return i;if(r.list)return r.list=null,d(r);if(r.taskList){var a="x"!==t.match(T,!0)[1];return a?r.taskOpen=!0:r.taskClosed=!0,n.highlightFormatting&&(r.formatting="task"),r.taskList=!1,d(r)}if(r.taskOpen=!1,r.taskClosed=!1,r.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(r.formatting="header"),d(r);var s=t.sol(),l=t.next();if(r.linkTitle){r.linkTitle=!1;var u=l;"("===l&&(u=")"),u=(u+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var f="^\\s*(?:[^"+u+"\\\\]+|\\\\\\\\|\\\\.)"+u;if(t.match(new RegExp(f),!0))return _.linkHref}if("`"===l){var p=r.formatting;n.highlightFormatting&&(r.formatting="code"),t.eatWhile("`");var h=t.current().length;if(0==r.code)return r.code=h,d(r);if(h==r.code){var v=d(r);return r.code=0,v}return r.formatting=p,d(r)}if(r.code)return d(r);if("$"===l){var p=r.formatting;r.formatting="math",t.eatWhile("$");var h=t.current().length;if(0==r.math)return r.math=h,d(r);if(h==r.math){var v=d(r);return r.math=0,v}return r.formatting=p,d(r)}if(r.math)return d(r);if("\\"===l&&(t.next(),n.highlightFormatting)){var y=d(r),b=_.formatting+"-escape";return y?y+" "+b:b}if("!"===l&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return r.imageMarker=!0,r.image=!0,n.highlightFormatting&&(r.formatting="image"),d(r);if("["===l&&r.imageMarker)return r.imageMarker=!1,r.imageAltText=!0,n.highlightFormatting&&(r.formatting="image"),d(r);if("]"===l&&r.imageAltText){n.highlightFormatting&&(r.formatting="image");var y=d(r);return r.imageAltText=!1,r.image=!1,r.inline=r.f=g,y}if("["===l&&t.match(/[^\]]*\](\(.*\)| ?\[.*?\])/,!1)&&!r.image)return r.linkText=!0,n.highlightFormatting&&(r.formatting="link"),d(r);if("]"===l&&r.linkText&&t.match(/\(.*?\)| ?\[.*?\]/,!1)){n.highlightFormatting&&(r.formatting="link");var y=d(r);return r.linkText=!1,r.inline=r.f=g,y}if("<"===l&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=m,n.highlightFormatting&&(r.formatting="link");var y=d(r);return y?y+=" ":y="",y+_.linkInline}if("<"===l&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=m,n.highlightFormatting&&(r.formatting="link");var y=d(r);return y?y+=" ":y="",y+_.linkEmail}if("<"===l&&t.match(/^(!--|\w)/,!1)){var k=t.string.indexOf(">",t.pos);if(k!=-1){var w=t.string.substring(t.start,k);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(w)&&(r.md_inside=!0)}return t.backUp(1),r.htmlState=e.startState(x),o(t,r,c)}if("<"===l&&t.match(/^\/\w*?>/))return r.md_inside=!1,"tag";var C=!1;if(!n.underscoresBreakWords&&"_"===l&&"_"!==t.peek()&&t.match(/(\w)/,!1)){var S=t.pos-2;if(S>=0){var M=t.string.charAt(S);"_"!==M&&M.match(/(\w)/,!1)&&(C=!0)}}if("*"===l||"_"===l&&!C)if(s&&" "===t.peek());else{if(r.strong===l&&t.eat(l)){n.highlightFormatting&&(r.formatting="strong");var v=d(r);return r.strong=!1,v}if(!r.strong&&t.eat(l))return r.strong=l,n.highlightFormatting&&(r.formatting="strong"),d(r);if(r.em===l){n.highlightFormatting&&(r.formatting="em");var v=d(r);return r.em=!1,v}if(!r.em)return r.em=l,n.highlightFormatting&&(r.formatting="em"),d(r)}else if(" "===l&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return d(r);t.backUp(1)}if(n.strikethrough)if("~"===l&&t.eatWhile(l)){if(r.strikethrough){n.highlightFormatting&&(r.formatting="strikethrough");var v=d(r);return r.strikethrough=!1,v}if(t.match(/^[^\s]/,!1))return r.strikethrough=!0,n.highlightFormatting&&(r.formatting="strikethrough"),d(r)}else if(" "===l&&t.match(/^~~/,!0)){if(" "===t.peek())return d(r);t.backUp(2)}return" "===l&&(t.match(/ +$/,!1)?r.trailingSpace++:r.trailingSpace&&(r.trailingSpaceNewLine=!0)),d(r)}function m(e,t){var r=e.next();if(">"===r){t.f=t.inline=h,n.highlightFormatting&&(t.formatting="link");var i=d(t);return i?i+=" ":i="",i+_.linkInline}return e.match(/^[^>]+/,!0),_.linkInline}function g(e,t){if(e.eatSpace())return null;var r=e.next();return"("===r||"["===r?(t.f=t.inline=v("("===r?")":"]",0),n.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,d(t)):"error"}function v(e){return function(t,r){var i=t.next();if(i===e){r.f=r.inline=h,n.highlightFormatting&&(r.formatting="link-string");var o=d(r);return r.linkHref=!1,o}return t.match(I[e]),r.linkHref=!0,d(r)}}function y(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=b,e.next(),n.highlightFormatting&&(t.formatting="link"),t.linkText=!0,d(t)):i(e,t,h)}function b(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=k,n.highlightFormatting&&(t.formatting="link");var r=d(t);return t.linkText=!1,r}return e.match(/^([^\]\\]|\\.)+/,!0),_.linkText}function k(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=h,_.linkHref+" url")}var x=e.getMode(t,"text/html"),w="null"==x.name;void 0===n.highlightFormatting&&(n.highlightFormatting=!1),void 0===n.maxBlockquoteDepth&&(n.maxBlockquoteDepth=0),void 0===n.underscoresBreakWords&&(n.underscoresBreakWords=!0),void 0===n.taskLists&&(n.taskLists=!1),void 0===n.strikethrough&&(n.strikethrough=!1),void 0===n.tokenTypeOverrides&&(n.tokenTypeOverrides={});var _={header:"header",code:"comment",math:"math",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough"};for(var C in _)_.hasOwnProperty(C)&&n.tokenTypeOverrides[C]&&(_[C]=n.tokenTypeOverrides[C]);var S=/^([*\-_])(?:\s*\1){2,}\s*$/,M=/^[*\-+]\s+/,L=/^[0-9]+([.)])\s+/,T=/^\[(x| )\](?=\s)/,A=n.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,E=/^ *(?:\={1,}|-{1,})\s*$/,z=/^[^#!\[\]*_\\<>\$` "'(~]+/,O=new RegExp("^("+(n.fencedCodeBlocks===!0?"~~~+|```+":n.fencedCodeBlocks)+")[ \\t]*([\\w+#-]*)"),I=(new RegExp("^($$)[ \\t]*([\\w+#-]*)"),{")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\\]]|\\.)*\])*?(?=\])/}),N={startState:function(){return{f:l,prevLine:null,thisLine:null,block:l,htmlState:null,indentation:0,inline:h,text:p,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,math:0,em:!1,strong:!1,header:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,fencedChars:null}},copyState:function(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&e.copyState(x,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkTitle:t.linkTitle,code:t.code,math:t.math,em:t.em,strong:t.strong,strikethrough:t.strikethrough,header:t.header,hr:t.hr,taskList:t.taskList,list:t.list,listStack:t.listStack.slice(0),quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedChars:t.fencedChars}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine){var n=t.header||t.hr;if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0)||n){if(s(t),!n)return null;t.prevLine=null}t.prevLine=t.thisLine,t.thisLine=e,t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.f=t.block;var r=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length;if(t.indentationDiff=Math.min(r-t.indentation,4),t.indentation=t.indentation+t.indentationDiff,r>0)return null}return t.f(e,t)},innerMode:function(e){return e.block==c?{state:e.htmlState,mode:x}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:N}},blankLine:s,getType:d,fold:"markdown"};return N},"xml"),e.defineMIME("text/x-markdown","markdown")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../markdown/markdown"),require("../../addon/mode/overlay")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../markdown/markdown","../../addon/mode/overlay"],e):e(CodeMirror)}(function(e){"use strict";var t=/^((?:(?:aaas?|about|acap|adiumxtra|af[ps]|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|cap|chrome(?:-extension)?|cid|coap|com-eventbrite-attendee|content|crid|cvs|data|dav|dict|dlna-(?:playcontainer|playsingle)|dns|doi|dtn|dvb|ed2k|facetime|feed|file|finger|fish|ftp|geo|gg|git|gizmoproject|go|gopher|gtalk|h323|hcp|https?|iax|icap|icon|im|imap|info|ipn|ipp|irc[6s]?|iris(?:\.beep|\.lwz|\.xpc|\.xpcs)?|itms|jar|javascript|jms|keyparc|lastfm|ldaps?|magnet|mailto|maps|market|message|mid|mms|ms-help|msnim|msrps?|mtqp|mumble|mupdate|mvn|news|nfs|nih?|nntp|notes|oid|opaquelocktoken|palm|paparazzi|platform|pop|pres|proxy|psyc|query|res(?:ource)?|rmi|rsync|rtmp|rtsp|secondlife|service|session|sftp|sgn|shttp|sieve|sips?|skype|sm[bs]|snmp|soap\.beeps?|soldat|spotify|ssh|steam|svn|tag|teamspeak|tel(?:net)?|tftp|things|thismessage|tip|tn3270|tv|udp|unreal|urn|ut2004|vemmi|ventrilo|view-source|webcal|wss?|wtai|wyciwyg|xcon(?:-userid)?|xfire|xmlrpc\.beeps?|xmpp|xri|ymsgr|z39\.50[rs]?):(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i;e.defineMode("gfm",function(n,r){function i(e){return e.code=!1,null}var o=0,a={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(e){return{code:e.code,codeBlock:e.codeBlock,ateSpace:e.ateSpace}},token:function(e,n){if(n.combineTokens=null,n.codeBlock)return e.match(/^```+/)?(n.codeBlock=!1,null):(e.skipToEnd(),null);if(e.sol()&&(n.code=!1),e.sol()&&e.match(/^```+/))return e.skipToEnd(),n.codeBlock=!0,null;if("`"===e.peek()){e.next();var i=e.pos;e.eatWhile("`");var a=1+e.pos-i;return n.code?a===o&&(n.code=!1):(o=a,n.code=!0),null}if(n.code)return e.next(),null;if(e.eatSpace())return n.ateSpace=!0,null;if((e.sol()||n.ateSpace)&&(n.ateSpace=!1,r.gitHubSpice!==!1)){if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/))return n.combineTokens=!0,"link";if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return n.combineTokens=!0,"link"}return e.match(t)&&"]("!=e.string.slice(e.start-2,e.start)&&(0==e.start||/\W/.test(e.string.charAt(e.start-1)))?(n.combineTokens=!0,"link"):(e.next(),null)},blankLine:i},s={underscoresBreakWords:!1,taskLists:!0,fencedCodeBlocks:"```",strikethrough:!0};for(var l in r)s[l]=r[l];return s.name="markdown",e.overlayMode(e.getMode(n,s),a)},"markdown"),e.defineMIME("text/x-gfm","gfm")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n){return/^(?:operator|sof|keyword c|case|new|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}e.defineMode("javascript",function(n,r){function i(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}function o(e,t,n){return _e=e,Ce=n,t}function a(e,n){var r=e.next();if('"'==r||"'"==r)return n.tokenize=s(r),n.tokenize(e,n);if("."==r&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return o("number","number");if("."==r&&e.match(".."))return o("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return o(r);if("="==r&&e.eat(">"))return o("=>","operator");if("0"==r&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),o("number","number");if("0"==r&&e.eat(/o/i))return e.eatWhile(/[0-7]/i),o("number","number");if("0"==r&&e.eat(/b/i))return e.eatWhile(/[01]/i),o("number","number");if(/\d/.test(r))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),o("number","number");if("/"==r)return e.eat("*")?(n.tokenize=l,l(e,n)):e.eat("/")?(e.skipToEnd(),o("comment","comment")):t(e,n,1)?(i(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),o("regexp","string-2")):(e.eatWhile(Oe),o("operator","operator",e.current()));if("`"==r)return n.tokenize=c,c(e,n);if("#"==r)return e.skipToEnd(),o("error","error");if(Oe.test(r))return e.eatWhile(Oe),o("operator","operator",e.current());if(Ee.test(r)){e.eatWhile(Ee);var a=e.current(),u=ze.propertyIsEnumerable(a)&&ze[a];return u&&"."!=n.lastType?o(u.type,u.style,a):o("variable","variable",a)}}function s(e){return function(t,n){var r,i=!1;if(Le&&"@"==t.peek()&&t.match(Ie))return n.tokenize=a,o("jsonld-keyword","meta");for(;null!=(r=t.next())&&(r!=e||i);)i=!i&&"\\"==r;return i||(n.tokenize=a),o("string","string")}}function l(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=a;break}r="*"==n}return o("comment","comment")}function c(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=a;break}r=!r&&"\\"==n}return o("quasi","string-2",e.current())}function u(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(n<0)){for(var r=0,i=!1,o=n-1;o>=0;--o){var a=e.string.charAt(o),s=Ne.indexOf(a);if(s>=0&&s<3){if(!r){++o;break}if(0==--r){"("==a&&(i=!0);break}}else if(s>=3&&s<6)++r;else if(Ee.test(a))i=!0;else{if(/["'\/]/.test(a))return;if(i&&!r){++o;break}}}i&&!r&&(t.fatArrowAt=o)}}function f(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function d(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(var n=r.vars;n;n=n.next)if(n.name==t)return!0}function p(e,t,n,r,i){var o=e.cc;for(Pe.state=e,Pe.stream=i,Pe.marked=null,Pe.cc=o,Pe.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var a=o.length?o.pop():Te?_:w;if(a(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return Pe.marked?Pe.marked:"variable"==n&&d(e,r)?"variable-2":t}}}function h(){for(var e=arguments.length-1;e>=0;e--)Pe.cc.push(arguments[e])}function m(){return h.apply(null,arguments),!0}function g(e){function t(t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}var n=Pe.state;if(Pe.marked="def",n.context){if(t(n.localVars))return;n.localVars={name:e,next:n.localVars}}else{if(t(n.globalVars))return;r.globalVars&&(n.globalVars={name:e,next:n.globalVars})}}function v(){Pe.state.context={prev:Pe.state.context,vars:Pe.state.localVars},Pe.state.localVars=Re}function y(){Pe.state.localVars=Pe.state.context.vars,Pe.state.context=Pe.state.context.prev}function b(e,t){var n=function(){var n=Pe.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new f(r,Pe.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function k(){var e=Pe.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function x(e){function t(n){return n==e?m():";"==e?h():m(t)}return t}function w(e,t){return"var"==e?m(b("vardef",t.length),J,x(";"),k):"keyword a"==e?m(b("form"),S,w,k):"keyword b"==e?m(b("form"),w,k):"{"==e?m(b("}"),U,k):";"==e?m():"if"==e?("else"==Pe.state.lexical.info&&Pe.state.cc[Pe.state.cc.length-1]==k&&Pe.state.cc.pop()(),m(b("form"),S,w,k,ie)):"function"==e?m(ue):"for"==e?m(b("form"),oe,w,k):"variable"==e?m(b("stat"),j):"switch"==e?m(b("form"),S,b("}","switch"),x("{"),U,k,k):"case"==e?m(_,x(":")):"default"==e?m(x(":")):"catch"==e?m(b("form"),v,x("("),fe,x(")"),w,k,y):"class"==e?m(b("form"),de,k):"export"==e?m(b("stat"),ge,k):"import"==e?m(b("stat"),ve,k):"module"==e?m(b("form"),ee,b("}"),x("{"),U,k,k):"type"==e?m(G,x("operator"),G,x(";")):"async"==e?m(w):h(b("stat"),_,x(";"),k)}function _(e){return M(e,!1)}function C(e){return M(e,!0)}function S(e){return"("!=e?h():m(b(")"),_,x(")"),k)}function M(e,t){if(Pe.state.fatArrowAt==Pe.stream.start){var n=t?N:I;if("("==e)return m(v,b(")"),H(ee,")"),k,x("=>"),n,y);if("variable"==e)return h(v,ee,x("=>"),n,y)}var r=t?E:A;return qe.hasOwnProperty(e)?m(r):"function"==e?m(ue,r):"keyword c"==e||"async"==e?m(t?T:L):"("==e?m(b(")"),L,x(")"),k,r):"operator"==e||"spread"==e?m(t?C:_):"["==e?m(b("]"),xe,k,r):"{"==e?$(W,"}",null,r):"quasi"==e?h(z,r):"new"==e?m(q(t)):m()}function L(e){return e.match(/[;\}\)\],]/)?h():h(_)}function T(e){return e.match(/[;\}\)\],]/)?h():h(C)}function A(e,t){return","==e?m(_):E(e,t,!1)}function E(e,t,n){var r=0==n?A:E,i=0==n?_:C;return"=>"==e?m(v,n?N:I,y):"operator"==e?/\+\+|--/.test(t)?m(r):"?"==t?m(_,x(":"),i):m(i):"quasi"==e?h(z,r):";"!=e?"("==e?$(C,")","call",r):"."==e?m(D,r):"["==e?m(b("]"),L,x("]"),k,r):void 0:void 0}function z(e,t){return"quasi"!=e?h():"${"!=t.slice(t.length-2)?m(z):m(_,O)}function O(e){if("}"==e)return Pe.marked="string-2",Pe.state.tokenize=c,m(z)}function I(e){return u(Pe.stream,Pe.state),h("{"==e?w:_)}function N(e){return u(Pe.stream,Pe.state),h("{"==e?w:C)}function q(e){return function(t){return"."==t?m(e?R:P):h(e?C:_)}}function P(e,t){if("target"==t)return Pe.marked="keyword",m(A)}function R(e,t){if("target"==t)return Pe.marked="keyword",m(E)}function j(e){return":"==e?m(k,w):h(A,x(";"),k)}function D(e){if("variable"==e)return Pe.marked="property",m()}function W(e,t){return"async"==e?(Pe.marked="property",m(W)):"variable"==e||"keyword"==Pe.style?(Pe.marked="property",m("get"==t||"set"==t?B:F)):"number"==e||"string"==e?(Pe.marked=Le?"property":Pe.style+" property",m(F)):"jsonld-keyword"==e?m(F):"modifier"==e?m(W):"["==e?m(_,x("]"),F):"spread"==e?m(_):":"==e?h(F):void 0}function B(e){return"variable"!=e?h(F):(Pe.marked="property",m(ue))}function F(e){return":"==e?m(C):"("==e?h(ue):void 0}function H(e,t){function n(r,i){if(","==r){var o=Pe.state.lexical;return"call"==o.info&&(o.pos=(o.pos||0)+1),m(function(n,r){return n==t||r==t?h():h(e)},n)}return r==t||i==t?m():m(x(t))}return function(r,i){return r==t||i==t?m():h(e,n)}}function $(e,t,n){for(var r=3;r"==e)return m(G)}function Z(e){return"variable"==e||"keyword"==Pe.style?(Pe.marked="property",m(Z)):":"==e?m(G):void 0}function Y(e){return"variable"==e?m(Y):":"==e?m(G):void 0}function Q(e,t){return"<"==t?m(H(G,">"),Q):"["==e?m(x("]"),Q):void 0}function J(){return h(ee,K,ne,re)}function ee(e,t){return"modifier"==e?m(ee):"variable"==e?(g(t),m()):"spread"==e?m(ee):"["==e?$(ee,"]"):"{"==e?$(te,"}"):void 0}function te(e,t){return"variable"!=e||Pe.stream.match(/^\s*:/,!1)?("variable"==e&&(Pe.marked="property"),"spread"==e?m(ee):"}"==e?h():m(x(":"),ee,ne)):(g(t),m(ne))}function ne(e,t){if("="==t)return m(C)}function re(e){if(","==e)return m(J)}function ie(e,t){if("keyword b"==e&&"else"==t)return m(b("form","else"),w,k)}function oe(e){if("("==e)return m(b(")"),ae,x(")"),k)}function ae(e){return"var"==e?m(J,x(";"),le):";"==e?m(le):"variable"==e?m(se):h(_,x(";"),le)}function se(e,t){return"in"==t||"of"==t?(Pe.marked="keyword",m(_)):m(A,le)}function le(e,t){return";"==e?m(ce):"in"==t||"of"==t?(Pe.marked="keyword",m(_)):h(_,x(";"),ce)}function ce(e){")"!=e&&m(_)}function ue(e,t){return"*"==t?(Pe.marked="keyword",m(ue)):"variable"==e?(g(t),m(ue)):"("==e?m(v,b(")"),H(fe,")"),k,K,w,y):void 0}function fe(e){return"spread"==e?m(fe):h(ee,K,V)}function de(e,t){if("variable"==e)return g(t),m(pe)}function pe(e,t){return"extends"==t?m(Ae?G:_,pe):"{"==e?m(b("}"),he,k):void 0}function he(e,t){return"variable"==e||"keyword"==Pe.style?("static"==t||"get"==t||"set"==t||Ae&&("public"==t||"private"==t||"protected"==t))&&Pe.stream.match(/^\s+[\w$\xa1-\uffff]/,!1)?(Pe.marked="keyword",m(he)):(Pe.marked="property",m(Ae?me:ue,he)):"*"==t?(Pe.marked="keyword",m(he)):";"==e?m(he):"}"==e?m():void 0}function me(e){return":"==e?m(G):h(ue)}function ge(e,t){return"*"==t?(Pe.marked="keyword",m(ke,x(";"))):"default"==t?(Pe.marked="keyword",m(_,x(";"))):h(w)}function ve(e){return"string"==e?m():h(ye,ke)}function ye(e,t){return"{"==e?$(ye,"}"):("variable"==e&&g(t),"*"==t&&(Pe.marked="keyword"),m(be))}function be(e,t){if("as"==t)return Pe.marked="keyword",m(ye)}function ke(e,t){if("from"==t)return Pe.marked="keyword",m(_)}function xe(e){return"]"==e?m():h(H(C,"]"))}function we(e,t){return"operator"==e.lastType||","==e.lastType||Oe.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}var _e,Ce,Se=n.indentUnit,Me=r.statementIndent,Le=r.jsonld,Te=r.json||Le,Ae=r.typescript,Ee=r.wordCharacters||/[\w$\xa1-\uffff]/,ze=function(){function e(e){return{type:e,style:"keyword"}}var t=e("keyword a"),n=e("keyword b"),r=e("keyword c"),i=e("operator"),o={type:"atom",style:"atom"},a={"if":e("if"),"while":t,"with":t,"else":n,"do":n,"try":n,"finally":n,"return":r,"break":r,"continue":r,"new":e("new"),"delete":r,"throw":r,"debugger":r,"var":e("var"),"const":e("var"),"let":e("var"),"function":e("function"),"catch":e("catch"),"for":e("for"),"switch":e("switch"),"case":e("case"),"default":e("default"),"in":i,"typeof":i,"instanceof":i,"true":o,"false":o,"null":o,undefined:o,NaN:o,Infinity:o,"this":e("this"),"class":e("class"),"super":e("atom"),"yield":r,"export":e("export"),"import":e("import"),"extends":r,await:r,async:e("async")};if(Ae){var s={type:"variable",style:"variable-3"},l={"interface":e("class"),"implements":r,namespace:r,module:e("module"),"enum":e("module"),type:e("type"),"public":e("modifier"),"private":e("modifier"),"protected":e("modifier"),"abstract":e("modifier"),as:i,string:s,number:s,"boolean":s,any:s};for(var c in l)a[c]=l[c]}return a}(),Oe=/[+\-*&%=<>!?|~^]/,Ie=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Ne="([{}])",qe={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},Pe={state:null,column:null,marked:null,cc:null},Re={name:"this",next:{name:"arguments"}};return k.lex=!0,{startState:function(e){var t={tokenize:a,lastType:"sof",cc:[],lexical:new f((e||0)-Se,0,"block",(!1)),localVars:r.localVars,context:r.localVars&&{vars:r.localVars},indented:e||0};return r.globalVars&&"object"==typeof r.globalVars&&(t.globalVars=r.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),u(e,t)),t.tokenize!=l&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==_e?n:(t.lastType="operator"!=_e||"++"!=Ce&&"--"!=Ce?_e:"incdec",p(t,n,_e,Ce,e))},indent:function(t,n){if(t.tokenize==l)return e.Pass;if(t.tokenize!=a)return 0;var i,o=n&&n.charAt(0),s=t.lexical;if(!/^\s*else\b/.test(n))for(var c=t.cc.length-1;c>=0;--c){var u=t.cc[c];if(u==k)s=s.prev;else if(u!=ie)break}for(;("stat"==s.type||"form"==s.type)&&("}"==o||(i=t.cc[t.cc.length-1])&&(i==A||i==E)&&!/^[,\.=+\-*:?[\(]/.test(n));)s=s.prev; +Me&&")"==s.type&&"stat"==s.prev.type&&(s=s.prev);var f=s.type,d=o==f;return"vardef"==f?s.indented+("operator"==t.lastType||","==t.lastType?s.info+1:0):"form"==f&&"{"==o?s.indented:"form"==f?s.indented+Se:"stat"==f?s.indented+(we(t,n)?Me||Se:0):"switch"!=s.info||d||0==r.doubleIndentSwitch?s.align?s.column+(d?0:1):s.indented+(d?0:Se):s.indented+(/^(?:case|default)\b/.test(n)?Se:2*Se)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Te?null:"/*",blockCommentEnd:Te?null:"*/",lineComment:Te?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:Te?"json":"javascript",jsonldMode:Le,jsonMode:Te,expressionAllowed:t,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=_&&t!=C||e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},n=0;n*\/]/.test(n)?r(null,"select-op"):"."==n&&e.match(/^-?[_a-z][_a-z0-9-]*/i)?r("qualifier","qualifier"):/[:;{}\[\]\(\)]/.test(n)?r(null,n):"u"==n&&e.match(/rl(-prefix)?\(/)||"d"==n&&e.match("omain(")||"r"==n&&e.match("egexp(")?(e.backUp(1),t.tokenize=a,r("property","word")):/[\w\\\-]/.test(n)?(e.eatWhile(/[\w\\\-]/),r("property","word")):r(null,null):/[\d.]/.test(e.peek())?(e.eatWhile(/[\w.%]/),r("number","unit")):e.match(/^-[\w\\\-]+/)?(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?r("variable-2","variable-definition"):r("variable-2","variable")):e.match(/^\w+-/)?r("meta","meta"):void 0}function o(e){return function(t,n){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){")"==e&&t.backUp(1);break}o=!o&&"\\"==i}return(i==e||!o&&")"!=e)&&(n.tokenize=null),r("string","string")}}function a(e,t){return e.next(),e.match(/\s*[\"\')]/,!1)?t.tokenize=null:t.tokenize=o(")"),r(null,"(")}function s(e,t,n){this.type=e,this.indent=t,this.prev=n}function l(e,t,n,r){return e.context=new s(n,t.indentation()+(r===!1?0:g),e.context),n}function c(e){return e.context.prev&&(e.context=e.context.prev),e.context.type}function u(e,t,n){return E[n.context.type](e,t,n)}function f(e,t,n,r){for(var i=r||1;i>0;i--)n.context=n.context.prev;return u(e,t,n)}function d(e){var t=e.current().toLowerCase();m=L.hasOwnProperty(t)?"atom":M.hasOwnProperty(t)?"keyword":"variable"}var p=n.inline;n.propertyKeywords||(n=e.resolveMode("text/css"));var h,m,g=t.indentUnit,v=n.tokenHooks,y=n.documentTypes||{},b=n.mediaTypes||{},k=n.mediaFeatures||{},x=n.mediaValueKeywords||{},w=n.propertyKeywords||{},_=n.nonStandardPropertyKeywords||{},C=n.fontProperties||{},S=n.counterDescriptors||{},M=n.colorKeywords||{},L=n.valueKeywords||{},T=n.allowNested,A=n.supportsAtComponent===!0,E={};return E.top=function(e,t,n){if("{"==e)return l(n,t,"block");if("}"==e&&n.context.prev)return c(n);if(A&&/@component/.test(e))return l(n,t,"atComponentBlock");if(/^@(-moz-)?document$/.test(e))return l(n,t,"documentTypes");if(/^@(media|supports|(-moz-)?document|import)$/.test(e))return l(n,t,"atBlock");if(/^@(font-face|counter-style)/.test(e))return n.stateArg=e,"restricted_atBlock_before";if(/^@(-(moz|ms|o|webkit)-)?keyframes$/.test(e))return"keyframes";if(e&&"@"==e.charAt(0))return l(n,t,"at");if("hash"==e)m="builtin";else if("word"==e)m="tag";else{if("variable-definition"==e)return"maybeprop";if("interpolation"==e)return l(n,t,"interpolation");if(":"==e)return"pseudo";if(T&&"("==e)return l(n,t,"parens")}return n.context.type},E.block=function(e,t,n){if("word"==e){var r=t.current().toLowerCase();return w.hasOwnProperty(r)?(m="property","maybeprop"):_.hasOwnProperty(r)?(m="string-2","maybeprop"):T?(m=t.match(/^\s*:(?:\s|$)/,!1)?"property":"tag","block"):(m+=" error","maybeprop")}return"meta"==e?"block":T||"hash"!=e&&"qualifier"!=e?E.top(e,t,n):(m="error","block")},E.maybeprop=function(e,t,n){return":"==e?l(n,t,"prop"):u(e,t,n)},E.prop=function(e,t,n){if(";"==e)return c(n);if("{"==e&&T)return l(n,t,"propBlock");if("}"==e||"{"==e)return f(e,t,n);if("("==e)return l(n,t,"parens");if("hash"!=e||/^#([0-9a-fA-f]{3,4}|[0-9a-fA-f]{6}|[0-9a-fA-f]{8})$/.test(t.current())){if("word"==e)d(t);else if("interpolation"==e)return l(n,t,"interpolation")}else m+=" error";return"prop"},E.propBlock=function(e,t,n){return"}"==e?c(n):"word"==e?(m="property","maybeprop"):n.context.type},E.parens=function(e,t,n){return"{"==e||"}"==e?f(e,t,n):")"==e?c(n):"("==e?l(n,t,"parens"):"interpolation"==e?l(n,t,"interpolation"):("word"==e&&d(t),"parens")},E.pseudo=function(e,t,n){return"word"==e?(m="variable-3",n.context.type):u(e,t,n)},E.documentTypes=function(e,t,n){return"word"==e&&y.hasOwnProperty(t.current())?(m="tag",n.context.type):E.atBlock(e,t,n)},E.atBlock=function(e,t,n){if("("==e)return l(n,t,"atBlock_parens");if("}"==e||";"==e)return f(e,t,n);if("{"==e)return c(n)&&l(n,t,T?"block":"top");if("interpolation"==e)return l(n,t,"interpolation");if("word"==e){var r=t.current().toLowerCase();m="only"==r||"not"==r||"and"==r||"or"==r?"keyword":b.hasOwnProperty(r)?"attribute":k.hasOwnProperty(r)?"property":x.hasOwnProperty(r)?"keyword":w.hasOwnProperty(r)?"property":_.hasOwnProperty(r)?"string-2":L.hasOwnProperty(r)?"atom":M.hasOwnProperty(r)?"keyword":"error"}return n.context.type},E.atComponentBlock=function(e,t,n){return"}"==e?f(e,t,n):"{"==e?c(n)&&l(n,t,T?"block":"top",!1):("word"==e&&(m="error"),n.context.type)},E.atBlock_parens=function(e,t,n){return")"==e?c(n):"{"==e||"}"==e?f(e,t,n,2):E.atBlock(e,t,n)},E.restricted_atBlock_before=function(e,t,n){return"{"==e?l(n,t,"restricted_atBlock"):"word"==e&&"@counter-style"==n.stateArg?(m="variable","restricted_atBlock_before"):u(e,t,n)},E.restricted_atBlock=function(e,t,n){return"}"==e?(n.stateArg=null,c(n)):"word"==e?(m="@font-face"==n.stateArg&&!C.hasOwnProperty(t.current().toLowerCase())||"@counter-style"==n.stateArg&&!S.hasOwnProperty(t.current().toLowerCase())?"error":"property","maybeprop"):"restricted_atBlock"},E.keyframes=function(e,t,n){return"word"==e?(m="variable","keyframes"):"{"==e?l(n,t,"top"):u(e,t,n)},E.at=function(e,t,n){return";"==e?c(n):"{"==e||"}"==e?f(e,t,n):("word"==e?m="tag":"hash"==e&&(m="builtin"),"at")},E.interpolation=function(e,t,n){return"}"==e?c(n):"{"==e||";"==e?f(e,t,n):("word"==e?m="variable":"variable"!=e&&"("!=e&&")"!=e&&(m="error"),"interpolation")},{startState:function(e){return{tokenize:null,state:p?"block":"top",stateArg:null,context:new s(p?"block":"top",e||0,null)}},token:function(e,t){if(!t.tokenize&&e.eatSpace())return null;var n=(t.tokenize||i)(e,t);return n&&"object"==typeof n&&(h=n[1],n=n[0]),m=n,t.state=E[t.state](h,e,t),m},indent:function(e,t){var n=e.context,r=t&&t.charAt(0),i=n.indent;return"prop"!=n.type||"}"!=r&&")"!=r||(n=n.prev),n.prev&&("}"!=r||"block"!=n.type&&"top"!=n.type&&"interpolation"!=n.type&&"restricted_atBlock"!=n.type?(")"!=r||"parens"!=n.type&&"atBlock_parens"!=n.type)&&("{"!=r||"at"!=n.type&&"atBlock"!=n.type)||(i=Math.max(0,n.indent-g),n=n.prev):(n=n.prev,i=n.indent)),i},electricChars:"}",blockCommentStart:"/*",blockCommentEnd:"*/",fold:"brace"}});var r=["domain","regexp","url","url-prefix"],i=t(r),o=["all","aural","braille","handheld","print","projection","screen","tty","tv","embossed"],a=t(o),s=["width","min-width","max-width","height","min-height","max-height","device-width","min-device-width","max-device-width","device-height","min-device-height","max-device-height","aspect-ratio","min-aspect-ratio","max-aspect-ratio","device-aspect-ratio","min-device-aspect-ratio","max-device-aspect-ratio","color","min-color","max-color","color-index","min-color-index","max-color-index","monochrome","min-monochrome","max-monochrome","resolution","min-resolution","max-resolution","scan","grid","orientation","device-pixel-ratio","min-device-pixel-ratio","max-device-pixel-ratio","pointer","any-pointer","hover","any-hover"],l=t(s),c=["landscape","portrait","none","coarse","fine","on-demand","hover","interlace","progressive"],u=t(c),f=["align-content","align-items","align-self","alignment-adjust","alignment-baseline","anchor-point","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","azimuth","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","binding","bleed","bookmark-label","bookmark-level","bookmark-state","bookmark-target","border","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","clear","clip","color","color-profile","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","content","counter-increment","counter-reset","crop","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","drop-initial-after-adjust","drop-initial-after-align","drop-initial-before-adjust","drop-initial-before-align","drop-initial-size","drop-initial-value","elevation","empty-cells","fit","fit-position","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","float-offset","flow-from","flow-into","font","font-feature-settings","font-family","font-kerning","font-language-override","font-size","font-size-adjust","font-stretch","font-style","font-synthesis","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-weight","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-gap","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-gap","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","inline-box-align","justify-content","left","letter-spacing","line-break","line-height","line-stacking","line-stacking-ruby","line-stacking-shift","line-stacking-strategy","list-style","list-style-image","list-style-position","list-style-type","margin","margin-bottom","margin-left","margin-right","margin-top","marker-offset","marks","marquee-direction","marquee-loop","marquee-play-count","marquee-speed","marquee-style","max-height","max-width","min-height","min-width","move-to","nav-down","nav-index","nav-left","nav-right","nav-up","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-style","overflow-wrap","overflow-x","overflow-y","padding","padding-bottom","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","page-policy","pause","pause-after","pause-before","perspective","perspective-origin","pitch","pitch-range","play-during","position","presentation-level","punctuation-trim","quotes","region-break-after","region-break-before","region-break-inside","region-fragment","rendering-intent","resize","rest","rest-after","rest-before","richness","right","rotation","rotation-point","ruby-align","ruby-overhang","ruby-position","ruby-span","shape-image-threshold","shape-inside","shape-margin","shape-outside","size","speak","speak-as","speak-header","speak-numeral","speak-punctuation","speech-rate","stress","string-set","tab-size","table-layout","target","target-name","target-new","target-position","text-align","text-align-last","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-style","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-height","text-indent","text-justify","text-outline","text-overflow","text-shadow","text-size-adjust","text-space-collapse","text-transform","text-underline-position","text-wrap","top","transform","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","unicode-bidi","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","volume","white-space","widows","width","word-break","word-spacing","word-wrap","z-index","clip-path","clip-rule","mask","enable-background","filter","flood-color","flood-opacity","lighting-color","stop-color","stop-opacity","pointer-events","color-interpolation","color-interpolation-filters","color-rendering","fill","fill-opacity","fill-rule","image-rendering","marker","marker-end","marker-mid","marker-start","shape-rendering","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-rendering","baseline-shift","dominant-baseline","glyph-orientation-horizontal","glyph-orientation-vertical","text-anchor","writing-mode"],d=t(f),p=["scrollbar-arrow-color","scrollbar-base-color","scrollbar-dark-shadow-color","scrollbar-face-color","scrollbar-highlight-color","scrollbar-shadow-color","scrollbar-3d-light-color","scrollbar-track-color","shape-inside","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","zoom"],h=t(p),m=["font-family","src","unicode-range","font-variant","font-feature-settings","font-stretch","font-weight","font-style"],g=t(m),v=["additive-symbols","fallback","negative","pad","prefix","range","speak-as","suffix","symbols","system"],y=t(v),b=["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"],k=t(b),x=["above","absolute","activeborder","additive","activecaption","afar","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","amharic","amharic-abegede","antialiased","appworkspace","arabic-indic","armenian","asterisks","attr","auto","avoid","avoid-column","avoid-page","avoid-region","background","backwards","baseline","below","bidi-override","binary","bengali","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","cambodian","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","cjk-earthly-branch","cjk-heavenly-stem","cjk-ideographic","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","devanagari","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic","ethiopic-abegede","ethiopic-abegede-am-et","ethiopic-abegede-gez","ethiopic-abegede-ti-er","ethiopic-abegede-ti-et","ethiopic-halehame-aa-er","ethiopic-halehame-aa-et","ethiopic-halehame-am-et","ethiopic-halehame-gez","ethiopic-halehame-om-et","ethiopic-halehame-sid-et","ethiopic-halehame-so-et","ethiopic-halehame-ti-er","ethiopic-halehame-ti-et","ethiopic-halehame-tig","ethiopic-numeric","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","georgian","graytext","grid","groove","gujarati","gurmukhi","hand","hangul","hangul-consonant","hard-light","hebrew","help","hidden","hide","higher","highlight","highlighttext","hiragana","hiragana-iroha","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","japanese-formal","japanese-informal","justify","kannada","katakana","katakana-iroha","keep-all","khmer","korean-hangul-formal","korean-hanja-formal","korean-hanja-informal","landscape","lao","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-alpha","lower-armenian","lower-greek","lower-hexadecimal","lower-latin","lower-norwegian","lower-roman","lowercase","ltr","luminosity","malayalam","match","matrix","matrix3d","media-controls-background","media-current-time-display","media-fullscreen-button","media-mute-button","media-play-button","media-return-to-realtime-button","media-rewind-button","media-seek-back-button","media-seek-forward-button","media-slider","media-sliderthumb","media-time-remaining-display","media-volume-slider","media-volume-slider-container","media-volume-sliderthumb","medium","menu","menulist","menulist-button","menulist-text","menulist-textfield","menutext","message-box","middle","min-intrinsic","mix","mongolian","monospace","move","multiple","multiply","myanmar","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","octal","open-quote","optimizeLegibility","optimizeSpeed","oriya","oromo","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","persian","perspective","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","se-resize","searchfield","searchfield-cancel-button","searchfield-decoration","searchfield-results-button","searchfield-results-decoration","semi-condensed","semi-expanded","separate","serif","show","sidama","simp-chinese-formal","simp-chinese-informal","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","somali","source-atop","source-in","source-out","source-over","space","space-around","space-between","spell-out","square","square-button","start","static","status-bar","stretch","stroke","sub","subpixel-antialiased","super","sw-resize","symbolic","symbols","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","tamil","telugu","text","text-bottom","text-top","textarea","textfield","thai","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","tibetan","tigre","tigrinya-er","tigrinya-er-abegede","tigrinya-et","tigrinya-et-abegede","to","top","trad-chinese-formal","trad-chinese-informal","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","up","upper-alpha","upper-armenian","upper-greek","upper-hexadecimal","upper-latin","upper-norwegian","upper-roman","uppercase","urdu","url","var","vertical","vertical-text","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"],w=t(x),_=r.concat(o).concat(s).concat(c).concat(f).concat(p).concat(b).concat(x);e.registerHelper("hintWords","css",_),e.defineMIME("text/css",{documentTypes:i,mediaTypes:a,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:d,nonStandardPropertyKeywords:h,fontProperties:g,counterDescriptors:y,colorKeywords:k,valueKeywords:w,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=n,n(e,t))}},name:"css"}),e.defineMIME("text/x-scss",{mediaTypes:a,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:d,nonStandardPropertyKeywords:h,colorKeywords:k,valueKeywords:w,fontProperties:g,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=n,n(e,t)):["operator","operator"]},":":function(e){return!!e.match(/\s*\{/)&&[null,"{"]},$:function(e){return e.match(/^[\w-]+/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"]},"#":function(e){return!!e.eat("{")&&[null,"interpolation"]}},name:"css",helperType:"scss"}),e.defineMIME("text/x-less",{mediaTypes:a,mediaFeatures:l,mediaValueKeywords:u,propertyKeywords:d,nonStandardPropertyKeywords:h,colorKeywords:k,valueKeywords:w,fontProperties:g,allowNested:!0,tokenHooks:{"/":function(e,t){return e.eat("/")?(e.skipToEnd(),["comment","comment"]):e.eat("*")?(t.tokenize=n,n(e,t)):["operator","operator"]},"@":function(e){return e.eat("{")?[null,"interpolation"]:!e.match(/^(charset|document|font-face|import|(-(moz|ms|o|webkit)-)?keyframes|media|namespace|page|supports)\b/,!1)&&(e.eatWhile(/[\w\\\-]/),e.match(/^\s*:/,!1)?["variable-2","variable-definition"]:["variable-2","variable"])},"&":function(){return["atom","atom"]}},name:"css",helperType:"less"}),e.defineMIME("text/x-gss",{documentTypes:i,mediaTypes:a,mediaFeatures:l,propertyKeywords:d,nonStandardPropertyKeywords:h,fontProperties:g,counterDescriptors:y,colorKeywords:k,valueKeywords:w,supportsAtComponent:!0,tokenHooks:{"/":function(e,t){return!!e.eat("*")&&(t.tokenize=n,n(e,t))}},name:"css",helperType:"gss"})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../xml/xml"),require("../javascript/javascript"),require("../css/css")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../xml/xml","../javascript/javascript","../css/css"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n){var r=e.current(),i=r.search(t);return i>-1?e.backUp(r.length-i):r.match(/<\/?$/)&&(e.backUp(r.length),e.match(t,!1)||e.match(r)),n}function n(e){var t=l[e];return t?t:l[e]=new RegExp("\\s+"+e+"\\s*=\\s*('|\")?([^'\"]+)('|\")?\\s*")}function r(e,t){var r=e.match(n(t));return r?/^\s*(.*?)\s*$/.exec(r[2])[1]:""}function i(e,t){return new RegExp((t?"^":"")+"","i")}function o(e,t){for(var n in e)for(var r=t[n]||(t[n]=[]),i=e[n],o=i.length-1;o>=0;o--)r.unshift(i[o])}function a(e,t){for(var n=0;n\s\/]/.test(r.current())&&(s=o.htmlState.tagName&&o.htmlState.tagName.toLowerCase())&&u.hasOwnProperty(s))o.inTag=s+" ";else if(o.inTag&&d&&/>$/.test(r.current())){var p=/^([\S]+) (.*)/.exec(o.inTag);o.inTag=null;var h=">"==r.current()&&a(u[p[1]],p[2]),m=e.getMode(n,h),g=i(p[1],!0),v=i(p[1],!1);o.token=function(e,n){return e.match(g,!1)?(n.token=l,n.localState=n.localMode=null,null):t(e,v,n.localMode.token(e,n.localState))},o.localMode=m,o.localState=e.startState(m,c.indent(o.htmlState,""))}else o.inTag&&(o.inTag+=r.current(),r.eol()&&(o.inTag+=" "));return f}var c=e.getMode(n,{name:"xml",htmlMode:!0,multilineTagIndentFactor:r.multilineTagIndentFactor,multilineTagIndentPastTag:r.multilineTagIndentPastTag}),u={},f=r&&r.tags,d=r&&r.scriptTypes;if(o(s,u),f&&o(f,u),d)for(var p=d.length-1;p>=0;p--)u.script.unshift(["type",d[p].matches,d[p].mode]);return{startState:function(){var t=e.startState(c);return{token:l,inTag:null,localMode:null,localState:null,htmlState:t}},copyState:function(t){var n;return t.localState&&(n=e.copyState(t.localMode,t.localState)),{token:t.token,inTag:t.inTag,localMode:t.localMode,localState:n,htmlState:e.copyState(c,t.htmlState)}},token:function(e,t){return t.token(e,t)},indent:function(t,n){return!t.localMode||/^\s*<\//.test(n)?c.indent(t.htmlState,n):t.localMode.indent?t.localMode.indent(t.localState,n):e.Pass},innerMode:function(e){return{state:e.localState||e.htmlState,mode:e.localMode||c}}}},"xml","javascript","css"),e.defineMIME("text/html","htmlmixed")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../../addon/mode/multiplex")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../../addon/mode/multiplex"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("htmlembedded",function(t,n){return e.multiplexingMode(e.getMode(t,"htmlmixed"),{open:n.open||n.scriptStartRegex||"<%",close:n.close||n.scriptEndRegex||"%>",mode:e.getMode(t,n.scriptingModeSpec)})},"htmlmixed"),e.defineMIME("application/x-ejs",{name:"htmlembedded",scriptingModeSpec:"javascript"}),e.defineMIME("application/x-aspx",{name:"htmlembedded",scriptingModeSpec:"text/x-csharp"}),e.defineMIME("application/x-jsp",{name:"htmlembedded",scriptingModeSpec:"text/x-java"}),e.defineMIME("application/x-erb",{name:"htmlembedded",scriptingModeSpec:"ruby"})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.info=r,this.align=i,this.prev=o}function n(e,n,r,i){var o=e.indented;return e.context&&"statement"!=e.context.type&&"statement"!=r&&(o=e.context.indented),e.context=new t(o,n,r,i,null,e.context)}function r(e){var t=e.context.type;return")"!=t&&"]"!=t&&"}"!=t||(e.indented=e.context.indented),e.context=e.context.prev}function i(e,t,n){return"variable"==t.prevToken||"variable-3"==t.prevToken||(!!/\S(?:[^- ]>|[*\]])\s*$|\*$/.test(e.string.slice(0,n))||(!(!t.typeAtEndOfLine||e.column()!=e.indentation())||void 0))}function o(e){for(;;){if(!e||"top"==e.type)return!0;if("}"==e.type&&"namespace"!=e.prev.info)return!1;e=e.prev}}function a(e){for(var t={},n=e.split(" "),r=0;r!?|\/]/,I=l.endStatement||/^[;:,]$/;return{startState:function(e){return{tokenize:null,context:new t((e||0)-m,0,"top",null,(!1)),indented:0,startOfLine:!0,prevToken:null}},token:function(e,t){var a=t.context;if(e.sol()&&(null==a.align&&(a.align=!1),t.indented=e.indentation(),t.startOfLine=!0),e.eatSpace())return d(e,t),null;p=h=null;var s=(t.tokenize||c)(e,t);if("comment"==s||"meta"==s)return s;if(null==a.align&&(a.align=!0),I.test(p))for(;"statement"==t.context.type;)r(t);else if("{"==p)n(t,e.column(),"}");else if("["==p)n(t,e.column(),"]");else if("("==p)n(t,e.column(),")");else if("}"==p){for(;"statement"==a.type;)a=r(t);for("}"==a.type&&(a=r(t));"statement"==a.type;)a=r(t)}else p==a.type?r(t):M&&(("}"==a.type||"top"==a.type)&&";"!=p||"statement"==a.type&&"newstatement"==p)&&n(t,e.column(),"statement",e.current());if("variable"==s&&("def"==t.prevToken||l.typeFirstDefinitions&&i(e,t,e.start)&&o(t.context)&&e.match(/^\s*\(/,!1))&&(s="def"),C.token){var u=C.token(e,t,s);void 0!==u&&(s=u)}return"def"==s&&l.styleDefs===!1&&(s="variable"),t.startOfLine=!1,t.prevToken=h?"def":s||p,d(e,t),s},indent:function(t,n){if(t.tokenize!=c&&null!=t.tokenize||t.typeAtEndOfLine)return e.Pass;var r=t.context,i=n&&n.charAt(0);if("statement"==r.type&&"}"==i&&(r=r.prev),l.dontIndentStatements)for(;"statement"==r.type&&l.dontIndentStatements.test(r.info);)r=r.prev;if(C.indent){var o=C.indent(t,r,n);if("number"==typeof o)return o}var a=i==r.type,s=r.prev&&"switch"==r.prev.info;if(l.allmanIndentation&&/[{(]/.test(i)){for(;"top"!=r.type&&"}"!=r.type;)r=r.prev;return r.indented}return"statement"==r.type?r.indented+("{"==i?0:g):!r.align||v&&")"==r.type?")"!=r.type||a?r.indented+(a?0:m)+(a||!s||/^(?:case|default)\b/.test(n)?0:m):r.indented+g:r.column+(a?0:1)},electricInput:L?/^\s*(?:case .*?:|default:|\{\}?|\})$/:/^\s*[{}]$/,blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",fold:"brace"}});var b="auto if break case register continue return default do sizeof static else struct switch extern typedef union for goto while enum const volatile",k="int long char short double float unsigned signed void size_t ptrdiff_t";m(["text/x-csrc","text/x-c","text/x-chdr"],{name:"clike",keywords:a(b),types:a(k+" bool _Complex _Bool float_t double_t intptr_t intmax_t int8_t int16_t int32_t int64_t uintptr_t uintmax_t uint8_t uint16_t uint32_t uint64_t"),blockKeywords:a("case do else for if switch while struct"),defKeywords:a("struct"),typeFirstDefinitions:!0,atoms:a("null true false"),hooks:{"#":l,"*":c},modeProps:{fold:["brace","include"]}}),m(["text/x-c++src","text/x-c++hdr"],{name:"clike",keywords:a(b+" asm dynamic_cast namespace reinterpret_cast try explicit new static_cast typeid catch operator template typename class friend private this using const_cast inline public throw virtual delete mutable protected alignas alignof constexpr decltype nullptr noexcept thread_local final static_assert override"),types:a(k+" bool wchar_t"),blockKeywords:a("catch class do else finally for if struct switch try while"),defKeywords:a("class namespace struct enum union"),typeFirstDefinitions:!0,atoms:a("true false null"),dontIndentStatements:/^template$/,hooks:{"#":l,"*":c,u:f,U:f,L:f,R:f,0:u,1:u,2:u,3:u,4:u,5:u,6:u,7:u,8:u,9:u,token:function(e,t,n){if("variable"==n&&"("==e.peek()&&(";"==t.prevToken||null==t.prevToken||"}"==t.prevToken)&&d(e.current()))return"def"}},namespaceSeparator:"::",modeProps:{fold:["brace","include"]}}),m("text/x-java",{name:"clike",keywords:a("abstract assert break case catch class const continue default do else enum extends final finally float for goto if implements import instanceof interface native new package private protected public return static strictfp super switch synchronized this throw throws transient try volatile while"),types:a("byte short int long float double boolean char void Boolean Byte Character Double Float Integer Long Number Object Short String StringBuffer StringBuilder Void"),blockKeywords:a("catch class do else finally for if switch try while"),defKeywords:a("class interface package enum"),typeFirstDefinitions:!0,atoms:a("true false null"),endStatement:/^[;:]$/,number:/^(?:0x[a-f\d_]+|0b[01_]+|(?:[\d_]+\.?\d*|\.\d+)(?:e[-+]?[\d_]+)?)(u|ll?|l|f)?/i,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"}},modeProps:{fold:["brace","import"]}}),m("text/x-csharp",{name:"clike",keywords:a("abstract as async await base break case catch checked class const continue default delegate do else enum event explicit extern finally fixed for foreach goto if implicit in interface internal is lock namespace new operator out override params private protected public readonly ref return sealed sizeof stackalloc static struct switch this throw try typeof unchecked unsafe using virtual void volatile while add alias ascending descending dynamic from get global group into join let orderby partial remove select set value var yield"),types:a("Action Boolean Byte Char DateTime DateTimeOffset Decimal Double Func Guid Int16 Int32 Int64 Object SByte Single String Task TimeSpan UInt16 UInt32 UInt64 bool byte char decimal double short int long object sbyte float string ushort uint ulong"),blockKeywords:a("catch class do else finally for foreach if struct switch try while"),defKeywords:a("class interface namespace struct var"),typeFirstDefinitions:!0,atoms:a("true false null"),hooks:{"@":function(e,t){return e.eat('"')?(t.tokenize=p,p(e,t)):(e.eatWhile(/[\w\$_]/),"meta")}}}),m("text/x-scala",{name:"clike",keywords:a("abstract case catch class def do else extends final finally for forSome if implicit import lazy match new null object override package private protected return sealed super this throw trait try type val var while with yield _ : = => <- <: <% >: # @ assert assume require print println printf readLine readBoolean readByte readShort readChar readInt readLong readFloat readDouble :: #:: "),types:a("AnyVal App Application Array BufferedIterator BigDecimal BigInt Char Console Either Enumeration Equiv Error Exception Fractional Function IndexedSeq Int Integral Iterable Iterator List Map Numeric Nil NotNull Option Ordered Ordering PartialFunction PartialOrdering Product Proxy Range Responder Seq Serializable Set Specializable Stream StringBuilder StringContext Symbol Throwable Traversable TraversableOnce Tuple Unit Vector Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),multiLineStrings:!0,blockKeywords:a("catch class do else finally for forSome if match switch try while"),defKeywords:a("class def object package trait type val var"),atoms:a("true false null"),indentStatements:!1,indentSwitch:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return!!e.match('""')&&(t.tokenize=g,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},"=":function(e,n){var r=n.context;return!("}"!=r.type||!r.align||!e.eat(">"))&&(n.context=new t(r.indented,r.column,r.type,r.info,null,r.prev),"operator")}},modeProps:{closeBrackets:{triples:'"'}}}),m("text/x-kotlin",{name:"clike",keywords:a("package as typealias class interface this super val var fun for is in This throw return break continue object if else while do try when !in !is as? file import where by get set abstract enum open inner override private public internal protected catch finally out final vararg reified dynamic companion constructor init sealed field property receiver param sparam lateinit data inline noinline tailrec external annotation crossinline const operator infix"),types:a("Boolean Byte Character CharSequence Class ClassLoader Cloneable Comparable Compiler Double Exception Float Integer Long Math Number Object Package Pair Process Runtime Runnable SecurityManager Short StackTraceElement StrictMath String StringBuffer System Thread ThreadGroup ThreadLocal Throwable Triple Void"),intendSwitch:!1,indentStatements:!1,multiLineStrings:!0,blockKeywords:a("catch class do else finally for if where try while enum"),defKeywords:a("class val var object package interface fun"),atoms:a("true false null this"),hooks:{'"':function(e,t){return t.tokenize=v(e.match('""')),t.tokenize(e,t)}},modeProps:{closeBrackets:{triples:'"'}}}),m(["x-shader/x-vertex","x-shader/x-fragment"],{name:"clike",keywords:a("sampler1D sampler2D sampler3D samplerCube sampler1DShadow sampler2DShadow const attribute uniform varying break continue discard return for while do if else struct in out inout"),types:a("float int bool void vec2 vec3 vec4 ivec2 ivec3 ivec4 bvec2 bvec3 bvec4 mat2 mat3 mat4"),blockKeywords:a("for while do if else struct"),builtin:a("radians degrees sin cos tan asin acos atan pow exp log exp2 sqrt inversesqrt abs sign floor ceil fract mod min max clamp mix step smoothstep length distance dot cross normalize ftransform faceforward reflect refract matrixCompMult lessThan lessThanEqual greaterThan greaterThanEqual equal notEqual any all not texture1D texture1DProj texture1DLod texture1DProjLod texture2D texture2DProj texture2DLod texture2DProjLod texture3D texture3DProj texture3DLod texture3DProjLod textureCube textureCubeLod shadow1D shadow2D shadow1DProj shadow2DProj shadow1DLod shadow2DLod shadow1DProjLod shadow2DProjLod dFdx dFdy fwidth noise1 noise2 noise3 noise4"),atoms:a("true false gl_FragColor gl_SecondaryColor gl_Normal gl_Vertex gl_MultiTexCoord0 gl_MultiTexCoord1 gl_MultiTexCoord2 gl_MultiTexCoord3 gl_MultiTexCoord4 gl_MultiTexCoord5 gl_MultiTexCoord6 gl_MultiTexCoord7 gl_FogCoord gl_PointCoord gl_Position gl_PointSize gl_ClipVertex gl_FrontColor gl_BackColor gl_FrontSecondaryColor gl_BackSecondaryColor gl_TexCoord gl_FogFragCoord gl_FragCoord gl_FrontFacing gl_FragData gl_FragDepth gl_ModelViewMatrix gl_ProjectionMatrix gl_ModelViewProjectionMatrix gl_TextureMatrix gl_NormalMatrix gl_ModelViewMatrixInverse gl_ProjectionMatrixInverse gl_ModelViewProjectionMatrixInverse gl_TexureMatrixTranspose gl_ModelViewMatrixInverseTranspose gl_ProjectionMatrixInverseTranspose gl_ModelViewProjectionMatrixInverseTranspose gl_TextureMatrixInverseTranspose gl_NormalScale gl_DepthRange gl_ClipPlane gl_Point gl_FrontMaterial gl_BackMaterial gl_LightSource gl_LightModel gl_FrontLightModelProduct gl_BackLightModelProduct gl_TextureColor gl_EyePlaneS gl_EyePlaneT gl_EyePlaneR gl_EyePlaneQ gl_FogParameters gl_MaxLights gl_MaxClipPlanes gl_MaxTextureUnits gl_MaxTextureCoords gl_MaxVertexAttribs gl_MaxVertexUniformComponents gl_MaxVaryingFloats gl_MaxVertexTextureImageUnits gl_MaxTextureImageUnits gl_MaxFragmentUniformComponents gl_MaxCombineTextureImageUnits gl_MaxDrawBuffers"),indentSwitch:!1,hooks:{"#":l},modeProps:{fold:["brace","include"]}}),m("text/x-nesc",{name:"clike",keywords:a(b+"as atomic async call command component components configuration event generic implementation includes interface module new norace nx_struct nx_union post provides signal task uses abstract extends"),types:a(k),blockKeywords:a("case do else for if switch while struct"),atoms:a("null true false"),hooks:{"#":l},modeProps:{fold:["brace","include"]}}),m("text/x-objectivec",{name:"clike",keywords:a(b+"inline restrict _Bool _Complex _Imaginary BOOL Class bycopy byref id IMP in inout nil oneway out Protocol SEL self super atomic nonatomic retain copy readwrite readonly"),types:a(k),atoms:a("YES NO NULL NILL ON OFF true false"),hooks:{"@":function(e){return e.eatWhile(/[\w\$]/),"keyword"},"#":l,indent:function(e,t,n){if("statement"==t.type&&/^@\w/.test(n))return t.indented}},modeProps:{fold:"brace"}}),m("text/x-squirrel",{name:"clike",keywords:a("base break clone continue const default delete enum extends function in class foreach local resume return this throw typeof yield constructor instanceof static"),types:a(k),blockKeywords:a("case catch class else for foreach if switch try while"),defKeywords:a("function local class"),typeFirstDefinitions:!0,atoms:a("true false null"),hooks:{"#":l},modeProps:{fold:["brace","include"]}});var x=null;m("text/x-ceylon",{name:"clike",keywords:a("abstracts alias assembly assert assign break case catch class continue dynamic else exists extends finally for function given if import in interface is let module new nonempty object of out outer package return satisfies super switch then this throw try value void while"),types:function(e){var t=e.charAt(0);return t===t.toUpperCase()&&t!==t.toLowerCase()},blockKeywords:a("case catch class dynamic else finally for function if interface module new object switch try while"),defKeywords:a("class dynamic function interface module object package value"),builtin:a("abstract actual aliased annotation by default deprecated doc final formal late license native optional sealed see serializable shared suppressWarnings tagged throws variable"),isPunctuationChar:/[\[\]{}\(\),;\:\.`]/,isOperatorChar:/[+\-*&%=<>!?|^~:\/]/,numberStart:/[\d#$]/,number:/^(?:#[\da-fA-F_]+|\$[01_]+|[\d_]+[kMGTPmunpf]?|[\d_]+\.[\d_]+(?:[eE][-+]?\d+|[kMGTPmunpf]|)|)/i,multiLineStrings:!0,typeFirstDefinitions:!0,atoms:a("true false null larger smaller equal empty finished"),indentSwitch:!1,styleDefs:!1,hooks:{"@":function(e){return e.eatWhile(/[\w\$_]/),"meta"},'"':function(e,t){return t.tokenize=y(e.match('""')?"triple":"single"),t.tokenize(e,t)},"`":function(e,t){return!(!x||!e.match("`"))&&(t.tokenize=x,x=null,t.tokenize(e,t))},"'":function(e){return e.eatWhile(/[\w\$_\xa1-\uffff]/),"atom"},token:function(e,t,n){if(("variable"==n||"variable-3"==n)&&"."==t.prevToken)return"variable-2"}},modeProps:{fold:["brace","import"],closeBrackets:{triples:'"'}}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("clojure",function(e){function t(e){for(var t={},n=e.split(" "),r=0;r ->> doto and or dosync doseq dotimes dorun doall load import unimport ns in-ns refer try catch finally throw with-open with-local-vars binding gen-class gen-and-load-class gen-and-save-class handler-case handle"),k=t("* *' *1 *2 *3 *agent* *allow-unresolved-vars* *assert* *clojure-version* *command-line-args* *compile-files* *compile-path* *compiler-options* *data-readers* *e *err* *file* *flush-on-newline* *fn-loader* *in* *math-context* *ns* *out* *print-dup* *print-length* *print-level* *print-meta* *print-readably* *read-eval* *source-path* *unchecked-math* *use-context-classloader* *verbose-defrecords* *warn-on-reflection* + +' - -' -> ->> ->ArrayChunk ->Vec ->VecNode ->VecSeq -cache-protocol-fn -reset-methods .. / < <= = == > >= EMPTY-NODE accessor aclone add-classpath add-watch agent agent-error agent-errors aget alength alias all-ns alter alter-meta! alter-var-root amap ancestors and apply areduce array-map aset aset-boolean aset-byte aset-char aset-double aset-float aset-int aset-long aset-short assert assoc assoc! assoc-in associative? atom await await-for await1 bases bean bigdec bigint biginteger binding bit-and bit-and-not bit-clear bit-flip bit-not bit-or bit-set bit-shift-left bit-shift-right bit-test bit-xor boolean boolean-array booleans bound-fn bound-fn* bound? butlast byte byte-array bytes case cat cast char char-array char-escape-string char-name-string char? chars chunk chunk-append chunk-buffer chunk-cons chunk-first chunk-next chunk-rest chunked-seq? class class? clear-agent-errors clojure-version coll? comment commute comp comparator compare compare-and-set! compile complement completing concat cond condp conj conj! cons constantly construct-proxy contains? count counted? create-ns create-struct cycle dec dec' decimal? declare dedupe default-data-readers definline definterface defmacro defmethod defmulti defn defn- defonce defprotocol defrecord defstruct deftype delay delay? deliver denominator deref derive descendants destructure disj disj! dissoc dissoc! distinct distinct? doall dorun doseq dosync dotimes doto double double-array doubles drop drop-last drop-while eduction empty empty? ensure enumeration-seq error-handler error-mode eval even? every-pred every? ex-data ex-info extend extend-protocol extend-type extenders extends? false? ffirst file-seq filter filterv find find-keyword find-ns find-protocol-impl find-protocol-method find-var first flatten float float-array float? floats flush fn fn? fnext fnil for force format frequencies future future-call future-cancel future-cancelled? future-done? future? gen-class gen-interface gensym get get-in get-method get-proxy-class get-thread-bindings get-validator group-by hash hash-combine hash-map hash-set identical? identity if-let if-not ifn? import in-ns inc inc' init-proxy instance? int int-array integer? interleave intern interpose into into-array ints io! isa? iterate iterator-seq juxt keep keep-indexed key keys keyword keyword? last lazy-cat lazy-seq let letfn line-seq list list* list? load load-file load-reader load-string loaded-libs locking long long-array longs loop macroexpand macroexpand-1 make-array make-hierarchy map map-indexed map? mapcat mapv max max-key memfn memoize merge merge-with meta method-sig methods min min-key mod munge name namespace namespace-munge neg? newline next nfirst nil? nnext not not-any? not-empty not-every? not= ns ns-aliases ns-imports ns-interns ns-map ns-name ns-publics ns-refers ns-resolve ns-unalias ns-unmap nth nthnext nthrest num number? numerator object-array odd? or parents partial partition partition-all partition-by pcalls peek persistent! pmap pop pop! pop-thread-bindings pos? pr pr-str prefer-method prefers primitives-classnames print print-ctor print-dup print-method print-simple print-str printf println println-str prn prn-str promise proxy proxy-call-with-super proxy-mappings proxy-name proxy-super push-thread-bindings pvalues quot rand rand-int rand-nth random-sample range ratio? rational? rationalize re-find re-groups re-matcher re-matches re-pattern re-seq read read-line read-string realized? reduce reduce-kv reductions ref ref-history-count ref-max-history ref-min-history ref-set refer refer-clojure reify release-pending-sends rem remove remove-all-methods remove-method remove-ns remove-watch repeat repeatedly replace replicate require reset! reset-meta! resolve rest restart-agent resultset-seq reverse reversible? rseq rsubseq satisfies? second select-keys send send-off seq seq? seque sequence sequential? set set-error-handler! set-error-mode! set-validator! set? short short-array shorts shuffle shutdown-agents slurp some some-fn sort sort-by sorted-map sorted-map-by sorted-set sorted-set-by sorted? special-symbol? spit split-at split-with str string? struct struct-map subs subseq subvec supers swap! symbol symbol? sync take take-last take-nth take-while test the-ns thread-bound? time to-array to-array-2d trampoline transduce transient tree-seq true? type unchecked-add unchecked-add-int unchecked-byte unchecked-char unchecked-dec unchecked-dec-int unchecked-divide-int unchecked-double unchecked-float unchecked-inc unchecked-inc-int unchecked-int unchecked-long unchecked-multiply unchecked-multiply-int unchecked-negate unchecked-negate-int unchecked-remainder-int unchecked-short unchecked-subtract unchecked-subtract-int underive unquote unquote-splicing update update-in update-proxy use val vals var-get var-set var? vary-meta vec vector vector-of vector? volatile! volatile? vreset! vswap! when when-first when-let when-not while with-bindings with-bindings* with-in-str with-loading-context with-local-vars with-meta with-open with-out-str with-precision with-redefs with-redefs-fn xml-seq zero? zipmap *default-data-reader-fn* as-> cond-> cond->> reduced reduced? send-via set-agent-send-executor! set-agent-send-off-executor! some-> some->>"),x=t("ns fn def defn defmethod bound-fn if if-not case condp when while when-not when-first do future comment doto locking proxy with-open with-precision reify deftype defrecord defprotocol extend extend-protocol extend-type try catch let letfn binding loop for doseq dotimes when-let if-let defstruct struct-map assoc testing deftest handler-case handle dotrace deftrace"),w={digit:/\d/,digit_or_colon:/[\d:]/,hex:/[0-9a-f]/i,sign:/[+-]/,exponent:/e/i,keyword_char:/[^\s\(\[\;\)\]]/,symbol:/[\w*+!\-\._?:<>\/\xa1-\uffff]/,block_indent:/^(?:def|with)[^\/]+$|\/(?:def|with)/};return{startState:function(){return{indentStack:null,indentation:0,mode:!1}},token:function(e,t){if(null==t.indentStack&&e.sol()&&(t.indentation=e.indentation()),"string"!=t.mode&&e.eatSpace())return null;var n=null;switch(t.mode){case"string":for(var _,C=!1;null!=(_=e.next());){if('"'==_&&!C){t.mode=!1;break}C=!C&&"\\"==_}n=c;break;default:var S=e.next();if('"'==S)t.mode="string",n=c;else if("\\"==S)a(e),n=u;else if("'"!=S||w.digit_or_colon.test(e.peek()))if(";"==S)e.skipToEnd(),n=l;else if(o(S,e))n=d;else if("("==S||"["==S||"{"==S){var M,L="",T=e.column();if("("==S)for(;null!=(M=e.eat(w.keyword_char));)L+=M;L.length>0&&(x.propertyIsEnumerable(L)||w.block_indent.test(L))?r(t,T+g,S):(e.eatSpace(),e.eol()||";"==e.peek()?r(t,T+v,S):r(t,T+e.current().length,S)),e.backUp(e.current().length-1),n=p}else if(")"==S||"]"==S||"}"==S)n=p,null!=t.indentStack&&t.indentStack.type==(")"==S?"(":"]"==S?"[":"{")&&i(t);else{if(":"==S)return e.eatWhile(w.symbol),f;e.eatWhile(w.symbol),n=b&&b.propertyIsEnumerable(e.current())?h:k&&k.propertyIsEnumerable(e.current())?s:y&&y.propertyIsEnumerable(e.current())?f:m}else n=f}return n},indent:function(e){return null==e.indentStack?e.indentation:e.indentStack.indent},closeBrackets:{pairs:'()[]{}""'},lineComment:";;"}}),e.defineMIME("text/x-clojure","clojure"),e.defineMIME("text/x-clojurescript","clojure"),e.defineMIME("application/edn","clojure")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("ruby",function(e){function t(e){for(var t={},n=0,r=e.length;n]/)?(e.eat(/[\<\>]/),"atom"):e.eat(/[\+\-\*\/\&\|\:\!]/)?"atom":e.eat(/[a-zA-Z$@_\xa1-\uffff]/)?(e.eatWhile(/[\w$\xa1-\uffff]/),e.eat(/[\?\!\=]/),"atom"):"operator";if("@"==i&&e.match(/^@?[a-zA-Z_\xa1-\uffff]/))return e.eat("@"),e.eatWhile(/[\w\xa1-\uffff]/),"variable-2";if("$"==i)return e.eat(/[a-zA-Z_]/)?e.eatWhile(/[\w]/):e.eat(/\d/)?e.eat(/\d/):e.next(),"variable-3";if(/[a-zA-Z_\xa1-\uffff]/.test(i))return e.eatWhile(/[\w\xa1-\uffff]/),e.eat(/[\?\!]/),e.eat(":")?"atom":"ident";if("|"!=i||!t.varList&&"{"!=t.lastTok&&"do"!=t.lastTok){if(/[\(\)\[\]{}\\;]/.test(i))return c=i,null;if("-"==i&&e.eat(">"))return"arrow";if(/[=+\-\/*:\.^%<>~|]/.test(i)){var v=e.eatWhile(/[=+\-\/*:\.^%<>~|]/);return"."!=i||v||(c="."),"operator"}return null}return c="|",null}function i(e){return e||(e=1),function(t,n){if("}"==t.peek()){if(1==e)return n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n);n.tokenize[n.tokenize.length-1]=i(e-1)}else"{"==t.peek()&&(n.tokenize[n.tokenize.length-1]=i(e+1));return r(t,n)}}function o(){var e=!1;return function(t,n){return e?(n.tokenize.pop(),n.tokenize[n.tokenize.length-1](t,n)):(e=!0,r(t,n))}}function a(e,t,n,r){return function(a,s){var l,c=!1;for("read-quoted-paused"===s.context.type&&(s.context=s.context.prev,a.eat("}"));null!=(l=a.next());){if(l==e&&(r||!c)){s.tokenize.pop();break}if(n&&"#"==l&&!c){if(a.eat("{")){"}"==e&&(s.context={prev:s.context,type:"read-quoted-paused"}),s.tokenize.push(i());break}if(/[@\$]/.test(a.peek())){s.tokenize.push(o());break}}c=!c&&"\\"==l}return t}}function s(e){return function(t,n){return t.match(e)?n.tokenize.pop():t.skipToEnd(),"string"}}function l(e,t){return e.sol()&&e.match("=end")&&e.eol()&&t.tokenize.pop(),e.skipToEnd(),"comment"}var c,u=t(["alias","and","BEGIN","begin","break","case","class","def","defined?","do","else","elsif","END","end","ensure","false","for","if","in","module","next","not","or","redo","rescue","retry","return","self","super","then","true","undef","unless","until","when","while","yield","nil","raise","throw","catch","fail","loop","callcc","caller","lambda","proc","public","protected","private","require","load","require_relative","extend","autoload","__END__","__FILE__","__LINE__","__dir__"]),f=t(["def","class","case","for","while","until","module","then","catch","loop","proc","begin"]),d=t(["end","until"]),p={"[":"]","{":"}","(":")"};return{startState:function(){return{tokenize:[r],indented:0,context:{type:"top",indented:-e.indentUnit},continuedLine:!1,lastTok:null,varList:!1}},token:function(e,t){c=null,e.sol()&&(t.indented=e.indentation());var n,r=t.tokenize[t.tokenize.length-1](e,t),i=c;if("ident"==r){var o=e.current();r="."==t.lastTok?"property":u.propertyIsEnumerable(e.current())?"keyword":/^[A-Z]/.test(o)?"tag":"def"==t.lastTok||"class"==t.lastTok||t.varList?"def":"variable","keyword"==r&&(i=o,f.propertyIsEnumerable(o)?n="indent":d.propertyIsEnumerable(o)?n="dedent":"if"!=o&&"unless"!=o||e.column()!=e.indentation()?"do"==o&&t.context.indentedr?f(t):i0&&p(e,t)&&(o+=" "+m),o}return c(e,t)}function c(e,t){if(e.eatSpace())return null;var n=e.peek();if("#"==n)return e.skipToEnd(),"comment";if(e.match(/^[0-9\.]/,!1)){var i=!1;if(e.match(/^\d*\.\d+(e[\+\-]?\d+)?/i)&&(i=!0),e.match(/^\d+\.\d*/)&&(i=!0),e.match(/^\.\d+/)&&(i=!0),i)return e.eat(/J/i),"number";var o=!1;if(e.match(/^0x[0-9a-f]+/i)&&(o=!0),e.match(/^0b[01]+/i)&&(o=!0), +e.match(/^0o[0-7]+/i)&&(o=!0),e.match(/^[1-9]\d*(e[\+\-]?\d+)?/)&&(e.eat(/J/i),o=!0),e.match(/^0(?![\dx])/i)&&(o=!0),o)return e.eat(/L/i),"number"}return e.match(M)?(t.tokenize=u(e.current()),t.tokenize(e,t)):e.match(b)||e.match(y)?"punctuation":e.match(v)||e.match(C)?"operator":e.match(g)?"punctuation":"."==t.lastToken&&e.match(S)?"property":e.match(L)||e.match(r)?"keyword":e.match(T)?"builtin":e.match(/^(self|cls)\b/)?"variable-2":e.match(S)?"def"==t.lastToken||"class"==t.lastToken?"def":"variable":(e.next(),m)}function u(e){function t(t,i){for(;!t.eol();)if(t.eatWhile(/[^'"\\]/),t.eat("\\")){if(t.next(),n&&t.eol())return r}else{if(t.match(e))return i.tokenize=l,r;t.eat(/['"]/)}if(n){if(s.singleLineStringErrors)return m;i.tokenize=l}return r}for(;"rubf".indexOf(e.charAt(0).toLowerCase())>=0;)e=e.substr(1);var n=1==e.length,r="string";return t.isString=!0,t}function f(e){for(;"py"!=n(e).type;)e.scopes.pop();e.scopes.push({offset:n(e).offset+a.indentUnit,type:"py",align:null})}function d(e,t,n){var r=e.match(/^([\s\[\{\(]|#.*)*$/,!1)?null:e.column()+1;t.scopes.push({offset:t.indent+k,type:n,align:r})}function p(e,t){for(var r=e.indentation();t.scopes.length>1&&n(t).offset>r;){if("py"!=n(t).type)return!0;t.scopes.pop()}return n(t).offset!=r}function h(e,t){e.sol()&&(t.beginningOfLine=!0);var r=t.tokenize(e,t),i=e.current();if(t.beginningOfLine&&"@"==i)return e.match(S,!1)?"meta":_?"operator":m;/\S/.test(i)&&(t.beginningOfLine=!1),"variable"!=r&&"builtin"!=r||"meta"!=t.lastToken||(r="meta"),"pass"!=i&&"return"!=i||(t.dedent+=1),"lambda"==i&&(t.lambda=!0),":"!=i||t.lambda||"py"!=n(t).type||f(t);var o=1==i.length?"[({".indexOf(i):-1;if(o!=-1&&d(e,t,"])}".slice(o,o+1)),o="])}".indexOf(i),o!=-1){if(n(t).type!=i)return m;t.indent=t.scopes.pop().offset-k}return t.dedent>0&&e.eol()&&"py"==n(t).type&&(t.scopes.length>1&&t.scopes.pop(),t.dedent-=1),r}var m="error",g=s.singleDelimiters||/^[\(\)\[\]\{\}@,:`=;\.]/,v=s.doubleOperators||/^([!<>]==|<>|<<|>>|\/\/|\*\*)/,y=s.doubleDelimiters||/^(\+=|\-=|\*=|%=|\/=|&=|\|=|\^=)/,b=s.tripleDelimiters||/^(\/\/=|>>=|<<=|\*\*=)/,k=s.hangingIndent||a.indentUnit,x=i,w=o;void 0!=s.extra_keywords&&(x=x.concat(s.extra_keywords)),void 0!=s.extra_builtins&&(w=w.concat(s.extra_builtins));var _=!(s.version&&Number(s.version)<3);if(_){var C=s.singleOperators||/^[\+\-\*\/%&|\^~<>!@]/,S=s.identifiers||/^[_A-Za-z\u00A1-\uFFFF][_A-Za-z0-9\u00A1-\uFFFF]*/;x=x.concat(["nonlocal","False","True","None","async","await"]),w=w.concat(["ascii","bytes","exec","print"]);var M=new RegExp("^(([rbuf]|(br))?('{3}|\"{3}|['\"]))","i")}else{var C=s.singleOperators||/^[\+\-\*\/%&|\^~<>!]/,S=s.identifiers||/^[_A-Za-z][_A-Za-z0-9]*/;x=x.concat(["exec","print"]),w=w.concat(["apply","basestring","buffer","cmp","coerce","execfile","file","intern","long","raw_input","reduce","reload","unichr","unicode","xrange","False","True","None"]);var M=new RegExp("^(([rub]|(ur)|(br))?('{3}|\"{3}|['\"]))","i")}var L=t(x),T=t(w),A={startState:function(e){return{tokenize:l,scopes:[{offset:e||0,type:"py",align:null}],indent:e||0,lastToken:null,lambda:!1,dedent:0}},token:function(e,t){var n=t.errorToken;n&&(t.errorToken=!1);var r=h(e,t);return r&&"comment"!=r&&(t.lastToken="keyword"==r||"punctuation"==r?e.current():r),"punctuation"==r&&(r=null),e.eol()&&t.lambda&&(t.lambda=!1),n?r+" "+m:r},indent:function(t,r){if(t.tokenize!=l)return t.tokenize.isString?e.Pass:0;var i=n(t),o=i.type==r.charAt(0);return null!=i.align?i.align-(o?1:0):i.offset-(o?k:0)},electricInput:/^\s*[\}\]\)]$/,closeBrackets:{triples:"'\""},lineComment:"#",fold:"indent"};return A}),e.defineMIME("text/x-python","python");var a=function(e){return e.split(" ")};e.defineMIME("text/x-cython",{name:"python",extra_keywords:a("by cdef cimport cpdef ctypedef enum exceptextern gil include nogil property publicreadonly struct union DEF IF ELIF ELSE")})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("shell",function(){function e(e,t){for(var n=t.split(" "),r=0;r1&&e.eat("$");var i=e.next(),o=/\w/;return"{"===i&&(o=/[^}]/),"("===i?(t.tokens[0]=n(")"),r(e,t)):(/\d/.test(i)||(e.eatWhile(o),e.eat("}")),t.tokens.shift(),"def")};return{startState:function(){return{tokens:[]}},token:function(e,t){return r(e,t)},lineComment:"#",fold:"brace"}}),e.defineMIME("text/x-sh","shell")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../htmlmixed/htmlmixed"),require("../clike/clike")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../htmlmixed/htmlmixed","../clike/clike"],e):e(CodeMirror)}(function(e){"use strict";function t(e){for(var t={},n=e.split(" "),r=0;r\w/,!1)&&(t.tokenize=n([[["->",null]],[[/[\w]+/,"variable"]]],r,i)),"variable-2";for(var o=!1;!e.eol()&&(o||i===!1||!e.match("{$",!1)&&!e.match(/^(\$[a-zA-Z_][a-zA-Z0-9_]*|\$\{)/,!1));){if(!o&&e.match(r)){t.tokenize=null,t.tokStack.pop(),t.tokStack.pop();break}o="\\"==e.next()&&!o}return"string"}var o="abstract and array as break case catch class clone const continue declare default do else elseif enddeclare endfor endforeach endif endswitch endwhile extends final for foreach function global goto if implements interface instanceof namespace new or private protected public static switch throw trait try use var while xor die echo empty exit eval include include_once isset list require require_once return print unset __halt_compiler self static parent yield insteadof finally",a="true false null TRUE FALSE NULL __CLASS__ __DIR__ __FILE__ __LINE__ __METHOD__ __FUNCTION__ __NAMESPACE__ __TRAIT__",s="func_num_args func_get_arg func_get_args strlen strcmp strncmp strcasecmp strncasecmp each error_reporting define defined trigger_error user_error set_error_handler restore_error_handler get_declared_classes get_loaded_extensions extension_loaded get_extension_funcs debug_backtrace constant bin2hex hex2bin sleep usleep time mktime gmmktime strftime gmstrftime strtotime date gmdate getdate localtime checkdate flush wordwrap htmlspecialchars htmlentities html_entity_decode md5 md5_file crc32 getimagesize image_type_to_mime_type phpinfo phpversion phpcredits strnatcmp strnatcasecmp substr_count strspn strcspn strtok strtoupper strtolower strpos strrpos strrev hebrev hebrevc nl2br basename dirname pathinfo stripslashes stripcslashes strstr stristr strrchr str_shuffle str_word_count strcoll substr substr_replace quotemeta ucfirst ucwords strtr addslashes addcslashes rtrim str_replace str_repeat count_chars chunk_split trim ltrim strip_tags similar_text explode implode setlocale localeconv parse_str str_pad chop strchr sprintf printf vprintf vsprintf sscanf fscanf parse_url urlencode urldecode rawurlencode rawurldecode readlink linkinfo link unlink exec system escapeshellcmd escapeshellarg passthru shell_exec proc_open proc_close rand srand getrandmax mt_rand mt_srand mt_getrandmax base64_decode base64_encode abs ceil floor round is_finite is_nan is_infinite bindec hexdec octdec decbin decoct dechex base_convert number_format fmod ip2long long2ip getenv putenv getopt microtime gettimeofday getrusage uniqid quoted_printable_decode set_time_limit get_cfg_var magic_quotes_runtime set_magic_quotes_runtime get_magic_quotes_gpc get_magic_quotes_runtime import_request_variables error_log serialize unserialize memory_get_usage var_dump var_export debug_zval_dump print_r highlight_file show_source highlight_string ini_get ini_get_all ini_set ini_alter ini_restore get_include_path set_include_path restore_include_path setcookie header headers_sent connection_aborted connection_status ignore_user_abort parse_ini_file is_uploaded_file move_uploaded_file intval floatval doubleval strval gettype settype is_null is_resource is_bool is_long is_float is_int is_integer is_double is_real is_numeric is_string is_array is_object is_scalar ereg ereg_replace eregi eregi_replace split spliti join sql_regcase dl pclose popen readfile rewind rmdir umask fclose feof fgetc fgets fgetss fread fopen fpassthru ftruncate fstat fseek ftell fflush fwrite fputs mkdir rename copy tempnam tmpfile file file_get_contents file_put_contents stream_select stream_context_create stream_context_set_params stream_context_set_option stream_context_get_options stream_filter_prepend stream_filter_append fgetcsv flock get_meta_tags stream_set_write_buffer set_file_buffer set_socket_blocking stream_set_blocking socket_set_blocking stream_get_meta_data stream_register_wrapper stream_wrapper_register stream_set_timeout socket_set_timeout socket_get_status realpath fnmatch fsockopen pfsockopen pack unpack get_browser crypt opendir closedir chdir getcwd rewinddir readdir dir glob fileatime filectime filegroup fileinode filemtime fileowner fileperms filesize filetype file_exists is_writable is_writeable is_readable is_executable is_file is_dir is_link stat lstat chown touch clearstatcache mail ob_start ob_flush ob_clean ob_end_flush ob_end_clean ob_get_flush ob_get_clean ob_get_length ob_get_level ob_get_status ob_get_contents ob_implicit_flush ob_list_handlers ksort krsort natsort natcasesort asort arsort sort rsort usort uasort uksort shuffle array_walk count end prev next reset current key min max in_array array_search extract compact array_fill range array_multisort array_push array_pop array_shift array_unshift array_splice array_slice array_merge array_merge_recursive array_keys array_values array_count_values array_reverse array_reduce array_pad array_flip array_change_key_case array_rand array_unique array_intersect array_intersect_assoc array_diff array_diff_assoc array_sum array_filter array_map array_chunk array_key_exists array_intersect_key array_combine array_column pos sizeof key_exists assert assert_options version_compare ftok str_rot13 aggregate session_name session_module_name session_save_path session_id session_regenerate_id session_decode session_register session_unregister session_is_registered session_encode session_start session_destroy session_unset session_set_save_handler session_cache_limiter session_cache_expire session_set_cookie_params session_get_cookie_params session_write_close preg_match preg_match_all preg_replace preg_replace_callback preg_split preg_quote preg_grep overload ctype_alnum ctype_alpha ctype_cntrl ctype_digit ctype_lower ctype_graph ctype_print ctype_punct ctype_space ctype_upper ctype_xdigit virtual apache_request_headers apache_note apache_lookup_uri apache_child_terminate apache_setenv apache_response_headers apache_get_version getallheaders mysql_connect mysql_pconnect mysql_close mysql_select_db mysql_create_db mysql_drop_db mysql_query mysql_unbuffered_query mysql_db_query mysql_list_dbs mysql_list_tables mysql_list_fields mysql_list_processes mysql_error mysql_errno mysql_affected_rows mysql_insert_id mysql_result mysql_num_rows mysql_num_fields mysql_fetch_row mysql_fetch_array mysql_fetch_assoc mysql_fetch_object mysql_data_seek mysql_fetch_lengths mysql_fetch_field mysql_field_seek mysql_free_result mysql_field_name mysql_field_table mysql_field_len mysql_field_type mysql_field_flags mysql_escape_string mysql_real_escape_string mysql_stat mysql_thread_id mysql_client_encoding mysql_get_client_info mysql_get_host_info mysql_get_proto_info mysql_get_server_info mysql_info mysql mysql_fieldname mysql_fieldtable mysql_fieldlen mysql_fieldtype mysql_fieldflags mysql_selectdb mysql_createdb mysql_dropdb mysql_freeresult mysql_numfields mysql_numrows mysql_listdbs mysql_listtables mysql_listfields mysql_db_name mysql_dbname mysql_tablename mysql_table_name pg_connect pg_pconnect pg_close pg_connection_status pg_connection_busy pg_connection_reset pg_host pg_dbname pg_port pg_tty pg_options pg_ping pg_query pg_send_query pg_cancel_query pg_fetch_result pg_fetch_row pg_fetch_assoc pg_fetch_array pg_fetch_object pg_fetch_all pg_affected_rows pg_get_result pg_result_seek pg_result_status pg_free_result pg_last_oid pg_num_rows pg_num_fields pg_field_name pg_field_num pg_field_size pg_field_type pg_field_prtlen pg_field_is_null pg_get_notify pg_get_pid pg_result_error pg_last_error pg_last_notice pg_put_line pg_end_copy pg_copy_to pg_copy_from pg_trace pg_untrace pg_lo_create pg_lo_unlink pg_lo_open pg_lo_close pg_lo_read pg_lo_write pg_lo_read_all pg_lo_import pg_lo_export pg_lo_seek pg_lo_tell pg_escape_string pg_escape_bytea pg_unescape_bytea pg_client_encoding pg_set_client_encoding pg_meta_data pg_convert pg_insert pg_update pg_delete pg_select pg_exec pg_getlastoid pg_cmdtuples pg_errormessage pg_numrows pg_numfields pg_fieldname pg_fieldsize pg_fieldtype pg_fieldnum pg_fieldprtlen pg_fieldisnull pg_freeresult pg_result pg_loreadall pg_locreate pg_lounlink pg_loopen pg_loclose pg_loread pg_lowrite pg_loimport pg_loexport http_response_code get_declared_traits getimagesizefromstring socket_import_stream stream_set_chunk_size trait_exists header_register_callback class_uses session_status session_register_shutdown echo print global static exit array empty eval isset unset die include require include_once require_once json_decode json_encode json_last_error json_last_error_msg curl_close curl_copy_handle curl_errno curl_error curl_escape curl_exec curl_file_create curl_getinfo curl_init curl_multi_add_handle curl_multi_close curl_multi_exec curl_multi_getcontent curl_multi_info_read curl_multi_init curl_multi_remove_handle curl_multi_select curl_multi_setopt curl_multi_strerror curl_pause curl_reset curl_setopt_array curl_setopt curl_share_close curl_share_init curl_share_setopt curl_strerror curl_unescape curl_version mysqli_affected_rows mysqli_autocommit mysqli_change_user mysqli_character_set_name mysqli_close mysqli_commit mysqli_connect_errno mysqli_connect_error mysqli_connect mysqli_data_seek mysqli_debug mysqli_dump_debug_info mysqli_errno mysqli_error_list mysqli_error mysqli_fetch_all mysqli_fetch_array mysqli_fetch_assoc mysqli_fetch_field_direct mysqli_fetch_field mysqli_fetch_fields mysqli_fetch_lengths mysqli_fetch_object mysqli_fetch_row mysqli_field_count mysqli_field_seek mysqli_field_tell mysqli_free_result mysqli_get_charset mysqli_get_client_info mysqli_get_client_stats mysqli_get_client_version mysqli_get_connection_stats mysqli_get_host_info mysqli_get_proto_info mysqli_get_server_info mysqli_get_server_version mysqli_info mysqli_init mysqli_insert_id mysqli_kill mysqli_more_results mysqli_multi_query mysqli_next_result mysqli_num_fields mysqli_num_rows mysqli_options mysqli_ping mysqli_prepare mysqli_query mysqli_real_connect mysqli_real_escape_string mysqli_real_query mysqli_reap_async_query mysqli_refresh mysqli_rollback mysqli_select_db mysqli_set_charset mysqli_set_local_infile_default mysqli_set_local_infile_handler mysqli_sqlstate mysqli_ssl_set mysqli_stat mysqli_stmt_init mysqli_store_result mysqli_thread_id mysqli_thread_safe mysqli_use_result mysqli_warning_count";e.registerHelper("hintWords","php",[o,a,s].join(" ").split(" ")),e.registerHelper("wordChars","php",/[\w$]/);var l={name:"clike",helperType:"php",keywords:t(o),blockKeywords:t("catch do else elseif for foreach if switch try while finally"),defKeywords:t("class function interface namespace trait"),atoms:t(a),builtin:t(s),multiLineStrings:!0,hooks:{$:function(e){return e.eatWhile(/[\w\$_]/),"variable-2"},"<":function(e,t){var n;if(n=e.match(/<<\s*/)){var i=e.eat(/['"]/);e.eatWhile(/[\w\.]/);var o=e.current().slice(n[0].length+(i?2:1));if(i&&e.eat(i),o)return(t.tokStack||(t.tokStack=[])).push(o,0),t.tokenize=r(o,"'"!=i),"string"}return!1},"#":function(e){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"},"/":function(e){if(e.eat("/")){for(;!e.eol()&&!e.match("?>",!1);)e.next();return"comment"}return!1},'"':function(e,t){return(t.tokStack||(t.tokStack=[])).push('"',0),t.tokenize=r('"'),"string"},"{":function(e,t){return t.tokStack&&t.tokStack.length&&t.tokStack[t.tokStack.length-1]++,!1},"}":function(e,t){return t.tokStack&&t.tokStack.length>0&&!--t.tokStack[t.tokStack.length-1]&&(t.tokenize=r(t.tokStack[t.tokStack.length-2])),!1}}};e.defineMode("php",function(t,n){function r(t,n){var r=n.curMode==o;if(t.sol()&&n.pending&&'"'!=n.pending&&"'"!=n.pending&&(n.pending=null),r)return r&&null==n.php.tokenize&&t.match("?>")?(n.curMode=i,n.curState=n.html,n.php.context.prev||(n.php=null),"meta"):o.token(t,n.curState);if(t.match(/^<\?\w*/))return n.curMode=o,n.php||(n.php=e.startState(o,i.indent(n.html,""))),n.curState=n.php,"meta";if('"'==n.pending||"'"==n.pending){for(;!t.eol()&&t.next()!=n.pending;);var a="string"}else if(n.pending&&t.pos/.test(l)?n.pending=s[0]:n.pending={end:t.pos,style:a},t.backUp(l.length-c)),a}var i=e.getMode(t,"text/html"),o=e.getMode(t,l);return{startState:function(){var t=e.startState(i),r=n.startOpen?e.startState(o):null;return{html:t,php:r,curMode:n.startOpen?o:i,curState:n.startOpen?r:t,pending:null}},copyState:function(t){var n,r=t.html,a=e.copyState(i,r),s=t.php,l=s&&e.copyState(o,s);return n=t.curMode==i?a:l,{html:a,php:l,curMode:t.curMode,curState:n,pending:t.pending}},token:r,indent:function(e,t){return e.curMode!=o&&/^\s*<\//.test(t)||e.curMode==o&&/^\?>/.test(t)?i.indent(e.html,t):e.curMode.indent(e.curState,t)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:"//",innerMode:function(e){return{state:e.curState,mode:e.curMode}}}},"htmlmixed","clike"),e.defineMIME("application/x-httpd-php","php"),e.defineMIME("application/x-httpd-php-open",{name:"php",startOpen:!0}),e.defineMIME("text/x-php",l)}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("sql",function(t,n){function r(e,t){var n=e.next();if(h[n]){var r=h[n](e,t);if(r!==!1)return r}if(1==p.hexNumber&&("0"==n&&e.match(/^[xX][0-9a-fA-F]+/)||("x"==n||"X"==n)&&e.match(/^'[0-9a-fA-F]+'/)))return"number";if(1==p.binaryNumber&&(("b"==n||"B"==n)&&e.match(/^'[01]+'/)||"0"==n&&e.match(/^b[01]+/)))return"number";if(n.charCodeAt(0)>47&&n.charCodeAt(0)<58)return e.match(/^[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/),1==p.decimallessFloat&&e.eat("."),"number";if("?"==n&&(e.eatSpace()||e.eol()||e.eat(";")))return"variable-3";if("'"==n||'"'==n&&p.doubleQuote)return t.tokenize=i(n),t.tokenize(e,t);if((1==p.nCharCast&&("n"==n||"N"==n)||1==p.charsetCast&&"_"==n&&e.match(/[a-z][a-z0-9]*/i))&&("'"==e.peek()||'"'==e.peek()))return"keyword";if(/^[\(\),\;\[\]]/.test(n))return null;if(p.commentSlashSlash&&"/"==n&&e.eat("/"))return e.skipToEnd(),"comment";if(p.commentHash&&"#"==n||"-"==n&&e.eat("-")&&(!p.commentSpaceRequired||e.eat(" ")))return e.skipToEnd(),"comment";if("/"==n&&e.eat("*"))return t.tokenize=o,t.tokenize(e,t);if("."!=n){if(d.test(n))return e.eatWhile(d),null;if("{"==n&&(e.match(/^( )*(d|D|t|T|ts|TS)( )*'[^']*'( )*}/)||e.match(/^( )*(d|D|t|T|ts|TS)( )*"[^"]*"( )*}/)))return"number";e.eatWhile(/^[_\w\d]/);var a=e.current().toLowerCase();return m.hasOwnProperty(a)&&(e.match(/^( )+'[^']*'/)||e.match(/^( )+"[^"]*"/))?"number":c.hasOwnProperty(a)?"atom":u.hasOwnProperty(a)?"builtin":f.hasOwnProperty(a)?"keyword":l.hasOwnProperty(a)?"string-2":null}return 1==p.zerolessFloat&&e.match(/^(?:\d+(?:e[+-]?\d+)?)/i)?"number":1==p.ODBCdotTable&&e.match(/^[a-zA-Z_]+/)?"variable-2":void 0}function i(e){return function(t,n){for(var i,o=!1;null!=(i=t.next());){if(i==e&&!o){n.tokenize=r;break}o=!o&&"\\"==i}return"string"}}function o(e,t){for(;;){if(!e.skipTo("*")){e.skipToEnd();break}if(e.next(),e.eat("/")){t.tokenize=r;break}}return"comment"}function a(e,t,n){t.context={prev:t.context,indent:e.indentation(),col:e.column(),type:n}}function s(e){e.indent=e.context.indent,e.context=e.context.prev}var l=n.client||{},c=n.atoms||{"false":!0,"true":!0,"null":!0},u=n.builtin||{},f=n.keywords||{},d=n.operatorChars||/^[*+\-%<>!=&|~^]/,p=n.support||{},h=n.hooks||{},m=n.dateSQL||{date:!0,time:!0,timestamp:!0};return{startState:function(){return{tokenize:r,context:null}},token:function(e,t){if(e.sol()&&t.context&&null==t.context.align&&(t.context.align=!1),e.eatSpace())return null;var n=t.tokenize(e,t);if("comment"==n)return n;t.context&&null==t.context.align&&(t.context.align=!0);var r=e.current();return"("==r?a(e,t,")"):"["==r?a(e,t,"]"):t.context&&t.context.type==r&&s(t),n},indent:function(n,r){var i=n.context;if(!i)return e.Pass;var o=r.charAt(0)==i.type;return i.align?i.col+(o?0:1):i.indent+(o?0:t.indentUnit)},blockCommentStart:"/*",blockCommentEnd:"*/",lineComment:p.commentSlashSlash?"//":p.commentHash?"#":null}}),function(){function t(e){for(var t;null!=(t=e.next());)if("`"==t&&!e.eat("`"))return"variable-2";return e.backUp(e.current().length-1),e.eatWhile(/\w/)?"variable-2":null}function n(e){return e.eat("@")&&(e.match(/^session\./),e.match(/^local\./),e.match(/^global\./)),e.eat("'")?(e.match(/^.*'/),"variable-2"):e.eat('"')?(e.match(/^.*"/),"variable-2"):e.eat("`")?(e.match(/^.*`/),"variable-2"):e.match(/^[0-9a-zA-Z$\.\_]+/)?"variable-2":null}function r(e){return e.eat("N")?"atom":e.match(/^[a-zA-Z.#!?]/)?"variable-2":null}function i(e){for(var t={},n=e.split(" "),r=0;r!=]/,dateSQL:i("date time timestamp"),support:i("ODBCdotTable doubleQuote binaryNumber hexNumber")}),e.defineMIME("text/x-mssql",{name:"sql",client:i("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:i(o+"begin trigger proc view index for add constraint key primary foreign collate clustered nonclustered declare"),builtin:i("bigint numeric bit smallint decimal smallmoney int tinyint money float real char varchar text nchar nvarchar ntext binary varbinary image cursor timestamp hierarchyid uniqueidentifier sql_variant xml table "),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:i("date datetimeoffset datetime2 smalldatetime datetime time"),hooks:{"@":n}}),e.defineMIME("text/x-mysql",{name:"sql",client:i("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:i(o+"accessible action add after algorithm all analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general get global grant grants group group_concat handler hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show signal slave slow smallint snapshot soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:i("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:i("date time timestamp"),support:i("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":n,"`":t,"\\":r}}),e.defineMIME("text/x-mariadb",{name:"sql",client:i("charset clear connect edit ego exit go help nopager notee nowarning pager print prompt quit rehash source status system tee"),keywords:i(o+"accessible action add after algorithm all always analyze asensitive at authors auto_increment autocommit avg avg_row_length before binary binlog both btree cache call cascade cascaded case catalog_name chain change changed character check checkpoint checksum class_origin client_statistics close coalesce code collate collation collations column columns comment commit committed completion concurrent condition connection consistent constraint contains continue contributors convert cross current current_date current_time current_timestamp current_user cursor data database databases day_hour day_microsecond day_minute day_second deallocate dec declare default delay_key_write delayed delimiter des_key_file describe deterministic dev_pop dev_samp deviance diagnostics directory disable discard distinctrow div dual dumpfile each elseif enable enclosed end ends engine engines enum errors escape escaped even event events every execute exists exit explain extended fast fetch field fields first flush for force foreign found_rows full fulltext function general generated get global grant grants group groupby_concat handler hard hash help high_priority hosts hour_microsecond hour_minute hour_second if ignore ignore_server_ids import index index_statistics infile inner innodb inout insensitive insert_method install interval invoker isolation iterate key keys kill language last leading leave left level limit linear lines list load local localtime localtimestamp lock logs low_priority master master_heartbeat_period master_ssl_verify_server_cert masters match max max_rows maxvalue message_text middleint migrate min min_rows minute_microsecond minute_second mod mode modifies modify mutex mysql_errno natural next no no_write_to_binlog offline offset one online open optimize option optionally out outer outfile pack_keys parser partition partitions password persistent phase plugin plugins prepare preserve prev primary privileges procedure processlist profile profiles purge query quick range read read_write reads real rebuild recover references regexp relaylog release remove rename reorganize repair repeatable replace require resignal restrict resume return returns revoke right rlike rollback rollup row row_format rtree savepoint schedule schema schema_name schemas second_microsecond security sensitive separator serializable server session share show shutdown signal slave slow smallint snapshot soft soname spatial specific sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_no_cache sql_small_result sqlexception sqlstate sqlwarning ssl start starting starts status std stddev stddev_pop stddev_samp storage straight_join subclass_origin sum suspend table_name table_statistics tables tablespace temporary terminated to trailing transaction trigger triggers truncate uncommitted undo uninstall unique unlock upgrade usage use use_frm user user_resources user_statistics using utc_date utc_time utc_timestamp value variables varying view views virtual warnings when while with work write xa xor year_month zerofill begin do then else loop repeat"),builtin:i("bool boolean bit blob decimal double float long longblob longtext medium mediumblob mediumint mediumtext time timestamp tinyblob tinyint tinytext text bigint int int1 int2 int3 int4 int8 integer float float4 float8 double char varbinary varchar varcharacter precision date datetime year unsigned signed numeric"), +atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^]/,dateSQL:i("date time timestamp"),support:i("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber doubleQuote nCharCast charsetCast commentHash commentSpaceRequired"),hooks:{"@":n,"`":t,"\\":r}}),e.defineMIME("text/x-cassandra",{name:"sql",client:{},keywords:i("add all allow alter and any apply as asc authorize batch begin by clustering columnfamily compact consistency count create custom delete desc distinct drop each_quorum exists filtering from grant if in index insert into key keyspace keyspaces level limit local_one local_quorum modify nan norecursive nosuperuser not of on one order password permission permissions primary quorum rename revoke schema select set storage superuser table three to token truncate ttl two type unlogged update use user users using values where with writetime"),builtin:i("ascii bigint blob boolean counter decimal double float frozen inet int list map static text timestamp timeuuid tuple uuid varchar varint"),atoms:i("false true infinity NaN"),operatorChars:/^[<>=]/,dateSQL:{},support:i("commentSlashSlash decimallessFloat"),hooks:{}}),e.defineMIME("text/x-plsql",{name:"sql",client:i("appinfo arraysize autocommit autoprint autorecovery autotrace blockterminator break btitle cmdsep colsep compatibility compute concat copycommit copytypecheck define describe echo editfile embedded escape exec execute feedback flagger flush heading headsep instance linesize lno loboffset logsource long longchunksize markup native newpage numformat numwidth pagesize pause pno recsep recsepchar release repfooter repheader serveroutput shiftinout show showmode size spool sqlblanklines sqlcase sqlcode sqlcontinue sqlnumber sqlpluscompatibility sqlprefix sqlprompt sqlterminator suffix tab term termout time timing trimout trimspool ttitle underline verify version wrap"),keywords:i("abort accept access add all alter and any array arraylen as asc assert assign at attributes audit authorization avg base_table begin between binary_integer body boolean by case cast char char_base check close cluster clusters colauth column comment commit compress connect connected constant constraint crash create current currval cursor data_base database date dba deallocate debugoff debugon decimal declare default definition delay delete desc digits dispose distinct do drop else elseif elsif enable end entry escape exception exception_init exchange exclusive exists exit external fast fetch file for force form from function generic goto grant group having identified if immediate in increment index indexes indicator initial initrans insert interface intersect into is key level library like limited local lock log logging long loop master maxextents maxtrans member minextents minus mislabel mode modify multiset new next no noaudit nocompress nologging noparallel not nowait number_base object of off offline on online only open option or order out package parallel partition pctfree pctincrease pctused pls_integer positive positiven pragma primary prior private privileges procedure public raise range raw read rebuild record ref references refresh release rename replace resource restrict return returning returns reverse revoke rollback row rowid rowlabel rownum rows run savepoint schema segment select separate session set share snapshot some space split sql start statement storage subtype successful synonym tabauth table tables tablespace task terminate then to trigger truncate type union unique unlimited unrecoverable unusable update use using validate value values variable view views when whenever where while with work"),builtin:i("abs acos add_months ascii asin atan atan2 average bfile bfilename bigserial bit blob ceil character chartorowid chr clob concat convert cos cosh count dec decode deref dual dump dup_val_on_index empty error exp false float floor found glb greatest hextoraw initcap instr instrb int integer isopen last_day least length lengthb ln lower lpad ltrim lub make_ref max min mlslabel mod months_between natural naturaln nchar nclob new_time next_day nextval nls_charset_decl_len nls_charset_id nls_charset_name nls_initcap nls_lower nls_sort nls_upper nlssort no_data_found notfound null number numeric nvarchar2 nvl others power rawtohex real reftohex round rowcount rowidtochar rowtype rpad rtrim serial sign signtype sin sinh smallint soundex sqlcode sqlerrm sqrt stddev string substr substrb sum sysdate tan tanh to_char text to_date to_label to_multi_byte to_number to_single_byte translate true trunc uid unlogged upper user userenv varchar varchar2 variance varying vsize xml"),operatorChars:/^[*+\-%<>!=~]/,dateSQL:i("date time timestamp"),support:i("doubleQuote nCharCast zerolessFloat binaryNumber hexNumber")}),e.defineMIME("text/x-hive",{name:"sql",keywords:i("select alter $elem$ $key$ $value$ add after all analyze and archive as asc before between binary both bucket buckets by cascade case cast change cluster clustered clusterstatus collection column columns comment compute concatenate continue create cross cursor data database databases dbproperties deferred delete delimited desc describe directory disable distinct distribute drop else enable end escaped exclusive exists explain export extended external false fetch fields fileformat first format formatted from full function functions grant group having hold_ddltime idxproperties if import in index indexes inpath inputdriver inputformat insert intersect into is items join keys lateral left like limit lines load local location lock locks mapjoin materialized minus msck no_drop nocompress not of offline on option or order out outer outputdriver outputformat overwrite partition partitioned partitions percent plus preserve procedure purge range rcfile read readonly reads rebuild recordreader recordwriter recover reduce regexp rename repair replace restrict revoke right rlike row schema schemas semi sequencefile serde serdeproperties set shared show show_database sort sorted ssl statistics stored streamtable table tables tablesample tblproperties temporary terminated textfile then tmp to touch transform trigger true unarchive undo union uniquejoin unlock update use using utc utc_tmestamp view when where while with"),builtin:i("bool boolean long timestamp tinyint smallint bigint int float double date datetime unsigned string array struct map uniontype"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=]/,dateSQL:i("date timestamp"),support:i("ODBCdotTable doubleQuote binaryNumber hexNumber")}),e.defineMIME("text/x-pgsql",{name:"sql",client:i("source"),keywords:i(o+"a abort abs absent absolute access according action ada add admin after aggregate all allocate also always analyse analyze any are array array_agg array_max_cardinality asensitive assertion assignment asymmetric at atomic attribute attributes authorization avg backward base64 before begin begin_frame begin_partition bernoulli binary bit_length blob blocked bom both breadth c cache call called cardinality cascade cascaded case cast catalog catalog_name ceil ceiling chain characteristics characters character_length character_set_catalog character_set_name character_set_schema char_length check checkpoint class class_origin clob close cluster coalesce cobol collate collation collation_catalog collation_name collation_schema collect column columns column_name command_function command_function_code comment comments commit committed concurrently condition condition_number configuration conflict connect connection connection_name constraint constraints constraint_catalog constraint_name constraint_schema constructor contains content continue control conversion convert copy corr corresponding cost covar_pop covar_samp cross csv cube cume_dist current current_catalog current_date current_default_transform_group current_path current_role current_row current_schema current_time current_timestamp current_transform_group_for_type current_user cursor cursor_name cycle data database datalink datetime_interval_code datetime_interval_precision day db deallocate dec declare default defaults deferrable deferred defined definer degree delimiter delimiters dense_rank depth deref derived describe descriptor deterministic diagnostics dictionary disable discard disconnect dispatch dlnewcopy dlpreviouscopy dlurlcomplete dlurlcompleteonly dlurlcompletewrite dlurlpath dlurlpathonly dlurlpathwrite dlurlscheme dlurlserver dlvalue do document domain dynamic dynamic_function dynamic_function_code each element else empty enable encoding encrypted end end-exec end_frame end_partition enforced enum equals escape event every except exception exclude excluding exclusive exec execute exists exp explain expression extension external extract false family fetch file filter final first first_value flag float floor following for force foreign fortran forward found frame_row free freeze fs full function functions fusion g general generated get global go goto grant granted greatest grouping groups handler header hex hierarchy hold hour id identity if ignore ilike immediate immediately immutable implementation implicit import including increment indent index indexes indicator inherit inherits initially inline inner inout input insensitive instance instantiable instead integrity intersect intersection invoker isnull isolation k key key_member key_type label lag language large last last_value lateral lead leading leakproof least left length level library like_regex link listen ln load local localtime localtimestamp location locator lock locked logged lower m map mapping match matched materialized max maxvalue max_cardinality member merge message_length message_octet_length message_text method min minute minvalue mod mode modifies module month more move multiset mumps name names namespace national natural nchar nclob nesting new next nfc nfd nfkc nfkd nil no none normalize normalized nothing notify notnull nowait nth_value ntile null nullable nullif nulls number object occurrences_regex octets octet_length of off offset oids old only open operator option options ordering ordinality others out outer output over overlaps overlay overriding owned owner p pad parameter parameter_mode parameter_name parameter_ordinal_position parameter_specific_catalog parameter_specific_name parameter_specific_schema parser partial partition pascal passing passthrough password percent percentile_cont percentile_disc percent_rank period permission placing plans pli policy portion position position_regex power precedes preceding prepare prepared preserve primary prior privileges procedural procedure program public quote range rank read reads reassign recheck recovery recursive ref references referencing refresh regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy regr_syy reindex relative release rename repeatable replace replica requiring reset respect restart restore restrict result return returned_cardinality returned_length returned_octet_length returned_sqlstate returning returns revoke right role rollback rollup routine routine_catalog routine_name routine_schema row rows row_count row_number rule savepoint scale schema schema_name scope scope_catalog scope_name scope_schema scroll search second section security selective self sensitive sequence sequences serializable server server_name session session_user setof sets share show similar simple size skip snapshot some source space specific specifictype specific_name sql sqlcode sqlerror sqlexception sqlstate sqlwarning sqrt stable standalone start state statement static statistics stddev_pop stddev_samp stdin stdout storage strict strip structure style subclass_origin submultiset substring substring_regex succeeds sum symmetric sysid system system_time system_user t tables tablesample tablespace table_name temp template temporary then ties timezone_hour timezone_minute to token top_level_count trailing transaction transactions_committed transactions_rolled_back transaction_active transform transforms translate translate_regex translation treat trigger trigger_catalog trigger_name trigger_schema trim trim_array true truncate trusted type types uescape unbounded uncommitted under unencrypted unique unknown unlink unlisten unlogged unnamed unnest until untyped upper uri usage user user_defined_type_catalog user_defined_type_code user_defined_type_name user_defined_type_schema using vacuum valid validate validator value value_of varbinary variadic var_pop var_samp verbose version versioning view views volatile when whenever whitespace width_bucket window within work wrapper write xmlagg xmlattributes xmlbinary xmlcast xmlcomment xmlconcat xmldeclaration xmldocument xmlelement xmlexists xmlforest xmliterate xmlnamespaces xmlparse xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltext xmlvalidate year yes loop repeat"),builtin:i("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float8 inet integer int int4 interval json jsonb line lseg macaddr money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),atoms:i("false true null unknown"),operatorChars:/^[*+\-%<>!=&|^\/#@?~]/,dateSQL:i("date time timestamp"),support:i("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast")}),e.defineMIME("text/x-gql",{name:"sql",keywords:i("ancestor and asc by contains desc descendant distinct from group has in is limit offset on order select superset where"),atoms:i("false true"),builtin:i("blob datetime first key __key__ string integer double boolean null"),operatorChars:/^[*+\-%<>!=]/})}()}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("coffeescript",function(e,t){function n(e){return new RegExp("^(("+e.join(")|(")+"))\\b")}function r(e,t){if(e.sol()){null===t.scope.align&&(t.scope.align=!1);var n=t.scope.offset;if(e.eatSpace()){var r=e.indentation();return r>n&&"coffee"==t.scope.type?"indent":r0&&s(e,t)}if(e.eatSpace())return null;var a=e.peek();if(e.match("####"))return e.skipToEnd(),"comment";if(e.match("###"))return t.tokenize=o,t.tokenize(e,t);if("#"===a)return e.skipToEnd(),"comment";if(e.match(/^-?[0-9\.]/,!1)){var l=!1;if(e.match(/^-?\d*\.\d+(e[\+\-]?\d+)?/i)&&(l=!0),e.match(/^-?\d+\.\d*/)&&(l=!0),e.match(/^-?\.\d+/)&&(l=!0),l)return"."==e.peek()&&e.backUp(1),"number";var m=!1;if(e.match(/^-?0x[0-9a-f]+/i)&&(m=!0),e.match(/^-?[1-9]\d*(e[\+\-]?\d+)?/)&&(m=!0),e.match(/^-?0(?![\dx])/i)&&(m=!0),m)return"number"}if(e.match(y))return t.tokenize=i(e.current(),!1,"string"),t.tokenize(e,t);if(e.match(b)){if("/"!=e.current()||e.match(/^.*\//,!1))return t.tokenize=i(e.current(),!0,"string-2"),t.tokenize(e,t);e.backUp(1)}return e.match(u)||e.match(h)?"operator":e.match(f)?"punctuation":e.match(x)?"atom":e.match(p)||t.prop&&e.match(d)?"property":e.match(v)?"keyword":e.match(d)?"variable":(e.next(),c)}function i(e,n,i){return function(o,a){for(;!o.eol();)if(o.eatWhile(/[^'"\/\\]/),o.eat("\\")){if(o.next(),n&&o.eol())return i}else{if(o.match(e))return a.tokenize=r,i;o.eat(/['"\/]/)}return n&&(t.singleLineStringErrors?i=c:a.tokenize=r),i}}function o(e,t){for(;!e.eol();){if(e.eatWhile(/[^#]/),e.match("###")){t.tokenize=r;break}e.eatWhile("#")}return"comment"}function a(t,n,r){r=r||"coffee";for(var i=0,o=!1,a=null,s=n.scope;s;s=s.prev)if("coffee"===s.type||"}"==s.type){i=s.offset+e.indentUnit;break}"coffee"!==r?(o=null,a=t.column()+t.current().length):n.scope.align&&(n.scope.align=!1),n.scope={offset:i,type:r,prev:n.scope,align:o,alignOffset:a}}function s(e,t){if(t.scope.prev){if("coffee"===t.scope.type){for(var n=e.indentation(),r=!1,i=t.scope;i;i=i.prev)if(n===i.offset){r=!0;break}if(!r)return!0;for(;t.scope.prev&&t.scope.offset!==n;)t.scope=t.scope.prev;return!1}return t.scope=t.scope.prev,!1}}function l(e,t){var n=t.tokenize(e,t),r=e.current();"return"===r&&(t.dedent=!0),(("->"===r||"=>"===r)&&e.eol()||"indent"===n)&&a(e,t);var i="[({".indexOf(r);if(i!==-1&&a(e,t,"])}".slice(i,i+1)),m.exec(r)&&a(e,t),"then"==r&&s(e,t),"dedent"===n&&s(e,t))return c;if(i="])}".indexOf(r),i!==-1){for(;"coffee"==t.scope.type&&t.scope.prev;)t.scope=t.scope.prev;t.scope.type==r&&(t.scope=t.scope.prev)}return t.dedent&&e.eol()&&("coffee"==t.scope.type&&t.scope.prev&&(t.scope=t.scope.prev),t.dedent=!1),n}var c="error",u=/^(?:->|=>|\+[+=]?|-[\-=]?|\*[\*=]?|\/[\/=]?|[=!]=|<[><]?=?|>>?=?|%=?|&=?|\|=?|\^=?|\~|!|\?|(or|and|\|\||&&|\?)=)/,f=/^(?:[()\[\]{},:`=;]|\.\.?\.?)/,d=/^[_A-Za-z$][_A-Za-z$0-9]*/,p=/^@[_A-Za-z$][_A-Za-z$0-9]*/,h=n(["and","or","not","is","isnt","in","instanceof","typeof"]),m=["for","while","loop","if","unless","else","switch","try","catch","finally","class"],g=["break","by","continue","debugger","delete","do","in","of","new","return","then","this","@","throw","when","until","extends"],v=n(m.concat(g));m=n(m);var y=/^('{3}|\"{3}|['\"])/,b=/^(\/{3}|\/)/,k=["Infinity","NaN","undefined","null","true","false","on","off","yes","no"],x=n(k),w={startState:function(e){return{tokenize:r,scope:{offset:e||0,type:"coffee",prev:null,align:!1},prop:!1,dedent:0}},token:function(e,t){var n=null===t.scope.align&&t.scope;n&&e.sol()&&(n.align=!1);var r=l(e,t);return r&&"comment"!=r&&(n&&(n.align=!0),t.prop="punctuation"==r&&"."==e.current()),r},indent:function(e,t){if(e.tokenize!=r)return 0;var n=e.scope,i=t&&"])}".indexOf(t.charAt(0))>-1;if(i)for(;"coffee"==n.type&&n.prev;)n=n.prev;var o=i&&n.type===t.charAt(0);return n.align?n.alignOffset-(o?1:0):(o?n.prev:n).offset},lineComment:"#",fold:"indent"};return w}),e.defineMIME("text/x-coffeescript","coffeescript"),e.defineMIME("text/coffeescript","coffeescript")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("yaml",function(){var e=["true","false","on","off","yes","no"],t=new RegExp("\\b(("+e.join(")|(")+"))$","i");return{token:function(e,n){var r=e.peek(),i=n.escaped;if(n.escaped=!1,"#"==r&&(0==e.pos||/\s/.test(e.string.charAt(e.pos-1))))return e.skipToEnd(),"comment";if(e.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(n.literal&&e.indentation()>n.keyCol)return e.skipToEnd(),"string";if(n.literal&&(n.literal=!1),e.sol()){if(n.keyCol=0,n.pair=!1,n.pairStart=!1,e.match(/---/))return"def";if(e.match(/\.\.\./))return"def";if(e.match(/\s*-\s+/))return"meta"}if(e.match(/^(\{|\}|\[|\])/))return"{"==r?n.inlinePairs++:"}"==r?n.inlinePairs--:"["==r?n.inlineList++:n.inlineList--,"meta";if(n.inlineList>0&&!i&&","==r)return e.next(),"meta";if(n.inlinePairs>0&&!i&&","==r)return n.keyCol=0,n.pair=!1,n.pairStart=!1,e.next(),"meta";if(n.pairStart){if(e.match(/^\s*(\||\>)\s*/))return n.literal=!0,"meta";if(e.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable-2";if(0==n.inlinePairs&&e.match(/^\s*-?[0-9\.\,]+\s?$/))return"number";if(n.inlinePairs>0&&e.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(e.match(t))return"keyword"}return!n.pair&&e.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(n.pair=!0,n.keyCol=e.indentation(),"atom"):n.pair&&e.match(/^:\s*/)?(n.pairStart=!0,"meta"):(n.pairStart=!1,n.escaped="\\"==r,e.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}}}}),e.defineMIME("text/x-yaml","yaml")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../javascript/javascript"),require("../css/css"),require("../htmlmixed/htmlmixed")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../javascript/javascript","../css/css","../htmlmixed/htmlmixed"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("pug",function(t){function n(){this.javaScriptLine=!1,this.javaScriptLineExcludesColon=!1,this.javaScriptArguments=!1,this.javaScriptArgumentsDepth=0,this.isInterpolating=!1,this.interpolationNesting=0,this.jsState=e.startState(Y),this.restOfLine="",this.isIncludeFiltered=!1,this.isEach=!1,this.lastTag="",this.scriptType="",this.isAttrs=!1,this.attrsNest=[],this.inAttributeName=!0,this.attributeIsType=!1,this.attrValue="",this.indentOf=1/0,this.indentToken="",this.innerMode=null,this.innerState=null,this.innerModeForLine=!1}function r(e,t){if(e.sol()&&(t.javaScriptLine=!1,t.javaScriptLineExcludesColon=!1),t.javaScriptLine){if(t.javaScriptLineExcludesColon&&":"===e.peek())return t.javaScriptLine=!1,void(t.javaScriptLineExcludesColon=!1);var n=Y.token(e,t.jsState);return e.eol()&&(t.javaScriptLine=!1),n||!0}}function i(e,t){if(t.javaScriptArguments){if(0===t.javaScriptArgumentsDepth&&"("!==e.peek())return void(t.javaScriptArguments=!1);if("("===e.peek()?t.javaScriptArgumentsDepth++:")"===e.peek()&&t.javaScriptArgumentsDepth--,0===t.javaScriptArgumentsDepth)return void(t.javaScriptArguments=!1);var n=Y.token(e,t.jsState);return n||!0}}function o(e){if(e.match(/^yield\b/))return"keyword"}function a(e){if(e.match(/^(?:doctype) *([^\n]+)?/))return V}function s(e,t){if(e.match("#{"))return t.isInterpolating=!0,t.interpolationNesting=0,"punctuation"}function l(e,t){if(t.isInterpolating){if("}"===e.peek()){if(t.interpolationNesting--,t.interpolationNesting<0)return e.next(),t.isInterpolating=!1,"punctuation"}else"{"===e.peek()&&t.interpolationNesting++;return Y.token(e,t.jsState)||!0}}function c(e,t){if(e.match(/^case\b/))return t.javaScriptLine=!0,K}function u(e,t){if(e.match(/^when\b/))return t.javaScriptLine=!0,t.javaScriptLineExcludesColon=!0,K}function f(e){if(e.match(/^default\b/))return K}function d(e,t){if(e.match(/^extends?\b/))return t.restOfLine="string",K}function p(e,t){if(e.match(/^append\b/))return t.restOfLine="variable",K}function h(e,t){if(e.match(/^prepend\b/))return t.restOfLine="variable",K}function m(e,t){if(e.match(/^block\b *(?:(prepend|append)\b)?/))return t.restOfLine="variable",K}function g(e,t){if(e.match(/^include\b/))return t.restOfLine="string",K}function v(e,t){if(e.match(/^include:([a-zA-Z0-9\-]+)/,!1)&&e.match("include"))return t.isIncludeFiltered=!0,K}function y(e,t){if(t.isIncludeFiltered){var n=L(e,t);return t.isIncludeFiltered=!1,t.restOfLine="string",n}}function b(e,t){if(e.match(/^mixin\b/))return t.javaScriptLine=!0,K}function k(e,t){return e.match(/^\+([-\w]+)/)?(e.match(/^\( *[-\w]+ *=/,!1)||(t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0),"variable"):e.match(/^\+#{/,!1)?(e.next(),t.mixinCallAfter=!0,s(e,t)):void 0}function x(e,t){if(t.mixinCallAfter)return t.mixinCallAfter=!1,e.match(/^\( *[-\w]+ *=/,!1)||(t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0),!0}function w(e,t){if(e.match(/^(if|unless|else if|else)\b/))return t.javaScriptLine=!0,K}function _(e,t){if(e.match(/^(- *)?(each|for)\b/))return t.isEach=!0,K}function C(e,t){if(t.isEach){if(e.match(/^ in\b/))return t.javaScriptLine=!0,t.isEach=!1,K;if(e.sol()||e.eol())t.isEach=!1;else if(e.next()){for(;!e.match(/^ in\b/,!1)&&e.next(););return"variable"}}}function S(e,t){if(e.match(/^while\b/))return t.javaScriptLine=!0,K}function M(e,t){var n;if(n=e.match(/^(\w(?:[-:\w]*\w)?)\/?/))return t.lastTag=n[1].toLowerCase(),"script"===t.lastTag&&(t.scriptType="application/javascript"),"tag"}function L(n,r){if(n.match(/^:([\w\-]+)/)){var i;return t&&t.innerModes&&(i=t.innerModes(n.current().substring(1))),i||(i=n.current().substring(1)),"string"==typeof i&&(i=e.getMode(t,i)),W(n,r,i),"atom"}}function T(e,t){if(e.match(/^(!?=|-)/))return t.javaScriptLine=!0,"punctuation"}function A(e){if(e.match(/^#([\w-]+)/))return G}function E(e){if(e.match(/^\.([\w-]+)/))return X}function z(e,t){if("("==e.peek())return e.next(),t.isAttrs=!0,t.attrsNest=[],t.inAttributeName=!0,t.attrValue="",t.attributeIsType=!1,"punctuation"}function O(t,n){if(n.isAttrs){if(Z[t.peek()]&&n.attrsNest.push(Z[t.peek()]),n.attrsNest[n.attrsNest.length-1]===t.peek())n.attrsNest.pop();else if(t.eat(")"))return n.isAttrs=!1,"punctuation";if(n.inAttributeName&&t.match(/^[^=,\)!]+/))return"="!==t.peek()&&"!"!==t.peek()||(n.inAttributeName=!1,n.jsState=e.startState(Y),"script"===n.lastTag&&"type"===t.current().trim().toLowerCase()?n.attributeIsType=!0:n.attributeIsType=!1),"attribute";var r=Y.token(t,n.jsState);if(n.attributeIsType&&"string"===r&&(n.scriptType=t.current().toString()),0===n.attrsNest.length&&("string"===r||"variable"===r||"keyword"===r))try{return Function("","var x "+n.attrValue.replace(/,\s*$/,"").replace(/^!/,"")),n.inAttributeName=!0,n.attrValue="",t.backUp(t.current().length),O(t,n)}catch(i){}return n.attrValue+=t.current(),r||!0}}function I(e,t){if(e.match(/^&attributes\b/))return t.javaScriptArguments=!0,t.javaScriptArgumentsDepth=0,"keyword"}function N(e){if(e.sol()&&e.eatSpace())return"indent"}function q(e,t){if(e.match(/^ *\/\/(-)?([^\n]*)/))return t.indentOf=e.indentation(),t.indentToken="comment","comment"}function P(e){if(e.match(/^: */))return"colon"}function R(e,t){return e.match(/^(?:\| ?| )([^\n]+)/)?"string":e.match(/^(<[^\n]*)/,!1)?(W(e,t,"htmlmixed"),t.innerModeForLine=!0,B(e,t,!0)):void 0}function j(e,t){if(e.eat(".")){var n=null;return"script"===t.lastTag&&t.scriptType.toLowerCase().indexOf("javascript")!=-1?n=t.scriptType.toLowerCase().replace(/"|'/g,""):"style"===t.lastTag&&(n="css"),W(e,t,n),"dot"}}function D(e){return e.next(),null}function W(n,r,i){i=e.mimeModes[i]||i,i=t.innerModes?t.innerModes(i)||i:i,i=e.mimeModes[i]||i,i=e.getMode(t,i),r.indentOf=n.indentation(),i&&"null"!==i.name?r.innerMode=i:r.indentToken="string"}function B(t,n,r){return t.indentation()>n.indentOf||n.innerModeForLine&&!t.sol()||r?n.innerMode?(n.innerState||(n.innerState=n.innerMode.startState?e.startState(n.innerMode,t.indentation()):{}),t.hideFirstChars(n.indentOf+2,function(){return n.innerMode.token(t,n.innerState)||!0})):(t.skipToEnd(),n.indentToken):void(t.sol()&&(n.indentOf=1/0,n.indentToken=null,n.innerMode=null,n.innerState=null))}function F(e,t){if(e.sol()&&(t.restOfLine=""),t.restOfLine){e.skipToEnd();var n=t.restOfLine;return t.restOfLine="",n}}function H(){return new n}function $(e){return e.copy()}function U(e,t){var n=B(e,t)||F(e,t)||l(e,t)||y(e,t)||C(e,t)||O(e,t)||r(e,t)||i(e,t)||x(e,t)||o(e,t)||a(e,t)||s(e,t)||c(e,t)||u(e,t)||f(e,t)||d(e,t)||p(e,t)||h(e,t)||m(e,t)||g(e,t)||v(e,t)||b(e,t)||k(e,t)||w(e,t)||_(e,t)||S(e,t)||M(e,t)||L(e,t)||T(e,t)||A(e,t)||E(e,t)||z(e,t)||I(e,t)||N(e,t)||R(e,t)||q(e,t)||P(e,t)||j(e,t)||D(e,t);return n===!0?null:n}var K="keyword",V="meta",G="builtin",X="qualifier",Z={"{":"}","(":")","[":"]"},Y=e.getMode(t,"javascript");return n.prototype.copy=function(){var t=new n;return t.javaScriptLine=this.javaScriptLine,t.javaScriptLineExcludesColon=this.javaScriptLineExcludesColon,t.javaScriptArguments=this.javaScriptArguments,t.javaScriptArgumentsDepth=this.javaScriptArgumentsDepth,t.isInterpolating=this.isInterpolating,t.interpolationNesting=this.interpolationNesting,t.jsState=e.copyState(Y,this.jsState),t.innerMode=this.innerMode,this.innerMode&&this.innerState&&(t.innerState=e.copyState(this.innerMode,this.innerState)),t.restOfLine=this.restOfLine,t.isIncludeFiltered=this.isIncludeFiltered,t.isEach=this.isEach,t.lastTag=this.lastTag,t.scriptType=this.scriptType,t.isAttrs=this.isAttrs,t.attrsNest=this.attrsNest.slice(),t.inAttributeName=this.inAttributeName,t.attributeIsType=this.attributeIsType,t.attrValue=this.attrValue,t.indentOf=this.indentOf,t.indentToken=this.indentToken,t.innerModeForLine=this.innerModeForLine,t},{startState:H,copyState:$,token:U}},"javascript","css","htmlmixed"),e.defineMIME("text/x-pug","pug"),e.defineMIME("text/x-jade","pug")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("lua",function(e,t){function n(e){return new RegExp("^(?:"+e.join("|")+")","i")}function r(e){return new RegExp("^(?:"+e.join("|")+")$","i")}function i(e){for(var t=0;e.eat("=");)++t;return e.eat("["),t}function o(e,t){var n=e.next();return"-"==n&&e.eat("-")?e.eat("[")&&e.eat("[")?(t.cur=a(i(e),"comment"))(e,t):(e.skipToEnd(),"comment"):'"'==n||"'"==n?(t.cur=s(n))(e,t):"["==n&&/[\[=]/.test(e.peek())?(t.cur=a(i(e),"string"))(e,t):/\d/.test(n)?(e.eatWhile(/[\w.%]/),"number"):/[\w_]/.test(n)?(e.eatWhile(/[\w\\\-_.]/),"variable"):null}function a(e,t){return function(n,r){for(var i,a=null;null!=(i=n.next());)if(null==a)"]"==i&&(a=0);else if("="==i)++a;else{if("]"==i&&a==e){r.cur=o;break}a=null}return t}}function s(e){return function(t,n){for(var r,i=!1;null!=(r=t.next())&&(r!=e||i);)i=!i&&"\\"==r;return i||(n.cur=o),"string"}}var l=e.indentUnit,c=r(t.specials||[]),u=r(["_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load","loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require","select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall","coroutine.create","coroutine.resume","coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield","debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable","debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable","debug.setupvalue","debug.traceback","close","flush","lines","read","seek","setvbuf","write","io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin","io.stdout","io.tmpfile","io.type","io.write","math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg","math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max","math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh","math.sqrt","math.tan","math.tanh","os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale","os.time","os.tmpname","package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload","package.seeall","string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub","string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper","table.concat","table.insert","table.maxn","table.remove","table.sort"]),f=r(["and","break","elseif","false","nil","not","or","return","true","function","end","if","then","else","do","while","repeat","until","for","in","local"]),d=r(["function","if","repeat","do","\\(","{"]),p=r(["end","until","\\)","}"]),h=n(["end","until","\\)","}","else","elseif"]);return{startState:function(e){return{basecol:e||0,indentDepth:0,cur:o}},token:function(e,t){if(e.eatSpace())return null;var n=t.cur(e,t),r=e.current();return"variable"==n&&(f.test(r)?n="keyword":u.test(r)?n="builtin":c.test(r)&&(n="variable-2")),"comment"!=n&&"string"!=n&&(d.test(r)?++t.indentDepth:p.test(r)&&--t.indentDepth),n},indent:function(e,t){var n=h.test(t);return e.basecol+l*(e.indentDepth-(n?1:0))},lineComment:"--",blockCommentStart:"--[[",blockCommentEnd:"]]"}}),e.defineMIME("text/x-lua","lua")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("cmake",function(){function e(e,t){for(var n,r,i=!1;!e.eol()&&(n=e.next())!=t.pending;){if("$"===n&&"\\"!=r&&'"'==t.pending){i=!0;break}r=n}return i&&e.backUp(1),n==t.pending?t.continueString=!1:t.continueString=!0,"string"}function t(t,r){ +var i=t.next();return"$"===i?t.match(n)?"variable-2":"variable":r.continueString?(t.backUp(1),e(t,r)):t.match(/(\s+)?\w+\(/)||t.match(/(\s+)?\w+\ \(/)?(t.backUp(1),"def"):"#"==i?(t.skipToEnd(),"comment"):"'"==i||'"'==i?(r.pending=i,e(t,r)):"("==i||")"==i?"bracket":i.match(/[0-9]/)?"number":(t.eatWhile(/[\w-]/),null)}var n=/({)?[a-zA-Z0-9_]+(})?/;return{startState:function(){var e={};return e.inDefinition=!1,e.inInclude=!1,e.continueString=!1,e.pending=!1,e},token:function(e,n){return e.eatSpace()?null:t(e,n)}}}),e.defineMIME("text/x-cmake","cmake")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("nginx",function(e){function t(e){for(var t={},n=e.split(" "),r=0;r*\/]/.test(s)?n(null,"select-op"):/[;{}:\[\]]/.test(s)?n(null,s):(e.eatWhile(/[\w\\\-]/),n("variable","variable")):n(null,"compare"):void n(null,"compare")}function i(e,t){for(var i,o=!1;null!=(i=e.next());){if(o&&"/"==i){t.tokenize=r;break}o="*"==i}return n("comment","comment")}function o(e,t){for(var i,o=0;null!=(i=e.next());){if(o>=2&&">"==i){t.tokenize=r;break}o="-"==i?o+1:0}return n("comment","comment")}function a(e){return function(t,i){for(var o,a=!1;null!=(o=t.next())&&(o!=e||a);)a=!a&&"\\"==o;return a||(i.tokenize=r),n("string","string")}}var s,l=t("break return rewrite set accept_mutex accept_mutex_delay access_log add_after_body add_before_body add_header addition_types aio alias allow ancient_browser ancient_browser_value auth_basic auth_basic_user_file auth_http auth_http_header auth_http_timeout autoindex autoindex_exact_size autoindex_localtime charset charset_types client_body_buffer_size client_body_in_file_only client_body_in_single_buffer client_body_temp_path client_body_timeout client_header_buffer_size client_header_timeout client_max_body_size connection_pool_size create_full_put_path daemon dav_access dav_methods debug_connection debug_points default_type degradation degrade deny devpoll_changes devpoll_events directio directio_alignment empty_gif env epoll_events error_log eventport_events expires fastcgi_bind fastcgi_buffer_size fastcgi_buffers fastcgi_busy_buffers_size fastcgi_cache fastcgi_cache_key fastcgi_cache_methods fastcgi_cache_min_uses fastcgi_cache_path fastcgi_cache_use_stale fastcgi_cache_valid fastcgi_catch_stderr fastcgi_connect_timeout fastcgi_hide_header fastcgi_ignore_client_abort fastcgi_ignore_headers fastcgi_index fastcgi_intercept_errors fastcgi_max_temp_file_size fastcgi_next_upstream fastcgi_param fastcgi_pass_header fastcgi_pass_request_body fastcgi_pass_request_headers fastcgi_read_timeout fastcgi_send_lowat fastcgi_send_timeout fastcgi_split_path_info fastcgi_store fastcgi_store_access fastcgi_temp_file_write_size fastcgi_temp_path fastcgi_upstream_fail_timeout fastcgi_upstream_max_fails flv geoip_city geoip_country google_perftools_profiles gzip gzip_buffers gzip_comp_level gzip_disable gzip_hash gzip_http_version gzip_min_length gzip_no_buffer gzip_proxied gzip_static gzip_types gzip_vary gzip_window if_modified_since ignore_invalid_headers image_filter image_filter_buffer image_filter_jpeg_quality image_filter_transparency imap_auth imap_capabilities imap_client_buffer index ip_hash keepalive_requests keepalive_timeout kqueue_changes kqueue_events large_client_header_buffers limit_conn limit_conn_log_level limit_rate limit_rate_after limit_req limit_req_log_level limit_req_zone limit_zone lingering_time lingering_timeout lock_file log_format log_not_found log_subrequest map_hash_bucket_size map_hash_max_size master_process memcached_bind memcached_buffer_size memcached_connect_timeout memcached_next_upstream memcached_read_timeout memcached_send_timeout memcached_upstream_fail_timeout memcached_upstream_max_fails merge_slashes min_delete_depth modern_browser modern_browser_value msie_padding msie_refresh multi_accept open_file_cache open_file_cache_errors open_file_cache_events open_file_cache_min_uses open_file_cache_valid open_log_file_cache output_buffers override_charset perl perl_modules perl_require perl_set pid pop3_auth pop3_capabilities port_in_redirect postpone_gzipping postpone_output protocol proxy proxy_bind proxy_buffer proxy_buffer_size proxy_buffering proxy_buffers proxy_busy_buffers_size proxy_cache proxy_cache_key proxy_cache_methods proxy_cache_min_uses proxy_cache_path proxy_cache_use_stale proxy_cache_valid proxy_connect_timeout proxy_headers_hash_bucket_size proxy_headers_hash_max_size proxy_hide_header proxy_ignore_client_abort proxy_ignore_headers proxy_intercept_errors proxy_max_temp_file_size proxy_method proxy_next_upstream proxy_pass_error_message proxy_pass_header proxy_pass_request_body proxy_pass_request_headers proxy_read_timeout proxy_redirect proxy_send_lowat proxy_send_timeout proxy_set_body proxy_set_header proxy_ssl_session_reuse proxy_store proxy_store_access proxy_temp_file_write_size proxy_temp_path proxy_timeout proxy_upstream_fail_timeout proxy_upstream_max_fails random_index read_ahead real_ip_header recursive_error_pages request_pool_size reset_timedout_connection resolver resolver_timeout rewrite_log rtsig_overflow_events rtsig_overflow_test rtsig_overflow_threshold rtsig_signo satisfy secure_link_secret send_lowat send_timeout sendfile sendfile_max_chunk server_name_in_redirect server_names_hash_bucket_size server_names_hash_max_size server_tokens set_real_ip_from smtp_auth smtp_capabilities smtp_client_buffer smtp_greeting_delay so_keepalive source_charset ssi ssi_ignore_recycled_buffers ssi_min_file_chunk ssi_silent_errors ssi_types ssi_value_length ssl ssl_certificate ssl_certificate_key ssl_ciphers ssl_client_certificate ssl_crl ssl_dhparam ssl_engine ssl_prefer_server_ciphers ssl_protocols ssl_session_cache ssl_session_timeout ssl_verify_client ssl_verify_depth starttls stub_status sub_filter sub_filter_once sub_filter_types tcp_nodelay tcp_nopush thread_stack_size timeout timer_resolution types_hash_bucket_size types_hash_max_size underscores_in_headers uninitialized_variable_warn use user userid userid_domain userid_expires userid_mark userid_name userid_p3p userid_path userid_service valid_referers variables_hash_bucket_size variables_hash_max_size worker_connections worker_cpu_affinity worker_priority worker_processes worker_rlimit_core worker_rlimit_nofile worker_rlimit_sigpending worker_threads working_directory xclient xml_entities xslt_stylesheet xslt_typesdrew@li229-23"),c=t("http mail events server types location upstream charset_map limit_except if geo map"),u=t("include root server server_name listen internal proxy_pass memcached_pass fastcgi_pass try_files"),f=e.indentUnit;return{startState:function(e){return{tokenize:r,baseIndent:e||0,stack:[]}},token:function(e,t){if(e.eatSpace())return null;s=null;var n=t.tokenize(e,t),r=t.stack[t.stack.length-1];return"hash"==s&&"rule"==r?n="atom":"variable"==n&&("rule"==r?n="number":r&&"@media{"!=r||(n="tag")),"rule"==r&&/^[\{\};]$/.test(s)&&t.stack.pop(),"{"==s?"@media"==r?t.stack[t.stack.length-1]="@media{":t.stack.push("{"):"}"==s?t.stack.pop():"@media"==s?t.stack.push("@media"):"{"==r&&"comment"!=s&&t.stack.push("rule"),n},indent:function(e,t){var n=e.stack.length;return/^\}/.test(t)&&(n-="rule"==e.stack[e.stack.length-1]?2:1),e.baseIndent+n*f},electricChars:"}"}}),e.defineMIME("text/x-nginx-conf","nginx")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){return e.string.charAt(e.pos+(t||0))}function n(e,t){if(t){var n=e.pos-t;return e.string.substr(n>=0?n:0,t)}return e.string.substr(0,e.pos-1)}function r(e,t){var n=e.string.length,r=n-e.pos+1;return e.string.substr(e.pos,t&&t=(n=e.string.length-1)?e.pos=n:e.pos=r}e.defineMode("perl",function(){function e(e,t,n,r,i){return t.chain=null,t.style=null,t.tail=null,t.tokenize=function(e,t){for(var o,s=!1,l=0;o=e.next();){if(o===n[l]&&!s)return void 0!==n[++l]?(t.chain=n[l],t.style=r,t.tail=i):i&&e.eatWhile(i),t.tokenize=a,r;s=!s&&"\\"==o}return r},t.tokenize(e,t)}function o(e,t,n){return t.tokenize=function(e,t){return e.string==n&&(t.tokenize=a),e.skipToEnd(),"string"},t.tokenize(e,t)}function a(a,u){if(a.eatSpace())return null;if(u.chain)return e(a,u,u.chain,u.style,u.tail);if(a.match(/^\-?[\d\.]/,!1)&&a.match(/^(\-?(\d*\.\d+(e[+-]?\d+)?|\d+\.\d*)|0x[\da-fA-F]+|0b[01]+|\d+(e[+-]?\d+)?)/))return"number";if(a.match(/^<<(?=\w)/))return a.eatWhile(/\w/),o(a,u,a.current().substr(2));if(a.sol()&&a.match(/^\=item(?!\w)/))return o(a,u,"=cut");var f=a.next();if('"'==f||"'"==f){if(n(a,3)=="<<"+f){var d=a.pos;a.eatWhile(/\w/);var p=a.current().substr(1);if(p&&a.eat(f))return o(a,u,p);a.pos=d}return e(a,u,[f],"string")}if("q"==f){var h=t(a,-2);if(!h||!/\w/.test(h))if(h=t(a,0),"x"==h){if(h=t(a,1),"("==h)return i(a,2),e(a,u,[")"],l,c);if("["==h)return i(a,2),e(a,u,["]"],l,c);if("{"==h)return i(a,2),e(a,u,["}"],l,c);if("<"==h)return i(a,2),e(a,u,[">"],l,c);if(/[\^'"!~\/]/.test(h))return i(a,1),e(a,u,[a.eat(h)],l,c)}else if("q"==h){if(h=t(a,1),"("==h)return i(a,2),e(a,u,[")"],"string");if("["==h)return i(a,2),e(a,u,["]"],"string");if("{"==h)return i(a,2),e(a,u,["}"],"string");if("<"==h)return i(a,2),e(a,u,[">"],"string");if(/[\^'"!~\/]/.test(h))return i(a,1),e(a,u,[a.eat(h)],"string")}else if("w"==h){if(h=t(a,1),"("==h)return i(a,2),e(a,u,[")"],"bracket");if("["==h)return i(a,2),e(a,u,["]"],"bracket");if("{"==h)return i(a,2),e(a,u,["}"],"bracket");if("<"==h)return i(a,2),e(a,u,[">"],"bracket");if(/[\^'"!~\/]/.test(h))return i(a,1),e(a,u,[a.eat(h)],"bracket")}else if("r"==h){if(h=t(a,1),"("==h)return i(a,2),e(a,u,[")"],l,c);if("["==h)return i(a,2),e(a,u,["]"],l,c);if("{"==h)return i(a,2),e(a,u,["}"],l,c);if("<"==h)return i(a,2),e(a,u,[">"],l,c);if(/[\^'"!~\/]/.test(h))return i(a,1),e(a,u,[a.eat(h)],l,c)}else if(/[\^'"!~\/(\[{<]/.test(h)){if("("==h)return i(a,1),e(a,u,[")"],"string");if("["==h)return i(a,1),e(a,u,["]"],"string");if("{"==h)return i(a,1),e(a,u,["}"],"string");if("<"==h)return i(a,1),e(a,u,[">"],"string");if(/[\^'"!~\/]/.test(h))return e(a,u,[a.eat(h)],"string")}}if("m"==f){var h=t(a,-2);if((!h||!/\w/.test(h))&&(h=a.eat(/[(\[{<\^'"!~\/]/))){if(/[\^'"!~\/]/.test(h))return e(a,u,[h],l,c);if("("==h)return e(a,u,[")"],l,c);if("["==h)return e(a,u,["]"],l,c);if("{"==h)return e(a,u,["}"],l,c);if("<"==h)return e(a,u,[">"],l,c)}}if("s"==f){var h=/[\/>\]})\w]/.test(t(a,-2));if(!h&&(h=a.eat(/[(\[{<\^'"!~\/]/)))return"["==h?e(a,u,["]","]"],l,c):"{"==h?e(a,u,["}","}"],l,c):"<"==h?e(a,u,[">",">"],l,c):"("==h?e(a,u,[")",")"],l,c):e(a,u,[h,h],l,c)}if("y"==f){var h=/[\/>\]})\w]/.test(t(a,-2));if(!h&&(h=a.eat(/[(\[{<\^'"!~\/]/)))return"["==h?e(a,u,["]","]"],l,c):"{"==h?e(a,u,["}","}"],l,c):"<"==h?e(a,u,[">",">"],l,c):"("==h?e(a,u,[")",")"],l,c):e(a,u,[h,h],l,c)}if("t"==f){var h=/[\/>\]})\w]/.test(t(a,-2));if(!h&&(h=a.eat("r"),h&&(h=a.eat(/[(\[{<\^'"!~\/]/))))return"["==h?e(a,u,["]","]"],l,c):"{"==h?e(a,u,["}","}"],l,c):"<"==h?e(a,u,[">",">"],l,c):"("==h?e(a,u,[")",")"],l,c):e(a,u,[h,h],l,c)}if("`"==f)return e(a,u,[f],"variable-2");if("/"==f)return/~\s*$/.test(n(a))?e(a,u,[f],l,c):"operator";if("$"==f){var d=a.pos;if(a.eatWhile(/\d/)||a.eat("{")&&a.eatWhile(/\d/)&&a.eat("}"))return"variable-2";a.pos=d}if(/[$@%]/.test(f)){var d=a.pos;if(a.eat("^")&&a.eat(/[A-Z]/)||!/[@$%&]/.test(t(a,-2))&&a.eat(/[=|\\\-#?@;:&`~\^!\[\]*'"$+.,\/<>()]/)){var h=a.current();if(s[h])return"variable-2"}a.pos=d}if(/[$@%&]/.test(f)&&(a.eatWhile(/[\w$\[\]]/)||a.eat("{")&&a.eatWhile(/[\w$\[\]]/)&&a.eat("}"))){var h=a.current();return s[h]?"variable-2":"variable"}if("#"==f&&"$"!=t(a,-2))return a.skipToEnd(),"comment";if(/[:+\-\^*$&%@=<>!?|\/~\.]/.test(f)){var d=a.pos;if(a.eatWhile(/[:+\-\^*$&%@=<>!?|\/~\.]/),s[a.current()])return"operator";a.pos=d}if("_"==f&&1==a.pos){if("_END__"==r(a,6))return e(a,u,["\0"],"comment");if("_DATA__"==r(a,7))return e(a,u,["\0"],"variable-2");if("_C__"==r(a,7))return e(a,u,["\0"],"string")}if(/\w/.test(f)){var d=a.pos;if("{"==t(a,-2)&&("}"==t(a,0)||a.eatWhile(/\w/)&&"}"==t(a,0)))return"string";a.pos=d}if(/[A-Z]/.test(f)){var m=t(a,-2),d=a.pos;if(a.eatWhile(/[A-Z_]/),!/[\da-z]/.test(t(a,0))){var h=s[a.current()];return h?(h[1]&&(h=h[0]),":"!=m?1==h?"keyword":2==h?"def":3==h?"atom":4==h?"operator":5==h?"variable-2":"meta":"meta"):"meta"}a.pos=d}if(/[a-zA-Z_]/.test(f)){var m=t(a,-2);a.eatWhile(/\w/);var h=s[a.current()];return h?(h[1]&&(h=h[0]),":"!=m?1==h?"keyword":2==h?"def":3==h?"atom":4==h?"operator":5==h?"variable-2":"meta":"meta"):"meta"}return null}var s={"->":4,"++":4,"--":4,"**":4,"=~":4,"!~":4,"*":4,"/":4,"%":4,x:4,"+":4,"-":4,".":4,"<<":4,">>":4,"<":4,">":4,"<=":4,">=":4,lt:4,gt:4,le:4,ge:4,"==":4,"!=":4,"<=>":4,eq:4,ne:4,cmp:4,"~~":4,"&":4,"|":4,"^":4,"&&":4,"||":4,"//":4,"..":4,"...":4,"?":4,":":4,"=":4,"+=":4,"-=":4,"*=":4,",":4,"=>":4,"::":4,not:4,and:4,or:4,xor:4,BEGIN:[5,1],END:[5,1],PRINT:[5,1],PRINTF:[5,1],GETC:[5,1],READ:[5,1],READLINE:[5,1],DESTROY:[5,1],TIE:[5,1],TIEHANDLE:[5,1],UNTIE:[5,1],STDIN:5,STDIN_TOP:5,STDOUT:5,STDOUT_TOP:5,STDERR:5,STDERR_TOP:5,$ARG:5,$_:5,"@ARG":5,"@_":5,$LIST_SEPARATOR:5,'$"':5,$PROCESS_ID:5,$PID:5,$$:5,$REAL_GROUP_ID:5,$GID:5,"$(":5,$EFFECTIVE_GROUP_ID:5,$EGID:5,"$)":5,$PROGRAM_NAME:5,$0:5,$SUBSCRIPT_SEPARATOR:5,$SUBSEP:5,"$;":5,$REAL_USER_ID:5,$UID:5,"$<":5,$EFFECTIVE_USER_ID:5,$EUID:5,"$>":5,$a:5,$b:5,$COMPILING:5,"$^C":5,$DEBUGGING:5,"$^D":5,"${^ENCODING}":5,$ENV:5,"%ENV":5,$SYSTEM_FD_MAX:5,"$^F":5,"@F":5,"${^GLOBAL_PHASE}":5,"$^H":5,"%^H":5,"@INC":5,"%INC":5,$INPLACE_EDIT:5,"$^I":5,"$^M":5,$OSNAME:5,"$^O":5,"${^OPEN}":5,$PERLDB:5,"$^P":5,$SIG:5,"%SIG":5,$BASETIME:5,"$^T":5,"${^TAINT}":5,"${^UNICODE}":5,"${^UTF8CACHE}":5,"${^UTF8LOCALE}":5,$PERL_VERSION:5,"$^V":5,"${^WIN32_SLOPPY_STAT}":5,$EXECUTABLE_NAME:5,"$^X":5,$1:5,$MATCH:5,"$&":5,"${^MATCH}":5,$PREMATCH:5,"$`":5,"${^PREMATCH}":5,$POSTMATCH:5,"$'":5,"${^POSTMATCH}":5,$LAST_PAREN_MATCH:5,"$+":5,$LAST_SUBMATCH_RESULT:5,"$^N":5,"@LAST_MATCH_END":5,"@+":5,"%LAST_PAREN_MATCH":5,"%+":5,"@LAST_MATCH_START":5,"@-":5,"%LAST_MATCH_START":5,"%-":5,$LAST_REGEXP_CODE_RESULT:5,"$^R":5,"${^RE_DEBUG_FLAGS}":5,"${^RE_TRIE_MAXBUF}":5,$ARGV:5,"@ARGV":5,ARGV:5,ARGVOUT:5,$OUTPUT_FIELD_SEPARATOR:5,$OFS:5,"$,":5,$INPUT_LINE_NUMBER:5,$NR:5,"$.":5,$INPUT_RECORD_SEPARATOR:5,$RS:5,"$/":5,$OUTPUT_RECORD_SEPARATOR:5,$ORS:5,"$\\":5,$OUTPUT_AUTOFLUSH:5,"$|":5,$ACCUMULATOR:5,"$^A":5,$FORMAT_FORMFEED:5,"$^L":5,$FORMAT_PAGE_NUMBER:5,"$%":5,$FORMAT_LINES_LEFT:5,"$-":5,$FORMAT_LINE_BREAK_CHARACTERS:5,"$:":5,$FORMAT_LINES_PER_PAGE:5,"$=":5,$FORMAT_TOP_NAME:5,"$^":5,$FORMAT_NAME:5,"$~":5,"${^CHILD_ERROR_NATIVE}":5,$EXTENDED_OS_ERROR:5,"$^E":5,$EXCEPTIONS_BEING_CAUGHT:5,"$^S":5,$WARNING:5,"$^W":5,"${^WARNING_BITS}":5,$OS_ERROR:5,$ERRNO:5,"$!":5,"%OS_ERROR":5,"%ERRNO":5,"%!":5,$CHILD_ERROR:5,"$?":5,$EVAL_ERROR:5,"$@":5,$OFMT:5,"$#":5,"$*":5,$ARRAY_BASE:5,"$[":5,$OLD_PERL_VERSION:5,"$]":5,"if":[1,1],elsif:[1,1],"else":[1,1],"while":[1,1],unless:[1,1],"for":[1,1],foreach:[1,1],abs:1,accept:1,alarm:1,atan2:1,bind:1,binmode:1,bless:1,bootstrap:1,"break":1,caller:1,chdir:1,chmod:1,chomp:1,chop:1,chown:1,chr:1,chroot:1,close:1,closedir:1,connect:1,"continue":[1,1],cos:1,crypt:1,dbmclose:1,dbmopen:1,"default":1,defined:1,"delete":1,die:1,"do":1,dump:1,each:1,endgrent:1,endhostent:1,endnetent:1,endprotoent:1,endpwent:1,endservent:1,eof:1,eval:1,exec:1,exists:1,exit:1,exp:1,fcntl:1,fileno:1,flock:1,fork:1,format:1,formline:1,getc:1,getgrent:1,getgrgid:1,getgrnam:1,gethostbyaddr:1,gethostbyname:1,gethostent:1,getlogin:1,getnetbyaddr:1,getnetbyname:1,getnetent:1,getpeername:1,getpgrp:1,getppid:1,getpriority:1,getprotobyname:1,getprotobynumber:1,getprotoent:1,getpwent:1,getpwnam:1,getpwuid:1,getservbyname:1,getservbyport:1,getservent:1,getsockname:1,getsockopt:1,given:1,glob:1,gmtime:1,"goto":1,grep:1,hex:1,"import":1,index:1,"int":1,ioctl:1,join:1,keys:1,kill:1,last:1,lc:1,lcfirst:1,length:1,link:1,listen:1,local:2,localtime:1,lock:1,log:1,lstat:1,m:null,map:1,mkdir:1,msgctl:1,msgget:1,msgrcv:1,msgsnd:1,my:2,"new":1,next:1,no:1,oct:1,open:1,opendir:1,ord:1,our:2,pack:1,"package":1,pipe:1,pop:1,pos:1,print:1,printf:1,prototype:1,push:1,q:null,qq:null,qr:null,quotemeta:null,qw:null,qx:null,rand:1,read:1,readdir:1,readline:1,readlink:1,readpipe:1,recv:1,redo:1,ref:1,rename:1,require:1,reset:1,"return":1,reverse:1,rewinddir:1,rindex:1,rmdir:1,s:null,say:1,scalar:1,seek:1,seekdir:1,select:1,semctl:1,semget:1,semop:1,send:1,setgrent:1,sethostent:1,setnetent:1,setpgrp:1,setpriority:1,setprotoent:1,setpwent:1,setservent:1,setsockopt:1,shift:1,shmctl:1,shmget:1,shmread:1,shmwrite:1,shutdown:1,sin:1,sleep:1,socket:1,socketpair:1,sort:1,splice:1,split:1,sprintf:1,sqrt:1,srand:1,stat:1,state:1,study:1,sub:1,substr:1,symlink:1,syscall:1,sysopen:1,sysread:1,sysseek:1,system:1,syswrite:1,tell:1,telldir:1,tie:1,tied:1,time:1,times:1,tr:null,truncate:1,uc:1,ucfirst:1,umask:1,undef:1,unlink:1,unpack:1,unshift:1,untie:1,use:1,utime:1,values:1,vec:1,wait:1,waitpid:1,wantarray:1,warn:1,when:1,write:1,y:null},l="string-2",c=/[goseximacplud]/;return{startState:function(){return{tokenize:a,chain:null,style:null,tail:null}},token:function(e,t){return(t.tokenize||a)(e,t)},lineComment:"#"}}),e.registerHelper("wordChars","perl",/[\w$]/),e.defineMIME("text/x-perl","perl")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("sass",function(e){function t(e){return new RegExp("^"+e.join("|"))}function n(e,t){var n=e.peek();return")"===n?(e.next(),t.tokenizer=l,"operator"):"("===n?(e.next(),e.eatSpace(),"operator"):"'"===n||'"'===n?(t.tokenizer=i(e.next()),"string"):(t.tokenizer=i(")",!1),"string")}function r(e,t){return function(n,r){return n.sol()&&n.indentation()<=e?(r.tokenizer=l,l(n,r)):(t&&n.skipTo("*/")?(n.next(),n.next(),r.tokenizer=l):n.skipToEnd(),"comment")}}function i(e,t){function n(r,i){var a=r.next(),s=r.peek(),c=r.string.charAt(r.pos-2),u="\\"!==a&&s===e||a===e&&"\\"!==c;return u?(a!==e&&t&&r.next(),i.tokenizer=l,"string"):"#"===a&&"{"===s?(i.tokenizer=o(n),r.next(),"operator"):"string"}return null==t&&(t=!0),n}function o(e){return function(t,n){return"}"===t.peek()?(t.next(),n.tokenizer=e,"operator"):l(t,n)}}function a(t){if(0==t.indentCount){t.indentCount++;var n=t.scopes[0].offset,r=n+e.indentUnit;t.scopes.unshift({offset:r})}}function s(e){1!=e.scopes.length&&e.scopes.shift()}function l(e,t){var c=e.peek();if(e.match("/*"))return t.tokenizer=r(e.indentation(),!0),t.tokenizer(e,t);if(e.match("//"))return t.tokenizer=r(e.indentation(),!1),t.tokenizer(e,t);if(e.match("#{"))return t.tokenizer=o(l),"operator";if('"'===c||"'"===c)return e.next(),t.tokenizer=i(c),"string";if(t.cursorHalf){if("#"===c&&(e.next(),e.match(/[0-9a-fA-F]{6}|[0-9a-fA-F]{3}/)))return e.peek()||(t.cursorHalf=0),"number";if(e.match(/^-?[0-9\.]+/))return e.peek()||(t.cursorHalf=0),"number";if(e.match(/^(px|em|in)\b/))return e.peek()||(t.cursorHalf=0),"unit";if(e.match(f))return e.peek()||(t.cursorHalf=0),"keyword";if(e.match(/^url/)&&"("===e.peek())return t.tokenizer=n,e.peek()||(t.cursorHalf=0),"atom";if("$"===c)return e.next(),e.eatWhile(/[\w-]/),e.peek()||(t.cursorHalf=0),"variable-3";if("!"===c)return e.next(),e.peek()||(t.cursorHalf=0),e.match(/^[\w]+/)?"keyword":"operator";if(e.match(p))return e.peek()||(t.cursorHalf=0),"operator";if(e.eatWhile(/[\w-]/))return e.peek()||(t.cursorHalf=0),"attribute";if(!e.peek())return t.cursorHalf=0,null}else{if("."===c){if(e.next(),e.match(/^[\w-]+/))return a(t),"atom";if("#"===e.peek())return a(t),"atom"}if("#"===c){if(e.next(),e.match(/^[\w-]+/))return a(t),"atom";if("#"===e.peek())return a(t),"atom"}if("$"===c)return e.next(),e.eatWhile(/[\w-]/),"variable-2";if(e.match(/^-?[0-9\.]+/))return"number";if(e.match(/^(px|em|in)\b/))return"unit";if(e.match(f))return"keyword";if(e.match(/^url/)&&"("===e.peek())return t.tokenizer=n,"atom";if("="===c&&e.match(/^=[\w-]+/))return a(t),"meta";if("+"===c&&e.match(/^\+[\w-]+/))return"variable-3";if("@"===c&&e.match(/@extend/)&&(e.match(/\s*[\w]/)||s(t)),e.match(/^@(else if|if|media|else|for|each|while|mixin|function)/))return a(t),"meta";if("@"===c)return e.next(),e.eatWhile(/[\w-]/),"meta";if(e.eatWhile(/[\w-]/))return e.match(/ *: *[\w-\+\$#!\("']/,!1)?"property":e.match(/ *:/,!1)?(a(t),t.cursorHalf=1,"atom"):e.match(/ *,/,!1)?"atom":(a(t),"atom");if(":"===c)return e.match(h)?"keyword":(e.next(),t.cursorHalf=1,"operator")}return e.match(p)?"operator":(e.next(),null)}function c(t,n){t.sol()&&(n.indentCount=0);var r=n.tokenizer(t,n),i=t.current();if("@return"!==i&&"}"!==i||s(n),null!==r){for(var o=t.pos-i.length,a=o+e.indentUnit*n.indentCount,l=[],c=0;c","<","==",">=","<=","\\+","-","\\!=","/","\\*","%","and","or","not",";","\\{","\\}",":"],p=t(d),h=/^::?[a-zA-Z_][\w\-]*/;return{startState:function(){return{tokenizer:l,scopes:[{offset:0,type:"sass"}],indentCount:0,cursorHalf:0,definedVars:[],definedMixins:[]}},token:function(e,t){var n=c(e,t);return t.lastToken={style:n,content:e.current()},n},indent:function(e){return e.scopes[0].offset}}}),e.defineMIME("text/x-sass","sass")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.registerHelper("wordChars","r",/[\w.]/),e.defineMode("r",function(e){function t(e){for(var t=e.split(" "),n={},r=0;r=!&|~$:]/;return{startState:function(){return{tokenize:n,ctx:{type:"top",indent:-e.indentUnit,align:!1},indent:0,afterIdent:!1}},token:function(e,t){if(e.sol()&&(null==t.ctx.align&&(t.ctx.align=!1),t.indent=e.indentation()),e.eatSpace())return null;var n=t.tokenize(e,t);"comment"!=n&&null==t.ctx.align&&(t.ctx.align=!0);var r=t.ctx.type;return";"!=a&&"{"!=a&&"}"!=a||"block"!=r||o(t),"{"==a?i(t,"}",e):"("==a?(i(t,")",e),t.afterIdent&&(t.ctx.argList=!0)):"["==a?i(t,"]",e):"block"==a?i(t,"block",e):a==r&&o(t),t.afterIdent="variable"==n||"keyword"==n,n},indent:function(t,r){if(t.tokenize!=n)return 0;var i=r&&r.charAt(0),o=t.ctx,a=i==o.type;return"block"==o.type?o.indent+("{"==i?0:e.indentUnit):o.align?o.column+(a?0:1):o.indent+(a?0:e.indentUnit)},lineComment:"#"}}),e.defineMIME("text/x-rsrc","r")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror"),require("../../addon/mode/simple")):"function"==typeof define&&define.amd?define(["../../lib/codemirror","../../addon/mode/simple"],e):e(CodeMirror)}(function(e){"use strict";var t=["from","maintainer","run","cmd","expose","env","add","copy","entrypoint","volume","user","workdir","onbuild"],n="("+t.join("|")+")",r=new RegExp(n+"\\s*$","i"),i=new RegExp(n+"(\\s+)","i");e.defineSimpleMode("dockerfile",{start:[{regex:/#.*$/,token:"comment"},{regex:r,token:"variable-2"},{regex:i,token:["variable-2",null],next:"arguments"},{regex:/./,token:null}],arguments:[{regex:/#.*$/,token:"error",next:"start"},{regex:/[^#]+\\$/,token:null},{regex:/[^#]+/,token:null,next:"start"},{regex:/$/,token:null,next:"start"},{token:null,next:"start"}],meta:{lineComment:"#"}}),e.defineMIME("text/x-dockerfile","dockerfile")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../../lib/codemirror")):"function"==typeof define&&define.amd?define(["../../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";e.defineMode("tiddlywiki",function(){function e(e,t,n){return t.tokenize=n,n(e,t)}function t(t,u){var x=t.sol(),w=t.peek();if(u.block=!1,x&&/[<\/\*{}\-]/.test(w)){if(t.match(k))return u.block=!0,e(t,u,i);if(t.match(m))return"quote";if(t.match(p)||t.match(h))return"comment";if(t.match(g)||t.match(v)||t.match(y)||t.match(b))return"comment";if(t.match(d))return"hr"}if(t.next(),x&&/[\/\*!#;:>|]/.test(w)){if("!"==w)return t.skipToEnd(),"header";if("*"==w)return t.eatWhile("*"),"comment";if("#"==w)return t.eatWhile("#"),"comment";if(";"==w)return t.eatWhile(";"),"comment";if(":"==w)return t.eatWhile(":"),"comment";if(">"==w)return t.eatWhile(">"),"quote";if("|"==w)return"header"}if("{"==w&&t.match(/\{\{/))return e(t,u,i);if(/[hf]/i.test(w)&&/[ti]/i.test(t.peek())&&t.match(/\b(ttps?|tp|ile):\/\/[\-A-Z0-9+&@#\/%?=~_|$!:,.;]*[A-Z0-9+&@#\/%=~_|$]/i))return"link";if('"'==w)return"string";if("~"==w)return"brace";if(/[\[\]]/.test(w)&&t.match(w))return"brace";if("@"==w)return t.eatWhile(f),"link";if(/\d/.test(w))return t.eatWhile(/\d/),"number";if("/"==w){if(t.eat("%"))return e(t,u,n);if(t.eat("/"))return e(t,u,o)}if("_"==w&&t.eat("_"))return e(t,u,a);if("-"==w&&t.eat("-")){if(" "!=t.peek())return e(t,u,s);if(" "==t.peek())return"brace"}return"'"==w&&t.eat("'")?e(t,u,r):"<"==w&&t.eat("<")?e(t,u,l):(t.eatWhile(/[\w\$_]/),c.propertyIsEnumerable(t.current())?"keyword":null)}function n(e,n){for(var r,i=!1;r=e.next();){if("/"==r&&i){n.tokenize=t;break}i="%"==r}return"comment"}function r(e,n){for(var r,i=!1;r=e.next();){if("'"==r&&i){n.tokenize=t;break}i="'"==r}return"strong"}function i(e,n){var r=n.block;return r&&e.current()?"comment":!r&&e.match(w)?(n.tokenize=t,"comment"):r&&e.sol()&&e.match(x)?(n.tokenize=t,"comment"):(e.next(),"comment")}function o(e,n){for(var r,i=!1;r=e.next();){if("/"==r&&i){n.tokenize=t;break}i="/"==r}return"em"}function a(e,n){for(var r,i=!1;r=e.next();){if("_"==r&&i){n.tokenize=t;break}i="_"==r}return"underlined"}function s(e,n){for(var r,i=!1;r=e.next();){if("-"==r&&i){n.tokenize=t;break}i="-"==r}return"strikethrough"}function l(e,n){if("<<"==e.current())return"macro";var r=e.next();return r?">"==r&&">"==e.peek()?(e.next(),n.tokenize=t,"macro"):(e.eatWhile(/[\w\$_]/),u.propertyIsEnumerable(e.current())?"keyword":null):(n.tokenize=t,null)}var c={},u={allTags:!0,closeAll:!0,list:!0,newJournal:!0,newTiddler:!0,permaview:!0,saveChanges:!0,search:!0,slider:!0,tabs:!0,tag:!0,tagging:!0,tags:!0,tiddler:!0,timeline:!0,today:!0,version:!0,option:!0,"with":!0,filter:!0},f=/[\w_\-]/i,d=/^\-\-\-\-+$/,p=/^\/\*\*\*$/,h=/^\*\*\*\/$/,m=/^<<<$/,g=/^\/\/\{\{\{$/,v=/^\/\/\}\}\}$/,y=/^$/,b=/^$/,k=/^\{\{\{$/,x=/^\}\}\}$/,w=/.*?\}\}\}/;return{startState:function(){return{tokenize:t}},token:function(e,t){if(e.eatSpace())return null;var n=t.tokenize(e,t);return n}}}),e.defineMIME("text/x-tiddlywiki","tiddlywiki")}),function(e){e(CodeMirror)}(function(e){"use strict";function t(e,t,n){var r;return r=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),r?n+=" mw-mnemonic":t}function n(e,n){return function(r,i,o){o&&r.sol()?i.ownLine=!0:o===!1&&i.ownLine&&(i.ownLine=!1);var a=i.ownLine?n:e;return r.match(/[^&]+/)?a:(r.next(),t(r,a,a))}}e.defineMode("mediawiki",function(n){function r(e,t,n){return t.isBold&&(e+=" strong"),t.isItalic&&(e+=" em"),i(e,t,n)}function i(e,t,n){var r="";switch(t.nTemplate){case 0:break;case 1:r+="-template";break;case 2:r+="-template2";break;default:r+="-template3"}switch(t.nExt){case 0:break;case 1:r+="-ext";break;case 2:r+="-ext2";break;default:r+="-ext3"}return t.nLink>0&&(r+="-link"),""!==r&&(e="mw"+r+"-ground "+e),n&&t[n]--,e}function o(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=r.stack.pop();break}n.next()}return i(e,r)}}function a(e){return function(t,n){return t.skipToEnd(),n.tokenize=n.stack.pop(),i(e,n)}}function s(e,t){return function(n,r){return r.tokenize=r.stack.pop(),n.eat(e)?i(t,r):i("error",r)}}function l(e){return function(t,n){return t.match(/[^&<\[\{~]+/)?(t.eol()&&(t.backUp(e),n.tokenize=a("mw-section-header")),null):E("","")(t,n)}}function c(e,t){return e.match(/[^\{\}\|]+/)?i("mw-templatevariable-name",t):e.eat("|")?(t.tokenize=u,i("mw-templatevariable-delimiter",t)):e.match("}}}")?(t.tokenize=t.stack.pop(),i("mw-templatevariable-bracket",t)):e.match("{{{")?(t.stack.push(t.tokenize),i("mw-templatevariable-bracket",t)):(e.next(),i("mw-templatevariable-name",t))}function u(e,t){return e.match(/[^\{\}\[<\&~]+/)?i("mw-templatevariable",t):e.match("}}}")?(t.tokenize=t.stack.pop(),i("mw-templatevariable-bracket",t)):E("mw-templatevariable","")(e,t)}function f(e,t){return e.match(/#?[^\:\}\{~]+/)?i("mw-parserfunction-name",t):e.eat(":")?(t.tokenize=d,i("mw-parserfunction-delimiter",t)):e.match("}}")?(t.tokenize=t.stack.pop(),i("mw-parserfunction-bracket",t,"nExt")):E("mw-parserfunction","")(e,t)}function d(e,t){return e.match(/[^\|\}\{\[<\&~]+/)?i("mw-parserfunction",t):e.eat("|")?i("mw-parserfunction-delimiter",t):e.match("}}")?(t.tokenize=t.stack.pop(),i("mw-parserfunction-bracket",t,"nExt")):E("mw-parserfunction","")(e,t)}function p(e){return function(t,n){return t.match(/[\s\u00a0]*\|[\s\u00a0]*/)?(n.tokenize=h(!0),i("mw-template-delimiter",n)):t.match(/[\s\u00a0]*\}\}/)?(n.tokenize=n.stack.pop(),i("mw-template-bracket",n,"nTemplate")):e&&t.sol()?(n.nTemplate--,void(n.tokenize=n.stack.pop())):t.match(/[\s\u00a0]*[^\s\u00a0\|\}<\{\&~]+/)?(n.tokenize=p(!0),i("mw-template-name mw-pagename",n)):t.eatSpace()?t.eol()===!0?i("mw-template-name",n):i("mw-template-name mw-pagename",n):E("mw-template-name mw-pagename","mw-template-name-mnemonic mw-pagename")(t,n)}}function h(e){return function(t,n){return e&&t.eatWhile(/[^=\|\}\{\[<\&~]/)?t.eat("=")?(n.tokenize=h(!1),i("mw-template-argument-name",n)):i("mw-template",n):t.eatWhile(/[^\|\}\{\[<\&~]/)?i("mw-template",n):t.eat("|")?(n.tokenize=h(!0), +i("mw-template-delimiter",n)):t.match("}}")?(n.tokenize=n.stack.pop(),i("mw-template-bracket",n,"nTemplate")):E("mw-template","")(t,n)}}function m(e){return function(t,n){for(;e>0;)e--,t.next();return t.eol()?(n.nLink--,n.tokenize=n.stack.pop()):n.tokenize=g,i("mw-extlink-protocol",n)}}function g(e,t){return e.sol()?(t.nLink--,void(t.tokenize=t.stack.pop())):e.match(/[\s\u00a0]*\]/)?(t.tokenize=t.stack.pop(),i("mw-extlink-bracket",t,"nLink")):e.eatSpace()?(t.tokenize=v,r("",t)):e.match(/[^\s\u00a0\]\{\&~]+/)||e.eatSpace()?r("mw-extlink",t):E("mw-extlink","")(e,t)}function v(e,t){return e.sol()?(t.nLink--,void(t.tokenize=t.stack.pop())):e.eat("]")?(t.tokenize=t.stack.pop(),i("mw-extlink-bracket",t,"nLink")):e.match(/[^'\]\{\&~]+/)?r("mw-extlink-text",t):E("mw-extlink-text","")(e,t)}function y(e,t){return e.sol()?(t.nLink--,void(t.tokenize=t.stack.pop())):e.match(/[\s\u00a0]*#[\s\u00a0]*/)?(t.tokenize=b,i("mw-link",t)):e.match(/[\s\u00a0]*\|[\s\u00a0]*/)?(t.tokenize=k(),i("mw-link-delimiter",t)):e.match(/[\s\u00a0]*\]\]/)?(t.tokenize=t.stack.pop(),i("mw-link-bracket",t,"nLink")):e.match(/[\s\u00a0]*[^\s\u00a0#\|\]\&~\{]+/)||e.eatSpace()?r("mw-link-pagename mw-pagename",t):E("mw-link-pagename mw-pagename","mw-pagename")(e,t)}function b(e,t){return e.sol()?(t.nLink--,void(t.tokenize=t.stack.pop())):e.match(/[^\|\]\&~\{\}]+/)?i("mw-link-tosection",t):e.eat("|")?(t.tokenize=k(),i("mw-link-delimiter",t)):e.match("]]")?(t.tokenize=t.stack.pop(),i("mw-link-bracket",t,"nLink")):E("mw-link-tosection","")(e,t)}function k(){var e,t;return function(n,o){if(n.match("]]"))return o.tokenize=o.stack.pop(),i("mw-link-bracket",o,"nLink");if(n.match("'''"))return e=!e,i("mw-link-text mw-apostrophes",o);if(n.match("''"))return t=!t,i("mw-link-text mw-apostrophes",o);var a="mw-link-text";return e&&(a+=" strong"),t&&(a+=" em"),n.match(/[^'\]\{\&~]+/)?r(a,o):E(a,"")(n,o)}}function x(e,t,n){return function(r,o){for(var a="";e>0;)e--,a+=r.next();return r.eol()?(o.tokenize=o.stack.pop(),i(n?"mw-htmltag-name":"mw-exttag-name",o)):(r.eatSpace(),r.eol()?(o.tokenize=o.stack.pop(),i(n?"mw-htmltag-name":"mw-exttag-name",o)):n?(t?o.tokenize=s(">","mw-htmltag-bracket"):o.tokenize=w(a),i("mw-htmltag-name",o)):(t?o.tokenize=s(">","mw-exttag-bracket"):o.tokenize=_(a),i("mw-exttag-name",o)))}}function w(e){return function(t,n){return t.match(/[^>\/<\{\&~]+/)?i("mw-htmltag-attribute",n):t.eat(">")?(n.InHtmlTag.push(e),n.tokenize=n.stack.pop(),i("mw-htmltag-bracket",n)):t.match("/>")?(n.tokenize=n.stack.pop(),i("mw-htmltag-bracket",n)):E("mw-htmltag-attribute","")(t,n)}}function _(t){return function(r,o){return r.match(/[^>\/<\{\&~]+/)?i("mw-exttag-attribute",o):r.eat(">")?(o.extName=t,n.mwextMode&&t in n.mwextMode.tag&&(o.extMode=e.getMode(n,n.mwextMode.tag[t]),o.extState=e.startState(o.extMode)),o.tokenize=C(t),i("mw-exttag-bracket",o)):r.match("/>")?(o.tokenize=o.stack.pop(),i("mw-exttag-bracket",o)):E("mw-exttag-attribute","")(r,o)}}function C(e){return function(t,n){var r,i=!1,o=t.pos,a=new RegExp(""),s=a.exec(o?t.string.slice(o):t.string);if(s){if(0===s.index)return n.tokenize=S(e),n.extName=!1,n.extMode!==!1&&(n.extMode=!1,n.extState=!1),n.tokenize(t,n);r=s.index+o,i=t.string,t.string=i.slice(0,r)}return n.stack.push(n.tokenize),n.tokenize=M(i),n.tokenize(t,n)}}function S(e){return function(t,n){return t.next(),t.next(),n.tokenize=x(e.length,!0,!1),i("mw-exttag-bracket",n)}}function M(e){return function(t,n){var r;return n.extMode===!1?(r=e===!1&&t.sol()?"line-cm-mw-exttag":"mw-exttag",t.skipToEnd()):(r=(e===!1&&t.sol()?"line-cm-mw-tag-":"mw-tag-")+n.extName,r+=" "+n.extMode.token(t,n.extState,e===!1)),t.eol()&&(e!==!1&&(t.string=e),n.tokenize=n.stack.pop()),i(r,n)}}function L(e,t){return e.sol()?(t.tokenize=T,T(e,t)):E("mw-table-definition","")(e,t)}function T(e,t){if(e.sol()){if(e.eat("|"))return e.eat("-")?(e.eatSpace(),t.tokenize=L,i("mw-table-delimiter",t)):e.eat("}")?(t.tokenize=t.stack.pop(),i("mw-table-bracket",t)):(e.eatSpace(),t.tokenize=A(!0,!1),i("mw-table-delimiter",t));if(e.eat("!"))return e.eatSpace(),t.tokenize=A(!0,!0),i("mw-table-delimiter",t)}return E("","")(e,t)}function A(e,t){return function(n,o){if(n.sol()){var a=n.peek();if("|"===a||"!"===a)return o.tokenize=T,o.tokenize(n,o);o.isBold=!1,o.isItalic=!1}else{if(n.match(/[^'\|\{\[<\&~]+/))return r(t?"strong":"",o);if(n.match("||")||t&&n.match("!!")||e&&n.eat("|"))return o.isBold=!1,o.isItalic=!1,e&&(o.tokenize=A(!1,t)),i("mw-table-delimiter",o)}return E(t?"strong":"",t?"strong":"")(n,o)}}function E(e,a){return function(s,u){function d(e){return u.stack.push(u.tokenize),u.tokenize=e,e(s,u)}var h=s.sol(),g=s.next();if(h)switch(u.isBold=!1,u.isItalic=!1,g){case" ":return"mw-skipformatting";case"-":if(s.match("---"))return"mw-hr";break;case"=":var v=s.match(/(={0,5})(.+?(=\1\s*))$/);if(v)return s.backUp(v[2].length),u.stack.push(u.tokenize),u.tokenize=l(v[3].length),"mw-section-header line-cm-mw-section-"+(v[1].length+1);break;case"*":case"#":if(s.match(/[\*#]*:*/))return"mw-list";break;case":":if(s.match(/:*[\*#]*/))return"mw-indenting";break;case"{":if(s.eat("|"))return s.eatSpace(),u.stack.push(u.tokenize),u.tokenize=L,"mw-table-bracket"}switch(g){case"&":return r(t(s,e,a),u);case"'":if(s.match("''"))return u.isBold=!u.isBold,i("mw-apostrophes",u);if(s.eat("'"))return u.isItalic=!u.isItalic,i("mw-apostrophes",u);break;case"[":if(s.eat("[")){if(s.eatSpace(),/[^\]\|\[]/.test(s.peek()))return u.nLink++,u.stack.push(u.tokenize),u.tokenize=y,i("mw-link-bracket",u)}else{var b=s.match(z);if(b)return u.nLink++,s.backUp(b[0].length),u.stack.push(u.tokenize),u.tokenize=m(b[0].length),i("mw-extlink-bracket",u)}break;case"{":if(s.match("{{"))return s.eatSpace(),u.stack.push(u.tokenize),u.tokenize=c,i("mw-templatevariable-bracket",u);if(s.match(/\{[\s\u00a0]*/)){if("#"===s.peek())return u.nExt++,u.stack.push(u.tokenize),u.tokenize=f,i("mw-parserfunction-bracket",u);var k=s.match(/([^\s\u00a0\}\[\]<\{\'\|\&\:]+)(\:|[\s\u00a0]*)(\}\}?)?(.)?/);return k&&(s.backUp(k[0].length),(":"===k[2]||void 0===k[4]||"}}"===k[3])&&n.mwextFunctionSynonyms&&(k[1].toLowerCase()in n.mwextFunctionSynonyms[0]||k[1]in n.mwextFunctionSynonyms[1]))?(u.nExt++,u.stack.push(u.tokenize),u.tokenize=f,i("mw-parserfunction-bracket",u)):(u.nTemplate++,u.stack.push(u.tokenize),u.tokenize=p(!1),i("mw-template-bracket",u))}break;case"<":if(s.match("!--"))return d(o("mw-comment","-->"));var w=!!s.eat("/"),_=s.match(/[^>\/\s\u00a0\.\*\,\[\]\{\}\$\^\+\?\|\/\\'`~<=!@#%&\(\)-]+/);if(_){if(_=_[0].toLowerCase(),n.mwextTags&&_ in n.mwextTags)return w===!0?"error":(s.backUp(_.length),u.stack.push(u.tokenize),u.tokenize=x(_.length,w,!1),i("mw-exttag-bracket",u));if(_ in O)return w===!0&&_!==u.InHtmlTag.pop()?"error":(s.backUp(_.length),u.stack.push(u.tokenize),u.tokenize=x(_.length,w,!0),i("mw-htmltag-bracket",u));s.backUp(_.length)}break;case"~":if(s.match(/~{2,4}/))return"mw-signature"}s.match(/[^\s\u00a0_>\}\[\]<\{\'\|\&\:~]+/);var C=r(e,u);return C}}var z=new RegExp(n.mwextUrlProtocols,"i"),O={b:!0,bdi:!0,del:!0,i:!0,ins:!0,u:!0,font:!0,big:!0,small:!0,sub:!0,sup:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,cite:!0,code:!0,em:!0,s:!0,strike:!0,strong:!0,tt:!0,"var":!0,div:!0,center:!0,blockquote:!0,ol:!0,ul:!0,dl:!0,table:!0,caption:!0,pre:!0,ruby:!0,rb:!0,rp:!0,rt:!0,rtc:!0,p:!0,span:!0,abbr:!0,dfn:!0,kbd:!0,samp:!0,data:!0,time:!0,mark:!0,br:!0,wbr:!0,hr:!0,li:!0,dt:!0,dd:!0,td:!0,th:!0,tr:!0,noinclude:!0,includeonly:!0,onlyinclude:!0};return{startState:function(){return{tokenize:E("",""),stack:[],InHtmlTag:[],isBold:!1,isItalic:!1,extName:!1,extMode:!1,extState:!1,nTemplate:0,nLink:0,nExt:0}},copyState:function(t){return{tokenize:t.tokenize,stack:t.stack.concat([]),InHtmlTag:t.InHtmlTag.concat([]),isBold:t.isBold,isItalic:t.isItalic,extName:t.extName,extMode:t.extMode,extState:t.extMode!==!1&&e.copyState(t.extMode,t.extState),nTemplate:t.nTemplate,nLink:t.nLink,nExt:t.nExt}},token:function(e,t){return t.tokenize(e,t)},blankLine:function(e){if(e.extName){if(e.extMode){var t="";return e.extMode.blankLine&&(t=" "+e.extMode.blankLine(e.extState)),"line-cm-mw-tag-"+e.extName+t}return"line-cm-mw-exttag"}}}}),e.defineMIME("text/mediawiki","mediawiki"),e.defineMode("mw-tag-pre",function(){return{startState:function(){return{}},token:n("mw-tag-pre","line-cm-mw-tag-pre")}}),e.defineMode("mw-tag-nowiki",function(){return{startState:function(){return{}},token:n("mw-tag-nowiki","line-cm-mw-tag-nowiki")}})}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../lib/codemirror")):"function"==typeof define&&define.amd?define(["../lib/codemirror"],e):e(CodeMirror)}(function(e){"use strict";function t(e,t){return e.line==t.line&&e.ch==t.ch}function n(e){N.push(e),N.length>50&&N.shift()}function r(e){return N.length?void(N[N.length-1]+=e):n(e)}function i(e){return N[N.length-(e?Math.min(e,1):1)]||""}function o(){return N.length>1&&N.pop(),i()}function a(e,i,o,a,s){null==s&&(s=e.getRange(i,o)),a&&q&&q.cm==e&&t(i,q.pos)&&e.isClean(q.gen)?r(s):n(s),e.replaceRange("",i,o,"+delete"),q=a?{cm:e,pos:i,gen:e.changeGeneration()}:null}function s(e,t,n){return e.findPosH(t,n,"char",!0)}function l(e,t,n){return e.findPosH(t,n,"word",!0)}function c(e,t,n){return e.findPosV(t,n,"line",e.doc.sel.goalColumn)}function u(e,t,n){return e.findPosV(t,n,"page",e.doc.sel.goalColumn)}function f(e,t,n){for(var r=t.line,i=e.getLine(r),o=/\S/.test(n<0?i.slice(0,t.ch):i.slice(t.ch)),a=e.firstLine(),s=e.lastLine();;){if(r+=n,rs)return e.clipPos(I(r-n,n<0?0:null));i=e.getLine(r);var l=/\S/.test(i);if(l)o=!0;else if(o)return I(r,0)}}function d(e,t,n){for(var r=t.line,i=t.ch,o=e.getLine(t.line),a=!1;;){var s=o.charAt(i+(n<0?-1:0));if(s){if(a&&/[!?.]/.test(s))return I(r,i+(n>0?1:0));a||(a=/\w/.test(s)),i+=n}else{if(r==(n<0?e.firstLine():e.lastLine()))return I(r,i);if(o=e.getLine(r+n),!/\S/.test(o))return I(r,i);r+=n,i=n<0?o.length:0}}}function p(e,n,r){var i;if(e.findMatchingBracket&&(i=e.findMatchingBracket(n,!0))&&i.match&&(i.forward?1:-1)==r)return r>0?I(i.to.line,i.to.ch+1):i.to;for(var o=!0;;o=!1){var a=e.getTokenAt(n),s=I(n.line,r<0?a.start:a.end);if(!(o&&r>0&&a.end==n.ch)&&/\w/.test(a.string))return s;var l=e.findPosH(s,r,"char");if(t(s,l))return n;n=l}}function h(e,t){var n=e.state.emacsPrefix;return n?(w(e),"-"==n?-1:Number(n)):t?null:1}function m(e){var t="string"==typeof e?function(t){t.execCommand(e)}:e;return function(e){var n=h(e);t(e);for(var r=1;r1&&"+input"==t.origin){for(var r=t.text.join("\n"),i="",o=1;o',n,{bottom:!0}):n(prompt(t,""))}function A(e,t){var n=e.getCursor(),r=e.findPosH(n,1,"word");e.replaceRange(t(e.getRange(n,r)),n,r),e.setCursor(r)}function E(e){for(var t=e.getCursor(),n=t.line,r=t.ch,i=[];n>=e.firstLine();){for(var o=e.getLine(n),a=null==r?o.length:r;a>0;){var r=o.charAt(--a);if(")"==r)i.push("(");else if("]"==r)i.push("[");else if("}"==r)i.push("{");else if(/[\(\{\[]/.test(r)&&(!i.length||i.pop()!=r))return e.extendSelection(I(n,a))}--n,r=null}}function z(e){e.execCommand("clearSearch"),L(e)}function O(e){j[e]=function(t){k(t,e)},R["Ctrl-"+e]=function(t){k(t,e)},P["Ctrl-"+e]=!0}for(var I=e.Pos,N=[],q=null,P={"Alt-G":!0,"Ctrl-X":!0,"Ctrl-Q":!0,"Ctrl-U":!0},R=e.keyMap.emacs=e.normalizeKeyMap({"Ctrl-W":function(e){a(e,e.getCursor("start"),e.getCursor("end"))},"Ctrl-K":m(function(e){var t=e.getCursor(),n=e.clipPos(I(t.line)),r=e.getRange(t,n);/\S/.test(r)||(r+="\n",n=I(t.line+1,0)),a(e,t,n,!0,r)}),"Alt-W":function(e){n(e.getSelection()),L(e)},"Ctrl-Y":function(e){var t=e.getCursor();e.replaceRange(i(h(e)),t,t,"paste"),e.setSelection(t,e.getCursor())},"Alt-Y":function(e){e.replaceSelection(o(),"around","paste")},"Ctrl-Space":M,"Ctrl-Shift-2":M,"Ctrl-F":v(s,1),"Ctrl-B":v(s,-1),Right:v(s,1),Left:v(s,-1),"Ctrl-D":function(e){y(e,s,1)},Delete:function(e){b(e)||y(e,s,1)},"Ctrl-H":function(e){y(e,s,-1)},Backspace:function(e){b(e)||y(e,s,-1)},"Alt-F":v(l,1),"Alt-B":v(l,-1),"Alt-D":function(e){y(e,l,1)},"Alt-Backspace":function(e){y(e,l,-1)},"Ctrl-N":v(c,1),"Ctrl-P":v(c,-1),Down:v(c,1),Up:v(c,-1),"Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd",End:"goLineEnd",Home:"goLineStart","Alt-V":v(u,-1),"Ctrl-V":v(u,1),PageUp:v(u,-1),PageDown:v(u,1),"Ctrl-Up":v(f,-1),"Ctrl-Down":v(f,1),"Alt-A":v(d,-1),"Alt-E":v(d,1),"Alt-K":function(e){y(e,d,1)},"Ctrl-Alt-K":function(e){y(e,p,1)},"Ctrl-Alt-Backspace":function(e){y(e,p,-1)},"Ctrl-Alt-F":v(p,1),"Ctrl-Alt-B":v(p,-1),"Shift-Ctrl-Alt-2":function(e){var t=e.getCursor();e.setSelection(g(e,t,p,1),t)},"Ctrl-Alt-T":function(e){var t=p(e,e.getCursor(),-1),n=p(e,t,1),r=p(e,n,1),i=p(e,r,-1);e.replaceRange(e.getRange(i,r)+e.getRange(n,i)+e.getRange(t,n),t,r)},"Ctrl-Alt-U":m(E),"Alt-Space":function(e){for(var t=e.getCursor(),n=t.ch,r=t.ch,i=e.getLine(t.line);n&&/\s/.test(i.charAt(n-1));)--n;for(;r0?e.setCursor(t-1):void T(e,"Goto line",function(t){var n;t&&!isNaN(n=Number(t))&&n==(0|n)&&n>0&&e.setCursor(n-1)})},"Ctrl-X Tab":function(e){e.indentSelection(h(e,!0)||e.getOption("indentUnit"))},"Ctrl-X Ctrl-X":function(e){e.setSelection(e.getCursor("head"),e.getCursor("anchor"))},"Ctrl-X Ctrl-S":"save","Ctrl-X Ctrl-W":"save","Ctrl-X S":"saveAll","Ctrl-X F":"open","Ctrl-X U":m("undo"),"Ctrl-X K":"close","Ctrl-X Delete":function(e){a(e,e.getCursor(),d(e,e.getCursor(),1),!0)},"Ctrl-X H":"selectAll","Ctrl-Q Tab":m("insertTab"),"Ctrl-U":C}),j={"Ctrl-G":w},D=0;D<10;++D)O(String(D));O("-")}),function(e){"object"==typeof exports&&"object"==typeof module?e(require("../lib/codemirror"),require("../addon/search/searchcursor"),require("../addon/edit/matchbrackets")):"function"==typeof define&&define.amd?define(["../lib/codemirror","../addon/search/searchcursor","../addon/edit/matchbrackets"],e):e(CodeMirror)}(function(e){"use strict";function t(t,n,r){if(r<0&&0==n.ch)return t.clipPos(d(n.line-1));var i=t.getLine(n.line);if(r>0&&n.ch>=i.length)return t.clipPos(d(n.line+1,0));for(var o,a="start",s=n.ch,l=r<0?0:i.length,c=0;s!=l;s+=r,c++){var u=i.charAt(r<0?s-1:s),f="_"!=u&&e.isWordChar(u)?"w":"o";if("w"==f&&u.toUpperCase()==u&&(f="W"),"start"==a)"o"!=f&&(a="in",o=f);else if("in"==a&&o!=f){if("w"==o&&"W"==f&&r<0&&s--,"W"==o&&"w"==f&&r>0){o="w";continue}break}}return d(n.line,s)}function n(e,n){e.extendSelectionsBy(function(r){return e.display.shift||e.doc.extend||r.empty()?t(e.doc,r.head,n):n<0?r.from():r.to()})}function r(t,n){return t.isReadOnly()?e.Pass:(t.operation(function(){for(var e=t.listSelections().length,r=[],i=-1,o=0;o=0;s--){var l=r[o[s]];if(!(c&&e.cmpPos(l.head,c)>0)){var u=i(t,l.head);c=u.from,t.replaceRange(n(u.word),u.from,u.to)}}})}function l(t){var n=t.getCursor("from"),r=t.getCursor("to");if(0==e.cmpPos(n,r)){var o=i(t,n);if(!o.word)return;n=o.from,r=o.to}return{from:n,to:r,query:t.getRange(n,r),word:o}}function c(e,t){var n=l(e);if(n){var r=n.query,i=e.getSearchCursor(r,t?n.to:n.from);(t?i.findNext():i.findPrevious())?e.setSelection(i.from(),i.to()):(i=e.getSearchCursor(r,t?d(e.firstLine(),0):e.clipPos(d(e.lastLine()))),(t?i.findNext():i.findPrevious())?e.setSelection(i.from(),i.to()):n.word&&e.setSelection(n.from,n.to))}}var u=e.keyMap.sublime={fallthrough:"default"},f=e.commands,d=e.Pos,p=e.keyMap["default"]==e.keyMap.macDefault,h=p?"Cmd-":"Ctrl-",m=p?"Ctrl-":"Alt-";f[u[m+"Left"]="goSubwordLeft"]=function(e){n(e,-1)},f[u[m+"Right"]="goSubwordRight"]=function(e){n(e,1)},p&&(u["Cmd-Left"]="goLineStartSmart");var g=p?"Ctrl-Alt-":"Ctrl-";f[u[g+"Up"]="scrollLineUp"]=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top+t.clientHeight,"local");e.getCursor().line>=n&&e.execCommand("goLineUp")}e.scrollTo(null,t.top-e.defaultTextHeight())},f[u[g+"Down"]="scrollLineDown"]=function(e){var t=e.getScrollInfo();if(!e.somethingSelected()){var n=e.lineAtHeight(t.top,"local")+1;e.getCursor().line<=n&&e.execCommand("goLineDown")}e.scrollTo(null,t.top+e.defaultTextHeight())},f[u["Shift-"+h+"L"]="splitSelectionByLine"]=function(e){for(var t=e.listSelections(),n=[],r=0;ri.line&&a==o.line&&0==o.ch||n.push({anchor:a==i.line?i:d(a,0),head:a==o.line?o:d(a)});e.setSelections(n,0)},u["Shift-Tab"]="indentLess",f[u.Esc="singleSelectionTop"]=function(e){var t=e.listSelections()[0];e.setSelection(t.anchor,t.head,{scroll:!1})},f[u[h+"L"]="selectLine"]=function(e){for(var t=e.listSelections(),n=[],r=0;ri?r.push(l,c):r.length&&(r[r.length-1]=c),i=c}t.operation(function(){for(var e=0;et.lastLine()?t.replaceRange("\n"+a,d(t.lastLine()),null,"+swapLine"):t.replaceRange(a+"\n",d(i,0),null,"+swapLine")}t.setSelections(o),t.scrollIntoView()})},f[u[y+"Down"]="swapLineDown"]=function(t){if(t.isReadOnly())return e.Pass;for(var n=t.listSelections(),r=[],i=t.lastLine()+1,o=n.length-1;o>=0;o--){var a=n[o],s=a.to().line+1,l=a.from().line;0!=a.to().ch||a.empty()||s--,s=0;e-=2){var n=r[e],i=r[e+1],o=t.getLine(n);n==t.lastLine()?t.replaceRange("",d(n-1),d(n),"+swapLine"):t.replaceRange("",d(n,0),d(n+1,0),"+swapLine"),t.replaceRange(o+"\n",d(i,0),null,"+swapLine")}t.scrollIntoView()})},f[u[h+"/"]="toggleCommentIndented"]=function(e){e.toggleComment({indent:!0})},f[u[h+"J"]="joinLines"]=function(e){for(var t=e.listSelections(),n=[],r=0;r=0;i--){var o=n[i].head,a=t.getRange({line:o.line,ch:0},o),s=e.countColumn(a,null,t.getOption("tabSize")),l=t.findPosH(o,-1,"char",!1);if(a&&!/\S/.test(a)&&s%r==0){var c=new d(o.line,e.findColumn(a,s-r,r));c.ch!=o.ch&&(l=c)}t.replaceRange("",l,o,"+delete")}})},f[u[b+h+"K"]="delLineRight"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=t.length-1;n>=0;n--)e.replaceRange("",t[n].anchor,d(t[n].to().line),"+delete");e.scrollIntoView()})},f[u[b+h+"U"]="upcaseAtCursor"]=function(e){s(e,function(e){return e.toUpperCase()})},f[u[b+h+"L"]="downcaseAtCursor"]=function(e){s(e,function(e){return e.toLowerCase()})},f[u[b+h+"Space"]="setSublimeMark"]=function(e){e.state.sublimeMark&&e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor())},f[u[b+h+"A"]="selectToSublimeMark"]=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&e.setSelection(e.getCursor(),t)},f[u[b+h+"W"]="deleteToSublimeMark"]=function(t){var n=t.state.sublimeMark&&t.state.sublimeMark.find();if(n){var r=t.getCursor(),i=n;if(e.cmpPos(r,i)>0){var o=i;i=r,r=o}t.state.sublimeKilled=t.getRange(r,i),t.replaceRange("",r,i)}},f[u[b+h+"X"]="swapWithSublimeMark"]=function(e){var t=e.state.sublimeMark&&e.state.sublimeMark.find();t&&(e.state.sublimeMark.clear(),e.state.sublimeMark=e.setBookmark(e.getCursor()),e.setCursor(t))},f[u[b+h+"Y"]="sublimeYank"]=function(e){null!=e.state.sublimeKilled&&e.replaceSelection(e.state.sublimeKilled,null,"paste")},u[b+h+"G"]="clearBookmarks",f[u[b+h+"C"]="showInCenter"]=function(e){var t=e.cursorCoords(null,"local");e.scrollTo(null,(t.top+t.bottom)/2-e.getScrollInfo().clientHeight/2)};var k=p?"Ctrl-Shift-":"Ctrl-Alt-";f[u[k+"Up"]="selectLinesUpward"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=0;ne.firstLine()&&e.addSelection(d(r.head.line-1,r.head.ch))}})},f[u[k+"Down"]="selectLinesDownward"]=function(e){e.operation(function(){for(var t=e.listSelections(),n=0;n",type:"keyToKey",toKeys:"h"},{keys:"",type:"keyToKey",toKeys:"l"},{keys:"",type:"keyToKey",toKeys:"k"},{keys:"",type:"keyToKey",toKeys:"j"},{keys:"",type:"keyToKey",toKeys:"l"},{keys:"",type:"keyToKey",toKeys:"h",context:"normal"},{keys:"",type:"keyToKey",toKeys:"W"},{keys:"",type:"keyToKey",toKeys:"B",context:"normal"},{keys:"",type:"keyToKey",toKeys:"w"},{keys:"",type:"keyToKey",toKeys:"b",context:"normal"},{keys:"",type:"keyToKey",toKeys:"j"},{keys:"",type:"keyToKey",toKeys:"k"},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:"",context:"insert"},{keys:"",type:"keyToKey",toKeys:"",context:"insert"},{keys:"s",type:"keyToKey",toKeys:"cl",context:"normal"},{keys:"s",type:"keyToKey",toKeys:"c",context:"visual"},{keys:"S",type:"keyToKey",toKeys:"cc",context:"normal"},{keys:"S",type:"keyToKey",toKeys:"VdO",context:"visual"},{keys:"",type:"keyToKey",toKeys:"0"},{keys:"",type:"keyToKey",toKeys:"$"},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:""},{keys:"",type:"keyToKey",toKeys:"j^",context:"normal"},{keys:"",type:"action",action:"toggleOverwrite",context:"insert"},{keys:"H",type:"motion",motion:"moveToTopLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"M",type:"motion",motion:"moveToMiddleLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"L",type:"motion",motion:"moveToBottomLine",motionArgs:{linewise:!0,toJumplist:!0}},{keys:"h",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!1}},{keys:"l",type:"motion",motion:"moveByCharacters",motionArgs:{forward:!0}},{keys:"j",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,linewise:!0}},{keys:"k",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,linewise:!0}},{keys:"gj",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!0}},{keys:"gk",type:"motion",motion:"moveByDisplayLines",motionArgs:{forward:!1}},{keys:"w",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1}},{keys:"W",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!1,bigWord:!0}},{keys:"e",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,inclusive:!0}},{keys:"E",type:"motion",motion:"moveByWords",motionArgs:{forward:!0,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"b",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1}},{keys:"B",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1,bigWord:!0}},{keys:"ge",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,inclusive:!0}},{keys:"gE",type:"motion",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!0,bigWord:!0,inclusive:!0}},{keys:"{",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!1,toJumplist:!0}},{keys:"}",type:"motion",motion:"moveByParagraph",motionArgs:{forward:!0,toJumplist:!0}},{keys:"",type:"motion",motion:"moveByPage",motionArgs:{forward:!0}},{keys:"",type:"motion",motion:"moveByPage",motionArgs:{forward:!1}},{keys:"",type:"motion",motion:"moveByScroll",motionArgs:{forward:!0,explicitRepeat:!0}},{keys:"",type:"motion",motion:"moveByScroll",motionArgs:{forward:!1,explicitRepeat:!0}},{keys:"gg",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!1,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"G",type:"motion",motion:"moveToLineOrEdgeOfDocument",motionArgs:{forward:!0,explicitRepeat:!0,linewise:!0,toJumplist:!0}},{keys:"0",type:"motion",motion:"moveToStartOfLine"},{keys:"^",type:"motion",motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"+",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0}},{keys:"-",type:"motion",motion:"moveByLines",motionArgs:{forward:!1,toFirstChar:!0}},{keys:"_",type:"motion",motion:"moveByLines",motionArgs:{forward:!0,toFirstChar:!0,repeatOffset:-1}},{keys:"$",type:"motion",motion:"moveToEol",motionArgs:{inclusive:!0}},{keys:"%",type:"motion",motion:"moveToMatchedSymbol",motionArgs:{inclusive:!0, +toJumplist:!0}},{keys:"f",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"F",type:"motion",motion:"moveToCharacter",motionArgs:{forward:!1}},{keys:"t",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!0,inclusive:!0}},{keys:"T",type:"motion",motion:"moveTillCharacter",motionArgs:{forward:!1}},{keys:";",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!0}},{keys:",",type:"motion",motion:"repeatLastCharacterSearch",motionArgs:{forward:!1}},{keys:"'",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0,linewise:!0}},{keys:"`",type:"motion",motion:"goToMark",motionArgs:{toJumplist:!0}},{keys:"]`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0}},{keys:"[`",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1}},{keys:"]'",type:"motion",motion:"jumpToMark",motionArgs:{forward:!0,linewise:!0}},{keys:"['",type:"motion",motion:"jumpToMark",motionArgs:{forward:!1,linewise:!0}},{keys:"]p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0,matchIndent:!0}},{keys:"[p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0,matchIndent:!0}},{keys:"]",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!0,toJumplist:!0}},{keys:"[",type:"motion",motion:"moveToSymbol",motionArgs:{forward:!1,toJumplist:!0}},{keys:"|",type:"motion",motion:"moveToColumn"},{keys:"o",type:"motion",motion:"moveToOtherHighlightedEnd",context:"visual"},{keys:"O",type:"motion",motion:"moveToOtherHighlightedEnd",motionArgs:{sameLine:!0},context:"visual"},{keys:"d",type:"operator",operator:"delete"},{keys:"y",type:"operator",operator:"yank"},{keys:"c",type:"operator",operator:"change"},{keys:">",type:"operator",operator:"indent",operatorArgs:{indentRight:!0}},{keys:"<",type:"operator",operator:"indent",operatorArgs:{indentRight:!1}},{keys:"g~",type:"operator",operator:"changeCase"},{keys:"gu",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},isEdit:!0},{keys:"gU",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},isEdit:!0},{keys:"n",type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:!0}},{keys:"N",type:"motion",motion:"findNext",motionArgs:{forward:!1,toJumplist:!0}},{keys:"x",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!0},operatorMotionArgs:{visualLine:!1}},{keys:"X",type:"operatorMotion",operator:"delete",motion:"moveByCharacters",motionArgs:{forward:!1},operatorMotionArgs:{visualLine:!0}},{keys:"D",type:"operatorMotion",operator:"delete",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"D",type:"operator",operator:"delete",operatorArgs:{linewise:!0},context:"visual"},{keys:"Y",type:"operatorMotion",operator:"yank",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"Y",type:"operator",operator:"yank",operatorArgs:{linewise:!0},context:"visual"},{keys:"C",type:"operatorMotion",operator:"change",motion:"moveToEol",motionArgs:{inclusive:!0},context:"normal"},{keys:"C",type:"operator",operator:"change",operatorArgs:{linewise:!0},context:"visual"},{keys:"~",type:"operatorMotion",operator:"changeCase",motion:"moveByCharacters",motionArgs:{forward:!0},operatorArgs:{shouldMoveCursor:!0},context:"normal"},{keys:"~",type:"operator",operator:"changeCase",context:"visual"},{keys:"",type:"operatorMotion",operator:"delete",motion:"moveByWords",motionArgs:{forward:!1,wordEnd:!1},context:"insert"},{keys:"",type:"action",action:"jumpListWalk",actionArgs:{forward:!0}},{keys:"",type:"action",action:"jumpListWalk",actionArgs:{forward:!1}},{keys:"",type:"action",action:"scroll",actionArgs:{forward:!0,linewise:!0}},{keys:"",type:"action",action:"scroll",actionArgs:{forward:!1,linewise:!0}},{keys:"a",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"charAfter"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"eol"},context:"normal"},{keys:"A",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"endOfSelectedArea"},context:"visual"},{keys:"i",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"inplace"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"firstNonBlank"},context:"normal"},{keys:"I",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{insertAt:"startOfSelectedArea"},context:"visual"},{keys:"o",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!0},context:"normal"},{keys:"O",type:"action",action:"newLineAndEnterInsertMode",isEdit:!0,interlaceInsertRepeat:!0,actionArgs:{after:!1},context:"normal"},{keys:"v",type:"action",action:"toggleVisualMode"},{keys:"V",type:"action",action:"toggleVisualMode",actionArgs:{linewise:!0}},{keys:"",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"",type:"action",action:"toggleVisualMode",actionArgs:{blockwise:!0}},{keys:"gv",type:"action",action:"reselectLastSelection"},{keys:"J",type:"action",action:"joinLines",isEdit:!0},{keys:"p",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!0,isEdit:!0}},{keys:"P",type:"action",action:"paste",isEdit:!0,actionArgs:{after:!1,isEdit:!0}},{keys:"r",type:"action",action:"replace",isEdit:!0},{keys:"@",type:"action",action:"replayMacro"},{keys:"q",type:"action",action:"enterMacroRecordMode"},{keys:"R",type:"action",action:"enterInsertMode",isEdit:!0,actionArgs:{replace:!0}},{keys:"u",type:"action",action:"undo",context:"normal"},{keys:"u",type:"operator",operator:"changeCase",operatorArgs:{toLower:!0},context:"visual",isEdit:!0},{keys:"U",type:"operator",operator:"changeCase",operatorArgs:{toLower:!1},context:"visual",isEdit:!0},{keys:"",type:"action",action:"redo"},{keys:"m",type:"action",action:"setMark"},{keys:'"',type:"action",action:"setRegister"},{keys:"zz",type:"action",action:"scrollToCursor",actionArgs:{position:"center"}},{keys:"z.",type:"action",action:"scrollToCursor",actionArgs:{position:"center"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"zt",type:"action",action:"scrollToCursor",actionArgs:{position:"top"}},{keys:"z",type:"action",action:"scrollToCursor",actionArgs:{position:"top"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:"z-",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"}},{keys:"zb",type:"action",action:"scrollToCursor",actionArgs:{position:"bottom"},motion:"moveToFirstNonWhiteSpaceCharacter"},{keys:".",type:"action",action:"repeatLastEdit"},{keys:"",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!0,backtrack:!1}},{keys:"",type:"action",action:"incrementNumberToken",isEdit:!0,actionArgs:{increase:!1,backtrack:!1}},{keys:"a",type:"motion",motion:"textObjectManipulation"},{keys:"i",type:"motion",motion:"textObjectManipulation",motionArgs:{textObjectInner:!0}},{keys:"/",type:"search",searchArgs:{forward:!0,querySrc:"prompt",toJumplist:!0}},{keys:"?",type:"search",searchArgs:{forward:!1,querySrc:"prompt",toJumplist:!0}},{keys:"*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",wholeWordOnly:!0,toJumplist:!0}},{keys:"g*",type:"search",searchArgs:{forward:!0,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:"g#",type:"search",searchArgs:{forward:!1,querySrc:"wordUnderCursor",toJumplist:!0}},{keys:":",type:"ex"}],n=[{name:"colorscheme",shortName:"colo"},{name:"map"},{name:"imap",shortName:"im"},{name:"nmap",shortName:"nm"},{name:"vmap",shortName:"vm"},{name:"unmap"},{name:"write",shortName:"w"},{name:"undo",shortName:"u"},{name:"redo",shortName:"red"},{name:"set",shortName:"se"},{name:"set",shortName:"se"},{name:"setlocal",shortName:"setl"},{name:"setglobal",shortName:"setg"},{name:"sort",shortName:"sor"},{name:"substitute",shortName:"s",possiblyAsync:!0},{name:"nohlsearch",shortName:"noh"},{name:"yank",shortName:"y"},{name:"delmarks",shortName:"delm"},{name:"registers",shortName:"reg",excludeFromCommandHistory:!0},{name:"global",shortName:"g"}],r=e.Pos,i=function(){function i(t){t.setOption("disableInput",!0),t.setOption("showCursorWhenSelecting",!1),e.signal(t,"vim-mode-change",{mode:"normal"}),t.on("cursorActivity",et),_(t),e.on(t.getInputField(),"paste",u(t))}function o(t){t.setOption("disableInput",!1),t.off("cursorActivity",et),e.off(t.getInputField(),"paste",u(t)),t.state.vim=null}function a(t,n){this==e.keyMap.vim&&e.rmClass(t.getWrapperElement(),"cm-fat-cursor"),n&&n.attach==s||o(t,!1)}function s(t,n){this==e.keyMap.vim&&e.addClass(t.getWrapperElement(),"cm-fat-cursor"),n&&n.attach==s||i(t)}function l(t,n){if(n){if(this[t])return this[t];var r=c(t);if(!r)return!1;var i=e.Vim.findKey(n,r);return"function"==typeof i&&e.signal(n,"vim-keypress",r),i}}function c(e){if("'"==e.charAt(0))return e.charAt(1);var t=e.split(/-(?!$)/),n=t[t.length-1];if(1==t.length&&1==t[0].length)return!1;if(2==t.length&&"Shift"==t[0]&&1==n.length)return!1;for(var r=!1,i=0;i")}function u(e){var t=e.state.vim;return t.onPasteFn||(t.onPasteFn=function(){t.insertMode||(e.setCursor(R(e.getCursor(),0,1)),Mt.enterInsertMode(e,{},t))}),t.onPasteFn}function f(e,t){for(var n=[],r=e;r=e.firstLine()&&t<=e.lastLine()}function p(e){return/^[a-z]$/.test(e)}function h(e){return"()[]{}".indexOf(e)!=-1}function m(e){return ct.test(e)}function g(e){return/^[A-Z]$/.test(e)}function v(e){return/^\s*$/.test(e)}function y(e,t){for(var n=0;n"==t.slice(-11)){var n=t.length-11,r=e.slice(0,n),i=t.slice(0,n);return r==i&&e.length>n?"full":0==i.indexOf(r)&&"partial"}return e==t?"full":0==t.indexOf(e)&&"partial"}function B(e){var t=/^.*(<[\w\-]+>)$/.exec(e),n=t?t[1]:e.slice(-1);if(n.length>1)switch(n){case"":n="\n";break;case"":n=" "}return n}function F(e,t,n){return function(){for(var r=0;r2&&(t=K.apply(void 0,Array.prototype.slice.call(arguments,1))),U(e,t)?e:t}function V(e,t){return arguments.length>2&&(t=V.apply(void 0,Array.prototype.slice.call(arguments,1))),U(e,t)?t:e}function G(e,t,n){var r=U(e,t),i=U(t,n);return r&&i}function X(e,t){return e.getLine(t).length}function Z(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function Y(e){return e.replace(/([.?*+$\[\]\/\\(){}|\-])/g,"\\$1")}function Q(e,t,n){var i=X(e,t),o=new Array(n-i+1).join(" ");e.setCursor(r(t,i)),e.replaceRange(o,e.getCursor())}function J(e,t){var n=[],i=e.listSelections(),o=H(e.clipPos(t)),a=!$(t,o),s=e.getCursor("head"),l=te(i,s),c=$(i[l].head,i[l].anchor),u=i.length-1,f=u-l>l?u:0,d=i[f].anchor,p=Math.min(d.line,o.line),h=Math.max(d.line,o.line),m=d.ch,g=o.ch,v=i[f].head.ch-m,y=g-m;v>0&&y<=0?(m++,a||g--):v<0&&y>=0?(m--,c||g++):v<0&&y==-1&&(m--,g++);for(var b=p;b<=h;b++){var k={anchor:new r(b,m),head:new r(b,g)};n.push(k)}return l=o.line==h?n.length-1:0,e.setSelections(n),t.ch=g,d.ch=m,d}function ee(e,t,n){for(var r=[],i=0;ic&&(o.line=c),o.ch=X(e,o.line)}return{ranges:[{anchor:a,head:o}],primary:0}}if("block"==n){for(var u=Math.min(a.line,o.line),f=Math.min(a.ch,o.ch),d=Math.max(a.line,o.line),p=Math.max(a.ch,o.ch)+1,h=d-u+1,m=o.line==u?0:h-1,g=[],v=0;v0&&o&&v(o);o=i.pop())n.line--,n.ch=0;o?(n.line--,n.ch=X(e,n.line)):n.ch=0}}function ue(e,t,n){t.ch=0,n.ch=0,n.line++}function fe(e){if(!e)return 0;var t=e.search(/\S/);return t==-1?e.length:t}function de(e,t,n,i,o){for(var a=se(e),s=e.getLine(a.line),l=a.ch,c=o?ut[0]:ft[0];!c(s.charAt(l));)if(l++,l>=s.length)return null;i?c=ft[0]:(c=ut[0],c(s.charAt(l))||(c=ut[1]));for(var u=l,f=l;c(s.charAt(u))&&u=0;)f--;if(f++,t){for(var d=u;/\s/.test(s.charAt(u))&&u0;)f--;f||(f=p)}}return{start:r(a.line,f),end:r(a.line,u)}}function pe(e,t,n){$(t,n)||kt.jumpList.add(e,t,n)}function he(e,t){kt.lastCharacterSearch.increment=e,kt.lastCharacterSearch.forward=t.forward,kt.lastCharacterSearch.selectedCharacter=t.selectedCharacter}function me(e,t,n,i){var o=H(e.getCursor()),a=n?1:-1,s=n?e.lineCount():-1,l=o.ch,c=o.line,u=e.getLine(c),f={lineText:u,nextCh:u.charAt(l),lastCh:null,index:l,symb:i,reverseSymb:(n?{")":"(","}":"{"}:{"(":")","{":"}"})[i],forward:n,depth:0,curMoveThrough:!1},d=Lt[i];if(!d)return o;var p=Tt[d].init,h=Tt[d].isComplete;for(p&&p(f);c!==s&&t;){if(f.index+=a,f.nextCh=f.lineText.charAt(f.index),!f.nextCh){if(c+=a,f.lineText=e.getLine(c)||"",a>0)f.index=0;else{var m=f.lineText.length;f.index=m>0?m-1:0}f.nextCh=f.lineText.charAt(f.index)}h(f)&&(o.line=c,o.ch=f.index,t--)}return f.nextCh||f.curMoveThrough?r(c,f.index):o}function ge(e,t,n,r,i){var o=t.line,a=t.ch,s=e.getLine(o),l=n?1:-1,c=r?ft:ut;if(i&&""==s){if(o+=l,s=e.getLine(o),!d(e,o))return null;a=n?0:s.length}for(;;){if(i&&""==s)return{from:0,to:0,line:o};for(var u=l>0?s.length:-1,f=u,p=u;a!=u;){for(var h=!1,m=0;m0?0:s.length}}function ve(e,t,n,i,o,a){var s=H(t),l=[];(i&&!o||!i&&o)&&n++;for(var c=!(i&&o),u=0;u0;)s(p,i)&&n--,p+=i;return new r(p,0)}var h=e.state.vim;if(h.visualLine&&s(u,1,!0)){var m=h.sel.anchor;s(m.line,-1,!0)&&(o&&m.line==u||(u+=1))}var g=a(u);for(p=u;p<=d&&n;p++)s(p,1,!0)&&(o&&a(p)==g||n--);for(c=new r(p,0),p>d&&!g?g=!0:o=!1,p=u;p>f&&(o&&a(p)!=g&&p!=u||!s(p,-1,!0));p--);return l=new r(p,0),{start:l,end:c}}function _e(e,t,n,i){var o,a,s=t,l={"(":/[()]/,")":/[()]/,"[":/[[\]]/,"]":/[[\]]/,"{":/[{}]/,"}":/[{}]/}[n],c={"(":"(",")":"(","[":"[","]":"[","{":"{","}":"{"}[n],u=e.getLine(s.line).charAt(s.ch),f=u===c?1:0;if(o=e.scanForBracket(r(s.line,s.ch+f),-1,null,{bracketRegex:l}),a=e.scanForBracket(r(s.line,s.ch+f),1,null,{bracketRegex:l}),!o||!a)return{start:s,end:s};if(o=o.pos,a=a.pos,o.line==a.line&&o.ch>a.ch||o.line>a.line){var d=o;o=a,a=d}return i?a.ch+=1:o.ch+=1,{start:o,end:a}}function Ce(e,t,n,i){var o,a,s,l,c=H(t),u=e.getLine(c.line),f=u.split(""),d=f.indexOf(n);if(c.ch-1&&!o;s--)f[s]==n&&(o=s+1);else o=c.ch+1;if(o&&!a)for(s=o,l=f.length;s'+t+"",{bottom:!0,duration:5e3}):alert(t)}function qe(e,t){var n=''+(e||"")+'';return t&&(n+=' '+t+""),n}function Pe(e,t){var n=(t.prefix||"")+" "+(t.desc||""),r=qe(t.prefix,t.desc);Le(e,r,n,t.onClose,t)}function Re(e,t){if(e instanceof RegExp&&t instanceof RegExp){for(var n=["global","multiline","ignoreCase","source"],r=0;r=t&&e<=n:e==t}function $e(e){var t=e.getScrollInfo(),n=6,r=10,i=e.coordsChar({left:0,top:n+t.top},"local"),o=t.clientHeight-r+t.top,a=e.coordsChar({left:0,top:o},"local");return{top:i.line,bottom:a.line}}function Ue(t,n,r,i,o,a,s,l,c){function u(){t.operation(function(){for(;!m;)f(),d();p()})}function f(){var e=t.getRange(a.from(),a.to()),n=e.replace(s,l);a.replace(n)}function d(){for(;a.findNext()&&He(a.from(),i,o);)if(r||!g||a.from().line!=g.line)return t.scrollIntoView(a.from(),30),t.setSelection(a.from(),a.to()),g=a.from(),void(m=!1);m=!0}function p(e){if(e&&e(),t.focus(),g){t.setCursor(g);var n=t.state.vim;n.exMode=!1,n.lastHPos=n.lastHSPos=g.ch}c&&c()}function h(n,r,i){e.e_stop(n);var o=e.keyName(n);switch(o){case"Y":f(),d();break;case"N":d();break;case"A":var a=c;c=void 0,t.operation(u),c=a;break;case"L":f();case"Q":case"Esc":case"Ctrl-C":case"Ctrl-[":p(i)}return m&&p(i),!0}t.state.vim.exMode=!0;var m=!1,g=a.from();return d(),m?void Ne(t,"No matches for "+s.source):n?void Pe(t,{prefix:"replace with "+l+" (y/n/a/q/l)",onKeyDown:h}):(u(),void(c&&c()))}function Ke(t){var n=t.state.vim,r=kt.macroModeState,i=kt.registerController.getRegister("."),o=r.isPlaying,a=r.lastInsertModeChanges,s=[];if(!o){for(var l=a.inVisualBlock?n.lastSelection.visualBlock.height:1,c=a.changes,s=[],u=0;u1&&(ot(t,n,n.insertModeRepeat-1,!0),n.lastEditInputState.repeatOverride=n.insertModeRepeat),delete n.insertModeRepeat,n.insertMode=!1,t.setCursor(t.getCursor().line,t.getCursor().ch-1),t.setOption("keyMap","vim"),t.setOption("disableInput",!0),t.toggleOverwrite(!1),i.setText(a.changes.join("")),e.signal(t,"vim-mode-change",{mode:"normal"}),r.isRecording&&Ye(r)}function Ve(e){t.unshift(e)}function Ge(e,t,n,r,i){var o={keys:e,type:t};o[t]=n,o[t+"Args"]=r;for(var a in i)o[a]=i[a];Ve(o)}function Xe(t,n,r,i){var o=kt.registerController.getRegister(i);if(":"==i)return o.keyBuffer[0]&&Nt.processCommand(t,o.keyBuffer[0]),void(r.isPlaying=!1);var a=o.keyBuffer,s=0;r.isPlaying=!0,r.replaySearchQueries=o.searchQueries.slice(0);for(var l=0;l|<\w+>|./.exec(f),u=c[0],f=f.substring(c.index+u.length),e.Vim.handleKey(t,u,"macro"),n.insertMode){var d=o.insertModeChanges[s++].changes;kt.macroModeState.lastInsertModeChanges.changes=d,at(t,d,1),Ke(t)}r.isPlaying=!1}function Ze(e,t){if(!e.isPlaying){var n=e.latestRegister,r=kt.registerController.getRegister(n);r&&r.pushText(t)}}function Ye(e){if(!e.isPlaying){var t=e.latestRegister,n=kt.registerController.getRegister(t);n&&n.pushInsertModeChanges&&n.pushInsertModeChanges(e.lastInsertModeChanges)}}function Qe(e,t){if(!e.isPlaying){var n=e.latestRegister,r=kt.registerController.getRegister(n);r&&r.pushSearchQuery&&r.pushSearchQuery(t)}}function Je(e,t){var n=kt.macroModeState,r=n.lastInsertModeChanges;if(!n.isPlaying)for(;t;){if(r.expectCursorActivityForChange=!0,"+input"==t.origin||"paste"==t.origin||void 0===t.origin){var i=t.text.join("\n");r.maybeReset&&(r.changes=[],r.maybeReset=!1),r.changes.push(i)}t=t.next}}function et(e){var t=e.state.vim;if(t.insertMode){var n=kt.macroModeState;if(n.isPlaying)return;var r=n.lastInsertModeChanges;r.expectCursorActivityForChange?r.expectCursorActivityForChange=!1:r.maybeReset=!0}else e.curOp.isVimOp||nt(e,t);t.visualMode&&tt(e)}function tt(e){var t=e.state.vim,n=q(e,H(t.sel.head)),r=R(n,0,1);t.fakeCursor&&t.fakeCursor.clear(),t.fakeCursor=e.markText(n,r,{className:"cm-animate-fat-cursor"})}function nt(t,n){var r=t.getCursor("anchor"),i=t.getCursor("head");if(n.visualMode&&!t.somethingSelected()?le(t,!1):n.visualMode||n.insertMode||!t.somethingSelected()||(n.visualMode=!0,n.visualLine=!1,e.signal(t,"vim-mode-change",{mode:"visual"})),n.visualMode){var o=U(i,r)?0:-1,a=U(i,r)?-1:0;i=R(i,0,o),r=R(r,0,a),n.sel={anchor:r,head:i},ke(t,n,"<",K(i,r)),ke(t,n,">",V(i,r))}else n.insertMode||(n.lastHPos=t.getCursor().ch)}function rt(e){this.keyName=e}function it(t){function n(){return i.maybeReset&&(i.changes=[],i.maybeReset=!1),i.changes.push(new rt(o)),!0}var r=kt.macroModeState,i=r.lastInsertModeChanges,o=e.keyName(t);o&&(o.indexOf("Delete")==-1&&o.indexOf("Backspace")==-1||e.lookupKey(o,"vim-insert",n))}function ot(e,t,n,r){function i(){s?_t.processAction(e,t,t.lastEditActionCommand):_t.evalInput(e,t)}function o(n){if(a.lastInsertModeChanges.changes.length>0){n=t.lastEditActionCommand?n:1;var r=a.lastInsertModeChanges;at(e,r.changes,n)}}var a=kt.macroModeState;a.isPlaying=!0;var s=!!t.lastEditActionCommand,l=t.inputState;if(t.inputState=t.lastEditInputState,s&&t.lastEditActionCommand.interlaceInsertRepeat)for(var c=0;c"]),gt=[].concat(dt,pt,ht,["-",'"',".",":","/"]),vt={};b("filetype",void 0,"string",["ft"],function(e,t){if(void 0!==t){if(void 0===e){var n=t.getOption("mode");return"null"==n?"":n}var n=""==e?"null":e;t.setOption("mode",n)}});var yt=function(){function e(e,t,s){function l(t){var i=++r%n,o=a[i];o&&o.clear(),a[i]=e.setBookmark(t)}var c=r%n,u=a[c];if(u){var f=u.find();f&&!$(f,t)&&l(t)}else l(t);l(s),i=r,o=r-n+1,o<0&&(o=0)}function t(e,t){r+=t,r>i?r=i:r0?1:-1,u=e.getCursor();do if(r+=c,s=a[(n+r)%n],s&&(l=s.find())&&!$(u,l))break;while(ro)}return s}var n=100,r=-1,i=0,o=0,a=new Array(n);return{cachedCursor:void 0,add:e,move:t}},bt=function(e){return e?{changes:e.changes,expectCursorActivityForChange:e.expectCursorActivityForChange}:{changes:[],expectCursorActivityForChange:!1}};w.prototype={exitMacroRecordMode:function(){var e=kt.macroModeState;e.onRecordingDone&&e.onRecordingDone(),e.onRecordingDone=void 0,e.isRecording=!1},enterMacroRecordMode:function(e,t){var n=kt.registerController.getRegister(t); +n&&(n.clear(),this.latestRegister=t,e.openDialog&&(this.onRecordingDone=e.openDialog("(recording)["+t+"]",null,{bottom:!0})),this.isRecording=!0)}};var kt,xt,wt={buildKeyMap:function(){},getRegisterController:function(){return kt.registerController},resetVimGlobalState_:C,getVimGlobalState_:function(){return kt},maybeInitVimState_:_,suppressErrorLogging:!1,InsertModeKey:rt,map:function(e,t,n){Nt.map(e,t,n)},unmap:function(e,t){Nt.unmap(e,t)},setOption:k,getOption:x,defineOption:b,defineEx:function(e,t,n){if(t){if(0!==e.indexOf(t))throw new Error('(Vim.defineEx) "'+t+'" is not a prefix of "'+e+'", command not registered')}else t=e;It[e]=n,Nt.commandMap_[t]={name:e,shortName:t,type:"api"}},handleKey:function(e,t,n){var r=this.findKey(e,t,n);if("function"==typeof r)return r()},findKey:function(n,r,i){function o(){var e=kt.macroModeState;if(e.isRecording){if("q"==r)return e.exitMacroRecordMode(),M(n),!0;"mapping"!=i&&Ze(e,r)}}function a(){if(""==r)return M(n),f.visualMode?le(n):f.insertMode&&Ke(n),!0}function s(t){for(var i;t;)i=/<\w+-.+?>|<\w+>|./.exec(t),r=i[0],t=t.substring(i.index+r.length),e.Vim.handleKey(n,r,"mapping")}function l(){if(a())return!0;for(var e=f.inputState.keyBuffer=f.inputState.keyBuffer+r,i=1==r.length,o=_t.matchCommand(e,t,f.inputState,"insert");e.length>1&&"full"!=o.type;){var e=f.inputState.keyBuffer=e.slice(1),s=_t.matchCommand(e,t,f.inputState,"insert");"none"!=s.type&&(o=s)}if("none"==o.type)return M(n),!1;if("partial"==o.type)return xt&&window.clearTimeout(xt),xt=window.setTimeout(function(){f.insertMode&&f.inputState.keyBuffer&&M(n)},x("insertModeEscKeysTimeout")),!i;if(xt&&window.clearTimeout(xt),i){for(var l=n.listSelections(),c=0;c0||this.motionRepeat.length>0)&&(e=1,this.prefixRepeat.length>0&&(e*=parseInt(this.prefixRepeat.join(""),10)),this.motionRepeat.length>0&&(e*=parseInt(this.motionRepeat.join(""),10))),e},L.prototype={setText:function(e,t,n){this.keyBuffer=[e||""],this.linewise=!!t,this.blockwise=!!n},pushText:function(e,t){t&&(this.linewise||this.keyBuffer.push("\n"),this.linewise=!0),this.keyBuffer.push(e)},pushInsertModeChanges:function(e){this.insertModeChanges.push(bt(e))},pushSearchQuery:function(e){this.searchQueries.push(e)},clear:function(){this.keyBuffer=[],this.insertModeChanges=[],this.searchQueries=[],this.linewise=!1},toString:function(){return this.keyBuffer.join("")}},A.prototype={pushText:function(e,t,n,r,i){r&&"\n"==n.charAt(0)&&(n=n.slice(1)+"\n"),r&&"\n"!==n.charAt(n.length-1)&&(n+="\n");var o=this.isValidRegister(e)?this.getRegister(e):null;if(!o){switch(t){case"yank":this.registers[0]=new L(n,r,i);break;case"delete":case"change":n.indexOf("\n")==-1?this.registers["-"]=new L(n,r):(this.shiftNumericRegisters_(),this.registers[1]=new L(n,r))}return void this.unnamedRegister.setText(n,r,i)}var a=g(e);a?o.pushText(n,r):o.setText(n,r,i),this.unnamedRegister.setText(o.toString(),r)},getRegister:function(e){return this.isValidRegister(e)?(e=e.toLowerCase(),this.registers[e]||(this.registers[e]=new L),this.registers[e]):this.unnamedRegister},isValidRegister:function(e){return e&&y(e,gt)},shiftNumericRegisters_:function(){for(var e=9;e>=2;e--)this.registers[e]=this.getRegister(""+(e-1))}},E.prototype={nextMatch:function(e,t){var n=this.historyBuffer,r=t?-1:1;null===this.initialPrefix&&(this.initialPrefix=e);for(var i=this.iterator+r;t?i>=0:i=n.length?(this.iterator=n.length,this.initialPrefix):i<0?e:void 0},pushInput:function(e){var t=this.historyBuffer.indexOf(e);t>-1&&this.historyBuffer.splice(t,1),e.length&&this.historyBuffer.push(e)},reset:function(){this.initialPrefix=null,this.iterator=this.historyBuffer.length}};var _t={matchCommand:function(e,t,n,r){var i=D(e,t,r,n);if(!i.full&&!i.partial)return{type:"none"};if(!i.full&&i.partial)return{type:"partial"};for(var o,a=0;a"==o.keys.slice(-11)&&(n.selectedCharacter=B(e)),{type:"full",command:o}},processCommand:function(e,t,n){switch(t.inputState.repeatOverride=n.repeatOverride,n.type){case"motion":this.processMotion(e,t,n);break;case"operator":this.processOperator(e,t,n);break;case"operatorMotion":this.processOperatorMotion(e,t,n);break;case"action":this.processAction(e,t,n);break;case"search":this.processSearch(e,t,n);break;case"ex":case"keyToEx":this.processEx(e,t,n)}},processMotion:function(e,t,n){t.inputState.motion=n.motion,t.inputState.motionArgs=P(n.motionArgs),this.evalInput(e,t)},processOperator:function(e,t,n){var r=t.inputState;if(r.operator){if(r.operator==n.operator)return r.motion="expandToLine",r.motionArgs={linewise:!0},void this.evalInput(e,t);M(e)}r.operator=n.operator,r.operatorArgs=P(n.operatorArgs),t.visualMode&&this.evalInput(e,t)},processOperatorMotion:function(e,t,n){var r=t.visualMode,i=P(n.operatorMotionArgs);i&&r&&i.visualLine&&(t.visualLine=!0),this.processOperator(e,t,n),r||this.processMotion(e,t,n)},processAction:function(e,t,n){var r=t.inputState,i=r.getRepeat(),o=!!i,a=P(n.actionArgs)||{};r.selectedCharacter&&(a.selectedCharacter=r.selectedCharacter),n.operator&&this.processOperator(e,t,n),n.motion&&this.processMotion(e,t,n),(n.motion||n.operator)&&this.evalInput(e,t),a.repeat=i||1,a.repeatIsExplicit=o,a.registerName=r.registerName,M(e),t.lastMotion=null,n.isEdit&&this.recordLastEdit(t,r,n),Mt[n.action](e,a,t)},processSearch:function(t,n,r){function i(e,i,o){kt.searchHistoryController.pushInput(e),kt.searchHistoryController.reset();try{je(t,e,i,o)}catch(a){return Ne(t,"Invalid regex: "+e),void M(t)}_t.processMotion(t,n,{type:"motion",motion:"findNext",motionArgs:{forward:!0,toJumplist:r.searchArgs.toJumplist}})}function o(e){t.scrollTo(d.left,d.top),i(e,!0,!0);var n=kt.macroModeState;n.isRecording&&Qe(n,e)}function a(n,r,i){var o,a=e.keyName(n);"Up"==a||"Down"==a?(o="Up"==a,r=kt.searchHistoryController.nextMatch(r,o)||"",i(r)):"Left"!=a&&"Right"!=a&&"Ctrl"!=a&&"Alt"!=a&&"Shift"!=a&&kt.searchHistoryController.reset();var s;try{s=je(t,r,!0,!0)}catch(n){}s?t.scrollIntoView(Be(t,!l,s),30):(Fe(t),t.scrollTo(d.left,d.top))}function s(n,r,i){var o=e.keyName(n);"Esc"==o||"Ctrl-C"==o||"Ctrl-["==o||"Backspace"==o&&""==r?(kt.searchHistoryController.pushInput(r),kt.searchHistoryController.reset(),je(t,f),Fe(t),t.scrollTo(d.left,d.top),e.e_stop(n),M(t),i(),t.focus()):"Ctrl-U"==o&&(e.e_stop(n),i(""))}if(t.getSearchCursor){var l=r.searchArgs.forward,c=r.searchArgs.wholeWordOnly;Me(t).setReversed(!l);var u=l?"/":"?",f=Me(t).getQuery(),d=t.getScrollInfo();switch(r.searchArgs.querySrc){case"prompt":var p=kt.macroModeState;if(p.isPlaying){var h=p.replaySearchQueries.shift();i(h,!0,!1)}else Pe(t,{onClose:o,prefix:u,desc:zt,onKeyUp:a,onKeyDown:s});break;case"wordUnderCursor":var m=de(t,!1,!0,!1,!0),g=!0;if(m||(m=de(t,!1,!0,!1,!1),g=!1),!m)return;var h=t.getLine(m.start.line).substring(m.start.ch,m.end.ch);h=g&&c?"\\b"+h+"\\b":Y(h),kt.jumpList.cachedCursor=t.getCursor(),t.setCursor(m.start),i(h,!0,!1)}}},processEx:function(t,n,r){function i(e){kt.exCommandHistoryController.pushInput(e),kt.exCommandHistoryController.reset(),Nt.processCommand(t,e)}function o(n,r,i){var o,a=e.keyName(n);("Esc"==a||"Ctrl-C"==a||"Ctrl-["==a||"Backspace"==a&&""==r)&&(kt.exCommandHistoryController.pushInput(r),kt.exCommandHistoryController.reset(),e.e_stop(n),M(t),i(),t.focus()),"Up"==a||"Down"==a?(o="Up"==a,r=kt.exCommandHistoryController.nextMatch(r,o)||"",i(r)):"Ctrl-U"==a?(e.e_stop(n),i("")):"Left"!=a&&"Right"!=a&&"Ctrl"!=a&&"Alt"!=a&&"Shift"!=a&&kt.exCommandHistoryController.reset()}"keyToEx"==r.type?Nt.processCommand(t,r.exArgs.input):n.visualMode?Pe(t,{onClose:i,prefix:":",value:"'<,'>",onKeyDown:o}):Pe(t,{onClose:i,prefix:":",onKeyDown:o})},evalInput:function(e,t){var n,i,o,a=t.inputState,s=a.motion,l=a.motionArgs||{},c=a.operator,u=a.operatorArgs||{},f=a.registerName,d=t.sel,p=H(t.visualMode?q(e,d.head):e.getCursor("head")),h=H(t.visualMode?q(e,d.anchor):e.getCursor("anchor")),m=H(p),g=H(h);if(c&&this.recordLastEdit(t,a),o=void 0!==a.repeatOverride?a.repeatOverride:a.getRepeat(),o>0&&l.explicitRepeat?l.repeatIsExplicit=!0:(l.noRepeat||!l.explicitRepeat&&0===o)&&(o=1,l.repeatIsExplicit=!1),a.selectedCharacter&&(l.selectedCharacter=u.selectedCharacter=a.selectedCharacter),l.repeat=o,M(e),s){var v=Ct[s](e,p,l,t);if(t.lastMotion=Ct[s],!v)return;if(l.toJumplist){var y=kt.jumpList,b=y.cachedCursor;b?(pe(e,b,v),delete y.cachedCursor):pe(e,p,v)}v instanceof Array?(i=v[0],n=v[1]):n=v,n||(n=H(p)),t.visualMode?(t.visualBlock&&n.ch===1/0||(n=q(e,n,t.visualBlock)),i&&(i=q(e,i,!0)),i=i||g,d.anchor=i,d.head=n,oe(e),ke(e,t,"<",U(i,n)?i:n),ke(e,t,">",U(i,n)?n:i)):c||(n=q(e,n),e.setCursor(n.line,n.ch))}if(c){if(u.lastSel){i=g;var k=u.lastSel,x=Math.abs(k.head.line-k.anchor.line),w=Math.abs(k.head.ch-k.anchor.ch);n=k.visualLine?r(g.line+x,g.ch):k.visualBlock?r(g.line+x,g.ch+w):k.head.line==k.anchor.line?r(g.line,g.ch+w):r(g.line+x,g.ch),t.visualMode=!0,t.visualLine=k.visualLine,t.visualBlock=k.visualBlock,d=t.sel={anchor:i,head:n},oe(e)}else t.visualMode&&(u.lastSel={anchor:H(d.anchor),head:H(d.head),visualBlock:t.visualBlock,visualLine:t.visualLine});var _,C,S,L,T;if(t.visualMode){if(_=K(d.head,d.anchor),C=V(d.head,d.anchor),S=t.visualLine||u.linewise,L=t.visualBlock?"block":S?"line":"char",T=ae(e,{anchor:_,head:C},L),S){var A=T.ranges;if("block"==L)for(var E=0;Eu&&o.line==u?this.moveToEol(e,t,n,i):(n.toFirstChar&&(a=fe(e.getLine(l)),i.lastHPos=a),i.lastHSPos=e.charCoords(r(l,a),"div").left,r(l,a))},moveByDisplayLines:function(e,t,n,i){var o=t;switch(i.lastMotion){case this.moveByDisplayLines:case this.moveByScroll:case this.moveByLines:case this.moveToColumn:case this.moveToEol:break;default:i.lastHSPos=e.charCoords(o,"div").left}var a=n.repeat,s=e.findPosV(o,n.forward?a:-a,"line",i.lastHSPos);if(s.hitSide)if(n.forward)var l=e.charCoords(s,"div"),c={top:l.top+8,left:i.lastHSPos},s=e.coordsChar(c,"div");else{var u=e.charCoords(r(e.firstLine(),0),"div");u.left=i.lastHSPos,s=e.coordsChar(u,"div")}return i.lastHPos=s.ch,s},moveByPage:function(e,t,n){var r=t,i=n.repeat;return e.findPosV(r,n.forward?i:-i,"page")},moveByParagraph:function(e,t,n){var r=n.forward?1:-1;return we(e,t,n.repeat,r)},moveByScroll:function(e,t,n,r){var i=e.getScrollInfo(),o=null,a=n.repeat;a||(a=i.clientHeight/(2*e.defaultTextHeight()));var s=e.charCoords(t,"local");n.repeat=a;var o=Ct.moveByDisplayLines(e,t,n,r);if(!o)return null;var l=e.charCoords(o,"local");return e.scrollTo(null,i.top+l.top-s.top),o},moveByWords:function(e,t,n){return ve(e,t,n.repeat,!!n.forward,!!n.wordEnd,!!n.bigWord)},moveTillCharacter:function(e,t,n){var r=n.repeat,i=ye(e,r,n.forward,n.selectedCharacter),o=n.forward?-1:1;return he(o,n),i?(i.ch+=o,i):null},moveToCharacter:function(e,t,n){var r=n.repeat;return he(0,n),ye(e,r,n.forward,n.selectedCharacter)||t},moveToSymbol:function(e,t,n){var r=n.repeat;return me(e,r,n.forward,n.selectedCharacter)||t},moveToColumn:function(e,t,n,r){var i=n.repeat;return r.lastHPos=i-1,r.lastHSPos=e.charCoords(t,"div").left,be(e,i)},moveToEol:function(e,t,n,i){var o=t;i.lastHPos=1/0;var a=r(o.line+n.repeat-1,1/0),s=e.clipPos(a);return s.ch--,i.lastHSPos=e.charCoords(s,"div").left,a},moveToFirstNonWhiteSpaceCharacter:function(e,t){var n=t;return r(n.line,fe(e.getLine(n.line)))},moveToMatchedSymbol:function(e,t){var n,i=t,o=i.line,a=i.ch,s=e.getLine(o);do if(n=s.charAt(a++),n&&h(n)){var l=e.getTokenTypeAt(r(o,a));if("string"!==l&&"comment"!==l)break}while(n);if(n){var c=e.findMatchingBracket(r(o,a));return c.to}return i},moveToStartOfLine:function(e,t){return r(t.line,0)},moveToLineOrEdgeOfDocument:function(e,t,n){var i=n.forward?e.lastLine():e.firstLine();return n.repeatIsExplicit&&(i=n.repeat-e.getOption("firstLineNumber")),r(i,fe(e.getLine(i)))},textObjectManipulation:function(e,t,n,r){var i={"(":")",")":"(","{":"}","}":"{","[":"]","]":"["},o={"'":!0,'"':!0},a=n.selectedCharacter;"b"==a?a="(":"B"==a&&(a="{");var s,l=!n.textObjectInner;if(i[a])s=_e(e,t,a,l);else if(o[a])s=Ce(e,t,a,l);else if("W"===a)s=de(e,l,!0,!0);else if("w"===a)s=de(e,l,!0,!1);else{if("p"!==a)return null;if(s=we(e,t,n.repeat,0,l),n.linewise=!0,r.visualMode)r.visualLine||(r.visualLine=!0);else{var c=r.inputState.operatorArgs;c&&(c.linewise=!0),s.end.line--}}return e.state.vim.visualMode?ie(e,s.start,s.end):[s.start,s.end]},repeatLastCharacterSearch:function(e,t,n){var r=kt.lastCharacterSearch,i=n.repeat,o=n.forward===r.forward,a=(r.increment?1:0)*(o?-1:1);e.moveH(-a,"char"),n.inclusive=!!o;var s=ye(e,i,o,r.selectedCharacter);return s?(s.ch+=a,s):(e.moveH(a,"char"),t)}},St={change:function(t,n,i){var o,a,s=t.state.vim;if(kt.macroModeState.lastInsertModeChanges.inVisualBlock=s.visualBlock,s.visualMode){a=t.getSelection();var l=O("",i.length);t.replaceSelections(l),o=K(i[0].head,i[0].anchor)}else{var c=i[0].anchor,u=i[0].head;a=t.getRange(c,u);var f=s.lastEditInputState||{};if("moveByWords"==f.motion&&!v(a)){var d=/\s+$/.exec(a);d&&f.motionArgs&&f.motionArgs.forward&&(u=R(u,0,-d[0].length),a=a.slice(0,-d[0].length))}var p=new r(c.line-1,Number.MAX_VALUE),h=t.firstLine()==t.lastLine();u.line>t.lastLine()&&n.linewise&&!h?t.replaceRange("",p,u):t.replaceRange("",c,u),n.linewise&&(h||(t.setCursor(p),e.commands.newlineAndIndent(t)),c.ch=Number.MAX_VALUE),o=c}kt.registerController.pushText(n.registerName,"change",a,n.linewise,i.length>1),Mt.enterInsertMode(t,{head:o},t.state.vim)},"delete":function(e,t,n){var i,o,a=e.state.vim;if(a.visualBlock){o=e.getSelection();var s=O("",n.length);e.replaceSelections(s),i=n[0].anchor}else{var l=n[0].anchor,c=n[0].head;t.linewise&&c.line!=e.firstLine()&&l.line==e.lastLine()&&l.line==c.line-1&&(l.line==e.firstLine()?l.ch=0:l=r(l.line-1,X(e,l.line-1))),o=e.getRange(l,c),e.replaceRange("",l,c),i=l,t.linewise&&(i=Ct.moveToFirstNonWhiteSpaceCharacter(e,l))}return kt.registerController.pushText(t.registerName,"delete",o,t.linewise,a.visualBlock),q(e,i)},indent:function(e,t,n){var r=e.state.vim,i=n[0].anchor.line,o=r.visualBlock?n[n.length-1].anchor.line:n[0].head.line,a=r.visualMode?t.repeat:1;t.linewise&&o--;for(var s=i;s<=o;s++)for(var l=0;lc.top?(l.line+=(s-c.top)/i,l.line=Math.ceil(l.line),e.setCursor(l),c=e.charCoords(l,"local"),e.scrollTo(null,c.top)):e.scrollTo(null,s);else{var u=s+e.getScrollInfo().clientHeight;u=a.anchor.line?R(a.head,0,1):r(a.anchor.line,0);else if("inplace"==o&&i.visualMode)return;t.setOption("disableInput",!1),n&&n.replace?(t.toggleOverwrite(!0),t.setOption("keyMap","vim-replace"),e.signal(t,"vim-mode-change",{mode:"replace"})):(t.toggleOverwrite(!1),t.setOption("keyMap","vim-insert"),e.signal(t,"vim-mode-change",{mode:"insert"})),kt.macroModeState.isPlaying||(t.on("change",Je),e.on(t.getInputField(),"keydown",it)),i.visualMode&&le(t),ee(t,s,l)}},toggleVisualMode:function(t,n,i){var o,a=n.repeat,s=t.getCursor();i.visualMode?i.visualLine^n.linewise||i.visualBlock^n.blockwise?(i.visualLine=!!n.linewise,i.visualBlock=!!n.blockwise,e.signal(t,"vim-mode-change",{mode:"visual",subMode:i.visualLine?"linewise":i.visualBlock?"blockwise":""}),oe(t)):le(t):(i.visualMode=!0,i.visualLine=!!n.linewise,i.visualBlock=!!n.blockwise,o=q(t,r(s.line,s.ch+a-1),!0),i.sel={anchor:s,head:o},e.signal(t,"vim-mode-change",{mode:"visual",subMode:i.visualLine?"linewise":i.visualBlock?"blockwise":""}),oe(t),ke(t,i,"<",K(s,o)),ke(t,i,">",V(s,o)))},reselectLastSelection:function(t,n,r){var i=r.lastSelection;if(r.visualMode&&re(t,r),i){var o=i.anchorMark.find(),a=i.headMark.find();if(!o||!a)return;r.sel={anchor:o,head:a},r.visualMode=!0,r.visualLine=i.visualLine,r.visualBlock=i.visualBlock,oe(t),ke(t,r,"<",K(o,a)),ke(t,r,">",V(o,a)),e.signal(t,"vim-mode-change",{mode:"visual",subMode:r.visualLine?"linewise":r.visualBlock?"blockwise":""})}},joinLines:function(e,t,n){var i,o;if(n.visualMode){if(i=e.getCursor("anchor"),o=e.getCursor("head"),U(o,i)){var a=o;o=i,i=a}o.ch=X(e,o.line)-1}else{var s=Math.max(t.repeat,2);i=e.getCursor(),o=q(e,r(i.line+s-1,1/0))}for(var l=0,c=i.line;c1)var a=Array(t.repeat+1).join(a);var h=o.linewise,m=o.blockwise;if(h)n.visualMode?a=n.visualLine?a.slice(0,-1):"\n"+a.slice(0,a.length-1)+"\n":t.after?(a="\n"+a.slice(0,a.length-1),i.ch=X(e,i.line)):i.ch=0;else{if(m){a=a.split("\n");for(var g=0;ge.lastLine()&&e.replaceRange("\n",r(M,0));var L=X(e,M);Lu.length&&(o=u.length),a=r(l.line,o)}if("\n"==s)i.visualMode||t.replaceRange("",l,a),(e.commands.newlineAndIndentContinueComment||e.commands.newlineAndIndent)(t);else{var f=t.getRange(l,a);if(f=f.replace(/[^\n]/g,s),i.visualBlock){var d=new Array(t.getOption("tabSize")+1).join(" ");f=t.getSelection(),f=f.replace(/\t/g,d).replace(/[^\n]/g,s).split("\n"),t.replaceSelections(f)}else t.replaceRange(f,l,a);i.visualMode?(l=U(c[0].anchor,c[0].head)?c[0].anchor:c[0].head,t.setCursor(l),le(t,!1)):t.setCursor(R(a,0,-1))}},incrementNumberToken:function(e,t){for(var n,i,o,a,s,l=e.getCursor(),c=e.getLine(l.line),u=/-?\d+/g;null!==(n=u.exec(c))&&(s=n[0],i=n.index,o=i+s.length,!(l.ch=1)return!0}else e.nextCh===e.reverseSymb&&e.depth--;return!1}},section:{init:function(e){e.curMoveThrough=!0,e.symb=(e.forward?"]":"[")===e.symb?"{":"}"},isComplete:function(e){return 0===e.index&&e.nextCh===e.symb}},comment:{isComplete:function(e){var t="*"===e.lastCh&&"/"===e.nextCh;return e.lastCh=e.nextCh,t}},method:{init:function(e){e.symb="m"===e.symb?"{":"}",e.reverseSymb="{"===e.symb?"}":"{"},isComplete:function(e){return e.nextCh===e.symb}},preprocess:{init:function(e){e.index=0},isComplete:function(e){if("#"===e.nextCh){var t=e.lineText.match(/#(\w+)/)[1];if("endif"===t){if(e.forward&&0===e.depth)return!0;e.depth++}else if("if"===t){if(!e.forward&&0===e.depth)return!0;e.depth--}if("else"===t&&0===e.depth)return!0}return!1}}};b("pcre",!0,"boolean"),Se.prototype={getQuery:function(){return kt.query},setQuery:function(e){kt.query=e},getOverlay:function(){return this.searchOverlay},setOverlay:function(e){this.searchOverlay=e},isReversed:function(){return kt.isReversed},setReversed:function(e){kt.isReversed=e},getScrollbarAnnotate:function(){return this.annotate},setScrollbarAnnotate:function(e){this.annotate=e}};var At={"\\n":"\n","\\r":"\r","\\t":"\t"},Et={"\\/":"/","\\\\":"\\","\\n":"\n","\\r":"\r","\\t":"\t"},zt="(Javascript regexp)",Ot=function(){this.buildCommandMap_()};Ot.prototype={processCommand:function(e,t,n){var r=this;e.operation(function(){e.curOp.isVimOp=!0,r._processCommand(e,t,n)})},_processCommand:function(t,n,r){var i=t.state.vim,o=kt.registerController.getRegister(":"),a=o.toString();i.visualMode&&le(t);var s=new e.StringStream(n);o.setText(n);var l=r||{};l.input=n;try{this.parseInput_(t,s,l)}catch(c){throw Ne(t,c),c}var u,f;if(l.commandName){if(u=this.matchCommand_(l.commandName)){if(f=u.name,u.excludeFromCommandHistory&&o.setText(a),this.parseCommandArgs_(s,l,u),"exToKey"==u.type){for(var d=0;d0;t--){var n=e.substring(0,t);if(this.commandMap_[n]){var r=this.commandMap_[n];if(0===r.name.indexOf(e))return r}}return null},buildCommandMap_:function(){this.commandMap_={};for(var e=0;e
";if(n){var o;n=n.join("");for(var a=0;a"}}else for(var o in r){var l=r[o].toString();l.length&&(i+='"'+o+" "+l+"
")}Ne(e,i)},sort:function(t,n){function i(){if(n.argString){var t=new e.StringStream(n.argString);if(t.eat("!")&&(a=!0),t.eol())return;if(!t.eatSpace())return"Invalid arguments";var r=t.match(/[a-z]+/);if(r){r=r[0],s=r.indexOf("i")!=-1,l=r.indexOf("u")!=-1;var i=r.indexOf("d")!=-1&&1,o=r.indexOf("x")!=-1&&1,u=r.indexOf("o")!=-1&&1;if(i+o+u>1)return"Invalid arguments";c=i&&"decimal"||o&&"hex"||u&&"octal"}if(t.match(/\/.*\//))return"patterns not supported"}}function o(e,t){if(a){var n;n=e,e=t,t=n}s&&(e=e.toLowerCase(),t=t.toLowerCase());var r=c&&g.exec(e),i=c&&g.exec(t);return r?(r=parseInt((r[1]+r[2]).toLowerCase(),v),i=parseInt((i[1]+i[2]).toLowerCase(),v),r-i):e")}if(!r)return void Ne(e,f);var h=0,m=function(){if(h=u)return void Ne(t,"Invalid argument: "+n.argString.substring(o));for(var f=0;f<=u-c;f++){var d=String.fromCharCode(c+f);delete r.marks[d]}}else delete r.marks[a]}}},Nt=new Ot;return e.keyMap.vim={attach:s,detach:a,call:l},b("insertModeEscKeysTimeout",200,"number"),e.keyMap["vim-insert"]={fallthrough:["default"],attach:s,detach:a,call:l},e.keyMap["vim-replace"]={Backspace:"goCharLeft",fallthrough:["vim-insert"],attach:s,detach:a,call:l},C(),wt};e.Vim=i()}); \ No newline at end of file diff --git a/public/vendor/codemirror/compress.sh b/public/vendor/codemirror/compress.sh index 678df9b1..8ee71a8f 100644 --- a/public/vendor/codemirror/compress.sh +++ b/public/vendor/codemirror/compress.sh @@ -30,7 +30,7 @@ addon/fold/foldgutter.js \ addon/fold/markdown-fold.js \ addon/fold/xml-fold.js \ mode/xml/xml.js \ -mode/markdown/markdown.js \ +mode/markdown/markdown_math.js \ mode/gfm/gfm.js \ mode/javascript/javascript.js \ mode/css/css.js \ @@ -45,7 +45,7 @@ mode/php/php.js \ mode/sql/sql.js \ mode/coffeescript/coffeescript.js \ mode/yaml/yaml.js \ -mode/jade/jade.js \ +mode/pug/pug.js \ mode/lua/lua.js \ mode/cmake/cmake.js \ mode/nginx/nginx.js \ diff --git a/public/vendor/codemirror/keymap/vim.js b/public/vendor/codemirror/keymap/vim.js index afed132e..a166f72b 100644 --- a/public/vendor/codemirror/keymap/vim.js +++ b/public/vendor/codemirror/keymap/vim.js @@ -780,8 +780,12 @@ if (lastInsertModeKeyTimer) { window.clearTimeout(lastInsertModeKeyTimer); } if (keysAreChars) { - var here = cm.getCursor(); - cm.replaceRange('', offsetCursor(here, 0, -(keys.length - 1)), here, '+input'); + var selections = cm.listSelections(); + for (var i = 0; i < selections.length; i++) { + var here = selections[i].head; + cm.replaceRange('', offsetCursor(here, 0, -(keys.length - 1)), here, '+input'); + } + vimGlobalState.macroModeState.lastInsertModeChanges.changes.pop(); } clearInputState(cm); return match.command; @@ -818,7 +822,7 @@ // TODO: Look into using CodeMirror's multi-key handling. // Return no-op since we are caching the key. Counts as handled, but // don't want act on it just yet. - return function() {}; + return function() { return true; }; } else { return function() { return cm.operation(function() { @@ -4874,6 +4878,10 @@ if (changeObj.origin == '+input' || changeObj.origin == 'paste' || changeObj.origin === undefined /* only in testing */) { var text = changeObj.text.join('\n'); + if (lastChange.maybeReset) { + lastChange.changes = []; + lastChange.maybeReset = false; + } lastChange.changes.push(text); } // Change objects may be chained with next. @@ -4896,7 +4904,7 @@ lastChange.expectCursorActivityForChange = false; } else { // Cursor moved outside the context of an edit. Reset the change. - lastChange.changes = []; + lastChange.maybeReset = true; } } else if (!cm.curOp.isVimOp) { handleExternalSelection(cm, vim); @@ -4960,6 +4968,10 @@ var keyName = CodeMirror.keyName(e); if (!keyName) { return; } function onKeyFound() { + if (lastChange.maybeReset) { + lastChange.changes = []; + lastChange.maybeReset = false; + } lastChange.changes.push(new InsertModeKey(keyName)); return true; } diff --git a/public/vendor/codemirror/lib/codemirror.js b/public/vendor/codemirror/lib/codemirror.js index 2c7829b2..b77c1518 100644 --- a/public/vendor/codemirror/lib/codemirror.js +++ b/public/vendor/codemirror/lib/codemirror.js @@ -592,8 +592,12 @@ var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft; var gutterW = display.gutters.offsetWidth, left = comp + "px"; for (var i = 0; i < view.length; i++) if (!view[i].hidden) { - if (cm.options.fixedGutter && view[i].gutter) - view[i].gutter.style.left = left; + if (cm.options.fixedGutter) { + if (view[i].gutter) + view[i].gutter.style.left = left; + if (view[i].gutterBackground) + view[i].gutterBackground.style.left = left; + } var align = view[i].alignable; if (align) for (var j = 0; j < align.length; j++) align[j].style.left = left; @@ -1149,7 +1153,7 @@ } function handlePaste(e, cm) { - var pasted = e.clipboardData && e.clipboardData.getData("text/plain"); + var pasted = e.clipboardData && e.clipboardData.getData("Text"); if (pasted) { e.preventDefault(); if (!cm.isReadOnly() && !cm.options.disableInput) @@ -1193,10 +1197,10 @@ return {text: text, ranges: ranges}; } - function disableBrowserMagic(field) { + function disableBrowserMagic(field, spellcheck) { field.setAttribute("autocorrect", "off"); field.setAttribute("autocapitalize", "off"); - field.setAttribute("spellcheck", "false"); + field.setAttribute("spellcheck", !!spellcheck); } // TEXTAREA INPUT STYLE @@ -1576,10 +1580,14 @@ init: function(display) { var input = this, cm = input.cm; var div = input.div = display.lineDiv; - disableBrowserMagic(div); + disableBrowserMagic(div, cm.options.spellcheck); on(div, "paste", function(e) { - if (!signalDOMEvent(cm, e)) handlePaste(e, cm); + if (signalDOMEvent(cm, e) || handlePaste(e, cm)) return + // IE doesn't fire input events, so we schedule a read for the pasted content in this way + if (ie_version <= 11) setTimeout(operation(cm, function() { + if (!input.pollContent()) regChange(cm); + }), 20) }) on(div, "compositionstart", function(e) { @@ -1639,23 +1647,27 @@ }); } } - // iOS exposes the clipboard API, but seems to discard content inserted into it - if (e.clipboardData && !ios) { - e.preventDefault(); + if (e.clipboardData) { e.clipboardData.clearData(); - e.clipboardData.setData("text/plain", lastCopied.text.join("\n")); - } else { - // Old-fashioned briefly-focus-a-textarea hack - var kludge = hiddenTextarea(), te = kludge.firstChild; - cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild); - te.value = lastCopied.text.join("\n"); - var hadFocus = document.activeElement; - selectInput(te); - setTimeout(function() { - cm.display.lineSpace.removeChild(kludge); - hadFocus.focus(); - }, 50); + var content = lastCopied.text.join("\n") + // iOS exposes the clipboard API, but seems to discard content inserted into it + e.clipboardData.setData("Text", content); + if (e.clipboardData.getData("Text") == content) { + e.preventDefault(); + return + } } + // Old-fashioned briefly-focus-a-textarea hack + var kludge = hiddenTextarea(), te = kludge.firstChild; + cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild); + te.value = lastCopied.text.join("\n"); + var hadFocus = document.activeElement; + selectInput(te); + setTimeout(function() { + cm.display.lineSpace.removeChild(kludge); + hadFocus.focus(); + if (hadFocus == div) input.showPrimarySelection() + }, 50); } on(div, "copy", onCopyCut); on(div, "cut", onCopyCut); @@ -1963,7 +1975,7 @@ if (found) return badPos(Pos(found.line, found.ch + dist), bad); else - dist += after.textContent.length; + dist += before.textContent.length; } } @@ -3533,8 +3545,8 @@ on(inp, "keyup", function(e) { onKeyUp.call(cm, e); }); on(inp, "keydown", operation(cm, onKeyDown)); on(inp, "keypress", operation(cm, onKeyPress)); - on(inp, "focus", bind(onFocus, cm)); - on(inp, "blur", bind(onBlur, cm)); + on(inp, "focus", function (e) { onFocus(cm, e); }); + on(inp, "blur", function (e) { onBlur(cm, e); }); } function dragDropChanged(cm, value, old) { @@ -4262,12 +4274,12 @@ }, 100); } - function onFocus(cm) { + function onFocus(cm, e) { if (cm.state.delayingBlurEvent) cm.state.delayingBlurEvent = false; if (cm.options.readOnly == "nocursor") return; if (!cm.state.focused) { - signal(cm, "focus", cm); + signal(cm, "focus", cm, e); cm.state.focused = true; addClass(cm.display.wrapper, "CodeMirror-focused"); // This test prevents this from firing when a context @@ -4281,11 +4293,11 @@ } restartBlink(cm); } - function onBlur(cm) { + function onBlur(cm, e) { if (cm.state.delayingBlurEvent) return; if (cm.state.focused) { - signal(cm, "blur", cm); + signal(cm, "blur", cm, e); cm.state.focused = false; rmClass(cm.display.wrapper, "CodeMirror-focused"); } @@ -4907,7 +4919,8 @@ var doc = cm.doc, x = pos.left, y; if (unit == "page") { var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight); - y = pos.top + dir * (pageSize - (dir < 0 ? 1.5 : .5) * textHeight(cm.display)); + var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3); + y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount; } else if (unit == "line") { y = dir > 0 ? pos.bottom + 3 : pos.top - 3; } @@ -4960,7 +4973,10 @@ addOverlay: methodOp(function(spec, options) { var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec); if (mode.startState) throw new Error("Overlays may not be stateful."); - this.state.overlays.push({mode: mode, modeSpec: spec, opaque: options && options.opaque}); + insertSorted(this.state.overlays, + {mode: mode, modeSpec: spec, opaque: options && options.opaque, + priority: (options && options.priority) || 0}, + function(overlay) { return overlay.priority }) this.state.modeGen++; regChange(this); }), @@ -5432,6 +5448,9 @@ option("inputStyle", mobile ? "contenteditable" : "textarea", function() { throw new Error("inputStyle can not (yet) be changed in a running editor"); // FIXME }, true); + option("spellcheck", false, function(cm, val) { + cm.getInputField().spellcheck = val + }, true); option("rtlMoveVisually", !windows); option("wholeLineUpdateBefore", true); @@ -5541,6 +5560,8 @@ spec.name = found.name; } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) { return CodeMirror.resolveMode("application/xml"); + } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+json$/.test(spec)) { + return CodeMirror.resolveMode("application/json"); } if (typeof spec == "string") return {name: spec}; else return spec || {name: "null"}; @@ -6852,7 +6873,7 @@ } if (!flattenSpans || curStyle != style) { while (curStart < stream.start) { - curStart = Math.min(stream.start, curStart + 50000); + curStart = Math.min(stream.start, curStart + 5000); f(curStart, curStyle); } curStyle = style; @@ -6860,8 +6881,10 @@ stream.start = stream.pos; } while (curStart < stream.pos) { - // Webkit seems to refuse to render text nodes longer than 57444 characters - var pos = Math.min(stream.pos, curStart + 50000); + // Webkit seems to refuse to render text nodes longer than 57444 + // characters, and returns inaccurate measurements in nodes + // starting around 5000 chars. + var pos = Math.min(stream.pos, curStart + 5000); f(pos, curStyle); curStart = pos; } @@ -7970,7 +7993,7 @@ } // Register a change in the history. Merges changes that are within - // a single operation, ore are close together with an origin that + // a single operation, or are close together with an origin that // allows merging (starting with "+") into a single event. function addChangeToHistory(doc, change, selAfter, opId) { if(change.origin == "ignoreHistory") return; @@ -8374,6 +8397,12 @@ return out; } + function insertSorted(array, value, score) { + var pos = 0, priority = score(value) + while (pos < array.length && score(array[pos]) <= priority) pos++ + array.splice(pos, 0, value) + } + function nothing() {} function createObj(base, props) { @@ -8942,7 +8971,7 @@ // THE END - CodeMirror.version = "5.17.1"; + CodeMirror.version = "5.19.0"; return CodeMirror; }); diff --git a/public/vendor/codemirror/mode/cypher/cypher.js b/public/vendor/codemirror/mode/cypher/cypher.js index 107e4f6d..f99abe23 100644 --- a/public/vendor/codemirror/mode/cypher/cypher.js +++ b/public/vendor/codemirror/mode/cypher/cypher.js @@ -62,7 +62,7 @@ var curPunc; var funcs = wordRegexp(["abs", "acos", "allShortestPaths", "asin", "atan", "atan2", "avg", "ceil", "coalesce", "collect", "cos", "cot", "count", "degrees", "e", "endnode", "exp", "extract", "filter", "floor", "haversin", "head", "id", "keys", "labels", "last", "left", "length", "log", "log10", "lower", "ltrim", "max", "min", "node", "nodes", "percentileCont", "percentileDisc", "pi", "radians", "rand", "range", "reduce", "rel", "relationship", "relationships", "replace", "reverse", "right", "round", "rtrim", "shortestPath", "sign", "sin", "size", "split", "sqrt", "startnode", "stdev", "stdevp", "str", "substring", "sum", "tail", "tan", "timestamp", "toFloat", "toInt", "toString", "trim", "type", "upper"]); var preds = wordRegexp(["all", "and", "any", "contains", "exists", "has", "in", "none", "not", "or", "single", "xor"]); - var keywords = wordRegexp(["as", "asc", "ascending", "assert", "by", "case", "commit", "constraint", "create", "csv", "cypher", "delete", "desc", "descending", "detach", "distinct", "drop", "else", "end", "ends", "explain", "false", "fieldterminator", "foreach", "from", "headers", "in", "index", "is", "join", "limit", "load", "match", "merge", "null", "on", "optional", "order", "periodic", "profile", "remove", "return", "scan", "set", "skip", "start", "starts", "then", "true", "union", "unique", "unwind", "using", "when", "where", "with"]); + var keywords = wordRegexp(["as", "asc", "ascending", "assert", "by", "case", "commit", "constraint", "create", "csv", "cypher", "delete", "desc", "descending", "detach", "distinct", "drop", "else", "end", "ends", "explain", "false", "fieldterminator", "foreach", "from", "headers", "in", "index", "is", "join", "limit", "load", "match", "merge", "null", "on", "optional", "order", "periodic", "profile", "remove", "return", "scan", "set", "skip", "start", "starts", "then", "true", "union", "unique", "unwind", "using", "when", "where", "with", "call", "yield"]); var operatorChars = /[*+\-<>=&|~%^]/; return { diff --git a/public/vendor/codemirror/mode/erlang/erlang.js b/public/vendor/codemirror/mode/erlang/erlang.js index 5aed76a5..9528e19f 100644 --- a/public/vendor/codemirror/mode/erlang/erlang.js +++ b/public/vendor/codemirror/mode/erlang/erlang.js @@ -433,15 +433,16 @@ CodeMirror.defineMode("erlang", function(cmCfg) { } function maybe_drop_post(s) { + if (!s.length) return s var last = s.length-1; if (s[last].type === "dot") { return []; } - if (s[last].type === "fun" && s[last-1].token === "fun") { + if (last > 1 && s[last].type === "fun" && s[last-1].token === "fun") { return s.slice(0,last-1); } - switch (s[s.length-1].token) { + switch (s[last].token) { case "}": return d(s,{g:["{"]}); case "]": return d(s,{i:["["]}); case ")": return d(s,{i:["("]}); diff --git a/public/vendor/codemirror/mode/htmlmixed/htmlmixed.js b/public/vendor/codemirror/mode/htmlmixed/htmlmixed.js index d74083ee..eb21fcc1 100644 --- a/public/vendor/codemirror/mode/htmlmixed/htmlmixed.js +++ b/public/vendor/codemirror/mode/htmlmixed/htmlmixed.js @@ -46,7 +46,7 @@ function getAttrValue(text, attr) { var match = text.match(getAttrRegexp(attr)) - return match ? match[2] : "" + return match ? /^\s*(.*?)\s*$/.exec(match[2])[1] : "" } function getTagRegexp(tagName, anchored) { diff --git a/public/vendor/codemirror/mode/index.html b/public/vendor/codemirror/mode/index.html index 732e0e52..3a2fe551 100644 --- a/public/vendor/codemirror/mode/index.html +++ b/public/vendor/codemirror/mode/index.html @@ -76,7 +76,6 @@ option.

  • HTTP
  • IDL
  • Java
  • -
  • Jade
  • JavaScript (JSX)
  • Jinja2
  • Julia
  • @@ -107,6 +106,7 @@ option.

  • PowerShell
  • Properties files
  • ProtoBuf
  • +
  • Pug
  • Puppet
  • Python
  • Q
  • diff --git a/public/vendor/codemirror/mode/javascript/javascript.js b/public/vendor/codemirror/mode/javascript/javascript.js index da6b760f..e2356074 100644 --- a/public/vendor/codemirror/mode/javascript/javascript.js +++ b/public/vendor/codemirror/mode/javascript/javascript.js @@ -1,8 +1,6 @@ // CodeMirror, copyright (c) by Marijn Haverbeke and others // Distributed under an MIT license: http://codemirror.net/LICENSE -// TODO actually recognize syntax of TypeScript constructs - (function(mod) { if (typeof exports == "object" && typeof module == "object") // CommonJS mod(require("../../lib/codemirror")); @@ -56,6 +54,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { "namespace": C, "module": kw("module"), "enum": kw("module"), + "type": kw("type"), // scope modifiers "public": kw("modifier"), @@ -345,19 +344,19 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { function statement(type, value) { if (type == "var") return cont(pushlex("vardef", value.length), vardef, expect(";"), poplex); - if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex); + if (type == "keyword a") return cont(pushlex("form"), parenExpr, statement, poplex); if (type == "keyword b") return cont(pushlex("form"), statement, poplex); if (type == "{") return cont(pushlex("}"), block, poplex); if (type == ";") return cont(); if (type == "if") { if (cx.state.lexical.info == "else" && cx.state.cc[cx.state.cc.length - 1] == poplex) cx.state.cc.pop()(); - return cont(pushlex("form"), expression, statement, poplex, maybeelse); + return cont(pushlex("form"), parenExpr, statement, poplex, maybeelse); } if (type == "function") return cont(functiondef); if (type == "for") return cont(pushlex("form"), forspec, statement, poplex); if (type == "variable") return cont(pushlex("stat"), maybelabel); - if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"), + if (type == "switch") return cont(pushlex("form"), parenExpr, pushlex("}", "switch"), expect("{"), block, poplex, poplex); if (type == "case") return cont(expression, expect(":")); if (type == "default") return cont(expect(":")); @@ -367,6 +366,7 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { if (type == "export") return cont(pushlex("stat"), afterExport, poplex); if (type == "import") return cont(pushlex("stat"), afterImport, poplex); if (type == "module") return cont(pushlex("form"), pattern, pushlex("}"), expect("{"), block, poplex, poplex) + if (type == "type") return cont(typeexpr, expect("operator"), typeexpr, expect(";")); if (type == "async") return cont(statement) return pass(pushlex("stat"), expression, expect(";"), poplex); } @@ -376,6 +376,10 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { function expressionNoComma(type) { return expressionInner(type, true); } + function parenExpr(type) { + if (type != "(") return pass() + return cont(pushlex(")"), expression, expect(")"), poplex) + } function expressionInner(type, noComma) { if (cx.state.fatArrowAt == cx.stream.start) { var body = noComma ? arrowBodyNoComma : arrowBody; @@ -463,8 +467,10 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { if (type == "variable") {cx.marked = "property"; return cont();} } function objprop(type, value) { - if (type == "async") return cont(objprop); - if (type == "variable" || cx.style == "keyword") { + if (type == "async") { + cx.marked = "property"; + return cont(objprop); + } else if (type == "variable" || cx.style == "keyword") { cx.marked = "property"; if (value == "get" || value == "set") return cont(getterSetter); return cont(afterprop); @@ -479,6 +485,8 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { return cont(expression, expect("]"), afterprop); } else if (type == "spread") { return cont(expression); + } else if (type == ":") { + return pass(afterprop) } } function getterSetter(type) { @@ -517,14 +525,34 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { if (type == "}") return cont(); return pass(statement, block); } - function maybetype(type) { - if (isTS && type == ":") return cont(typeexpr); + function maybetype(type, value) { + if (isTS) { + if (type == ":") return cont(typeexpr); + if (value == "?") return cont(maybetype); + } } function maybedefault(_, value) { if (value == "=") return cont(expressionNoComma); } function typeexpr(type) { if (type == "variable") {cx.marked = "variable-3"; return cont(afterType);} + if (type == "{") return cont(commasep(typeprop, "}")) + if (type == "(") return cont(commasep(typearg, ")"), maybeReturnType) + } + function maybeReturnType(type) { + if (type == "=>") return cont(typeexpr) + } + function typeprop(type) { + if (type == "variable" || cx.style == "keyword") { + cx.marked = "property" + return cont(typeprop) + } else if (type == ":") { + return cont(typeexpr) + } + } + function typearg(type) { + if (type == "variable") return cont(typearg) + else if (type == ":") return cont(typeexpr) } function afterType(type, value) { if (value == "<") return cont(commasep(typeexpr, ">"), afterType) @@ -593,18 +621,19 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { if (type == "variable") {register(value); return cont(classNameAfter);} } function classNameAfter(type, value) { - if (value == "extends") return cont(expression, classNameAfter); + if (value == "extends") return cont(isTS ? typeexpr : expression, classNameAfter); if (type == "{") return cont(pushlex("}"), classBody, poplex); } function classBody(type, value) { if (type == "variable" || cx.style == "keyword") { - if (value == "static") { + if ((value == "static" || value == "get" || value == "set" || + (isTS && (value == "public" || value == "private" || value == "protected"))) && + cx.stream.match(/^\s+[\w$\xa1-\uffff]/, false)) { cx.marked = "keyword"; return cont(classBody); } cx.marked = "property"; - if (value == "get" || value == "set") return cont(classGetterSetter, functiondef, classBody); - return cont(functiondef, classBody); + return cont(isTS ? classfield : functiondef, classBody); } if (value == "*") { cx.marked = "keyword"; @@ -613,10 +642,9 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { if (type == ";") return cont(classBody); if (type == "}") return cont(); } - function classGetterSetter(type) { - if (type != "variable") return pass(); - cx.marked = "property"; - return cont(); + function classfield(type) { + if (type == ":") return cont(typeexpr) + return pass(functiondef) } function afterExport(_type, value) { if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); } @@ -685,14 +713,18 @@ CodeMirror.defineMode("javascript", function(config, parserConfig) { indent: function(state, textAfter) { if (state.tokenize == tokenComment) return CodeMirror.Pass; if (state.tokenize != tokenBase) return 0; - var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical; + var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, top // Kludge to prevent 'maybelse' from blocking lexical scope pops if (!/^\s*else\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) { var c = state.cc[i]; if (c == poplex) lexical = lexical.prev; else if (c != maybeelse) break; } - if (lexical.type == "stat" && firstChar == "}") lexical = lexical.prev; + while ((lexical.type == "stat" || lexical.type == "form") && + (firstChar == "}" || ((top = state.cc[state.cc.length - 1]) && + (top == maybeoperatorComma || top == maybeoperatorNoComma) && + !/^[,\.=+\-*:?[\(]/.test(textAfter)))) + lexical = lexical.prev; if (statementIndent && lexical.type == ")" && lexical.prev.type == "stat") lexical = lexical.prev; var type = lexical.type, closing = firstChar == type; diff --git a/public/vendor/codemirror/mode/javascript/test.js b/public/vendor/codemirror/mode/javascript/test.js index 8916b755..91c8b743 100644 --- a/public/vendor/codemirror/mode/javascript/test.js +++ b/public/vendor/codemirror/mode/javascript/test.js @@ -31,7 +31,7 @@ MT("class", "[keyword class] [def Point] [keyword extends] [variable SuperThing] {", - " [property get] [property prop]() { [keyword return] [number 24]; }", + " [keyword get] [property prop]() { [keyword return] [number 24]; }", " [property constructor]([def x], [def y]) {", " [keyword super]([string 'something']);", " [keyword this].[property x] [operator =] [variable-2 x];", @@ -140,6 +140,19 @@ " [number 1];", "[number 2];"); + MT("indent_semicolonless_if", + "[keyword function] [def foo]() {", + " [keyword if] ([variable x])", + " [variable foo]()", + "}") + + MT("indent_semicolonless_if_with_statement", + "[keyword function] [def foo]() {", + " [keyword if] ([variable x])", + " [variable foo]()", + " [variable bar]()", + "}") + MT("multilinestring", "[keyword var] [def x] [operator =] [string 'foo\\]", "[string bar'];"); @@ -167,6 +180,23 @@ " }", "}"); + var ts_mode = CodeMirror.getMode({indentUnit: 2}, "application/typescript") + function TS(name) { + test.mode(name, ts_mode, Array.prototype.slice.call(arguments, 1)) + } + + TS("extend_type", + "[keyword class] [def Foo] [keyword extends] [variable-3 Some][operator <][variable-3 Type][operator >] {}") + + TS("arrow_type", + "[keyword let] [def x]: ([variable arg]: [variable-3 Type]) [operator =>] [variable-3 ReturnType]") + + TS("typescript_class", + "[keyword class] [def Foo] {", + " [keyword public] [keyword static] [property main]() {}", + " [keyword private] [property _foo]: [variable-3 string];", + "}") + var jsonld_mode = CodeMirror.getMode( {indentUnit: 2}, {name: "javascript", jsonld: true} diff --git a/public/vendor/codemirror/mode/jsx/index.html b/public/vendor/codemirror/mode/jsx/index.html index cb51edb3..1054bbcc 100644 --- a/public/vendor/codemirror/mode/jsx/index.html +++ b/public/vendor/codemirror/mode/jsx/index.html @@ -84,6 +84,6 @@ var editor = CodeMirror.fromTextArea(document.getElementById("code"), {

    JSX Mode for React's JavaScript syntax extension.

    -

    MIME types defined: text/jsx.

    +

    MIME types defined: text/jsx, text/typescript-jsx.

    diff --git a/public/vendor/codemirror/mode/jsx/jsx.js b/public/vendor/codemirror/mode/jsx/jsx.js index aff01b8d..45c3024a 100644 --- a/public/vendor/codemirror/mode/jsx/jsx.js +++ b/public/vendor/codemirror/mode/jsx/jsx.js @@ -144,4 +144,5 @@ }, "xml", "javascript") CodeMirror.defineMIME("text/jsx", "jsx") + CodeMirror.defineMIME("text/typescript-jsx", {name: "jsx", base: {name: "javascript", typescript: true}}) }); diff --git a/public/vendor/codemirror/mode/livescript/livescript.js b/public/vendor/codemirror/mode/livescript/livescript.js index 4b26e046..1e363f87 100644 --- a/public/vendor/codemirror/mode/livescript/livescript.js +++ b/public/vendor/codemirror/mode/livescript/livescript.js @@ -50,7 +50,7 @@ startState: function(){ return { next: 'start', - lastToken: null + lastToken: {style: null, indent: 0, content: ""} }; }, token: function(stream, state){ diff --git a/public/vendor/codemirror/mode/markdown/markdown_math.js b/public/vendor/codemirror/mode/markdown/markdown_math.js new file mode 100644 index 00000000..e46adb79 --- /dev/null +++ b/public/vendor/codemirror/mode/markdown/markdown_math.js @@ -0,0 +1,864 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: http://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror"), require("../xml/xml"), require("../meta")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror", "../xml/xml", "../meta"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) { + + var htmlMode = CodeMirror.getMode(cmCfg, "text/html"); + var htmlModeMissing = htmlMode.name == "null" + + function getMode(name) { + if (CodeMirror.findModeByName) { + var found = CodeMirror.findModeByName(name); + if (found) name = found.mime || found.mimes[0]; + } + var mode = CodeMirror.getMode(cmCfg, name); + return mode.name == "null" ? null : mode; + } + + // Should characters that affect highlighting be highlighted separate? + // Does not include characters that will be output (such as `1.` and `-` for lists) + if (modeCfg.highlightFormatting === undefined) + modeCfg.highlightFormatting = false; + + // Maximum number of nested blockquotes. Set to 0 for infinite nesting. + // Excess `>` will emit `error` token. + if (modeCfg.maxBlockquoteDepth === undefined) + modeCfg.maxBlockquoteDepth = 0; + + // Should underscores in words open/close em/strong? + if (modeCfg.underscoresBreakWords === undefined) + modeCfg.underscoresBreakWords = true; + + // Use `fencedCodeBlocks` to configure fenced code blocks. false to + // disable, string to specify a precise regexp that the fence should + // match, and true to allow three or more backticks or tildes (as + // per CommonMark). + + // Turn on task lists? ("- [ ] " and "- [x] ") + if (modeCfg.taskLists === undefined) modeCfg.taskLists = false; + + // Turn on strikethrough syntax + if (modeCfg.strikethrough === undefined) + modeCfg.strikethrough = false; + + // Allow token types to be overridden by user-provided token types. + if (modeCfg.tokenTypeOverrides === undefined) + modeCfg.tokenTypeOverrides = {}; + + var tokenTypes = { + header: "header", + code: "comment", + math: "math", + quote: "quote", + list1: "variable-2", + list2: "variable-3", + list3: "keyword", + hr: "hr", + image: "image", + imageAltText: "image-alt-text", + imageMarker: "image-marker", + formatting: "formatting", + linkInline: "link", + linkEmail: "link", + linkText: "link", + linkHref: "string", + em: "em", + strong: "strong", + strikethrough: "strikethrough" + }; + + for (var tokenType in tokenTypes) { + if (tokenTypes.hasOwnProperty(tokenType) && modeCfg.tokenTypeOverrides[tokenType]) { + tokenTypes[tokenType] = modeCfg.tokenTypeOverrides[tokenType]; + } + } + + var hrRE = /^([*\-_])(?:\s*\1){2,}\s*$/ + , ulRE = /^[*\-+]\s+/ + , olRE = /^[0-9]+([.)])\s+/ + , taskListRE = /^\[(x| )\](?=\s)/ // Must follow ulRE or olRE + , atxHeaderRE = modeCfg.allowAtxHeaderWithoutSpace ? /^(#+)/ : /^(#+)(?: |$)/ + , setextHeaderRE = /^ *(?:\={1,}|-{1,})\s*$/ + , textRE = /^[^#!\[\]*_\\<>\$` "'(~]+/ + , fencedCodeRE = new RegExp("^(" + (modeCfg.fencedCodeBlocks === true ? "~~~+|```+" : modeCfg.fencedCodeBlocks) + + ")[ \\t]*([\\w+#\-]*)") + , fencedMathRE = new RegExp("^(\$\$)[ \\t]*([\\w+#\-]*)"); + + function switchInline(stream, state, f) { + state.f = state.inline = f; + return f(stream, state); + } + + function switchBlock(stream, state, f) { + state.f = state.block = f; + return f(stream, state); + } + + function lineIsEmpty(line) { + return !line || !/\S/.test(line.string) + } + + // Blocks + + function blankLine(state) { + // Reset linkTitle state + state.linkTitle = false; + // Reset EM state + state.em = false; + // Reset STRONG state + state.strong = false; + // Reset strikethrough state + state.strikethrough = false; + // Reset state.quote + state.quote = 0; + // Reset state.indentedCode + state.indentedCode = false; + if (htmlModeMissing && state.f == htmlBlock) { + state.f = inlineNormal; + state.block = blockNormal; + } + // Reset state.trailingSpace + state.trailingSpace = 0; + state.trailingSpaceNewLine = false; + // Mark this line as blank + state.prevLine = state.thisLine + state.thisLine = null + return null; + } + + function blockNormal(stream, state) { + + var sol = stream.sol(); + + var prevLineIsList = state.list !== false, + prevLineIsIndentedCode = state.indentedCode; + + state.indentedCode = false; + + if (prevLineIsList) { + if (state.indentationDiff >= 0) { // Continued list + if (state.indentationDiff < 4) { // Only adjust indentation if *not* a code block + state.indentation -= state.indentationDiff; + } + state.list = null; + } else if (state.indentation > 0) { + state.list = null; + } else { // No longer a list + state.list = false; + } + } + + var match = null; + if (state.indentationDiff >= 4) { + stream.skipToEnd(); + if (prevLineIsIndentedCode || lineIsEmpty(state.prevLine)) { + state.indentation -= 4; + state.indentedCode = true; + return tokenTypes.code; + } else { + return null; + } + } else if (stream.eatSpace()) { + return null; + } else if ((match = stream.match(atxHeaderRE)) && match[1].length <= 6) { + state.header = match[1].length; + if (modeCfg.highlightFormatting) state.formatting = "header"; + state.f = state.inline; + return getType(state); + } else if (!lineIsEmpty(state.prevLine) && !state.quote && !prevLineIsList && + !prevLineIsIndentedCode && (match = stream.match(setextHeaderRE))) { + state.header = match[0].charAt(0) == '=' ? 1 : 2; + if (modeCfg.highlightFormatting) state.formatting = "header"; + state.f = state.inline; + return getType(state); + } else if (stream.eat('>')) { + state.quote = sol ? 1 : state.quote + 1; + if (modeCfg.highlightFormatting) state.formatting = "quote"; + stream.eatSpace(); + return getType(state); + } else if (stream.peek() === '[') { + return switchInline(stream, state, footnoteLink); + } else if (stream.match(hrRE, true)) { + state.hr = true; + return tokenTypes.hr; + } else if ((lineIsEmpty(state.prevLine) || prevLineIsList) && (stream.match(ulRE, false) || stream.match(olRE, false))) { + var listType = null; + if (stream.match(ulRE, true)) { + listType = 'ul'; + } else { + stream.match(olRE, true); + listType = 'ol'; + } + state.indentation = stream.column() + stream.current().length; + state.list = true; + + // While this list item's marker's indentation + // is less than the deepest list item's content's indentation, + // pop the deepest list item indentation off the stack. + while (state.listStack && stream.column() < state.listStack[state.listStack.length - 1]) { + state.listStack.pop(); + } + + // Add this list item's content's indentation to the stack + state.listStack.push(state.indentation); + + if (modeCfg.taskLists && stream.match(taskListRE, false)) { + state.taskList = true; + } + state.f = state.inline; + if (modeCfg.highlightFormatting) state.formatting = ["list", "list-" + listType]; + return getType(state); + } else if (modeCfg.fencedCodeBlocks && (match = stream.match(fencedCodeRE, true))) { + state.fencedChars = match[1] + // try switching mode + state.localMode = getMode(match[2]); + if (state.localMode) state.localState = CodeMirror.startState(state.localMode); + state.f = state.block = local; + if (modeCfg.highlightFormatting) state.formatting = "code-block"; + state.code = -1 + return getType(state); + } else if (match = stream.match(fencedCodeRE, true)) { + state.fencedChars = match[1] + // try switching mode + state.localMode = getMode(match[2]); + if (state.localMode) state.localState = CodeMirror.startState(state.localMode); + state.f = state.block = local; + state.formatting = "math"; + state.math = -1 + return getType(state); + } + + return switchInline(stream, state, state.inline); + } + + function htmlBlock(stream, state) { + var style = htmlMode.token(stream, state.htmlState); + if (!htmlModeMissing) { + var inner = CodeMirror.innerMode(htmlMode, state.htmlState) + if ((inner.mode.name == "xml" && inner.state.tagStart === null && + (!inner.state.context && inner.state.tokenize.isInText)) || + (state.md_inside && stream.current().indexOf(">") > -1)) { + state.f = inlineNormal; + state.block = blockNormal; + state.htmlState = null; + } + } + return style; + } + + function local(stream, state) { + if (state.fencedChars && stream.match(state.fencedChars, false)) { + state.localMode = state.localState = null; + state.f = state.block = leavingLocal; + return null; + } else if (state.localMode) { + return state.localMode.token(stream, state.localState); + } else { + stream.skipToEnd(); + if (state.math === -1) { + return tokenTypes.math; + } + return tokenTypes.code; + } + } + + function leavingLocal(stream, state) { + stream.match(state.fencedChars); + state.block = blockNormal; + state.f = inlineNormal; + state.fencedChars = null; + if (state.math === -1) { + state.formatting = "math"; + state.math = 1 + var returnType = getType(state); + state.math = 0 + return returnType; + } + if (modeCfg.highlightFormatting) state.formatting = "code-block"; + state.code = 1 + var returnType = getType(state); + state.code = 0 + return returnType; + } + + // Inline + function getType(state) { + var styles = []; + + if (state.formatting) { + styles.push(tokenTypes.formatting); + + if (typeof state.formatting === "string") state.formatting = [state.formatting]; + + for (var i = 0; i < state.formatting.length; i++) { + styles.push(tokenTypes.formatting + "-" + state.formatting[i]); + + if (state.formatting[i] === "header") { + styles.push(tokenTypes.formatting + "-" + state.formatting[i] + "-" + state.header); + } + + // Add `formatting-quote` and `formatting-quote-#` for blockquotes + // Add `error` instead if the maximum blockquote nesting depth is passed + if (state.formatting[i] === "quote") { + if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) { + styles.push(tokenTypes.formatting + "-" + state.formatting[i] + "-" + state.quote); + } else { + styles.push("error"); + } + } + } + } + + if (state.taskOpen) { + styles.push("meta"); + return styles.length ? styles.join(' ') : null; + } + if (state.taskClosed) { + styles.push("property"); + return styles.length ? styles.join(' ') : null; + } + + if (state.linkHref) { + styles.push(tokenTypes.linkHref, "url"); + } else { // Only apply inline styles to non-url text + if (state.strong) { styles.push(tokenTypes.strong); } + if (state.em) { styles.push(tokenTypes.em); } + if (state.strikethrough) { styles.push(tokenTypes.strikethrough); } + if (state.linkText) { styles.push(tokenTypes.linkText); } + if (state.code) { styles.push(tokenTypes.code); } + if (state.math) { styles.push(tokenTypes.math); } + if (state.image) { styles.push(tokenTypes.image); } + if (state.imageAltText) { styles.push(tokenTypes.imageAltText, "link"); } + if (state.imageMarker) { styles.push(tokenTypes.imageMarker); } + } + + if (state.header) { styles.push(tokenTypes.header, tokenTypes.header + "-" + state.header); } + + if (state.quote) { + styles.push(tokenTypes.quote); + + // Add `quote-#` where the maximum for `#` is modeCfg.maxBlockquoteDepth + if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) { + styles.push(tokenTypes.quote + "-" + state.quote); + } else { + styles.push(tokenTypes.quote + "-" + modeCfg.maxBlockquoteDepth); + } + } + + if (state.list !== false) { + var listMod = (state.listStack.length - 1) % 3; + if (!listMod) { + styles.push(tokenTypes.list1); + } else if (listMod === 1) { + styles.push(tokenTypes.list2); + } else { + styles.push(tokenTypes.list3); + } + } + + if (state.trailingSpaceNewLine) { + styles.push("trailing-space-new-line"); + } else if (state.trailingSpace) { + styles.push("trailing-space-" + (state.trailingSpace % 2 ? "a" : "b")); + } + + return styles.length ? styles.join(' ') : null; + } + + function handleText(stream, state) { + if (stream.match(textRE, true)) { + return getType(state); + } + return undefined; + } + + function inlineNormal(stream, state) { + var style = state.text(stream, state); + if (typeof style !== 'undefined') + return style; + + if (state.list) { // List marker (*, +, -, 1., etc) + state.list = null; + return getType(state); + } + + if (state.taskList) { + var taskOpen = stream.match(taskListRE, true)[1] !== "x"; + if (taskOpen) state.taskOpen = true; + else state.taskClosed = true; + if (modeCfg.highlightFormatting) state.formatting = "task"; + state.taskList = false; + return getType(state); + } + + state.taskOpen = false; + state.taskClosed = false; + + if (state.header && stream.match(/^#+$/, true)) { + if (modeCfg.highlightFormatting) state.formatting = "header"; + return getType(state); + } + + // Get sol() value now, before character is consumed + var sol = stream.sol(); + + var ch = stream.next(); + + // Matches link titles present on next line + if (state.linkTitle) { + state.linkTitle = false; + var matchCh = ch; + if (ch === '(') { + matchCh = ')'; + } + matchCh = (matchCh+'').replace(/([.?*+^$[\]\\(){}|-])/g, "\\$1"); + var regex = '^\\s*(?:[^' + matchCh + '\\\\]+|\\\\\\\\|\\\\.)' + matchCh; + if (stream.match(new RegExp(regex), true)) { + return tokenTypes.linkHref; + } + } + + // If this block is changed, it may need to be updated in GFM mode + if (ch === '`') { + var previousFormatting = state.formatting; + if (modeCfg.highlightFormatting) state.formatting = "code"; + stream.eatWhile('`'); + var count = stream.current().length + if (state.code == 0) { + state.code = count + return getType(state) + } else if (count == state.code) { // Must be exact + var t = getType(state) + state.code = 0 + return t + } else { + state.formatting = previousFormatting + return getType(state) + } + } else if (state.code) { + return getType(state); + } + + // display math correctly + if (ch === '$') { + var previousFormatting = state.formatting; + state.formatting = "math"; + stream.eatWhile('$'); + var count = stream.current().length + if (state.math == 0) { + state.math = count + return getType(state) + } else if (count == state.math) { // Must be exact + var t = getType(state) + state.math = 0 + return t + } else { + state.formatting = previousFormatting + return getType(state) + } + } else if (state.math) { + return getType(state); + } + + if (ch === '\\') { + stream.next(); + if (modeCfg.highlightFormatting) { + var type = getType(state); + var formattingEscape = tokenTypes.formatting + "-escape"; + return type ? type + " " + formattingEscape : formattingEscape; + } + } + + if (ch === '!' && stream.match(/\[[^\]]*\] ?(?:\(|\[)/, false)) { + state.imageMarker = true; + state.image = true; + if (modeCfg.highlightFormatting) state.formatting = "image"; + return getType(state); + } + + if (ch === '[' && state.imageMarker) { + state.imageMarker = false; + state.imageAltText = true + if (modeCfg.highlightFormatting) state.formatting = "image"; + return getType(state); + } + + if (ch === ']' && state.imageAltText) { + if (modeCfg.highlightFormatting) state.formatting = "image"; + var type = getType(state); + state.imageAltText = false; + state.image = false; + state.inline = state.f = linkHref; + return type; + } + + if (ch === '[' && stream.match(/[^\]]*\](\(.*\)| ?\[.*?\])/, false) && !state.image) { + state.linkText = true; + if (modeCfg.highlightFormatting) state.formatting = "link"; + return getType(state); + } + + if (ch === ']' && state.linkText && stream.match(/\(.*?\)| ?\[.*?\]/, false)) { + if (modeCfg.highlightFormatting) state.formatting = "link"; + var type = getType(state); + state.linkText = false; + state.inline = state.f = linkHref; + return type; + } + + if (ch === '<' && stream.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/, false)) { + state.f = state.inline = linkInline; + if (modeCfg.highlightFormatting) state.formatting = "link"; + var type = getType(state); + if (type){ + type += " "; + } else { + type = ""; + } + return type + tokenTypes.linkInline; + } + + if (ch === '<' && stream.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/, false)) { + state.f = state.inline = linkInline; + if (modeCfg.highlightFormatting) state.formatting = "link"; + var type = getType(state); + if (type){ + type += " "; + } else { + type = ""; + } + return type + tokenTypes.linkEmail; + } + + if (ch === '<' && stream.match(/^(!--|\w)/, false)) { + var end = stream.string.indexOf(">", stream.pos); + if (end != -1) { + var atts = stream.string.substring(stream.start, end); + if (/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(atts)) state.md_inside = true; + } + stream.backUp(1); + state.htmlState = CodeMirror.startState(htmlMode); + return switchBlock(stream, state, htmlBlock); + } + + if (ch === '<' && stream.match(/^\/\w*?>/)) { + state.md_inside = false; + return "tag"; + } + + var ignoreUnderscore = false; + if (!modeCfg.underscoresBreakWords) { + if (ch === '_' && stream.peek() !== '_' && stream.match(/(\w)/, false)) { + var prevPos = stream.pos - 2; + if (prevPos >= 0) { + var prevCh = stream.string.charAt(prevPos); + if (prevCh !== '_' && prevCh.match(/(\w)/, false)) { + ignoreUnderscore = true; + } + } + } + } + if (ch === '*' || (ch === '_' && !ignoreUnderscore)) { + if (sol && stream.peek() === ' ') { + // Do nothing, surrounded by newline and space + } else if (state.strong === ch && stream.eat(ch)) { // Remove STRONG + if (modeCfg.highlightFormatting) state.formatting = "strong"; + var t = getType(state); + state.strong = false; + return t; + } else if (!state.strong && stream.eat(ch)) { // Add STRONG + state.strong = ch; + if (modeCfg.highlightFormatting) state.formatting = "strong"; + return getType(state); + } else if (state.em === ch) { // Remove EM + if (modeCfg.highlightFormatting) state.formatting = "em"; + var t = getType(state); + state.em = false; + return t; + } else if (!state.em) { // Add EM + state.em = ch; + if (modeCfg.highlightFormatting) state.formatting = "em"; + return getType(state); + } + } else if (ch === ' ') { + if (stream.eat('*') || stream.eat('_')) { // Probably surrounded by spaces + if (stream.peek() === ' ') { // Surrounded by spaces, ignore + return getType(state); + } else { // Not surrounded by spaces, back up pointer + stream.backUp(1); + } + } + } + + if (modeCfg.strikethrough) { + if (ch === '~' && stream.eatWhile(ch)) { + if (state.strikethrough) {// Remove strikethrough + if (modeCfg.highlightFormatting) state.formatting = "strikethrough"; + var t = getType(state); + state.strikethrough = false; + return t; + } else if (stream.match(/^[^\s]/, false)) {// Add strikethrough + state.strikethrough = true; + if (modeCfg.highlightFormatting) state.formatting = "strikethrough"; + return getType(state); + } + } else if (ch === ' ') { + if (stream.match(/^~~/, true)) { // Probably surrounded by space + if (stream.peek() === ' ') { // Surrounded by spaces, ignore + return getType(state); + } else { // Not surrounded by spaces, back up pointer + stream.backUp(2); + } + } + } + } + + if (ch === ' ') { + if (stream.match(/ +$/, false)) { + state.trailingSpace++; + } else if (state.trailingSpace) { + state.trailingSpaceNewLine = true; + } + } + + return getType(state); + } + + function linkInline(stream, state) { + var ch = stream.next(); + + if (ch === ">") { + state.f = state.inline = inlineNormal; + if (modeCfg.highlightFormatting) state.formatting = "link"; + var type = getType(state); + if (type){ + type += " "; + } else { + type = ""; + } + return type + tokenTypes.linkInline; + } + + stream.match(/^[^>]+/, true); + + return tokenTypes.linkInline; + } + + function linkHref(stream, state) { + // Check if space, and return NULL if so (to avoid marking the space) + if(stream.eatSpace()){ + return null; + } + var ch = stream.next(); + if (ch === '(' || ch === '[') { + state.f = state.inline = getLinkHrefInside(ch === "(" ? ")" : "]", 0); + if (modeCfg.highlightFormatting) state.formatting = "link-string"; + state.linkHref = true; + return getType(state); + } + return 'error'; + } + + var linkRE = { + ")": /^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/, + "]": /^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\\]]|\\.)*\])*?(?=\])/ + } + + function getLinkHrefInside(endChar) { + return function(stream, state) { + var ch = stream.next(); + + if (ch === endChar) { + state.f = state.inline = inlineNormal; + if (modeCfg.highlightFormatting) state.formatting = "link-string"; + var returnState = getType(state); + state.linkHref = false; + return returnState; + } + + stream.match(linkRE[endChar]) + state.linkHref = true; + return getType(state); + }; + } + + function footnoteLink(stream, state) { + if (stream.match(/^([^\]\\]|\\.)*\]:/, false)) { + state.f = footnoteLinkInside; + stream.next(); // Consume [ + if (modeCfg.highlightFormatting) state.formatting = "link"; + state.linkText = true; + return getType(state); + } + return switchInline(stream, state, inlineNormal); + } + + function footnoteLinkInside(stream, state) { + if (stream.match(/^\]:/, true)) { + state.f = state.inline = footnoteUrl; + if (modeCfg.highlightFormatting) state.formatting = "link"; + var returnType = getType(state); + state.linkText = false; + return returnType; + } + + stream.match(/^([^\]\\]|\\.)+/, true); + + return tokenTypes.linkText; + } + + function footnoteUrl(stream, state) { + // Check if space, and return NULL if so (to avoid marking the space) + if(stream.eatSpace()){ + return null; + } + // Match URL + stream.match(/^[^\s]+/, true); + // Check for link title + if (stream.peek() === undefined) { // End of line, set flag to check next line + state.linkTitle = true; + } else { // More content on line, check if link title + stream.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/, true); + } + state.f = state.inline = inlineNormal; + return tokenTypes.linkHref + " url"; + } + + var mode = { + startState: function() { + return { + f: blockNormal, + + prevLine: null, + thisLine: null, + + block: blockNormal, + htmlState: null, + indentation: 0, + + inline: inlineNormal, + text: handleText, + + formatting: false, + linkText: false, + linkHref: false, + linkTitle: false, + code: 0, + math: 0, + em: false, + strong: false, + header: 0, + hr: false, + taskList: false, + list: false, + listStack: [], + quote: 0, + trailingSpace: 0, + trailingSpaceNewLine: false, + strikethrough: false, + fencedChars: null + }; + }, + + copyState: function(s) { + return { + f: s.f, + + prevLine: s.prevLine, + thisLine: s.thisLine, + + block: s.block, + htmlState: s.htmlState && CodeMirror.copyState(htmlMode, s.htmlState), + indentation: s.indentation, + + localMode: s.localMode, + localState: s.localMode ? CodeMirror.copyState(s.localMode, s.localState) : null, + + inline: s.inline, + text: s.text, + formatting: false, + linkTitle: s.linkTitle, + code: s.code, + math: s.math, + em: s.em, + strong: s.strong, + strikethrough: s.strikethrough, + header: s.header, + hr: s.hr, + taskList: s.taskList, + list: s.list, + listStack: s.listStack.slice(0), + quote: s.quote, + indentedCode: s.indentedCode, + trailingSpace: s.trailingSpace, + trailingSpaceNewLine: s.trailingSpaceNewLine, + md_inside: s.md_inside, + fencedChars: s.fencedChars + }; + }, + + token: function(stream, state) { + + // Reset state.formatting + state.formatting = false; + + if (stream != state.thisLine) { + var forceBlankLine = state.header || state.hr; + + // Reset state.header and state.hr + state.header = 0; + state.hr = false; + + if (stream.match(/^\s*$/, true) || forceBlankLine) { + blankLine(state); + if (!forceBlankLine) return null + state.prevLine = null + } + + state.prevLine = state.thisLine + state.thisLine = stream + + // Reset state.taskList + state.taskList = false; + + // Reset state.trailingSpace + state.trailingSpace = 0; + state.trailingSpaceNewLine = false; + + state.f = state.block; + var indentation = stream.match(/^\s*/, true)[0].replace(/\t/g, ' ').length; + state.indentationDiff = Math.min(indentation - state.indentation, 4); + state.indentation = state.indentation + state.indentationDiff; + if (indentation > 0) return null; + } + return state.f(stream, state); + }, + + innerMode: function(state) { + if (state.block == htmlBlock) return {state: state.htmlState, mode: htmlMode}; + if (state.localState) return {state: state.localState, mode: state.localMode}; + return {state: state, mode: mode}; + }, + + blankLine: blankLine, + + getType: getType, + + fold: "markdown" + }; + return mode; +}, "xml"); + +CodeMirror.defineMIME("text/x-markdown", "markdown"); + +}); diff --git a/public/vendor/codemirror/mode/mediawiki/img/black4.png b/public/vendor/codemirror/mode/mediawiki/img/black4.png index c66d7014..d34ee8e8 100755 Binary files a/public/vendor/codemirror/mode/mediawiki/img/black4.png and b/public/vendor/codemirror/mode/mediawiki/img/black4.png differ diff --git a/public/vendor/codemirror/mode/mediawiki/img/ext2.png b/public/vendor/codemirror/mode/mediawiki/img/ext2.png index d78a7429..e64c0564 100755 Binary files a/public/vendor/codemirror/mode/mediawiki/img/ext2.png and b/public/vendor/codemirror/mode/mediawiki/img/ext2.png differ diff --git a/public/vendor/codemirror/mode/mediawiki/img/ext4.png b/public/vendor/codemirror/mode/mediawiki/img/ext4.png index 11b439d4..87ef4e6b 100755 Binary files a/public/vendor/codemirror/mode/mediawiki/img/ext4.png and b/public/vendor/codemirror/mode/mediawiki/img/ext4.png differ diff --git a/public/vendor/codemirror/mode/mediawiki/img/link4.png b/public/vendor/codemirror/mode/mediawiki/img/link4.png index 07eca617..906d9a30 100755 Binary files a/public/vendor/codemirror/mode/mediawiki/img/link4.png and b/public/vendor/codemirror/mode/mediawiki/img/link4.png differ diff --git a/public/vendor/codemirror/mode/mediawiki/img/template4.png b/public/vendor/codemirror/mode/mediawiki/img/template4.png index 7eda15ab..d02f4222 100755 Binary files a/public/vendor/codemirror/mode/mediawiki/img/template4.png and b/public/vendor/codemirror/mode/mediawiki/img/template4.png differ diff --git a/public/vendor/codemirror/mode/mediawiki/img/template8.png b/public/vendor/codemirror/mode/mediawiki/img/template8.png index 4df75b05..f234e04c 100755 Binary files a/public/vendor/codemirror/mode/mediawiki/img/template8.png and b/public/vendor/codemirror/mode/mediawiki/img/template8.png differ diff --git a/public/vendor/codemirror/mode/meta.js b/public/vendor/codemirror/mode/meta.js index eb25e242..1e078eed 100644 --- a/public/vendor/codemirror/mode/meta.js +++ b/public/vendor/codemirror/mode/meta.js @@ -56,7 +56,7 @@ {name: "Gherkin", mime: "text/x-feature", mode: "gherkin", ext: ["feature"]}, {name: "GitHub Flavored Markdown", mime: "text/x-gfm", mode: "gfm", file: /^(readme|contributing|history).md$/i}, {name: "Go", mime: "text/x-go", mode: "go", ext: ["go"]}, - {name: "Groovy", mime: "text/x-groovy", mode: "groovy", ext: ["groovy", "gradle"]}, + {name: "Groovy", mime: "text/x-groovy", mode: "groovy", ext: ["groovy", "gradle"], file: /^Jenkinsfile$/}, {name: "HAML", mime: "text/x-haml", mode: "haml", ext: ["haml"]}, {name: "Haskell", mime: "text/x-haskell", mode: "haskell", ext: ["hs"]}, {name: "Haskell (Literate)", mime: "text/x-literate-haskell", mode: "haskell-literate", ext: ["lhs"]}, @@ -66,7 +66,7 @@ {name: "HTML", mime: "text/html", mode: "htmlmixed", ext: ["html", "htm"], alias: ["xhtml"]}, {name: "HTTP", mime: "message/http", mode: "http"}, {name: "IDL", mime: "text/x-idl", mode: "idl", ext: ["pro"]}, - {name: "Jade", mime: "text/x-jade", mode: "jade", ext: ["jade"]}, + {name: "Pug", mime: "text/x-pug", mode: "pug", ext: ["jade", "pug"], alias: ["jade"]}, {name: "Java", mime: "text/x-java", mode: "clike", ext: ["java"]}, {name: "Java Server Pages", mime: "application/x-jsp", mode: "htmlembedded", ext: ["jsp"], alias: ["jsp"]}, {name: "JavaScript", mimes: ["text/javascript", "text/ecmascript", "application/javascript", "application/x-javascript", "application/ecmascript"], diff --git a/public/vendor/codemirror/mode/jade/index.html b/public/vendor/codemirror/mode/pug/index.html similarity index 83% rename from public/vendor/codemirror/mode/jade/index.html rename to public/vendor/codemirror/mode/pug/index.html index e534981b..1765853a 100644 --- a/public/vendor/codemirror/mode/jade/index.html +++ b/public/vendor/codemirror/mode/pug/index.html @@ -1,6 +1,6 @@ -CodeMirror: Jade Templating Mode +CodeMirror: Pug Templating Mode @@ -10,7 +10,7 @@ - +
    -

    Jade Templating Mode

    +

    Pug Templating Mode

    -

    The Jade Templating Mode

    +

    The Pug Templating Mode

    Created by Forbes Lindesay. Managed as part of a Brackets extension at https://github.com/ForbesLindesay/jade-brackets.

    -

    MIME type defined: text/x-jade.

    +

    MIME type defined: text/x-pug, text/x-jade.

    diff --git a/public/vendor/codemirror/mode/jade/jade.js b/public/vendor/codemirror/mode/pug/pug.js similarity index 99% rename from public/vendor/codemirror/mode/jade/jade.js rename to public/vendor/codemirror/mode/pug/pug.js index 51ed105a..40182336 100644 --- a/public/vendor/codemirror/mode/jade/jade.js +++ b/public/vendor/codemirror/mode/pug/pug.js @@ -11,7 +11,7 @@ })(function(CodeMirror) { "use strict"; -CodeMirror.defineMode('jade', function (config) { +CodeMirror.defineMode("pug", function (config) { // token types var KEYWORD = 'keyword'; var DOCTYPE = 'meta'; @@ -585,6 +585,7 @@ CodeMirror.defineMode('jade', function (config) { }; }, 'javascript', 'css', 'htmlmixed'); -CodeMirror.defineMIME('text/x-jade', 'jade'); +CodeMirror.defineMIME('text/x-pug', 'pug'); +CodeMirror.defineMIME('text/x-jade', 'pug'); }); diff --git a/public/vendor/codemirror/mode/python/index.html b/public/vendor/codemirror/mode/python/index.html index 6116a13b..0ac02a33 100644 --- a/public/vendor/codemirror/mode/python/index.html +++ b/public/vendor/codemirror/mode/python/index.html @@ -176,7 +176,7 @@ def pairwise_cython(double[:, ::1] X):

    Configuration Options for Python mode:

      -
    • version - 2/3 - The version of Python to recognize. Default is 2.
    • +
    • version - 2/3 - The version of Python to recognize. Default is 3.
    • singleLineStringErrors - true/false - If you have a single-line string that is not terminated at the end of the line, this will show subsequent lines as errors if true, otherwise it will consider the newline as the end of the string. Default is false.
    • hangingIndent - int - If you want to write long arguments to a function starting on a new line, how much that line should be indented. Defaults to one normal indentation unit.
    diff --git a/public/vendor/codemirror/mode/python/python.js b/public/vendor/codemirror/mode/python/python.js index be65ad76..efeed7f1 100644 --- a/public/vendor/codemirror/mode/python/python.js +++ b/public/vendor/codemirror/mode/python/python.js @@ -55,7 +55,7 @@ if (parserConf.extra_builtins != undefined) myBuiltins = myBuiltins.concat(parserConf.extra_builtins); - var py3 = parserConf.version && parseInt(parserConf.version, 10) == 3 + var py3 = !(parserConf.version && Number(parserConf.version) < 3) if (py3) { // since http://legacy.python.org/dev/peps/pep-0465/ @ is also an operator var singleOperators = parserConf.singleOperators || /^[\+\-\*\/%&|\^~<>!@]/; @@ -185,7 +185,7 @@ } function tokenStringFactory(delimiter) { - while ("rub".indexOf(delimiter.charAt(0).toLowerCase()) >= 0) + while ("rubf".indexOf(delimiter.charAt(0).toLowerCase()) >= 0) delimiter = delimiter.substr(1); var singleline = delimiter.length == 1; diff --git a/public/vendor/codemirror/mode/sas/sas.js b/public/vendor/codemirror/mode/sas/sas.js old mode 100755 new mode 100644 index fe114827..a6109eb1 --- a/public/vendor/codemirror/mode/sas/sas.js +++ b/public/vendor/codemirror/mode/sas/sas.js @@ -137,12 +137,13 @@ stream.next(); return 'comment'; } - } else if (!state.continueString && (ch === '"' || ch === "'")) { - // Have we found a string? - state.continueString = ch; //save the matching quote in the state - return "string"; - } else if (state.continueString !== null) { - if (stream.skipTo(state.continueString)) { + } else if ((ch === '"' || ch === "'") && !state.continueString) { + state.continueString = ch + return "string" + } else if (state.continueString) { + if (state.continueString == ch) { + state.continueString = null; + } else if (stream.skipTo(state.continueString)) { // quote found on this line stream.next(); state.continueString = null; @@ -187,12 +188,12 @@ if (stream.peek() === '.') stream.skipTo(' '); state.nextword = false; return 'variable-2'; - } + word = word.toLowerCase() // Are we in a DATA Step? if (state.inDataStep) { - if (word.toLowerCase() === 'run;' || stream.match(/run\s;/)) { + if (word === 'run;' || stream.match(/run\s;/)) { state.inDataStep = false; return 'builtin'; } @@ -203,84 +204,84 @@ else return 'variable'; } // do we have a DATA Step keyword - if (word && words.hasOwnProperty(word.toLowerCase()) && - (words[word.toLowerCase()].state.indexOf("inDataStep") !== -1 || - words[word.toLowerCase()].state.indexOf("ALL") !== -1)) { + if (word && words.hasOwnProperty(word) && + (words[word].state.indexOf("inDataStep") !== -1 || + words[word].state.indexOf("ALL") !== -1)) { //backup to the start of the word if (stream.start < stream.pos) stream.backUp(stream.pos - stream.start); //advance the length of the word and return for (var i = 0; i < word.length; ++i) stream.next(); - return words[word.toLowerCase()].style; + return words[word].style; } } // Are we in an Proc statement? if (state.inProc) { - if (word.toLowerCase() === 'run;' || word.toLowerCase() === 'quit;') { + if (word === 'run;' || word === 'quit;') { state.inProc = false; return 'builtin'; } // do we have a proc keyword - if (word && words.hasOwnProperty(word.toLowerCase()) && - (words[word.toLowerCase()].state.indexOf("inProc") !== -1 || - words[word.toLowerCase()].state.indexOf("ALL") !== -1)) { + if (word && words.hasOwnProperty(word) && + (words[word].state.indexOf("inProc") !== -1 || + words[word].state.indexOf("ALL") !== -1)) { stream.match(/[\w]+/); return words[word].style; } } // Are we in a Macro statement? if (state.inMacro) { - if (word.toLowerCase() === '%mend') { + if (word === '%mend') { if (stream.peek() === ';') stream.next(); state.inMacro = false; return 'builtin'; } - if (word && words.hasOwnProperty(word.toLowerCase()) && - (words[word.toLowerCase()].state.indexOf("inMacro") !== -1 || - words[word.toLowerCase()].state.indexOf("ALL") !== -1)) { + if (word && words.hasOwnProperty(word) && + (words[word].state.indexOf("inMacro") !== -1 || + words[word].state.indexOf("ALL") !== -1)) { stream.match(/[\w]+/); - return words[word.toLowerCase()].style; + return words[word].style; } return 'atom'; } // Do we have Keywords specific words? - if (word && words.hasOwnProperty(word.toLowerCase())) { + if (word && words.hasOwnProperty(word)) { // Negates the initial next() stream.backUp(1); // Actually move the stream stream.match(/[\w]+/); - if (word.toLowerCase() === 'data' && /=/.test(stream.peek()) === false) { + if (word === 'data' && /=/.test(stream.peek()) === false) { state.inDataStep = true; state.nextword = true; return 'builtin'; } - if (word.toLowerCase() === 'proc') { + if (word === 'proc') { state.inProc = true; state.nextword = true; return 'builtin'; } - if (word.toLowerCase() === '%macro') { + if (word === '%macro') { state.inMacro = true; state.nextword = true; return 'builtin'; } - if (/title[1-9]/i.test(word)) return 'def'; + if (/title[1-9]/.test(word)) return 'def'; - if (word.toLowerCase() === 'footnote') { + if (word === 'footnote') { stream.eat(/[1-9]/); return 'def'; } // Returns their value as state in the prior define methods - if (state.inDataStep === true && words[word.toLowerCase()].state.indexOf("inDataStep") !== -1) - return words[word.toLowerCase()].style; - if (state.inProc === true && words[word.toLowerCase()].state.indexOf("inProc") !== -1) - return words[word.toLowerCase()].style; - if (state.inMacro === true && words[word.toLowerCase()].state.indexOf("inMacro") !== -1) - return words[word.toLowerCase()].style; - if (words[word.toLowerCase()].state.indexOf("ALL") !== -1) - return words[word.toLowerCase()].style; + if (state.inDataStep === true && words[word].state.indexOf("inDataStep") !== -1) + return words[word].style; + if (state.inProc === true && words[word].state.indexOf("inProc") !== -1) + return words[word].style; + if (state.inMacro === true && words[word].state.indexOf("inMacro") !== -1) + return words[word].style; + if (words[word].state.indexOf("ALL") !== -1) + return words[word].style; return null; } // Unrecognized syntax diff --git a/public/vendor/codemirror/mode/vue/index.html b/public/vendor/codemirror/mode/vue/index.html index cccb9764..e0b45b94 100644 --- a/public/vendor/codemirror/mode/vue/index.html +++ b/public/vendor/codemirror/mode/vue/index.html @@ -14,7 +14,7 @@ - + diff --git a/public/vendor/codemirror/mode/vue/vue.js b/public/vendor/codemirror/mode/vue/vue.js index d89a5523..f8089af5 100644 --- a/public/vendor/codemirror/mode/vue/vue.js +++ b/public/vendor/codemirror/mode/vue/vue.js @@ -12,7 +12,7 @@ require("../css/css"), require("../sass/sass"), require("../stylus/stylus"), - require("../jade/jade"), + require("../pug/pug"), require("../handlebars/handlebars")); } else if (typeof define === "function" && define.amd) { // AMD define(["../../lib/codemirror", @@ -23,7 +23,7 @@ "../css/css", "../sass/sass", "../stylus/stylus", - "../jade/jade", + "../pug/pug", "../handlebars/handlebars"], mod); } else { // Plain browser env mod(CodeMirror); @@ -42,9 +42,9 @@ ], template: [ ["lang", /^vue-template$/i, "vue"], - ["lang", /^jade$/i, "jade"], + ["lang", /^pug$/i, "pug"], ["lang", /^handlebars$/i, "handlebars"], - ["type", /^(text\/)?(x-)?jade$/i, "jade"], + ["type", /^(text\/)?(x-)?pug$/i, "pug"], ["type", /^text\/x-handlebars-template$/i, "handlebars"], [null, null, "vue-template"] ] @@ -63,7 +63,7 @@ CodeMirror.defineMode("vue", function (config) { return CodeMirror.getMode(config, {name: "htmlmixed", tags: tagLanguages}); - }, "htmlmixed", "xml", "javascript", "coffeescript", "css", "sass", "stylus", "jade", "handlebars"); + }, "htmlmixed", "xml", "javascript", "coffeescript", "css", "sass", "stylus", "pug", "handlebars"); CodeMirror.defineMIME("script/x-vue", "vue"); }); diff --git a/public/vendor/codemirror/theme/panda-syntax.css b/public/vendor/codemirror/theme/panda-syntax.css index 0e035003..8c0c7540 100644 --- a/public/vendor/codemirror/theme/panda-syntax.css +++ b/public/vendor/codemirror/theme/panda-syntax.css @@ -1,94 +1,85 @@ /* - Name: Panda Syntax Author: Siamak Mokhtari (http://github.com/siamak/) - CodeMirror template by Siamak Mokhtari (https://github.com/siamak/atom-panda-syntax) - */ .cm-s-panda-syntax { - /*font-family: 'Operator Mono', 'Source Sans Pro', Helvetica, Arial, sans-serif;*/ - font-family: 'Operator Mono', 'Source Sans Pro', Menlo, Monaco, Consolas, Courier New, monospace; background: #292A2B; color: #E6E6E6; + line-height: 1.5; + font-family: 'Operator Mono', 'Source Sans Pro', Menlo, Monaco, Consolas, Courier New, monospace; } +.cm-s-panda-syntax .CodeMirror-cursor { border-color: #ff2c6d; } .cm-s-panda-syntax .CodeMirror-activeline-background { - background: #404954; + background: rgba(99, 123, 156, 0.1); +} +.cm-s-panda-syntax .CodeMirror-selected { + background: #FFF; } - .cm-s-panda-syntax .cm-comment { font-style: italic; color: #676B79; } -.cm-s-panda-syntax .cm-string, -.cm-s-panda-syntax .cm-string-2 { +.cm-s-panda-syntax .cm-operator { + color: #f3f3f3; +} +.cm-s-panda-syntax .cm-string { color: #19F9D8; } +.cm-s-panda-syntax .cm-string-2 { + color: #FFB86C; +} + +.cm-s-panda-syntax .cm-tag { + color: #ff2c6d; +} +.cm-s-panda-syntax .cm-meta { + color: #b084eb; +} + .cm-s-panda-syntax .cm-number { color: #FFB86C; } .cm-s-panda-syntax .cm-atom { - color: #FFB86C; + color: #ff2c6d; } - .cm-s-panda-syntax .cm-keyword { color: #FF75B5; } -.cm-s-panda-syntax .cm-keyword-2 { - color: #FF75B5; -} -.cm-s-panda-syntax .cm-keyword-3 { - color: #B084EB; -} - .cm-s-panda-syntax .cm-variable { - color: #FF9AC1; + color: #ffb86c; } .cm-s-panda-syntax .cm-variable-2 { - color: #e6e6e6; + color: #ff9ac1; } .cm-s-panda-syntax .cm-variable-3 { - color: #82B1FF; + color: #ff9ac1; } .cm-s-panda-syntax .cm-def { - /*font-style: italic;*/ color: #e6e6e6; } -.cm-s-panda-syntax .cm-def-2 { - font-style: italic; - color: #ffcc95; -} - - .cm-s-panda-syntax .cm-property { - color: #6FC1FF; + color: #f3f3f3; +} +.cm-s-panda-syntax .cm-unit { + color: #ffb86c; } -.cm-s-panda-syntax .cm-matchingbracket, -.CodeMirror .CodeMirror-matchingbracket { - color: #E6E6E6 !important; - border-bottom: 1px dotted #19f9d8; - padding-bottom: 2px; +.cm-s-panda-syntax .cm-attribute { + color: #ffb86c; } -.cm-s-panda-syntax .CodeMirror-gutters { - background: #292A2B; - color: #757575; - border: none; +.cm-s-panda-syntax .CodeMirror-matchingbracket { + border-bottom: 1px dotted #19F9D8; + padding-bottom: 2px; + color: #e6e6e6; } -.cm-s-panda-syntax .CodeMirror-guttermarker, .cm-s-panda-syntax .CodeMirror-guttermarker-subtle, .cm-s-panda-syntax .CodeMirror-linenumber { - color: #757575; +.CodeMirror-gutters { + background: #292a2b; + border-right-color: rgba(255, 255, 255, 0.1); } -.cm-s-panda-syntax .CodeMirror-linenumber { - padding-right: 10px; +.CodeMirror-linenumber { + color: #e6e6e6; + opacity: 0.6; } -.cm-s-panda-syntax .CodeMirror-cursor { - border-left: 1px solid #757575; -} -/*.cm-s-panda-syntax div.CodeMirror-selected { background: rgba(255, 255, 255, 0.5); }*/ -.cm-s-panda-syntax.CodeMirror-focused div.CodeMirror-selected { background: rgba(255, 255, 255, 0.25); } -.cm-s-panda-syntax .CodeMirror-line::selection, .cm-s-panda-syntax .CodeMirror-line > span::selection, .cm-s-panda-syntax .CodeMirror-line > span > span::selection { background: rgba(255, 255, 255, 0.10); } -.cm-s-panda-syntax .CodeMirror-line::-moz-selection, .cm-s-panda-syntax .CodeMirror-line > span::-moz-selection, .cm-s-panda-syntax .CodeMirror-line > span > span::-moz-selection { background: rgba(255, 255, 255, 0.10); } - -.cm-s-panda-syntax .CodeMirror-activeline-background { background: rgba(99, 123, 156, 0.125); } diff --git a/public/vendor/codemirror/theme/pastel-on-dark.css b/public/vendor/codemirror/theme/pastel-on-dark.css index 71975092..2603d362 100644 --- a/public/vendor/codemirror/theme/pastel-on-dark.css +++ b/public/vendor/codemirror/theme/pastel-on-dark.css @@ -11,7 +11,6 @@ background: #2c2827; color: #8F938F; line-height: 1.5; - font-size: 14px; } .cm-s-pastel-on-dark div.CodeMirror-selected { background: rgba(221,240,255,0.2); } .cm-s-pastel-on-dark .CodeMirror-line::selection, .cm-s-pastel-on-dark .CodeMirror-line > span::selection, .cm-s-pastel-on-dark .CodeMirror-line > span > span::selection { background: rgba(221,240,255,0.2); } diff --git a/public/vendor/codemirror/theme/solarized.css b/public/vendor/codemirror/theme/solarized.css index 4b1e1630..1f39c7ed 100644 --- a/public/vendor/codemirror/theme/solarized.css +++ b/public/vendor/codemirror/theme/solarized.css @@ -155,8 +155,8 @@ http://ethanschoonover.com/solarized/img/solarized-palette.png .cm-s-solarized .CodeMirror-cursor { border-left: 1px solid #819090; } /* Fat cursor */ -.cm-s-solarized.cm-s-light.cm-fat-cursor .CodeMirror-cursor { background: #fdf6e3; } -.cm-s-solarized.cm-s-light .cm-animate-fat-cursor { background-color: #fdf6e3; } +.cm-s-solarized.cm-s-light.cm-fat-cursor .CodeMirror-cursor { background: #77ee77; } +.cm-s-solarized.cm-s-light .cm-animate-fat-cursor { background-color: #77ee77; } .cm-s-solarized.cm-s-dark.cm-fat-cursor .CodeMirror-cursor { background: #586e75; } .cm-s-solarized.cm-s-dark .cm-animate-fat-cursor { background-color: #586e75; } diff --git a/public/vendor/emojify/images/+1.png b/public/vendor/emojify/images/+1.png index 81786c1d..0aab213c 100755 Binary files a/public/vendor/emojify/images/+1.png and b/public/vendor/emojify/images/+1.png differ diff --git a/public/vendor/emojify/images/100.png b/public/vendor/emojify/images/100.png index ca3bb9bc..11d37841 100755 Binary files a/public/vendor/emojify/images/100.png and b/public/vendor/emojify/images/100.png differ diff --git a/public/vendor/emojify/images/109.png b/public/vendor/emojify/images/109.png index 74b9d5d3..87ec8d2d 100755 Binary files a/public/vendor/emojify/images/109.png and b/public/vendor/emojify/images/109.png differ diff --git a/public/vendor/emojify/images/a.png b/public/vendor/emojify/images/a.png index 09ff6d6f..e91239b9 100755 Binary files a/public/vendor/emojify/images/a.png and b/public/vendor/emojify/images/a.png differ diff --git a/public/vendor/emojify/images/ab.png b/public/vendor/emojify/images/ab.png index 2a522204..546a9a4a 100755 Binary files a/public/vendor/emojify/images/ab.png and b/public/vendor/emojify/images/ab.png differ diff --git a/public/vendor/emojify/images/alien.png b/public/vendor/emojify/images/alien.png index 416de47b..0e62aceb 100755 Binary files a/public/vendor/emojify/images/alien.png and b/public/vendor/emojify/images/alien.png differ diff --git a/public/vendor/emojify/images/ambulance.png b/public/vendor/emojify/images/ambulance.png index b740f45d..b0aaed37 100755 Binary files a/public/vendor/emojify/images/ambulance.png and b/public/vendor/emojify/images/ambulance.png differ diff --git a/public/vendor/emojify/images/anchor.png b/public/vendor/emojify/images/anchor.png index 0c5192e6..7401a432 100755 Binary files a/public/vendor/emojify/images/anchor.png and b/public/vendor/emojify/images/anchor.png differ diff --git a/public/vendor/emojify/images/angel.png b/public/vendor/emojify/images/angel.png index da52c310..71c0f7b0 100755 Binary files a/public/vendor/emojify/images/angel.png and b/public/vendor/emojify/images/angel.png differ diff --git a/public/vendor/emojify/images/angry.png b/public/vendor/emojify/images/angry.png index f95bfa89..0e2823df 100755 Binary files a/public/vendor/emojify/images/angry.png and b/public/vendor/emojify/images/angry.png differ diff --git a/public/vendor/emojify/images/anguished.png b/public/vendor/emojify/images/anguished.png index c6259472..5894e7a5 100755 Binary files a/public/vendor/emojify/images/anguished.png and b/public/vendor/emojify/images/anguished.png differ diff --git a/public/vendor/emojify/images/apple.png b/public/vendor/emojify/images/apple.png index 08aa17b9..de5e5260 100755 Binary files a/public/vendor/emojify/images/apple.png and b/public/vendor/emojify/images/apple.png differ diff --git a/public/vendor/emojify/images/aries.png b/public/vendor/emojify/images/aries.png index aab5e880..06e9d285 100755 Binary files a/public/vendor/emojify/images/aries.png and b/public/vendor/emojify/images/aries.png differ diff --git a/public/vendor/emojify/images/arrow_backward.png b/public/vendor/emojify/images/arrow_backward.png index 08862183..d7fb35b9 100755 Binary files a/public/vendor/emojify/images/arrow_backward.png and b/public/vendor/emojify/images/arrow_backward.png differ diff --git a/public/vendor/emojify/images/arrow_double_down.png b/public/vendor/emojify/images/arrow_double_down.png index 2ecbebcd..3e97de78 100755 Binary files a/public/vendor/emojify/images/arrow_double_down.png and b/public/vendor/emojify/images/arrow_double_down.png differ diff --git a/public/vendor/emojify/images/arrow_double_up.png b/public/vendor/emojify/images/arrow_double_up.png index 2bd6659b..af7cc71f 100755 Binary files a/public/vendor/emojify/images/arrow_double_up.png and b/public/vendor/emojify/images/arrow_double_up.png differ diff --git a/public/vendor/emojify/images/arrow_down.png b/public/vendor/emojify/images/arrow_down.png index e6702f02..b737ad4a 100755 Binary files a/public/vendor/emojify/images/arrow_down.png and b/public/vendor/emojify/images/arrow_down.png differ diff --git a/public/vendor/emojify/images/arrow_down_small.png b/public/vendor/emojify/images/arrow_down_small.png index 22d383a9..faedccfa 100755 Binary files a/public/vendor/emojify/images/arrow_down_small.png and b/public/vendor/emojify/images/arrow_down_small.png differ diff --git a/public/vendor/emojify/images/arrow_forward.png b/public/vendor/emojify/images/arrow_forward.png index fbfe711b..ba67d124 100755 Binary files a/public/vendor/emojify/images/arrow_forward.png and b/public/vendor/emojify/images/arrow_forward.png differ diff --git a/public/vendor/emojify/images/arrow_heading_down.png b/public/vendor/emojify/images/arrow_heading_down.png index 56dd3b9d..709eaaeb 100755 Binary files a/public/vendor/emojify/images/arrow_heading_down.png and b/public/vendor/emojify/images/arrow_heading_down.png differ diff --git a/public/vendor/emojify/images/arrow_left.png b/public/vendor/emojify/images/arrow_left.png index d64ac619..bcb19b90 100755 Binary files a/public/vendor/emojify/images/arrow_left.png and b/public/vendor/emojify/images/arrow_left.png differ diff --git a/public/vendor/emojify/images/arrow_lower_left.png b/public/vendor/emojify/images/arrow_lower_left.png index 55fb03c4..f85dce91 100755 Binary files a/public/vendor/emojify/images/arrow_lower_left.png and b/public/vendor/emojify/images/arrow_lower_left.png differ diff --git a/public/vendor/emojify/images/arrow_lower_right.png b/public/vendor/emojify/images/arrow_lower_right.png index da8fb829..0cd99b60 100755 Binary files a/public/vendor/emojify/images/arrow_lower_right.png and b/public/vendor/emojify/images/arrow_lower_right.png differ diff --git a/public/vendor/emojify/images/arrow_right.png b/public/vendor/emojify/images/arrow_right.png index 6d483b51..68ea8e2d 100755 Binary files a/public/vendor/emojify/images/arrow_right.png and b/public/vendor/emojify/images/arrow_right.png differ diff --git a/public/vendor/emojify/images/arrow_up.png b/public/vendor/emojify/images/arrow_up.png index b5b0688d..d6e78f54 100755 Binary files a/public/vendor/emojify/images/arrow_up.png and b/public/vendor/emojify/images/arrow_up.png differ diff --git a/public/vendor/emojify/images/arrow_up_down.png b/public/vendor/emojify/images/arrow_up_down.png index be423de7..a64befb5 100755 Binary files a/public/vendor/emojify/images/arrow_up_down.png and b/public/vendor/emojify/images/arrow_up_down.png differ diff --git a/public/vendor/emojify/images/arrow_up_small.png b/public/vendor/emojify/images/arrow_up_small.png index 3f40bfb8..531d5e26 100755 Binary files a/public/vendor/emojify/images/arrow_up_small.png and b/public/vendor/emojify/images/arrow_up_small.png differ diff --git a/public/vendor/emojify/images/arrow_upper_left.png b/public/vendor/emojify/images/arrow_upper_left.png index 2950ae2f..87661913 100755 Binary files a/public/vendor/emojify/images/arrow_upper_left.png and b/public/vendor/emojify/images/arrow_upper_left.png differ diff --git a/public/vendor/emojify/images/arrow_upper_right.png b/public/vendor/emojify/images/arrow_upper_right.png index e23790ba..a39fe319 100755 Binary files a/public/vendor/emojify/images/arrow_upper_right.png and b/public/vendor/emojify/images/arrow_upper_right.png differ diff --git a/public/vendor/emojify/images/arrows_clockwise.png b/public/vendor/emojify/images/arrows_clockwise.png index 5f84d7e7..bf8effbd 100755 Binary files a/public/vendor/emojify/images/arrows_clockwise.png and b/public/vendor/emojify/images/arrows_clockwise.png differ diff --git a/public/vendor/emojify/images/art.png b/public/vendor/emojify/images/art.png index d45212b0..94aaae44 100755 Binary files a/public/vendor/emojify/images/art.png and b/public/vendor/emojify/images/art.png differ diff --git a/public/vendor/emojify/images/articulated_lorry.png b/public/vendor/emojify/images/articulated_lorry.png index 81ec1f91..fc6528e9 100755 Binary files a/public/vendor/emojify/images/articulated_lorry.png and b/public/vendor/emojify/images/articulated_lorry.png differ diff --git a/public/vendor/emojify/images/astonished.png b/public/vendor/emojify/images/astonished.png index 858a8348..1242e6fe 100755 Binary files a/public/vendor/emojify/images/astonished.png and b/public/vendor/emojify/images/astonished.png differ diff --git a/public/vendor/emojify/images/b.png b/public/vendor/emojify/images/b.png index 8742b3d2..8bc0c36e 100755 Binary files a/public/vendor/emojify/images/b.png and b/public/vendor/emojify/images/b.png differ diff --git a/public/vendor/emojify/images/baby_symbol.png b/public/vendor/emojify/images/baby_symbol.png index 2e58725c..d91b1211 100755 Binary files a/public/vendor/emojify/images/baby_symbol.png and b/public/vendor/emojify/images/baby_symbol.png differ diff --git a/public/vendor/emojify/images/back.png b/public/vendor/emojify/images/back.png index 0cde6287..17f2bd95 100755 Binary files a/public/vendor/emojify/images/back.png and b/public/vendor/emojify/images/back.png differ diff --git a/public/vendor/emojify/images/bar_chart.png b/public/vendor/emojify/images/bar_chart.png index 09d7301c..803d47dd 100755 Binary files a/public/vendor/emojify/images/bar_chart.png and b/public/vendor/emojify/images/bar_chart.png differ diff --git a/public/vendor/emojify/images/bee.png b/public/vendor/emojify/images/bee.png index f5373395..7a7a0054 100755 Binary files a/public/vendor/emojify/images/bee.png and b/public/vendor/emojify/images/bee.png differ diff --git a/public/vendor/emojify/images/beers.png b/public/vendor/emojify/images/beers.png index cc5e4ab5..eb93059d 100755 Binary files a/public/vendor/emojify/images/beers.png and b/public/vendor/emojify/images/beers.png differ diff --git a/public/vendor/emojify/images/beginner.png b/public/vendor/emojify/images/beginner.png index 1f022d17..5dbfdd67 100755 Binary files a/public/vendor/emojify/images/beginner.png and b/public/vendor/emojify/images/beginner.png differ diff --git a/public/vendor/emojify/images/bento.png b/public/vendor/emojify/images/bento.png index d6801124..c8a25af4 100755 Binary files a/public/vendor/emojify/images/bento.png and b/public/vendor/emojify/images/bento.png differ diff --git a/public/vendor/emojify/images/bike.png b/public/vendor/emojify/images/bike.png index 65738602..e018659f 100755 Binary files a/public/vendor/emojify/images/bike.png and b/public/vendor/emojify/images/bike.png differ diff --git a/public/vendor/emojify/images/black_joker.png b/public/vendor/emojify/images/black_joker.png index 4c78f361..99e658c5 100755 Binary files a/public/vendor/emojify/images/black_joker.png and b/public/vendor/emojify/images/black_joker.png differ diff --git a/public/vendor/emojify/images/black_medium_small_square.png b/public/vendor/emojify/images/black_medium_small_square.png index 25bfe9c4..7c09600c 100755 Binary files a/public/vendor/emojify/images/black_medium_small_square.png and b/public/vendor/emojify/images/black_medium_small_square.png differ diff --git a/public/vendor/emojify/images/black_medium_square.png b/public/vendor/emojify/images/black_medium_square.png index 204cce12..1252f7cb 100755 Binary files a/public/vendor/emojify/images/black_medium_square.png and b/public/vendor/emojify/images/black_medium_square.png differ diff --git a/public/vendor/emojify/images/black_small_square.png b/public/vendor/emojify/images/black_small_square.png index a247751e..2571a24b 100755 Binary files a/public/vendor/emojify/images/black_small_square.png and b/public/vendor/emojify/images/black_small_square.png differ diff --git a/public/vendor/emojify/images/black_square.png b/public/vendor/emojify/images/black_square.png index 71da10de..ca327c2a 100755 Binary files a/public/vendor/emojify/images/black_square.png and b/public/vendor/emojify/images/black_square.png differ diff --git a/public/vendor/emojify/images/black_square_button.png b/public/vendor/emojify/images/black_square_button.png index f2597e95..a6a899f5 100755 Binary files a/public/vendor/emojify/images/black_square_button.png and b/public/vendor/emojify/images/black_square_button.png differ diff --git a/public/vendor/emojify/images/blue_book.png b/public/vendor/emojify/images/blue_book.png index e2b9e8c7..1dfb9f92 100755 Binary files a/public/vendor/emojify/images/blue_book.png and b/public/vendor/emojify/images/blue_book.png differ diff --git a/public/vendor/emojify/images/blue_car.png b/public/vendor/emojify/images/blue_car.png index 978291e0..e539e410 100755 Binary files a/public/vendor/emojify/images/blue_car.png and b/public/vendor/emojify/images/blue_car.png differ diff --git a/public/vendor/emojify/images/blue_heart.png b/public/vendor/emojify/images/blue_heart.png index baa29b31..5f5ed897 100755 Binary files a/public/vendor/emojify/images/blue_heart.png and b/public/vendor/emojify/images/blue_heart.png differ diff --git a/public/vendor/emojify/images/blush.png b/public/vendor/emojify/images/blush.png index 3a95eb61..839c1dcd 100755 Binary files a/public/vendor/emojify/images/blush.png and b/public/vendor/emojify/images/blush.png differ diff --git a/public/vendor/emojify/images/bomb.png b/public/vendor/emojify/images/bomb.png index 3289787d..eaff28e1 100755 Binary files a/public/vendor/emojify/images/bomb.png and b/public/vendor/emojify/images/bomb.png differ diff --git a/public/vendor/emojify/images/book.png b/public/vendor/emojify/images/book.png index 8b698415..4cfb1f8c 100755 Binary files a/public/vendor/emojify/images/book.png and b/public/vendor/emojify/images/book.png differ diff --git a/public/vendor/emojify/images/bookmark_tabs.png b/public/vendor/emojify/images/bookmark_tabs.png index 83782ff0..619f1bcd 100755 Binary files a/public/vendor/emojify/images/bookmark_tabs.png and b/public/vendor/emojify/images/bookmark_tabs.png differ diff --git a/public/vendor/emojify/images/books.png b/public/vendor/emojify/images/books.png index dca06a1a..b4f8e508 100755 Binary files a/public/vendor/emojify/images/books.png and b/public/vendor/emojify/images/books.png differ diff --git a/public/vendor/emojify/images/bow.png b/public/vendor/emojify/images/bow.png index 024cb610..66939f8f 100755 Binary files a/public/vendor/emojify/images/bow.png and b/public/vendor/emojify/images/bow.png differ diff --git a/public/vendor/emojify/images/bowtie.png b/public/vendor/emojify/images/bowtie.png index 28ff0c78..4d25a0af 100755 Binary files a/public/vendor/emojify/images/bowtie.png and b/public/vendor/emojify/images/bowtie.png differ diff --git a/public/vendor/emojify/images/boy.png b/public/vendor/emojify/images/boy.png index f79f1f29..eb863fbb 100755 Binary files a/public/vendor/emojify/images/boy.png and b/public/vendor/emojify/images/boy.png differ diff --git a/public/vendor/emojify/images/bridge_at_night.png b/public/vendor/emojify/images/bridge_at_night.png index 495b06c3..8d3f41a4 100755 Binary files a/public/vendor/emojify/images/bridge_at_night.png and b/public/vendor/emojify/images/bridge_at_night.png differ diff --git a/public/vendor/emojify/images/briefcase.png b/public/vendor/emojify/images/briefcase.png index 46e82b00..cea8a11f 100755 Binary files a/public/vendor/emojify/images/briefcase.png and b/public/vendor/emojify/images/briefcase.png differ diff --git a/public/vendor/emojify/images/broken_heart.png b/public/vendor/emojify/images/broken_heart.png index a1bc850e..7bda17d1 100755 Binary files a/public/vendor/emojify/images/broken_heart.png and b/public/vendor/emojify/images/broken_heart.png differ diff --git a/public/vendor/emojify/images/bug.png b/public/vendor/emojify/images/bug.png index c2eaf7a7..d1f46669 100755 Binary files a/public/vendor/emojify/images/bug.png and b/public/vendor/emojify/images/bug.png differ diff --git a/public/vendor/emojify/images/bus.png b/public/vendor/emojify/images/bus.png index 823aa39e..a1c4f5de 100755 Binary files a/public/vendor/emojify/images/bus.png and b/public/vendor/emojify/images/bus.png differ diff --git a/public/vendor/emojify/images/busts_in_silhouette.png b/public/vendor/emojify/images/busts_in_silhouette.png index 1f3aabcf..4021ffa2 100755 Binary files a/public/vendor/emojify/images/busts_in_silhouette.png and b/public/vendor/emojify/images/busts_in_silhouette.png differ diff --git a/public/vendor/emojify/images/calendar.png b/public/vendor/emojify/images/calendar.png index 900b868b..14a86429 100755 Binary files a/public/vendor/emojify/images/calendar.png and b/public/vendor/emojify/images/calendar.png differ diff --git a/public/vendor/emojify/images/calling.png b/public/vendor/emojify/images/calling.png index 837897f2..e4c662ca 100755 Binary files a/public/vendor/emojify/images/calling.png and b/public/vendor/emojify/images/calling.png differ diff --git a/public/vendor/emojify/images/camera.png b/public/vendor/emojify/images/camera.png index 397d03b3..b753d109 100755 Binary files a/public/vendor/emojify/images/camera.png and b/public/vendor/emojify/images/camera.png differ diff --git a/public/vendor/emojify/images/capricorn.png b/public/vendor/emojify/images/capricorn.png index f2044e78..0c478d00 100755 Binary files a/public/vendor/emojify/images/capricorn.png and b/public/vendor/emojify/images/capricorn.png differ diff --git a/public/vendor/emojify/images/car.png b/public/vendor/emojify/images/car.png index d70a2f06..b0d9a709 100755 Binary files a/public/vendor/emojify/images/car.png and b/public/vendor/emojify/images/car.png differ diff --git a/public/vendor/emojify/images/card_index.png b/public/vendor/emojify/images/card_index.png index 374e94e9..ee743539 100755 Binary files a/public/vendor/emojify/images/card_index.png and b/public/vendor/emojify/images/card_index.png differ diff --git a/public/vendor/emojify/images/carousel_horse.png b/public/vendor/emojify/images/carousel_horse.png index 765d2c0a..571053b9 100755 Binary files a/public/vendor/emojify/images/carousel_horse.png and b/public/vendor/emojify/images/carousel_horse.png differ diff --git a/public/vendor/emojify/images/cd.png b/public/vendor/emojify/images/cd.png index baff835c..1cc7c310 100755 Binary files a/public/vendor/emojify/images/cd.png and b/public/vendor/emojify/images/cd.png differ diff --git a/public/vendor/emojify/images/chart_with_downwards_trend.png b/public/vendor/emojify/images/chart_with_downwards_trend.png index cb0d2a11..5fdd1521 100755 Binary files a/public/vendor/emojify/images/chart_with_downwards_trend.png and b/public/vendor/emojify/images/chart_with_downwards_trend.png differ diff --git a/public/vendor/emojify/images/chart_with_upwards_trend.png b/public/vendor/emojify/images/chart_with_upwards_trend.png index 7c66745c..0a5aa77c 100755 Binary files a/public/vendor/emojify/images/chart_with_upwards_trend.png and b/public/vendor/emojify/images/chart_with_upwards_trend.png differ diff --git a/public/vendor/emojify/images/checkered_flag.png b/public/vendor/emojify/images/checkered_flag.png index ead4a68d..b03eb394 100755 Binary files a/public/vendor/emojify/images/checkered_flag.png and b/public/vendor/emojify/images/checkered_flag.png differ diff --git a/public/vendor/emojify/images/cherries.png b/public/vendor/emojify/images/cherries.png index 8d3e044f..3949dde4 100755 Binary files a/public/vendor/emojify/images/cherries.png and b/public/vendor/emojify/images/cherries.png differ diff --git a/public/vendor/emojify/images/cherry_blossom.png b/public/vendor/emojify/images/cherry_blossom.png index e0315549..d68d94c8 100755 Binary files a/public/vendor/emojify/images/cherry_blossom.png and b/public/vendor/emojify/images/cherry_blossom.png differ diff --git a/public/vendor/emojify/images/chestnut.png b/public/vendor/emojify/images/chestnut.png index 066fb6bf..2432edb4 100755 Binary files a/public/vendor/emojify/images/chestnut.png and b/public/vendor/emojify/images/chestnut.png differ diff --git a/public/vendor/emojify/images/children_crossing.png b/public/vendor/emojify/images/children_crossing.png index b0302ae6..ff806eed 100755 Binary files a/public/vendor/emojify/images/children_crossing.png and b/public/vendor/emojify/images/children_crossing.png differ diff --git a/public/vendor/emojify/images/church.png b/public/vendor/emojify/images/church.png index 4c07c6b9..0c917466 100755 Binary files a/public/vendor/emojify/images/church.png and b/public/vendor/emojify/images/church.png differ diff --git a/public/vendor/emojify/images/cinema.png b/public/vendor/emojify/images/cinema.png index a990ccf9..43dd3405 100755 Binary files a/public/vendor/emojify/images/cinema.png and b/public/vendor/emojify/images/cinema.png differ diff --git a/public/vendor/emojify/images/city_sunrise.png b/public/vendor/emojify/images/city_sunrise.png index 91ca2a40..1b01c583 100755 Binary files a/public/vendor/emojify/images/city_sunrise.png and b/public/vendor/emojify/images/city_sunrise.png differ diff --git a/public/vendor/emojify/images/city_sunset.png b/public/vendor/emojify/images/city_sunset.png index 7cb178a2..f9d5cc76 100755 Binary files a/public/vendor/emojify/images/city_sunset.png and b/public/vendor/emojify/images/city_sunset.png differ diff --git a/public/vendor/emojify/images/cl.png b/public/vendor/emojify/images/cl.png index 15ac6752..a2be4f86 100755 Binary files a/public/vendor/emojify/images/cl.png and b/public/vendor/emojify/images/cl.png differ diff --git a/public/vendor/emojify/images/clapper.png b/public/vendor/emojify/images/clapper.png index 4e1dc111..015f5ff4 100755 Binary files a/public/vendor/emojify/images/clapper.png and b/public/vendor/emojify/images/clapper.png differ diff --git a/public/vendor/emojify/images/clipboard.png b/public/vendor/emojify/images/clipboard.png index e2c74e6d..f129d8f1 100755 Binary files a/public/vendor/emojify/images/clipboard.png and b/public/vendor/emojify/images/clipboard.png differ diff --git a/public/vendor/emojify/images/clock1230.png b/public/vendor/emojify/images/clock1230.png index a6527154..01d59aa4 100755 Binary files a/public/vendor/emojify/images/clock1230.png and b/public/vendor/emojify/images/clock1230.png differ diff --git a/public/vendor/emojify/images/clock130.png b/public/vendor/emojify/images/clock130.png index 90ea5b91..64eabb5d 100755 Binary files a/public/vendor/emojify/images/clock130.png and b/public/vendor/emojify/images/clock130.png differ diff --git a/public/vendor/emojify/images/clock230.png b/public/vendor/emojify/images/clock230.png index f12c6912..8a76ba52 100755 Binary files a/public/vendor/emojify/images/clock230.png and b/public/vendor/emojify/images/clock230.png differ diff --git a/public/vendor/emojify/images/clock330.png b/public/vendor/emojify/images/clock330.png index 1dc9628e..75941f19 100755 Binary files a/public/vendor/emojify/images/clock330.png and b/public/vendor/emojify/images/clock330.png differ diff --git a/public/vendor/emojify/images/clock5.png b/public/vendor/emojify/images/clock5.png index b010b4f8..99f85bca 100755 Binary files a/public/vendor/emojify/images/clock5.png and b/public/vendor/emojify/images/clock5.png differ diff --git a/public/vendor/emojify/images/clock530.png b/public/vendor/emojify/images/clock530.png index e08d4ad2..2ac67f73 100755 Binary files a/public/vendor/emojify/images/clock530.png and b/public/vendor/emojify/images/clock530.png differ diff --git a/public/vendor/emojify/images/clock630.png b/public/vendor/emojify/images/clock630.png index 46f0681f..38758bc9 100755 Binary files a/public/vendor/emojify/images/clock630.png and b/public/vendor/emojify/images/clock630.png differ diff --git a/public/vendor/emojify/images/clock730.png b/public/vendor/emojify/images/clock730.png index f2807de2..01c06608 100755 Binary files a/public/vendor/emojify/images/clock730.png and b/public/vendor/emojify/images/clock730.png differ diff --git a/public/vendor/emojify/images/clock8.png b/public/vendor/emojify/images/clock8.png index 74c770d8..4b14e652 100755 Binary files a/public/vendor/emojify/images/clock8.png and b/public/vendor/emojify/images/clock8.png differ diff --git a/public/vendor/emojify/images/clock930.png b/public/vendor/emojify/images/clock930.png index fd352214..ff689706 100755 Binary files a/public/vendor/emojify/images/clock930.png and b/public/vendor/emojify/images/clock930.png differ diff --git a/public/vendor/emojify/images/closed_book.png b/public/vendor/emojify/images/closed_book.png index 484029c5..673346ce 100755 Binary files a/public/vendor/emojify/images/closed_book.png and b/public/vendor/emojify/images/closed_book.png differ diff --git a/public/vendor/emojify/images/closed_lock_with_key.png b/public/vendor/emojify/images/closed_lock_with_key.png index e6fdf6cb..81b82a14 100755 Binary files a/public/vendor/emojify/images/closed_lock_with_key.png and b/public/vendor/emojify/images/closed_lock_with_key.png differ diff --git a/public/vendor/emojify/images/cloud.png b/public/vendor/emojify/images/cloud.png index b31c08c0..f3f84a08 100755 Binary files a/public/vendor/emojify/images/cloud.png and b/public/vendor/emojify/images/cloud.png differ diff --git a/public/vendor/emojify/images/clubs.png b/public/vendor/emojify/images/clubs.png index bfab5365..7e3fee58 100755 Binary files a/public/vendor/emojify/images/clubs.png and b/public/vendor/emojify/images/clubs.png differ diff --git a/public/vendor/emojify/images/cn.png b/public/vendor/emojify/images/cn.png index b30dcc53..0308d514 100755 Binary files a/public/vendor/emojify/images/cn.png and b/public/vendor/emojify/images/cn.png differ diff --git a/public/vendor/emojify/images/coffee.png b/public/vendor/emojify/images/coffee.png index 57e1adcb..c7fb932e 100755 Binary files a/public/vendor/emojify/images/coffee.png and b/public/vendor/emojify/images/coffee.png differ diff --git a/public/vendor/emojify/images/cold_sweat.png b/public/vendor/emojify/images/cold_sweat.png index b9e39bc6..e48844eb 100755 Binary files a/public/vendor/emojify/images/cold_sweat.png and b/public/vendor/emojify/images/cold_sweat.png differ diff --git a/public/vendor/emojify/images/confetti_ball.png b/public/vendor/emojify/images/confetti_ball.png index bd293e3d..70a57212 100755 Binary files a/public/vendor/emojify/images/confetti_ball.png and b/public/vendor/emojify/images/confetti_ball.png differ diff --git a/public/vendor/emojify/images/confounded.png b/public/vendor/emojify/images/confounded.png index 762c3766..8ab4c7b9 100755 Binary files a/public/vendor/emojify/images/confounded.png and b/public/vendor/emojify/images/confounded.png differ diff --git a/public/vendor/emojify/images/confused.png b/public/vendor/emojify/images/confused.png index 8dc494db..4e37d4ec 100755 Binary files a/public/vendor/emojify/images/confused.png and b/public/vendor/emojify/images/confused.png differ diff --git a/public/vendor/emojify/images/congratulations.png b/public/vendor/emojify/images/congratulations.png index 85814e33..fc941afd 100755 Binary files a/public/vendor/emojify/images/congratulations.png and b/public/vendor/emojify/images/congratulations.png differ diff --git a/public/vendor/emojify/images/construction_worker.png b/public/vendor/emojify/images/construction_worker.png index 4d648604..3abd4e14 100755 Binary files a/public/vendor/emojify/images/construction_worker.png and b/public/vendor/emojify/images/construction_worker.png differ diff --git a/public/vendor/emojify/images/cookie.png b/public/vendor/emojify/images/cookie.png index 653edb25..97058dff 100755 Binary files a/public/vendor/emojify/images/cookie.png and b/public/vendor/emojify/images/cookie.png differ diff --git a/public/vendor/emojify/images/cool.png b/public/vendor/emojify/images/cool.png index 937dcd79..6210a3bf 100755 Binary files a/public/vendor/emojify/images/cool.png and b/public/vendor/emojify/images/cool.png differ diff --git a/public/vendor/emojify/images/couple_with_heart.png b/public/vendor/emojify/images/couple_with_heart.png index c503f40a..a280016f 100755 Binary files a/public/vendor/emojify/images/couple_with_heart.png and b/public/vendor/emojify/images/couple_with_heart.png differ diff --git a/public/vendor/emojify/images/couplekiss.png b/public/vendor/emojify/images/couplekiss.png index d0279082..e9445c27 100755 Binary files a/public/vendor/emojify/images/couplekiss.png and b/public/vendor/emojify/images/couplekiss.png differ diff --git a/public/vendor/emojify/images/credit_card.png b/public/vendor/emojify/images/credit_card.png index be1c1dd3..39492c46 100755 Binary files a/public/vendor/emojify/images/credit_card.png and b/public/vendor/emojify/images/credit_card.png differ diff --git a/public/vendor/emojify/images/cry.png b/public/vendor/emojify/images/cry.png index 6d0d9afd..7dd32678 100755 Binary files a/public/vendor/emojify/images/cry.png and b/public/vendor/emojify/images/cry.png differ diff --git a/public/vendor/emojify/images/crystal_ball.png b/public/vendor/emojify/images/crystal_ball.png index 6d2c6c42..dd91cc51 100755 Binary files a/public/vendor/emojify/images/crystal_ball.png and b/public/vendor/emojify/images/crystal_ball.png differ diff --git a/public/vendor/emojify/images/curry.png b/public/vendor/emojify/images/curry.png index 7983c706..3c57f065 100755 Binary files a/public/vendor/emojify/images/curry.png and b/public/vendor/emojify/images/curry.png differ diff --git a/public/vendor/emojify/images/custard.png b/public/vendor/emojify/images/custard.png index 9f843b4c..c49a3adf 100755 Binary files a/public/vendor/emojify/images/custard.png and b/public/vendor/emojify/images/custard.png differ diff --git a/public/vendor/emojify/images/dancer.png b/public/vendor/emojify/images/dancer.png index 7a7bf59f..15bc7f1e 100755 Binary files a/public/vendor/emojify/images/dancer.png and b/public/vendor/emojify/images/dancer.png differ diff --git a/public/vendor/emojify/images/dash.png b/public/vendor/emojify/images/dash.png index dc2c0a8f..56fb7399 100755 Binary files a/public/vendor/emojify/images/dash.png and b/public/vendor/emojify/images/dash.png differ diff --git a/public/vendor/emojify/images/date.png b/public/vendor/emojify/images/date.png index 6ad2efa5..777a5dbd 100755 Binary files a/public/vendor/emojify/images/date.png and b/public/vendor/emojify/images/date.png differ diff --git a/public/vendor/emojify/images/de.png b/public/vendor/emojify/images/de.png index 16a28548..7bfb9941 100755 Binary files a/public/vendor/emojify/images/de.png and b/public/vendor/emojify/images/de.png differ diff --git a/public/vendor/emojify/images/deciduous_tree.png b/public/vendor/emojify/images/deciduous_tree.png index 3fdf8c00..ecae6d74 100755 Binary files a/public/vendor/emojify/images/deciduous_tree.png and b/public/vendor/emojify/images/deciduous_tree.png differ diff --git a/public/vendor/emojify/images/diamond_shape_with_a_dot_inside.png b/public/vendor/emojify/images/diamond_shape_with_a_dot_inside.png index dfd1098b..b223517c 100755 Binary files a/public/vendor/emojify/images/diamond_shape_with_a_dot_inside.png and b/public/vendor/emojify/images/diamond_shape_with_a_dot_inside.png differ diff --git a/public/vendor/emojify/images/diamonds.png b/public/vendor/emojify/images/diamonds.png index fe082775..4a99af99 100755 Binary files a/public/vendor/emojify/images/diamonds.png and b/public/vendor/emojify/images/diamonds.png differ diff --git a/public/vendor/emojify/images/disappointed.png b/public/vendor/emojify/images/disappointed.png index 82552008..c459e9bb 100755 Binary files a/public/vendor/emojify/images/disappointed.png and b/public/vendor/emojify/images/disappointed.png differ diff --git a/public/vendor/emojify/images/disappointed_relieved.png b/public/vendor/emojify/images/disappointed_relieved.png index fa5f9e7f..28e8d680 100755 Binary files a/public/vendor/emojify/images/disappointed_relieved.png and b/public/vendor/emojify/images/disappointed_relieved.png differ diff --git a/public/vendor/emojify/images/dizzy_face.png b/public/vendor/emojify/images/dizzy_face.png index 8001d6ff..b0410d44 100755 Binary files a/public/vendor/emojify/images/dizzy_face.png and b/public/vendor/emojify/images/dizzy_face.png differ diff --git a/public/vendor/emojify/images/dollar.png b/public/vendor/emojify/images/dollar.png index 63de8849..f86cf3bd 100755 Binary files a/public/vendor/emojify/images/dollar.png and b/public/vendor/emojify/images/dollar.png differ diff --git a/public/vendor/emojify/images/dolls.png b/public/vendor/emojify/images/dolls.png index 47ce3390..343f18d0 100755 Binary files a/public/vendor/emojify/images/dolls.png and b/public/vendor/emojify/images/dolls.png differ diff --git a/public/vendor/emojify/images/donut.png b/public/vendor/emojify/images/donut.png index ccf86912..e89d2e71 100755 Binary files a/public/vendor/emojify/images/donut.png and b/public/vendor/emojify/images/donut.png differ diff --git a/public/vendor/emojify/images/doughnut.png b/public/vendor/emojify/images/doughnut.png index ccf86912..e89d2e71 100755 Binary files a/public/vendor/emojify/images/doughnut.png and b/public/vendor/emojify/images/doughnut.png differ diff --git a/public/vendor/emojify/images/dvd.png b/public/vendor/emojify/images/dvd.png index 363c83d0..da013d40 100755 Binary files a/public/vendor/emojify/images/dvd.png and b/public/vendor/emojify/images/dvd.png differ diff --git a/public/vendor/emojify/images/e-mail.png b/public/vendor/emojify/images/e-mail.png index 176a8e1e..6eb45bea 100755 Binary files a/public/vendor/emojify/images/e-mail.png and b/public/vendor/emojify/images/e-mail.png differ diff --git a/public/vendor/emojify/images/ear.png b/public/vendor/emojify/images/ear.png index 2bbbf10c..9eabcaaf 100755 Binary files a/public/vendor/emojify/images/ear.png and b/public/vendor/emojify/images/ear.png differ diff --git a/public/vendor/emojify/images/eight.png b/public/vendor/emojify/images/eight.png index 7bdb4223..b0829b02 100755 Binary files a/public/vendor/emojify/images/eight.png and b/public/vendor/emojify/images/eight.png differ diff --git a/public/vendor/emojify/images/eight_pointed_black_star.png b/public/vendor/emojify/images/eight_pointed_black_star.png index 2420a776..aab4159d 100755 Binary files a/public/vendor/emojify/images/eight_pointed_black_star.png and b/public/vendor/emojify/images/eight_pointed_black_star.png differ diff --git a/public/vendor/emojify/images/email.png b/public/vendor/emojify/images/email.png index 0e01fd5f..18d7a6a8 100755 Binary files a/public/vendor/emojify/images/email.png and b/public/vendor/emojify/images/email.png differ diff --git a/public/vendor/emojify/images/es.png b/public/vendor/emojify/images/es.png index 71b30bff..54d55040 100755 Binary files a/public/vendor/emojify/images/es.png and b/public/vendor/emojify/images/es.png differ diff --git a/public/vendor/emojify/images/euro.png b/public/vendor/emojify/images/euro.png index 1c5904b7..2a8fb032 100755 Binary files a/public/vendor/emojify/images/euro.png and b/public/vendor/emojify/images/euro.png differ diff --git a/public/vendor/emojify/images/european_castle.png b/public/vendor/emojify/images/european_castle.png index 8229b8a8..2db2482b 100755 Binary files a/public/vendor/emojify/images/european_castle.png and b/public/vendor/emojify/images/european_castle.png differ diff --git a/public/vendor/emojify/images/exclamation.png b/public/vendor/emojify/images/exclamation.png index 77bbdeab..5c9a8216 100755 Binary files a/public/vendor/emojify/images/exclamation.png and b/public/vendor/emojify/images/exclamation.png differ diff --git a/public/vendor/emojify/images/expressionless.png b/public/vendor/emojify/images/expressionless.png index 913ff4e2..1b414148 100755 Binary files a/public/vendor/emojify/images/expressionless.png and b/public/vendor/emojify/images/expressionless.png differ diff --git a/public/vendor/emojify/images/eyes.png b/public/vendor/emojify/images/eyes.png index 1ac24a61..0cc3c10f 100755 Binary files a/public/vendor/emojify/images/eyes.png and b/public/vendor/emojify/images/eyes.png differ diff --git a/public/vendor/emojify/images/factory.png b/public/vendor/emojify/images/factory.png index 64046347..63bfff10 100755 Binary files a/public/vendor/emojify/images/factory.png and b/public/vendor/emojify/images/factory.png differ diff --git a/public/vendor/emojify/images/family.png b/public/vendor/emojify/images/family.png index b4b365f3..3c841928 100755 Binary files a/public/vendor/emojify/images/family.png and b/public/vendor/emojify/images/family.png differ diff --git a/public/vendor/emojify/images/fast_forward.png b/public/vendor/emojify/images/fast_forward.png index 8830e146..abdbe514 100755 Binary files a/public/vendor/emojify/images/fast_forward.png and b/public/vendor/emojify/images/fast_forward.png differ diff --git a/public/vendor/emojify/images/fearful.png b/public/vendor/emojify/images/fearful.png index 513fce47..009861ba 100755 Binary files a/public/vendor/emojify/images/fearful.png and b/public/vendor/emojify/images/fearful.png differ diff --git a/public/vendor/emojify/images/ferris_wheel.png b/public/vendor/emojify/images/ferris_wheel.png index 54a1dcfa..7c482d45 100755 Binary files a/public/vendor/emojify/images/ferris_wheel.png and b/public/vendor/emojify/images/ferris_wheel.png differ diff --git a/public/vendor/emojify/images/file_folder.png b/public/vendor/emojify/images/file_folder.png index 4d8bebf8..9445027d 100755 Binary files a/public/vendor/emojify/images/file_folder.png and b/public/vendor/emojify/images/file_folder.png differ diff --git a/public/vendor/emojify/images/finnadie.png b/public/vendor/emojify/images/finnadie.png index bfc5a0d9..660312dc 100755 Binary files a/public/vendor/emojify/images/finnadie.png and b/public/vendor/emojify/images/finnadie.png differ diff --git a/public/vendor/emojify/images/fire_engine.png b/public/vendor/emojify/images/fire_engine.png index 9e6c59c9..8e676258 100755 Binary files a/public/vendor/emojify/images/fire_engine.png and b/public/vendor/emojify/images/fire_engine.png differ diff --git a/public/vendor/emojify/images/fireworks.png b/public/vendor/emojify/images/fireworks.png index b4eccd57..6a9eca34 100755 Binary files a/public/vendor/emojify/images/fireworks.png and b/public/vendor/emojify/images/fireworks.png differ diff --git a/public/vendor/emojify/images/fish.png b/public/vendor/emojify/images/fish.png index 90bdda2c..a91a5f09 100755 Binary files a/public/vendor/emojify/images/fish.png and b/public/vendor/emojify/images/fish.png differ diff --git a/public/vendor/emojify/images/fist.png b/public/vendor/emojify/images/fist.png index ecc8874c..6f952f95 100755 Binary files a/public/vendor/emojify/images/fist.png and b/public/vendor/emojify/images/fist.png differ diff --git a/public/vendor/emojify/images/five.png b/public/vendor/emojify/images/five.png index 794321aa..fb4e635b 100755 Binary files a/public/vendor/emojify/images/five.png and b/public/vendor/emojify/images/five.png differ diff --git a/public/vendor/emojify/images/flashlight.png b/public/vendor/emojify/images/flashlight.png index 215940aa..1f38d742 100755 Binary files a/public/vendor/emojify/images/flashlight.png and b/public/vendor/emojify/images/flashlight.png differ diff --git a/public/vendor/emojify/images/floppy_disk.png b/public/vendor/emojify/images/floppy_disk.png index 4ad56315..2e7a389f 100755 Binary files a/public/vendor/emojify/images/floppy_disk.png and b/public/vendor/emojify/images/floppy_disk.png differ diff --git a/public/vendor/emojify/images/flower_playing_cards.png b/public/vendor/emojify/images/flower_playing_cards.png index cc46a6a1..09ffb433 100755 Binary files a/public/vendor/emojify/images/flower_playing_cards.png and b/public/vendor/emojify/images/flower_playing_cards.png differ diff --git a/public/vendor/emojify/images/flushed.png b/public/vendor/emojify/images/flushed.png index 74b78c9c..b008ae25 100755 Binary files a/public/vendor/emojify/images/flushed.png and b/public/vendor/emojify/images/flushed.png differ diff --git a/public/vendor/emojify/images/foggy.png b/public/vendor/emojify/images/foggy.png index 3c7b8b04..36892f6f 100755 Binary files a/public/vendor/emojify/images/foggy.png and b/public/vendor/emojify/images/foggy.png differ diff --git a/public/vendor/emojify/images/fountain.png b/public/vendor/emojify/images/fountain.png index da126e64..0a75c5bd 100755 Binary files a/public/vendor/emojify/images/fountain.png and b/public/vendor/emojify/images/fountain.png differ diff --git a/public/vendor/emojify/images/four.png b/public/vendor/emojify/images/four.png index 14782ba2..08fe0c51 100755 Binary files a/public/vendor/emojify/images/four.png and b/public/vendor/emojify/images/four.png differ diff --git a/public/vendor/emojify/images/fr.png b/public/vendor/emojify/images/fr.png index 6311c911..3e35b6ab 100755 Binary files a/public/vendor/emojify/images/fr.png and b/public/vendor/emojify/images/fr.png differ diff --git a/public/vendor/emojify/images/frowning.png b/public/vendor/emojify/images/frowning.png index 487b7701..d226c399 100755 Binary files a/public/vendor/emojify/images/frowning.png and b/public/vendor/emojify/images/frowning.png differ diff --git a/public/vendor/emojify/images/fu.png b/public/vendor/emojify/images/fu.png index 61a3fee8..40af3c6a 100755 Binary files a/public/vendor/emojify/images/fu.png and b/public/vendor/emojify/images/fu.png differ diff --git a/public/vendor/emojify/images/gb.png b/public/vendor/emojify/images/gb.png index 2a62c7a0..5439ccf1 100755 Binary files a/public/vendor/emojify/images/gb.png and b/public/vendor/emojify/images/gb.png differ diff --git a/public/vendor/emojify/images/gem.png b/public/vendor/emojify/images/gem.png index 8a5d8dad..483c0f96 100755 Binary files a/public/vendor/emojify/images/gem.png and b/public/vendor/emojify/images/gem.png differ diff --git a/public/vendor/emojify/images/gemini.png b/public/vendor/emojify/images/gemini.png index d926f6e8..fa2e2d24 100755 Binary files a/public/vendor/emojify/images/gemini.png and b/public/vendor/emojify/images/gemini.png differ diff --git a/public/vendor/emojify/images/girl.png b/public/vendor/emojify/images/girl.png index ea412694..1771071a 100755 Binary files a/public/vendor/emojify/images/girl.png and b/public/vendor/emojify/images/girl.png differ diff --git a/public/vendor/emojify/images/golf.png b/public/vendor/emojify/images/golf.png index cba2116a..3a98bb39 100755 Binary files a/public/vendor/emojify/images/golf.png and b/public/vendor/emojify/images/golf.png differ diff --git a/public/vendor/emojify/images/green_apple.png b/public/vendor/emojify/images/green_apple.png index 337205cd..032f5f45 100755 Binary files a/public/vendor/emojify/images/green_apple.png and b/public/vendor/emojify/images/green_apple.png differ diff --git a/public/vendor/emojify/images/green_book.png b/public/vendor/emojify/images/green_book.png index e86651e5..40f532fe 100755 Binary files a/public/vendor/emojify/images/green_book.png and b/public/vendor/emojify/images/green_book.png differ diff --git a/public/vendor/emojify/images/green_heart.png b/public/vendor/emojify/images/green_heart.png index 7289cb81..a110b193 100755 Binary files a/public/vendor/emojify/images/green_heart.png and b/public/vendor/emojify/images/green_heart.png differ diff --git a/public/vendor/emojify/images/grimacing.png b/public/vendor/emojify/images/grimacing.png index 1219ba7d..1d3cce84 100755 Binary files a/public/vendor/emojify/images/grimacing.png and b/public/vendor/emojify/images/grimacing.png differ diff --git a/public/vendor/emojify/images/grin.png b/public/vendor/emojify/images/grin.png index 591cfcef..42d64572 100755 Binary files a/public/vendor/emojify/images/grin.png and b/public/vendor/emojify/images/grin.png differ diff --git a/public/vendor/emojify/images/grinning.png b/public/vendor/emojify/images/grinning.png index 7e812b7e..d45c6a15 100755 Binary files a/public/vendor/emojify/images/grinning.png and b/public/vendor/emojify/images/grinning.png differ diff --git a/public/vendor/emojify/images/guardsman.png b/public/vendor/emojify/images/guardsman.png index b67b335d..64389231 100755 Binary files a/public/vendor/emojify/images/guardsman.png and b/public/vendor/emojify/images/guardsman.png differ diff --git a/public/vendor/emojify/images/guitar.png b/public/vendor/emojify/images/guitar.png index 2b7fa43c..abb79f73 100755 Binary files a/public/vendor/emojify/images/guitar.png and b/public/vendor/emojify/images/guitar.png differ diff --git a/public/vendor/emojify/images/gun.png b/public/vendor/emojify/images/gun.png index c49dc52c..c2694ed2 100755 Binary files a/public/vendor/emojify/images/gun.png and b/public/vendor/emojify/images/gun.png differ diff --git a/public/vendor/emojify/images/haircut.png b/public/vendor/emojify/images/haircut.png index 902d273f..9a9c64df 100755 Binary files a/public/vendor/emojify/images/haircut.png and b/public/vendor/emojify/images/haircut.png differ diff --git a/public/vendor/emojify/images/hamburger.png b/public/vendor/emojify/images/hamburger.png index 9f1a3fdf..cd72b900 100755 Binary files a/public/vendor/emojify/images/hamburger.png and b/public/vendor/emojify/images/hamburger.png differ diff --git a/public/vendor/emojify/images/hand.png b/public/vendor/emojify/images/hand.png index 5e45c25a..7eea8fe1 100755 Binary files a/public/vendor/emojify/images/hand.png and b/public/vendor/emojify/images/hand.png differ diff --git a/public/vendor/emojify/images/hatching_chick.png b/public/vendor/emojify/images/hatching_chick.png index 005a5551..57523cee 100755 Binary files a/public/vendor/emojify/images/hatching_chick.png and b/public/vendor/emojify/images/hatching_chick.png differ diff --git a/public/vendor/emojify/images/headphones.png b/public/vendor/emojify/images/headphones.png index ad83000e..e36517f9 100755 Binary files a/public/vendor/emojify/images/headphones.png and b/public/vendor/emojify/images/headphones.png differ diff --git a/public/vendor/emojify/images/heart.png b/public/vendor/emojify/images/heart.png index 7d7790ce..155dbaa7 100755 Binary files a/public/vendor/emojify/images/heart.png and b/public/vendor/emojify/images/heart.png differ diff --git a/public/vendor/emojify/images/heart_decoration.png b/public/vendor/emojify/images/heart_decoration.png index b8be44db..17a4383d 100755 Binary files a/public/vendor/emojify/images/heart_decoration.png and b/public/vendor/emojify/images/heart_decoration.png differ diff --git a/public/vendor/emojify/images/heart_eyes.png b/public/vendor/emojify/images/heart_eyes.png index 0e579427..102f12bb 100755 Binary files a/public/vendor/emojify/images/heart_eyes.png and b/public/vendor/emojify/images/heart_eyes.png differ diff --git a/public/vendor/emojify/images/heartbeat.png b/public/vendor/emojify/images/heartbeat.png index b6628f6f..a31c7530 100755 Binary files a/public/vendor/emojify/images/heartbeat.png and b/public/vendor/emojify/images/heartbeat.png differ diff --git a/public/vendor/emojify/images/heartpulse.png b/public/vendor/emojify/images/heartpulse.png index a7491cbe..4b04c700 100755 Binary files a/public/vendor/emojify/images/heartpulse.png and b/public/vendor/emojify/images/heartpulse.png differ diff --git a/public/vendor/emojify/images/hearts.png b/public/vendor/emojify/images/hearts.png index e8947153..40c35f25 100755 Binary files a/public/vendor/emojify/images/hearts.png and b/public/vendor/emojify/images/hearts.png differ diff --git a/public/vendor/emojify/images/heavy_minus_sign.png b/public/vendor/emojify/images/heavy_minus_sign.png index 4a33f905..77703e53 100755 Binary files a/public/vendor/emojify/images/heavy_minus_sign.png and b/public/vendor/emojify/images/heavy_minus_sign.png differ diff --git a/public/vendor/emojify/images/helicopter.png b/public/vendor/emojify/images/helicopter.png index 8e82a0d5..f75a1b0f 100755 Binary files a/public/vendor/emojify/images/helicopter.png and b/public/vendor/emojify/images/helicopter.png differ diff --git a/public/vendor/emojify/images/high_heel.png b/public/vendor/emojify/images/high_heel.png index 525b6a0d..c03c4b45 100755 Binary files a/public/vendor/emojify/images/high_heel.png and b/public/vendor/emojify/images/high_heel.png differ diff --git a/public/vendor/emojify/images/honeybee.png b/public/vendor/emojify/images/honeybee.png index f5373395..7a7a0054 100755 Binary files a/public/vendor/emojify/images/honeybee.png and b/public/vendor/emojify/images/honeybee.png differ diff --git a/public/vendor/emojify/images/horse_racing.png b/public/vendor/emojify/images/horse_racing.png index e3bbaec1..c6f4c168 100755 Binary files a/public/vendor/emojify/images/horse_racing.png and b/public/vendor/emojify/images/horse_racing.png differ diff --git a/public/vendor/emojify/images/hushed.png b/public/vendor/emojify/images/hushed.png index bbd2cd4b..260a69da 100755 Binary files a/public/vendor/emojify/images/hushed.png and b/public/vendor/emojify/images/hushed.png differ diff --git a/public/vendor/emojify/images/ice_cream.png b/public/vendor/emojify/images/ice_cream.png index 190be016..e4390fa7 100755 Binary files a/public/vendor/emojify/images/ice_cream.png and b/public/vendor/emojify/images/ice_cream.png differ diff --git a/public/vendor/emojify/images/imp.png b/public/vendor/emojify/images/imp.png index fa7d9dc1..2a4b2978 100755 Binary files a/public/vendor/emojify/images/imp.png and b/public/vendor/emojify/images/imp.png differ diff --git a/public/vendor/emojify/images/inbox_tray.png b/public/vendor/emojify/images/inbox_tray.png index e2df0f89..a4a85ca1 100755 Binary files a/public/vendor/emojify/images/inbox_tray.png and b/public/vendor/emojify/images/inbox_tray.png differ diff --git a/public/vendor/emojify/images/innocent.png b/public/vendor/emojify/images/innocent.png index 503b614f..78d828b6 100755 Binary files a/public/vendor/emojify/images/innocent.png and b/public/vendor/emojify/images/innocent.png differ diff --git a/public/vendor/emojify/images/iphone.png b/public/vendor/emojify/images/iphone.png index df007103..294ead64 100755 Binary files a/public/vendor/emojify/images/iphone.png and b/public/vendor/emojify/images/iphone.png differ diff --git a/public/vendor/emojify/images/it.png b/public/vendor/emojify/images/it.png index 70bc9f32..ebdf3e67 100755 Binary files a/public/vendor/emojify/images/it.png and b/public/vendor/emojify/images/it.png differ diff --git a/public/vendor/emojify/images/japan.png b/public/vendor/emojify/images/japan.png index 45932803..9d6459f8 100755 Binary files a/public/vendor/emojify/images/japan.png and b/public/vendor/emojify/images/japan.png differ diff --git a/public/vendor/emojify/images/japanese_castle.png b/public/vendor/emojify/images/japanese_castle.png index f225ab21..3ca96c10 100755 Binary files a/public/vendor/emojify/images/japanese_castle.png and b/public/vendor/emojify/images/japanese_castle.png differ diff --git a/public/vendor/emojify/images/joy.png b/public/vendor/emojify/images/joy.png index 47df693d..f0435c8b 100755 Binary files a/public/vendor/emojify/images/joy.png and b/public/vendor/emojify/images/joy.png differ diff --git a/public/vendor/emojify/images/jp.png b/public/vendor/emojify/images/jp.png index b786efbb..e04dd106 100755 Binary files a/public/vendor/emojify/images/jp.png and b/public/vendor/emojify/images/jp.png differ diff --git a/public/vendor/emojify/images/keycap_ten.png b/public/vendor/emojify/images/keycap_ten.png index 71dac1c1..5c223440 100755 Binary files a/public/vendor/emojify/images/keycap_ten.png and b/public/vendor/emojify/images/keycap_ten.png differ diff --git a/public/vendor/emojify/images/kissing.png b/public/vendor/emojify/images/kissing.png index f3c8dcd7..2b0b234a 100755 Binary files a/public/vendor/emojify/images/kissing.png and b/public/vendor/emojify/images/kissing.png differ diff --git a/public/vendor/emojify/images/kissing_closed_eyes.png b/public/vendor/emojify/images/kissing_closed_eyes.png index 449de197..c1bf1ec9 100755 Binary files a/public/vendor/emojify/images/kissing_closed_eyes.png and b/public/vendor/emojify/images/kissing_closed_eyes.png differ diff --git a/public/vendor/emojify/images/kissing_face.png b/public/vendor/emojify/images/kissing_face.png index 449de197..c1bf1ec9 100755 Binary files a/public/vendor/emojify/images/kissing_face.png and b/public/vendor/emojify/images/kissing_face.png differ diff --git a/public/vendor/emojify/images/kissing_heart.png b/public/vendor/emojify/images/kissing_heart.png index af9a80b7..deb503e7 100755 Binary files a/public/vendor/emojify/images/kissing_heart.png and b/public/vendor/emojify/images/kissing_heart.png differ diff --git a/public/vendor/emojify/images/kissing_smiling_eyes.png b/public/vendor/emojify/images/kissing_smiling_eyes.png index 57f7b493..fe86b115 100755 Binary files a/public/vendor/emojify/images/kissing_smiling_eyes.png and b/public/vendor/emojify/images/kissing_smiling_eyes.png differ diff --git a/public/vendor/emojify/images/koala.png b/public/vendor/emojify/images/koala.png index e17bd3cf..bd4b09e3 100755 Binary files a/public/vendor/emojify/images/koala.png and b/public/vendor/emojify/images/koala.png differ diff --git a/public/vendor/emojify/images/koko.png b/public/vendor/emojify/images/koko.png index 3bef28c9..f9683664 100755 Binary files a/public/vendor/emojify/images/koko.png and b/public/vendor/emojify/images/koko.png differ diff --git a/public/vendor/emojify/images/kr.png b/public/vendor/emojify/images/kr.png index b4c0c1b6..4ee23b0f 100755 Binary files a/public/vendor/emojify/images/kr.png and b/public/vendor/emojify/images/kr.png differ diff --git a/public/vendor/emojify/images/large_blue_circle.png b/public/vendor/emojify/images/large_blue_circle.png index a5b4ad4a..47a950f7 100755 Binary files a/public/vendor/emojify/images/large_blue_circle.png and b/public/vendor/emojify/images/large_blue_circle.png differ diff --git a/public/vendor/emojify/images/large_blue_diamond.png b/public/vendor/emojify/images/large_blue_diamond.png index f4598ec0..65e50b04 100755 Binary files a/public/vendor/emojify/images/large_blue_diamond.png and b/public/vendor/emojify/images/large_blue_diamond.png differ diff --git a/public/vendor/emojify/images/large_orange_diamond.png b/public/vendor/emojify/images/large_orange_diamond.png index 803725aa..4f62022f 100755 Binary files a/public/vendor/emojify/images/large_orange_diamond.png and b/public/vendor/emojify/images/large_orange_diamond.png differ diff --git a/public/vendor/emojify/images/laughing.png b/public/vendor/emojify/images/laughing.png index 11c91eb2..85d184e0 100755 Binary files a/public/vendor/emojify/images/laughing.png and b/public/vendor/emojify/images/laughing.png differ diff --git a/public/vendor/emojify/images/left_right_arrow.png b/public/vendor/emojify/images/left_right_arrow.png index b9fd11c5..6dbe5363 100755 Binary files a/public/vendor/emojify/images/left_right_arrow.png and b/public/vendor/emojify/images/left_right_arrow.png differ diff --git a/public/vendor/emojify/images/leo.png b/public/vendor/emojify/images/leo.png index e025933b..1e5da887 100755 Binary files a/public/vendor/emojify/images/leo.png and b/public/vendor/emojify/images/leo.png differ diff --git a/public/vendor/emojify/images/libra.png b/public/vendor/emojify/images/libra.png index 6f4a927c..208e6d77 100755 Binary files a/public/vendor/emojify/images/libra.png and b/public/vendor/emojify/images/libra.png differ diff --git a/public/vendor/emojify/images/lips.png b/public/vendor/emojify/images/lips.png index 826ed110..fbe76ada 100755 Binary files a/public/vendor/emojify/images/lips.png and b/public/vendor/emojify/images/lips.png differ diff --git a/public/vendor/emojify/images/lollipop.png b/public/vendor/emojify/images/lollipop.png index ba55e709..9edcdf7a 100755 Binary files a/public/vendor/emojify/images/lollipop.png and b/public/vendor/emojify/images/lollipop.png differ diff --git a/public/vendor/emojify/images/love_hotel.png b/public/vendor/emojify/images/love_hotel.png index 44d7db82..7bfa02f3 100755 Binary files a/public/vendor/emojify/images/love_hotel.png and b/public/vendor/emojify/images/love_hotel.png differ diff --git a/public/vendor/emojify/images/love_letter.png b/public/vendor/emojify/images/love_letter.png index e29981f4..31387384 100755 Binary files a/public/vendor/emojify/images/love_letter.png and b/public/vendor/emojify/images/love_letter.png differ diff --git a/public/vendor/emojify/images/mag.png b/public/vendor/emojify/images/mag.png index aa5b1d7c..4f7906b9 100755 Binary files a/public/vendor/emojify/images/mag.png and b/public/vendor/emojify/images/mag.png differ diff --git a/public/vendor/emojify/images/mahjong.png b/public/vendor/emojify/images/mahjong.png index f51ce65f..3219d277 100755 Binary files a/public/vendor/emojify/images/mahjong.png and b/public/vendor/emojify/images/mahjong.png differ diff --git a/public/vendor/emojify/images/mailbox.png b/public/vendor/emojify/images/mailbox.png index 8351e707..eb48cf7c 100755 Binary files a/public/vendor/emojify/images/mailbox.png and b/public/vendor/emojify/images/mailbox.png differ diff --git a/public/vendor/emojify/images/mailbox_closed.png b/public/vendor/emojify/images/mailbox_closed.png index a5982b69..397e8449 100755 Binary files a/public/vendor/emojify/images/mailbox_closed.png and b/public/vendor/emojify/images/mailbox_closed.png differ diff --git a/public/vendor/emojify/images/man.png b/public/vendor/emojify/images/man.png index d9bfa26a..66edc653 100755 Binary files a/public/vendor/emojify/images/man.png and b/public/vendor/emojify/images/man.png differ diff --git a/public/vendor/emojify/images/man_with_turban.png b/public/vendor/emojify/images/man_with_turban.png index 036604ca..915e9848 100755 Binary files a/public/vendor/emojify/images/man_with_turban.png and b/public/vendor/emojify/images/man_with_turban.png differ diff --git a/public/vendor/emojify/images/mans_shoe.png b/public/vendor/emojify/images/mans_shoe.png index ecba9ba7..fe0c7c1b 100755 Binary files a/public/vendor/emojify/images/mans_shoe.png and b/public/vendor/emojify/images/mans_shoe.png differ diff --git a/public/vendor/emojify/images/mask.png b/public/vendor/emojify/images/mask.png index 05887e99..a0efb9cf 100755 Binary files a/public/vendor/emojify/images/mask.png and b/public/vendor/emojify/images/mask.png differ diff --git a/public/vendor/emojify/images/mens.png b/public/vendor/emojify/images/mens.png index abccfc9f..e5adab6c 100755 Binary files a/public/vendor/emojify/images/mens.png and b/public/vendor/emojify/images/mens.png differ diff --git a/public/vendor/emojify/images/metro.png b/public/vendor/emojify/images/metro.png index 4acf5ab3..14fc8d18 100755 Binary files a/public/vendor/emojify/images/metro.png and b/public/vendor/emojify/images/metro.png differ diff --git a/public/vendor/emojify/images/milky_way.png b/public/vendor/emojify/images/milky_way.png index 901090a1..f03f0544 100755 Binary files a/public/vendor/emojify/images/milky_way.png and b/public/vendor/emojify/images/milky_way.png differ diff --git a/public/vendor/emojify/images/minibus.png b/public/vendor/emojify/images/minibus.png index c52cef23..9bf31f6f 100755 Binary files a/public/vendor/emojify/images/minibus.png and b/public/vendor/emojify/images/minibus.png differ diff --git a/public/vendor/emojify/images/mobile_phone_off.png b/public/vendor/emojify/images/mobile_phone_off.png index fa16c763..768d91f5 100755 Binary files a/public/vendor/emojify/images/mobile_phone_off.png and b/public/vendor/emojify/images/mobile_phone_off.png differ diff --git a/public/vendor/emojify/images/moon.png b/public/vendor/emojify/images/moon.png index afdb450d..751e31b8 100755 Binary files a/public/vendor/emojify/images/moon.png and b/public/vendor/emojify/images/moon.png differ diff --git a/public/vendor/emojify/images/mount_fuji.png b/public/vendor/emojify/images/mount_fuji.png index 4c313e58..4c5f5471 100755 Binary files a/public/vendor/emojify/images/mount_fuji.png and b/public/vendor/emojify/images/mount_fuji.png differ diff --git a/public/vendor/emojify/images/mountain_bicyclist.png b/public/vendor/emojify/images/mountain_bicyclist.png index b6988975..ecb0996f 100755 Binary files a/public/vendor/emojify/images/mountain_bicyclist.png and b/public/vendor/emojify/images/mountain_bicyclist.png differ diff --git a/public/vendor/emojify/images/mountain_cableway.png b/public/vendor/emojify/images/mountain_cableway.png index 5688bb23..c9f00e8e 100755 Binary files a/public/vendor/emojify/images/mountain_cableway.png and b/public/vendor/emojify/images/mountain_cableway.png differ diff --git a/public/vendor/emojify/images/mountain_railway.png b/public/vendor/emojify/images/mountain_railway.png index 1f3d1aab..6ba93406 100755 Binary files a/public/vendor/emojify/images/mountain_railway.png and b/public/vendor/emojify/images/mountain_railway.png differ diff --git a/public/vendor/emojify/images/mouse.png b/public/vendor/emojify/images/mouse.png index 8ff162e2..2433e232 100755 Binary files a/public/vendor/emojify/images/mouse.png and b/public/vendor/emojify/images/mouse.png differ diff --git a/public/vendor/emojify/images/mouse2.png b/public/vendor/emojify/images/mouse2.png index 2d777e5e..7a60b211 100755 Binary files a/public/vendor/emojify/images/mouse2.png and b/public/vendor/emojify/images/mouse2.png differ diff --git a/public/vendor/emojify/images/movie_camera.png b/public/vendor/emojify/images/movie_camera.png index 9c143840..ffa9c8ff 100755 Binary files a/public/vendor/emojify/images/movie_camera.png and b/public/vendor/emojify/images/movie_camera.png differ diff --git a/public/vendor/emojify/images/moyai.png b/public/vendor/emojify/images/moyai.png index 61a1a9c2..ff1f19db 100755 Binary files a/public/vendor/emojify/images/moyai.png and b/public/vendor/emojify/images/moyai.png differ diff --git a/public/vendor/emojify/images/muscle.png b/public/vendor/emojify/images/muscle.png index 19f92efb..456a729f 100755 Binary files a/public/vendor/emojify/images/muscle.png and b/public/vendor/emojify/images/muscle.png differ diff --git a/public/vendor/emojify/images/musical_keyboard.png b/public/vendor/emojify/images/musical_keyboard.png index 93647a4a..5fd132a3 100755 Binary files a/public/vendor/emojify/images/musical_keyboard.png and b/public/vendor/emojify/images/musical_keyboard.png differ diff --git a/public/vendor/emojify/images/musical_note.png b/public/vendor/emojify/images/musical_note.png index 68b261bc..a9ee4ace 100755 Binary files a/public/vendor/emojify/images/musical_note.png and b/public/vendor/emojify/images/musical_note.png differ diff --git a/public/vendor/emojify/images/musical_score.png b/public/vendor/emojify/images/musical_score.png index c99e3381..a510ba45 100755 Binary files a/public/vendor/emojify/images/musical_score.png and b/public/vendor/emojify/images/musical_score.png differ diff --git a/public/vendor/emojify/images/nail_care.png b/public/vendor/emojify/images/nail_care.png index 6a66e63d..4c1771d0 100755 Binary files a/public/vendor/emojify/images/nail_care.png and b/public/vendor/emojify/images/nail_care.png differ diff --git a/public/vendor/emojify/images/neckbeard.png b/public/vendor/emojify/images/neckbeard.png index 6e31d165..2349221a 100755 Binary files a/public/vendor/emojify/images/neckbeard.png and b/public/vendor/emojify/images/neckbeard.png differ diff --git a/public/vendor/emojify/images/necktie.png b/public/vendor/emojify/images/necktie.png index 80461c66..d7dc86f8 100755 Binary files a/public/vendor/emojify/images/necktie.png and b/public/vendor/emojify/images/necktie.png differ diff --git a/public/vendor/emojify/images/neutral_face.png b/public/vendor/emojify/images/neutral_face.png index 682a1ba0..caa81f6b 100755 Binary files a/public/vendor/emojify/images/neutral_face.png and b/public/vendor/emojify/images/neutral_face.png differ diff --git a/public/vendor/emojify/images/new.png b/public/vendor/emojify/images/new.png index 28d1570e..8012280b 100755 Binary files a/public/vendor/emojify/images/new.png and b/public/vendor/emojify/images/new.png differ diff --git a/public/vendor/emojify/images/new_moon_with_face.png b/public/vendor/emojify/images/new_moon_with_face.png index 21a696eb..e1df7af4 100755 Binary files a/public/vendor/emojify/images/new_moon_with_face.png and b/public/vendor/emojify/images/new_moon_with_face.png differ diff --git a/public/vendor/emojify/images/newspaper.png b/public/vendor/emojify/images/newspaper.png index 60c3394d..242328fd 100755 Binary files a/public/vendor/emojify/images/newspaper.png and b/public/vendor/emojify/images/newspaper.png differ diff --git a/public/vendor/emojify/images/ng.png b/public/vendor/emojify/images/ng.png index 2ca180ae..f3f60ec1 100755 Binary files a/public/vendor/emojify/images/ng.png and b/public/vendor/emojify/images/ng.png differ diff --git a/public/vendor/emojify/images/nine.png b/public/vendor/emojify/images/nine.png index 8006cc90..8c4c6b2b 100755 Binary files a/public/vendor/emojify/images/nine.png and b/public/vendor/emojify/images/nine.png differ diff --git a/public/vendor/emojify/images/no_mouth.png b/public/vendor/emojify/images/no_mouth.png index e6780204..5b1010bc 100755 Binary files a/public/vendor/emojify/images/no_mouth.png and b/public/vendor/emojify/images/no_mouth.png differ diff --git a/public/vendor/emojify/images/no_smoking.png b/public/vendor/emojify/images/no_smoking.png index 5880ddfd..581905d9 100755 Binary files a/public/vendor/emojify/images/no_smoking.png and b/public/vendor/emojify/images/no_smoking.png differ diff --git a/public/vendor/emojify/images/nose.png b/public/vendor/emojify/images/nose.png index ad17c16c..e3fd4ee2 100755 Binary files a/public/vendor/emojify/images/nose.png and b/public/vendor/emojify/images/nose.png differ diff --git a/public/vendor/emojify/images/notebook_with_decorative_cover.png b/public/vendor/emojify/images/notebook_with_decorative_cover.png index 4f3b14c8..2b3e47bc 100755 Binary files a/public/vendor/emojify/images/notebook_with_decorative_cover.png and b/public/vendor/emojify/images/notebook_with_decorative_cover.png differ diff --git a/public/vendor/emojify/images/notes.png b/public/vendor/emojify/images/notes.png index 0956d6ab..7d2d2229 100755 Binary files a/public/vendor/emojify/images/notes.png and b/public/vendor/emojify/images/notes.png differ diff --git a/public/vendor/emojify/images/o2.png b/public/vendor/emojify/images/o2.png index d85f9fb9..127a2b80 100755 Binary files a/public/vendor/emojify/images/o2.png and b/public/vendor/emojify/images/o2.png differ diff --git a/public/vendor/emojify/images/octocat.png b/public/vendor/emojify/images/octocat.png index d296f25f..3dc7e6ff 100755 Binary files a/public/vendor/emojify/images/octocat.png and b/public/vendor/emojify/images/octocat.png differ diff --git a/public/vendor/emojify/images/octopus.png b/public/vendor/emojify/images/octopus.png index 52ce64b4..20761682 100755 Binary files a/public/vendor/emojify/images/octopus.png and b/public/vendor/emojify/images/octopus.png differ diff --git a/public/vendor/emojify/images/office.png b/public/vendor/emojify/images/office.png index 53c3ef8d..28bc2176 100755 Binary files a/public/vendor/emojify/images/office.png and b/public/vendor/emojify/images/office.png differ diff --git a/public/vendor/emojify/images/ok.png b/public/vendor/emojify/images/ok.png index 6433d1a9..6d528fc7 100755 Binary files a/public/vendor/emojify/images/ok.png and b/public/vendor/emojify/images/ok.png differ diff --git a/public/vendor/emojify/images/older_man.png b/public/vendor/emojify/images/older_man.png index 149f0cfb..4eff1687 100755 Binary files a/public/vendor/emojify/images/older_man.png and b/public/vendor/emojify/images/older_man.png differ diff --git a/public/vendor/emojify/images/oncoming_bus.png b/public/vendor/emojify/images/oncoming_bus.png index 3695f762..49129a5d 100755 Binary files a/public/vendor/emojify/images/oncoming_bus.png and b/public/vendor/emojify/images/oncoming_bus.png differ diff --git a/public/vendor/emojify/images/one.png b/public/vendor/emojify/images/one.png index 2d1f9f8c..16248afc 100755 Binary files a/public/vendor/emojify/images/one.png and b/public/vendor/emojify/images/one.png differ diff --git a/public/vendor/emojify/images/open_hands.png b/public/vendor/emojify/images/open_hands.png index cef9f428..a00a43a8 100755 Binary files a/public/vendor/emojify/images/open_hands.png and b/public/vendor/emojify/images/open_hands.png differ diff --git a/public/vendor/emojify/images/open_mouth.png b/public/vendor/emojify/images/open_mouth.png index daf91427..b686e601 100755 Binary files a/public/vendor/emojify/images/open_mouth.png and b/public/vendor/emojify/images/open_mouth.png differ diff --git a/public/vendor/emojify/images/ophiuchus.png b/public/vendor/emojify/images/ophiuchus.png index 4eef715b..7a0c1c23 100755 Binary files a/public/vendor/emojify/images/ophiuchus.png and b/public/vendor/emojify/images/ophiuchus.png differ diff --git a/public/vendor/emojify/images/orange_book.png b/public/vendor/emojify/images/orange_book.png index 49650d59..0253822c 100755 Binary files a/public/vendor/emojify/images/orange_book.png and b/public/vendor/emojify/images/orange_book.png differ diff --git a/public/vendor/emojify/images/outbox_tray.png b/public/vendor/emojify/images/outbox_tray.png index 7ad15e64..50967df0 100755 Binary files a/public/vendor/emojify/images/outbox_tray.png and b/public/vendor/emojify/images/outbox_tray.png differ diff --git a/public/vendor/emojify/images/package.png b/public/vendor/emojify/images/package.png index 26602af9..1c3f346a 100755 Binary files a/public/vendor/emojify/images/package.png and b/public/vendor/emojify/images/package.png differ diff --git a/public/vendor/emojify/images/pager.png b/public/vendor/emojify/images/pager.png index e3e1fc44..a9071326 100755 Binary files a/public/vendor/emojify/images/pager.png and b/public/vendor/emojify/images/pager.png differ diff --git a/public/vendor/emojify/images/paw_prints.png b/public/vendor/emojify/images/paw_prints.png index 89b9fec9..83971f24 100755 Binary files a/public/vendor/emojify/images/paw_prints.png and b/public/vendor/emojify/images/paw_prints.png differ diff --git a/public/vendor/emojify/images/peach.png b/public/vendor/emojify/images/peach.png index ee2139ec..814de502 100755 Binary files a/public/vendor/emojify/images/peach.png and b/public/vendor/emojify/images/peach.png differ diff --git a/public/vendor/emojify/images/pear.png b/public/vendor/emojify/images/pear.png index f24aca8c..7d183f9b 100755 Binary files a/public/vendor/emojify/images/pear.png and b/public/vendor/emojify/images/pear.png differ diff --git a/public/vendor/emojify/images/penguin.png b/public/vendor/emojify/images/penguin.png index d8edbcb8..ea3215b6 100755 Binary files a/public/vendor/emojify/images/penguin.png and b/public/vendor/emojify/images/penguin.png differ diff --git a/public/vendor/emojify/images/pensive.png b/public/vendor/emojify/images/pensive.png index 4159f3c4..f2f8c67f 100755 Binary files a/public/vendor/emojify/images/pensive.png and b/public/vendor/emojify/images/pensive.png differ diff --git a/public/vendor/emojify/images/persevere.png b/public/vendor/emojify/images/persevere.png index f99f6da4..10c384c7 100755 Binary files a/public/vendor/emojify/images/persevere.png and b/public/vendor/emojify/images/persevere.png differ diff --git a/public/vendor/emojify/images/person_with_blond_hair.png b/public/vendor/emojify/images/person_with_blond_hair.png index c144301c..3b61b372 100755 Binary files a/public/vendor/emojify/images/person_with_blond_hair.png and b/public/vendor/emojify/images/person_with_blond_hair.png differ diff --git a/public/vendor/emojify/images/pig2.png b/public/vendor/emojify/images/pig2.png index fec3374d..e46851d4 100755 Binary files a/public/vendor/emojify/images/pig2.png and b/public/vendor/emojify/images/pig2.png differ diff --git a/public/vendor/emojify/images/pig_nose.png b/public/vendor/emojify/images/pig_nose.png index 38d61244..53b9323a 100755 Binary files a/public/vendor/emojify/images/pig_nose.png and b/public/vendor/emojify/images/pig_nose.png differ diff --git a/public/vendor/emojify/images/pisces.png b/public/vendor/emojify/images/pisces.png index 6db2c3d5..b64dbf95 100755 Binary files a/public/vendor/emojify/images/pisces.png and b/public/vendor/emojify/images/pisces.png differ diff --git a/public/vendor/emojify/images/plus1.png b/public/vendor/emojify/images/plus1.png index 81786c1d..0aab213c 100755 Binary files a/public/vendor/emojify/images/plus1.png and b/public/vendor/emojify/images/plus1.png differ diff --git a/public/vendor/emojify/images/point_left.png b/public/vendor/emojify/images/point_left.png index 38a99b43..b0b3c027 100755 Binary files a/public/vendor/emojify/images/point_left.png and b/public/vendor/emojify/images/point_left.png differ diff --git a/public/vendor/emojify/images/point_right.png b/public/vendor/emojify/images/point_right.png index 6f9f029a..2b8adf9b 100755 Binary files a/public/vendor/emojify/images/point_right.png and b/public/vendor/emojify/images/point_right.png differ diff --git a/public/vendor/emojify/images/police_car.png b/public/vendor/emojify/images/police_car.png index b8f17275..7e680719 100755 Binary files a/public/vendor/emojify/images/police_car.png and b/public/vendor/emojify/images/police_car.png differ diff --git a/public/vendor/emojify/images/pound.png b/public/vendor/emojify/images/pound.png index f8be91d7..5594c3d2 100755 Binary files a/public/vendor/emojify/images/pound.png and b/public/vendor/emojify/images/pound.png differ diff --git a/public/vendor/emojify/images/purple_heart.png b/public/vendor/emojify/images/purple_heart.png index d5f87504..214d58c1 100755 Binary files a/public/vendor/emojify/images/purple_heart.png and b/public/vendor/emojify/images/purple_heart.png differ diff --git a/public/vendor/emojify/images/purse.png b/public/vendor/emojify/images/purse.png index 8f06a2b9..ae99d07b 100755 Binary files a/public/vendor/emojify/images/purse.png and b/public/vendor/emojify/images/purse.png differ diff --git a/public/vendor/emojify/images/racehorse.png b/public/vendor/emojify/images/racehorse.png index 4d09c64d..89d21821 100755 Binary files a/public/vendor/emojify/images/racehorse.png and b/public/vendor/emojify/images/racehorse.png differ diff --git a/public/vendor/emojify/images/radio_button.png b/public/vendor/emojify/images/radio_button.png index 63755eec..6ee99a71 100755 Binary files a/public/vendor/emojify/images/radio_button.png and b/public/vendor/emojify/images/radio_button.png differ diff --git a/public/vendor/emojify/images/rage.png b/public/vendor/emojify/images/rage.png index c65ddff5..3e04d251 100755 Binary files a/public/vendor/emojify/images/rage.png and b/public/vendor/emojify/images/rage.png differ diff --git a/public/vendor/emojify/images/railway_car.png b/public/vendor/emojify/images/railway_car.png index 22361158..f15718df 100755 Binary files a/public/vendor/emojify/images/railway_car.png and b/public/vendor/emojify/images/railway_car.png differ diff --git a/public/vendor/emojify/images/rainbow.png b/public/vendor/emojify/images/rainbow.png index 6b1faa03..795eb840 100755 Binary files a/public/vendor/emojify/images/rainbow.png and b/public/vendor/emojify/images/rainbow.png differ diff --git a/public/vendor/emojify/images/raised_hand.png b/public/vendor/emojify/images/raised_hand.png index 5e45c25a..7eea8fe1 100755 Binary files a/public/vendor/emojify/images/raised_hand.png and b/public/vendor/emojify/images/raised_hand.png differ diff --git a/public/vendor/emojify/images/raised_hands.png b/public/vendor/emojify/images/raised_hands.png index e03142bd..0796608d 100755 Binary files a/public/vendor/emojify/images/raised_hands.png and b/public/vendor/emojify/images/raised_hands.png differ diff --git a/public/vendor/emojify/images/ramen.png b/public/vendor/emojify/images/ramen.png index 78dc7d53..fe265eea 100755 Binary files a/public/vendor/emojify/images/ramen.png and b/public/vendor/emojify/images/ramen.png differ diff --git a/public/vendor/emojify/images/rat.png b/public/vendor/emojify/images/rat.png index fa7dd401..a596d373 100755 Binary files a/public/vendor/emojify/images/rat.png and b/public/vendor/emojify/images/rat.png differ diff --git a/public/vendor/emojify/images/red_car.png b/public/vendor/emojify/images/red_car.png index d70a2f06..b0d9a709 100755 Binary files a/public/vendor/emojify/images/red_car.png and b/public/vendor/emojify/images/red_car.png differ diff --git a/public/vendor/emojify/images/red_circle.png b/public/vendor/emojify/images/red_circle.png index b391289b..dc96a3f1 100755 Binary files a/public/vendor/emojify/images/red_circle.png and b/public/vendor/emojify/images/red_circle.png differ diff --git a/public/vendor/emojify/images/relaxed.png b/public/vendor/emojify/images/relaxed.png index bbab82d3..6f7c7377 100755 Binary files a/public/vendor/emojify/images/relaxed.png and b/public/vendor/emojify/images/relaxed.png differ diff --git a/public/vendor/emojify/images/relieved.png b/public/vendor/emojify/images/relieved.png index fe5629f4..3a8b160d 100755 Binary files a/public/vendor/emojify/images/relieved.png and b/public/vendor/emojify/images/relieved.png differ diff --git a/public/vendor/emojify/images/repeat_one.png b/public/vendor/emojify/images/repeat_one.png index 3c47bcc1..1b1ed004 100755 Binary files a/public/vendor/emojify/images/repeat_one.png and b/public/vendor/emojify/images/repeat_one.png differ diff --git a/public/vendor/emojify/images/restroom.png b/public/vendor/emojify/images/restroom.png index d6c111b2..3a1cce3c 100755 Binary files a/public/vendor/emojify/images/restroom.png and b/public/vendor/emojify/images/restroom.png differ diff --git a/public/vendor/emojify/images/rewind.png b/public/vendor/emojify/images/rewind.png index 26289dc3..01c23fc9 100755 Binary files a/public/vendor/emojify/images/rewind.png and b/public/vendor/emojify/images/rewind.png differ diff --git a/public/vendor/emojify/images/rice.png b/public/vendor/emojify/images/rice.png index 1fd22027..ac2b6a66 100755 Binary files a/public/vendor/emojify/images/rice.png and b/public/vendor/emojify/images/rice.png differ diff --git a/public/vendor/emojify/images/rice_scene.png b/public/vendor/emojify/images/rice_scene.png index 14361988..f80d6e5b 100755 Binary files a/public/vendor/emojify/images/rice_scene.png and b/public/vendor/emojify/images/rice_scene.png differ diff --git a/public/vendor/emojify/images/ring.png b/public/vendor/emojify/images/ring.png index 8a57fd68..7273b8fe 100755 Binary files a/public/vendor/emojify/images/ring.png and b/public/vendor/emojify/images/ring.png differ diff --git a/public/vendor/emojify/images/roller_coaster.png b/public/vendor/emojify/images/roller_coaster.png index 9180b986..9642984a 100755 Binary files a/public/vendor/emojify/images/roller_coaster.png and b/public/vendor/emojify/images/roller_coaster.png differ diff --git a/public/vendor/emojify/images/rose.png b/public/vendor/emojify/images/rose.png index 3479fbcb..55974bf4 100755 Binary files a/public/vendor/emojify/images/rose.png and b/public/vendor/emojify/images/rose.png differ diff --git a/public/vendor/emojify/images/round_pushpin.png b/public/vendor/emojify/images/round_pushpin.png index e498e92c..5d2f6a57 100755 Binary files a/public/vendor/emojify/images/round_pushpin.png and b/public/vendor/emojify/images/round_pushpin.png differ diff --git a/public/vendor/emojify/images/rowboat.png b/public/vendor/emojify/images/rowboat.png index e370d0fb..8d6c5d51 100755 Binary files a/public/vendor/emojify/images/rowboat.png and b/public/vendor/emojify/images/rowboat.png differ diff --git a/public/vendor/emojify/images/ru.png b/public/vendor/emojify/images/ru.png index 55fcf354..6b02f673 100755 Binary files a/public/vendor/emojify/images/ru.png and b/public/vendor/emojify/images/ru.png differ diff --git a/public/vendor/emojify/images/sa.png b/public/vendor/emojify/images/sa.png index 387f098b..f9b43860 100755 Binary files a/public/vendor/emojify/images/sa.png and b/public/vendor/emojify/images/sa.png differ diff --git a/public/vendor/emojify/images/sagittarius.png b/public/vendor/emojify/images/sagittarius.png index 8b5435ba..5ac51d86 100755 Binary files a/public/vendor/emojify/images/sagittarius.png and b/public/vendor/emojify/images/sagittarius.png differ diff --git a/public/vendor/emojify/images/santa.png b/public/vendor/emojify/images/santa.png index a2240c07..c5280085 100755 Binary files a/public/vendor/emojify/images/santa.png and b/public/vendor/emojify/images/santa.png differ diff --git a/public/vendor/emojify/images/satisfied.png b/public/vendor/emojify/images/satisfied.png index 11c91eb2..85d184e0 100755 Binary files a/public/vendor/emojify/images/satisfied.png and b/public/vendor/emojify/images/satisfied.png differ diff --git a/public/vendor/emojify/images/school_satchel.png b/public/vendor/emojify/images/school_satchel.png index edfb19ae..6930bbe5 100755 Binary files a/public/vendor/emojify/images/school_satchel.png and b/public/vendor/emojify/images/school_satchel.png differ diff --git a/public/vendor/emojify/images/scorpius.png b/public/vendor/emojify/images/scorpius.png index 67fcea16..3f96984c 100755 Binary files a/public/vendor/emojify/images/scorpius.png and b/public/vendor/emojify/images/scorpius.png differ diff --git a/public/vendor/emojify/images/scream.png b/public/vendor/emojify/images/scream.png index 9e93c885..6d3b60ba 100755 Binary files a/public/vendor/emojify/images/scream.png and b/public/vendor/emojify/images/scream.png differ diff --git a/public/vendor/emojify/images/secret.png b/public/vendor/emojify/images/secret.png index 82e383a6..d9d20ebe 100755 Binary files a/public/vendor/emojify/images/secret.png and b/public/vendor/emojify/images/secret.png differ diff --git a/public/vendor/emojify/images/seven.png b/public/vendor/emojify/images/seven.png index 354e89ae..97912bf0 100755 Binary files a/public/vendor/emojify/images/seven.png and b/public/vendor/emojify/images/seven.png differ diff --git a/public/vendor/emojify/images/shaved_ice.png b/public/vendor/emojify/images/shaved_ice.png index 0d0b382c..dc051c92 100755 Binary files a/public/vendor/emojify/images/shaved_ice.png and b/public/vendor/emojify/images/shaved_ice.png differ diff --git a/public/vendor/emojify/images/ship.png b/public/vendor/emojify/images/ship.png index 5d2d8b60..1feb4707 100755 Binary files a/public/vendor/emojify/images/ship.png and b/public/vendor/emojify/images/ship.png differ diff --git a/public/vendor/emojify/images/shirt.png b/public/vendor/emojify/images/shirt.png index 297a6d63..15c2e111 100755 Binary files a/public/vendor/emojify/images/shirt.png and b/public/vendor/emojify/images/shirt.png differ diff --git a/public/vendor/emojify/images/signal_strength.png b/public/vendor/emojify/images/signal_strength.png index a4bd23eb..df3deea2 100755 Binary files a/public/vendor/emojify/images/signal_strength.png and b/public/vendor/emojify/images/signal_strength.png differ diff --git a/public/vendor/emojify/images/six.png b/public/vendor/emojify/images/six.png index 56880556..b56b7a88 100755 Binary files a/public/vendor/emojify/images/six.png and b/public/vendor/emojify/images/six.png differ diff --git a/public/vendor/emojify/images/sleepy.png b/public/vendor/emojify/images/sleepy.png index df4f55ef..d744d080 100755 Binary files a/public/vendor/emojify/images/sleepy.png and b/public/vendor/emojify/images/sleepy.png differ diff --git a/public/vendor/emojify/images/slot_machine.png b/public/vendor/emojify/images/slot_machine.png index 26f11483..001c4ce0 100755 Binary files a/public/vendor/emojify/images/slot_machine.png and b/public/vendor/emojify/images/slot_machine.png differ diff --git a/public/vendor/emojify/images/smile.png b/public/vendor/emojify/images/smile.png index 81a83968..d4d7234c 100755 Binary files a/public/vendor/emojify/images/smile.png and b/public/vendor/emojify/images/smile.png differ diff --git a/public/vendor/emojify/images/smiley.png b/public/vendor/emojify/images/smiley.png index 77b581d6..606d833d 100755 Binary files a/public/vendor/emojify/images/smiley.png and b/public/vendor/emojify/images/smiley.png differ diff --git a/public/vendor/emojify/images/smiling_imp.png b/public/vendor/emojify/images/smiling_imp.png index d9040493..4d2f392a 100755 Binary files a/public/vendor/emojify/images/smiling_imp.png and b/public/vendor/emojify/images/smiling_imp.png differ diff --git a/public/vendor/emojify/images/smirk.png b/public/vendor/emojify/images/smirk.png index bc6e5082..acc4ab94 100755 Binary files a/public/vendor/emojify/images/smirk.png and b/public/vendor/emojify/images/smirk.png differ diff --git a/public/vendor/emojify/images/smoking.png b/public/vendor/emojify/images/smoking.png index 4aad6cbd..41658b81 100755 Binary files a/public/vendor/emojify/images/smoking.png and b/public/vendor/emojify/images/smoking.png differ diff --git a/public/vendor/emojify/images/snowflake.png b/public/vendor/emojify/images/snowflake.png index 54b68ff4..d63884bc 100755 Binary files a/public/vendor/emojify/images/snowflake.png and b/public/vendor/emojify/images/snowflake.png differ diff --git a/public/vendor/emojify/images/sob.png b/public/vendor/emojify/images/sob.png index 1561df92..5e973a6c 100755 Binary files a/public/vendor/emojify/images/sob.png and b/public/vendor/emojify/images/sob.png differ diff --git a/public/vendor/emojify/images/soccer.png b/public/vendor/emojify/images/soccer.png index 1e118b5b..eede705b 100755 Binary files a/public/vendor/emojify/images/soccer.png and b/public/vendor/emojify/images/soccer.png differ diff --git a/public/vendor/emojify/images/space_invader.png b/public/vendor/emojify/images/space_invader.png index 38404916..d6ac14bf 100755 Binary files a/public/vendor/emojify/images/space_invader.png and b/public/vendor/emojify/images/space_invader.png differ diff --git a/public/vendor/emojify/images/spades.png b/public/vendor/emojify/images/spades.png index 133a1aba..2350be04 100755 Binary files a/public/vendor/emojify/images/spades.png and b/public/vendor/emojify/images/spades.png differ diff --git a/public/vendor/emojify/images/spaghetti.png b/public/vendor/emojify/images/spaghetti.png index 08de243f..af117238 100755 Binary files a/public/vendor/emojify/images/spaghetti.png and b/public/vendor/emojify/images/spaghetti.png differ diff --git a/public/vendor/emojify/images/sparkle.png b/public/vendor/emojify/images/sparkle.png index 23a68ceb..0c8670b5 100755 Binary files a/public/vendor/emojify/images/sparkle.png and b/public/vendor/emojify/images/sparkle.png differ diff --git a/public/vendor/emojify/images/sparkler.png b/public/vendor/emojify/images/sparkler.png index 4aabd7e0..9bd3fcba 100755 Binary files a/public/vendor/emojify/images/sparkler.png and b/public/vendor/emojify/images/sparkler.png differ diff --git a/public/vendor/emojify/images/speedboat.png b/public/vendor/emojify/images/speedboat.png index da6689b3..3c590427 100755 Binary files a/public/vendor/emojify/images/speedboat.png and b/public/vendor/emojify/images/speedboat.png differ diff --git a/public/vendor/emojify/images/star.png b/public/vendor/emojify/images/star.png index 1bfddc86..da15e8fc 100755 Binary files a/public/vendor/emojify/images/star.png and b/public/vendor/emojify/images/star.png differ diff --git a/public/vendor/emojify/images/stars.png b/public/vendor/emojify/images/stars.png index 097a8424..6609d173 100755 Binary files a/public/vendor/emojify/images/stars.png and b/public/vendor/emojify/images/stars.png differ diff --git a/public/vendor/emojify/images/statue_of_liberty.png b/public/vendor/emojify/images/statue_of_liberty.png index 9ad90280..d5824035 100755 Binary files a/public/vendor/emojify/images/statue_of_liberty.png and b/public/vendor/emojify/images/statue_of_liberty.png differ diff --git a/public/vendor/emojify/images/stew.png b/public/vendor/emojify/images/stew.png index e9687f9e..77839441 100755 Binary files a/public/vendor/emojify/images/stew.png and b/public/vendor/emojify/images/stew.png differ diff --git a/public/vendor/emojify/images/straight_ruler.png b/public/vendor/emojify/images/straight_ruler.png index d96658ea..ba6eab04 100755 Binary files a/public/vendor/emojify/images/straight_ruler.png and b/public/vendor/emojify/images/straight_ruler.png differ diff --git a/public/vendor/emojify/images/stuck_out_tongue_closed_eyes.png b/public/vendor/emojify/images/stuck_out_tongue_closed_eyes.png index 333716ee..bf9e4128 100755 Binary files a/public/vendor/emojify/images/stuck_out_tongue_closed_eyes.png and b/public/vendor/emojify/images/stuck_out_tongue_closed_eyes.png differ diff --git a/public/vendor/emojify/images/stuck_out_tongue_winking_eye.png b/public/vendor/emojify/images/stuck_out_tongue_winking_eye.png index 6ae9d497..9e0ad9cf 100755 Binary files a/public/vendor/emojify/images/stuck_out_tongue_winking_eye.png and b/public/vendor/emojify/images/stuck_out_tongue_winking_eye.png differ diff --git a/public/vendor/emojify/images/sunglasses.png b/public/vendor/emojify/images/sunglasses.png index f2e52478..fe968330 100755 Binary files a/public/vendor/emojify/images/sunglasses.png and b/public/vendor/emojify/images/sunglasses.png differ diff --git a/public/vendor/emojify/images/sunny.png b/public/vendor/emojify/images/sunny.png index d23c095e..27f4b6ca 100755 Binary files a/public/vendor/emojify/images/sunny.png and b/public/vendor/emojify/images/sunny.png differ diff --git a/public/vendor/emojify/images/sunrise.png b/public/vendor/emojify/images/sunrise.png index ec58dcc9..43ede1df 100755 Binary files a/public/vendor/emojify/images/sunrise.png and b/public/vendor/emojify/images/sunrise.png differ diff --git a/public/vendor/emojify/images/sunrise_over_mountains.png b/public/vendor/emojify/images/sunrise_over_mountains.png index ebc3db14..c4561894 100755 Binary files a/public/vendor/emojify/images/sunrise_over_mountains.png and b/public/vendor/emojify/images/sunrise_over_mountains.png differ diff --git a/public/vendor/emojify/images/sushi.png b/public/vendor/emojify/images/sushi.png index 0d179bd9..b0c728c4 100755 Binary files a/public/vendor/emojify/images/sushi.png and b/public/vendor/emojify/images/sushi.png differ diff --git a/public/vendor/emojify/images/sweat.png b/public/vendor/emojify/images/sweat.png index e894b769..34f25520 100755 Binary files a/public/vendor/emojify/images/sweat.png and b/public/vendor/emojify/images/sweat.png differ diff --git a/public/vendor/emojify/images/sweat_smile.png b/public/vendor/emojify/images/sweat_smile.png index 3903f717..74392d1d 100755 Binary files a/public/vendor/emojify/images/sweat_smile.png and b/public/vendor/emojify/images/sweat_smile.png differ diff --git a/public/vendor/emojify/images/swimmer.png b/public/vendor/emojify/images/swimmer.png index d3878a06..906949f9 100755 Binary files a/public/vendor/emojify/images/swimmer.png and b/public/vendor/emojify/images/swimmer.png differ diff --git a/public/vendor/emojify/images/tada.png b/public/vendor/emojify/images/tada.png index 7411b526..a4e975e4 100755 Binary files a/public/vendor/emojify/images/tada.png and b/public/vendor/emojify/images/tada.png differ diff --git a/public/vendor/emojify/images/tangerine.png b/public/vendor/emojify/images/tangerine.png index fc9d4f82..eab93692 100755 Binary files a/public/vendor/emojify/images/tangerine.png and b/public/vendor/emojify/images/tangerine.png differ diff --git a/public/vendor/emojify/images/taurus.png b/public/vendor/emojify/images/taurus.png index 6af582f6..3f302ba2 100755 Binary files a/public/vendor/emojify/images/taurus.png and b/public/vendor/emojify/images/taurus.png differ diff --git a/public/vendor/emojify/images/taxi.png b/public/vendor/emojify/images/taxi.png index 60a50d36..2e1f6cc8 100755 Binary files a/public/vendor/emojify/images/taxi.png and b/public/vendor/emojify/images/taxi.png differ diff --git a/public/vendor/emojify/images/tea.png b/public/vendor/emojify/images/tea.png index 3ece0b70..f027e367 100755 Binary files a/public/vendor/emojify/images/tea.png and b/public/vendor/emojify/images/tea.png differ diff --git a/public/vendor/emojify/images/tennis.png b/public/vendor/emojify/images/tennis.png index 278d904e..00ce5002 100755 Binary files a/public/vendor/emojify/images/tennis.png and b/public/vendor/emojify/images/tennis.png differ diff --git a/public/vendor/emojify/images/tent.png b/public/vendor/emojify/images/tent.png index 5c0d20e4..08bd7eb8 100755 Binary files a/public/vendor/emojify/images/tent.png and b/public/vendor/emojify/images/tent.png differ diff --git a/public/vendor/emojify/images/thought_balloon.png b/public/vendor/emojify/images/thought_balloon.png index febe30d0..8713345d 100755 Binary files a/public/vendor/emojify/images/thought_balloon.png and b/public/vendor/emojify/images/thought_balloon.png differ diff --git a/public/vendor/emojify/images/three.png b/public/vendor/emojify/images/three.png index 55644c99..07182e9e 100755 Binary files a/public/vendor/emojify/images/three.png and b/public/vendor/emojify/images/three.png differ diff --git a/public/vendor/emojify/images/thumbsup.png b/public/vendor/emojify/images/thumbsup.png index 81786c1d..0aab213c 100755 Binary files a/public/vendor/emojify/images/thumbsup.png and b/public/vendor/emojify/images/thumbsup.png differ diff --git a/public/vendor/emojify/images/ticket.png b/public/vendor/emojify/images/ticket.png index cdacf1a7..88f0c36b 100755 Binary files a/public/vendor/emojify/images/ticket.png and b/public/vendor/emojify/images/ticket.png differ diff --git a/public/vendor/emojify/images/tired_face.png b/public/vendor/emojify/images/tired_face.png index 77b78345..f126784b 100755 Binary files a/public/vendor/emojify/images/tired_face.png and b/public/vendor/emojify/images/tired_face.png differ diff --git a/public/vendor/emojify/images/tokyo_tower.png b/public/vendor/emojify/images/tokyo_tower.png index e1cbd7a3..ba7e9476 100755 Binary files a/public/vendor/emojify/images/tokyo_tower.png and b/public/vendor/emojify/images/tokyo_tower.png differ diff --git a/public/vendor/emojify/images/tomato.png b/public/vendor/emojify/images/tomato.png index a129700b..9fa7a0f9 100755 Binary files a/public/vendor/emojify/images/tomato.png and b/public/vendor/emojify/images/tomato.png differ diff --git a/public/vendor/emojify/images/tongue.png b/public/vendor/emojify/images/tongue.png index b0bab120..3861caec 100755 Binary files a/public/vendor/emojify/images/tongue.png and b/public/vendor/emojify/images/tongue.png differ diff --git a/public/vendor/emojify/images/tractor.png b/public/vendor/emojify/images/tractor.png index 058fd3ed..73ecb9de 100755 Binary files a/public/vendor/emojify/images/tractor.png and b/public/vendor/emojify/images/tractor.png differ diff --git a/public/vendor/emojify/images/traffic_light.png b/public/vendor/emojify/images/traffic_light.png index 1facb276..b8093a45 100755 Binary files a/public/vendor/emojify/images/traffic_light.png and b/public/vendor/emojify/images/traffic_light.png differ diff --git a/public/vendor/emojify/images/train.png b/public/vendor/emojify/images/train.png index 3202d80e..4e766ef9 100755 Binary files a/public/vendor/emojify/images/train.png and b/public/vendor/emojify/images/train.png differ diff --git a/public/vendor/emojify/images/trident.png b/public/vendor/emojify/images/trident.png index d79a7b4c..d2a949fc 100755 Binary files a/public/vendor/emojify/images/trident.png and b/public/vendor/emojify/images/trident.png differ diff --git a/public/vendor/emojify/images/triumph.png b/public/vendor/emojify/images/triumph.png index 92f93bd1..a4df48f4 100755 Binary files a/public/vendor/emojify/images/triumph.png and b/public/vendor/emojify/images/triumph.png differ diff --git a/public/vendor/emojify/images/trolleybus.png b/public/vendor/emojify/images/trolleybus.png index b9740a53..d7ba3910 100755 Binary files a/public/vendor/emojify/images/trolleybus.png and b/public/vendor/emojify/images/trolleybus.png differ diff --git a/public/vendor/emojify/images/trollface.png b/public/vendor/emojify/images/trollface.png index 119d77e7..9d6dea5a 100755 Binary files a/public/vendor/emojify/images/trollface.png and b/public/vendor/emojify/images/trollface.png differ diff --git a/public/vendor/emojify/images/tropical_fish.png b/public/vendor/emojify/images/tropical_fish.png index a6d73498..f3e321b9 100755 Binary files a/public/vendor/emojify/images/tropical_fish.png and b/public/vendor/emojify/images/tropical_fish.png differ diff --git a/public/vendor/emojify/images/truck.png b/public/vendor/emojify/images/truck.png index 3f25ba1f..b66033d2 100755 Binary files a/public/vendor/emojify/images/truck.png and b/public/vendor/emojify/images/truck.png differ diff --git a/public/vendor/emojify/images/tshirt.png b/public/vendor/emojify/images/tshirt.png index 297a6d63..15c2e111 100755 Binary files a/public/vendor/emojify/images/tshirt.png and b/public/vendor/emojify/images/tshirt.png differ diff --git a/public/vendor/emojify/images/turtle.png b/public/vendor/emojify/images/turtle.png index 04d1d968..02cb3f2f 100755 Binary files a/public/vendor/emojify/images/turtle.png and b/public/vendor/emojify/images/turtle.png differ diff --git a/public/vendor/emojify/images/two.png b/public/vendor/emojify/images/two.png index c191f8a3..fc664fa9 100755 Binary files a/public/vendor/emojify/images/two.png and b/public/vendor/emojify/images/two.png differ diff --git a/public/vendor/emojify/images/two_hearts.png b/public/vendor/emojify/images/two_hearts.png index b189e9ae..e1de6588 100755 Binary files a/public/vendor/emojify/images/two_hearts.png and b/public/vendor/emojify/images/two_hearts.png differ diff --git a/public/vendor/emojify/images/u5272.png b/public/vendor/emojify/images/u5272.png index 2148253f..b09907a1 100755 Binary files a/public/vendor/emojify/images/u5272.png and b/public/vendor/emojify/images/u5272.png differ diff --git a/public/vendor/emojify/images/u55b6.png b/public/vendor/emojify/images/u55b6.png index ba946d3f..56d196ce 100755 Binary files a/public/vendor/emojify/images/u55b6.png and b/public/vendor/emojify/images/u55b6.png differ diff --git a/public/vendor/emojify/images/u6307.png b/public/vendor/emojify/images/u6307.png index 6557f567..d7adbc2c 100755 Binary files a/public/vendor/emojify/images/u6307.png and b/public/vendor/emojify/images/u6307.png differ diff --git a/public/vendor/emojify/images/u6708.png b/public/vendor/emojify/images/u6708.png index e4dfe5aa..402a37fb 100755 Binary files a/public/vendor/emojify/images/u6708.png and b/public/vendor/emojify/images/u6708.png differ diff --git a/public/vendor/emojify/images/u6709.png b/public/vendor/emojify/images/u6709.png index cd8fb3f6..295489bd 100755 Binary files a/public/vendor/emojify/images/u6709.png and b/public/vendor/emojify/images/u6709.png differ diff --git a/public/vendor/emojify/images/u6e80.png b/public/vendor/emojify/images/u6e80.png index 5df1cb87..5ac535e5 100755 Binary files a/public/vendor/emojify/images/u6e80.png and b/public/vendor/emojify/images/u6e80.png differ diff --git a/public/vendor/emojify/images/u7121.png b/public/vendor/emojify/images/u7121.png index 25f694ed..999424eb 100755 Binary files a/public/vendor/emojify/images/u7121.png and b/public/vendor/emojify/images/u7121.png differ diff --git a/public/vendor/emojify/images/u7533.png b/public/vendor/emojify/images/u7533.png index fc4a9901..3c15f859 100755 Binary files a/public/vendor/emojify/images/u7533.png and b/public/vendor/emojify/images/u7533.png differ diff --git a/public/vendor/emojify/images/u7a7a.png b/public/vendor/emojify/images/u7a7a.png index c05f5cff..ef0d30a9 100755 Binary files a/public/vendor/emojify/images/u7a7a.png and b/public/vendor/emojify/images/u7a7a.png differ diff --git a/public/vendor/emojify/images/uk.png b/public/vendor/emojify/images/uk.png index 2a62c7a0..5439ccf1 100755 Binary files a/public/vendor/emojify/images/uk.png and b/public/vendor/emojify/images/uk.png differ diff --git a/public/vendor/emojify/images/unamused.png b/public/vendor/emojify/images/unamused.png index 3722e6f5..fbcaa8e2 100755 Binary files a/public/vendor/emojify/images/unamused.png and b/public/vendor/emojify/images/unamused.png differ diff --git a/public/vendor/emojify/images/up.png b/public/vendor/emojify/images/up.png index 829219a8..cdd4107d 100755 Binary files a/public/vendor/emojify/images/up.png and b/public/vendor/emojify/images/up.png differ diff --git a/public/vendor/emojify/images/us.png b/public/vendor/emojify/images/us.png index 38137669..f7fab12c 100755 Binary files a/public/vendor/emojify/images/us.png and b/public/vendor/emojify/images/us.png differ diff --git a/public/vendor/emojify/images/vertical_traffic_light.png b/public/vendor/emojify/images/vertical_traffic_light.png index 7a5ba35f..ef476138 100755 Binary files a/public/vendor/emojify/images/vertical_traffic_light.png and b/public/vendor/emojify/images/vertical_traffic_light.png differ diff --git a/public/vendor/emojify/images/vhs.png b/public/vendor/emojify/images/vhs.png index 881081c1..9296f7a4 100755 Binary files a/public/vendor/emojify/images/vhs.png and b/public/vendor/emojify/images/vhs.png differ diff --git a/public/vendor/emojify/images/vibration_mode.png b/public/vendor/emojify/images/vibration_mode.png index a716e96c..793027f3 100755 Binary files a/public/vendor/emojify/images/vibration_mode.png and b/public/vendor/emojify/images/vibration_mode.png differ diff --git a/public/vendor/emojify/images/video_camera.png b/public/vendor/emojify/images/video_camera.png index 274cecdd..79f6dcdd 100755 Binary files a/public/vendor/emojify/images/video_camera.png and b/public/vendor/emojify/images/video_camera.png differ diff --git a/public/vendor/emojify/images/virgo.png b/public/vendor/emojify/images/virgo.png index 72e1763f..70fbed35 100755 Binary files a/public/vendor/emojify/images/virgo.png and b/public/vendor/emojify/images/virgo.png differ diff --git a/public/vendor/emojify/images/volcano.png b/public/vendor/emojify/images/volcano.png index 9b434539..773761e2 100755 Binary files a/public/vendor/emojify/images/volcano.png and b/public/vendor/emojify/images/volcano.png differ diff --git a/public/vendor/emojify/images/vs.png b/public/vendor/emojify/images/vs.png index 86363885..7316b4a8 100755 Binary files a/public/vendor/emojify/images/vs.png and b/public/vendor/emojify/images/vs.png differ diff --git a/public/vendor/emojify/images/warning.png b/public/vendor/emojify/images/warning.png index db6f96f0..82130b72 100755 Binary files a/public/vendor/emojify/images/warning.png and b/public/vendor/emojify/images/warning.png differ diff --git a/public/vendor/emojify/images/wc.png b/public/vendor/emojify/images/wc.png index dfe84d2a..00756ebd 100755 Binary files a/public/vendor/emojify/images/wc.png and b/public/vendor/emojify/images/wc.png differ diff --git a/public/vendor/emojify/images/wedding.png b/public/vendor/emojify/images/wedding.png index ead19d52..18f1d20b 100755 Binary files a/public/vendor/emojify/images/wedding.png and b/public/vendor/emojify/images/wedding.png differ diff --git a/public/vendor/emojify/images/whale.png b/public/vendor/emojify/images/whale.png index 5bb113e4..1399a5b3 100755 Binary files a/public/vendor/emojify/images/whale.png and b/public/vendor/emojify/images/whale.png differ diff --git a/public/vendor/emojify/images/wheelchair.png b/public/vendor/emojify/images/wheelchair.png index eddcdd79..c8efe4b6 100755 Binary files a/public/vendor/emojify/images/wheelchair.png and b/public/vendor/emojify/images/wheelchair.png differ diff --git a/public/vendor/emojify/images/white_check_mark.png b/public/vendor/emojify/images/white_check_mark.png index 61dc0583..5ed1cec7 100755 Binary files a/public/vendor/emojify/images/white_check_mark.png and b/public/vendor/emojify/images/white_check_mark.png differ diff --git a/public/vendor/emojify/images/white_circle.png b/public/vendor/emojify/images/white_circle.png index 3f648d1b..d70af5e1 100755 Binary files a/public/vendor/emojify/images/white_circle.png and b/public/vendor/emojify/images/white_circle.png differ diff --git a/public/vendor/emojify/images/white_large_square.png b/public/vendor/emojify/images/white_large_square.png index 60cb19a1..5d10d8bd 100755 Binary files a/public/vendor/emojify/images/white_large_square.png and b/public/vendor/emojify/images/white_large_square.png differ diff --git a/public/vendor/emojify/images/white_medium_small_square.png b/public/vendor/emojify/images/white_medium_small_square.png index a115cdc4..03f2759a 100755 Binary files a/public/vendor/emojify/images/white_medium_small_square.png and b/public/vendor/emojify/images/white_medium_small_square.png differ diff --git a/public/vendor/emojify/images/white_medium_square.png b/public/vendor/emojify/images/white_medium_square.png index 199808bc..03542ac3 100755 Binary files a/public/vendor/emojify/images/white_medium_square.png and b/public/vendor/emojify/images/white_medium_square.png differ diff --git a/public/vendor/emojify/images/white_small_square.png b/public/vendor/emojify/images/white_small_square.png index 24ba879f..547eff15 100755 Binary files a/public/vendor/emojify/images/white_small_square.png and b/public/vendor/emojify/images/white_small_square.png differ diff --git a/public/vendor/emojify/images/white_square.png b/public/vendor/emojify/images/white_square.png index 60cb19a1..5d10d8bd 100755 Binary files a/public/vendor/emojify/images/white_square.png and b/public/vendor/emojify/images/white_square.png differ diff --git a/public/vendor/emojify/images/white_square_button.png b/public/vendor/emojify/images/white_square_button.png index ad54d55c..9e4126d9 100755 Binary files a/public/vendor/emojify/images/white_square_button.png and b/public/vendor/emojify/images/white_square_button.png differ diff --git a/public/vendor/emojify/images/wink.png b/public/vendor/emojify/images/wink.png index 756766dd..d7b118d5 100755 Binary files a/public/vendor/emojify/images/wink.png and b/public/vendor/emojify/images/wink.png differ diff --git a/public/vendor/emojify/images/wink2.png b/public/vendor/emojify/images/wink2.png index 6ae9d497..9e0ad9cf 100755 Binary files a/public/vendor/emojify/images/wink2.png and b/public/vendor/emojify/images/wink2.png differ diff --git a/public/vendor/emojify/images/womens.png b/public/vendor/emojify/images/womens.png index 2fab2966..91cabdb5 100755 Binary files a/public/vendor/emojify/images/womens.png and b/public/vendor/emojify/images/womens.png differ diff --git a/public/vendor/emojify/images/worried.png b/public/vendor/emojify/images/worried.png index bfa1856c..56f7b910 100755 Binary files a/public/vendor/emojify/images/worried.png and b/public/vendor/emojify/images/worried.png differ diff --git a/public/vendor/emojify/images/yellow_heart.png b/public/vendor/emojify/images/yellow_heart.png index fa41ce78..fbbbe258 100755 Binary files a/public/vendor/emojify/images/yellow_heart.png and b/public/vendor/emojify/images/yellow_heart.png differ diff --git a/public/vendor/emojify/images/yen.png b/public/vendor/emojify/images/yen.png index 139bc936..07b90ace 100755 Binary files a/public/vendor/emojify/images/yen.png and b/public/vendor/emojify/images/yen.png differ diff --git a/public/vendor/emojify/images/yum.png b/public/vendor/emojify/images/yum.png index fc39637e..2bc79b95 100755 Binary files a/public/vendor/emojify/images/yum.png and b/public/vendor/emojify/images/yum.png differ diff --git a/public/vendor/emojify/images/zero.png b/public/vendor/emojify/images/zero.png index 6e57b334..ad613e92 100755 Binary files a/public/vendor/emojify/images/zero.png and b/public/vendor/emojify/images/zero.png differ diff --git a/public/vendor/emojify/images/zzz.png b/public/vendor/emojify/images/zzz.png index 30be0465..598505bd 100755 Binary files a/public/vendor/emojify/images/zzz.png and b/public/vendor/emojify/images/zzz.png differ diff --git a/public/vendor/jquery-ui/images/ui-bg_flat_0_aaaaaa_40x100.png b/public/vendor/jquery-ui/images/ui-bg_flat_0_aaaaaa_40x100.png index eaf324ec..a2e6bfc0 100755 Binary files a/public/vendor/jquery-ui/images/ui-bg_flat_0_aaaaaa_40x100.png and b/public/vendor/jquery-ui/images/ui-bg_flat_0_aaaaaa_40x100.png differ diff --git a/public/vendor/jquery-ui/images/ui-bg_flat_75_ffffff_40x100.png b/public/vendor/jquery-ui/images/ui-bg_flat_75_ffffff_40x100.png index 878195ce..e36540bb 100755 Binary files a/public/vendor/jquery-ui/images/ui-bg_flat_75_ffffff_40x100.png and b/public/vendor/jquery-ui/images/ui-bg_flat_75_ffffff_40x100.png differ diff --git a/public/vendor/jquery-ui/images/ui-bg_glass_55_fbf9ee_1x400.png b/public/vendor/jquery-ui/images/ui-bg_glass_55_fbf9ee_1x400.png index 40fc2044..913a170b 100755 Binary files a/public/vendor/jquery-ui/images/ui-bg_glass_55_fbf9ee_1x400.png and b/public/vendor/jquery-ui/images/ui-bg_glass_55_fbf9ee_1x400.png differ diff --git a/public/vendor/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png b/public/vendor/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png index deccc56f..3e56dbdc 100755 Binary files a/public/vendor/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png and b/public/vendor/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png differ diff --git a/public/vendor/jquery-ui/images/ui-bg_glass_75_dadada_1x400.png b/public/vendor/jquery-ui/images/ui-bg_glass_75_dadada_1x400.png index 9a8c1bc7..6b8b33a1 100755 Binary files a/public/vendor/jquery-ui/images/ui-bg_glass_75_dadada_1x400.png and b/public/vendor/jquery-ui/images/ui-bg_glass_75_dadada_1x400.png differ diff --git a/public/vendor/jquery-ui/images/ui-bg_glass_75_e6e6e6_1x400.png b/public/vendor/jquery-ui/images/ui-bg_glass_75_e6e6e6_1x400.png index eb8db001..8cc46b39 100755 Binary files a/public/vendor/jquery-ui/images/ui-bg_glass_75_e6e6e6_1x400.png and b/public/vendor/jquery-ui/images/ui-bg_glass_75_e6e6e6_1x400.png differ diff --git a/public/vendor/jquery-ui/images/ui-bg_glass_95_fef1ec_1x400.png b/public/vendor/jquery-ui/images/ui-bg_glass_95_fef1ec_1x400.png index ca41c69e..7fb8918f 100755 Binary files a/public/vendor/jquery-ui/images/ui-bg_glass_95_fef1ec_1x400.png and b/public/vendor/jquery-ui/images/ui-bg_glass_95_fef1ec_1x400.png differ diff --git a/public/vendor/jquery-ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/public/vendor/jquery-ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png index 375e180a..ae3ccae0 100755 Binary files a/public/vendor/jquery-ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png and b/public/vendor/jquery-ui/images/ui-bg_highlight-soft_75_cccccc_1x100.png differ diff --git a/public/vendor/jquery-ui/images/ui-icons_222222_256x240.png b/public/vendor/jquery-ui/images/ui-icons_222222_256x240.png index e9c8e16a..04451462 100755 Binary files a/public/vendor/jquery-ui/images/ui-icons_222222_256x240.png and b/public/vendor/jquery-ui/images/ui-icons_222222_256x240.png differ diff --git a/public/vendor/jquery-ui/images/ui-icons_2e83ff_256x240.png b/public/vendor/jquery-ui/images/ui-icons_2e83ff_256x240.png index f2bf8388..08957e91 100755 Binary files a/public/vendor/jquery-ui/images/ui-icons_2e83ff_256x240.png and b/public/vendor/jquery-ui/images/ui-icons_2e83ff_256x240.png differ diff --git a/public/vendor/jquery-ui/images/ui-icons_454545_256x240.png b/public/vendor/jquery-ui/images/ui-icons_454545_256x240.png index d6169e8b..0ff52c24 100755 Binary files a/public/vendor/jquery-ui/images/ui-icons_454545_256x240.png and b/public/vendor/jquery-ui/images/ui-icons_454545_256x240.png differ diff --git a/public/vendor/jquery-ui/images/ui-icons_888888_256x240.png b/public/vendor/jquery-ui/images/ui-icons_888888_256x240.png index d3e6e02a..6acc778b 100755 Binary files a/public/vendor/jquery-ui/images/ui-icons_888888_256x240.png and b/public/vendor/jquery-ui/images/ui-icons_888888_256x240.png differ diff --git a/public/vendor/jquery-ui/images/ui-icons_cd0a0a_256x240.png b/public/vendor/jquery-ui/images/ui-icons_cd0a0a_256x240.png index 49370189..ee9dfec9 100755 Binary files a/public/vendor/jquery-ui/images/ui-icons_cd0a0a_256x240.png and b/public/vendor/jquery-ui/images/ui-icons_cd0a0a_256x240.png differ diff --git a/public/vendor/ot/ot.min.js b/public/vendor/ot/ot.min.js index 92ef1419..a784b35f 100644 --- a/public/vendor/ot/ot.min.js +++ b/public/vendor/ot/ot.min.js @@ -1 +1 @@ -function hex2rgb(t){if("#"==t[0]&&(t=t.substr(1)),3==t.length){var e=t;t="",e=/^([a-f0-9])([a-f0-9])([a-f0-9])$/i.exec(e).slice(1);for(var n=0;3>n;n++)t+=e[n]+e[n]}var o=/^([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i.exec(t).slice(1);return{red:parseInt(o[0],16),green:parseInt(o[1],16),blue:parseInt(o[2],16)}}if("undefined"==typeof ot)var ot={};if(ot.TextOperation=function(){"use strict";function t(){return this&&this.constructor===t?(this.ops=[],this.baseLength=0,void(this.targetLength=0)):new t}function e(e){var n=e.ops,o=t.isRetain;switch(n.length){case 1:return n[0];case 2:return o(n[0])?n[1]:o(n[1])?n[0]:null;case 3:if(o(n[0])&&o(n[2]))return n[1]}return null}function n(t){return o(t.ops[0])?t.ops[0]:0}t.prototype.equals=function(t){if(this.baseLength!==t.baseLength)return!1;if(this.targetLength!==t.targetLength)return!1;if(this.ops.length!==t.ops.length)return!1;for(var e=0;e0},r=t.isInsert=function(t){return"string"==typeof t},i=t.isDelete=function(t){return"number"==typeof t&&0>t};return t.prototype.retain=function(t){if("number"!=typeof t)throw new Error("retain expects an integer");return 0===t?this:(this.baseLength+=t,this.targetLength+=t,o(this.ops[this.ops.length-1])?this.ops[this.ops.length-1]+=t:this.ops.push(t),this)},t.prototype.insert=function(t){if("string"!=typeof t)throw new Error("insert expects a string");if(""===t)return this;this.targetLength+=t.length;var e=this.ops;return r(e[e.length-1])?e[e.length-1]+=t:i(e[e.length-1])?r(e[e.length-2])?e[e.length-2]+=t:(e[e.length]=e[e.length-1],e[e.length-2]=t):e.push(t),this},t.prototype["delete"]=function(t){if("string"==typeof t&&(t=t.length),"number"!=typeof t)throw new Error("delete expects an integer or a string");return 0===t?this:(t>0&&(t=-t),this.baseLength-=t,i(this.ops[this.ops.length-1])?this.ops[this.ops.length-1]+=t:this.ops.push(t),this)},t.prototype.isNoop=function(){return 0===this.ops.length||1===this.ops.length&&o(this.ops[0])},t.prototype.toString=function(){var t=Array.prototype.map||function(t){for(var e=this,n=[],o=0,r=e.length;r>o;o++)n[o]=t(e[o]);return n};return t.call(this.ops,function(t){return o(t)?"retain "+t:r(t)?"insert '"+t+"'":"delete "+-t}).join(", ")},t.prototype.toJSON=function(){return this.ops},t.fromJSON=function(e){for(var n=new t,s=0,a=e.length;a>s;s++){var h=e[s];if(o(h))n.retain(h);else if(r(h))n.insert(h);else{if(!i(h))throw new Error("unknown operation: "+JSON.stringify(h));n["delete"](h)}}return n},t.prototype.apply=function(t){var e=this;if(t.length!==e.baseLength)throw new Error("The operation's base length must be equal to the string's length.");for(var n=[],i=0,s=0,a=this.ops,h=0,p=a.length;p>h;h++){var c=a[h];if(o(c)){if(s+c>t.length)throw new Error("Operation can't retain more characters than are left in the string.");n[i++]=t.slice(s,s+c),s+=c}else r(c)?n[i++]=c:s-=c}if(s!==t.length)throw new Error("The operation didn't operate on the whole string.");return n.join("")},t.prototype.invert=function(e){for(var n=0,i=new t,s=this.ops,a=0,h=s.length;h>a;a++){var p=s[a];o(p)?(i.retain(p),n+=p):r(p)?i["delete"](p.length):(i.insert(e.slice(n,n-p)),n-=p)}return i},t.prototype.compose=function(e){var n=this;if(n.targetLength!==e.baseLength)throw new Error("The base length of the second operation has to be the target length of the first operation");for(var s=new t,a=n.ops,h=e.ops,p=0,c=0,l=a[p++],u=h[c++];;){if("undefined"==typeof l&&"undefined"==typeof u)break;if(i(l))s["delete"](l),l=a[p++];else if(r(u))s.insert(u),u=h[c++];else{if("undefined"==typeof l)throw new Error("Cannot compose operations: first operation is too short.");if("undefined"==typeof u)throw new Error("Cannot compose operations: first operation is too long.");if(o(l)&&o(u))l>u?(s.retain(u),l-=u,u=h[c++]):l===u?(s.retain(l),l=a[p++],u=h[c++]):(s.retain(l),u-=l,l=a[p++]);else if(r(l)&&i(u))l.length>-u?(l=l.slice(-u),u=h[c++]):l.length===-u?(l=a[p++],u=h[c++]):(u+=l.length,l=a[p++]);else if(r(l)&&o(u))l.length>u?(s.insert(l.slice(0,u)),l=l.slice(u),u=h[c++]):l.length===u?(s.insert(l),l=a[p++],u=h[c++]):(s.insert(l),u-=l.length,l=a[p++]);else{if(!o(l)||!i(u))throw new Error("This shouldn't happen: op1: "+JSON.stringify(l)+", op2: "+JSON.stringify(u));l>-u?(s["delete"](u),l+=u,u=h[c++]):l===-u?(s["delete"](u),l=a[p++],u=h[c++]):(s["delete"](l),u+=l,l=a[p++])}}}return s},t.prototype.shouldBeComposedWith=function(t){if(this.isNoop()||t.isNoop())return!0;var o=n(this),s=n(t),a=e(this),h=e(t);return a&&h?r(a)&&r(h)?o+a.length===s:i(a)&&i(h)?s-h===o||o===s:!1:!1},t.prototype.shouldBeComposedWithInverted=function(t){if(this.isNoop()||t.isNoop())return!0;var o=n(this),s=n(t),a=e(this),h=e(t);return a&&h?r(a)&&r(h)?o+a.length===s||o===s:i(a)&&i(h)?s-h===o:!1:!1},t.transform=function(e,n){if(e.baseLength!==n.baseLength)throw new Error("Both operations have to have the same base length");for(var s=new t,a=new t,h=e.ops,p=n.ops,c=0,l=0,u=h[c++],f=p[l++];;){if("undefined"==typeof u&&"undefined"==typeof f)break;if(r(u))s.insert(u),a.retain(u.length),u=h[c++];else if(r(f))s.retain(f.length),a.insert(f),f=p[l++];else{if("undefined"==typeof u)throw new Error("Cannot compose operations: first operation is too short.");if("undefined"==typeof f)throw new Error("Cannot compose operations: first operation is too long.");var d;if(o(u)&&o(f))u>f?(d=f,u-=f,f=p[l++]):u===f?(d=f,u=h[c++],f=p[l++]):(d=u,f-=u,u=h[c++]),s.retain(d),a.retain(d);else if(i(u)&&i(f))-u>-f?(u-=f,f=p[l++]):u===f?(u=h[c++],f=p[l++]):(f-=u,u=h[c++]);else if(i(u)&&o(f))-u>f?(d=f,u+=f,f=p[l++]):-u===f?(d=f,u=h[c++],f=p[l++]):(d=-u,f+=u,u=h[c++]),s["delete"](d);else{if(!o(u)||!i(f))throw new Error("The two operations aren't compatible");u>-f?(d=-f,u+=f,f=p[l++]):u===-f?(d=u,u=h[c++],f=p[l++]):(d=u,f+=u,u=h[c++]),a["delete"](d)}}}return[s,a]},t}(),"object"==typeof module&&(module.exports=ot.TextOperation),"undefined"==typeof ot)var ot={};if(ot.Selection=function(t){"use strict";function e(t,e){this.anchor=t,this.head=e}function n(t){this.ranges=t||[]}var o=t.ot?t.ot.TextOperation:require("./text-operation");return e.fromJSON=function(t){return new e(t.anchor,t.head)},e.prototype.equals=function(t){return this.anchor===t.anchor&&this.head===t.head},e.prototype.isEmpty=function(){return this.anchor===this.head},e.prototype.transform=function(t){function n(e){for(var n=e,r=t.ops,i=0,s=t.ops.length;s>i&&(o.isRetain(r[i])?e-=r[i]:o.isInsert(r[i])?n+=r[i].length:(n-=Math.min(e,-r[i]),e+=r[i]),!(0>e));i++);return n}var r=n(this.anchor);return this.anchor===this.head?new e(r,r):new e(r,n(this.head))},n.Range=e,n.createCursor=function(t){return new n([new e(t,t)])},n.fromJSON=function(t){for(var o=t.ranges||t,r=0,i=[];r=0;r--){var i=o.transform(t[r],e);"function"==typeof i[0].isNoop&&i[0].isNoop()||n.push(i[0]),e=i[1]}return n.reverse()}var n="normal",o="undoing",r="redoing";return t.prototype.add=function(t,e){if(this.state===o)this.redoStack.push(t),this.dontCompose=!0;else if(this.state===r)this.undoStack.push(t),this.dontCompose=!0;else{var n=this.undoStack;!this.dontCompose&&e&&n.length>0?n.push(t.compose(n.pop())):(n.push(t),n.length>this.maxItems&&n.shift()),this.dontCompose=!1,this.redoStack=[]}},t.prototype.transform=function(t){this.undoStack=e(this.undoStack,t),this.redoStack=e(this.redoStack,t)},t.prototype.performUndo=function(t){if(this.state=o,0===this.undoStack.length)throw new Error("undo not possible");t(this.undoStack.pop()),this.state=n},t.prototype.performRedo=function(t){if(this.state=r,0===this.redoStack.length)throw new Error("redo not possible");t(this.redoStack.pop()),this.state=n},t.prototype.canUndo=function(){return 0!==this.undoStack.length},t.prototype.canRedo=function(){return 0!==this.redoStack.length},t.prototype.isUndoing=function(){return this.state===o},t.prototype.isRedoing=function(){return this.state===r},t}(),"object"==typeof module&&(module.exports=ot.UndoManager),"undefined"==typeof ot)var ot={};ot.Client=function(){"use strict";function t(t){this.revision=t,this.setState(s)}function e(){}function n(t){this.outstanding=t}function o(t,e){this.outstanding=t,this.buffer=e}function r(t,e,n){this.acknowlaged=t,this.client=e,this.revision=n}function i(t,e,n,o){this.acknowlaged=t,this.buffer=e,this.client=n,this.revision=o}t.prototype.setState=function(t){this.state=t},t.prototype.applyClient=function(t){this.setState(this.state.applyClient(this,t))},t.prototype.applyServer=function(t,e){this.setState(this.state.applyServer(this,t,e))},t.prototype.applyOperations=function(t,e){this.setState(this.state.applyOperations(this,t,e))},t.prototype.serverAck=function(t){this.setState(this.state.serverAck(this,t))},t.prototype.serverReconnect=function(){"function"==typeof this.state.resend&&this.state.resend(this)},t.prototype.transformSelection=function(t){return this.state.transformSelection(t)},t.prototype.sendOperation=function(){throw new Error("sendOperation must be defined in child class")},t.prototype.applyOperation=function(){throw new Error("applyOperation must be defined in child class")},t.Synchronized=e,e.prototype.applyClient=function(t,e){return t.sendOperation(t.revision,e),new n(e)},e.prototype.applyServer=function(t,e,n){if(e-t.revision>1)throw new Error("Invalid revision.");return t.revision=e,t.applyOperation(n),this},e.prototype.serverAck=function(){throw new Error("There is no pending operation.")},e.prototype.transformSelection=function(t){return t};var s=new e;return t.AwaitingConfirm=n,n.prototype.applyClient=function(t,e){return new o(this.outstanding,e)},n.prototype.applyServer=function(t,e,o){if(e-t.revision>1)throw new Error("Invalid revision.");t.revision=e;var r=o.constructor.transform(this.outstanding,o);return t.applyOperation(r[1]),new n(r[0])},n.prototype.serverAck=function(t,e){return e-t.revision>1?new r(this.outstanding,t,e).getOperations():(t.revision=e,s)},n.prototype.transformSelection=function(t){return t.transform(this.outstanding)},n.prototype.resend=function(t){t.sendOperation(t.revision,this.outstanding)},t.AwaitingWithBuffer=o,o.prototype.applyClient=function(t,e){var n=this.buffer.compose(e);return new o(this.outstanding,n)},o.prototype.applyServer=function(t,e,n){if(e-t.revision>1)throw new Error("Invalid revision.");t.revision=e;var r=n.constructor.transform,i=r(this.outstanding,n),s=r(this.buffer,i[1]);return t.applyOperation(s[1]),new o(i[0],s[0])},o.prototype.serverAck=function(t,e){return e-t.revision>1?new i(this.outstanding,this.buffer,t,e).getOperations():(t.revision=e,t.sendOperation(t.revision,this.buffer),new n(this.buffer))},o.prototype.transformSelection=function(t){return t.transform(this.outstanding).transform(this.buffer)},o.prototype.resend=function(t){t.sendOperation(t.revision,this.outstanding)},t.Stale=r,r.prototype.applyClient=function(t,e){return new i(this.acknowlaged,e,t,this.revision)},r.prototype.applyServer=function(){throw new Error("Ignored server-side change.")},r.prototype.applyOperations=function(t,e,n){for(var o=this.acknowlaged.constructor.transform,r=0;re.line?1:t.che.ch?1:0}function n(t,n){return e(t,n)<=0}function o(t,e){return n(t,e)?t:e}function r(t,e){return n(t,e)?e:t}function i(t){return t.indexFromPos({line:t.lastLine(),ch:0})+t.getLine(t.lastLine()).length}function s(t,e){var n=t[e];t[e]=function(){n.apply(t,arguments)}}var a=ot.TextOperation,h=ot.Selection;t.prototype.detach=function(){this.cm.off("changes",this.onChanges),this.cm.off("change",this.onChange),this.cm.off("cursorActivity",this.onCursorActivity),this.cm.off("focus",this.onFocus),this.cm.off("blur",this.onBlur)},t.operationFromCodeMirrorChanges=function(t,e){function o(t){return t[t.length-1]}function r(t){if(0===t.length)return 0;for(var e=0,n=0;n=0;u--){var f=t[u];l=s(l,f);var d=l(f.from),g=h-d-r(f.text);p=(new a).retain(d)["delete"](r(f.removed)).insert(f.text.join("\n")).retain(g).compose(p),c=c.compose((new a).retain(d)["delete"](r(f.text)).insert(f.removed.join("\n")).retain(g)),h+=r(f.removed)-r(f.text)}return[p,c]},t.operationFromCodeMirrorChange=t.operationFromCodeMirrorChanges,t.applyOperationToCodeMirror=function(t,e){e.operation(function(){for(var n=t.ops,o=0,r=0,i=n.length;i>r;r++){var s=n[r];if(a.isRetain(s))o+=s;else if(a.isInsert(s))e.replaceRange(s,e.posFromIndex(o),null,"ignoreHistory"),o+=s.length;else if(a.isDelete(s)){var h=e.posFromIndex(o),p=e.posFromIndex(o-s);e.replaceRange("",h,p,"ignoreHistory")}}})},t.prototype.registerCallbacks=function(t){this.callbacks=t},t.prototype.onChange=function(){this.changeInProgress=!0},t.prototype.onChanges=function(e,n){if(!this.ignoreNextChange){var o=t.operationFromCodeMirrorChanges(n,this.cm);this.trigger("change",o[0],o[1])}this.selectionChanged&&this.trigger("selectionChange"),this.changeInProgress=!1,this.ignoreNextChange=!1},t.prototype.onCursorActivity=t.prototype.onFocus=function(){this.changeInProgress?this.selectionChanged=!0:this.trigger("selectionChange")},t.prototype.onBlur=function(){this.cm.somethingSelected()||this.trigger("blur")},t.prototype.getValue=function(){return this.cm.getValue()},t.prototype.getSelection=function(){for(var t=this.cm,e=t.listSelections(),n=[],o=0;o0&&(this.majorRevision+=n.length,this.minorRevision=0);var o=t.events;if(o){for(e=0;en?n*(1+e):n+e-e*n,i=2*n-o,s=function(t){return 0>t&&(t+=1),t>1&&(t-=1),1>6*t?i+6*(o-i)*t:1>2*t?o:2>3*t?i+6*(o-i)*(2/3-t):i};return r(s(t+1/3),s(t),s(t-1/3))}function s(t){for(var e=1,n=0;n0&&n.shouldBeComposedWithInverted(h(this.undoManager.undoStack).wrapped)),s=new t(this.selection,o);this.undoManager.add(new d(n,s),i),this.applyClient(e)},o.prototype.updateSelection=function(){this.selection=this.editorAdapter.getSelection()},o.prototype.onSelectionChange=function(){var t=this.selection;this.updateSelection(),t&&this.selection.equals(t)||this.sendSelection(this.selection)},o.prototype.onBlur=function(){this.selection=null,this.sendSelection(null)},o.prototype.sendSelection=function(t){this.state instanceof c.AwaitingWithBuffer||this.serverAdapter.sendSelection(t)},o.prototype.sendOperation=function(t,e){this.serverAdapter.sendOperation(t,e.toJSON(),this.selection)},o.prototype.getOperations=function(t,e){this.serverAdapter.getOperations(t,e)},o.prototype.applyOperation=function(t){this.editorAdapter.applyOperation(t),this.updateSelection(),this.undoManager.transform(new d(t,null))},o}(); \ No newline at end of file +function hex2rgb(t){if("#"==t[0]&&(t=t.substr(1)),3==t.length){var e=t;t="",e=/^([a-f0-9])([a-f0-9])([a-f0-9])$/i.exec(e).slice(1);for(var n=0;n<3;n++)t+=e[n]+e[n]}var o=/^([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})$/i.exec(t).slice(1);return{red:parseInt(o[0],16),green:parseInt(o[1],16),blue:parseInt(o[2],16)}}if("undefined"==typeof ot)var ot={};if(ot.TextOperation=function(){"use strict";function t(){return this&&this.constructor===t?(this.ops=[],this.baseLength=0,void(this.targetLength=0)):new t}function e(e,n){var o=e.ops,r=t.isRetain;switch(o.length){case 1:return o[0];case 2:return r(o[0])?o[1]:r(o[1])?o[0]:null;case 3:if(r(o[0])&&r(o[2]))return o[1]}return null}function n(t){return o(t.ops[0])?t.ops[0]:0}t.prototype.equals=function(t){if(this.baseLength!==t.baseLength)return!1;if(this.targetLength!==t.targetLength)return!1;if(this.ops.length!==t.ops.length)return!1;for(var e=0;e0},r=t.isInsert=function(t){return"string"==typeof t},i=t.isDelete=function(t){return"number"==typeof t&&t<0};return t.prototype.retain=function(t){if("number"!=typeof t)throw new Error("retain expects an integer");return 0===t?this:(this.baseLength+=t,this.targetLength+=t,o(this.ops[this.ops.length-1])?this.ops[this.ops.length-1]+=t:this.ops.push(t),this)},t.prototype.insert=function(t){if("string"!=typeof t)throw new Error("insert expects a string");if(""===t)return this;this.targetLength+=t.length;var e=this.ops;return r(e[e.length-1])?e[e.length-1]+=t:i(e[e.length-1])?r(e[e.length-2])?e[e.length-2]+=t:(e[e.length]=e[e.length-1],e[e.length-2]=t):e.push(t),this},t.prototype["delete"]=function(t){if("string"==typeof t&&(t=t.length),"number"!=typeof t)throw new Error("delete expects an integer or a string");return 0===t?this:(t>0&&(t=-t),this.baseLength-=t,i(this.ops[this.ops.length-1])?this.ops[this.ops.length-1]+=t:this.ops.push(t),this)},t.prototype.isNoop=function(){return 0===this.ops.length||1===this.ops.length&&o(this.ops[0])},t.prototype.toString=function(){var t=Array.prototype.map||function(t){for(var e=this,n=[],o=0,r=e.length;ot.length)throw new Error("Operation can't retain more characters than are left in the string.");n[i++]=t.slice(s,s+c),s+=c}else r(c)?n[i++]=c:s-=c}if(s!==t.length)throw new Error("The operation didn't operate on the whole string.");return n.join("")},t.prototype.invert=function(e){for(var n=0,i=new t,s=this.ops,a=0,h=s.length;au?(s.retain(u),l-=u,u=h[c++]):l===u?(s.retain(l),l=a[p++],u=h[c++]):(s.retain(l),u-=l,l=a[p++]);else if(r(l)&&i(u))l.length>-u?(l=l.slice(-u),u=h[c++]):l.length===-u?(l=a[p++],u=h[c++]):(u+=l.length,l=a[p++]);else if(r(l)&&o(u))l.length>u?(s.insert(l.slice(0,u)),l=l.slice(u),u=h[c++]):l.length===u?(s.insert(l),l=a[p++],u=h[c++]):(s.insert(l),u-=l.length,l=a[p++]);else{if(!o(l)||!i(u))throw new Error("This shouldn't happen: op1: "+JSON.stringify(l)+", op2: "+JSON.stringify(u));l>-u?(s["delete"](u),l+=u,u=h[c++]):l===-u?(s["delete"](u),l=a[p++],u=h[c++]):(s["delete"](l),u+=l,l=a[p++])}}}return s},t.prototype.shouldBeComposedWith=function(t){if(this.isNoop()||t.isNoop())return!0;var o=n(this),s=n(t),a=e(this),h=e(t);return!(!a||!h)&&(r(a)&&r(h)?o+a.length===s:!(!i(a)||!i(h))&&(s-h===o||o===s))},t.prototype.shouldBeComposedWithInverted=function(t){if(this.isNoop()||t.isNoop())return!0;var o=n(this),s=n(t),a=e(this),h=e(t);return!(!a||!h)&&(r(a)&&r(h)?o+a.length===s||o===s:!(!i(a)||!i(h))&&s-h===o)},t.transform=function(e,n){if(e.baseLength!==n.baseLength)throw new Error("Both operations have to have the same base length");for(var s=new t,a=new t,h=e.ops,p=n.ops,c=0,l=0,u=h[c++],f=p[l++];;){if("undefined"==typeof u&&"undefined"==typeof f)break;if(r(u))s.insert(u),a.retain(u.length),u=h[c++];else if(r(f))s.retain(f.length),a.insert(f),f=p[l++];else{if("undefined"==typeof u)throw new Error("Cannot compose operations: first operation is too short.");if("undefined"==typeof f)throw new Error("Cannot compose operations: first operation is too long.");var d;if(o(u)&&o(f))u>f?(d=f,u-=f,f=p[l++]):u===f?(d=f,u=h[c++],f=p[l++]):(d=u,f-=u,u=h[c++]),s.retain(d),a.retain(d);else if(i(u)&&i(f))-u>-f?(u-=f,f=p[l++]):u===f?(u=h[c++],f=p[l++]):(f-=u,u=h[c++]);else if(i(u)&&o(f))-u>f?(d=f,u+=f,f=p[l++]):-u===f?(d=f,u=h[c++],f=p[l++]):(d=-u,f+=u,u=h[c++]),s["delete"](d);else{if(!o(u)||!i(f))throw new Error("The two operations aren't compatible");u>-f?(d=-f,u+=f,f=p[l++]):u===-f?(d=u,u=h[c++],f=p[l++]):(d=u,f+=u,u=h[c++]),a["delete"](d)}}}return[s,a]},t}(),"object"==typeof module&&(module.exports=ot.TextOperation),"undefined"==typeof ot)var ot={};if(ot.Selection=function(t){"use strict";function e(t,e){this.anchor=t,this.head=e}function n(t){this.ranges=t||[]}var o=t.ot?t.ot.TextOperation:require("./text-operation");return e.fromJSON=function(t){return new e(t.anchor,t.head)},e.prototype.equals=function(t){return this.anchor===t.anchor&&this.head===t.head},e.prototype.isEmpty=function(){return this.anchor===this.head},e.prototype.transform=function(t){function n(e){for(var n=e,r=t.ops,i=0,s=t.ops.length;i=0;r--){var i=o.transform(t[r],e);"function"==typeof i[0].isNoop&&i[0].isNoop()||n.push(i[0]),e=i[1]}return n.reverse()}var n="normal",o="undoing",r="redoing";return t.prototype.add=function(t,e){if(this.state===o)this.redoStack.push(t),this.dontCompose=!0;else if(this.state===r)this.undoStack.push(t),this.dontCompose=!0;else{var n=this.undoStack;!this.dontCompose&&e&&n.length>0?n.push(t.compose(n.pop())):(n.push(t),n.length>this.maxItems&&n.shift()),this.dontCompose=!1,this.redoStack=[]}},t.prototype.transform=function(t){this.undoStack=e(this.undoStack,t),this.redoStack=e(this.redoStack,t)},t.prototype.performUndo=function(t){if(this.state=o,0===this.undoStack.length)throw new Error("undo not possible");t(this.undoStack.pop()),this.state=n},t.prototype.performRedo=function(t){if(this.state=r,0===this.redoStack.length)throw new Error("redo not possible");t(this.redoStack.pop()),this.state=n},t.prototype.canUndo=function(){return 0!==this.undoStack.length},t.prototype.canRedo=function(){return 0!==this.redoStack.length},t.prototype.isUndoing=function(){return this.state===o},t.prototype.isRedoing=function(){return this.state===r},t}(),"object"==typeof module&&(module.exports=ot.UndoManager),"undefined"==typeof ot)var ot={};ot.Client=function(t){"use strict";function e(t){this.revision=t,this.setState(a)}function n(){}function o(t){this.outstanding=t}function r(t,e){this.outstanding=t,this.buffer=e}function i(t,e,n){this.acknowlaged=t,this.client=e,this.revision=n}function s(t,e,n,o){this.acknowlaged=t,this.buffer=e,this.client=n,this.revision=o}e.prototype.setState=function(t){this.state=t},e.prototype.applyClient=function(t){this.setState(this.state.applyClient(this,t))},e.prototype.applyServer=function(t,e){this.setState(this.state.applyServer(this,t,e))},e.prototype.applyOperations=function(t,e){this.setState(this.state.applyOperations(this,t,e))},e.prototype.serverAck=function(t){this.setState(this.state.serverAck(this,t))},e.prototype.serverReconnect=function(){"function"==typeof this.state.resend&&this.state.resend(this)},e.prototype.transformSelection=function(t){return this.state.transformSelection(t)},e.prototype.sendOperation=function(t,e){throw new Error("sendOperation must be defined in child class")},e.prototype.applyOperation=function(t){throw new Error("applyOperation must be defined in child class")},e.Synchronized=n,n.prototype.applyClient=function(t,e){return t.sendOperation(t.revision,e),new o(e)},n.prototype.applyServer=function(t,e,n){if(e-t.revision>1)throw new Error("Invalid revision.");return t.revision=e,t.applyOperation(n),this},n.prototype.serverAck=function(t,e){throw new Error("There is no pending operation.")},n.prototype.transformSelection=function(t){return t};var a=new n;return e.AwaitingConfirm=o,o.prototype.applyClient=function(t,e){return new r(this.outstanding,e)},o.prototype.applyServer=function(t,e,n){if(e-t.revision>1)throw new Error("Invalid revision.");t.revision=e;var r=n.constructor.transform(this.outstanding,n);return t.applyOperation(r[1]),new o(r[0])},o.prototype.serverAck=function(t,e){return e-t.revision>1?new i(this.outstanding,t,e).getOperations():(t.revision=e,a)},o.prototype.transformSelection=function(t){return t.transform(this.outstanding)},o.prototype.resend=function(t){t.sendOperation(t.revision,this.outstanding)},e.AwaitingWithBuffer=r,r.prototype.applyClient=function(t,e){var n=this.buffer.compose(e);return new r(this.outstanding,n)},r.prototype.applyServer=function(t,e,n){if(e-t.revision>1)throw new Error("Invalid revision.");t.revision=e;var o=n.constructor.transform,i=o(this.outstanding,n),s=o(this.buffer,i[1]);return t.applyOperation(s[1]),new r(i[0],s[0])},r.prototype.serverAck=function(t,e){return e-t.revision>1?new s(this.outstanding,this.buffer,t,e).getOperations():(t.revision=e,t.sendOperation(t.revision,this.buffer),new o(this.buffer))},r.prototype.transformSelection=function(t){return t.transform(this.outstanding).transform(this.buffer)},r.prototype.resend=function(t){t.sendOperation(t.revision,this.outstanding)},e.Stale=i,i.prototype.applyClient=function(t,e){return new s(this.acknowlaged,e,t,this.revision)},i.prototype.applyServer=function(t,e,n){throw new Error("Ignored server-side change.")},i.prototype.applyOperations=function(t,e,n){for(var o=this.acknowlaged.constructor.transform,r=0;re.line?1:t.che.ch?1:0}function o(t,e){return n(t,e)<=0}function r(t,e){return o(t,e)?t:e}function i(t,e){return o(t,e)?e:t}function s(t){return t.indexFromPos({line:t.lastLine(),ch:0})+t.getLine(t.lastLine()).length}function a(t,e){var n=t[e];t[e]=function(){n.apply(t,arguments)}}var h=ot.TextOperation,p=ot.Selection;e.prototype.detach=function(){this.cm.off("changes",this.onChanges),this.cm.off("change",this.onChange),this.cm.off("cursorActivity",this.onCursorActivity),this.cm.off("focus",this.onFocus),this.cm.off("blur",this.onBlur)},e.operationFromCodeMirrorChanges=function(t,e){function n(t){return t[t.length-1]}function r(t){if(0===t.length)return 0;for(var e=0,n=0;n=0;u--){var f=t[u];l=i(l,f);var d=l(f.from),g=a-d-r(f.text);p=(new h).retain(d)["delete"](r(f.removed)).insert(f.text.join("\n")).retain(g).compose(p),c=c.compose((new h).retain(d)["delete"](r(f.text)).insert(f.removed.join("\n")).retain(g)),a+=r(f.removed)-r(f.text)}return[p,c]},e.operationFromCodeMirrorChange=e.operationFromCodeMirrorChanges,e.applyOperationToCodeMirror=function(t,e){e.operation(function(){for(var n=t.ops,o=0,r=0,i=n.length;r0&&(this.majorRevision+=n.length,this.minorRevision=0);var o=t.events;if(o){for(e=0;e1&&(t-=1),6*t<1?i+6*(o-i)*t:2*t<1?o:3*t<2?i+6*(o-i)*(2/3-t):i};return r(s(t+1/3),s(t),s(t-1/3))}function s(t){for(var e=1,n=0;n0&&n.shouldBeComposedWithInverted(h(this.undoManager.undoStack).wrapped)),s=new t(this.selection,o);this.undoManager.add(new d(n,s),i),this.applyClient(e)},o.prototype.updateSelection=function(){this.selection=this.editorAdapter.getSelection()},o.prototype.onSelectionChange=function(){var t=this.selection;this.updateSelection(),t&&this.selection.equals(t)||this.sendSelection(this.selection)},o.prototype.onBlur=function(){this.selection=null,this.sendSelection(null)},o.prototype.sendSelection=function(t){this.state instanceof c.AwaitingWithBuffer||this.serverAdapter.sendSelection(t)},o.prototype.sendOperation=function(t,e){this.serverAdapter.sendOperation(t,e.toJSON(),this.selection)},o.prototype.getOperations=function(t,e){this.serverAdapter.getOperations(t,e)},o.prototype.applyOperation=function(t){this.editorAdapter.applyOperation(t),this.updateSelection(),this.undoManager.transform(new d(t,null))},o}(); \ No newline at end of file diff --git a/public/vendor/ot/socketio-adapter.js b/public/vendor/ot/socketio-adapter.js index 463ef461..329d4f3e 100755 --- a/public/vendor/ot/socketio-adapter.js +++ b/public/vendor/ot/socketio-adapter.js @@ -32,7 +32,7 @@ ot.SocketIOAdapter = (function () { self.trigger('selection', clientId, selection); }); socket.on('reconnect', function () { - //self.trigger('reconnect'); + self.trigger('reconnect'); }); } diff --git a/public/vendor/select2/select2.png b/public/vendor/select2/select2.png index 1d804ffb..44e10d63 100755 Binary files a/public/vendor/select2/select2.png and b/public/vendor/select2/select2.png differ diff --git a/public/vendor/select2/select2x2.png b/public/vendor/select2/select2x2.png index 4bdd5c96..c657a145 100755 Binary files a/public/vendor/select2/select2x2.png and b/public/vendor/select2/select2x2.png differ diff --git a/public/views/body.ejs b/public/views/body.ejs index 28680e49..79f2544e 100644 --- a/public/views/body.ejs +++ b/public/views/body.ejs @@ -7,7 +7,7 @@ - +   @@ -19,8 +19,15 @@
  • Editable - Signed people can edit
  • Locked - Only owner can edit
  • Private - Only owner can view & edit
  • +
  • +
  • Delete this note
  • +
    +
    @@ -215,6 +222,26 @@ + + <%- include refresh-modal %> <%- include signin-modal %> <%- include help-modal %> diff --git a/public/views/foot.ejs b/public/views/foot.ejs index adab9d15..de714bbe 100644 --- a/public/views/foot.ejs +++ b/public/views/foot.ejs @@ -3,14 +3,14 @@ <% if(useCDN) { %> - - + + - + - + <% } else { %> diff --git a/public/views/html.hbs b/public/views/html.hbs index 7213ff9f..3f25e5d7 100644 --- a/public/views/html.hbs +++ b/public/views/html.hbs @@ -19,7 +19,7 @@ - + @@ -47,7 +47,7 @@ - + <% if(useCDN) { %> - - + + - + <% } else { %> diff --git a/public/views/pretty.ejs b/public/views/pretty.ejs index 4cfbdb04..6f7c4e72 100644 --- a/public/views/pretty.ejs +++ b/public/views/pretty.ejs @@ -52,12 +52,19 @@ <% if(lastchangeuserprofile) { %> <% } else { %> - + <% } %>   <%- viewcount %> views +
    + <% if(ownerprofile && owner !== lastchangeuser) { %> + +   +  owned this note + + <% } %>
    <%- body %>
    @@ -83,11 +90,11 @@ MathJax.Hub.Config({ messageStyle: "none", skipStartupTypeset: true ,tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']], processEscapes: true }}); <% if(useCDN) { %> - + - + <% } else { %> diff --git a/public/views/slide.ejs b/public/views/slide.ejs index b3212f44..c463f378 100644 --- a/public/views/slide.ejs +++ b/public/views/slide.ejs @@ -60,12 +60,19 @@ <% if(lastchangeuserprofile) { %> <% } else { %> - + <% } %>   <%- viewcount %> views +
    + <% if(ownerprofile && owner !== lastchangeuser) { %> + +   +  owned this note + + <% } %> <% if(typeof disqus !== 'undefined' && disqus) { %> @@ -80,11 +87,11 @@ MathJax.Hub.Config({ messageStyle: "none", skipStartupTypeset: true ,tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']], processEscapes: true }}); <% if(useCDN) { %> - - + + - + <% } else { %> @@ -97,7 +104,6 @@ <% } %> - diff --git a/webpackBaseConfig.js b/webpackBaseConfig.js index e2d58f4d..01f8e39f 100644 --- a/webpackBaseConfig.js +++ b/webpackBaseConfig.js @@ -41,7 +41,8 @@ module.exports = { "expose?LZString!lz-string", "expose?filterXSS!xss", "js-url", - "bootstrap" + "bootstrap", + "expose?ListPagination!list.pagination.js/dist/list.pagination.js" ] },