├── Procfile ├── .gitignore ├── .bowerrc ├── .travis.yml ├── bower.json ├── static ├── images │ ├── lint.png │ ├── run.png │ ├── save.png │ ├── share.png │ ├── favicon.png │ ├── twitter.png │ └── es6-fiddle.png ├── src │ ├── analytics.js │ ├── underscore.min.js │ └── lodash.min.js ├── lib │ ├── codemirror │ │ ├── LICENSE │ │ ├── style │ │ │ └── codemirror.css │ │ └── src │ │ │ └── mode.js │ └── q │ │ └── q.min.js ├── embed.html ├── index.html └── style │ └── es6-fiddle.css ├── style ├── es6-fiddle.styl ├── header.styl ├── embed.styl └── content.styl ├── .jshintrc ├── CONTRIBUTORS.md ├── src ├── add-examples.js ├── filter-example.js ├── sortby-example.js ├── random-example.js └── es6-fiddle.js ├── README.md ├── .jscs.json ├── package.json ├── app.js ├── LICENSE.md ├── api.js └── Gruntfile.js /Procfile: -------------------------------------------------------------------------------- 1 | web: node app.js 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules/ 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /.bowerrc: -------------------------------------------------------------------------------- 1 | { 2 | "directory": "static/lib" 3 | } 4 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.10" 4 | -------------------------------------------------------------------------------- /bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "es6-fiddle-web", 3 | "version": "0.0.1", 4 | "main": ["./src"] 5 | } 6 | -------------------------------------------------------------------------------- /static/images/lint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wintersummermint/lodash-fiddle-playground/HEAD/static/images/lint.png -------------------------------------------------------------------------------- /static/images/run.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wintersummermint/lodash-fiddle-playground/HEAD/static/images/run.png -------------------------------------------------------------------------------- /static/images/save.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wintersummermint/lodash-fiddle-playground/HEAD/static/images/save.png -------------------------------------------------------------------------------- /static/images/share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wintersummermint/lodash-fiddle-playground/HEAD/static/images/share.png -------------------------------------------------------------------------------- /static/images/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wintersummermint/lodash-fiddle-playground/HEAD/static/images/favicon.png -------------------------------------------------------------------------------- /static/images/twitter.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wintersummermint/lodash-fiddle-playground/HEAD/static/images/twitter.png -------------------------------------------------------------------------------- /static/images/es6-fiddle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wintersummermint/lodash-fiddle-playground/HEAD/static/images/es6-fiddle.png -------------------------------------------------------------------------------- /style/es6-fiddle.styl: -------------------------------------------------------------------------------- 1 | body, html { 2 | margin: 0; 3 | padding: 0 0 10px 0; 4 | min-width: 600px; 5 | } 6 | 7 | .CodeMirror { 8 | height: 100%; 9 | } 10 | 11 | .CodeMirror-scroll { 12 | overflow-y: hidden; 13 | overflow-x: auto; 14 | } 15 | -------------------------------------------------------------------------------- /.jshintrc: -------------------------------------------------------------------------------- 1 | { 2 | "camelcase": true, 3 | "indent": 4, 4 | "trailing": true, 5 | "quotmark": "single", 6 | "maxlen": 120, 7 | "unused": true, 8 | "undef": true, 9 | "sub": true, 10 | "browser": true, 11 | "node": true 12 | } 13 | -------------------------------------------------------------------------------- /CONTRIBUTORS.md: -------------------------------------------------------------------------------- 1 | Lodash Fiddle contributors 2 | === 3 | * [Nixon Galario](https://github.com/wintersummermint) 4 | * added lodash library/ examples project maintaner 5 | * [Jeff McRiffey](https://github.com/jmcriffey) 6 | * Original Author and project maintainer of ES6 Fiddle 7 | * [Jaydson Gomes](https://github.com/jaydson) 8 | * Embedded fiddles 9 | -------------------------------------------------------------------------------- /style/header.styl: -------------------------------------------------------------------------------- 1 | .header { 2 | width: 100%; 3 | height: 100px; 4 | background: #595352; 5 | color: #fefefe; 6 | } 7 | 8 | .header > h1 { 9 | margin: 0px; 10 | padding : 15px 0px 0px 45px; 11 | font-family: 'verdana','lato'; 12 | font-weight : 100; 13 | } 14 | .header > p { 15 | margin: 0px; 16 | padding : 0px 0px 10px 45px; 17 | font-family: 'verdana','lato'; 18 | font-weight : 100; 19 | } -------------------------------------------------------------------------------- /static/src/analytics.js: -------------------------------------------------------------------------------- 1 | (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ 2 | (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), 3 | m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) 4 | })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); 5 | 6 | ga('create', 'UA-48128415-1', 'es6fiddle.net'); 7 | ga('send', 'pageview'); 8 | -------------------------------------------------------------------------------- /src/add-examples.js: -------------------------------------------------------------------------------- 1 | //add all of the example code to the example selector 2 | 3 | if (!window.embedded) { 4 | for (var example in window.lodashExample) { 5 | if (window.lodashExample.hasOwnProperty(example)) { 6 | window.exampleSelector.innerHTML += 7 | ''; 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/filter-example.js: -------------------------------------------------------------------------------- 1 | window.lodashExample.filter = {}; 2 | 3 | window.lodashExample.filter.code = [ 4 | 'let characters = [', 5 | ' { \'name\': \'barney\', \'age\': 36, \'pets\': [\'hoppy\'] },', 6 | ' { \'name\': \'fred\', \'age\': 40, \'pets\': [\'baby puss\', \'dino\'] }', 7 | '];', 8 | '', 9 | 'let filterAge = _.filter(characters, { \'age\': 36 });', 10 | '', 11 | 'console.log(JSON.stringify(filterAge));' 12 | ].join('\n'); 13 | 14 | window.lodashExample.filter.display = 'Filter Collection'; 15 | -------------------------------------------------------------------------------- /src/sortby-example.js: -------------------------------------------------------------------------------- 1 | window.lodashExample.sortBy = {}; 2 | 3 | window.lodashExample.sortBy.code = [ 4 | '', 5 | 'let articles = [', 6 | ' { article: 41, quantity: 24 },', 7 | ' { article: 2323, quantity: 2 },', 8 | ' { article: 655, quantity: 23 }', 9 | '];', 10 | '', 11 | 'let sortByArticles = _.sortBy(articles, function(item){', 12 | ' return -item.quantity;', 13 | '});', 14 | 'console.log(JSON.stringify(sortByArticles));' 15 | ].join('\n'); 16 | 17 | window.lodashExample.sortBy.display = 'sortBy Collection'; -------------------------------------------------------------------------------- /src/random-example.js: -------------------------------------------------------------------------------- 1 | window.lodashExample.random = {}; 2 | 3 | window.lodashExample.random.code = [ 4 | '// Get a random number between 15 and 20.', 5 | '', 6 | '// Naive utility method', 7 | 'function getRandomNumber(min, max){', 8 | ' return Math.floor(Math.random() * (max - min + 1)) + min;', 9 | '}', 10 | '', 11 | 'getRandomNumber(15, 20);', 12 | '', 13 | '// Lodash', 14 | 'let rand = _.random(15, 20);', 15 | '', 16 | 'console.log(rand)' 17 | ].join('\n'); 18 | 19 | window.lodashExample.random.display = 'Random Function'; 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # Lodash Fiddle Web 3 | 4 | [![Build Status](https://travis-ci.org/jmcriffey/es6-fiddle-web.png?branch=master)](https://travis-ci.org/jmcriffey/es6-fiddle-web) 5 | 6 | ## Installation 7 | 8 | No installation just Go to App : https://lodashfiddle.herokuapp.com/ 9 | 10 | ## Contributing 11 | 12 | 1. Fork it! 13 | 2. Create your feature branch: `git checkout -b my-new-feature` 14 | 3. Commit your changes: `git commit -am 'Add some feature'` 15 | 4. Push to the branch: `git push origin my-new-feature` 16 | 5. Submit a pull request :D 17 | 18 | 19 | ## Credits 20 | 21 | Credits from Jeff McRiffey https://github.com/jmcriffey/es6-fiddle-web and samples https://github.com/mdunisch/lololodash/tree/master/exercises that gives me idea to have a fiddle playground for lodash 22 | 23 | ## TODO 24 | 25 | more samples and UI improvements 26 | 27 | ## License 28 | 29 | MIT 30 | -------------------------------------------------------------------------------- /.jscs.json: -------------------------------------------------------------------------------- 1 | { 2 | "requireCurlyBraces": ["if", "else", "for", "while", "do"], 3 | "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return"], 4 | "requireSpacesInFunctionExpression": { 5 | "beforeOpeningCurlyBrace": true 6 | }, 7 | "disallowSpacesInFunctionExpression": { 8 | "beforeOpeningRoundBrace": true 9 | }, 10 | "requireMultipleVarDecl": true, 11 | "disallowLeftStickedOperators": ["?", "-", "+", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], 12 | "disallowRightStickedOperators": ["?", "/", "+", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], 13 | "requireRightStickedOperators": ["!"], 14 | "requireLeftStickedOperators": [","], 15 | "disallowKeywords": ["with"], 16 | "disallowMultipleLineBreaks": true, 17 | "disallowKeywordsOnNewLine": ["else"], 18 | "requireLineFeedAtFileEnd": true 19 | } 20 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "es6-fiddle-web", 3 | "description": "Lodash fiddle with ES2015 feautures", 4 | "version": "0.0.1", 5 | "homepage": "http://www.lodashfiddle.cf", 6 | "author": { 7 | "name": "Nixon Galario", 8 | "email": "nixongalario@gmail.com", 9 | "url": "github.com/wintersummermint" 10 | }, 11 | "repository": { 12 | "type": "git", 13 | "url": "https://github.com/wintersummermint/lodash-fiddle-web.git" 14 | }, 15 | "dependencies": { 16 | "express": "^3.4.8", 17 | "mongodb": "^1.3.23" 18 | }, 19 | "devDependencies": { 20 | "grunt-cli": "^0.1.13", 21 | "grunt": "0.4.2", 22 | "grunt-contrib-stylus": "^0.12.0", 23 | "grunt-contrib-uglify": "^0.3.2", 24 | "grunt-contrib-jshint": "^0.8.0", 25 | "grunt-jscs-checker": "^0.3.2", 26 | "grunt-contrib-watch": "^0.5.3" 27 | }, 28 | "scripts": { 29 | "test": "grunt test", 30 | "start": "grunt watch", 31 | "build": "grunt build" 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app.js: -------------------------------------------------------------------------------- 1 | var express = require('express'), 2 | pkg = require('./package.json'), 3 | api = require('./api'), 4 | app = express(), 5 | port = Number(process.env.PORT || 5001); 6 | 7 | app.use(express.compress()); 8 | app.use(express.logger()); 9 | app.use(express.json()); 10 | 11 | app.configure(function() { 12 | app.use('/', express.static(__dirname + '/static')); 13 | }); 14 | 15 | app.get(/^\/\w+\/$/, function(req, res) { 16 | res.sendfile(__dirname + '/static/index.html'); 17 | }); 18 | 19 | app.get(/^\/embed\/\w+\/$/, function(req, res) { 20 | res.sendfile(__dirname + '/static/embed.html'); 21 | }); 22 | 23 | app.get(/^\/\w+$/, function(req, res) { 24 | res.redirect(req.url + '/'); 25 | }); 26 | 27 | app.get(/^\/embed\/\w+$/, function(req, res) { 28 | res.redirect(req.url + '/'); 29 | }); 30 | 31 | api(app); 32 | 33 | app.listen(port, function() { 34 | console.log('port is ' + port); 35 | }); 36 | 37 | console.log( 38 | 'Express version ' + 39 | pkg.dependencies.express.replace(/[^\w\.]/g, '') + 40 | ' starting server on port ' + 41 | port + 42 | '.' 43 | ); 44 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Nixon Galario 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /static/lib/codemirror/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2013 by Marijn Haverbeke and others 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /static/embed.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Lodash Fiddle 10 | 11 | 12 | 13 | 14 |
15 |
16 | Lodash Fiddle 17 | Console 18 | Edit at Lodash Fiddle 19 |
20 |
21 |
22 |
23 | 24 |
25 |
26 |
27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /api.js: -------------------------------------------------------------------------------- 1 | var mongo = require('mongodb').MongoClient, 2 | fiddles = null; 3 | 4 | module.exports = function(app) { 5 | mongo.connect(String(process.env.MONGO_URL), function(err, db) { 6 | fiddles = db.collection('fiddles'); 7 | }); 8 | 9 | app.get(/^\/fiddles\/\w+$/, function(req, res) { 10 | var fiddle = req.url.split('/').pop(); 11 | 12 | if (fiddle) { 13 | fiddles.findOne({fiddle: fiddle}, function(err, item) { 14 | if (item) { 15 | res.json(item); 16 | } else { 17 | res.json({ 18 | 'message': 'No fiddle found.' 19 | }); 20 | } 21 | }); 22 | } 23 | }); 24 | 25 | app.post('/save', function(req, res) { 26 | var now = Date.now(), 27 | fiddle = parseInt(now, 10).toString(36); 28 | 29 | if (req.body.value) { //don't save anything empty 30 | fiddles.findOne({fiddle: fiddle}, function(err, item) { 31 | if (!item) { 32 | fiddles.insert({ 33 | fiddle: fiddle, 34 | value: req.body.value 35 | }, function() { 36 | console.log('Inserted fiddle at', fiddle + '.'); 37 | }); 38 | } 39 | }); 40 | } 41 | 42 | res.json({ 43 | saved: true, 44 | fiddle: fiddle 45 | }); 46 | }); 47 | }; 48 | -------------------------------------------------------------------------------- /style/embed.styl: -------------------------------------------------------------------------------- 1 | .embed-wrapper { 2 | position: relative; 3 | border: 1px solid #ddd; 4 | 5 | .embed-header { 6 | width: 100%; 7 | height: 30px; 8 | line-height: 30px; 9 | position: absolute; 10 | top: 0; 11 | left: 0; 12 | border-bottom: 1px solid #ddd; 13 | color: #000; 14 | overflow: hidden; 15 | z-index: 10; 16 | font-family: 'helvetica', 'arial', 'sans-serif'; 17 | font-size: 13px; 18 | box-shadow: 0 1px 3px #ddd; 19 | 20 | span { 21 | color: darken(#e9d9d3, 25%); 22 | margin-left: 15px; 23 | cursor: pointer; 24 | 25 | &:hover { 26 | color: #983e50; 27 | font-weight: bold; 28 | } 29 | 30 | &.selected { 31 | color: #983e50; 32 | font-weight: bold; 33 | } 34 | } 35 | 36 | a { 37 | float: right; 38 | margin-right: 10px; 39 | color: darken(#e9d9d3, 25%); 40 | text-decoration: none; 41 | font-size: 10px; 42 | 43 | &:hover { 44 | color: #983e50; 45 | } 46 | 47 | &.selected { 48 | color: #983e50; 49 | } 50 | 51 | } 52 | } 53 | 54 | .embed-content { 55 | position: relative; 56 | top: 30px; 57 | height: 260px; 58 | overflow: auto; 59 | 60 | .fiddle { 61 | display: block; 62 | height: 215px; 63 | margin-left: 10px; 64 | margin-top: 10px 65 | } 66 | 67 | .result-wrapper { 68 | display: none; 69 | 70 | .result { 71 | width: 100%; 72 | height: 100%; 73 | border: none; 74 | } 75 | } 76 | } 77 | 78 | 79 | } 80 | -------------------------------------------------------------------------------- /Gruntfile.js: -------------------------------------------------------------------------------- 1 | module.exports = function(grunt) { 2 | var jsFiles = [ 3 | 'static/lib/jshint/**/*.js', 4 | 'static/lib/codemirror/**/*.js', 5 | 'src/es6-fiddle.js', 6 | 'src/*-example.js', 7 | 'src/add-examples.js' 8 | ], 9 | styleFiles = ['static/lib/**/*.css', 'style/*.styl'], 10 | lintFiles = ['Gruntfile.js', 'app.js', 'api.js', 'src/*.js'], 11 | pkg = grunt.file.readJSON('package.json'), 12 | npmTasks = [ 13 | 'grunt-contrib-jshint', 14 | 'grunt-contrib-stylus', 15 | 'grunt-contrib-uglify', 16 | 'grunt-contrib-watch', 17 | 'grunt-jscs-checker' 18 | ]; 19 | 20 | grunt.initConfig({ 21 | pkg: pkg, 22 | jscs: { 23 | all: lintFiles, 24 | options: { 25 | config: '.jscs.json' 26 | } 27 | }, 28 | jshint: { 29 | all: lintFiles, 30 | options: { 31 | jshintrc: '.jshintrc' 32 | } 33 | }, 34 | uglify: { 35 | options: { 36 | mangle: false 37 | }, 38 | compile: { 39 | files: { 40 | 'static/src/es6-fiddle.js': jsFiles 41 | } 42 | } 43 | }, 44 | stylus: { 45 | compile: { 46 | files: { 47 | 'static/style/es6-fiddle.css': styleFiles 48 | }, 49 | options: { 50 | import: ['nib'] 51 | } 52 | } 53 | }, 54 | watch: { 55 | options: { 56 | atBegin: true 57 | }, 58 | style: { 59 | files: styleFiles, 60 | tasks: ['stylus'] 61 | }, 62 | src: { 63 | files: jsFiles, 64 | tasks: ['uglify'] 65 | } 66 | } 67 | }); 68 | 69 | npmTasks.forEach(function(task) { 70 | grunt.loadNpmTasks(task); 71 | }); 72 | 73 | grunt.registerTask('default', ['watch']); 74 | grunt.registerTask('test', ['jshint', 'jscs']); 75 | grunt.registerTask('build', ['stylus', 'uglify']); 76 | }; 77 | -------------------------------------------------------------------------------- /static/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | Lodash Fiddle 10 | 11 | 12 | 13 | 16 | 17 | 18 | Fork me on GitHub 19 |
20 |

lodash

21 |

lodash fiddle with ES2015

22 |
23 |
24 | 27 |
28 |
29 | Code 30 | 39 | 40 | 41 | 42 |
43 |
44 |
45 |
46 |
Console
47 | 48 |
49 |
50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /style/content.styl: -------------------------------------------------------------------------------- 1 | .content-item { 2 | height: 508px; 3 | display: block; 4 | float: left; 5 | border: 1px solid #ddd; 6 | font-size: 14px; 7 | margin-top: 40px; 8 | width: 49%; 9 | float: left; 10 | } 11 | 12 | .animate { 13 | transition: all 0.1s; 14 | -webkit-transition: all 0.1s; 15 | } 16 | 17 | .action-button { 18 | position: relative; 19 | padding: 3px; 20 | float: left; 21 | height: 15px; 22 | width: 15px; 23 | border-radius: 3px; 24 | font-family: 'Lato', sans-serif; 25 | font-size: 18px; 26 | color: #FFF; 27 | text-decoration: none; 28 | } 29 | 30 | i.fa { 31 | font-size: 18px; 32 | position: relative; 33 | bottom: 20px; 34 | } 35 | .green { 36 | background-color: #2ecc71; 37 | border-bottom: 5px solid #27ae60; 38 | text-shadow: 0px -2px #27ae60; 39 | } 40 | 41 | .action-button:active { 42 | transform: translate(0px,5px); 43 | -webkit-transform: translate(0px,5px); 44 | border-bottom: 1px solid; 45 | } 46 | .icon-btn { 47 | color: #fff; 48 | background-repeat: no-repeat; 49 | border-radius: 2px; 50 | height: 15px; 51 | width: 15px; 52 | padding: 5px; 53 | background-size: cover; 54 | display: inline-block; 55 | cursor: pointer; 56 | float: right; 57 | margin-right: 10px; 58 | margin-top: 18px; 59 | } 60 | 61 | .content-embed { 62 | width : 100%; 63 | } 64 | 65 | .content { 66 | clearfix(); 67 | position: relative; 68 | width: 93%; 69 | min-width: 600px; 70 | height: 508px; 71 | margin-top: 4px; 72 | font-size: 0; 73 | margin: 0 auto; 74 | 75 | .examples { 76 | position: absolute; 77 | left: 0px; 78 | top: 10px; 79 | } 80 | 81 | .menu { 82 | @extend .content-item; 83 | width: 200px; 84 | border-color: transparent; 85 | 86 | select { 87 | width: 175px; 88 | margin-left: 15px; 89 | } 90 | 91 | .links { 92 | list-style-type: none; 93 | 94 | li { 95 | list-style-type: none; 96 | 97 | a { 98 | text-decoration: none; 99 | color: #009999; 100 | font-family: 'helvetica', 'arial', 'sans-serif'; 101 | 102 | &:hover { 103 | color: #1d7373; 104 | } 105 | } 106 | } 107 | } 108 | } 109 | 110 | .fiddle-wrapper { 111 | @extend .content-item; 112 | margin-right: 1%; 113 | 114 | .fiddle-header { 115 | height: 58px; 116 | width: 100%; 117 | background: #595352; 118 | color: #32D149; 119 | line-height: 58px; 120 | font-size: 18px; 121 | font-family: 'helvetica', 'arial', 'sans-serif'; 122 | position: relative; 123 | 124 | span { 125 | margin-left: 20px; 126 | text-transform: uppercase; 127 | } 128 | 129 | .run { 130 | @extend .icon-btn; 131 | } 132 | 133 | .lint { 134 | @extend .icon-btn; 135 | 136 | } 137 | 138 | .save { 139 | @extend .icon-btn; 140 | 141 | } 142 | 143 | .share { 144 | @extend .icon-btn; 145 | 146 | display: none; 147 | 148 | .share-drop { 149 | color: #47B84B; 150 | background: #fff; 151 | display: none; 152 | position: absolute; 153 | height: 150px; 154 | width: 250px; 155 | z-index: 10; 156 | top: 30px; 157 | right: -235px; 158 | line-height: 25px; 159 | font-size: 12px; 160 | text-align: left; 161 | box-shadow: 0 2px 25px #777; 162 | border-right: none; 163 | padding-left: 10px; 164 | 165 | label { 166 | display: block; 167 | } 168 | 169 | input { 170 | display: block; 171 | color: #777; 172 | width: 90%; 173 | 174 | &#share-embed { 175 | margin-bottom: 10px; 176 | } 177 | } 178 | 179 | .tweet { 180 | 181 | color: #47B84B; 182 | padding-left: 25px; 183 | margin-top: 10px; 184 | width: 50px; 185 | text-decoration: none; 186 | 187 | &:hover { 188 | color: lighten(#47B84B, 25%); 189 | } 190 | } 191 | } 192 | 193 | &:hover { 194 | .share-drop { 195 | display: block; 196 | } 197 | } 198 | } 199 | } 200 | 201 | .fiddle { 202 | width: 100%; 203 | height: 450px; 204 | 205 | .line-error { 206 | background-color: #bf3030; 207 | opacity: 0.1; 208 | } 209 | } 210 | } 211 | 212 | .result-wrapper { 213 | @extend .content-item; 214 | 215 | .result-header { 216 | height: 58px; 217 | width: 100%; 218 | background: #595352; 219 | color: #32D149; 220 | line-height: 58px; 221 | font-size: 18px; 222 | font-family: 'helvetica', 'arial', 'sans-serif'; 223 | 224 | span { 225 | margin-left: 20px; 226 | text-transform: uppercase; 227 | } 228 | } 229 | 230 | .result { 231 | height: 450px; 232 | width: 100%; 233 | border: none; 234 | } 235 | } 236 | } -------------------------------------------------------------------------------- /static/lib/codemirror/style/codemirror.css: -------------------------------------------------------------------------------- 1 | /* BASICS */ 2 | 3 | .CodeMirror { 4 | /* Set height, width, borders, and global font properties here */ 5 | font-family: monospace; 6 | height: 300px; 7 | } 8 | .CodeMirror-scroll { 9 | /* Set scrolling behaviour here */ 10 | overflow: auto; 11 | } 12 | 13 | /* PADDING */ 14 | 15 | .CodeMirror-lines { 16 | padding: 4px 0; /* Vertical padding around content */ 17 | } 18 | .CodeMirror pre { 19 | padding: 0 4px; /* Horizontal padding of content */ 20 | } 21 | 22 | .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { 23 | background-color: white; /* The little square between H and V scrollbars */ 24 | } 25 | 26 | /* GUTTER */ 27 | 28 | .CodeMirror-gutters { 29 | border-right: 1px solid #ddd; 30 | background-color: #f7f7f7; 31 | white-space: nowrap; 32 | } 33 | .CodeMirror-linenumbers {} 34 | .CodeMirror-linenumber { 35 | padding: 0 3px 0 5px; 36 | min-width: 20px; 37 | text-align: right; 38 | color: #999; 39 | -moz-box-sizing: content-box; 40 | box-sizing: content-box; 41 | } 42 | 43 | /* CURSOR */ 44 | 45 | .CodeMirror div.CodeMirror-cursor { 46 | border-left: 1px solid black; 47 | z-index: 3; 48 | } 49 | /* Shown when moving in bi-directional text */ 50 | .CodeMirror div.CodeMirror-secondarycursor { 51 | border-left: 1px solid silver; 52 | } 53 | .CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor { 54 | width: auto; 55 | border: 0; 56 | background: #7e7; 57 | z-index: 1; 58 | } 59 | /* Can style cursor different in overwrite (non-insert) mode */ 60 | .CodeMirror div.CodeMirror-cursor.CodeMirror-overwrite {} 61 | 62 | .cm-tab { display: inline-block; } 63 | 64 | /* DEFAULT THEME */ 65 | 66 | .cm-s-default .cm-keyword {color: #708;} 67 | .cm-s-default .cm-atom {color: #219;} 68 | .cm-s-default .cm-number {color: #164;} 69 | .cm-s-default .cm-def {color: #00f;} 70 | .cm-s-default .cm-variable {color: black;} 71 | .cm-s-default .cm-variable-2 {color: #05a;} 72 | .cm-s-default .cm-variable-3 {color: #085;} 73 | .cm-s-default .cm-property {color: black;} 74 | .cm-s-default .cm-operator {color: black;} 75 | .cm-s-default .cm-comment {color: #a50;} 76 | .cm-s-default .cm-string {color: #a11;} 77 | .cm-s-default .cm-string-2 {color: #f50;} 78 | .cm-s-default .cm-meta {color: #555;} 79 | .cm-s-default .cm-qualifier {color: #555;} 80 | .cm-s-default .cm-builtin {color: #30a;} 81 | .cm-s-default .cm-bracket {color: #997;} 82 | .cm-s-default .cm-tag {color: #170;} 83 | .cm-s-default .cm-attribute {color: #00c;} 84 | .cm-s-default .cm-header {color: blue;} 85 | .cm-s-default .cm-quote {color: #090;} 86 | .cm-s-default .cm-hr {color: #999;} 87 | .cm-s-default .cm-link {color: #00c;} 88 | 89 | .cm-negative {color: #d44;} 90 | .cm-positive {color: #292;} 91 | .cm-header, .cm-strong {font-weight: bold;} 92 | .cm-em {font-style: italic;} 93 | .cm-link {text-decoration: underline;} 94 | 95 | .cm-s-default .cm-error {color: #f00;} 96 | .cm-invalidchar {color: #f00;} 97 | 98 | div.CodeMirror span.CodeMirror-matchingbracket {color: #0f0;} 99 | div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #f22;} 100 | .CodeMirror-activeline-background {background: #e8f2ff;} 101 | 102 | /* STOP */ 103 | 104 | /* The rest of this file contains styles related to the mechanics of 105 | the editor. You probably shouldn't touch them. */ 106 | 107 | .CodeMirror { 108 | line-height: 1; 109 | position: relative; 110 | overflow: hidden; 111 | background: white; 112 | color: black; 113 | } 114 | 115 | .CodeMirror-scroll { 116 | /* 30px is the magic margin used to hide the element's real scrollbars */ 117 | /* See overflow: hidden in .CodeMirror */ 118 | margin-bottom: -30px; margin-right: -30px; 119 | padding-bottom: 30px; padding-right: 30px; 120 | height: 100%; 121 | outline: none; /* Prevent dragging from highlighting the element */ 122 | position: relative; 123 | -moz-box-sizing: content-box; 124 | box-sizing: content-box; 125 | } 126 | .CodeMirror-sizer { 127 | position: relative; 128 | } 129 | 130 | /* The fake, visible scrollbars. Used to force redraw during scrolling 131 | before actuall scrolling happens, thus preventing shaking and 132 | flickering artifacts. */ 133 | .CodeMirror-vscrollbar, .CodeMirror-hscrollbar, .CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { 134 | position: absolute; 135 | z-index: 6; 136 | display: none; 137 | } 138 | .CodeMirror-vscrollbar { 139 | right: 0; top: 0; 140 | overflow-x: hidden; 141 | overflow-y: scroll; 142 | } 143 | .CodeMirror-hscrollbar { 144 | bottom: 0; left: 0; 145 | overflow-y: hidden; 146 | overflow-x: scroll; 147 | } 148 | .CodeMirror-scrollbar-filler { 149 | right: 0; bottom: 0; 150 | } 151 | .CodeMirror-gutter-filler { 152 | left: 0; bottom: 0; 153 | } 154 | 155 | .CodeMirror-gutters { 156 | position: absolute; left: 0; top: 0; 157 | padding-bottom: 30px; 158 | z-index: 3; 159 | } 160 | .CodeMirror-gutter { 161 | white-space: normal; 162 | height: 100%; 163 | -moz-box-sizing: content-box; 164 | box-sizing: content-box; 165 | padding-bottom: 30px; 166 | margin-bottom: -32px; 167 | display: inline-block; 168 | /* Hack to make IE7 behave */ 169 | *zoom:1; 170 | *display:inline; 171 | } 172 | .CodeMirror-gutter-elt { 173 | position: absolute; 174 | cursor: default; 175 | z-index: 4; 176 | } 177 | 178 | .CodeMirror-lines { 179 | cursor: text; 180 | } 181 | .CodeMirror pre { 182 | /* Reset some styles that the rest of the page might have set */ 183 | -moz-border-radius: 0; -webkit-border-radius: 0; border-radius: 0; 184 | border-width: 0; 185 | background: transparent; 186 | font-family: inherit; 187 | font-size: inherit; 188 | margin: 0; 189 | white-space: pre; 190 | word-wrap: normal; 191 | line-height: inherit; 192 | color: inherit; 193 | z-index: 2; 194 | position: relative; 195 | overflow: visible; 196 | } 197 | .CodeMirror-wrap pre { 198 | word-wrap: break-word; 199 | white-space: pre-wrap; 200 | word-break: normal; 201 | } 202 | .CodeMirror-code pre { 203 | border-right: 30px solid transparent; 204 | width: -webkit-fit-content; 205 | width: -moz-fit-content; 206 | width: fit-content; 207 | } 208 | .CodeMirror-wrap .CodeMirror-code pre { 209 | border-right: none; 210 | width: auto; 211 | } 212 | .CodeMirror-linebackground { 213 | position: absolute; 214 | left: 0; right: 0; top: 0; bottom: 0; 215 | z-index: 0; 216 | } 217 | 218 | .CodeMirror-linewidget { 219 | position: relative; 220 | z-index: 2; 221 | overflow: auto; 222 | } 223 | 224 | .CodeMirror-widget {} 225 | 226 | .CodeMirror-wrap .CodeMirror-scroll { 227 | overflow-x: hidden; 228 | } 229 | 230 | .CodeMirror-measure { 231 | position: absolute; 232 | width: 100%; 233 | height: 0; 234 | overflow: hidden; 235 | visibility: hidden; 236 | } 237 | .CodeMirror-measure pre { position: static; } 238 | 239 | .CodeMirror div.CodeMirror-cursor { 240 | position: absolute; 241 | visibility: hidden; 242 | border-right: none; 243 | width: 0; 244 | } 245 | .CodeMirror-focused div.CodeMirror-cursor { 246 | visibility: visible; 247 | } 248 | 249 | .CodeMirror-selected { background: #d9d9d9; } 250 | .CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; } 251 | 252 | .cm-searching { 253 | background: #ffa; 254 | background: rgba(255, 255, 0, .4); 255 | } 256 | 257 | /* IE7 hack to prevent it from returning funny offsetTops on the spans */ 258 | .CodeMirror span { *vertical-align: text-bottom; } 259 | 260 | @media print { 261 | /* Hide the cursor when printing */ 262 | .CodeMirror div.CodeMirror-cursor { 263 | visibility: hidden; 264 | } 265 | } 266 | -------------------------------------------------------------------------------- /static/style/es6-fiddle.css: -------------------------------------------------------------------------------- 1 | .CodeMirror{font-family:monospace;height:300px}.CodeMirror-scroll{overflow:auto}.CodeMirror-lines{padding:4px 0;}.CodeMirror pre{padding:0 4px;}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:#fff;}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror div.CodeMirror-cursor{border-left:1px solid #000;z-index:3}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid #c0c0c0}.CodeMirror.cm-keymap-fat-cursor div.CodeMirror-cursor{width:auto;border:0;background:#7e7;z-index:1}.cm-tab{display:inline-block}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable{color:#000}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3{color:#085}.cm-s-default .cm-property{color:#000}.cm-s-default .cm-operator{color:#000}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-header{color:#00f}.cm-s-default .cm-quote{color:#090}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-s-default .cm-error{color:#f00}.cm-invalidchar{color:#f00}div.CodeMirror span.CodeMirror-matchingbracket{color:#0f0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#f22}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{line-height:1;position:relative;overflow:hidden;background:#fff;color:#000}.CodeMirror-scroll{margin-bottom:-30px;margin-right:-30px;padding-bottom:30px;padding-right:30px;height:100%;outline:none;position:relative;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-sizer{position:relative}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;padding-bottom:30px;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;padding-bottom:30px;margin-bottom:-32px;display:inline-block;*zoom:1;*display:inline}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-lines{cursor:text}.CodeMirror pre{-moz-border-radius:0;-webkit-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible}.CodeMirror-wrap pre{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-code pre{border-right:30px solid transparent;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content}.CodeMirror-wrap .CodeMirror-code pre{border-right:none;width:auto}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;overflow:auto}.CodeMirror-wrap .CodeMirror-scroll{overflow-x:hidden}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-measure pre{position:static}.CodeMirror div.CodeMirror-cursor{position:absolute;visibility:hidden;border-right:none;width:0}.CodeMirror-focused div.CodeMirror-cursor{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.cm-searching{background:#ffa;background:rgba(255,255,0,0.4)}.CodeMirror span{*vertical-align:text-bottom}@media print{.CodeMirror div.CodeMirror-cursor{visibility:hidden}} 2 | .content-item,.content .menu,.content .fiddle-wrapper,.content .result-wrapper{height:508px;display:block;float:left;border:1px solid #ddd;font-size:14px;margin-top:40px;width:49%;float:left}.animate{-webkit-transition:all 0.1s;-moz-transition:all 0.1s;-o-transition:all 0.1s;-ms-transition:all 0.1s;transition:all 0.1s;-webkit-transition:all .1s}.action-button{position:relative;padding:3px;float:left;height:15px;width:15px;-webkit-border-radius:3px;border-radius:3px;font-family:'Lato',sans-serif;font-size:18px;color:#fff;text-decoration:none}i.fa{font-size:18px;position:relative;bottom:20px}.green{background-color:#2ecc71;border-bottom:5px solid #27ae60;text-shadow:0 -2px #27ae60}.action-button:active{-webkit-transform:translate(0,5px);-moz-transform:translate(0,5px);-o-transform:translate(0,5px);-ms-transform:translate(0,5px);transform:translate(0,5px);-webkit-transform:translate(0,5px);border-bottom:1px solid}.icon-btn,.content .fiddle-wrapper .fiddle-header .run,.content .fiddle-wrapper .fiddle-header .lint,.content .fiddle-wrapper .fiddle-header .save,.content .fiddle-wrapper .fiddle-header .share{color:#fff;background-repeat:no-repeat;-webkit-border-radius:2px;border-radius:2px;height:15px;width:15px;padding:5px;-webkit-background-size:cover;-moz-background-size:cover;background-size:cover;display:inline-block;cursor:pointer;float:right;margin-right:10px;margin-top:18px}.content-embed{width:100%}.content{zoom:1;position:relative;width:93%;min-width:600px;height:508px;margin-top:4px;font-size:0;margin:0 auto;}.content:before,.content:after{content:"";display:table}.content:after{clear:both}.content .examples{position:absolute;left:0;top:10px}.content .menu{width:200px;border-color:transparent;}.content .menu select{width:175px;margin-left:15px}.content .menu .links{list-style-type:none;}.content .menu .links li{list-style-type:none;}.content .menu .links li a{text-decoration:none;color:#099;font-family:'helvetica','arial','sans-serif';}.content .menu .links li a:hover{color:#1d7373}.content .fiddle-wrapper{margin-right:1%;}.content .fiddle-wrapper .fiddle-header{height:58px;width:100%;background:#595352;color:#32d149;line-height:58px;font-size:18px;font-family:'helvetica','arial','sans-serif';position:relative;}.content .fiddle-wrapper .fiddle-header span{margin-left:20px;text-transform:uppercase}.content .fiddle-wrapper .fiddle-header .share{display:none;}.content .fiddle-wrapper .fiddle-header .share .share-drop{color:#47b84b;background:#fff;display:none;position:absolute;height:150px;width:250px;z-index:10;top:30px;right:-235px;line-height:25px;font-size:12px;text-align:left;-webkit-box-shadow:0 2px 25px #777;box-shadow:0 2px 25px #777;border-right:none;padding-left:10px;}.content .fiddle-wrapper .fiddle-header .share .share-drop label{display:block}.content .fiddle-wrapper .fiddle-header .share .share-drop input{display:block;color:#777;width:90%;}.content .fiddle-wrapper .fiddle-header .share .share-drop input#share-embed{margin-bottom:10px}.content .fiddle-wrapper .fiddle-header .share .share-drop .tweet{color:#47b84b;padding-left:25px;margin-top:10px;width:50px;text-decoration:none;}.content .fiddle-wrapper .fiddle-header .share .share-drop .tweet:hover{color:#75ca78}.content .fiddle-wrapper .fiddle-header .share:hover .share-drop{display:block}.content .fiddle-wrapper .fiddle{width:100%;height:450px;}.content .fiddle-wrapper .fiddle .line-error{background-color:#bf3030;opacity:.1;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=10)";filter:alpha(opacity=10)}.content .result-wrapper .result-header{height:58px;width:100%;background:#595352;color:#32d149;line-height:58px;font-size:18px;font-family:'helvetica','arial','sans-serif';}.content .result-wrapper .result-header span{margin-left:20px;text-transform:uppercase}.content .result-wrapper .result{height:450px;width:100%;border:none} 3 | .embed-wrapper{position:relative;border:1px solid #ddd;}.embed-wrapper .embed-header{width:100%;height:30px;line-height:30px;position:absolute;top:0;left:0;border-bottom:1px solid #ddd;color:#000;overflow:hidden;z-index:10;font-family:'helvetica','arial','sans-serif';font-size:13px;-webkit-box-shadow:0 1px 3px #ddd;box-shadow:0 1px 3px #ddd;}.embed-wrapper .embed-header span{color:#c49989;margin-left:15px;cursor:pointer;}.embed-wrapper .embed-header span:hover{color:#983e50;font-weight:bold}.embed-wrapper .embed-header span.selected{color:#983e50;font-weight:bold}.embed-wrapper .embed-header a{float:right;margin-right:10px;color:#c49989;text-decoration:none;font-size:10px;}.embed-wrapper .embed-header a:hover{color:#983e50}.embed-wrapper .embed-header a.selected{color:#983e50}.embed-wrapper .embed-content{position:relative;top:30px;height:260px;overflow:auto;}.embed-wrapper .embed-content .fiddle{display:block;height:215px;margin-left:10px;margin-top:10px}.embed-wrapper .embed-content .result-wrapper{display:none;}.embed-wrapper .embed-content .result-wrapper .result{width:100%;height:100%;border:none} 4 | body,html{margin:0;padding:0 0 10px 0;min-width:600px}.CodeMirror{height:100%}.CodeMirror-scroll{overflow-y:hidden;overflow-x:auto} 5 | .header{width:100%;height:100px;background:#595352;color:#fefefe}.header > h1{margin:0;padding:15px 0 0 45px;font-family:'verdana','lato';font-weight:100}.header > p{margin:0;padding:0 0 10px 45px;font-family:'verdana','lato';font-weight:100} -------------------------------------------------------------------------------- /src/es6-fiddle.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | var fiddle = null, 3 | runBtn = document.querySelector('.run'), 4 | lintBtn = document.querySelector('.lint'), 5 | saveBtn = document.querySelector('.save'), 6 | iDoc = document.querySelector('.result').contentDocument, 7 | iHead = iDoc.getElementsByTagName('head')[0], 8 | babel = document.createElement('script'), 9 | lodash = document.createElement('script'), 10 | babelPolyfill = document.createElement('script'), 11 | q = document.createElement('script'), 12 | logger = document.createElement('script'), 13 | style = document.createElement('style'), 14 | lintLog = null, 15 | userInput = null, 16 | pathArr = location.pathname.split('/'), 17 | fiddleId = pathArr[pathArr.length - 2], 18 | embedded = pathArr[1] === 'embed', 19 | bootstrap = null; 20 | 21 | //set the global examples object 22 | window.lodashExample = {}; 23 | window.exampleSelector = document.querySelector('.examples'); 24 | window.embedded = embedded; 25 | 26 | //check to see if the share button should be shown 27 | if (fiddleId && !embedded) { 28 | var share = document.querySelector('.share'), 29 | src = document.location.protocol + '//' + document.location.host + '/embed/' + fiddleId + '/', 30 | iframe = ''; 31 | 32 | if (share) { 33 | var embed = share.querySelector('#share-embed'), 34 | link = share.querySelector('#share-link'); 35 | 36 | share.style.display = 'inline-block'; 37 | link.value = document.location.href; 38 | embed.value = iframe; 39 | link.onclick = link.select; 40 | embed.onclick = embed.select; 41 | } 42 | } 43 | 44 | //handle the embedded buttons 45 | if (embedded) { 46 | var es6Btn = document.querySelector('.es6-click-btn'), 47 | consoleBtn = document.querySelector('.console-click-btn'), 48 | editLink = document.querySelector('.edit-at-es6'); 49 | 50 | editLink.href = document.location.href.replace('/embed', ''); 51 | 52 | es6Btn.onclick = function() { 53 | document.querySelector('.fiddle').style.display = 'block'; 54 | document.querySelector('.result-wrapper').style.display = 'none'; 55 | es6Btn.className += ' selected'; 56 | consoleBtn.className = consoleBtn.className.replace(' selected', ''); 57 | }; 58 | 59 | consoleBtn.onclick = function() { 60 | document.querySelector('.fiddle').style.display = 'none'; 61 | document.querySelector('.result-wrapper').style.display = 'block'; 62 | es6Btn.className = es6Btn.className.replace(' selected', ''); 63 | consoleBtn.className += ' selected'; 64 | }; 65 | 66 | } 67 | 68 | //add the fiddle area 69 | fiddle = window.CodeMirror(document.querySelector('.fiddle'), { 70 | lineNumbers: !embedded, 71 | readOnly: embedded ? 'nocursor' : false 72 | }); 73 | fiddle.focus(); 74 | 75 | //add the logger script to the iframe 76 | logger.innerHTML = 77 | 'window.console.log = (function() {\n' + 78 | '\tvar escaped = {"&": "&", "<": "<", ">": ">", "\\\"": """, "\'": "'", "/": "/"};\n' + 79 | '\tvar escapeHTML = function(str) {\n' + 80 | '\t\treturn String(str).replace(/[&<>"\'\/]/g, function (s) {\n' + 81 | '\t\t\t\treturn escaped[s];\n' + 82 | '\t\t});\n' + 83 | '\t};' + 84 | '\tvar log = console.log;\n' + 85 | '\treturn function() {\n' + 86 | '\t\tlog.apply(window.console, arguments);\n' + 87 | '\t\tdocument.body.innerHTML +=\n' + 88 | '\t\t\t"
" + \n' + 89 | '\t\t\t\tescapeHTML(Array.prototype.slice.call(arguments).join(" ")) + \n' + 90 | '\t\t\t"
";\n' + 91 | '\t};\n' + 92 | '})();\n\n' + 93 | 'window.console.error = (function() {\n' + 94 | '\tvar err = console.error;\n' + 95 | '\treturn function() {\n' + 96 | '\t\terr.apply(window.console, arguments);\n' + 97 | '\t\tdocument.body.innerHTML +=\n' + 98 | '\t\t\t"
" + \n' + 99 | '\t\t\t\tArray.prototype.slice.call(arguments).join(" ") + \n' + 100 | '\t\t"
";\n' + 101 | '\t};\n' + 102 | '})();\n\n'; 103 | iHead.appendChild(logger); 104 | 105 | //set the iDoc css 106 | style.innerHTML = 107 | 'body{font-family:monospace;padding:10px;color:#666}\n' + 108 | 'div{border-bottom:1px solid #eee;padding: 2px 0;}'; 109 | iHead.appendChild(style); 110 | 111 | //wait for babel to load 112 | babel.onload = function() { 113 | var loadReq = new XMLHttpRequest(), 114 | loadResp, 115 | runFiddle = function() { 116 | if (userInput) { //clean up the old code 117 | iHead.removeChild(userInput); 118 | } 119 | if (bootstrap) { //clean up the old code 120 | iHead.removeChild(bootstrap); 121 | } 122 | 123 | //create new script elements for the bootstrap and user input 124 | userInput = document.createElement('script'); 125 | bootstrap = document.createElement('script'); 126 | 127 | //user input needs to be a 'text/babel' script for babel 128 | userInput.setAttribute('type', 'text/babel'); 129 | userInput.className = 'babel-text'; 130 | 131 | //set the new script code 132 | userInput.innerHTML = fiddle.getValue(); 133 | bootstrap.innerHTML = ( 134 | 'document.body.innerHTML = \'\';\n' + 135 | 'babel.run(document.querySelector(".babel-text").innerHTML);\n' 136 | ); 137 | 138 | //append the new scripts 139 | iHead.appendChild(userInput); 140 | iHead.appendChild(bootstrap); 141 | }; 142 | 143 | if (fiddleId) { //load up the saved code 144 | loadReq.open('GET', '/fiddles/' + fiddleId, true); 145 | loadReq.send(); 146 | loadReq.onload = function() { 147 | if (this.status >= 200 && this.status < 400) { 148 | loadResp = JSON.parse(this.response); 149 | if (loadResp.value) { 150 | fiddle.setValue(loadResp.value); 151 | } else { 152 | fiddle.setValue('\/* Sorry, but I could not load your code right now. *\/'); 153 | } 154 | } 155 | 156 | if (embedded) { //go ahead and run the code 157 | runFiddle(); 158 | } 159 | }; 160 | } 161 | 162 | if (!embedded) { 163 | 164 | //run the input 165 | runBtn.onclick = runFiddle; 166 | 167 | //lint the result 168 | lintBtn.onclick = function() { 169 | var lint = window.JSHINT(fiddle.getValue(), { 170 | esnext: true, 171 | devel: true, 172 | browser: true 173 | }); 174 | 175 | //clean up the old lint log script 176 | if (lintLog) { 177 | iHead.removeChild(lintLog); 178 | } 179 | 180 | //make a new lint log script 181 | lintLog = document.createElement('script'); 182 | lintLog.innerHTML = 'document.body.innerHTML = \'\';\n'; 183 | 184 | //remove the line error class from all lines 185 | fiddle.eachLine(function(line) { 186 | fiddle.removeLineClass(line, 'background', 'line-error'); 187 | }); 188 | 189 | if (!lint) { 190 | window.JSHINT.errors.forEach(function(err) { 191 | fiddle.addLineClass(err.line - 1, 'background', 'line-error'); 192 | lintLog.innerHTML += 193 | 'console.log(\'Line \' + ' + 194 | err.line + 195 | ' + \':\', \'' + 196 | err.reason.replace(/'/g, '\\\'') + '\')\n'; 197 | }); 198 | } else { 199 | lintLog.innerHTML += 'console.log(\'Your code is lint free!\');'; 200 | } 201 | 202 | iHead.appendChild(lintLog); 203 | }; 204 | 205 | //save the code 206 | saveBtn.onclick = function() { 207 | var code = fiddle.getValue(), 208 | saveReq = new XMLHttpRequest(), 209 | resp; 210 | 211 | if (code) { 212 | saveReq.open('POST', '/save', true); 213 | saveReq.setRequestHeader('Content-type','application/json'); 214 | saveReq.onload = function() { 215 | if (this.status >= 200 && this.status < 400) { 216 | resp = JSON.parse(this.response); 217 | window.location.href = '/' + resp.fiddle + '/'; 218 | } 219 | }; 220 | saveReq.send(JSON.stringify({ 221 | value: fiddle.getValue() 222 | })); 223 | } 224 | }; 225 | 226 | //load the selected code 227 | window.exampleSelector.onchange = function() { 228 | if (window.exampleSelector.value) { 229 | fiddle.setValue(window.lodashExample[window.exampleSelector.value].code); 230 | } 231 | }; 232 | } 233 | }; 234 | 235 | //add babel to the iframe 236 | babelPolyfill.src = '/lib/babel/babel-polyfill.js'; 237 | babel.src = '/lib/babel/babel.js'; 238 | lodash.src = '/lib/lodash/lodash.min.js'; 239 | q.src = '/lib/q/q.min.js'; 240 | iHead.appendChild(babelPolyfill); 241 | iHead.appendChild(babel); 242 | iHead.appendChild(lodash); 243 | iHead.appendChild(q); 244 | })(); 245 | -------------------------------------------------------------------------------- /static/lib/q/q.min.js: -------------------------------------------------------------------------------- 1 | !function(t){"use strict";if("function"==typeof bootstrap)bootstrap("promise",t);else if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define(t);else if("undefined"!=typeof ses){if(!ses.ok())return;ses.makeQ=t}else{if("undefined"==typeof window&&"undefined"==typeof self)throw new Error("This environment was not anticipated by Q. Please file a bug.");var n="undefined"!=typeof window?window:self,e=n.Q;n.Q=t(),n.Q.noConflict=function(){return n.Q=e,this}}}(function(){"use strict";function t(t){return function(){return K.apply(t,arguments)}}function n(t){return t===Object(t)}function e(t){return"[object StopIteration]"===en(t)||t instanceof _}function r(t,n){if(V&&n.stack&&"object"==typeof t&&null!==t&&t.stack&&-1===t.stack.indexOf(rn)){for(var e=[],r=n;r;r=r.source)r.stack&&e.unshift(r.stack);e.unshift(t.stack);var i=e.join("\n"+rn+"\n");t.stack=o(i)}}function o(t){for(var n=t.split("\n"),e=[],r=0;r=q&&fn>=r}function s(){if(V)try{throw new Error}catch(t){var n=t.stack.split("\n"),e=n[0].indexOf("@")>0?n[1]:n[2],r=u(e);if(!r)return;return H=r[0],r[1]}}function f(t,n,e){return function(){return"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(n+" is deprecated, use "+e+" instead.",new Error("").stack),t.apply(t,arguments)}}function p(t){return t instanceof h?t:g(t)?O(t):E(t)}function a(){function t(t){n=t,i.source=t,W(e,function(n,e){p.nextTick(function(){t.promiseDispatch.apply(t,e)})},void 0),e=void 0,r=void 0}var n,e=[],r=[],o=Z(a.prototype),i=Z(h.prototype);if(i.promiseDispatch=function(t,o,i){var u=L(arguments);e?(e.push(u),"when"===o&&i[1]&&r.push(i[1])):p.nextTick(function(){n.promiseDispatch.apply(n,u)})},i.valueOf=function(){if(e)return i;var t=v(n);return m(t)&&(n=t),t},i.inspect=function(){return n?n.inspect():{state:"pending"}},p.longStackSupport&&V)try{throw new Error}catch(u){i.stack=u.stack.substring(u.stack.indexOf("\n")+1)}return o.promise=i,o.resolve=function(e){n||t(p(e))},o.fulfill=function(e){n||t(E(e))},o.reject=function(e){n||t(R(e))},o.notify=function(t){n||W(r,function(n,e){p.nextTick(function(){e(t)})},void 0)},o}function l(t){if("function"!=typeof t)throw new TypeError("resolver must be a function.");var n=a();try{t(n.resolve,n.reject,n.notify)}catch(e){n.reject(e)}return n.promise}function d(t){return l(function(n,e){for(var r=0,o=t.length;o>r;r++)p(t[r]).then(n,e)})}function h(t,n,e){void 0===n&&(n=function(t){return R(new Error("Promise does not support operation: "+t))}),void 0===e&&(e=function(){return{state:"unknown"}});var r=Z(h.prototype);if(r.promiseDispatch=function(e,o,i){var u;try{u=t[o]?t[o].apply(r,i):n.call(r,o,i)}catch(c){u=R(c)}e&&e(u)},r.inspect=e,e){var o=e();"rejected"===o.state&&(r.exception=o.reason),r.valueOf=function(){var t=e();return"pending"===t.state||"rejected"===t.state?r:t.value}}return r}function y(t,n,e,r){return p(t).then(n,e,r)}function v(t){if(m(t)){var n=t.inspect();if("fulfilled"===n.state)return n.value}return t}function m(t){return t instanceof h}function g(t){return n(t)&&"function"==typeof t.then}function k(t){return m(t)&&"pending"===t.inspect().state}function j(t){return!m(t)||"fulfilled"===t.inspect().state}function w(t){return m(t)&&"rejected"===t.inspect().state}function b(){on.length=0,un.length=0,sn||(sn=!0)}function x(t,n){sn&&("object"==typeof process&&"function"==typeof process.emit&&p.nextTick.runAfter(function(){-1!==X(un,t)&&(process.emit("unhandledRejection",n,t),cn.push(t))}),un.push(t),on.push(n&&"undefined"!=typeof n.stack?n.stack:"(no stack) "+n))}function T(t){if(sn){var n=X(un,t);-1!==n&&("object"==typeof process&&"function"==typeof process.emit&&p.nextTick.runAfter(function(){var e=X(cn,t);-1!==e&&(process.emit("rejectionHandled",on[n],t),cn.splice(e,1))}),un.splice(n,1),on.splice(n,1))}}function R(t){var n=h({when:function(n){return n&&T(this),n?n(t):this}},function(){return this},function(){return{state:"rejected",reason:t}});return x(n,t),n}function E(t){return h({when:function(){return t},get:function(n){return t[n]},set:function(n,e){t[n]=e},"delete":function(n){delete t[n]},post:function(n,e){return null===n||void 0===n?t.apply(void 0,e):t[n].apply(t,e)},apply:function(n,e){return t.apply(n,e)},keys:function(){return nn(t)}},void 0,function(){return{state:"fulfilled",value:t}})}function O(t){var n=a();return p.nextTick(function(){try{t.then(n.resolve,n.reject,n.notify)}catch(e){n.reject(e)}}),n.promise}function S(t){return h({isDef:function(){}},function(n,e){return A(t,n,e)},function(){return p(t).inspect()})}function N(t,n,e){return p(t).spread(n,e)}function D(t){return function(){function n(t,n){var u;if("undefined"==typeof StopIteration){try{u=r[t](n)}catch(c){return R(c)}return u.done?p(u.value):y(u.value,o,i)}try{u=r[t](n)}catch(c){return e(c)?p(c.value):R(c)}return y(u,o,i)}var r=t.apply(this,arguments),o=n.bind(n,"next"),i=n.bind(n,"throw");return o()}}function P(t){p.done(p.async(t)())}function C(t){throw new _(t)}function Q(t){return function(){return N([this,I(arguments)],function(n,e){return t.apply(n,e)})}}function A(t,n,e){return p(t).dispatch(n,e)}function I(t){return y(t,function(t){var n=0,e=a();return W(t,function(r,o,i){var u;m(o)&&"fulfilled"===(u=o.inspect()).state?t[i]=u.value:(++n,y(o,function(r){t[i]=r,0===--n&&e.resolve(t)},e.reject,function(t){e.notify({index:i,value:t})}))},void 0),0===n&&e.resolve(t),e.promise})}function U(t){if(0===t.length)return p.resolve();var n=p.defer(),e=0;return W(t,function(r,o,i){function u(t){n.resolve(t)}function c(){e--,0===e&&n.reject(new Error("Can't get fulfillment value from any promise, all promises were rejected."))}function s(t){n.notify({index:i,value:t})}var f=t[i];e++,y(f,u,c,s)},void 0),n.promise}function F(t){return y(t,function(t){return t=Y(t,p),y(I(Y(t,function(t){return y(t,z,z)})),function(){return t})})}function M(t){return p(t).allSettled()}function B(t,n){return p(t).then(void 0,void 0,n)}function $(t,n){return p(t).nodeify(n)}var V=!1;try{throw new Error}catch(G){V=!!G.stack}var H,_,q=s(),z=function(){},J=function(){function t(){for(var t,r;e.next;)e=e.next,t=e.task,e.task=void 0,r=e.domain,r&&(e.domain=void 0,r.enter()),n(t,r);for(;c.length;)t=c.pop(),n(t);o=!1}function n(n,e){try{n()}catch(r){if(u)throw e&&e.exit(),setTimeout(t,0),e&&e.enter(),r;setTimeout(function(){throw r},0)}e&&e.exit()}var e={task:void 0,next:null},r=e,o=!1,i=void 0,u=!1,c=[];if(J=function(t){r=r.next={task:t,domain:u&&process.domain,next:null},o||(o=!0,i())},"object"==typeof process&&"[object process]"===process.toString()&&process.nextTick)u=!0,i=function(){process.nextTick(t)};else if("function"==typeof setImmediate)i="undefined"!=typeof window?setImmediate.bind(window,t):function(){setImmediate(t)};else if("undefined"!=typeof MessageChannel){var s=new MessageChannel;s.port1.onmessage=function(){i=f,s.port1.onmessage=t,t()};var f=function(){s.port2.postMessage(0)};i=function(){setTimeout(t,0),f()}}else i=function(){setTimeout(t,0)};return J.runAfter=function(t){c.push(t),o||(o=!0,i())},J}(),K=Function.call,L=t(Array.prototype.slice),W=t(Array.prototype.reduce||function(t,n){var e=0,r=this.length;if(1===arguments.length)for(;;){if(e in this){n=this[e++];break}if(++e>=r)throw new TypeError}for(;r>e;e++)e in this&&(n=t(n,this[e],e));return n}),X=t(Array.prototype.indexOf||function(t){for(var n=0;n2?L(arguments,1):e)}},p.Promise=l,p.promise=l,l.race=d,l.all=I,l.reject=R,l.resolve=p,p.passByCopy=function(t){return t},h.prototype.passByCopy=function(){return this},p.join=function(t,n){return p(t).join(n)},h.prototype.join=function(t){return p([this,t]).spread(function(t,n){if(t===n)return t;throw new Error("Can't join: not the same: "+t+" "+n)})},p.race=d,h.prototype.race=function(){return this.then(p.race)},p.makePromise=h,h.prototype.toString=function(){return"[object Promise]"},h.prototype.then=function(t,n,e){function o(n){try{return"function"==typeof t?t(n):n}catch(e){return R(e)}}function i(t){if("function"==typeof n){r(t,c);try{return n(t)}catch(e){return R(e)}}return R(t)}function u(t){return"function"==typeof e?e(t):t}var c=this,s=a(),f=!1;return p.nextTick(function(){c.promiseDispatch(function(t){f||(f=!0,s.resolve(o(t)))},"when",[function(t){f||(f=!0,s.resolve(i(t)))}])}),c.promiseDispatch(void 0,"when",[void 0,function(t){var n,e=!1;try{n=u(t)}catch(r){if(e=!0,!p.onerror)throw r;p.onerror(r)}e||s.notify(n)}]),s.promise},p.tap=function(t,n){return p(t).tap(n)},h.prototype.tap=function(t){return t=p(t),this.then(function(n){return t.fcall(n).thenResolve(n)})},p.when=y,h.prototype.thenResolve=function(t){return this.then(function(){return t})},p.thenResolve=function(t,n){return p(t).thenResolve(n)},h.prototype.thenReject=function(t){return this.then(function(){throw t})},p.thenReject=function(t,n){return p(t).thenReject(n)},p.nearer=v,p.isPromise=m,p.isPromiseAlike=g,p.isPending=k,h.prototype.isPending=function(){return"pending"===this.inspect().state},p.isFulfilled=j,h.prototype.isFulfilled=function(){return"fulfilled"===this.inspect().state},p.isRejected=w,h.prototype.isRejected=function(){return"rejected"===this.inspect().state};var on=[],un=[],cn=[],sn=!0;p.resetUnhandledRejections=b,p.getUnhandledReasons=function(){return on.slice()},p.stopUnhandledRejectionTracking=function(){b(),sn=!1},b(),p.reject=R,p.fulfill=E,p.master=S,p.spread=N,h.prototype.spread=function(t,n){return this.all().then(function(n){return t.apply(void 0,n)},n)},p.async=D,p.spawn=P,p["return"]=C,p.promised=Q,p.dispatch=A,h.prototype.dispatch=function(t,n){var e=this,r=a();return p.nextTick(function(){e.promiseDispatch(r.resolve,t,n)}),r.promise},p.get=function(t,n){return p(t).dispatch("get",[n])},h.prototype.get=function(t){return this.dispatch("get",[t])},p.set=function(t,n,e){return p(t).dispatch("set",[n,e])},h.prototype.set=function(t,n){return this.dispatch("set",[t,n])},p.del=p["delete"]=function(t,n){return p(t).dispatch("delete",[n])},h.prototype.del=h.prototype["delete"]=function(t){return this.dispatch("delete",[t])},p.mapply=p.post=function(t,n,e){return p(t).dispatch("post",[n,e])},h.prototype.mapply=h.prototype.post=function(t,n){return this.dispatch("post",[t,n])},p.send=p.mcall=p.invoke=function(t,n){return p(t).dispatch("post",[n,L(arguments,2)])},h.prototype.send=h.prototype.mcall=h.prototype.invoke=function(t){return this.dispatch("post",[t,L(arguments,1)])},p.fapply=function(t,n){return p(t).dispatch("apply",[void 0,n])},h.prototype.fapply=function(t){return this.dispatch("apply",[void 0,t])},p["try"]=p.fcall=function(t){return p(t).dispatch("apply",[void 0,L(arguments,1)])},h.prototype.fcall=function(){return this.dispatch("apply",[void 0,L(arguments)])},p.fbind=function(t){var n=p(t),e=L(arguments,1);return function(){return n.dispatch("apply",[this,e.concat(L(arguments))])}},h.prototype.fbind=function(){var t=this,n=L(arguments);return function(){return t.dispatch("apply",[this,n.concat(L(arguments))])}},p.keys=function(t){return p(t).dispatch("keys",[])},h.prototype.keys=function(){return this.dispatch("keys",[])},p.all=I,h.prototype.all=function(){return I(this)},p.any=U,h.prototype.any=function(){return U(this)},p.allResolved=f(F,"allResolved","allSettled"),h.prototype.allResolved=function(){return F(this)},p.allSettled=M,h.prototype.allSettled=function(){return this.then(function(t){return I(Y(t,function(t){function n(){return t.inspect()}return t=p(t),t.then(n,n)}))})},p.fail=p["catch"]=function(t,n){return p(t).then(void 0,n)},h.prototype.fail=h.prototype["catch"]=function(t){return this.then(void 0,t)},p.progress=B,h.prototype.progress=function(t){return this.then(void 0,void 0,t)},p.fin=p["finally"]=function(t,n){return p(t)["finally"](n)},h.prototype.fin=h.prototype["finally"]=function(t){return t=p(t),this.then(function(n){return t.fcall().then(function(){return n})},function(n){return t.fcall().then(function(){throw n})})},p.done=function(t,n,e,r){return p(t).done(n,e,r)},h.prototype.done=function(t,n,e){var o=function(t){p.nextTick(function(){if(r(t,i),!p.onerror)throw t;p.onerror(t)})},i=t||n||e?this.then(t,n,e):this;"object"==typeof process&&process&&process.domain&&(o=process.domain.bind(o)),i.then(void 0,o)},p.timeout=function(t,n,e){return p(t).timeout(n,e)},h.prototype.timeout=function(t,n){var e=a(),r=setTimeout(function(){n&&"string"!=typeof n||(n=new Error(n||"Timed out after "+t+" ms"),n.code="ETIMEDOUT"),e.reject(n)},t);return this.then(function(t){clearTimeout(r),e.resolve(t)},function(t){clearTimeout(r),e.reject(t)},e.notify),e.promise},p.delay=function(t,n){return void 0===n&&(n=t,t=void 0),p(t).delay(n)},h.prototype.delay=function(t){return this.then(function(n){var e=a();return setTimeout(function(){e.resolve(n)},t),e.promise})},p.nfapply=function(t,n){return p(t).nfapply(n)},h.prototype.nfapply=function(t){var n=a(),e=L(t);return e.push(n.makeNodeResolver()),this.fapply(e).fail(n.reject),n.promise},p.nfcall=function(t){var n=L(arguments,1);return p(t).nfapply(n)},h.prototype.nfcall=function(){var t=L(arguments),n=a();return t.push(n.makeNodeResolver()),this.fapply(t).fail(n.reject),n.promise},p.nfbind=p.denodeify=function(t){var n=L(arguments,1);return function(){var e=n.concat(L(arguments)),r=a();return e.push(r.makeNodeResolver()),p(t).fapply(e).fail(r.reject),r.promise}},h.prototype.nfbind=h.prototype.denodeify=function(){var t=L(arguments);return t.unshift(this),p.denodeify.apply(void 0,t)},p.nbind=function(t,n){var e=L(arguments,2);return function(){function r(){return t.apply(n,arguments)}var o=e.concat(L(arguments)),i=a();return o.push(i.makeNodeResolver()),p(r).fapply(o).fail(i.reject),i.promise}},h.prototype.nbind=function(){var t=L(arguments,0);return t.unshift(this),p.nbind.apply(void 0,t)},p.nmapply=p.npost=function(t,n,e){return p(t).npost(n,e)},h.prototype.nmapply=h.prototype.npost=function(t,n){var e=L(n||[]),r=a();return e.push(r.makeNodeResolver()),this.dispatch("post",[t,e]).fail(r.reject),r.promise},p.nsend=p.nmcall=p.ninvoke=function(t,n){var e=L(arguments,2),r=a();return e.push(r.makeNodeResolver()),p(t).dispatch("post",[n,e]).fail(r.reject),r.promise},h.prototype.nsend=h.prototype.nmcall=h.prototype.ninvoke=function(t){var n=L(arguments,1),e=a();return n.push(e.makeNodeResolver()),this.dispatch("post",[t,n]).fail(e.reject),e.promise},p.nodeify=$,h.prototype.nodeify=function(t){return t?void this.then(function(n){p.nextTick(function(){t(null,n)})},function(n){p.nextTick(function(){t(n)})}):this},p.noConflict=function(){throw new Error("Q.noConflict only works when Q is used as a global")};var fn=s();return p}); -------------------------------------------------------------------------------- /static/src/underscore.min.js: -------------------------------------------------------------------------------- 1 | // Underscore.js 1.8.3 2 | // http://underscorejs.org 3 | // (c) 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors 4 | // Underscore may be freely distributed under the MIT license. 5 | (function(){function n(n){function t(t,r,e,u,i,o){for(;i>=0&&o>i;i+=n){var a=u?u[i]:i;e=r(e,t[a],a,t)}return e}return function(r,e,u,i){e=b(e,i,4);var o=!k(r)&&m.keys(r),a=(o||r).length,c=n>0?0:a-1;return arguments.length<3&&(u=r[o?o[c]:c],c+=n),t(r,e,u,o,c,a)}}function t(n){return function(t,r,e){r=x(r,e);for(var u=O(t),i=n>0?0:u-1;i>=0&&u>i;i+=n)if(r(t[i],i,t))return i;return-1}}function r(n,t,r){return function(e,u,i){var o=0,a=O(e);if("number"==typeof i)n>0?o=i>=0?i:Math.max(i+a,o):a=i>=0?Math.min(i+1,a):i+a+1;else if(r&&i&&a)return i=r(e,u),e[i]===u?i:-1;if(u!==u)return i=t(l.call(e,o,a),m.isNaN),i>=0?i+o:-1;for(i=n>0?o:a-1;i>=0&&a>i;i+=n)if(e[i]===u)return i;return-1}}function e(n,t){var r=I.length,e=n.constructor,u=m.isFunction(e)&&e.prototype||a,i="constructor";for(m.has(n,i)&&!m.contains(t,i)&&t.push(i);r--;)i=I[r],i in n&&n[i]!==u[i]&&!m.contains(t,i)&&t.push(i)}var u=this,i=u._,o=Array.prototype,a=Object.prototype,c=Function.prototype,f=o.push,l=o.slice,s=a.toString,p=a.hasOwnProperty,h=Array.isArray,v=Object.keys,g=c.bind,y=Object.create,d=function(){},m=function(n){return n instanceof m?n:this instanceof m?void(this._wrapped=n):new m(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=m),exports._=m):u._=m,m.VERSION="1.8.3";var b=function(n,t,r){if(t===void 0)return n;switch(null==r?3:r){case 1:return function(r){return n.call(t,r)};case 2:return function(r,e){return n.call(t,r,e)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,i){return n.call(t,r,e,u,i)}}return function(){return n.apply(t,arguments)}},x=function(n,t,r){return null==n?m.identity:m.isFunction(n)?b(n,t,r):m.isObject(n)?m.matcher(n):m.property(n)};m.iteratee=function(n,t){return x(n,t,1/0)};var _=function(n,t){return function(r){var e=arguments.length;if(2>e||null==r)return r;for(var u=1;e>u;u++)for(var i=arguments[u],o=n(i),a=o.length,c=0;a>c;c++){var f=o[c];t&&r[f]!==void 0||(r[f]=i[f])}return r}},j=function(n){if(!m.isObject(n))return{};if(y)return y(n);d.prototype=n;var t=new d;return d.prototype=null,t},w=function(n){return function(t){return null==t?void 0:t[n]}},A=Math.pow(2,53)-1,O=w("length"),k=function(n){var t=O(n);return"number"==typeof t&&t>=0&&A>=t};m.each=m.forEach=function(n,t,r){t=b(t,r);var e,u;if(k(n))for(e=0,u=n.length;u>e;e++)t(n[e],e,n);else{var i=m.keys(n);for(e=0,u=i.length;u>e;e++)t(n[i[e]],i[e],n)}return n},m.map=m.collect=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=Array(u),o=0;u>o;o++){var a=e?e[o]:o;i[o]=t(n[a],a,n)}return i},m.reduce=m.foldl=m.inject=n(1),m.reduceRight=m.foldr=n(-1),m.find=m.detect=function(n,t,r){var e;return e=k(n)?m.findIndex(n,t,r):m.findKey(n,t,r),e!==void 0&&e!==-1?n[e]:void 0},m.filter=m.select=function(n,t,r){var e=[];return t=x(t,r),m.each(n,function(n,r,u){t(n,r,u)&&e.push(n)}),e},m.reject=function(n,t,r){return m.filter(n,m.negate(x(t)),r)},m.every=m.all=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(!t(n[o],o,n))return!1}return!0},m.some=m.any=function(n,t,r){t=x(t,r);for(var e=!k(n)&&m.keys(n),u=(e||n).length,i=0;u>i;i++){var o=e?e[i]:i;if(t(n[o],o,n))return!0}return!1},m.contains=m.includes=m.include=function(n,t,r,e){return k(n)||(n=m.values(n)),("number"!=typeof r||e)&&(r=0),m.indexOf(n,t,r)>=0},m.invoke=function(n,t){var r=l.call(arguments,2),e=m.isFunction(t);return m.map(n,function(n){var u=e?t:n[t];return null==u?u:u.apply(n,r)})},m.pluck=function(n,t){return m.map(n,m.property(t))},m.where=function(n,t){return m.filter(n,m.matcher(t))},m.findWhere=function(n,t){return m.find(n,m.matcher(t))},m.max=function(n,t,r){var e,u,i=-1/0,o=-1/0;if(null==t&&null!=n){n=k(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],e>i&&(i=e)}else t=x(t,r),m.each(n,function(n,r,e){u=t(n,r,e),(u>o||u===-1/0&&i===-1/0)&&(i=n,o=u)});return i},m.min=function(n,t,r){var e,u,i=1/0,o=1/0;if(null==t&&null!=n){n=k(n)?n:m.values(n);for(var a=0,c=n.length;c>a;a++)e=n[a],i>e&&(i=e)}else t=x(t,r),m.each(n,function(n,r,e){u=t(n,r,e),(o>u||1/0===u&&1/0===i)&&(i=n,o=u)});return i},m.shuffle=function(n){for(var t,r=k(n)?n:m.values(n),e=r.length,u=Array(e),i=0;e>i;i++)t=m.random(0,i),t!==i&&(u[i]=u[t]),u[t]=r[i];return u},m.sample=function(n,t,r){return null==t||r?(k(n)||(n=m.values(n)),n[m.random(n.length-1)]):m.shuffle(n).slice(0,Math.max(0,t))},m.sortBy=function(n,t,r){return t=x(t,r),m.pluck(m.map(n,function(n,r,e){return{value:n,index:r,criteria:t(n,r,e)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var F=function(n){return function(t,r,e){var u={};return r=x(r,e),m.each(t,function(e,i){var o=r(e,i,t);n(u,e,o)}),u}};m.groupBy=F(function(n,t,r){m.has(n,r)?n[r].push(t):n[r]=[t]}),m.indexBy=F(function(n,t,r){n[r]=t}),m.countBy=F(function(n,t,r){m.has(n,r)?n[r]++:n[r]=1}),m.toArray=function(n){return n?m.isArray(n)?l.call(n):k(n)?m.map(n,m.identity):m.values(n):[]},m.size=function(n){return null==n?0:k(n)?n.length:m.keys(n).length},m.partition=function(n,t,r){t=x(t,r);var e=[],u=[];return m.each(n,function(n,r,i){(t(n,r,i)?e:u).push(n)}),[e,u]},m.first=m.head=m.take=function(n,t,r){return null==n?void 0:null==t||r?n[0]:m.initial(n,n.length-t)},m.initial=function(n,t,r){return l.call(n,0,Math.max(0,n.length-(null==t||r?1:t)))},m.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:m.rest(n,Math.max(0,n.length-t))},m.rest=m.tail=m.drop=function(n,t,r){return l.call(n,null==t||r?1:t)},m.compact=function(n){return m.filter(n,m.identity)};var S=function(n,t,r,e){for(var u=[],i=0,o=e||0,a=O(n);a>o;o++){var c=n[o];if(k(c)&&(m.isArray(c)||m.isArguments(c))){t||(c=S(c,t,r));var f=0,l=c.length;for(u.length+=l;l>f;)u[i++]=c[f++]}else r||(u[i++]=c)}return u};m.flatten=function(n,t){return S(n,t,!1)},m.without=function(n){return m.difference(n,l.call(arguments,1))},m.uniq=m.unique=function(n,t,r,e){m.isBoolean(t)||(e=r,r=t,t=!1),null!=r&&(r=x(r,e));for(var u=[],i=[],o=0,a=O(n);a>o;o++){var c=n[o],f=r?r(c,o,n):c;t?(o&&i===f||u.push(c),i=f):r?m.contains(i,f)||(i.push(f),u.push(c)):m.contains(u,c)||u.push(c)}return u},m.union=function(){return m.uniq(S(arguments,!0,!0))},m.intersection=function(n){for(var t=[],r=arguments.length,e=0,u=O(n);u>e;e++){var i=n[e];if(!m.contains(t,i)){for(var o=1;r>o&&m.contains(arguments[o],i);o++);o===r&&t.push(i)}}return t},m.difference=function(n){var t=S(arguments,!0,!0,1);return m.filter(n,function(n){return!m.contains(t,n)})},m.zip=function(){return m.unzip(arguments)},m.unzip=function(n){for(var t=n&&m.max(n,O).length||0,r=Array(t),e=0;t>e;e++)r[e]=m.pluck(n,e);return r},m.object=function(n,t){for(var r={},e=0,u=O(n);u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},m.findIndex=t(1),m.findLastIndex=t(-1),m.sortedIndex=function(n,t,r,e){r=x(r,e,1);for(var u=r(t),i=0,o=O(n);o>i;){var a=Math.floor((i+o)/2);r(n[a])i;i++,n+=r)u[i]=n;return u};var E=function(n,t,r,e,u){if(!(e instanceof t))return n.apply(r,u);var i=j(n.prototype),o=n.apply(i,u);return m.isObject(o)?o:i};m.bind=function(n,t){if(g&&n.bind===g)return g.apply(n,l.call(arguments,1));if(!m.isFunction(n))throw new TypeError("Bind must be called on a function");var r=l.call(arguments,2),e=function(){return E(n,e,t,this,r.concat(l.call(arguments)))};return e},m.partial=function(n){var t=l.call(arguments,1),r=function(){for(var e=0,u=t.length,i=Array(u),o=0;u>o;o++)i[o]=t[o]===m?arguments[e++]:t[o];for(;e=e)throw new Error("bindAll must be passed function names");for(t=1;e>t;t++)r=arguments[t],n[r]=m.bind(n[r],n);return n},m.memoize=function(n,t){var r=function(e){var u=r.cache,i=""+(t?t.apply(this,arguments):e);return m.has(u,i)||(u[i]=n.apply(this,arguments)),u[i]};return r.cache={},r},m.delay=function(n,t){var r=l.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},m.defer=m.partial(m.delay,m,1),m.throttle=function(n,t,r){var e,u,i,o=null,a=0;r||(r={});var c=function(){a=r.leading===!1?0:m.now(),o=null,i=n.apply(e,u),o||(e=u=null)};return function(){var f=m.now();a||r.leading!==!1||(a=f);var l=t-(f-a);return e=this,u=arguments,0>=l||l>t?(o&&(clearTimeout(o),o=null),a=f,i=n.apply(e,u),o||(e=u=null)):o||r.trailing===!1||(o=setTimeout(c,l)),i}},m.debounce=function(n,t,r){var e,u,i,o,a,c=function(){var f=m.now()-o;t>f&&f>=0?e=setTimeout(c,t-f):(e=null,r||(a=n.apply(i,u),e||(i=u=null)))};return function(){i=this,u=arguments,o=m.now();var f=r&&!e;return e||(e=setTimeout(c,t)),f&&(a=n.apply(i,u),i=u=null),a}},m.wrap=function(n,t){return m.partial(t,n)},m.negate=function(n){return function(){return!n.apply(this,arguments)}},m.compose=function(){var n=arguments,t=n.length-1;return function(){for(var r=t,e=n[t].apply(this,arguments);r--;)e=n[r].call(this,e);return e}},m.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},m.before=function(n,t){var r;return function(){return--n>0&&(r=t.apply(this,arguments)),1>=n&&(t=null),r}},m.once=m.partial(m.before,2);var M=!{toString:null}.propertyIsEnumerable("toString"),I=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];m.keys=function(n){if(!m.isObject(n))return[];if(v)return v(n);var t=[];for(var r in n)m.has(n,r)&&t.push(r);return M&&e(n,t),t},m.allKeys=function(n){if(!m.isObject(n))return[];var t=[];for(var r in n)t.push(r);return M&&e(n,t),t},m.values=function(n){for(var t=m.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},m.mapObject=function(n,t,r){t=x(t,r);for(var e,u=m.keys(n),i=u.length,o={},a=0;i>a;a++)e=u[a],o[e]=t(n[e],e,n);return o},m.pairs=function(n){for(var t=m.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},m.invert=function(n){for(var t={},r=m.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},m.functions=m.methods=function(n){var t=[];for(var r in n)m.isFunction(n[r])&&t.push(r);return t.sort()},m.extend=_(m.allKeys),m.extendOwn=m.assign=_(m.keys),m.findKey=function(n,t,r){t=x(t,r);for(var e,u=m.keys(n),i=0,o=u.length;o>i;i++)if(e=u[i],t(n[e],e,n))return e},m.pick=function(n,t,r){var e,u,i={},o=n;if(null==o)return i;m.isFunction(t)?(u=m.allKeys(o),e=b(t,r)):(u=S(arguments,!1,!1,1),e=function(n,t,r){return t in r},o=Object(o));for(var a=0,c=u.length;c>a;a++){var f=u[a],l=o[f];e(l,f,o)&&(i[f]=l)}return i},m.omit=function(n,t,r){if(m.isFunction(t))t=m.negate(t);else{var e=m.map(S(arguments,!1,!1,1),String);t=function(n,t){return!m.contains(e,t)}}return m.pick(n,t,r)},m.defaults=_(m.allKeys,!0),m.create=function(n,t){var r=j(n);return t&&m.extendOwn(r,t),r},m.clone=function(n){return m.isObject(n)?m.isArray(n)?n.slice():m.extend({},n):n},m.tap=function(n,t){return t(n),n},m.isMatch=function(n,t){var r=m.keys(t),e=r.length;if(null==n)return!e;for(var u=Object(n),i=0;e>i;i++){var o=r[i];if(t[o]!==u[o]||!(o in u))return!1}return!0};var N=function(n,t,r,e){if(n===t)return 0!==n||1/n===1/t;if(null==n||null==t)return n===t;n instanceof m&&(n=n._wrapped),t instanceof m&&(t=t._wrapped);var u=s.call(n);if(u!==s.call(t))return!1;switch(u){case"[object RegExp]":case"[object String]":return""+n==""+t;case"[object Number]":return+n!==+n?+t!==+t:0===+n?1/+n===1/t:+n===+t;case"[object Date]":case"[object Boolean]":return+n===+t}var i="[object Array]"===u;if(!i){if("object"!=typeof n||"object"!=typeof t)return!1;var o=n.constructor,a=t.constructor;if(o!==a&&!(m.isFunction(o)&&o instanceof o&&m.isFunction(a)&&a instanceof a)&&"constructor"in n&&"constructor"in t)return!1}r=r||[],e=e||[];for(var c=r.length;c--;)if(r[c]===n)return e[c]===t;if(r.push(n),e.push(t),i){if(c=n.length,c!==t.length)return!1;for(;c--;)if(!N(n[c],t[c],r,e))return!1}else{var f,l=m.keys(n);if(c=l.length,m.keys(t).length!==c)return!1;for(;c--;)if(f=l[c],!m.has(t,f)||!N(n[f],t[f],r,e))return!1}return r.pop(),e.pop(),!0};m.isEqual=function(n,t){return N(n,t)},m.isEmpty=function(n){return null==n?!0:k(n)&&(m.isArray(n)||m.isString(n)||m.isArguments(n))?0===n.length:0===m.keys(n).length},m.isElement=function(n){return!(!n||1!==n.nodeType)},m.isArray=h||function(n){return"[object Array]"===s.call(n)},m.isObject=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},m.each(["Arguments","Function","String","Number","Date","RegExp","Error"],function(n){m["is"+n]=function(t){return s.call(t)==="[object "+n+"]"}}),m.isArguments(arguments)||(m.isArguments=function(n){return m.has(n,"callee")}),"function"!=typeof/./&&"object"!=typeof Int8Array&&(m.isFunction=function(n){return"function"==typeof n||!1}),m.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},m.isNaN=function(n){return m.isNumber(n)&&n!==+n},m.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"===s.call(n)},m.isNull=function(n){return null===n},m.isUndefined=function(n){return n===void 0},m.has=function(n,t){return null!=n&&p.call(n,t)},m.noConflict=function(){return u._=i,this},m.identity=function(n){return n},m.constant=function(n){return function(){return n}},m.noop=function(){},m.property=w,m.propertyOf=function(n){return null==n?function(){}:function(t){return n[t]}},m.matcher=m.matches=function(n){return n=m.extendOwn({},n),function(t){return m.isMatch(t,n)}},m.times=function(n,t,r){var e=Array(Math.max(0,n));t=b(t,r,1);for(var u=0;n>u;u++)e[u]=t(u);return e},m.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},m.now=Date.now||function(){return(new Date).getTime()};var B={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},T=m.invert(B),R=function(n){var t=function(t){return n[t]},r="(?:"+m.keys(n).join("|")+")",e=RegExp(r),u=RegExp(r,"g");return function(n){return n=null==n?"":""+n,e.test(n)?n.replace(u,t):n}};m.escape=R(B),m.unescape=R(T),m.result=function(n,t,r){var e=null==n?void 0:n[t];return e===void 0&&(e=r),m.isFunction(e)?e.call(n):e};var q=0;m.uniqueId=function(n){var t=++q+"";return n?n+t:t},m.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var K=/(.)^/,z={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\u2028|\u2029/g,L=function(n){return"\\"+z[n]};m.template=function(n,t,r){!t&&r&&(t=r),t=m.defaults({},t,m.templateSettings);var e=RegExp([(t.escape||K).source,(t.interpolate||K).source,(t.evaluate||K).source].join("|")+"|$","g"),u=0,i="__p+='";n.replace(e,function(t,r,e,o,a){return i+=n.slice(u,a).replace(D,L),u=a+t.length,r?i+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":e?i+="'+\n((__t=("+e+"))==null?'':__t)+\n'":o&&(i+="';\n"+o+"\n__p+='"),t}),i+="';\n",t.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var o=new Function(t.variable||"obj","_",i)}catch(a){throw a.source=i,a}var c=function(n){return o.call(this,n,m)},f=t.variable||"obj";return c.source="function("+f+"){\n"+i+"}",c},m.chain=function(n){var t=m(n);return t._chain=!0,t};var P=function(n,t){return n._chain?m(t).chain():t};m.mixin=function(n){m.each(m.functions(n),function(t){var r=m[t]=n[t];m.prototype[t]=function(){var n=[this._wrapped];return f.apply(n,arguments),P(this,r.apply(m,n))}})},m.mixin(m),m.each(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=o[n];m.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!==n&&"splice"!==n||0!==r.length||delete r[0],P(this,r)}}),m.each(["concat","join","slice"],function(n){var t=o[n];m.prototype[n]=function(){return P(this,t.apply(this._wrapped,arguments))}}),m.prototype.value=function(){return this._wrapped},m.prototype.valueOf=m.prototype.toJSON=m.prototype.value,m.prototype.toString=function(){return""+this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return m})}).call(this); 6 | //# sourceMappingURL=underscore-min.map -------------------------------------------------------------------------------- /static/lib/codemirror/src/mode.js: -------------------------------------------------------------------------------- 1 | // CodeMirror, copyright (c) by Marijn Haverbeke and others 2 | // Distributed under an MIT license: http://codemirror.net/LICENSE 3 | 4 | // TODO actually recognize syntax of TypeScript constructs 5 | 6 | (function(mod) { 7 | if (typeof exports == "object" && typeof module == "object") // CommonJS 8 | mod(require("../../lib/codemirror")); 9 | else if (typeof define == "function" && define.amd) // AMD 10 | define(["../../lib/codemirror"], mod); 11 | else // Plain browser env 12 | mod(CodeMirror); 13 | })(function(CodeMirror) { 14 | "use strict"; 15 | 16 | CodeMirror.defineMode("javascript", function(config, parserConfig) { 17 | var indentUnit = config.indentUnit; 18 | var statementIndent = parserConfig.statementIndent; 19 | var jsonldMode = parserConfig.jsonld; 20 | var jsonMode = parserConfig.json || jsonldMode; 21 | var isTS = parserConfig.typescript; 22 | 23 | // Tokenizer 24 | 25 | var keywords = function(){ 26 | function kw(type) {return {type: type, style: "keyword"};} 27 | var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"); 28 | var operator = kw("operator"), atom = {type: "atom", style: "atom"}; 29 | 30 | var jsKeywords = { 31 | "if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B, 32 | "return": C, "break": C, "continue": C, "new": C, "delete": C, "throw": C, "debugger": C, 33 | "var": kw("var"), "const": kw("var"), "let": kw("var"), 34 | "function": kw("function"), "catch": kw("catch"), 35 | "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), 36 | "in": operator, "typeof": operator, "instanceof": operator, 37 | "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom, 38 | "this": kw("this"), "module": kw("module"), "class": kw("class"), "super": kw("atom"), 39 | "yield": C, "export": kw("export"), "import": kw("import"), "extends": C 40 | }; 41 | 42 | // Extend the 'normal' keywords with the TypeScript language extensions 43 | if (isTS) { 44 | var type = {type: "variable", style: "variable-3"}; 45 | var tsKeywords = { 46 | // object-like things 47 | "interface": kw("interface"), 48 | "extends": kw("extends"), 49 | "constructor": kw("constructor"), 50 | 51 | // scope modifiers 52 | "public": kw("public"), 53 | "private": kw("private"), 54 | "protected": kw("protected"), 55 | "static": kw("static"), 56 | 57 | // types 58 | "string": type, "number": type, "bool": type, "any": type 59 | }; 60 | 61 | for (var attr in tsKeywords) { 62 | jsKeywords[attr] = tsKeywords[attr]; 63 | } 64 | } 65 | 66 | return jsKeywords; 67 | }(); 68 | 69 | var isOperatorChar = /[+\-*&%=<>!?|~^]/; 70 | var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/; 71 | 72 | function readRegexp(stream) { 73 | var escaped = false, next, inSet = false; 74 | while ((next = stream.next()) != null) { 75 | if (!escaped) { 76 | if (next == "/" && !inSet) return; 77 | if (next == "[") inSet = true; 78 | else if (inSet && next == "]") inSet = false; 79 | } 80 | escaped = !escaped && next == "\\"; 81 | } 82 | } 83 | 84 | // Used as scratch variables to communicate multiple values without 85 | // consing up tons of objects. 86 | var type, content; 87 | function ret(tp, style, cont) { 88 | type = tp; content = cont; 89 | return style; 90 | } 91 | function tokenBase(stream, state) { 92 | var ch = stream.next(); 93 | if (ch == '"' || ch == "'") { 94 | state.tokenize = tokenString(ch); 95 | return state.tokenize(stream, state); 96 | } else if (ch == "." && stream.match(/^\d+(?:[eE][+\-]?\d+)?/)) { 97 | return ret("number", "number"); 98 | } else if (ch == "." && stream.match("..")) { 99 | return ret("spread", "meta"); 100 | } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) { 101 | return ret(ch); 102 | } else if (ch == "=" && stream.eat(">")) { 103 | return ret("=>", "operator"); 104 | } else if (ch == "0" && stream.eat(/x/i)) { 105 | stream.eatWhile(/[\da-f]/i); 106 | return ret("number", "number"); 107 | } else if (/\d/.test(ch)) { 108 | stream.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/); 109 | return ret("number", "number"); 110 | } else if (ch == "/") { 111 | if (stream.eat("*")) { 112 | state.tokenize = tokenComment; 113 | return tokenComment(stream, state); 114 | } else if (stream.eat("/")) { 115 | stream.skipToEnd(); 116 | return ret("comment", "comment"); 117 | } else if (state.lastType == "operator" || state.lastType == "keyword c" || 118 | state.lastType == "sof" || /^[\[{}\(,;:]$/.test(state.lastType)) { 119 | readRegexp(stream); 120 | stream.eatWhile(/[gimy]/); // 'y' is "sticky" option in Mozilla 121 | return ret("regexp", "string-2"); 122 | } else { 123 | stream.eatWhile(isOperatorChar); 124 | return ret("operator", "operator", stream.current()); 125 | } 126 | } else if (ch == "`") { 127 | state.tokenize = tokenQuasi; 128 | return tokenQuasi(stream, state); 129 | } else if (ch == "#") { 130 | stream.skipToEnd(); 131 | return ret("error", "error"); 132 | } else if (isOperatorChar.test(ch)) { 133 | stream.eatWhile(isOperatorChar); 134 | return ret("operator", "operator", stream.current()); 135 | } else { 136 | stream.eatWhile(/[\w\$_]/); 137 | var word = stream.current(), known = keywords.propertyIsEnumerable(word) && keywords[word]; 138 | return (known && state.lastType != ".") ? ret(known.type, known.style, word) : 139 | ret("variable", "variable", word); 140 | } 141 | } 142 | 143 | function tokenString(quote) { 144 | return function(stream, state) { 145 | var escaped = false, next; 146 | if (jsonldMode && stream.peek() == "@" && stream.match(isJsonldKeyword)){ 147 | state.tokenize = tokenBase; 148 | return ret("jsonld-keyword", "meta"); 149 | } 150 | while ((next = stream.next()) != null) { 151 | if (next == quote && !escaped) break; 152 | escaped = !escaped && next == "\\"; 153 | } 154 | if (!escaped) state.tokenize = tokenBase; 155 | return ret("string", "string"); 156 | }; 157 | } 158 | 159 | function tokenComment(stream, state) { 160 | var maybeEnd = false, ch; 161 | while (ch = stream.next()) { 162 | if (ch == "/" && maybeEnd) { 163 | state.tokenize = tokenBase; 164 | break; 165 | } 166 | maybeEnd = (ch == "*"); 167 | } 168 | return ret("comment", "comment"); 169 | } 170 | 171 | function tokenQuasi(stream, state) { 172 | var escaped = false, next; 173 | while ((next = stream.next()) != null) { 174 | if (!escaped && (next == "`" || next == "$" && stream.eat("{"))) { 175 | state.tokenize = tokenBase; 176 | break; 177 | } 178 | escaped = !escaped && next == "\\"; 179 | } 180 | return ret("quasi", "string-2", stream.current()); 181 | } 182 | 183 | var brackets = "([{}])"; 184 | // This is a crude lookahead trick to try and notice that we're 185 | // parsing the argument patterns for a fat-arrow function before we 186 | // actually hit the arrow token. It only works if the arrow is on 187 | // the same line as the arguments and there's no strange noise 188 | // (comments) in between. Fallback is to only notice when we hit the 189 | // arrow, and not declare the arguments as locals for the arrow 190 | // body. 191 | function findFatArrow(stream, state) { 192 | if (state.fatArrowAt) state.fatArrowAt = null; 193 | var arrow = stream.string.indexOf("=>", stream.start); 194 | if (arrow < 0) return; 195 | 196 | var depth = 0, sawSomething = false; 197 | for (var pos = arrow - 1; pos >= 0; --pos) { 198 | var ch = stream.string.charAt(pos); 199 | var bracket = brackets.indexOf(ch); 200 | if (bracket >= 0 && bracket < 3) { 201 | if (!depth) { ++pos; break; } 202 | if (--depth == 0) break; 203 | } else if (bracket >= 3 && bracket < 6) { 204 | ++depth; 205 | } else if (/[$\w]/.test(ch)) { 206 | sawSomething = true; 207 | } else if (sawSomething && !depth) { 208 | ++pos; 209 | break; 210 | } 211 | } 212 | if (sawSomething && !depth) state.fatArrowAt = pos; 213 | } 214 | 215 | // Parser 216 | 217 | var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true, "this": true, "jsonld-keyword": true}; 218 | 219 | function JSLexical(indented, column, type, align, prev, info) { 220 | this.indented = indented; 221 | this.column = column; 222 | this.type = type; 223 | this.prev = prev; 224 | this.info = info; 225 | if (align != null) this.align = align; 226 | } 227 | 228 | function inScope(state, varname) { 229 | for (var v = state.localVars; v; v = v.next) 230 | if (v.name == varname) return true; 231 | for (var cx = state.context; cx; cx = cx.prev) { 232 | for (var v = cx.vars; v; v = v.next) 233 | if (v.name == varname) return true; 234 | } 235 | } 236 | 237 | function parseJS(state, style, type, content, stream) { 238 | var cc = state.cc; 239 | // Communicate our context to the combinators. 240 | // (Less wasteful than consing up a hundred closures on every call.) 241 | cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style; 242 | 243 | if (!state.lexical.hasOwnProperty("align")) 244 | state.lexical.align = true; 245 | 246 | while(true) { 247 | var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement; 248 | if (combinator(type, content)) { 249 | while(cc.length && cc[cc.length - 1].lex) 250 | cc.pop()(); 251 | if (cx.marked) return cx.marked; 252 | if (type == "variable" && inScope(state, content)) return "variable-2"; 253 | return style; 254 | } 255 | } 256 | } 257 | 258 | // Combinator utils 259 | 260 | var cx = {state: null, column: null, marked: null, cc: null}; 261 | function pass() { 262 | for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]); 263 | } 264 | function cont() { 265 | pass.apply(null, arguments); 266 | return true; 267 | } 268 | function register(varname) { 269 | function inList(list) { 270 | for (var v = list; v; v = v.next) 271 | if (v.name == varname) return true; 272 | return false; 273 | } 274 | var state = cx.state; 275 | if (state.context) { 276 | cx.marked = "def"; 277 | if (inList(state.localVars)) return; 278 | state.localVars = {name: varname, next: state.localVars}; 279 | } else { 280 | if (inList(state.globalVars)) return; 281 | if (parserConfig.globalVars) 282 | state.globalVars = {name: varname, next: state.globalVars}; 283 | } 284 | } 285 | 286 | // Combinators 287 | 288 | var defaultVars = {name: "this", next: {name: "arguments"}}; 289 | function pushcontext() { 290 | cx.state.context = {prev: cx.state.context, vars: cx.state.localVars}; 291 | cx.state.localVars = defaultVars; 292 | } 293 | function popcontext() { 294 | cx.state.localVars = cx.state.context.vars; 295 | cx.state.context = cx.state.context.prev; 296 | } 297 | function pushlex(type, info) { 298 | var result = function() { 299 | var state = cx.state, indent = state.indented; 300 | if (state.lexical.type == "stat") indent = state.lexical.indented; 301 | state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info); 302 | }; 303 | result.lex = true; 304 | return result; 305 | } 306 | function poplex() { 307 | var state = cx.state; 308 | if (state.lexical.prev) { 309 | if (state.lexical.type == ")") 310 | state.indented = state.lexical.indented; 311 | state.lexical = state.lexical.prev; 312 | } 313 | } 314 | poplex.lex = true; 315 | 316 | function expect(wanted) { 317 | function exp(type) { 318 | if (type == wanted) return cont(); 319 | else if (wanted == ";") return pass(); 320 | else return cont(exp); 321 | }; 322 | return exp; 323 | } 324 | 325 | function statement(type, value) { 326 | if (type == "var") return cont(pushlex("vardef", value.length), vardef, expect(";"), poplex); 327 | if (type == "keyword a") return cont(pushlex("form"), expression, statement, poplex); 328 | if (type == "keyword b") return cont(pushlex("form"), statement, poplex); 329 | if (type == "{") return cont(pushlex("}"), block, poplex); 330 | if (type == ";") return cont(); 331 | if (type == "if") { 332 | if (cx.state.lexical.info == "else" && cx.state.cc[cx.state.cc.length - 1] == poplex) 333 | cx.state.cc.pop()(); 334 | return cont(pushlex("form"), expression, statement, poplex, maybeelse); 335 | } 336 | if (type == "function") return cont(functiondef); 337 | if (type == "for") return cont(pushlex("form"), forspec, statement, poplex); 338 | if (type == "variable") return cont(pushlex("stat"), maybelabel); 339 | if (type == "switch") return cont(pushlex("form"), expression, pushlex("}", "switch"), expect("{"), 340 | block, poplex, poplex); 341 | if (type == "case") return cont(expression, expect(":")); 342 | if (type == "default") return cont(expect(":")); 343 | if (type == "catch") return cont(pushlex("form"), pushcontext, expect("("), funarg, expect(")"), 344 | statement, poplex, popcontext); 345 | if (type == "module") return cont(pushlex("form"), pushcontext, afterModule, popcontext, poplex); 346 | if (type == "class") return cont(pushlex("form"), className, poplex); 347 | if (type == "export") return cont(pushlex("form"), afterExport, poplex); 348 | if (type == "import") return cont(pushlex("form"), afterImport, poplex); 349 | return pass(pushlex("stat"), expression, expect(";"), poplex); 350 | } 351 | function expression(type) { 352 | return expressionInner(type, false); 353 | } 354 | function expressionNoComma(type) { 355 | return expressionInner(type, true); 356 | } 357 | function expressionInner(type, noComma) { 358 | if (cx.state.fatArrowAt == cx.stream.start) { 359 | var body = noComma ? arrowBodyNoComma : arrowBody; 360 | if (type == "(") return cont(pushcontext, pushlex(")"), commasep(pattern, ")"), poplex, expect("=>"), body, popcontext); 361 | else if (type == "variable") return pass(pushcontext, pattern, expect("=>"), body, popcontext); 362 | } 363 | 364 | var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma; 365 | if (atomicTypes.hasOwnProperty(type)) return cont(maybeop); 366 | if (type == "function") return cont(functiondef, maybeop); 367 | if (type == "keyword c") return cont(noComma ? maybeexpressionNoComma : maybeexpression); 368 | if (type == "(") return cont(pushlex(")"), maybeexpression, comprehension, expect(")"), poplex, maybeop); 369 | if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression); 370 | if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop); 371 | if (type == "{") return contCommasep(objprop, "}", null, maybeop); 372 | if (type == "quasi") { return pass(quasi, maybeop); } 373 | return cont(); 374 | } 375 | function maybeexpression(type) { 376 | if (type.match(/[;\}\)\],]/)) return pass(); 377 | return pass(expression); 378 | } 379 | function maybeexpressionNoComma(type) { 380 | if (type.match(/[;\}\)\],]/)) return pass(); 381 | return pass(expressionNoComma); 382 | } 383 | 384 | function maybeoperatorComma(type, value) { 385 | if (type == ",") return cont(expression); 386 | return maybeoperatorNoComma(type, value, false); 387 | } 388 | function maybeoperatorNoComma(type, value, noComma) { 389 | var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma; 390 | var expr = noComma == false ? expression : expressionNoComma; 391 | if (value == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext); 392 | if (type == "operator") { 393 | if (/\+\+|--/.test(value)) return cont(me); 394 | if (value == "?") return cont(expression, expect(":"), expr); 395 | return cont(expr); 396 | } 397 | if (type == "quasi") { return pass(quasi, me); } 398 | if (type == ";") return; 399 | if (type == "(") return contCommasep(expressionNoComma, ")", "call", me); 400 | if (type == ".") return cont(property, me); 401 | if (type == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me); 402 | } 403 | function quasi(type, value) { 404 | if (type != "quasi") return pass(); 405 | if (value.slice(value.length - 2) != "${") return cont(quasi); 406 | return cont(expression, continueQuasi); 407 | } 408 | function continueQuasi(type) { 409 | if (type == "}") { 410 | cx.marked = "string-2"; 411 | cx.state.tokenize = tokenQuasi; 412 | return cont(quasi); 413 | } 414 | } 415 | function arrowBody(type) { 416 | findFatArrow(cx.stream, cx.state); 417 | if (type == "{") return pass(statement); 418 | return pass(expression); 419 | } 420 | function arrowBodyNoComma(type) { 421 | findFatArrow(cx.stream, cx.state); 422 | if (type == "{") return pass(statement); 423 | return pass(expressionNoComma); 424 | } 425 | function maybelabel(type) { 426 | if (type == ":") return cont(poplex, statement); 427 | return pass(maybeoperatorComma, expect(";"), poplex); 428 | } 429 | function property(type) { 430 | if (type == "variable") {cx.marked = "property"; return cont();} 431 | } 432 | function objprop(type, value) { 433 | if (type == "variable" || cx.style == "keyword") { 434 | cx.marked = "property"; 435 | if (value == "get" || value == "set") return cont(getterSetter); 436 | return cont(afterprop); 437 | } else if (type == "number" || type == "string") { 438 | cx.marked = jsonldMode ? "property" : (cx.style + " property"); 439 | return cont(afterprop); 440 | } else if (type == "jsonld-keyword") { 441 | return cont(afterprop); 442 | } else if (type == "[") { 443 | return cont(expression, expect("]"), afterprop); 444 | } 445 | } 446 | function getterSetter(type) { 447 | if (type != "variable") return pass(afterprop); 448 | cx.marked = "property"; 449 | return cont(functiondef); 450 | } 451 | function afterprop(type) { 452 | if (type == ":") return cont(expressionNoComma); 453 | if (type == "(") return pass(functiondef); 454 | } 455 | function commasep(what, end) { 456 | function proceed(type) { 457 | if (type == ",") { 458 | var lex = cx.state.lexical; 459 | if (lex.info == "call") lex.pos = (lex.pos || 0) + 1; 460 | return cont(what, proceed); 461 | } 462 | if (type == end) return cont(); 463 | return cont(expect(end)); 464 | } 465 | return function(type) { 466 | if (type == end) return cont(); 467 | return pass(what, proceed); 468 | }; 469 | } 470 | function contCommasep(what, end, info) { 471 | for (var i = 3; i < arguments.length; i++) 472 | cx.cc.push(arguments[i]); 473 | return cont(pushlex(end, info), commasep(what, end), poplex); 474 | } 475 | function block(type) { 476 | if (type == "}") return cont(); 477 | return pass(statement, block); 478 | } 479 | function maybetype(type) { 480 | if (isTS && type == ":") return cont(typedef); 481 | } 482 | function typedef(type) { 483 | if (type == "variable"){cx.marked = "variable-3"; return cont();} 484 | } 485 | function vardef() { 486 | return pass(pattern, maybetype, maybeAssign, vardefCont); 487 | } 488 | function pattern(type, value) { 489 | if (type == "variable") { register(value); return cont(); } 490 | if (type == "[") return contCommasep(pattern, "]"); 491 | if (type == "{") return contCommasep(proppattern, "}"); 492 | } 493 | function proppattern(type, value) { 494 | if (type == "variable" && !cx.stream.match(/^\s*:/, false)) { 495 | register(value); 496 | return cont(maybeAssign); 497 | } 498 | if (type == "variable") cx.marked = "property"; 499 | return cont(expect(":"), pattern, maybeAssign); 500 | } 501 | function maybeAssign(_type, value) { 502 | if (value == "=") return cont(expressionNoComma); 503 | } 504 | function vardefCont(type) { 505 | if (type == ",") return cont(vardef); 506 | } 507 | function maybeelse(type, value) { 508 | if (type == "keyword b" && value == "else") return cont(pushlex("form", "else"), statement, poplex); 509 | } 510 | function forspec(type) { 511 | if (type == "(") return cont(pushlex(")"), forspec1, expect(")"), poplex); 512 | } 513 | function forspec1(type) { 514 | if (type == "var") return cont(vardef, expect(";"), forspec2); 515 | if (type == ";") return cont(forspec2); 516 | if (type == "variable") return cont(formaybeinof); 517 | return pass(expression, expect(";"), forspec2); 518 | } 519 | function formaybeinof(_type, value) { 520 | if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); } 521 | return cont(maybeoperatorComma, forspec2); 522 | } 523 | function forspec2(type, value) { 524 | if (type == ";") return cont(forspec3); 525 | if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression); } 526 | return pass(expression, expect(";"), forspec3); 527 | } 528 | function forspec3(type) { 529 | if (type != ")") cont(expression); 530 | } 531 | function functiondef(type, value) { 532 | if (value == "*") {cx.marked = "keyword"; return cont(functiondef);} 533 | if (type == "variable") {register(value); return cont(functiondef);} 534 | if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, statement, popcontext); 535 | } 536 | function funarg(type) { 537 | if (type == "spread") return cont(funarg); 538 | return pass(pattern, maybetype); 539 | } 540 | function className(type, value) { 541 | if (type == "variable") {register(value); return cont(classNameAfter);} 542 | } 543 | function classNameAfter(type, value) { 544 | if (value == "extends") return cont(expression, classNameAfter); 545 | if (type == "{") return cont(pushlex("}"), classBody, poplex); 546 | } 547 | function classBody(type, value) { 548 | if (type == "variable" || cx.style == "keyword") { 549 | cx.marked = "property"; 550 | if (value == "get" || value == "set") return cont(classGetterSetter, functiondef, classBody); 551 | return cont(functiondef, classBody); 552 | } 553 | if (value == "*") { 554 | cx.marked = "keyword"; 555 | return cont(classBody); 556 | } 557 | if (type == ";") return cont(classBody); 558 | if (type == "}") return cont(); 559 | } 560 | function classGetterSetter(type) { 561 | if (type != "variable") return pass(); 562 | cx.marked = "property"; 563 | return cont(); 564 | } 565 | function afterModule(type, value) { 566 | if (type == "string") return cont(statement); 567 | if (type == "variable") { register(value); return cont(maybeFrom); } 568 | } 569 | function afterExport(_type, value) { 570 | if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); } 571 | if (value == "default") { cx.marked = "keyword"; return cont(expression, expect(";")); } 572 | return pass(statement); 573 | } 574 | function afterImport(type) { 575 | if (type == "string") return cont(); 576 | return pass(importSpec, maybeFrom); 577 | } 578 | function importSpec(type, value) { 579 | if (type == "{") return contCommasep(importSpec, "}"); 580 | if (type == "variable") register(value); 581 | return cont(); 582 | } 583 | function maybeFrom(_type, value) { 584 | if (value == "from") { cx.marked = "keyword"; return cont(expression); } 585 | } 586 | function arrayLiteral(type) { 587 | if (type == "]") return cont(); 588 | return pass(expressionNoComma, maybeArrayComprehension); 589 | } 590 | function maybeArrayComprehension(type) { 591 | if (type == "for") return pass(comprehension, expect("]")); 592 | if (type == ",") return cont(commasep(expressionNoComma, "]")); 593 | return pass(commasep(expressionNoComma, "]")); 594 | } 595 | function comprehension(type) { 596 | if (type == "for") return cont(forspec, comprehension); 597 | if (type == "if") return cont(expression, comprehension); 598 | } 599 | 600 | // Interface 601 | 602 | return { 603 | startState: function(basecolumn) { 604 | var state = { 605 | tokenize: tokenBase, 606 | lastType: "sof", 607 | cc: [], 608 | lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false), 609 | localVars: parserConfig.localVars, 610 | context: parserConfig.localVars && {vars: parserConfig.localVars}, 611 | indented: 0 612 | }; 613 | if (parserConfig.globalVars && typeof parserConfig.globalVars == "object") 614 | state.globalVars = parserConfig.globalVars; 615 | return state; 616 | }, 617 | 618 | token: function(stream, state) { 619 | if (stream.sol()) { 620 | if (!state.lexical.hasOwnProperty("align")) 621 | state.lexical.align = false; 622 | state.indented = stream.indentation(); 623 | findFatArrow(stream, state); 624 | } 625 | if (state.tokenize != tokenComment && stream.eatSpace()) return null; 626 | var style = state.tokenize(stream, state); 627 | if (type == "comment") return style; 628 | state.lastType = type == "operator" && (content == "++" || content == "--") ? "incdec" : type; 629 | return parseJS(state, style, type, content, stream); 630 | }, 631 | 632 | indent: function(state, textAfter) { 633 | if (state.tokenize == tokenComment) return CodeMirror.Pass; 634 | if (state.tokenize != tokenBase) return 0; 635 | var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical; 636 | // Kludge to prevent 'maybelse' from blocking lexical scope pops 637 | if (!/^\s*else\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) { 638 | var c = state.cc[i]; 639 | if (c == poplex) lexical = lexical.prev; 640 | else if (c != maybeelse) break; 641 | } 642 | if (lexical.type == "stat" && firstChar == "}") lexical = lexical.prev; 643 | if (statementIndent && lexical.type == ")" && lexical.prev.type == "stat") 644 | lexical = lexical.prev; 645 | var type = lexical.type, closing = firstChar == type; 646 | 647 | if (type == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? lexical.info + 1 : 0); 648 | else if (type == "form" && firstChar == "{") return lexical.indented; 649 | else if (type == "form") return lexical.indented + indentUnit; 650 | else if (type == "stat") 651 | return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? statementIndent || indentUnit : 0); 652 | else if (lexical.info == "switch" && !closing && parserConfig.doubleIndentSwitch != false) 653 | return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit); 654 | else if (lexical.align) return lexical.column + (closing ? 0 : 1); 655 | else return lexical.indented + (closing ? 0 : indentUnit); 656 | }, 657 | 658 | electricChars: ":{}", 659 | blockCommentStart: jsonMode ? null : "/*", 660 | blockCommentEnd: jsonMode ? null : "*/", 661 | lineComment: jsonMode ? null : "//", 662 | fold: "brace", 663 | 664 | helperType: jsonMode ? "json" : "javascript", 665 | jsonldMode: jsonldMode, 666 | jsonMode: jsonMode 667 | }; 668 | }); 669 | 670 | CodeMirror.registerHelper("wordChars", "javascript", /[\\w$]/); 671 | 672 | CodeMirror.defineMIME("text/javascript", "javascript"); 673 | CodeMirror.defineMIME("text/ecmascript", "javascript"); 674 | CodeMirror.defineMIME("application/javascript", "javascript"); 675 | CodeMirror.defineMIME("application/ecmascript", "javascript"); 676 | CodeMirror.defineMIME("application/json", {name: "javascript", json: true}); 677 | CodeMirror.defineMIME("application/x-json", {name: "javascript", json: true}); 678 | CodeMirror.defineMIME("application/ld+json", {name: "javascript", jsonld: true}); 679 | CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true }); 680 | CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true }); 681 | 682 | }); 683 | -------------------------------------------------------------------------------- /static/src/lodash.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * lodash 4.11.2 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE 4 | * Build: `lodash -o ./dist/lodash.js` 5 | */ 6 | ;(function(){function t(t,n){return t.set(n[0],n[1]),t}function n(t,n){return t.add(n),t}function r(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}function e(t,n,r,e){for(var u=-1,o=t.length;++ur?false:(r==t.length-1?t.pop():Fu.call(t,r,1),true)}function Zt(t,n){var r=Tt(t,n);return 0>r?N:t[r][1]}function Tt(t,n){for(var r=t.length;r--;)if(Se(t[r][0],n))return r;return-1}function qt(t,n,r){ 14 | var e=Tt(t,n);0>e?t.push([n,r]):t[e][1]=r}function Gt(t,n,r,e){return t===N||Se(t,xu[r])&&!wu.call(e,r)?n:t}function Jt(t,n,r){(r===N||Se(t[n],r))&&(typeof n!="number"||r!==N||n in t)||(t[n]=r)}function Yt(t,n,r){var e=t[n];wu.call(t,n)&&Se(e,r)&&(r!==N||n in t)||(t[n]=r)}function Ht(t,n,r,e){return yo(t,function(t,u,o){n(e,t,r(t),o)}),e}function Qt(t,n){return t&&ar(n,tu(n),t)}function Xt(t,n){for(var r=-1,e=null==t,u=n.length,o=Array(u);++r=t?t:r), 15 | n!==N&&(t=t>=n?t:n)),t}function nn(t,n,r,e,o,i,f){var c;if(e&&(c=i?e(t,o,i,f):e(t)),c!==N)return c;if(!ze(t))return t;if(o=li(t)){if(c=Pr(t),!n)return cr(t,c)}else{var a=Fr(t),l="[object Function]"==a||"[object GeneratorFunction]"==a;if(si(t))return er(t,n);if("[object Object]"==a||"[object Arguments]"==a||l&&!i){if(L(t))return i?t:{};if(c=Zr(l?{}:t),!n)return lr(t,Qt(c,t))}else{if(!Bt[a])return i?t:{};c=Tr(t,a,nn,n)}}if(f||(f=new Ft),i=f.get(t))return i;if(f.set(t,c),!o)var s=r?vn(t,tu,$r):tu(t); 16 | return u(s||t,function(u,o){s&&(o=u,u=t[o]),Yt(c,o,nn(u,n,r,e,o,t,f))}),c}function rn(t){var n=tu(t),r=n.length;return function(e){if(null==e)return!r;for(var u=r;u--;){var o=n[u],i=t[o],f=e[o];if(f===N&&!(o in Object(e))||!i(f))return false}return true}}function en(t){return ze(t)?zu(t):{}}function un(t,n,r){if(typeof t!="function")throw new yu("Expected a function");return $u(function(){t.apply(N,r)},n)}function on(t,n,r,e){var u=-1,o=f,i=true,l=t.length,s=[],h=n.length;if(!l)return s;r&&(n=a(n,A(r))),e?(o=c, 17 | i=false):n.length>=200&&(o=zt,i=false,n=new Ut(n));t:for(;++u0&&r(f)?n>1?ln(f,n-1,r,e,u):l(u,f):e||(u[u.length]=f)}return u}function sn(t,n){return t&&xo(t,n,tu)}function hn(t,n){return t&&jo(t,n,tu)}function pn(t,n){return i(n,function(n){return Ce(t[n])})}function _n(t,n){n=Yr(n,t)?[n]:nr(n);for(var r=0,e=n.length;null!=t&&e>r;)t=t[ee(n[r++])];return r&&r==e?t:N}function vn(t,n,r){return n=n(t),li(t)?n:l(n,r(t))}function gn(t,n){return t>n}function dn(t,n){return wu.call(t,n)||typeof t=="object"&&n in t&&null===Zu(Object(t)); 19 | }function yn(t,n){return n in Object(t)}function bn(t,n,r){for(var e=r?c:f,u=t[0].length,o=t.length,i=o,l=Array(o),s=1/0,h=[];i--;){var p=t[i];i&&n&&(p=a(p,A(n))),s=Gu(p.length,s),l[i]=!r&&(n||u>=120&&p.length>=120)?new Ut(i&&p):N}var p=t[0],_=-1,v=l[0];t:for(;++_h.length;){var g=p[_],d=n?n(g):g,g=r||0!==g?g:0;if(v?!zt(v,d):!e(h,d,r)){for(i=o;--i;){var y=l[i];if(y?!zt(y,d):!e(t[i],d,r))continue t}v&&v.push(d),h.push(g)}}return h}function xn(t,n,r){var e={};return sn(t,function(t,u,o){n(e,r(t),u,o); 20 | }),e}function jn(t,n,e){return Yr(n,t)||(n=nr(n),t=re(t,n),n=ae(n)),n=null==t?t:t[ee(n)],null==n?N:r(n,t,e)}function mn(t,n,r,e,u){if(t===n)n=true;else if(null==t||null==n||!ze(t)&&!De(n))n=t!==t&&n!==n;else t:{var o=li(t),i=li(n),f="[object Array]",c="[object Array]";o||(f=Fr(t),f="[object Arguments]"==f?"[object Object]":f),i||(c=Fr(n),c="[object Arguments]"==c?"[object Object]":c);var a="[object Object]"==f&&!L(t),i="[object Object]"==c&&!L(n);if((c=f==c)&&!a)u||(u=new Ft),n=o||qe(t)?Br(t,n,mn,r,e,u):Lr(t,n,f,mn,r,e,u);else{ 21 | if(!(2&e)&&(o=a&&wu.call(t,"__wrapped__"),f=i&&wu.call(n,"__wrapped__"),o||f)){t=o?t.value():t,n=f?n.value():n,u||(u=new Ft),n=mn(t,n,r,e,u);break t}if(c)n:if(u||(u=new Ft),o=2&e,f=tu(t),i=f.length,c=tu(n).length,i==c||o){for(a=i;a--;){var l=f[a];if(!(o?l in n:dn(n,l))){n=false;break n}}if(c=u.get(t))n=c==n;else{c=true,u.set(t,n);for(var s=o;++at}function En(t,n){var r=-1,e=We(t)?Array(t.length):[];return yo(t,function(t,u,o){e[++r]=n(t,u,o)}),e}function In(t){var n=Ur(t);return 1==n.length&&n[0][2]?te(n[0][0],n[0][1]):function(r){return r===t||wn(r,t,n)}}function Sn(t,n){return Yr(t)&&n===n&&!ze(n)?te(ee(t),n):function(r){ 24 | var e=Qe(r,t);return e===N&&e===n?Xe(r,t):mn(n,e,N,3)}}function Rn(t,n,r,e,o){if(t!==n){if(!li(n)&&!qe(n))var i=nu(n);u(i||n,function(u,f){if(i&&(f=u,u=n[f]),ze(u)){o||(o=new Ft);var c=f,a=o,l=t[c],s=n[c],h=a.get(s);if(h)Jt(t,c,h);else{var h=e?e(l,s,c+"",t,n,a):N,p=h===N;p&&(h=s,li(s)||qe(s)?li(l)?h=l:Be(l)?h=cr(l):(p=false,h=nn(s,true)):Ne(s)||Re(s)?Re(l)?h=Ye(l):!ze(l)||r&&Ce(l)?(p=false,h=nn(s,true)):h=l:p=false),a.set(s,h),p&&Rn(h,s,r,e,a),a["delete"](s),Jt(t,c,h)}}else c=e?e(t[f],u,f+"",t,n,o):N,c===N&&(c=u), 25 | Jt(t,f,c)})}}function Wn(t,n){var r=t.length;return r?(n+=0>n?r:0,Gr(n,r)?t[n]:N):void 0}function Bn(t,n,r){var e=-1;return n=a(n.length?n:[au],A(Mr())),t=En(t,function(t){return{a:a(n,function(n){return n(t)}),b:++e,c:t}}),x(t,function(t,n){var e;t:{e=-1;for(var u=t.a,o=n.a,i=u.length,f=r.length;++e=f?c:c*("desc"==r[e]?-1:1);break t}}e=t.b-n.b}return e})}function Ln(t,n){return t=Object(t),s(n,function(n,r){return r in t&&(n[r]=t[r]),n},{})}function Cn(t,n){for(var r=-1,e=vn(t,nu,ko),u=e.length,o={};++rn||n>9007199254740991)return r;do n%2&&(r+=t),(n=Pu(n/2))&&(t+=t);while(n);return r}function Nn(t,n,r,e){n=Yr(n,t)?[n]:nr(n);for(var u=-1,o=n.length,i=o-1,f=t;null!=f&&++un&&(n=-n>u?0:u+n),r=r>u?u:r,0>r&&(r+=u),u=n>r?0:r-n>>>0,n>>>=0,r=Array(u);++e=u){for(;u>e;){var o=e+u>>>1,i=t[o];null!==i&&!Te(i)&&(r?n>=i:n>i)?e=o+1:u=o}return u}return qn(t,n,au,r)}function qn(t,n,r,e){n=r(n);for(var u=0,o=t?t.length:0,i=n!==n,f=null===n,c=Te(n),a=n===N;o>u;){var l=Pu((u+o)/2),s=r(t[l]),h=s!==N,p=null===s,_=s===s,v=Te(s);(i?e||_:a?_&&(e||h):f?_&&h&&(e||!p):c?_&&h&&!p&&(e||!v):p||v?0:e?n>=s:n>s)?u=l+1:o=l; 29 | }return Gu(o,4294967294)}function Vn(t,n){for(var r=-1,e=t.length,u=0,o=[];++r=200){if(u=n?null:wo(t))return z(u);i=false,u=zt,l=new Ut}else l=n?[]:a;t:for(;++ee?n[e]:N);return i}function tr(t){return Be(t)?t:[]}function nr(t){return li(t)?t:Io(t)}function rr(t,n,r){var e=t.length;return r=r===N?e:r,!n&&r>=e?t:Pn(t,n,r)}function er(t,n){if(n)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}function ur(t){var n=new t.constructor(t.byteLength);return new Bu(n).set(new Bu(t)),n}function or(t,n){if(t!==n){var r=t!==N,e=null===t,u=t===t,o=Te(t),i=n!==N,f=null===n,c=n===n,a=Te(n); 32 | if(!f&&!a&&!o&&t>n||o&&i&&c&&!f&&!a||e&&i&&c||!r&&c||!u)return 1;if(!e&&!o&&!a&&n>t||a&&r&&u&&!e&&!o||f&&r&&u||!i&&u||!c)return-1}return 0}function ir(t,n,r,e){var u=-1,o=t.length,i=r.length,f=-1,c=n.length,a=Ku(o-i,0),l=Array(c+a);for(e=!e;++fu)&&(l[r[u]]=t[u]);for(;a--;)l[f++]=t[u++];return l}function fr(t,n,r,e){var u=-1,o=t.length,i=-1,f=r.length,c=-1,a=n.length,l=Ku(o-f,0),s=Array(l+a);for(e=!e;++uu)&&(s[l+r[i]]=t[u++]); 33 | return s}function cr(t,n){var r=-1,e=t.length;for(n||(n=Array(e));++r1?r[u-1]:N,i=u>2?r[2]:N,o=typeof o=="function"?(u--,o):N;for(i&&Jr(r[0],r[1],i)&&(o=3>u?N:o,u=1),n=Object(n);++ei&&f[0]!==a&&f[i-1]!==a?[]:U(f,a),i-=c.length,e>i?Sr(t,n,jr,u.placeholder,N,f,c,N,N,e-i):r(this&&this!==Vt&&this instanceof u?o:t,this,f)}var o=yr(t);return u}function xr(t){return Ee(function(n){n=ln(n,1);var r=n.length,e=r,u=wt.prototype.thru;for(t&&n.reverse();e--;){var o=n[e];if(typeof o!="function")throw new yu("Expected a function");if(u&&!i&&"wrapper"==Cr(o))var i=new wt([],true); 37 | }for(e=i?e:r;++e=200)return i.plant(e).value();for(var u=0,t=r?n[u].apply(this,t):e;++ud)return j=U(b,j),Sr(t,n,jr,l.placeholder,r,b,j,f,c,a-d);if(j=h?r:this,y=p?j[t]:t,d=b.length,f){x=b.length;for(var m=Gu(f.length,x),w=cr(b);m--;){var A=f[m];b[m]=Gr(A,x)?w[A]:N}}else v&&d>1&&b.reverse();return s&&d>c&&(b.length=c),this&&this!==Vt&&this instanceof l&&(y=g||yr(y)),y.apply(j,b)}var s=128&n,h=1&n,p=2&n,_=24&n,v=512&n,g=p?N:yr(t);return l}function mr(t,n){return function(r,e){return xn(r,t,n(e))}}function wr(t){return function(n,r){var e; 39 | if(n===N&&r===N)return 0;if(n!==N&&(e=n),r!==N){if(e===N)return r;typeof n=="string"||typeof r=="string"?(n=Gn(n),r=Gn(r)):(n=Kn(n),r=Kn(r)),e=t(n,r)}return e}}function Ar(t){return Ee(function(n){return n=1==n.length&&li(n[0])?a(n[0],A(Mr())):a(ln(n,1,Kr),A(Mr())),Ee(function(e){var u=this;return t(n,function(t){return r(t,u,e)})})})}function Or(t,n){n=n===N?" ":Gn(n);var r=n.length;return 2>r?r?Fn(n,t):n:(r=Fn(n,Nu(t/D(n))),It.test(n)?rr(r.match(kt),0,t).join(""):r.slice(0,t))}function kr(t,n,e,u){ 40 | function o(){for(var n=-1,c=arguments.length,a=-1,l=u.length,s=Array(l+c),h=this&&this!==Vt&&this instanceof o?f:t;++an?1:-1:Je(e)||0;var u=-1;r=Ku(Nu((r-n)/(e||1)),0);for(var o=Array(r);r--;)o[t?r:++u]=n,n+=e;return o}}function Ir(t){return function(n,r){return typeof n=="string"&&typeof r=="string"||(n=Je(n), 41 | r=Je(r)),t(n,r)}}function Sr(t,n,r,e,u,o,i,f,c,a){var l=8&n,s=l?i:N;i=l?N:i;var h=l?o:N;return o=l?N:o,n=(n|(l?32:64))&~(l?64:32),4&n||(n&=-4),n=[t,n,u,h,s,o,i,f,c,a],r=r.apply(N,n),Qr(t)&&Eo(r,n),r.placeholder=e,r}function Rr(t){var n=gu[t];return function(t,r){if(t=Je(t),r=Ke(r)){var e=(He(t)+"e").split("e"),e=n(e[0]+"e"+(+e[1]+r)),e=(He(e)+"e").split("e");return+(e[0]+"e"+(+e[1]-r))}return n(t)}}function Wr(t,n,r,e,u,o,i,f){var c=2&n;if(!c&&typeof t!="function")throw new yu("Expected a function"); 42 | var a=e?e.length:0;if(a||(n&=-97,e=u=N),i=i===N?i:Ku(Ke(i),0),f=f===N?f:Ke(f),a-=u?u.length:0,64&n){var l=e,s=u;e=u=N}var h=c?N:Ao(t);return o=[t,n,r,e,u,l,s,o,i,f],h&&(r=o[1],t=h[1],n=r|t,e=128==t&&8==r||128==t&&256==r&&h[8]>=o[7].length||384==t&&h[8]>=h[7].length&&8==r,131>n||e)&&(1&t&&(o[2]=h[2],n|=1&r?0:4),(r=h[3])&&(e=o[3],o[3]=e?ir(e,r,h[4]):r,o[4]=e?U(o[3],"__lodash_placeholder__"):h[4]),(r=h[5])&&(e=o[5],o[5]=e?fr(e,r,h[6]):r,o[6]=e?U(o[5],"__lodash_placeholder__"):h[6]),(r=h[7])&&(o[7]=r), 43 | 128&t&&(o[8]=null==o[8]?h[8]:Gu(o[8],h[8])),null==o[9]&&(o[9]=h[9]),o[0]=h[0],o[1]=n),t=o[0],n=o[1],r=o[2],e=o[3],u=o[4],f=o[9]=null==o[9]?c?0:t.length:Ku(o[9]-a,0),!f&&24&n&&(n&=-25),(h?mo:Eo)(n&&1!=n?8==n||16==n?br(t,n,f):32!=n&&33!=n||u.length?jr.apply(N,o):kr(t,n,r,e):vr(t,n,r),o)}function Br(t,n,r,e,u,o){var i=-1,f=2&u,c=1&u,a=t.length,l=n.length;if(a!=l&&!(f&&l>a))return false;if(l=o.get(t))return l==n;for(l=true,o.set(t,n);++i-1&&0==t%1&&n>t}function Jr(t,n,r){if(!ze(r))return false;var e=typeof n;return("number"==e?We(r)&&Gr(n,r.length):"string"==e&&n in r)?Se(r[n],t):false; 50 | }function Yr(t,n){if(li(t))return false;var r=typeof t;return"number"==r||"symbol"==r||"boolean"==r||null==t||Te(t)?true:nt.test(t)||!tt.test(t)||null!=n&&t in Object(n)}function Hr(t){var n=typeof t;return"string"==n||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==t:null===t}function Qr(t){var n=Cr(t),r=jt[n];return typeof r=="function"&&n in Lt.prototype?t===r?true:(n=Ao(r),!!n&&t===n[0]):false}function Xr(t){var n=t&&t.constructor;return t===(typeof n=="function"&&n.prototype||xu)}function te(t,n){return function(r){ 51 | return null==r?false:r[t]===n&&(n!==N||t in Object(r))}}function ne(t,n,r,e,u,o){return ze(t)&&ze(n)&&Rn(t,n,N,ne,o.set(n,t)),t}function re(t,n){return 1==n.length?t:_n(t,Pn(n,0,-1))}function ee(t){if(typeof t=="string"||Te(t))return t;var n=t+"";return"0"==n&&1/t==-P?"-0":n}function ue(t){if(null!=t){try{return mu.call(t)}catch(n){}return t+""}return""}function oe(t){if(t instanceof Lt)return t.clone();var n=new wt(t.__wrapped__,t.__chain__);return n.__actions__=cr(t.__actions__),n.__index__=t.__index__, 52 | n.__values__=t.__values__,n}function ie(t,n,r){var e=t?t.length:0;return e?(n=r||n===N?1:Ke(n),Pn(t,0>n?0:n,e)):[]}function fe(t,n,r){var e=t?t.length:0;return e?(n=r||n===N?1:Ke(n),n=e-n,Pn(t,0,0>n?0:n)):[]}function ce(t){return t&&t.length?t[0]:N}function ae(t){var n=t?t.length:0;return n?t[n-1]:N}function le(t,n){return t&&t.length&&n&&n.length?zn(t,n):t}function se(t){return t?Qu.call(t):t}function he(t){if(!t||!t.length)return[];var n=0;return t=i(t,function(t){return Be(t)?(n=Ku(t.length,n), 53 | !0):void 0}),m(n,function(n){return a(t,Mn(n))})}function pe(t,n){if(!t||!t.length)return[];var e=he(t);return null==n?e:a(e,function(t){return r(n,N,t)})}function _e(t){return t=jt(t),t.__chain__=true,t}function ve(t,n){return n(t)}function ge(){return this}function de(t,n){return typeof n=="function"&&li(t)?u(t,n):yo(t,Mr(n))}function ye(t,n){var r;if(typeof n=="function"&&li(t)){for(r=t.length;r--&&false!==n(t[r],r,t););r=t}else r=bo(t,Mr(n));return r}function be(t,n){return(li(t)?a:En)(t,Mr(n,3))}function xe(t,n,r){ 54 | var e=-1,u=Ve(t),o=u.length,i=o-1;for(n=(r?Jr(t,n,r):n===N)?1:tn(Ke(n),0,o);++e=t&&(n=N),r}}function we(t,n,r){return n=r?N:n,t=Wr(t,8,N,N,N,N,N,n),t.placeholder=we.placeholder,t}function Ae(t,n,r){return n=r?N:n, 55 | t=Wr(t,16,N,N,N,N,N,n),t.placeholder=Ae.placeholder,t}function Oe(t,n,r){function e(n){var r=c,e=a;return c=a=N,_=n,s=t.apply(e,r)}function u(t){var r=t-p;return t-=_,!p||r>=n||0>r||g&&t>=l}function o(){var t=Xo();if(u(t))return i(t);var r;r=t-_,t=n-(t-p),r=g?Gu(t,l-r):t,h=$u(o,r)}function i(t){return Lu(h),h=N,d&&c?e(t):(c=a=N,s)}function f(){var t=Xo(),r=u(t);if(c=arguments,a=this,p=t,r){if(h===N)return _=t=p,h=$u(o,n),v?e(t):s;if(g)return Lu(h),h=$u(o,n),e(p)}return h===N&&(h=$u(o,n)),s}var c,a,l,s,h,p=0,_=0,v=false,g=false,d=true; 56 | if(typeof t!="function")throw new yu("Expected a function");return n=Je(n)||0,ze(r)&&(v=!!r.leading,l=(g="maxWait"in r)?Ku(Je(r.maxWait)||0,n):l,d="trailing"in r?!!r.trailing:d),f.cancel=function(){h!==N&&Lu(h),p=_=0,c=a=h=N},f.flush=function(){return h===N?s:i(Xo())},f}function ke(t,n){function r(){var e=arguments,u=n?n.apply(this,e):e[0],o=r.cache;return o.has(u)?o.get(u):(e=t.apply(this,e),r.cache=o.set(u,e),e)}if(typeof t!="function"||n&&typeof n!="function")throw new yu("Expected a function"); 57 | return r.cache=new(ke.Cache||Mt),r}function Ee(t,n){if(typeof t!="function")throw new yu("Expected a function");return n=Ku(n===N?t.length-1:Ke(n),0),function(){for(var e=arguments,u=-1,o=Ku(e.length-n,0),i=Array(o);++u-1&&0==t%1&&9007199254740991>=t; 59 | }function ze(t){var n=typeof t;return!!t&&("object"==n||"function"==n)}function De(t){return!!t&&typeof t=="object"}function $e(t){return ze(t)?(Ce(t)||L(t)?Iu:vt).test(ue(t)):false}function Fe(t){return typeof t=="number"||De(t)&&"[object Number]"==ku.call(t)}function Ne(t){return!De(t)||"[object Object]"!=ku.call(t)||L(t)?false:(t=Zu(Object(t)),null===t?true:(t=wu.call(t,"constructor")&&t.constructor,typeof t=="function"&&t instanceof t&&mu.call(t)==Ou))}function Pe(t){return ze(t)&&"[object RegExp]"==ku.call(t); 60 | }function Ze(t){return typeof t=="string"||!li(t)&&De(t)&&"[object String]"==ku.call(t)}function Te(t){return typeof t=="symbol"||De(t)&&"[object Symbol]"==ku.call(t)}function qe(t){return De(t)&&Ue(t.length)&&!!Wt[ku.call(t)]}function Ve(t){if(!t)return[];if(We(t))return Ze(t)?t.match(kt):cr(t);if(Uu&&t[Uu])return C(t[Uu]());var n=Fr(t);return("[object Map]"==n?M:"[object Set]"==n?z:uu)(t)}function Ke(t){if(!t)return 0===t?t:0;if(t=Je(t),t===P||t===-P)return 1.7976931348623157e308*(0>t?-1:1);var n=t%1; 61 | return t===t?n?t-n:t:0}function Ge(t){return t?tn(Ke(t),0,4294967295):0}function Je(t){if(typeof t=="number")return t;if(Te(t))return Z;if(ze(t)&&(t=Ce(t.valueOf)?t.valueOf():t,t=ze(t)?t+"":t),typeof t!="string")return 0===t?t:+t;t=t.replace(ot,"");var n=_t.test(t);return n||gt.test(t)?$t(t.slice(2),n?2:8):pt.test(t)?Z:+t}function Ye(t){return ar(t,nu(t))}function He(t){return null==t?"":Gn(t)}function Qe(t,n,r){return t=null==t?N:_n(t,n),t===N?r:t}function Xe(t,n){return null!=t&&Nr(t,n,yn)}function tu(t){ 62 | var n=Xr(t);if(!n&&!We(t))return Vu(Object(t));var r,e=qr(t),u=!!e,e=e||[],o=e.length;for(r in t)!dn(t,r)||u&&("length"==r||Gr(r,o))||n&&"constructor"==r||e.push(r);return e}function nu(t){for(var n=-1,r=Xr(t),e=On(t),u=e.length,o=qr(t),i=!!o,o=o||[],f=o.length;++ne.length?qt(e,t,n):(r.array=null,r.map=new Mt(e))),(r=r.map)&&r.set(t,n),this};var yo=pr(sn),bo=pr(hn,true),xo=_r(),jo=_r(true);Cu&&!Du.call({valueOf:1},"valueOf")&&(On=function(t){return C(Cu(t))});var mo=io?function(t,n){return io.set(t,n),t}:au,wo=eo&&1/z(new eo([,-0]))[1]==P?function(t){ 69 | return new eo(t)}:hu,Ao=io?function(t){return io.get(t)}:hu,Oo=Mn("length");Mu||($r=function(){return[]});var ko=Mu?function(t){for(var n=[];t;)l(n,$r(t)),t=Zu(Object(t));return n}:$r;(to&&"[object DataView]"!=Fr(new to(new ArrayBuffer(1)))||no&&"[object Map]"!=Fr(new no)||ro&&"[object Promise]"!=Fr(ro.resolve())||eo&&"[object Set]"!=Fr(new eo)||uo&&"[object WeakMap]"!=Fr(new uo))&&(Fr=function(t){var n=ku.call(t);if(t=(t="[object Object]"==n?t.constructor:N)?ue(t):N)switch(t){case ao:return"[object DataView]"; 70 | case lo:return"[object Map]";case so:return"[object Promise]";case ho:return"[object Set]";case po:return"[object WeakMap]"}return n});var Eo=function(){var t=0,n=0;return function(r,e){var u=Xo(),o=16-(u-n);if(n=u,o>0){if(150<=++t)return r}else t=0;return mo(r,e)}}(),Io=ke(function(t){var n=[];return He(t).replace(rt,function(t,r,e,u){n.push(e?u.replace(at,"$1"):r||t)}),n}),So=Ee(function(t,n){return Be(t)?on(t,ln(n,1,Be,true)):[]}),Ro=Ee(function(t,n){var r=ae(n);return Be(r)&&(r=N),Be(t)?on(t,ln(n,1,Be,true),Mr(r)):[]; 71 | }),Wo=Ee(function(t,n){var r=ae(n);return Be(r)&&(r=N),Be(t)?on(t,ln(n,1,Be,true),N,r):[]}),Bo=Ee(function(t){var n=a(t,tr);return n.length&&n[0]===t[0]?bn(n):[]}),Lo=Ee(function(t){var n=ae(t),r=a(t,tr);return n===ae(r)?n=N:r.pop(),r.length&&r[0]===t[0]?bn(r,Mr(n)):[]}),Co=Ee(function(t){var n=ae(t),r=a(t,tr);return n===ae(r)?n=N:r.pop(),r.length&&r[0]===t[0]?bn(r,N,n):[]}),Mo=Ee(le),Uo=Ee(function(t,n){n=ln(n,1);var r=t?t.length:0,e=Xt(t,n);return Dn(t,a(n,function(t){return Gr(t,r)?+t:t}).sort(or)), 72 | e}),zo=Ee(function(t){return Jn(ln(t,1,Be,true))}),Do=Ee(function(t){var n=ae(t);return Be(n)&&(n=N),Jn(ln(t,1,Be,true),Mr(n))}),$o=Ee(function(t){var n=ae(t);return Be(n)&&(n=N),Jn(ln(t,1,Be,true),N,n)}),Fo=Ee(function(t,n){return Be(t)?on(t,n):[]}),No=Ee(function(t){return Qn(i(t,Be))}),Po=Ee(function(t){var n=ae(t);return Be(n)&&(n=N),Qn(i(t,Be),Mr(n))}),Zo=Ee(function(t){var n=ae(t);return Be(n)&&(n=N),Qn(i(t,Be),N,n)}),To=Ee(he),qo=Ee(function(t){var n=t.length,n=n>1?t[n-1]:N,n=typeof n=="function"?(t.pop(), 73 | n):N;return pe(t,n)}),Vo=Ee(function(t){function n(n){return Xt(n,t)}t=ln(t,1);var r=t.length,e=r?t[0]:0,u=this.__wrapped__;return!(r>1||this.__actions__.length)&&u instanceof Lt&&Gr(e)?(u=u.slice(e,+e+(r?1:0)),u.__actions__.push({func:ve,args:[n],thisArg:N}),new wt(u,this.__chain__).thru(function(t){return r&&!t.length&&t.push(N),t})):this.thru(n)}),Ko=sr(function(t,n,r){wu.call(t,r)?++t[r]:t[r]=1}),Go=sr(function(t,n,r){wu.call(t,r)?t[r].push(n):t[r]=[n]}),Jo=Ee(function(t,n,e){var u=-1,o=typeof n=="function",i=Yr(n),f=We(t)?Array(t.length):[]; 74 | return yo(t,function(t){var c=o?n:i&&null!=t?t[n]:N;f[++u]=c?r(c,t,e):jn(t,n,e)}),f}),Yo=sr(function(t,n,r){t[r]=n}),Ho=sr(function(t,n,r){t[r?0:1].push(n)},function(){return[[],[]]}),Qo=Ee(function(t,n){if(null==t)return[];var r=n.length;return r>1&&Jr(t,n[0],n[1])?n=[]:r>2&&Jr(n[0],n[1],n[2])&&(n=[n[0]]),n=1==n.length&&li(n[0])?n[0]:ln(n,1,Kr),Bn(t,n,[])}),Xo=_u.now,ti=Ee(function(t,n,r){var e=1;if(r.length)var u=U(r,Dr(ti)),e=32|e;return Wr(t,e,n,r,u)}),ni=Ee(function(t,n,r){var e=3;if(r.length)var u=U(r,Dr(ni)),e=32|e; 75 | return Wr(n,e,t,r,u)}),ri=Ee(function(t,n){return un(t,1,n)}),ei=Ee(function(t,n,r){return un(t,Je(n)||0,r)});ke.Cache=Mt;var ui=Ee(function(t,n){n=1==n.length&&li(n[0])?a(n[0],A(Mr())):a(ln(n,1,Kr),A(Mr()));var e=n.length;return Ee(function(u){for(var o=-1,i=Gu(u.length,e);++o=n}),li=Array.isArray,si=Su?function(t){return t instanceof Su}:cu(false),hi=Ir(kn),pi=Ir(function(t,n){return n>=t}),_i=hr(function(t,n){if(fo||Xr(n)||We(n))ar(n,tu(n),t);else for(var r in n)wu.call(n,r)&&Yt(t,r,n[r])}),vi=hr(function(t,n){if(fo||Xr(n)||We(n))ar(n,nu(n),t);else for(var r in n)Yt(t,r,n[r])}),gi=hr(function(t,n,r,e){ar(n,nu(n),t,e)}),di=hr(function(t,n,r,e){ar(n,tu(n),t,e)}),yi=Ee(function(t,n){return Xt(t,ln(n,1))}),bi=Ee(function(t){return t.push(N,Gt), 77 | r(gi,N,t)}),xi=Ee(function(t){return t.push(N,ne),r(Oi,N,t)}),ji=mr(function(t,n,r){t[n]=r},cu(au)),mi=mr(function(t,n,r){wu.call(t,n)?t[n].push(r):t[n]=[r]},Mr),wi=Ee(jn),Ai=hr(function(t,n,r){Rn(t,n,r)}),Oi=hr(function(t,n,r,e){Rn(t,n,r,e)}),ki=Ee(function(t,n){return null==t?{}:(n=a(ln(n,1),ee),Ln(t,on(vn(t,nu,ko),n)))}),Ei=Ee(function(t,n){return null==t?{}:Ln(t,a(ln(n,1),ee))}),Ii=dr(function(t,n,r){return n=n.toLowerCase(),t+(r?ou(n):n)}),Si=dr(function(t,n,r){return t+(r?"-":"")+n.toLowerCase(); 78 | }),Ri=dr(function(t,n,r){return t+(r?" ":"")+n.toLowerCase()}),Wi=gr("toLowerCase"),Bi=dr(function(t,n,r){return t+(r?"_":"")+n.toLowerCase()}),Li=dr(function(t,n,r){return t+(r?" ":"")+Mi(n)}),Ci=dr(function(t,n,r){return t+(r?" ":"")+n.toUpperCase()}),Mi=gr("toUpperCase"),Ui=Ee(function(t,n){try{return r(t,N,n)}catch(e){return Le(e)?e:new vu(e)}}),zi=Ee(function(t,n){return u(ln(n,1),function(n){n=ee(n),t[n]=ti(t[n],t)}),t}),Di=xr(),$i=xr(true),Fi=Ee(function(t,n){return function(r){return jn(r,t,n); 79 | }}),Ni=Ee(function(t,n){return function(r){return jn(t,r,n)}}),Pi=Ar(a),Zi=Ar(o),Ti=Ar(p),qi=Er(),Vi=Er(true),Ki=wr(function(t,n){return t+n}),Gi=Rr("ceil"),Ji=wr(function(t,n){return t/n}),Yi=Rr("floor"),Hi=wr(function(t,n){return t*n}),Qi=Rr("round"),Xi=wr(function(t,n){return t-n});return jt.after=function(t,n){if(typeof n!="function")throw new yu("Expected a function");return t=Ke(t),function(){return 1>--t?n.apply(this,arguments):void 0}},jt.ary=je,jt.assign=_i,jt.assignIn=vi,jt.assignInWith=gi, 80 | jt.assignWith=di,jt.at=yi,jt.before=me,jt.bind=ti,jt.bindAll=zi,jt.bindKey=ni,jt.castArray=Ie,jt.chain=_e,jt.chunk=function(t,n,r){if(n=(r?Jr(t,n,r):n===N)?1:Ku(Ke(n),0),r=t?t.length:0,!r||1>n)return[];for(var e=0,u=0,o=Array(Nu(r/n));r>e;)o[u++]=Pn(t,e,e+=n);return o},jt.compact=function(t){for(var n=-1,r=t?t.length:0,e=0,u=[];++nt)return t?cr(n):[];for(var r=Array(t-1);t--;)r[t-1]=arguments[t]; 81 | for(var t=ln(r,1),r=-1,e=n.length,u=-1,o=t.length,i=Array(e+o);++rr&&(r=-r>u?0:u+r),e=e===N||e>u?u:Ke(e),0>e&&(e+=u),e=r>e?0:Ge(e);e>r;)t[r++]=n; 83 | return t},jt.filter=function(t,n){return(li(t)?i:an)(t,Mr(n,3))},jt.flatMap=function(t,n){return ln(be(t,n),1)},jt.flatMapDeep=function(t,n){return ln(be(t,n),P)},jt.flatMapDepth=function(t,n,r){return r=r===N?1:Ke(r),ln(be(t,n),r)},jt.flatten=function(t){return t&&t.length?ln(t,1):[]},jt.flattenDeep=function(t){return t&&t.length?ln(t,P):[]},jt.flattenDepth=function(t,n){return t&&t.length?(n=n===N?1:Ke(n),ln(t,n)):[]},jt.flip=function(t){return Wr(t,512)},jt.flow=Di,jt.flowRight=$i,jt.fromPairs=function(t){ 84 | for(var n=-1,r=t?t.length:0,e={};++n>>0,r?(t=He(t))&&(typeof n=="string"||null!=n&&!Pe(n))&&(n=Gn(n),""==n&&It.test(t))?rr(t.match(kt),0,r):Xu.call(t,n,r):[]},jt.spread=function(t,n){if(typeof t!="function")throw new yu("Expected a function");return n=n===N?0:Ku(Ke(n),0),Ee(function(e){var u=e[n];return e=rr(e,0,n),u&&l(e,u),r(t,this,e)})},jt.tail=function(t){return ie(t,1)},jt.take=function(t,n,r){return t&&t.length?(n=r||n===N?1:Ke(n),Pn(t,0,0>n?0:n)):[]},jt.takeRight=function(t,n,r){var e=t?t.length:0;return e?(n=r||n===N?1:Ke(n), 90 | n=e-n,Pn(t,0>n?0:n,e)):[]},jt.takeRightWhile=function(t,n){return t&&t.length?Yn(t,Mr(n,3),false,true):[]},jt.takeWhile=function(t,n){return t&&t.length?Yn(t,Mr(n,3)):[]},jt.tap=function(t,n){return n(t),t},jt.throttle=function(t,n,r){var e=true,u=true;if(typeof t!="function")throw new yu("Expected a function");return ze(r)&&(e="leading"in r?!!r.leading:e,u="trailing"in r?!!r.trailing:u),Oe(t,n,{leading:e,maxWait:n,trailing:u})},jt.thru=ve,jt.toArray=Ve,jt.toPairs=ru,jt.toPairsIn=eu,jt.toPath=function(t){ 91 | return li(t)?a(t,ee):Te(t)?[t]:cr(Io(t))},jt.toPlainObject=Ye,jt.transform=function(t,n,r){var e=li(t)||qe(t);if(n=Mr(n,4),null==r)if(e||ze(t)){var o=t.constructor;r=e?li(t)?new o:[]:Ce(o)?en(Zu(Object(t))):{}}else r={};return(e?u:sn)(t,function(t,e,u){return n(r,t,e,u)}),r},jt.unary=function(t){return je(t,1)},jt.union=zo,jt.unionBy=Do,jt.unionWith=$o,jt.uniq=function(t){return t&&t.length?Jn(t):[]},jt.uniqBy=function(t,n){return t&&t.length?Jn(t,Mr(n)):[]},jt.uniqWith=function(t,n){return t&&t.length?Jn(t,N,n):[]; 92 | },jt.unset=function(t,n){var r;if(null==t)r=true;else{r=t;var e=n,e=Yr(e,r)?[e]:nr(e);r=re(r,e),e=ee(ae(e)),r=!(null!=r&&dn(r,e))||delete r[e]}return r},jt.unzip=he,jt.unzipWith=pe,jt.update=function(t,n,r){return null==t?t:Nn(t,n,(typeof r=="function"?r:au)(_n(t,n)),void 0)},jt.updateWith=function(t,n,r,e){return e=typeof e=="function"?e:N,null!=t&&(t=Nn(t,n,(typeof r=="function"?r:au)(_n(t,n)),e)),t},jt.values=uu,jt.valuesIn=function(t){return null==t?[]:O(t,nu(t))},jt.without=Fo,jt.words=fu,jt.wrap=function(t,n){ 93 | return n=null==n?au:n,oi(n,t)},jt.xor=No,jt.xorBy=Po,jt.xorWith=Zo,jt.zip=To,jt.zipObject=function(t,n){return Xn(t||[],n||[],Yt)},jt.zipObjectDeep=function(t,n){return Xn(t||[],n||[],Nn)},jt.zipWith=qo,jt.entries=ru,jt.entriesIn=eu,jt.extend=vi,jt.extendWith=gi,su(jt,jt),jt.add=Ki,jt.attempt=Ui,jt.camelCase=Ii,jt.capitalize=ou,jt.ceil=Gi,jt.clamp=function(t,n,r){return r===N&&(r=n,n=N),r!==N&&(r=Je(r),r=r===r?r:0),n!==N&&(n=Je(n),n=n===n?n:0),tn(Je(t),n,r)},jt.clone=function(t){return nn(t,false,true); 94 | },jt.cloneDeep=function(t){return nn(t,true,true)},jt.cloneDeepWith=function(t,n){return nn(t,true,true,n)},jt.cloneWith=function(t,n){return nn(t,false,true,n)},jt.deburr=iu,jt.divide=Ji,jt.endsWith=function(t,n,r){t=He(t),n=Gn(n);var e=t.length;return r=r===N?e:tn(Ke(r),0,e),r-=n.length,r>=0&&t.indexOf(n,r)==r},jt.eq=Se,jt.escape=function(t){return(t=He(t))&&Y.test(t)?t.replace(G,R):t},jt.escapeRegExp=function(t){return(t=He(t))&&ut.test(t)?t.replace(et,"\\$&"):t},jt.every=function(t,n,r){var e=li(t)?o:fn;return r&&Jr(t,n,r)&&(n=N), 95 | e(t,Mr(n,3))},jt.find=function(t,n){if(n=Mr(n,3),li(t)){var r=v(t,n);return r>-1?t[r]:N}return _(t,n,yo)},jt.findIndex=function(t,n){return t&&t.length?v(t,Mr(n,3)):-1},jt.findKey=function(t,n){return _(t,Mr(n,3),sn,true)},jt.findLast=function(t,n){if(n=Mr(n,3),li(t)){var r=v(t,n,true);return r>-1?t[r]:N}return _(t,n,bo)},jt.findLastIndex=function(t,n){return t&&t.length?v(t,Mr(n,3),true):-1},jt.findLastKey=function(t,n){return _(t,Mr(n,3),hn,true)},jt.floor=Yi,jt.forEach=de,jt.forEachRight=ye,jt.forIn=function(t,n){ 96 | return null==t?t:xo(t,Mr(n),nu)},jt.forInRight=function(t,n){return null==t?t:jo(t,Mr(n),nu)},jt.forOwn=function(t,n){return t&&sn(t,Mr(n))},jt.forOwnRight=function(t,n){return t&&hn(t,Mr(n))},jt.get=Qe,jt.gt=ci,jt.gte=ai,jt.has=function(t,n){return null!=t&&Nr(t,n,dn)},jt.hasIn=Xe,jt.head=ce,jt.identity=au,jt.includes=function(t,n,r,e){return t=We(t)?t:uu(t),r=r&&!e?Ke(r):0,e=t.length,0>r&&(r=Ku(e+r,0)),Ze(t)?e>=r&&-1r&&(r=Ku(e+r,0)),g(t,n,r)):-1},jt.inRange=function(t,n,r){return n=Je(n)||0,r===N?(r=n,n=0):r=Je(r)||0,t=Je(t),t>=Gu(n,r)&&t=-9007199254740991&&9007199254740991>=t; 100 | },jt.isSet=function(t){return De(t)&&"[object Set]"==Fr(t)},jt.isString=Ze,jt.isSymbol=Te,jt.isTypedArray=qe,jt.isUndefined=function(t){return t===N},jt.isWeakMap=function(t){return De(t)&&"[object WeakMap]"==Fr(t)},jt.isWeakSet=function(t){return De(t)&&"[object WeakSet]"==ku.call(t)},jt.join=function(t,n){return t?qu.call(t,n):""},jt.kebabCase=Si,jt.last=ae,jt.lastIndexOf=function(t,n,r){var e=t?t.length:0;if(!e)return-1;var u=e;if(r!==N&&(u=Ke(r),u=(0>u?Ku(e+u,0):Gu(u,e-1))+1),n!==n)return B(t,u,true); 101 | for(;u--;)if(t[u]===n)return u;return-1},jt.lowerCase=Ri,jt.lowerFirst=Wi,jt.lt=hi,jt.lte=pi,jt.max=function(t){return t&&t.length?cn(t,au,gn):N},jt.maxBy=function(t,n){return t&&t.length?cn(t,Mr(n),gn):N},jt.mean=function(t){return y(t,au)},jt.meanBy=function(t,n){return y(t,Mr(n))},jt.min=function(t){return t&&t.length?cn(t,au,kn):N},jt.minBy=function(t,n){return t&&t.length?cn(t,Mr(n),kn):N},jt.multiply=Hi,jt.nth=function(t,n){return t&&t.length?Wn(t,Ke(n)):N},jt.noConflict=function(){return Vt._===this&&(Vt._=Eu), 102 | this},jt.noop=hu,jt.now=Xo,jt.pad=function(t,n,r){t=He(t);var e=(n=Ke(n))?D(t):0;return!n||e>=n?t:(n=(n-e)/2,Or(Pu(n),r)+t+Or(Nu(n),r))},jt.padEnd=function(t,n,r){t=He(t);var e=(n=Ke(n))?D(t):0;return n&&n>e?t+Or(n-e,r):t},jt.padStart=function(t,n,r){t=He(t);var e=(n=Ke(n))?D(t):0;return n&&n>e?Or(n-e,r)+t:t},jt.parseInt=function(t,n,r){return r||null==n?n=0:n&&(n=+n),t=He(t).replace(ot,""),Ju(t,n||(ht.test(t)?16:10))},jt.random=function(t,n,r){if(r&&typeof r!="boolean"&&Jr(t,n,r)&&(n=r=N),r===N&&(typeof n=="boolean"?(r=n, 103 | n=N):typeof t=="boolean"&&(r=t,t=N)),t===N&&n===N?(t=0,n=1):(t=Je(t)||0,n===N?(n=t,t=0):n=Je(n)||0),t>n){var e=t;t=n,n=e}return r||t%1||n%1?(r=Yu(),Gu(t+r*(n-t+Dt("1e-"+((r+"").length-1))),n)):$n(t,n)},jt.reduce=function(t,n,r){var e=li(t)?s:b,u=3>arguments.length;return e(t,Mr(n,4),r,u,yo)},jt.reduceRight=function(t,n,r){var e=li(t)?h:b,u=3>arguments.length;return e(t,Mr(n,4),r,u,bo)},jt.repeat=function(t,n,r){return n=(r?Jr(t,n,r):n===N)?1:Ke(n),Fn(He(t),n)},jt.replace=function(){var t=arguments,n=He(t[0]); 104 | return 3>t.length?n:Hu.call(n,t[1],t[2])},jt.result=function(t,n,r){n=Yr(n,t)?[n]:nr(n);var e=-1,u=n.length;for(u||(t=N,u=1);++e0?t[$n(0,n-1)]:N},jt.size=function(t){if(null==t)return 0;if(We(t)){var n=t.length;return n&&Ze(t)?D(t):n}return De(t)&&(n=Fr(t),"[object Map]"==n||"[object Set]"==n)?t.size:tu(t).length},jt.snakeCase=Bi, 105 | jt.some=function(t,n,r){var e=li(t)?p:Zn;return r&&Jr(t,n,r)&&(n=N),e(t,Mr(n,3))},jt.sortedIndex=function(t,n){return Tn(t,n)},jt.sortedIndexBy=function(t,n,r){return qn(t,n,Mr(r))},jt.sortedIndexOf=function(t,n){var r=t?t.length:0;if(r){var e=Tn(t,n);if(r>e&&Se(t[e],n))return e}return-1},jt.sortedLastIndex=function(t,n){return Tn(t,n,true)},jt.sortedLastIndexBy=function(t,n,r){return qn(t,n,Mr(r),true)},jt.sortedLastIndexOf=function(t,n){if(t&&t.length){var r=Tn(t,n,true)-1;if(Se(t[r],n))return r}return-1; 106 | },jt.startCase=Li,jt.startsWith=function(t,n,r){return t=He(t),r=tn(Ke(r),0,t.length),t.lastIndexOf(Gn(n),r)==r},jt.subtract=Xi,jt.sum=function(t){return t&&t.length?j(t,au):0},jt.sumBy=function(t,n){return t&&t.length?j(t,Mr(n)):0},jt.template=function(t,n,r){var e=jt.templateSettings;r&&Jr(t,n,r)&&(n=N),t=He(t),n=gi({},n,e,Gt),r=gi({},n.imports,e.imports,Gt);var u,o,i=tu(r),f=O(r,i),c=0;r=n.interpolate||bt;var a="__p+='";r=du((n.escape||bt).source+"|"+r.source+"|"+(r===X?lt:bt).source+"|"+(n.evaluate||bt).source+"|$","g"); 107 | var l="sourceURL"in n?"//# sourceURL="+n.sourceURL+"\n":"";if(t.replace(r,function(n,r,e,i,f,l){return e||(e=i),a+=t.slice(c,l).replace(xt,W),r&&(u=true,a+="'+__e("+r+")+'"),f&&(o=true,a+="';"+f+";\n__p+='"),e&&(a+="'+((__t=("+e+"))==null?'':__t)+'"),c=l+n.length,n}),a+="';",(n=n.variable)||(a="with(obj){"+a+"}"),a=(o?a.replace(T,""):a).replace(q,"$1").replace(V,"$1;"),a="function("+(n||"obj")+"){"+(n?"":"obj||(obj={});")+"var __t,__p=''"+(u?",__e=_.escape":"")+(o?",__j=Array.prototype.join;function print(){__p+=__j.call(arguments,'')}":";")+a+"return __p}", 108 | n=Ui(function(){return Function(i,l+"return "+a).apply(N,f)}),n.source=a,Le(n))throw n;return n},jt.times=function(t,n){if(t=Ke(t),1>t||t>9007199254740991)return[];var r=4294967295,e=Gu(t,4294967295);for(n=Mr(n),t-=4294967295,e=m(e,n);++r=o)return t;if(o=r-D(e),1>o)return e;if(r=i?rr(i,0,o).join(""):t.slice(0,o),u===N)return r+e;if(i&&(o+=r.length-o),Pe(u)){if(t.slice(o).search(u)){var f=r;for(u.global||(u=du(u.source,He(st.exec(u))+"g")),u.lastIndex=0;i=u.exec(f);)var c=i.index;r=r.slice(0,c===N?o:c)}}else t.indexOf(Gn(u),o)!=o&&(u=r.lastIndexOf(u),u>-1&&(r=r.slice(0,u)));return r+e},jt.unescape=function(t){return(t=He(t))&&J.test(t)?t.replace(K,$):t},jt.uniqueId=function(t){ 111 | var n=++Au;return He(t)+n},jt.upperCase=Ci,jt.upperFirst=Mi,jt.each=de,jt.eachRight=ye,jt.first=ce,su(jt,function(){var t={};return sn(jt,function(n,r){wu.call(jt.prototype,r)||(t[r]=n)}),t}(),{chain:false}),jt.VERSION="4.11.2",u("bind bindKey curry curryRight partial partialRight".split(" "),function(t){jt[t].placeholder=jt}),u(["drop","take"],function(t,n){Lt.prototype[t]=function(r){var e=this.__filtered__;if(e&&!n)return new Lt(this);r=r===N?1:Ku(Ke(r),0);var u=this.clone();return e?u.__takeCount__=Gu(r,u.__takeCount__):u.__views__.push({ 112 | size:Gu(r,4294967295),type:t+(0>u.__dir__?"Right":"")}),u},Lt.prototype[t+"Right"]=function(n){return this.reverse()[t](n).reverse()}}),u(["filter","map","takeWhile"],function(t,n){var r=n+1,e=1==r||3==r;Lt.prototype[t]=function(t){var n=this.clone();return n.__iteratees__.push({iteratee:Mr(t,3),type:r}),n.__filtered__=n.__filtered__||e,n}}),u(["head","last"],function(t,n){var r="take"+(n?"Right":"");Lt.prototype[t]=function(){return this[r](1).value()[0]}}),u(["initial","tail"],function(t,n){var r="drop"+(n?"":"Right"); 113 | Lt.prototype[t]=function(){return this.__filtered__?new Lt(this):this[r](1)}}),Lt.prototype.compact=function(){return this.filter(au)},Lt.prototype.find=function(t){return this.filter(t).head()},Lt.prototype.findLast=function(t){return this.reverse().find(t)},Lt.prototype.invokeMap=Ee(function(t,n){return typeof t=="function"?new Lt(this):this.map(function(r){return jn(r,t,n)})}),Lt.prototype.reject=function(t){return t=Mr(t,3),this.filter(function(n){return!t(n)})},Lt.prototype.slice=function(t,n){ 114 | t=Ke(t);var r=this;return r.__filtered__&&(t>0||0>n)?new Lt(r):(0>t?r=r.takeRight(-t):t&&(r=r.drop(t)),n!==N&&(n=Ke(n),r=0>n?r.dropRight(-n):r.take(n-t)),r)},Lt.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},Lt.prototype.toArray=function(){return this.take(4294967295)},sn(Lt.prototype,function(t,n){var r=/^(?:filter|find|map|reject)|While$/.test(n),e=/^(?:head|last)$/.test(n),u=jt[e?"take"+("last"==n?"Right":""):n],o=e||/^find/.test(n);u&&(jt.prototype[n]=function(){ 115 | function n(t){return t=u.apply(jt,l([t],f)),e&&h?t[0]:t}var i=this.__wrapped__,f=e?[1]:arguments,c=i instanceof Lt,a=f[0],s=c||li(i);s&&r&&typeof a=="function"&&1!=a.length&&(c=s=false);var h=this.__chain__,p=!!this.__actions__.length,a=o&&!h,c=c&&!p;return!o&&s?(i=c?i:new Lt(this),i=t.apply(i,f),i.__actions__.push({func:ve,args:[n],thisArg:N}),new wt(i,h)):a&&c?t.apply(this,f):(i=this.thru(n),a?e?i.value()[0]:i.value():i)})}),u("pop push shift sort splice unshift".split(" "),function(t){var n=bu[t],r=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",e=/^(?:pop|shift)$/.test(t); 116 | jt.prototype[t]=function(){var t=arguments;if(e&&!this.__chain__){var u=this.value();return n.apply(li(u)?u:[],t)}return this[r](function(r){return n.apply(li(r)?r:[],t)})}}),sn(Lt.prototype,function(t,n){var r=jt[n];if(r){var e=r.name+"";(co[e]||(co[e]=[])).push({name:n,func:r})}}),co[jr(N,2).name]=[{name:"wrapper",func:N}],Lt.prototype.clone=function(){var t=new Lt(this.__wrapped__);return t.__actions__=cr(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=cr(this.__iteratees__), 117 | t.__takeCount__=this.__takeCount__,t.__views__=cr(this.__views__),t},Lt.prototype.reverse=function(){if(this.__filtered__){var t=new Lt(this);t.__dir__=-1,t.__filtered__=true}else t=this.clone(),t.__dir__*=-1;return t},Lt.prototype.value=function(){var t,n=this.__wrapped__.value(),r=this.__dir__,e=li(n),u=0>r,o=e?n.length:0;t=o;for(var i=this.__views__,f=0,c=-1,a=i.length;++co||o==t&&a==t)return Hn(n,this.__actions__);e=[];t:for(;t--&&a>c;){for(u+=r,o=-1,l=n[u];++o=this.__values__.length,n=t?N:this.__values__[this.__index__++];return{done:t,value:n}},jt.prototype.plant=function(t){for(var n,r=this;r instanceof mt;){var e=oe(r);e.__index__=0,e.__values__=N,n?u.__wrapped__=e:n=e;var u=e,r=r.__wrapped__}return u.__wrapped__=t,n},jt.prototype.reverse=function(){var t=this.__wrapped__;return t instanceof Lt?(this.__actions__.length&&(t=new Lt(this)),t=t.reverse(),t.__actions__.push({func:ve, 120 | args:[se],thisArg:N}),new wt(t,this.__chain__)):this.thru(se)},jt.prototype.toJSON=jt.prototype.valueOf=jt.prototype.value=function(){return Hn(this.__wrapped__,this.__actions__)},Uu&&(jt.prototype[Uu]=ge),jt}var N,P=1/0,Z=NaN,T=/\b__p\+='';/g,q=/\b(__p\+=)''\+/g,V=/(__e\(.*?\)|\b__t\))\+'';/g,K=/&(?:amp|lt|gt|quot|#39|#96);/g,G=/[&<>"'`]/g,J=RegExp(K.source),Y=RegExp(G.source),H=/<%-([\s\S]+?)%>/g,Q=/<%([\s\S]+?)%>/g,X=/<%=([\s\S]+?)%>/g,tt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,nt=/^\w*$/,rt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,et=/[\\^$.*+?()[\]{}|]/g,ut=RegExp(et.source),ot=/^\s+|\s+$/g,it=/^\s+/,ft=/\s+$/,ct=/[a-zA-Z0-9]+/g,at=/\\(\\)?/g,lt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,st=/\w*$/,ht=/^0x/i,pt=/^[-+]0x[0-9a-f]+$/i,_t=/^0b[01]+$/i,vt=/^\[object .+?Constructor\]$/,gt=/^0o[0-7]+$/i,dt=/^(?:0|[1-9]\d*)$/,yt=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,bt=/($^)/,xt=/['\n\r\u2028\u2029\\]/g,jt="[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?(?:\\u200d(?:[^\\ud800-\\udfff]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])[\\ufe0e\\ufe0f]?(?:[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|\\ud83c[\\udffb-\\udfff])?)*",mt="(?:[\\u2700-\\u27bf]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff])"+jt,wt="(?:[^\\ud800-\\udfff][\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]?|[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]|(?:\\ud83c[\\udde6-\\uddff]){2}|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff])",At=RegExp("['\u2019]","g"),Ot=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0]","g"),kt=RegExp("\\ud83c[\\udffb-\\udfff](?=\\ud83c[\\udffb-\\udfff])|"+wt+jt,"g"),Et=RegExp(["[A-Z\\xc0-\\xd6\\xd8-\\xde]?[a-z\\xdf-\\xf6\\xf8-\\xff]+(?:['\u2019](?:d|ll|m|re|s|t|ve))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde]|$)|(?:[A-Z\\xc0-\\xd6\\xd8-\\xde]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?(?=[\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000]|[A-Z\\xc0-\\xd6\\xd8-\\xde](?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])|$)|[A-Z\\xc0-\\xd6\\xd8-\\xde]?(?:[a-z\\xdf-\\xf6\\xf8-\\xff]|[^\\ud800-\\udfff\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\d+\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde])+(?:['\u2019](?:d|ll|m|re|s|t|ve))?|[A-Z\\xc0-\\xd6\\xd8-\\xde]+(?:['\u2019](?:D|LL|M|RE|S|T|VE))?|\\d+",mt].join("|"),"g"),It=RegExp("[\\u200d\\ud800-\\udfff\\u0300-\\u036f\\ufe20-\\ufe23\\u20d0-\\u20f0\\ufe0e\\ufe0f]"),St=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Rt="Array Buffer DataView Date Error Float32Array Float64Array Function Int8Array Int16Array Int32Array Map Math Object Promise Reflect RegExp Set String Symbol TypeError Uint8Array Uint8ClampedArray Uint16Array Uint32Array WeakMap _ clearTimeout isFinite parseInt setTimeout".split(" "),Wt={}; 121 | Wt["[object Float32Array]"]=Wt["[object Float64Array]"]=Wt["[object Int8Array]"]=Wt["[object Int16Array]"]=Wt["[object Int32Array]"]=Wt["[object Uint8Array]"]=Wt["[object Uint8ClampedArray]"]=Wt["[object Uint16Array]"]=Wt["[object Uint32Array]"]=true,Wt["[object Arguments]"]=Wt["[object Array]"]=Wt["[object ArrayBuffer]"]=Wt["[object Boolean]"]=Wt["[object DataView]"]=Wt["[object Date]"]=Wt["[object Error]"]=Wt["[object Function]"]=Wt["[object Map]"]=Wt["[object Number]"]=Wt["[object Object]"]=Wt["[object RegExp]"]=Wt["[object Set]"]=Wt["[object String]"]=Wt["[object WeakMap]"]=false; 122 | var Bt={};Bt["[object Arguments]"]=Bt["[object Array]"]=Bt["[object ArrayBuffer]"]=Bt["[object DataView]"]=Bt["[object Boolean]"]=Bt["[object Date]"]=Bt["[object Float32Array]"]=Bt["[object Float64Array]"]=Bt["[object Int8Array]"]=Bt["[object Int16Array]"]=Bt["[object Int32Array]"]=Bt["[object Map]"]=Bt["[object Number]"]=Bt["[object Object]"]=Bt["[object RegExp]"]=Bt["[object Set]"]=Bt["[object String]"]=Bt["[object Symbol]"]=Bt["[object Uint8Array]"]=Bt["[object Uint8ClampedArray]"]=Bt["[object Uint16Array]"]=Bt["[object Uint32Array]"]=true, 123 | Bt["[object Error]"]=Bt["[object Function]"]=Bt["[object WeakMap]"]=false;var Lt={"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O", 124 | "\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss"},Ct={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Mt={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Ut={"function":true,object:true},zt={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029" 125 | },Dt=parseFloat,$t=parseInt,Ft=Ut[typeof exports]&&exports&&!exports.nodeType?exports:N,Nt=Ut[typeof module]&&module&&!module.nodeType?module:N,Pt=Nt&&Nt.exports===Ft?Ft:N,Zt=I(Ut[typeof self]&&self),Tt=I(Ut[typeof window]&&window),qt=I(Ut[typeof this]&&this),Vt=I(Ft&&Nt&&typeof global=="object"&&global)||Tt!==(qt&&qt.window)&&Tt||Zt||qt||Function("return this")(),Kt=F();(Tt||Zt||{})._=Kt,typeof define=="function"&&typeof define.amd=="object"&&define.amd? define(function(){return Kt}):Ft&&Nt?(Pt&&((Nt.exports=Kt)._=Kt), 126 | Ft._=Kt):Vt._=Kt}).call(this); --------------------------------------------------------------------------------