diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 000000000..78c462c03 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,24 @@ +{ + "env": { + "browser": true, + "es6": true, + "node": true, + "jquery": true + }, + "parser": "babel-eslint", + "extends": "eslint:recommended", + "globals": { + "Atomics": "readonly", + "SharedArrayBuffer": "readonly" + }, + "parserOptions": { + "ecmaVersion": 6, + "sourceType": "module" + }, + "rules": { + "no-undef": "off", + "no-unused-vars": "off", + "no-prototype-builtins": "off", + "no-inner-declarations": "off" + } +} \ No newline at end of file diff --git a/README.md b/README.md index 7f170cdb2..553fdd79b 100755 --- a/README.md +++ b/README.md @@ -1,72 +1,59 @@ -Assignment 4 - Creative Coding: Interactive Multimedia Experiences -=== +## A4: Wavelength -Due: September 27th, by 11:59 PM. +https://a4-kitzeller.herokuapp.com -For this assignment we will focus on client-side development using popular audio/graphics/visualization technologies; the server requirements are minimal. The goal of this assignment is to refine our JavaScript knowledge while exploring the multimedia capabilities of the browser. +Wavelength is a web application that facilitates real-time audio-visual collaboration. It makes use of +[Hydra](https://github.com/ojack/hydra), [Tone.js](https://tonejs.github.io/), +[Magenta.js](https://magenta.tensorflow.org/), [Gibber](https://github.com/charlieroberts/gibber.audio.lib), [Babylon.js](https://www.babylonjs.com/), and Canvas2d. +The goal of the app is to allow users to work on live-coding projects together in real-time, without having to be physically +present. The app allows interaction with pre-existing music/visual libraries, as well as tools and interfaces I created. +Most of the challenges faced were related to websockets, audio timing, and figuring out when states should be saved, given that multiple +users are editing the same content. +Several challenges arose with using different canvases and contexts, webgl, 2d, etc. As well as having several audio +contexts and sources. -Baseline Requirements ---- +I used the built-in standard ESLint plugin on WebStorm, as well as running Code Inspection. I also used w3 to validate my HTML and CSS files, both +on the website and the WebStorm plugin. I used 'eslint:recommended', adding support for jqeury. I also disabled some of the rules, +like 'no-undef', as they were not happy with some of the js files I had to browserify to use within my app. -Your application is required to implement the following functionalities: +I created ES6 modules for the sequencer and the piano. Also, for user interaction, I made use of dat.gui input, mouse movement, +keypress events, file drag/drop, MIDI input and microphone/camera input. -- A server created using Express (you can also use an alternative server framework such as Koa) for basic file delivery and middleware. Your middleware stack should include the `compression` and `helmet` [middlewares]((https://expressjs.com/en/resources/middleware.html)) by default. You are not required to use Glitch for this assignment (but using Glitch is fine!); [Heroku](https://www.heroku.com) is another excellent option to explore. The course staff can't be resposible for helping with all other hosting options outside of Glitch, but some of us do have experience with other systems. It also never hurts to ask on Slack, as there's 99 other classmates who might have the experience you're looking for! -- A client-side interactive experience using at least one of the web technologies frameworks we discussed in class over the past week. - - [Three.js](https://threejs.org/): A library for 3D graphics / VR experiences - - [D3.js](https://d3js.org): A library that is primarily used for interactive data visualizations - - [Canvas](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API): A 2D raster drawing API included in all modern browsers - - [SVG](https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API): A 2D vector drawing framework that enables shapes to be defined via XML. - - [Web Audio API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API): An API for audio synthesis, analysis, processing, and file playback. -- A user interface for interaction with your project, which must expose at least six parameters for user control. [dat.gui](https://workshop.chromeexperiments.com/examples/gui/#1--Basic-Usage) is highly recommended for this. You might also explore interaction by tracking mouse movement via the `window.onmousemove` event handler in tandem with the `event.clientX` and `event.clientY` properties. Consider using the [Pointer Events API](https://developer.mozilla.org/en-US/docs/Web/API/Pointer_events) to ensure that that mouse and touch events will both be supported in your app. -- Your application should display basic documentation for the user interface when the application first loads. This documentation should be dismissable, however, users should be able to redisplay it via either a help buton (this could, for example, be inside a dat.gui interface) or via a keyboard shortcut (commonly the question mark). -- Your application should feature at least two different ES6 modules that you write ([read about ES6 modules](https://www.sitepoint.com/understanding-es6-modules/)) and include into a main JavaScript file. This means that you will need to author *at least three JavaScript files* (a `app.js` or `main.js` file and two modules). We'll discuss modules in class on Monday 9/23; for this assignment modules should contain at least two functions. -- You are required to use a linter for your JavaScript. There are plugins for most IDEs, however it will be difficult to run the linter directly in Glitch. If you haven't moved to developing on your personal laptop and then uploading to Glitch when your project is completed, this is the assignment to do so! -- Your HTML and CSS should validate. There are options/plugins for most IDEs to check validation. +To test, you can create an account, or use: -The interactive experience should possess a reasonable level of complexity. Some examples: -### Three.js -- A generative algorithm creates simple agents that move through a virtual world. Your interface controls the behavior / appearance of these agents. -- A simple 3D game -- An 3D audio visualization of a song of your choosing. User interaction should control aspects of the visualization. -### Canvas -- Implement a generative algorithm such as [Conway's Game of Life](https://bitstorm.org/gameoflife/) (or 1D cellular automata) and provide interactive controls. Note that the Game of Life has been created by 100s of people using ; we'll be checking to ensure that your implementation is not a copy of these. -- Design a 2D audio visualizer of a song of your choosing. User interaction should control visual aspects of the experience. -### Web Audio API -- Create a screen-based musical instrument using the Web Audio API. You can use projects such as [Interface.js](http://charlie-roberts.com/interface/) or [Nexus UI](https://nexus-js.github.io/ui/api/#Piano) to provide common musical interface elements, or use dat.GUI in combination with mouse/touch events (use the Pointer Events API). Your GUI should enable users to control aspects of sound synthesis. -### D3.js -- Create visualizations using the datasets found at [Awesome JSON Datasets](https://github.com/jdorfman/Awesome-JSON-Datasets). Experiment with providing different visualizations of the same data set, and providing users interactive control over visualization parameters and/or data filtering. Alternatively, create a single visualization with using one of the more complicated techniques shown at [d3js.org](d3js.org) and provide meaningful points of interaction for users. +- username: kit +- password: secret -Deliverables ---- -Do the following to complete this assignment: +![tone_mode](img/a4_tone.png) -1. Implement your project with the above requirements. -3. Test your project to make sure that when someone goes to your main page on Glitch/Heroku/etc., it displays correctly. -4. Ensure that your project has the proper naming scheme `a4-yourname` so we can find it. -5. Fork this repository and modify the README to the specifications below. *NOTE: If you don't use Glitch for hosting (where we can see the files) then you must include all project files that you author in your repo for this assignment*. -6. Create and submit a Pull Request to the original repo. Name the pull request using the following template: `a4-gitname-firstname-lastname`. +![piano_mode](img/a4_piano.png) -Sample Readme (delete the above when you're ready to submit, and modify the below so with your links and descriptions) ---- +![midi_d3_mode](img/a4_midi_d3.png) -## Your Web Application Title +![audio_vis](img/a4_audiovis.png) -your hosting link e.g. http://a4-charlieroberts.glitch.me +Here's cool gif I made using gource which shows my commits to the project repo! -Include a very brief summary of your project here. Images are encouraged, along with concise, high-level text. Be sure to include: +![gource](img/gource.gif) -- the goal of the application -- challenges you faced in realizing the application -- a brief description of the JS linter you used and what rules it follows (we'll be looking at your JS files for consistency) ## Technical Achievements -- **Tech Achievement 1**: I wrote my own custom GLSL shaders to use as a material for my Three.js objects. -- **Tech Achievement 2**: My audiovisualizer uses both FFT and amplitude analysis to drive visualization. -- **Tech Achievement 3**: I optimized the efficiency of my reaction-diffusion algorithm by... -- **Tech Achievement 4**: I visualized the dataset X using three different visualization technqiues provided by D3, andprovided +- **Tech Achievement 1**: I created a MIDI File visualizer using d3.js, and added other audio visualizations using canvas2d and babylon.js. The midi +visualizer allows users to drag/drop files onto the page, or select from preloaded midi files on the bottom. The d3 mode allows users to draw sounds, + where the x-axis alters the frequency and the y-axis alters the amplitude of the sound. +- **Tech Achievement 2**: I improved the RNN model and fixed the midi piano, adding more keys to the piano as well as Dat.GUI support +for changing the piano attack and release, as well as the rnn step number and temperature (randomness). +- **Tech Achievement 3**: I updated the sequencer to give it two modes, a "synth" mode and a "drum" mode. The synth mode +produces sounds from Tone.js synths, whereas the drum mode allows users to toggle between various drumkits, like analog, electronic, percussion, dubstep and hiphop +using the "change" button, which is only enabled when the user is in drum mode. ### Design/Evaluation Achievements -- **Design Achievement 1**: I ensured that my application would run on both desktops / mobile devices by changing X -- **Design Achievement 2**: I followed best practices for accessibility, including providing alt attributes for images and using semantic HTML. There are no `
` or `` elements in my document. -- **Design Achievement 3**: We tested the application with n=X users, finding that... +- **Design Achievement 1**: I added more custom Hydra.js patterns to the "random" button in "hydra" mode. +- **Design Achievement 2**: I designed all the audio visualizations as well as the d3 midi visualisers and reactive synth instrument. +- **Design Achievement 3**: I designed the interaction for switching the drum pad mode from synth to drumkit. +- **Design Achievement 4**: I updated the edit mode capabilities, allowing users to move around more of the UI, like the button columns on the +left and right of the screen. I also updated which buttons are shown/hidden on each mode, making the UI much more intuitive and user-friendly. +This includes updating the "mode" button, so that now all possible modes appear, rather than forcing the user to cycle through each mode. +- **Design Achievement 5**: I added mouse support for the MIDI piano to remove any hardware requirements (for accessibility) +- **Design Achievement 6**: I tested my application on several people, making modifications to the UI/UX accordingly. diff --git a/img/a4_audiovis.png b/img/a4_audiovis.png new file mode 100644 index 000000000..f529ab624 Binary files /dev/null and b/img/a4_audiovis.png differ diff --git a/img/a4_midi_d3.png b/img/a4_midi_d3.png new file mode 100644 index 000000000..95758ad39 Binary files /dev/null and b/img/a4_midi_d3.png differ diff --git a/img/a4_piano.png b/img/a4_piano.png new file mode 100644 index 000000000..3f833f2ca Binary files /dev/null and b/img/a4_piano.png differ diff --git a/img/a4_tone.png b/img/a4_tone.png new file mode 100644 index 000000000..20b79be78 Binary files /dev/null and b/img/a4_tone.png differ diff --git a/img/gource.gif b/img/gource.gif new file mode 100644 index 000000000..1a8d3511a Binary files /dev/null and b/img/gource.gif differ diff --git a/models/session.js b/models/session.js new file mode 100644 index 000000000..dd9a78900 --- /dev/null +++ b/models/session.js @@ -0,0 +1,8 @@ +var mongoose = require('mongoose'); + +module.exports = mongoose.model('Session',{ + hydra: String, + name: String, + user: String, + tone: Array +}); \ No newline at end of file diff --git a/models/user.js b/models/user.js new file mode 100644 index 000000000..07d86001e --- /dev/null +++ b/models/user.js @@ -0,0 +1,9 @@ +var mongoose = require('mongoose'); + +module.exports = mongoose.model('User',{ + username: String, + password: String, + email: String, + gender: String, + address: String +}); \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 000000000..91285301c --- /dev/null +++ b/package.json @@ -0,0 +1,45 @@ +{ + "name": "a3-persistence", + "version": "1.0.0", + "description": "Assignment 3 - Persistence: Two-tier Web Application with Flat File Database, Express server, and CSS template ===", + "main": "server.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", + "start": "node server.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/kitzeller/a3-persistence.git" + }, + "author": "kit zellerbach", + "license": "ISC", + "bugs": { + "url": "https://github.com/kitzeller/a3-persistence/issues" + }, + "homepage": "https://github.com/kitzeller/a3-persistence#readme", + "dependencies": { + "babel-eslint": "^10.0.3", + "bcryptjs": "^2.4.3", + "compression": "^1.7.4", + "connect-ensure-login": "^0.1.1", + "cookie-parser": "^1.4.4", + "ejs": "^2.7.1", + "express": "^4.17.1", + "express-session": "^1.16.2", + "helmet": "^3.21.0", + "hydra-synth": "^1.0.25", + "lowdb": "^1.0.0", + "mongoose": "^5.7.1", + "morgan": "^1.9.1", + "passport": "^0.4.0", + "passport-local": "^1.0.0", + "response-time": "^2.3.2", + "serve-favicon": "^2.5.0", + "socket.io": "^2.2.0", + "timesync": "^1.0.3", + "uuid": "^3.3.3" + }, + "devDependencies": { + "eslint": "^6.4.0" + } +} diff --git a/public/css/main.css b/public/css/main.css new file mode 100755 index 000000000..78da8abe0 --- /dev/null +++ b/public/css/main.css @@ -0,0 +1,453 @@ +/*////////////////////////////////////////////////////////////////// +[ FONT ]*/ + +@font-face { + font-family: Ubuntu-Regular; + src: url('../fonts/ubuntu/Ubuntu-Regular.ttf'); +} + +@font-face { + font-family: Ubuntu-Bold; + src: url('../fonts/ubuntu/Ubuntu-Bold.ttf'); +} + +/*////////////////////////////////////////////////////////////////// +[ RESTYLE TAG ]*/ + +* { + margin: 0; + padding: 0; + box-sizing: border-box; +} + +body, html { + height: 100%; + font-family: Ubuntu-Regular, sans-serif; +} + +/*---------------------------------------------*/ +a { + font-family: Ubuntu-Regular; + font-size: 14px; + line-height: 1.7; + color: #666666; + margin: 0; + transition: all 0.4s; + -webkit-transition: all 0.4s; + -o-transition: all 0.4s; + -moz-transition: all 0.4s; +} + +a:focus { + outline: none !important; +} + +a:hover { + text-decoration: none; + color: #403866; +} + +/*---------------------------------------------*/ +h1, h2, h3, h4, h5, h6 { + margin: 0; +} + +p { + font-family: Ubuntu-Regular; + font-size: 14px; + line-height: 1.7; + color: #666666; + margin: 0; +} + +ul, li { + margin: 0; + list-style-type: none; +} + + +/*---------------------------------------------*/ +input { + outline: none; + border: none; +} + +textarea { + outline: none; + border: none; +} + +textarea:focus, input:focus { + border-color: transparent !important; +} + +input::-webkit-input-placeholder { + color: #8f8fa1; +} + +input:-moz-placeholder { + color: #8f8fa1; +} + +input::-moz-placeholder { + color: #8f8fa1; +} + +input:-ms-input-placeholder { + color: #8f8fa1; +} + +textarea::-webkit-input-placeholder { + color: #8f8fa1; +} + +textarea:-moz-placeholder { + color: #8f8fa1; +} + +textarea::-moz-placeholder { + color: #8f8fa1; +} + +textarea:-ms-input-placeholder { + color: #8f8fa1; +} + +label { + display: block; + margin: 0; +} + +/*---------------------------------------------*/ +button { + outline: none !important; + border: none; + background: transparent; +} + +button:hover { + cursor: pointer; +} + +iframe { + border: none !important; +} + + +/*////////////////////////////////////////////////////////////////// +[ Utility ]*/ +.txt1 { + font-family: Ubuntu-Regular; + font-size: 16px; + color: #827ffe; + line-height: 1.4; +} + + +/*////////////////////////////////////////////////////////////////// +[ login ]*/ + +.limiter { + width: 100%; + margin: 0 auto; +} + +.container-login100 { + width: 100%; + min-height: 100vh; + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + flex-wrap: wrap; + justify-content: center; + align-items: center; + padding: 15px; + + transform: translateY(20%); + + background-position: center; + background-size: cover; + background-repeat: no-repeat;; +} + + +.wrap-login100 { + width: 390px; + background: rgba(255, 255, 255, 0.5); + border-radius: 10px; + position: relative; + padding: 40px; +} + + +/*================================================================== +[ Form ]*/ + +.login100-form { + width: 100%; +} + +.login100-form-title { + font-family: Ubuntu-Bold; + font-size: 30px; + color: #403866; + line-height: 1.2; + text-transform: uppercase; + text-align: center; + + width: 100%; + display: block; +} + + +/*------------------------------------------------------------------ +[ Input ]*/ + +.wrap-input100 { + width: 100%; + position: relative; + background-color: #e6e6e6; + border: 1px solid transparent; + border-radius: 3px; +} + + +/*---------------------------------------------*/ +.input100 { + font-family: Ubuntu-Bold; + color: #403866; + line-height: 1.2; + font-size: 18px; + + display: block; + width: 100%; + background: transparent; + height: 62px; + padding: 0 20px 0 38px; +} + +/*------------------------------------------------------------------ +[ Focus Input ]*/ + +.focus-input100 { + position: absolute; + display: block; + width: calc(100% + 2px); + height: calc(100% + 2px); + top: -1px; + left: -1px; + pointer-events: none; + border: 1px solid #827ffe; + border-radius: 3px; + + visibility: hidden; + opacity: 0; + + -webkit-transition: all 0.4s; + -o-transition: all 0.4s; + -moz-transition: all 0.4s; + transition: all 0.4s; + + -webkit-transform: scaleX(1.1) scaleY(1.3); + -moz-transform: scaleX(1.1) scaleY(1.3); + -ms-transform: scaleX(1.1) scaleY(1.3); + -o-transform: scaleX(1.1) scaleY(1.3); + transform: scaleX(1.1) scaleY(1.3); +} + +.input100:focus + .focus-input100 { + visibility: visible; + opacity: 1; + + -webkit-transform: scale(1); + -moz-transform: scale(1); + -ms-transform: scale(1); + -o-transform: scale(1); + transform: scale(1); +} + +.eff-focus-selection { + visibility: visible; + opacity: 1; + + -webkit-transform: scale(1); + -moz-transform: scale(1); + -ms-transform: scale(1); + -o-transform: scale(1); + transform: scale(1); +} + + +/*================================================================== +[ Restyle Checkbox ]*/ + +.input-checkbox100 { + display: none; +} + +.label-checkbox100 { + font-family: Ubuntu-Regular; + font-size: 16px; + color: #999999; + line-height: 1.2; + + display: block; + position: relative; + padding-left: 26px; + cursor: pointer; +} + +.label-checkbox100::before { + content: "\f00c"; + font-family: FontAwesome; + font-size: 13px; + color: transparent; + + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + justify-content: center; + align-items: center; + position: absolute; + width: 18px; + height: 18px; + border-radius: 3px; + background: #fff; + border: 2px solid #827ffe; + left: 0; + top: 50%; + -webkit-transform: translateY(-50%); + -moz-transform: translateY(-50%); + -ms-transform: translateY(-50%); + -o-transform: translateY(-50%); + transform: translateY(-50%); +} + +.input-checkbox100:checked + .label-checkbox100::before { + color: #0e0c0e; +} + + +/*------------------------------------------------------------------ +[ Button ]*/ +.container-login100-form-btn { + width: 100%; + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + flex-wrap: wrap; +} + +.login100-form-btn { + font-family: Ubuntu-Bold; + font-size: 16px; + color: #fff; + line-height: 1.2; + text-transform: uppercase; + + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + justify-content: center; + align-items: center; + padding: 0 20px; + width: 100%; + height: 62px; + background-color: rgba(0, 0, 0, 0.5); + border-radius: 3px; + + -webkit-transition: all 0.4s; + -o-transition: all 0.4s; + -moz-transition: all 0.4s; + transition: all 0.4s; +} + +.login100-form-btn:hover { + background-color: #403866; +} + + +/*------------------------------------------------------------------ +[ Alert validate ]*/ + +.validate-input { + position: relative; +} + +.alert-validate::before { + content: attr(data-validate); + position: absolute; + max-width: 70%; + background-color: #fff; + border: 1px solid #c80000; + border-radius: 3px; + padding: 4px 25px 5px 10px; + top: 50%; + -webkit-transform: translateY(-50%); + -moz-transform: translateY(-50%); + -ms-transform: translateY(-50%); + -o-transform: translateY(-50%); + transform: translateY(-50%); + right: 12px; + pointer-events: none; + + font-family: Ubuntu-Regular; + color: #c80000; + font-size: 14px; + line-height: 1.4; + text-align: left; + + visibility: hidden; + opacity: 0; + + -webkit-transition: opacity 0.4s; + -o-transition: opacity 0.4s; + -moz-transition: opacity 0.4s; + transition: opacity 0.4s; +} + +.alert-validate::after { + content: "\f12a"; + font-family: FontAwesome; + display: block; + position: absolute; + color: #c80000; + font-size: 18px; + top: 50%; + -webkit-transform: translateY(-50%); + -moz-transform: translateY(-50%); + -ms-transform: translateY(-50%); + -o-transform: translateY(-50%); + transform: translateY(-50%); + right: 18px; +} + +.alert-validate:hover:before { + visibility: visible; + opacity: 1; +} + +@media (max-width: 992px) { + .alert-validate::before { + visibility: visible; + opacity: 1; + } +} + +#refresh { + position: absolute; + padding: 10px; + left: 0; + bottom: 0; + z-index: 10; + color: white; + font-size: 30px; +} \ No newline at end of file diff --git a/public/css/simple-sidebar.css b/public/css/simple-sidebar.css new file mode 100755 index 000000000..cf9381fca --- /dev/null +++ b/public/css/simple-sidebar.css @@ -0,0 +1,79 @@ +/*! + * Start Bootstrap - Simple Sidebar (https://startbootstrap.com/template-overviews/simple-sidebar) + * Copyright 2013-2019 Start Bootstrap + * Licensed under MIT (https://github.com/BlackrockDigital/startbootstrap-simple-sidebar/blob/master/LICENSE) + */ +body { + overflow-x: hidden; + color: white; +} + +a { + color: white; +} + +#sidebar-wrapper { + min-height: 100vh; + margin-left: -15rem; + -webkit-transition: margin .25s ease-out; + -moz-transition: margin .25s ease-out; + -o-transition: margin .25s ease-out; + transition: margin .25s ease-out; +} + +#sidebar-wrapper .sidebar-heading { + padding: 0.875rem 1.25rem; + font-size: 1.2rem; +} + +#sidebar-wrapper .list-group { + width: 15rem; +} + +.list-group-item { + color: white; +} + +.navbar-light .navbar-nav .nav-link { + color: white; +} + +#page-content-wrapper { + min-width: 100vw; +} + +#wrapper.toggled #sidebar-wrapper { + margin-left: 0; +} + +@media (min-width: 768px) { + #sidebar-wrapper { + margin-left: 0; + } + + #page-content-wrapper { + min-width: 0; + width: 100%; + } + + #wrapper.toggled #sidebar-wrapper { + margin-left: -15rem; + } +} + + +.bg-darkish { + background-color: #4d545c; +} + +.hidden { + display: none; +} + +/*ul {*/ +/* list-style-type: none;*/ +/*}*/ + + + + diff --git a/public/css/style.css b/public/css/style.css new file mode 100644 index 000000000..3b818286c --- /dev/null +++ b/public/css/style.css @@ -0,0 +1,514 @@ +@import 'https://fonts.googleapis.com/css?family=Oswald'; + +html, body { + height: 100%; + width: 100%; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + overflow: hidden; + font-family: 'Oswald', sans-serif; +} + +h1 { + color: #fff; + font-size: 6vw; + letter-spacing: 6px; +} + +canvas { + z-index: -1; + position: absolute; + top: 0; + left: 0; + height: 100%; + width: 100%; +} + +.fixed-header { + z-index: 0; + position: fixed; + transform: translateY(-30%); +} + +.fixed-header h1 { + opacity: 0.8; + color: rgba(255, 255, 255, 1); + font-size: 19.5vw; + letter-spacing: 6.5px; + text-shadow: -0.5px -0.5px 10px #000, + 0.5px -0.5px 10px #000, + -0.5px 0.5px 10px #000, + 0.5px 0.5px 10px #000; +} + +.subheading { + color: #fff; + font-size: 3vw; + letter-spacing: 6px; + margin: 0; +} + +/* Piano */ + +.piano { + width: 750px; + display: flex; + justify-content: space-between; + flex-wrap: wrap; + z-index: 1; +} + + +.keys { + display: block; + width: 100%; + height: 350px; + max-width: 880px; + position: relative; + margin: 40px auto 0; +} + +.key { + position: relative; + border: 4px solid black; + border-radius: .5rem; + transition: all .07s ease; + display: block; + box-sizing: border-box; + z-index: 2; +} + +.key:not(.sharp) { + float: left; + width: 7%; + height: 100%; + background: rgba(255, 255, 255, .8); +} + +.key.sharp { + position: absolute; + width: 5%; + height: 60%; + background: #000; + color: #eee; + top: 0; + z-index: 3; +} + +.key[data-key="49"] { + left: 4.5%; +} + +.key[data-key="51"] { + left: 11.5%; +} + +.key[data-key="54"] { + left: 25.5%; +} + +.key[data-key="56"] { + left: 32.5%; +} + +.key[data-key="58"] { + left: 39.5%; +} + +.key[data-key="61"] { + left: 53.5%; +} + +.key[data-key="63"] { + left: 60.5%; +} + +.key[data-key="66"] { + left: 74.5%; +} + +.key[data-key="68"] { + left: 81.5%; +} + +.key[data-key="70"] { + left: 88.5%; +} + +.playing { + transform: scale(.95); + border-color: #028ae9; + box-shadow: 0 0 1rem #028ae9; +} + +.hints { + display: block; + width: 100%; + opacity: 0; + position: absolute; + bottom: 7px; + transition: opacity .3s ease-out; + font-size: 20px; +} + +/*.keys:hover .hints {*/ +/* opacity: 1;*/ +/*}*/ + +/* Pads & Boxes */ + +.pad { + width: 550px; + display: flex; + justify-content: space-between; + flex-wrap: wrap; +} + + +.pad-top { + width: 650px; + display: flex; + justify-content: space-between; + flex-wrap: wrap; + position: absolute; + top: 0; +} + +.pad-bottom { + width: 800px; + display: flex; + justify-content: space-between; + flex-wrap: wrap; + position: absolute; + bottom: 0; + z-index: 2; +} + + +.box { + width: 70px; + height: 70px; + margin: 10px 0; + box-shadow: 0 8px 6px -6px black; + background-color: #606060; + display: flex; + justify-content: center; + align-items: center; + font-size: 20px; + color: rgba(255, 255, 255, 0.8); + user-select: none; +} + +.fake-box { + width: 60px; + height: 60px; + margin: 10px 0; + box-shadow: 0 8px 6px -6px black; + background-color: #606060; + display: flex; + justify-content: center; + align-items: center; + font-size: 12px; + color: rgba(255, 255, 255, 0.8); + user-select: none; +} + +.fake-box:hover { + cursor: pointer; + background-color: rgba(0, 0, 0, 0.8); +} + +.box:hover { + cursor: pointer; + background-color: rgba(0, 0, 0, 0.8); +} + +.hover { + cursor: pointer; + background-color: rgba(0, 0, 0, 0.8); +} + +.box-active { + transform: scale(1.3); + transition: all .2s; +} + +/*Specific Pads*/ + +.pad-e { + border: 2px solid #553bcc; +} + +.pad-0 { + border: 2px solid #c3cc1e; +} + +.pad-1 { + border: 2px solid #2ecc71; +} + +.pad-2 { + border: 2px solid #E5446D; +} + +.pad-3 { + border: 2px solid #1abc9c; +} + +.pad-h { + border: 1px solid #b0b0b0; +} + +.pad-y { + border: 2px solid #19b095; + font-size: 16px; +} + +/* Floating
*/ + +#logout-div { + z-index: 100; + margin: 10px; + position: absolute; + right: 0; + top: 50%; + transform: translate(0, -50%); +} + +#session-div { + z-index: 100; + margin: 10px; + position: absolute; + left: 0; + top: 50%; + transform: translate(0, -50%); +} + +#profile-div { + z-index: 100; + margin: 10px; + position: absolute; + right: 0; + bottom: 0; +} + +#help-div { + z-index: 100; + margin: 10px; + position: absolute; + left: 0; + bottom: 0; +} + +.CodeMirror { + position: absolute; + top: 20px; + left: 20px; + z-index: 1; + width: calc(100% - 20px); + height: calc(100% - 20px); + background: transparent; + display: none; +} + + +button:disabled { + background-color: rgba(158, 158, 158, 0.76); +} + +#myCanvas { + position: absolute; + top: 0; + left: 0; + height: 100%; + width: 100%; +} + +/*AudioVisual Section*/ + +.ghost-button { + display: inline-block; + width: 150px; + font-weight: bold; + padding: 8px; + color: white; + border: 3px solid white; + text-align: center; + outline: none; + text-decoration: none; + background-color: transparent; + transition: background-color 0.2s ease-out, + color 0.2s ease-out; +} + +.ghost-button:hover, +.ghost-button:active { + background-color: white; + color: #000; + transition: background-color 0.3s ease-in, + color 0.3s ease-in; +} + +.ghost-active { + background-color: white; + color: #000; + transition: background-color 0.3s ease-in, + color 0.3s ease-in; +} + +/*D3 STYLE*/ + +#d3 { + z-index: 1; + margin: 0; + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} + +#midi-container { + background-color: black; +} + +#svg-container { + background-color: black; +} + +rect { + fill: none; + pointer-events: all; +} + +circle { + fill: none; + stroke-width: 2.5px; +} + + +/*Snackbar*/ + + +#snackbar { + visibility: hidden; + min-width: 250px; + margin-left: -125px; + background-color: #333; + color: #fff; + text-align: center; + border-radius: 2px; + padding: 16px; + position: fixed; + left: 50%; + bottom: 30px; + font-size: 17px; + z-index: 100; +} + +#snackbar.show { + visibility: visible; + -webkit-animation: fadein 0.5s, fadeout 0.5s 2.5s; + animation: fadein 0.5s, fadeout 0.5s 2.5s; +} + +@-webkit-keyframes fadein { + from { + bottom: 0; + opacity: 0; + } + to { + bottom: 30px; + opacity: 1; + } +} + +@keyframes fadein { + from { + bottom: 0; + opacity: 0; + } + to { + bottom: 30px; + opacity: 1; + } +} + +@-webkit-keyframes fadeout { + from { + bottom: 30px; + opacity: 1; + } + to { + bottom: 0; + opacity: 0; + } +} + +@keyframes fadeout { + from { + bottom: 30px; + opacity: 1; + } + to { + bottom: 0; + opacity: 0; + } +} + + +/*Drop*/ + + +#drop_zone { + width: 100%; + height: 100%; + position: absolute; + top: 0; + left: 0; + text-align: center; + background-color: black; + color: white; + z-index: 2; +} + +#svg-container { + background-color: black; + width: 100%; + height: 100%; + margin: 0; + position: absolute; + top: 0; + left: 0; +} + + +.modal { + max-width: 800px; +} + +/* Dropdown */ + +/* The container
- needed to position the dropdown content */ +.dropdown { + display: flex; +} + +/* Dropdown Content (Hidden by Default) */ +.dropdown-content { + display: none; + justify-content: space-between; + flex-wrap: wrap; + position: absolute; + left: 70px; + width: 470px; + z-index: 1; +} + + +/* Show the dropdown menu (use JS to add this class to the .dropdown-content container when the user clicks on the dropdown button) */ +.drp-show { + display: flex; +} \ No newline at end of file diff --git a/public/css/tomorrow-night-eighties.css b/public/css/tomorrow-night-eighties.css new file mode 100644 index 000000000..0bb2ccc1d --- /dev/null +++ b/public/css/tomorrow-night-eighties.css @@ -0,0 +1,131 @@ +/* + + Name: Tomorrow Night - Eighties + Author: Chris Kempson + + CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) + Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) + +*/ + +/*.cm-s-tomorrow-night-eighties.CodeMirror { background: #000000; color: #CCCCCC; }*/ + +/*OJ*/ +.cm-s-tomorrow-night-eighties.CodeMirror { + background: rgba(0, 0, 0, 0); + color: #cccccc; + font-size: 20px; + height: 100%; +} + +.cm-s-tomorrow-night-eighties span span.CodeMirror-selectedtext { + background: #666666; +} + +.cm-s-tomorrow-night-eighties .CodeMirror-line::selection, +.cm-s-tomorrow-night-eighties .CodeMirror-line > span::selection, +.cm-s-tomorrow-night-eighties .CodeMirror-line > span > span::selection { + background: rgba(45, 45, 45, 0.99); +} + +.cm-s-tomorrow-night-eighties .CodeMirror-line::-moz-selection, +.cm-s-tomorrow-night-eighties .CodeMirror-line > span::-moz-selection, +.cm-s-tomorrow-night-eighties .CodeMirror-line > span > span::-moz-selection { + background: rgba(45, 45, 45, 0.99); +} + +.cm-s-tomorrow-night-eighties .CodeMirror-gutters { + background: #000000; + border-right: 0; +} + +.cm-s-tomorrow-night-eighties .CodeMirror-guttermarker { + color: #f2777a; +} + +.cm-s-tomorrow-night-eighties .CodeMirror-guttermarker-subtle { + color: #777; +} + +.cm-s-tomorrow-night-eighties .CodeMirror-linenumber { + color: #515151; +} + +.cm-s-tomorrow-night-eighties .CodeMirror-cursor { + border-left: 3px solid #999; +} + +/* OJ*/ +.cm-s-tomorrow-night-eighties .CodeMirror-line span { + background-color: rgba(0, 0, 0, 0.6); + color: #cccccc; +} + +/* fix weird alternating background colors */ +.cm-s-tomorrow-night-eighties .CodeMirror-line span span { + background-color: rgba(0, 0, 0, 0); +} + +.cm-s-tomorrow-night-eighties span.cm-comment { + color: #d27b53; +} + +.cm-s-tomorrow-night-eighties span.cm-atom { + color: #a16a94; +} + +.cm-s-tomorrow-night-eighties span.cm-number { + color: #a16a94; +} + +.cm-s-tomorrow-night-eighties span.cm-property, +.cm-s-tomorrow-night-eighties span.cm-attribute { + color: #99cc99; +} + +.cm-s-tomorrow-night-eighties span.cm-keyword { + color: #f2777a; +} + +.cm-s-tomorrow-night-eighties span.cm-string { + color: #ffcc66; +} + +.cm-s-tomorrow-night-eighties span.cm-variable { + color: #99cc99; +} + +.cm-s-tomorrow-night-eighties span.cm-variable-2 { + color: #6699cc; +} + +.cm-s-tomorrow-night-eighties span.cm-def { + color: #f99157; +} + +.cm-s-tomorrow-night-eighties span.cm-bracket { + color: #cccccc; +} + +.cm-s-tomorrow-night-eighties span.cm-tag { + color: #f2777a; +} + +.cm-s-tomorrow-night-eighties span.cm-link { + color: #a16a94; +} + +.cm-s-tomorrow-night-eighties span.cm-error { + background: #f2777a; + color: #6a6a6a; +} + +.cm-s-tomorrow-night-eighties .CodeMirror-activeline-background { + background: #343600; +} + +/*.cm-s-tomorrow-night-eighties .CodeMirror-activeline-background { background: #0f0; }*/ +.cm-s-tomorrow-night-eighties .CodeMirror-matchingbracket { + text-decoration: underline; + color: white !important; +} diff --git a/public/css/util.css b/public/css/util.css new file mode 100755 index 000000000..4ed3d1047 --- /dev/null +++ b/public/css/util.css @@ -0,0 +1,9826 @@ +/*[ FONT SIZE ] +/////////////////////////////////////////////////////////// +*/ +.fs-1 { + font-size: 1px; +} + +.fs-2 { + font-size: 2px; +} + +.fs-3 { + font-size: 3px; +} + +.fs-4 { + font-size: 4px; +} + +.fs-5 { + font-size: 5px; +} + +.fs-6 { + font-size: 6px; +} + +.fs-7 { + font-size: 7px; +} + +.fs-8 { + font-size: 8px; +} + +.fs-9 { + font-size: 9px; +} + +.fs-10 { + font-size: 10px; +} + +.fs-11 { + font-size: 11px; +} + +.fs-12 { + font-size: 12px; +} + +.fs-13 { + font-size: 13px; +} + +.fs-14 { + font-size: 14px; +} + +.fs-15 { + font-size: 15px; +} + +.fs-16 { + font-size: 16px; +} + +.fs-17 { + font-size: 17px; +} + +.fs-18 { + font-size: 18px; +} + +.fs-19 { + font-size: 19px; +} + +.fs-20 { + font-size: 20px; +} + +.fs-21 { + font-size: 21px; +} + +.fs-22 { + font-size: 22px; +} + +.fs-23 { + font-size: 23px; +} + +.fs-24 { + font-size: 24px; +} + +.fs-25 { + font-size: 25px; +} + +.fs-26 { + font-size: 26px; +} + +.fs-27 { + font-size: 27px; +} + +.fs-28 { + font-size: 28px; +} + +.fs-29 { + font-size: 29px; +} + +.fs-30 { + font-size: 30px; +} + +.fs-31 { + font-size: 31px; +} + +.fs-32 { + font-size: 32px; +} + +.fs-33 { + font-size: 33px; +} + +.fs-34 { + font-size: 34px; +} + +.fs-35 { + font-size: 35px; +} + +.fs-36 { + font-size: 36px; +} + +.fs-37 { + font-size: 37px; +} + +.fs-38 { + font-size: 38px; +} + +.fs-39 { + font-size: 39px; +} + +.fs-40 { + font-size: 40px; +} + +.fs-41 { + font-size: 41px; +} + +.fs-42 { + font-size: 42px; +} + +.fs-43 { + font-size: 43px; +} + +.fs-44 { + font-size: 44px; +} + +.fs-45 { + font-size: 45px; +} + +.fs-46 { + font-size: 46px; +} + +.fs-47 { + font-size: 47px; +} + +.fs-48 { + font-size: 48px; +} + +.fs-49 { + font-size: 49px; +} + +.fs-50 { + font-size: 50px; +} + +.fs-51 { + font-size: 51px; +} + +.fs-52 { + font-size: 52px; +} + +.fs-53 { + font-size: 53px; +} + +.fs-54 { + font-size: 54px; +} + +.fs-55 { + font-size: 55px; +} + +.fs-56 { + font-size: 56px; +} + +.fs-57 { + font-size: 57px; +} + +.fs-58 { + font-size: 58px; +} + +.fs-59 { + font-size: 59px; +} + +.fs-60 { + font-size: 60px; +} + +.fs-61 { + font-size: 61px; +} + +.fs-62 { + font-size: 62px; +} + +.fs-63 { + font-size: 63px; +} + +.fs-64 { + font-size: 64px; +} + +.fs-65 { + font-size: 65px; +} + +.fs-66 { + font-size: 66px; +} + +.fs-67 { + font-size: 67px; +} + +.fs-68 { + font-size: 68px; +} + +.fs-69 { + font-size: 69px; +} + +.fs-70 { + font-size: 70px; +} + +.fs-71 { + font-size: 71px; +} + +.fs-72 { + font-size: 72px; +} + +.fs-73 { + font-size: 73px; +} + +.fs-74 { + font-size: 74px; +} + +.fs-75 { + font-size: 75px; +} + +.fs-76 { + font-size: 76px; +} + +.fs-77 { + font-size: 77px; +} + +.fs-78 { + font-size: 78px; +} + +.fs-79 { + font-size: 79px; +} + +.fs-80 { + font-size: 80px; +} + +.fs-81 { + font-size: 81px; +} + +.fs-82 { + font-size: 82px; +} + +.fs-83 { + font-size: 83px; +} + +.fs-84 { + font-size: 84px; +} + +.fs-85 { + font-size: 85px; +} + +.fs-86 { + font-size: 86px; +} + +.fs-87 { + font-size: 87px; +} + +.fs-88 { + font-size: 88px; +} + +.fs-89 { + font-size: 89px; +} + +.fs-90 { + font-size: 90px; +} + +.fs-91 { + font-size: 91px; +} + +.fs-92 { + font-size: 92px; +} + +.fs-93 { + font-size: 93px; +} + +.fs-94 { + font-size: 94px; +} + +.fs-95 { + font-size: 95px; +} + +.fs-96 { + font-size: 96px; +} + +.fs-97 { + font-size: 97px; +} + +.fs-98 { + font-size: 98px; +} + +.fs-99 { + font-size: 99px; +} + +.fs-100 { + font-size: 100px; +} + +.fs-101 { + font-size: 101px; +} + +.fs-102 { + font-size: 102px; +} + +.fs-103 { + font-size: 103px; +} + +.fs-104 { + font-size: 104px; +} + +.fs-105 { + font-size: 105px; +} + +.fs-106 { + font-size: 106px; +} + +.fs-107 { + font-size: 107px; +} + +.fs-108 { + font-size: 108px; +} + +.fs-109 { + font-size: 109px; +} + +.fs-110 { + font-size: 110px; +} + +.fs-111 { + font-size: 111px; +} + +.fs-112 { + font-size: 112px; +} + +.fs-113 { + font-size: 113px; +} + +.fs-114 { + font-size: 114px; +} + +.fs-115 { + font-size: 115px; +} + +.fs-116 { + font-size: 116px; +} + +.fs-117 { + font-size: 117px; +} + +.fs-118 { + font-size: 118px; +} + +.fs-119 { + font-size: 119px; +} + +.fs-120 { + font-size: 120px; +} + +.fs-121 { + font-size: 121px; +} + +.fs-122 { + font-size: 122px; +} + +.fs-123 { + font-size: 123px; +} + +.fs-124 { + font-size: 124px; +} + +.fs-125 { + font-size: 125px; +} + +.fs-126 { + font-size: 126px; +} + +.fs-127 { + font-size: 127px; +} + +.fs-128 { + font-size: 128px; +} + +.fs-129 { + font-size: 129px; +} + +.fs-130 { + font-size: 130px; +} + +.fs-131 { + font-size: 131px; +} + +.fs-132 { + font-size: 132px; +} + +.fs-133 { + font-size: 133px; +} + +.fs-134 { + font-size: 134px; +} + +.fs-135 { + font-size: 135px; +} + +.fs-136 { + font-size: 136px; +} + +.fs-137 { + font-size: 137px; +} + +.fs-138 { + font-size: 138px; +} + +.fs-139 { + font-size: 139px; +} + +.fs-140 { + font-size: 140px; +} + +.fs-141 { + font-size: 141px; +} + +.fs-142 { + font-size: 142px; +} + +.fs-143 { + font-size: 143px; +} + +.fs-144 { + font-size: 144px; +} + +.fs-145 { + font-size: 145px; +} + +.fs-146 { + font-size: 146px; +} + +.fs-147 { + font-size: 147px; +} + +.fs-148 { + font-size: 148px; +} + +.fs-149 { + font-size: 149px; +} + +.fs-150 { + font-size: 150px; +} + +.fs-151 { + font-size: 151px; +} + +.fs-152 { + font-size: 152px; +} + +.fs-153 { + font-size: 153px; +} + +.fs-154 { + font-size: 154px; +} + +.fs-155 { + font-size: 155px; +} + +.fs-156 { + font-size: 156px; +} + +.fs-157 { + font-size: 157px; +} + +.fs-158 { + font-size: 158px; +} + +.fs-159 { + font-size: 159px; +} + +.fs-160 { + font-size: 160px; +} + +.fs-161 { + font-size: 161px; +} + +.fs-162 { + font-size: 162px; +} + +.fs-163 { + font-size: 163px; +} + +.fs-164 { + font-size: 164px; +} + +.fs-165 { + font-size: 165px; +} + +.fs-166 { + font-size: 166px; +} + +.fs-167 { + font-size: 167px; +} + +.fs-168 { + font-size: 168px; +} + +.fs-169 { + font-size: 169px; +} + +.fs-170 { + font-size: 170px; +} + +.fs-171 { + font-size: 171px; +} + +.fs-172 { + font-size: 172px; +} + +.fs-173 { + font-size: 173px; +} + +.fs-174 { + font-size: 174px; +} + +.fs-175 { + font-size: 175px; +} + +.fs-176 { + font-size: 176px; +} + +.fs-177 { + font-size: 177px; +} + +.fs-178 { + font-size: 178px; +} + +.fs-179 { + font-size: 179px; +} + +.fs-180 { + font-size: 180px; +} + +.fs-181 { + font-size: 181px; +} + +.fs-182 { + font-size: 182px; +} + +.fs-183 { + font-size: 183px; +} + +.fs-184 { + font-size: 184px; +} + +.fs-185 { + font-size: 185px; +} + +.fs-186 { + font-size: 186px; +} + +.fs-187 { + font-size: 187px; +} + +.fs-188 { + font-size: 188px; +} + +.fs-189 { + font-size: 189px; +} + +.fs-190 { + font-size: 190px; +} + +.fs-191 { + font-size: 191px; +} + +.fs-192 { + font-size: 192px; +} + +.fs-193 { + font-size: 193px; +} + +.fs-194 { + font-size: 194px; +} + +.fs-195 { + font-size: 195px; +} + +.fs-196 { + font-size: 196px; +} + +.fs-197 { + font-size: 197px; +} + +.fs-198 { + font-size: 198px; +} + +.fs-199 { + font-size: 199px; +} + +.fs-200 { + font-size: 200px; +} + +/*[ PADDING ] +/////////////////////////////////////////////////////////// +*/ +.p-t-0 { + padding-top: 0; +} + +.p-t-1 { + padding-top: 1px; +} + +.p-t-2 { + padding-top: 2px; +} + +.p-t-3 { + padding-top: 3px; +} + +.p-t-4 { + padding-top: 4px; +} + +.p-t-5 { + padding-top: 5px; +} + +.p-t-6 { + padding-top: 6px; +} + +.p-t-7 { + padding-top: 7px; +} + +.p-t-8 { + padding-top: 8px; +} + +.p-t-9 { + padding-top: 9px; +} + +.p-t-10 { + padding-top: 10px; +} + +.p-t-11 { + padding-top: 11px; +} + +.p-t-12 { + padding-top: 12px; +} + +.p-t-13 { + padding-top: 13px; +} + +.p-t-14 { + padding-top: 14px; +} + +.p-t-15 { + padding-top: 15px; +} + +.p-t-16 { + padding-top: 16px; +} + +.p-t-17 { + padding-top: 17px; +} + +.p-t-18 { + padding-top: 18px; +} + +.p-t-19 { + padding-top: 19px; +} + +.p-t-20 { + padding-top: 20px; +} + +.p-t-21 { + padding-top: 21px; +} + +.p-t-22 { + padding-top: 22px; +} + +.p-t-23 { + padding-top: 23px; +} + +.p-t-24 { + padding-top: 24px; +} + +.p-t-25 { + padding-top: 25px; +} + +.p-t-26 { + padding-top: 26px; +} + +.p-t-27 { + padding-top: 27px; +} + +.p-t-28 { + padding-top: 28px; +} + +.p-t-29 { + padding-top: 29px; +} + +.p-t-30 { + padding-top: 30px; +} + +.p-t-31 { + padding-top: 31px; +} + +.p-t-32 { + padding-top: 32px; +} + +.p-t-33 { + padding-top: 33px; +} + +.p-t-34 { + padding-top: 34px; +} + +.p-t-35 { + padding-top: 35px; +} + +.p-t-36 { + padding-top: 36px; +} + +.p-t-37 { + padding-top: 37px; +} + +.p-t-38 { + padding-top: 38px; +} + +.p-t-39 { + padding-top: 39px; +} + +.p-t-40 { + padding-top: 40px; +} + +.p-t-41 { + padding-top: 41px; +} + +.p-t-42 { + padding-top: 42px; +} + +.p-t-43 { + padding-top: 43px; +} + +.p-t-44 { + padding-top: 44px; +} + +.p-t-45 { + padding-top: 45px; +} + +.p-t-46 { + padding-top: 46px; +} + +.p-t-47 { + padding-top: 47px; +} + +.p-t-48 { + padding-top: 48px; +} + +.p-t-49 { + padding-top: 49px; +} + +.p-t-50 { + padding-top: 50px; +} + +.p-t-51 { + padding-top: 51px; +} + +.p-t-52 { + padding-top: 52px; +} + +.p-t-53 { + padding-top: 53px; +} + +.p-t-54 { + padding-top: 54px; +} + +.p-t-55 { + padding-top: 55px; +} + +.p-t-56 { + padding-top: 56px; +} + +.p-t-57 { + padding-top: 57px; +} + +.p-t-58 { + padding-top: 58px; +} + +.p-t-59 { + padding-top: 59px; +} + +.p-t-60 { + padding-top: 60px; +} + +.p-t-61 { + padding-top: 61px; +} + +.p-t-62 { + padding-top: 62px; +} + +.p-t-63 { + padding-top: 63px; +} + +.p-t-64 { + padding-top: 64px; +} + +.p-t-65 { + padding-top: 65px; +} + +.p-t-66 { + padding-top: 66px; +} + +.p-t-67 { + padding-top: 67px; +} + +.p-t-68 { + padding-top: 68px; +} + +.p-t-69 { + padding-top: 69px; +} + +.p-t-70 { + padding-top: 70px; +} + +.p-t-71 { + padding-top: 71px; +} + +.p-t-72 { + padding-top: 72px; +} + +.p-t-73 { + padding-top: 73px; +} + +.p-t-74 { + padding-top: 74px; +} + +.p-t-75 { + padding-top: 75px; +} + +.p-t-76 { + padding-top: 76px; +} + +.p-t-77 { + padding-top: 77px; +} + +.p-t-78 { + padding-top: 78px; +} + +.p-t-79 { + padding-top: 79px; +} + +.p-t-80 { + padding-top: 80px; +} + +.p-t-81 { + padding-top: 81px; +} + +.p-t-82 { + padding-top: 82px; +} + +.p-t-83 { + padding-top: 83px; +} + +.p-t-84 { + padding-top: 84px; +} + +.p-t-85 { + padding-top: 85px; +} + +.p-t-86 { + padding-top: 86px; +} + +.p-t-87 { + padding-top: 87px; +} + +.p-t-88 { + padding-top: 88px; +} + +.p-t-89 { + padding-top: 89px; +} + +.p-t-90 { + padding-top: 90px; +} + +.p-t-91 { + padding-top: 91px; +} + +.p-t-92 { + padding-top: 92px; +} + +.p-t-93 { + padding-top: 93px; +} + +.p-t-94 { + padding-top: 94px; +} + +.p-t-95 { + padding-top: 95px; +} + +.p-t-96 { + padding-top: 96px; +} + +.p-t-97 { + padding-top: 97px; +} + +.p-t-98 { + padding-top: 98px; +} + +.p-t-99 { + padding-top: 99px; +} + +.p-t-100 { + padding-top: 100px; +} + +.p-t-101 { + padding-top: 101px; +} + +.p-t-102 { + padding-top: 102px; +} + +.p-t-103 { + padding-top: 103px; +} + +.p-t-104 { + padding-top: 104px; +} + +.p-t-105 { + padding-top: 105px; +} + +.p-t-106 { + padding-top: 106px; +} + +.p-t-107 { + padding-top: 107px; +} + +.p-t-108 { + padding-top: 108px; +} + +.p-t-109 { + padding-top: 109px; +} + +.p-t-110 { + padding-top: 110px; +} + +.p-t-111 { + padding-top: 111px; +} + +.p-t-112 { + padding-top: 112px; +} + +.p-t-113 { + padding-top: 113px; +} + +.p-t-114 { + padding-top: 114px; +} + +.p-t-115 { + padding-top: 115px; +} + +.p-t-116 { + padding-top: 116px; +} + +.p-t-117 { + padding-top: 117px; +} + +.p-t-118 { + padding-top: 118px; +} + +.p-t-119 { + padding-top: 119px; +} + +.p-t-120 { + padding-top: 120px; +} + +.p-t-121 { + padding-top: 121px; +} + +.p-t-122 { + padding-top: 122px; +} + +.p-t-123 { + padding-top: 123px; +} + +.p-t-124 { + padding-top: 124px; +} + +.p-t-125 { + padding-top: 125px; +} + +.p-t-126 { + padding-top: 126px; +} + +.p-t-127 { + padding-top: 127px; +} + +.p-t-128 { + padding-top: 128px; +} + +.p-t-129 { + padding-top: 129px; +} + +.p-t-130 { + padding-top: 130px; +} + +.p-t-131 { + padding-top: 131px; +} + +.p-t-132 { + padding-top: 132px; +} + +.p-t-133 { + padding-top: 133px; +} + +.p-t-134 { + padding-top: 134px; +} + +.p-t-135 { + padding-top: 135px; +} + +.p-t-136 { + padding-top: 136px; +} + +.p-t-137 { + padding-top: 137px; +} + +.p-t-138 { + padding-top: 138px; +} + +.p-t-139 { + padding-top: 139px; +} + +.p-t-140 { + padding-top: 140px; +} + +.p-t-141 { + padding-top: 141px; +} + +.p-t-142 { + padding-top: 142px; +} + +.p-t-143 { + padding-top: 143px; +} + +.p-t-144 { + padding-top: 144px; +} + +.p-t-145 { + padding-top: 145px; +} + +.p-t-146 { + padding-top: 146px; +} + +.p-t-147 { + padding-top: 147px; +} + +.p-t-148 { + padding-top: 148px; +} + +.p-t-149 { + padding-top: 149px; +} + +.p-t-150 { + padding-top: 150px; +} + +.p-t-151 { + padding-top: 151px; +} + +.p-t-152 { + padding-top: 152px; +} + +.p-t-153 { + padding-top: 153px; +} + +.p-t-154 { + padding-top: 154px; +} + +.p-t-155 { + padding-top: 155px; +} + +.p-t-156 { + padding-top: 156px; +} + +.p-t-157 { + padding-top: 157px; +} + +.p-t-158 { + padding-top: 158px; +} + +.p-t-159 { + padding-top: 159px; +} + +.p-t-160 { + padding-top: 160px; +} + +.p-t-161 { + padding-top: 161px; +} + +.p-t-162 { + padding-top: 162px; +} + +.p-t-163 { + padding-top: 163px; +} + +.p-t-164 { + padding-top: 164px; +} + +.p-t-165 { + padding-top: 165px; +} + +.p-t-166 { + padding-top: 166px; +} + +.p-t-167 { + padding-top: 167px; +} + +.p-t-168 { + padding-top: 168px; +} + +.p-t-169 { + padding-top: 169px; +} + +.p-t-170 { + padding-top: 170px; +} + +.p-t-171 { + padding-top: 171px; +} + +.p-t-172 { + padding-top: 172px; +} + +.p-t-173 { + padding-top: 173px; +} + +.p-t-174 { + padding-top: 174px; +} + +.p-t-175 { + padding-top: 175px; +} + +.p-t-176 { + padding-top: 176px; +} + +.p-t-177 { + padding-top: 177px; +} + +.p-t-178 { + padding-top: 178px; +} + +.p-t-179 { + padding-top: 179px; +} + +.p-t-180 { + padding-top: 180px; +} + +.p-t-181 { + padding-top: 181px; +} + +.p-t-182 { + padding-top: 182px; +} + +.p-t-183 { + padding-top: 183px; +} + +.p-t-184 { + padding-top: 184px; +} + +.p-t-185 { + padding-top: 185px; +} + +.p-t-186 { + padding-top: 186px; +} + +.p-t-187 { + padding-top: 187px; +} + +.p-t-188 { + padding-top: 188px; +} + +.p-t-189 { + padding-top: 189px; +} + +.p-t-190 { + padding-top: 190px; +} + +.p-t-191 { + padding-top: 191px; +} + +.p-t-192 { + padding-top: 192px; +} + +.p-t-193 { + padding-top: 193px; +} + +.p-t-194 { + padding-top: 194px; +} + +.p-t-195 { + padding-top: 195px; +} + +.p-t-196 { + padding-top: 196px; +} + +.p-t-197 { + padding-top: 197px; +} + +.p-t-198 { + padding-top: 198px; +} + +.p-t-199 { + padding-top: 199px; +} + +.p-t-200 { + padding-top: 200px; +} + +.p-t-201 { + padding-top: 201px; +} + +.p-t-202 { + padding-top: 202px; +} + +.p-t-203 { + padding-top: 203px; +} + +.p-t-204 { + padding-top: 204px; +} + +.p-t-205 { + padding-top: 205px; +} + +.p-t-206 { + padding-top: 206px; +} + +.p-t-207 { + padding-top: 207px; +} + +.p-t-208 { + padding-top: 208px; +} + +.p-t-209 { + padding-top: 209px; +} + +.p-t-210 { + padding-top: 210px; +} + +.p-t-211 { + padding-top: 211px; +} + +.p-t-212 { + padding-top: 212px; +} + +.p-t-213 { + padding-top: 213px; +} + +.p-t-214 { + padding-top: 214px; +} + +.p-t-215 { + padding-top: 215px; +} + +.p-t-216 { + padding-top: 216px; +} + +.p-t-217 { + padding-top: 217px; +} + +.p-t-218 { + padding-top: 218px; +} + +.p-t-219 { + padding-top: 219px; +} + +.p-t-220 { + padding-top: 220px; +} + +.p-t-221 { + padding-top: 221px; +} + +.p-t-222 { + padding-top: 222px; +} + +.p-t-223 { + padding-top: 223px; +} + +.p-t-224 { + padding-top: 224px; +} + +.p-t-225 { + padding-top: 225px; +} + +.p-t-226 { + padding-top: 226px; +} + +.p-t-227 { + padding-top: 227px; +} + +.p-t-228 { + padding-top: 228px; +} + +.p-t-229 { + padding-top: 229px; +} + +.p-t-230 { + padding-top: 230px; +} + +.p-t-231 { + padding-top: 231px; +} + +.p-t-232 { + padding-top: 232px; +} + +.p-t-233 { + padding-top: 233px; +} + +.p-t-234 { + padding-top: 234px; +} + +.p-t-235 { + padding-top: 235px; +} + +.p-t-236 { + padding-top: 236px; +} + +.p-t-237 { + padding-top: 237px; +} + +.p-t-238 { + padding-top: 238px; +} + +.p-t-239 { + padding-top: 239px; +} + +.p-t-240 { + padding-top: 240px; +} + +.p-t-241 { + padding-top: 241px; +} + +.p-t-242 { + padding-top: 242px; +} + +.p-t-243 { + padding-top: 243px; +} + +.p-t-244 { + padding-top: 244px; +} + +.p-t-245 { + padding-top: 245px; +} + +.p-t-246 { + padding-top: 246px; +} + +.p-t-247 { + padding-top: 247px; +} + +.p-t-248 { + padding-top: 248px; +} + +.p-t-249 { + padding-top: 249px; +} + +.p-t-250 { + padding-top: 250px; +} + +.p-b-0 { + padding-bottom: 0; +} + +.p-b-1 { + padding-bottom: 1px; +} + +.p-b-2 { + padding-bottom: 2px; +} + +.p-b-3 { + padding-bottom: 3px; +} + +.p-b-4 { + padding-bottom: 4px; +} + +.p-b-5 { + padding-bottom: 5px; +} + +.p-b-6 { + padding-bottom: 6px; +} + +.p-b-7 { + padding-bottom: 7px; +} + +.p-b-8 { + padding-bottom: 8px; +} + +.p-b-9 { + padding-bottom: 9px; +} + +.p-b-10 { + padding-bottom: 10px; +} + +.p-b-11 { + padding-bottom: 11px; +} + +.p-b-12 { + padding-bottom: 12px; +} + +.p-b-13 { + padding-bottom: 13px; +} + +.p-b-14 { + padding-bottom: 14px; +} + +.p-b-15 { + padding-bottom: 15px; +} + +.p-b-16 { + padding-bottom: 16px; +} + +.p-b-17 { + padding-bottom: 17px; +} + +.p-b-18 { + padding-bottom: 18px; +} + +.p-b-19 { + padding-bottom: 19px; +} + +.p-b-20 { + padding-bottom: 20px; +} + +.p-b-21 { + padding-bottom: 21px; +} + +.p-b-22 { + padding-bottom: 22px; +} + +.p-b-23 { + padding-bottom: 23px; +} + +.p-b-24 { + padding-bottom: 24px; +} + +.p-b-25 { + padding-bottom: 25px; +} + +.p-b-26 { + padding-bottom: 26px; +} + +.p-b-27 { + padding-bottom: 27px; +} + +.p-b-28 { + padding-bottom: 28px; +} + +.p-b-29 { + padding-bottom: 29px; +} + +.p-b-30 { + padding-bottom: 30px; +} + +.p-b-31 { + padding-bottom: 31px; +} + +.p-b-32 { + padding-bottom: 32px; +} + +.p-b-33 { + padding-bottom: 33px; +} + +.p-b-34 { + padding-bottom: 34px; +} + +.p-b-35 { + padding-bottom: 35px; +} + +.p-b-36 { + padding-bottom: 36px; +} + +.p-b-37 { + padding-bottom: 37px; +} + +.p-b-38 { + padding-bottom: 38px; +} + +.p-b-39 { + padding-bottom: 39px; +} + +.p-b-40 { + padding-bottom: 40px; +} + +.p-b-41 { + padding-bottom: 41px; +} + +.p-b-42 { + padding-bottom: 42px; +} + +.p-b-43 { + padding-bottom: 43px; +} + +.p-b-44 { + padding-bottom: 44px; +} + +.p-b-45 { + padding-bottom: 45px; +} + +.p-b-46 { + padding-bottom: 46px; +} + +.p-b-47 { + padding-bottom: 47px; +} + +.p-b-48 { + padding-bottom: 48px; +} + +.p-b-49 { + padding-bottom: 49px; +} + +.p-b-50 { + padding-bottom: 50px; +} + +.p-b-51 { + padding-bottom: 51px; +} + +.p-b-52 { + padding-bottom: 52px; +} + +.p-b-53 { + padding-bottom: 53px; +} + +.p-b-54 { + padding-bottom: 54px; +} + +.p-b-55 { + padding-bottom: 55px; +} + +.p-b-56 { + padding-bottom: 56px; +} + +.p-b-57 { + padding-bottom: 57px; +} + +.p-b-58 { + padding-bottom: 58px; +} + +.p-b-59 { + padding-bottom: 59px; +} + +.p-b-60 { + padding-bottom: 60px; +} + +.p-b-61 { + padding-bottom: 61px; +} + +.p-b-62 { + padding-bottom: 62px; +} + +.p-b-63 { + padding-bottom: 63px; +} + +.p-b-64 { + padding-bottom: 64px; +} + +.p-b-65 { + padding-bottom: 65px; +} + +.p-b-66 { + padding-bottom: 66px; +} + +.p-b-67 { + padding-bottom: 67px; +} + +.p-b-68 { + padding-bottom: 68px; +} + +.p-b-69 { + padding-bottom: 69px; +} + +.p-b-70 { + padding-bottom: 70px; +} + +.p-b-71 { + padding-bottom: 71px; +} + +.p-b-72 { + padding-bottom: 72px; +} + +.p-b-73 { + padding-bottom: 73px; +} + +.p-b-74 { + padding-bottom: 74px; +} + +.p-b-75 { + padding-bottom: 75px; +} + +.p-b-76 { + padding-bottom: 76px; +} + +.p-b-77 { + padding-bottom: 77px; +} + +.p-b-78 { + padding-bottom: 78px; +} + +.p-b-79 { + padding-bottom: 79px; +} + +.p-b-80 { + padding-bottom: 80px; +} + +.p-b-81 { + padding-bottom: 81px; +} + +.p-b-82 { + padding-bottom: 82px; +} + +.p-b-83 { + padding-bottom: 83px; +} + +.p-b-84 { + padding-bottom: 84px; +} + +.p-b-85 { + padding-bottom: 85px; +} + +.p-b-86 { + padding-bottom: 86px; +} + +.p-b-87 { + padding-bottom: 87px; +} + +.p-b-88 { + padding-bottom: 88px; +} + +.p-b-89 { + padding-bottom: 89px; +} + +.p-b-90 { + padding-bottom: 90px; +} + +.p-b-91 { + padding-bottom: 91px; +} + +.p-b-92 { + padding-bottom: 92px; +} + +.p-b-93 { + padding-bottom: 93px; +} + +.p-b-94 { + padding-bottom: 94px; +} + +.p-b-95 { + padding-bottom: 95px; +} + +.p-b-96 { + padding-bottom: 96px; +} + +.p-b-97 { + padding-bottom: 97px; +} + +.p-b-98 { + padding-bottom: 98px; +} + +.p-b-99 { + padding-bottom: 99px; +} + +.p-b-100 { + padding-bottom: 100px; +} + +.p-b-101 { + padding-bottom: 101px; +} + +.p-b-102 { + padding-bottom: 102px; +} + +.p-b-103 { + padding-bottom: 103px; +} + +.p-b-104 { + padding-bottom: 104px; +} + +.p-b-105 { + padding-bottom: 105px; +} + +.p-b-106 { + padding-bottom: 106px; +} + +.p-b-107 { + padding-bottom: 107px; +} + +.p-b-108 { + padding-bottom: 108px; +} + +.p-b-109 { + padding-bottom: 109px; +} + +.p-b-110 { + padding-bottom: 110px; +} + +.p-b-111 { + padding-bottom: 111px; +} + +.p-b-112 { + padding-bottom: 112px; +} + +.p-b-113 { + padding-bottom: 113px; +} + +.p-b-114 { + padding-bottom: 114px; +} + +.p-b-115 { + padding-bottom: 115px; +} + +.p-b-116 { + padding-bottom: 116px; +} + +.p-b-117 { + padding-bottom: 117px; +} + +.p-b-118 { + padding-bottom: 118px; +} + +.p-b-119 { + padding-bottom: 119px; +} + +.p-b-120 { + padding-bottom: 120px; +} + +.p-b-121 { + padding-bottom: 121px; +} + +.p-b-122 { + padding-bottom: 122px; +} + +.p-b-123 { + padding-bottom: 123px; +} + +.p-b-124 { + padding-bottom: 124px; +} + +.p-b-125 { + padding-bottom: 125px; +} + +.p-b-126 { + padding-bottom: 126px; +} + +.p-b-127 { + padding-bottom: 127px; +} + +.p-b-128 { + padding-bottom: 128px; +} + +.p-b-129 { + padding-bottom: 129px; +} + +.p-b-130 { + padding-bottom: 130px; +} + +.p-b-131 { + padding-bottom: 131px; +} + +.p-b-132 { + padding-bottom: 132px; +} + +.p-b-133 { + padding-bottom: 133px; +} + +.p-b-134 { + padding-bottom: 134px; +} + +.p-b-135 { + padding-bottom: 135px; +} + +.p-b-136 { + padding-bottom: 136px; +} + +.p-b-137 { + padding-bottom: 137px; +} + +.p-b-138 { + padding-bottom: 138px; +} + +.p-b-139 { + padding-bottom: 139px; +} + +.p-b-140 { + padding-bottom: 140px; +} + +.p-b-141 { + padding-bottom: 141px; +} + +.p-b-142 { + padding-bottom: 142px; +} + +.p-b-143 { + padding-bottom: 143px; +} + +.p-b-144 { + padding-bottom: 144px; +} + +.p-b-145 { + padding-bottom: 145px; +} + +.p-b-146 { + padding-bottom: 146px; +} + +.p-b-147 { + padding-bottom: 147px; +} + +.p-b-148 { + padding-bottom: 148px; +} + +.p-b-149 { + padding-bottom: 149px; +} + +.p-b-150 { + padding-bottom: 150px; +} + +.p-b-151 { + padding-bottom: 151px; +} + +.p-b-152 { + padding-bottom: 152px; +} + +.p-b-153 { + padding-bottom: 153px; +} + +.p-b-154 { + padding-bottom: 154px; +} + +.p-b-155 { + padding-bottom: 155px; +} + +.p-b-156 { + padding-bottom: 156px; +} + +.p-b-157 { + padding-bottom: 157px; +} + +.p-b-158 { + padding-bottom: 158px; +} + +.p-b-159 { + padding-bottom: 159px; +} + +.p-b-160 { + padding-bottom: 160px; +} + +.p-b-161 { + padding-bottom: 161px; +} + +.p-b-162 { + padding-bottom: 162px; +} + +.p-b-163 { + padding-bottom: 163px; +} + +.p-b-164 { + padding-bottom: 164px; +} + +.p-b-165 { + padding-bottom: 165px; +} + +.p-b-166 { + padding-bottom: 166px; +} + +.p-b-167 { + padding-bottom: 167px; +} + +.p-b-168 { + padding-bottom: 168px; +} + +.p-b-169 { + padding-bottom: 169px; +} + +.p-b-170 { + padding-bottom: 170px; +} + +.p-b-171 { + padding-bottom: 171px; +} + +.p-b-172 { + padding-bottom: 172px; +} + +.p-b-173 { + padding-bottom: 173px; +} + +.p-b-174 { + padding-bottom: 174px; +} + +.p-b-175 { + padding-bottom: 175px; +} + +.p-b-176 { + padding-bottom: 176px; +} + +.p-b-177 { + padding-bottom: 177px; +} + +.p-b-178 { + padding-bottom: 178px; +} + +.p-b-179 { + padding-bottom: 179px; +} + +.p-b-180 { + padding-bottom: 180px; +} + +.p-b-181 { + padding-bottom: 181px; +} + +.p-b-182 { + padding-bottom: 182px; +} + +.p-b-183 { + padding-bottom: 183px; +} + +.p-b-184 { + padding-bottom: 184px; +} + +.p-b-185 { + padding-bottom: 185px; +} + +.p-b-186 { + padding-bottom: 186px; +} + +.p-b-187 { + padding-bottom: 187px; +} + +.p-b-188 { + padding-bottom: 188px; +} + +.p-b-189 { + padding-bottom: 189px; +} + +.p-b-190 { + padding-bottom: 190px; +} + +.p-b-191 { + padding-bottom: 191px; +} + +.p-b-192 { + padding-bottom: 192px; +} + +.p-b-193 { + padding-bottom: 193px; +} + +.p-b-194 { + padding-bottom: 194px; +} + +.p-b-195 { + padding-bottom: 195px; +} + +.p-b-196 { + padding-bottom: 196px; +} + +.p-b-197 { + padding-bottom: 197px; +} + +.p-b-198 { + padding-bottom: 198px; +} + +.p-b-199 { + padding-bottom: 199px; +} + +.p-b-200 { + padding-bottom: 200px; +} + +.p-b-201 { + padding-bottom: 201px; +} + +.p-b-202 { + padding-bottom: 202px; +} + +.p-b-203 { + padding-bottom: 203px; +} + +.p-b-204 { + padding-bottom: 204px; +} + +.p-b-205 { + padding-bottom: 205px; +} + +.p-b-206 { + padding-bottom: 206px; +} + +.p-b-207 { + padding-bottom: 207px; +} + +.p-b-208 { + padding-bottom: 208px; +} + +.p-b-209 { + padding-bottom: 209px; +} + +.p-b-210 { + padding-bottom: 210px; +} + +.p-b-211 { + padding-bottom: 211px; +} + +.p-b-212 { + padding-bottom: 212px; +} + +.p-b-213 { + padding-bottom: 213px; +} + +.p-b-214 { + padding-bottom: 214px; +} + +.p-b-215 { + padding-bottom: 215px; +} + +.p-b-216 { + padding-bottom: 216px; +} + +.p-b-217 { + padding-bottom: 217px; +} + +.p-b-218 { + padding-bottom: 218px; +} + +.p-b-219 { + padding-bottom: 219px; +} + +.p-b-220 { + padding-bottom: 220px; +} + +.p-b-221 { + padding-bottom: 221px; +} + +.p-b-222 { + padding-bottom: 222px; +} + +.p-b-223 { + padding-bottom: 223px; +} + +.p-b-224 { + padding-bottom: 224px; +} + +.p-b-225 { + padding-bottom: 225px; +} + +.p-b-226 { + padding-bottom: 226px; +} + +.p-b-227 { + padding-bottom: 227px; +} + +.p-b-228 { + padding-bottom: 228px; +} + +.p-b-229 { + padding-bottom: 229px; +} + +.p-b-230 { + padding-bottom: 230px; +} + +.p-b-231 { + padding-bottom: 231px; +} + +.p-b-232 { + padding-bottom: 232px; +} + +.p-b-233 { + padding-bottom: 233px; +} + +.p-b-234 { + padding-bottom: 234px; +} + +.p-b-235 { + padding-bottom: 235px; +} + +.p-b-236 { + padding-bottom: 236px; +} + +.p-b-237 { + padding-bottom: 237px; +} + +.p-b-238 { + padding-bottom: 238px; +} + +.p-b-239 { + padding-bottom: 239px; +} + +.p-b-240 { + padding-bottom: 240px; +} + +.p-b-241 { + padding-bottom: 241px; +} + +.p-b-242 { + padding-bottom: 242px; +} + +.p-b-243 { + padding-bottom: 243px; +} + +.p-b-244 { + padding-bottom: 244px; +} + +.p-b-245 { + padding-bottom: 245px; +} + +.p-b-246 { + padding-bottom: 246px; +} + +.p-b-247 { + padding-bottom: 247px; +} + +.p-b-248 { + padding-bottom: 248px; +} + +.p-b-249 { + padding-bottom: 249px; +} + +.p-b-250 { + padding-bottom: 250px; +} + +.p-l-0 { + padding-left: 0; +} + +.p-l-1 { + padding-left: 1px; +} + +.p-l-2 { + padding-left: 2px; +} + +.p-l-3 { + padding-left: 3px; +} + +.p-l-4 { + padding-left: 4px; +} + +.p-l-5 { + padding-left: 5px; +} + +.p-l-6 { + padding-left: 6px; +} + +.p-l-7 { + padding-left: 7px; +} + +.p-l-8 { + padding-left: 8px; +} + +.p-l-9 { + padding-left: 9px; +} + +.p-l-10 { + padding-left: 10px; +} + +.p-l-11 { + padding-left: 11px; +} + +.p-l-12 { + padding-left: 12px; +} + +.p-l-13 { + padding-left: 13px; +} + +.p-l-14 { + padding-left: 14px; +} + +.p-l-15 { + padding-left: 15px; +} + +.p-l-16 { + padding-left: 16px; +} + +.p-l-17 { + padding-left: 17px; +} + +.p-l-18 { + padding-left: 18px; +} + +.p-l-19 { + padding-left: 19px; +} + +.p-l-20 { + padding-left: 20px; +} + +.p-l-21 { + padding-left: 21px; +} + +.p-l-22 { + padding-left: 22px; +} + +.p-l-23 { + padding-left: 23px; +} + +.p-l-24 { + padding-left: 24px; +} + +.p-l-25 { + padding-left: 25px; +} + +.p-l-26 { + padding-left: 26px; +} + +.p-l-27 { + padding-left: 27px; +} + +.p-l-28 { + padding-left: 28px; +} + +.p-l-29 { + padding-left: 29px; +} + +.p-l-30 { + padding-left: 30px; +} + +.p-l-31 { + padding-left: 31px; +} + +.p-l-32 { + padding-left: 32px; +} + +.p-l-33 { + padding-left: 33px; +} + +.p-l-34 { + padding-left: 34px; +} + +.p-l-35 { + padding-left: 35px; +} + +.p-l-36 { + padding-left: 36px; +} + +.p-l-37 { + padding-left: 37px; +} + +.p-l-38 { + padding-left: 38px; +} + +.p-l-39 { + padding-left: 39px; +} + +.p-l-40 { + padding-left: 40px; +} + +.p-l-41 { + padding-left: 41px; +} + +.p-l-42 { + padding-left: 42px; +} + +.p-l-43 { + padding-left: 43px; +} + +.p-l-44 { + padding-left: 44px; +} + +.p-l-45 { + padding-left: 45px; +} + +.p-l-46 { + padding-left: 46px; +} + +.p-l-47 { + padding-left: 47px; +} + +.p-l-48 { + padding-left: 48px; +} + +.p-l-49 { + padding-left: 49px; +} + +.p-l-50 { + padding-left: 50px; +} + +.p-l-51 { + padding-left: 51px; +} + +.p-l-52 { + padding-left: 52px; +} + +.p-l-53 { + padding-left: 53px; +} + +.p-l-54 { + padding-left: 54px; +} + +.p-l-55 { + padding-left: 55px; +} + +.p-l-56 { + padding-left: 56px; +} + +.p-l-57 { + padding-left: 57px; +} + +.p-l-58 { + padding-left: 58px; +} + +.p-l-59 { + padding-left: 59px; +} + +.p-l-60 { + padding-left: 60px; +} + +.p-l-61 { + padding-left: 61px; +} + +.p-l-62 { + padding-left: 62px; +} + +.p-l-63 { + padding-left: 63px; +} + +.p-l-64 { + padding-left: 64px; +} + +.p-l-65 { + padding-left: 65px; +} + +.p-l-66 { + padding-left: 66px; +} + +.p-l-67 { + padding-left: 67px; +} + +.p-l-68 { + padding-left: 68px; +} + +.p-l-69 { + padding-left: 69px; +} + +.p-l-70 { + padding-left: 70px; +} + +.p-l-71 { + padding-left: 71px; +} + +.p-l-72 { + padding-left: 72px; +} + +.p-l-73 { + padding-left: 73px; +} + +.p-l-74 { + padding-left: 74px; +} + +.p-l-75 { + padding-left: 75px; +} + +.p-l-76 { + padding-left: 76px; +} + +.p-l-77 { + padding-left: 77px; +} + +.p-l-78 { + padding-left: 78px; +} + +.p-l-79 { + padding-left: 79px; +} + +.p-l-80 { + padding-left: 80px; +} + +.p-l-81 { + padding-left: 81px; +} + +.p-l-82 { + padding-left: 82px; +} + +.p-l-83 { + padding-left: 83px; +} + +.p-l-84 { + padding-left: 84px; +} + +.p-l-85 { + padding-left: 85px; +} + +.p-l-86 { + padding-left: 86px; +} + +.p-l-87 { + padding-left: 87px; +} + +.p-l-88 { + padding-left: 88px; +} + +.p-l-89 { + padding-left: 89px; +} + +.p-l-90 { + padding-left: 90px; +} + +.p-l-91 { + padding-left: 91px; +} + +.p-l-92 { + padding-left: 92px; +} + +.p-l-93 { + padding-left: 93px; +} + +.p-l-94 { + padding-left: 94px; +} + +.p-l-95 { + padding-left: 95px; +} + +.p-l-96 { + padding-left: 96px; +} + +.p-l-97 { + padding-left: 97px; +} + +.p-l-98 { + padding-left: 98px; +} + +.p-l-99 { + padding-left: 99px; +} + +.p-l-100 { + padding-left: 100px; +} + +.p-l-101 { + padding-left: 101px; +} + +.p-l-102 { + padding-left: 102px; +} + +.p-l-103 { + padding-left: 103px; +} + +.p-l-104 { + padding-left: 104px; +} + +.p-l-105 { + padding-left: 105px; +} + +.p-l-106 { + padding-left: 106px; +} + +.p-l-107 { + padding-left: 107px; +} + +.p-l-108 { + padding-left: 108px; +} + +.p-l-109 { + padding-left: 109px; +} + +.p-l-110 { + padding-left: 110px; +} + +.p-l-111 { + padding-left: 111px; +} + +.p-l-112 { + padding-left: 112px; +} + +.p-l-113 { + padding-left: 113px; +} + +.p-l-114 { + padding-left: 114px; +} + +.p-l-115 { + padding-left: 115px; +} + +.p-l-116 { + padding-left: 116px; +} + +.p-l-117 { + padding-left: 117px; +} + +.p-l-118 { + padding-left: 118px; +} + +.p-l-119 { + padding-left: 119px; +} + +.p-l-120 { + padding-left: 120px; +} + +.p-l-121 { + padding-left: 121px; +} + +.p-l-122 { + padding-left: 122px; +} + +.p-l-123 { + padding-left: 123px; +} + +.p-l-124 { + padding-left: 124px; +} + +.p-l-125 { + padding-left: 125px; +} + +.p-l-126 { + padding-left: 126px; +} + +.p-l-127 { + padding-left: 127px; +} + +.p-l-128 { + padding-left: 128px; +} + +.p-l-129 { + padding-left: 129px; +} + +.p-l-130 { + padding-left: 130px; +} + +.p-l-131 { + padding-left: 131px; +} + +.p-l-132 { + padding-left: 132px; +} + +.p-l-133 { + padding-left: 133px; +} + +.p-l-134 { + padding-left: 134px; +} + +.p-l-135 { + padding-left: 135px; +} + +.p-l-136 { + padding-left: 136px; +} + +.p-l-137 { + padding-left: 137px; +} + +.p-l-138 { + padding-left: 138px; +} + +.p-l-139 { + padding-left: 139px; +} + +.p-l-140 { + padding-left: 140px; +} + +.p-l-141 { + padding-left: 141px; +} + +.p-l-142 { + padding-left: 142px; +} + +.p-l-143 { + padding-left: 143px; +} + +.p-l-144 { + padding-left: 144px; +} + +.p-l-145 { + padding-left: 145px; +} + +.p-l-146 { + padding-left: 146px; +} + +.p-l-147 { + padding-left: 147px; +} + +.p-l-148 { + padding-left: 148px; +} + +.p-l-149 { + padding-left: 149px; +} + +.p-l-150 { + padding-left: 150px; +} + +.p-l-151 { + padding-left: 151px; +} + +.p-l-152 { + padding-left: 152px; +} + +.p-l-153 { + padding-left: 153px; +} + +.p-l-154 { + padding-left: 154px; +} + +.p-l-155 { + padding-left: 155px; +} + +.p-l-156 { + padding-left: 156px; +} + +.p-l-157 { + padding-left: 157px; +} + +.p-l-158 { + padding-left: 158px; +} + +.p-l-159 { + padding-left: 159px; +} + +.p-l-160 { + padding-left: 160px; +} + +.p-l-161 { + padding-left: 161px; +} + +.p-l-162 { + padding-left: 162px; +} + +.p-l-163 { + padding-left: 163px; +} + +.p-l-164 { + padding-left: 164px; +} + +.p-l-165 { + padding-left: 165px; +} + +.p-l-166 { + padding-left: 166px; +} + +.p-l-167 { + padding-left: 167px; +} + +.p-l-168 { + padding-left: 168px; +} + +.p-l-169 { + padding-left: 169px; +} + +.p-l-170 { + padding-left: 170px; +} + +.p-l-171 { + padding-left: 171px; +} + +.p-l-172 { + padding-left: 172px; +} + +.p-l-173 { + padding-left: 173px; +} + +.p-l-174 { + padding-left: 174px; +} + +.p-l-175 { + padding-left: 175px; +} + +.p-l-176 { + padding-left: 176px; +} + +.p-l-177 { + padding-left: 177px; +} + +.p-l-178 { + padding-left: 178px; +} + +.p-l-179 { + padding-left: 179px; +} + +.p-l-180 { + padding-left: 180px; +} + +.p-l-181 { + padding-left: 181px; +} + +.p-l-182 { + padding-left: 182px; +} + +.p-l-183 { + padding-left: 183px; +} + +.p-l-184 { + padding-left: 184px; +} + +.p-l-185 { + padding-left: 185px; +} + +.p-l-186 { + padding-left: 186px; +} + +.p-l-187 { + padding-left: 187px; +} + +.p-l-188 { + padding-left: 188px; +} + +.p-l-189 { + padding-left: 189px; +} + +.p-l-190 { + padding-left: 190px; +} + +.p-l-191 { + padding-left: 191px; +} + +.p-l-192 { + padding-left: 192px; +} + +.p-l-193 { + padding-left: 193px; +} + +.p-l-194 { + padding-left: 194px; +} + +.p-l-195 { + padding-left: 195px; +} + +.p-l-196 { + padding-left: 196px; +} + +.p-l-197 { + padding-left: 197px; +} + +.p-l-198 { + padding-left: 198px; +} + +.p-l-199 { + padding-left: 199px; +} + +.p-l-200 { + padding-left: 200px; +} + +.p-l-201 { + padding-left: 201px; +} + +.p-l-202 { + padding-left: 202px; +} + +.p-l-203 { + padding-left: 203px; +} + +.p-l-204 { + padding-left: 204px; +} + +.p-l-205 { + padding-left: 205px; +} + +.p-l-206 { + padding-left: 206px; +} + +.p-l-207 { + padding-left: 207px; +} + +.p-l-208 { + padding-left: 208px; +} + +.p-l-209 { + padding-left: 209px; +} + +.p-l-210 { + padding-left: 210px; +} + +.p-l-211 { + padding-left: 211px; +} + +.p-l-212 { + padding-left: 212px; +} + +.p-l-213 { + padding-left: 213px; +} + +.p-l-214 { + padding-left: 214px; +} + +.p-l-215 { + padding-left: 215px; +} + +.p-l-216 { + padding-left: 216px; +} + +.p-l-217 { + padding-left: 217px; +} + +.p-l-218 { + padding-left: 218px; +} + +.p-l-219 { + padding-left: 219px; +} + +.p-l-220 { + padding-left: 220px; +} + +.p-l-221 { + padding-left: 221px; +} + +.p-l-222 { + padding-left: 222px; +} + +.p-l-223 { + padding-left: 223px; +} + +.p-l-224 { + padding-left: 224px; +} + +.p-l-225 { + padding-left: 225px; +} + +.p-l-226 { + padding-left: 226px; +} + +.p-l-227 { + padding-left: 227px; +} + +.p-l-228 { + padding-left: 228px; +} + +.p-l-229 { + padding-left: 229px; +} + +.p-l-230 { + padding-left: 230px; +} + +.p-l-231 { + padding-left: 231px; +} + +.p-l-232 { + padding-left: 232px; +} + +.p-l-233 { + padding-left: 233px; +} + +.p-l-234 { + padding-left: 234px; +} + +.p-l-235 { + padding-left: 235px; +} + +.p-l-236 { + padding-left: 236px; +} + +.p-l-237 { + padding-left: 237px; +} + +.p-l-238 { + padding-left: 238px; +} + +.p-l-239 { + padding-left: 239px; +} + +.p-l-240 { + padding-left: 240px; +} + +.p-l-241 { + padding-left: 241px; +} + +.p-l-242 { + padding-left: 242px; +} + +.p-l-243 { + padding-left: 243px; +} + +.p-l-244 { + padding-left: 244px; +} + +.p-l-245 { + padding-left: 245px; +} + +.p-l-246 { + padding-left: 246px; +} + +.p-l-247 { + padding-left: 247px; +} + +.p-l-248 { + padding-left: 248px; +} + +.p-l-249 { + padding-left: 249px; +} + +.p-l-250 { + padding-left: 250px; +} + +.p-r-0 { + padding-right: 0; +} + +.p-r-1 { + padding-right: 1px; +} + +.p-r-2 { + padding-right: 2px; +} + +.p-r-3 { + padding-right: 3px; +} + +.p-r-4 { + padding-right: 4px; +} + +.p-r-5 { + padding-right: 5px; +} + +.p-r-6 { + padding-right: 6px; +} + +.p-r-7 { + padding-right: 7px; +} + +.p-r-8 { + padding-right: 8px; +} + +.p-r-9 { + padding-right: 9px; +} + +.p-r-10 { + padding-right: 10px; +} + +.p-r-11 { + padding-right: 11px; +} + +.p-r-12 { + padding-right: 12px; +} + +.p-r-13 { + padding-right: 13px; +} + +.p-r-14 { + padding-right: 14px; +} + +.p-r-15 { + padding-right: 15px; +} + +.p-r-16 { + padding-right: 16px; +} + +.p-r-17 { + padding-right: 17px; +} + +.p-r-18 { + padding-right: 18px; +} + +.p-r-19 { + padding-right: 19px; +} + +.p-r-20 { + padding-right: 20px; +} + +.p-r-21 { + padding-right: 21px; +} + +.p-r-22 { + padding-right: 22px; +} + +.p-r-23 { + padding-right: 23px; +} + +.p-r-24 { + padding-right: 24px; +} + +.p-r-25 { + padding-right: 25px; +} + +.p-r-26 { + padding-right: 26px; +} + +.p-r-27 { + padding-right: 27px; +} + +.p-r-28 { + padding-right: 28px; +} + +.p-r-29 { + padding-right: 29px; +} + +.p-r-30 { + padding-right: 30px; +} + +.p-r-31 { + padding-right: 31px; +} + +.p-r-32 { + padding-right: 32px; +} + +.p-r-33 { + padding-right: 33px; +} + +.p-r-34 { + padding-right: 34px; +} + +.p-r-35 { + padding-right: 35px; +} + +.p-r-36 { + padding-right: 36px; +} + +.p-r-37 { + padding-right: 37px; +} + +.p-r-38 { + padding-right: 38px; +} + +.p-r-39 { + padding-right: 39px; +} + +.p-r-40 { + padding-right: 40px; +} + +.p-r-41 { + padding-right: 41px; +} + +.p-r-42 { + padding-right: 42px; +} + +.p-r-43 { + padding-right: 43px; +} + +.p-r-44 { + padding-right: 44px; +} + +.p-r-45 { + padding-right: 45px; +} + +.p-r-46 { + padding-right: 46px; +} + +.p-r-47 { + padding-right: 47px; +} + +.p-r-48 { + padding-right: 48px; +} + +.p-r-49 { + padding-right: 49px; +} + +.p-r-50 { + padding-right: 50px; +} + +.p-r-51 { + padding-right: 51px; +} + +.p-r-52 { + padding-right: 52px; +} + +.p-r-53 { + padding-right: 53px; +} + +.p-r-54 { + padding-right: 54px; +} + +.p-r-55 { + padding-right: 55px; +} + +.p-r-56 { + padding-right: 56px; +} + +.p-r-57 { + padding-right: 57px; +} + +.p-r-58 { + padding-right: 58px; +} + +.p-r-59 { + padding-right: 59px; +} + +.p-r-60 { + padding-right: 60px; +} + +.p-r-61 { + padding-right: 61px; +} + +.p-r-62 { + padding-right: 62px; +} + +.p-r-63 { + padding-right: 63px; +} + +.p-r-64 { + padding-right: 64px; +} + +.p-r-65 { + padding-right: 65px; +} + +.p-r-66 { + padding-right: 66px; +} + +.p-r-67 { + padding-right: 67px; +} + +.p-r-68 { + padding-right: 68px; +} + +.p-r-69 { + padding-right: 69px; +} + +.p-r-70 { + padding-right: 70px; +} + +.p-r-71 { + padding-right: 71px; +} + +.p-r-72 { + padding-right: 72px; +} + +.p-r-73 { + padding-right: 73px; +} + +.p-r-74 { + padding-right: 74px; +} + +.p-r-75 { + padding-right: 75px; +} + +.p-r-76 { + padding-right: 76px; +} + +.p-r-77 { + padding-right: 77px; +} + +.p-r-78 { + padding-right: 78px; +} + +.p-r-79 { + padding-right: 79px; +} + +.p-r-80 { + padding-right: 80px; +} + +.p-r-81 { + padding-right: 81px; +} + +.p-r-82 { + padding-right: 82px; +} + +.p-r-83 { + padding-right: 83px; +} + +.p-r-84 { + padding-right: 84px; +} + +.p-r-85 { + padding-right: 85px; +} + +.p-r-86 { + padding-right: 86px; +} + +.p-r-87 { + padding-right: 87px; +} + +.p-r-88 { + padding-right: 88px; +} + +.p-r-89 { + padding-right: 89px; +} + +.p-r-90 { + padding-right: 90px; +} + +.p-r-91 { + padding-right: 91px; +} + +.p-r-92 { + padding-right: 92px; +} + +.p-r-93 { + padding-right: 93px; +} + +.p-r-94 { + padding-right: 94px; +} + +.p-r-95 { + padding-right: 95px; +} + +.p-r-96 { + padding-right: 96px; +} + +.p-r-97 { + padding-right: 97px; +} + +.p-r-98 { + padding-right: 98px; +} + +.p-r-99 { + padding-right: 99px; +} + +.p-r-100 { + padding-right: 100px; +} + +.p-r-101 { + padding-right: 101px; +} + +.p-r-102 { + padding-right: 102px; +} + +.p-r-103 { + padding-right: 103px; +} + +.p-r-104 { + padding-right: 104px; +} + +.p-r-105 { + padding-right: 105px; +} + +.p-r-106 { + padding-right: 106px; +} + +.p-r-107 { + padding-right: 107px; +} + +.p-r-108 { + padding-right: 108px; +} + +.p-r-109 { + padding-right: 109px; +} + +.p-r-110 { + padding-right: 110px; +} + +.p-r-111 { + padding-right: 111px; +} + +.p-r-112 { + padding-right: 112px; +} + +.p-r-113 { + padding-right: 113px; +} + +.p-r-114 { + padding-right: 114px; +} + +.p-r-115 { + padding-right: 115px; +} + +.p-r-116 { + padding-right: 116px; +} + +.p-r-117 { + padding-right: 117px; +} + +.p-r-118 { + padding-right: 118px; +} + +.p-r-119 { + padding-right: 119px; +} + +.p-r-120 { + padding-right: 120px; +} + +.p-r-121 { + padding-right: 121px; +} + +.p-r-122 { + padding-right: 122px; +} + +.p-r-123 { + padding-right: 123px; +} + +.p-r-124 { + padding-right: 124px; +} + +.p-r-125 { + padding-right: 125px; +} + +.p-r-126 { + padding-right: 126px; +} + +.p-r-127 { + padding-right: 127px; +} + +.p-r-128 { + padding-right: 128px; +} + +.p-r-129 { + padding-right: 129px; +} + +.p-r-130 { + padding-right: 130px; +} + +.p-r-131 { + padding-right: 131px; +} + +.p-r-132 { + padding-right: 132px; +} + +.p-r-133 { + padding-right: 133px; +} + +.p-r-134 { + padding-right: 134px; +} + +.p-r-135 { + padding-right: 135px; +} + +.p-r-136 { + padding-right: 136px; +} + +.p-r-137 { + padding-right: 137px; +} + +.p-r-138 { + padding-right: 138px; +} + +.p-r-139 { + padding-right: 139px; +} + +.p-r-140 { + padding-right: 140px; +} + +.p-r-141 { + padding-right: 141px; +} + +.p-r-142 { + padding-right: 142px; +} + +.p-r-143 { + padding-right: 143px; +} + +.p-r-144 { + padding-right: 144px; +} + +.p-r-145 { + padding-right: 145px; +} + +.p-r-146 { + padding-right: 146px; +} + +.p-r-147 { + padding-right: 147px; +} + +.p-r-148 { + padding-right: 148px; +} + +.p-r-149 { + padding-right: 149px; +} + +.p-r-150 { + padding-right: 150px; +} + +.p-r-151 { + padding-right: 151px; +} + +.p-r-152 { + padding-right: 152px; +} + +.p-r-153 { + padding-right: 153px; +} + +.p-r-154 { + padding-right: 154px; +} + +.p-r-155 { + padding-right: 155px; +} + +.p-r-156 { + padding-right: 156px; +} + +.p-r-157 { + padding-right: 157px; +} + +.p-r-158 { + padding-right: 158px; +} + +.p-r-159 { + padding-right: 159px; +} + +.p-r-160 { + padding-right: 160px; +} + +.p-r-161 { + padding-right: 161px; +} + +.p-r-162 { + padding-right: 162px; +} + +.p-r-163 { + padding-right: 163px; +} + +.p-r-164 { + padding-right: 164px; +} + +.p-r-165 { + padding-right: 165px; +} + +.p-r-166 { + padding-right: 166px; +} + +.p-r-167 { + padding-right: 167px; +} + +.p-r-168 { + padding-right: 168px; +} + +.p-r-169 { + padding-right: 169px; +} + +.p-r-170 { + padding-right: 170px; +} + +.p-r-171 { + padding-right: 171px; +} + +.p-r-172 { + padding-right: 172px; +} + +.p-r-173 { + padding-right: 173px; +} + +.p-r-174 { + padding-right: 174px; +} + +.p-r-175 { + padding-right: 175px; +} + +.p-r-176 { + padding-right: 176px; +} + +.p-r-177 { + padding-right: 177px; +} + +.p-r-178 { + padding-right: 178px; +} + +.p-r-179 { + padding-right: 179px; +} + +.p-r-180 { + padding-right: 180px; +} + +.p-r-181 { + padding-right: 181px; +} + +.p-r-182 { + padding-right: 182px; +} + +.p-r-183 { + padding-right: 183px; +} + +.p-r-184 { + padding-right: 184px; +} + +.p-r-185 { + padding-right: 185px; +} + +.p-r-186 { + padding-right: 186px; +} + +.p-r-187 { + padding-right: 187px; +} + +.p-r-188 { + padding-right: 188px; +} + +.p-r-189 { + padding-right: 189px; +} + +.p-r-190 { + padding-right: 190px; +} + +.p-r-191 { + padding-right: 191px; +} + +.p-r-192 { + padding-right: 192px; +} + +.p-r-193 { + padding-right: 193px; +} + +.p-r-194 { + padding-right: 194px; +} + +.p-r-195 { + padding-right: 195px; +} + +.p-r-196 { + padding-right: 196px; +} + +.p-r-197 { + padding-right: 197px; +} + +.p-r-198 { + padding-right: 198px; +} + +.p-r-199 { + padding-right: 199px; +} + +.p-r-200 { + padding-right: 200px; +} + +.p-r-201 { + padding-right: 201px; +} + +.p-r-202 { + padding-right: 202px; +} + +.p-r-203 { + padding-right: 203px; +} + +.p-r-204 { + padding-right: 204px; +} + +.p-r-205 { + padding-right: 205px; +} + +.p-r-206 { + padding-right: 206px; +} + +.p-r-207 { + padding-right: 207px; +} + +.p-r-208 { + padding-right: 208px; +} + +.p-r-209 { + padding-right: 209px; +} + +.p-r-210 { + padding-right: 210px; +} + +.p-r-211 { + padding-right: 211px; +} + +.p-r-212 { + padding-right: 212px; +} + +.p-r-213 { + padding-right: 213px; +} + +.p-r-214 { + padding-right: 214px; +} + +.p-r-215 { + padding-right: 215px; +} + +.p-r-216 { + padding-right: 216px; +} + +.p-r-217 { + padding-right: 217px; +} + +.p-r-218 { + padding-right: 218px; +} + +.p-r-219 { + padding-right: 219px; +} + +.p-r-220 { + padding-right: 220px; +} + +.p-r-221 { + padding-right: 221px; +} + +.p-r-222 { + padding-right: 222px; +} + +.p-r-223 { + padding-right: 223px; +} + +.p-r-224 { + padding-right: 224px; +} + +.p-r-225 { + padding-right: 225px; +} + +.p-r-226 { + padding-right: 226px; +} + +.p-r-227 { + padding-right: 227px; +} + +.p-r-228 { + padding-right: 228px; +} + +.p-r-229 { + padding-right: 229px; +} + +.p-r-230 { + padding-right: 230px; +} + +.p-r-231 { + padding-right: 231px; +} + +.p-r-232 { + padding-right: 232px; +} + +.p-r-233 { + padding-right: 233px; +} + +.p-r-234 { + padding-right: 234px; +} + +.p-r-235 { + padding-right: 235px; +} + +.p-r-236 { + padding-right: 236px; +} + +.p-r-237 { + padding-right: 237px; +} + +.p-r-238 { + padding-right: 238px; +} + +.p-r-239 { + padding-right: 239px; +} + +.p-r-240 { + padding-right: 240px; +} + +.p-r-241 { + padding-right: 241px; +} + +.p-r-242 { + padding-right: 242px; +} + +.p-r-243 { + padding-right: 243px; +} + +.p-r-244 { + padding-right: 244px; +} + +.p-r-245 { + padding-right: 245px; +} + +.p-r-246 { + padding-right: 246px; +} + +.p-r-247 { + padding-right: 247px; +} + +.p-r-248 { + padding-right: 248px; +} + +.p-r-249 { + padding-right: 249px; +} + +.p-r-250 { + padding-right: 250px; +} + +/*[ MARGIN ] +/////////////////////////////////////////////////////////// +*/ +.m-t-0 { + margin-top: 0; +} + +.m-t-1 { + margin-top: 1px; +} + +.m-t-2 { + margin-top: 2px; +} + +.m-t-3 { + margin-top: 3px; +} + +.m-t-4 { + margin-top: 4px; +} + +.m-t-5 { + margin-top: 5px; +} + +.m-t-6 { + margin-top: 6px; +} + +.m-t-7 { + margin-top: 7px; +} + +.m-t-8 { + margin-top: 8px; +} + +.m-t-9 { + margin-top: 9px; +} + +.m-t-10 { + margin-top: 10px; +} + +.m-t-11 { + margin-top: 11px; +} + +.m-t-12 { + margin-top: 12px; +} + +.m-t-13 { + margin-top: 13px; +} + +.m-t-14 { + margin-top: 14px; +} + +.m-t-15 { + margin-top: 15px; +} + +.m-t-16 { + margin-top: 16px; +} + +.m-t-17 { + margin-top: 17px; +} + +.m-t-18 { + margin-top: 18px; +} + +.m-t-19 { + margin-top: 19px; +} + +.m-t-20 { + margin-top: 20px; +} + +.m-t-21 { + margin-top: 21px; +} + +.m-t-22 { + margin-top: 22px; +} + +.m-t-23 { + margin-top: 23px; +} + +.m-t-24 { + margin-top: 24px; +} + +.m-t-25 { + margin-top: 25px; +} + +.m-t-26 { + margin-top: 26px; +} + +.m-t-27 { + margin-top: 27px; +} + +.m-t-28 { + margin-top: 28px; +} + +.m-t-29 { + margin-top: 29px; +} + +.m-t-30 { + margin-top: 30px; +} + +.m-t-31 { + margin-top: 31px; +} + +.m-t-32 { + margin-top: 32px; +} + +.m-t-33 { + margin-top: 33px; +} + +.m-t-34 { + margin-top: 34px; +} + +.m-t-35 { + margin-top: 35px; +} + +.m-t-36 { + margin-top: 36px; +} + +.m-t-37 { + margin-top: 37px; +} + +.m-t-38 { + margin-top: 38px; +} + +.m-t-39 { + margin-top: 39px; +} + +.m-t-40 { + margin-top: 40px; +} + +.m-t-41 { + margin-top: 41px; +} + +.m-t-42 { + margin-top: 42px; +} + +.m-t-43 { + margin-top: 43px; +} + +.m-t-44 { + margin-top: 44px; +} + +.m-t-45 { + margin-top: 45px; +} + +.m-t-46 { + margin-top: 46px; +} + +.m-t-47 { + margin-top: 47px; +} + +.m-t-48 { + margin-top: 48px; +} + +.m-t-49 { + margin-top: 49px; +} + +.m-t-50 { + margin-top: 50px; +} + +.m-t-51 { + margin-top: 51px; +} + +.m-t-52 { + margin-top: 52px; +} + +.m-t-53 { + margin-top: 53px; +} + +.m-t-54 { + margin-top: 54px; +} + +.m-t-55 { + margin-top: 55px; +} + +.m-t-56 { + margin-top: 56px; +} + +.m-t-57 { + margin-top: 57px; +} + +.m-t-58 { + margin-top: 58px; +} + +.m-t-59 { + margin-top: 59px; +} + +.m-t-60 { + margin-top: 60px; +} + +.m-t-61 { + margin-top: 61px; +} + +.m-t-62 { + margin-top: 62px; +} + +.m-t-63 { + margin-top: 63px; +} + +.m-t-64 { + margin-top: 64px; +} + +.m-t-65 { + margin-top: 65px; +} + +.m-t-66 { + margin-top: 66px; +} + +.m-t-67 { + margin-top: 67px; +} + +.m-t-68 { + margin-top: 68px; +} + +.m-t-69 { + margin-top: 69px; +} + +.m-t-70 { + margin-top: 70px; +} + +.m-t-71 { + margin-top: 71px; +} + +.m-t-72 { + margin-top: 72px; +} + +.m-t-73 { + margin-top: 73px; +} + +.m-t-74 { + margin-top: 74px; +} + +.m-t-75 { + margin-top: 75px; +} + +.m-t-76 { + margin-top: 76px; +} + +.m-t-77 { + margin-top: 77px; +} + +.m-t-78 { + margin-top: 78px; +} + +.m-t-79 { + margin-top: 79px; +} + +.m-t-80 { + margin-top: 80px; +} + +.m-t-81 { + margin-top: 81px; +} + +.m-t-82 { + margin-top: 82px; +} + +.m-t-83 { + margin-top: 83px; +} + +.m-t-84 { + margin-top: 84px; +} + +.m-t-85 { + margin-top: 85px; +} + +.m-t-86 { + margin-top: 86px; +} + +.m-t-87 { + margin-top: 87px; +} + +.m-t-88 { + margin-top: 88px; +} + +.m-t-89 { + margin-top: 89px; +} + +.m-t-90 { + margin-top: 90px; +} + +.m-t-91 { + margin-top: 91px; +} + +.m-t-92 { + margin-top: 92px; +} + +.m-t-93 { + margin-top: 93px; +} + +.m-t-94 { + margin-top: 94px; +} + +.m-t-95 { + margin-top: 95px; +} + +.m-t-96 { + margin-top: 96px; +} + +.m-t-97 { + margin-top: 97px; +} + +.m-t-98 { + margin-top: 98px; +} + +.m-t-99 { + margin-top: 99px; +} + +.m-t-100 { + margin-top: 100px; +} + +.m-t-101 { + margin-top: 101px; +} + +.m-t-102 { + margin-top: 102px; +} + +.m-t-103 { + margin-top: 103px; +} + +.m-t-104 { + margin-top: 104px; +} + +.m-t-105 { + margin-top: 105px; +} + +.m-t-106 { + margin-top: 106px; +} + +.m-t-107 { + margin-top: 107px; +} + +.m-t-108 { + margin-top: 108px; +} + +.m-t-109 { + margin-top: 109px; +} + +.m-t-110 { + margin-top: 110px; +} + +.m-t-111 { + margin-top: 111px; +} + +.m-t-112 { + margin-top: 112px; +} + +.m-t-113 { + margin-top: 113px; +} + +.m-t-114 { + margin-top: 114px; +} + +.m-t-115 { + margin-top: 115px; +} + +.m-t-116 { + margin-top: 116px; +} + +.m-t-117 { + margin-top: 117px; +} + +.m-t-118 { + margin-top: 118px; +} + +.m-t-119 { + margin-top: 119px; +} + +.m-t-120 { + margin-top: 120px; +} + +.m-t-121 { + margin-top: 121px; +} + +.m-t-122 { + margin-top: 122px; +} + +.m-t-123 { + margin-top: 123px; +} + +.m-t-124 { + margin-top: 124px; +} + +.m-t-125 { + margin-top: 125px; +} + +.m-t-126 { + margin-top: 126px; +} + +.m-t-127 { + margin-top: 127px; +} + +.m-t-128 { + margin-top: 128px; +} + +.m-t-129 { + margin-top: 129px; +} + +.m-t-130 { + margin-top: 130px; +} + +.m-t-131 { + margin-top: 131px; +} + +.m-t-132 { + margin-top: 132px; +} + +.m-t-133 { + margin-top: 133px; +} + +.m-t-134 { + margin-top: 134px; +} + +.m-t-135 { + margin-top: 135px; +} + +.m-t-136 { + margin-top: 136px; +} + +.m-t-137 { + margin-top: 137px; +} + +.m-t-138 { + margin-top: 138px; +} + +.m-t-139 { + margin-top: 139px; +} + +.m-t-140 { + margin-top: 140px; +} + +.m-t-141 { + margin-top: 141px; +} + +.m-t-142 { + margin-top: 142px; +} + +.m-t-143 { + margin-top: 143px; +} + +.m-t-144 { + margin-top: 144px; +} + +.m-t-145 { + margin-top: 145px; +} + +.m-t-146 { + margin-top: 146px; +} + +.m-t-147 { + margin-top: 147px; +} + +.m-t-148 { + margin-top: 148px; +} + +.m-t-149 { + margin-top: 149px; +} + +.m-t-150 { + margin-top: 150px; +} + +.m-t-151 { + margin-top: 151px; +} + +.m-t-152 { + margin-top: 152px; +} + +.m-t-153 { + margin-top: 153px; +} + +.m-t-154 { + margin-top: 154px; +} + +.m-t-155 { + margin-top: 155px; +} + +.m-t-156 { + margin-top: 156px; +} + +.m-t-157 { + margin-top: 157px; +} + +.m-t-158 { + margin-top: 158px; +} + +.m-t-159 { + margin-top: 159px; +} + +.m-t-160 { + margin-top: 160px; +} + +.m-t-161 { + margin-top: 161px; +} + +.m-t-162 { + margin-top: 162px; +} + +.m-t-163 { + margin-top: 163px; +} + +.m-t-164 { + margin-top: 164px; +} + +.m-t-165 { + margin-top: 165px; +} + +.m-t-166 { + margin-top: 166px; +} + +.m-t-167 { + margin-top: 167px; +} + +.m-t-168 { + margin-top: 168px; +} + +.m-t-169 { + margin-top: 169px; +} + +.m-t-170 { + margin-top: 170px; +} + +.m-t-171 { + margin-top: 171px; +} + +.m-t-172 { + margin-top: 172px; +} + +.m-t-173 { + margin-top: 173px; +} + +.m-t-174 { + margin-top: 174px; +} + +.m-t-175 { + margin-top: 175px; +} + +.m-t-176 { + margin-top: 176px; +} + +.m-t-177 { + margin-top: 177px; +} + +.m-t-178 { + margin-top: 178px; +} + +.m-t-179 { + margin-top: 179px; +} + +.m-t-180 { + margin-top: 180px; +} + +.m-t-181 { + margin-top: 181px; +} + +.m-t-182 { + margin-top: 182px; +} + +.m-t-183 { + margin-top: 183px; +} + +.m-t-184 { + margin-top: 184px; +} + +.m-t-185 { + margin-top: 185px; +} + +.m-t-186 { + margin-top: 186px; +} + +.m-t-187 { + margin-top: 187px; +} + +.m-t-188 { + margin-top: 188px; +} + +.m-t-189 { + margin-top: 189px; +} + +.m-t-190 { + margin-top: 190px; +} + +.m-t-191 { + margin-top: 191px; +} + +.m-t-192 { + margin-top: 192px; +} + +.m-t-193 { + margin-top: 193px; +} + +.m-t-194 { + margin-top: 194px; +} + +.m-t-195 { + margin-top: 195px; +} + +.m-t-196 { + margin-top: 196px; +} + +.m-t-197 { + margin-top: 197px; +} + +.m-t-198 { + margin-top: 198px; +} + +.m-t-199 { + margin-top: 199px; +} + +.m-t-200 { + margin-top: 200px; +} + +.m-t-201 { + margin-top: 201px; +} + +.m-t-202 { + margin-top: 202px; +} + +.m-t-203 { + margin-top: 203px; +} + +.m-t-204 { + margin-top: 204px; +} + +.m-t-205 { + margin-top: 205px; +} + +.m-t-206 { + margin-top: 206px; +} + +.m-t-207 { + margin-top: 207px; +} + +.m-t-208 { + margin-top: 208px; +} + +.m-t-209 { + margin-top: 209px; +} + +.m-t-210 { + margin-top: 210px; +} + +.m-t-211 { + margin-top: 211px; +} + +.m-t-212 { + margin-top: 212px; +} + +.m-t-213 { + margin-top: 213px; +} + +.m-t-214 { + margin-top: 214px; +} + +.m-t-215 { + margin-top: 215px; +} + +.m-t-216 { + margin-top: 216px; +} + +.m-t-217 { + margin-top: 217px; +} + +.m-t-218 { + margin-top: 218px; +} + +.m-t-219 { + margin-top: 219px; +} + +.m-t-220 { + margin-top: 220px; +} + +.m-t-221 { + margin-top: 221px; +} + +.m-t-222 { + margin-top: 222px; +} + +.m-t-223 { + margin-top: 223px; +} + +.m-t-224 { + margin-top: 224px; +} + +.m-t-225 { + margin-top: 225px; +} + +.m-t-226 { + margin-top: 226px; +} + +.m-t-227 { + margin-top: 227px; +} + +.m-t-228 { + margin-top: 228px; +} + +.m-t-229 { + margin-top: 229px; +} + +.m-t-230 { + margin-top: 230px; +} + +.m-t-231 { + margin-top: 231px; +} + +.m-t-232 { + margin-top: 232px; +} + +.m-t-233 { + margin-top: 233px; +} + +.m-t-234 { + margin-top: 234px; +} + +.m-t-235 { + margin-top: 235px; +} + +.m-t-236 { + margin-top: 236px; +} + +.m-t-237 { + margin-top: 237px; +} + +.m-t-238 { + margin-top: 238px; +} + +.m-t-239 { + margin-top: 239px; +} + +.m-t-240 { + margin-top: 240px; +} + +.m-t-241 { + margin-top: 241px; +} + +.m-t-242 { + margin-top: 242px; +} + +.m-t-243 { + margin-top: 243px; +} + +.m-t-244 { + margin-top: 244px; +} + +.m-t-245 { + margin-top: 245px; +} + +.m-t-246 { + margin-top: 246px; +} + +.m-t-247 { + margin-top: 247px; +} + +.m-t-248 { + margin-top: 248px; +} + +.m-t-249 { + margin-top: 249px; +} + +.m-t-250 { + margin-top: 250px; +} + +.m-b-0 { + margin-bottom: 0; +} + +.m-b-1 { + margin-bottom: 1px; +} + +.m-b-2 { + margin-bottom: 2px; +} + +.m-b-3 { + margin-bottom: 3px; +} + +.m-b-4 { + margin-bottom: 4px; +} + +.m-b-5 { + margin-bottom: 5px; +} + +.m-b-6 { + margin-bottom: 6px; +} + +.m-b-7 { + margin-bottom: 7px; +} + +.m-b-8 { + margin-bottom: 8px; +} + +.m-b-9 { + margin-bottom: 9px; +} + +.m-b-10 { + margin-bottom: 10px; +} + +.m-b-11 { + margin-bottom: 11px; +} + +.m-b-12 { + margin-bottom: 12px; +} + +.m-b-13 { + margin-bottom: 13px; +} + +.m-b-14 { + margin-bottom: 14px; +} + +.m-b-15 { + margin-bottom: 15px; +} + +.m-b-16 { + margin-bottom: 16px; +} + +.m-b-17 { + margin-bottom: 17px; +} + +.m-b-18 { + margin-bottom: 18px; +} + +.m-b-19 { + margin-bottom: 19px; +} + +.m-b-20 { + margin-bottom: 20px; +} + +.m-b-21 { + margin-bottom: 21px; +} + +.m-b-22 { + margin-bottom: 22px; +} + +.m-b-23 { + margin-bottom: 23px; +} + +.m-b-24 { + margin-bottom: 24px; +} + +.m-b-25 { + margin-bottom: 25px; +} + +.m-b-26 { + margin-bottom: 26px; +} + +.m-b-27 { + margin-bottom: 27px; +} + +.m-b-28 { + margin-bottom: 28px; +} + +.m-b-29 { + margin-bottom: 29px; +} + +.m-b-30 { + margin-bottom: 30px; +} + +.m-b-31 { + margin-bottom: 31px; +} + +.m-b-32 { + margin-bottom: 32px; +} + +.m-b-33 { + margin-bottom: 33px; +} + +.m-b-34 { + margin-bottom: 34px; +} + +.m-b-35 { + margin-bottom: 35px; +} + +.m-b-36 { + margin-bottom: 36px; +} + +.m-b-37 { + margin-bottom: 37px; +} + +.m-b-38 { + margin-bottom: 38px; +} + +.m-b-39 { + margin-bottom: 39px; +} + +.m-b-40 { + margin-bottom: 40px; +} + +.m-b-41 { + margin-bottom: 41px; +} + +.m-b-42 { + margin-bottom: 42px; +} + +.m-b-43 { + margin-bottom: 43px; +} + +.m-b-44 { + margin-bottom: 44px; +} + +.m-b-45 { + margin-bottom: 45px; +} + +.m-b-46 { + margin-bottom: 46px; +} + +.m-b-47 { + margin-bottom: 47px; +} + +.m-b-48 { + margin-bottom: 48px; +} + +.m-b-49 { + margin-bottom: 49px; +} + +.m-b-50 { + margin-bottom: 50px; +} + +.m-b-51 { + margin-bottom: 51px; +} + +.m-b-52 { + margin-bottom: 52px; +} + +.m-b-53 { + margin-bottom: 53px; +} + +.m-b-54 { + margin-bottom: 54px; +} + +.m-b-55 { + margin-bottom: 55px; +} + +.m-b-56 { + margin-bottom: 56px; +} + +.m-b-57 { + margin-bottom: 57px; +} + +.m-b-58 { + margin-bottom: 58px; +} + +.m-b-59 { + margin-bottom: 59px; +} + +.m-b-60 { + margin-bottom: 60px; +} + +.m-b-61 { + margin-bottom: 61px; +} + +.m-b-62 { + margin-bottom: 62px; +} + +.m-b-63 { + margin-bottom: 63px; +} + +.m-b-64 { + margin-bottom: 64px; +} + +.m-b-65 { + margin-bottom: 65px; +} + +.m-b-66 { + margin-bottom: 66px; +} + +.m-b-67 { + margin-bottom: 67px; +} + +.m-b-68 { + margin-bottom: 68px; +} + +.m-b-69 { + margin-bottom: 69px; +} + +.m-b-70 { + margin-bottom: 70px; +} + +.m-b-71 { + margin-bottom: 71px; +} + +.m-b-72 { + margin-bottom: 72px; +} + +.m-b-73 { + margin-bottom: 73px; +} + +.m-b-74 { + margin-bottom: 74px; +} + +.m-b-75 { + margin-bottom: 75px; +} + +.m-b-76 { + margin-bottom: 76px; +} + +.m-b-77 { + margin-bottom: 77px; +} + +.m-b-78 { + margin-bottom: 78px; +} + +.m-b-79 { + margin-bottom: 79px; +} + +.m-b-80 { + margin-bottom: 80px; +} + +.m-b-81 { + margin-bottom: 81px; +} + +.m-b-82 { + margin-bottom: 82px; +} + +.m-b-83 { + margin-bottom: 83px; +} + +.m-b-84 { + margin-bottom: 84px; +} + +.m-b-85 { + margin-bottom: 85px; +} + +.m-b-86 { + margin-bottom: 86px; +} + +.m-b-87 { + margin-bottom: 87px; +} + +.m-b-88 { + margin-bottom: 88px; +} + +.m-b-89 { + margin-bottom: 89px; +} + +.m-b-90 { + margin-bottom: 90px; +} + +.m-b-91 { + margin-bottom: 91px; +} + +.m-b-92 { + margin-bottom: 92px; +} + +.m-b-93 { + margin-bottom: 93px; +} + +.m-b-94 { + margin-bottom: 94px; +} + +.m-b-95 { + margin-bottom: 95px; +} + +.m-b-96 { + margin-bottom: 96px; +} + +.m-b-97 { + margin-bottom: 97px; +} + +.m-b-98 { + margin-bottom: 98px; +} + +.m-b-99 { + margin-bottom: 99px; +} + +.m-b-100 { + margin-bottom: 100px; +} + +.m-b-101 { + margin-bottom: 101px; +} + +.m-b-102 { + margin-bottom: 102px; +} + +.m-b-103 { + margin-bottom: 103px; +} + +.m-b-104 { + margin-bottom: 104px; +} + +.m-b-105 { + margin-bottom: 105px; +} + +.m-b-106 { + margin-bottom: 106px; +} + +.m-b-107 { + margin-bottom: 107px; +} + +.m-b-108 { + margin-bottom: 108px; +} + +.m-b-109 { + margin-bottom: 109px; +} + +.m-b-110 { + margin-bottom: 110px; +} + +.m-b-111 { + margin-bottom: 111px; +} + +.m-b-112 { + margin-bottom: 112px; +} + +.m-b-113 { + margin-bottom: 113px; +} + +.m-b-114 { + margin-bottom: 114px; +} + +.m-b-115 { + margin-bottom: 115px; +} + +.m-b-116 { + margin-bottom: 116px; +} + +.m-b-117 { + margin-bottom: 117px; +} + +.m-b-118 { + margin-bottom: 118px; +} + +.m-b-119 { + margin-bottom: 119px; +} + +.m-b-120 { + margin-bottom: 120px; +} + +.m-b-121 { + margin-bottom: 121px; +} + +.m-b-122 { + margin-bottom: 122px; +} + +.m-b-123 { + margin-bottom: 123px; +} + +.m-b-124 { + margin-bottom: 124px; +} + +.m-b-125 { + margin-bottom: 125px; +} + +.m-b-126 { + margin-bottom: 126px; +} + +.m-b-127 { + margin-bottom: 127px; +} + +.m-b-128 { + margin-bottom: 128px; +} + +.m-b-129 { + margin-bottom: 129px; +} + +.m-b-130 { + margin-bottom: 130px; +} + +.m-b-131 { + margin-bottom: 131px; +} + +.m-b-132 { + margin-bottom: 132px; +} + +.m-b-133 { + margin-bottom: 133px; +} + +.m-b-134 { + margin-bottom: 134px; +} + +.m-b-135 { + margin-bottom: 135px; +} + +.m-b-136 { + margin-bottom: 136px; +} + +.m-b-137 { + margin-bottom: 137px; +} + +.m-b-138 { + margin-bottom: 138px; +} + +.m-b-139 { + margin-bottom: 139px; +} + +.m-b-140 { + margin-bottom: 140px; +} + +.m-b-141 { + margin-bottom: 141px; +} + +.m-b-142 { + margin-bottom: 142px; +} + +.m-b-143 { + margin-bottom: 143px; +} + +.m-b-144 { + margin-bottom: 144px; +} + +.m-b-145 { + margin-bottom: 145px; +} + +.m-b-146 { + margin-bottom: 146px; +} + +.m-b-147 { + margin-bottom: 147px; +} + +.m-b-148 { + margin-bottom: 148px; +} + +.m-b-149 { + margin-bottom: 149px; +} + +.m-b-150 { + margin-bottom: 150px; +} + +.m-b-151 { + margin-bottom: 151px; +} + +.m-b-152 { + margin-bottom: 152px; +} + +.m-b-153 { + margin-bottom: 153px; +} + +.m-b-154 { + margin-bottom: 154px; +} + +.m-b-155 { + margin-bottom: 155px; +} + +.m-b-156 { + margin-bottom: 156px; +} + +.m-b-157 { + margin-bottom: 157px; +} + +.m-b-158 { + margin-bottom: 158px; +} + +.m-b-159 { + margin-bottom: 159px; +} + +.m-b-160 { + margin-bottom: 160px; +} + +.m-b-161 { + margin-bottom: 161px; +} + +.m-b-162 { + margin-bottom: 162px; +} + +.m-b-163 { + margin-bottom: 163px; +} + +.m-b-164 { + margin-bottom: 164px; +} + +.m-b-165 { + margin-bottom: 165px; +} + +.m-b-166 { + margin-bottom: 166px; +} + +.m-b-167 { + margin-bottom: 167px; +} + +.m-b-168 { + margin-bottom: 168px; +} + +.m-b-169 { + margin-bottom: 169px; +} + +.m-b-170 { + margin-bottom: 170px; +} + +.m-b-171 { + margin-bottom: 171px; +} + +.m-b-172 { + margin-bottom: 172px; +} + +.m-b-173 { + margin-bottom: 173px; +} + +.m-b-174 { + margin-bottom: 174px; +} + +.m-b-175 { + margin-bottom: 175px; +} + +.m-b-176 { + margin-bottom: 176px; +} + +.m-b-177 { + margin-bottom: 177px; +} + +.m-b-178 { + margin-bottom: 178px; +} + +.m-b-179 { + margin-bottom: 179px; +} + +.m-b-180 { + margin-bottom: 180px; +} + +.m-b-181 { + margin-bottom: 181px; +} + +.m-b-182 { + margin-bottom: 182px; +} + +.m-b-183 { + margin-bottom: 183px; +} + +.m-b-184 { + margin-bottom: 184px; +} + +.m-b-185 { + margin-bottom: 185px; +} + +.m-b-186 { + margin-bottom: 186px; +} + +.m-b-187 { + margin-bottom: 187px; +} + +.m-b-188 { + margin-bottom: 188px; +} + +.m-b-189 { + margin-bottom: 189px; +} + +.m-b-190 { + margin-bottom: 190px; +} + +.m-b-191 { + margin-bottom: 191px; +} + +.m-b-192 { + margin-bottom: 192px; +} + +.m-b-193 { + margin-bottom: 193px; +} + +.m-b-194 { + margin-bottom: 194px; +} + +.m-b-195 { + margin-bottom: 195px; +} + +.m-b-196 { + margin-bottom: 196px; +} + +.m-b-197 { + margin-bottom: 197px; +} + +.m-b-198 { + margin-bottom: 198px; +} + +.m-b-199 { + margin-bottom: 199px; +} + +.m-b-200 { + margin-bottom: 200px; +} + +.m-b-201 { + margin-bottom: 201px; +} + +.m-b-202 { + margin-bottom: 202px; +} + +.m-b-203 { + margin-bottom: 203px; +} + +.m-b-204 { + margin-bottom: 204px; +} + +.m-b-205 { + margin-bottom: 205px; +} + +.m-b-206 { + margin-bottom: 206px; +} + +.m-b-207 { + margin-bottom: 207px; +} + +.m-b-208 { + margin-bottom: 208px; +} + +.m-b-209 { + margin-bottom: 209px; +} + +.m-b-210 { + margin-bottom: 210px; +} + +.m-b-211 { + margin-bottom: 211px; +} + +.m-b-212 { + margin-bottom: 212px; +} + +.m-b-213 { + margin-bottom: 213px; +} + +.m-b-214 { + margin-bottom: 214px; +} + +.m-b-215 { + margin-bottom: 215px; +} + +.m-b-216 { + margin-bottom: 216px; +} + +.m-b-217 { + margin-bottom: 217px; +} + +.m-b-218 { + margin-bottom: 218px; +} + +.m-b-219 { + margin-bottom: 219px; +} + +.m-b-220 { + margin-bottom: 220px; +} + +.m-b-221 { + margin-bottom: 221px; +} + +.m-b-222 { + margin-bottom: 222px; +} + +.m-b-223 { + margin-bottom: 223px; +} + +.m-b-224 { + margin-bottom: 224px; +} + +.m-b-225 { + margin-bottom: 225px; +} + +.m-b-226 { + margin-bottom: 226px; +} + +.m-b-227 { + margin-bottom: 227px; +} + +.m-b-228 { + margin-bottom: 228px; +} + +.m-b-229 { + margin-bottom: 229px; +} + +.m-b-230 { + margin-bottom: 230px; +} + +.m-b-231 { + margin-bottom: 231px; +} + +.m-b-232 { + margin-bottom: 232px; +} + +.m-b-233 { + margin-bottom: 233px; +} + +.m-b-234 { + margin-bottom: 234px; +} + +.m-b-235 { + margin-bottom: 235px; +} + +.m-b-236 { + margin-bottom: 236px; +} + +.m-b-237 { + margin-bottom: 237px; +} + +.m-b-238 { + margin-bottom: 238px; +} + +.m-b-239 { + margin-bottom: 239px; +} + +.m-b-240 { + margin-bottom: 240px; +} + +.m-b-241 { + margin-bottom: 241px; +} + +.m-b-242 { + margin-bottom: 242px; +} + +.m-b-243 { + margin-bottom: 243px; +} + +.m-b-244 { + margin-bottom: 244px; +} + +.m-b-245 { + margin-bottom: 245px; +} + +.m-b-246 { + margin-bottom: 246px; +} + +.m-b-247 { + margin-bottom: 247px; +} + +.m-b-248 { + margin-bottom: 248px; +} + +.m-b-249 { + margin-bottom: 249px; +} + +.m-b-250 { + margin-bottom: 250px; +} + +.m-l-0 { + margin-left: 0; +} + +.m-l-1 { + margin-left: 1px; +} + +.m-l-2 { + margin-left: 2px; +} + +.m-l-3 { + margin-left: 3px; +} + +.m-l-4 { + margin-left: 4px; +} + +.m-l-5 { + margin-left: 5px; +} + +.m-l-6 { + margin-left: 6px; +} + +.m-l-7 { + margin-left: 7px; +} + +.m-l-8 { + margin-left: 8px; +} + +.m-l-9 { + margin-left: 9px; +} + +.m-l-10 { + margin-left: 10px; +} + +.m-l-11 { + margin-left: 11px; +} + +.m-l-12 { + margin-left: 12px; +} + +.m-l-13 { + margin-left: 13px; +} + +.m-l-14 { + margin-left: 14px; +} + +.m-l-15 { + margin-left: 15px; +} + +.m-l-16 { + margin-left: 16px; +} + +.m-l-17 { + margin-left: 17px; +} + +.m-l-18 { + margin-left: 18px; +} + +.m-l-19 { + margin-left: 19px; +} + +.m-l-20 { + margin-left: 20px; +} + +.m-l-21 { + margin-left: 21px; +} + +.m-l-22 { + margin-left: 22px; +} + +.m-l-23 { + margin-left: 23px; +} + +.m-l-24 { + margin-left: 24px; +} + +.m-l-25 { + margin-left: 25px; +} + +.m-l-26 { + margin-left: 26px; +} + +.m-l-27 { + margin-left: 27px; +} + +.m-l-28 { + margin-left: 28px; +} + +.m-l-29 { + margin-left: 29px; +} + +.m-l-30 { + margin-left: 30px; +} + +.m-l-31 { + margin-left: 31px; +} + +.m-l-32 { + margin-left: 32px; +} + +.m-l-33 { + margin-left: 33px; +} + +.m-l-34 { + margin-left: 34px; +} + +.m-l-35 { + margin-left: 35px; +} + +.m-l-36 { + margin-left: 36px; +} + +.m-l-37 { + margin-left: 37px; +} + +.m-l-38 { + margin-left: 38px; +} + +.m-l-39 { + margin-left: 39px; +} + +.m-l-40 { + margin-left: 40px; +} + +.m-l-41 { + margin-left: 41px; +} + +.m-l-42 { + margin-left: 42px; +} + +.m-l-43 { + margin-left: 43px; +} + +.m-l-44 { + margin-left: 44px; +} + +.m-l-45 { + margin-left: 45px; +} + +.m-l-46 { + margin-left: 46px; +} + +.m-l-47 { + margin-left: 47px; +} + +.m-l-48 { + margin-left: 48px; +} + +.m-l-49 { + margin-left: 49px; +} + +.m-l-50 { + margin-left: 50px; +} + +.m-l-51 { + margin-left: 51px; +} + +.m-l-52 { + margin-left: 52px; +} + +.m-l-53 { + margin-left: 53px; +} + +.m-l-54 { + margin-left: 54px; +} + +.m-l-55 { + margin-left: 55px; +} + +.m-l-56 { + margin-left: 56px; +} + +.m-l-57 { + margin-left: 57px; +} + +.m-l-58 { + margin-left: 58px; +} + +.m-l-59 { + margin-left: 59px; +} + +.m-l-60 { + margin-left: 60px; +} + +.m-l-61 { + margin-left: 61px; +} + +.m-l-62 { + margin-left: 62px; +} + +.m-l-63 { + margin-left: 63px; +} + +.m-l-64 { + margin-left: 64px; +} + +.m-l-65 { + margin-left: 65px; +} + +.m-l-66 { + margin-left: 66px; +} + +.m-l-67 { + margin-left: 67px; +} + +.m-l-68 { + margin-left: 68px; +} + +.m-l-69 { + margin-left: 69px; +} + +.m-l-70 { + margin-left: 70px; +} + +.m-l-71 { + margin-left: 71px; +} + +.m-l-72 { + margin-left: 72px; +} + +.m-l-73 { + margin-left: 73px; +} + +.m-l-74 { + margin-left: 74px; +} + +.m-l-75 { + margin-left: 75px; +} + +.m-l-76 { + margin-left: 76px; +} + +.m-l-77 { + margin-left: 77px; +} + +.m-l-78 { + margin-left: 78px; +} + +.m-l-79 { + margin-left: 79px; +} + +.m-l-80 { + margin-left: 80px; +} + +.m-l-81 { + margin-left: 81px; +} + +.m-l-82 { + margin-left: 82px; +} + +.m-l-83 { + margin-left: 83px; +} + +.m-l-84 { + margin-left: 84px; +} + +.m-l-85 { + margin-left: 85px; +} + +.m-l-86 { + margin-left: 86px; +} + +.m-l-87 { + margin-left: 87px; +} + +.m-l-88 { + margin-left: 88px; +} + +.m-l-89 { + margin-left: 89px; +} + +.m-l-90 { + margin-left: 90px; +} + +.m-l-91 { + margin-left: 91px; +} + +.m-l-92 { + margin-left: 92px; +} + +.m-l-93 { + margin-left: 93px; +} + +.m-l-94 { + margin-left: 94px; +} + +.m-l-95 { + margin-left: 95px; +} + +.m-l-96 { + margin-left: 96px; +} + +.m-l-97 { + margin-left: 97px; +} + +.m-l-98 { + margin-left: 98px; +} + +.m-l-99 { + margin-left: 99px; +} + +.m-l-100 { + margin-left: 100px; +} + +.m-l-101 { + margin-left: 101px; +} + +.m-l-102 { + margin-left: 102px; +} + +.m-l-103 { + margin-left: 103px; +} + +.m-l-104 { + margin-left: 104px; +} + +.m-l-105 { + margin-left: 105px; +} + +.m-l-106 { + margin-left: 106px; +} + +.m-l-107 { + margin-left: 107px; +} + +.m-l-108 { + margin-left: 108px; +} + +.m-l-109 { + margin-left: 109px; +} + +.m-l-110 { + margin-left: 110px; +} + +.m-l-111 { + margin-left: 111px; +} + +.m-l-112 { + margin-left: 112px; +} + +.m-l-113 { + margin-left: 113px; +} + +.m-l-114 { + margin-left: 114px; +} + +.m-l-115 { + margin-left: 115px; +} + +.m-l-116 { + margin-left: 116px; +} + +.m-l-117 { + margin-left: 117px; +} + +.m-l-118 { + margin-left: 118px; +} + +.m-l-119 { + margin-left: 119px; +} + +.m-l-120 { + margin-left: 120px; +} + +.m-l-121 { + margin-left: 121px; +} + +.m-l-122 { + margin-left: 122px; +} + +.m-l-123 { + margin-left: 123px; +} + +.m-l-124 { + margin-left: 124px; +} + +.m-l-125 { + margin-left: 125px; +} + +.m-l-126 { + margin-left: 126px; +} + +.m-l-127 { + margin-left: 127px; +} + +.m-l-128 { + margin-left: 128px; +} + +.m-l-129 { + margin-left: 129px; +} + +.m-l-130 { + margin-left: 130px; +} + +.m-l-131 { + margin-left: 131px; +} + +.m-l-132 { + margin-left: 132px; +} + +.m-l-133 { + margin-left: 133px; +} + +.m-l-134 { + margin-left: 134px; +} + +.m-l-135 { + margin-left: 135px; +} + +.m-l-136 { + margin-left: 136px; +} + +.m-l-137 { + margin-left: 137px; +} + +.m-l-138 { + margin-left: 138px; +} + +.m-l-139 { + margin-left: 139px; +} + +.m-l-140 { + margin-left: 140px; +} + +.m-l-141 { + margin-left: 141px; +} + +.m-l-142 { + margin-left: 142px; +} + +.m-l-143 { + margin-left: 143px; +} + +.m-l-144 { + margin-left: 144px; +} + +.m-l-145 { + margin-left: 145px; +} + +.m-l-146 { + margin-left: 146px; +} + +.m-l-147 { + margin-left: 147px; +} + +.m-l-148 { + margin-left: 148px; +} + +.m-l-149 { + margin-left: 149px; +} + +.m-l-150 { + margin-left: 150px; +} + +.m-l-151 { + margin-left: 151px; +} + +.m-l-152 { + margin-left: 152px; +} + +.m-l-153 { + margin-left: 153px; +} + +.m-l-154 { + margin-left: 154px; +} + +.m-l-155 { + margin-left: 155px; +} + +.m-l-156 { + margin-left: 156px; +} + +.m-l-157 { + margin-left: 157px; +} + +.m-l-158 { + margin-left: 158px; +} + +.m-l-159 { + margin-left: 159px; +} + +.m-l-160 { + margin-left: 160px; +} + +.m-l-161 { + margin-left: 161px; +} + +.m-l-162 { + margin-left: 162px; +} + +.m-l-163 { + margin-left: 163px; +} + +.m-l-164 { + margin-left: 164px; +} + +.m-l-165 { + margin-left: 165px; +} + +.m-l-166 { + margin-left: 166px; +} + +.m-l-167 { + margin-left: 167px; +} + +.m-l-168 { + margin-left: 168px; +} + +.m-l-169 { + margin-left: 169px; +} + +.m-l-170 { + margin-left: 170px; +} + +.m-l-171 { + margin-left: 171px; +} + +.m-l-172 { + margin-left: 172px; +} + +.m-l-173 { + margin-left: 173px; +} + +.m-l-174 { + margin-left: 174px; +} + +.m-l-175 { + margin-left: 175px; +} + +.m-l-176 { + margin-left: 176px; +} + +.m-l-177 { + margin-left: 177px; +} + +.m-l-178 { + margin-left: 178px; +} + +.m-l-179 { + margin-left: 179px; +} + +.m-l-180 { + margin-left: 180px; +} + +.m-l-181 { + margin-left: 181px; +} + +.m-l-182 { + margin-left: 182px; +} + +.m-l-183 { + margin-left: 183px; +} + +.m-l-184 { + margin-left: 184px; +} + +.m-l-185 { + margin-left: 185px; +} + +.m-l-186 { + margin-left: 186px; +} + +.m-l-187 { + margin-left: 187px; +} + +.m-l-188 { + margin-left: 188px; +} + +.m-l-189 { + margin-left: 189px; +} + +.m-l-190 { + margin-left: 190px; +} + +.m-l-191 { + margin-left: 191px; +} + +.m-l-192 { + margin-left: 192px; +} + +.m-l-193 { + margin-left: 193px; +} + +.m-l-194 { + margin-left: 194px; +} + +.m-l-195 { + margin-left: 195px; +} + +.m-l-196 { + margin-left: 196px; +} + +.m-l-197 { + margin-left: 197px; +} + +.m-l-198 { + margin-left: 198px; +} + +.m-l-199 { + margin-left: 199px; +} + +.m-l-200 { + margin-left: 200px; +} + +.m-l-201 { + margin-left: 201px; +} + +.m-l-202 { + margin-left: 202px; +} + +.m-l-203 { + margin-left: 203px; +} + +.m-l-204 { + margin-left: 204px; +} + +.m-l-205 { + margin-left: 205px; +} + +.m-l-206 { + margin-left: 206px; +} + +.m-l-207 { + margin-left: 207px; +} + +.m-l-208 { + margin-left: 208px; +} + +.m-l-209 { + margin-left: 209px; +} + +.m-l-210 { + margin-left: 210px; +} + +.m-l-211 { + margin-left: 211px; +} + +.m-l-212 { + margin-left: 212px; +} + +.m-l-213 { + margin-left: 213px; +} + +.m-l-214 { + margin-left: 214px; +} + +.m-l-215 { + margin-left: 215px; +} + +.m-l-216 { + margin-left: 216px; +} + +.m-l-217 { + margin-left: 217px; +} + +.m-l-218 { + margin-left: 218px; +} + +.m-l-219 { + margin-left: 219px; +} + +.m-l-220 { + margin-left: 220px; +} + +.m-l-221 { + margin-left: 221px; +} + +.m-l-222 { + margin-left: 222px; +} + +.m-l-223 { + margin-left: 223px; +} + +.m-l-224 { + margin-left: 224px; +} + +.m-l-225 { + margin-left: 225px; +} + +.m-l-226 { + margin-left: 226px; +} + +.m-l-227 { + margin-left: 227px; +} + +.m-l-228 { + margin-left: 228px; +} + +.m-l-229 { + margin-left: 229px; +} + +.m-l-230 { + margin-left: 230px; +} + +.m-l-231 { + margin-left: 231px; +} + +.m-l-232 { + margin-left: 232px; +} + +.m-l-233 { + margin-left: 233px; +} + +.m-l-234 { + margin-left: 234px; +} + +.m-l-235 { + margin-left: 235px; +} + +.m-l-236 { + margin-left: 236px; +} + +.m-l-237 { + margin-left: 237px; +} + +.m-l-238 { + margin-left: 238px; +} + +.m-l-239 { + margin-left: 239px; +} + +.m-l-240 { + margin-left: 240px; +} + +.m-l-241 { + margin-left: 241px; +} + +.m-l-242 { + margin-left: 242px; +} + +.m-l-243 { + margin-left: 243px; +} + +.m-l-244 { + margin-left: 244px; +} + +.m-l-245 { + margin-left: 245px; +} + +.m-l-246 { + margin-left: 246px; +} + +.m-l-247 { + margin-left: 247px; +} + +.m-l-248 { + margin-left: 248px; +} + +.m-l-249 { + margin-left: 249px; +} + +.m-l-250 { + margin-left: 250px; +} + +.m-r-0 { + margin-right: 0; +} + +.m-r-1 { + margin-right: 1px; +} + +.m-r-2 { + margin-right: 2px; +} + +.m-r-3 { + margin-right: 3px; +} + +.m-r-4 { + margin-right: 4px; +} + +.m-r-5 { + margin-right: 5px; +} + +.m-r-6 { + margin-right: 6px; +} + +.m-r-7 { + margin-right: 7px; +} + +.m-r-8 { + margin-right: 8px; +} + +.m-r-9 { + margin-right: 9px; +} + +.m-r-10 { + margin-right: 10px; +} + +.m-r-11 { + margin-right: 11px; +} + +.m-r-12 { + margin-right: 12px; +} + +.m-r-13 { + margin-right: 13px; +} + +.m-r-14 { + margin-right: 14px; +} + +.m-r-15 { + margin-right: 15px; +} + +.m-r-16 { + margin-right: 16px; +} + +.m-r-17 { + margin-right: 17px; +} + +.m-r-18 { + margin-right: 18px; +} + +.m-r-19 { + margin-right: 19px; +} + +.m-r-20 { + margin-right: 20px; +} + +.m-r-21 { + margin-right: 21px; +} + +.m-r-22 { + margin-right: 22px; +} + +.m-r-23 { + margin-right: 23px; +} + +.m-r-24 { + margin-right: 24px; +} + +.m-r-25 { + margin-right: 25px; +} + +.m-r-26 { + margin-right: 26px; +} + +.m-r-27 { + margin-right: 27px; +} + +.m-r-28 { + margin-right: 28px; +} + +.m-r-29 { + margin-right: 29px; +} + +.m-r-30 { + margin-right: 30px; +} + +.m-r-31 { + margin-right: 31px; +} + +.m-r-32 { + margin-right: 32px; +} + +.m-r-33 { + margin-right: 33px; +} + +.m-r-34 { + margin-right: 34px; +} + +.m-r-35 { + margin-right: 35px; +} + +.m-r-36 { + margin-right: 36px; +} + +.m-r-37 { + margin-right: 37px; +} + +.m-r-38 { + margin-right: 38px; +} + +.m-r-39 { + margin-right: 39px; +} + +.m-r-40 { + margin-right: 40px; +} + +.m-r-41 { + margin-right: 41px; +} + +.m-r-42 { + margin-right: 42px; +} + +.m-r-43 { + margin-right: 43px; +} + +.m-r-44 { + margin-right: 44px; +} + +.m-r-45 { + margin-right: 45px; +} + +.m-r-46 { + margin-right: 46px; +} + +.m-r-47 { + margin-right: 47px; +} + +.m-r-48 { + margin-right: 48px; +} + +.m-r-49 { + margin-right: 49px; +} + +.m-r-50 { + margin-right: 50px; +} + +.m-r-51 { + margin-right: 51px; +} + +.m-r-52 { + margin-right: 52px; +} + +.m-r-53 { + margin-right: 53px; +} + +.m-r-54 { + margin-right: 54px; +} + +.m-r-55 { + margin-right: 55px; +} + +.m-r-56 { + margin-right: 56px; +} + +.m-r-57 { + margin-right: 57px; +} + +.m-r-58 { + margin-right: 58px; +} + +.m-r-59 { + margin-right: 59px; +} + +.m-r-60 { + margin-right: 60px; +} + +.m-r-61 { + margin-right: 61px; +} + +.m-r-62 { + margin-right: 62px; +} + +.m-r-63 { + margin-right: 63px; +} + +.m-r-64 { + margin-right: 64px; +} + +.m-r-65 { + margin-right: 65px; +} + +.m-r-66 { + margin-right: 66px; +} + +.m-r-67 { + margin-right: 67px; +} + +.m-r-68 { + margin-right: 68px; +} + +.m-r-69 { + margin-right: 69px; +} + +.m-r-70 { + margin-right: 70px; +} + +.m-r-71 { + margin-right: 71px; +} + +.m-r-72 { + margin-right: 72px; +} + +.m-r-73 { + margin-right: 73px; +} + +.m-r-74 { + margin-right: 74px; +} + +.m-r-75 { + margin-right: 75px; +} + +.m-r-76 { + margin-right: 76px; +} + +.m-r-77 { + margin-right: 77px; +} + +.m-r-78 { + margin-right: 78px; +} + +.m-r-79 { + margin-right: 79px; +} + +.m-r-80 { + margin-right: 80px; +} + +.m-r-81 { + margin-right: 81px; +} + +.m-r-82 { + margin-right: 82px; +} + +.m-r-83 { + margin-right: 83px; +} + +.m-r-84 { + margin-right: 84px; +} + +.m-r-85 { + margin-right: 85px; +} + +.m-r-86 { + margin-right: 86px; +} + +.m-r-87 { + margin-right: 87px; +} + +.m-r-88 { + margin-right: 88px; +} + +.m-r-89 { + margin-right: 89px; +} + +.m-r-90 { + margin-right: 90px; +} + +.m-r-91 { + margin-right: 91px; +} + +.m-r-92 { + margin-right: 92px; +} + +.m-r-93 { + margin-right: 93px; +} + +.m-r-94 { + margin-right: 94px; +} + +.m-r-95 { + margin-right: 95px; +} + +.m-r-96 { + margin-right: 96px; +} + +.m-r-97 { + margin-right: 97px; +} + +.m-r-98 { + margin-right: 98px; +} + +.m-r-99 { + margin-right: 99px; +} + +.m-r-100 { + margin-right: 100px; +} + +.m-r-101 { + margin-right: 101px; +} + +.m-r-102 { + margin-right: 102px; +} + +.m-r-103 { + margin-right: 103px; +} + +.m-r-104 { + margin-right: 104px; +} + +.m-r-105 { + margin-right: 105px; +} + +.m-r-106 { + margin-right: 106px; +} + +.m-r-107 { + margin-right: 107px; +} + +.m-r-108 { + margin-right: 108px; +} + +.m-r-109 { + margin-right: 109px; +} + +.m-r-110 { + margin-right: 110px; +} + +.m-r-111 { + margin-right: 111px; +} + +.m-r-112 { + margin-right: 112px; +} + +.m-r-113 { + margin-right: 113px; +} + +.m-r-114 { + margin-right: 114px; +} + +.m-r-115 { + margin-right: 115px; +} + +.m-r-116 { + margin-right: 116px; +} + +.m-r-117 { + margin-right: 117px; +} + +.m-r-118 { + margin-right: 118px; +} + +.m-r-119 { + margin-right: 119px; +} + +.m-r-120 { + margin-right: 120px; +} + +.m-r-121 { + margin-right: 121px; +} + +.m-r-122 { + margin-right: 122px; +} + +.m-r-123 { + margin-right: 123px; +} + +.m-r-124 { + margin-right: 124px; +} + +.m-r-125 { + margin-right: 125px; +} + +.m-r-126 { + margin-right: 126px; +} + +.m-r-127 { + margin-right: 127px; +} + +.m-r-128 { + margin-right: 128px; +} + +.m-r-129 { + margin-right: 129px; +} + +.m-r-130 { + margin-right: 130px; +} + +.m-r-131 { + margin-right: 131px; +} + +.m-r-132 { + margin-right: 132px; +} + +.m-r-133 { + margin-right: 133px; +} + +.m-r-134 { + margin-right: 134px; +} + +.m-r-135 { + margin-right: 135px; +} + +.m-r-136 { + margin-right: 136px; +} + +.m-r-137 { + margin-right: 137px; +} + +.m-r-138 { + margin-right: 138px; +} + +.m-r-139 { + margin-right: 139px; +} + +.m-r-140 { + margin-right: 140px; +} + +.m-r-141 { + margin-right: 141px; +} + +.m-r-142 { + margin-right: 142px; +} + +.m-r-143 { + margin-right: 143px; +} + +.m-r-144 { + margin-right: 144px; +} + +.m-r-145 { + margin-right: 145px; +} + +.m-r-146 { + margin-right: 146px; +} + +.m-r-147 { + margin-right: 147px; +} + +.m-r-148 { + margin-right: 148px; +} + +.m-r-149 { + margin-right: 149px; +} + +.m-r-150 { + margin-right: 150px; +} + +.m-r-151 { + margin-right: 151px; +} + +.m-r-152 { + margin-right: 152px; +} + +.m-r-153 { + margin-right: 153px; +} + +.m-r-154 { + margin-right: 154px; +} + +.m-r-155 { + margin-right: 155px; +} + +.m-r-156 { + margin-right: 156px; +} + +.m-r-157 { + margin-right: 157px; +} + +.m-r-158 { + margin-right: 158px; +} + +.m-r-159 { + margin-right: 159px; +} + +.m-r-160 { + margin-right: 160px; +} + +.m-r-161 { + margin-right: 161px; +} + +.m-r-162 { + margin-right: 162px; +} + +.m-r-163 { + margin-right: 163px; +} + +.m-r-164 { + margin-right: 164px; +} + +.m-r-165 { + margin-right: 165px; +} + +.m-r-166 { + margin-right: 166px; +} + +.m-r-167 { + margin-right: 167px; +} + +.m-r-168 { + margin-right: 168px; +} + +.m-r-169 { + margin-right: 169px; +} + +.m-r-170 { + margin-right: 170px; +} + +.m-r-171 { + margin-right: 171px; +} + +.m-r-172 { + margin-right: 172px; +} + +.m-r-173 { + margin-right: 173px; +} + +.m-r-174 { + margin-right: 174px; +} + +.m-r-175 { + margin-right: 175px; +} + +.m-r-176 { + margin-right: 176px; +} + +.m-r-177 { + margin-right: 177px; +} + +.m-r-178 { + margin-right: 178px; +} + +.m-r-179 { + margin-right: 179px; +} + +.m-r-180 { + margin-right: 180px; +} + +.m-r-181 { + margin-right: 181px; +} + +.m-r-182 { + margin-right: 182px; +} + +.m-r-183 { + margin-right: 183px; +} + +.m-r-184 { + margin-right: 184px; +} + +.m-r-185 { + margin-right: 185px; +} + +.m-r-186 { + margin-right: 186px; +} + +.m-r-187 { + margin-right: 187px; +} + +.m-r-188 { + margin-right: 188px; +} + +.m-r-189 { + margin-right: 189px; +} + +.m-r-190 { + margin-right: 190px; +} + +.m-r-191 { + margin-right: 191px; +} + +.m-r-192 { + margin-right: 192px; +} + +.m-r-193 { + margin-right: 193px; +} + +.m-r-194 { + margin-right: 194px; +} + +.m-r-195 { + margin-right: 195px; +} + +.m-r-196 { + margin-right: 196px; +} + +.m-r-197 { + margin-right: 197px; +} + +.m-r-198 { + margin-right: 198px; +} + +.m-r-199 { + margin-right: 199px; +} + +.m-r-200 { + margin-right: 200px; +} + +.m-r-201 { + margin-right: 201px; +} + +.m-r-202 { + margin-right: 202px; +} + +.m-r-203 { + margin-right: 203px; +} + +.m-r-204 { + margin-right: 204px; +} + +.m-r-205 { + margin-right: 205px; +} + +.m-r-206 { + margin-right: 206px; +} + +.m-r-207 { + margin-right: 207px; +} + +.m-r-208 { + margin-right: 208px; +} + +.m-r-209 { + margin-right: 209px; +} + +.m-r-210 { + margin-right: 210px; +} + +.m-r-211 { + margin-right: 211px; +} + +.m-r-212 { + margin-right: 212px; +} + +.m-r-213 { + margin-right: 213px; +} + +.m-r-214 { + margin-right: 214px; +} + +.m-r-215 { + margin-right: 215px; +} + +.m-r-216 { + margin-right: 216px; +} + +.m-r-217 { + margin-right: 217px; +} + +.m-r-218 { + margin-right: 218px; +} + +.m-r-219 { + margin-right: 219px; +} + +.m-r-220 { + margin-right: 220px; +} + +.m-r-221 { + margin-right: 221px; +} + +.m-r-222 { + margin-right: 222px; +} + +.m-r-223 { + margin-right: 223px; +} + +.m-r-224 { + margin-right: 224px; +} + +.m-r-225 { + margin-right: 225px; +} + +.m-r-226 { + margin-right: 226px; +} + +.m-r-227 { + margin-right: 227px; +} + +.m-r-228 { + margin-right: 228px; +} + +.m-r-229 { + margin-right: 229px; +} + +.m-r-230 { + margin-right: 230px; +} + +.m-r-231 { + margin-right: 231px; +} + +.m-r-232 { + margin-right: 232px; +} + +.m-r-233 { + margin-right: 233px; +} + +.m-r-234 { + margin-right: 234px; +} + +.m-r-235 { + margin-right: 235px; +} + +.m-r-236 { + margin-right: 236px; +} + +.m-r-237 { + margin-right: 237px; +} + +.m-r-238 { + margin-right: 238px; +} + +.m-r-239 { + margin-right: 239px; +} + +.m-r-240 { + margin-right: 240px; +} + +.m-r-241 { + margin-right: 241px; +} + +.m-r-242 { + margin-right: 242px; +} + +.m-r-243 { + margin-right: 243px; +} + +.m-r-244 { + margin-right: 244px; +} + +.m-r-245 { + margin-right: 245px; +} + +.m-r-246 { + margin-right: 246px; +} + +.m-r-247 { + margin-right: 247px; +} + +.m-r-248 { + margin-right: 248px; +} + +.m-r-249 { + margin-right: 249px; +} + +.m-r-250 { + margin-right: 250px; +} + +.m-l-r-auto { + margin-left: auto; + margin-right: auto; +} + +.m-l-auto { + margin-left: auto; +} + +.m-r-auto { + margin-right: auto; +} + + +/*[ TEXT ] +/////////////////////////////////////////////////////////// +*/ +/* ------------------------------------ */ +.text-white { + color: white; +} + +.text-black { + color: black; +} + +.text-hov-white:hover { + color: white; +} + +/* ------------------------------------ */ +.text-up { + text-transform: uppercase; +} + +/* ------------------------------------ */ +.text-center { + text-align: center; +} + +.text-left { + text-align: left; +} + +.text-right { + text-align: right; +} + +.text-middle { + vertical-align: middle; +} + +/* ------------------------------------ */ +.lh-1-0 { + line-height: 1.0; +} + +.lh-1-1 { + line-height: 1.1; +} + +.lh-1-2 { + line-height: 1.2; +} + +.lh-1-3 { + line-height: 1.3; +} + +.lh-1-4 { + line-height: 1.4; +} + +.lh-1-5 { + line-height: 1.5; +} + +.lh-1-6 { + line-height: 1.6; +} + +.lh-1-7 { + line-height: 1.7; +} + +.lh-1-8 { + line-height: 1.8; +} + +.lh-1-9 { + line-height: 1.9; +} + +.lh-2-0 { + line-height: 2.0; +} + +.lh-2-1 { + line-height: 2.1; +} + +.lh-2-2 { + line-height: 2.2; +} + +.lh-2-3 { + line-height: 2.3; +} + +.lh-2-4 { + line-height: 2.4; +} + +.lh-2-5 { + line-height: 2.5; +} + +.lh-2-6 { + line-height: 2.6; +} + +.lh-2-7 { + line-height: 2.7; +} + +.lh-2-8 { + line-height: 2.8; +} + +.lh-2-9 { + line-height: 2.9; +} + + +/*[ SHAPE ] +/////////////////////////////////////////////////////////// +*/ + +/*[ Display ] +----------------------------------------------------------- +*/ +.dis-none { + display: none; +} + +.dis-block { + display: block; +} + +.dis-inline { + display: inline; +} + +.dis-inline-block { + display: inline-block; +} + +.dis-flex { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; +} + +/*[ Position ] +----------------------------------------------------------- +*/ +.pos-relative { + position: relative; +} + +.pos-absolute { + position: absolute; +} + +.pos-fixed { + position: fixed; +} + +/*[ float ] +----------------------------------------------------------- +*/ +.float-l { + float: left; +} + +.float-r { + float: right; +} + + +/*[ Width & Height ] +----------------------------------------------------------- +*/ +.sizefull { + width: 100%; + height: 100%; +} + +.w-full { + width: 100%; +} + +.h-full { + height: 100%; +} + +.max-w-full { + max-width: 100%; +} + +.max-h-full { + max-height: 100%; +} + +.min-w-full { + min-width: 100%; +} + +.min-h-full { + min-height: 100%; +} + +/*[ Top Bottom Left Right ] +----------------------------------------------------------- +*/ +.top-0 { + top: 0; +} + +.bottom-0 { + bottom: 0; +} + +.left-0 { + left: 0; +} + +.right-0 { + right: 0; +} + +.top-auto { + top: auto; +} + +.bottom-auto { + bottom: auto; +} + +.left-auto { + left: auto; +} + +.right-auto { + right: auto; +} + + +/*[ Opacity ] +----------------------------------------------------------- +*/ +.op-0-0 { + opacity: 0; +} + +.op-0-1 { + opacity: 0.1; +} + +.op-0-2 { + opacity: 0.2; +} + +.op-0-3 { + opacity: 0.3; +} + +.op-0-4 { + opacity: 0.4; +} + +.op-0-5 { + opacity: 0.5; +} + +.op-0-6 { + opacity: 0.6; +} + +.op-0-7 { + opacity: 0.7; +} + +.op-0-8 { + opacity: 0.8; +} + +.op-0-9 { + opacity: 0.9; +} + +.op-1-0 { + opacity: 1; +} + +/*[ Background ] +----------------------------------------------------------- +*/ +.bgwhite { + background-color: white; +} + +.bgblack { + background-color: black; +} + + +/*[ Wrap Picture ] +----------------------------------------------------------- +*/ +.wrap-pic-w img { + width: 100%; +} + +.wrap-pic-max-w img { + max-width: 100%; +} + +/* ------------------------------------ */ +.wrap-pic-h img { + height: 100%; +} + +.wrap-pic-max-h img { + max-height: 100%; +} + +/* ------------------------------------ */ +.wrap-pic-cir { + border-radius: 50%; + overflow: hidden; +} + +.wrap-pic-cir img { + width: 100%; +} + + +/*[ Hover ] +----------------------------------------------------------- +*/ +.hov-pointer:hover { + cursor: pointer; +} + +/* ------------------------------------ */ +.hov-img-zoom { + display: block; + overflow: hidden; +} + +.hov-img-zoom img { + width: 100%; + -webkit-transition: all 0.6s; + -o-transition: all 0.6s; + -moz-transition: all 0.6s; + transition: all 0.6s; +} + +.hov-img-zoom:hover img { + -webkit-transform: scale(1.1); + -moz-transform: scale(1.1); + -ms-transform: scale(1.1); + -o-transform: scale(1.1); + transform: scale(1.1); +} + + +/*[ ] +----------------------------------------------------------- +*/ +.bo-cir { + border-radius: 50%; +} + +.of-hidden { + overflow: hidden; +} + +.visible-false { + visibility: hidden; +} + +.visible-true { + visibility: visible; +} + + +/*[ Transition ] +----------------------------------------------------------- +*/ +.trans-0-1 { + -webkit-transition: all 0.1s; + -o-transition: all 0.1s; + -moz-transition: all 0.1s; + transition: all 0.1s; +} + +.trans-0-2 { + -webkit-transition: all 0.2s; + -o-transition: all 0.2s; + -moz-transition: all 0.2s; + transition: all 0.2s; +} + +.trans-0-3 { + -webkit-transition: all 0.3s; + -o-transition: all 0.3s; + -moz-transition: all 0.3s; + transition: all 0.3s; +} + +.trans-0-4 { + -webkit-transition: all 0.4s; + -o-transition: all 0.4s; + -moz-transition: all 0.4s; + transition: all 0.4s; +} + +.trans-0-5 { + -webkit-transition: all 0.5s; + -o-transition: all 0.5s; + -moz-transition: all 0.5s; + transition: all 0.5s; +} + +.trans-0-6 { + -webkit-transition: all 0.6s; + -o-transition: all 0.6s; + -moz-transition: all 0.6s; + transition: all 0.6s; +} + +.trans-0-9 { + -webkit-transition: all 0.9s; + -o-transition: all 0.9s; + -moz-transition: all 0.9s; + transition: all 0.9s; +} + +.trans-1-0 { + -webkit-transition: all 1s; + -o-transition: all 1s; + -moz-transition: all 1s; + transition: all 1s; +} + + +/*[ Layout ] +/////////////////////////////////////////////////////////// +*/ + +/*[ Flex ] +----------------------------------------------------------- +*/ +/* ------------------------------------ */ +.flex-w { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + -webkit-flex-wrap: wrap; + -moz-flex-wrap: wrap; + -ms-flex-wrap: wrap; + -o-flex-wrap: wrap; + flex-wrap: wrap; +} + +/* ------------------------------------ */ +.flex-l { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + justify-content: flex-start; +} + +.flex-r { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + justify-content: flex-end; +} + +.flex-c { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + justify-content: center; +} + +.flex-sa { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + justify-content: space-around; +} + +.flex-sb { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + justify-content: space-between; +} + +/* ------------------------------------ */ +.flex-t { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + -ms-align-items: flex-start; + align-items: flex-start; +} + +.flex-b { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + -ms-align-items: flex-end; + align-items: flex-end; +} + +.flex-m { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + -ms-align-items: center; + align-items: center; +} + +.flex-str { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + -ms-align-items: stretch; + align-items: stretch; +} + +/* ------------------------------------ */ +.flex-row { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: row; + -moz-flex-direction: row; + -ms-flex-direction: row; + -o-flex-direction: row; + flex-direction: row; +} + +.flex-row-rev { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: row-reverse; + -moz-flex-direction: row-reverse; + -ms-flex-direction: row-reverse; + -o-flex-direction: row-reverse; + flex-direction: row-reverse; +} + +.flex-col { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column; + -moz-flex-direction: column; + -ms-flex-direction: column; + -o-flex-direction: column; + flex-direction: column; +} + +.flex-col-rev { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column-reverse; + -moz-flex-direction: column-reverse; + -ms-flex-direction: column-reverse; + -o-flex-direction: column-reverse; + flex-direction: column-reverse; +} + +/* ------------------------------------ */ +.flex-c-m { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + justify-content: center; + -ms-align-items: center; + align-items: center; +} + +.flex-c-t { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + justify-content: center; + -ms-align-items: flex-start; + align-items: flex-start; +} + +.flex-c-b { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + justify-content: center; + -ms-align-items: flex-end; + align-items: flex-end; +} + +.flex-c-str { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + justify-content: center; + -ms-align-items: stretch; + align-items: stretch; +} + +.flex-l-m { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + justify-content: flex-start; + -ms-align-items: center; + align-items: center; +} + +.flex-r-m { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + justify-content: flex-end; + -ms-align-items: center; + align-items: center; +} + +.flex-sa-m { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + justify-content: space-around; + -ms-align-items: center; + align-items: center; +} + +.flex-sb-m { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + justify-content: space-between; + -ms-align-items: center; + align-items: center; +} + +/* ------------------------------------ */ +.flex-col-l { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column; + -moz-flex-direction: column; + -ms-flex-direction: column; + -o-flex-direction: column; + flex-direction: column; + -ms-align-items: flex-start; + align-items: flex-start; +} + +.flex-col-r { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column; + -moz-flex-direction: column; + -ms-flex-direction: column; + -o-flex-direction: column; + flex-direction: column; + -ms-align-items: flex-end; + align-items: flex-end; +} + +.flex-col-c { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column; + -moz-flex-direction: column; + -ms-flex-direction: column; + -o-flex-direction: column; + flex-direction: column; + -ms-align-items: center; + align-items: center; +} + +.flex-col-l-m { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column; + -moz-flex-direction: column; + -ms-flex-direction: column; + -o-flex-direction: column; + flex-direction: column; + -ms-align-items: flex-start; + align-items: flex-start; + justify-content: center; +} + +.flex-col-r-m { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column; + -moz-flex-direction: column; + -ms-flex-direction: column; + -o-flex-direction: column; + flex-direction: column; + -ms-align-items: flex-end; + align-items: flex-end; + justify-content: center; +} + +.flex-col-c-m { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column; + -moz-flex-direction: column; + -ms-flex-direction: column; + -o-flex-direction: column; + flex-direction: column; + -ms-align-items: center; + align-items: center; + justify-content: center; +} + +.flex-col-str { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column; + -moz-flex-direction: column; + -ms-flex-direction: column; + -o-flex-direction: column; + flex-direction: column; + -ms-align-items: stretch; + align-items: stretch; +} + +.flex-col-sb { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column; + -moz-flex-direction: column; + -ms-flex-direction: column; + -o-flex-direction: column; + flex-direction: column; + justify-content: space-between; +} + +/* ------------------------------------ */ +.flex-col-rev-l { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column-reverse; + -moz-flex-direction: column-reverse; + -ms-flex-direction: column-reverse; + -o-flex-direction: column-reverse; + flex-direction: column-reverse; + -ms-align-items: flex-start; + align-items: flex-start; +} + +.flex-col-rev-r { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column-reverse; + -moz-flex-direction: column-reverse; + -ms-flex-direction: column-reverse; + -o-flex-direction: column-reverse; + flex-direction: column-reverse; + -ms-align-items: flex-end; + align-items: flex-end; +} + +.flex-col-rev-c { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column-reverse; + -moz-flex-direction: column-reverse; + -ms-flex-direction: column-reverse; + -o-flex-direction: column-reverse; + flex-direction: column-reverse; + -ms-align-items: center; + align-items: center; +} + +.flex-col-rev-str { + display: -webkit-box; + display: -webkit-flex; + display: -moz-box; + display: -ms-flexbox; + display: flex; + -webkit-flex-direction: column-reverse; + -moz-flex-direction: column-reverse; + -ms-flex-direction: column-reverse; + -o-flex-direction: column-reverse; + flex-direction: column-reverse; + -ms-align-items: stretch; + align-items: stretch; +} + + +/*[ Absolute ] +----------------------------------------------------------- +*/ +.ab-c-m { + position: absolute; + top: 50%; + left: 50%; + -webkit-transform: translate(-50%, -50%); + -moz-transform: translate(-50%, -50%); + -ms-transform: translate(-50%, -50%); + -o-transform: translate(-50%, -50%); + transform: translate(-50%, -50%); +} + +.ab-c-t { + position: absolute; + top: 0; + left: 50%; + -webkit-transform: translateX(-50%); + -moz-transform: translateX(-50%); + -ms-transform: translateX(-50%); + -o-transform: translateX(-50%); + transform: translateX(-50%); +} + +.ab-c-b { + position: absolute; + bottom: 0; + left: 50%; + -webkit-transform: translateX(-50%); + -moz-transform: translateX(-50%); + -ms-transform: translateX(-50%); + -o-transform: translateX(-50%); + transform: translateX(-50%); +} + +.ab-l-m { + position: absolute; + left: 0; + top: 50%; + -webkit-transform: translateY(-50%); + -moz-transform: translateY(-50%); + -ms-transform: translateY(-50%); + -o-transform: translateY(-50%); + transform: translateY(-50%); +} + +.ab-r-m { + position: absolute; + right: 0; + top: 50%; + -webkit-transform: translateY(-50%); + -moz-transform: translateY(-50%); + -ms-transform: translateY(-50%); + -o-transform: translateY(-50%); + transform: translateY(-50%); +} + +.ab-t-l { + position: absolute; + left: 0; + top: 0; +} + +.ab-t-r { + position: absolute; + right: 0; + top: 0; +} + +.ab-b-l { + position: absolute; + left: 0; + bottom: 0; +} + +.ab-b-r { + position: absolute; + right: 0; + bottom: 0; +} + + + + + + + + + diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 000000000..7036c4fef Binary files /dev/null and b/public/favicon.ico differ diff --git a/public/fonts/Linearicons-Free-v1.0.0/WebFont/Linearicons-Free.eot b/public/fonts/Linearicons-Free-v1.0.0/WebFont/Linearicons-Free.eot new file mode 100755 index 000000000..e531c2262 Binary files /dev/null and b/public/fonts/Linearicons-Free-v1.0.0/WebFont/Linearicons-Free.eot differ diff --git a/public/fonts/Linearicons-Free-v1.0.0/WebFont/Linearicons-Free.svg b/public/fonts/Linearicons-Free-v1.0.0/WebFont/Linearicons-Free.svg new file mode 100755 index 000000000..f498bf424 --- /dev/null +++ b/public/fonts/Linearicons-Free-v1.0.0/WebFont/Linearicons-Free.svg @@ -0,0 +1,199 @@ + + + + + +{ + "fontFamily": "Linearicons-Free", + "majorVersion": 1, + "minorVersion": 0, + "description": "Designed by Perxis (https://perxis.com).\nFont generated by IcoMoon.", + "copyright": "Copyright © 2015 Perxis.com. All Rights Reserved.", + "designerURL": "https://perxis.com", + "license": "https://linearicons.com/free/license", + "fontURL": "https://linearicons.com", + "licenseURL": "https://linearicons.com/free/license", + "version": "Version 1.0", + "fontId": "Linearicons-Free", + "psName": "Linearicons-Free", + "subFamily": "Regular", + "fullName": "Linearicons-Free" +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/fonts/Linearicons-Free-v1.0.0/WebFont/Linearicons-Free.ttf b/public/fonts/Linearicons-Free-v1.0.0/WebFont/Linearicons-Free.ttf new file mode 100755 index 000000000..73d678322 Binary files /dev/null and b/public/fonts/Linearicons-Free-v1.0.0/WebFont/Linearicons-Free.ttf differ diff --git a/public/fonts/Linearicons-Free-v1.0.0/WebFont/Linearicons-Free.woff b/public/fonts/Linearicons-Free-v1.0.0/WebFont/Linearicons-Free.woff new file mode 100755 index 000000000..63b5b751e Binary files /dev/null and b/public/fonts/Linearicons-Free-v1.0.0/WebFont/Linearicons-Free.woff differ diff --git a/public/fonts/Linearicons-Free-v1.0.0/WebFont/Linearicons-Free.woff2 b/public/fonts/Linearicons-Free-v1.0.0/WebFont/Linearicons-Free.woff2 new file mode 100755 index 000000000..d4c5ddafc Binary files /dev/null and b/public/fonts/Linearicons-Free-v1.0.0/WebFont/Linearicons-Free.woff2 differ diff --git a/public/fonts/Linearicons-Free-v1.0.0/icon-font.min.css b/public/fonts/Linearicons-Free-v1.0.0/icon-font.min.css new file mode 100755 index 000000000..b41e8145e --- /dev/null +++ b/public/fonts/Linearicons-Free-v1.0.0/icon-font.min.css @@ -0,0 +1,7 @@ +/* +Linearicons Free v1.0.0 - https://linearicons.com/free +By Perxis - https://perxis.com +(c) 2014-2015 Perxis.com +License: https://linearicons.com/free/license +*/ +@font-face{font-family:Linearicons-Free;src:url(https://cdn.linearicons.com/free/1.0.0/Linearicons-Free.eot);src:url(https://cdn.linearicons.com/free/1.0.0/Linearicons-Free.eot?#iefix) format('embedded-opentype'),url(https://cdn.linearicons.com/free/1.0.0/Linearicons-Free.woff2) format('woff2'),url(https://cdn.linearicons.com/free/1.0.0/Linearicons-Free.ttf) format('truetype'),url(https://cdn.linearicons.com/free/1.0.0/Linearicons-Free.woff) format('woff'),url(https://cdn.linearicons.com/free/1.0.0/Linearicons-Free.svg#Linearicons-Free) format('svg');font-weight:400;font-style:normal}.lnr{font-family:Linearicons-Free;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.lnr-home:before{content:"\e800"}.lnr-apartment:before{content:"\e801"}.lnr-pencil:before{content:"\e802"}.lnr-magic-wand:before{content:"\e803"}.lnr-drop:before{content:"\e804"}.lnr-lighter:before{content:"\e805"}.lnr-poop:before{content:"\e806"}.lnr-sun:before{content:"\e807"}.lnr-moon:before{content:"\e808"}.lnr-cloud:before{content:"\e809"}.lnr-cloud-upload:before{content:"\e80a"}.lnr-cloud-download:before{content:"\e80b"}.lnr-cloud-sync:before{content:"\e80c"}.lnr-cloud-check:before{content:"\e80d"}.lnr-database:before{content:"\e80e"}.lnr-lock:before{content:"\e80f"}.lnr-cog:before{content:"\e810"}.lnr-trash:before{content:"\e811"}.lnr-dice:before{content:"\e812"}.lnr-heart:before{content:"\e813"}.lnr-star:before{content:"\e814"}.lnr-star-half:before{content:"\e815"}.lnr-star-empty:before{content:"\e816"}.lnr-flag:before{content:"\e817"}.lnr-envelope:before{content:"\e818"}.lnr-paperclip:before{content:"\e819"}.lnr-inbox:before{content:"\e81a"}.lnr-eye:before{content:"\e81b"}.lnr-printer:before{content:"\e81c"}.lnr-file-empty:before{content:"\e81d"}.lnr-file-add:before{content:"\e81e"}.lnr-enter:before{content:"\e81f"}.lnr-exit:before{content:"\e820"}.lnr-graduation-hat:before{content:"\e821"}.lnr-license:before{content:"\e822"}.lnr-music-note:before{content:"\e823"}.lnr-film-play:before{content:"\e824"}.lnr-camera-video:before{content:"\e825"}.lnr-camera:before{content:"\e826"}.lnr-picture:before{content:"\e827"}.lnr-book:before{content:"\e828"}.lnr-bookmark:before{content:"\e829"}.lnr-user:before{content:"\e82a"}.lnr-users:before{content:"\e82b"}.lnr-shirt:before{content:"\e82c"}.lnr-store:before{content:"\e82d"}.lnr-cart:before{content:"\e82e"}.lnr-tag:before{content:"\e82f"}.lnr-phone-handset:before{content:"\e830"}.lnr-phone:before{content:"\e831"}.lnr-pushpin:before{content:"\e832"}.lnr-map-marker:before{content:"\e833"}.lnr-map:before{content:"\e834"}.lnr-location:before{content:"\e835"}.lnr-calendar-full:before{content:"\e836"}.lnr-keyboard:before{content:"\e837"}.lnr-spell-check:before{content:"\e838"}.lnr-screen:before{content:"\e839"}.lnr-smartphone:before{content:"\e83a"}.lnr-tablet:before{content:"\e83b"}.lnr-laptop:before{content:"\e83c"}.lnr-laptop-phone:before{content:"\e83d"}.lnr-power-switch:before{content:"\e83e"}.lnr-bubble:before{content:"\e83f"}.lnr-heart-pulse:before{content:"\e840"}.lnr-construction:before{content:"\e841"}.lnr-pie-chart:before{content:"\e842"}.lnr-chart-bars:before{content:"\e843"}.lnr-gift:before{content:"\e844"}.lnr-diamond:before{content:"\e845"}.lnr-linearicons:before{content:"\e846"}.lnr-dinner:before{content:"\e847"}.lnr-coffee-cup:before{content:"\e848"}.lnr-leaf:before{content:"\e849"}.lnr-paw:before{content:"\e84a"}.lnr-rocket:before{content:"\e84b"}.lnr-briefcase:before{content:"\e84c"}.lnr-bus:before{content:"\e84d"}.lnr-car:before{content:"\e84e"}.lnr-train:before{content:"\e84f"}.lnr-bicycle:before{content:"\e850"}.lnr-wheelchair:before{content:"\e851"}.lnr-select:before{content:"\e852"}.lnr-earth:before{content:"\e853"}.lnr-smile:before{content:"\e854"}.lnr-sad:before{content:"\e855"}.lnr-neutral:before{content:"\e856"}.lnr-mustache:before{content:"\e857"}.lnr-alarm:before{content:"\e858"}.lnr-bullhorn:before{content:"\e859"}.lnr-volume-high:before{content:"\e85a"}.lnr-volume-medium:before{content:"\e85b"}.lnr-volume-low:before{content:"\e85c"}.lnr-volume:before{content:"\e85d"}.lnr-mic:before{content:"\e85e"}.lnr-hourglass:before{content:"\e85f"}.lnr-undo:before{content:"\e860"}.lnr-redo:before{content:"\e861"}.lnr-sync:before{content:"\e862"}.lnr-history:before{content:"\e863"}.lnr-clock:before{content:"\e864"}.lnr-download:before{content:"\e865"}.lnr-upload:before{content:"\e866"}.lnr-enter-down:before{content:"\e867"}.lnr-exit-up:before{content:"\e868"}.lnr-bug:before{content:"\e869"}.lnr-code:before{content:"\e86a"}.lnr-link:before{content:"\e86b"}.lnr-unlink:before{content:"\e86c"}.lnr-thumbs-up:before{content:"\e86d"}.lnr-thumbs-down:before{content:"\e86e"}.lnr-magnifier:before{content:"\e86f"}.lnr-cross:before{content:"\e870"}.lnr-menu:before{content:"\e871"}.lnr-list:before{content:"\e872"}.lnr-chevron-up:before{content:"\e873"}.lnr-chevron-down:before{content:"\e874"}.lnr-chevron-left:before{content:"\e875"}.lnr-chevron-right:before{content:"\e876"}.lnr-arrow-up:before{content:"\e877"}.lnr-arrow-down:before{content:"\e878"}.lnr-arrow-left:before{content:"\e879"}.lnr-arrow-right:before{content:"\e87a"}.lnr-move:before{content:"\e87b"}.lnr-warning:before{content:"\e87c"}.lnr-question-circle:before{content:"\e87d"}.lnr-menu-circle:before{content:"\e87e"}.lnr-checkmark-circle:before{content:"\e87f"}.lnr-cross-circle:before{content:"\e880"}.lnr-plus-circle:before{content:"\e881"}.lnr-circle-minus:before{content:"\e882"}.lnr-arrow-up-circle:before{content:"\e883"}.lnr-arrow-down-circle:before{content:"\e884"}.lnr-arrow-left-circle:before{content:"\e885"}.lnr-arrow-right-circle:before{content:"\e886"}.lnr-chevron-up-circle:before{content:"\e887"}.lnr-chevron-down-circle:before{content:"\e888"}.lnr-chevron-left-circle:before{content:"\e889"}.lnr-chevron-right-circle:before{content:"\e88a"}.lnr-crop:before{content:"\e88b"}.lnr-frame-expand:before{content:"\e88c"}.lnr-frame-contract:before{content:"\e88d"}.lnr-layers:before{content:"\e88e"}.lnr-funnel:before{content:"\e88f"}.lnr-text-format:before{content:"\e890"}.lnr-text-format-remove:before{content:"\e891"}.lnr-text-size:before{content:"\e892"}.lnr-bold:before{content:"\e893"}.lnr-italic:before{content:"\e894"}.lnr-underline:before{content:"\e895"}.lnr-strikethrough:before{content:"\e896"}.lnr-highlight:before{content:"\e897"}.lnr-text-align-left:before{content:"\e898"}.lnr-text-align-center:before{content:"\e899"}.lnr-text-align-right:before{content:"\e89a"}.lnr-text-align-justify:before{content:"\e89b"}.lnr-line-spacing:before{content:"\e89c"}.lnr-indent-increase:before{content:"\e89d"}.lnr-indent-decrease:before{content:"\e89e"}.lnr-pilcrow:before{content:"\e89f"}.lnr-direction-ltr:before{content:"\e8a0"}.lnr-direction-rtl:before{content:"\e8a1"}.lnr-page-break:before{content:"\e8a2"}.lnr-sort-alpha-asc:before{content:"\e8a3"}.lnr-sort-amount-asc:before{content:"\e8a4"}.lnr-hand:before{content:"\e8a5"}.lnr-pointer-up:before{content:"\e8a6"}.lnr-pointer-right:before{content:"\e8a7"}.lnr-pointer-down:before{content:"\e8a8"}.lnr-pointer-left:before{content:"\e8a9"} \ No newline at end of file diff --git a/public/fonts/font-awesome-4.7.0/HELP-US-OUT.txt b/public/fonts/font-awesome-4.7.0/HELP-US-OUT.txt new file mode 100755 index 000000000..83d083dd7 --- /dev/null +++ b/public/fonts/font-awesome-4.7.0/HELP-US-OUT.txt @@ -0,0 +1,7 @@ +I hope you love Font Awesome. If you've found it useful, please do me a favor and check out my latest project, +Fort Awesome (https://fortawesome.com). It makes it easy to put the perfect icons on your website. Choose from our awesome, +comprehensive icon sets or copy and paste your own. + +Please. Check it out. + +-Dave Gandy diff --git a/public/fonts/font-awesome-4.7.0/css/font-awesome.css b/public/fonts/font-awesome-4.7.0/css/font-awesome.css new file mode 100755 index 000000000..ee906a819 --- /dev/null +++ b/public/fonts/font-awesome-4.7.0/css/font-awesome.css @@ -0,0 +1,2337 @@ +/*! + * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) + */ +/* FONT PATH + * -------------------------- */ +@font-face { + font-family: 'FontAwesome'; + src: url('../fonts/fontawesome-webfont.eot?v=4.7.0'); + src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'), url('../fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'), url('../fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'), url('../fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'), url('../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg'); + font-weight: normal; + font-style: normal; +} +.fa { + display: inline-block; + font: normal normal normal 14px/1 FontAwesome; + font-size: inherit; + text-rendering: auto; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} +/* makes the font 33% larger relative to the icon container */ +.fa-lg { + font-size: 1.33333333em; + line-height: 0.75em; + vertical-align: -15%; +} +.fa-2x { + font-size: 2em; +} +.fa-3x { + font-size: 3em; +} +.fa-4x { + font-size: 4em; +} +.fa-5x { + font-size: 5em; +} +.fa-fw { + width: 1.28571429em; + text-align: center; +} +.fa-ul { + padding-left: 0; + margin-left: 2.14285714em; + list-style-type: none; +} +.fa-ul > li { + position: relative; +} +.fa-li { + position: absolute; + left: -2.14285714em; + width: 2.14285714em; + top: 0.14285714em; + text-align: center; +} +.fa-li.fa-lg { + left: -1.85714286em; +} +.fa-border { + padding: .2em .25em .15em; + border: solid 0.08em #eeeeee; + border-radius: .1em; +} +.fa-pull-left { + float: left; +} +.fa-pull-right { + float: right; +} +.fa.fa-pull-left { + margin-right: .3em; +} +.fa.fa-pull-right { + margin-left: .3em; +} +/* Deprecated as of 4.4.0 */ +.pull-right { + float: right; +} +.pull-left { + float: left; +} +.fa.pull-left { + margin-right: .3em; +} +.fa.pull-right { + margin-left: .3em; +} +.fa-spin { + -webkit-animation: fa-spin 2s infinite linear; + animation: fa-spin 2s infinite linear; +} +.fa-pulse { + -webkit-animation: fa-spin 1s infinite steps(8); + animation: fa-spin 1s infinite steps(8); +} +@-webkit-keyframes fa-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} +@keyframes fa-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} +.fa-rotate-90 { + -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)"; + -webkit-transform: rotate(90deg); + -ms-transform: rotate(90deg); + transform: rotate(90deg); +} +.fa-rotate-180 { + -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)"; + -webkit-transform: rotate(180deg); + -ms-transform: rotate(180deg); + transform: rotate(180deg); +} +.fa-rotate-270 { + -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)"; + -webkit-transform: rotate(270deg); + -ms-transform: rotate(270deg); + transform: rotate(270deg); +} +.fa-flip-horizontal { + -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)"; + -webkit-transform: scale(-1, 1); + -ms-transform: scale(-1, 1); + transform: scale(-1, 1); +} +.fa-flip-vertical { + -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)"; + -webkit-transform: scale(1, -1); + -ms-transform: scale(1, -1); + transform: scale(1, -1); +} +:root .fa-rotate-90, +:root .fa-rotate-180, +:root .fa-rotate-270, +:root .fa-flip-horizontal, +:root .fa-flip-vertical { + filter: none; +} +.fa-stack { + position: relative; + display: inline-block; + width: 2em; + height: 2em; + line-height: 2em; + vertical-align: middle; +} +.fa-stack-1x, +.fa-stack-2x { + position: absolute; + left: 0; + width: 100%; + text-align: center; +} +.fa-stack-1x { + line-height: inherit; +} +.fa-stack-2x { + font-size: 2em; +} +.fa-inverse { + color: #ffffff; +} +/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen + readers do not read off random characters that represent icons */ +.fa-glass:before { + content: "\f000"; +} +.fa-music:before { + content: "\f001"; +} +.fa-search:before { + content: "\f002"; +} +.fa-envelope-o:before { + content: "\f003"; +} +.fa-heart:before { + content: "\f004"; +} +.fa-star:before { + content: "\f005"; +} +.fa-star-o:before { + content: "\f006"; +} +.fa-user:before { + content: "\f007"; +} +.fa-film:before { + content: "\f008"; +} +.fa-th-large:before { + content: "\f009"; +} +.fa-th:before { + content: "\f00a"; +} +.fa-th-list:before { + content: "\f00b"; +} +.fa-check:before { + content: "\f00c"; +} +.fa-remove:before, +.fa-close:before, +.fa-times:before { + content: "\f00d"; +} +.fa-search-plus:before { + content: "\f00e"; +} +.fa-search-minus:before { + content: "\f010"; +} +.fa-power-off:before { + content: "\f011"; +} +.fa-signal:before { + content: "\f012"; +} +.fa-gear:before, +.fa-cog:before { + content: "\f013"; +} +.fa-trash-o:before { + content: "\f014"; +} +.fa-home:before { + content: "\f015"; +} +.fa-file-o:before { + content: "\f016"; +} +.fa-clock-o:before { + content: "\f017"; +} +.fa-road:before { + content: "\f018"; +} +.fa-download:before { + content: "\f019"; +} +.fa-arrow-circle-o-down:before { + content: "\f01a"; +} +.fa-arrow-circle-o-up:before { + content: "\f01b"; +} +.fa-inbox:before { + content: "\f01c"; +} +.fa-play-circle-o:before { + content: "\f01d"; +} +.fa-rotate-right:before, +.fa-repeat:before { + content: "\f01e"; +} +.fa-refresh:before { + content: "\f021"; +} +.fa-list-alt:before { + content: "\f022"; +} +.fa-lock:before { + content: "\f023"; +} +.fa-flag:before { + content: "\f024"; +} +.fa-headphones:before { + content: "\f025"; +} +.fa-volume-off:before { + content: "\f026"; +} +.fa-volume-down:before { + content: "\f027"; +} +.fa-volume-up:before { + content: "\f028"; +} +.fa-qrcode:before { + content: "\f029"; +} +.fa-barcode:before { + content: "\f02a"; +} +.fa-tag:before { + content: "\f02b"; +} +.fa-tags:before { + content: "\f02c"; +} +.fa-book:before { + content: "\f02d"; +} +.fa-bookmark:before { + content: "\f02e"; +} +.fa-print:before { + content: "\f02f"; +} +.fa-camera:before { + content: "\f030"; +} +.fa-font:before { + content: "\f031"; +} +.fa-bold:before { + content: "\f032"; +} +.fa-italic:before { + content: "\f033"; +} +.fa-text-height:before { + content: "\f034"; +} +.fa-text-width:before { + content: "\f035"; +} +.fa-align-left:before { + content: "\f036"; +} +.fa-align-center:before { + content: "\f037"; +} +.fa-align-right:before { + content: "\f038"; +} +.fa-align-justify:before { + content: "\f039"; +} +.fa-list:before { + content: "\f03a"; +} +.fa-dedent:before, +.fa-outdent:before { + content: "\f03b"; +} +.fa-indent:before { + content: "\f03c"; +} +.fa-video-camera:before { + content: "\f03d"; +} +.fa-photo:before, +.fa-image:before, +.fa-picture-o:before { + content: "\f03e"; +} +.fa-pencil:before { + content: "\f040"; +} +.fa-map-marker:before { + content: "\f041"; +} +.fa-adjust:before { + content: "\f042"; +} +.fa-tint:before { + content: "\f043"; +} +.fa-edit:before, +.fa-pencil-square-o:before { + content: "\f044"; +} +.fa-share-square-o:before { + content: "\f045"; +} +.fa-check-square-o:before { + content: "\f046"; +} +.fa-arrows:before { + content: "\f047"; +} +.fa-step-backward:before { + content: "\f048"; +} +.fa-fast-backward:before { + content: "\f049"; +} +.fa-backward:before { + content: "\f04a"; +} +.fa-play:before { + content: "\f04b"; +} +.fa-pause:before { + content: "\f04c"; +} +.fa-stop:before { + content: "\f04d"; +} +.fa-forward:before { + content: "\f04e"; +} +.fa-fast-forward:before { + content: "\f050"; +} +.fa-step-forward:before { + content: "\f051"; +} +.fa-eject:before { + content: "\f052"; +} +.fa-chevron-left:before { + content: "\f053"; +} +.fa-chevron-right:before { + content: "\f054"; +} +.fa-plus-circle:before { + content: "\f055"; +} +.fa-minus-circle:before { + content: "\f056"; +} +.fa-times-circle:before { + content: "\f057"; +} +.fa-check-circle:before { + content: "\f058"; +} +.fa-question-circle:before { + content: "\f059"; +} +.fa-info-circle:before { + content: "\f05a"; +} +.fa-crosshairs:before { + content: "\f05b"; +} +.fa-times-circle-o:before { + content: "\f05c"; +} +.fa-check-circle-o:before { + content: "\f05d"; +} +.fa-ban:before { + content: "\f05e"; +} +.fa-arrow-left:before { + content: "\f060"; +} +.fa-arrow-right:before { + content: "\f061"; +} +.fa-arrow-up:before { + content: "\f062"; +} +.fa-arrow-down:before { + content: "\f063"; +} +.fa-mail-forward:before, +.fa-share:before { + content: "\f064"; +} +.fa-expand:before { + content: "\f065"; +} +.fa-compress:before { + content: "\f066"; +} +.fa-plus:before { + content: "\f067"; +} +.fa-minus:before { + content: "\f068"; +} +.fa-asterisk:before { + content: "\f069"; +} +.fa-exclamation-circle:before { + content: "\f06a"; +} +.fa-gift:before { + content: "\f06b"; +} +.fa-leaf:before { + content: "\f06c"; +} +.fa-fire:before { + content: "\f06d"; +} +.fa-eye:before { + content: "\f06e"; +} +.fa-eye-slash:before { + content: "\f070"; +} +.fa-warning:before, +.fa-exclamation-triangle:before { + content: "\f071"; +} +.fa-plane:before { + content: "\f072"; +} +.fa-calendar:before { + content: "\f073"; +} +.fa-random:before { + content: "\f074"; +} +.fa-comment:before { + content: "\f075"; +} +.fa-magnet:before { + content: "\f076"; +} +.fa-chevron-up:before { + content: "\f077"; +} +.fa-chevron-down:before { + content: "\f078"; +} +.fa-retweet:before { + content: "\f079"; +} +.fa-shopping-cart:before { + content: "\f07a"; +} +.fa-folder:before { + content: "\f07b"; +} +.fa-folder-open:before { + content: "\f07c"; +} +.fa-arrows-v:before { + content: "\f07d"; +} +.fa-arrows-h:before { + content: "\f07e"; +} +.fa-bar-chart-o:before, +.fa-bar-chart:before { + content: "\f080"; +} +.fa-twitter-square:before { + content: "\f081"; +} +.fa-facebook-square:before { + content: "\f082"; +} +.fa-camera-retro:before { + content: "\f083"; +} +.fa-key:before { + content: "\f084"; +} +.fa-gears:before, +.fa-cogs:before { + content: "\f085"; +} +.fa-comments:before { + content: "\f086"; +} +.fa-thumbs-o-up:before { + content: "\f087"; +} +.fa-thumbs-o-down:before { + content: "\f088"; +} +.fa-star-half:before { + content: "\f089"; +} +.fa-heart-o:before { + content: "\f08a"; +} +.fa-sign-out:before { + content: "\f08b"; +} +.fa-linkedin-square:before { + content: "\f08c"; +} +.fa-thumb-tack:before { + content: "\f08d"; +} +.fa-external-link:before { + content: "\f08e"; +} +.fa-sign-in:before { + content: "\f090"; +} +.fa-trophy:before { + content: "\f091"; +} +.fa-github-square:before { + content: "\f092"; +} +.fa-upload:before { + content: "\f093"; +} +.fa-lemon-o:before { + content: "\f094"; +} +.fa-phone:before { + content: "\f095"; +} +.fa-square-o:before { + content: "\f096"; +} +.fa-bookmark-o:before { + content: "\f097"; +} +.fa-phone-square:before { + content: "\f098"; +} +.fa-twitter:before { + content: "\f099"; +} +.fa-facebook-f:before, +.fa-facebook:before { + content: "\f09a"; +} +.fa-github:before { + content: "\f09b"; +} +.fa-unlock:before { + content: "\f09c"; +} +.fa-credit-card:before { + content: "\f09d"; +} +.fa-feed:before, +.fa-rss:before { + content: "\f09e"; +} +.fa-hdd-o:before { + content: "\f0a0"; +} +.fa-bullhorn:before { + content: "\f0a1"; +} +.fa-bell:before { + content: "\f0f3"; +} +.fa-certificate:before { + content: "\f0a3"; +} +.fa-hand-o-right:before { + content: "\f0a4"; +} +.fa-hand-o-left:before { + content: "\f0a5"; +} +.fa-hand-o-up:before { + content: "\f0a6"; +} +.fa-hand-o-down:before { + content: "\f0a7"; +} +.fa-arrow-circle-left:before { + content: "\f0a8"; +} +.fa-arrow-circle-right:before { + content: "\f0a9"; +} +.fa-arrow-circle-up:before { + content: "\f0aa"; +} +.fa-arrow-circle-down:before { + content: "\f0ab"; +} +.fa-globe:before { + content: "\f0ac"; +} +.fa-wrench:before { + content: "\f0ad"; +} +.fa-tasks:before { + content: "\f0ae"; +} +.fa-filter:before { + content: "\f0b0"; +} +.fa-briefcase:before { + content: "\f0b1"; +} +.fa-arrows-alt:before { + content: "\f0b2"; +} +.fa-group:before, +.fa-users:before { + content: "\f0c0"; +} +.fa-chain:before, +.fa-link:before { + content: "\f0c1"; +} +.fa-cloud:before { + content: "\f0c2"; +} +.fa-flask:before { + content: "\f0c3"; +} +.fa-cut:before, +.fa-scissors:before { + content: "\f0c4"; +} +.fa-copy:before, +.fa-files-o:before { + content: "\f0c5"; +} +.fa-paperclip:before { + content: "\f0c6"; +} +.fa-save:before, +.fa-floppy-o:before { + content: "\f0c7"; +} +.fa-square:before { + content: "\f0c8"; +} +.fa-navicon:before, +.fa-reorder:before, +.fa-bars:before { + content: "\f0c9"; +} +.fa-list-ul:before { + content: "\f0ca"; +} +.fa-list-ol:before { + content: "\f0cb"; +} +.fa-strikethrough:before { + content: "\f0cc"; +} +.fa-underline:before { + content: "\f0cd"; +} +.fa-table:before { + content: "\f0ce"; +} +.fa-magic:before { + content: "\f0d0"; +} +.fa-truck:before { + content: "\f0d1"; +} +.fa-pinterest:before { + content: "\f0d2"; +} +.fa-pinterest-square:before { + content: "\f0d3"; +} +.fa-google-plus-square:before { + content: "\f0d4"; +} +.fa-google-plus:before { + content: "\f0d5"; +} +.fa-money:before { + content: "\f0d6"; +} +.fa-caret-down:before { + content: "\f0d7"; +} +.fa-caret-up:before { + content: "\f0d8"; +} +.fa-caret-left:before { + content: "\f0d9"; +} +.fa-caret-right:before { + content: "\f0da"; +} +.fa-columns:before { + content: "\f0db"; +} +.fa-unsorted:before, +.fa-sort:before { + content: "\f0dc"; +} +.fa-sort-down:before, +.fa-sort-desc:before { + content: "\f0dd"; +} +.fa-sort-up:before, +.fa-sort-asc:before { + content: "\f0de"; +} +.fa-envelope:before { + content: "\f0e0"; +} +.fa-linkedin:before { + content: "\f0e1"; +} +.fa-rotate-left:before, +.fa-undo:before { + content: "\f0e2"; +} +.fa-legal:before, +.fa-gavel:before { + content: "\f0e3"; +} +.fa-dashboard:before, +.fa-tachometer:before { + content: "\f0e4"; +} +.fa-comment-o:before { + content: "\f0e5"; +} +.fa-comments-o:before { + content: "\f0e6"; +} +.fa-flash:before, +.fa-bolt:before { + content: "\f0e7"; +} +.fa-sitemap:before { + content: "\f0e8"; +} +.fa-umbrella:before { + content: "\f0e9"; +} +.fa-paste:before, +.fa-clipboard:before { + content: "\f0ea"; +} +.fa-lightbulb-o:before { + content: "\f0eb"; +} +.fa-exchange:before { + content: "\f0ec"; +} +.fa-cloud-download:before { + content: "\f0ed"; +} +.fa-cloud-upload:before { + content: "\f0ee"; +} +.fa-user-md:before { + content: "\f0f0"; +} +.fa-stethoscope:before { + content: "\f0f1"; +} +.fa-suitcase:before { + content: "\f0f2"; +} +.fa-bell-o:before { + content: "\f0a2"; +} +.fa-coffee:before { + content: "\f0f4"; +} +.fa-cutlery:before { + content: "\f0f5"; +} +.fa-file-text-o:before { + content: "\f0f6"; +} +.fa-building-o:before { + content: "\f0f7"; +} +.fa-hospital-o:before { + content: "\f0f8"; +} +.fa-ambulance:before { + content: "\f0f9"; +} +.fa-medkit:before { + content: "\f0fa"; +} +.fa-fighter-jet:before { + content: "\f0fb"; +} +.fa-beer:before { + content: "\f0fc"; +} +.fa-h-square:before { + content: "\f0fd"; +} +.fa-plus-square:before { + content: "\f0fe"; +} +.fa-angle-double-left:before { + content: "\f100"; +} +.fa-angle-double-right:before { + content: "\f101"; +} +.fa-angle-double-up:before { + content: "\f102"; +} +.fa-angle-double-down:before { + content: "\f103"; +} +.fa-angle-left:before { + content: "\f104"; +} +.fa-angle-right:before { + content: "\f105"; +} +.fa-angle-up:before { + content: "\f106"; +} +.fa-angle-down:before { + content: "\f107"; +} +.fa-desktop:before { + content: "\f108"; +} +.fa-laptop:before { + content: "\f109"; +} +.fa-tablet:before { + content: "\f10a"; +} +.fa-mobile-phone:before, +.fa-mobile:before { + content: "\f10b"; +} +.fa-circle-o:before { + content: "\f10c"; +} +.fa-quote-left:before { + content: "\f10d"; +} +.fa-quote-right:before { + content: "\f10e"; +} +.fa-spinner:before { + content: "\f110"; +} +.fa-circle:before { + content: "\f111"; +} +.fa-mail-reply:before, +.fa-reply:before { + content: "\f112"; +} +.fa-github-alt:before { + content: "\f113"; +} +.fa-folder-o:before { + content: "\f114"; +} +.fa-folder-open-o:before { + content: "\f115"; +} +.fa-smile-o:before { + content: "\f118"; +} +.fa-frown-o:before { + content: "\f119"; +} +.fa-meh-o:before { + content: "\f11a"; +} +.fa-gamepad:before { + content: "\f11b"; +} +.fa-keyboard-o:before { + content: "\f11c"; +} +.fa-flag-o:before { + content: "\f11d"; +} +.fa-flag-checkered:before { + content: "\f11e"; +} +.fa-terminal:before { + content: "\f120"; +} +.fa-code:before { + content: "\f121"; +} +.fa-mail-reply-all:before, +.fa-reply-all:before { + content: "\f122"; +} +.fa-star-half-empty:before, +.fa-star-half-full:before, +.fa-star-half-o:before { + content: "\f123"; +} +.fa-location-arrow:before { + content: "\f124"; +} +.fa-crop:before { + content: "\f125"; +} +.fa-code-fork:before { + content: "\f126"; +} +.fa-unlink:before, +.fa-chain-broken:before { + content: "\f127"; +} +.fa-question:before { + content: "\f128"; +} +.fa-info:before { + content: "\f129"; +} +.fa-exclamation:before { + content: "\f12a"; +} +.fa-superscript:before { + content: "\f12b"; +} +.fa-subscript:before { + content: "\f12c"; +} +.fa-eraser:before { + content: "\f12d"; +} +.fa-puzzle-piece:before { + content: "\f12e"; +} +.fa-microphone:before { + content: "\f130"; +} +.fa-microphone-slash:before { + content: "\f131"; +} +.fa-shield:before { + content: "\f132"; +} +.fa-calendar-o:before { + content: "\f133"; +} +.fa-fire-extinguisher:before { + content: "\f134"; +} +.fa-rocket:before { + content: "\f135"; +} +.fa-maxcdn:before { + content: "\f136"; +} +.fa-chevron-circle-left:before { + content: "\f137"; +} +.fa-chevron-circle-right:before { + content: "\f138"; +} +.fa-chevron-circle-up:before { + content: "\f139"; +} +.fa-chevron-circle-down:before { + content: "\f13a"; +} +.fa-html5:before { + content: "\f13b"; +} +.fa-css3:before { + content: "\f13c"; +} +.fa-anchor:before { + content: "\f13d"; +} +.fa-unlock-alt:before { + content: "\f13e"; +} +.fa-bullseye:before { + content: "\f140"; +} +.fa-ellipsis-h:before { + content: "\f141"; +} +.fa-ellipsis-v:before { + content: "\f142"; +} +.fa-rss-square:before { + content: "\f143"; +} +.fa-play-circle:before { + content: "\f144"; +} +.fa-ticket:before { + content: "\f145"; +} +.fa-minus-square:before { + content: "\f146"; +} +.fa-minus-square-o:before { + content: "\f147"; +} +.fa-level-up:before { + content: "\f148"; +} +.fa-level-down:before { + content: "\f149"; +} +.fa-check-square:before { + content: "\f14a"; +} +.fa-pencil-square:before { + content: "\f14b"; +} +.fa-external-link-square:before { + content: "\f14c"; +} +.fa-share-square:before { + content: "\f14d"; +} +.fa-compass:before { + content: "\f14e"; +} +.fa-toggle-down:before, +.fa-caret-square-o-down:before { + content: "\f150"; +} +.fa-toggle-up:before, +.fa-caret-square-o-up:before { + content: "\f151"; +} +.fa-toggle-right:before, +.fa-caret-square-o-right:before { + content: "\f152"; +} +.fa-euro:before, +.fa-eur:before { + content: "\f153"; +} +.fa-gbp:before { + content: "\f154"; +} +.fa-dollar:before, +.fa-usd:before { + content: "\f155"; +} +.fa-rupee:before, +.fa-inr:before { + content: "\f156"; +} +.fa-cny:before, +.fa-rmb:before, +.fa-yen:before, +.fa-jpy:before { + content: "\f157"; +} +.fa-ruble:before, +.fa-rouble:before, +.fa-rub:before { + content: "\f158"; +} +.fa-won:before, +.fa-krw:before { + content: "\f159"; +} +.fa-bitcoin:before, +.fa-btc:before { + content: "\f15a"; +} +.fa-file:before { + content: "\f15b"; +} +.fa-file-text:before { + content: "\f15c"; +} +.fa-sort-alpha-asc:before { + content: "\f15d"; +} +.fa-sort-alpha-desc:before { + content: "\f15e"; +} +.fa-sort-amount-asc:before { + content: "\f160"; +} +.fa-sort-amount-desc:before { + content: "\f161"; +} +.fa-sort-numeric-asc:before { + content: "\f162"; +} +.fa-sort-numeric-desc:before { + content: "\f163"; +} +.fa-thumbs-up:before { + content: "\f164"; +} +.fa-thumbs-down:before { + content: "\f165"; +} +.fa-youtube-square:before { + content: "\f166"; +} +.fa-youtube:before { + content: "\f167"; +} +.fa-xing:before { + content: "\f168"; +} +.fa-xing-square:before { + content: "\f169"; +} +.fa-youtube-play:before { + content: "\f16a"; +} +.fa-dropbox:before { + content: "\f16b"; +} +.fa-stack-overflow:before { + content: "\f16c"; +} +.fa-instagram:before { + content: "\f16d"; +} +.fa-flickr:before { + content: "\f16e"; +} +.fa-adn:before { + content: "\f170"; +} +.fa-bitbucket:before { + content: "\f171"; +} +.fa-bitbucket-square:before { + content: "\f172"; +} +.fa-tumblr:before { + content: "\f173"; +} +.fa-tumblr-square:before { + content: "\f174"; +} +.fa-long-arrow-down:before { + content: "\f175"; +} +.fa-long-arrow-up:before { + content: "\f176"; +} +.fa-long-arrow-left:before { + content: "\f177"; +} +.fa-long-arrow-right:before { + content: "\f178"; +} +.fa-apple:before { + content: "\f179"; +} +.fa-windows:before { + content: "\f17a"; +} +.fa-android:before { + content: "\f17b"; +} +.fa-linux:before { + content: "\f17c"; +} +.fa-dribbble:before { + content: "\f17d"; +} +.fa-skype:before { + content: "\f17e"; +} +.fa-foursquare:before { + content: "\f180"; +} +.fa-trello:before { + content: "\f181"; +} +.fa-female:before { + content: "\f182"; +} +.fa-male:before { + content: "\f183"; +} +.fa-gittip:before, +.fa-gratipay:before { + content: "\f184"; +} +.fa-sun-o:before { + content: "\f185"; +} +.fa-moon-o:before { + content: "\f186"; +} +.fa-archive:before { + content: "\f187"; +} +.fa-bug:before { + content: "\f188"; +} +.fa-vk:before { + content: "\f189"; +} +.fa-weibo:before { + content: "\f18a"; +} +.fa-renren:before { + content: "\f18b"; +} +.fa-pagelines:before { + content: "\f18c"; +} +.fa-stack-exchange:before { + content: "\f18d"; +} +.fa-arrow-circle-o-right:before { + content: "\f18e"; +} +.fa-arrow-circle-o-left:before { + content: "\f190"; +} +.fa-toggle-left:before, +.fa-caret-square-o-left:before { + content: "\f191"; +} +.fa-dot-circle-o:before { + content: "\f192"; +} +.fa-wheelchair:before { + content: "\f193"; +} +.fa-vimeo-square:before { + content: "\f194"; +} +.fa-turkish-lira:before, +.fa-try:before { + content: "\f195"; +} +.fa-plus-square-o:before { + content: "\f196"; +} +.fa-space-shuttle:before { + content: "\f197"; +} +.fa-slack:before { + content: "\f198"; +} +.fa-envelope-square:before { + content: "\f199"; +} +.fa-wordpress:before { + content: "\f19a"; +} +.fa-openid:before { + content: "\f19b"; +} +.fa-institution:before, +.fa-bank:before, +.fa-university:before { + content: "\f19c"; +} +.fa-mortar-board:before, +.fa-graduation-cap:before { + content: "\f19d"; +} +.fa-yahoo:before { + content: "\f19e"; +} +.fa-google:before { + content: "\f1a0"; +} +.fa-reddit:before { + content: "\f1a1"; +} +.fa-reddit-square:before { + content: "\f1a2"; +} +.fa-stumbleupon-circle:before { + content: "\f1a3"; +} +.fa-stumbleupon:before { + content: "\f1a4"; +} +.fa-delicious:before { + content: "\f1a5"; +} +.fa-digg:before { + content: "\f1a6"; +} +.fa-pied-piper-pp:before { + content: "\f1a7"; +} +.fa-pied-piper-alt:before { + content: "\f1a8"; +} +.fa-drupal:before { + content: "\f1a9"; +} +.fa-joomla:before { + content: "\f1aa"; +} +.fa-language:before { + content: "\f1ab"; +} +.fa-fax:before { + content: "\f1ac"; +} +.fa-building:before { + content: "\f1ad"; +} +.fa-child:before { + content: "\f1ae"; +} +.fa-paw:before { + content: "\f1b0"; +} +.fa-spoon:before { + content: "\f1b1"; +} +.fa-cube:before { + content: "\f1b2"; +} +.fa-cubes:before { + content: "\f1b3"; +} +.fa-behance:before { + content: "\f1b4"; +} +.fa-behance-square:before { + content: "\f1b5"; +} +.fa-steam:before { + content: "\f1b6"; +} +.fa-steam-square:before { + content: "\f1b7"; +} +.fa-recycle:before { + content: "\f1b8"; +} +.fa-automobile:before, +.fa-car:before { + content: "\f1b9"; +} +.fa-cab:before, +.fa-taxi:before { + content: "\f1ba"; +} +.fa-tree:before { + content: "\f1bb"; +} +.fa-spotify:before { + content: "\f1bc"; +} +.fa-deviantart:before { + content: "\f1bd"; +} +.fa-soundcloud:before { + content: "\f1be"; +} +.fa-database:before { + content: "\f1c0"; +} +.fa-file-pdf-o:before { + content: "\f1c1"; +} +.fa-file-word-o:before { + content: "\f1c2"; +} +.fa-file-excel-o:before { + content: "\f1c3"; +} +.fa-file-powerpoint-o:before { + content: "\f1c4"; +} +.fa-file-photo-o:before, +.fa-file-picture-o:before, +.fa-file-image-o:before { + content: "\f1c5"; +} +.fa-file-zip-o:before, +.fa-file-archive-o:before { + content: "\f1c6"; +} +.fa-file-sound-o:before, +.fa-file-audio-o:before { + content: "\f1c7"; +} +.fa-file-movie-o:before, +.fa-file-video-o:before { + content: "\f1c8"; +} +.fa-file-code-o:before { + content: "\f1c9"; +} +.fa-vine:before { + content: "\f1ca"; +} +.fa-codepen:before { + content: "\f1cb"; +} +.fa-jsfiddle:before { + content: "\f1cc"; +} +.fa-life-bouy:before, +.fa-life-buoy:before, +.fa-life-saver:before, +.fa-support:before, +.fa-life-ring:before { + content: "\f1cd"; +} +.fa-circle-o-notch:before { + content: "\f1ce"; +} +.fa-ra:before, +.fa-resistance:before, +.fa-rebel:before { + content: "\f1d0"; +} +.fa-ge:before, +.fa-empire:before { + content: "\f1d1"; +} +.fa-git-square:before { + content: "\f1d2"; +} +.fa-git:before { + content: "\f1d3"; +} +.fa-y-combinator-square:before, +.fa-yc-square:before, +.fa-hacker-news:before { + content: "\f1d4"; +} +.fa-tencent-weibo:before { + content: "\f1d5"; +} +.fa-qq:before { + content: "\f1d6"; +} +.fa-wechat:before, +.fa-weixin:before { + content: "\f1d7"; +} +.fa-send:before, +.fa-paper-plane:before { + content: "\f1d8"; +} +.fa-send-o:before, +.fa-paper-plane-o:before { + content: "\f1d9"; +} +.fa-history:before { + content: "\f1da"; +} +.fa-circle-thin:before { + content: "\f1db"; +} +.fa-header:before { + content: "\f1dc"; +} +.fa-paragraph:before { + content: "\f1dd"; +} +.fa-sliders:before { + content: "\f1de"; +} +.fa-share-alt:before { + content: "\f1e0"; +} +.fa-share-alt-square:before { + content: "\f1e1"; +} +.fa-bomb:before { + content: "\f1e2"; +} +.fa-soccer-ball-o:before, +.fa-futbol-o:before { + content: "\f1e3"; +} +.fa-tty:before { + content: "\f1e4"; +} +.fa-binoculars:before { + content: "\f1e5"; +} +.fa-plug:before { + content: "\f1e6"; +} +.fa-slideshare:before { + content: "\f1e7"; +} +.fa-twitch:before { + content: "\f1e8"; +} +.fa-yelp:before { + content: "\f1e9"; +} +.fa-newspaper-o:before { + content: "\f1ea"; +} +.fa-wifi:before { + content: "\f1eb"; +} +.fa-calculator:before { + content: "\f1ec"; +} +.fa-paypal:before { + content: "\f1ed"; +} +.fa-google-wallet:before { + content: "\f1ee"; +} +.fa-cc-visa:before { + content: "\f1f0"; +} +.fa-cc-mastercard:before { + content: "\f1f1"; +} +.fa-cc-discover:before { + content: "\f1f2"; +} +.fa-cc-amex:before { + content: "\f1f3"; +} +.fa-cc-paypal:before { + content: "\f1f4"; +} +.fa-cc-stripe:before { + content: "\f1f5"; +} +.fa-bell-slash:before { + content: "\f1f6"; +} +.fa-bell-slash-o:before { + content: "\f1f7"; +} +.fa-trash:before { + content: "\f1f8"; +} +.fa-copyright:before { + content: "\f1f9"; +} +.fa-at:before { + content: "\f1fa"; +} +.fa-eyedropper:before { + content: "\f1fb"; +} +.fa-paint-brush:before { + content: "\f1fc"; +} +.fa-birthday-cake:before { + content: "\f1fd"; +} +.fa-area-chart:before { + content: "\f1fe"; +} +.fa-pie-chart:before { + content: "\f200"; +} +.fa-line-chart:before { + content: "\f201"; +} +.fa-lastfm:before { + content: "\f202"; +} +.fa-lastfm-square:before { + content: "\f203"; +} +.fa-toggle-off:before { + content: "\f204"; +} +.fa-toggle-on:before { + content: "\f205"; +} +.fa-bicycle:before { + content: "\f206"; +} +.fa-bus:before { + content: "\f207"; +} +.fa-ioxhost:before { + content: "\f208"; +} +.fa-angellist:before { + content: "\f209"; +} +.fa-cc:before { + content: "\f20a"; +} +.fa-shekel:before, +.fa-sheqel:before, +.fa-ils:before { + content: "\f20b"; +} +.fa-meanpath:before { + content: "\f20c"; +} +.fa-buysellads:before { + content: "\f20d"; +} +.fa-connectdevelop:before { + content: "\f20e"; +} +.fa-dashcube:before { + content: "\f210"; +} +.fa-forumbee:before { + content: "\f211"; +} +.fa-leanpub:before { + content: "\f212"; +} +.fa-sellsy:before { + content: "\f213"; +} +.fa-shirtsinbulk:before { + content: "\f214"; +} +.fa-simplybuilt:before { + content: "\f215"; +} +.fa-skyatlas:before { + content: "\f216"; +} +.fa-cart-plus:before { + content: "\f217"; +} +.fa-cart-arrow-down:before { + content: "\f218"; +} +.fa-diamond:before { + content: "\f219"; +} +.fa-ship:before { + content: "\f21a"; +} +.fa-user-secret:before { + content: "\f21b"; +} +.fa-motorcycle:before { + content: "\f21c"; +} +.fa-street-view:before { + content: "\f21d"; +} +.fa-heartbeat:before { + content: "\f21e"; +} +.fa-venus:before { + content: "\f221"; +} +.fa-mars:before { + content: "\f222"; +} +.fa-mercury:before { + content: "\f223"; +} +.fa-intersex:before, +.fa-transgender:before { + content: "\f224"; +} +.fa-transgender-alt:before { + content: "\f225"; +} +.fa-venus-double:before { + content: "\f226"; +} +.fa-mars-double:before { + content: "\f227"; +} +.fa-venus-mars:before { + content: "\f228"; +} +.fa-mars-stroke:before { + content: "\f229"; +} +.fa-mars-stroke-v:before { + content: "\f22a"; +} +.fa-mars-stroke-h:before { + content: "\f22b"; +} +.fa-neuter:before { + content: "\f22c"; +} +.fa-genderless:before { + content: "\f22d"; +} +.fa-facebook-official:before { + content: "\f230"; +} +.fa-pinterest-p:before { + content: "\f231"; +} +.fa-whatsapp:before { + content: "\f232"; +} +.fa-server:before { + content: "\f233"; +} +.fa-user-plus:before { + content: "\f234"; +} +.fa-user-times:before { + content: "\f235"; +} +.fa-hotel:before, +.fa-bed:before { + content: "\f236"; +} +.fa-viacoin:before { + content: "\f237"; +} +.fa-train:before { + content: "\f238"; +} +.fa-subway:before { + content: "\f239"; +} +.fa-medium:before { + content: "\f23a"; +} +.fa-yc:before, +.fa-y-combinator:before { + content: "\f23b"; +} +.fa-optin-monster:before { + content: "\f23c"; +} +.fa-opencart:before { + content: "\f23d"; +} +.fa-expeditedssl:before { + content: "\f23e"; +} +.fa-battery-4:before, +.fa-battery:before, +.fa-battery-full:before { + content: "\f240"; +} +.fa-battery-3:before, +.fa-battery-three-quarters:before { + content: "\f241"; +} +.fa-battery-2:before, +.fa-battery-half:before { + content: "\f242"; +} +.fa-battery-1:before, +.fa-battery-quarter:before { + content: "\f243"; +} +.fa-battery-0:before, +.fa-battery-empty:before { + content: "\f244"; +} +.fa-mouse-pointer:before { + content: "\f245"; +} +.fa-i-cursor:before { + content: "\f246"; +} +.fa-object-group:before { + content: "\f247"; +} +.fa-object-ungroup:before { + content: "\f248"; +} +.fa-sticky-note:before { + content: "\f249"; +} +.fa-sticky-note-o:before { + content: "\f24a"; +} +.fa-cc-jcb:before { + content: "\f24b"; +} +.fa-cc-diners-club:before { + content: "\f24c"; +} +.fa-clone:before { + content: "\f24d"; +} +.fa-balance-scale:before { + content: "\f24e"; +} +.fa-hourglass-o:before { + content: "\f250"; +} +.fa-hourglass-1:before, +.fa-hourglass-start:before { + content: "\f251"; +} +.fa-hourglass-2:before, +.fa-hourglass-half:before { + content: "\f252"; +} +.fa-hourglass-3:before, +.fa-hourglass-end:before { + content: "\f253"; +} +.fa-hourglass:before { + content: "\f254"; +} +.fa-hand-grab-o:before, +.fa-hand-rock-o:before { + content: "\f255"; +} +.fa-hand-stop-o:before, +.fa-hand-paper-o:before { + content: "\f256"; +} +.fa-hand-scissors-o:before { + content: "\f257"; +} +.fa-hand-lizard-o:before { + content: "\f258"; +} +.fa-hand-spock-o:before { + content: "\f259"; +} +.fa-hand-pointer-o:before { + content: "\f25a"; +} +.fa-hand-peace-o:before { + content: "\f25b"; +} +.fa-trademark:before { + content: "\f25c"; +} +.fa-registered:before { + content: "\f25d"; +} +.fa-creative-commons:before { + content: "\f25e"; +} +.fa-gg:before { + content: "\f260"; +} +.fa-gg-circle:before { + content: "\f261"; +} +.fa-tripadvisor:before { + content: "\f262"; +} +.fa-odnoklassniki:before { + content: "\f263"; +} +.fa-odnoklassniki-square:before { + content: "\f264"; +} +.fa-get-pocket:before { + content: "\f265"; +} +.fa-wikipedia-w:before { + content: "\f266"; +} +.fa-safari:before { + content: "\f267"; +} +.fa-chrome:before { + content: "\f268"; +} +.fa-firefox:before { + content: "\f269"; +} +.fa-opera:before { + content: "\f26a"; +} +.fa-internet-explorer:before { + content: "\f26b"; +} +.fa-tv:before, +.fa-television:before { + content: "\f26c"; +} +.fa-contao:before { + content: "\f26d"; +} +.fa-500px:before { + content: "\f26e"; +} +.fa-amazon:before { + content: "\f270"; +} +.fa-calendar-plus-o:before { + content: "\f271"; +} +.fa-calendar-minus-o:before { + content: "\f272"; +} +.fa-calendar-times-o:before { + content: "\f273"; +} +.fa-calendar-check-o:before { + content: "\f274"; +} +.fa-industry:before { + content: "\f275"; +} +.fa-map-pin:before { + content: "\f276"; +} +.fa-map-signs:before { + content: "\f277"; +} +.fa-map-o:before { + content: "\f278"; +} +.fa-map:before { + content: "\f279"; +} +.fa-commenting:before { + content: "\f27a"; +} +.fa-commenting-o:before { + content: "\f27b"; +} +.fa-houzz:before { + content: "\f27c"; +} +.fa-vimeo:before { + content: "\f27d"; +} +.fa-black-tie:before { + content: "\f27e"; +} +.fa-fonticons:before { + content: "\f280"; +} +.fa-reddit-alien:before { + content: "\f281"; +} +.fa-edge:before { + content: "\f282"; +} +.fa-credit-card-alt:before { + content: "\f283"; +} +.fa-codiepie:before { + content: "\f284"; +} +.fa-modx:before { + content: "\f285"; +} +.fa-fort-awesome:before { + content: "\f286"; +} +.fa-usb:before { + content: "\f287"; +} +.fa-product-hunt:before { + content: "\f288"; +} +.fa-mixcloud:before { + content: "\f289"; +} +.fa-scribd:before { + content: "\f28a"; +} +.fa-pause-circle:before { + content: "\f28b"; +} +.fa-pause-circle-o:before { + content: "\f28c"; +} +.fa-stop-circle:before { + content: "\f28d"; +} +.fa-stop-circle-o:before { + content: "\f28e"; +} +.fa-shopping-bag:before { + content: "\f290"; +} +.fa-shopping-basket:before { + content: "\f291"; +} +.fa-hashtag:before { + content: "\f292"; +} +.fa-bluetooth:before { + content: "\f293"; +} +.fa-bluetooth-b:before { + content: "\f294"; +} +.fa-percent:before { + content: "\f295"; +} +.fa-gitlab:before { + content: "\f296"; +} +.fa-wpbeginner:before { + content: "\f297"; +} +.fa-wpforms:before { + content: "\f298"; +} +.fa-envira:before { + content: "\f299"; +} +.fa-universal-access:before { + content: "\f29a"; +} +.fa-wheelchair-alt:before { + content: "\f29b"; +} +.fa-question-circle-o:before { + content: "\f29c"; +} +.fa-blind:before { + content: "\f29d"; +} +.fa-audio-description:before { + content: "\f29e"; +} +.fa-volume-control-phone:before { + content: "\f2a0"; +} +.fa-braille:before { + content: "\f2a1"; +} +.fa-assistive-listening-systems:before { + content: "\f2a2"; +} +.fa-asl-interpreting:before, +.fa-american-sign-language-interpreting:before { + content: "\f2a3"; +} +.fa-deafness:before, +.fa-hard-of-hearing:before, +.fa-deaf:before { + content: "\f2a4"; +} +.fa-glide:before { + content: "\f2a5"; +} +.fa-glide-g:before { + content: "\f2a6"; +} +.fa-signing:before, +.fa-sign-language:before { + content: "\f2a7"; +} +.fa-low-vision:before { + content: "\f2a8"; +} +.fa-viadeo:before { + content: "\f2a9"; +} +.fa-viadeo-square:before { + content: "\f2aa"; +} +.fa-snapchat:before { + content: "\f2ab"; +} +.fa-snapchat-ghost:before { + content: "\f2ac"; +} +.fa-snapchat-square:before { + content: "\f2ad"; +} +.fa-pied-piper:before { + content: "\f2ae"; +} +.fa-first-order:before { + content: "\f2b0"; +} +.fa-yoast:before { + content: "\f2b1"; +} +.fa-themeisle:before { + content: "\f2b2"; +} +.fa-google-plus-circle:before, +.fa-google-plus-official:before { + content: "\f2b3"; +} +.fa-fa:before, +.fa-font-awesome:before { + content: "\f2b4"; +} +.fa-handshake-o:before { + content: "\f2b5"; +} +.fa-envelope-open:before { + content: "\f2b6"; +} +.fa-envelope-open-o:before { + content: "\f2b7"; +} +.fa-linode:before { + content: "\f2b8"; +} +.fa-address-book:before { + content: "\f2b9"; +} +.fa-address-book-o:before { + content: "\f2ba"; +} +.fa-vcard:before, +.fa-address-card:before { + content: "\f2bb"; +} +.fa-vcard-o:before, +.fa-address-card-o:before { + content: "\f2bc"; +} +.fa-user-circle:before { + content: "\f2bd"; +} +.fa-user-circle-o:before { + content: "\f2be"; +} +.fa-user-o:before { + content: "\f2c0"; +} +.fa-id-badge:before { + content: "\f2c1"; +} +.fa-drivers-license:before, +.fa-id-card:before { + content: "\f2c2"; +} +.fa-drivers-license-o:before, +.fa-id-card-o:before { + content: "\f2c3"; +} +.fa-quora:before { + content: "\f2c4"; +} +.fa-free-code-camp:before { + content: "\f2c5"; +} +.fa-telegram:before { + content: "\f2c6"; +} +.fa-thermometer-4:before, +.fa-thermometer:before, +.fa-thermometer-full:before { + content: "\f2c7"; +} +.fa-thermometer-3:before, +.fa-thermometer-three-quarters:before { + content: "\f2c8"; +} +.fa-thermometer-2:before, +.fa-thermometer-half:before { + content: "\f2c9"; +} +.fa-thermometer-1:before, +.fa-thermometer-quarter:before { + content: "\f2ca"; +} +.fa-thermometer-0:before, +.fa-thermometer-empty:before { + content: "\f2cb"; +} +.fa-shower:before { + content: "\f2cc"; +} +.fa-bathtub:before, +.fa-s15:before, +.fa-bath:before { + content: "\f2cd"; +} +.fa-podcast:before { + content: "\f2ce"; +} +.fa-window-maximize:before { + content: "\f2d0"; +} +.fa-window-minimize:before { + content: "\f2d1"; +} +.fa-window-restore:before { + content: "\f2d2"; +} +.fa-times-rectangle:before, +.fa-window-close:before { + content: "\f2d3"; +} +.fa-times-rectangle-o:before, +.fa-window-close-o:before { + content: "\f2d4"; +} +.fa-bandcamp:before { + content: "\f2d5"; +} +.fa-grav:before { + content: "\f2d6"; +} +.fa-etsy:before { + content: "\f2d7"; +} +.fa-imdb:before { + content: "\f2d8"; +} +.fa-ravelry:before { + content: "\f2d9"; +} +.fa-eercast:before { + content: "\f2da"; +} +.fa-microchip:before { + content: "\f2db"; +} +.fa-snowflake-o:before { + content: "\f2dc"; +} +.fa-superpowers:before { + content: "\f2dd"; +} +.fa-wpexplorer:before { + content: "\f2de"; +} +.fa-meetup:before { + content: "\f2e0"; +} +.sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0, 0, 0, 0); + border: 0; +} +.sr-only-focusable:active, +.sr-only-focusable:focus { + position: static; + width: auto; + height: auto; + margin: 0; + overflow: visible; + clip: auto; +} diff --git a/public/fonts/font-awesome-4.7.0/css/font-awesome.min.css b/public/fonts/font-awesome-4.7.0/css/font-awesome.min.css new file mode 100755 index 000000000..540440ce8 --- /dev/null +++ b/public/fonts/font-awesome-4.7.0/css/font-awesome.min.css @@ -0,0 +1,4 @@ +/*! + * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) + */@font-face{font-family:'FontAwesome';src:url('../fonts/fontawesome-webfont.eot?v=4.7.0');src:url('../fonts/fontawesome-webfont.eot?#iefix&v=4.7.0') format('embedded-opentype'),url('../fonts/fontawesome-webfont.woff2?v=4.7.0') format('woff2'),url('../fonts/fontawesome-webfont.woff?v=4.7.0') format('woff'),url('../fonts/fontawesome-webfont.ttf?v=4.7.0') format('truetype'),url('../fonts/fontawesome-webfont.svg?v=4.7.0#fontawesomeregular') format('svg');font-weight:normal;font-style:normal}.fa{display:inline-block;font:normal normal normal 14px/1 FontAwesome;font-size:inherit;text-rendering:auto;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-ul>li{position:relative}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:solid .08em #eee;border-radius:.1em}.fa-pull-left{float:left}.fa-pull-right{float:right}.fa.fa-pull-left{margin-right:.3em}.fa.fa-pull-right{margin-left:.3em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:fa-spin 2s infinite linear;animation:fa-spin 2s infinite linear}.fa-pulse{-webkit-animation:fa-spin 1s infinite steps(8);animation:fa-spin 1s infinite steps(8)}@-webkit-keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}@keyframes fa-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";-webkit-transform:rotate(90deg);-ms-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";-webkit-transform:rotate(270deg);-ms-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";-webkit-transform:scale(-1, 1);-ms-transform:scale(-1, 1);transform:scale(-1, 1)}.fa-flip-vertical{-ms-filter:"progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";-webkit-transform:scale(1, -1);-ms-transform:scale(1, -1);transform:scale(1, -1)}:root .fa-rotate-90,:root .fa-rotate-180,:root .fa-rotate-270,:root .fa-flip-horizontal,:root .fa-flip-vertical{filter:none}.fa-stack{position:relative;display:inline-block;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-remove:before,.fa-close:before,.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-gear:before,.fa-cog:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-rotate-right:before,.fa-repeat:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-photo:before,.fa-image:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-warning:before,.fa-exclamation-triangle:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before,.fa-bar-chart:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-gears:before,.fa-cogs:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook-f:before,.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-feed:before,.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-save:before,.fa-floppy-o:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-navicon:before,.fa-reorder:before,.fa-bars:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-unsorted:before,.fa-sort:before{content:"\f0dc"}.fa-sort-down:before,.fa-sort-desc:before{content:"\f0dd"}.fa-sort-up:before,.fa-sort-asc:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-legal:before,.fa-gavel:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-flash:before,.fa-bolt:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-paste:before,.fa-clipboard:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-unlink:before,.fa-chain-broken:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-toggle-down:before,.fa-caret-square-o-down:before{content:"\f150"}.fa-toggle-up:before,.fa-caret-square-o-up:before{content:"\f151"}.fa-toggle-right:before,.fa-caret-square-o-right:before{content:"\f152"}.fa-euro:before,.fa-eur:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-rupee:before,.fa-inr:before{content:"\f156"}.fa-cny:before,.fa-rmb:before,.fa-yen:before,.fa-jpy:before{content:"\f157"}.fa-ruble:before,.fa-rouble:before,.fa-rub:before{content:"\f158"}.fa-won:before,.fa-krw:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before,.fa-gratipay:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-toggle-left:before,.fa-caret-square-o-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-turkish-lira:before,.fa-try:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-institution:before,.fa-bank:before,.fa-university:before{content:"\f19c"}.fa-mortar-board:before,.fa-graduation-cap:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper-pp:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-photo-o:before,.fa-file-picture-o:before,.fa-file-image-o:before{content:"\f1c5"}.fa-file-zip-o:before,.fa-file-archive-o:before{content:"\f1c6"}.fa-file-sound-o:before,.fa-file-audio-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-buoy:before,.fa-life-saver:before,.fa-support:before,.fa-life-ring:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-resistance:before,.fa-rebel:before{content:"\f1d0"}.fa-ge:before,.fa-empire:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-y-combinator-square:before,.fa-yc-square:before,.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-send:before,.fa-paper-plane:before{content:"\f1d8"}.fa-send-o:before,.fa-paper-plane-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.fa-soccer-ball-o:before,.fa-futbol-o:before{content:"\f1e3"}.fa-tty:before{content:"\f1e4"}.fa-binoculars:before{content:"\f1e5"}.fa-plug:before{content:"\f1e6"}.fa-slideshare:before{content:"\f1e7"}.fa-twitch:before{content:"\f1e8"}.fa-yelp:before{content:"\f1e9"}.fa-newspaper-o:before{content:"\f1ea"}.fa-wifi:before{content:"\f1eb"}.fa-calculator:before{content:"\f1ec"}.fa-paypal:before{content:"\f1ed"}.fa-google-wallet:before{content:"\f1ee"}.fa-cc-visa:before{content:"\f1f0"}.fa-cc-mastercard:before{content:"\f1f1"}.fa-cc-discover:before{content:"\f1f2"}.fa-cc-amex:before{content:"\f1f3"}.fa-cc-paypal:before{content:"\f1f4"}.fa-cc-stripe:before{content:"\f1f5"}.fa-bell-slash:before{content:"\f1f6"}.fa-bell-slash-o:before{content:"\f1f7"}.fa-trash:before{content:"\f1f8"}.fa-copyright:before{content:"\f1f9"}.fa-at:before{content:"\f1fa"}.fa-eyedropper:before{content:"\f1fb"}.fa-paint-brush:before{content:"\f1fc"}.fa-birthday-cake:before{content:"\f1fd"}.fa-area-chart:before{content:"\f1fe"}.fa-pie-chart:before{content:"\f200"}.fa-line-chart:before{content:"\f201"}.fa-lastfm:before{content:"\f202"}.fa-lastfm-square:before{content:"\f203"}.fa-toggle-off:before{content:"\f204"}.fa-toggle-on:before{content:"\f205"}.fa-bicycle:before{content:"\f206"}.fa-bus:before{content:"\f207"}.fa-ioxhost:before{content:"\f208"}.fa-angellist:before{content:"\f209"}.fa-cc:before{content:"\f20a"}.fa-shekel:before,.fa-sheqel:before,.fa-ils:before{content:"\f20b"}.fa-meanpath:before{content:"\f20c"}.fa-buysellads:before{content:"\f20d"}.fa-connectdevelop:before{content:"\f20e"}.fa-dashcube:before{content:"\f210"}.fa-forumbee:before{content:"\f211"}.fa-leanpub:before{content:"\f212"}.fa-sellsy:before{content:"\f213"}.fa-shirtsinbulk:before{content:"\f214"}.fa-simplybuilt:before{content:"\f215"}.fa-skyatlas:before{content:"\f216"}.fa-cart-plus:before{content:"\f217"}.fa-cart-arrow-down:before{content:"\f218"}.fa-diamond:before{content:"\f219"}.fa-ship:before{content:"\f21a"}.fa-user-secret:before{content:"\f21b"}.fa-motorcycle:before{content:"\f21c"}.fa-street-view:before{content:"\f21d"}.fa-heartbeat:before{content:"\f21e"}.fa-venus:before{content:"\f221"}.fa-mars:before{content:"\f222"}.fa-mercury:before{content:"\f223"}.fa-intersex:before,.fa-transgender:before{content:"\f224"}.fa-transgender-alt:before{content:"\f225"}.fa-venus-double:before{content:"\f226"}.fa-mars-double:before{content:"\f227"}.fa-venus-mars:before{content:"\f228"}.fa-mars-stroke:before{content:"\f229"}.fa-mars-stroke-v:before{content:"\f22a"}.fa-mars-stroke-h:before{content:"\f22b"}.fa-neuter:before{content:"\f22c"}.fa-genderless:before{content:"\f22d"}.fa-facebook-official:before{content:"\f230"}.fa-pinterest-p:before{content:"\f231"}.fa-whatsapp:before{content:"\f232"}.fa-server:before{content:"\f233"}.fa-user-plus:before{content:"\f234"}.fa-user-times:before{content:"\f235"}.fa-hotel:before,.fa-bed:before{content:"\f236"}.fa-viacoin:before{content:"\f237"}.fa-train:before{content:"\f238"}.fa-subway:before{content:"\f239"}.fa-medium:before{content:"\f23a"}.fa-yc:before,.fa-y-combinator:before{content:"\f23b"}.fa-optin-monster:before{content:"\f23c"}.fa-opencart:before{content:"\f23d"}.fa-expeditedssl:before{content:"\f23e"}.fa-battery-4:before,.fa-battery:before,.fa-battery-full:before{content:"\f240"}.fa-battery-3:before,.fa-battery-three-quarters:before{content:"\f241"}.fa-battery-2:before,.fa-battery-half:before{content:"\f242"}.fa-battery-1:before,.fa-battery-quarter:before{content:"\f243"}.fa-battery-0:before,.fa-battery-empty:before{content:"\f244"}.fa-mouse-pointer:before{content:"\f245"}.fa-i-cursor:before{content:"\f246"}.fa-object-group:before{content:"\f247"}.fa-object-ungroup:before{content:"\f248"}.fa-sticky-note:before{content:"\f249"}.fa-sticky-note-o:before{content:"\f24a"}.fa-cc-jcb:before{content:"\f24b"}.fa-cc-diners-club:before{content:"\f24c"}.fa-clone:before{content:"\f24d"}.fa-balance-scale:before{content:"\f24e"}.fa-hourglass-o:before{content:"\f250"}.fa-hourglass-1:before,.fa-hourglass-start:before{content:"\f251"}.fa-hourglass-2:before,.fa-hourglass-half:before{content:"\f252"}.fa-hourglass-3:before,.fa-hourglass-end:before{content:"\f253"}.fa-hourglass:before{content:"\f254"}.fa-hand-grab-o:before,.fa-hand-rock-o:before{content:"\f255"}.fa-hand-stop-o:before,.fa-hand-paper-o:before{content:"\f256"}.fa-hand-scissors-o:before{content:"\f257"}.fa-hand-lizard-o:before{content:"\f258"}.fa-hand-spock-o:before{content:"\f259"}.fa-hand-pointer-o:before{content:"\f25a"}.fa-hand-peace-o:before{content:"\f25b"}.fa-trademark:before{content:"\f25c"}.fa-registered:before{content:"\f25d"}.fa-creative-commons:before{content:"\f25e"}.fa-gg:before{content:"\f260"}.fa-gg-circle:before{content:"\f261"}.fa-tripadvisor:before{content:"\f262"}.fa-odnoklassniki:before{content:"\f263"}.fa-odnoklassniki-square:before{content:"\f264"}.fa-get-pocket:before{content:"\f265"}.fa-wikipedia-w:before{content:"\f266"}.fa-safari:before{content:"\f267"}.fa-chrome:before{content:"\f268"}.fa-firefox:before{content:"\f269"}.fa-opera:before{content:"\f26a"}.fa-internet-explorer:before{content:"\f26b"}.fa-tv:before,.fa-television:before{content:"\f26c"}.fa-contao:before{content:"\f26d"}.fa-500px:before{content:"\f26e"}.fa-amazon:before{content:"\f270"}.fa-calendar-plus-o:before{content:"\f271"}.fa-calendar-minus-o:before{content:"\f272"}.fa-calendar-times-o:before{content:"\f273"}.fa-calendar-check-o:before{content:"\f274"}.fa-industry:before{content:"\f275"}.fa-map-pin:before{content:"\f276"}.fa-map-signs:before{content:"\f277"}.fa-map-o:before{content:"\f278"}.fa-map:before{content:"\f279"}.fa-commenting:before{content:"\f27a"}.fa-commenting-o:before{content:"\f27b"}.fa-houzz:before{content:"\f27c"}.fa-vimeo:before{content:"\f27d"}.fa-black-tie:before{content:"\f27e"}.fa-fonticons:before{content:"\f280"}.fa-reddit-alien:before{content:"\f281"}.fa-edge:before{content:"\f282"}.fa-credit-card-alt:before{content:"\f283"}.fa-codiepie:before{content:"\f284"}.fa-modx:before{content:"\f285"}.fa-fort-awesome:before{content:"\f286"}.fa-usb:before{content:"\f287"}.fa-product-hunt:before{content:"\f288"}.fa-mixcloud:before{content:"\f289"}.fa-scribd:before{content:"\f28a"}.fa-pause-circle:before{content:"\f28b"}.fa-pause-circle-o:before{content:"\f28c"}.fa-stop-circle:before{content:"\f28d"}.fa-stop-circle-o:before{content:"\f28e"}.fa-shopping-bag:before{content:"\f290"}.fa-shopping-basket:before{content:"\f291"}.fa-hashtag:before{content:"\f292"}.fa-bluetooth:before{content:"\f293"}.fa-bluetooth-b:before{content:"\f294"}.fa-percent:before{content:"\f295"}.fa-gitlab:before{content:"\f296"}.fa-wpbeginner:before{content:"\f297"}.fa-wpforms:before{content:"\f298"}.fa-envira:before{content:"\f299"}.fa-universal-access:before{content:"\f29a"}.fa-wheelchair-alt:before{content:"\f29b"}.fa-question-circle-o:before{content:"\f29c"}.fa-blind:before{content:"\f29d"}.fa-audio-description:before{content:"\f29e"}.fa-volume-control-phone:before{content:"\f2a0"}.fa-braille:before{content:"\f2a1"}.fa-assistive-listening-systems:before{content:"\f2a2"}.fa-asl-interpreting:before,.fa-american-sign-language-interpreting:before{content:"\f2a3"}.fa-deafness:before,.fa-hard-of-hearing:before,.fa-deaf:before{content:"\f2a4"}.fa-glide:before{content:"\f2a5"}.fa-glide-g:before{content:"\f2a6"}.fa-signing:before,.fa-sign-language:before{content:"\f2a7"}.fa-low-vision:before{content:"\f2a8"}.fa-viadeo:before{content:"\f2a9"}.fa-viadeo-square:before{content:"\f2aa"}.fa-snapchat:before{content:"\f2ab"}.fa-snapchat-ghost:before{content:"\f2ac"}.fa-snapchat-square:before{content:"\f2ad"}.fa-pied-piper:before{content:"\f2ae"}.fa-first-order:before{content:"\f2b0"}.fa-yoast:before{content:"\f2b1"}.fa-themeisle:before{content:"\f2b2"}.fa-google-plus-circle:before,.fa-google-plus-official:before{content:"\f2b3"}.fa-fa:before,.fa-font-awesome:before{content:"\f2b4"}.fa-handshake-o:before{content:"\f2b5"}.fa-envelope-open:before{content:"\f2b6"}.fa-envelope-open-o:before{content:"\f2b7"}.fa-linode:before{content:"\f2b8"}.fa-address-book:before{content:"\f2b9"}.fa-address-book-o:before{content:"\f2ba"}.fa-vcard:before,.fa-address-card:before{content:"\f2bb"}.fa-vcard-o:before,.fa-address-card-o:before{content:"\f2bc"}.fa-user-circle:before{content:"\f2bd"}.fa-user-circle-o:before{content:"\f2be"}.fa-user-o:before{content:"\f2c0"}.fa-id-badge:before{content:"\f2c1"}.fa-drivers-license:before,.fa-id-card:before{content:"\f2c2"}.fa-drivers-license-o:before,.fa-id-card-o:before{content:"\f2c3"}.fa-quora:before{content:"\f2c4"}.fa-free-code-camp:before{content:"\f2c5"}.fa-telegram:before{content:"\f2c6"}.fa-thermometer-4:before,.fa-thermometer:before,.fa-thermometer-full:before{content:"\f2c7"}.fa-thermometer-3:before,.fa-thermometer-three-quarters:before{content:"\f2c8"}.fa-thermometer-2:before,.fa-thermometer-half:before{content:"\f2c9"}.fa-thermometer-1:before,.fa-thermometer-quarter:before{content:"\f2ca"}.fa-thermometer-0:before,.fa-thermometer-empty:before{content:"\f2cb"}.fa-shower:before{content:"\f2cc"}.fa-bathtub:before,.fa-s15:before,.fa-bath:before{content:"\f2cd"}.fa-podcast:before{content:"\f2ce"}.fa-window-maximize:before{content:"\f2d0"}.fa-window-minimize:before{content:"\f2d1"}.fa-window-restore:before{content:"\f2d2"}.fa-times-rectangle:before,.fa-window-close:before{content:"\f2d3"}.fa-times-rectangle-o:before,.fa-window-close-o:before{content:"\f2d4"}.fa-bandcamp:before{content:"\f2d5"}.fa-grav:before{content:"\f2d6"}.fa-etsy:before{content:"\f2d7"}.fa-imdb:before{content:"\f2d8"}.fa-ravelry:before{content:"\f2d9"}.fa-eercast:before{content:"\f2da"}.fa-microchip:before{content:"\f2db"}.fa-snowflake-o:before{content:"\f2dc"}.fa-superpowers:before{content:"\f2dd"}.fa-wpexplorer:before{content:"\f2de"}.fa-meetup:before{content:"\f2e0"}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto} diff --git a/public/fonts/font-awesome-4.7.0/fonts/FontAwesome.otf b/public/fonts/font-awesome-4.7.0/fonts/FontAwesome.otf new file mode 100755 index 000000000..401ec0f36 Binary files /dev/null and b/public/fonts/font-awesome-4.7.0/fonts/FontAwesome.otf differ diff --git a/public/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.eot b/public/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.eot new file mode 100755 index 000000000..e9f60ca95 Binary files /dev/null and b/public/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.eot differ diff --git a/public/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.svg b/public/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.svg new file mode 100755 index 000000000..855c845e5 --- /dev/null +++ b/public/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.svg @@ -0,0 +1,2671 @@ + + + + +Created by FontForge 20120731 at Mon Oct 24 17:37:40 2016 + By ,,, +Copyright Dave Gandy 2016. All rights reserved. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.ttf b/public/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.ttf new file mode 100755 index 000000000..35acda2fa Binary files /dev/null and b/public/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.ttf differ diff --git a/public/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.woff b/public/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.woff new file mode 100755 index 000000000..400014a4b Binary files /dev/null and b/public/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.woff differ diff --git a/public/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.woff2 b/public/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.woff2 new file mode 100755 index 000000000..4d13fc604 Binary files /dev/null and b/public/fonts/font-awesome-4.7.0/fonts/fontawesome-webfont.woff2 differ diff --git a/public/fonts/font-awesome-4.7.0/less/animated.less b/public/fonts/font-awesome-4.7.0/less/animated.less new file mode 100755 index 000000000..66ad52a5b --- /dev/null +++ b/public/fonts/font-awesome-4.7.0/less/animated.less @@ -0,0 +1,34 @@ +// Animated Icons +// -------------------------- + +.@{fa-css-prefix}-spin { + -webkit-animation: fa-spin 2s infinite linear; + animation: fa-spin 2s infinite linear; +} + +.@{fa-css-prefix}-pulse { + -webkit-animation: fa-spin 1s infinite steps(8); + animation: fa-spin 1s infinite steps(8); +} + +@-webkit-keyframes fa-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} + +@keyframes fa-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} diff --git a/public/fonts/font-awesome-4.7.0/less/bordered-pulled.less b/public/fonts/font-awesome-4.7.0/less/bordered-pulled.less new file mode 100755 index 000000000..f1c8ad75f --- /dev/null +++ b/public/fonts/font-awesome-4.7.0/less/bordered-pulled.less @@ -0,0 +1,25 @@ +// Bordered & Pulled +// ------------------------- + +.@{fa-css-prefix}-border { + padding: .2em .25em .15em; + border: solid .08em @fa-border-color; + border-radius: .1em; +} + +.@{fa-css-prefix}-pull-left { float: left; } +.@{fa-css-prefix}-pull-right { float: right; } + +.@{fa-css-prefix} { + &.@{fa-css-prefix}-pull-left { margin-right: .3em; } + &.@{fa-css-prefix}-pull-right { margin-left: .3em; } +} + +/* Deprecated as of 4.4.0 */ +.pull-right { float: right; } +.pull-left { float: left; } + +.@{fa-css-prefix} { + &.pull-left { margin-right: .3em; } + &.pull-right { margin-left: .3em; } +} diff --git a/public/fonts/font-awesome-4.7.0/less/core.less b/public/fonts/font-awesome-4.7.0/less/core.less new file mode 100755 index 000000000..c577ac84a --- /dev/null +++ b/public/fonts/font-awesome-4.7.0/less/core.less @@ -0,0 +1,12 @@ +// Base Class Definition +// ------------------------- + +.@{fa-css-prefix} { + display: inline-block; + font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration + font-size: inherit; // can't have font-size inherit on line above, so need to override + text-rendering: auto; // optimizelegibility throws things off #1094 + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + +} diff --git a/public/fonts/font-awesome-4.7.0/less/fixed-width.less b/public/fonts/font-awesome-4.7.0/less/fixed-width.less new file mode 100755 index 000000000..110289f2f --- /dev/null +++ b/public/fonts/font-awesome-4.7.0/less/fixed-width.less @@ -0,0 +1,6 @@ +// Fixed Width Icons +// ------------------------- +.@{fa-css-prefix}-fw { + width: (18em / 14); + text-align: center; +} diff --git a/public/fonts/font-awesome-4.7.0/less/font-awesome.less b/public/fonts/font-awesome-4.7.0/less/font-awesome.less new file mode 100755 index 000000000..c3677def3 --- /dev/null +++ b/public/fonts/font-awesome-4.7.0/less/font-awesome.less @@ -0,0 +1,18 @@ +/*! + * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) + */ + +@import "variables.less"; +@import "mixins.less"; +@import "path.less"; +@import "core.less"; +@import "larger.less"; +@import "fixed-width.less"; +@import "list.less"; +@import "bordered-pulled.less"; +@import "animated.less"; +@import "rotated-flipped.less"; +@import "stacked.less"; +@import "icons.less"; +@import "screen-reader.less"; diff --git a/public/fonts/font-awesome-4.7.0/less/icons.less b/public/fonts/font-awesome-4.7.0/less/icons.less new file mode 100755 index 000000000..159d60042 --- /dev/null +++ b/public/fonts/font-awesome-4.7.0/less/icons.less @@ -0,0 +1,789 @@ +/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen + readers do not read off random characters that represent icons */ + +.@{fa-css-prefix}-glass:before { content: @fa-var-glass; } +.@{fa-css-prefix}-music:before { content: @fa-var-music; } +.@{fa-css-prefix}-search:before { content: @fa-var-search; } +.@{fa-css-prefix}-envelope-o:before { content: @fa-var-envelope-o; } +.@{fa-css-prefix}-heart:before { content: @fa-var-heart; } +.@{fa-css-prefix}-star:before { content: @fa-var-star; } +.@{fa-css-prefix}-star-o:before { content: @fa-var-star-o; } +.@{fa-css-prefix}-user:before { content: @fa-var-user; } +.@{fa-css-prefix}-film:before { content: @fa-var-film; } +.@{fa-css-prefix}-th-large:before { content: @fa-var-th-large; } +.@{fa-css-prefix}-th:before { content: @fa-var-th; } +.@{fa-css-prefix}-th-list:before { content: @fa-var-th-list; } +.@{fa-css-prefix}-check:before { content: @fa-var-check; } +.@{fa-css-prefix}-remove:before, +.@{fa-css-prefix}-close:before, +.@{fa-css-prefix}-times:before { content: @fa-var-times; } +.@{fa-css-prefix}-search-plus:before { content: @fa-var-search-plus; } +.@{fa-css-prefix}-search-minus:before { content: @fa-var-search-minus; } +.@{fa-css-prefix}-power-off:before { content: @fa-var-power-off; } +.@{fa-css-prefix}-signal:before { content: @fa-var-signal; } +.@{fa-css-prefix}-gear:before, +.@{fa-css-prefix}-cog:before { content: @fa-var-cog; } +.@{fa-css-prefix}-trash-o:before { content: @fa-var-trash-o; } +.@{fa-css-prefix}-home:before { content: @fa-var-home; } +.@{fa-css-prefix}-file-o:before { content: @fa-var-file-o; } +.@{fa-css-prefix}-clock-o:before { content: @fa-var-clock-o; } +.@{fa-css-prefix}-road:before { content: @fa-var-road; } +.@{fa-css-prefix}-download:before { content: @fa-var-download; } +.@{fa-css-prefix}-arrow-circle-o-down:before { content: @fa-var-arrow-circle-o-down; } +.@{fa-css-prefix}-arrow-circle-o-up:before { content: @fa-var-arrow-circle-o-up; } +.@{fa-css-prefix}-inbox:before { content: @fa-var-inbox; } +.@{fa-css-prefix}-play-circle-o:before { content: @fa-var-play-circle-o; } +.@{fa-css-prefix}-rotate-right:before, +.@{fa-css-prefix}-repeat:before { content: @fa-var-repeat; } +.@{fa-css-prefix}-refresh:before { content: @fa-var-refresh; } +.@{fa-css-prefix}-list-alt:before { content: @fa-var-list-alt; } +.@{fa-css-prefix}-lock:before { content: @fa-var-lock; } +.@{fa-css-prefix}-flag:before { content: @fa-var-flag; } +.@{fa-css-prefix}-headphones:before { content: @fa-var-headphones; } +.@{fa-css-prefix}-volume-off:before { content: @fa-var-volume-off; } +.@{fa-css-prefix}-volume-down:before { content: @fa-var-volume-down; } +.@{fa-css-prefix}-volume-up:before { content: @fa-var-volume-up; } +.@{fa-css-prefix}-qrcode:before { content: @fa-var-qrcode; } +.@{fa-css-prefix}-barcode:before { content: @fa-var-barcode; } +.@{fa-css-prefix}-tag:before { content: @fa-var-tag; } +.@{fa-css-prefix}-tags:before { content: @fa-var-tags; } +.@{fa-css-prefix}-book:before { content: @fa-var-book; } +.@{fa-css-prefix}-bookmark:before { content: @fa-var-bookmark; } +.@{fa-css-prefix}-print:before { content: @fa-var-print; } +.@{fa-css-prefix}-camera:before { content: @fa-var-camera; } +.@{fa-css-prefix}-font:before { content: @fa-var-font; } +.@{fa-css-prefix}-bold:before { content: @fa-var-bold; } +.@{fa-css-prefix}-italic:before { content: @fa-var-italic; } +.@{fa-css-prefix}-text-height:before { content: @fa-var-text-height; } +.@{fa-css-prefix}-text-width:before { content: @fa-var-text-width; } +.@{fa-css-prefix}-align-left:before { content: @fa-var-align-left; } +.@{fa-css-prefix}-align-center:before { content: @fa-var-align-center; } +.@{fa-css-prefix}-align-right:before { content: @fa-var-align-right; } +.@{fa-css-prefix}-align-justify:before { content: @fa-var-align-justify; } +.@{fa-css-prefix}-list:before { content: @fa-var-list; } +.@{fa-css-prefix}-dedent:before, +.@{fa-css-prefix}-outdent:before { content: @fa-var-outdent; } +.@{fa-css-prefix}-indent:before { content: @fa-var-indent; } +.@{fa-css-prefix}-video-camera:before { content: @fa-var-video-camera; } +.@{fa-css-prefix}-photo:before, +.@{fa-css-prefix}-image:before, +.@{fa-css-prefix}-picture-o:before { content: @fa-var-picture-o; } +.@{fa-css-prefix}-pencil:before { content: @fa-var-pencil; } +.@{fa-css-prefix}-map-marker:before { content: @fa-var-map-marker; } +.@{fa-css-prefix}-adjust:before { content: @fa-var-adjust; } +.@{fa-css-prefix}-tint:before { content: @fa-var-tint; } +.@{fa-css-prefix}-edit:before, +.@{fa-css-prefix}-pencil-square-o:before { content: @fa-var-pencil-square-o; } +.@{fa-css-prefix}-share-square-o:before { content: @fa-var-share-square-o; } +.@{fa-css-prefix}-check-square-o:before { content: @fa-var-check-square-o; } +.@{fa-css-prefix}-arrows:before { content: @fa-var-arrows; } +.@{fa-css-prefix}-step-backward:before { content: @fa-var-step-backward; } +.@{fa-css-prefix}-fast-backward:before { content: @fa-var-fast-backward; } +.@{fa-css-prefix}-backward:before { content: @fa-var-backward; } +.@{fa-css-prefix}-play:before { content: @fa-var-play; } +.@{fa-css-prefix}-pause:before { content: @fa-var-pause; } +.@{fa-css-prefix}-stop:before { content: @fa-var-stop; } +.@{fa-css-prefix}-forward:before { content: @fa-var-forward; } +.@{fa-css-prefix}-fast-forward:before { content: @fa-var-fast-forward; } +.@{fa-css-prefix}-step-forward:before { content: @fa-var-step-forward; } +.@{fa-css-prefix}-eject:before { content: @fa-var-eject; } +.@{fa-css-prefix}-chevron-left:before { content: @fa-var-chevron-left; } +.@{fa-css-prefix}-chevron-right:before { content: @fa-var-chevron-right; } +.@{fa-css-prefix}-plus-circle:before { content: @fa-var-plus-circle; } +.@{fa-css-prefix}-minus-circle:before { content: @fa-var-minus-circle; } +.@{fa-css-prefix}-times-circle:before { content: @fa-var-times-circle; } +.@{fa-css-prefix}-check-circle:before { content: @fa-var-check-circle; } +.@{fa-css-prefix}-question-circle:before { content: @fa-var-question-circle; } +.@{fa-css-prefix}-info-circle:before { content: @fa-var-info-circle; } +.@{fa-css-prefix}-crosshairs:before { content: @fa-var-crosshairs; } +.@{fa-css-prefix}-times-circle-o:before { content: @fa-var-times-circle-o; } +.@{fa-css-prefix}-check-circle-o:before { content: @fa-var-check-circle-o; } +.@{fa-css-prefix}-ban:before { content: @fa-var-ban; } +.@{fa-css-prefix}-arrow-left:before { content: @fa-var-arrow-left; } +.@{fa-css-prefix}-arrow-right:before { content: @fa-var-arrow-right; } +.@{fa-css-prefix}-arrow-up:before { content: @fa-var-arrow-up; } +.@{fa-css-prefix}-arrow-down:before { content: @fa-var-arrow-down; } +.@{fa-css-prefix}-mail-forward:before, +.@{fa-css-prefix}-share:before { content: @fa-var-share; } +.@{fa-css-prefix}-expand:before { content: @fa-var-expand; } +.@{fa-css-prefix}-compress:before { content: @fa-var-compress; } +.@{fa-css-prefix}-plus:before { content: @fa-var-plus; } +.@{fa-css-prefix}-minus:before { content: @fa-var-minus; } +.@{fa-css-prefix}-asterisk:before { content: @fa-var-asterisk; } +.@{fa-css-prefix}-exclamation-circle:before { content: @fa-var-exclamation-circle; } +.@{fa-css-prefix}-gift:before { content: @fa-var-gift; } +.@{fa-css-prefix}-leaf:before { content: @fa-var-leaf; } +.@{fa-css-prefix}-fire:before { content: @fa-var-fire; } +.@{fa-css-prefix}-eye:before { content: @fa-var-eye; } +.@{fa-css-prefix}-eye-slash:before { content: @fa-var-eye-slash; } +.@{fa-css-prefix}-warning:before, +.@{fa-css-prefix}-exclamation-triangle:before { content: @fa-var-exclamation-triangle; } +.@{fa-css-prefix}-plane:before { content: @fa-var-plane; } +.@{fa-css-prefix}-calendar:before { content: @fa-var-calendar; } +.@{fa-css-prefix}-random:before { content: @fa-var-random; } +.@{fa-css-prefix}-comment:before { content: @fa-var-comment; } +.@{fa-css-prefix}-magnet:before { content: @fa-var-magnet; } +.@{fa-css-prefix}-chevron-up:before { content: @fa-var-chevron-up; } +.@{fa-css-prefix}-chevron-down:before { content: @fa-var-chevron-down; } +.@{fa-css-prefix}-retweet:before { content: @fa-var-retweet; } +.@{fa-css-prefix}-shopping-cart:before { content: @fa-var-shopping-cart; } +.@{fa-css-prefix}-folder:before { content: @fa-var-folder; } +.@{fa-css-prefix}-folder-open:before { content: @fa-var-folder-open; } +.@{fa-css-prefix}-arrows-v:before { content: @fa-var-arrows-v; } +.@{fa-css-prefix}-arrows-h:before { content: @fa-var-arrows-h; } +.@{fa-css-prefix}-bar-chart-o:before, +.@{fa-css-prefix}-bar-chart:before { content: @fa-var-bar-chart; } +.@{fa-css-prefix}-twitter-square:before { content: @fa-var-twitter-square; } +.@{fa-css-prefix}-facebook-square:before { content: @fa-var-facebook-square; } +.@{fa-css-prefix}-camera-retro:before { content: @fa-var-camera-retro; } +.@{fa-css-prefix}-key:before { content: @fa-var-key; } +.@{fa-css-prefix}-gears:before, +.@{fa-css-prefix}-cogs:before { content: @fa-var-cogs; } +.@{fa-css-prefix}-comments:before { content: @fa-var-comments; } +.@{fa-css-prefix}-thumbs-o-up:before { content: @fa-var-thumbs-o-up; } +.@{fa-css-prefix}-thumbs-o-down:before { content: @fa-var-thumbs-o-down; } +.@{fa-css-prefix}-star-half:before { content: @fa-var-star-half; } +.@{fa-css-prefix}-heart-o:before { content: @fa-var-heart-o; } +.@{fa-css-prefix}-sign-out:before { content: @fa-var-sign-out; } +.@{fa-css-prefix}-linkedin-square:before { content: @fa-var-linkedin-square; } +.@{fa-css-prefix}-thumb-tack:before { content: @fa-var-thumb-tack; } +.@{fa-css-prefix}-external-link:before { content: @fa-var-external-link; } +.@{fa-css-prefix}-sign-in:before { content: @fa-var-sign-in; } +.@{fa-css-prefix}-trophy:before { content: @fa-var-trophy; } +.@{fa-css-prefix}-github-square:before { content: @fa-var-github-square; } +.@{fa-css-prefix}-upload:before { content: @fa-var-upload; } +.@{fa-css-prefix}-lemon-o:before { content: @fa-var-lemon-o; } +.@{fa-css-prefix}-phone:before { content: @fa-var-phone; } +.@{fa-css-prefix}-square-o:before { content: @fa-var-square-o; } +.@{fa-css-prefix}-bookmark-o:before { content: @fa-var-bookmark-o; } +.@{fa-css-prefix}-phone-square:before { content: @fa-var-phone-square; } +.@{fa-css-prefix}-twitter:before { content: @fa-var-twitter; } +.@{fa-css-prefix}-facebook-f:before, +.@{fa-css-prefix}-facebook:before { content: @fa-var-facebook; } +.@{fa-css-prefix}-github:before { content: @fa-var-github; } +.@{fa-css-prefix}-unlock:before { content: @fa-var-unlock; } +.@{fa-css-prefix}-credit-card:before { content: @fa-var-credit-card; } +.@{fa-css-prefix}-feed:before, +.@{fa-css-prefix}-rss:before { content: @fa-var-rss; } +.@{fa-css-prefix}-hdd-o:before { content: @fa-var-hdd-o; } +.@{fa-css-prefix}-bullhorn:before { content: @fa-var-bullhorn; } +.@{fa-css-prefix}-bell:before { content: @fa-var-bell; } +.@{fa-css-prefix}-certificate:before { content: @fa-var-certificate; } +.@{fa-css-prefix}-hand-o-right:before { content: @fa-var-hand-o-right; } +.@{fa-css-prefix}-hand-o-left:before { content: @fa-var-hand-o-left; } +.@{fa-css-prefix}-hand-o-up:before { content: @fa-var-hand-o-up; } +.@{fa-css-prefix}-hand-o-down:before { content: @fa-var-hand-o-down; } +.@{fa-css-prefix}-arrow-circle-left:before { content: @fa-var-arrow-circle-left; } +.@{fa-css-prefix}-arrow-circle-right:before { content: @fa-var-arrow-circle-right; } +.@{fa-css-prefix}-arrow-circle-up:before { content: @fa-var-arrow-circle-up; } +.@{fa-css-prefix}-arrow-circle-down:before { content: @fa-var-arrow-circle-down; } +.@{fa-css-prefix}-globe:before { content: @fa-var-globe; } +.@{fa-css-prefix}-wrench:before { content: @fa-var-wrench; } +.@{fa-css-prefix}-tasks:before { content: @fa-var-tasks; } +.@{fa-css-prefix}-filter:before { content: @fa-var-filter; } +.@{fa-css-prefix}-briefcase:before { content: @fa-var-briefcase; } +.@{fa-css-prefix}-arrows-alt:before { content: @fa-var-arrows-alt; } +.@{fa-css-prefix}-group:before, +.@{fa-css-prefix}-users:before { content: @fa-var-users; } +.@{fa-css-prefix}-chain:before, +.@{fa-css-prefix}-link:before { content: @fa-var-link; } +.@{fa-css-prefix}-cloud:before { content: @fa-var-cloud; } +.@{fa-css-prefix}-flask:before { content: @fa-var-flask; } +.@{fa-css-prefix}-cut:before, +.@{fa-css-prefix}-scissors:before { content: @fa-var-scissors; } +.@{fa-css-prefix}-copy:before, +.@{fa-css-prefix}-files-o:before { content: @fa-var-files-o; } +.@{fa-css-prefix}-paperclip:before { content: @fa-var-paperclip; } +.@{fa-css-prefix}-save:before, +.@{fa-css-prefix}-floppy-o:before { content: @fa-var-floppy-o; } +.@{fa-css-prefix}-square:before { content: @fa-var-square; } +.@{fa-css-prefix}-navicon:before, +.@{fa-css-prefix}-reorder:before, +.@{fa-css-prefix}-bars:before { content: @fa-var-bars; } +.@{fa-css-prefix}-list-ul:before { content: @fa-var-list-ul; } +.@{fa-css-prefix}-list-ol:before { content: @fa-var-list-ol; } +.@{fa-css-prefix}-strikethrough:before { content: @fa-var-strikethrough; } +.@{fa-css-prefix}-underline:before { content: @fa-var-underline; } +.@{fa-css-prefix}-table:before { content: @fa-var-table; } +.@{fa-css-prefix}-magic:before { content: @fa-var-magic; } +.@{fa-css-prefix}-truck:before { content: @fa-var-truck; } +.@{fa-css-prefix}-pinterest:before { content: @fa-var-pinterest; } +.@{fa-css-prefix}-pinterest-square:before { content: @fa-var-pinterest-square; } +.@{fa-css-prefix}-google-plus-square:before { content: @fa-var-google-plus-square; } +.@{fa-css-prefix}-google-plus:before { content: @fa-var-google-plus; } +.@{fa-css-prefix}-money:before { content: @fa-var-money; } +.@{fa-css-prefix}-caret-down:before { content: @fa-var-caret-down; } +.@{fa-css-prefix}-caret-up:before { content: @fa-var-caret-up; } +.@{fa-css-prefix}-caret-left:before { content: @fa-var-caret-left; } +.@{fa-css-prefix}-caret-right:before { content: @fa-var-caret-right; } +.@{fa-css-prefix}-columns:before { content: @fa-var-columns; } +.@{fa-css-prefix}-unsorted:before, +.@{fa-css-prefix}-sort:before { content: @fa-var-sort; } +.@{fa-css-prefix}-sort-down:before, +.@{fa-css-prefix}-sort-desc:before { content: @fa-var-sort-desc; } +.@{fa-css-prefix}-sort-up:before, +.@{fa-css-prefix}-sort-asc:before { content: @fa-var-sort-asc; } +.@{fa-css-prefix}-envelope:before { content: @fa-var-envelope; } +.@{fa-css-prefix}-linkedin:before { content: @fa-var-linkedin; } +.@{fa-css-prefix}-rotate-left:before, +.@{fa-css-prefix}-undo:before { content: @fa-var-undo; } +.@{fa-css-prefix}-legal:before, +.@{fa-css-prefix}-gavel:before { content: @fa-var-gavel; } +.@{fa-css-prefix}-dashboard:before, +.@{fa-css-prefix}-tachometer:before { content: @fa-var-tachometer; } +.@{fa-css-prefix}-comment-o:before { content: @fa-var-comment-o; } +.@{fa-css-prefix}-comments-o:before { content: @fa-var-comments-o; } +.@{fa-css-prefix}-flash:before, +.@{fa-css-prefix}-bolt:before { content: @fa-var-bolt; } +.@{fa-css-prefix}-sitemap:before { content: @fa-var-sitemap; } +.@{fa-css-prefix}-umbrella:before { content: @fa-var-umbrella; } +.@{fa-css-prefix}-paste:before, +.@{fa-css-prefix}-clipboard:before { content: @fa-var-clipboard; } +.@{fa-css-prefix}-lightbulb-o:before { content: @fa-var-lightbulb-o; } +.@{fa-css-prefix}-exchange:before { content: @fa-var-exchange; } +.@{fa-css-prefix}-cloud-download:before { content: @fa-var-cloud-download; } +.@{fa-css-prefix}-cloud-upload:before { content: @fa-var-cloud-upload; } +.@{fa-css-prefix}-user-md:before { content: @fa-var-user-md; } +.@{fa-css-prefix}-stethoscope:before { content: @fa-var-stethoscope; } +.@{fa-css-prefix}-suitcase:before { content: @fa-var-suitcase; } +.@{fa-css-prefix}-bell-o:before { content: @fa-var-bell-o; } +.@{fa-css-prefix}-coffee:before { content: @fa-var-coffee; } +.@{fa-css-prefix}-cutlery:before { content: @fa-var-cutlery; } +.@{fa-css-prefix}-file-text-o:before { content: @fa-var-file-text-o; } +.@{fa-css-prefix}-building-o:before { content: @fa-var-building-o; } +.@{fa-css-prefix}-hospital-o:before { content: @fa-var-hospital-o; } +.@{fa-css-prefix}-ambulance:before { content: @fa-var-ambulance; } +.@{fa-css-prefix}-medkit:before { content: @fa-var-medkit; } +.@{fa-css-prefix}-fighter-jet:before { content: @fa-var-fighter-jet; } +.@{fa-css-prefix}-beer:before { content: @fa-var-beer; } +.@{fa-css-prefix}-h-square:before { content: @fa-var-h-square; } +.@{fa-css-prefix}-plus-square:before { content: @fa-var-plus-square; } +.@{fa-css-prefix}-angle-double-left:before { content: @fa-var-angle-double-left; } +.@{fa-css-prefix}-angle-double-right:before { content: @fa-var-angle-double-right; } +.@{fa-css-prefix}-angle-double-up:before { content: @fa-var-angle-double-up; } +.@{fa-css-prefix}-angle-double-down:before { content: @fa-var-angle-double-down; } +.@{fa-css-prefix}-angle-left:before { content: @fa-var-angle-left; } +.@{fa-css-prefix}-angle-right:before { content: @fa-var-angle-right; } +.@{fa-css-prefix}-angle-up:before { content: @fa-var-angle-up; } +.@{fa-css-prefix}-angle-down:before { content: @fa-var-angle-down; } +.@{fa-css-prefix}-desktop:before { content: @fa-var-desktop; } +.@{fa-css-prefix}-laptop:before { content: @fa-var-laptop; } +.@{fa-css-prefix}-tablet:before { content: @fa-var-tablet; } +.@{fa-css-prefix}-mobile-phone:before, +.@{fa-css-prefix}-mobile:before { content: @fa-var-mobile; } +.@{fa-css-prefix}-circle-o:before { content: @fa-var-circle-o; } +.@{fa-css-prefix}-quote-left:before { content: @fa-var-quote-left; } +.@{fa-css-prefix}-quote-right:before { content: @fa-var-quote-right; } +.@{fa-css-prefix}-spinner:before { content: @fa-var-spinner; } +.@{fa-css-prefix}-circle:before { content: @fa-var-circle; } +.@{fa-css-prefix}-mail-reply:before, +.@{fa-css-prefix}-reply:before { content: @fa-var-reply; } +.@{fa-css-prefix}-github-alt:before { content: @fa-var-github-alt; } +.@{fa-css-prefix}-folder-o:before { content: @fa-var-folder-o; } +.@{fa-css-prefix}-folder-open-o:before { content: @fa-var-folder-open-o; } +.@{fa-css-prefix}-smile-o:before { content: @fa-var-smile-o; } +.@{fa-css-prefix}-frown-o:before { content: @fa-var-frown-o; } +.@{fa-css-prefix}-meh-o:before { content: @fa-var-meh-o; } +.@{fa-css-prefix}-gamepad:before { content: @fa-var-gamepad; } +.@{fa-css-prefix}-keyboard-o:before { content: @fa-var-keyboard-o; } +.@{fa-css-prefix}-flag-o:before { content: @fa-var-flag-o; } +.@{fa-css-prefix}-flag-checkered:before { content: @fa-var-flag-checkered; } +.@{fa-css-prefix}-terminal:before { content: @fa-var-terminal; } +.@{fa-css-prefix}-code:before { content: @fa-var-code; } +.@{fa-css-prefix}-mail-reply-all:before, +.@{fa-css-prefix}-reply-all:before { content: @fa-var-reply-all; } +.@{fa-css-prefix}-star-half-empty:before, +.@{fa-css-prefix}-star-half-full:before, +.@{fa-css-prefix}-star-half-o:before { content: @fa-var-star-half-o; } +.@{fa-css-prefix}-location-arrow:before { content: @fa-var-location-arrow; } +.@{fa-css-prefix}-crop:before { content: @fa-var-crop; } +.@{fa-css-prefix}-code-fork:before { content: @fa-var-code-fork; } +.@{fa-css-prefix}-unlink:before, +.@{fa-css-prefix}-chain-broken:before { content: @fa-var-chain-broken; } +.@{fa-css-prefix}-question:before { content: @fa-var-question; } +.@{fa-css-prefix}-info:before { content: @fa-var-info; } +.@{fa-css-prefix}-exclamation:before { content: @fa-var-exclamation; } +.@{fa-css-prefix}-superscript:before { content: @fa-var-superscript; } +.@{fa-css-prefix}-subscript:before { content: @fa-var-subscript; } +.@{fa-css-prefix}-eraser:before { content: @fa-var-eraser; } +.@{fa-css-prefix}-puzzle-piece:before { content: @fa-var-puzzle-piece; } +.@{fa-css-prefix}-microphone:before { content: @fa-var-microphone; } +.@{fa-css-prefix}-microphone-slash:before { content: @fa-var-microphone-slash; } +.@{fa-css-prefix}-shield:before { content: @fa-var-shield; } +.@{fa-css-prefix}-calendar-o:before { content: @fa-var-calendar-o; } +.@{fa-css-prefix}-fire-extinguisher:before { content: @fa-var-fire-extinguisher; } +.@{fa-css-prefix}-rocket:before { content: @fa-var-rocket; } +.@{fa-css-prefix}-maxcdn:before { content: @fa-var-maxcdn; } +.@{fa-css-prefix}-chevron-circle-left:before { content: @fa-var-chevron-circle-left; } +.@{fa-css-prefix}-chevron-circle-right:before { content: @fa-var-chevron-circle-right; } +.@{fa-css-prefix}-chevron-circle-up:before { content: @fa-var-chevron-circle-up; } +.@{fa-css-prefix}-chevron-circle-down:before { content: @fa-var-chevron-circle-down; } +.@{fa-css-prefix}-html5:before { content: @fa-var-html5; } +.@{fa-css-prefix}-css3:before { content: @fa-var-css3; } +.@{fa-css-prefix}-anchor:before { content: @fa-var-anchor; } +.@{fa-css-prefix}-unlock-alt:before { content: @fa-var-unlock-alt; } +.@{fa-css-prefix}-bullseye:before { content: @fa-var-bullseye; } +.@{fa-css-prefix}-ellipsis-h:before { content: @fa-var-ellipsis-h; } +.@{fa-css-prefix}-ellipsis-v:before { content: @fa-var-ellipsis-v; } +.@{fa-css-prefix}-rss-square:before { content: @fa-var-rss-square; } +.@{fa-css-prefix}-play-circle:before { content: @fa-var-play-circle; } +.@{fa-css-prefix}-ticket:before { content: @fa-var-ticket; } +.@{fa-css-prefix}-minus-square:before { content: @fa-var-minus-square; } +.@{fa-css-prefix}-minus-square-o:before { content: @fa-var-minus-square-o; } +.@{fa-css-prefix}-level-up:before { content: @fa-var-level-up; } +.@{fa-css-prefix}-level-down:before { content: @fa-var-level-down; } +.@{fa-css-prefix}-check-square:before { content: @fa-var-check-square; } +.@{fa-css-prefix}-pencil-square:before { content: @fa-var-pencil-square; } +.@{fa-css-prefix}-external-link-square:before { content: @fa-var-external-link-square; } +.@{fa-css-prefix}-share-square:before { content: @fa-var-share-square; } +.@{fa-css-prefix}-compass:before { content: @fa-var-compass; } +.@{fa-css-prefix}-toggle-down:before, +.@{fa-css-prefix}-caret-square-o-down:before { content: @fa-var-caret-square-o-down; } +.@{fa-css-prefix}-toggle-up:before, +.@{fa-css-prefix}-caret-square-o-up:before { content: @fa-var-caret-square-o-up; } +.@{fa-css-prefix}-toggle-right:before, +.@{fa-css-prefix}-caret-square-o-right:before { content: @fa-var-caret-square-o-right; } +.@{fa-css-prefix}-euro:before, +.@{fa-css-prefix}-eur:before { content: @fa-var-eur; } +.@{fa-css-prefix}-gbp:before { content: @fa-var-gbp; } +.@{fa-css-prefix}-dollar:before, +.@{fa-css-prefix}-usd:before { content: @fa-var-usd; } +.@{fa-css-prefix}-rupee:before, +.@{fa-css-prefix}-inr:before { content: @fa-var-inr; } +.@{fa-css-prefix}-cny:before, +.@{fa-css-prefix}-rmb:before, +.@{fa-css-prefix}-yen:before, +.@{fa-css-prefix}-jpy:before { content: @fa-var-jpy; } +.@{fa-css-prefix}-ruble:before, +.@{fa-css-prefix}-rouble:before, +.@{fa-css-prefix}-rub:before { content: @fa-var-rub; } +.@{fa-css-prefix}-won:before, +.@{fa-css-prefix}-krw:before { content: @fa-var-krw; } +.@{fa-css-prefix}-bitcoin:before, +.@{fa-css-prefix}-btc:before { content: @fa-var-btc; } +.@{fa-css-prefix}-file:before { content: @fa-var-file; } +.@{fa-css-prefix}-file-text:before { content: @fa-var-file-text; } +.@{fa-css-prefix}-sort-alpha-asc:before { content: @fa-var-sort-alpha-asc; } +.@{fa-css-prefix}-sort-alpha-desc:before { content: @fa-var-sort-alpha-desc; } +.@{fa-css-prefix}-sort-amount-asc:before { content: @fa-var-sort-amount-asc; } +.@{fa-css-prefix}-sort-amount-desc:before { content: @fa-var-sort-amount-desc; } +.@{fa-css-prefix}-sort-numeric-asc:before { content: @fa-var-sort-numeric-asc; } +.@{fa-css-prefix}-sort-numeric-desc:before { content: @fa-var-sort-numeric-desc; } +.@{fa-css-prefix}-thumbs-up:before { content: @fa-var-thumbs-up; } +.@{fa-css-prefix}-thumbs-down:before { content: @fa-var-thumbs-down; } +.@{fa-css-prefix}-youtube-square:before { content: @fa-var-youtube-square; } +.@{fa-css-prefix}-youtube:before { content: @fa-var-youtube; } +.@{fa-css-prefix}-xing:before { content: @fa-var-xing; } +.@{fa-css-prefix}-xing-square:before { content: @fa-var-xing-square; } +.@{fa-css-prefix}-youtube-play:before { content: @fa-var-youtube-play; } +.@{fa-css-prefix}-dropbox:before { content: @fa-var-dropbox; } +.@{fa-css-prefix}-stack-overflow:before { content: @fa-var-stack-overflow; } +.@{fa-css-prefix}-instagram:before { content: @fa-var-instagram; } +.@{fa-css-prefix}-flickr:before { content: @fa-var-flickr; } +.@{fa-css-prefix}-adn:before { content: @fa-var-adn; } +.@{fa-css-prefix}-bitbucket:before { content: @fa-var-bitbucket; } +.@{fa-css-prefix}-bitbucket-square:before { content: @fa-var-bitbucket-square; } +.@{fa-css-prefix}-tumblr:before { content: @fa-var-tumblr; } +.@{fa-css-prefix}-tumblr-square:before { content: @fa-var-tumblr-square; } +.@{fa-css-prefix}-long-arrow-down:before { content: @fa-var-long-arrow-down; } +.@{fa-css-prefix}-long-arrow-up:before { content: @fa-var-long-arrow-up; } +.@{fa-css-prefix}-long-arrow-left:before { content: @fa-var-long-arrow-left; } +.@{fa-css-prefix}-long-arrow-right:before { content: @fa-var-long-arrow-right; } +.@{fa-css-prefix}-apple:before { content: @fa-var-apple; } +.@{fa-css-prefix}-windows:before { content: @fa-var-windows; } +.@{fa-css-prefix}-android:before { content: @fa-var-android; } +.@{fa-css-prefix}-linux:before { content: @fa-var-linux; } +.@{fa-css-prefix}-dribbble:before { content: @fa-var-dribbble; } +.@{fa-css-prefix}-skype:before { content: @fa-var-skype; } +.@{fa-css-prefix}-foursquare:before { content: @fa-var-foursquare; } +.@{fa-css-prefix}-trello:before { content: @fa-var-trello; } +.@{fa-css-prefix}-female:before { content: @fa-var-female; } +.@{fa-css-prefix}-male:before { content: @fa-var-male; } +.@{fa-css-prefix}-gittip:before, +.@{fa-css-prefix}-gratipay:before { content: @fa-var-gratipay; } +.@{fa-css-prefix}-sun-o:before { content: @fa-var-sun-o; } +.@{fa-css-prefix}-moon-o:before { content: @fa-var-moon-o; } +.@{fa-css-prefix}-archive:before { content: @fa-var-archive; } +.@{fa-css-prefix}-bug:before { content: @fa-var-bug; } +.@{fa-css-prefix}-vk:before { content: @fa-var-vk; } +.@{fa-css-prefix}-weibo:before { content: @fa-var-weibo; } +.@{fa-css-prefix}-renren:before { content: @fa-var-renren; } +.@{fa-css-prefix}-pagelines:before { content: @fa-var-pagelines; } +.@{fa-css-prefix}-stack-exchange:before { content: @fa-var-stack-exchange; } +.@{fa-css-prefix}-arrow-circle-o-right:before { content: @fa-var-arrow-circle-o-right; } +.@{fa-css-prefix}-arrow-circle-o-left:before { content: @fa-var-arrow-circle-o-left; } +.@{fa-css-prefix}-toggle-left:before, +.@{fa-css-prefix}-caret-square-o-left:before { content: @fa-var-caret-square-o-left; } +.@{fa-css-prefix}-dot-circle-o:before { content: @fa-var-dot-circle-o; } +.@{fa-css-prefix}-wheelchair:before { content: @fa-var-wheelchair; } +.@{fa-css-prefix}-vimeo-square:before { content: @fa-var-vimeo-square; } +.@{fa-css-prefix}-turkish-lira:before, +.@{fa-css-prefix}-try:before { content: @fa-var-try; } +.@{fa-css-prefix}-plus-square-o:before { content: @fa-var-plus-square-o; } +.@{fa-css-prefix}-space-shuttle:before { content: @fa-var-space-shuttle; } +.@{fa-css-prefix}-slack:before { content: @fa-var-slack; } +.@{fa-css-prefix}-envelope-square:before { content: @fa-var-envelope-square; } +.@{fa-css-prefix}-wordpress:before { content: @fa-var-wordpress; } +.@{fa-css-prefix}-openid:before { content: @fa-var-openid; } +.@{fa-css-prefix}-institution:before, +.@{fa-css-prefix}-bank:before, +.@{fa-css-prefix}-university:before { content: @fa-var-university; } +.@{fa-css-prefix}-mortar-board:before, +.@{fa-css-prefix}-graduation-cap:before { content: @fa-var-graduation-cap; } +.@{fa-css-prefix}-yahoo:before { content: @fa-var-yahoo; } +.@{fa-css-prefix}-google:before { content: @fa-var-google; } +.@{fa-css-prefix}-reddit:before { content: @fa-var-reddit; } +.@{fa-css-prefix}-reddit-square:before { content: @fa-var-reddit-square; } +.@{fa-css-prefix}-stumbleupon-circle:before { content: @fa-var-stumbleupon-circle; } +.@{fa-css-prefix}-stumbleupon:before { content: @fa-var-stumbleupon; } +.@{fa-css-prefix}-delicious:before { content: @fa-var-delicious; } +.@{fa-css-prefix}-digg:before { content: @fa-var-digg; } +.@{fa-css-prefix}-pied-piper-pp:before { content: @fa-var-pied-piper-pp; } +.@{fa-css-prefix}-pied-piper-alt:before { content: @fa-var-pied-piper-alt; } +.@{fa-css-prefix}-drupal:before { content: @fa-var-drupal; } +.@{fa-css-prefix}-joomla:before { content: @fa-var-joomla; } +.@{fa-css-prefix}-language:before { content: @fa-var-language; } +.@{fa-css-prefix}-fax:before { content: @fa-var-fax; } +.@{fa-css-prefix}-building:before { content: @fa-var-building; } +.@{fa-css-prefix}-child:before { content: @fa-var-child; } +.@{fa-css-prefix}-paw:before { content: @fa-var-paw; } +.@{fa-css-prefix}-spoon:before { content: @fa-var-spoon; } +.@{fa-css-prefix}-cube:before { content: @fa-var-cube; } +.@{fa-css-prefix}-cubes:before { content: @fa-var-cubes; } +.@{fa-css-prefix}-behance:before { content: @fa-var-behance; } +.@{fa-css-prefix}-behance-square:before { content: @fa-var-behance-square; } +.@{fa-css-prefix}-steam:before { content: @fa-var-steam; } +.@{fa-css-prefix}-steam-square:before { content: @fa-var-steam-square; } +.@{fa-css-prefix}-recycle:before { content: @fa-var-recycle; } +.@{fa-css-prefix}-automobile:before, +.@{fa-css-prefix}-car:before { content: @fa-var-car; } +.@{fa-css-prefix}-cab:before, +.@{fa-css-prefix}-taxi:before { content: @fa-var-taxi; } +.@{fa-css-prefix}-tree:before { content: @fa-var-tree; } +.@{fa-css-prefix}-spotify:before { content: @fa-var-spotify; } +.@{fa-css-prefix}-deviantart:before { content: @fa-var-deviantart; } +.@{fa-css-prefix}-soundcloud:before { content: @fa-var-soundcloud; } +.@{fa-css-prefix}-database:before { content: @fa-var-database; } +.@{fa-css-prefix}-file-pdf-o:before { content: @fa-var-file-pdf-o; } +.@{fa-css-prefix}-file-word-o:before { content: @fa-var-file-word-o; } +.@{fa-css-prefix}-file-excel-o:before { content: @fa-var-file-excel-o; } +.@{fa-css-prefix}-file-powerpoint-o:before { content: @fa-var-file-powerpoint-o; } +.@{fa-css-prefix}-file-photo-o:before, +.@{fa-css-prefix}-file-picture-o:before, +.@{fa-css-prefix}-file-image-o:before { content: @fa-var-file-image-o; } +.@{fa-css-prefix}-file-zip-o:before, +.@{fa-css-prefix}-file-archive-o:before { content: @fa-var-file-archive-o; } +.@{fa-css-prefix}-file-sound-o:before, +.@{fa-css-prefix}-file-audio-o:before { content: @fa-var-file-audio-o; } +.@{fa-css-prefix}-file-movie-o:before, +.@{fa-css-prefix}-file-video-o:before { content: @fa-var-file-video-o; } +.@{fa-css-prefix}-file-code-o:before { content: @fa-var-file-code-o; } +.@{fa-css-prefix}-vine:before { content: @fa-var-vine; } +.@{fa-css-prefix}-codepen:before { content: @fa-var-codepen; } +.@{fa-css-prefix}-jsfiddle:before { content: @fa-var-jsfiddle; } +.@{fa-css-prefix}-life-bouy:before, +.@{fa-css-prefix}-life-buoy:before, +.@{fa-css-prefix}-life-saver:before, +.@{fa-css-prefix}-support:before, +.@{fa-css-prefix}-life-ring:before { content: @fa-var-life-ring; } +.@{fa-css-prefix}-circle-o-notch:before { content: @fa-var-circle-o-notch; } +.@{fa-css-prefix}-ra:before, +.@{fa-css-prefix}-resistance:before, +.@{fa-css-prefix}-rebel:before { content: @fa-var-rebel; } +.@{fa-css-prefix}-ge:before, +.@{fa-css-prefix}-empire:before { content: @fa-var-empire; } +.@{fa-css-prefix}-git-square:before { content: @fa-var-git-square; } +.@{fa-css-prefix}-git:before { content: @fa-var-git; } +.@{fa-css-prefix}-y-combinator-square:before, +.@{fa-css-prefix}-yc-square:before, +.@{fa-css-prefix}-hacker-news:before { content: @fa-var-hacker-news; } +.@{fa-css-prefix}-tencent-weibo:before { content: @fa-var-tencent-weibo; } +.@{fa-css-prefix}-qq:before { content: @fa-var-qq; } +.@{fa-css-prefix}-wechat:before, +.@{fa-css-prefix}-weixin:before { content: @fa-var-weixin; } +.@{fa-css-prefix}-send:before, +.@{fa-css-prefix}-paper-plane:before { content: @fa-var-paper-plane; } +.@{fa-css-prefix}-send-o:before, +.@{fa-css-prefix}-paper-plane-o:before { content: @fa-var-paper-plane-o; } +.@{fa-css-prefix}-history:before { content: @fa-var-history; } +.@{fa-css-prefix}-circle-thin:before { content: @fa-var-circle-thin; } +.@{fa-css-prefix}-header:before { content: @fa-var-header; } +.@{fa-css-prefix}-paragraph:before { content: @fa-var-paragraph; } +.@{fa-css-prefix}-sliders:before { content: @fa-var-sliders; } +.@{fa-css-prefix}-share-alt:before { content: @fa-var-share-alt; } +.@{fa-css-prefix}-share-alt-square:before { content: @fa-var-share-alt-square; } +.@{fa-css-prefix}-bomb:before { content: @fa-var-bomb; } +.@{fa-css-prefix}-soccer-ball-o:before, +.@{fa-css-prefix}-futbol-o:before { content: @fa-var-futbol-o; } +.@{fa-css-prefix}-tty:before { content: @fa-var-tty; } +.@{fa-css-prefix}-binoculars:before { content: @fa-var-binoculars; } +.@{fa-css-prefix}-plug:before { content: @fa-var-plug; } +.@{fa-css-prefix}-slideshare:before { content: @fa-var-slideshare; } +.@{fa-css-prefix}-twitch:before { content: @fa-var-twitch; } +.@{fa-css-prefix}-yelp:before { content: @fa-var-yelp; } +.@{fa-css-prefix}-newspaper-o:before { content: @fa-var-newspaper-o; } +.@{fa-css-prefix}-wifi:before { content: @fa-var-wifi; } +.@{fa-css-prefix}-calculator:before { content: @fa-var-calculator; } +.@{fa-css-prefix}-paypal:before { content: @fa-var-paypal; } +.@{fa-css-prefix}-google-wallet:before { content: @fa-var-google-wallet; } +.@{fa-css-prefix}-cc-visa:before { content: @fa-var-cc-visa; } +.@{fa-css-prefix}-cc-mastercard:before { content: @fa-var-cc-mastercard; } +.@{fa-css-prefix}-cc-discover:before { content: @fa-var-cc-discover; } +.@{fa-css-prefix}-cc-amex:before { content: @fa-var-cc-amex; } +.@{fa-css-prefix}-cc-paypal:before { content: @fa-var-cc-paypal; } +.@{fa-css-prefix}-cc-stripe:before { content: @fa-var-cc-stripe; } +.@{fa-css-prefix}-bell-slash:before { content: @fa-var-bell-slash; } +.@{fa-css-prefix}-bell-slash-o:before { content: @fa-var-bell-slash-o; } +.@{fa-css-prefix}-trash:before { content: @fa-var-trash; } +.@{fa-css-prefix}-copyright:before { content: @fa-var-copyright; } +.@{fa-css-prefix}-at:before { content: @fa-var-at; } +.@{fa-css-prefix}-eyedropper:before { content: @fa-var-eyedropper; } +.@{fa-css-prefix}-paint-brush:before { content: @fa-var-paint-brush; } +.@{fa-css-prefix}-birthday-cake:before { content: @fa-var-birthday-cake; } +.@{fa-css-prefix}-area-chart:before { content: @fa-var-area-chart; } +.@{fa-css-prefix}-pie-chart:before { content: @fa-var-pie-chart; } +.@{fa-css-prefix}-line-chart:before { content: @fa-var-line-chart; } +.@{fa-css-prefix}-lastfm:before { content: @fa-var-lastfm; } +.@{fa-css-prefix}-lastfm-square:before { content: @fa-var-lastfm-square; } +.@{fa-css-prefix}-toggle-off:before { content: @fa-var-toggle-off; } +.@{fa-css-prefix}-toggle-on:before { content: @fa-var-toggle-on; } +.@{fa-css-prefix}-bicycle:before { content: @fa-var-bicycle; } +.@{fa-css-prefix}-bus:before { content: @fa-var-bus; } +.@{fa-css-prefix}-ioxhost:before { content: @fa-var-ioxhost; } +.@{fa-css-prefix}-angellist:before { content: @fa-var-angellist; } +.@{fa-css-prefix}-cc:before { content: @fa-var-cc; } +.@{fa-css-prefix}-shekel:before, +.@{fa-css-prefix}-sheqel:before, +.@{fa-css-prefix}-ils:before { content: @fa-var-ils; } +.@{fa-css-prefix}-meanpath:before { content: @fa-var-meanpath; } +.@{fa-css-prefix}-buysellads:before { content: @fa-var-buysellads; } +.@{fa-css-prefix}-connectdevelop:before { content: @fa-var-connectdevelop; } +.@{fa-css-prefix}-dashcube:before { content: @fa-var-dashcube; } +.@{fa-css-prefix}-forumbee:before { content: @fa-var-forumbee; } +.@{fa-css-prefix}-leanpub:before { content: @fa-var-leanpub; } +.@{fa-css-prefix}-sellsy:before { content: @fa-var-sellsy; } +.@{fa-css-prefix}-shirtsinbulk:before { content: @fa-var-shirtsinbulk; } +.@{fa-css-prefix}-simplybuilt:before { content: @fa-var-simplybuilt; } +.@{fa-css-prefix}-skyatlas:before { content: @fa-var-skyatlas; } +.@{fa-css-prefix}-cart-plus:before { content: @fa-var-cart-plus; } +.@{fa-css-prefix}-cart-arrow-down:before { content: @fa-var-cart-arrow-down; } +.@{fa-css-prefix}-diamond:before { content: @fa-var-diamond; } +.@{fa-css-prefix}-ship:before { content: @fa-var-ship; } +.@{fa-css-prefix}-user-secret:before { content: @fa-var-user-secret; } +.@{fa-css-prefix}-motorcycle:before { content: @fa-var-motorcycle; } +.@{fa-css-prefix}-street-view:before { content: @fa-var-street-view; } +.@{fa-css-prefix}-heartbeat:before { content: @fa-var-heartbeat; } +.@{fa-css-prefix}-venus:before { content: @fa-var-venus; } +.@{fa-css-prefix}-mars:before { content: @fa-var-mars; } +.@{fa-css-prefix}-mercury:before { content: @fa-var-mercury; } +.@{fa-css-prefix}-intersex:before, +.@{fa-css-prefix}-transgender:before { content: @fa-var-transgender; } +.@{fa-css-prefix}-transgender-alt:before { content: @fa-var-transgender-alt; } +.@{fa-css-prefix}-venus-double:before { content: @fa-var-venus-double; } +.@{fa-css-prefix}-mars-double:before { content: @fa-var-mars-double; } +.@{fa-css-prefix}-venus-mars:before { content: @fa-var-venus-mars; } +.@{fa-css-prefix}-mars-stroke:before { content: @fa-var-mars-stroke; } +.@{fa-css-prefix}-mars-stroke-v:before { content: @fa-var-mars-stroke-v; } +.@{fa-css-prefix}-mars-stroke-h:before { content: @fa-var-mars-stroke-h; } +.@{fa-css-prefix}-neuter:before { content: @fa-var-neuter; } +.@{fa-css-prefix}-genderless:before { content: @fa-var-genderless; } +.@{fa-css-prefix}-facebook-official:before { content: @fa-var-facebook-official; } +.@{fa-css-prefix}-pinterest-p:before { content: @fa-var-pinterest-p; } +.@{fa-css-prefix}-whatsapp:before { content: @fa-var-whatsapp; } +.@{fa-css-prefix}-server:before { content: @fa-var-server; } +.@{fa-css-prefix}-user-plus:before { content: @fa-var-user-plus; } +.@{fa-css-prefix}-user-times:before { content: @fa-var-user-times; } +.@{fa-css-prefix}-hotel:before, +.@{fa-css-prefix}-bed:before { content: @fa-var-bed; } +.@{fa-css-prefix}-viacoin:before { content: @fa-var-viacoin; } +.@{fa-css-prefix}-train:before { content: @fa-var-train; } +.@{fa-css-prefix}-subway:before { content: @fa-var-subway; } +.@{fa-css-prefix}-medium:before { content: @fa-var-medium; } +.@{fa-css-prefix}-yc:before, +.@{fa-css-prefix}-y-combinator:before { content: @fa-var-y-combinator; } +.@{fa-css-prefix}-optin-monster:before { content: @fa-var-optin-monster; } +.@{fa-css-prefix}-opencart:before { content: @fa-var-opencart; } +.@{fa-css-prefix}-expeditedssl:before { content: @fa-var-expeditedssl; } +.@{fa-css-prefix}-battery-4:before, +.@{fa-css-prefix}-battery:before, +.@{fa-css-prefix}-battery-full:before { content: @fa-var-battery-full; } +.@{fa-css-prefix}-battery-3:before, +.@{fa-css-prefix}-battery-three-quarters:before { content: @fa-var-battery-three-quarters; } +.@{fa-css-prefix}-battery-2:before, +.@{fa-css-prefix}-battery-half:before { content: @fa-var-battery-half; } +.@{fa-css-prefix}-battery-1:before, +.@{fa-css-prefix}-battery-quarter:before { content: @fa-var-battery-quarter; } +.@{fa-css-prefix}-battery-0:before, +.@{fa-css-prefix}-battery-empty:before { content: @fa-var-battery-empty; } +.@{fa-css-prefix}-mouse-pointer:before { content: @fa-var-mouse-pointer; } +.@{fa-css-prefix}-i-cursor:before { content: @fa-var-i-cursor; } +.@{fa-css-prefix}-object-group:before { content: @fa-var-object-group; } +.@{fa-css-prefix}-object-ungroup:before { content: @fa-var-object-ungroup; } +.@{fa-css-prefix}-sticky-note:before { content: @fa-var-sticky-note; } +.@{fa-css-prefix}-sticky-note-o:before { content: @fa-var-sticky-note-o; } +.@{fa-css-prefix}-cc-jcb:before { content: @fa-var-cc-jcb; } +.@{fa-css-prefix}-cc-diners-club:before { content: @fa-var-cc-diners-club; } +.@{fa-css-prefix}-clone:before { content: @fa-var-clone; } +.@{fa-css-prefix}-balance-scale:before { content: @fa-var-balance-scale; } +.@{fa-css-prefix}-hourglass-o:before { content: @fa-var-hourglass-o; } +.@{fa-css-prefix}-hourglass-1:before, +.@{fa-css-prefix}-hourglass-start:before { content: @fa-var-hourglass-start; } +.@{fa-css-prefix}-hourglass-2:before, +.@{fa-css-prefix}-hourglass-half:before { content: @fa-var-hourglass-half; } +.@{fa-css-prefix}-hourglass-3:before, +.@{fa-css-prefix}-hourglass-end:before { content: @fa-var-hourglass-end; } +.@{fa-css-prefix}-hourglass:before { content: @fa-var-hourglass; } +.@{fa-css-prefix}-hand-grab-o:before, +.@{fa-css-prefix}-hand-rock-o:before { content: @fa-var-hand-rock-o; } +.@{fa-css-prefix}-hand-stop-o:before, +.@{fa-css-prefix}-hand-paper-o:before { content: @fa-var-hand-paper-o; } +.@{fa-css-prefix}-hand-scissors-o:before { content: @fa-var-hand-scissors-o; } +.@{fa-css-prefix}-hand-lizard-o:before { content: @fa-var-hand-lizard-o; } +.@{fa-css-prefix}-hand-spock-o:before { content: @fa-var-hand-spock-o; } +.@{fa-css-prefix}-hand-pointer-o:before { content: @fa-var-hand-pointer-o; } +.@{fa-css-prefix}-hand-peace-o:before { content: @fa-var-hand-peace-o; } +.@{fa-css-prefix}-trademark:before { content: @fa-var-trademark; } +.@{fa-css-prefix}-registered:before { content: @fa-var-registered; } +.@{fa-css-prefix}-creative-commons:before { content: @fa-var-creative-commons; } +.@{fa-css-prefix}-gg:before { content: @fa-var-gg; } +.@{fa-css-prefix}-gg-circle:before { content: @fa-var-gg-circle; } +.@{fa-css-prefix}-tripadvisor:before { content: @fa-var-tripadvisor; } +.@{fa-css-prefix}-odnoklassniki:before { content: @fa-var-odnoklassniki; } +.@{fa-css-prefix}-odnoklassniki-square:before { content: @fa-var-odnoklassniki-square; } +.@{fa-css-prefix}-get-pocket:before { content: @fa-var-get-pocket; } +.@{fa-css-prefix}-wikipedia-w:before { content: @fa-var-wikipedia-w; } +.@{fa-css-prefix}-safari:before { content: @fa-var-safari; } +.@{fa-css-prefix}-chrome:before { content: @fa-var-chrome; } +.@{fa-css-prefix}-firefox:before { content: @fa-var-firefox; } +.@{fa-css-prefix}-opera:before { content: @fa-var-opera; } +.@{fa-css-prefix}-internet-explorer:before { content: @fa-var-internet-explorer; } +.@{fa-css-prefix}-tv:before, +.@{fa-css-prefix}-television:before { content: @fa-var-television; } +.@{fa-css-prefix}-contao:before { content: @fa-var-contao; } +.@{fa-css-prefix}-500px:before { content: @fa-var-500px; } +.@{fa-css-prefix}-amazon:before { content: @fa-var-amazon; } +.@{fa-css-prefix}-calendar-plus-o:before { content: @fa-var-calendar-plus-o; } +.@{fa-css-prefix}-calendar-minus-o:before { content: @fa-var-calendar-minus-o; } +.@{fa-css-prefix}-calendar-times-o:before { content: @fa-var-calendar-times-o; } +.@{fa-css-prefix}-calendar-check-o:before { content: @fa-var-calendar-check-o; } +.@{fa-css-prefix}-industry:before { content: @fa-var-industry; } +.@{fa-css-prefix}-map-pin:before { content: @fa-var-map-pin; } +.@{fa-css-prefix}-map-signs:before { content: @fa-var-map-signs; } +.@{fa-css-prefix}-map-o:before { content: @fa-var-map-o; } +.@{fa-css-prefix}-map:before { content: @fa-var-map; } +.@{fa-css-prefix}-commenting:before { content: @fa-var-commenting; } +.@{fa-css-prefix}-commenting-o:before { content: @fa-var-commenting-o; } +.@{fa-css-prefix}-houzz:before { content: @fa-var-houzz; } +.@{fa-css-prefix}-vimeo:before { content: @fa-var-vimeo; } +.@{fa-css-prefix}-black-tie:before { content: @fa-var-black-tie; } +.@{fa-css-prefix}-fonticons:before { content: @fa-var-fonticons; } +.@{fa-css-prefix}-reddit-alien:before { content: @fa-var-reddit-alien; } +.@{fa-css-prefix}-edge:before { content: @fa-var-edge; } +.@{fa-css-prefix}-credit-card-alt:before { content: @fa-var-credit-card-alt; } +.@{fa-css-prefix}-codiepie:before { content: @fa-var-codiepie; } +.@{fa-css-prefix}-modx:before { content: @fa-var-modx; } +.@{fa-css-prefix}-fort-awesome:before { content: @fa-var-fort-awesome; } +.@{fa-css-prefix}-usb:before { content: @fa-var-usb; } +.@{fa-css-prefix}-product-hunt:before { content: @fa-var-product-hunt; } +.@{fa-css-prefix}-mixcloud:before { content: @fa-var-mixcloud; } +.@{fa-css-prefix}-scribd:before { content: @fa-var-scribd; } +.@{fa-css-prefix}-pause-circle:before { content: @fa-var-pause-circle; } +.@{fa-css-prefix}-pause-circle-o:before { content: @fa-var-pause-circle-o; } +.@{fa-css-prefix}-stop-circle:before { content: @fa-var-stop-circle; } +.@{fa-css-prefix}-stop-circle-o:before { content: @fa-var-stop-circle-o; } +.@{fa-css-prefix}-shopping-bag:before { content: @fa-var-shopping-bag; } +.@{fa-css-prefix}-shopping-basket:before { content: @fa-var-shopping-basket; } +.@{fa-css-prefix}-hashtag:before { content: @fa-var-hashtag; } +.@{fa-css-prefix}-bluetooth:before { content: @fa-var-bluetooth; } +.@{fa-css-prefix}-bluetooth-b:before { content: @fa-var-bluetooth-b; } +.@{fa-css-prefix}-percent:before { content: @fa-var-percent; } +.@{fa-css-prefix}-gitlab:before { content: @fa-var-gitlab; } +.@{fa-css-prefix}-wpbeginner:before { content: @fa-var-wpbeginner; } +.@{fa-css-prefix}-wpforms:before { content: @fa-var-wpforms; } +.@{fa-css-prefix}-envira:before { content: @fa-var-envira; } +.@{fa-css-prefix}-universal-access:before { content: @fa-var-universal-access; } +.@{fa-css-prefix}-wheelchair-alt:before { content: @fa-var-wheelchair-alt; } +.@{fa-css-prefix}-question-circle-o:before { content: @fa-var-question-circle-o; } +.@{fa-css-prefix}-blind:before { content: @fa-var-blind; } +.@{fa-css-prefix}-audio-description:before { content: @fa-var-audio-description; } +.@{fa-css-prefix}-volume-control-phone:before { content: @fa-var-volume-control-phone; } +.@{fa-css-prefix}-braille:before { content: @fa-var-braille; } +.@{fa-css-prefix}-assistive-listening-systems:before { content: @fa-var-assistive-listening-systems; } +.@{fa-css-prefix}-asl-interpreting:before, +.@{fa-css-prefix}-american-sign-language-interpreting:before { content: @fa-var-american-sign-language-interpreting; } +.@{fa-css-prefix}-deafness:before, +.@{fa-css-prefix}-hard-of-hearing:before, +.@{fa-css-prefix}-deaf:before { content: @fa-var-deaf; } +.@{fa-css-prefix}-glide:before { content: @fa-var-glide; } +.@{fa-css-prefix}-glide-g:before { content: @fa-var-glide-g; } +.@{fa-css-prefix}-signing:before, +.@{fa-css-prefix}-sign-language:before { content: @fa-var-sign-language; } +.@{fa-css-prefix}-low-vision:before { content: @fa-var-low-vision; } +.@{fa-css-prefix}-viadeo:before { content: @fa-var-viadeo; } +.@{fa-css-prefix}-viadeo-square:before { content: @fa-var-viadeo-square; } +.@{fa-css-prefix}-snapchat:before { content: @fa-var-snapchat; } +.@{fa-css-prefix}-snapchat-ghost:before { content: @fa-var-snapchat-ghost; } +.@{fa-css-prefix}-snapchat-square:before { content: @fa-var-snapchat-square; } +.@{fa-css-prefix}-pied-piper:before { content: @fa-var-pied-piper; } +.@{fa-css-prefix}-first-order:before { content: @fa-var-first-order; } +.@{fa-css-prefix}-yoast:before { content: @fa-var-yoast; } +.@{fa-css-prefix}-themeisle:before { content: @fa-var-themeisle; } +.@{fa-css-prefix}-google-plus-circle:before, +.@{fa-css-prefix}-google-plus-official:before { content: @fa-var-google-plus-official; } +.@{fa-css-prefix}-fa:before, +.@{fa-css-prefix}-font-awesome:before { content: @fa-var-font-awesome; } +.@{fa-css-prefix}-handshake-o:before { content: @fa-var-handshake-o; } +.@{fa-css-prefix}-envelope-open:before { content: @fa-var-envelope-open; } +.@{fa-css-prefix}-envelope-open-o:before { content: @fa-var-envelope-open-o; } +.@{fa-css-prefix}-linode:before { content: @fa-var-linode; } +.@{fa-css-prefix}-address-book:before { content: @fa-var-address-book; } +.@{fa-css-prefix}-address-book-o:before { content: @fa-var-address-book-o; } +.@{fa-css-prefix}-vcard:before, +.@{fa-css-prefix}-address-card:before { content: @fa-var-address-card; } +.@{fa-css-prefix}-vcard-o:before, +.@{fa-css-prefix}-address-card-o:before { content: @fa-var-address-card-o; } +.@{fa-css-prefix}-user-circle:before { content: @fa-var-user-circle; } +.@{fa-css-prefix}-user-circle-o:before { content: @fa-var-user-circle-o; } +.@{fa-css-prefix}-user-o:before { content: @fa-var-user-o; } +.@{fa-css-prefix}-id-badge:before { content: @fa-var-id-badge; } +.@{fa-css-prefix}-drivers-license:before, +.@{fa-css-prefix}-id-card:before { content: @fa-var-id-card; } +.@{fa-css-prefix}-drivers-license-o:before, +.@{fa-css-prefix}-id-card-o:before { content: @fa-var-id-card-o; } +.@{fa-css-prefix}-quora:before { content: @fa-var-quora; } +.@{fa-css-prefix}-free-code-camp:before { content: @fa-var-free-code-camp; } +.@{fa-css-prefix}-telegram:before { content: @fa-var-telegram; } +.@{fa-css-prefix}-thermometer-4:before, +.@{fa-css-prefix}-thermometer:before, +.@{fa-css-prefix}-thermometer-full:before { content: @fa-var-thermometer-full; } +.@{fa-css-prefix}-thermometer-3:before, +.@{fa-css-prefix}-thermometer-three-quarters:before { content: @fa-var-thermometer-three-quarters; } +.@{fa-css-prefix}-thermometer-2:before, +.@{fa-css-prefix}-thermometer-half:before { content: @fa-var-thermometer-half; } +.@{fa-css-prefix}-thermometer-1:before, +.@{fa-css-prefix}-thermometer-quarter:before { content: @fa-var-thermometer-quarter; } +.@{fa-css-prefix}-thermometer-0:before, +.@{fa-css-prefix}-thermometer-empty:before { content: @fa-var-thermometer-empty; } +.@{fa-css-prefix}-shower:before { content: @fa-var-shower; } +.@{fa-css-prefix}-bathtub:before, +.@{fa-css-prefix}-s15:before, +.@{fa-css-prefix}-bath:before { content: @fa-var-bath; } +.@{fa-css-prefix}-podcast:before { content: @fa-var-podcast; } +.@{fa-css-prefix}-window-maximize:before { content: @fa-var-window-maximize; } +.@{fa-css-prefix}-window-minimize:before { content: @fa-var-window-minimize; } +.@{fa-css-prefix}-window-restore:before { content: @fa-var-window-restore; } +.@{fa-css-prefix}-times-rectangle:before, +.@{fa-css-prefix}-window-close:before { content: @fa-var-window-close; } +.@{fa-css-prefix}-times-rectangle-o:before, +.@{fa-css-prefix}-window-close-o:before { content: @fa-var-window-close-o; } +.@{fa-css-prefix}-bandcamp:before { content: @fa-var-bandcamp; } +.@{fa-css-prefix}-grav:before { content: @fa-var-grav; } +.@{fa-css-prefix}-etsy:before { content: @fa-var-etsy; } +.@{fa-css-prefix}-imdb:before { content: @fa-var-imdb; } +.@{fa-css-prefix}-ravelry:before { content: @fa-var-ravelry; } +.@{fa-css-prefix}-eercast:before { content: @fa-var-eercast; } +.@{fa-css-prefix}-microchip:before { content: @fa-var-microchip; } +.@{fa-css-prefix}-snowflake-o:before { content: @fa-var-snowflake-o; } +.@{fa-css-prefix}-superpowers:before { content: @fa-var-superpowers; } +.@{fa-css-prefix}-wpexplorer:before { content: @fa-var-wpexplorer; } +.@{fa-css-prefix}-meetup:before { content: @fa-var-meetup; } diff --git a/public/fonts/font-awesome-4.7.0/less/larger.less b/public/fonts/font-awesome-4.7.0/less/larger.less new file mode 100755 index 000000000..c9d646770 --- /dev/null +++ b/public/fonts/font-awesome-4.7.0/less/larger.less @@ -0,0 +1,13 @@ +// Icon Sizes +// ------------------------- + +/* makes the font 33% larger relative to the icon container */ +.@{fa-css-prefix}-lg { + font-size: (4em / 3); + line-height: (3em / 4); + vertical-align: -15%; +} +.@{fa-css-prefix}-2x { font-size: 2em; } +.@{fa-css-prefix}-3x { font-size: 3em; } +.@{fa-css-prefix}-4x { font-size: 4em; } +.@{fa-css-prefix}-5x { font-size: 5em; } diff --git a/public/fonts/font-awesome-4.7.0/less/list.less b/public/fonts/font-awesome-4.7.0/less/list.less new file mode 100755 index 000000000..0b440382f --- /dev/null +++ b/public/fonts/font-awesome-4.7.0/less/list.less @@ -0,0 +1,19 @@ +// List Icons +// ------------------------- + +.@{fa-css-prefix}-ul { + padding-left: 0; + margin-left: @fa-li-width; + list-style-type: none; + > li { position: relative; } +} +.@{fa-css-prefix}-li { + position: absolute; + left: -@fa-li-width; + width: @fa-li-width; + top: (2em / 14); + text-align: center; + &.@{fa-css-prefix}-lg { + left: (-@fa-li-width + (4em / 14)); + } +} diff --git a/public/fonts/font-awesome-4.7.0/less/mixins.less b/public/fonts/font-awesome-4.7.0/less/mixins.less new file mode 100755 index 000000000..beef231d0 --- /dev/null +++ b/public/fonts/font-awesome-4.7.0/less/mixins.less @@ -0,0 +1,60 @@ +// Mixins +// -------------------------- + +.fa-icon() { + display: inline-block; + font: normal normal normal @fa-font-size-base/@fa-line-height-base FontAwesome; // shortening font declaration + font-size: inherit; // can't have font-size inherit on line above, so need to override + text-rendering: auto; // optimizelegibility throws things off #1094 + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + +} + +.fa-icon-rotate(@degrees, @rotation) { + -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=@{rotation})"; + -webkit-transform: rotate(@degrees); + -ms-transform: rotate(@degrees); + transform: rotate(@degrees); +} + +.fa-icon-flip(@horiz, @vert, @rotation) { + -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=@{rotation}, mirror=1)"; + -webkit-transform: scale(@horiz, @vert); + -ms-transform: scale(@horiz, @vert); + transform: scale(@horiz, @vert); +} + + +// Only display content to screen readers. A la Bootstrap 4. +// +// See: http://a11yproject.com/posts/how-to-hide-content/ + +.sr-only() { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0,0,0,0); + border: 0; +} + +// Use in conjunction with .sr-only to only display content when it's focused. +// +// Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1 +// +// Credit: HTML5 Boilerplate + +.sr-only-focusable() { + &:active, + &:focus { + position: static; + width: auto; + height: auto; + margin: 0; + overflow: visible; + clip: auto; + } +} diff --git a/public/fonts/font-awesome-4.7.0/less/path.less b/public/fonts/font-awesome-4.7.0/less/path.less new file mode 100755 index 000000000..835be41f8 --- /dev/null +++ b/public/fonts/font-awesome-4.7.0/less/path.less @@ -0,0 +1,15 @@ +/* FONT PATH + * -------------------------- */ + +@font-face { + font-family: 'FontAwesome'; + src: url('@{fa-font-path}/fontawesome-webfont.eot?v=@{fa-version}'); + src: url('@{fa-font-path}/fontawesome-webfont.eot?#iefix&v=@{fa-version}') format('embedded-opentype'), + url('@{fa-font-path}/fontawesome-webfont.woff2?v=@{fa-version}') format('woff2'), + url('@{fa-font-path}/fontawesome-webfont.woff?v=@{fa-version}') format('woff'), + url('@{fa-font-path}/fontawesome-webfont.ttf?v=@{fa-version}') format('truetype'), + url('@{fa-font-path}/fontawesome-webfont.svg?v=@{fa-version}#fontawesomeregular') format('svg'); + // src: url('@{fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts + font-weight: normal; + font-style: normal; +} diff --git a/public/fonts/font-awesome-4.7.0/less/rotated-flipped.less b/public/fonts/font-awesome-4.7.0/less/rotated-flipped.less new file mode 100755 index 000000000..f6ba81475 --- /dev/null +++ b/public/fonts/font-awesome-4.7.0/less/rotated-flipped.less @@ -0,0 +1,20 @@ +// Rotated & Flipped Icons +// ------------------------- + +.@{fa-css-prefix}-rotate-90 { .fa-icon-rotate(90deg, 1); } +.@{fa-css-prefix}-rotate-180 { .fa-icon-rotate(180deg, 2); } +.@{fa-css-prefix}-rotate-270 { .fa-icon-rotate(270deg, 3); } + +.@{fa-css-prefix}-flip-horizontal { .fa-icon-flip(-1, 1, 0); } +.@{fa-css-prefix}-flip-vertical { .fa-icon-flip(1, -1, 2); } + +// Hook for IE8-9 +// ------------------------- + +:root .@{fa-css-prefix}-rotate-90, +:root .@{fa-css-prefix}-rotate-180, +:root .@{fa-css-prefix}-rotate-270, +:root .@{fa-css-prefix}-flip-horizontal, +:root .@{fa-css-prefix}-flip-vertical { + filter: none; +} diff --git a/public/fonts/font-awesome-4.7.0/less/screen-reader.less b/public/fonts/font-awesome-4.7.0/less/screen-reader.less new file mode 100755 index 000000000..11c188196 --- /dev/null +++ b/public/fonts/font-awesome-4.7.0/less/screen-reader.less @@ -0,0 +1,5 @@ +// Screen Readers +// ------------------------- + +.sr-only { .sr-only(); } +.sr-only-focusable { .sr-only-focusable(); } diff --git a/public/fonts/font-awesome-4.7.0/less/stacked.less b/public/fonts/font-awesome-4.7.0/less/stacked.less new file mode 100755 index 000000000..fc53fb0e7 --- /dev/null +++ b/public/fonts/font-awesome-4.7.0/less/stacked.less @@ -0,0 +1,20 @@ +// Stacked Icons +// ------------------------- + +.@{fa-css-prefix}-stack { + position: relative; + display: inline-block; + width: 2em; + height: 2em; + line-height: 2em; + vertical-align: middle; +} +.@{fa-css-prefix}-stack-1x, .@{fa-css-prefix}-stack-2x { + position: absolute; + left: 0; + width: 100%; + text-align: center; +} +.@{fa-css-prefix}-stack-1x { line-height: inherit; } +.@{fa-css-prefix}-stack-2x { font-size: 2em; } +.@{fa-css-prefix}-inverse { color: @fa-inverse; } diff --git a/public/fonts/font-awesome-4.7.0/less/variables.less b/public/fonts/font-awesome-4.7.0/less/variables.less new file mode 100755 index 000000000..7ddbbc011 --- /dev/null +++ b/public/fonts/font-awesome-4.7.0/less/variables.less @@ -0,0 +1,800 @@ +// Variables +// -------------------------- + +@fa-font-path: "../fonts"; +@fa-font-size-base: 14px; +@fa-line-height-base: 1; +//@fa-font-path: "//netdna.bootstrapcdn.com/font-awesome/4.7.0/fonts"; // for referencing Bootstrap CDN font files directly +@fa-css-prefix: fa; +@fa-version: "4.7.0"; +@fa-border-color: #eee; +@fa-inverse: #fff; +@fa-li-width: (30em / 14); + +@fa-var-500px: "\f26e"; +@fa-var-address-book: "\f2b9"; +@fa-var-address-book-o: "\f2ba"; +@fa-var-address-card: "\f2bb"; +@fa-var-address-card-o: "\f2bc"; +@fa-var-adjust: "\f042"; +@fa-var-adn: "\f170"; +@fa-var-align-center: "\f037"; +@fa-var-align-justify: "\f039"; +@fa-var-align-left: "\f036"; +@fa-var-align-right: "\f038"; +@fa-var-amazon: "\f270"; +@fa-var-ambulance: "\f0f9"; +@fa-var-american-sign-language-interpreting: "\f2a3"; +@fa-var-anchor: "\f13d"; +@fa-var-android: "\f17b"; +@fa-var-angellist: "\f209"; +@fa-var-angle-double-down: "\f103"; +@fa-var-angle-double-left: "\f100"; +@fa-var-angle-double-right: "\f101"; +@fa-var-angle-double-up: "\f102"; +@fa-var-angle-down: "\f107"; +@fa-var-angle-left: "\f104"; +@fa-var-angle-right: "\f105"; +@fa-var-angle-up: "\f106"; +@fa-var-apple: "\f179"; +@fa-var-archive: "\f187"; +@fa-var-area-chart: "\f1fe"; +@fa-var-arrow-circle-down: "\f0ab"; +@fa-var-arrow-circle-left: "\f0a8"; +@fa-var-arrow-circle-o-down: "\f01a"; +@fa-var-arrow-circle-o-left: "\f190"; +@fa-var-arrow-circle-o-right: "\f18e"; +@fa-var-arrow-circle-o-up: "\f01b"; +@fa-var-arrow-circle-right: "\f0a9"; +@fa-var-arrow-circle-up: "\f0aa"; +@fa-var-arrow-down: "\f063"; +@fa-var-arrow-left: "\f060"; +@fa-var-arrow-right: "\f061"; +@fa-var-arrow-up: "\f062"; +@fa-var-arrows: "\f047"; +@fa-var-arrows-alt: "\f0b2"; +@fa-var-arrows-h: "\f07e"; +@fa-var-arrows-v: "\f07d"; +@fa-var-asl-interpreting: "\f2a3"; +@fa-var-assistive-listening-systems: "\f2a2"; +@fa-var-asterisk: "\f069"; +@fa-var-at: "\f1fa"; +@fa-var-audio-description: "\f29e"; +@fa-var-automobile: "\f1b9"; +@fa-var-backward: "\f04a"; +@fa-var-balance-scale: "\f24e"; +@fa-var-ban: "\f05e"; +@fa-var-bandcamp: "\f2d5"; +@fa-var-bank: "\f19c"; +@fa-var-bar-chart: "\f080"; +@fa-var-bar-chart-o: "\f080"; +@fa-var-barcode: "\f02a"; +@fa-var-bars: "\f0c9"; +@fa-var-bath: "\f2cd"; +@fa-var-bathtub: "\f2cd"; +@fa-var-battery: "\f240"; +@fa-var-battery-0: "\f244"; +@fa-var-battery-1: "\f243"; +@fa-var-battery-2: "\f242"; +@fa-var-battery-3: "\f241"; +@fa-var-battery-4: "\f240"; +@fa-var-battery-empty: "\f244"; +@fa-var-battery-full: "\f240"; +@fa-var-battery-half: "\f242"; +@fa-var-battery-quarter: "\f243"; +@fa-var-battery-three-quarters: "\f241"; +@fa-var-bed: "\f236"; +@fa-var-beer: "\f0fc"; +@fa-var-behance: "\f1b4"; +@fa-var-behance-square: "\f1b5"; +@fa-var-bell: "\f0f3"; +@fa-var-bell-o: "\f0a2"; +@fa-var-bell-slash: "\f1f6"; +@fa-var-bell-slash-o: "\f1f7"; +@fa-var-bicycle: "\f206"; +@fa-var-binoculars: "\f1e5"; +@fa-var-birthday-cake: "\f1fd"; +@fa-var-bitbucket: "\f171"; +@fa-var-bitbucket-square: "\f172"; +@fa-var-bitcoin: "\f15a"; +@fa-var-black-tie: "\f27e"; +@fa-var-blind: "\f29d"; +@fa-var-bluetooth: "\f293"; +@fa-var-bluetooth-b: "\f294"; +@fa-var-bold: "\f032"; +@fa-var-bolt: "\f0e7"; +@fa-var-bomb: "\f1e2"; +@fa-var-book: "\f02d"; +@fa-var-bookmark: "\f02e"; +@fa-var-bookmark-o: "\f097"; +@fa-var-braille: "\f2a1"; +@fa-var-briefcase: "\f0b1"; +@fa-var-btc: "\f15a"; +@fa-var-bug: "\f188"; +@fa-var-building: "\f1ad"; +@fa-var-building-o: "\f0f7"; +@fa-var-bullhorn: "\f0a1"; +@fa-var-bullseye: "\f140"; +@fa-var-bus: "\f207"; +@fa-var-buysellads: "\f20d"; +@fa-var-cab: "\f1ba"; +@fa-var-calculator: "\f1ec"; +@fa-var-calendar: "\f073"; +@fa-var-calendar-check-o: "\f274"; +@fa-var-calendar-minus-o: "\f272"; +@fa-var-calendar-o: "\f133"; +@fa-var-calendar-plus-o: "\f271"; +@fa-var-calendar-times-o: "\f273"; +@fa-var-camera: "\f030"; +@fa-var-camera-retro: "\f083"; +@fa-var-car: "\f1b9"; +@fa-var-caret-down: "\f0d7"; +@fa-var-caret-left: "\f0d9"; +@fa-var-caret-right: "\f0da"; +@fa-var-caret-square-o-down: "\f150"; +@fa-var-caret-square-o-left: "\f191"; +@fa-var-caret-square-o-right: "\f152"; +@fa-var-caret-square-o-up: "\f151"; +@fa-var-caret-up: "\f0d8"; +@fa-var-cart-arrow-down: "\f218"; +@fa-var-cart-plus: "\f217"; +@fa-var-cc: "\f20a"; +@fa-var-cc-amex: "\f1f3"; +@fa-var-cc-diners-club: "\f24c"; +@fa-var-cc-discover: "\f1f2"; +@fa-var-cc-jcb: "\f24b"; +@fa-var-cc-mastercard: "\f1f1"; +@fa-var-cc-paypal: "\f1f4"; +@fa-var-cc-stripe: "\f1f5"; +@fa-var-cc-visa: "\f1f0"; +@fa-var-certificate: "\f0a3"; +@fa-var-chain: "\f0c1"; +@fa-var-chain-broken: "\f127"; +@fa-var-check: "\f00c"; +@fa-var-check-circle: "\f058"; +@fa-var-check-circle-o: "\f05d"; +@fa-var-check-square: "\f14a"; +@fa-var-check-square-o: "\f046"; +@fa-var-chevron-circle-down: "\f13a"; +@fa-var-chevron-circle-left: "\f137"; +@fa-var-chevron-circle-right: "\f138"; +@fa-var-chevron-circle-up: "\f139"; +@fa-var-chevron-down: "\f078"; +@fa-var-chevron-left: "\f053"; +@fa-var-chevron-right: "\f054"; +@fa-var-chevron-up: "\f077"; +@fa-var-child: "\f1ae"; +@fa-var-chrome: "\f268"; +@fa-var-circle: "\f111"; +@fa-var-circle-o: "\f10c"; +@fa-var-circle-o-notch: "\f1ce"; +@fa-var-circle-thin: "\f1db"; +@fa-var-clipboard: "\f0ea"; +@fa-var-clock-o: "\f017"; +@fa-var-clone: "\f24d"; +@fa-var-close: "\f00d"; +@fa-var-cloud: "\f0c2"; +@fa-var-cloud-download: "\f0ed"; +@fa-var-cloud-upload: "\f0ee"; +@fa-var-cny: "\f157"; +@fa-var-code: "\f121"; +@fa-var-code-fork: "\f126"; +@fa-var-codepen: "\f1cb"; +@fa-var-codiepie: "\f284"; +@fa-var-coffee: "\f0f4"; +@fa-var-cog: "\f013"; +@fa-var-cogs: "\f085"; +@fa-var-columns: "\f0db"; +@fa-var-comment: "\f075"; +@fa-var-comment-o: "\f0e5"; +@fa-var-commenting: "\f27a"; +@fa-var-commenting-o: "\f27b"; +@fa-var-comments: "\f086"; +@fa-var-comments-o: "\f0e6"; +@fa-var-compass: "\f14e"; +@fa-var-compress: "\f066"; +@fa-var-connectdevelop: "\f20e"; +@fa-var-contao: "\f26d"; +@fa-var-copy: "\f0c5"; +@fa-var-copyright: "\f1f9"; +@fa-var-creative-commons: "\f25e"; +@fa-var-credit-card: "\f09d"; +@fa-var-credit-card-alt: "\f283"; +@fa-var-crop: "\f125"; +@fa-var-crosshairs: "\f05b"; +@fa-var-css3: "\f13c"; +@fa-var-cube: "\f1b2"; +@fa-var-cubes: "\f1b3"; +@fa-var-cut: "\f0c4"; +@fa-var-cutlery: "\f0f5"; +@fa-var-dashboard: "\f0e4"; +@fa-var-dashcube: "\f210"; +@fa-var-database: "\f1c0"; +@fa-var-deaf: "\f2a4"; +@fa-var-deafness: "\f2a4"; +@fa-var-dedent: "\f03b"; +@fa-var-delicious: "\f1a5"; +@fa-var-desktop: "\f108"; +@fa-var-deviantart: "\f1bd"; +@fa-var-diamond: "\f219"; +@fa-var-digg: "\f1a6"; +@fa-var-dollar: "\f155"; +@fa-var-dot-circle-o: "\f192"; +@fa-var-download: "\f019"; +@fa-var-dribbble: "\f17d"; +@fa-var-drivers-license: "\f2c2"; +@fa-var-drivers-license-o: "\f2c3"; +@fa-var-dropbox: "\f16b"; +@fa-var-drupal: "\f1a9"; +@fa-var-edge: "\f282"; +@fa-var-edit: "\f044"; +@fa-var-eercast: "\f2da"; +@fa-var-eject: "\f052"; +@fa-var-ellipsis-h: "\f141"; +@fa-var-ellipsis-v: "\f142"; +@fa-var-empire: "\f1d1"; +@fa-var-envelope: "\f0e0"; +@fa-var-envelope-o: "\f003"; +@fa-var-envelope-open: "\f2b6"; +@fa-var-envelope-open-o: "\f2b7"; +@fa-var-envelope-square: "\f199"; +@fa-var-envira: "\f299"; +@fa-var-eraser: "\f12d"; +@fa-var-etsy: "\f2d7"; +@fa-var-eur: "\f153"; +@fa-var-euro: "\f153"; +@fa-var-exchange: "\f0ec"; +@fa-var-exclamation: "\f12a"; +@fa-var-exclamation-circle: "\f06a"; +@fa-var-exclamation-triangle: "\f071"; +@fa-var-expand: "\f065"; +@fa-var-expeditedssl: "\f23e"; +@fa-var-external-link: "\f08e"; +@fa-var-external-link-square: "\f14c"; +@fa-var-eye: "\f06e"; +@fa-var-eye-slash: "\f070"; +@fa-var-eyedropper: "\f1fb"; +@fa-var-fa: "\f2b4"; +@fa-var-facebook: "\f09a"; +@fa-var-facebook-f: "\f09a"; +@fa-var-facebook-official: "\f230"; +@fa-var-facebook-square: "\f082"; +@fa-var-fast-backward: "\f049"; +@fa-var-fast-forward: "\f050"; +@fa-var-fax: "\f1ac"; +@fa-var-feed: "\f09e"; +@fa-var-female: "\f182"; +@fa-var-fighter-jet: "\f0fb"; +@fa-var-file: "\f15b"; +@fa-var-file-archive-o: "\f1c6"; +@fa-var-file-audio-o: "\f1c7"; +@fa-var-file-code-o: "\f1c9"; +@fa-var-file-excel-o: "\f1c3"; +@fa-var-file-image-o: "\f1c5"; +@fa-var-file-movie-o: "\f1c8"; +@fa-var-file-o: "\f016"; +@fa-var-file-pdf-o: "\f1c1"; +@fa-var-file-photo-o: "\f1c5"; +@fa-var-file-picture-o: "\f1c5"; +@fa-var-file-powerpoint-o: "\f1c4"; +@fa-var-file-sound-o: "\f1c7"; +@fa-var-file-text: "\f15c"; +@fa-var-file-text-o: "\f0f6"; +@fa-var-file-video-o: "\f1c8"; +@fa-var-file-word-o: "\f1c2"; +@fa-var-file-zip-o: "\f1c6"; +@fa-var-files-o: "\f0c5"; +@fa-var-film: "\f008"; +@fa-var-filter: "\f0b0"; +@fa-var-fire: "\f06d"; +@fa-var-fire-extinguisher: "\f134"; +@fa-var-firefox: "\f269"; +@fa-var-first-order: "\f2b0"; +@fa-var-flag: "\f024"; +@fa-var-flag-checkered: "\f11e"; +@fa-var-flag-o: "\f11d"; +@fa-var-flash: "\f0e7"; +@fa-var-flask: "\f0c3"; +@fa-var-flickr: "\f16e"; +@fa-var-floppy-o: "\f0c7"; +@fa-var-folder: "\f07b"; +@fa-var-folder-o: "\f114"; +@fa-var-folder-open: "\f07c"; +@fa-var-folder-open-o: "\f115"; +@fa-var-font: "\f031"; +@fa-var-font-awesome: "\f2b4"; +@fa-var-fonticons: "\f280"; +@fa-var-fort-awesome: "\f286"; +@fa-var-forumbee: "\f211"; +@fa-var-forward: "\f04e"; +@fa-var-foursquare: "\f180"; +@fa-var-free-code-camp: "\f2c5"; +@fa-var-frown-o: "\f119"; +@fa-var-futbol-o: "\f1e3"; +@fa-var-gamepad: "\f11b"; +@fa-var-gavel: "\f0e3"; +@fa-var-gbp: "\f154"; +@fa-var-ge: "\f1d1"; +@fa-var-gear: "\f013"; +@fa-var-gears: "\f085"; +@fa-var-genderless: "\f22d"; +@fa-var-get-pocket: "\f265"; +@fa-var-gg: "\f260"; +@fa-var-gg-circle: "\f261"; +@fa-var-gift: "\f06b"; +@fa-var-git: "\f1d3"; +@fa-var-git-square: "\f1d2"; +@fa-var-github: "\f09b"; +@fa-var-github-alt: "\f113"; +@fa-var-github-square: "\f092"; +@fa-var-gitlab: "\f296"; +@fa-var-gittip: "\f184"; +@fa-var-glass: "\f000"; +@fa-var-glide: "\f2a5"; +@fa-var-glide-g: "\f2a6"; +@fa-var-globe: "\f0ac"; +@fa-var-google: "\f1a0"; +@fa-var-google-plus: "\f0d5"; +@fa-var-google-plus-circle: "\f2b3"; +@fa-var-google-plus-official: "\f2b3"; +@fa-var-google-plus-square: "\f0d4"; +@fa-var-google-wallet: "\f1ee"; +@fa-var-graduation-cap: "\f19d"; +@fa-var-gratipay: "\f184"; +@fa-var-grav: "\f2d6"; +@fa-var-group: "\f0c0"; +@fa-var-h-square: "\f0fd"; +@fa-var-hacker-news: "\f1d4"; +@fa-var-hand-grab-o: "\f255"; +@fa-var-hand-lizard-o: "\f258"; +@fa-var-hand-o-down: "\f0a7"; +@fa-var-hand-o-left: "\f0a5"; +@fa-var-hand-o-right: "\f0a4"; +@fa-var-hand-o-up: "\f0a6"; +@fa-var-hand-paper-o: "\f256"; +@fa-var-hand-peace-o: "\f25b"; +@fa-var-hand-pointer-o: "\f25a"; +@fa-var-hand-rock-o: "\f255"; +@fa-var-hand-scissors-o: "\f257"; +@fa-var-hand-spock-o: "\f259"; +@fa-var-hand-stop-o: "\f256"; +@fa-var-handshake-o: "\f2b5"; +@fa-var-hard-of-hearing: "\f2a4"; +@fa-var-hashtag: "\f292"; +@fa-var-hdd-o: "\f0a0"; +@fa-var-header: "\f1dc"; +@fa-var-headphones: "\f025"; +@fa-var-heart: "\f004"; +@fa-var-heart-o: "\f08a"; +@fa-var-heartbeat: "\f21e"; +@fa-var-history: "\f1da"; +@fa-var-home: "\f015"; +@fa-var-hospital-o: "\f0f8"; +@fa-var-hotel: "\f236"; +@fa-var-hourglass: "\f254"; +@fa-var-hourglass-1: "\f251"; +@fa-var-hourglass-2: "\f252"; +@fa-var-hourglass-3: "\f253"; +@fa-var-hourglass-end: "\f253"; +@fa-var-hourglass-half: "\f252"; +@fa-var-hourglass-o: "\f250"; +@fa-var-hourglass-start: "\f251"; +@fa-var-houzz: "\f27c"; +@fa-var-html5: "\f13b"; +@fa-var-i-cursor: "\f246"; +@fa-var-id-badge: "\f2c1"; +@fa-var-id-card: "\f2c2"; +@fa-var-id-card-o: "\f2c3"; +@fa-var-ils: "\f20b"; +@fa-var-image: "\f03e"; +@fa-var-imdb: "\f2d8"; +@fa-var-inbox: "\f01c"; +@fa-var-indent: "\f03c"; +@fa-var-industry: "\f275"; +@fa-var-info: "\f129"; +@fa-var-info-circle: "\f05a"; +@fa-var-inr: "\f156"; +@fa-var-instagram: "\f16d"; +@fa-var-institution: "\f19c"; +@fa-var-internet-explorer: "\f26b"; +@fa-var-intersex: "\f224"; +@fa-var-ioxhost: "\f208"; +@fa-var-italic: "\f033"; +@fa-var-joomla: "\f1aa"; +@fa-var-jpy: "\f157"; +@fa-var-jsfiddle: "\f1cc"; +@fa-var-key: "\f084"; +@fa-var-keyboard-o: "\f11c"; +@fa-var-krw: "\f159"; +@fa-var-language: "\f1ab"; +@fa-var-laptop: "\f109"; +@fa-var-lastfm: "\f202"; +@fa-var-lastfm-square: "\f203"; +@fa-var-leaf: "\f06c"; +@fa-var-leanpub: "\f212"; +@fa-var-legal: "\f0e3"; +@fa-var-lemon-o: "\f094"; +@fa-var-level-down: "\f149"; +@fa-var-level-up: "\f148"; +@fa-var-life-bouy: "\f1cd"; +@fa-var-life-buoy: "\f1cd"; +@fa-var-life-ring: "\f1cd"; +@fa-var-life-saver: "\f1cd"; +@fa-var-lightbulb-o: "\f0eb"; +@fa-var-line-chart: "\f201"; +@fa-var-link: "\f0c1"; +@fa-var-linkedin: "\f0e1"; +@fa-var-linkedin-square: "\f08c"; +@fa-var-linode: "\f2b8"; +@fa-var-linux: "\f17c"; +@fa-var-list: "\f03a"; +@fa-var-list-alt: "\f022"; +@fa-var-list-ol: "\f0cb"; +@fa-var-list-ul: "\f0ca"; +@fa-var-location-arrow: "\f124"; +@fa-var-lock: "\f023"; +@fa-var-long-arrow-down: "\f175"; +@fa-var-long-arrow-left: "\f177"; +@fa-var-long-arrow-right: "\f178"; +@fa-var-long-arrow-up: "\f176"; +@fa-var-low-vision: "\f2a8"; +@fa-var-magic: "\f0d0"; +@fa-var-magnet: "\f076"; +@fa-var-mail-forward: "\f064"; +@fa-var-mail-reply: "\f112"; +@fa-var-mail-reply-all: "\f122"; +@fa-var-male: "\f183"; +@fa-var-map: "\f279"; +@fa-var-map-marker: "\f041"; +@fa-var-map-o: "\f278"; +@fa-var-map-pin: "\f276"; +@fa-var-map-signs: "\f277"; +@fa-var-mars: "\f222"; +@fa-var-mars-double: "\f227"; +@fa-var-mars-stroke: "\f229"; +@fa-var-mars-stroke-h: "\f22b"; +@fa-var-mars-stroke-v: "\f22a"; +@fa-var-maxcdn: "\f136"; +@fa-var-meanpath: "\f20c"; +@fa-var-medium: "\f23a"; +@fa-var-medkit: "\f0fa"; +@fa-var-meetup: "\f2e0"; +@fa-var-meh-o: "\f11a"; +@fa-var-mercury: "\f223"; +@fa-var-microchip: "\f2db"; +@fa-var-microphone: "\f130"; +@fa-var-microphone-slash: "\f131"; +@fa-var-minus: "\f068"; +@fa-var-minus-circle: "\f056"; +@fa-var-minus-square: "\f146"; +@fa-var-minus-square-o: "\f147"; +@fa-var-mixcloud: "\f289"; +@fa-var-mobile: "\f10b"; +@fa-var-mobile-phone: "\f10b"; +@fa-var-modx: "\f285"; +@fa-var-money: "\f0d6"; +@fa-var-moon-o: "\f186"; +@fa-var-mortar-board: "\f19d"; +@fa-var-motorcycle: "\f21c"; +@fa-var-mouse-pointer: "\f245"; +@fa-var-music: "\f001"; +@fa-var-navicon: "\f0c9"; +@fa-var-neuter: "\f22c"; +@fa-var-newspaper-o: "\f1ea"; +@fa-var-object-group: "\f247"; +@fa-var-object-ungroup: "\f248"; +@fa-var-odnoklassniki: "\f263"; +@fa-var-odnoklassniki-square: "\f264"; +@fa-var-opencart: "\f23d"; +@fa-var-openid: "\f19b"; +@fa-var-opera: "\f26a"; +@fa-var-optin-monster: "\f23c"; +@fa-var-outdent: "\f03b"; +@fa-var-pagelines: "\f18c"; +@fa-var-paint-brush: "\f1fc"; +@fa-var-paper-plane: "\f1d8"; +@fa-var-paper-plane-o: "\f1d9"; +@fa-var-paperclip: "\f0c6"; +@fa-var-paragraph: "\f1dd"; +@fa-var-paste: "\f0ea"; +@fa-var-pause: "\f04c"; +@fa-var-pause-circle: "\f28b"; +@fa-var-pause-circle-o: "\f28c"; +@fa-var-paw: "\f1b0"; +@fa-var-paypal: "\f1ed"; +@fa-var-pencil: "\f040"; +@fa-var-pencil-square: "\f14b"; +@fa-var-pencil-square-o: "\f044"; +@fa-var-percent: "\f295"; +@fa-var-phone: "\f095"; +@fa-var-phone-square: "\f098"; +@fa-var-photo: "\f03e"; +@fa-var-picture-o: "\f03e"; +@fa-var-pie-chart: "\f200"; +@fa-var-pied-piper: "\f2ae"; +@fa-var-pied-piper-alt: "\f1a8"; +@fa-var-pied-piper-pp: "\f1a7"; +@fa-var-pinterest: "\f0d2"; +@fa-var-pinterest-p: "\f231"; +@fa-var-pinterest-square: "\f0d3"; +@fa-var-plane: "\f072"; +@fa-var-play: "\f04b"; +@fa-var-play-circle: "\f144"; +@fa-var-play-circle-o: "\f01d"; +@fa-var-plug: "\f1e6"; +@fa-var-plus: "\f067"; +@fa-var-plus-circle: "\f055"; +@fa-var-plus-square: "\f0fe"; +@fa-var-plus-square-o: "\f196"; +@fa-var-podcast: "\f2ce"; +@fa-var-power-off: "\f011"; +@fa-var-print: "\f02f"; +@fa-var-product-hunt: "\f288"; +@fa-var-puzzle-piece: "\f12e"; +@fa-var-qq: "\f1d6"; +@fa-var-qrcode: "\f029"; +@fa-var-question: "\f128"; +@fa-var-question-circle: "\f059"; +@fa-var-question-circle-o: "\f29c"; +@fa-var-quora: "\f2c4"; +@fa-var-quote-left: "\f10d"; +@fa-var-quote-right: "\f10e"; +@fa-var-ra: "\f1d0"; +@fa-var-random: "\f074"; +@fa-var-ravelry: "\f2d9"; +@fa-var-rebel: "\f1d0"; +@fa-var-recycle: "\f1b8"; +@fa-var-reddit: "\f1a1"; +@fa-var-reddit-alien: "\f281"; +@fa-var-reddit-square: "\f1a2"; +@fa-var-refresh: "\f021"; +@fa-var-registered: "\f25d"; +@fa-var-remove: "\f00d"; +@fa-var-renren: "\f18b"; +@fa-var-reorder: "\f0c9"; +@fa-var-repeat: "\f01e"; +@fa-var-reply: "\f112"; +@fa-var-reply-all: "\f122"; +@fa-var-resistance: "\f1d0"; +@fa-var-retweet: "\f079"; +@fa-var-rmb: "\f157"; +@fa-var-road: "\f018"; +@fa-var-rocket: "\f135"; +@fa-var-rotate-left: "\f0e2"; +@fa-var-rotate-right: "\f01e"; +@fa-var-rouble: "\f158"; +@fa-var-rss: "\f09e"; +@fa-var-rss-square: "\f143"; +@fa-var-rub: "\f158"; +@fa-var-ruble: "\f158"; +@fa-var-rupee: "\f156"; +@fa-var-s15: "\f2cd"; +@fa-var-safari: "\f267"; +@fa-var-save: "\f0c7"; +@fa-var-scissors: "\f0c4"; +@fa-var-scribd: "\f28a"; +@fa-var-search: "\f002"; +@fa-var-search-minus: "\f010"; +@fa-var-search-plus: "\f00e"; +@fa-var-sellsy: "\f213"; +@fa-var-send: "\f1d8"; +@fa-var-send-o: "\f1d9"; +@fa-var-server: "\f233"; +@fa-var-share: "\f064"; +@fa-var-share-alt: "\f1e0"; +@fa-var-share-alt-square: "\f1e1"; +@fa-var-share-square: "\f14d"; +@fa-var-share-square-o: "\f045"; +@fa-var-shekel: "\f20b"; +@fa-var-sheqel: "\f20b"; +@fa-var-shield: "\f132"; +@fa-var-ship: "\f21a"; +@fa-var-shirtsinbulk: "\f214"; +@fa-var-shopping-bag: "\f290"; +@fa-var-shopping-basket: "\f291"; +@fa-var-shopping-cart: "\f07a"; +@fa-var-shower: "\f2cc"; +@fa-var-sign-in: "\f090"; +@fa-var-sign-language: "\f2a7"; +@fa-var-sign-out: "\f08b"; +@fa-var-signal: "\f012"; +@fa-var-signing: "\f2a7"; +@fa-var-simplybuilt: "\f215"; +@fa-var-sitemap: "\f0e8"; +@fa-var-skyatlas: "\f216"; +@fa-var-skype: "\f17e"; +@fa-var-slack: "\f198"; +@fa-var-sliders: "\f1de"; +@fa-var-slideshare: "\f1e7"; +@fa-var-smile-o: "\f118"; +@fa-var-snapchat: "\f2ab"; +@fa-var-snapchat-ghost: "\f2ac"; +@fa-var-snapchat-square: "\f2ad"; +@fa-var-snowflake-o: "\f2dc"; +@fa-var-soccer-ball-o: "\f1e3"; +@fa-var-sort: "\f0dc"; +@fa-var-sort-alpha-asc: "\f15d"; +@fa-var-sort-alpha-desc: "\f15e"; +@fa-var-sort-amount-asc: "\f160"; +@fa-var-sort-amount-desc: "\f161"; +@fa-var-sort-asc: "\f0de"; +@fa-var-sort-desc: "\f0dd"; +@fa-var-sort-down: "\f0dd"; +@fa-var-sort-numeric-asc: "\f162"; +@fa-var-sort-numeric-desc: "\f163"; +@fa-var-sort-up: "\f0de"; +@fa-var-soundcloud: "\f1be"; +@fa-var-space-shuttle: "\f197"; +@fa-var-spinner: "\f110"; +@fa-var-spoon: "\f1b1"; +@fa-var-spotify: "\f1bc"; +@fa-var-square: "\f0c8"; +@fa-var-square-o: "\f096"; +@fa-var-stack-exchange: "\f18d"; +@fa-var-stack-overflow: "\f16c"; +@fa-var-star: "\f005"; +@fa-var-star-half: "\f089"; +@fa-var-star-half-empty: "\f123"; +@fa-var-star-half-full: "\f123"; +@fa-var-star-half-o: "\f123"; +@fa-var-star-o: "\f006"; +@fa-var-steam: "\f1b6"; +@fa-var-steam-square: "\f1b7"; +@fa-var-step-backward: "\f048"; +@fa-var-step-forward: "\f051"; +@fa-var-stethoscope: "\f0f1"; +@fa-var-sticky-note: "\f249"; +@fa-var-sticky-note-o: "\f24a"; +@fa-var-stop: "\f04d"; +@fa-var-stop-circle: "\f28d"; +@fa-var-stop-circle-o: "\f28e"; +@fa-var-street-view: "\f21d"; +@fa-var-strikethrough: "\f0cc"; +@fa-var-stumbleupon: "\f1a4"; +@fa-var-stumbleupon-circle: "\f1a3"; +@fa-var-subscript: "\f12c"; +@fa-var-subway: "\f239"; +@fa-var-suitcase: "\f0f2"; +@fa-var-sun-o: "\f185"; +@fa-var-superpowers: "\f2dd"; +@fa-var-superscript: "\f12b"; +@fa-var-support: "\f1cd"; +@fa-var-table: "\f0ce"; +@fa-var-tablet: "\f10a"; +@fa-var-tachometer: "\f0e4"; +@fa-var-tag: "\f02b"; +@fa-var-tags: "\f02c"; +@fa-var-tasks: "\f0ae"; +@fa-var-taxi: "\f1ba"; +@fa-var-telegram: "\f2c6"; +@fa-var-television: "\f26c"; +@fa-var-tencent-weibo: "\f1d5"; +@fa-var-terminal: "\f120"; +@fa-var-text-height: "\f034"; +@fa-var-text-width: "\f035"; +@fa-var-th: "\f00a"; +@fa-var-th-large: "\f009"; +@fa-var-th-list: "\f00b"; +@fa-var-themeisle: "\f2b2"; +@fa-var-thermometer: "\f2c7"; +@fa-var-thermometer-0: "\f2cb"; +@fa-var-thermometer-1: "\f2ca"; +@fa-var-thermometer-2: "\f2c9"; +@fa-var-thermometer-3: "\f2c8"; +@fa-var-thermometer-4: "\f2c7"; +@fa-var-thermometer-empty: "\f2cb"; +@fa-var-thermometer-full: "\f2c7"; +@fa-var-thermometer-half: "\f2c9"; +@fa-var-thermometer-quarter: "\f2ca"; +@fa-var-thermometer-three-quarters: "\f2c8"; +@fa-var-thumb-tack: "\f08d"; +@fa-var-thumbs-down: "\f165"; +@fa-var-thumbs-o-down: "\f088"; +@fa-var-thumbs-o-up: "\f087"; +@fa-var-thumbs-up: "\f164"; +@fa-var-ticket: "\f145"; +@fa-var-times: "\f00d"; +@fa-var-times-circle: "\f057"; +@fa-var-times-circle-o: "\f05c"; +@fa-var-times-rectangle: "\f2d3"; +@fa-var-times-rectangle-o: "\f2d4"; +@fa-var-tint: "\f043"; +@fa-var-toggle-down: "\f150"; +@fa-var-toggle-left: "\f191"; +@fa-var-toggle-off: "\f204"; +@fa-var-toggle-on: "\f205"; +@fa-var-toggle-right: "\f152"; +@fa-var-toggle-up: "\f151"; +@fa-var-trademark: "\f25c"; +@fa-var-train: "\f238"; +@fa-var-transgender: "\f224"; +@fa-var-transgender-alt: "\f225"; +@fa-var-trash: "\f1f8"; +@fa-var-trash-o: "\f014"; +@fa-var-tree: "\f1bb"; +@fa-var-trello: "\f181"; +@fa-var-tripadvisor: "\f262"; +@fa-var-trophy: "\f091"; +@fa-var-truck: "\f0d1"; +@fa-var-try: "\f195"; +@fa-var-tty: "\f1e4"; +@fa-var-tumblr: "\f173"; +@fa-var-tumblr-square: "\f174"; +@fa-var-turkish-lira: "\f195"; +@fa-var-tv: "\f26c"; +@fa-var-twitch: "\f1e8"; +@fa-var-twitter: "\f099"; +@fa-var-twitter-square: "\f081"; +@fa-var-umbrella: "\f0e9"; +@fa-var-underline: "\f0cd"; +@fa-var-undo: "\f0e2"; +@fa-var-universal-access: "\f29a"; +@fa-var-university: "\f19c"; +@fa-var-unlink: "\f127"; +@fa-var-unlock: "\f09c"; +@fa-var-unlock-alt: "\f13e"; +@fa-var-unsorted: "\f0dc"; +@fa-var-upload: "\f093"; +@fa-var-usb: "\f287"; +@fa-var-usd: "\f155"; +@fa-var-user: "\f007"; +@fa-var-user-circle: "\f2bd"; +@fa-var-user-circle-o: "\f2be"; +@fa-var-user-md: "\f0f0"; +@fa-var-user-o: "\f2c0"; +@fa-var-user-plus: "\f234"; +@fa-var-user-secret: "\f21b"; +@fa-var-user-times: "\f235"; +@fa-var-users: "\f0c0"; +@fa-var-vcard: "\f2bb"; +@fa-var-vcard-o: "\f2bc"; +@fa-var-venus: "\f221"; +@fa-var-venus-double: "\f226"; +@fa-var-venus-mars: "\f228"; +@fa-var-viacoin: "\f237"; +@fa-var-viadeo: "\f2a9"; +@fa-var-viadeo-square: "\f2aa"; +@fa-var-video-camera: "\f03d"; +@fa-var-vimeo: "\f27d"; +@fa-var-vimeo-square: "\f194"; +@fa-var-vine: "\f1ca"; +@fa-var-vk: "\f189"; +@fa-var-volume-control-phone: "\f2a0"; +@fa-var-volume-down: "\f027"; +@fa-var-volume-off: "\f026"; +@fa-var-volume-up: "\f028"; +@fa-var-warning: "\f071"; +@fa-var-wechat: "\f1d7"; +@fa-var-weibo: "\f18a"; +@fa-var-weixin: "\f1d7"; +@fa-var-whatsapp: "\f232"; +@fa-var-wheelchair: "\f193"; +@fa-var-wheelchair-alt: "\f29b"; +@fa-var-wifi: "\f1eb"; +@fa-var-wikipedia-w: "\f266"; +@fa-var-window-close: "\f2d3"; +@fa-var-window-close-o: "\f2d4"; +@fa-var-window-maximize: "\f2d0"; +@fa-var-window-minimize: "\f2d1"; +@fa-var-window-restore: "\f2d2"; +@fa-var-windows: "\f17a"; +@fa-var-won: "\f159"; +@fa-var-wordpress: "\f19a"; +@fa-var-wpbeginner: "\f297"; +@fa-var-wpexplorer: "\f2de"; +@fa-var-wpforms: "\f298"; +@fa-var-wrench: "\f0ad"; +@fa-var-xing: "\f168"; +@fa-var-xing-square: "\f169"; +@fa-var-y-combinator: "\f23b"; +@fa-var-y-combinator-square: "\f1d4"; +@fa-var-yahoo: "\f19e"; +@fa-var-yc: "\f23b"; +@fa-var-yc-square: "\f1d4"; +@fa-var-yelp: "\f1e9"; +@fa-var-yen: "\f157"; +@fa-var-yoast: "\f2b1"; +@fa-var-youtube: "\f167"; +@fa-var-youtube-play: "\f16a"; +@fa-var-youtube-square: "\f166"; + diff --git a/public/fonts/font-awesome-4.7.0/scss/_animated.scss b/public/fonts/font-awesome-4.7.0/scss/_animated.scss new file mode 100755 index 000000000..8a020dbff --- /dev/null +++ b/public/fonts/font-awesome-4.7.0/scss/_animated.scss @@ -0,0 +1,34 @@ +// Spinning Icons +// -------------------------- + +.#{$fa-css-prefix}-spin { + -webkit-animation: fa-spin 2s infinite linear; + animation: fa-spin 2s infinite linear; +} + +.#{$fa-css-prefix}-pulse { + -webkit-animation: fa-spin 1s infinite steps(8); + animation: fa-spin 1s infinite steps(8); +} + +@-webkit-keyframes fa-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} + +@keyframes fa-spin { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(359deg); + transform: rotate(359deg); + } +} diff --git a/public/fonts/font-awesome-4.7.0/scss/_bordered-pulled.scss b/public/fonts/font-awesome-4.7.0/scss/_bordered-pulled.scss new file mode 100755 index 000000000..d4b85a02f --- /dev/null +++ b/public/fonts/font-awesome-4.7.0/scss/_bordered-pulled.scss @@ -0,0 +1,25 @@ +// Bordered & Pulled +// ------------------------- + +.#{$fa-css-prefix}-border { + padding: .2em .25em .15em; + border: solid .08em $fa-border-color; + border-radius: .1em; +} + +.#{$fa-css-prefix}-pull-left { float: left; } +.#{$fa-css-prefix}-pull-right { float: right; } + +.#{$fa-css-prefix} { + &.#{$fa-css-prefix}-pull-left { margin-right: .3em; } + &.#{$fa-css-prefix}-pull-right { margin-left: .3em; } +} + +/* Deprecated as of 4.4.0 */ +.pull-right { float: right; } +.pull-left { float: left; } + +.#{$fa-css-prefix} { + &.pull-left { margin-right: .3em; } + &.pull-right { margin-left: .3em; } +} diff --git a/public/fonts/font-awesome-4.7.0/scss/_core.scss b/public/fonts/font-awesome-4.7.0/scss/_core.scss new file mode 100755 index 000000000..7425ef85f --- /dev/null +++ b/public/fonts/font-awesome-4.7.0/scss/_core.scss @@ -0,0 +1,12 @@ +// Base Class Definition +// ------------------------- + +.#{$fa-css-prefix} { + display: inline-block; + font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration + font-size: inherit; // can't have font-size inherit on line above, so need to override + text-rendering: auto; // optimizelegibility throws things off #1094 + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + +} diff --git a/public/fonts/font-awesome-4.7.0/scss/_fixed-width.scss b/public/fonts/font-awesome-4.7.0/scss/_fixed-width.scss new file mode 100755 index 000000000..b221c9813 --- /dev/null +++ b/public/fonts/font-awesome-4.7.0/scss/_fixed-width.scss @@ -0,0 +1,6 @@ +// Fixed Width Icons +// ------------------------- +.#{$fa-css-prefix}-fw { + width: (18em / 14); + text-align: center; +} diff --git a/public/fonts/font-awesome-4.7.0/scss/_icons.scss b/public/fonts/font-awesome-4.7.0/scss/_icons.scss new file mode 100755 index 000000000..e63e702c4 --- /dev/null +++ b/public/fonts/font-awesome-4.7.0/scss/_icons.scss @@ -0,0 +1,789 @@ +/* Font Awesome uses the Unicode Private Use Area (PUA) to ensure screen + readers do not read off random characters that represent icons */ + +.#{$fa-css-prefix}-glass:before { content: $fa-var-glass; } +.#{$fa-css-prefix}-music:before { content: $fa-var-music; } +.#{$fa-css-prefix}-search:before { content: $fa-var-search; } +.#{$fa-css-prefix}-envelope-o:before { content: $fa-var-envelope-o; } +.#{$fa-css-prefix}-heart:before { content: $fa-var-heart; } +.#{$fa-css-prefix}-star:before { content: $fa-var-star; } +.#{$fa-css-prefix}-star-o:before { content: $fa-var-star-o; } +.#{$fa-css-prefix}-user:before { content: $fa-var-user; } +.#{$fa-css-prefix}-film:before { content: $fa-var-film; } +.#{$fa-css-prefix}-th-large:before { content: $fa-var-th-large; } +.#{$fa-css-prefix}-th:before { content: $fa-var-th; } +.#{$fa-css-prefix}-th-list:before { content: $fa-var-th-list; } +.#{$fa-css-prefix}-check:before { content: $fa-var-check; } +.#{$fa-css-prefix}-remove:before, +.#{$fa-css-prefix}-close:before, +.#{$fa-css-prefix}-times:before { content: $fa-var-times; } +.#{$fa-css-prefix}-search-plus:before { content: $fa-var-search-plus; } +.#{$fa-css-prefix}-search-minus:before { content: $fa-var-search-minus; } +.#{$fa-css-prefix}-power-off:before { content: $fa-var-power-off; } +.#{$fa-css-prefix}-signal:before { content: $fa-var-signal; } +.#{$fa-css-prefix}-gear:before, +.#{$fa-css-prefix}-cog:before { content: $fa-var-cog; } +.#{$fa-css-prefix}-trash-o:before { content: $fa-var-trash-o; } +.#{$fa-css-prefix}-home:before { content: $fa-var-home; } +.#{$fa-css-prefix}-file-o:before { content: $fa-var-file-o; } +.#{$fa-css-prefix}-clock-o:before { content: $fa-var-clock-o; } +.#{$fa-css-prefix}-road:before { content: $fa-var-road; } +.#{$fa-css-prefix}-download:before { content: $fa-var-download; } +.#{$fa-css-prefix}-arrow-circle-o-down:before { content: $fa-var-arrow-circle-o-down; } +.#{$fa-css-prefix}-arrow-circle-o-up:before { content: $fa-var-arrow-circle-o-up; } +.#{$fa-css-prefix}-inbox:before { content: $fa-var-inbox; } +.#{$fa-css-prefix}-play-circle-o:before { content: $fa-var-play-circle-o; } +.#{$fa-css-prefix}-rotate-right:before, +.#{$fa-css-prefix}-repeat:before { content: $fa-var-repeat; } +.#{$fa-css-prefix}-refresh:before { content: $fa-var-refresh; } +.#{$fa-css-prefix}-list-alt:before { content: $fa-var-list-alt; } +.#{$fa-css-prefix}-lock:before { content: $fa-var-lock; } +.#{$fa-css-prefix}-flag:before { content: $fa-var-flag; } +.#{$fa-css-prefix}-headphones:before { content: $fa-var-headphones; } +.#{$fa-css-prefix}-volume-off:before { content: $fa-var-volume-off; } +.#{$fa-css-prefix}-volume-down:before { content: $fa-var-volume-down; } +.#{$fa-css-prefix}-volume-up:before { content: $fa-var-volume-up; } +.#{$fa-css-prefix}-qrcode:before { content: $fa-var-qrcode; } +.#{$fa-css-prefix}-barcode:before { content: $fa-var-barcode; } +.#{$fa-css-prefix}-tag:before { content: $fa-var-tag; } +.#{$fa-css-prefix}-tags:before { content: $fa-var-tags; } +.#{$fa-css-prefix}-book:before { content: $fa-var-book; } +.#{$fa-css-prefix}-bookmark:before { content: $fa-var-bookmark; } +.#{$fa-css-prefix}-print:before { content: $fa-var-print; } +.#{$fa-css-prefix}-camera:before { content: $fa-var-camera; } +.#{$fa-css-prefix}-font:before { content: $fa-var-font; } +.#{$fa-css-prefix}-bold:before { content: $fa-var-bold; } +.#{$fa-css-prefix}-italic:before { content: $fa-var-italic; } +.#{$fa-css-prefix}-text-height:before { content: $fa-var-text-height; } +.#{$fa-css-prefix}-text-width:before { content: $fa-var-text-width; } +.#{$fa-css-prefix}-align-left:before { content: $fa-var-align-left; } +.#{$fa-css-prefix}-align-center:before { content: $fa-var-align-center; } +.#{$fa-css-prefix}-align-right:before { content: $fa-var-align-right; } +.#{$fa-css-prefix}-align-justify:before { content: $fa-var-align-justify; } +.#{$fa-css-prefix}-list:before { content: $fa-var-list; } +.#{$fa-css-prefix}-dedent:before, +.#{$fa-css-prefix}-outdent:before { content: $fa-var-outdent; } +.#{$fa-css-prefix}-indent:before { content: $fa-var-indent; } +.#{$fa-css-prefix}-video-camera:before { content: $fa-var-video-camera; } +.#{$fa-css-prefix}-photo:before, +.#{$fa-css-prefix}-image:before, +.#{$fa-css-prefix}-picture-o:before { content: $fa-var-picture-o; } +.#{$fa-css-prefix}-pencil:before { content: $fa-var-pencil; } +.#{$fa-css-prefix}-map-marker:before { content: $fa-var-map-marker; } +.#{$fa-css-prefix}-adjust:before { content: $fa-var-adjust; } +.#{$fa-css-prefix}-tint:before { content: $fa-var-tint; } +.#{$fa-css-prefix}-edit:before, +.#{$fa-css-prefix}-pencil-square-o:before { content: $fa-var-pencil-square-o; } +.#{$fa-css-prefix}-share-square-o:before { content: $fa-var-share-square-o; } +.#{$fa-css-prefix}-check-square-o:before { content: $fa-var-check-square-o; } +.#{$fa-css-prefix}-arrows:before { content: $fa-var-arrows; } +.#{$fa-css-prefix}-step-backward:before { content: $fa-var-step-backward; } +.#{$fa-css-prefix}-fast-backward:before { content: $fa-var-fast-backward; } +.#{$fa-css-prefix}-backward:before { content: $fa-var-backward; } +.#{$fa-css-prefix}-play:before { content: $fa-var-play; } +.#{$fa-css-prefix}-pause:before { content: $fa-var-pause; } +.#{$fa-css-prefix}-stop:before { content: $fa-var-stop; } +.#{$fa-css-prefix}-forward:before { content: $fa-var-forward; } +.#{$fa-css-prefix}-fast-forward:before { content: $fa-var-fast-forward; } +.#{$fa-css-prefix}-step-forward:before { content: $fa-var-step-forward; } +.#{$fa-css-prefix}-eject:before { content: $fa-var-eject; } +.#{$fa-css-prefix}-chevron-left:before { content: $fa-var-chevron-left; } +.#{$fa-css-prefix}-chevron-right:before { content: $fa-var-chevron-right; } +.#{$fa-css-prefix}-plus-circle:before { content: $fa-var-plus-circle; } +.#{$fa-css-prefix}-minus-circle:before { content: $fa-var-minus-circle; } +.#{$fa-css-prefix}-times-circle:before { content: $fa-var-times-circle; } +.#{$fa-css-prefix}-check-circle:before { content: $fa-var-check-circle; } +.#{$fa-css-prefix}-question-circle:before { content: $fa-var-question-circle; } +.#{$fa-css-prefix}-info-circle:before { content: $fa-var-info-circle; } +.#{$fa-css-prefix}-crosshairs:before { content: $fa-var-crosshairs; } +.#{$fa-css-prefix}-times-circle-o:before { content: $fa-var-times-circle-o; } +.#{$fa-css-prefix}-check-circle-o:before { content: $fa-var-check-circle-o; } +.#{$fa-css-prefix}-ban:before { content: $fa-var-ban; } +.#{$fa-css-prefix}-arrow-left:before { content: $fa-var-arrow-left; } +.#{$fa-css-prefix}-arrow-right:before { content: $fa-var-arrow-right; } +.#{$fa-css-prefix}-arrow-up:before { content: $fa-var-arrow-up; } +.#{$fa-css-prefix}-arrow-down:before { content: $fa-var-arrow-down; } +.#{$fa-css-prefix}-mail-forward:before, +.#{$fa-css-prefix}-share:before { content: $fa-var-share; } +.#{$fa-css-prefix}-expand:before { content: $fa-var-expand; } +.#{$fa-css-prefix}-compress:before { content: $fa-var-compress; } +.#{$fa-css-prefix}-plus:before { content: $fa-var-plus; } +.#{$fa-css-prefix}-minus:before { content: $fa-var-minus; } +.#{$fa-css-prefix}-asterisk:before { content: $fa-var-asterisk; } +.#{$fa-css-prefix}-exclamation-circle:before { content: $fa-var-exclamation-circle; } +.#{$fa-css-prefix}-gift:before { content: $fa-var-gift; } +.#{$fa-css-prefix}-leaf:before { content: $fa-var-leaf; } +.#{$fa-css-prefix}-fire:before { content: $fa-var-fire; } +.#{$fa-css-prefix}-eye:before { content: $fa-var-eye; } +.#{$fa-css-prefix}-eye-slash:before { content: $fa-var-eye-slash; } +.#{$fa-css-prefix}-warning:before, +.#{$fa-css-prefix}-exclamation-triangle:before { content: $fa-var-exclamation-triangle; } +.#{$fa-css-prefix}-plane:before { content: $fa-var-plane; } +.#{$fa-css-prefix}-calendar:before { content: $fa-var-calendar; } +.#{$fa-css-prefix}-random:before { content: $fa-var-random; } +.#{$fa-css-prefix}-comment:before { content: $fa-var-comment; } +.#{$fa-css-prefix}-magnet:before { content: $fa-var-magnet; } +.#{$fa-css-prefix}-chevron-up:before { content: $fa-var-chevron-up; } +.#{$fa-css-prefix}-chevron-down:before { content: $fa-var-chevron-down; } +.#{$fa-css-prefix}-retweet:before { content: $fa-var-retweet; } +.#{$fa-css-prefix}-shopping-cart:before { content: $fa-var-shopping-cart; } +.#{$fa-css-prefix}-folder:before { content: $fa-var-folder; } +.#{$fa-css-prefix}-folder-open:before { content: $fa-var-folder-open; } +.#{$fa-css-prefix}-arrows-v:before { content: $fa-var-arrows-v; } +.#{$fa-css-prefix}-arrows-h:before { content: $fa-var-arrows-h; } +.#{$fa-css-prefix}-bar-chart-o:before, +.#{$fa-css-prefix}-bar-chart:before { content: $fa-var-bar-chart; } +.#{$fa-css-prefix}-twitter-square:before { content: $fa-var-twitter-square; } +.#{$fa-css-prefix}-facebook-square:before { content: $fa-var-facebook-square; } +.#{$fa-css-prefix}-camera-retro:before { content: $fa-var-camera-retro; } +.#{$fa-css-prefix}-key:before { content: $fa-var-key; } +.#{$fa-css-prefix}-gears:before, +.#{$fa-css-prefix}-cogs:before { content: $fa-var-cogs; } +.#{$fa-css-prefix}-comments:before { content: $fa-var-comments; } +.#{$fa-css-prefix}-thumbs-o-up:before { content: $fa-var-thumbs-o-up; } +.#{$fa-css-prefix}-thumbs-o-down:before { content: $fa-var-thumbs-o-down; } +.#{$fa-css-prefix}-star-half:before { content: $fa-var-star-half; } +.#{$fa-css-prefix}-heart-o:before { content: $fa-var-heart-o; } +.#{$fa-css-prefix}-sign-out:before { content: $fa-var-sign-out; } +.#{$fa-css-prefix}-linkedin-square:before { content: $fa-var-linkedin-square; } +.#{$fa-css-prefix}-thumb-tack:before { content: $fa-var-thumb-tack; } +.#{$fa-css-prefix}-external-link:before { content: $fa-var-external-link; } +.#{$fa-css-prefix}-sign-in:before { content: $fa-var-sign-in; } +.#{$fa-css-prefix}-trophy:before { content: $fa-var-trophy; } +.#{$fa-css-prefix}-github-square:before { content: $fa-var-github-square; } +.#{$fa-css-prefix}-upload:before { content: $fa-var-upload; } +.#{$fa-css-prefix}-lemon-o:before { content: $fa-var-lemon-o; } +.#{$fa-css-prefix}-phone:before { content: $fa-var-phone; } +.#{$fa-css-prefix}-square-o:before { content: $fa-var-square-o; } +.#{$fa-css-prefix}-bookmark-o:before { content: $fa-var-bookmark-o; } +.#{$fa-css-prefix}-phone-square:before { content: $fa-var-phone-square; } +.#{$fa-css-prefix}-twitter:before { content: $fa-var-twitter; } +.#{$fa-css-prefix}-facebook-f:before, +.#{$fa-css-prefix}-facebook:before { content: $fa-var-facebook; } +.#{$fa-css-prefix}-github:before { content: $fa-var-github; } +.#{$fa-css-prefix}-unlock:before { content: $fa-var-unlock; } +.#{$fa-css-prefix}-credit-card:before { content: $fa-var-credit-card; } +.#{$fa-css-prefix}-feed:before, +.#{$fa-css-prefix}-rss:before { content: $fa-var-rss; } +.#{$fa-css-prefix}-hdd-o:before { content: $fa-var-hdd-o; } +.#{$fa-css-prefix}-bullhorn:before { content: $fa-var-bullhorn; } +.#{$fa-css-prefix}-bell:before { content: $fa-var-bell; } +.#{$fa-css-prefix}-certificate:before { content: $fa-var-certificate; } +.#{$fa-css-prefix}-hand-o-right:before { content: $fa-var-hand-o-right; } +.#{$fa-css-prefix}-hand-o-left:before { content: $fa-var-hand-o-left; } +.#{$fa-css-prefix}-hand-o-up:before { content: $fa-var-hand-o-up; } +.#{$fa-css-prefix}-hand-o-down:before { content: $fa-var-hand-o-down; } +.#{$fa-css-prefix}-arrow-circle-left:before { content: $fa-var-arrow-circle-left; } +.#{$fa-css-prefix}-arrow-circle-right:before { content: $fa-var-arrow-circle-right; } +.#{$fa-css-prefix}-arrow-circle-up:before { content: $fa-var-arrow-circle-up; } +.#{$fa-css-prefix}-arrow-circle-down:before { content: $fa-var-arrow-circle-down; } +.#{$fa-css-prefix}-globe:before { content: $fa-var-globe; } +.#{$fa-css-prefix}-wrench:before { content: $fa-var-wrench; } +.#{$fa-css-prefix}-tasks:before { content: $fa-var-tasks; } +.#{$fa-css-prefix}-filter:before { content: $fa-var-filter; } +.#{$fa-css-prefix}-briefcase:before { content: $fa-var-briefcase; } +.#{$fa-css-prefix}-arrows-alt:before { content: $fa-var-arrows-alt; } +.#{$fa-css-prefix}-group:before, +.#{$fa-css-prefix}-users:before { content: $fa-var-users; } +.#{$fa-css-prefix}-chain:before, +.#{$fa-css-prefix}-link:before { content: $fa-var-link; } +.#{$fa-css-prefix}-cloud:before { content: $fa-var-cloud; } +.#{$fa-css-prefix}-flask:before { content: $fa-var-flask; } +.#{$fa-css-prefix}-cut:before, +.#{$fa-css-prefix}-scissors:before { content: $fa-var-scissors; } +.#{$fa-css-prefix}-copy:before, +.#{$fa-css-prefix}-files-o:before { content: $fa-var-files-o; } +.#{$fa-css-prefix}-paperclip:before { content: $fa-var-paperclip; } +.#{$fa-css-prefix}-save:before, +.#{$fa-css-prefix}-floppy-o:before { content: $fa-var-floppy-o; } +.#{$fa-css-prefix}-square:before { content: $fa-var-square; } +.#{$fa-css-prefix}-navicon:before, +.#{$fa-css-prefix}-reorder:before, +.#{$fa-css-prefix}-bars:before { content: $fa-var-bars; } +.#{$fa-css-prefix}-list-ul:before { content: $fa-var-list-ul; } +.#{$fa-css-prefix}-list-ol:before { content: $fa-var-list-ol; } +.#{$fa-css-prefix}-strikethrough:before { content: $fa-var-strikethrough; } +.#{$fa-css-prefix}-underline:before { content: $fa-var-underline; } +.#{$fa-css-prefix}-table:before { content: $fa-var-table; } +.#{$fa-css-prefix}-magic:before { content: $fa-var-magic; } +.#{$fa-css-prefix}-truck:before { content: $fa-var-truck; } +.#{$fa-css-prefix}-pinterest:before { content: $fa-var-pinterest; } +.#{$fa-css-prefix}-pinterest-square:before { content: $fa-var-pinterest-square; } +.#{$fa-css-prefix}-google-plus-square:before { content: $fa-var-google-plus-square; } +.#{$fa-css-prefix}-google-plus:before { content: $fa-var-google-plus; } +.#{$fa-css-prefix}-money:before { content: $fa-var-money; } +.#{$fa-css-prefix}-caret-down:before { content: $fa-var-caret-down; } +.#{$fa-css-prefix}-caret-up:before { content: $fa-var-caret-up; } +.#{$fa-css-prefix}-caret-left:before { content: $fa-var-caret-left; } +.#{$fa-css-prefix}-caret-right:before { content: $fa-var-caret-right; } +.#{$fa-css-prefix}-columns:before { content: $fa-var-columns; } +.#{$fa-css-prefix}-unsorted:before, +.#{$fa-css-prefix}-sort:before { content: $fa-var-sort; } +.#{$fa-css-prefix}-sort-down:before, +.#{$fa-css-prefix}-sort-desc:before { content: $fa-var-sort-desc; } +.#{$fa-css-prefix}-sort-up:before, +.#{$fa-css-prefix}-sort-asc:before { content: $fa-var-sort-asc; } +.#{$fa-css-prefix}-envelope:before { content: $fa-var-envelope; } +.#{$fa-css-prefix}-linkedin:before { content: $fa-var-linkedin; } +.#{$fa-css-prefix}-rotate-left:before, +.#{$fa-css-prefix}-undo:before { content: $fa-var-undo; } +.#{$fa-css-prefix}-legal:before, +.#{$fa-css-prefix}-gavel:before { content: $fa-var-gavel; } +.#{$fa-css-prefix}-dashboard:before, +.#{$fa-css-prefix}-tachometer:before { content: $fa-var-tachometer; } +.#{$fa-css-prefix}-comment-o:before { content: $fa-var-comment-o; } +.#{$fa-css-prefix}-comments-o:before { content: $fa-var-comments-o; } +.#{$fa-css-prefix}-flash:before, +.#{$fa-css-prefix}-bolt:before { content: $fa-var-bolt; } +.#{$fa-css-prefix}-sitemap:before { content: $fa-var-sitemap; } +.#{$fa-css-prefix}-umbrella:before { content: $fa-var-umbrella; } +.#{$fa-css-prefix}-paste:before, +.#{$fa-css-prefix}-clipboard:before { content: $fa-var-clipboard; } +.#{$fa-css-prefix}-lightbulb-o:before { content: $fa-var-lightbulb-o; } +.#{$fa-css-prefix}-exchange:before { content: $fa-var-exchange; } +.#{$fa-css-prefix}-cloud-download:before { content: $fa-var-cloud-download; } +.#{$fa-css-prefix}-cloud-upload:before { content: $fa-var-cloud-upload; } +.#{$fa-css-prefix}-user-md:before { content: $fa-var-user-md; } +.#{$fa-css-prefix}-stethoscope:before { content: $fa-var-stethoscope; } +.#{$fa-css-prefix}-suitcase:before { content: $fa-var-suitcase; } +.#{$fa-css-prefix}-bell-o:before { content: $fa-var-bell-o; } +.#{$fa-css-prefix}-coffee:before { content: $fa-var-coffee; } +.#{$fa-css-prefix}-cutlery:before { content: $fa-var-cutlery; } +.#{$fa-css-prefix}-file-text-o:before { content: $fa-var-file-text-o; } +.#{$fa-css-prefix}-building-o:before { content: $fa-var-building-o; } +.#{$fa-css-prefix}-hospital-o:before { content: $fa-var-hospital-o; } +.#{$fa-css-prefix}-ambulance:before { content: $fa-var-ambulance; } +.#{$fa-css-prefix}-medkit:before { content: $fa-var-medkit; } +.#{$fa-css-prefix}-fighter-jet:before { content: $fa-var-fighter-jet; } +.#{$fa-css-prefix}-beer:before { content: $fa-var-beer; } +.#{$fa-css-prefix}-h-square:before { content: $fa-var-h-square; } +.#{$fa-css-prefix}-plus-square:before { content: $fa-var-plus-square; } +.#{$fa-css-prefix}-angle-double-left:before { content: $fa-var-angle-double-left; } +.#{$fa-css-prefix}-angle-double-right:before { content: $fa-var-angle-double-right; } +.#{$fa-css-prefix}-angle-double-up:before { content: $fa-var-angle-double-up; } +.#{$fa-css-prefix}-angle-double-down:before { content: $fa-var-angle-double-down; } +.#{$fa-css-prefix}-angle-left:before { content: $fa-var-angle-left; } +.#{$fa-css-prefix}-angle-right:before { content: $fa-var-angle-right; } +.#{$fa-css-prefix}-angle-up:before { content: $fa-var-angle-up; } +.#{$fa-css-prefix}-angle-down:before { content: $fa-var-angle-down; } +.#{$fa-css-prefix}-desktop:before { content: $fa-var-desktop; } +.#{$fa-css-prefix}-laptop:before { content: $fa-var-laptop; } +.#{$fa-css-prefix}-tablet:before { content: $fa-var-tablet; } +.#{$fa-css-prefix}-mobile-phone:before, +.#{$fa-css-prefix}-mobile:before { content: $fa-var-mobile; } +.#{$fa-css-prefix}-circle-o:before { content: $fa-var-circle-o; } +.#{$fa-css-prefix}-quote-left:before { content: $fa-var-quote-left; } +.#{$fa-css-prefix}-quote-right:before { content: $fa-var-quote-right; } +.#{$fa-css-prefix}-spinner:before { content: $fa-var-spinner; } +.#{$fa-css-prefix}-circle:before { content: $fa-var-circle; } +.#{$fa-css-prefix}-mail-reply:before, +.#{$fa-css-prefix}-reply:before { content: $fa-var-reply; } +.#{$fa-css-prefix}-github-alt:before { content: $fa-var-github-alt; } +.#{$fa-css-prefix}-folder-o:before { content: $fa-var-folder-o; } +.#{$fa-css-prefix}-folder-open-o:before { content: $fa-var-folder-open-o; } +.#{$fa-css-prefix}-smile-o:before { content: $fa-var-smile-o; } +.#{$fa-css-prefix}-frown-o:before { content: $fa-var-frown-o; } +.#{$fa-css-prefix}-meh-o:before { content: $fa-var-meh-o; } +.#{$fa-css-prefix}-gamepad:before { content: $fa-var-gamepad; } +.#{$fa-css-prefix}-keyboard-o:before { content: $fa-var-keyboard-o; } +.#{$fa-css-prefix}-flag-o:before { content: $fa-var-flag-o; } +.#{$fa-css-prefix}-flag-checkered:before { content: $fa-var-flag-checkered; } +.#{$fa-css-prefix}-terminal:before { content: $fa-var-terminal; } +.#{$fa-css-prefix}-code:before { content: $fa-var-code; } +.#{$fa-css-prefix}-mail-reply-all:before, +.#{$fa-css-prefix}-reply-all:before { content: $fa-var-reply-all; } +.#{$fa-css-prefix}-star-half-empty:before, +.#{$fa-css-prefix}-star-half-full:before, +.#{$fa-css-prefix}-star-half-o:before { content: $fa-var-star-half-o; } +.#{$fa-css-prefix}-location-arrow:before { content: $fa-var-location-arrow; } +.#{$fa-css-prefix}-crop:before { content: $fa-var-crop; } +.#{$fa-css-prefix}-code-fork:before { content: $fa-var-code-fork; } +.#{$fa-css-prefix}-unlink:before, +.#{$fa-css-prefix}-chain-broken:before { content: $fa-var-chain-broken; } +.#{$fa-css-prefix}-question:before { content: $fa-var-question; } +.#{$fa-css-prefix}-info:before { content: $fa-var-info; } +.#{$fa-css-prefix}-exclamation:before { content: $fa-var-exclamation; } +.#{$fa-css-prefix}-superscript:before { content: $fa-var-superscript; } +.#{$fa-css-prefix}-subscript:before { content: $fa-var-subscript; } +.#{$fa-css-prefix}-eraser:before { content: $fa-var-eraser; } +.#{$fa-css-prefix}-puzzle-piece:before { content: $fa-var-puzzle-piece; } +.#{$fa-css-prefix}-microphone:before { content: $fa-var-microphone; } +.#{$fa-css-prefix}-microphone-slash:before { content: $fa-var-microphone-slash; } +.#{$fa-css-prefix}-shield:before { content: $fa-var-shield; } +.#{$fa-css-prefix}-calendar-o:before { content: $fa-var-calendar-o; } +.#{$fa-css-prefix}-fire-extinguisher:before { content: $fa-var-fire-extinguisher; } +.#{$fa-css-prefix}-rocket:before { content: $fa-var-rocket; } +.#{$fa-css-prefix}-maxcdn:before { content: $fa-var-maxcdn; } +.#{$fa-css-prefix}-chevron-circle-left:before { content: $fa-var-chevron-circle-left; } +.#{$fa-css-prefix}-chevron-circle-right:before { content: $fa-var-chevron-circle-right; } +.#{$fa-css-prefix}-chevron-circle-up:before { content: $fa-var-chevron-circle-up; } +.#{$fa-css-prefix}-chevron-circle-down:before { content: $fa-var-chevron-circle-down; } +.#{$fa-css-prefix}-html5:before { content: $fa-var-html5; } +.#{$fa-css-prefix}-css3:before { content: $fa-var-css3; } +.#{$fa-css-prefix}-anchor:before { content: $fa-var-anchor; } +.#{$fa-css-prefix}-unlock-alt:before { content: $fa-var-unlock-alt; } +.#{$fa-css-prefix}-bullseye:before { content: $fa-var-bullseye; } +.#{$fa-css-prefix}-ellipsis-h:before { content: $fa-var-ellipsis-h; } +.#{$fa-css-prefix}-ellipsis-v:before { content: $fa-var-ellipsis-v; } +.#{$fa-css-prefix}-rss-square:before { content: $fa-var-rss-square; } +.#{$fa-css-prefix}-play-circle:before { content: $fa-var-play-circle; } +.#{$fa-css-prefix}-ticket:before { content: $fa-var-ticket; } +.#{$fa-css-prefix}-minus-square:before { content: $fa-var-minus-square; } +.#{$fa-css-prefix}-minus-square-o:before { content: $fa-var-minus-square-o; } +.#{$fa-css-prefix}-level-up:before { content: $fa-var-level-up; } +.#{$fa-css-prefix}-level-down:before { content: $fa-var-level-down; } +.#{$fa-css-prefix}-check-square:before { content: $fa-var-check-square; } +.#{$fa-css-prefix}-pencil-square:before { content: $fa-var-pencil-square; } +.#{$fa-css-prefix}-external-link-square:before { content: $fa-var-external-link-square; } +.#{$fa-css-prefix}-share-square:before { content: $fa-var-share-square; } +.#{$fa-css-prefix}-compass:before { content: $fa-var-compass; } +.#{$fa-css-prefix}-toggle-down:before, +.#{$fa-css-prefix}-caret-square-o-down:before { content: $fa-var-caret-square-o-down; } +.#{$fa-css-prefix}-toggle-up:before, +.#{$fa-css-prefix}-caret-square-o-up:before { content: $fa-var-caret-square-o-up; } +.#{$fa-css-prefix}-toggle-right:before, +.#{$fa-css-prefix}-caret-square-o-right:before { content: $fa-var-caret-square-o-right; } +.#{$fa-css-prefix}-euro:before, +.#{$fa-css-prefix}-eur:before { content: $fa-var-eur; } +.#{$fa-css-prefix}-gbp:before { content: $fa-var-gbp; } +.#{$fa-css-prefix}-dollar:before, +.#{$fa-css-prefix}-usd:before { content: $fa-var-usd; } +.#{$fa-css-prefix}-rupee:before, +.#{$fa-css-prefix}-inr:before { content: $fa-var-inr; } +.#{$fa-css-prefix}-cny:before, +.#{$fa-css-prefix}-rmb:before, +.#{$fa-css-prefix}-yen:before, +.#{$fa-css-prefix}-jpy:before { content: $fa-var-jpy; } +.#{$fa-css-prefix}-ruble:before, +.#{$fa-css-prefix}-rouble:before, +.#{$fa-css-prefix}-rub:before { content: $fa-var-rub; } +.#{$fa-css-prefix}-won:before, +.#{$fa-css-prefix}-krw:before { content: $fa-var-krw; } +.#{$fa-css-prefix}-bitcoin:before, +.#{$fa-css-prefix}-btc:before { content: $fa-var-btc; } +.#{$fa-css-prefix}-file:before { content: $fa-var-file; } +.#{$fa-css-prefix}-file-text:before { content: $fa-var-file-text; } +.#{$fa-css-prefix}-sort-alpha-asc:before { content: $fa-var-sort-alpha-asc; } +.#{$fa-css-prefix}-sort-alpha-desc:before { content: $fa-var-sort-alpha-desc; } +.#{$fa-css-prefix}-sort-amount-asc:before { content: $fa-var-sort-amount-asc; } +.#{$fa-css-prefix}-sort-amount-desc:before { content: $fa-var-sort-amount-desc; } +.#{$fa-css-prefix}-sort-numeric-asc:before { content: $fa-var-sort-numeric-asc; } +.#{$fa-css-prefix}-sort-numeric-desc:before { content: $fa-var-sort-numeric-desc; } +.#{$fa-css-prefix}-thumbs-up:before { content: $fa-var-thumbs-up; } +.#{$fa-css-prefix}-thumbs-down:before { content: $fa-var-thumbs-down; } +.#{$fa-css-prefix}-youtube-square:before { content: $fa-var-youtube-square; } +.#{$fa-css-prefix}-youtube:before { content: $fa-var-youtube; } +.#{$fa-css-prefix}-xing:before { content: $fa-var-xing; } +.#{$fa-css-prefix}-xing-square:before { content: $fa-var-xing-square; } +.#{$fa-css-prefix}-youtube-play:before { content: $fa-var-youtube-play; } +.#{$fa-css-prefix}-dropbox:before { content: $fa-var-dropbox; } +.#{$fa-css-prefix}-stack-overflow:before { content: $fa-var-stack-overflow; } +.#{$fa-css-prefix}-instagram:before { content: $fa-var-instagram; } +.#{$fa-css-prefix}-flickr:before { content: $fa-var-flickr; } +.#{$fa-css-prefix}-adn:before { content: $fa-var-adn; } +.#{$fa-css-prefix}-bitbucket:before { content: $fa-var-bitbucket; } +.#{$fa-css-prefix}-bitbucket-square:before { content: $fa-var-bitbucket-square; } +.#{$fa-css-prefix}-tumblr:before { content: $fa-var-tumblr; } +.#{$fa-css-prefix}-tumblr-square:before { content: $fa-var-tumblr-square; } +.#{$fa-css-prefix}-long-arrow-down:before { content: $fa-var-long-arrow-down; } +.#{$fa-css-prefix}-long-arrow-up:before { content: $fa-var-long-arrow-up; } +.#{$fa-css-prefix}-long-arrow-left:before { content: $fa-var-long-arrow-left; } +.#{$fa-css-prefix}-long-arrow-right:before { content: $fa-var-long-arrow-right; } +.#{$fa-css-prefix}-apple:before { content: $fa-var-apple; } +.#{$fa-css-prefix}-windows:before { content: $fa-var-windows; } +.#{$fa-css-prefix}-android:before { content: $fa-var-android; } +.#{$fa-css-prefix}-linux:before { content: $fa-var-linux; } +.#{$fa-css-prefix}-dribbble:before { content: $fa-var-dribbble; } +.#{$fa-css-prefix}-skype:before { content: $fa-var-skype; } +.#{$fa-css-prefix}-foursquare:before { content: $fa-var-foursquare; } +.#{$fa-css-prefix}-trello:before { content: $fa-var-trello; } +.#{$fa-css-prefix}-female:before { content: $fa-var-female; } +.#{$fa-css-prefix}-male:before { content: $fa-var-male; } +.#{$fa-css-prefix}-gittip:before, +.#{$fa-css-prefix}-gratipay:before { content: $fa-var-gratipay; } +.#{$fa-css-prefix}-sun-o:before { content: $fa-var-sun-o; } +.#{$fa-css-prefix}-moon-o:before { content: $fa-var-moon-o; } +.#{$fa-css-prefix}-archive:before { content: $fa-var-archive; } +.#{$fa-css-prefix}-bug:before { content: $fa-var-bug; } +.#{$fa-css-prefix}-vk:before { content: $fa-var-vk; } +.#{$fa-css-prefix}-weibo:before { content: $fa-var-weibo; } +.#{$fa-css-prefix}-renren:before { content: $fa-var-renren; } +.#{$fa-css-prefix}-pagelines:before { content: $fa-var-pagelines; } +.#{$fa-css-prefix}-stack-exchange:before { content: $fa-var-stack-exchange; } +.#{$fa-css-prefix}-arrow-circle-o-right:before { content: $fa-var-arrow-circle-o-right; } +.#{$fa-css-prefix}-arrow-circle-o-left:before { content: $fa-var-arrow-circle-o-left; } +.#{$fa-css-prefix}-toggle-left:before, +.#{$fa-css-prefix}-caret-square-o-left:before { content: $fa-var-caret-square-o-left; } +.#{$fa-css-prefix}-dot-circle-o:before { content: $fa-var-dot-circle-o; } +.#{$fa-css-prefix}-wheelchair:before { content: $fa-var-wheelchair; } +.#{$fa-css-prefix}-vimeo-square:before { content: $fa-var-vimeo-square; } +.#{$fa-css-prefix}-turkish-lira:before, +.#{$fa-css-prefix}-try:before { content: $fa-var-try; } +.#{$fa-css-prefix}-plus-square-o:before { content: $fa-var-plus-square-o; } +.#{$fa-css-prefix}-space-shuttle:before { content: $fa-var-space-shuttle; } +.#{$fa-css-prefix}-slack:before { content: $fa-var-slack; } +.#{$fa-css-prefix}-envelope-square:before { content: $fa-var-envelope-square; } +.#{$fa-css-prefix}-wordpress:before { content: $fa-var-wordpress; } +.#{$fa-css-prefix}-openid:before { content: $fa-var-openid; } +.#{$fa-css-prefix}-institution:before, +.#{$fa-css-prefix}-bank:before, +.#{$fa-css-prefix}-university:before { content: $fa-var-university; } +.#{$fa-css-prefix}-mortar-board:before, +.#{$fa-css-prefix}-graduation-cap:before { content: $fa-var-graduation-cap; } +.#{$fa-css-prefix}-yahoo:before { content: $fa-var-yahoo; } +.#{$fa-css-prefix}-google:before { content: $fa-var-google; } +.#{$fa-css-prefix}-reddit:before { content: $fa-var-reddit; } +.#{$fa-css-prefix}-reddit-square:before { content: $fa-var-reddit-square; } +.#{$fa-css-prefix}-stumbleupon-circle:before { content: $fa-var-stumbleupon-circle; } +.#{$fa-css-prefix}-stumbleupon:before { content: $fa-var-stumbleupon; } +.#{$fa-css-prefix}-delicious:before { content: $fa-var-delicious; } +.#{$fa-css-prefix}-digg:before { content: $fa-var-digg; } +.#{$fa-css-prefix}-pied-piper-pp:before { content: $fa-var-pied-piper-pp; } +.#{$fa-css-prefix}-pied-piper-alt:before { content: $fa-var-pied-piper-alt; } +.#{$fa-css-prefix}-drupal:before { content: $fa-var-drupal; } +.#{$fa-css-prefix}-joomla:before { content: $fa-var-joomla; } +.#{$fa-css-prefix}-language:before { content: $fa-var-language; } +.#{$fa-css-prefix}-fax:before { content: $fa-var-fax; } +.#{$fa-css-prefix}-building:before { content: $fa-var-building; } +.#{$fa-css-prefix}-child:before { content: $fa-var-child; } +.#{$fa-css-prefix}-paw:before { content: $fa-var-paw; } +.#{$fa-css-prefix}-spoon:before { content: $fa-var-spoon; } +.#{$fa-css-prefix}-cube:before { content: $fa-var-cube; } +.#{$fa-css-prefix}-cubes:before { content: $fa-var-cubes; } +.#{$fa-css-prefix}-behance:before { content: $fa-var-behance; } +.#{$fa-css-prefix}-behance-square:before { content: $fa-var-behance-square; } +.#{$fa-css-prefix}-steam:before { content: $fa-var-steam; } +.#{$fa-css-prefix}-steam-square:before { content: $fa-var-steam-square; } +.#{$fa-css-prefix}-recycle:before { content: $fa-var-recycle; } +.#{$fa-css-prefix}-automobile:before, +.#{$fa-css-prefix}-car:before { content: $fa-var-car; } +.#{$fa-css-prefix}-cab:before, +.#{$fa-css-prefix}-taxi:before { content: $fa-var-taxi; } +.#{$fa-css-prefix}-tree:before { content: $fa-var-tree; } +.#{$fa-css-prefix}-spotify:before { content: $fa-var-spotify; } +.#{$fa-css-prefix}-deviantart:before { content: $fa-var-deviantart; } +.#{$fa-css-prefix}-soundcloud:before { content: $fa-var-soundcloud; } +.#{$fa-css-prefix}-database:before { content: $fa-var-database; } +.#{$fa-css-prefix}-file-pdf-o:before { content: $fa-var-file-pdf-o; } +.#{$fa-css-prefix}-file-word-o:before { content: $fa-var-file-word-o; } +.#{$fa-css-prefix}-file-excel-o:before { content: $fa-var-file-excel-o; } +.#{$fa-css-prefix}-file-powerpoint-o:before { content: $fa-var-file-powerpoint-o; } +.#{$fa-css-prefix}-file-photo-o:before, +.#{$fa-css-prefix}-file-picture-o:before, +.#{$fa-css-prefix}-file-image-o:before { content: $fa-var-file-image-o; } +.#{$fa-css-prefix}-file-zip-o:before, +.#{$fa-css-prefix}-file-archive-o:before { content: $fa-var-file-archive-o; } +.#{$fa-css-prefix}-file-sound-o:before, +.#{$fa-css-prefix}-file-audio-o:before { content: $fa-var-file-audio-o; } +.#{$fa-css-prefix}-file-movie-o:before, +.#{$fa-css-prefix}-file-video-o:before { content: $fa-var-file-video-o; } +.#{$fa-css-prefix}-file-code-o:before { content: $fa-var-file-code-o; } +.#{$fa-css-prefix}-vine:before { content: $fa-var-vine; } +.#{$fa-css-prefix}-codepen:before { content: $fa-var-codepen; } +.#{$fa-css-prefix}-jsfiddle:before { content: $fa-var-jsfiddle; } +.#{$fa-css-prefix}-life-bouy:before, +.#{$fa-css-prefix}-life-buoy:before, +.#{$fa-css-prefix}-life-saver:before, +.#{$fa-css-prefix}-support:before, +.#{$fa-css-prefix}-life-ring:before { content: $fa-var-life-ring; } +.#{$fa-css-prefix}-circle-o-notch:before { content: $fa-var-circle-o-notch; } +.#{$fa-css-prefix}-ra:before, +.#{$fa-css-prefix}-resistance:before, +.#{$fa-css-prefix}-rebel:before { content: $fa-var-rebel; } +.#{$fa-css-prefix}-ge:before, +.#{$fa-css-prefix}-empire:before { content: $fa-var-empire; } +.#{$fa-css-prefix}-git-square:before { content: $fa-var-git-square; } +.#{$fa-css-prefix}-git:before { content: $fa-var-git; } +.#{$fa-css-prefix}-y-combinator-square:before, +.#{$fa-css-prefix}-yc-square:before, +.#{$fa-css-prefix}-hacker-news:before { content: $fa-var-hacker-news; } +.#{$fa-css-prefix}-tencent-weibo:before { content: $fa-var-tencent-weibo; } +.#{$fa-css-prefix}-qq:before { content: $fa-var-qq; } +.#{$fa-css-prefix}-wechat:before, +.#{$fa-css-prefix}-weixin:before { content: $fa-var-weixin; } +.#{$fa-css-prefix}-send:before, +.#{$fa-css-prefix}-paper-plane:before { content: $fa-var-paper-plane; } +.#{$fa-css-prefix}-send-o:before, +.#{$fa-css-prefix}-paper-plane-o:before { content: $fa-var-paper-plane-o; } +.#{$fa-css-prefix}-history:before { content: $fa-var-history; } +.#{$fa-css-prefix}-circle-thin:before { content: $fa-var-circle-thin; } +.#{$fa-css-prefix}-header:before { content: $fa-var-header; } +.#{$fa-css-prefix}-paragraph:before { content: $fa-var-paragraph; } +.#{$fa-css-prefix}-sliders:before { content: $fa-var-sliders; } +.#{$fa-css-prefix}-share-alt:before { content: $fa-var-share-alt; } +.#{$fa-css-prefix}-share-alt-square:before { content: $fa-var-share-alt-square; } +.#{$fa-css-prefix}-bomb:before { content: $fa-var-bomb; } +.#{$fa-css-prefix}-soccer-ball-o:before, +.#{$fa-css-prefix}-futbol-o:before { content: $fa-var-futbol-o; } +.#{$fa-css-prefix}-tty:before { content: $fa-var-tty; } +.#{$fa-css-prefix}-binoculars:before { content: $fa-var-binoculars; } +.#{$fa-css-prefix}-plug:before { content: $fa-var-plug; } +.#{$fa-css-prefix}-slideshare:before { content: $fa-var-slideshare; } +.#{$fa-css-prefix}-twitch:before { content: $fa-var-twitch; } +.#{$fa-css-prefix}-yelp:before { content: $fa-var-yelp; } +.#{$fa-css-prefix}-newspaper-o:before { content: $fa-var-newspaper-o; } +.#{$fa-css-prefix}-wifi:before { content: $fa-var-wifi; } +.#{$fa-css-prefix}-calculator:before { content: $fa-var-calculator; } +.#{$fa-css-prefix}-paypal:before { content: $fa-var-paypal; } +.#{$fa-css-prefix}-google-wallet:before { content: $fa-var-google-wallet; } +.#{$fa-css-prefix}-cc-visa:before { content: $fa-var-cc-visa; } +.#{$fa-css-prefix}-cc-mastercard:before { content: $fa-var-cc-mastercard; } +.#{$fa-css-prefix}-cc-discover:before { content: $fa-var-cc-discover; } +.#{$fa-css-prefix}-cc-amex:before { content: $fa-var-cc-amex; } +.#{$fa-css-prefix}-cc-paypal:before { content: $fa-var-cc-paypal; } +.#{$fa-css-prefix}-cc-stripe:before { content: $fa-var-cc-stripe; } +.#{$fa-css-prefix}-bell-slash:before { content: $fa-var-bell-slash; } +.#{$fa-css-prefix}-bell-slash-o:before { content: $fa-var-bell-slash-o; } +.#{$fa-css-prefix}-trash:before { content: $fa-var-trash; } +.#{$fa-css-prefix}-copyright:before { content: $fa-var-copyright; } +.#{$fa-css-prefix}-at:before { content: $fa-var-at; } +.#{$fa-css-prefix}-eyedropper:before { content: $fa-var-eyedropper; } +.#{$fa-css-prefix}-paint-brush:before { content: $fa-var-paint-brush; } +.#{$fa-css-prefix}-birthday-cake:before { content: $fa-var-birthday-cake; } +.#{$fa-css-prefix}-area-chart:before { content: $fa-var-area-chart; } +.#{$fa-css-prefix}-pie-chart:before { content: $fa-var-pie-chart; } +.#{$fa-css-prefix}-line-chart:before { content: $fa-var-line-chart; } +.#{$fa-css-prefix}-lastfm:before { content: $fa-var-lastfm; } +.#{$fa-css-prefix}-lastfm-square:before { content: $fa-var-lastfm-square; } +.#{$fa-css-prefix}-toggle-off:before { content: $fa-var-toggle-off; } +.#{$fa-css-prefix}-toggle-on:before { content: $fa-var-toggle-on; } +.#{$fa-css-prefix}-bicycle:before { content: $fa-var-bicycle; } +.#{$fa-css-prefix}-bus:before { content: $fa-var-bus; } +.#{$fa-css-prefix}-ioxhost:before { content: $fa-var-ioxhost; } +.#{$fa-css-prefix}-angellist:before { content: $fa-var-angellist; } +.#{$fa-css-prefix}-cc:before { content: $fa-var-cc; } +.#{$fa-css-prefix}-shekel:before, +.#{$fa-css-prefix}-sheqel:before, +.#{$fa-css-prefix}-ils:before { content: $fa-var-ils; } +.#{$fa-css-prefix}-meanpath:before { content: $fa-var-meanpath; } +.#{$fa-css-prefix}-buysellads:before { content: $fa-var-buysellads; } +.#{$fa-css-prefix}-connectdevelop:before { content: $fa-var-connectdevelop; } +.#{$fa-css-prefix}-dashcube:before { content: $fa-var-dashcube; } +.#{$fa-css-prefix}-forumbee:before { content: $fa-var-forumbee; } +.#{$fa-css-prefix}-leanpub:before { content: $fa-var-leanpub; } +.#{$fa-css-prefix}-sellsy:before { content: $fa-var-sellsy; } +.#{$fa-css-prefix}-shirtsinbulk:before { content: $fa-var-shirtsinbulk; } +.#{$fa-css-prefix}-simplybuilt:before { content: $fa-var-simplybuilt; } +.#{$fa-css-prefix}-skyatlas:before { content: $fa-var-skyatlas; } +.#{$fa-css-prefix}-cart-plus:before { content: $fa-var-cart-plus; } +.#{$fa-css-prefix}-cart-arrow-down:before { content: $fa-var-cart-arrow-down; } +.#{$fa-css-prefix}-diamond:before { content: $fa-var-diamond; } +.#{$fa-css-prefix}-ship:before { content: $fa-var-ship; } +.#{$fa-css-prefix}-user-secret:before { content: $fa-var-user-secret; } +.#{$fa-css-prefix}-motorcycle:before { content: $fa-var-motorcycle; } +.#{$fa-css-prefix}-street-view:before { content: $fa-var-street-view; } +.#{$fa-css-prefix}-heartbeat:before { content: $fa-var-heartbeat; } +.#{$fa-css-prefix}-venus:before { content: $fa-var-venus; } +.#{$fa-css-prefix}-mars:before { content: $fa-var-mars; } +.#{$fa-css-prefix}-mercury:before { content: $fa-var-mercury; } +.#{$fa-css-prefix}-intersex:before, +.#{$fa-css-prefix}-transgender:before { content: $fa-var-transgender; } +.#{$fa-css-prefix}-transgender-alt:before { content: $fa-var-transgender-alt; } +.#{$fa-css-prefix}-venus-double:before { content: $fa-var-venus-double; } +.#{$fa-css-prefix}-mars-double:before { content: $fa-var-mars-double; } +.#{$fa-css-prefix}-venus-mars:before { content: $fa-var-venus-mars; } +.#{$fa-css-prefix}-mars-stroke:before { content: $fa-var-mars-stroke; } +.#{$fa-css-prefix}-mars-stroke-v:before { content: $fa-var-mars-stroke-v; } +.#{$fa-css-prefix}-mars-stroke-h:before { content: $fa-var-mars-stroke-h; } +.#{$fa-css-prefix}-neuter:before { content: $fa-var-neuter; } +.#{$fa-css-prefix}-genderless:before { content: $fa-var-genderless; } +.#{$fa-css-prefix}-facebook-official:before { content: $fa-var-facebook-official; } +.#{$fa-css-prefix}-pinterest-p:before { content: $fa-var-pinterest-p; } +.#{$fa-css-prefix}-whatsapp:before { content: $fa-var-whatsapp; } +.#{$fa-css-prefix}-server:before { content: $fa-var-server; } +.#{$fa-css-prefix}-user-plus:before { content: $fa-var-user-plus; } +.#{$fa-css-prefix}-user-times:before { content: $fa-var-user-times; } +.#{$fa-css-prefix}-hotel:before, +.#{$fa-css-prefix}-bed:before { content: $fa-var-bed; } +.#{$fa-css-prefix}-viacoin:before { content: $fa-var-viacoin; } +.#{$fa-css-prefix}-train:before { content: $fa-var-train; } +.#{$fa-css-prefix}-subway:before { content: $fa-var-subway; } +.#{$fa-css-prefix}-medium:before { content: $fa-var-medium; } +.#{$fa-css-prefix}-yc:before, +.#{$fa-css-prefix}-y-combinator:before { content: $fa-var-y-combinator; } +.#{$fa-css-prefix}-optin-monster:before { content: $fa-var-optin-monster; } +.#{$fa-css-prefix}-opencart:before { content: $fa-var-opencart; } +.#{$fa-css-prefix}-expeditedssl:before { content: $fa-var-expeditedssl; } +.#{$fa-css-prefix}-battery-4:before, +.#{$fa-css-prefix}-battery:before, +.#{$fa-css-prefix}-battery-full:before { content: $fa-var-battery-full; } +.#{$fa-css-prefix}-battery-3:before, +.#{$fa-css-prefix}-battery-three-quarters:before { content: $fa-var-battery-three-quarters; } +.#{$fa-css-prefix}-battery-2:before, +.#{$fa-css-prefix}-battery-half:before { content: $fa-var-battery-half; } +.#{$fa-css-prefix}-battery-1:before, +.#{$fa-css-prefix}-battery-quarter:before { content: $fa-var-battery-quarter; } +.#{$fa-css-prefix}-battery-0:before, +.#{$fa-css-prefix}-battery-empty:before { content: $fa-var-battery-empty; } +.#{$fa-css-prefix}-mouse-pointer:before { content: $fa-var-mouse-pointer; } +.#{$fa-css-prefix}-i-cursor:before { content: $fa-var-i-cursor; } +.#{$fa-css-prefix}-object-group:before { content: $fa-var-object-group; } +.#{$fa-css-prefix}-object-ungroup:before { content: $fa-var-object-ungroup; } +.#{$fa-css-prefix}-sticky-note:before { content: $fa-var-sticky-note; } +.#{$fa-css-prefix}-sticky-note-o:before { content: $fa-var-sticky-note-o; } +.#{$fa-css-prefix}-cc-jcb:before { content: $fa-var-cc-jcb; } +.#{$fa-css-prefix}-cc-diners-club:before { content: $fa-var-cc-diners-club; } +.#{$fa-css-prefix}-clone:before { content: $fa-var-clone; } +.#{$fa-css-prefix}-balance-scale:before { content: $fa-var-balance-scale; } +.#{$fa-css-prefix}-hourglass-o:before { content: $fa-var-hourglass-o; } +.#{$fa-css-prefix}-hourglass-1:before, +.#{$fa-css-prefix}-hourglass-start:before { content: $fa-var-hourglass-start; } +.#{$fa-css-prefix}-hourglass-2:before, +.#{$fa-css-prefix}-hourglass-half:before { content: $fa-var-hourglass-half; } +.#{$fa-css-prefix}-hourglass-3:before, +.#{$fa-css-prefix}-hourglass-end:before { content: $fa-var-hourglass-end; } +.#{$fa-css-prefix}-hourglass:before { content: $fa-var-hourglass; } +.#{$fa-css-prefix}-hand-grab-o:before, +.#{$fa-css-prefix}-hand-rock-o:before { content: $fa-var-hand-rock-o; } +.#{$fa-css-prefix}-hand-stop-o:before, +.#{$fa-css-prefix}-hand-paper-o:before { content: $fa-var-hand-paper-o; } +.#{$fa-css-prefix}-hand-scissors-o:before { content: $fa-var-hand-scissors-o; } +.#{$fa-css-prefix}-hand-lizard-o:before { content: $fa-var-hand-lizard-o; } +.#{$fa-css-prefix}-hand-spock-o:before { content: $fa-var-hand-spock-o; } +.#{$fa-css-prefix}-hand-pointer-o:before { content: $fa-var-hand-pointer-o; } +.#{$fa-css-prefix}-hand-peace-o:before { content: $fa-var-hand-peace-o; } +.#{$fa-css-prefix}-trademark:before { content: $fa-var-trademark; } +.#{$fa-css-prefix}-registered:before { content: $fa-var-registered; } +.#{$fa-css-prefix}-creative-commons:before { content: $fa-var-creative-commons; } +.#{$fa-css-prefix}-gg:before { content: $fa-var-gg; } +.#{$fa-css-prefix}-gg-circle:before { content: $fa-var-gg-circle; } +.#{$fa-css-prefix}-tripadvisor:before { content: $fa-var-tripadvisor; } +.#{$fa-css-prefix}-odnoklassniki:before { content: $fa-var-odnoklassniki; } +.#{$fa-css-prefix}-odnoklassniki-square:before { content: $fa-var-odnoklassniki-square; } +.#{$fa-css-prefix}-get-pocket:before { content: $fa-var-get-pocket; } +.#{$fa-css-prefix}-wikipedia-w:before { content: $fa-var-wikipedia-w; } +.#{$fa-css-prefix}-safari:before { content: $fa-var-safari; } +.#{$fa-css-prefix}-chrome:before { content: $fa-var-chrome; } +.#{$fa-css-prefix}-firefox:before { content: $fa-var-firefox; } +.#{$fa-css-prefix}-opera:before { content: $fa-var-opera; } +.#{$fa-css-prefix}-internet-explorer:before { content: $fa-var-internet-explorer; } +.#{$fa-css-prefix}-tv:before, +.#{$fa-css-prefix}-television:before { content: $fa-var-television; } +.#{$fa-css-prefix}-contao:before { content: $fa-var-contao; } +.#{$fa-css-prefix}-500px:before { content: $fa-var-500px; } +.#{$fa-css-prefix}-amazon:before { content: $fa-var-amazon; } +.#{$fa-css-prefix}-calendar-plus-o:before { content: $fa-var-calendar-plus-o; } +.#{$fa-css-prefix}-calendar-minus-o:before { content: $fa-var-calendar-minus-o; } +.#{$fa-css-prefix}-calendar-times-o:before { content: $fa-var-calendar-times-o; } +.#{$fa-css-prefix}-calendar-check-o:before { content: $fa-var-calendar-check-o; } +.#{$fa-css-prefix}-industry:before { content: $fa-var-industry; } +.#{$fa-css-prefix}-map-pin:before { content: $fa-var-map-pin; } +.#{$fa-css-prefix}-map-signs:before { content: $fa-var-map-signs; } +.#{$fa-css-prefix}-map-o:before { content: $fa-var-map-o; } +.#{$fa-css-prefix}-map:before { content: $fa-var-map; } +.#{$fa-css-prefix}-commenting:before { content: $fa-var-commenting; } +.#{$fa-css-prefix}-commenting-o:before { content: $fa-var-commenting-o; } +.#{$fa-css-prefix}-houzz:before { content: $fa-var-houzz; } +.#{$fa-css-prefix}-vimeo:before { content: $fa-var-vimeo; } +.#{$fa-css-prefix}-black-tie:before { content: $fa-var-black-tie; } +.#{$fa-css-prefix}-fonticons:before { content: $fa-var-fonticons; } +.#{$fa-css-prefix}-reddit-alien:before { content: $fa-var-reddit-alien; } +.#{$fa-css-prefix}-edge:before { content: $fa-var-edge; } +.#{$fa-css-prefix}-credit-card-alt:before { content: $fa-var-credit-card-alt; } +.#{$fa-css-prefix}-codiepie:before { content: $fa-var-codiepie; } +.#{$fa-css-prefix}-modx:before { content: $fa-var-modx; } +.#{$fa-css-prefix}-fort-awesome:before { content: $fa-var-fort-awesome; } +.#{$fa-css-prefix}-usb:before { content: $fa-var-usb; } +.#{$fa-css-prefix}-product-hunt:before { content: $fa-var-product-hunt; } +.#{$fa-css-prefix}-mixcloud:before { content: $fa-var-mixcloud; } +.#{$fa-css-prefix}-scribd:before { content: $fa-var-scribd; } +.#{$fa-css-prefix}-pause-circle:before { content: $fa-var-pause-circle; } +.#{$fa-css-prefix}-pause-circle-o:before { content: $fa-var-pause-circle-o; } +.#{$fa-css-prefix}-stop-circle:before { content: $fa-var-stop-circle; } +.#{$fa-css-prefix}-stop-circle-o:before { content: $fa-var-stop-circle-o; } +.#{$fa-css-prefix}-shopping-bag:before { content: $fa-var-shopping-bag; } +.#{$fa-css-prefix}-shopping-basket:before { content: $fa-var-shopping-basket; } +.#{$fa-css-prefix}-hashtag:before { content: $fa-var-hashtag; } +.#{$fa-css-prefix}-bluetooth:before { content: $fa-var-bluetooth; } +.#{$fa-css-prefix}-bluetooth-b:before { content: $fa-var-bluetooth-b; } +.#{$fa-css-prefix}-percent:before { content: $fa-var-percent; } +.#{$fa-css-prefix}-gitlab:before { content: $fa-var-gitlab; } +.#{$fa-css-prefix}-wpbeginner:before { content: $fa-var-wpbeginner; } +.#{$fa-css-prefix}-wpforms:before { content: $fa-var-wpforms; } +.#{$fa-css-prefix}-envira:before { content: $fa-var-envira; } +.#{$fa-css-prefix}-universal-access:before { content: $fa-var-universal-access; } +.#{$fa-css-prefix}-wheelchair-alt:before { content: $fa-var-wheelchair-alt; } +.#{$fa-css-prefix}-question-circle-o:before { content: $fa-var-question-circle-o; } +.#{$fa-css-prefix}-blind:before { content: $fa-var-blind; } +.#{$fa-css-prefix}-audio-description:before { content: $fa-var-audio-description; } +.#{$fa-css-prefix}-volume-control-phone:before { content: $fa-var-volume-control-phone; } +.#{$fa-css-prefix}-braille:before { content: $fa-var-braille; } +.#{$fa-css-prefix}-assistive-listening-systems:before { content: $fa-var-assistive-listening-systems; } +.#{$fa-css-prefix}-asl-interpreting:before, +.#{$fa-css-prefix}-american-sign-language-interpreting:before { content: $fa-var-american-sign-language-interpreting; } +.#{$fa-css-prefix}-deafness:before, +.#{$fa-css-prefix}-hard-of-hearing:before, +.#{$fa-css-prefix}-deaf:before { content: $fa-var-deaf; } +.#{$fa-css-prefix}-glide:before { content: $fa-var-glide; } +.#{$fa-css-prefix}-glide-g:before { content: $fa-var-glide-g; } +.#{$fa-css-prefix}-signing:before, +.#{$fa-css-prefix}-sign-language:before { content: $fa-var-sign-language; } +.#{$fa-css-prefix}-low-vision:before { content: $fa-var-low-vision; } +.#{$fa-css-prefix}-viadeo:before { content: $fa-var-viadeo; } +.#{$fa-css-prefix}-viadeo-square:before { content: $fa-var-viadeo-square; } +.#{$fa-css-prefix}-snapchat:before { content: $fa-var-snapchat; } +.#{$fa-css-prefix}-snapchat-ghost:before { content: $fa-var-snapchat-ghost; } +.#{$fa-css-prefix}-snapchat-square:before { content: $fa-var-snapchat-square; } +.#{$fa-css-prefix}-pied-piper:before { content: $fa-var-pied-piper; } +.#{$fa-css-prefix}-first-order:before { content: $fa-var-first-order; } +.#{$fa-css-prefix}-yoast:before { content: $fa-var-yoast; } +.#{$fa-css-prefix}-themeisle:before { content: $fa-var-themeisle; } +.#{$fa-css-prefix}-google-plus-circle:before, +.#{$fa-css-prefix}-google-plus-official:before { content: $fa-var-google-plus-official; } +.#{$fa-css-prefix}-fa:before, +.#{$fa-css-prefix}-font-awesome:before { content: $fa-var-font-awesome; } +.#{$fa-css-prefix}-handshake-o:before { content: $fa-var-handshake-o; } +.#{$fa-css-prefix}-envelope-open:before { content: $fa-var-envelope-open; } +.#{$fa-css-prefix}-envelope-open-o:before { content: $fa-var-envelope-open-o; } +.#{$fa-css-prefix}-linode:before { content: $fa-var-linode; } +.#{$fa-css-prefix}-address-book:before { content: $fa-var-address-book; } +.#{$fa-css-prefix}-address-book-o:before { content: $fa-var-address-book-o; } +.#{$fa-css-prefix}-vcard:before, +.#{$fa-css-prefix}-address-card:before { content: $fa-var-address-card; } +.#{$fa-css-prefix}-vcard-o:before, +.#{$fa-css-prefix}-address-card-o:before { content: $fa-var-address-card-o; } +.#{$fa-css-prefix}-user-circle:before { content: $fa-var-user-circle; } +.#{$fa-css-prefix}-user-circle-o:before { content: $fa-var-user-circle-o; } +.#{$fa-css-prefix}-user-o:before { content: $fa-var-user-o; } +.#{$fa-css-prefix}-id-badge:before { content: $fa-var-id-badge; } +.#{$fa-css-prefix}-drivers-license:before, +.#{$fa-css-prefix}-id-card:before { content: $fa-var-id-card; } +.#{$fa-css-prefix}-drivers-license-o:before, +.#{$fa-css-prefix}-id-card-o:before { content: $fa-var-id-card-o; } +.#{$fa-css-prefix}-quora:before { content: $fa-var-quora; } +.#{$fa-css-prefix}-free-code-camp:before { content: $fa-var-free-code-camp; } +.#{$fa-css-prefix}-telegram:before { content: $fa-var-telegram; } +.#{$fa-css-prefix}-thermometer-4:before, +.#{$fa-css-prefix}-thermometer:before, +.#{$fa-css-prefix}-thermometer-full:before { content: $fa-var-thermometer-full; } +.#{$fa-css-prefix}-thermometer-3:before, +.#{$fa-css-prefix}-thermometer-three-quarters:before { content: $fa-var-thermometer-three-quarters; } +.#{$fa-css-prefix}-thermometer-2:before, +.#{$fa-css-prefix}-thermometer-half:before { content: $fa-var-thermometer-half; } +.#{$fa-css-prefix}-thermometer-1:before, +.#{$fa-css-prefix}-thermometer-quarter:before { content: $fa-var-thermometer-quarter; } +.#{$fa-css-prefix}-thermometer-0:before, +.#{$fa-css-prefix}-thermometer-empty:before { content: $fa-var-thermometer-empty; } +.#{$fa-css-prefix}-shower:before { content: $fa-var-shower; } +.#{$fa-css-prefix}-bathtub:before, +.#{$fa-css-prefix}-s15:before, +.#{$fa-css-prefix}-bath:before { content: $fa-var-bath; } +.#{$fa-css-prefix}-podcast:before { content: $fa-var-podcast; } +.#{$fa-css-prefix}-window-maximize:before { content: $fa-var-window-maximize; } +.#{$fa-css-prefix}-window-minimize:before { content: $fa-var-window-minimize; } +.#{$fa-css-prefix}-window-restore:before { content: $fa-var-window-restore; } +.#{$fa-css-prefix}-times-rectangle:before, +.#{$fa-css-prefix}-window-close:before { content: $fa-var-window-close; } +.#{$fa-css-prefix}-times-rectangle-o:before, +.#{$fa-css-prefix}-window-close-o:before { content: $fa-var-window-close-o; } +.#{$fa-css-prefix}-bandcamp:before { content: $fa-var-bandcamp; } +.#{$fa-css-prefix}-grav:before { content: $fa-var-grav; } +.#{$fa-css-prefix}-etsy:before { content: $fa-var-etsy; } +.#{$fa-css-prefix}-imdb:before { content: $fa-var-imdb; } +.#{$fa-css-prefix}-ravelry:before { content: $fa-var-ravelry; } +.#{$fa-css-prefix}-eercast:before { content: $fa-var-eercast; } +.#{$fa-css-prefix}-microchip:before { content: $fa-var-microchip; } +.#{$fa-css-prefix}-snowflake-o:before { content: $fa-var-snowflake-o; } +.#{$fa-css-prefix}-superpowers:before { content: $fa-var-superpowers; } +.#{$fa-css-prefix}-wpexplorer:before { content: $fa-var-wpexplorer; } +.#{$fa-css-prefix}-meetup:before { content: $fa-var-meetup; } diff --git a/public/fonts/font-awesome-4.7.0/scss/_larger.scss b/public/fonts/font-awesome-4.7.0/scss/_larger.scss new file mode 100755 index 000000000..41e9a8184 --- /dev/null +++ b/public/fonts/font-awesome-4.7.0/scss/_larger.scss @@ -0,0 +1,13 @@ +// Icon Sizes +// ------------------------- + +/* makes the font 33% larger relative to the icon container */ +.#{$fa-css-prefix}-lg { + font-size: (4em / 3); + line-height: (3em / 4); + vertical-align: -15%; +} +.#{$fa-css-prefix}-2x { font-size: 2em; } +.#{$fa-css-prefix}-3x { font-size: 3em; } +.#{$fa-css-prefix}-4x { font-size: 4em; } +.#{$fa-css-prefix}-5x { font-size: 5em; } diff --git a/public/fonts/font-awesome-4.7.0/scss/_list.scss b/public/fonts/font-awesome-4.7.0/scss/_list.scss new file mode 100755 index 000000000..7d1e4d54d --- /dev/null +++ b/public/fonts/font-awesome-4.7.0/scss/_list.scss @@ -0,0 +1,19 @@ +// List Icons +// ------------------------- + +.#{$fa-css-prefix}-ul { + padding-left: 0; + margin-left: $fa-li-width; + list-style-type: none; + > li { position: relative; } +} +.#{$fa-css-prefix}-li { + position: absolute; + left: -$fa-li-width; + width: $fa-li-width; + top: (2em / 14); + text-align: center; + &.#{$fa-css-prefix}-lg { + left: -$fa-li-width + (4em / 14); + } +} diff --git a/public/fonts/font-awesome-4.7.0/scss/_mixins.scss b/public/fonts/font-awesome-4.7.0/scss/_mixins.scss new file mode 100755 index 000000000..c3bbd5745 --- /dev/null +++ b/public/fonts/font-awesome-4.7.0/scss/_mixins.scss @@ -0,0 +1,60 @@ +// Mixins +// -------------------------- + +@mixin fa-icon() { + display: inline-block; + font: normal normal normal #{$fa-font-size-base}/#{$fa-line-height-base} FontAwesome; // shortening font declaration + font-size: inherit; // can't have font-size inherit on line above, so need to override + text-rendering: auto; // optimizelegibility throws things off #1094 + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + +} + +@mixin fa-icon-rotate($degrees, $rotation) { + -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation})"; + -webkit-transform: rotate($degrees); + -ms-transform: rotate($degrees); + transform: rotate($degrees); +} + +@mixin fa-icon-flip($horiz, $vert, $rotation) { + -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=#{$rotation}, mirror=1)"; + -webkit-transform: scale($horiz, $vert); + -ms-transform: scale($horiz, $vert); + transform: scale($horiz, $vert); +} + + +// Only display content to screen readers. A la Bootstrap 4. +// +// See: http://a11yproject.com/posts/how-to-hide-content/ + +@mixin sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + margin: -1px; + overflow: hidden; + clip: rect(0,0,0,0); + border: 0; +} + +// Use in conjunction with .sr-only to only display content when it's focused. +// +// Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1 +// +// Credit: HTML5 Boilerplate + +@mixin sr-only-focusable { + &:active, + &:focus { + position: static; + width: auto; + height: auto; + margin: 0; + overflow: visible; + clip: auto; + } +} diff --git a/public/fonts/font-awesome-4.7.0/scss/_path.scss b/public/fonts/font-awesome-4.7.0/scss/_path.scss new file mode 100755 index 000000000..bb457c23a --- /dev/null +++ b/public/fonts/font-awesome-4.7.0/scss/_path.scss @@ -0,0 +1,15 @@ +/* FONT PATH + * -------------------------- */ + +@font-face { + font-family: 'FontAwesome'; + src: url('#{$fa-font-path}/fontawesome-webfont.eot?v=#{$fa-version}'); + src: url('#{$fa-font-path}/fontawesome-webfont.eot?#iefix&v=#{$fa-version}') format('embedded-opentype'), + url('#{$fa-font-path}/fontawesome-webfont.woff2?v=#{$fa-version}') format('woff2'), + url('#{$fa-font-path}/fontawesome-webfont.woff?v=#{$fa-version}') format('woff'), + url('#{$fa-font-path}/fontawesome-webfont.ttf?v=#{$fa-version}') format('truetype'), + url('#{$fa-font-path}/fontawesome-webfont.svg?v=#{$fa-version}#fontawesomeregular') format('svg'); +// src: url('#{$fa-font-path}/FontAwesome.otf') format('opentype'); // used when developing fonts + font-weight: normal; + font-style: normal; +} diff --git a/public/fonts/font-awesome-4.7.0/scss/_rotated-flipped.scss b/public/fonts/font-awesome-4.7.0/scss/_rotated-flipped.scss new file mode 100755 index 000000000..a3558fd09 --- /dev/null +++ b/public/fonts/font-awesome-4.7.0/scss/_rotated-flipped.scss @@ -0,0 +1,20 @@ +// Rotated & Flipped Icons +// ------------------------- + +.#{$fa-css-prefix}-rotate-90 { @include fa-icon-rotate(90deg, 1); } +.#{$fa-css-prefix}-rotate-180 { @include fa-icon-rotate(180deg, 2); } +.#{$fa-css-prefix}-rotate-270 { @include fa-icon-rotate(270deg, 3); } + +.#{$fa-css-prefix}-flip-horizontal { @include fa-icon-flip(-1, 1, 0); } +.#{$fa-css-prefix}-flip-vertical { @include fa-icon-flip(1, -1, 2); } + +// Hook for IE8-9 +// ------------------------- + +:root .#{$fa-css-prefix}-rotate-90, +:root .#{$fa-css-prefix}-rotate-180, +:root .#{$fa-css-prefix}-rotate-270, +:root .#{$fa-css-prefix}-flip-horizontal, +:root .#{$fa-css-prefix}-flip-vertical { + filter: none; +} diff --git a/public/fonts/font-awesome-4.7.0/scss/_screen-reader.scss b/public/fonts/font-awesome-4.7.0/scss/_screen-reader.scss new file mode 100755 index 000000000..637426f0d --- /dev/null +++ b/public/fonts/font-awesome-4.7.0/scss/_screen-reader.scss @@ -0,0 +1,5 @@ +// Screen Readers +// ------------------------- + +.sr-only { @include sr-only(); } +.sr-only-focusable { @include sr-only-focusable(); } diff --git a/public/fonts/font-awesome-4.7.0/scss/_stacked.scss b/public/fonts/font-awesome-4.7.0/scss/_stacked.scss new file mode 100755 index 000000000..aef740366 --- /dev/null +++ b/public/fonts/font-awesome-4.7.0/scss/_stacked.scss @@ -0,0 +1,20 @@ +// Stacked Icons +// ------------------------- + +.#{$fa-css-prefix}-stack { + position: relative; + display: inline-block; + width: 2em; + height: 2em; + line-height: 2em; + vertical-align: middle; +} +.#{$fa-css-prefix}-stack-1x, .#{$fa-css-prefix}-stack-2x { + position: absolute; + left: 0; + width: 100%; + text-align: center; +} +.#{$fa-css-prefix}-stack-1x { line-height: inherit; } +.#{$fa-css-prefix}-stack-2x { font-size: 2em; } +.#{$fa-css-prefix}-inverse { color: $fa-inverse; } diff --git a/public/fonts/font-awesome-4.7.0/scss/_variables.scss b/public/fonts/font-awesome-4.7.0/scss/_variables.scss new file mode 100755 index 000000000..498fc4a08 --- /dev/null +++ b/public/fonts/font-awesome-4.7.0/scss/_variables.scss @@ -0,0 +1,800 @@ +// Variables +// -------------------------- + +$fa-font-path: "../fonts" !default; +$fa-font-size-base: 14px !default; +$fa-line-height-base: 1 !default; +//$fa-font-path: "//netdna.bootstrapcdn.com/font-awesome/4.7.0/fonts" !default; // for referencing Bootstrap CDN font files directly +$fa-css-prefix: fa !default; +$fa-version: "4.7.0" !default; +$fa-border-color: #eee !default; +$fa-inverse: #fff !default; +$fa-li-width: (30em / 14) !default; + +$fa-var-500px: "\f26e"; +$fa-var-address-book: "\f2b9"; +$fa-var-address-book-o: "\f2ba"; +$fa-var-address-card: "\f2bb"; +$fa-var-address-card-o: "\f2bc"; +$fa-var-adjust: "\f042"; +$fa-var-adn: "\f170"; +$fa-var-align-center: "\f037"; +$fa-var-align-justify: "\f039"; +$fa-var-align-left: "\f036"; +$fa-var-align-right: "\f038"; +$fa-var-amazon: "\f270"; +$fa-var-ambulance: "\f0f9"; +$fa-var-american-sign-language-interpreting: "\f2a3"; +$fa-var-anchor: "\f13d"; +$fa-var-android: "\f17b"; +$fa-var-angellist: "\f209"; +$fa-var-angle-double-down: "\f103"; +$fa-var-angle-double-left: "\f100"; +$fa-var-angle-double-right: "\f101"; +$fa-var-angle-double-up: "\f102"; +$fa-var-angle-down: "\f107"; +$fa-var-angle-left: "\f104"; +$fa-var-angle-right: "\f105"; +$fa-var-angle-up: "\f106"; +$fa-var-apple: "\f179"; +$fa-var-archive: "\f187"; +$fa-var-area-chart: "\f1fe"; +$fa-var-arrow-circle-down: "\f0ab"; +$fa-var-arrow-circle-left: "\f0a8"; +$fa-var-arrow-circle-o-down: "\f01a"; +$fa-var-arrow-circle-o-left: "\f190"; +$fa-var-arrow-circle-o-right: "\f18e"; +$fa-var-arrow-circle-o-up: "\f01b"; +$fa-var-arrow-circle-right: "\f0a9"; +$fa-var-arrow-circle-up: "\f0aa"; +$fa-var-arrow-down: "\f063"; +$fa-var-arrow-left: "\f060"; +$fa-var-arrow-right: "\f061"; +$fa-var-arrow-up: "\f062"; +$fa-var-arrows: "\f047"; +$fa-var-arrows-alt: "\f0b2"; +$fa-var-arrows-h: "\f07e"; +$fa-var-arrows-v: "\f07d"; +$fa-var-asl-interpreting: "\f2a3"; +$fa-var-assistive-listening-systems: "\f2a2"; +$fa-var-asterisk: "\f069"; +$fa-var-at: "\f1fa"; +$fa-var-audio-description: "\f29e"; +$fa-var-automobile: "\f1b9"; +$fa-var-backward: "\f04a"; +$fa-var-balance-scale: "\f24e"; +$fa-var-ban: "\f05e"; +$fa-var-bandcamp: "\f2d5"; +$fa-var-bank: "\f19c"; +$fa-var-bar-chart: "\f080"; +$fa-var-bar-chart-o: "\f080"; +$fa-var-barcode: "\f02a"; +$fa-var-bars: "\f0c9"; +$fa-var-bath: "\f2cd"; +$fa-var-bathtub: "\f2cd"; +$fa-var-battery: "\f240"; +$fa-var-battery-0: "\f244"; +$fa-var-battery-1: "\f243"; +$fa-var-battery-2: "\f242"; +$fa-var-battery-3: "\f241"; +$fa-var-battery-4: "\f240"; +$fa-var-battery-empty: "\f244"; +$fa-var-battery-full: "\f240"; +$fa-var-battery-half: "\f242"; +$fa-var-battery-quarter: "\f243"; +$fa-var-battery-three-quarters: "\f241"; +$fa-var-bed: "\f236"; +$fa-var-beer: "\f0fc"; +$fa-var-behance: "\f1b4"; +$fa-var-behance-square: "\f1b5"; +$fa-var-bell: "\f0f3"; +$fa-var-bell-o: "\f0a2"; +$fa-var-bell-slash: "\f1f6"; +$fa-var-bell-slash-o: "\f1f7"; +$fa-var-bicycle: "\f206"; +$fa-var-binoculars: "\f1e5"; +$fa-var-birthday-cake: "\f1fd"; +$fa-var-bitbucket: "\f171"; +$fa-var-bitbucket-square: "\f172"; +$fa-var-bitcoin: "\f15a"; +$fa-var-black-tie: "\f27e"; +$fa-var-blind: "\f29d"; +$fa-var-bluetooth: "\f293"; +$fa-var-bluetooth-b: "\f294"; +$fa-var-bold: "\f032"; +$fa-var-bolt: "\f0e7"; +$fa-var-bomb: "\f1e2"; +$fa-var-book: "\f02d"; +$fa-var-bookmark: "\f02e"; +$fa-var-bookmark-o: "\f097"; +$fa-var-braille: "\f2a1"; +$fa-var-briefcase: "\f0b1"; +$fa-var-btc: "\f15a"; +$fa-var-bug: "\f188"; +$fa-var-building: "\f1ad"; +$fa-var-building-o: "\f0f7"; +$fa-var-bullhorn: "\f0a1"; +$fa-var-bullseye: "\f140"; +$fa-var-bus: "\f207"; +$fa-var-buysellads: "\f20d"; +$fa-var-cab: "\f1ba"; +$fa-var-calculator: "\f1ec"; +$fa-var-calendar: "\f073"; +$fa-var-calendar-check-o: "\f274"; +$fa-var-calendar-minus-o: "\f272"; +$fa-var-calendar-o: "\f133"; +$fa-var-calendar-plus-o: "\f271"; +$fa-var-calendar-times-o: "\f273"; +$fa-var-camera: "\f030"; +$fa-var-camera-retro: "\f083"; +$fa-var-car: "\f1b9"; +$fa-var-caret-down: "\f0d7"; +$fa-var-caret-left: "\f0d9"; +$fa-var-caret-right: "\f0da"; +$fa-var-caret-square-o-down: "\f150"; +$fa-var-caret-square-o-left: "\f191"; +$fa-var-caret-square-o-right: "\f152"; +$fa-var-caret-square-o-up: "\f151"; +$fa-var-caret-up: "\f0d8"; +$fa-var-cart-arrow-down: "\f218"; +$fa-var-cart-plus: "\f217"; +$fa-var-cc: "\f20a"; +$fa-var-cc-amex: "\f1f3"; +$fa-var-cc-diners-club: "\f24c"; +$fa-var-cc-discover: "\f1f2"; +$fa-var-cc-jcb: "\f24b"; +$fa-var-cc-mastercard: "\f1f1"; +$fa-var-cc-paypal: "\f1f4"; +$fa-var-cc-stripe: "\f1f5"; +$fa-var-cc-visa: "\f1f0"; +$fa-var-certificate: "\f0a3"; +$fa-var-chain: "\f0c1"; +$fa-var-chain-broken: "\f127"; +$fa-var-check: "\f00c"; +$fa-var-check-circle: "\f058"; +$fa-var-check-circle-o: "\f05d"; +$fa-var-check-square: "\f14a"; +$fa-var-check-square-o: "\f046"; +$fa-var-chevron-circle-down: "\f13a"; +$fa-var-chevron-circle-left: "\f137"; +$fa-var-chevron-circle-right: "\f138"; +$fa-var-chevron-circle-up: "\f139"; +$fa-var-chevron-down: "\f078"; +$fa-var-chevron-left: "\f053"; +$fa-var-chevron-right: "\f054"; +$fa-var-chevron-up: "\f077"; +$fa-var-child: "\f1ae"; +$fa-var-chrome: "\f268"; +$fa-var-circle: "\f111"; +$fa-var-circle-o: "\f10c"; +$fa-var-circle-o-notch: "\f1ce"; +$fa-var-circle-thin: "\f1db"; +$fa-var-clipboard: "\f0ea"; +$fa-var-clock-o: "\f017"; +$fa-var-clone: "\f24d"; +$fa-var-close: "\f00d"; +$fa-var-cloud: "\f0c2"; +$fa-var-cloud-download: "\f0ed"; +$fa-var-cloud-upload: "\f0ee"; +$fa-var-cny: "\f157"; +$fa-var-code: "\f121"; +$fa-var-code-fork: "\f126"; +$fa-var-codepen: "\f1cb"; +$fa-var-codiepie: "\f284"; +$fa-var-coffee: "\f0f4"; +$fa-var-cog: "\f013"; +$fa-var-cogs: "\f085"; +$fa-var-columns: "\f0db"; +$fa-var-comment: "\f075"; +$fa-var-comment-o: "\f0e5"; +$fa-var-commenting: "\f27a"; +$fa-var-commenting-o: "\f27b"; +$fa-var-comments: "\f086"; +$fa-var-comments-o: "\f0e6"; +$fa-var-compass: "\f14e"; +$fa-var-compress: "\f066"; +$fa-var-connectdevelop: "\f20e"; +$fa-var-contao: "\f26d"; +$fa-var-copy: "\f0c5"; +$fa-var-copyright: "\f1f9"; +$fa-var-creative-commons: "\f25e"; +$fa-var-credit-card: "\f09d"; +$fa-var-credit-card-alt: "\f283"; +$fa-var-crop: "\f125"; +$fa-var-crosshairs: "\f05b"; +$fa-var-css3: "\f13c"; +$fa-var-cube: "\f1b2"; +$fa-var-cubes: "\f1b3"; +$fa-var-cut: "\f0c4"; +$fa-var-cutlery: "\f0f5"; +$fa-var-dashboard: "\f0e4"; +$fa-var-dashcube: "\f210"; +$fa-var-database: "\f1c0"; +$fa-var-deaf: "\f2a4"; +$fa-var-deafness: "\f2a4"; +$fa-var-dedent: "\f03b"; +$fa-var-delicious: "\f1a5"; +$fa-var-desktop: "\f108"; +$fa-var-deviantart: "\f1bd"; +$fa-var-diamond: "\f219"; +$fa-var-digg: "\f1a6"; +$fa-var-dollar: "\f155"; +$fa-var-dot-circle-o: "\f192"; +$fa-var-download: "\f019"; +$fa-var-dribbble: "\f17d"; +$fa-var-drivers-license: "\f2c2"; +$fa-var-drivers-license-o: "\f2c3"; +$fa-var-dropbox: "\f16b"; +$fa-var-drupal: "\f1a9"; +$fa-var-edge: "\f282"; +$fa-var-edit: "\f044"; +$fa-var-eercast: "\f2da"; +$fa-var-eject: "\f052"; +$fa-var-ellipsis-h: "\f141"; +$fa-var-ellipsis-v: "\f142"; +$fa-var-empire: "\f1d1"; +$fa-var-envelope: "\f0e0"; +$fa-var-envelope-o: "\f003"; +$fa-var-envelope-open: "\f2b6"; +$fa-var-envelope-open-o: "\f2b7"; +$fa-var-envelope-square: "\f199"; +$fa-var-envira: "\f299"; +$fa-var-eraser: "\f12d"; +$fa-var-etsy: "\f2d7"; +$fa-var-eur: "\f153"; +$fa-var-euro: "\f153"; +$fa-var-exchange: "\f0ec"; +$fa-var-exclamation: "\f12a"; +$fa-var-exclamation-circle: "\f06a"; +$fa-var-exclamation-triangle: "\f071"; +$fa-var-expand: "\f065"; +$fa-var-expeditedssl: "\f23e"; +$fa-var-external-link: "\f08e"; +$fa-var-external-link-square: "\f14c"; +$fa-var-eye: "\f06e"; +$fa-var-eye-slash: "\f070"; +$fa-var-eyedropper: "\f1fb"; +$fa-var-fa: "\f2b4"; +$fa-var-facebook: "\f09a"; +$fa-var-facebook-f: "\f09a"; +$fa-var-facebook-official: "\f230"; +$fa-var-facebook-square: "\f082"; +$fa-var-fast-backward: "\f049"; +$fa-var-fast-forward: "\f050"; +$fa-var-fax: "\f1ac"; +$fa-var-feed: "\f09e"; +$fa-var-female: "\f182"; +$fa-var-fighter-jet: "\f0fb"; +$fa-var-file: "\f15b"; +$fa-var-file-archive-o: "\f1c6"; +$fa-var-file-audio-o: "\f1c7"; +$fa-var-file-code-o: "\f1c9"; +$fa-var-file-excel-o: "\f1c3"; +$fa-var-file-image-o: "\f1c5"; +$fa-var-file-movie-o: "\f1c8"; +$fa-var-file-o: "\f016"; +$fa-var-file-pdf-o: "\f1c1"; +$fa-var-file-photo-o: "\f1c5"; +$fa-var-file-picture-o: "\f1c5"; +$fa-var-file-powerpoint-o: "\f1c4"; +$fa-var-file-sound-o: "\f1c7"; +$fa-var-file-text: "\f15c"; +$fa-var-file-text-o: "\f0f6"; +$fa-var-file-video-o: "\f1c8"; +$fa-var-file-word-o: "\f1c2"; +$fa-var-file-zip-o: "\f1c6"; +$fa-var-files-o: "\f0c5"; +$fa-var-film: "\f008"; +$fa-var-filter: "\f0b0"; +$fa-var-fire: "\f06d"; +$fa-var-fire-extinguisher: "\f134"; +$fa-var-firefox: "\f269"; +$fa-var-first-order: "\f2b0"; +$fa-var-flag: "\f024"; +$fa-var-flag-checkered: "\f11e"; +$fa-var-flag-o: "\f11d"; +$fa-var-flash: "\f0e7"; +$fa-var-flask: "\f0c3"; +$fa-var-flickr: "\f16e"; +$fa-var-floppy-o: "\f0c7"; +$fa-var-folder: "\f07b"; +$fa-var-folder-o: "\f114"; +$fa-var-folder-open: "\f07c"; +$fa-var-folder-open-o: "\f115"; +$fa-var-font: "\f031"; +$fa-var-font-awesome: "\f2b4"; +$fa-var-fonticons: "\f280"; +$fa-var-fort-awesome: "\f286"; +$fa-var-forumbee: "\f211"; +$fa-var-forward: "\f04e"; +$fa-var-foursquare: "\f180"; +$fa-var-free-code-camp: "\f2c5"; +$fa-var-frown-o: "\f119"; +$fa-var-futbol-o: "\f1e3"; +$fa-var-gamepad: "\f11b"; +$fa-var-gavel: "\f0e3"; +$fa-var-gbp: "\f154"; +$fa-var-ge: "\f1d1"; +$fa-var-gear: "\f013"; +$fa-var-gears: "\f085"; +$fa-var-genderless: "\f22d"; +$fa-var-get-pocket: "\f265"; +$fa-var-gg: "\f260"; +$fa-var-gg-circle: "\f261"; +$fa-var-gift: "\f06b"; +$fa-var-git: "\f1d3"; +$fa-var-git-square: "\f1d2"; +$fa-var-github: "\f09b"; +$fa-var-github-alt: "\f113"; +$fa-var-github-square: "\f092"; +$fa-var-gitlab: "\f296"; +$fa-var-gittip: "\f184"; +$fa-var-glass: "\f000"; +$fa-var-glide: "\f2a5"; +$fa-var-glide-g: "\f2a6"; +$fa-var-globe: "\f0ac"; +$fa-var-google: "\f1a0"; +$fa-var-google-plus: "\f0d5"; +$fa-var-google-plus-circle: "\f2b3"; +$fa-var-google-plus-official: "\f2b3"; +$fa-var-google-plus-square: "\f0d4"; +$fa-var-google-wallet: "\f1ee"; +$fa-var-graduation-cap: "\f19d"; +$fa-var-gratipay: "\f184"; +$fa-var-grav: "\f2d6"; +$fa-var-group: "\f0c0"; +$fa-var-h-square: "\f0fd"; +$fa-var-hacker-news: "\f1d4"; +$fa-var-hand-grab-o: "\f255"; +$fa-var-hand-lizard-o: "\f258"; +$fa-var-hand-o-down: "\f0a7"; +$fa-var-hand-o-left: "\f0a5"; +$fa-var-hand-o-right: "\f0a4"; +$fa-var-hand-o-up: "\f0a6"; +$fa-var-hand-paper-o: "\f256"; +$fa-var-hand-peace-o: "\f25b"; +$fa-var-hand-pointer-o: "\f25a"; +$fa-var-hand-rock-o: "\f255"; +$fa-var-hand-scissors-o: "\f257"; +$fa-var-hand-spock-o: "\f259"; +$fa-var-hand-stop-o: "\f256"; +$fa-var-handshake-o: "\f2b5"; +$fa-var-hard-of-hearing: "\f2a4"; +$fa-var-hashtag: "\f292"; +$fa-var-hdd-o: "\f0a0"; +$fa-var-header: "\f1dc"; +$fa-var-headphones: "\f025"; +$fa-var-heart: "\f004"; +$fa-var-heart-o: "\f08a"; +$fa-var-heartbeat: "\f21e"; +$fa-var-history: "\f1da"; +$fa-var-home: "\f015"; +$fa-var-hospital-o: "\f0f8"; +$fa-var-hotel: "\f236"; +$fa-var-hourglass: "\f254"; +$fa-var-hourglass-1: "\f251"; +$fa-var-hourglass-2: "\f252"; +$fa-var-hourglass-3: "\f253"; +$fa-var-hourglass-end: "\f253"; +$fa-var-hourglass-half: "\f252"; +$fa-var-hourglass-o: "\f250"; +$fa-var-hourglass-start: "\f251"; +$fa-var-houzz: "\f27c"; +$fa-var-html5: "\f13b"; +$fa-var-i-cursor: "\f246"; +$fa-var-id-badge: "\f2c1"; +$fa-var-id-card: "\f2c2"; +$fa-var-id-card-o: "\f2c3"; +$fa-var-ils: "\f20b"; +$fa-var-image: "\f03e"; +$fa-var-imdb: "\f2d8"; +$fa-var-inbox: "\f01c"; +$fa-var-indent: "\f03c"; +$fa-var-industry: "\f275"; +$fa-var-info: "\f129"; +$fa-var-info-circle: "\f05a"; +$fa-var-inr: "\f156"; +$fa-var-instagram: "\f16d"; +$fa-var-institution: "\f19c"; +$fa-var-internet-explorer: "\f26b"; +$fa-var-intersex: "\f224"; +$fa-var-ioxhost: "\f208"; +$fa-var-italic: "\f033"; +$fa-var-joomla: "\f1aa"; +$fa-var-jpy: "\f157"; +$fa-var-jsfiddle: "\f1cc"; +$fa-var-key: "\f084"; +$fa-var-keyboard-o: "\f11c"; +$fa-var-krw: "\f159"; +$fa-var-language: "\f1ab"; +$fa-var-laptop: "\f109"; +$fa-var-lastfm: "\f202"; +$fa-var-lastfm-square: "\f203"; +$fa-var-leaf: "\f06c"; +$fa-var-leanpub: "\f212"; +$fa-var-legal: "\f0e3"; +$fa-var-lemon-o: "\f094"; +$fa-var-level-down: "\f149"; +$fa-var-level-up: "\f148"; +$fa-var-life-bouy: "\f1cd"; +$fa-var-life-buoy: "\f1cd"; +$fa-var-life-ring: "\f1cd"; +$fa-var-life-saver: "\f1cd"; +$fa-var-lightbulb-o: "\f0eb"; +$fa-var-line-chart: "\f201"; +$fa-var-link: "\f0c1"; +$fa-var-linkedin: "\f0e1"; +$fa-var-linkedin-square: "\f08c"; +$fa-var-linode: "\f2b8"; +$fa-var-linux: "\f17c"; +$fa-var-list: "\f03a"; +$fa-var-list-alt: "\f022"; +$fa-var-list-ol: "\f0cb"; +$fa-var-list-ul: "\f0ca"; +$fa-var-location-arrow: "\f124"; +$fa-var-lock: "\f023"; +$fa-var-long-arrow-down: "\f175"; +$fa-var-long-arrow-left: "\f177"; +$fa-var-long-arrow-right: "\f178"; +$fa-var-long-arrow-up: "\f176"; +$fa-var-low-vision: "\f2a8"; +$fa-var-magic: "\f0d0"; +$fa-var-magnet: "\f076"; +$fa-var-mail-forward: "\f064"; +$fa-var-mail-reply: "\f112"; +$fa-var-mail-reply-all: "\f122"; +$fa-var-male: "\f183"; +$fa-var-map: "\f279"; +$fa-var-map-marker: "\f041"; +$fa-var-map-o: "\f278"; +$fa-var-map-pin: "\f276"; +$fa-var-map-signs: "\f277"; +$fa-var-mars: "\f222"; +$fa-var-mars-double: "\f227"; +$fa-var-mars-stroke: "\f229"; +$fa-var-mars-stroke-h: "\f22b"; +$fa-var-mars-stroke-v: "\f22a"; +$fa-var-maxcdn: "\f136"; +$fa-var-meanpath: "\f20c"; +$fa-var-medium: "\f23a"; +$fa-var-medkit: "\f0fa"; +$fa-var-meetup: "\f2e0"; +$fa-var-meh-o: "\f11a"; +$fa-var-mercury: "\f223"; +$fa-var-microchip: "\f2db"; +$fa-var-microphone: "\f130"; +$fa-var-microphone-slash: "\f131"; +$fa-var-minus: "\f068"; +$fa-var-minus-circle: "\f056"; +$fa-var-minus-square: "\f146"; +$fa-var-minus-square-o: "\f147"; +$fa-var-mixcloud: "\f289"; +$fa-var-mobile: "\f10b"; +$fa-var-mobile-phone: "\f10b"; +$fa-var-modx: "\f285"; +$fa-var-money: "\f0d6"; +$fa-var-moon-o: "\f186"; +$fa-var-mortar-board: "\f19d"; +$fa-var-motorcycle: "\f21c"; +$fa-var-mouse-pointer: "\f245"; +$fa-var-music: "\f001"; +$fa-var-navicon: "\f0c9"; +$fa-var-neuter: "\f22c"; +$fa-var-newspaper-o: "\f1ea"; +$fa-var-object-group: "\f247"; +$fa-var-object-ungroup: "\f248"; +$fa-var-odnoklassniki: "\f263"; +$fa-var-odnoklassniki-square: "\f264"; +$fa-var-opencart: "\f23d"; +$fa-var-openid: "\f19b"; +$fa-var-opera: "\f26a"; +$fa-var-optin-monster: "\f23c"; +$fa-var-outdent: "\f03b"; +$fa-var-pagelines: "\f18c"; +$fa-var-paint-brush: "\f1fc"; +$fa-var-paper-plane: "\f1d8"; +$fa-var-paper-plane-o: "\f1d9"; +$fa-var-paperclip: "\f0c6"; +$fa-var-paragraph: "\f1dd"; +$fa-var-paste: "\f0ea"; +$fa-var-pause: "\f04c"; +$fa-var-pause-circle: "\f28b"; +$fa-var-pause-circle-o: "\f28c"; +$fa-var-paw: "\f1b0"; +$fa-var-paypal: "\f1ed"; +$fa-var-pencil: "\f040"; +$fa-var-pencil-square: "\f14b"; +$fa-var-pencil-square-o: "\f044"; +$fa-var-percent: "\f295"; +$fa-var-phone: "\f095"; +$fa-var-phone-square: "\f098"; +$fa-var-photo: "\f03e"; +$fa-var-picture-o: "\f03e"; +$fa-var-pie-chart: "\f200"; +$fa-var-pied-piper: "\f2ae"; +$fa-var-pied-piper-alt: "\f1a8"; +$fa-var-pied-piper-pp: "\f1a7"; +$fa-var-pinterest: "\f0d2"; +$fa-var-pinterest-p: "\f231"; +$fa-var-pinterest-square: "\f0d3"; +$fa-var-plane: "\f072"; +$fa-var-play: "\f04b"; +$fa-var-play-circle: "\f144"; +$fa-var-play-circle-o: "\f01d"; +$fa-var-plug: "\f1e6"; +$fa-var-plus: "\f067"; +$fa-var-plus-circle: "\f055"; +$fa-var-plus-square: "\f0fe"; +$fa-var-plus-square-o: "\f196"; +$fa-var-podcast: "\f2ce"; +$fa-var-power-off: "\f011"; +$fa-var-print: "\f02f"; +$fa-var-product-hunt: "\f288"; +$fa-var-puzzle-piece: "\f12e"; +$fa-var-qq: "\f1d6"; +$fa-var-qrcode: "\f029"; +$fa-var-question: "\f128"; +$fa-var-question-circle: "\f059"; +$fa-var-question-circle-o: "\f29c"; +$fa-var-quora: "\f2c4"; +$fa-var-quote-left: "\f10d"; +$fa-var-quote-right: "\f10e"; +$fa-var-ra: "\f1d0"; +$fa-var-random: "\f074"; +$fa-var-ravelry: "\f2d9"; +$fa-var-rebel: "\f1d0"; +$fa-var-recycle: "\f1b8"; +$fa-var-reddit: "\f1a1"; +$fa-var-reddit-alien: "\f281"; +$fa-var-reddit-square: "\f1a2"; +$fa-var-refresh: "\f021"; +$fa-var-registered: "\f25d"; +$fa-var-remove: "\f00d"; +$fa-var-renren: "\f18b"; +$fa-var-reorder: "\f0c9"; +$fa-var-repeat: "\f01e"; +$fa-var-reply: "\f112"; +$fa-var-reply-all: "\f122"; +$fa-var-resistance: "\f1d0"; +$fa-var-retweet: "\f079"; +$fa-var-rmb: "\f157"; +$fa-var-road: "\f018"; +$fa-var-rocket: "\f135"; +$fa-var-rotate-left: "\f0e2"; +$fa-var-rotate-right: "\f01e"; +$fa-var-rouble: "\f158"; +$fa-var-rss: "\f09e"; +$fa-var-rss-square: "\f143"; +$fa-var-rub: "\f158"; +$fa-var-ruble: "\f158"; +$fa-var-rupee: "\f156"; +$fa-var-s15: "\f2cd"; +$fa-var-safari: "\f267"; +$fa-var-save: "\f0c7"; +$fa-var-scissors: "\f0c4"; +$fa-var-scribd: "\f28a"; +$fa-var-search: "\f002"; +$fa-var-search-minus: "\f010"; +$fa-var-search-plus: "\f00e"; +$fa-var-sellsy: "\f213"; +$fa-var-send: "\f1d8"; +$fa-var-send-o: "\f1d9"; +$fa-var-server: "\f233"; +$fa-var-share: "\f064"; +$fa-var-share-alt: "\f1e0"; +$fa-var-share-alt-square: "\f1e1"; +$fa-var-share-square: "\f14d"; +$fa-var-share-square-o: "\f045"; +$fa-var-shekel: "\f20b"; +$fa-var-sheqel: "\f20b"; +$fa-var-shield: "\f132"; +$fa-var-ship: "\f21a"; +$fa-var-shirtsinbulk: "\f214"; +$fa-var-shopping-bag: "\f290"; +$fa-var-shopping-basket: "\f291"; +$fa-var-shopping-cart: "\f07a"; +$fa-var-shower: "\f2cc"; +$fa-var-sign-in: "\f090"; +$fa-var-sign-language: "\f2a7"; +$fa-var-sign-out: "\f08b"; +$fa-var-signal: "\f012"; +$fa-var-signing: "\f2a7"; +$fa-var-simplybuilt: "\f215"; +$fa-var-sitemap: "\f0e8"; +$fa-var-skyatlas: "\f216"; +$fa-var-skype: "\f17e"; +$fa-var-slack: "\f198"; +$fa-var-sliders: "\f1de"; +$fa-var-slideshare: "\f1e7"; +$fa-var-smile-o: "\f118"; +$fa-var-snapchat: "\f2ab"; +$fa-var-snapchat-ghost: "\f2ac"; +$fa-var-snapchat-square: "\f2ad"; +$fa-var-snowflake-o: "\f2dc"; +$fa-var-soccer-ball-o: "\f1e3"; +$fa-var-sort: "\f0dc"; +$fa-var-sort-alpha-asc: "\f15d"; +$fa-var-sort-alpha-desc: "\f15e"; +$fa-var-sort-amount-asc: "\f160"; +$fa-var-sort-amount-desc: "\f161"; +$fa-var-sort-asc: "\f0de"; +$fa-var-sort-desc: "\f0dd"; +$fa-var-sort-down: "\f0dd"; +$fa-var-sort-numeric-asc: "\f162"; +$fa-var-sort-numeric-desc: "\f163"; +$fa-var-sort-up: "\f0de"; +$fa-var-soundcloud: "\f1be"; +$fa-var-space-shuttle: "\f197"; +$fa-var-spinner: "\f110"; +$fa-var-spoon: "\f1b1"; +$fa-var-spotify: "\f1bc"; +$fa-var-square: "\f0c8"; +$fa-var-square-o: "\f096"; +$fa-var-stack-exchange: "\f18d"; +$fa-var-stack-overflow: "\f16c"; +$fa-var-star: "\f005"; +$fa-var-star-half: "\f089"; +$fa-var-star-half-empty: "\f123"; +$fa-var-star-half-full: "\f123"; +$fa-var-star-half-o: "\f123"; +$fa-var-star-o: "\f006"; +$fa-var-steam: "\f1b6"; +$fa-var-steam-square: "\f1b7"; +$fa-var-step-backward: "\f048"; +$fa-var-step-forward: "\f051"; +$fa-var-stethoscope: "\f0f1"; +$fa-var-sticky-note: "\f249"; +$fa-var-sticky-note-o: "\f24a"; +$fa-var-stop: "\f04d"; +$fa-var-stop-circle: "\f28d"; +$fa-var-stop-circle-o: "\f28e"; +$fa-var-street-view: "\f21d"; +$fa-var-strikethrough: "\f0cc"; +$fa-var-stumbleupon: "\f1a4"; +$fa-var-stumbleupon-circle: "\f1a3"; +$fa-var-subscript: "\f12c"; +$fa-var-subway: "\f239"; +$fa-var-suitcase: "\f0f2"; +$fa-var-sun-o: "\f185"; +$fa-var-superpowers: "\f2dd"; +$fa-var-superscript: "\f12b"; +$fa-var-support: "\f1cd"; +$fa-var-table: "\f0ce"; +$fa-var-tablet: "\f10a"; +$fa-var-tachometer: "\f0e4"; +$fa-var-tag: "\f02b"; +$fa-var-tags: "\f02c"; +$fa-var-tasks: "\f0ae"; +$fa-var-taxi: "\f1ba"; +$fa-var-telegram: "\f2c6"; +$fa-var-television: "\f26c"; +$fa-var-tencent-weibo: "\f1d5"; +$fa-var-terminal: "\f120"; +$fa-var-text-height: "\f034"; +$fa-var-text-width: "\f035"; +$fa-var-th: "\f00a"; +$fa-var-th-large: "\f009"; +$fa-var-th-list: "\f00b"; +$fa-var-themeisle: "\f2b2"; +$fa-var-thermometer: "\f2c7"; +$fa-var-thermometer-0: "\f2cb"; +$fa-var-thermometer-1: "\f2ca"; +$fa-var-thermometer-2: "\f2c9"; +$fa-var-thermometer-3: "\f2c8"; +$fa-var-thermometer-4: "\f2c7"; +$fa-var-thermometer-empty: "\f2cb"; +$fa-var-thermometer-full: "\f2c7"; +$fa-var-thermometer-half: "\f2c9"; +$fa-var-thermometer-quarter: "\f2ca"; +$fa-var-thermometer-three-quarters: "\f2c8"; +$fa-var-thumb-tack: "\f08d"; +$fa-var-thumbs-down: "\f165"; +$fa-var-thumbs-o-down: "\f088"; +$fa-var-thumbs-o-up: "\f087"; +$fa-var-thumbs-up: "\f164"; +$fa-var-ticket: "\f145"; +$fa-var-times: "\f00d"; +$fa-var-times-circle: "\f057"; +$fa-var-times-circle-o: "\f05c"; +$fa-var-times-rectangle: "\f2d3"; +$fa-var-times-rectangle-o: "\f2d4"; +$fa-var-tint: "\f043"; +$fa-var-toggle-down: "\f150"; +$fa-var-toggle-left: "\f191"; +$fa-var-toggle-off: "\f204"; +$fa-var-toggle-on: "\f205"; +$fa-var-toggle-right: "\f152"; +$fa-var-toggle-up: "\f151"; +$fa-var-trademark: "\f25c"; +$fa-var-train: "\f238"; +$fa-var-transgender: "\f224"; +$fa-var-transgender-alt: "\f225"; +$fa-var-trash: "\f1f8"; +$fa-var-trash-o: "\f014"; +$fa-var-tree: "\f1bb"; +$fa-var-trello: "\f181"; +$fa-var-tripadvisor: "\f262"; +$fa-var-trophy: "\f091"; +$fa-var-truck: "\f0d1"; +$fa-var-try: "\f195"; +$fa-var-tty: "\f1e4"; +$fa-var-tumblr: "\f173"; +$fa-var-tumblr-square: "\f174"; +$fa-var-turkish-lira: "\f195"; +$fa-var-tv: "\f26c"; +$fa-var-twitch: "\f1e8"; +$fa-var-twitter: "\f099"; +$fa-var-twitter-square: "\f081"; +$fa-var-umbrella: "\f0e9"; +$fa-var-underline: "\f0cd"; +$fa-var-undo: "\f0e2"; +$fa-var-universal-access: "\f29a"; +$fa-var-university: "\f19c"; +$fa-var-unlink: "\f127"; +$fa-var-unlock: "\f09c"; +$fa-var-unlock-alt: "\f13e"; +$fa-var-unsorted: "\f0dc"; +$fa-var-upload: "\f093"; +$fa-var-usb: "\f287"; +$fa-var-usd: "\f155"; +$fa-var-user: "\f007"; +$fa-var-user-circle: "\f2bd"; +$fa-var-user-circle-o: "\f2be"; +$fa-var-user-md: "\f0f0"; +$fa-var-user-o: "\f2c0"; +$fa-var-user-plus: "\f234"; +$fa-var-user-secret: "\f21b"; +$fa-var-user-times: "\f235"; +$fa-var-users: "\f0c0"; +$fa-var-vcard: "\f2bb"; +$fa-var-vcard-o: "\f2bc"; +$fa-var-venus: "\f221"; +$fa-var-venus-double: "\f226"; +$fa-var-venus-mars: "\f228"; +$fa-var-viacoin: "\f237"; +$fa-var-viadeo: "\f2a9"; +$fa-var-viadeo-square: "\f2aa"; +$fa-var-video-camera: "\f03d"; +$fa-var-vimeo: "\f27d"; +$fa-var-vimeo-square: "\f194"; +$fa-var-vine: "\f1ca"; +$fa-var-vk: "\f189"; +$fa-var-volume-control-phone: "\f2a0"; +$fa-var-volume-down: "\f027"; +$fa-var-volume-off: "\f026"; +$fa-var-volume-up: "\f028"; +$fa-var-warning: "\f071"; +$fa-var-wechat: "\f1d7"; +$fa-var-weibo: "\f18a"; +$fa-var-weixin: "\f1d7"; +$fa-var-whatsapp: "\f232"; +$fa-var-wheelchair: "\f193"; +$fa-var-wheelchair-alt: "\f29b"; +$fa-var-wifi: "\f1eb"; +$fa-var-wikipedia-w: "\f266"; +$fa-var-window-close: "\f2d3"; +$fa-var-window-close-o: "\f2d4"; +$fa-var-window-maximize: "\f2d0"; +$fa-var-window-minimize: "\f2d1"; +$fa-var-window-restore: "\f2d2"; +$fa-var-windows: "\f17a"; +$fa-var-won: "\f159"; +$fa-var-wordpress: "\f19a"; +$fa-var-wpbeginner: "\f297"; +$fa-var-wpexplorer: "\f2de"; +$fa-var-wpforms: "\f298"; +$fa-var-wrench: "\f0ad"; +$fa-var-xing: "\f168"; +$fa-var-xing-square: "\f169"; +$fa-var-y-combinator: "\f23b"; +$fa-var-y-combinator-square: "\f1d4"; +$fa-var-yahoo: "\f19e"; +$fa-var-yc: "\f23b"; +$fa-var-yc-square: "\f1d4"; +$fa-var-yelp: "\f1e9"; +$fa-var-yen: "\f157"; +$fa-var-yoast: "\f2b1"; +$fa-var-youtube: "\f167"; +$fa-var-youtube-play: "\f16a"; +$fa-var-youtube-square: "\f166"; + diff --git a/public/fonts/font-awesome-4.7.0/scss/font-awesome.scss b/public/fonts/font-awesome-4.7.0/scss/font-awesome.scss new file mode 100755 index 000000000..f1c83aaa5 --- /dev/null +++ b/public/fonts/font-awesome-4.7.0/scss/font-awesome.scss @@ -0,0 +1,18 @@ +/*! + * Font Awesome 4.7.0 by @davegandy - http://fontawesome.io - @fontawesome + * License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License) + */ + +@import "variables"; +@import "mixins"; +@import "path"; +@import "core"; +@import "larger"; +@import "fixed-width"; +@import "list"; +@import "bordered-pulled"; +@import "animated"; +@import "rotated-flipped"; +@import "stacked"; +@import "icons"; +@import "screen-reader"; diff --git a/public/fonts/montserrat/Montserrat-Black.ttf b/public/fonts/montserrat/Montserrat-Black.ttf new file mode 100755 index 000000000..f0d24ad27 Binary files /dev/null and b/public/fonts/montserrat/Montserrat-Black.ttf differ diff --git a/public/fonts/montserrat/Montserrat-BlackItalic.ttf b/public/fonts/montserrat/Montserrat-BlackItalic.ttf new file mode 100755 index 000000000..5ce4afcc7 Binary files /dev/null and b/public/fonts/montserrat/Montserrat-BlackItalic.ttf differ diff --git a/public/fonts/montserrat/Montserrat-Bold.ttf b/public/fonts/montserrat/Montserrat-Bold.ttf new file mode 100755 index 000000000..9a425b9a6 Binary files /dev/null and b/public/fonts/montserrat/Montserrat-Bold.ttf differ diff --git a/public/fonts/montserrat/Montserrat-BoldItalic.ttf b/public/fonts/montserrat/Montserrat-BoldItalic.ttf new file mode 100755 index 000000000..ed61ca71d Binary files /dev/null and b/public/fonts/montserrat/Montserrat-BoldItalic.ttf differ diff --git a/public/fonts/montserrat/Montserrat-ExtraBold.ttf b/public/fonts/montserrat/Montserrat-ExtraBold.ttf new file mode 100755 index 000000000..6725d537d Binary files /dev/null and b/public/fonts/montserrat/Montserrat-ExtraBold.ttf differ diff --git a/public/fonts/montserrat/Montserrat-ExtraBoldItalic.ttf b/public/fonts/montserrat/Montserrat-ExtraBoldItalic.ttf new file mode 100755 index 000000000..107f98d41 Binary files /dev/null and b/public/fonts/montserrat/Montserrat-ExtraBoldItalic.ttf differ diff --git a/public/fonts/montserrat/Montserrat-ExtraLight.ttf b/public/fonts/montserrat/Montserrat-ExtraLight.ttf new file mode 100755 index 000000000..2967eb6e6 Binary files /dev/null and b/public/fonts/montserrat/Montserrat-ExtraLight.ttf differ diff --git a/public/fonts/montserrat/Montserrat-ExtraLightItalic.ttf b/public/fonts/montserrat/Montserrat-ExtraLightItalic.ttf new file mode 100755 index 000000000..5d62085f1 Binary files /dev/null and b/public/fonts/montserrat/Montserrat-ExtraLightItalic.ttf differ diff --git a/public/fonts/montserrat/Montserrat-Italic.ttf b/public/fonts/montserrat/Montserrat-Italic.ttf new file mode 100755 index 000000000..00fadbea8 Binary files /dev/null and b/public/fonts/montserrat/Montserrat-Italic.ttf differ diff --git a/public/fonts/montserrat/Montserrat-Light.ttf b/public/fonts/montserrat/Montserrat-Light.ttf new file mode 100755 index 000000000..a3cf5f583 Binary files /dev/null and b/public/fonts/montserrat/Montserrat-Light.ttf differ diff --git a/public/fonts/montserrat/Montserrat-LightItalic.ttf b/public/fonts/montserrat/Montserrat-LightItalic.ttf new file mode 100755 index 000000000..6dba2197f Binary files /dev/null and b/public/fonts/montserrat/Montserrat-LightItalic.ttf differ diff --git a/public/fonts/montserrat/Montserrat-Medium.ttf b/public/fonts/montserrat/Montserrat-Medium.ttf new file mode 100755 index 000000000..db5b1af89 Binary files /dev/null and b/public/fonts/montserrat/Montserrat-Medium.ttf differ diff --git a/public/fonts/montserrat/Montserrat-MediumItalic.ttf b/public/fonts/montserrat/Montserrat-MediumItalic.ttf new file mode 100755 index 000000000..16dbf4c4a Binary files /dev/null and b/public/fonts/montserrat/Montserrat-MediumItalic.ttf differ diff --git a/public/fonts/montserrat/Montserrat-Regular.ttf b/public/fonts/montserrat/Montserrat-Regular.ttf new file mode 100755 index 000000000..2a2b2aaa6 Binary files /dev/null and b/public/fonts/montserrat/Montserrat-Regular.ttf differ diff --git a/public/fonts/montserrat/Montserrat-SemiBold.ttf b/public/fonts/montserrat/Montserrat-SemiBold.ttf new file mode 100755 index 000000000..0ecc66708 Binary files /dev/null and b/public/fonts/montserrat/Montserrat-SemiBold.ttf differ diff --git a/public/fonts/montserrat/Montserrat-SemiBoldItalic.ttf b/public/fonts/montserrat/Montserrat-SemiBoldItalic.ttf new file mode 100755 index 000000000..39f2393ed Binary files /dev/null and b/public/fonts/montserrat/Montserrat-SemiBoldItalic.ttf differ diff --git a/public/fonts/montserrat/Montserrat-Thin.ttf b/public/fonts/montserrat/Montserrat-Thin.ttf new file mode 100755 index 000000000..6a394e755 Binary files /dev/null and b/public/fonts/montserrat/Montserrat-Thin.ttf differ diff --git a/public/fonts/montserrat/Montserrat-ThinItalic.ttf b/public/fonts/montserrat/Montserrat-ThinItalic.ttf new file mode 100755 index 000000000..8eeeaa4c6 Binary files /dev/null and b/public/fonts/montserrat/Montserrat-ThinItalic.ttf differ diff --git a/public/fonts/montserrat/OFL.txt b/public/fonts/montserrat/OFL.txt new file mode 100755 index 000000000..f435ed8b5 --- /dev/null +++ b/public/fonts/montserrat/OFL.txt @@ -0,0 +1,93 @@ +Copyright 2011 The Montserrat Project Authors (https://github.com/JulietaUla/Montserrat) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/public/fonts/poppins/Poppins-Black.ttf b/public/fonts/poppins/Poppins-Black.ttf new file mode 100755 index 000000000..4d409e03e Binary files /dev/null and b/public/fonts/poppins/Poppins-Black.ttf differ diff --git a/public/fonts/poppins/Poppins-BlackItalic.ttf b/public/fonts/poppins/Poppins-BlackItalic.ttf new file mode 100755 index 000000000..f3c5e0af0 Binary files /dev/null and b/public/fonts/poppins/Poppins-BlackItalic.ttf differ diff --git a/public/fonts/poppins/Poppins-Bold.ttf b/public/fonts/poppins/Poppins-Bold.ttf new file mode 100755 index 000000000..44313ca44 Binary files /dev/null and b/public/fonts/poppins/Poppins-Bold.ttf differ diff --git a/public/fonts/poppins/Poppins-BoldItalic.ttf b/public/fonts/poppins/Poppins-BoldItalic.ttf new file mode 100755 index 000000000..939fc7d4e Binary files /dev/null and b/public/fonts/poppins/Poppins-BoldItalic.ttf differ diff --git a/public/fonts/poppins/Poppins-ExtraBold.ttf b/public/fonts/poppins/Poppins-ExtraBold.ttf new file mode 100755 index 000000000..88d0f1ebf Binary files /dev/null and b/public/fonts/poppins/Poppins-ExtraBold.ttf differ diff --git a/public/fonts/poppins/Poppins-ExtraBoldItalic.ttf b/public/fonts/poppins/Poppins-ExtraBoldItalic.ttf new file mode 100755 index 000000000..da7a257ad Binary files /dev/null and b/public/fonts/poppins/Poppins-ExtraBoldItalic.ttf differ diff --git a/public/fonts/poppins/Poppins-ExtraLight.ttf b/public/fonts/poppins/Poppins-ExtraLight.ttf new file mode 100755 index 000000000..4620a4218 Binary files /dev/null and b/public/fonts/poppins/Poppins-ExtraLight.ttf differ diff --git a/public/fonts/poppins/Poppins-ExtraLightItalic.ttf b/public/fonts/poppins/Poppins-ExtraLightItalic.ttf new file mode 100755 index 000000000..2c5ad2f82 Binary files /dev/null and b/public/fonts/poppins/Poppins-ExtraLightItalic.ttf differ diff --git a/public/fonts/poppins/Poppins-Italic.ttf b/public/fonts/poppins/Poppins-Italic.ttf new file mode 100755 index 000000000..8efebbf6a Binary files /dev/null and b/public/fonts/poppins/Poppins-Italic.ttf differ diff --git a/public/fonts/poppins/Poppins-Light.ttf b/public/fonts/poppins/Poppins-Light.ttf new file mode 100755 index 000000000..8a6ac6855 Binary files /dev/null and b/public/fonts/poppins/Poppins-Light.ttf differ diff --git a/public/fonts/poppins/Poppins-LightItalic.ttf b/public/fonts/poppins/Poppins-LightItalic.ttf new file mode 100755 index 000000000..b8f46a67a Binary files /dev/null and b/public/fonts/poppins/Poppins-LightItalic.ttf differ diff --git a/public/fonts/poppins/Poppins-Medium.ttf b/public/fonts/poppins/Poppins-Medium.ttf new file mode 100755 index 000000000..5b46f1985 Binary files /dev/null and b/public/fonts/poppins/Poppins-Medium.ttf differ diff --git a/public/fonts/poppins/Poppins-MediumItalic.ttf b/public/fonts/poppins/Poppins-MediumItalic.ttf new file mode 100755 index 000000000..e362e5701 Binary files /dev/null and b/public/fonts/poppins/Poppins-MediumItalic.ttf differ diff --git a/public/fonts/poppins/Poppins-Regular.ttf b/public/fonts/poppins/Poppins-Regular.ttf new file mode 100755 index 000000000..246a861a7 Binary files /dev/null and b/public/fonts/poppins/Poppins-Regular.ttf differ diff --git a/public/fonts/poppins/Poppins-SemiBold.ttf b/public/fonts/poppins/Poppins-SemiBold.ttf new file mode 100755 index 000000000..3bbad2a8b Binary files /dev/null and b/public/fonts/poppins/Poppins-SemiBold.ttf differ diff --git a/public/fonts/poppins/Poppins-SemiBoldItalic.ttf b/public/fonts/poppins/Poppins-SemiBoldItalic.ttf new file mode 100755 index 000000000..74a7c43ba Binary files /dev/null and b/public/fonts/poppins/Poppins-SemiBoldItalic.ttf differ diff --git a/public/fonts/poppins/Poppins-Thin.ttf b/public/fonts/poppins/Poppins-Thin.ttf new file mode 100755 index 000000000..205b2843a Binary files /dev/null and b/public/fonts/poppins/Poppins-Thin.ttf differ diff --git a/public/fonts/poppins/Poppins-ThinItalic.ttf b/public/fonts/poppins/Poppins-ThinItalic.ttf new file mode 100755 index 000000000..2f4b05e74 Binary files /dev/null and b/public/fonts/poppins/Poppins-ThinItalic.ttf differ diff --git a/public/fonts/ubuntu/UFL.txt b/public/fonts/ubuntu/UFL.txt new file mode 100755 index 000000000..ae78a8f94 --- /dev/null +++ b/public/fonts/ubuntu/UFL.txt @@ -0,0 +1,96 @@ +------------------------------- +UBUNTU FONT LICENCE Version 1.0 +------------------------------- + +PREAMBLE +This licence allows the licensed fonts to be used, studied, modified and +redistributed freely. The fonts, including any derivative works, can be +bundled, embedded, and redistributed provided the terms of this licence +are met. The fonts and derivatives, however, cannot be released under +any other licence. The requirement for fonts to remain under this +licence does not require any document created using the fonts or their +derivatives to be published under this licence, as long as the primary +purpose of the document is not to be a vehicle for the distribution of +the fonts. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this licence and clearly marked as such. This may +include source files, build scripts and documentation. + +"Original Version" refers to the collection of Font Software components +as received under this licence. + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to +a new environment. + +"Copyright Holder(s)" refers to all individuals and companies who have a +copyright ownership of the Font Software. + +"Substantially Changed" refers to Modified Versions which can be easily +identified as dissimilar to the Font Software by users of the Font +Software comparing the Original Version with the Modified Version. + +To "Propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification and with or without charging +a redistribution fee), making available to the public, and in some +countries other activities as well. + +PERMISSION & CONDITIONS +This licence does not grant any rights under trademark law and all such +rights are reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of the Font Software, to propagate the Font Software, subject to +the below conditions: + +1) Each copy of the Font Software must contain the above copyright +notice and this licence. These can be included either as stand-alone +text files, human-readable headers or in the appropriate machine- +readable metadata fields within text or binary files as long as those +fields can be easily viewed by the user. + +2) The font name complies with the following: +(a) The Original Version must retain its name, unmodified. +(b) Modified Versions which are Substantially Changed must be renamed to +avoid use of the name of the Original Version or similar names entirely. +(c) Modified Versions which are not Substantially Changed must be +renamed to both (i) retain the name of the Original Version and (ii) add +additional naming elements to distinguish the Modified Version from the +Original Version. The name of such Modified Versions must be the name of +the Original Version, with "derivative X" where X represents the name of +the new work, appended to that name. + +3) The name(s) of the Copyright Holder(s) and any contributor to the +Font Software shall not be used to promote, endorse or advertise any +Modified Version, except (i) as required by this licence, (ii) to +acknowledge the contribution(s) of the Copyright Holder(s) or (iii) with +their explicit written permission. + +4) The Font Software, modified or unmodified, in part or in whole, must +be distributed entirely under this licence, and must not be distributed +under any other licence. The requirement for fonts to remain under this +licence does not affect any document created using the Font Software, +except any version of the Font Software extracted from a document +created using the Font Software may only be distributed under this +licence. + +TERMINATION +This licence becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF +COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM OTHER +DEALINGS IN THE FONT SOFTWARE. diff --git a/public/fonts/ubuntu/Ubuntu-Bold.ttf b/public/fonts/ubuntu/Ubuntu-Bold.ttf new file mode 100755 index 000000000..7b855154e Binary files /dev/null and b/public/fonts/ubuntu/Ubuntu-Bold.ttf differ diff --git a/public/fonts/ubuntu/Ubuntu-BoldItalic.ttf b/public/fonts/ubuntu/Ubuntu-BoldItalic.ttf new file mode 100755 index 000000000..7db9e20ca Binary files /dev/null and b/public/fonts/ubuntu/Ubuntu-BoldItalic.ttf differ diff --git a/public/fonts/ubuntu/Ubuntu-Italic.ttf b/public/fonts/ubuntu/Ubuntu-Italic.ttf new file mode 100755 index 000000000..9621a3987 Binary files /dev/null and b/public/fonts/ubuntu/Ubuntu-Italic.ttf differ diff --git a/public/fonts/ubuntu/Ubuntu-Light.ttf b/public/fonts/ubuntu/Ubuntu-Light.ttf new file mode 100755 index 000000000..6a84adc7b Binary files /dev/null and b/public/fonts/ubuntu/Ubuntu-Light.ttf differ diff --git a/public/fonts/ubuntu/Ubuntu-LightItalic.ttf b/public/fonts/ubuntu/Ubuntu-LightItalic.ttf new file mode 100755 index 000000000..0295cbbeb Binary files /dev/null and b/public/fonts/ubuntu/Ubuntu-LightItalic.ttf differ diff --git a/public/fonts/ubuntu/Ubuntu-Medium.ttf b/public/fonts/ubuntu/Ubuntu-Medium.ttf new file mode 100755 index 000000000..c6f048e44 Binary files /dev/null and b/public/fonts/ubuntu/Ubuntu-Medium.ttf differ diff --git a/public/fonts/ubuntu/Ubuntu-MediumItalic.ttf b/public/fonts/ubuntu/Ubuntu-MediumItalic.ttf new file mode 100755 index 000000000..5fe5c5020 Binary files /dev/null and b/public/fonts/ubuntu/Ubuntu-MediumItalic.ttf differ diff --git a/public/fonts/ubuntu/Ubuntu-Regular.ttf b/public/fonts/ubuntu/Ubuntu-Regular.ttf new file mode 100755 index 000000000..2001d6ec6 Binary files /dev/null and b/public/fonts/ubuntu/Ubuntu-Regular.ttf differ diff --git a/public/js/audio-visuals.js b/public/js/audio-visuals.js new file mode 100644 index 000000000..3acfde99f --- /dev/null +++ b/public/js/audio-visuals.js @@ -0,0 +1,328 @@ +/** + * Audiovisuals + */ + +// Fix bug when editing hydra + +const avcanvas = document.getElementById("renderer"); +const ctx = avcanvas.getContext('2d'); +const audioCtx = new AudioContext(); +// const audioElement = document.createElement('audio'); +// document.body.appendChild(audioElement); +// audioElement.src = 'music/Bloodstream.mp3'; +// audioElement.loop = true; +const analyser = audioCtx.createAnalyser(); +analyser.fftSize = 1024;// 512 bins +// const player = audioCtx.createMediaElementSource(audioElement); +// player.connect(audioCtx.destination); +// player.connect(analyser); + +if (navigator.getUserMedia) { + navigator.getUserMedia({audio: true}, function (stream) { + microphone = audioCtx.createMediaStreamSource(stream); + microphone.connect(analyser); + //analyser.connect(audioCtx.destination); + //microphone.stop() + }); +} + +const marchingCanvas = document.getElementById("marchingCanvas"); +const babylonCanvas = document.getElementById("babylonCanvas"); + +let babylonInit = false; +let marchingInit = false; + +function firstVis() { + hideWebGl(); + + const start = function () { + //audioElement.play(); + + const results = new Uint8Array(analyser.frequencyBinCount); + + let background = new Image(); + background.src = "texture/synth.jpeg"; + + let draw = function () { + window.requestAnimationFrame(draw); + ctx.drawImage(background, 0, 0); + ctx.fillStyle = "white"; + analyser.getByteFrequencyData(results); + for (let i = 0; i < analyser.frequencyBinCount; i++) { + ctx.fillRect(i * 4, 300 + 256 - results[i] * 2, 3, 100); + } + }; + draw(); + }; + + start(); +} + + +function secondVis() { + hideWebGl(); + + let center_x, center_y, radius, bars, + x_end, y_end, bar_height, bar_width, + results; + bars = 100; + bar_width = 15; + + results = new Uint8Array(analyser.frequencyBinCount); + //audioElement.play(); + animate(); + + function animate() { + center_x = avcanvas.width / 2; + center_y = avcanvas.height / 2; + radius = 150; + + let gradient = ctx.createLinearGradient(0, 0, 0, avcanvas.height); + gradient.addColorStop(0, "rgb(255,78,231)"); + gradient.addColorStop(1, "rgb(43,204,197)"); + ctx.fillStyle = gradient; + ctx.fillRect(0, 0, avcanvas.width, avcanvas.height); + + ctx.beginPath(); + ctx.arc(center_x, center_y, radius, 0, 2 * Math.PI); + ctx.stroke(); + analyser.getByteFrequencyData(results); + for (let i = 0; i < bars; i++) { + let rads = Math.PI * 2 / bars; + bar_height = results[i] * 0.9; + let x = center_x + Math.cos(rads * i) * (radius); + let y = center_y + Math.sin(rads * i) * (radius); + x_end = center_x + Math.cos(rads * i) * (radius + bar_height); + y_end = center_y + Math.sin(rads * i) * (radius + bar_height); + drawBar(x, y, x_end, y_end, bar_width, results[i]); + } + window.requestAnimationFrame(animate); + } + + function drawBar(x1, y1, x2, y2, width, frequency) { + let lineColor = "rgb(" + frequency * 0.9 + ", " + frequency * 1.3 + ", " + 10 + ")"; + ctx.strokeStyle = lineColor; + ctx.lineWidth = width; + ctx.beginPath(); + ctx.moveTo(x1, y1); + ctx.lineTo(x2, y2); + ctx.stroke(); + } +} + +function thirdVis() { + hideWebGl(); + + //audioElement.play(); + + const results = new Uint8Array(analyser.frequencyBinCount); + + draw = function () { + window.requestAnimationFrame(draw); + + let grd = ctx.createLinearGradient(0, 0, 0, avcanvas.height - 150); + + grd.addColorStop(0.000, 'rgba(0, 255, 0, 1.000)'); + grd.addColorStop(0.200, 'rgba(0, 255, 0, 1.000)'); + grd.addColorStop(0.200, 'rgba(191, 255, 0, 1.000)'); + grd.addColorStop(0.400, 'rgba(191, 255, 0, 1.000)'); + grd.addColorStop(0.400, 'rgba(221, 255, 0, 1.000)'); + grd.addColorStop(0.600, 'rgba(221, 255, 0, 1.000)'); + grd.addColorStop(0.600, 'rgba(255, 229, 0, 1.000)'); + grd.addColorStop(0.800, 'rgba(255, 229, 0, 1.000)'); + grd.addColorStop(0.800, 'rgba(255, 144, 0, 1.000)'); + grd.addColorStop(1.000, 'rgba(255, 144, 0, 1.000)'); + grd.addColorStop(1.000, 'rgba(255, 50, 0, 1.000)'); + + + ctx.fillStyle = grd; + ctx.fillRect(0, 0, avcanvas.width, avcanvas.height); + + grd = ctx.createLinearGradient(0, avcanvas.height, 0, avcanvas.height / 2); + grd.addColorStop(0.000, 'rgba(0, 255, 0, 1.000)'); + grd.addColorStop(0.200, 'rgba(191, 255, 0, 1.000)'); + grd.addColorStop(0.400, 'rgba(221, 255, 0, 1.000)'); + grd.addColorStop(0.600, 'rgba(255, 229, 0, 1.000)'); + grd.addColorStop(0.800, 'rgba(255, 144, 0, 1.000)'); + grd.addColorStop(1.000, 'rgba(255, 50, 0, 1.000)'); + + ctx.fillStyle = grd; + + ctx.lineWidth = 10; + ctx.strokeStyle = grd; + ctx.beginPath(); + + let sliceWidth = avcanvas.width * 1.0 / analyser.frequencyBinCount; + let x = 0; + + //analyser.getByteFrequencyData(results); + analyser.getByteTimeDomainData(results); + + for (let i = 0; i < analyser.frequencyBinCount; i++) { + // ctx.fillRect(i * 3, avcanvas.height, 10, results[i] * -2.5) // upside down + + let v = results[i] / 128.0; + let y = v * avcanvas.height / 2; + + if (i === 0) { + ctx.moveTo(x, y); + } else { + ctx.lineTo(x, y); + } + + x += sliceWidth; + } + ctx.lineTo(avcanvas.width, avcanvas.height / 2); + ctx.stroke(); + }; + draw(); +} + +function fourthVis() { + //audioElement.play(); + + if (marchingInit) { + marchingCanvas.style.display = "block"; + babylonCanvas.style.display = "none"; + return; + } + + marchingInit = true; + Marching.export(window); + marchingCanvas.style.display = "block"; + babylonCanvas.style.display = "none"; + Marching.init(marchingCanvas); + + const s = march( + Marching.Repeat( + Marching.StairsDifference( + Marching.Sphere(2), + Marching.Repeat(Marching.Sphere(0.1), 0.25), + 0.25, + 10 + ), + 6 + ).translate(0, -1.5), + Marching.Plane().texture('cellular', {strength: -0.5, scale: 10}) + ) + .fog(0.1, Vec3(0, 0, 0.25)) + .background(Vec3(0, 0, 0.25)) + .render(); + + window.onresize = function () { + s.resolution(0.5) + } +} + +function fifthVis() { + //audioElement.play(); + + if (babylonInit) { + marchingCanvas.style.display = "none"; + babylonCanvas.style.display = "block"; + return; + } + + babylonInit = true; + marchingCanvas.style.display = "none"; + babylonCanvas.style.display = "block"; + let engine = new BABYLON.Engine(babylonCanvas, true); // Generate the BABYLON 3D engine + + // Create the scene space + let scene = new BABYLON.Scene(engine); + scene.clearColor = new BABYLON.Color3.Black(); + + // Add a camera to the scene and attach it to the canvas + let camera = new BABYLON.ArcRotateCamera("camera1", -Math.PI / 2, 6 * Math.PI / 12, 50, new BABYLON.Vector3(0, 5, 0), scene); + camera.attachControl(babylonCanvas, true); + + // Add lights to the scene + let light1 = new BABYLON.HemisphericLight("light1", new BABYLON.Vector3(1, 1, 0), scene); + let light2 = new BABYLON.PointLight("light2", new BABYLON.Vector3(0, 1, -1), scene); + + let url = "texture/blue-purple-gradient-linear-1920x1080-c2-191970-800080-a-135-f-14.png"; + let background = new BABYLON.Layer("back", url, scene); + background.isBackground = true; + + let groundMaterial = new BABYLON.GridMaterial("groundMaterial", scene); + groundMaterial.majorUnitFrequency = 5; + groundMaterial.minorUnitVisibility = 0.45; + groundMaterial.gridRatio = 2; + groundMaterial.backFaceCulling = false; + groundMaterial.mainColor = new BABYLON.Color3(0, 1, 1); + groundMaterial.lineColor = new BABYLON.Color3(0, 1.0, 1.0); + groundMaterial.opacity = 0.98; + + let ground = BABYLON.Mesh.CreateGroundFromHeightMap("ground", 'texture/heightMap.png', 150, 150, 150, 0, 15, scene, false); + ground.material = groundMaterial; + + + // BABYLON.SceneLoader.Append("../texture/drum_kit/", "scene.gltf", scene, function (scene) { + // // do something with the scene + // }); + + + let defaultGridMaterial = new BABYLON.GridMaterial("default", scene); + defaultGridMaterial.majorUnitFrequency = 5; + defaultGridMaterial.gridRatio = 0.5; + defaultGridMaterial.emissiveColor = new BABYLON.Color3(1, 0, 1); + + let mySphere = BABYLON.MeshBuilder.CreateSphere("mySphere", {diameter: 20}, scene); + mySphere.material = defaultGridMaterial; + mySphere.position.y += 10; + mySphere.position.z += 10; + + let spatialBoxArray = []; + let spatialBox; + let color; + const results = new Uint8Array(analyser.frequencyBinCount); + analyser.getByteFrequencyData(results); + for (let index = 0; index < analyser.frequencyBinCount - 150; index++) { + spatialBox = BABYLON.MeshBuilder.CreateBox("sb" + index, {height: 0.05, width: 0.05, depth: 0.1}, scene); + spatialBox.position = new BABYLON.Vector3(index / 20 - 9, 0, -38); + spatialBox.material = new BABYLON.StandardMaterial("sbm" + index, scene); + // spatialBox.material.alpha = 0.8; + // color = hsvToRgb(index / (analyser.frequencyBinCount) / 2 * 360, 100, 50), + spatialBox.material.diffuseColor = new BABYLON.Color3(1, 1, 1); + spatialBox.material.emissiveColor = new BABYLON.Color3(1, 1, 1); + spatialBoxArray.push(spatialBox); + } + + let gl = new BABYLON.GlowLayer("glow", scene); + + // Register a render loop to repeatedly render the scene + engine.runRenderLoop(function () { + //camera.alpha += 0.003; + scene.render(); + }); + + scene.registerBeforeRender(function () { + analyser.getByteFrequencyData(results); + for (let i = 0; i < analyser.frequencyBinCount - 150; i++) { + spatialBoxArray[i].position.y = 4 + results[i] * 0.015; + } + }); + + // Watch for browser/canvas resize events + window.addEventListener("resize", function () { + engine.resize(); + }); +} + +function hideWebGl() { + marchingCanvas.style.display = "none"; + babylonCanvas.style.display = "none"; +} + +function changeTo(song) { + if (song === "bloodstream") { + document.getElementById("bloodstream").classList.add("active"); + document.getElementById("tron").classList.remove("active"); + audioElement.src = 'music/Bloodstream.mp3'; + } else { + document.getElementById("bloodstream").classList.remove("active"); + document.getElementById("tron").classList.add("active"); + audioElement.src = 'music/TRON.mp3'; + } + audioElement.play(); +} \ No newline at end of file diff --git a/public/js/hydra-samples.js b/public/js/hydra-samples.js new file mode 100644 index 000000000..fb24c62c2 --- /dev/null +++ b/public/js/hydra-samples.js @@ -0,0 +1,66 @@ +export let hydra_samples = { + 'spiraltrap': 'shape(2).scale(0.1).modulate(noise(3,1)).rotate(0,0.2)\n' + + '.modulateRotate(osc(2),Math.sin(1*time)).modulateScale(osc(3,0.5)\n' + + '.rotate(0,0.5),-0.8).modulateRotate(src(o0),-1).rotate(0,0.5)\n' + + '.blend(src(o0),1.9).diff(o0,0.5).rotate(0,-0.1).luma(0.2).out()', + 'creepy': 'voronoi(5,1,5).brightness(()=>Math.random()*0.15)\n' + + '.modulatePixelate(noise(20,1),100)\n' + + '.out()', + 'wavelength': 'src(o0)\n' + + ' .modulate(o0, 0.0001)\n' + + ' .layer(shape(3, 0.3, 0).diff(shape()).rotate(0, 0.1).repeat([1, 1], 1).scale([0.1, 0.2, 0.5, 1, 2].fast()).scrollX(0, 0).luma(0.6).invert(() => Math.sin(time)))\n' + + ' .modulateRotate(osc(10, 0.1, 0.2), -0.01)\n' + + ' .scrollX(-0.001)\n' + + ' .out()', + 'flowery': 'osc(10,0.2,0.8).repeat(2,2).modulate(noise(5),0.001)\n' + + ' .pixelate(10,10)\n' + + ' .modulatePixelate(noise(0.9).kaleid(3).modulate(o0,0.09),10,0.9).contrast(1.6)\n' + + ' .out()', + 'split': 'gradient(1).color([1,0,0,1,0],[0,1,0,1,0],[0,0,1,1,0])\n' + + '.add(osc(2, 0.2, 2).rotate(2, -1).pixelate(-2))\n' + + '.out()', + 'pixels': 'noise(100, 0.4)\n' + + ' .pixelate(40,40)\n' + + ' .mult(osc(1000, 0.001, 0.8).rotate(Math.PI * 0.5))\n' + + ' .mult(osc(100, () => (time / 0.005) % 0.005, 0.5).color(0.5, 4, 4))\n' + + ' .kaleid(2)\n' + + ' .out()\n', + 'disc': 'noise()\n' + + ' .mult(osc(10,0.25,1))\n' + + ' .scrollY(1,0.25)\n' + + ' .pixelate([100,40,20,70].fast(0.25))\n' + + ' .modulateRotate(src(o0).scale(0.5),0.5)\n' + + ' .diff(src(o0).rotate([-0.05,0.05].fast(0.5)))\n' + + ' .out(o0)', + 'chocolate': 'voronoi()\n' + + ' .color(0.9,0.25,0.15)\n' + + ' .rotate(({time})=>(time%360)/2)\n' + + ' .modulate(osc(25,0.1,0.5)\n' + + ' .kaleid(50)\n' + + ' .scale(({time})=>Math.sin(time*1)*0.5+1)\n' + + ' .modulate(noise(0.6,0.5)),\n' + + ' 0.5)\n' + + ' .out(o0)', + 'algae': 'osc(10,-0.25,1).color(0,0,1).saturate(2).kaleid(50)\n' + + ' .mask(noise(25,2).modulateScale(noise(0.25,0.05)))\n' + + ' .modulateScale(osc(6,-0.5,2).kaleid(50))\n' + + ' .mult(osc(3,-0.25,2).kaleid(50))\n' + + ' .scale(0.5,0.5,0.75)\n' + + ' .out()', + 'acid': 'osc(8, 0.1, 1.5)\n' + + '.modulate(src(o0).rotate(0.5, 0.1))\n' + + '.modulate(src(o0).rotate(0.3, 0.1))\n' + + '.repeat()\n' + + '.modulateRotate(noise(5, 0.1, 100))\n' + + '.out()', + 'camera_trip': 's0.initCam()\n' + + 'osc(8, 0.1, 1.5)\n' + + '.modulate(src(o0).rotate(0.5, 0.1))\n' + + '.modulate(src(o0).rotate(0.3, 0.1))\n' + + '.repeat()\n' + + '.modulateRotate(noise(5, 0.1, 100))\n' + + '.diff(src(s0).repeat().kaleid())\n' + + '.diff(src(s0).rotate(0.2, 0.5).diff(src(s0).rotate(-0.2, 0.5)))\n' + + '.diff(shape(2).rotate(1, -0.3).scale(({time}) => Math.sin(time)))\n' + + '.out()' +}; diff --git a/public/js/index.js b/public/js/index.js new file mode 100644 index 000000000..9b46785d8 --- /dev/null +++ b/public/js/index.js @@ -0,0 +1,139 @@ +let canvas = document.getElementById("myCanvas"); +const hydra = new Hydra(canvas); + +$(document).ready(function () { + + changeBackground(); + + // Register + $("#register").click(function () { + let check = true; + + for (let i = 0; i < input.length; i++) { + if (validate(input[i]) == false) { + showValidate(input[i]); + check = false; + } + } + + if (!check) return; + + $.ajax({ + url: '/signup', + type: 'post', + dataType: 'json', + data: $('form#theform').serialize(), + success: function (data) { + console.log(data); + if (data.status === "ok") { + window.location = "main"; + } + } + }); + + }); + + + /*==================================================================[ Validate ]*/ + let input = $('.validate-input .input100'); + + $('.validate-form').on('submit', function () { + let check = true; + + for (let i = 0; i < input.length; i++) { + if (validate(input[i]) == false) { + showValidate(input[i]); + check = false; + } + } + + return check; + }); + + + $('.validate-form .input100').each(function () { + $(this).focus(function () { + hideValidate(this); + }); + }); + + function validate(input) { + if ($(input).attr('type') == 'email' || $(input).attr('name') == 'email') { + if ($(input).val().trim().match(/^([a-zA-Z0-9_\-.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9-]+\.)+))([a-zA-Z]{1,5}|[0-9]{1,3})(\]?)$/) == null) { + return false; + } + } else { + if ($(input).val().trim() == '') { + return false; + } + } + } + + function showValidate(input) { + let thisAlert = $(input).parent(); + $(thisAlert).addClass('alert-validate'); + } + + function hideValidate(input) { + let thisAlert = $(input).parent(); + $(thisAlert).removeClass('alert-validate'); + } + +}); + +function changeBackground() { + let ind = Math.floor((Math.random() * 5)); + + switch (ind) { + case 0: + hydra.shape(2).scale(0.1).scrollY(0, 0.3) + .add(shape(2).rotate(11).scale(0.1)).repeat(20, 20) + .modulateScale(osc(2, 0.1).rotate(11)) + .modulateScale(osc(2, 0.2)).scale(0.5) + .scrollX(0, [0.1, -0.1, 0.2, -0.2].fast(0.2)) + .scrollY(0, 0.1) + .modulateRotate(osc(2, 0.2), -2) + .rotate(0, 0.2) + .modulateScale(voronoi(3, 2).contrast(8), -1) + .out(); + break; + case 1: + hydra.shape(2, 0.3, 0.1) + .color(4, 2, 1) + .hue(() => (time / 8) % 1) + .repeatY(30) + .mult(osc(5).rotate(-Math.PI / 2)) + .add(solid(.5)) + .modulate(noise()) + .mult(osc(10)) + .diff(solid(1, 1, 0)) + .invert() + .kaleid(16) + .modulate(noise(1.1)) + .add(src(o0).scale(1.25).rotate(Math.PI / 2), 0.9) + .out(); + break; + case 2: + hydra.voronoi(4, 3, 1) + .colorama(2) + .mask(shape(3.15, 0.2, 0.90, () => a.fft[1] * 0.05)) + .rotate(0, 2.5) + .add(osc(15).modulate(o0)) + .contrast(4) + .out(); + break; + case 3: + hydra.noise(100, 0.4) + .pixelate(40, 40) + .mult(osc(1000, 0.001, 0.8).rotate(Math.PI * 0.5)) + .mult(osc(100, () => (time / 0.005) % 0.005, 0.5).color(0.5, 4, 4)) + .kaleid(2) + .out(); + break; + case 4: + hydra.shape(2).scale(0.1).modulate(noise(3, 1)).rotate(0, 0.2) + .modulateRotate(osc(2), Math.sin(1 * time)).modulateScale(osc(3, 0.5) + .rotate(0, 0.5), -0.8).modulateRotate(src(o0), -1).rotate(0, 0.5) + .blend(src(o0), 1.9).diff(o0, 0.5).rotate(0, -0.1).luma(0.2).out() + } +} diff --git a/public/js/main.js b/public/js/main.js new file mode 100644 index 000000000..bdf0ebb08 --- /dev/null +++ b/public/js/main.js @@ -0,0 +1,889 @@ +import {Piano} from './piano-module.js'; +import {Sequencer} from "./sequencer-module.js"; +import {hydra_samples} from "./hydra-samples.js"; + +/** TONE JS SETUP **/ +let synthFilter = new Tone.Filter(300, 'lowpass').connect( + new Tone.Gain(0.4).toMaster() +); +let synthConfig = { + oscillator: {type: 'fattriangle'}, + envelope: {attack: 3, sustain: 1, release: 1} +}; + +let sequencer = new Sequencer(); +let piano = new Piano("#piano"); + +// Edit mode +let dragged = false; + +let syn = new Tone.Synth(synthConfig).connect(synthFilter).toMaster(); +let synthsPlaying = {}; + +let bpm_dummy = { + value: Tone.Transport.bpm.value +}; + +/** DAT GUI CONTROLLER **/ +let gui = new dat.GUI(); +let controller = gui.add(bpm_dummy, 'value', 0, 140).name("tempo"); + +controller.onChange(function (value) { + // send tempo change + socket.emit('chat message', {'room': subscription, 'msg': {tempo: value}}); + console.log(value); +}); + + +//Tweaking tone and behavior of each instrument +Tone.Transport.bpm.value = 80; + +const allNotes = ["C1", "C#1", "D1", "D#1", "E1", "F1", "F#1", "G1", "G#1", "A1", "A#1", "B1", "C2", "C#2", "D2", "D#2", + "E2", "F2", "F#2", "G2", "G#2", "A2", "A#2", "B2", "C3", "C#3", "D3", "D#3", "E3", "F3", "F#3", "G3", "G#3", "A3", + "A#3", "B3", "C4", "C#4", "D4", "D#4", "E4", "F4", "F#4", "G4", "G#4", "A4", "A#4", "B4", "C5", "C#5", "D5", "D#5", + "E5", "F5", "F#5", "G5", "G#5", "A5", "A#5", "B5", "C6", "C#6", "D6", "D#6", "E6", "F6", "F#6", "G6", "G#6", "A6", "A#6", "B6", "C7"]; + +// possible modes: tone, hydra, gibber, piano, audiovis, .... +let mode = "tone"; + +// let canvas = document.createElement('canvas'); +let canvas = document.getElementById('myCanvas'); +let hydra = new Hydra(canvas); + +// Websocket +let socket = io(); +let subscription = "global"; + +// Code Mirror +const cm = CodeMirror.fromTextArea(document.getElementById('code'), { + theme: 'tomorrow-night-eighties', + mode: {name: 'javascript', globallets: true}, + lineWrapping: true, + styleSelectedText: true, + extraKeys: { + 'Shift-Enter': function (instance) { + socket.emit('hydra message', {'room': subscription, 'msg': cm.getValue()}); + } + } +}); + +// TODO: Send Socket Message +const gibbercm = CodeMirror.fromTextArea(document.getElementById('gibber'), { + theme: 'tomorrow-night-eighties', + mode: {name: 'javascript', globallets: true}, + lineWrapping: true, + styleSelectedText: true, + extraKeys: { + 'Shift-Enter': function (instance) { + //socket.emit('hydra message', {'room': subscription, 'msg': cm.getValue()}); + gibbercm.refresh(); + eval(gibbercm.getValue()); + } + } +}); + +/** + * When document is loaded + */ +$(document).ready(function () { + + // Update the logged on user + $.getJSON("loggeduser", function (data) { + // Make sure the data contains the username as expected before using it + if (data.hasOwnProperty('username')) { + // TODO: Change to display name + $("#profile").text(data.username.username); + } + }); + + /****** Bindings *****/ + $("#change-loop").bind("click", changeDrumLoop); + $("#edit").bind("click", editMode); + + $("#synth").bind("click", function () { + changeLoopMode("synth"); + }); + $("#drum").bind("click", function () { + changeLoopMode("drum"); + }); + + $("#start-loop").bind("click", function () { + socket.emit('chat message', {room: subscription, msg: 'start loop'}); + }); + $("#stop-loop").bind("click", function () { + socket.emit('chat message', {room: subscription, msg: 'stop loop'}); + }); + + $("#improvise").bind("click", function () { + piano.improvise(); + }); + + $("#autocomplete").bind("click", function () { + $("#autocomplete").toggleClass("hover"); + piano.autocomplete = !piano.autocomplete; + }); + + $("#record").bind("click", record); + $("#dropdownbtn").bind("click", myFunction); + + $("#myDropdown button").bind("click", function (e) { + changeMode($(this).attr("data-id")); + }); + + $("#audiovisualbuttons button").bind("click", function (e) { + switch ($(this).attr("data-id")) { + case 'first': + firstVis(); + break; + case 'second': + secondVis(); + break; + case 'third': + thirdVis(); + break; + case 'fourth': + fourthVis(); + break; + case 'fifth': + fifthVis(); + break; + } + }); + + $("#join-session").bind("click", joinSession); + $("#save").bind("click", saveSession); + $("#load").bind("click", loadSession); + + $("#drop_zone").bind("drop", dropHandler); + $("#drop_zone").bind("dragover", dragOverHandler); + $('#ex1').modal('show'); + + /** Emit user has subscribed ***/ + socket.emit('subscribe', subscription); + + /** MIDI SETUP **/ + if (navigator.requestMIDIAccess) { + console.log('This browser supports WebMIDI!'); + navigator.requestMIDIAccess() + .then(onMIDISuccess, onMIDIFailure); + + function onMIDISuccess(midiAccess) { + for (let input of midiAccess.inputs.values()) + input.onmidimessage = getMIDIMessage; + + } + + function onMIDIFailure() { + console.log('Could not access your MIDI devices.'); + } + } else { + console.log('WebMIDI is not supported in this browser.'); + } + + function getMIDIMessage(message) { + let command = message.data[0]; + let note = message.data[1]; + let velocity = (message.data.length > 2) ? message.data[2] : 0; // a velocity value might not be included with a noteOff command + + switch (command) { + case 144: // noteOn + // attack + playMidiNote(note, velocity); + break; + case 128: // noteOff + // release + stopMidiNode(note); + break; + } + } + + $(".keys div").click(function () { + let dk = $(this).attr("data-key"); + const key = document.querySelector(`.key[data-key="${dk}"]`); + Piano.animatePlay(key, dk, true); + socket.emit('midi message', { + 'room': subscription, + 'msg': {type: "start", note: dk, time: Tone.now(), speed: 90} + }); + }); + + function playMidiNote(note, velocity) { + const key = document.querySelector(`.key[data-key="${note}"]`); + if (key) { + Piano.animatePlay(key, note, true); + } + socket.emit('midi message', { + 'room': subscription, + 'msg': {type: "start", note: note, time: Tone.now(), speed: velocity} + }); + } + + function stopMidiNode(note) { + piano.stopPlaying(); + socket.emit('midi message', {'room': subscription, 'msg': {type: "stop", note: note}}); + } + + // Removing styles + $('[contenteditable]').on('paste', function (e) { + e.preventDefault(); + let text = (e.originalEvent || e).clipboardData.getData('text/plain') || prompt('Paste something..'); + document.execCommand('insertText', false, text); + }); + + /***** WEB SOCKET LISTENERS *****/ + socket.on('time', function (msg) { + stopLoop(); + for (let n of msg.msg) { + $("div[data-code='" + n + "']").toggleClass("box-active"); + } + sequencer.startLoop(msg.time); + }); + + socket.on('update', function (msg) { + // Only send active nodes if a sequence is currently playing + if (sequencer.playmode === "sequence") { + emitActiveNotes(); + } + }); + + socket.on('midi message', function (msg) { + console.dir("midi"); + if (msg.type === "start") { + let synth = new Tone.Synth(synthConfig).connect(synthFilter); + synthsPlaying[msg.note] = synth; + // TODO: Fix feedback + piano.playNote(msg); + } else { + if (synthsPlaying[msg.note]) { + let synth = synthsPlaying[msg.note]; + synth.triggerRelease(); + setTimeout(() => synth.dispose(), 2000); + synthsPlaying[msg.note] = null; + } + } + }); + + + socket.on('chat message', function (msg) { + if (msg === "start loop") { + sequencer.startLoop(msg.time); + return; + } + + if (msg === "stop loop") { + stopLoop(); + return; + } + + if (mode === "hydra") { + runHydra(msg); + return; + } + + if (msg.tempo) { + // tempo change + Tone.Transport.bpm.value = msg.tempo; + return; + } + + $("div[data-code='" + (msg + 40) + "']").toggleClass("box-active"); + if (sequencer.playmode === "single" || isNaN(msg)) { + playNote(msg); + setTimeout(function () { + $("div[data-code='" + (msg + 40) + "']").removeClass("box-active"); + }, 200); + } + }); + + socket.on('hydra message', function (msg) { + console.log("hydra message"); + + console.log("msg", msg); + cm.setValue(msg); + cm.refresh(); + eval(cm.getValue()); + }); + + // Run initial hydra code + hydra.src(o0) + .modulate(o0, 0.0001) + .layer(shape(3, 0.3, 0).diff(shape()).rotate(0, 0.1).repeat([1, 1], 1).scale([0.1, 0.2, 0.5, 1, 2].fast()).scrollX(0, 0).luma(0.6).invert(() => Math.sin(time))) + .modulateRotate(osc(10, 0.1, 0.2), -0.01) + .scrollX(-0.001) + .out(); + + $('.box').on('mousedown', async function (e) { + if ($(this).attr("data-file")) { + // midi file + if ($(this).attr("data-file") == "stop") { + clearMidiD3(); + return; + } + + const midi = await Midi.fromUrl("midi/" + $(this).attr("data-file")); + showMidiVis(midi); + return; + } + + if (isNaN($(this).attr("data-code"))) { + socket.emit('chat message', {'room': subscription, 'msg': $(this).attr("data-code")}); + } else { + socket.emit('chat message', {'room': subscription, 'msg': $(this).attr("data-code") - 40}); + } + }); + + $(window).keydown(function (e) { + if (mode === "tone") { + let code = e.keyCode; + socket.emit('chat message', {'room': subscription, 'msg': code - 40}); + } + }); + + function playNote(i) { + console.log("playnote", i); + if (isNaN(i)) { + return sequencer.playEffect(i) + } + + return sequencer.playNote(i) + } +}); + +function stopLoop() { + // De-select all selected keys + $(".pad").children().removeClass("box-active"); + $('#drum').attr("disabled", true); + + $('#stop-loop').addClass('hover'); + $('#start-loop').removeClass('hover'); + + sequencer.playmode = "single"; + Tone.Transport.stop(); + + $('.pad').children().removeClass('hover'); +} + +function changeLoopMode(v) { + if (v === "synth") { + $('#synth').addClass('hover'); + $('#drum').removeClass('hover'); + $('#change-loop').attr("disabled", true); + } else { + $('#change-loop').attr("disabled", false); + $('#drum').addClass('hover'); + $('#synth').removeClass('hover'); + } + sequencer.loop_mode = v; + if (sequencer.playmode === "sequence") sequencer.startLoop(); +} + +function changeDrumLoop() { + if (sequencer.drum_mode === "analog") { + sequencer.drum_mode = "dubstep"; + } else if (sequencer.drum_mode === "dubstep") { + sequencer.drum_mode = "electronic"; + } else if (sequencer.drum_mode === "electronic") { + sequencer.drum_mode = "hiphop"; + } else if (sequencer.drum_mode === "hiphop") { + sequencer.drum_mode = "percussion"; + } else if (sequencer.drum_mode === "percussion") { + sequencer.drum_mode = "analog"; + } + createSnackBar("Changed to " + sequencer.drum_mode) +} + +function editMode() { + $('#edit').toggleClass('hover'); + $('.pad').draggable(); + $('.pad-top').draggable(); + $('#profile-div').draggable(); + $('#help-div').draggable(); + + + if (dragged) { + $('.pad').draggable("disable"); + $('.pad-top').draggable("disable"); + $('#profile-div').draggable("disable"); + $('#help-div').draggable("disable"); + dragged = false; + } else { + $('.pad').draggable("enable"); + $('.pad-top').draggable("enable"); + $('#profile-div').draggable("enable"); + $('#help-div').draggable("enable"); + dragged = true; + } +} + +/** + * Joins a session + */ +function joinSession() { + let session = prompt("What's the session key? Type a new key to create a session, or an existing one to join."); + if (session == "" || session == null) { + console.log("Not joining"); + return; + } + socket.emit('unsubscribe', subscription); + socket.emit('subscribe', session); + subscription = session; + alert("Joined session " + session + "!"); +} + +/** + * Saves a session + */ +function saveSession() { + let response = prompt("What do you want to call this?."); + + if (response == "" || response == null) { + console.log("Not saving"); + return; + } + + $.getJSON("loggeduser", function (data) { + console.log(data); + // Make sure the data contains the username as expected before using it + if (data.hasOwnProperty('username')) { + console.log(data.username._id); + $.post("savesession", { + hydra: cm.getValue(), + tone: getActiveNoteList(), + user: data.username._id, + name: response + }); + } + }); +} + + +/** + * Loads a session + */ +function loadSession() { + let response = prompt("What is the name of the session?"); + + if (response == "" || response == null) { + console.log("Not loading"); + return; + } + + $.getJSON("loggeduser", function (data) { + // Make sure the data contains the username as expected before using it + if (data.hasOwnProperty('username')) { + $.getJSON("sessions?&id=" + data.username._id + "&name=" + response, function (data) { + console.log(data); + if (data[0]) { + // TODO: Refactor out emits into functions? + + // For all users + socket.emit('hydra message', {'room': subscription, 'msg': data[0].hydra}); + + // load music if there + if (data[0].tone.length > 0) { + console.log("TONE IS FILLED"); + socket.emit('time', {'room': subscription, 'msg': data[0].tone, 'time': Tone.now()}); + } + } else { + alert("Couldn't find session " + response + "!") + } + }); + } + }); +} + +/** + * Runs a hydra thingy + * @param msg + */ +function runHydra(msg) { + //todo: get code mappings from js file + let code; + switch (msg) { + case 'a': + code = 'osc().out()'; + break; + case 'b': + code = 'solid().out()'; + break; + case 'c': + code = 'voronoi().out()'; + break; + case 'd': + code = 'gradient().out()'; + break; + case 'e': + code = 'shape(5).out()'; + break; + case 'f': + code = 'noise().out()'; + break; + case 'g': + code = 's0.initCam() \nsrc(s0).out()'; + break; + case 'h': + alert("Make sure you have the ScreenCapture extension from https://github.com/ojack/hydra"); + code = 's1.initScreen() \nsrc(s1).out()'; + break; + case 'i': + code = 'shape(5, () => a.fft[2]).out()\n' + + 'a.show()\n'; + break; + case 'j': + keys = Object.keys(hydra_samples); + code = hydra_samples[keys[keys.length * Math.random() << 0]]; + break; + + } + socket.emit('hydra message', {'room': subscription, 'msg': code}); +} + +/** + * Gets active note list + * @returns {[]} + */ +function getActiveNoteList() { + let data_codes = []; + $('.pad').children().each(function () { + if ($(this).hasClass('box-active')) { + console.log($(this).attr("data-code")); + data_codes.push($(this).attr("data-code")); + } + }); + + return data_codes; +} + + +function emitActiveNotes() { + socket.emit('time', {'room': subscription, 'msg': getActiveNoteList(), 'time': Tone.now()}); +} + +/** + * Toggles record mode + */ +function record() { + if (piano.recordMode) { + piano.recordMode = false; + $("#record").text("record"); + } else { + piano.recordMode = true; + $("#record").text("stop"); + } +} + +// Init Gibber +Gibber.init(); + + +// FILE DROPPING +function dropHandler(ev) { + console.log('File(s) dropped'); + + // Prevent default behavior (Prevent file from being opened) + ev.preventDefault(); + + console.log(ev); + ev.dataTransfer = ev.originalEvent.dataTransfer; + + if (ev.dataTransfer.items) { + // Use DataTransferItemList interface to access the file(s) + for (let i = 0; i < ev.dataTransfer.items.length; i++) { + // If dropped items aren't files, reject them + if (ev.dataTransfer.items[i].kind === 'file') { + let file = ev.dataTransfer.items[i].getAsFile(); + console.log('... file[' + i + '].name = ' + file.name); + + // load a midi file in the browser + const reader = new FileReader(); + reader.onload = function (e) { + const midi = new Midi(e.target.result); + showMidiVis(midi); + + }; + reader.readAsArrayBuffer(file) + + } + } + } else { + // Use DataTransfer interface to access the file(s) + for (let i = 0; i < ev.dataTransfer.files.length; i++) { + console.log('... file[' + i + '].name = ' + ev.dataTransfer.files[i].name); + } + } +} + +function dragOverHandler(ev) { + console.log('File(s) in drop zone'); + + // Prevent default behavior (Prevent file from being opened) + ev.preventDefault(); +} + +let midiSynths = []; + +function clearMidiD3() { + for (let midisynth of midiSynths) { + midisynth.dispose(); + } + midiSynths = []; + d3.select("#svg-container").selectAll("svg").remove(); +} + +function showMidiVis(midi) { + $("#drop_zone").css({opacity: 0}); + // clear all + clearMidiD3(); + + // d3 + let width = Math.max(960, innerWidth), + height = Math.max(500, innerHeight); + + let i = 0; + + let svg = d3.select("#svg-container") + .append("svg") + .style("z-index", 1) + .attr("width", width) + .attr("height", height); + + svg.append("rect") + .attr("width", width) + .attr("height", height); + + // THE TRACK + const now = Tone.now() + 0.5; + midi.tracks.forEach(track => { + const notes = track.notes; + const synth = new Tone.PolySynth(10, Tone.Synth, { + envelope: { + attack: 0.02, + decay: 0.1, + sustain: 0.3, + release: 1 + } + }).toMaster(); + + midiSynths.push(synth); + + notes.forEach(note => { + synth.triggerAttackRelease(note.name, note.duration, note.time + now, note.velocity); + // TODO: d3? + + setTimeout(particle, (note.time + 0.5) * 1000); + + function particle() { + let heightScale = d3.scaleLinear() + .range([0, window.innerHeight]) + .domain([0, 128]); + + let widthScale = d3.scaleLinear() + .range([0, window.innerWidth]) + .domain([0, 128]); + + svg.insert("circle", "rect") + .attr("cx", widthScale(note.midi)) + .attr("cy", window.innerHeight / 2) + // .attr("cy", heightScale(note.midi)) + .attr("r", 1e-6) + .style("stroke", d3.hsl((i = (i + 1) % 360), 1, .5)) + .style("fill", d3.hsl((i = (i + 1) % 360), 1, .5)) + .style("stroke-opacity", 1) + .style("fill-opacity", 1) + .transition() + .duration(note.duration * 1000) + .ease(Math.sqrt) + .attr("r", 200) + .style("stroke-opacity", 1e-6) + .style("fill-opacity", 1e-6) + .remove(); + } + }) + }) +} + +/** + * Creates a snack bar + * @param text + */ +function createSnackBar(text) { + // Snackbar + let x = document.getElementById("snackbar"); + x.className = "show"; + x.innerText = text; + setTimeout(function () { + x.className = x.className.replace("show", ""); + }, 3000); +} + + +/** + * Drop Down Functionality + */ +window.myFunction = function () { + document.getElementById("myDropdown").classList.toggle("drp-show"); +}; + +// Close the dropdown menu if the user clicks outside of it +window.onclick = function (event) { + if (!event.target.matches('.dropbtn')) { + let dropdowns = document.getElementsByClassName("dropdown-content"); + let i; + for (i = 0; i < dropdowns.length; i++) { + let openDropdown = dropdowns[i]; + if (openDropdown.classList.contains('drp-show')) { + openDropdown.classList.remove('drp-show'); + } + } + } +}; + + +/** + * Change Modes + */ +function hideAll() { + $("#myCanvas").hide(); + $(".pad").hide(); + $(".pad-top").hide(); + $("#hydra-div").hide(); + $(".CodeMirror").hide(); + $(".piano").hide(); + $("#audiovisualbuttons").hide(); + $("#midioptions").hide(); + $("#audiovisual").hide(); + $("#svg-container").hide(); + $("#midi-container").hide(); + $("#piano-side-buttons").hide(); + $("#sequence-div").hide(); + $("#drum-side-buttons").hide(); + $(".dg").hide(); + + gui.domElement.style.display = "none"; +} + +function changeMode(m) { + if (m === "tone") { + mode = "tone"; + hideAll(); + $("#myCanvas").show(); + $(".pad").show(); + $(".pad-top").show(); + gui.domElement.style.display = "block"; + + $("#sequence-div").show(); + $("#drum-side-buttons").show() + + } else if (m === "hydra") { + // change to hydra + mode = "hydra"; + hideAll(); + $("#hydra-div").show(); + $("#myCanvas").show(); + cm.getWrapperElement().style.display = "block"; + gibbercm.getWrapperElement().style.display = "none"; + cm.refresh(); + } else if (m === "piano") { + // change to piano + mode = "piano"; + hideAll(); + $("#piano-side-buttons").show(); + $("#myCanvas").show(); + $(".piano").show(); + + $(".dg").show(); + gui.domElement.style.display = "none"; + + } else if (m === "gibber") { + // change to gibber + mode = "gibber"; + hideAll(); + $("#myCanvas").show(); + cm.getWrapperElement().style.display = "none"; + gibbercm.getWrapperElement().style.display = "block"; + gibbercm.refresh(); + } else if (m === "audiovisual") { + // change to audiovisual + mode = "audiovisual"; + hideAll(); + + $("#audiovisualbuttons").show(); + $("#audiovisual").show(); + + // TEST + $("#renderer").show(); + firstVis(); + // TEST + + } else if (m == "d3") { + // change to midi editor + hideAll(); + mode = "d3"; + + let width = Math.max(960, innerWidth), + height = Math.max(500, innerHeight); + + let i = 0; + + $("#svg-container").show(); + // d3.select("#svg-container").selectAll("svg").remove(); + + let svg = d3.select("#svg-container svg") + .attr("width", width) + .attr("height", height); + + if (d3.select("#svg-container svg")._groups[0][0] == null) { + console.log("wooo"); + svg = d3.select("#svg-container") + .append("svg") + .attr("width", width) + .attr("height", height); + } + + svg.append("rect") + .attr("width", width) + .attr("height", height) + .on("ontouchstart" in document ? "touchmove" : "mousemove", particle); + + function particle() { + let m = d3.mouse(this); + let heightScale = d3.scaleLinear() + .domain([0, window.innerHeight]) + .range([15, -15]); + + let widthScale = d3.scaleLinear() + .domain([0, window.innerWidth]) + .range([0, 72]); + + // TODO: Reset after this view? + syn.volume.value = Math.floor(heightScale([m[1]])); + syn.triggerAttackRelease(allNotes[Math.floor(widthScale([m[0]]))], "8n"); + + + svg.insert("circle", "rect") + .attr("cx", m[0]) + .attr("cy", m[1]) + .attr("r", 1e-6) + .style("stroke", d3.hsl((i = (i + 1) % 360), 1, .5)) + .style("stroke-opacity", 1) + .transition() + .duration(2000) + .ease(Math.sqrt) + .attr("r", 100) + .style("stroke-opacity", 1e-6) + .remove(); + + d3.event.preventDefault(); + } + } else if (m == "midi") { + // midi + hideAll(); + // TODO: Drag and drop midi file for editing + mode = "midi"; + $("#svg-container").show(); + $("#midi-container").show(); + $("#midioptions").show(); + + } + createSnackBar("Changed to " + mode + " mode."); +} \ No newline at end of file diff --git a/public/js/piano-module.js b/public/js/piano-module.js new file mode 100644 index 000000000..c65f0eed6 --- /dev/null +++ b/public/js/piano-module.js @@ -0,0 +1,258 @@ +class Piano { + + gui = new dat.GUI(); + + TWINKLE_TWINKLE = { + notes: [ + {pitch: 60, startTime: 0.0, endTime: 0.5}, + {pitch: 60, startTime: 0.5, endTime: 1.0}, + {pitch: 67, startTime: 1.0, endTime: 1.5}, + {pitch: 67, startTime: 1.5, endTime: 2.0}, + {pitch: 69, startTime: 2.0, endTime: 2.5}, + {pitch: 69, startTime: 2.5, endTime: 3.0}, + {pitch: 67, startTime: 3.0, endTime: 4.0}, + {pitch: 65, startTime: 4.0, endTime: 4.5}, + {pitch: 65, startTime: 4.5, endTime: 5.0}, + {pitch: 64, startTime: 5.0, endTime: 5.5}, + {pitch: 64, startTime: 5.5, endTime: 6.0}, + {pitch: 62, startTime: 6.0, endTime: 6.5}, + {pitch: 62, startTime: 6.5, endTime: 7.0}, + {pitch: 60, startTime: 7.0, endTime: 8.0}, + ], + totalTime: 8 + }; + + rnn_vals = { + steps: 40, + temperature: 1.5 + }; + + reverb = new Tone.Convolver('https://s3-us-west-2.amazonaws.com/s.cdpn.io/969699/hm2_000_ortf_48k.mp3').toMaster(); + + sampler = new Tone.Sampler({ + C3: 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/969699/plastic-marimba-c3.mp3', + 'D#3': 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/969699/plastic-marimba-ds3.mp3', + 'F#3': 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/969699/plastic-marimba-fs3.mp3', + A3: 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/969699/plastic-marimba-a3.mp3', + C4: 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/969699/plastic-marimba-c4.mp3', + 'D#4': 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/969699/plastic-marimba-ds4.mp3', + 'F#4': 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/969699/plastic-marimba-fs4.mp3', + A4: 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/969699/plastic-marimba-a4.mp3', + C5: 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/969699/plastic-marimba-c5.mp3', + 'D#5': 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/969699/plastic-marimba-ds5.mp3', + 'F#5': 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/969699/plastic-marimba-fs5.mp3', + A5: 'https://s3-us-west-2.amazonaws.com/s.cdpn.io/969699/plastic-marimba-a5.mp3' + }).connect(this.reverb); + + midiNotes = []; + recordMode = false; + + // Magenta.js + // let player = new mm.Player(); + vaePlayer = new mm.Player(); + rnnPlayer = new mm.Player(); + music_rnn; + music_vae; + + autocomplete = false; + + constructor(div_id) { + this.constructPiano(div_id); + + + if (!this.music_rnn) { + // let music_rnn = new mm.MusicRNN('https://storage.googleapis.com/magentadata/js/checkpoints/music_rnn/basic_rnn'); + this.music_rnn = new mm.MusicRNN('https://storage.googleapis.com/magentadata/js/checkpoints/music_rnn/melody_rnn'); + this.music_rnn.initialize(); + } + + if (!this.music_vae) { + this.music_vae = new mm.MusicVAE('https://storage.googleapis.com/magentadata/js/checkpoints/music_vae/mel_16bar_small_q2'); + this.music_vae.initialize(); + } + + this.gui.domElement.style.display = "none"; + this.controller = this.gui.add(this.sampler, 'attack', 0, 10).name("attack"); + this.controller = this.gui.add(this.sampler, 'release', 0, 1).name("release"); + this.controller = this.gui.add(this.rnn_vals, 'steps', 1, 40).name("steps"); + this.controller = this.gui.add(this.rnn_vals, 'temperature', 0.1, 2.5).name("temperature"); + this.controller.onChange(function (value) { + console.log(value); + }); + } + + + playNote(msg) { + console.log(msg); + + if (this.recordMode) this.midiNotes.push(msg.note); + + let freq = Tone.Frequency(msg.note, 'midi'); + this.sampler.triggerAttack(freq); + + if (this.autocomplete) { + this.playMusicVAE(); + } + } + + stopPlaying() { + if (this.autocomplete) { + if (this.vaePlayer.isPlaying()) { + this.vaePlayer.stop(); + + } + } + } + + + improvise() { + let seq = this.getSequence(this.midiNotes); + this.playMusicRNN(seq); + console.log("MIDI NOTES", this.midiNotes); + this.midiNotes = []; + } + + /** + * A MusicRNN is an LSTM-based language model for musical notes -- it is best at continuing a NoteSequence that you give it. + */ + playMusicRNN(sequence) { + + if (this.rnnPlayer.isPlaying()) { + this.rnnPlayer.stop(); + return; + } + + this.music_rnn.continueSequence(sequence, this.rnn_vals.steps, this.rnn_vals.temperature).then((sample) => { + this.rnnPlayer.start(sample); + this.rnnPlayer.callbackObject = { + // This method is called every time we play a new note. We use + // it to keep the visualization in sync with the audio. + run: (note) => { + console.log(note); + const key = document.querySelector(`.key[data-key="${note.pitch}"]`); + Piano.animatePlay(key, note.pitch, false) + }, + stop: () => { + } + }; + }); + } + + /** + * As a generative model, you can think of a VAE as coming up with new sequences that could be a decoding of some summarized version. + */ + playMusicVAE() { + + if (this.vaePlayer.isPlaying()) { + this.vaePlayer.stop(); + return; + } + + this.vaePlayer.callbackObject = { + // This method is called every time we play a new note. We use + // it to keep the visualization in sync with the audio. + run: (note) => { + console.log(note); + const key = document.querySelector(`.key[data-key="${note.pitch}"]`); + Piano.animatePlay(key, note.pitch, false) + }, + stop: () => { + } + }; + + this.music_vae + .sample(1, this.rnn_vals.temperature) + .then((sample) => this.vaePlayer.start(sample[0])); + + } + + + /** + * Create a quantized sequence + * @returns {{notes: [], quantizationInfo: {stepsPerQuarter: number}}} + */ + getSequence(list) { + const sequence = {notes: []}; + if (list.length <= 0) { + console.log("DEFAULT SEQUENCE"); + return mm.sequences.quantizeNoteSequence(this.TWINKLE_TWINKLE, 1); + } else { + let noteNum = 0; + for (let x of list) { + sequence.notes.push( + {pitch: x, startTime: noteNum, endTime: noteNum + 0.5}, + ); + sequence.totalTime = noteNum + 1; + noteNum += 0.5; + } + return mm.sequences.quantizeNoteSequence(sequence, 1); + } + } + + /** Animate Piano Keys **/ + static animatePlay(keyEl, note, isHuman) { + console.log("animating"); + if (!keyEl) return; + let sourceColor = isHuman ? '#1E88E5' : '#E91E63'; + let targetColor = keyEl.classList.contains("sharp") ? 'black' : 'white'; + keyEl.animate( + [{backgroundColor: sourceColor}, {backgroundColor: targetColor}], + {duration: 700, easing: 'ease-out'} + ); + } + + constructPiano(div_id) { + $(div_id).html("
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
\n" + + "
") + } +} + +export {Piano}; \ No newline at end of file diff --git a/public/js/profile.js b/public/js/profile.js new file mode 100644 index 000000000..74f212602 --- /dev/null +++ b/public/js/profile.js @@ -0,0 +1,91 @@ +let id; +let user; + +$(function () { + let socket = io(); + $('form').submit(function () { + socket.emit('chat', {msg: $('#m').val(), user: $("#user-name").text()}); + $('#m').val(''); + return false; + }); + socket.on('chat', function (msg) { + $('#messages').append($('
  • ').text(msg.user + ": " + msg.msg)); + window.scrollTo(0, document.body.scrollHeight); + }); +}); + +$.getJSON("loggeduser", function (data) { + // Make sure the data contains the username as expected before using it + if (data.hasOwnProperty('username')) { + $("#user-name").text(data.username.username.toLocaleLowerCase()); + id = data.username._id; + + // Get sessions + $.getJSON("sessions?&id=" + id, function (data) { + console.log(data); + for (let row of data) { + $("#content").append("

    " + row.name + "


    "); + $("#content").append("
    "); + + let r1 = $('').attr({ + type: "button", + id: row._id, + call: "delete", + value: "delete" + }); + + let r2 = $('').attr({ + type: "button", + id: row._id, + call: "put", + value: "update" + }); + + $("#content").append(r1); + $("#content").append(r2); + + $("input").click(function (e) { + console.log(e); + if ($(this).attr("call") == "delete") { + // delete + deleteSession($(this).attr("id")); + } else { + //update + updateSession($(this).attr("id"), $("#" + $(this).attr("id")).val()); + } + }); + } + }); + } +}); + +$(".list-group a").click(function (e) { + e.preventDefault(); + $(".toggle").hide(); + let toShow = $(this).attr('href'); + $(toShow).show(); +}); + +function deleteSession(id) { + $.ajax({ + url: '/?&id=' + id, + type: 'DELETE', + success: function () { + console.log('SUCCESS'); + // refresh + window.location = "profile.html"; + } + }); + +} + +function updateSession(id, body) { + $.ajax({ + type: 'PUT', + url: '/', + contentType: 'application/json', + data: JSON.stringify({"id": id, "hydra": body}), // access in body + }).done(function () { + console.log('SUCCESS'); + }); +} \ No newline at end of file diff --git a/public/js/sequencer-module.js b/public/js/sequencer-module.js new file mode 100644 index 000000000..1e1bcffde --- /dev/null +++ b/public/js/sequencer-module.js @@ -0,0 +1,151 @@ +class Sequencer { + // Modes + playmode = "single"; + loop_mode = "synth"; + drum_mode = "analog"; + synthLoop; + drumLoop; + + // Synths + snr = new Tone.Synth().toMaster(); + bass = new Tone.MembraneSynth().toMaster(); + cym = new Tone.Synth().toMaster(); + syn = new Tone.Synth({ + oscillator: {type: 'fattriangle'}, + envelope: {attack: 3, sustain: 1, release: 1} + }).connect(new Tone.Filter(300, 'lowpass').connect( + new Tone.Gain(0.4).toMaster() + )).toMaster(); + + // Sounds + allNotes = ["C1", "C#1", "D1", "D#1", "E1", "F1", "F#1", "G1", "G#1", "A1", "A#1", "B1", "C2", "C#2", "D2", + "D#2", "E2", "F2", "F#2", "G2", "G#2", "A2", "A#2", "B2", "C3", "C#3", "D3", "D#3", "E3", "F3", "F#3", + "G3", "G#3", "A3", "A#3", "B3", "C4", "C#4", "D4", "D#4", "E4", "F4", "F#4", "G4", "G#4", "A4", "A#4", "B4", + "C5", "C#5", "D5", "D#5", "E5", "F5", "F#5", "G5", "G#5", "A5", "A#5", "B5", "C6", "C#6", "D6", "D#6", "E6", + "F6", "F#6", "G6", "G#6", "A6", "A#6", "B6", "C7"]; + + map = { + a: {track: "music/dnb/ALPHA1.wav"}, + b: {track: "music/dnb/ESHER1.wav"}, + c: {track: "music/dnb/glory11.WAV"}, + d: {track: "music/dnb/LITE1.wav"}, + e: {track: "music/dnb/mudab11.WAV"}, + f: {track: "music/dnb/PAD1.wav"}, + g: {track: "music/dnb/PHAZER1.wav"}, + h: {track: "music/dnb/wax11.WAV"}, + /// here + i: {track: "/music/drum-kits/analog/clap.mp3"}, + j: {track: "/music/drum-kits/analog/hihat-closed.mp3"}, + k: {track: "/music/drum-kits/analog/hihat-open.mp3"}, + l: {track: "/music/drum-kits/analog/kick.mp3"}, + m: {track: "/music/drum-kits/analog/ride.mp3"}, + n: {track: "/music/drum-kits/analog/snare.mp3"}, + o: {track: "/music/drum-kits/analog/tom-high.mp3"}, + p: {track: "/music/drum-kits/analog/tom-low.mp3"} + }; + + /** + * Starts the sequencer loop + */ + startLoop() { + Tone.Transport.stop(); + if (this.synthLoop) this.synthLoop.stop(); + if (this.drumLoop) this.drumLoop.stop(); + + $('#start-loop').addClass('hover'); + $('#stop-loop').removeClass('hover'); + $('#stop-loop').attr("disabled", false); + $('#drum').attr("disabled", false); + + this.playmode = "sequence"; + + if (this.loop_mode === "synth") { + this.synthLoop = new Tone.Sequence(function (time, col) { + let n1 = $('.pad').children().eq(col).hasClass("box-active") ? ($('.pad').children().eq(col).attr('data-code')) : 0; + let n2 = $('.pad').children().eq(col + 6).hasClass("box-active") ? ($('.pad').children().eq(col).attr('data-code')) : 0; + let n3 = $('.pad').children().eq(col + 12).hasClass("box-active") ? ($('.pad').children().eq(col).attr('data-code')) : 0; + let n4 = $('.pad').children().eq(col + 18).hasClass("box-active") ? ($('.pad').children().eq(col).attr('data-code')) : 0; + + $('.pad').children().removeClass('hover'); + + $('.pad').children().eq(col).addClass('hover'); + $('.pad').children().eq(col + 7).addClass('hover'); + $('.pad').children().eq(col + 14).addClass('hover'); + $('.pad').children().eq(col + 21).addClass('hover'); + + if (n1) { + this.snr.triggerAttackRelease(this.allNotes[n1 - 40], "10hz", time); + } + if (n2) { + this.bass.triggerAttackRelease(this.allNotes[n2 - 40], "10hz", time); + } + if (n3) { + this.cym.triggerAttackRelease(this.allNotes[n3 - 40], "10hz", time); + } + if (n4) { + this.syn.triggerAttackRelease(this.allNotes[n4 - 40], "10hz", time); + } + + }.bind(this), [0, 1, 2, 3, 4, 5, 6], "16n").start(); + Tone.Transport.start(); + } else { + this.drumLoop = new Tone.Sequence(function (time, col) { + let n1 = $('.pad').children().eq(col).hasClass("box-active") ? "/music/drum-kits/" + this.drum_mode + "/clap.mp3" : 0; + let n2 = $('.pad').children().eq(col + 6).hasClass("box-active") ? "/music/drum-kits/" + this.drum_mode + "/snare.mp3" : 0; + let n3 = $('.pad').children().eq(col + 12).hasClass("box-active") ? "/music/drum-kits/" + this.drum_mode + "/hihat-open.mp3" : 0; + let n4 = $('.pad').children().eq(col + 18).hasClass("box-active") ? "/music/drum-kits/" + this.drum_mode + "/tom-mid.mp3" : 0; + + $('.pad').children().removeClass('hover'); + + $('.pad').children().eq(col).addClass('hover'); + $('.pad').children().eq(col + 7).addClass('hover'); + $('.pad').children().eq(col + 14).addClass('hover'); + $('.pad').children().eq(col + 21).addClass('hover'); + + if (n1) { + let player = new Tone.Player(n1).toMaster(); + player.autostart = true; + } + if (n2) { + let player = new Tone.Player(n2).toMaster(); + player.autostart = true; + } + if (n3) { + let player = new Tone.Player(n3).toMaster(); + player.autostart = true; + } + if (n4) { + let player = new Tone.Player(n4).toMaster(); + player.autostart = true; + } + + }.bind(this), [0, 1, 2, 3, 4, 5, 6], "16n").start(); + Tone.Transport.start(); + } + } + + /** + * Plays the ith effect + * @param i + */ + playEffect(i) { + let track = this.map[i].track; + if (this.map[i].player) { + console.log(this.map[i].player.state); + if (this.map[i].player.state === "started") { + this.map[i].player.stop(); + return; + } + } + this.map[i].player = new Tone.Player(track).toMaster(); + this.map[i].player.autostart = true; + + } + + + playNote(i) { + this.syn.triggerAttackRelease(this.allNotes[i], "8n"); + } +} + +export {Sequencer}; \ No newline at end of file diff --git a/public/login.html b/public/login.html new file mode 100644 index 000000000..6a56692ee --- /dev/null +++ b/public/login.html @@ -0,0 +1,87 @@ + + + + wavelength + + + + + + + + + + + + + + + + + + + + + + + + + +

    WAVELENGTH

    +
    +
    +
    +
    + +
    + + +
    + +
    + + +
    + +
    + +
    + +
    +
    + +
    +
    +
    + +
    + +
    + + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/public/main.html b/public/main.html new file mode 100644 index 000000000..3693a554f --- /dev/null +++ b/public/main.html @@ -0,0 +1,260 @@ + + + + + wavelength + + + + + + +
    + +
    + +
    + +
    +
    + + + +
    + + + + +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    + +
    + + + + + + Help +
    + +
    + + +
    + + + + + +
    +
    2
    +
    3
    +
    4
    +
    5
    +
    6
    +
    7
    +
    8
    + +
    W
    +
    E
    +
    R
    +
    T
    +
    Y
    +
    U
    +
    I
    + +
    S
    +
    D
    +
    F
    +
    G
    +
    H
    +
    J
    +
    K
    + +
    Z
    +
    X
    +
    C
    +
    V
    +
    B
    +
    N
    +
    M
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/public/midi/allstar.mid b/public/midi/allstar.mid new file mode 100644 index 000000000..72ab9ce60 Binary files /dev/null and b/public/midi/allstar.mid differ diff --git a/public/midi/blame.mid b/public/midi/blame.mid new file mode 100644 index 000000000..0088de8b5 Binary files /dev/null and b/public/midi/blame.mid differ diff --git a/public/midi/demons.mid b/public/midi/demons.mid new file mode 100644 index 000000000..b9735b352 Binary files /dev/null and b/public/midi/demons.mid differ diff --git a/public/midi/faded.mid b/public/midi/faded.mid new file mode 100644 index 000000000..b31539641 Binary files /dev/null and b/public/midi/faded.mid differ diff --git a/public/midi/mii.mid b/public/midi/mii.mid new file mode 100644 index 000000000..a4cdfe9a5 Binary files /dev/null and b/public/midi/mii.mid differ diff --git a/public/midi/potc.mid b/public/midi/potc.mid new file mode 100644 index 000000000..c14f89f3b Binary files /dev/null and b/public/midi/potc.mid differ diff --git a/public/music/Bloodstream.mp3 b/public/music/Bloodstream.mp3 new file mode 100644 index 000000000..073940738 Binary files /dev/null and b/public/music/Bloodstream.mp3 differ diff --git a/public/music/TRON.mp3 b/public/music/TRON.mp3 new file mode 100644 index 000000000..eabb16268 Binary files /dev/null and b/public/music/TRON.mp3 differ diff --git a/public/music/dnb/ALPHA1.wav b/public/music/dnb/ALPHA1.wav new file mode 100755 index 000000000..d2a3092b0 Binary files /dev/null and b/public/music/dnb/ALPHA1.wav differ diff --git a/public/music/dnb/ESHER1.wav b/public/music/dnb/ESHER1.wav new file mode 100755 index 000000000..6e3e2e8b1 Binary files /dev/null and b/public/music/dnb/ESHER1.wav differ diff --git a/public/music/dnb/LITE1.wav b/public/music/dnb/LITE1.wav new file mode 100755 index 000000000..213347d4e Binary files /dev/null and b/public/music/dnb/LITE1.wav differ diff --git a/public/music/dnb/PAD1.wav b/public/music/dnb/PAD1.wav new file mode 100755 index 000000000..a26db5583 Binary files /dev/null and b/public/music/dnb/PAD1.wav differ diff --git a/public/music/dnb/PHAZER1.wav b/public/music/dnb/PHAZER1.wav new file mode 100755 index 000000000..ba833315d Binary files /dev/null and b/public/music/dnb/PHAZER1.wav differ diff --git a/public/music/dnb/glory11.WAV b/public/music/dnb/glory11.WAV new file mode 100755 index 000000000..6849f0806 Binary files /dev/null and b/public/music/dnb/glory11.WAV differ diff --git a/public/music/dnb/mudab11.WAV b/public/music/dnb/mudab11.WAV new file mode 100755 index 000000000..56265cf7f Binary files /dev/null and b/public/music/dnb/mudab11.WAV differ diff --git a/public/music/dnb/mudab47.WAV b/public/music/dnb/mudab47.WAV new file mode 100755 index 000000000..c5c765113 Binary files /dev/null and b/public/music/dnb/mudab47.WAV differ diff --git a/public/music/dnb/wax11.WAV b/public/music/dnb/wax11.WAV new file mode 100755 index 000000000..564abcccd Binary files /dev/null and b/public/music/dnb/wax11.WAV differ diff --git a/public/music/drum-kits/analog/clap.mp3 b/public/music/drum-kits/analog/clap.mp3 new file mode 100755 index 000000000..8ed588b93 Binary files /dev/null and b/public/music/drum-kits/analog/clap.mp3 differ diff --git a/public/music/drum-kits/analog/hihat-closed.mp3 b/public/music/drum-kits/analog/hihat-closed.mp3 new file mode 100755 index 000000000..3137d4f36 Binary files /dev/null and b/public/music/drum-kits/analog/hihat-closed.mp3 differ diff --git a/public/music/drum-kits/analog/hihat-open.mp3 b/public/music/drum-kits/analog/hihat-open.mp3 new file mode 100755 index 000000000..d0429c842 Binary files /dev/null and b/public/music/drum-kits/analog/hihat-open.mp3 differ diff --git a/public/music/drum-kits/analog/kick.mp3 b/public/music/drum-kits/analog/kick.mp3 new file mode 100755 index 000000000..76853bd05 Binary files /dev/null and b/public/music/drum-kits/analog/kick.mp3 differ diff --git a/public/music/drum-kits/analog/ride.mp3 b/public/music/drum-kits/analog/ride.mp3 new file mode 100755 index 000000000..d5660d65b Binary files /dev/null and b/public/music/drum-kits/analog/ride.mp3 differ diff --git a/public/music/drum-kits/analog/snare.mp3 b/public/music/drum-kits/analog/snare.mp3 new file mode 100755 index 000000000..a2c1fe56a Binary files /dev/null and b/public/music/drum-kits/analog/snare.mp3 differ diff --git a/public/music/drum-kits/analog/tom-high.mp3 b/public/music/drum-kits/analog/tom-high.mp3 new file mode 100755 index 000000000..842f42e41 Binary files /dev/null and b/public/music/drum-kits/analog/tom-high.mp3 differ diff --git a/public/music/drum-kits/analog/tom-low.mp3 b/public/music/drum-kits/analog/tom-low.mp3 new file mode 100755 index 000000000..1fbff60c9 Binary files /dev/null and b/public/music/drum-kits/analog/tom-low.mp3 differ diff --git a/public/music/drum-kits/analog/tom-mid.mp3 b/public/music/drum-kits/analog/tom-mid.mp3 new file mode 100755 index 000000000..734fdd77c Binary files /dev/null and b/public/music/drum-kits/analog/tom-mid.mp3 differ diff --git a/public/music/drum-kits/dubstep/clap.mp3 b/public/music/drum-kits/dubstep/clap.mp3 new file mode 100755 index 000000000..8ed588b93 Binary files /dev/null and b/public/music/drum-kits/dubstep/clap.mp3 differ diff --git a/public/music/drum-kits/dubstep/hihat-closed.mp3 b/public/music/drum-kits/dubstep/hihat-closed.mp3 new file mode 100755 index 000000000..3137d4f36 Binary files /dev/null and b/public/music/drum-kits/dubstep/hihat-closed.mp3 differ diff --git a/public/music/drum-kits/dubstep/hihat-open.mp3 b/public/music/drum-kits/dubstep/hihat-open.mp3 new file mode 100755 index 000000000..d0429c842 Binary files /dev/null and b/public/music/drum-kits/dubstep/hihat-open.mp3 differ diff --git a/public/music/drum-kits/dubstep/kick.mp3 b/public/music/drum-kits/dubstep/kick.mp3 new file mode 100755 index 000000000..76853bd05 Binary files /dev/null and b/public/music/drum-kits/dubstep/kick.mp3 differ diff --git a/public/music/drum-kits/dubstep/ride.wav b/public/music/drum-kits/dubstep/ride.wav new file mode 100755 index 000000000..1e0010eb1 Binary files /dev/null and b/public/music/drum-kits/dubstep/ride.wav differ diff --git a/public/music/drum-kits/dubstep/snare.mp3 b/public/music/drum-kits/dubstep/snare.mp3 new file mode 100755 index 000000000..a2c1fe56a Binary files /dev/null and b/public/music/drum-kits/dubstep/snare.mp3 differ diff --git a/public/music/drum-kits/dubstep/tom-high.mp3 b/public/music/drum-kits/dubstep/tom-high.mp3 new file mode 100755 index 000000000..842f42e41 Binary files /dev/null and b/public/music/drum-kits/dubstep/tom-high.mp3 differ diff --git a/public/music/drum-kits/dubstep/tom-low.mp3 b/public/music/drum-kits/dubstep/tom-low.mp3 new file mode 100755 index 000000000..1fbff60c9 Binary files /dev/null and b/public/music/drum-kits/dubstep/tom-low.mp3 differ diff --git a/public/music/drum-kits/dubstep/tom-mid.mp3 b/public/music/drum-kits/dubstep/tom-mid.mp3 new file mode 100755 index 000000000..734fdd77c Binary files /dev/null and b/public/music/drum-kits/dubstep/tom-mid.mp3 differ diff --git a/public/music/drum-kits/electronic/clap.mp3 b/public/music/drum-kits/electronic/clap.mp3 new file mode 100755 index 000000000..8b64599ac Binary files /dev/null and b/public/music/drum-kits/electronic/clap.mp3 differ diff --git a/public/music/drum-kits/electronic/hihat-closed.mp3 b/public/music/drum-kits/electronic/hihat-closed.mp3 new file mode 100755 index 000000000..2c6dad2be Binary files /dev/null and b/public/music/drum-kits/electronic/hihat-closed.mp3 differ diff --git a/public/music/drum-kits/electronic/hihat-open.mp3 b/public/music/drum-kits/electronic/hihat-open.mp3 new file mode 100755 index 000000000..1cd521cca Binary files /dev/null and b/public/music/drum-kits/electronic/hihat-open.mp3 differ diff --git a/public/music/drum-kits/electronic/kick.mp3 b/public/music/drum-kits/electronic/kick.mp3 new file mode 100755 index 000000000..cc16789ae Binary files /dev/null and b/public/music/drum-kits/electronic/kick.mp3 differ diff --git a/public/music/drum-kits/electronic/ride.mp3 b/public/music/drum-kits/electronic/ride.mp3 new file mode 100755 index 000000000..7042ed759 Binary files /dev/null and b/public/music/drum-kits/electronic/ride.mp3 differ diff --git a/public/music/drum-kits/electronic/snare.mp3 b/public/music/drum-kits/electronic/snare.mp3 new file mode 100755 index 000000000..8580ee038 Binary files /dev/null and b/public/music/drum-kits/electronic/snare.mp3 differ diff --git a/public/music/drum-kits/electronic/tom-high.mp3 b/public/music/drum-kits/electronic/tom-high.mp3 new file mode 100755 index 000000000..d549c0426 Binary files /dev/null and b/public/music/drum-kits/electronic/tom-high.mp3 differ diff --git a/public/music/drum-kits/electronic/tom-low.mp3 b/public/music/drum-kits/electronic/tom-low.mp3 new file mode 100755 index 000000000..30decb12e Binary files /dev/null and b/public/music/drum-kits/electronic/tom-low.mp3 differ diff --git a/public/music/drum-kits/electronic/tom-mid.mp3 b/public/music/drum-kits/electronic/tom-mid.mp3 new file mode 100755 index 000000000..5d6f371e5 Binary files /dev/null and b/public/music/drum-kits/electronic/tom-mid.mp3 differ diff --git a/public/music/drum-kits/hiphop/clap.mp3 b/public/music/drum-kits/hiphop/clap.mp3 new file mode 100755 index 000000000..8e843350b Binary files /dev/null and b/public/music/drum-kits/hiphop/clap.mp3 differ diff --git a/public/music/drum-kits/hiphop/hihat-closed.mp3 b/public/music/drum-kits/hiphop/hihat-closed.mp3 new file mode 100755 index 000000000..4e4e28919 Binary files /dev/null and b/public/music/drum-kits/hiphop/hihat-closed.mp3 differ diff --git a/public/music/drum-kits/hiphop/hihat-open.mp3 b/public/music/drum-kits/hiphop/hihat-open.mp3 new file mode 100755 index 000000000..2e4d6f37c Binary files /dev/null and b/public/music/drum-kits/hiphop/hihat-open.mp3 differ diff --git a/public/music/drum-kits/hiphop/kick.mp3 b/public/music/drum-kits/hiphop/kick.mp3 new file mode 100755 index 000000000..1543b1400 Binary files /dev/null and b/public/music/drum-kits/hiphop/kick.mp3 differ diff --git a/public/music/drum-kits/hiphop/ride.mp3 b/public/music/drum-kits/hiphop/ride.mp3 new file mode 100755 index 000000000..f0a231e29 Binary files /dev/null and b/public/music/drum-kits/hiphop/ride.mp3 differ diff --git a/public/music/drum-kits/hiphop/snare.mp3 b/public/music/drum-kits/hiphop/snare.mp3 new file mode 100755 index 000000000..b493ff8a5 Binary files /dev/null and b/public/music/drum-kits/hiphop/snare.mp3 differ diff --git a/public/music/drum-kits/hiphop/tom-high.mp3 b/public/music/drum-kits/hiphop/tom-high.mp3 new file mode 100755 index 000000000..925bced70 Binary files /dev/null and b/public/music/drum-kits/hiphop/tom-high.mp3 differ diff --git a/public/music/drum-kits/hiphop/tom-low.mp3 b/public/music/drum-kits/hiphop/tom-low.mp3 new file mode 100755 index 000000000..5b7deab0e Binary files /dev/null and b/public/music/drum-kits/hiphop/tom-low.mp3 differ diff --git a/public/music/drum-kits/hiphop/tom-mid.mp3 b/public/music/drum-kits/hiphop/tom-mid.mp3 new file mode 100755 index 000000000..38a0867fa Binary files /dev/null and b/public/music/drum-kits/hiphop/tom-mid.mp3 differ diff --git a/public/music/drum-kits/percussion/clap.mp3 b/public/music/drum-kits/percussion/clap.mp3 new file mode 100755 index 000000000..bedce9e8f Binary files /dev/null and b/public/music/drum-kits/percussion/clap.mp3 differ diff --git a/public/music/drum-kits/percussion/hihat-closed.mp3 b/public/music/drum-kits/percussion/hihat-closed.mp3 new file mode 100755 index 000000000..b514ff97b Binary files /dev/null and b/public/music/drum-kits/percussion/hihat-closed.mp3 differ diff --git a/public/music/drum-kits/percussion/hihat-open.mp3 b/public/music/drum-kits/percussion/hihat-open.mp3 new file mode 100755 index 000000000..c95d17222 Binary files /dev/null and b/public/music/drum-kits/percussion/hihat-open.mp3 differ diff --git a/public/music/drum-kits/percussion/kick.mp3 b/public/music/drum-kits/percussion/kick.mp3 new file mode 100755 index 000000000..8f54fbec8 Binary files /dev/null and b/public/music/drum-kits/percussion/kick.mp3 differ diff --git a/public/music/drum-kits/percussion/ride.mp3 b/public/music/drum-kits/percussion/ride.mp3 new file mode 100755 index 000000000..3d4d6dd1c Binary files /dev/null and b/public/music/drum-kits/percussion/ride.mp3 differ diff --git a/public/music/drum-kits/percussion/snare.mp3 b/public/music/drum-kits/percussion/snare.mp3 new file mode 100755 index 000000000..ec22e6d1a Binary files /dev/null and b/public/music/drum-kits/percussion/snare.mp3 differ diff --git a/public/music/drum-kits/percussion/tom-high.mp3 b/public/music/drum-kits/percussion/tom-high.mp3 new file mode 100755 index 000000000..8b2af89ce Binary files /dev/null and b/public/music/drum-kits/percussion/tom-high.mp3 differ diff --git a/public/music/drum-kits/percussion/tom-low.mp3 b/public/music/drum-kits/percussion/tom-low.mp3 new file mode 100755 index 000000000..c3e004be5 Binary files /dev/null and b/public/music/drum-kits/percussion/tom-low.mp3 differ diff --git a/public/music/drum-kits/percussion/tom-mid.mp3 b/public/music/drum-kits/percussion/tom-mid.mp3 new file mode 100755 index 000000000..0fa257ed3 Binary files /dev/null and b/public/music/drum-kits/percussion/tom-mid.mp3 differ diff --git a/public/profile.html b/public/profile.html new file mode 100644 index 000000000..b04bc0c5b --- /dev/null +++ b/public/profile.html @@ -0,0 +1,126 @@ + + + + + + + + + + + wavelength + + + + + + + + + + + +
    + + + + + + +
    + + + +
    +

    Welcome,

    +

    These are your sessions!

    +
    + + + + + + + + +
    + + +
    + + + + + + + + + + + + + + diff --git a/public/texture/blue-purple-gradient-linear-1920x1080-c2-191970-800080-a-135-f-14.png b/public/texture/blue-purple-gradient-linear-1920x1080-c2-191970-800080-a-135-f-14.png new file mode 100644 index 000000000..e4818e755 Binary files /dev/null and b/public/texture/blue-purple-gradient-linear-1920x1080-c2-191970-800080-a-135-f-14.png differ diff --git a/public/texture/gradient-purple-blue-linear-1920x1080-c2-191970-ba55d3-a-90-f-14.png b/public/texture/gradient-purple-blue-linear-1920x1080-c2-191970-ba55d3-a-90-f-14.png new file mode 100644 index 000000000..fc7fde4de Binary files /dev/null and b/public/texture/gradient-purple-blue-linear-1920x1080-c2-191970-ba55d3-a-90-f-14.png differ diff --git a/public/texture/heightMap.png b/public/texture/heightMap.png new file mode 100755 index 000000000..84876f7c2 Binary files /dev/null and b/public/texture/heightMap.png differ diff --git a/public/texture/synth.jpeg b/public/texture/synth.jpeg new file mode 100644 index 000000000..7123185c4 Binary files /dev/null and b/public/texture/synth.jpeg differ diff --git a/public/vendor/animate/animate.css b/public/vendor/animate/animate.css new file mode 100755 index 000000000..1e79e03ad --- /dev/null +++ b/public/vendor/animate/animate.css @@ -0,0 +1,1579 @@ +@charset "UTF-8"; + +/*! + * animate.css -http://daneden.me/animate + * Version - 3.5.2 + * Licensed under the MIT license - http://opensource.org/licenses/MIT + * + * Copyright (c) 2017 Daniel Eden + */ + +.animated { + animation-duration: 1s; + animation-fill-mode: both; +} + +.animated.infinite { + animation-iteration-count: infinite; +} + +.animated.hinge { + animation-duration: 2s; +} + +.animated.flipOutX, +.animated.flipOutY, +.animated.bounceIn, +.animated.bounceOut { + animation-duration: .75s; +} + +@keyframes bounce { + from, 20%, 53%, 80%, to { + animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); + transform: translate3d(0,0,0); + } + + 40%, 43% { + animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060); + transform: translate3d(0, -30px, 0); + } + + 70% { + animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060); + transform: translate3d(0, -15px, 0); + } + + 90% { + transform: translate3d(0,-4px,0); + } +} + +.bounce { + animation-name: bounce; + transform-origin: center bottom; +} + +@keyframes flash { + from, 50%, to { + opacity: 1; + } + + 25%, 75% { + opacity: 0; + } +} + +.flash { + animation-name: flash; +} + +/* originally authored by Nick Pettit - https://github.com/nickpettit/glide */ + +@keyframes pulse { + from { + transform: scale3d(1, 1, 1); + } + + 50% { + transform: scale3d(1.05, 1.05, 1.05); + } + + to { + transform: scale3d(1, 1, 1); + } +} + +.pulse { + animation-name: pulse; +} + +@keyframes rubberBand { + from { + transform: scale3d(1, 1, 1); + } + + 30% { + transform: scale3d(1.25, 0.75, 1); + } + + 40% { + transform: scale3d(0.75, 1.25, 1); + } + + 50% { + transform: scale3d(1.15, 0.85, 1); + } + + 65% { + transform: scale3d(.95, 1.05, 1); + } + + 75% { + transform: scale3d(1.05, .95, 1); + } + + to { + transform: scale3d(1, 1, 1); + } +} + +.rubberBand { + animation-name: rubberBand; +} + +@keyframes shake { + from, to { + transform: translate3d(0, 0, 0); + } + + 10%, 30%, 50%, 70%, 90% { + transform: translate3d(-10px, 0, 0); + } + + 20%, 40%, 60%, 80% { + transform: translate3d(10px, 0, 0); + } +} + +.shake { + animation-name: shake; +} + +@keyframes headShake { + 0% { + transform: translateX(0); + } + + 6.5% { + transform: translateX(-6px) rotateY(-9deg); + } + + 18.5% { + transform: translateX(5px) rotateY(7deg); + } + + 31.5% { + transform: translateX(-3px) rotateY(-5deg); + } + + 43.5% { + transform: translateX(2px) rotateY(3deg); + } + + 50% { + transform: translateX(0); + } +} + +.headShake { + animation-timing-function: ease-in-out; + animation-name: headShake; +} + +@keyframes swing { + 20% { + transform: rotate3d(0, 0, 1, 15deg); + } + + 40% { + transform: rotate3d(0, 0, 1, -10deg); + } + + 60% { + transform: rotate3d(0, 0, 1, 5deg); + } + + 80% { + transform: rotate3d(0, 0, 1, -5deg); + } + + to { + transform: rotate3d(0, 0, 1, 0deg); + } +} + +.swing { + transform-origin: top center; + animation-name: swing; +} + +@keyframes tada { + from { + transform: scale3d(1, 1, 1); + } + + 10%, 20% { + transform: scale3d(.9, .9, .9) rotate3d(0, 0, 1, -3deg); + } + + 30%, 50%, 70%, 90% { + transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, 3deg); + } + + 40%, 60%, 80% { + transform: scale3d(1.1, 1.1, 1.1) rotate3d(0, 0, 1, -3deg); + } + + to { + transform: scale3d(1, 1, 1); + } +} + +.tada { + animation-name: tada; +} + +/* originally authored by Nick Pettit - https://github.com/nickpettit/glide */ + +@keyframes wobble { + from { + transform: none; + } + + 15% { + transform: translate3d(-25%, 0, 0) rotate3d(0, 0, 1, -5deg); + } + + 30% { + transform: translate3d(20%, 0, 0) rotate3d(0, 0, 1, 3deg); + } + + 45% { + transform: translate3d(-15%, 0, 0) rotate3d(0, 0, 1, -3deg); + } + + 60% { + transform: translate3d(10%, 0, 0) rotate3d(0, 0, 1, 2deg); + } + + 75% { + transform: translate3d(-5%, 0, 0) rotate3d(0, 0, 1, -1deg); + } + + to { + transform: none; + } +} + +.wobble { + animation-name: wobble; +} + +@keyframes jello { + from, 11.1%, to { + transform: none; + } + + 22.2% { + transform: skewX(-12.5deg) skewY(-12.5deg); + } + + 33.3% { + transform: skewX(6.25deg) skewY(6.25deg); + } + + 44.4% { + transform: skewX(-3.125deg) skewY(-3.125deg); + } + + 55.5% { + transform: skewX(1.5625deg) skewY(1.5625deg); + } + + 66.6% { + transform: skewX(-0.78125deg) skewY(-0.78125deg); + } + + 77.7% { + transform: skewX(0.390625deg) skewY(0.390625deg); + } + + 88.8% { + transform: skewX(-0.1953125deg) skewY(-0.1953125deg); + } +} + +.jello { + animation-name: jello; + transform-origin: center; +} + +@keyframes bounceIn { + from, 20%, 40%, 60%, 80%, to { + animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); + } + + 0% { + opacity: 0; + transform: scale3d(.3, .3, .3); + } + + 20% { + transform: scale3d(1.1, 1.1, 1.1); + } + + 40% { + transform: scale3d(.9, .9, .9); + } + + 60% { + opacity: 1; + transform: scale3d(1.03, 1.03, 1.03); + } + + 80% { + transform: scale3d(.97, .97, .97); + } + + to { + opacity: 1; + transform: scale3d(1, 1, 1); + } +} + +.bounceIn { + animation-name: bounceIn; +} + +@keyframes bounceInDown { + from, 60%, 75%, 90%, to { + animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); + } + + 0% { + opacity: 0; + transform: translate3d(0, -3000px, 0); + } + + 60% { + opacity: 1; + transform: translate3d(0, 25px, 0); + } + + 75% { + transform: translate3d(0, -10px, 0); + } + + 90% { + transform: translate3d(0, 5px, 0); + } + + to { + transform: none; + } +} + +.bounceInDown { + animation-name: bounceInDown; +} + +@keyframes bounceInLeft { + from, 60%, 75%, 90%, to { + animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); + } + + 0% { + opacity: 0; + transform: translate3d(-3000px, 0, 0); + } + + 60% { + opacity: 1; + transform: translate3d(25px, 0, 0); + } + + 75% { + transform: translate3d(-10px, 0, 0); + } + + 90% { + transform: translate3d(5px, 0, 0); + } + + to { + transform: none; + } +} + +.bounceInLeft { + animation-name: bounceInLeft; +} + +@keyframes bounceInRight { + from, 60%, 75%, 90%, to { + animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); + } + + from { + opacity: 0; + transform: translate3d(3000px, 0, 0); + } + + 60% { + opacity: 1; + transform: translate3d(-25px, 0, 0); + } + + 75% { + transform: translate3d(10px, 0, 0); + } + + 90% { + transform: translate3d(-5px, 0, 0); + } + + to { + transform: none; + } +} + +.bounceInRight { + animation-name: bounceInRight; +} + +@keyframes bounceInUp { + from, 60%, 75%, 90%, to { + animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000); + } + + from { + opacity: 0; + transform: translate3d(0, 3000px, 0); + } + + 60% { + opacity: 1; + transform: translate3d(0, -20px, 0); + } + + 75% { + transform: translate3d(0, 10px, 0); + } + + 90% { + transform: translate3d(0, -5px, 0); + } + + to { + transform: translate3d(0, 0, 0); + } +} + +.bounceInUp { + animation-name: bounceInUp; +} + +@keyframes bounceOut { + 20% { + transform: scale3d(.9, .9, .9); + } + + 50%, 55% { + opacity: 1; + transform: scale3d(1.1, 1.1, 1.1); + } + + to { + opacity: 0; + transform: scale3d(.3, .3, .3); + } +} + +.bounceOut { + animation-name: bounceOut; +} + +@keyframes bounceOutDown { + 20% { + transform: translate3d(0, 10px, 0); + } + + 40%, 45% { + opacity: 1; + transform: translate3d(0, -20px, 0); + } + + to { + opacity: 0; + transform: translate3d(0, 2000px, 0); + } +} + +.bounceOutDown { + animation-name: bounceOutDown; +} + +@keyframes bounceOutLeft { + 20% { + opacity: 1; + transform: translate3d(20px, 0, 0); + } + + to { + opacity: 0; + transform: translate3d(-2000px, 0, 0); + } +} + +.bounceOutLeft { + animation-name: bounceOutLeft; +} + +@keyframes bounceOutRight { + 20% { + opacity: 1; + transform: translate3d(-20px, 0, 0); + } + + to { + opacity: 0; + transform: translate3d(2000px, 0, 0); + } +} + +.bounceOutRight { + animation-name: bounceOutRight; +} + +@keyframes bounceOutUp { + 20% { + transform: translate3d(0, -10px, 0); + } + + 40%, 45% { + opacity: 1; + transform: translate3d(0, 20px, 0); + } + + to { + opacity: 0; + transform: translate3d(0, -2000px, 0); + } +} + +.bounceOutUp { + animation-name: bounceOutUp; +} + +@keyframes fadeIn { + from { + opacity: 0; + } + + to { + opacity: 1; + } +} + +.fadeIn { + animation-name: fadeIn; +} + +@keyframes fadeInDown { + from { + opacity: 0; + transform: translate3d(0, -100%, 0); + } + + to { + opacity: 1; + transform: none; + } +} + +.fadeInDown { + animation-name: fadeInDown; +} + +@keyframes fadeInDownBig { + from { + opacity: 0; + transform: translate3d(0, -2000px, 0); + } + + to { + opacity: 1; + transform: none; + } +} + +.fadeInDownBig { + animation-name: fadeInDownBig; +} + +@keyframes fadeInLeft { + from { + opacity: 0; + transform: translate3d(-100%, 0, 0); + } + + to { + opacity: 1; + transform: none; + } +} + +.fadeInLeft { + animation-name: fadeInLeft; +} + +@keyframes fadeInLeftBig { + from { + opacity: 0; + transform: translate3d(-2000px, 0, 0); + } + + to { + opacity: 1; + transform: none; + } +} + +.fadeInLeftBig { + animation-name: fadeInLeftBig; +} + +@keyframes fadeInRight { + from { + opacity: 0; + transform: translate3d(100%, 0, 0); + } + + to { + opacity: 1; + transform: none; + } +} + +.fadeInRight { + animation-name: fadeInRight; +} + +@keyframes fadeInRightBig { + from { + opacity: 0; + transform: translate3d(2000px, 0, 0); + } + + to { + opacity: 1; + transform: none; + } +} + +.fadeInRightBig { + animation-name: fadeInRightBig; +} + +@keyframes fadeInUp { + from { + opacity: 0; + transform: translate3d(0, 100%, 0); + } + + to { + opacity: 1; + transform: none; + } +} + +.fadeInUp { + animation-name: fadeInUp; +} + +@keyframes fadeInUpBig { + from { + opacity: 0; + transform: translate3d(0, 2000px, 0); + } + + to { + opacity: 1; + transform: none; + } +} + +.fadeInUpBig { + animation-name: fadeInUpBig; +} + +@keyframes fadeOut { + from { + opacity: 1; + } + + to { + opacity: 0; + } +} + +.fadeOut { + animation-name: fadeOut; +} + +@keyframes fadeOutDown { + from { + opacity: 1; + } + + to { + opacity: 0; + transform: translate3d(0, 100%, 0); + } +} + +.fadeOutDown { + animation-name: fadeOutDown; +} + +@keyframes fadeOutDownBig { + from { + opacity: 1; + } + + to { + opacity: 0; + transform: translate3d(0, 2000px, 0); + } +} + +.fadeOutDownBig { + animation-name: fadeOutDownBig; +} + +@keyframes fadeOutLeft { + from { + opacity: 1; + } + + to { + opacity: 0; + transform: translate3d(-100%, 0, 0); + } +} + +.fadeOutLeft { + animation-name: fadeOutLeft; +} + +@keyframes fadeOutLeftBig { + from { + opacity: 1; + } + + to { + opacity: 0; + transform: translate3d(-2000px, 0, 0); + } +} + +.fadeOutLeftBig { + animation-name: fadeOutLeftBig; +} + +@keyframes fadeOutRight { + from { + opacity: 1; + } + + to { + opacity: 0; + transform: translate3d(100%, 0, 0); + } +} + +.fadeOutRight { + animation-name: fadeOutRight; +} + +@keyframes fadeOutRightBig { + from { + opacity: 1; + } + + to { + opacity: 0; + transform: translate3d(2000px, 0, 0); + } +} + +.fadeOutRightBig { + animation-name: fadeOutRightBig; +} + +@keyframes fadeOutUp { + from { + opacity: 1; + } + + to { + opacity: 0; + transform: translate3d(0, -100%, 0); + } +} + +.fadeOutUp { + animation-name: fadeOutUp; +} + +@keyframes fadeOutUpBig { + from { + opacity: 1; + } + + to { + opacity: 0; + transform: translate3d(0, -2000px, 0); + } +} + +.fadeOutUpBig { + animation-name: fadeOutUpBig; +} + +@keyframes flip { + from { + transform: perspective(400px) rotate3d(0, 1, 0, -360deg); + animation-timing-function: ease-out; + } + + 40% { + transform: perspective(400px) translate3d(0, 0, 150px) rotate3d(0, 1, 0, -190deg); + animation-timing-function: ease-out; + } + + 50% { + transform: perspective(400px) translate3d(0, 0, 150px) rotate3d(0, 1, 0, -170deg); + animation-timing-function: ease-in; + } + + 80% { + transform: perspective(400px) scale3d(.95, .95, .95); + animation-timing-function: ease-in; + } + + to { + transform: perspective(400px); + animation-timing-function: ease-in; + } +} + +.animated.flip { + -webkit-backface-visibility: visible; + backface-visibility: visible; + animation-name: flip; +} + +@keyframes flipInX { + from { + transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + animation-timing-function: ease-in; + opacity: 0; + } + + 40% { + transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + animation-timing-function: ease-in; + } + + 60% { + transform: perspective(400px) rotate3d(1, 0, 0, 10deg); + opacity: 1; + } + + 80% { + transform: perspective(400px) rotate3d(1, 0, 0, -5deg); + } + + to { + transform: perspective(400px); + } +} + +.flipInX { + -webkit-backface-visibility: visible !important; + backface-visibility: visible !important; + animation-name: flipInX; +} + +@keyframes flipInY { + from { + transform: perspective(400px) rotate3d(0, 1, 0, 90deg); + animation-timing-function: ease-in; + opacity: 0; + } + + 40% { + transform: perspective(400px) rotate3d(0, 1, 0, -20deg); + animation-timing-function: ease-in; + } + + 60% { + transform: perspective(400px) rotate3d(0, 1, 0, 10deg); + opacity: 1; + } + + 80% { + transform: perspective(400px) rotate3d(0, 1, 0, -5deg); + } + + to { + transform: perspective(400px); + } +} + +.flipInY { + -webkit-backface-visibility: visible !important; + backface-visibility: visible !important; + animation-name: flipInY; +} + +@keyframes flipOutX { + from { + transform: perspective(400px); + } + + 30% { + transform: perspective(400px) rotate3d(1, 0, 0, -20deg); + opacity: 1; + } + + to { + transform: perspective(400px) rotate3d(1, 0, 0, 90deg); + opacity: 0; + } +} + +.flipOutX { + animation-name: flipOutX; + -webkit-backface-visibility: visible !important; + backface-visibility: visible !important; +} + +@keyframes flipOutY { + from { + transform: perspective(400px); + } + + 30% { + transform: perspective(400px) rotate3d(0, 1, 0, -15deg); + opacity: 1; + } + + to { + transform: perspective(400px) rotate3d(0, 1, 0, 90deg); + opacity: 0; + } +} + +.flipOutY { + -webkit-backface-visibility: visible !important; + backface-visibility: visible !important; + animation-name: flipOutY; +} + +@keyframes lightSpeedIn { + from { + transform: translate3d(100%, 0, 0) skewX(-30deg); + opacity: 0; + } + + 60% { + transform: skewX(20deg); + opacity: 1; + } + + 80% { + transform: skewX(-5deg); + opacity: 1; + } + + to { + transform: none; + opacity: 1; + } +} + +.lightSpeedIn { + animation-name: lightSpeedIn; + animation-timing-function: ease-out; +} + +@keyframes lightSpeedOut { + from { + opacity: 1; + } + + to { + transform: translate3d(100%, 0, 0) skewX(30deg); + opacity: 0; + } +} + +.lightSpeedOut { + animation-name: lightSpeedOut; + animation-timing-function: ease-in; +} + +@keyframes rotateIn { + from { + transform-origin: center; + transform: rotate3d(0, 0, 1, -200deg); + opacity: 0; + } + + to { + transform-origin: center; + transform: none; + opacity: 1; + } +} + +.rotateIn { + animation-name: rotateIn; +} + +@keyframes rotateInDownLeft { + from { + transform-origin: left bottom; + transform: rotate3d(0, 0, 1, -45deg); + opacity: 0; + } + + to { + transform-origin: left bottom; + transform: none; + opacity: 1; + } +} + +.rotateInDownLeft { + animation-name: rotateInDownLeft; +} + +@keyframes rotateInDownRight { + from { + transform-origin: right bottom; + transform: rotate3d(0, 0, 1, 45deg); + opacity: 0; + } + + to { + transform-origin: right bottom; + transform: none; + opacity: 1; + } +} + +.rotateInDownRight { + animation-name: rotateInDownRight; +} + +@keyframes rotateInUpLeft { + from { + transform-origin: left bottom; + transform: rotate3d(0, 0, 1, 45deg); + opacity: 0; + } + + to { + transform-origin: left bottom; + transform: none; + opacity: 1; + } +} + +.rotateInUpLeft { + animation-name: rotateInUpLeft; +} + +@keyframes rotateInUpRight { + from { + transform-origin: right bottom; + transform: rotate3d(0, 0, 1, -90deg); + opacity: 0; + } + + to { + transform-origin: right bottom; + transform: none; + opacity: 1; + } +} + +.rotateInUpRight { + animation-name: rotateInUpRight; +} + +@keyframes rotateOut { + from { + transform-origin: center; + opacity: 1; + } + + to { + transform-origin: center; + transform: rotate3d(0, 0, 1, 200deg); + opacity: 0; + } +} + +.rotateOut { + animation-name: rotateOut; +} + +@keyframes rotateOutDownLeft { + from { + transform-origin: left bottom; + opacity: 1; + } + + to { + transform-origin: left bottom; + transform: rotate3d(0, 0, 1, 45deg); + opacity: 0; + } +} + +.rotateOutDownLeft { + animation-name: rotateOutDownLeft; +} + +@keyframes rotateOutDownRight { + from { + transform-origin: right bottom; + opacity: 1; + } + + to { + transform-origin: right bottom; + transform: rotate3d(0, 0, 1, -45deg); + opacity: 0; + } +} + +.rotateOutDownRight { + animation-name: rotateOutDownRight; +} + +@keyframes rotateOutUpLeft { + from { + transform-origin: left bottom; + opacity: 1; + } + + to { + transform-origin: left bottom; + transform: rotate3d(0, 0, 1, -45deg); + opacity: 0; + } +} + +.rotateOutUpLeft { + animation-name: rotateOutUpLeft; +} + +@keyframes rotateOutUpRight { + from { + transform-origin: right bottom; + opacity: 1; + } + + to { + transform-origin: right bottom; + transform: rotate3d(0, 0, 1, 90deg); + opacity: 0; + } +} + +.rotateOutUpRight { + animation-name: rotateOutUpRight; +} + +@keyframes hinge { + 0% { + transform-origin: top left; + animation-timing-function: ease-in-out; + } + + 20%, 60% { + transform: rotate3d(0, 0, 1, 80deg); + transform-origin: top left; + animation-timing-function: ease-in-out; + } + + 40%, 80% { + transform: rotate3d(0, 0, 1, 60deg); + transform-origin: top left; + animation-timing-function: ease-in-out; + opacity: 1; + } + + to { + transform: translate3d(0, 700px, 0); + opacity: 0; + } +} + +.hinge { + animation-name: hinge; +} + +@keyframes jackInTheBox { + from { + opacity: 0; + transform: scale(0.1) rotate(30deg); + transform-origin: center bottom; + } + + 50% { + transform: rotate(-10deg); + } + + 70% { + transform: rotate(3deg); + } + + to { + opacity: 1; + transform: scale(1); + } +} + +.jackInTheBox { + animation-name: jackInTheBox; +} + +/* originally authored by Nick Pettit - https://github.com/nickpettit/glide */ + +@keyframes rollIn { + from { + opacity: 0; + transform: translate3d(-100%, 0, 0) rotate3d(0, 0, 1, -120deg); + } + + to { + opacity: 1; + transform: none; + } +} + +.rollIn { + animation-name: rollIn; +} + +/* originally authored by Nick Pettit - https://github.com/nickpettit/glide */ + +@keyframes rollOut { + from { + opacity: 1; + } + + to { + opacity: 0; + transform: translate3d(100%, 0, 0) rotate3d(0, 0, 1, 120deg); + } +} + +.rollOut { + animation-name: rollOut; +} + +@keyframes zoomIn { + from { + opacity: 0; + transform: scale3d(.3, .3, .3); + } + + 50% { + opacity: 1; + } +} + +.zoomIn { + animation-name: zoomIn; +} + +@keyframes zoomInDown { + from { + opacity: 0; + transform: scale3d(.1, .1, .1) translate3d(0, -1000px, 0); + animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190); + } + + 60% { + opacity: 1; + transform: scale3d(.475, .475, .475) translate3d(0, 60px, 0); + animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + } +} + +.zoomInDown { + animation-name: zoomInDown; +} + +@keyframes zoomInLeft { + from { + opacity: 0; + transform: scale3d(.1, .1, .1) translate3d(-1000px, 0, 0); + animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190); + } + + 60% { + opacity: 1; + transform: scale3d(.475, .475, .475) translate3d(10px, 0, 0); + animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + } +} + +.zoomInLeft { + animation-name: zoomInLeft; +} + +@keyframes zoomInRight { + from { + opacity: 0; + transform: scale3d(.1, .1, .1) translate3d(1000px, 0, 0); + animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190); + } + + 60% { + opacity: 1; + transform: scale3d(.475, .475, .475) translate3d(-10px, 0, 0); + animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + } +} + +.zoomInRight { + animation-name: zoomInRight; +} + +@keyframes zoomInUp { + from { + opacity: 0; + transform: scale3d(.1, .1, .1) translate3d(0, 1000px, 0); + animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190); + } + + 60% { + opacity: 1; + transform: scale3d(.475, .475, .475) translate3d(0, -60px, 0); + animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + } +} + +.zoomInUp { + animation-name: zoomInUp; +} + +@keyframes zoomOut { + from { + opacity: 1; + } + + 50% { + opacity: 0; + transform: scale3d(.3, .3, .3); + } + + to { + opacity: 0; + } +} + +.zoomOut { + animation-name: zoomOut; +} + +@keyframes zoomOutDown { + 40% { + opacity: 1; + transform: scale3d(.475, .475, .475) translate3d(0, -60px, 0); + animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190); + } + + to { + opacity: 0; + transform: scale3d(.1, .1, .1) translate3d(0, 2000px, 0); + transform-origin: center bottom; + animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + } +} + +.zoomOutDown { + animation-name: zoomOutDown; +} + +@keyframes zoomOutLeft { + 40% { + opacity: 1; + transform: scale3d(.475, .475, .475) translate3d(42px, 0, 0); + } + + to { + opacity: 0; + transform: scale(.1) translate3d(-2000px, 0, 0); + transform-origin: left center; + } +} + +.zoomOutLeft { + animation-name: zoomOutLeft; +} + +@keyframes zoomOutRight { + 40% { + opacity: 1; + transform: scale3d(.475, .475, .475) translate3d(-42px, 0, 0); + } + + to { + opacity: 0; + transform: scale(.1) translate3d(2000px, 0, 0); + transform-origin: right center; + } +} + +.zoomOutRight { + animation-name: zoomOutRight; +} + +@keyframes zoomOutUp { + 40% { + opacity: 1; + transform: scale3d(.475, .475, .475) translate3d(0, 60px, 0); + animation-timing-function: cubic-bezier(0.550, 0.055, 0.675, 0.190); + } + + to { + opacity: 0; + transform: scale3d(.1, .1, .1) translate3d(0, -2000px, 0); + transform-origin: center bottom; + animation-timing-function: cubic-bezier(0.175, 0.885, 0.320, 1); + } +} + +.zoomOutUp { + animation-name: zoomOutUp; +} + +@keyframes slideInDown { + from { + transform: translate3d(0, -100%, 0); + visibility: visible; + } + + to { + transform: translate3d(0, 0, 0); + } +} + +.slideInDown { + animation-name: slideInDown; +} + +@keyframes slideInLeft { + from { + transform: translate3d(-100%, 0, 0); + visibility: visible; + } + + to { + transform: translate3d(0, 0, 0); + } +} + +.slideInLeft { + animation-name: slideInLeft; +} + +@keyframes slideInRight { + from { + transform: translate3d(100%, 0, 0); + visibility: visible; + } + + to { + transform: translate3d(0, 0, 0); + } +} + +.slideInRight { + animation-name: slideInRight; +} + +@keyframes slideInUp { + from { + transform: translate3d(0, 100%, 0); + visibility: visible; + } + + to { + transform: translate3d(0, 0, 0); + } +} + +.slideInUp { + animation-name: slideInUp; +} + +@keyframes slideOutDown { + from { + transform: translate3d(0, 0, 0); + } + + to { + visibility: hidden; + transform: translate3d(0, 100%, 0); + } +} + +.slideOutDown { + animation-name: slideOutDown; +} + +@keyframes slideOutLeft { + from { + transform: translate3d(0, 0, 0); + } + + to { + visibility: hidden; + transform: translate3d(-100%, 0, 0); + } +} + +.slideOutLeft { + animation-name: slideOutLeft; +} + +@keyframes slideOutRight { + from { + transform: translate3d(0, 0, 0); + } + + to { + visibility: hidden; + transform: translate3d(100%, 0, 0); + } +} + +.slideOutRight { + animation-name: slideOutRight; +} + +@keyframes slideOutUp { + from { + transform: translate3d(0, 0, 0); + } + + to { + visibility: hidden; + transform: translate3d(0, -100%, 0); + } +} + +.slideOutUp { + animation-name: slideOutUp; +} diff --git a/public/vendor/animsition/css/animsition.css b/public/vendor/animsition/css/animsition.css new file mode 100755 index 000000000..5ce974494 --- /dev/null +++ b/public/vendor/animsition/css/animsition.css @@ -0,0 +1,1957 @@ +/*! + * animsition v4.0.2 + * A simple and easy jQuery plugin for CSS animated page transitions. + * http://blivesta.github.io/animsition + * License : MIT + * Author : blivesta (http://blivesta.com/) + */ +.animsition, +.animsition-overlay { + position: relative; + opacity: 0; + -webkit-animation-fill-mode: both; + animation-fill-mode: both; +} + +/** + * overlay option + */ +.animsition-overlay-slide { + position: fixed; + z-index: 1; + width: 100%; + height: 100%; + background-color: #ddd; +} +/* loading option */ +.animsition-loading, +.animsition-loading:after { + width: 32px; + height: 32px; + position: fixed; + top: 50%; + left: 50%; + margin-top: -16px; + margin-left: -16px; + border-radius: 50%; + z-index: 100; +} + +.animsition-loading { + background-color: transparent; + border-top: 5px solid rgba(0, 0, 0, 0.2); + border-right: 5px solid rgba(0, 0, 0, 0.2); + border-bottom: 5px solid rgba(0, 0, 0, 0.2); + border-left: 5px solid #eee; + -webkit-transform: translateZ(0); + transform: translateZ(0); + -webkit-animation-iteration-count:infinite; + animation-iteration-count:infinite; + -webkit-animation-timing-function: linear; + animation-timing-function: linear; + -webkit-animation-duration: .8s; + animation-duration: .8s; + -webkit-animation-name: animsition-loading; + animation-name: animsition-loading; +} + +@-webkit-keyframes animsition-loading { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} + +@keyframes animsition-loading { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} + +@-webkit-keyframes fade-in { + 0% { + opacity: 0; + } + 100% { + opacity: 1; + } +} + +@keyframes fade-in { + 0% { + opacity: 0; + } + 100% { + opacity: 1; + } +} + + +.fade-in { + -webkit-animation-name: fade-in; + animation-name: fade-in; +} + + +@-webkit-keyframes fade-out { + 0% { + opacity: 1; + } + 100% { + opacity: 0; + } +} + + +@keyframes fade-out { + 0% { + opacity: 1; + } + 100% { + opacity: 0; + } +} + + +.fade-out { + -webkit-animation-name: fade-out; + animation-name: fade-out; +} +@-webkit-keyframes fade-in-up { + 0% { + -webkit-transform: translateY(500px); + transform: translateY(500px); + opacity: 0; + } + 100% { + -webkit-transform: translateY(0); + transform: translateY(0); + opacity: 1; + } +} +@keyframes fade-in-up { + 0% { + -webkit-transform: translateY(500px); + transform: translateY(500px); + opacity: 0; + } + 100% { + -webkit-transform: translateY(0); + transform: translateY(0); + opacity: 1; + } +} + + +.fade-in-up { + -webkit-animation-name: fade-in-up; + animation-name: fade-in-up; +} + + +@-webkit-keyframes fade-out-up { + 0% { + -webkit-transform: translateY(0); + transform: translateY(0); + opacity: 1; + } + 100% { + -webkit-transform: translateY(-500px); + transform: translateY(-500px); + opacity: 0; + } +} + + +@keyframes fade-out-up { + 0% { + -webkit-transform: translateY(0); + transform: translateY(0); + opacity: 1; + } + 100% { + -webkit-transform: translateY(-500px); + transform: translateY(-500px); + opacity: 0; + } +} + + +.fade-out-up { + -webkit-animation-name: fade-out-up; + animation-name: fade-out-up; +} +@-webkit-keyframes fade-in-up-sm { + 0% { + -webkit-transform: translateY(100px); + transform: translateY(100px); + opacity: 0; + } + 100% { + -webkit-transform: translateY(0); + transform: translateY(0); + opacity: 1; + } +} +@keyframes fade-in-up-sm { + 0% { + -webkit-transform: translateY(100px); + transform: translateY(100px); + opacity: 0; + } + 100% { + -webkit-transform: translateY(0); + transform: translateY(0); + opacity: 1; + } +} + + +.fade-in-up-sm { + -webkit-animation-name: fade-in-up-sm; + animation-name: fade-in-up-sm; +} + + +@-webkit-keyframes fade-out-up-sm { + 0% { + -webkit-transform: translateY(0); + transform: translateY(0); + opacity: 1; + } + 100% { + -webkit-transform: translateY(-100px); + transform: translateY(-100px); + opacity: 0; + } +} + + +@keyframes fade-out-up-sm { + 0% { + -webkit-transform: translateY(0); + transform: translateY(0); + opacity: 1; + } + 100% { + -webkit-transform: translateY(-100px); + transform: translateY(-100px); + opacity: 0; + } +} + + +.fade-out-up-sm { + -webkit-animation-name: fade-out-up-sm; + animation-name: fade-out-up-sm; +} +@-webkit-keyframes fade-in-up-lg { + 0% { + -webkit-transform: translateY(1000px); + transform: translateY(1000px); + opacity: 0; + } + 100% { + -webkit-transform: translateY(0); + transform: translateY(0); + opacity: 1; + } +} +@keyframes fade-in-up-lg { + 0% { + -webkit-transform: translateY(1000px); + transform: translateY(1000px); + opacity: 0; + } + 100% { + -webkit-transform: translateY(0); + transform: translateY(0); + opacity: 1; + } +} + + +.fade-in-up-lg { + -webkit-animation-name: fade-in-up-lg; + animation-name: fade-in-up-lg; +} + + +@-webkit-keyframes fade-out-up-lg { + 0% { + -webkit-transform: translateY(0); + transform: translateY(0); + opacity: 1; + } + 100% { + -webkit-transform: translateY(-1000px); + transform: translateY(-1000px); + opacity: 0; + } +} + + +@keyframes fade-out-up-lg { + 0% { + -webkit-transform: translateY(0); + transform: translateY(0); + opacity: 1; + } + 100% { + -webkit-transform: translateY(-1000px); + transform: translateY(-1000px); + opacity: 0; + } +} + + +.fade-out-up-lg { + -webkit-animation-name: fade-out-up-lg; + animation-name: fade-out-up-lg; +} +@-webkit-keyframes fade-in-down { + 0% { + -webkit-transform: translateY(-500px); + transform: translateY(-500px); + opacity: 0; + } + 100% { + -webkit-transform: translateY(0); + transform: translateY(0); + opacity: 1; + } +} +@keyframes fade-in-down { + 0% { + -webkit-transform: translateY(-500px); + transform: translateY(-500px); + opacity: 0; + } + 100% { + -webkit-transform: translateY(0); + transform: translateY(0); + opacity: 1; + } +} + + +.fade-in-down { + -webkit-animation-name: fade-in-down; + animation-name: fade-in-down; +} + + +@-webkit-keyframes fade-out-down { + 0% { + -webkit-transform: translateY(0); + transform: translateY(0); + opacity: 1; + } + 100% { + -webkit-transform: translateY(500px); + transform: translateY(500px); + opacity: 0; + } +} + + +@keyframes fade-out-down { + 0% { + -webkit-transform: translateY(0); + transform: translateY(0); + opacity: 1; + } + 100% { + -webkit-transform: translateY(500px); + transform: translateY(500px); + opacity: 0; + } +} + + +.fade-out-down { + -webkit-animation-name: fade-out-down; + animation-name: fade-out-down; +} +@-webkit-keyframes fade-in-down-sm { + 0% { + -webkit-transform: translateY(-100px); + transform: translateY(-100px); + opacity: 0; + } + 100% { + -webkit-transform: translateY(0); + transform: translateY(0); + opacity: 1; + } +} +@keyframes fade-in-down-sm { + 0% { + -webkit-transform: translateY(-100px); + transform: translateY(-100px); + opacity: 0; + } + 100% { + -webkit-transform: translateY(0); + transform: translateY(0); + opacity: 1; + } +} + + +.fade-in-down-sm { + -webkit-animation-name: fade-in-down-sm; + animation-name: fade-in-down-sm; +} + + +@-webkit-keyframes fade-out-down-sm { + 0% { + -webkit-transform: translateY(0); + transform: translateY(0); + opacity: 1; + } + 100% { + -webkit-transform: translateY(100px); + transform: translateY(100px); + opacity: 0; + } +} + + +@keyframes fade-out-down-sm { + 0% { + -webkit-transform: translateY(0); + transform: translateY(0); + opacity: 1; + } + 100% { + -webkit-transform: translateY(100px); + transform: translateY(100px); + opacity: 0; + } +} + + +.fade-out-down-sm { + -webkit-animation-name: fade-out-down-sm; + animation-name: fade-out-down-sm; +} +@-webkit-keyframes fade-in-down-lg { + 0% { + -webkit-transform: translateY(-1000px); + transform: translateY(-1000px); + opacity: 0; + } + 100% { + -webkit-transform: translateY(0); + transform: translateY(0); + opacity: 1; + } +} +@keyframes fade-in-down-lg { + 0% { + -webkit-transform: translateY(-1000px); + transform: translateY(-1000px); + opacity: 0; + } + 100% { + -webkit-transform: translateY(0); + transform: translateY(0); + opacity: 1; + } +} + + +.fade-in-down-lg { + -webkit-animation-name: fade-in-down; + animation-name: fade-in-down; +} + + +@-webkit-keyframes fade-out-down-lg { + 0% { + -webkit-transform: translateY(0); + transform: translateY(0); + opacity: 1; + } + 100% { + -webkit-transform: translateY(1000px); + transform: translateY(1000px); + opacity: 0; + } +} + + +@keyframes fade-out-down-lg { + 0% { + -webkit-transform: translateY(0); + transform: translateY(0); + opacity: 1; + } + 100% { + -webkit-transform: translateY(1000px); + transform: translateY(1000px); + opacity: 0; + } +} + + +.fade-out-down-lg { + -webkit-animation-name: fade-out-down-lg; + animation-name: fade-out-down-lg; +} +@-webkit-keyframes fade-in-left { + 0% { + -webkit-transform: translateX(-500px); + transform: translateX(-500px); + opacity: 0; + } + 100% { + -webkit-transform: translateX(0); + transform: translateX(0); + opacity: 1; + } +} +@keyframes fade-in-left { + 0% { + -webkit-transform: translateX(-500px); + transform: translateX(-500px); + opacity: 0; + } + 100% { + -webkit-transform: translateX(0); + transform: translateX(0); + opacity: 1; + } +} + + +.fade-in-left { + -webkit-animation-name: fade-in-left; + animation-name: fade-in-left; +} + + +@-webkit-keyframes fade-out-left { + 0% { + -webkit-transform: translateX(0); + transform: translateX(0); + opacity: 1; + } + 100% { + -webkit-transform: translateX(-500px); + transform: translateX(-500px); + opacity: 0; + } +} + + +@keyframes fade-out-left { + 0% { + -webkit-transform: translateX(0); + transform: translateX(0); + opacity: 1; + } + 100% { + -webkit-transform: translateX(-500px); + transform: translateX(-500px); + opacity: 0; + } +} + + +.fade-out-left { + -webkit-animation-name: fade-out-left; + animation-name: fade-out-left; +} +@-webkit-keyframes fade-in-left-sm { + 0% { + -webkit-transform: translateX(-100px); + transform: translateX(-100px); + opacity: 0; + } + 100% { + -webkit-transform: translateX(0); + transform: translateX(0); + opacity: 1; + } +} +@keyframes fade-in-left-sm { + 0% { + -webkit-transform: translateX(-100px); + transform: translateX(-100px); + opacity: 0; + } + 100% { + -webkit-transform: translateX(0); + transform: translateX(0); + opacity: 1; + } +} + + +.fade-in-left-sm { + -webkit-animation-name: fade-in-left-sm; + animation-name: fade-in-left-sm; +} + + +@-webkit-keyframes fade-out-left-sm { + 0% { + -webkit-transform: translateX(0); + transform: translateX(0); + opacity: 1; + } + 100% { + -webkit-transform: translateX(-100px); + transform: translateX(-100px); + opacity: 0; + } +} + + +@keyframes fade-out-left-sm { + 0% { + -webkit-transform: translateX(0); + transform: translateX(0); + opacity: 1; + } + 100% { + -webkit-transform: translateX(-100px); + transform: translateX(-100px); + opacity: 0; + } +} + + +.fade-out-left-sm { + -webkit-animation-name: fade-out-left-sm; + animation-name: fade-out-left-sm; +} +@-webkit-keyframes fade-in-left-lg { + 0% { + -webkit-transform: translateX(-1500px); + transform: translateX(-1500px); + opacity: 0; + } + 100% { + -webkit-transform: translateX(0); + transform: translateX(0); + opacity: 1; + } +} +@keyframes fade-in-left-lg { + 0% { + -webkit-transform: translateX(-1500px); + transform: translateX(-1500px); + opacity: 0; + } + 100% { + -webkit-transform: translateX(0); + transform: translateX(0); + opacity: 1; + } +} + + +.fade-in-left-lg { + -webkit-animation-name: fade-in-left-lg; + animation-name: fade-in-left-lg; +} + + +@-webkit-keyframes fade-out-left-lg { + 0% { + -webkit-transform: translateX(0); + transform: translateX(0); + opacity: 1; + } + 100% { + -webkit-transform: translateX(-1500px); + transform: translateX(-1500px); + opacity: 0; + } +} + + +@keyframes fade-out-left-lg { + 0% { + -webkit-transform: translateX(0); + transform: translateX(0); + opacity: 1; + } + 100% { + -webkit-transform: translateX(-1500px); + transform: translateX(-1500px); + opacity: 0; + } +} + + +.fade-out-left-lg { + -webkit-animation-name: fade-out-left-lg; + animation-name: fade-out-left-lg; +} +@-webkit-keyframes fade-in-right { + 0% { + -webkit-transform: translateX(500px); + transform: translateX(500px); + opacity: 0; + } + 100% { + -webkit-transform: translateX(0); + transform: translateX(0); + opacity: 1; + } +} +@keyframes fade-in-right { + 0% { + -webkit-transform: translateX(500px); + transform: translateX(500px); + opacity: 0; + } + 100% { + -webkit-transform: translateX(0); + transform: translateX(0); + opacity: 1; + } +} + + +.fade-in-right { + -webkit-animation-name: fade-in-right; + animation-name: fade-in-right; +} + + +@-webkit-keyframes fade-out-right { + 0% { + -webkit-transform: translateX(0); + transform: translateX(0); + opacity: 1; + } + 100% { + -webkit-transform: translateX(500px); + transform: translateX(500px); + opacity: 0; + } +} + + +@keyframes fade-out-right { + 0% { + -webkit-transform: translateX(0); + transform: translateX(0); + opacity: 1; + } + 100% { + -webkit-transform: translateX(500px); + transform: translateX(500px); + opacity: 0; + } +} + + +.fade-out-right { + -webkit-animation-name: fade-out-right; + animation-name: fade-out-right; +} +@-webkit-keyframes fade-in-right-sm { + 0% { + -webkit-transform: translateX(100px); + transform: translateX(100px); + opacity: 0; + } + 100% { + -webkit-transform: translateX(0); + transform: translateX(0); + opacity: 1; + } +} +@keyframes fade-in-right-sm { + 0% { + -webkit-transform: translateX(100px); + transform: translateX(100px); + opacity: 0; + } + 100% { + -webkit-transform: translateX(0); + transform: translateX(0); + opacity: 1; + } +} + + +.fade-in-right-sm { + -webkit-animation-name: fade-in-right-sm; + animation-name: fade-in-right-sm; +} + + +@-webkit-keyframes fade-out-right-sm { + 0% { + -webkit-transform: translateX(0); + transform: translateX(0); + opacity: 1; + } + 100% { + -webkit-transform: translateX(100px); + transform: translateX(100px); + opacity: 0; + } +} + + +@keyframes fade-out-right-sm { + 0% { + -webkit-transform: translateX(0); + transform: translateX(0); + opacity: 1; + } + 100% { + -webkit-transform: translateX(100px); + transform: translateX(100px); + opacity: 0; + } +} + + +.fade-out-right-sm { + -webkit-animation-name: fade-out-right-sm; + animation-name: fade-out-right-sm; +} +@-webkit-keyframes fade-in-right-lg { + 0% { + -webkit-transform: translateX(1500px); + transform: translateX(1500px); + opacity: 0; + } + 100% { + -webkit-transform: translateX(0); + transform: translateX(0); + opacity: 1; + } +} +@keyframes fade-in-right-lg { + 0% { + -webkit-transform: translateX(1500px); + transform: translateX(1500px); + opacity: 0; + } + 100% { + -webkit-transform: translateX(0); + transform: translateX(0); + opacity: 1; + } +} + + +.fade-in-right-lg { + -webkit-animation-name: fade-in-right-lg; + animation-name: fade-in-right-lg; +} + + +@-webkit-keyframes fade-out-right-lg { + 0% { + -webkit-transform: translateX(0); + transform: translateX(0); + opacity: 1; + } + 100% { + -webkit-transform: translateX(1500px); + transform: translateX(1500px); + opacity: 0; + } +} + + +@keyframes fade-out-right-lg { + 0% { + -webkit-transform: translateX(0); + transform: translateX(0); + opacity: 1; + } + 100% { + -webkit-transform: translateX(1500px); + transform: translateX(1500px); + opacity: 0; + } +} + + +.fade-out-right-lg { + -webkit-animation-name: fade-out-right-lg; + animation-name: fade-out-right-lg; +} + +@-webkit-keyframes rotate-in { + 0% { + -webkit-transform: rotate(-90deg); + transform: rotate(-90deg); + -webkit-transform-origin: center center; + transform-origin: center center; + opacity: 0; + } + 100% { + -webkit-transform: rotate(0); + transform: rotate(0); + -webkit-transform-origin: center center; + transform-origin: center center; + opacity: 1; + } +} + +@keyframes rotate-in { + 0% { + -webkit-transform: rotate(-90deg); + transform: rotate(-90deg); + -webkit-transform-origin: center center; + transform-origin: center center; + opacity: 0; + } + 100% { + -webkit-transform: rotate(0); + transform: rotate(0); + -webkit-transform-origin: center center; + transform-origin: center center; + opacity: 1; + } +} + + +.rotate-in { + -webkit-animation-name: rotate-in; + animation-name: rotate-in; +} + + +@-webkit-keyframes rotate-out { + 0% { + -webkit-transform: rotate(0); + transform: rotate(0); + -webkit-transform-origin: center center; + transform-origin: center center; + opacity: 1; + } + 100% { + -webkit-transform: rotate(90deg); + transform: rotate(90deg); + -webkit-transform-origin: center center; + transform-origin: center center; + opacity: 0; + } +} + + +@keyframes rotate-out { + 0% { + -webkit-transform: rotate(0); + transform: rotate(0); + -webkit-transform-origin: center center; + transform-origin: center center; + opacity: 1; + } + 100% { + -webkit-transform: rotate(90deg); + transform: rotate(90deg); + -webkit-transform-origin: center center; + transform-origin: center center; + opacity: 0; + } +} + + +.rotate-out { + -webkit-animation-name: rotate-out; + animation-name: rotate-out; +} +@-webkit-keyframes rotate-in-sm { + 0% { + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); + -webkit-transform-origin: center center; + transform-origin: center center; + opacity: 0; + } + 100% { + -webkit-transform: rotate(0); + transform: rotate(0); + -webkit-transform-origin: center center; + transform-origin: center center; + opacity: 1; + } +} +@keyframes rotate-in-sm { + 0% { + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); + -webkit-transform-origin: center center; + transform-origin: center center; + opacity: 0; + } + 100% { + -webkit-transform: rotate(0); + transform: rotate(0); + -webkit-transform-origin: center center; + transform-origin: center center; + opacity: 1; + } +} + + +.rotate-in-sm { + -webkit-animation-name: rotate-in-sm; + animation-name: rotate-in-sm; +} + + +@-webkit-keyframes rotate-out-sm { + 0% { + -webkit-transform: rotate(0); + transform: rotate(0); + -webkit-transform-origin: center center; + transform-origin: center center; + opacity: 1; + } + 100% { + -webkit-transform: rotate(45deg); + transform: rotate(45deg); + -webkit-transform-origin: center center; + transform-origin: center center; + opacity: 0; + } +} + + +@keyframes rotate-out-sm { + 0% { + -webkit-transform: rotate(0); + transform: rotate(0); + -webkit-transform-origin: center center; + transform-origin: center center; + opacity: 1; + } + 100% { + -webkit-transform: rotate(45deg); + transform: rotate(45deg); + -webkit-transform-origin: center center; + transform-origin: center center; + opacity: 0; + } +} + + +.rotate-out-sm { + -webkit-animation-name: rotate-out-sm; + animation-name: rotate-out-sm; +} +@-webkit-keyframes rotate-in-lg { + 0% { + -webkit-transform: rotate(-180deg); + transform: rotate(-180deg); + -webkit-transform-origin: center center; + transform-origin: center center; + opacity: 0; + } + 100% { + -webkit-transform: rotate(0); + transform: rotate(0); + -webkit-transform-origin: center center; + transform-origin: center center; + opacity: 1; + } +} +@keyframes rotate-in-lg { + 0% { + -webkit-transform: rotate(-180deg); + transform: rotate(-180deg); + -webkit-transform-origin: center center; + transform-origin: center center; + opacity: 0; + } + 100% { + -webkit-transform: rotate(0); + transform: rotate(0); + -webkit-transform-origin: center center; + transform-origin: center center; + opacity: 1; + } +} + + +.rotate-in-lg { + -webkit-animation-name: rotate-in-lg; + animation-name: rotate-in-lg; +} + + +@-webkit-keyframes rotate-out-lg { + 0% { + -webkit-transform: rotate(0); + transform: rotate(0); + -webkit-transform-origin: center center; + transform-origin: center center; + opacity: 1; + } + 100% { + -webkit-transform: rotate(180deg); + transform: rotate(180deg); + -webkit-transform-origin: center center; + transform-origin: center center; + opacity: 0; + } +} + + +@keyframes rotate-out-lg { + 0% { + -webkit-transform: rotate(0); + transform: rotate(0); + -webkit-transform-origin: center center; + transform-origin: center center; + opacity: 1; + } + 100% { + -webkit-transform: rotate(180deg); + transform: rotate(180deg); + -webkit-transform-origin: center center; + transform-origin: center center; + opacity: 0; + } +} + + +.rotate-out-lg { + -webkit-animation-name: rotate-out-lg; + animation-name: rotate-out-lg; +} + +@-webkit-keyframes flip-in-x { + 0% { + -webkit-transform: perspective(550px) rotateX(90deg); + transform: perspective(550px) rotateX(90deg); + opacity: 0; + } + 100% { + -webkit-transform: perspective(550px) rotateX(0deg); + transform: perspective(550px) rotateX(0deg); + opacity: 1; + } +} + +@keyframes flip-in-x { + 0% { + -webkit-transform: perspective(550px) rotateX(90deg); + transform: perspective(550px) rotateX(90deg); + opacity: 0; + } + 100% { + -webkit-transform: perspective(550px) rotateX(0deg); + transform: perspective(550px) rotateX(0deg); + opacity: 1; + } +} + + +.flip-in-x { + -webkit-animation-name: flip-in-x; + animation-name: flip-in-x; + -webkit-backface-visibility: visible !important; + backface-visibility: visible !important; +} + + +@-webkit-keyframes flip-out-x { + 0% { + -webkit-transform: perspective(550px) rotateX(0deg); + transform: perspective(550px) rotateX(0deg); + opacity: 1; + } + 100% { + -webkit-transform: perspective(550px) rotateX(90deg); + transform: perspective(550px) rotateX(90deg); + opacity: 0; + } +} + + +@keyframes flip-out-x { + 0% { + -webkit-transform: perspective(550px) rotateX(0deg); + transform: perspective(550px) rotateX(0deg); + opacity: 1; + } + 100% { + -webkit-transform: perspective(550px) rotateX(90deg); + transform: perspective(550px) rotateX(90deg); + opacity: 0; + } +} + + +.flip-out-x { + -webkit-animation-name: flip-out-x; + animation-name: flip-out-x; + -webkit-backface-visibility: visible !important; + backface-visibility: visible !important; +} +@-webkit-keyframes flip-in-x-nr { + 0% { + -webkit-transform: perspective(100px) rotateX(90deg); + transform: perspective(100px) rotateX(90deg); + opacity: 0; + } + 100% { + -webkit-transform: perspective(100px) rotateX(0deg); + transform: perspective(100px) rotateX(0deg); + opacity: 1; + } +} +@keyframes flip-in-x-nr { + 0% { + -webkit-transform: perspective(100px) rotateX(90deg); + transform: perspective(100px) rotateX(90deg); + opacity: 0; + } + 100% { + -webkit-transform: perspective(100px) rotateX(0deg); + transform: perspective(100px) rotateX(0deg); + opacity: 1; + } +} + + +.flip-in-x-nr { + -webkit-animation-name: flip-in-x-nr; + animation-name: flip-in-x-nr; + -webkit-backface-visibility: visible !important; + backface-visibility: visible !important; +} + + +@-webkit-keyframes flip-out-x-nr { + 0% { + -webkit-transform: perspective(100px) rotateX(0deg); + transform: perspective(100px) rotateX(0deg); + opacity: 1; + } + 100% { + -webkit-transform: perspective(100px) rotateX(90deg); + transform: perspective(100px) rotateX(90deg); + opacity: 0; + } +} + + +@keyframes flip-out-x-nr { + 0% { + -webkit-transform: perspective(100px) rotateX(0deg); + transform: perspective(100px) rotateX(0deg); + opacity: 1; + } + 100% { + -webkit-transform: perspective(100px) rotateX(90deg); + transform: perspective(100px) rotateX(90deg); + opacity: 0; + } +} + + +.flip-out-x-nr { + -webkit-animation-name: flip-out-x-nr; + animation-name: flip-out-x-nr; + -webkit-backface-visibility: visible !important; + backface-visibility: visible !important; +} +@-webkit-keyframes flip-in-x-fr { + 0% { + -webkit-transform: perspective(1000px) rotateX(90deg); + transform: perspective(1000px) rotateX(90deg); + opacity: 0; + } + 100% { + -webkit-transform: perspective(1000px) rotateX(0deg); + transform: perspective(1000px) rotateX(0deg); + opacity: 1; + } +} +@keyframes flip-in-x-fr { + 0% { + -webkit-transform: perspective(1000px) rotateX(90deg); + transform: perspective(1000px) rotateX(90deg); + opacity: 0; + } + 100% { + -webkit-transform: perspective(1000px) rotateX(0deg); + transform: perspective(1000px) rotateX(0deg); + opacity: 1; + } +} + + +.flip-in-x-fr { + -webkit-animation-name: flip-in-x-fr; + animation-name: flip-in-x-fr; + -webkit-backface-visibility: visible !important; + backface-visibility: visible !important; +} + + +@-webkit-keyframes flip-out-x-fr { + 0% { + -webkit-transform: perspective(1000px) rotateX(0deg); + transform: perspective(1000px) rotateX(0deg); + opacity: 1; + } + 100% { + -webkit-transform: perspective(1000px) rotateX(90deg); + transform: perspective(1000px) rotateX(90deg); + opacity: 0; + } +} + + +@keyframes flip-out-x-fr { + 0% { + -webkit-transform: perspective(1000px) rotateX(0deg); + transform: perspective(1000px) rotateX(0deg); + opacity: 1; + } + 100% { + -webkit-transform: perspective(1000px) rotateX(90deg); + transform: perspective(1000px) rotateX(90deg); + opacity: 0; + } +} + + +.flip-out-x-fr { + -webkit-animation-name: flip-out-x-fr; + animation-name: flip-out-x-fr; + -webkit-backface-visibility: visible !important; + backface-visibility: visible !important; +} +@-webkit-keyframes flip-in-y { + 0% { + -webkit-transform: perspective(550px) rotateY(90deg); + transform: perspective(550px) rotateY(90deg); + opacity: 0; + } + 100% { + -webkit-transform: perspective(550px) rotateY(0deg); + transform: perspective(550px) rotateY(0deg); + opacity: 1; + } +} +@keyframes flip-in-y { + 0% { + -webkit-transform: perspective(550px) rotateY(90deg); + transform: perspective(550px) rotateY(90deg); + opacity: 0; + } + 100% { + -webkit-transform: perspective(550px) rotateY(0deg); + transform: perspective(550px) rotateY(0deg); + opacity: 1; + } +} + + +.flip-in-y { + -webkit-animation-name: flip-in-y; + animation-name: flip-in-y; + -webkit-backface-visibility: visible !important; + backface-visibility: visible !important; +} + + +@-webkit-keyframes flip-out-y { + 0% { + -webkit-transform: perspective(550px) rotateY(0deg); + transform: perspective(550px) rotateY(0deg); + opacity: 1; + } + 100% { + -webkit-transform: perspective(550px) rotateY(90deg); + transform: perspective(550px) rotateY(90deg); + opacity: 0; + } +} + + +@keyframes flip-out-y { + 0% { + -webkit-transform: perspective(550px) rotateY(0deg); + transform: perspective(550px) rotateY(0deg); + opacity: 1; + } + 100% { + -webkit-transform: perspective(550px) rotateY(90deg); + transform: perspective(550px) rotateY(90deg); + opacity: 0; + } +} + + +.flip-out-y { + -webkit-animation-name: flip-out-y; + animation-name: flip-out-y; + -webkit-backface-visibility: visible !important; + backface-visibility: visible !important; +} +@-webkit-keyframes flip-in-y-nr { + 0% { + -webkit-transform: perspective(100px) rotateY(90deg); + transform: perspective(100px) rotateY(90deg); + opacity: 0; + } + 100% { + -webkit-transform: perspective(100px) rotateY(0deg); + transform: perspective(100px) rotateY(0deg); + opacity: 1; + } +} +@keyframes flip-in-y-nr { + 0% { + -webkit-transform: perspective(100px) rotateY(90deg); + transform: perspective(100px) rotateY(90deg); + opacity: 0; + } + 100% { + -webkit-transform: perspective(100px) rotateY(0deg); + transform: perspective(100px) rotateY(0deg); + opacity: 1; + } +} + + +.flip-in-y-nr { + -webkit-animation-name: flip-in-y-nr; + animation-name: flip-in-y-nr; + -webkit-backface-visibility: visible !important; + backface-visibility: visible !important; +} + + +@-webkit-keyframes flip-out-y-nr { + 0% { + -webkit-transform: perspective(100px) rotateY(0deg); + transform: perspective(100px) rotateY(0deg); + opacity: 1; + } + 100% { + -webkit-transform: perspective(100px) rotateY(90deg); + transform: perspective(100px) rotateY(90deg); + opacity: 0; + } +} + + +@keyframes flip-out-y-nr { + 0% { + -webkit-transform: perspective(100px) rotateY(0deg); + transform: perspective(100px) rotateY(0deg); + opacity: 1; + } + 100% { + -webkit-transform: perspective(100px) rotateY(90deg); + transform: perspective(100px) rotateY(90deg); + opacity: 0; + } +} + + +.flip-out-y-nr { + -webkit-animation-name: flip-out-y-nr; + animation-name: flip-out-y-nr; + -webkit-backface-visibility: visible !important; + backface-visibility: visible !important; +} +@-webkit-keyframes flip-in-y-fr { + 0% { + -webkit-transform: perspective(1000px) rotateY(90deg); + transform: perspective(1000px) rotateY(90deg); + opacity: 0; + } + 100% { + -webkit-transform: perspective(1000px) rotateY(0deg); + transform: perspective(1000px) rotateY(0deg); + opacity: 1; + } +} +@keyframes flip-in-y-fr { + 0% { + -webkit-transform: perspective(1000px) rotateY(90deg); + transform: perspective(1000px) rotateY(90deg); + opacity: 0; + } + 100% { + -webkit-transform: perspective(1000px) rotateY(0deg); + transform: perspective(1000px) rotateY(0deg); + opacity: 1; + } +} + + +.flip-in-y-fr { + -webkit-animation-name: flip-in-y-fr; + animation-name: flip-in-y-fr; + -webkit-backface-visibility: visible !important; + backface-visibility: visible !important; +} + + +@-webkit-keyframes flip-out-y-fr { + 0% { + -webkit-transform: perspective(1000px) rotateY(0deg); + transform: perspective(1000px) rotateY(0deg); + opacity: 1; + } + 100% { + -webkit-transform: perspective(1000px) rotateY(90deg); + transform: perspective(1000px) rotateY(90deg); + opacity: 0; + } +} + + +@keyframes flip-out-y-fr { + 0% { + -webkit-transform: perspective(1000px) rotateY(0deg); + transform: perspective(1000px) rotateY(0deg); + opacity: 1; + } + 100% { + -webkit-transform: perspective(1000px) rotateY(90deg); + transform: perspective(1000px) rotateY(90deg); + opacity: 0; + } +} + + +.flip-out-y-fr { + -webkit-animation-name: flip-out-y-fr; + animation-name: flip-out-y-fr; + -webkit-backface-visibility: visible !important; + backface-visibility: visible !important; +} + +@-webkit-keyframes zoom-in { + 0% { + -webkit-transform: scale(.7); + transform: scale(.7); + opacity: 0; + } + 100% { + opacity: 1; + } +} + +@keyframes zoom-in { + 0% { + -webkit-transform: scale(.7); + transform: scale(.7); + opacity: 0; + } + 100% { + opacity: 1; + } +} + + +.zoom-in { + -webkit-animation-name: zoom-in; + animation-name: zoom-in; +} + + +@-webkit-keyframes zoom-out { + 0% { + -webkit-transform: scale(1); + transform: scale(1); + opacity: 1; + } + 50% { + -webkit-transform: scale(.7); + transform: scale(.7); + opacity: 0; + } + 100% { + opacity: 0; + } +} + + +@keyframes zoom-out { + 0% { + -webkit-transform: scale(1); + transform: scale(1); + opacity: 1; + } + 50% { + -webkit-transform: scale(.7); + transform: scale(.7); + opacity: 0; + } + 100% { + opacity: 0; + } +} + + +.zoom-out { + -webkit-animation-name: zoom-out; + animation-name: zoom-out; +} +@-webkit-keyframes zoom-in-sm { + 0% { + -webkit-transform: scale(.95); + transform: scale(.95); + opacity: 0; + } + 100% { + opacity: 1; + } +} +@keyframes zoom-in-sm { + 0% { + -webkit-transform: scale(.95); + transform: scale(.95); + opacity: 0; + } + 100% { + opacity: 1; + } +} + + +.zoom-in-sm { + -webkit-animation-name: zoom-in-sm; + animation-name: zoom-in-sm; +} + + +@-webkit-keyframes zoom-out-sm { + 0% { + -webkit-transform: scale(1); + transform: scale(1); + opacity: 1; + } + 50% { + -webkit-transform: scale(.95); + transform: scale(.95); + opacity: 0; + } + 100% { + opacity: 0; + } +} + + +@keyframes zoom-out-sm { + 0% { + -webkit-transform: scale(1); + transform: scale(1); + opacity: 1; + } + 50% { + -webkit-transform: scale(.95); + transform: scale(.95); + opacity: 0; + } + 100% { + opacity: 0; + } +} + + +.zoom-out-sm { + -webkit-animation-name: zoom-out-sm; + animation-name: zoom-out-sm; +} +@-webkit-keyframes zoom-in-lg { + 0% { + -webkit-transform: scale(.4); + transform: scale(.4); + opacity: 0; + } + 100% { + opacity: 1; + } +} +@keyframes zoom-in-lg { + 0% { + -webkit-transform: scale(.4); + transform: scale(.4); + opacity: 0; + } + 100% { + opacity: 1; + } +} + + +.zoom-in-lg { + -webkit-animation-name: zoom-in-lg; + animation-name: zoom-in-lg; +} + + +@-webkit-keyframes zoom-out-lg { + 0% { + -webkit-transform: scale(1); + transform: scale(1); + opacity: 1; + } + 50% { + -webkit-transform: scale(.4); + transform: scale(.4); + opacity: 0; + } + 100% { + opacity: 0; + } +} + + +@keyframes zoom-out-lg { + 0% { + -webkit-transform: scale(1); + transform: scale(1); + opacity: 1; + } + 50% { + -webkit-transform: scale(.4); + transform: scale(.4); + opacity: 0; + } + 100% { + opacity: 0; + } +} + + +.zoom-out-lg { + -webkit-animation-name: zoom-out-lg; + animation-name: zoom-out-lg; +} + +@-webkit-keyframes overlay-slide-in-top { + 0% { + height: 100%; + } + 100% { + height: 0; + } +} + +@keyframes overlay-slide-in-top { + 0% { + height: 100%; + } + 100% { + height: 0; + } +} + + +.overlay-slide-in-top { + top: 0; + height: 0; + -webkit-animation-name: overlay-slide-in-top; + animation-name: overlay-slide-in-top; +} + + +@-webkit-keyframes overlay-slide-out-top { + 0% { + height: 0; + } + 100% { + height: 100%; + } +} + + +@keyframes overlay-slide-out-top { + 0% { + height: 0; + } + 100% { + height: 100%; + } +} + + +.overlay-slide-out-top { + top: 0; + height: 100%; + -webkit-animation-name: overlay-slide-out-top; + animation-name: overlay-slide-out-top; +} +@-webkit-keyframes overlay-slide-in-bottom { + 0% { + height: 100%; + } + 100% { + height: 0; + } +} +@keyframes overlay-slide-in-bottom { + 0% { + height: 100%; + } + 100% { + height: 0; + } +} + + +.overlay-slide-in-bottom { + bottom: 0; + height: 0; + -webkit-animation-name: overlay-slide-in-bottom; + animation-name: overlay-slide-in-bottom; +} + + +@-webkit-keyframes overlay-slide-out-bottom { + 0% { + height: 0; + } + 100% { + height: 100%; + } +} + + +@keyframes overlay-slide-out-bottom { + 0% { + height: 0; + } + 100% { + height: 100%; + } +} + + +.overlay-slide-out-bottom { + bottom: 0; + height: 100%; + -webkit-animation-name: overlay-slide-out-bottom; + animation-name: overlay-slide-out-bottom; +} +@-webkit-keyframes overlay-slide-in-left { + 0% { + width: 100%; + } + 100% { + width: 0; + } +} +@keyframes overlay-slide-in-left { + 0% { + width: 100%; + } + 100% { + width: 0; + } +} + + +.overlay-slide-in-left { + width: 0; + -webkit-animation-name: overlay-slide-in-left; + animation-name: overlay-slide-in-left; +} + + +@-webkit-keyframes overlay-slide-out-left { + 0% { + width: 0; + } + 100% { + width: 100%; + } +} + + +@keyframes overlay-slide-out-left { + 0% { + width: 0; + } + 100% { + width: 100%; + } +} + + +.overlay-slide-out-left { + left: 0; + width: 100%; + -webkit-animation-name: overlay-slide-out-left; + animation-name: overlay-slide-out-left; +} +@-webkit-keyframes overlay-slide-in-right { + 0% { + width: 100%; + } + 100% { + width: 0; + } +} +@keyframes overlay-slide-in-right { + 0% { + width: 100%; + } + 100% { + width: 0; + } +} + + +.overlay-slide-in-right { + right: 0; + width: 0; + -webkit-animation-name: overlay-slide-in-right; + animation-name: overlay-slide-in-right; +} + + +@-webkit-keyframes overlay-slide-out-right { + 0% { + width: 0; + } + 100% { + width: 100%; + } +} + + +@keyframes overlay-slide-out-right { + 0% { + width: 0; + } + 100% { + width: 100%; + } +} + + +.overlay-slide-out-right { + right: 0; + width: 100%; + -webkit-animation-name: overlay-slide-out-right; + animation-name: overlay-slide-out-right; +} diff --git a/public/vendor/animsition/css/animsition.min.css b/public/vendor/animsition/css/animsition.min.css new file mode 100755 index 000000000..b321c663e --- /dev/null +++ b/public/vendor/animsition/css/animsition.min.css @@ -0,0 +1,7 @@ +/*! + * animsition v4.0.2 + * A simple and easy jQuery plugin for CSS animated page transitions. + * http://blivesta.github.io/animsition + * License : MIT + * Author : blivesta (http://blivesta.com/) + */.animsition,.animsition-overlay{position:relative;opacity:0;-webkit-animation-fill-mode:both;animation-fill-mode:both}.animsition-overlay-slide{position:fixed;z-index:1;width:100%;height:100%;background-color:#ddd}.animsition-loading,.animsition-loading:after{width:32px;height:32px;position:fixed;top:50%;left:50%;margin-top:-16px;margin-left:-16px;border-radius:50%;z-index:2}.animsition-loading{background-color:transparent;border-top:5px solid rgba(0,0,0,.2);border-right:5px solid rgba(0,0,0,.2);border-bottom:5px solid rgba(0,0,0,.2);border-left:5px solid #eee;-webkit-transform:translateZ(0);transform:translateZ(0);-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-duration:.8s;animation-duration:.8s;-webkit-animation-name:animsition-loading;animation-name:animsition-loading}@-webkit-keyframes animsition-loading{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes animsition-loading{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes fade-in{0%{opacity:0}to{opacity:1}}@keyframes fade-in{0%{opacity:0}to{opacity:1}}.fade-in{-webkit-animation-name:fade-in;animation-name:fade-in}@-webkit-keyframes fade-out{0%{opacity:1}to{opacity:0}}@keyframes fade-out{0%{opacity:1}to{opacity:0}}.fade-out{-webkit-animation-name:fade-out;animation-name:fade-out}@-webkit-keyframes fade-in-up{0%{-webkit-transform:translateY(500px);transform:translateY(500px);opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@keyframes fade-in-up{0%{-webkit-transform:translateY(500px);transform:translateY(500px);opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}.fade-in-up{-webkit-animation-name:fade-in-up;animation-name:fade-in-up}@-webkit-keyframes fade-out-up{0%{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}to{-webkit-transform:translateY(-500px);transform:translateY(-500px);opacity:0}}@keyframes fade-out-up{0%{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}to{-webkit-transform:translateY(-500px);transform:translateY(-500px);opacity:0}}.fade-out-up{-webkit-animation-name:fade-out-up;animation-name:fade-out-up}@-webkit-keyframes fade-in-up-sm{0%{-webkit-transform:translateY(100px);transform:translateY(100px);opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@keyframes fade-in-up-sm{0%{-webkit-transform:translateY(100px);transform:translateY(100px);opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}.fade-in-up-sm{-webkit-animation-name:fade-in-up-sm;animation-name:fade-in-up-sm}@-webkit-keyframes fade-out-up-sm{0%{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}to{-webkit-transform:translateY(-100px);transform:translateY(-100px);opacity:0}}@keyframes fade-out-up-sm{0%{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}to{-webkit-transform:translateY(-100px);transform:translateY(-100px);opacity:0}}.fade-out-up-sm{-webkit-animation-name:fade-out-up-sm;animation-name:fade-out-up-sm}@-webkit-keyframes fade-in-up-lg{0%{-webkit-transform:translateY(1000px);transform:translateY(1000px);opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@keyframes fade-in-up-lg{0%{-webkit-transform:translateY(1000px);transform:translateY(1000px);opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}.fade-in-up-lg{-webkit-animation-name:fade-in-up-lg;animation-name:fade-in-up-lg}@-webkit-keyframes fade-out-up-lg{0%{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}to{-webkit-transform:translateY(-1000px);transform:translateY(-1000px);opacity:0}}@keyframes fade-out-up-lg{0%{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}to{-webkit-transform:translateY(-1000px);transform:translateY(-1000px);opacity:0}}.fade-out-up-lg{-webkit-animation-name:fade-out-up-lg;animation-name:fade-out-up-lg}@-webkit-keyframes fade-in-down{0%{-webkit-transform:translateY(-500px);transform:translateY(-500px);opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@keyframes fade-in-down{0%{-webkit-transform:translateY(-500px);transform:translateY(-500px);opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}.fade-in-down{-webkit-animation-name:fade-in-down;animation-name:fade-in-down}@-webkit-keyframes fade-out-down{0%{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}to{-webkit-transform:translateY(500px);transform:translateY(500px);opacity:0}}@keyframes fade-out-down{0%{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}to{-webkit-transform:translateY(500px);transform:translateY(500px);opacity:0}}.fade-out-down{-webkit-animation-name:fade-out-down;animation-name:fade-out-down}@-webkit-keyframes fade-in-down-sm{0%{-webkit-transform:translateY(-100px);transform:translateY(-100px);opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@keyframes fade-in-down-sm{0%{-webkit-transform:translateY(-100px);transform:translateY(-100px);opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}.fade-in-down-sm{-webkit-animation-name:fade-in-down-sm;animation-name:fade-in-down-sm}@-webkit-keyframes fade-out-down-sm{0%{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}to{-webkit-transform:translateY(100px);transform:translateY(100px);opacity:0}}@keyframes fade-out-down-sm{0%{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}to{-webkit-transform:translateY(100px);transform:translateY(100px);opacity:0}}.fade-out-down-sm{-webkit-animation-name:fade-out-down-sm;animation-name:fade-out-down-sm}.fade-in-down-lg{-webkit-animation-name:fade-in-down;animation-name:fade-in-down}@-webkit-keyframes fade-out-down-lg{0%{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}to{-webkit-transform:translateY(1000px);transform:translateY(1000px);opacity:0}}@keyframes fade-out-down-lg{0%{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}to{-webkit-transform:translateY(1000px);transform:translateY(1000px);opacity:0}}.fade-out-down-lg{-webkit-animation-name:fade-out-down-lg;animation-name:fade-out-down-lg}@-webkit-keyframes fade-in-left{0%{-webkit-transform:translateX(-500px);transform:translateX(-500px);opacity:0}to{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}}@keyframes fade-in-left{0%{-webkit-transform:translateX(-500px);transform:translateX(-500px);opacity:0}to{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}}.fade-in-left{-webkit-animation-name:fade-in-left;animation-name:fade-in-left}@-webkit-keyframes fade-out-left{0%{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}to{-webkit-transform:translateX(-500px);transform:translateX(-500px);opacity:0}}@keyframes fade-out-left{0%{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}to{-webkit-transform:translateX(-500px);transform:translateX(-500px);opacity:0}}.fade-out-left{-webkit-animation-name:fade-out-left;animation-name:fade-out-left}@-webkit-keyframes fade-in-left-sm{0%{-webkit-transform:translateX(-100px);transform:translateX(-100px);opacity:0}to{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}}@keyframes fade-in-left-sm{0%{-webkit-transform:translateX(-100px);transform:translateX(-100px);opacity:0}to{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}}.fade-in-left-sm{-webkit-animation-name:fade-in-left-sm;animation-name:fade-in-left-sm}@-webkit-keyframes fade-out-left-sm{0%{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}to{-webkit-transform:translateX(-100px);transform:translateX(-100px);opacity:0}}@keyframes fade-out-left-sm{0%{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}to{-webkit-transform:translateX(-100px);transform:translateX(-100px);opacity:0}}.fade-out-left-sm{-webkit-animation-name:fade-out-left-sm;animation-name:fade-out-left-sm}@-webkit-keyframes fade-in-left-lg{0%{-webkit-transform:translateX(-1500px);transform:translateX(-1500px);opacity:0}to{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}}@keyframes fade-in-left-lg{0%{-webkit-transform:translateX(-1500px);transform:translateX(-1500px);opacity:0}to{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}}.fade-in-left-lg{-webkit-animation-name:fade-in-left-lg;animation-name:fade-in-left-lg}@-webkit-keyframes fade-out-left-lg{0%{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}to{-webkit-transform:translateX(-1500px);transform:translateX(-1500px);opacity:0}}@keyframes fade-out-left-lg{0%{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}to{-webkit-transform:translateX(-1500px);transform:translateX(-1500px);opacity:0}}.fade-out-left-lg{-webkit-animation-name:fade-out-left-lg;animation-name:fade-out-left-lg}@-webkit-keyframes fade-in-right{0%{-webkit-transform:translateX(500px);transform:translateX(500px);opacity:0}to{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}}@keyframes fade-in-right{0%{-webkit-transform:translateX(500px);transform:translateX(500px);opacity:0}to{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}}.fade-in-right{-webkit-animation-name:fade-in-right;animation-name:fade-in-right}@-webkit-keyframes fade-out-right{0%{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}to{-webkit-transform:translateX(500px);transform:translateX(500px);opacity:0}}@keyframes fade-out-right{0%{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}to{-webkit-transform:translateX(500px);transform:translateX(500px);opacity:0}}.fade-out-right{-webkit-animation-name:fade-out-right;animation-name:fade-out-right}@-webkit-keyframes fade-in-right-sm{0%{-webkit-transform:translateX(100px);transform:translateX(100px);opacity:0}to{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}}@keyframes fade-in-right-sm{0%{-webkit-transform:translateX(100px);transform:translateX(100px);opacity:0}to{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}}.fade-in-right-sm{-webkit-animation-name:fade-in-right-sm;animation-name:fade-in-right-sm}@-webkit-keyframes fade-out-right-sm{0%{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}to{-webkit-transform:translateX(100px);transform:translateX(100px);opacity:0}}@keyframes fade-out-right-sm{0%{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}to{-webkit-transform:translateX(100px);transform:translateX(100px);opacity:0}}.fade-out-right-sm{-webkit-animation-name:fade-out-right-sm;animation-name:fade-out-right-sm}@-webkit-keyframes fade-in-right-lg{0%{-webkit-transform:translateX(1500px);transform:translateX(1500px);opacity:0}to{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}}@keyframes fade-in-right-lg{0%{-webkit-transform:translateX(1500px);transform:translateX(1500px);opacity:0}to{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}}.fade-in-right-lg{-webkit-animation-name:fade-in-right-lg;animation-name:fade-in-right-lg}@-webkit-keyframes fade-out-right-lg{0%{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}to{-webkit-transform:translateX(1500px);transform:translateX(1500px);opacity:0}}@keyframes fade-out-right-lg{0%{-webkit-transform:translateX(0);transform:translateX(0);opacity:1}to{-webkit-transform:translateX(1500px);transform:translateX(1500px);opacity:0}}.fade-out-right-lg{-webkit-animation-name:fade-out-right-lg;animation-name:fade-out-right-lg}@-webkit-keyframes rotate-in{0%{-webkit-transform:rotate(-90deg);transform:rotate(-90deg);transform-origin:center center;opacity:0}0%,to{-webkit-transform-origin:center center}to{-webkit-transform:rotate(0);transform:rotate(0);transform-origin:center center;opacity:1}}@keyframes rotate-in{0%{-webkit-transform:rotate(-90deg);transform:rotate(-90deg);transform-origin:center center;opacity:0}0%,to{-webkit-transform-origin:center center}to{-webkit-transform:rotate(0);transform:rotate(0);transform-origin:center center;opacity:1}}.rotate-in{-webkit-animation-name:rotate-in;animation-name:rotate-in}@-webkit-keyframes rotate-out{0%{-webkit-transform:rotate(0);transform:rotate(0);transform-origin:center center;opacity:1}0%,to{-webkit-transform-origin:center center}to{-webkit-transform:rotate(90deg);transform:rotate(90deg);transform-origin:center center;opacity:0}}@keyframes rotate-out{0%{-webkit-transform:rotate(0);transform:rotate(0);transform-origin:center center;opacity:1}0%,to{-webkit-transform-origin:center center}to{-webkit-transform:rotate(90deg);transform:rotate(90deg);transform-origin:center center;opacity:0}}.rotate-out{-webkit-animation-name:rotate-out;animation-name:rotate-out}@-webkit-keyframes rotate-in-sm{0%{-webkit-transform:rotate(-45deg);transform:rotate(-45deg);transform-origin:center center;opacity:0}0%,to{-webkit-transform-origin:center center}to{-webkit-transform:rotate(0);transform:rotate(0);transform-origin:center center;opacity:1}}@keyframes rotate-in-sm{0%{-webkit-transform:rotate(-45deg);transform:rotate(-45deg);transform-origin:center center;opacity:0}0%,to{-webkit-transform-origin:center center}to{-webkit-transform:rotate(0);transform:rotate(0);transform-origin:center center;opacity:1}}.rotate-in-sm{-webkit-animation-name:rotate-in-sm;animation-name:rotate-in-sm}@-webkit-keyframes rotate-out-sm{0%{-webkit-transform:rotate(0);transform:rotate(0);transform-origin:center center;opacity:1}0%,to{-webkit-transform-origin:center center}to{-webkit-transform:rotate(45deg);transform:rotate(45deg);transform-origin:center center;opacity:0}}@keyframes rotate-out-sm{0%{-webkit-transform:rotate(0);transform:rotate(0);transform-origin:center center;opacity:1}0%,to{-webkit-transform-origin:center center}to{-webkit-transform:rotate(45deg);transform:rotate(45deg);transform-origin:center center;opacity:0}}.rotate-out-sm{-webkit-animation-name:rotate-out-sm;animation-name:rotate-out-sm}@-webkit-keyframes rotate-in-lg{0%{-webkit-transform:rotate(-180deg);transform:rotate(-180deg);transform-origin:center center;opacity:0}0%,to{-webkit-transform-origin:center center}to{-webkit-transform:rotate(0);transform:rotate(0);transform-origin:center center;opacity:1}}@keyframes rotate-in-lg{0%{-webkit-transform:rotate(-180deg);transform:rotate(-180deg);transform-origin:center center;opacity:0}0%,to{-webkit-transform-origin:center center}to{-webkit-transform:rotate(0);transform:rotate(0);transform-origin:center center;opacity:1}}.rotate-in-lg{-webkit-animation-name:rotate-in-lg;animation-name:rotate-in-lg}@-webkit-keyframes rotate-out-lg{0%{-webkit-transform:rotate(0);transform:rotate(0);transform-origin:center center;opacity:1}0%,to{-webkit-transform-origin:center center}to{-webkit-transform:rotate(180deg);transform:rotate(180deg);transform-origin:center center;opacity:0}}@keyframes rotate-out-lg{0%{-webkit-transform:rotate(0);transform:rotate(0);transform-origin:center center;opacity:1}0%,to{-webkit-transform-origin:center center}to{-webkit-transform:rotate(180deg);transform:rotate(180deg);transform-origin:center center;opacity:0}}.rotate-out-lg{-webkit-animation-name:rotate-out-lg;animation-name:rotate-out-lg}@-webkit-keyframes flip-in-x{0%{-webkit-transform:perspective(550px) rotateX(90deg);transform:perspective(550px) rotateX(90deg);opacity:0}to{-webkit-transform:perspective(550px) rotateX(0deg);transform:perspective(550px) rotateX(0deg);opacity:1}}@keyframes flip-in-x{0%{-webkit-transform:perspective(550px) rotateX(90deg);transform:perspective(550px) rotateX(90deg);opacity:0}to{-webkit-transform:perspective(550px) rotateX(0deg);transform:perspective(550px) rotateX(0deg);opacity:1}}.flip-in-x{-webkit-animation-name:flip-in-x;animation-name:flip-in-x;-webkit-backface-visibility:visible!important;backface-visibility:visible!important}@-webkit-keyframes flip-out-x{0%{-webkit-transform:perspective(550px) rotateX(0deg);transform:perspective(550px) rotateX(0deg);opacity:1}to{-webkit-transform:perspective(550px) rotateX(90deg);transform:perspective(550px) rotateX(90deg);opacity:0}}@keyframes flip-out-x{0%{-webkit-transform:perspective(550px) rotateX(0deg);transform:perspective(550px) rotateX(0deg);opacity:1}to{-webkit-transform:perspective(550px) rotateX(90deg);transform:perspective(550px) rotateX(90deg);opacity:0}}.flip-out-x{-webkit-animation-name:flip-out-x;animation-name:flip-out-x;-webkit-backface-visibility:visible!important;backface-visibility:visible!important}@-webkit-keyframes flip-in-x-nr{0%{-webkit-transform:perspective(100px) rotateX(90deg);transform:perspective(100px) rotateX(90deg);opacity:0}to{-webkit-transform:perspective(100px) rotateX(0deg);transform:perspective(100px) rotateX(0deg);opacity:1}}@keyframes flip-in-x-nr{0%{-webkit-transform:perspective(100px) rotateX(90deg);transform:perspective(100px) rotateX(90deg);opacity:0}to{-webkit-transform:perspective(100px) rotateX(0deg);transform:perspective(100px) rotateX(0deg);opacity:1}}.flip-in-x-nr{-webkit-animation-name:flip-in-x-nr;animation-name:flip-in-x-nr;-webkit-backface-visibility:visible!important;backface-visibility:visible!important}@-webkit-keyframes flip-out-x-nr{0%{-webkit-transform:perspective(100px) rotateX(0deg);transform:perspective(100px) rotateX(0deg);opacity:1}to{-webkit-transform:perspective(100px) rotateX(90deg);transform:perspective(100px) rotateX(90deg);opacity:0}}@keyframes flip-out-x-nr{0%{-webkit-transform:perspective(100px) rotateX(0deg);transform:perspective(100px) rotateX(0deg);opacity:1}to{-webkit-transform:perspective(100px) rotateX(90deg);transform:perspective(100px) rotateX(90deg);opacity:0}}.flip-out-x-nr{-webkit-animation-name:flip-out-x-nr;animation-name:flip-out-x-nr;-webkit-backface-visibility:visible!important;backface-visibility:visible!important}@-webkit-keyframes flip-in-x-fr{0%{-webkit-transform:perspective(1000px) rotateX(90deg);transform:perspective(1000px) rotateX(90deg);opacity:0}to{-webkit-transform:perspective(1000px) rotateX(0deg);transform:perspective(1000px) rotateX(0deg);opacity:1}}@keyframes flip-in-x-fr{0%{-webkit-transform:perspective(1000px) rotateX(90deg);transform:perspective(1000px) rotateX(90deg);opacity:0}to{-webkit-transform:perspective(1000px) rotateX(0deg);transform:perspective(1000px) rotateX(0deg);opacity:1}}.flip-in-x-fr{-webkit-animation-name:flip-in-x-fr;animation-name:flip-in-x-fr;-webkit-backface-visibility:visible!important;backface-visibility:visible!important}@-webkit-keyframes flip-out-x-fr{0%{-webkit-transform:perspective(1000px) rotateX(0deg);transform:perspective(1000px) rotateX(0deg);opacity:1}to{-webkit-transform:perspective(1000px) rotateX(90deg);transform:perspective(1000px) rotateX(90deg);opacity:0}}@keyframes flip-out-x-fr{0%{-webkit-transform:perspective(1000px) rotateX(0deg);transform:perspective(1000px) rotateX(0deg);opacity:1}to{-webkit-transform:perspective(1000px) rotateX(90deg);transform:perspective(1000px) rotateX(90deg);opacity:0}}.flip-out-x-fr{-webkit-animation-name:flip-out-x-fr;animation-name:flip-out-x-fr;-webkit-backface-visibility:visible!important;backface-visibility:visible!important}@-webkit-keyframes flip-in-y{0%{-webkit-transform:perspective(550px) rotateY(90deg);transform:perspective(550px) rotateY(90deg);opacity:0}to{-webkit-transform:perspective(550px) rotateY(0deg);transform:perspective(550px) rotateY(0deg);opacity:1}}@keyframes flip-in-y{0%{-webkit-transform:perspective(550px) rotateY(90deg);transform:perspective(550px) rotateY(90deg);opacity:0}to{-webkit-transform:perspective(550px) rotateY(0deg);transform:perspective(550px) rotateY(0deg);opacity:1}}.flip-in-y{-webkit-animation-name:flip-in-y;animation-name:flip-in-y;-webkit-backface-visibility:visible!important;backface-visibility:visible!important}@-webkit-keyframes flip-out-y{0%{-webkit-transform:perspective(550px) rotateY(0deg);transform:perspective(550px) rotateY(0deg);opacity:1}to{-webkit-transform:perspective(550px) rotateY(90deg);transform:perspective(550px) rotateY(90deg);opacity:0}}@keyframes flip-out-y{0%{-webkit-transform:perspective(550px) rotateY(0deg);transform:perspective(550px) rotateY(0deg);opacity:1}to{-webkit-transform:perspective(550px) rotateY(90deg);transform:perspective(550px) rotateY(90deg);opacity:0}}.flip-out-y{-webkit-animation-name:flip-out-y;animation-name:flip-out-y;-webkit-backface-visibility:visible!important;backface-visibility:visible!important}@-webkit-keyframes flip-in-y-nr{0%{-webkit-transform:perspective(100px) rotateY(90deg);transform:perspective(100px) rotateY(90deg);opacity:0}to{-webkit-transform:perspective(100px) rotateY(0deg);transform:perspective(100px) rotateY(0deg);opacity:1}}@keyframes flip-in-y-nr{0%{-webkit-transform:perspective(100px) rotateY(90deg);transform:perspective(100px) rotateY(90deg);opacity:0}to{-webkit-transform:perspective(100px) rotateY(0deg);transform:perspective(100px) rotateY(0deg);opacity:1}}.flip-in-y-nr{-webkit-animation-name:flip-in-y-nr;animation-name:flip-in-y-nr;-webkit-backface-visibility:visible!important;backface-visibility:visible!important}@-webkit-keyframes flip-out-y-nr{0%{-webkit-transform:perspective(100px) rotateY(0deg);transform:perspective(100px) rotateY(0deg);opacity:1}to{-webkit-transform:perspective(100px) rotateY(90deg);transform:perspective(100px) rotateY(90deg);opacity:0}}@keyframes flip-out-y-nr{0%{-webkit-transform:perspective(100px) rotateY(0deg);transform:perspective(100px) rotateY(0deg);opacity:1}to{-webkit-transform:perspective(100px) rotateY(90deg);transform:perspective(100px) rotateY(90deg);opacity:0}}.flip-out-y-nr{-webkit-animation-name:flip-out-y-nr;animation-name:flip-out-y-nr;-webkit-backface-visibility:visible!important;backface-visibility:visible!important}@-webkit-keyframes flip-in-y-fr{0%{-webkit-transform:perspective(1000px) rotateY(90deg);transform:perspective(1000px) rotateY(90deg);opacity:0}to{-webkit-transform:perspective(1000px) rotateY(0deg);transform:perspective(1000px) rotateY(0deg);opacity:1}}@keyframes flip-in-y-fr{0%{-webkit-transform:perspective(1000px) rotateY(90deg);transform:perspective(1000px) rotateY(90deg);opacity:0}to{-webkit-transform:perspective(1000px) rotateY(0deg);transform:perspective(1000px) rotateY(0deg);opacity:1}}.flip-in-y-fr{-webkit-animation-name:flip-in-y-fr;animation-name:flip-in-y-fr;-webkit-backface-visibility:visible!important;backface-visibility:visible!important}@-webkit-keyframes flip-out-y-fr{0%{-webkit-transform:perspective(1000px) rotateY(0deg);transform:perspective(1000px) rotateY(0deg);opacity:1}to{-webkit-transform:perspective(1000px) rotateY(90deg);transform:perspective(1000px) rotateY(90deg);opacity:0}}@keyframes flip-out-y-fr{0%{-webkit-transform:perspective(1000px) rotateY(0deg);transform:perspective(1000px) rotateY(0deg);opacity:1}to{-webkit-transform:perspective(1000px) rotateY(90deg);transform:perspective(1000px) rotateY(90deg);opacity:0}}.flip-out-y-fr{-webkit-animation-name:flip-out-y-fr;animation-name:flip-out-y-fr;-webkit-backface-visibility:visible!important;backface-visibility:visible!important}@-webkit-keyframes zoom-in{0%{-webkit-transform:scale(.7);transform:scale(.7);opacity:0}to{opacity:1}}@keyframes zoom-in{0%{-webkit-transform:scale(.7);transform:scale(.7);opacity:0}to{opacity:1}}.zoom-in{-webkit-animation-name:zoom-in;animation-name:zoom-in}@-webkit-keyframes zoom-out{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}50%{-webkit-transform:scale(.7);transform:scale(.7)}50%,to{opacity:0}}@keyframes zoom-out{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}50%{-webkit-transform:scale(.7);transform:scale(.7)}50%,to{opacity:0}}.zoom-out{-webkit-animation-name:zoom-out;animation-name:zoom-out}@-webkit-keyframes zoom-in-sm{0%{-webkit-transform:scale(.95);transform:scale(.95);opacity:0}to{opacity:1}}@keyframes zoom-in-sm{0%{-webkit-transform:scale(.95);transform:scale(.95);opacity:0}to{opacity:1}}.zoom-in-sm{-webkit-animation-name:zoom-in-sm;animation-name:zoom-in-sm}@-webkit-keyframes zoom-out-sm{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}50%{-webkit-transform:scale(.95);transform:scale(.95)}50%,to{opacity:0}}@keyframes zoom-out-sm{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}50%{-webkit-transform:scale(.95);transform:scale(.95)}50%,to{opacity:0}}.zoom-out-sm{-webkit-animation-name:zoom-out-sm;animation-name:zoom-out-sm}@-webkit-keyframes zoom-in-lg{0%{-webkit-transform:scale(.4);transform:scale(.4);opacity:0}to{opacity:1}}@keyframes zoom-in-lg{0%{-webkit-transform:scale(.4);transform:scale(.4);opacity:0}to{opacity:1}}.zoom-in-lg{-webkit-animation-name:zoom-in-lg;animation-name:zoom-in-lg}@-webkit-keyframes zoom-out-lg{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}50%{-webkit-transform:scale(.4);transform:scale(.4)}50%,to{opacity:0}}@keyframes zoom-out-lg{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}50%{-webkit-transform:scale(.4);transform:scale(.4)}50%,to{opacity:0}}.zoom-out-lg{-webkit-animation-name:zoom-out-lg;animation-name:zoom-out-lg}@-webkit-keyframes overlay-slide-in-top{0%{height:100%}to{height:0}}@keyframes overlay-slide-in-top{0%{height:100%}to{height:0}}.overlay-slide-in-top{top:0;height:0;-webkit-animation-name:overlay-slide-in-top;animation-name:overlay-slide-in-top}@-webkit-keyframes overlay-slide-out-top{0%{height:0}to{height:100%}}@keyframes overlay-slide-out-top{0%{height:0}to{height:100%}}.overlay-slide-out-top{top:0;height:100%;-webkit-animation-name:overlay-slide-out-top;animation-name:overlay-slide-out-top}@-webkit-keyframes overlay-slide-in-bottom{0%{height:100%}to{height:0}}@keyframes overlay-slide-in-bottom{0%{height:100%}to{height:0}}.overlay-slide-in-bottom{bottom:0;height:0;-webkit-animation-name:overlay-slide-in-bottom;animation-name:overlay-slide-in-bottom}@-webkit-keyframes overlay-slide-out-bottom{0%{height:0}to{height:100%}}@keyframes overlay-slide-out-bottom{0%{height:0}to{height:100%}}.overlay-slide-out-bottom{bottom:0;height:100%;-webkit-animation-name:overlay-slide-out-bottom;animation-name:overlay-slide-out-bottom}@-webkit-keyframes overlay-slide-in-left{0%{width:100%}to{width:0}}@keyframes overlay-slide-in-left{0%{width:100%}to{width:0}}.overlay-slide-in-left{width:0;-webkit-animation-name:overlay-slide-in-left;animation-name:overlay-slide-in-left}@-webkit-keyframes overlay-slide-out-left{0%{width:0}to{width:100%}}@keyframes overlay-slide-out-left{0%{width:0}to{width:100%}}.overlay-slide-out-left{left:0;width:100%;-webkit-animation-name:overlay-slide-out-left;animation-name:overlay-slide-out-left}@-webkit-keyframes overlay-slide-in-right{0%{width:100%}to{width:0}}@keyframes overlay-slide-in-right{0%{width:100%}to{width:0}}.overlay-slide-in-right{right:0;width:0;-webkit-animation-name:overlay-slide-in-right;animation-name:overlay-slide-in-right}@-webkit-keyframes overlay-slide-out-right{0%{width:0}to{width:100%}}@keyframes overlay-slide-out-right{0%{width:0}to{width:100%}}.overlay-slide-out-right{right:0;width:100%;-webkit-animation-name:overlay-slide-out-right;animation-name:overlay-slide-out-right} \ No newline at end of file diff --git a/public/vendor/animsition/js/animsition.js b/public/vendor/animsition/js/animsition.js new file mode 100755 index 000000000..a3134df85 --- /dev/null +++ b/public/vendor/animsition/js/animsition.js @@ -0,0 +1,361 @@ +/*! + * animsition v4.0.2 + * A simple and easy jQuery plugin for CSS animated page transitions. + * http://blivesta.github.io/animsition + * License : MIT + * Author : blivesta (http://blivesta.com/) + */ +;(function (factory) { + 'use strict'; + if (typeof define === 'function' && define.amd) { + define(['jquery'], factory); + } else if (typeof exports === 'object') { + module.exports = factory(require('jquery')); + } else { + factory(jQuery); + } +}(function ($) { + 'use strict'; + var namespace = 'animsition'; + var __ = { + init: function(options){ + options = $.extend({ + inClass : 'fade-in', + outClass : 'fade-out', + inDuration : 1500, + outDuration : 800, + linkElement : '.animsition-link', + // e.g. linkElement : 'a:not([target="_blank"]):not([href^="#"])' + loading : true, + loadingParentElement : 'body', //animsition wrapper element + loadingClass : 'animsition-loading', + loadingInner : '', // e.g '' + timeout : false, + timeoutCountdown : 5000, + onLoadEvent : true, + browser : [ 'animation-duration', '-webkit-animation-duration'], + // "browser" option allows you to disable the "animsition" in case the css property in the array is not supported by your browser. + // The default setting is to disable the "animsition" in a browser that does not support "animation-duration". + overlay : false, + overlayClass : 'animsition-overlay-slide', + overlayParentElement : 'body', + transition : function(url){ window.location.href = url; } + }, options); + + __.settings = { + timer: false, + data: { + inClass: 'animsition-in-class', + inDuration: 'animsition-in-duration', + outClass: 'animsition-out-class', + outDuration: 'animsition-out-duration', + overlay: 'animsition-overlay' + }, + events: { + inStart: 'animsition.inStart', + inEnd: 'animsition.inEnd', + outStart: 'animsition.outStart', + outEnd: 'animsition.outEnd' + } + }; + + // Remove the "Animsition" in a browser + // that does not support the "animaition-duration". + var support = __.supportCheck.call(this, options); + + if(!support && options.browser.length > 0){ + if(!support || !this.length){ + // If do not have a console object to object window + if (!('console' in window)) { + window.console = {}; + window.console.log = function(str){ return str; }; + } + if(!this.length) console.log('Animsition: Element does not exist on page.'); + if(!support) console.log('Animsition: Does not support this browser.'); + return __.destroy.call(this); + } + } + + var overlayMode = __.optionCheck.call(this, options); + + if (overlayMode && $('.' + options.overlayClass).length <= 0) { + __.addOverlay.call(this, options); + } + + if (options.loading && $('.' + options.loadingClass).length <= 0) { + __.addLoading.call(this, options); + } + + return this.each(function(){ + var _this = this; + var $this = $(this); + var $window = $(window); + var $document = $(document); + var data = $this.data(namespace); + + if (!data) { + options = $.extend({}, options); + + $this.data(namespace, { options: options }); + + if(options.timeout) __.addTimer.call(_this); + + if(options.onLoadEvent) { + $window.on('load.' + namespace, function() { + if(__.settings.timer) clearTimeout(__.settings.timer); + __.in.call(_this); + }); + } + + $window.on('pageshow.' + namespace, function(event) { + if(event.originalEvent.persisted) __.in.call(_this); + }); + + // Firefox back button issue #4 + $window.on('unload.' + namespace, function() { }); + + $document.on('click.' + namespace, options.linkElement, function(event) { + event.preventDefault(); + var $self = $(this); + var url = $self.attr('href'); + + // middle mouse button issue #24 + // if(middle mouse button || command key || shift key || win control key) + if (event.which === 2 || event.metaKey || event.shiftKey || navigator.platform.toUpperCase().indexOf('WIN') !== -1 && event.ctrlKey) { + window.open(url, '_blank'); + } else { + __.out.call(_this, $self, url); + } + + }); + } + }); // end each + }, + + addOverlay: function(options){ + $(options.overlayParentElement) + .prepend('
    '); + }, + + addLoading: function(options){ + $(options.loadingParentElement) + .append('
    ' + options.loadingInner + '
    '); + }, + + removeLoading: function(){ + var $this = $(this); + var options = $this.data(namespace).options; + var $loading = $(options.loadingParentElement).children('.' + options.loadingClass); + + $loading.fadeOut().remove(); + }, + + addTimer: function(){ + var _this = this; + var $this = $(this); + var options = $this.data(namespace).options; + + __.settings.timer = setTimeout(function(){ + __.in.call(_this); + $(window).off('load.' + namespace); + }, options.timeoutCountdown); + }, + + supportCheck: function(options){ + var $this = $(this); + var props = options.browser; + var propsNum = props.length; + var support = false; + + if (propsNum === 0) { + support = true; + } + for (var i = 0; i < propsNum; i++) { + if (typeof $this.css(props[i]) === 'string') { + support = true; + break; + } + } + return support; + }, + + optionCheck: function(options){ + var $this = $(this); + var overlayMode; + if(options.overlay || $this.data(__.settings.data.overlay)){ + overlayMode = true; + } else { + overlayMode = false; + } + return overlayMode; + }, + + animationCheck : function(data, stateClass, stateIn){ + var $this = $(this); + var options = $this.data(namespace).options; + var dataType = typeof data; + var dataDuration = !stateClass && dataType === 'number'; + var dataClass = stateClass && dataType === 'string' && data.length > 0; + + if(dataDuration || dataClass){ + data = data; + } else if(stateClass && stateIn) { + data = options.inClass; + } else if(!stateClass && stateIn) { + data = options.inDuration; + } else if(stateClass && !stateIn) { + data = options.outClass; + } else if(!stateClass && !stateIn) { + data = options.outDuration; + } + return data; + }, + + in: function(){ + var _this = this; + var $this = $(this); + var options = $this.data(namespace).options; + var thisInDuration = $this.data(__.settings.data.inDuration); + var thisInClass = $this.data(__.settings.data.inClass); + var inDuration = __.animationCheck.call(_this, thisInDuration, false, true); + var inClass = __.animationCheck.call(_this, thisInClass, true, true); + var overlayMode = __.optionCheck.call(_this, options); + var outClass = $this.data(namespace).outClass; + + if(options.loading) __.removeLoading.call(_this); + + if(outClass) $this.removeClass(outClass); + + if(overlayMode) { + __.inOverlay.call(_this, inClass, inDuration); + } else { + __.inDefault.call(_this, inClass, inDuration); + } + }, + + inDefault: function(inClass, inDuration){ + var $this = $(this); + + $this + .css({ 'animation-duration' : inDuration + 'ms' }) + .addClass(inClass) + .trigger(__.settings.events.inStart) + .animateCallback(function(){ + $this + .removeClass(inClass) + .css({ 'opacity' : 1 }) + .trigger(__.settings.events.inEnd); + }); + }, + + inOverlay: function(inClass, inDuration){ + var $this = $(this); + var options = $this.data(namespace).options; + + $this + .css({ 'opacity' : 1 }) + .trigger(__.settings.events.inStart); + + $(options.overlayParentElement) + .children('.' + options.overlayClass) + .css({ 'animation-duration' : inDuration + 'ms' }) + .addClass(inClass) + .animateCallback(function(){ + $this + .trigger(__.settings.events.inEnd); + }); + }, + + out: function($self, url){ + var _this = this; + var $this = $(this); + var options = $this.data(namespace).options; + var selfOutClass = $self.data(__.settings.data.outClass); + var thisOutClass = $this.data(__.settings.data.outClass); + var selfOutDuration = $self.data(__.settings.data.outDuration); + var thisOutDuration = $this.data(__.settings.data.outDuration); + var isOutClass = selfOutClass ? selfOutClass : thisOutClass; + var isOutDuration = selfOutDuration ? selfOutDuration : thisOutDuration; + var outClass = __.animationCheck.call(_this, isOutClass, true, false); + var outDuration = __.animationCheck.call(_this, isOutDuration, false, false); + var overlayMode = __.optionCheck.call(_this, options); + + $this.data(namespace).outClass = outClass; + + if(overlayMode) { + __.outOverlay.call(_this, outClass, outDuration, url); + } else { + __.outDefault.call(_this, outClass, outDuration, url); + } + }, + + outDefault: function(outClass, outDuration, url){ + var $this = $(this); + var options = $this.data(namespace).options; + + // (outDuration + 1) | #55 outDuration: 0 crashes on Safari only + $this + .css({ 'animation-duration' : (outDuration + 1) + 'ms' }) + .addClass(outClass) + .trigger(__.settings.events.outStart) + .animateCallback(function(){ + $this.trigger(__.settings.events.outEnd); + options.transition(url); + }); + }, + + + outOverlay: function(outClass, outDuration, url){ + var _this = this; + var $this = $(this); + var options = $this.data(namespace).options; + var thisInClass = $this.data(__.settings.data.inClass); + var inClass = __.animationCheck.call(_this, thisInClass, true, true); + + // (outDuration + 1) | #55 outDuration: 0 crashes animsition on Safari only + $(options.overlayParentElement) + .children('.' + options.overlayClass) + .css({ 'animation-duration' : (outDuration + 1) + 'ms' }) + .removeClass(inClass) + .addClass(outClass) + .trigger(__.settings.events.outStart) + .animateCallback(function(){ + $this.trigger(__.settings.events.outEnd); + options.transition(url); + }); + }, + + destroy: function(){ + return this.each(function(){ + var $this = $(this); + $(window).off('.'+ namespace); + $this + .css({'opacity': 1}) + .removeData(namespace); + }); + } + + }; + + $.fn.animateCallback = function(callback){ + var end = 'animationend webkitAnimationEnd'; + return this.each(function() { + var $this = $(this); + $this.on(end, function(){ + $this.off(end); + return callback.call(this); + }); + }); + }; + + $.fn.animsition = function(method){ + if ( __[method] ) { + return __[method].apply( this, Array.prototype.slice.call( arguments, 1 )); + } else if ( typeof method === 'object' || ! method ) { + return __.init.apply( this, arguments ); + } else { + $.error( 'Method ' + method + ' does not exist on jQuery.'+namespace); + } + }; + +})); diff --git a/public/vendor/animsition/js/animsition.min.js b/public/vendor/animsition/js/animsition.min.js new file mode 100755 index 000000000..64a143a44 --- /dev/null +++ b/public/vendor/animsition/js/animsition.min.js @@ -0,0 +1,8 @@ +/*! + * animsition v4.0.2 + * A simple and easy jQuery plugin for CSS animated page transitions. + * http://blivesta.github.io/animsition + * License : MIT + * Author : blivesta (http://blivesta.com/) + */ +!function(t){"use strict";"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof exports?module.exports=t(require("jquery")):t(jQuery)}(function(t){"use strict";var n="animsition",i={init:function(a){a=t.extend({inClass:"fade-in",outClass:"fade-out",inDuration:1500,outDuration:800,linkElement:".animsition-link",loading:!0,loadingParentElement:"body",loadingClass:"animsition-loading",loadingInner:"",timeout:!1,timeoutCountdown:5e3,onLoadEvent:!0,browser:["animation-duration","-webkit-animation-duration"],overlay:!1,overlayClass:"animsition-overlay-slide",overlayParentElement:"body",transition:function(t){window.location.href=t}},a),i.settings={timer:!1,data:{inClass:"animsition-in-class",inDuration:"animsition-in-duration",outClass:"animsition-out-class",outDuration:"animsition-out-duration",overlay:"animsition-overlay"},events:{inStart:"animsition.inStart",inEnd:"animsition.inEnd",outStart:"animsition.outStart",outEnd:"animsition.outEnd"}};var o=i.supportCheck.call(this,a);if(!o&&a.browser.length>0&&(!o||!this.length))return"console"in window||(window.console={},window.console.log=function(t){return t}),this.length||console.log("Animsition: Element does not exist on page."),o||console.log("Animsition: Does not support this browser."),i.destroy.call(this);var e=i.optionCheck.call(this,a);return e&&t("."+a.overlayClass).length<=0&&i.addOverlay.call(this,a),a.loading&&t("."+a.loadingClass).length<=0&&i.addLoading.call(this,a),this.each(function(){var o=this,e=t(this),s=t(window),r=t(document),l=e.data(n);l||(a=t.extend({},a),e.data(n,{options:a}),a.timeout&&i.addTimer.call(o),a.onLoadEvent&&s.on("load."+n,function(){i.settings.timer&&clearTimeout(i.settings.timer),i["in"].call(o)}),s.on("pageshow."+n,function(t){t.originalEvent.persisted&&i["in"].call(o)}),s.on("unload."+n,function(){}),r.on("click."+n,a.linkElement,function(n){n.preventDefault();var a=t(this),e=a.attr("href");2===n.which||n.metaKey||n.shiftKey||-1!==navigator.platform.toUpperCase().indexOf("WIN")&&n.ctrlKey?window.open(e,"_blank"):i.out.call(o,a,e)}))})},addOverlay:function(n){t(n.overlayParentElement).prepend('
    ')},addLoading:function(n){t(n.loadingParentElement).append('
    '+n.loadingInner+"
    ")},removeLoading:function(){var i=t(this),a=i.data(n).options,o=t(a.loadingParentElement).children("."+a.loadingClass);o.fadeOut().remove()},addTimer:function(){var a=this,o=t(this),e=o.data(n).options;i.settings.timer=setTimeout(function(){i["in"].call(a),t(window).off("load."+n)},e.timeoutCountdown)},supportCheck:function(n){var i=t(this),a=n.browser,o=a.length,e=!1;0===o&&(e=!0);for(var s=0;o>s;s++)if("string"==typeof i.css(a[s])){e=!0;break}return e},optionCheck:function(n){var a,o=t(this);return a=n.overlay||o.data(i.settings.data.overlay)?!0:!1},animationCheck:function(i,a,o){var e=t(this),s=e.data(n).options,r=typeof i,l=!a&&"number"===r,d=a&&"string"===r&&i.length>0;return l||d?i=i:a&&o?i=s.inClass:!a&&o?i=s.inDuration:a&&!o?i=s.outClass:a||o||(i=s.outDuration),i},"in":function(){var a=this,o=t(this),e=o.data(n).options,s=o.data(i.settings.data.inDuration),r=o.data(i.settings.data.inClass),l=i.animationCheck.call(a,s,!1,!0),d=i.animationCheck.call(a,r,!0,!0),u=i.optionCheck.call(a,e),c=o.data(n).outClass;e.loading&&i.removeLoading.call(a),c&&o.removeClass(c),u?i.inOverlay.call(a,d,l):i.inDefault.call(a,d,l)},inDefault:function(n,a){var o=t(this);o.css({"animation-duration":a+"ms"}).addClass(n).trigger(i.settings.events.inStart).animateCallback(function(){o.removeClass(n).css({opacity:1}).trigger(i.settings.events.inEnd)})},inOverlay:function(a,o){var e=t(this),s=e.data(n).options;e.css({opacity:1}).trigger(i.settings.events.inStart),t(s.overlayParentElement).children("."+s.overlayClass).css({"animation-duration":o+"ms"}).addClass(a).animateCallback(function(){e.trigger(i.settings.events.inEnd)})},out:function(a,o){var e=this,s=t(this),r=s.data(n).options,l=a.data(i.settings.data.outClass),d=s.data(i.settings.data.outClass),u=a.data(i.settings.data.outDuration),c=s.data(i.settings.data.outDuration),m=l?l:d,g=u?u:c,f=i.animationCheck.call(e,m,!0,!1),v=i.animationCheck.call(e,g,!1,!1),h=i.optionCheck.call(e,r);s.data(n).outClass=f,h?i.outOverlay.call(e,f,v,o):i.outDefault.call(e,f,v,o)},outDefault:function(a,o,e){var s=t(this),r=s.data(n).options;s.css({"animation-duration":o+1+"ms"}).addClass(a).trigger(i.settings.events.outStart).animateCallback(function(){s.trigger(i.settings.events.outEnd),r.transition(e)})},outOverlay:function(a,o,e){var s=this,r=t(this),l=r.data(n).options,d=r.data(i.settings.data.inClass),u=i.animationCheck.call(s,d,!0,!0);t(l.overlayParentElement).children("."+l.overlayClass).css({"animation-duration":o+1+"ms"}).removeClass(u).addClass(a).trigger(i.settings.events.outStart).animateCallback(function(){r.trigger(i.settings.events.outEnd),l.transition(e)})},destroy:function(){return this.each(function(){var i=t(this);t(window).off("."+n),i.css({opacity:1}).removeData(n)})}};t.fn.animateCallback=function(n){var i="animationend webkitAnimationEnd";return this.each(function(){var a=t(this);a.on(i,function(){return a.off(i),n.call(this)})})},t.fn.animsition=function(a){return i[a]?i[a].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof a&&a?void t.error("Method "+a+" does not exist on jQuery."+n):i.init.apply(this,arguments)}}); \ No newline at end of file diff --git a/public/vendor/bootstrap/css/bootstrap-grid.css b/public/vendor/bootstrap/css/bootstrap-grid.css new file mode 100755 index 000000000..b5f77b27c --- /dev/null +++ b/public/vendor/bootstrap/css/bootstrap-grid.css @@ -0,0 +1,1353 @@ +@-ms-viewport { + width: device-width; +} + +html { + box-sizing: border-box; + -ms-overflow-style: scrollbar; +} + +*, +*::before, +*::after { + box-sizing: inherit; +} + +.container { + margin-right: auto; + margin-left: auto; + padding-right: 15px; + padding-left: 15px; + width: 100%; +} + +@media (min-width: 576px) { + .container { + max-width: 540px; + } +} + +@media (min-width: 768px) { + .container { + max-width: 720px; + } +} + +@media (min-width: 992px) { + .container { + max-width: 960px; + } +} + +@media (min-width: 1200px) { + .container { + max-width: 1140px; + } +} + +.container-fluid { + width: 100%; + margin-right: auto; + margin-left: auto; + padding-right: 15px; + padding-left: 15px; + width: 100%; +} + +.row { + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + margin-right: -15px; + margin-left: -15px; +} + +.no-gutters { + margin-right: 0; + margin-left: 0; +} + +.no-gutters > .col, +.no-gutters > [class*="col-"] { + padding-right: 0; + padding-left: 0; +} + +.col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12, .col, +.col-auto, .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm, +.col-sm-auto, .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12, .col-md, +.col-md-auto, .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg, +.col-lg-auto, .col-xl-1, .col-xl-2, .col-xl-3, .col-xl-4, .col-xl-5, .col-xl-6, .col-xl-7, .col-xl-8, .col-xl-9, .col-xl-10, .col-xl-11, .col-xl-12, .col-xl, +.col-xl-auto { + position: relative; + width: 100%; + min-height: 1px; + padding-right: 15px; + padding-left: 15px; +} + +.col { + -ms-flex-preferred-size: 0; + flex-basis: 0; + -ms-flex-positive: 1; + flex-grow: 1; + max-width: 100%; +} + +.col-auto { + -ms-flex: 0 0 auto; + flex: 0 0 auto; + width: auto; + max-width: none; +} + +.col-1 { + -ms-flex: 0 0 8.333333%; + flex: 0 0 8.333333%; + max-width: 8.333333%; +} + +.col-2 { + -ms-flex: 0 0 16.666667%; + flex: 0 0 16.666667%; + max-width: 16.666667%; +} + +.col-3 { + -ms-flex: 0 0 25%; + flex: 0 0 25%; + max-width: 25%; +} + +.col-4 { + -ms-flex: 0 0 33.333333%; + flex: 0 0 33.333333%; + max-width: 33.333333%; +} + +.col-5 { + -ms-flex: 0 0 41.666667%; + flex: 0 0 41.666667%; + max-width: 41.666667%; +} + +.col-6 { + -ms-flex: 0 0 50%; + flex: 0 0 50%; + max-width: 50%; +} + +.col-7 { + -ms-flex: 0 0 58.333333%; + flex: 0 0 58.333333%; + max-width: 58.333333%; +} + +.col-8 { + -ms-flex: 0 0 66.666667%; + flex: 0 0 66.666667%; + max-width: 66.666667%; +} + +.col-9 { + -ms-flex: 0 0 75%; + flex: 0 0 75%; + max-width: 75%; +} + +.col-10 { + -ms-flex: 0 0 83.333333%; + flex: 0 0 83.333333%; + max-width: 83.333333%; +} + +.col-11 { + -ms-flex: 0 0 91.666667%; + flex: 0 0 91.666667%; + max-width: 91.666667%; +} + +.col-12 { + -ms-flex: 0 0 100%; + flex: 0 0 100%; + max-width: 100%; +} + +.order-1 { + -ms-flex-order: 1; + order: 1; +} + +.order-2 { + -ms-flex-order: 2; + order: 2; +} + +.order-3 { + -ms-flex-order: 3; + order: 3; +} + +.order-4 { + -ms-flex-order: 4; + order: 4; +} + +.order-5 { + -ms-flex-order: 5; + order: 5; +} + +.order-6 { + -ms-flex-order: 6; + order: 6; +} + +.order-7 { + -ms-flex-order: 7; + order: 7; +} + +.order-8 { + -ms-flex-order: 8; + order: 8; +} + +.order-9 { + -ms-flex-order: 9; + order: 9; +} + +.order-10 { + -ms-flex-order: 10; + order: 10; +} + +.order-11 { + -ms-flex-order: 11; + order: 11; +} + +.order-12 { + -ms-flex-order: 12; + order: 12; +} + +@media (min-width: 576px) { + .col-sm { + -ms-flex-preferred-size: 0; + flex-basis: 0; + -ms-flex-positive: 1; + flex-grow: 1; + max-width: 100%; + } + .col-sm-auto { + -ms-flex: 0 0 auto; + flex: 0 0 auto; + width: auto; + max-width: none; + } + .col-sm-1 { + -ms-flex: 0 0 8.333333%; + flex: 0 0 8.333333%; + max-width: 8.333333%; + } + .col-sm-2 { + -ms-flex: 0 0 16.666667%; + flex: 0 0 16.666667%; + max-width: 16.666667%; + } + .col-sm-3 { + -ms-flex: 0 0 25%; + flex: 0 0 25%; + max-width: 25%; + } + .col-sm-4 { + -ms-flex: 0 0 33.333333%; + flex: 0 0 33.333333%; + max-width: 33.333333%; + } + .col-sm-5 { + -ms-flex: 0 0 41.666667%; + flex: 0 0 41.666667%; + max-width: 41.666667%; + } + .col-sm-6 { + -ms-flex: 0 0 50%; + flex: 0 0 50%; + max-width: 50%; + } + .col-sm-7 { + -ms-flex: 0 0 58.333333%; + flex: 0 0 58.333333%; + max-width: 58.333333%; + } + .col-sm-8 { + -ms-flex: 0 0 66.666667%; + flex: 0 0 66.666667%; + max-width: 66.666667%; + } + .col-sm-9 { + -ms-flex: 0 0 75%; + flex: 0 0 75%; + max-width: 75%; + } + .col-sm-10 { + -ms-flex: 0 0 83.333333%; + flex: 0 0 83.333333%; + max-width: 83.333333%; + } + .col-sm-11 { + -ms-flex: 0 0 91.666667%; + flex: 0 0 91.666667%; + max-width: 91.666667%; + } + .col-sm-12 { + -ms-flex: 0 0 100%; + flex: 0 0 100%; + max-width: 100%; + } + .order-sm-1 { + -ms-flex-order: 1; + order: 1; + } + .order-sm-2 { + -ms-flex-order: 2; + order: 2; + } + .order-sm-3 { + -ms-flex-order: 3; + order: 3; + } + .order-sm-4 { + -ms-flex-order: 4; + order: 4; + } + .order-sm-5 { + -ms-flex-order: 5; + order: 5; + } + .order-sm-6 { + -ms-flex-order: 6; + order: 6; + } + .order-sm-7 { + -ms-flex-order: 7; + order: 7; + } + .order-sm-8 { + -ms-flex-order: 8; + order: 8; + } + .order-sm-9 { + -ms-flex-order: 9; + order: 9; + } + .order-sm-10 { + -ms-flex-order: 10; + order: 10; + } + .order-sm-11 { + -ms-flex-order: 11; + order: 11; + } + .order-sm-12 { + -ms-flex-order: 12; + order: 12; + } +} + +@media (min-width: 768px) { + .col-md { + -ms-flex-preferred-size: 0; + flex-basis: 0; + -ms-flex-positive: 1; + flex-grow: 1; + max-width: 100%; + } + .col-md-auto { + -ms-flex: 0 0 auto; + flex: 0 0 auto; + width: auto; + max-width: none; + } + .col-md-1 { + -ms-flex: 0 0 8.333333%; + flex: 0 0 8.333333%; + max-width: 8.333333%; + } + .col-md-2 { + -ms-flex: 0 0 16.666667%; + flex: 0 0 16.666667%; + max-width: 16.666667%; + } + .col-md-3 { + -ms-flex: 0 0 25%; + flex: 0 0 25%; + max-width: 25%; + } + .col-md-4 { + -ms-flex: 0 0 33.333333%; + flex: 0 0 33.333333%; + max-width: 33.333333%; + } + .col-md-5 { + -ms-flex: 0 0 41.666667%; + flex: 0 0 41.666667%; + max-width: 41.666667%; + } + .col-md-6 { + -ms-flex: 0 0 50%; + flex: 0 0 50%; + max-width: 50%; + } + .col-md-7 { + -ms-flex: 0 0 58.333333%; + flex: 0 0 58.333333%; + max-width: 58.333333%; + } + .col-md-8 { + -ms-flex: 0 0 66.666667%; + flex: 0 0 66.666667%; + max-width: 66.666667%; + } + .col-md-9 { + -ms-flex: 0 0 75%; + flex: 0 0 75%; + max-width: 75%; + } + .col-md-10 { + -ms-flex: 0 0 83.333333%; + flex: 0 0 83.333333%; + max-width: 83.333333%; + } + .col-md-11 { + -ms-flex: 0 0 91.666667%; + flex: 0 0 91.666667%; + max-width: 91.666667%; + } + .col-md-12 { + -ms-flex: 0 0 100%; + flex: 0 0 100%; + max-width: 100%; + } + .order-md-1 { + -ms-flex-order: 1; + order: 1; + } + .order-md-2 { + -ms-flex-order: 2; + order: 2; + } + .order-md-3 { + -ms-flex-order: 3; + order: 3; + } + .order-md-4 { + -ms-flex-order: 4; + order: 4; + } + .order-md-5 { + -ms-flex-order: 5; + order: 5; + } + .order-md-6 { + -ms-flex-order: 6; + order: 6; + } + .order-md-7 { + -ms-flex-order: 7; + order: 7; + } + .order-md-8 { + -ms-flex-order: 8; + order: 8; + } + .order-md-9 { + -ms-flex-order: 9; + order: 9; + } + .order-md-10 { + -ms-flex-order: 10; + order: 10; + } + .order-md-11 { + -ms-flex-order: 11; + order: 11; + } + .order-md-12 { + -ms-flex-order: 12; + order: 12; + } +} + +@media (min-width: 992px) { + .col-lg { + -ms-flex-preferred-size: 0; + flex-basis: 0; + -ms-flex-positive: 1; + flex-grow: 1; + max-width: 100%; + } + .col-lg-auto { + -ms-flex: 0 0 auto; + flex: 0 0 auto; + width: auto; + max-width: none; + } + .col-lg-1 { + -ms-flex: 0 0 8.333333%; + flex: 0 0 8.333333%; + max-width: 8.333333%; + } + .col-lg-2 { + -ms-flex: 0 0 16.666667%; + flex: 0 0 16.666667%; + max-width: 16.666667%; + } + .col-lg-3 { + -ms-flex: 0 0 25%; + flex: 0 0 25%; + max-width: 25%; + } + .col-lg-4 { + -ms-flex: 0 0 33.333333%; + flex: 0 0 33.333333%; + max-width: 33.333333%; + } + .col-lg-5 { + -ms-flex: 0 0 41.666667%; + flex: 0 0 41.666667%; + max-width: 41.666667%; + } + .col-lg-6 { + -ms-flex: 0 0 50%; + flex: 0 0 50%; + max-width: 50%; + } + .col-lg-7 { + -ms-flex: 0 0 58.333333%; + flex: 0 0 58.333333%; + max-width: 58.333333%; + } + .col-lg-8 { + -ms-flex: 0 0 66.666667%; + flex: 0 0 66.666667%; + max-width: 66.666667%; + } + .col-lg-9 { + -ms-flex: 0 0 75%; + flex: 0 0 75%; + max-width: 75%; + } + .col-lg-10 { + -ms-flex: 0 0 83.333333%; + flex: 0 0 83.333333%; + max-width: 83.333333%; + } + .col-lg-11 { + -ms-flex: 0 0 91.666667%; + flex: 0 0 91.666667%; + max-width: 91.666667%; + } + .col-lg-12 { + -ms-flex: 0 0 100%; + flex: 0 0 100%; + max-width: 100%; + } + .order-lg-1 { + -ms-flex-order: 1; + order: 1; + } + .order-lg-2 { + -ms-flex-order: 2; + order: 2; + } + .order-lg-3 { + -ms-flex-order: 3; + order: 3; + } + .order-lg-4 { + -ms-flex-order: 4; + order: 4; + } + .order-lg-5 { + -ms-flex-order: 5; + order: 5; + } + .order-lg-6 { + -ms-flex-order: 6; + order: 6; + } + .order-lg-7 { + -ms-flex-order: 7; + order: 7; + } + .order-lg-8 { + -ms-flex-order: 8; + order: 8; + } + .order-lg-9 { + -ms-flex-order: 9; + order: 9; + } + .order-lg-10 { + -ms-flex-order: 10; + order: 10; + } + .order-lg-11 { + -ms-flex-order: 11; + order: 11; + } + .order-lg-12 { + -ms-flex-order: 12; + order: 12; + } +} + +@media (min-width: 1200px) { + .col-xl { + -ms-flex-preferred-size: 0; + flex-basis: 0; + -ms-flex-positive: 1; + flex-grow: 1; + max-width: 100%; + } + .col-xl-auto { + -ms-flex: 0 0 auto; + flex: 0 0 auto; + width: auto; + max-width: none; + } + .col-xl-1 { + -ms-flex: 0 0 8.333333%; + flex: 0 0 8.333333%; + max-width: 8.333333%; + } + .col-xl-2 { + -ms-flex: 0 0 16.666667%; + flex: 0 0 16.666667%; + max-width: 16.666667%; + } + .col-xl-3 { + -ms-flex: 0 0 25%; + flex: 0 0 25%; + max-width: 25%; + } + .col-xl-4 { + -ms-flex: 0 0 33.333333%; + flex: 0 0 33.333333%; + max-width: 33.333333%; + } + .col-xl-5 { + -ms-flex: 0 0 41.666667%; + flex: 0 0 41.666667%; + max-width: 41.666667%; + } + .col-xl-6 { + -ms-flex: 0 0 50%; + flex: 0 0 50%; + max-width: 50%; + } + .col-xl-7 { + -ms-flex: 0 0 58.333333%; + flex: 0 0 58.333333%; + max-width: 58.333333%; + } + .col-xl-8 { + -ms-flex: 0 0 66.666667%; + flex: 0 0 66.666667%; + max-width: 66.666667%; + } + .col-xl-9 { + -ms-flex: 0 0 75%; + flex: 0 0 75%; + max-width: 75%; + } + .col-xl-10 { + -ms-flex: 0 0 83.333333%; + flex: 0 0 83.333333%; + max-width: 83.333333%; + } + .col-xl-11 { + -ms-flex: 0 0 91.666667%; + flex: 0 0 91.666667%; + max-width: 91.666667%; + } + .col-xl-12 { + -ms-flex: 0 0 100%; + flex: 0 0 100%; + max-width: 100%; + } + .order-xl-1 { + -ms-flex-order: 1; + order: 1; + } + .order-xl-2 { + -ms-flex-order: 2; + order: 2; + } + .order-xl-3 { + -ms-flex-order: 3; + order: 3; + } + .order-xl-4 { + -ms-flex-order: 4; + order: 4; + } + .order-xl-5 { + -ms-flex-order: 5; + order: 5; + } + .order-xl-6 { + -ms-flex-order: 6; + order: 6; + } + .order-xl-7 { + -ms-flex-order: 7; + order: 7; + } + .order-xl-8 { + -ms-flex-order: 8; + order: 8; + } + .order-xl-9 { + -ms-flex-order: 9; + order: 9; + } + .order-xl-10 { + -ms-flex-order: 10; + order: 10; + } + .order-xl-11 { + -ms-flex-order: 11; + order: 11; + } + .order-xl-12 { + -ms-flex-order: 12; + order: 12; + } +} + +.flex-row { + -ms-flex-direction: row !important; + flex-direction: row !important; +} + +.flex-column { + -ms-flex-direction: column !important; + flex-direction: column !important; +} + +.flex-row-reverse { + -ms-flex-direction: row-reverse !important; + flex-direction: row-reverse !important; +} + +.flex-column-reverse { + -ms-flex-direction: column-reverse !important; + flex-direction: column-reverse !important; +} + +.flex-wrap { + -ms-flex-wrap: wrap !important; + flex-wrap: wrap !important; +} + +.flex-nowrap { + -ms-flex-wrap: nowrap !important; + flex-wrap: nowrap !important; +} + +.flex-wrap-reverse { + -ms-flex-wrap: wrap-reverse !important; + flex-wrap: wrap-reverse !important; +} + +.justify-content-start { + -ms-flex-pack: start !important; + justify-content: flex-start !important; +} + +.justify-content-end { + -ms-flex-pack: end !important; + justify-content: flex-end !important; +} + +.justify-content-center { + -ms-flex-pack: center !important; + justify-content: center !important; +} + +.justify-content-between { + -ms-flex-pack: justify !important; + justify-content: space-between !important; +} + +.justify-content-around { + -ms-flex-pack: distribute !important; + justify-content: space-around !important; +} + +.align-items-start { + -ms-flex-align: start !important; + align-items: flex-start !important; +} + +.align-items-end { + -ms-flex-align: end !important; + align-items: flex-end !important; +} + +.align-items-center { + -ms-flex-align: center !important; + align-items: center !important; +} + +.align-items-baseline { + -ms-flex-align: baseline !important; + align-items: baseline !important; +} + +.align-items-stretch { + -ms-flex-align: stretch !important; + align-items: stretch !important; +} + +.align-content-start { + -ms-flex-line-pack: start !important; + align-content: flex-start !important; +} + +.align-content-end { + -ms-flex-line-pack: end !important; + align-content: flex-end !important; +} + +.align-content-center { + -ms-flex-line-pack: center !important; + align-content: center !important; +} + +.align-content-between { + -ms-flex-line-pack: justify !important; + align-content: space-between !important; +} + +.align-content-around { + -ms-flex-line-pack: distribute !important; + align-content: space-around !important; +} + +.align-content-stretch { + -ms-flex-line-pack: stretch !important; + align-content: stretch !important; +} + +.align-self-auto { + -ms-flex-item-align: auto !important; + align-self: auto !important; +} + +.align-self-start { + -ms-flex-item-align: start !important; + align-self: flex-start !important; +} + +.align-self-end { + -ms-flex-item-align: end !important; + align-self: flex-end !important; +} + +.align-self-center { + -ms-flex-item-align: center !important; + align-self: center !important; +} + +.align-self-baseline { + -ms-flex-item-align: baseline !important; + align-self: baseline !important; +} + +.align-self-stretch { + -ms-flex-item-align: stretch !important; + align-self: stretch !important; +} + +@media (min-width: 576px) { + .flex-sm-row { + -ms-flex-direction: row !important; + flex-direction: row !important; + } + .flex-sm-column { + -ms-flex-direction: column !important; + flex-direction: column !important; + } + .flex-sm-row-reverse { + -ms-flex-direction: row-reverse !important; + flex-direction: row-reverse !important; + } + .flex-sm-column-reverse { + -ms-flex-direction: column-reverse !important; + flex-direction: column-reverse !important; + } + .flex-sm-wrap { + -ms-flex-wrap: wrap !important; + flex-wrap: wrap !important; + } + .flex-sm-nowrap { + -ms-flex-wrap: nowrap !important; + flex-wrap: nowrap !important; + } + .flex-sm-wrap-reverse { + -ms-flex-wrap: wrap-reverse !important; + flex-wrap: wrap-reverse !important; + } + .justify-content-sm-start { + -ms-flex-pack: start !important; + justify-content: flex-start !important; + } + .justify-content-sm-end { + -ms-flex-pack: end !important; + justify-content: flex-end !important; + } + .justify-content-sm-center { + -ms-flex-pack: center !important; + justify-content: center !important; + } + .justify-content-sm-between { + -ms-flex-pack: justify !important; + justify-content: space-between !important; + } + .justify-content-sm-around { + -ms-flex-pack: distribute !important; + justify-content: space-around !important; + } + .align-items-sm-start { + -ms-flex-align: start !important; + align-items: flex-start !important; + } + .align-items-sm-end { + -ms-flex-align: end !important; + align-items: flex-end !important; + } + .align-items-sm-center { + -ms-flex-align: center !important; + align-items: center !important; + } + .align-items-sm-baseline { + -ms-flex-align: baseline !important; + align-items: baseline !important; + } + .align-items-sm-stretch { + -ms-flex-align: stretch !important; + align-items: stretch !important; + } + .align-content-sm-start { + -ms-flex-line-pack: start !important; + align-content: flex-start !important; + } + .align-content-sm-end { + -ms-flex-line-pack: end !important; + align-content: flex-end !important; + } + .align-content-sm-center { + -ms-flex-line-pack: center !important; + align-content: center !important; + } + .align-content-sm-between { + -ms-flex-line-pack: justify !important; + align-content: space-between !important; + } + .align-content-sm-around { + -ms-flex-line-pack: distribute !important; + align-content: space-around !important; + } + .align-content-sm-stretch { + -ms-flex-line-pack: stretch !important; + align-content: stretch !important; + } + .align-self-sm-auto { + -ms-flex-item-align: auto !important; + align-self: auto !important; + } + .align-self-sm-start { + -ms-flex-item-align: start !important; + align-self: flex-start !important; + } + .align-self-sm-end { + -ms-flex-item-align: end !important; + align-self: flex-end !important; + } + .align-self-sm-center { + -ms-flex-item-align: center !important; + align-self: center !important; + } + .align-self-sm-baseline { + -ms-flex-item-align: baseline !important; + align-self: baseline !important; + } + .align-self-sm-stretch { + -ms-flex-item-align: stretch !important; + align-self: stretch !important; + } +} + +@media (min-width: 768px) { + .flex-md-row { + -ms-flex-direction: row !important; + flex-direction: row !important; + } + .flex-md-column { + -ms-flex-direction: column !important; + flex-direction: column !important; + } + .flex-md-row-reverse { + -ms-flex-direction: row-reverse !important; + flex-direction: row-reverse !important; + } + .flex-md-column-reverse { + -ms-flex-direction: column-reverse !important; + flex-direction: column-reverse !important; + } + .flex-md-wrap { + -ms-flex-wrap: wrap !important; + flex-wrap: wrap !important; + } + .flex-md-nowrap { + -ms-flex-wrap: nowrap !important; + flex-wrap: nowrap !important; + } + .flex-md-wrap-reverse { + -ms-flex-wrap: wrap-reverse !important; + flex-wrap: wrap-reverse !important; + } + .justify-content-md-start { + -ms-flex-pack: start !important; + justify-content: flex-start !important; + } + .justify-content-md-end { + -ms-flex-pack: end !important; + justify-content: flex-end !important; + } + .justify-content-md-center { + -ms-flex-pack: center !important; + justify-content: center !important; + } + .justify-content-md-between { + -ms-flex-pack: justify !important; + justify-content: space-between !important; + } + .justify-content-md-around { + -ms-flex-pack: distribute !important; + justify-content: space-around !important; + } + .align-items-md-start { + -ms-flex-align: start !important; + align-items: flex-start !important; + } + .align-items-md-end { + -ms-flex-align: end !important; + align-items: flex-end !important; + } + .align-items-md-center { + -ms-flex-align: center !important; + align-items: center !important; + } + .align-items-md-baseline { + -ms-flex-align: baseline !important; + align-items: baseline !important; + } + .align-items-md-stretch { + -ms-flex-align: stretch !important; + align-items: stretch !important; + } + .align-content-md-start { + -ms-flex-line-pack: start !important; + align-content: flex-start !important; + } + .align-content-md-end { + -ms-flex-line-pack: end !important; + align-content: flex-end !important; + } + .align-content-md-center { + -ms-flex-line-pack: center !important; + align-content: center !important; + } + .align-content-md-between { + -ms-flex-line-pack: justify !important; + align-content: space-between !important; + } + .align-content-md-around { + -ms-flex-line-pack: distribute !important; + align-content: space-around !important; + } + .align-content-md-stretch { + -ms-flex-line-pack: stretch !important; + align-content: stretch !important; + } + .align-self-md-auto { + -ms-flex-item-align: auto !important; + align-self: auto !important; + } + .align-self-md-start { + -ms-flex-item-align: start !important; + align-self: flex-start !important; + } + .align-self-md-end { + -ms-flex-item-align: end !important; + align-self: flex-end !important; + } + .align-self-md-center { + -ms-flex-item-align: center !important; + align-self: center !important; + } + .align-self-md-baseline { + -ms-flex-item-align: baseline !important; + align-self: baseline !important; + } + .align-self-md-stretch { + -ms-flex-item-align: stretch !important; + align-self: stretch !important; + } +} + +@media (min-width: 992px) { + .flex-lg-row { + -ms-flex-direction: row !important; + flex-direction: row !important; + } + .flex-lg-column { + -ms-flex-direction: column !important; + flex-direction: column !important; + } + .flex-lg-row-reverse { + -ms-flex-direction: row-reverse !important; + flex-direction: row-reverse !important; + } + .flex-lg-column-reverse { + -ms-flex-direction: column-reverse !important; + flex-direction: column-reverse !important; + } + .flex-lg-wrap { + -ms-flex-wrap: wrap !important; + flex-wrap: wrap !important; + } + .flex-lg-nowrap { + -ms-flex-wrap: nowrap !important; + flex-wrap: nowrap !important; + } + .flex-lg-wrap-reverse { + -ms-flex-wrap: wrap-reverse !important; + flex-wrap: wrap-reverse !important; + } + .justify-content-lg-start { + -ms-flex-pack: start !important; + justify-content: flex-start !important; + } + .justify-content-lg-end { + -ms-flex-pack: end !important; + justify-content: flex-end !important; + } + .justify-content-lg-center { + -ms-flex-pack: center !important; + justify-content: center !important; + } + .justify-content-lg-between { + -ms-flex-pack: justify !important; + justify-content: space-between !important; + } + .justify-content-lg-around { + -ms-flex-pack: distribute !important; + justify-content: space-around !important; + } + .align-items-lg-start { + -ms-flex-align: start !important; + align-items: flex-start !important; + } + .align-items-lg-end { + -ms-flex-align: end !important; + align-items: flex-end !important; + } + .align-items-lg-center { + -ms-flex-align: center !important; + align-items: center !important; + } + .align-items-lg-baseline { + -ms-flex-align: baseline !important; + align-items: baseline !important; + } + .align-items-lg-stretch { + -ms-flex-align: stretch !important; + align-items: stretch !important; + } + .align-content-lg-start { + -ms-flex-line-pack: start !important; + align-content: flex-start !important; + } + .align-content-lg-end { + -ms-flex-line-pack: end !important; + align-content: flex-end !important; + } + .align-content-lg-center { + -ms-flex-line-pack: center !important; + align-content: center !important; + } + .align-content-lg-between { + -ms-flex-line-pack: justify !important; + align-content: space-between !important; + } + .align-content-lg-around { + -ms-flex-line-pack: distribute !important; + align-content: space-around !important; + } + .align-content-lg-stretch { + -ms-flex-line-pack: stretch !important; + align-content: stretch !important; + } + .align-self-lg-auto { + -ms-flex-item-align: auto !important; + align-self: auto !important; + } + .align-self-lg-start { + -ms-flex-item-align: start !important; + align-self: flex-start !important; + } + .align-self-lg-end { + -ms-flex-item-align: end !important; + align-self: flex-end !important; + } + .align-self-lg-center { + -ms-flex-item-align: center !important; + align-self: center !important; + } + .align-self-lg-baseline { + -ms-flex-item-align: baseline !important; + align-self: baseline !important; + } + .align-self-lg-stretch { + -ms-flex-item-align: stretch !important; + align-self: stretch !important; + } +} + +@media (min-width: 1200px) { + .flex-xl-row { + -ms-flex-direction: row !important; + flex-direction: row !important; + } + .flex-xl-column { + -ms-flex-direction: column !important; + flex-direction: column !important; + } + .flex-xl-row-reverse { + -ms-flex-direction: row-reverse !important; + flex-direction: row-reverse !important; + } + .flex-xl-column-reverse { + -ms-flex-direction: column-reverse !important; + flex-direction: column-reverse !important; + } + .flex-xl-wrap { + -ms-flex-wrap: wrap !important; + flex-wrap: wrap !important; + } + .flex-xl-nowrap { + -ms-flex-wrap: nowrap !important; + flex-wrap: nowrap !important; + } + .flex-xl-wrap-reverse { + -ms-flex-wrap: wrap-reverse !important; + flex-wrap: wrap-reverse !important; + } + .justify-content-xl-start { + -ms-flex-pack: start !important; + justify-content: flex-start !important; + } + .justify-content-xl-end { + -ms-flex-pack: end !important; + justify-content: flex-end !important; + } + .justify-content-xl-center { + -ms-flex-pack: center !important; + justify-content: center !important; + } + .justify-content-xl-between { + -ms-flex-pack: justify !important; + justify-content: space-between !important; + } + .justify-content-xl-around { + -ms-flex-pack: distribute !important; + justify-content: space-around !important; + } + .align-items-xl-start { + -ms-flex-align: start !important; + align-items: flex-start !important; + } + .align-items-xl-end { + -ms-flex-align: end !important; + align-items: flex-end !important; + } + .align-items-xl-center { + -ms-flex-align: center !important; + align-items: center !important; + } + .align-items-xl-baseline { + -ms-flex-align: baseline !important; + align-items: baseline !important; + } + .align-items-xl-stretch { + -ms-flex-align: stretch !important; + align-items: stretch !important; + } + .align-content-xl-start { + -ms-flex-line-pack: start !important; + align-content: flex-start !important; + } + .align-content-xl-end { + -ms-flex-line-pack: end !important; + align-content: flex-end !important; + } + .align-content-xl-center { + -ms-flex-line-pack: center !important; + align-content: center !important; + } + .align-content-xl-between { + -ms-flex-line-pack: justify !important; + align-content: space-between !important; + } + .align-content-xl-around { + -ms-flex-line-pack: distribute !important; + align-content: space-around !important; + } + .align-content-xl-stretch { + -ms-flex-line-pack: stretch !important; + align-content: stretch !important; + } + .align-self-xl-auto { + -ms-flex-item-align: auto !important; + align-self: auto !important; + } + .align-self-xl-start { + -ms-flex-item-align: start !important; + align-self: flex-start !important; + } + .align-self-xl-end { + -ms-flex-item-align: end !important; + align-self: flex-end !important; + } + .align-self-xl-center { + -ms-flex-item-align: center !important; + align-self: center !important; + } + .align-self-xl-baseline { + -ms-flex-item-align: baseline !important; + align-self: baseline !important; + } + .align-self-xl-stretch { + -ms-flex-item-align: stretch !important; + align-self: stretch !important; + } +} +/*# sourceMappingURL=bootstrap-grid.css.map */ \ No newline at end of file diff --git a/public/vendor/bootstrap/css/bootstrap-grid.css.map b/public/vendor/bootstrap/css/bootstrap-grid.css.map new file mode 100755 index 000000000..a5145bdb0 --- /dev/null +++ b/public/vendor/bootstrap/css/bootstrap-grid.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../scss/bootstrap-grid.scss","bootstrap-grid.css","../../scss/_grid.scss","../../scss/mixins/_grid.scss","../../scss/mixins/_breakpoints.scss","../../scss/_variables.scss","../../scss/mixins/_grid-framework.scss","../../scss/utilities/_flex.scss"],"names":[],"mappings":"AAUE;EAAgB,oBAAmB;CCRpC;;ADWD;EACE,uBAAsB;EACtB,8BAA6B;CAC9B;;AAED;;;EAGE,oBAAmB;CACpB;;AEjBC;ECAA,mBAAkB;EAClB,kBAAiB;EACjB,oBAAuC;EACvC,mBAAuC;EACvC,YAAW;CDDV;;AEgDC;EFnDF;ICYI,iBE8KK;GHvLR;CDmBF;;AG6BG;EFnDF;ICYI,iBE+KK;GHxLR;CDyBF;;AGuBG;EFnDF;ICYI,iBEgLK;GHzLR;CD+BF;;AGiBG;EFnDF;ICYI,kBEiLM;GH1LT;CDqCF;;AC5BC;EACE,YAAW;ECbb,mBAAkB;EAClB,kBAAiB;EACjB,oBAAuC;EACvC,mBAAuC;EACvC,YAAW;CDWV;;AAQD;ECLA,qBAAa;EAAb,cAAa;EACb,oBAAe;MAAf,gBAAe;EACf,oBAAuC;EACvC,mBAAuC;CDItC;;AAID;EACE,gBAAe;EACf,eAAc;CAOf;;AATD;;EAMI,iBAAgB;EAChB,gBAAe;CAChB;;AInCH;;;;;;EACE,mBAAkB;EAClB,YAAW;EACX,gBAAe;EACf,oBAA4B;EAC5B,mBAA4B;CAC7B;;AAkBG;EACE,2BAAa;MAAb,cAAa;EACb,qBAAY;MAAZ,aAAY;EACZ,gBAAe;CAChB;;AACD;EACE,mBAAc;MAAd,eAAc;EACd,YAAW;EACX,gBAAe;CAChB;;AAGC;EHFN,wBAAsC;MAAtC,oBAAsC;EAItC,qBAAuC;CGAhC;;AAFD;EHFN,yBAAsC;MAAtC,qBAAsC;EAItC,sBAAuC;CGAhC;;AAFD;EHFN,kBAAsC;MAAtC,cAAsC;EAItC,eAAuC;CGAhC;;AAFD;EHFN,yBAAsC;MAAtC,qBAAsC;EAItC,sBAAuC;CGAhC;;AAFD;EHFN,yBAAsC;MAAtC,qBAAsC;EAItC,sBAAuC;CGAhC;;AAFD;EHFN,kBAAsC;MAAtC,cAAsC;EAItC,eAAuC;CGAhC;;AAFD;EHFN,yBAAsC;MAAtC,qBAAsC;EAItC,sBAAuC;CGAhC;;AAFD;EHFN,yBAAsC;MAAtC,qBAAsC;EAItC,sBAAuC;CGAhC;;AAFD;EHFN,kBAAsC;MAAtC,cAAsC;EAItC,eAAuC;CGAhC;;AAFD;EHFN,yBAAsC;MAAtC,qBAAsC;EAItC,sBAAuC;CGAhC;;AAFD;EHFN,yBAAsC;MAAtC,qBAAsC;EAItC,sBAAuC;CGAhC;;AAFD;EHFN,mBAAsC;MAAtC,eAAsC;EAItC,gBAAuC;CGAhC;;AAID;EACE,kBAFU;MAEV,SAFU;CAGX;;AAFD;EACE,kBAFU;MAEV,SAFU;CAGX;;AAFD;EACE,kBAFU;MAEV,SAFU;CAGX;;AAFD;EACE,kBAFU;MAEV,SAFU;CAGX;;AAFD;EACE,kBAFU;MAEV,SAFU;CAGX;;AAFD;EACE,kBAFU;MAEV,SAFU;CAGX;;AAFD;EACE,kBAFU;MAEV,SAFU;CAGX;;AAFD;EACE,kBAFU;MAEV,SAFU;CAGX;;AAFD;EACE,kBAFU;MAEV,SAFU;CAGX;;AAFD;EACE,mBAFU;MAEV,UAFU;CAGX;;AAFD;EACE,mBAFU;MAEV,UAFU;CAGX;;AAFD;EACE,mBAFU;MAEV,UAFU;CAGX;;AFKL;EEzBE;IACE,2BAAa;QAAb,cAAa;IACb,qBAAY;QAAZ,aAAY;IACZ,gBAAe;GAChB;EACD;IACE,mBAAc;QAAd,eAAc;IACd,YAAW;IACX,gBAAe;GAChB;EAGC;IHFN,wBAAsC;QAAtC,oBAAsC;IAItC,qBAAuC;GGAhC;EAFD;IHFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GGAhC;EAFD;IHFN,kBAAsC;QAAtC,cAAsC;IAItC,eAAuC;GGAhC;EAFD;IHFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GGAhC;EAFD;IHFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GGAhC;EAFD;IHFN,kBAAsC;QAAtC,cAAsC;IAItC,eAAuC;GGAhC;EAFD;IHFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GGAhC;EAFD;IHFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GGAhC;EAFD;IHFN,kBAAsC;QAAtC,cAAsC;IAItC,eAAuC;GGAhC;EAFD;IHFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GGAhC;EAFD;IHFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GGAhC;EAFD;IHFN,mBAAsC;QAAtC,eAAsC;IAItC,gBAAuC;GGAhC;EAID;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,mBAFU;QAEV,UAFU;GAGX;EAFD;IACE,mBAFU;QAEV,UAFU;GAGX;EAFD;IACE,mBAFU;QAEV,UAFU;GAGX;CL2PR;;AGtPG;EEzBE;IACE,2BAAa;QAAb,cAAa;IACb,qBAAY;QAAZ,aAAY;IACZ,gBAAe;GAChB;EACD;IACE,mBAAc;QAAd,eAAc;IACd,YAAW;IACX,gBAAe;GAChB;EAGC;IHFN,wBAAsC;QAAtC,oBAAsC;IAItC,qBAAuC;GGAhC;EAFD;IHFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GGAhC;EAFD;IHFN,kBAAsC;QAAtC,cAAsC;IAItC,eAAuC;GGAhC;EAFD;IHFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GGAhC;EAFD;IHFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GGAhC;EAFD;IHFN,kBAAsC;QAAtC,cAAsC;IAItC,eAAuC;GGAhC;EAFD;IHFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GGAhC;EAFD;IHFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GGAhC;EAFD;IHFN,kBAAsC;QAAtC,cAAsC;IAItC,eAAuC;GGAhC;EAFD;IHFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GGAhC;EAFD;IHFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GGAhC;EAFD;IHFN,mBAAsC;QAAtC,eAAsC;IAItC,gBAAuC;GGAhC;EAID;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,mBAFU;QAEV,UAFU;GAGX;EAFD;IACE,mBAFU;QAEV,UAFU;GAGX;EAFD;IACE,mBAFU;QAEV,UAFU;GAGX;CL4VR;;AGvVG;EEzBE;IACE,2BAAa;QAAb,cAAa;IACb,qBAAY;QAAZ,aAAY;IACZ,gBAAe;GAChB;EACD;IACE,mBAAc;QAAd,eAAc;IACd,YAAW;IACX,gBAAe;GAChB;EAGC;IHFN,wBAAsC;QAAtC,oBAAsC;IAItC,qBAAuC;GGAhC;EAFD;IHFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GGAhC;EAFD;IHFN,kBAAsC;QAAtC,cAAsC;IAItC,eAAuC;GGAhC;EAFD;IHFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GGAhC;EAFD;IHFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GGAhC;EAFD;IHFN,kBAAsC;QAAtC,cAAsC;IAItC,eAAuC;GGAhC;EAFD;IHFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GGAhC;EAFD;IHFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GGAhC;EAFD;IHFN,kBAAsC;QAAtC,cAAsC;IAItC,eAAuC;GGAhC;EAFD;IHFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GGAhC;EAFD;IHFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GGAhC;EAFD;IHFN,mBAAsC;QAAtC,eAAsC;IAItC,gBAAuC;GGAhC;EAID;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,mBAFU;QAEV,UAFU;GAGX;EAFD;IACE,mBAFU;QAEV,UAFU;GAGX;EAFD;IACE,mBAFU;QAEV,UAFU;GAGX;CL6bR;;AGxbG;EEzBE;IACE,2BAAa;QAAb,cAAa;IACb,qBAAY;QAAZ,aAAY;IACZ,gBAAe;GAChB;EACD;IACE,mBAAc;QAAd,eAAc;IACd,YAAW;IACX,gBAAe;GAChB;EAGC;IHFN,wBAAsC;QAAtC,oBAAsC;IAItC,qBAAuC;GGAhC;EAFD;IHFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GGAhC;EAFD;IHFN,kBAAsC;QAAtC,cAAsC;IAItC,eAAuC;GGAhC;EAFD;IHFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GGAhC;EAFD;IHFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GGAhC;EAFD;IHFN,kBAAsC;QAAtC,cAAsC;IAItC,eAAuC;GGAhC;EAFD;IHFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GGAhC;EAFD;IHFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GGAhC;EAFD;IHFN,kBAAsC;QAAtC,cAAsC;IAItC,eAAuC;GGAhC;EAFD;IHFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GGAhC;EAFD;IHFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GGAhC;EAFD;IHFN,mBAAsC;QAAtC,eAAsC;IAItC,gBAAuC;GGAhC;EAID;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,mBAFU;QAEV,UAFU;GAGX;EAFD;IACE,mBAFU;QAEV,UAFU;GAGX;EAFD;IACE,mBAFU;QAEV,UAFU;GAGX;CL8hBR;;AMzkBG;EAAgC,mCAA8B;MAA9B,+BAA8B;CAAK;;AACnE;EAAgC,sCAAiC;MAAjC,kCAAiC;CAAK;;AACtE;EAAgC,2CAAsC;MAAtC,uCAAsC;CAAK;;AAC3E;EAAgC,8CAAyC;MAAzC,0CAAyC;CAAK;;AAE9E;EAA8B,+BAA0B;MAA1B,2BAA0B;CAAK;;AAC7D;EAA8B,iCAA4B;MAA5B,6BAA4B;CAAK;;AAC/D;EAA8B,uCAAkC;MAAlC,mCAAkC;CAAK;;AAErE;EAAoC,gCAAsC;MAAtC,uCAAsC;CAAK;;AAC/E;EAAoC,8BAAoC;MAApC,qCAAoC;CAAK;;AAC7E;EAAoC,iCAAkC;MAAlC,mCAAkC;CAAK;;AAC3E;EAAoC,kCAAyC;MAAzC,0CAAyC;CAAK;;AAClF;EAAoC,qCAAwC;MAAxC,yCAAwC;CAAK;;AAEjF;EAAiC,iCAAkC;MAAlC,mCAAkC;CAAK;;AACxE;EAAiC,+BAAgC;MAAhC,iCAAgC;CAAK;;AACtE;EAAiC,kCAA8B;MAA9B,+BAA8B;CAAK;;AACpE;EAAiC,oCAAgC;MAAhC,iCAAgC;CAAK;;AACtE;EAAiC,mCAA+B;MAA/B,gCAA+B;CAAK;;AAErE;EAAkC,qCAAoC;MAApC,qCAAoC;CAAK;;AAC3E;EAAkC,mCAAkC;MAAlC,mCAAkC;CAAK;;AACzE;EAAkC,sCAAgC;MAAhC,iCAAgC;CAAK;;AACvE;EAAkC,uCAAuC;MAAvC,wCAAuC;CAAK;;AAC9E;EAAkC,0CAAsC;MAAtC,uCAAsC;CAAK;;AAC7E;EAAkC,uCAAiC;MAAjC,kCAAiC;CAAK;;AAExE;EAAgC,qCAA2B;MAA3B,4BAA2B;CAAK;;AAChE;EAAgC,sCAAiC;MAAjC,kCAAiC;CAAK;;AACtE;EAAgC,oCAA+B;MAA/B,gCAA+B;CAAK;;AACpE;EAAgC,uCAA6B;MAA7B,8BAA6B;CAAK;;AAClE;EAAgC,yCAA+B;MAA/B,gCAA+B;CAAK;;AACpE;EAAgC,wCAA8B;MAA9B,+BAA8B;CAAK;;AHenE;EGhDA;IAAgC,mCAA8B;QAA9B,+BAA8B;GAAK;EACnE;IAAgC,sCAAiC;QAAjC,kCAAiC;GAAK;EACtE;IAAgC,2CAAsC;QAAtC,uCAAsC;GAAK;EAC3E;IAAgC,8CAAyC;QAAzC,0CAAyC;GAAK;EAE9E;IAA8B,+BAA0B;QAA1B,2BAA0B;GAAK;EAC7D;IAA8B,iCAA4B;QAA5B,6BAA4B;GAAK;EAC/D;IAA8B,uCAAkC;QAAlC,mCAAkC;GAAK;EAErE;IAAoC,gCAAsC;QAAtC,uCAAsC;GAAK;EAC/E;IAAoC,8BAAoC;QAApC,qCAAoC;GAAK;EAC7E;IAAoC,iCAAkC;QAAlC,mCAAkC;GAAK;EAC3E;IAAoC,kCAAyC;QAAzC,0CAAyC;GAAK;EAClF;IAAoC,qCAAwC;QAAxC,yCAAwC;GAAK;EAEjF;IAAiC,iCAAkC;QAAlC,mCAAkC;GAAK;EACxE;IAAiC,+BAAgC;QAAhC,iCAAgC;GAAK;EACtE;IAAiC,kCAA8B;QAA9B,+BAA8B;GAAK;EACpE;IAAiC,oCAAgC;QAAhC,iCAAgC;GAAK;EACtE;IAAiC,mCAA+B;QAA/B,gCAA+B;GAAK;EAErE;IAAkC,qCAAoC;QAApC,qCAAoC;GAAK;EAC3E;IAAkC,mCAAkC;QAAlC,mCAAkC;GAAK;EACzE;IAAkC,sCAAgC;QAAhC,iCAAgC;GAAK;EACvE;IAAkC,uCAAuC;QAAvC,wCAAuC;GAAK;EAC9E;IAAkC,0CAAsC;QAAtC,uCAAsC;GAAK;EAC7E;IAAkC,uCAAiC;QAAjC,kCAAiC;GAAK;EAExE;IAAgC,qCAA2B;QAA3B,4BAA2B;GAAK;EAChE;IAAgC,sCAAiC;QAAjC,kCAAiC;GAAK;EACtE;IAAgC,oCAA+B;QAA/B,gCAA+B;GAAK;EACpE;IAAgC,uCAA6B;QAA7B,8BAA6B;GAAK;EAClE;IAAgC,yCAA+B;QAA/B,gCAA+B;GAAK;EACpE;IAAgC,wCAA8B;QAA9B,+BAA8B;GAAK;CNsvBtE;;AGvuBG;EGhDA;IAAgC,mCAA8B;QAA9B,+BAA8B;GAAK;EACnE;IAAgC,sCAAiC;QAAjC,kCAAiC;GAAK;EACtE;IAAgC,2CAAsC;QAAtC,uCAAsC;GAAK;EAC3E;IAAgC,8CAAyC;QAAzC,0CAAyC;GAAK;EAE9E;IAA8B,+BAA0B;QAA1B,2BAA0B;GAAK;EAC7D;IAA8B,iCAA4B;QAA5B,6BAA4B;GAAK;EAC/D;IAA8B,uCAAkC;QAAlC,mCAAkC;GAAK;EAErE;IAAoC,gCAAsC;QAAtC,uCAAsC;GAAK;EAC/E;IAAoC,8BAAoC;QAApC,qCAAoC;GAAK;EAC7E;IAAoC,iCAAkC;QAAlC,mCAAkC;GAAK;EAC3E;IAAoC,kCAAyC;QAAzC,0CAAyC;GAAK;EAClF;IAAoC,qCAAwC;QAAxC,yCAAwC;GAAK;EAEjF;IAAiC,iCAAkC;QAAlC,mCAAkC;GAAK;EACxE;IAAiC,+BAAgC;QAAhC,iCAAgC;GAAK;EACtE;IAAiC,kCAA8B;QAA9B,+BAA8B;GAAK;EACpE;IAAiC,oCAAgC;QAAhC,iCAAgC;GAAK;EACtE;IAAiC,mCAA+B;QAA/B,gCAA+B;GAAK;EAErE;IAAkC,qCAAoC;QAApC,qCAAoC;GAAK;EAC3E;IAAkC,mCAAkC;QAAlC,mCAAkC;GAAK;EACzE;IAAkC,sCAAgC;QAAhC,iCAAgC;GAAK;EACvE;IAAkC,uCAAuC;QAAvC,wCAAuC;GAAK;EAC9E;IAAkC,0CAAsC;QAAtC,uCAAsC;GAAK;EAC7E;IAAkC,uCAAiC;QAAjC,kCAAiC;GAAK;EAExE;IAAgC,qCAA2B;QAA3B,4BAA2B;GAAK;EAChE;IAAgC,sCAAiC;QAAjC,kCAAiC;GAAK;EACtE;IAAgC,oCAA+B;QAA/B,gCAA+B;GAAK;EACpE;IAAgC,uCAA6B;QAA7B,8BAA6B;GAAK;EAClE;IAAgC,yCAA+B;QAA/B,gCAA+B;GAAK;EACpE;IAAgC,wCAA8B;QAA9B,+BAA8B;GAAK;CNg1BtE;;AGj0BG;EGhDA;IAAgC,mCAA8B;QAA9B,+BAA8B;GAAK;EACnE;IAAgC,sCAAiC;QAAjC,kCAAiC;GAAK;EACtE;IAAgC,2CAAsC;QAAtC,uCAAsC;GAAK;EAC3E;IAAgC,8CAAyC;QAAzC,0CAAyC;GAAK;EAE9E;IAA8B,+BAA0B;QAA1B,2BAA0B;GAAK;EAC7D;IAA8B,iCAA4B;QAA5B,6BAA4B;GAAK;EAC/D;IAA8B,uCAAkC;QAAlC,mCAAkC;GAAK;EAErE;IAAoC,gCAAsC;QAAtC,uCAAsC;GAAK;EAC/E;IAAoC,8BAAoC;QAApC,qCAAoC;GAAK;EAC7E;IAAoC,iCAAkC;QAAlC,mCAAkC;GAAK;EAC3E;IAAoC,kCAAyC;QAAzC,0CAAyC;GAAK;EAClF;IAAoC,qCAAwC;QAAxC,yCAAwC;GAAK;EAEjF;IAAiC,iCAAkC;QAAlC,mCAAkC;GAAK;EACxE;IAAiC,+BAAgC;QAAhC,iCAAgC;GAAK;EACtE;IAAiC,kCAA8B;QAA9B,+BAA8B;GAAK;EACpE;IAAiC,oCAAgC;QAAhC,iCAAgC;GAAK;EACtE;IAAiC,mCAA+B;QAA/B,gCAA+B;GAAK;EAErE;IAAkC,qCAAoC;QAApC,qCAAoC;GAAK;EAC3E;IAAkC,mCAAkC;QAAlC,mCAAkC;GAAK;EACzE;IAAkC,sCAAgC;QAAhC,iCAAgC;GAAK;EACvE;IAAkC,uCAAuC;QAAvC,wCAAuC;GAAK;EAC9E;IAAkC,0CAAsC;QAAtC,uCAAsC;GAAK;EAC7E;IAAkC,uCAAiC;QAAjC,kCAAiC;GAAK;EAExE;IAAgC,qCAA2B;QAA3B,4BAA2B;GAAK;EAChE;IAAgC,sCAAiC;QAAjC,kCAAiC;GAAK;EACtE;IAAgC,oCAA+B;QAA/B,gCAA+B;GAAK;EACpE;IAAgC,uCAA6B;QAA7B,8BAA6B;GAAK;EAClE;IAAgC,yCAA+B;QAA/B,gCAA+B;GAAK;EACpE;IAAgC,wCAA8B;QAA9B,+BAA8B;GAAK;CN06BtE;;AG35BG;EGhDA;IAAgC,mCAA8B;QAA9B,+BAA8B;GAAK;EACnE;IAAgC,sCAAiC;QAAjC,kCAAiC;GAAK;EACtE;IAAgC,2CAAsC;QAAtC,uCAAsC;GAAK;EAC3E;IAAgC,8CAAyC;QAAzC,0CAAyC;GAAK;EAE9E;IAA8B,+BAA0B;QAA1B,2BAA0B;GAAK;EAC7D;IAA8B,iCAA4B;QAA5B,6BAA4B;GAAK;EAC/D;IAA8B,uCAAkC;QAAlC,mCAAkC;GAAK;EAErE;IAAoC,gCAAsC;QAAtC,uCAAsC;GAAK;EAC/E;IAAoC,8BAAoC;QAApC,qCAAoC;GAAK;EAC7E;IAAoC,iCAAkC;QAAlC,mCAAkC;GAAK;EAC3E;IAAoC,kCAAyC;QAAzC,0CAAyC;GAAK;EAClF;IAAoC,qCAAwC;QAAxC,yCAAwC;GAAK;EAEjF;IAAiC,iCAAkC;QAAlC,mCAAkC;GAAK;EACxE;IAAiC,+BAAgC;QAAhC,iCAAgC;GAAK;EACtE;IAAiC,kCAA8B;QAA9B,+BAA8B;GAAK;EACpE;IAAiC,oCAAgC;QAAhC,iCAAgC;GAAK;EACtE;IAAiC,mCAA+B;QAA/B,gCAA+B;GAAK;EAErE;IAAkC,qCAAoC;QAApC,qCAAoC;GAAK;EAC3E;IAAkC,mCAAkC;QAAlC,mCAAkC;GAAK;EACzE;IAAkC,sCAAgC;QAAhC,iCAAgC;GAAK;EACvE;IAAkC,uCAAuC;QAAvC,wCAAuC;GAAK;EAC9E;IAAkC,0CAAsC;QAAtC,uCAAsC;GAAK;EAC7E;IAAkC,uCAAiC;QAAjC,kCAAiC;GAAK;EAExE;IAAgC,qCAA2B;QAA3B,4BAA2B;GAAK;EAChE;IAAgC,sCAAiC;QAAjC,kCAAiC;GAAK;EACtE;IAAgC,oCAA+B;QAA/B,gCAA+B;GAAK;EACpE;IAAgC,uCAA6B;QAA7B,8BAA6B;GAAK;EAClE;IAAgC,yCAA+B;QAA/B,gCAA+B;GAAK;EACpE;IAAgC,wCAA8B;QAA9B,+BAA8B;GAAK;CNogCtE","file":"bootstrap-grid.css","sourcesContent":["// Bootstrap Grid only\n//\n// Includes relevant variables and mixins for the flexbox grid\n// system, as well as the generated predefined classes (e.g., `.col-sm-4`).\n\n//\n// Box sizing, responsive, and more\n//\n\n@at-root {\n @-ms-viewport { width: device-width; }\n}\n\nhtml {\n box-sizing: border-box;\n -ms-overflow-style: scrollbar;\n}\n\n*,\n*::before,\n*::after {\n box-sizing: inherit;\n}\n\n@import \"functions\";\n@import \"variables\";\n\n//\n// Grid mixins\n//\n\n@import \"mixins/breakpoints\";\n@import \"mixins/grid-framework\";\n@import \"mixins/grid\";\n\n@import \"grid\";\n@import \"utilities/flex\";\n","@-ms-viewport {\n width: device-width;\n}\n\nhtml {\n box-sizing: border-box;\n -ms-overflow-style: scrollbar;\n}\n\n*,\n*::before,\n*::after {\n box-sizing: inherit;\n}\n\n.container {\n margin-right: auto;\n margin-left: auto;\n padding-right: 15px;\n padding-left: 15px;\n width: 100%;\n}\n\n@media (min-width: 576px) {\n .container {\n max-width: 540px;\n }\n}\n\n@media (min-width: 768px) {\n .container {\n max-width: 720px;\n }\n}\n\n@media (min-width: 992px) {\n .container {\n max-width: 960px;\n }\n}\n\n@media (min-width: 1200px) {\n .container {\n max-width: 1140px;\n }\n}\n\n.container-fluid {\n width: 100%;\n margin-right: auto;\n margin-left: auto;\n padding-right: 15px;\n padding-left: 15px;\n width: 100%;\n}\n\n.row {\n display: flex;\n flex-wrap: wrap;\n margin-right: -15px;\n margin-left: -15px;\n}\n\n.no-gutters {\n margin-right: 0;\n margin-left: 0;\n}\n\n.no-gutters > .col,\n.no-gutters > [class*=\"col-\"] {\n padding-right: 0;\n padding-left: 0;\n}\n\n.col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12, .col,\n.col-auto, .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm,\n.col-sm-auto, .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12, .col-md,\n.col-md-auto, .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg,\n.col-lg-auto, .col-xl-1, .col-xl-2, .col-xl-3, .col-xl-4, .col-xl-5, .col-xl-6, .col-xl-7, .col-xl-8, .col-xl-9, .col-xl-10, .col-xl-11, .col-xl-12, .col-xl,\n.col-xl-auto {\n position: relative;\n width: 100%;\n min-height: 1px;\n padding-right: 15px;\n padding-left: 15px;\n}\n\n.col {\n flex-basis: 0;\n flex-grow: 1;\n max-width: 100%;\n}\n\n.col-auto {\n flex: 0 0 auto;\n width: auto;\n max-width: none;\n}\n\n.col-1 {\n flex: 0 0 8.333333%;\n max-width: 8.333333%;\n}\n\n.col-2 {\n flex: 0 0 16.666667%;\n max-width: 16.666667%;\n}\n\n.col-3 {\n flex: 0 0 25%;\n max-width: 25%;\n}\n\n.col-4 {\n flex: 0 0 33.333333%;\n max-width: 33.333333%;\n}\n\n.col-5 {\n flex: 0 0 41.666667%;\n max-width: 41.666667%;\n}\n\n.col-6 {\n flex: 0 0 50%;\n max-width: 50%;\n}\n\n.col-7 {\n flex: 0 0 58.333333%;\n max-width: 58.333333%;\n}\n\n.col-8 {\n flex: 0 0 66.666667%;\n max-width: 66.666667%;\n}\n\n.col-9 {\n flex: 0 0 75%;\n max-width: 75%;\n}\n\n.col-10 {\n flex: 0 0 83.333333%;\n max-width: 83.333333%;\n}\n\n.col-11 {\n flex: 0 0 91.666667%;\n max-width: 91.666667%;\n}\n\n.col-12 {\n flex: 0 0 100%;\n max-width: 100%;\n}\n\n.order-1 {\n order: 1;\n}\n\n.order-2 {\n order: 2;\n}\n\n.order-3 {\n order: 3;\n}\n\n.order-4 {\n order: 4;\n}\n\n.order-5 {\n order: 5;\n}\n\n.order-6 {\n order: 6;\n}\n\n.order-7 {\n order: 7;\n}\n\n.order-8 {\n order: 8;\n}\n\n.order-9 {\n order: 9;\n}\n\n.order-10 {\n order: 10;\n}\n\n.order-11 {\n order: 11;\n}\n\n.order-12 {\n order: 12;\n}\n\n@media (min-width: 576px) {\n .col-sm {\n flex-basis: 0;\n flex-grow: 1;\n max-width: 100%;\n }\n .col-sm-auto {\n flex: 0 0 auto;\n width: auto;\n max-width: none;\n }\n .col-sm-1 {\n flex: 0 0 8.333333%;\n max-width: 8.333333%;\n }\n .col-sm-2 {\n flex: 0 0 16.666667%;\n max-width: 16.666667%;\n }\n .col-sm-3 {\n flex: 0 0 25%;\n max-width: 25%;\n }\n .col-sm-4 {\n flex: 0 0 33.333333%;\n max-width: 33.333333%;\n }\n .col-sm-5 {\n flex: 0 0 41.666667%;\n max-width: 41.666667%;\n }\n .col-sm-6 {\n flex: 0 0 50%;\n max-width: 50%;\n }\n .col-sm-7 {\n flex: 0 0 58.333333%;\n max-width: 58.333333%;\n }\n .col-sm-8 {\n flex: 0 0 66.666667%;\n max-width: 66.666667%;\n }\n .col-sm-9 {\n flex: 0 0 75%;\n max-width: 75%;\n }\n .col-sm-10 {\n flex: 0 0 83.333333%;\n max-width: 83.333333%;\n }\n .col-sm-11 {\n flex: 0 0 91.666667%;\n max-width: 91.666667%;\n }\n .col-sm-12 {\n flex: 0 0 100%;\n max-width: 100%;\n }\n .order-sm-1 {\n order: 1;\n }\n .order-sm-2 {\n order: 2;\n }\n .order-sm-3 {\n order: 3;\n }\n .order-sm-4 {\n order: 4;\n }\n .order-sm-5 {\n order: 5;\n }\n .order-sm-6 {\n order: 6;\n }\n .order-sm-7 {\n order: 7;\n }\n .order-sm-8 {\n order: 8;\n }\n .order-sm-9 {\n order: 9;\n }\n .order-sm-10 {\n order: 10;\n }\n .order-sm-11 {\n order: 11;\n }\n .order-sm-12 {\n order: 12;\n }\n}\n\n@media (min-width: 768px) {\n .col-md {\n flex-basis: 0;\n flex-grow: 1;\n max-width: 100%;\n }\n .col-md-auto {\n flex: 0 0 auto;\n width: auto;\n max-width: none;\n }\n .col-md-1 {\n flex: 0 0 8.333333%;\n max-width: 8.333333%;\n }\n .col-md-2 {\n flex: 0 0 16.666667%;\n max-width: 16.666667%;\n }\n .col-md-3 {\n flex: 0 0 25%;\n max-width: 25%;\n }\n .col-md-4 {\n flex: 0 0 33.333333%;\n max-width: 33.333333%;\n }\n .col-md-5 {\n flex: 0 0 41.666667%;\n max-width: 41.666667%;\n }\n .col-md-6 {\n flex: 0 0 50%;\n max-width: 50%;\n }\n .col-md-7 {\n flex: 0 0 58.333333%;\n max-width: 58.333333%;\n }\n .col-md-8 {\n flex: 0 0 66.666667%;\n max-width: 66.666667%;\n }\n .col-md-9 {\n flex: 0 0 75%;\n max-width: 75%;\n }\n .col-md-10 {\n flex: 0 0 83.333333%;\n max-width: 83.333333%;\n }\n .col-md-11 {\n flex: 0 0 91.666667%;\n max-width: 91.666667%;\n }\n .col-md-12 {\n flex: 0 0 100%;\n max-width: 100%;\n }\n .order-md-1 {\n order: 1;\n }\n .order-md-2 {\n order: 2;\n }\n .order-md-3 {\n order: 3;\n }\n .order-md-4 {\n order: 4;\n }\n .order-md-5 {\n order: 5;\n }\n .order-md-6 {\n order: 6;\n }\n .order-md-7 {\n order: 7;\n }\n .order-md-8 {\n order: 8;\n }\n .order-md-9 {\n order: 9;\n }\n .order-md-10 {\n order: 10;\n }\n .order-md-11 {\n order: 11;\n }\n .order-md-12 {\n order: 12;\n }\n}\n\n@media (min-width: 992px) {\n .col-lg {\n flex-basis: 0;\n flex-grow: 1;\n max-width: 100%;\n }\n .col-lg-auto {\n flex: 0 0 auto;\n width: auto;\n max-width: none;\n }\n .col-lg-1 {\n flex: 0 0 8.333333%;\n max-width: 8.333333%;\n }\n .col-lg-2 {\n flex: 0 0 16.666667%;\n max-width: 16.666667%;\n }\n .col-lg-3 {\n flex: 0 0 25%;\n max-width: 25%;\n }\n .col-lg-4 {\n flex: 0 0 33.333333%;\n max-width: 33.333333%;\n }\n .col-lg-5 {\n flex: 0 0 41.666667%;\n max-width: 41.666667%;\n }\n .col-lg-6 {\n flex: 0 0 50%;\n max-width: 50%;\n }\n .col-lg-7 {\n flex: 0 0 58.333333%;\n max-width: 58.333333%;\n }\n .col-lg-8 {\n flex: 0 0 66.666667%;\n max-width: 66.666667%;\n }\n .col-lg-9 {\n flex: 0 0 75%;\n max-width: 75%;\n }\n .col-lg-10 {\n flex: 0 0 83.333333%;\n max-width: 83.333333%;\n }\n .col-lg-11 {\n flex: 0 0 91.666667%;\n max-width: 91.666667%;\n }\n .col-lg-12 {\n flex: 0 0 100%;\n max-width: 100%;\n }\n .order-lg-1 {\n order: 1;\n }\n .order-lg-2 {\n order: 2;\n }\n .order-lg-3 {\n order: 3;\n }\n .order-lg-4 {\n order: 4;\n }\n .order-lg-5 {\n order: 5;\n }\n .order-lg-6 {\n order: 6;\n }\n .order-lg-7 {\n order: 7;\n }\n .order-lg-8 {\n order: 8;\n }\n .order-lg-9 {\n order: 9;\n }\n .order-lg-10 {\n order: 10;\n }\n .order-lg-11 {\n order: 11;\n }\n .order-lg-12 {\n order: 12;\n }\n}\n\n@media (min-width: 1200px) {\n .col-xl {\n flex-basis: 0;\n flex-grow: 1;\n max-width: 100%;\n }\n .col-xl-auto {\n flex: 0 0 auto;\n width: auto;\n max-width: none;\n }\n .col-xl-1 {\n flex: 0 0 8.333333%;\n max-width: 8.333333%;\n }\n .col-xl-2 {\n flex: 0 0 16.666667%;\n max-width: 16.666667%;\n }\n .col-xl-3 {\n flex: 0 0 25%;\n max-width: 25%;\n }\n .col-xl-4 {\n flex: 0 0 33.333333%;\n max-width: 33.333333%;\n }\n .col-xl-5 {\n flex: 0 0 41.666667%;\n max-width: 41.666667%;\n }\n .col-xl-6 {\n flex: 0 0 50%;\n max-width: 50%;\n }\n .col-xl-7 {\n flex: 0 0 58.333333%;\n max-width: 58.333333%;\n }\n .col-xl-8 {\n flex: 0 0 66.666667%;\n max-width: 66.666667%;\n }\n .col-xl-9 {\n flex: 0 0 75%;\n max-width: 75%;\n }\n .col-xl-10 {\n flex: 0 0 83.333333%;\n max-width: 83.333333%;\n }\n .col-xl-11 {\n flex: 0 0 91.666667%;\n max-width: 91.666667%;\n }\n .col-xl-12 {\n flex: 0 0 100%;\n max-width: 100%;\n }\n .order-xl-1 {\n order: 1;\n }\n .order-xl-2 {\n order: 2;\n }\n .order-xl-3 {\n order: 3;\n }\n .order-xl-4 {\n order: 4;\n }\n .order-xl-5 {\n order: 5;\n }\n .order-xl-6 {\n order: 6;\n }\n .order-xl-7 {\n order: 7;\n }\n .order-xl-8 {\n order: 8;\n }\n .order-xl-9 {\n order: 9;\n }\n .order-xl-10 {\n order: 10;\n }\n .order-xl-11 {\n order: 11;\n }\n .order-xl-12 {\n order: 12;\n }\n}\n\n.flex-row {\n flex-direction: row !important;\n}\n\n.flex-column {\n flex-direction: column !important;\n}\n\n.flex-row-reverse {\n flex-direction: row-reverse !important;\n}\n\n.flex-column-reverse {\n flex-direction: column-reverse !important;\n}\n\n.flex-wrap {\n flex-wrap: wrap !important;\n}\n\n.flex-nowrap {\n flex-wrap: nowrap !important;\n}\n\n.flex-wrap-reverse {\n flex-wrap: wrap-reverse !important;\n}\n\n.justify-content-start {\n justify-content: flex-start !important;\n}\n\n.justify-content-end {\n justify-content: flex-end !important;\n}\n\n.justify-content-center {\n justify-content: center !important;\n}\n\n.justify-content-between {\n justify-content: space-between !important;\n}\n\n.justify-content-around {\n justify-content: space-around !important;\n}\n\n.align-items-start {\n align-items: flex-start !important;\n}\n\n.align-items-end {\n align-items: flex-end !important;\n}\n\n.align-items-center {\n align-items: center !important;\n}\n\n.align-items-baseline {\n align-items: baseline !important;\n}\n\n.align-items-stretch {\n align-items: stretch !important;\n}\n\n.align-content-start {\n align-content: flex-start !important;\n}\n\n.align-content-end {\n align-content: flex-end !important;\n}\n\n.align-content-center {\n align-content: center !important;\n}\n\n.align-content-between {\n align-content: space-between !important;\n}\n\n.align-content-around {\n align-content: space-around !important;\n}\n\n.align-content-stretch {\n align-content: stretch !important;\n}\n\n.align-self-auto {\n align-self: auto !important;\n}\n\n.align-self-start {\n align-self: flex-start !important;\n}\n\n.align-self-end {\n align-self: flex-end !important;\n}\n\n.align-self-center {\n align-self: center !important;\n}\n\n.align-self-baseline {\n align-self: baseline !important;\n}\n\n.align-self-stretch {\n align-self: stretch !important;\n}\n\n@media (min-width: 576px) {\n .flex-sm-row {\n flex-direction: row !important;\n }\n .flex-sm-column {\n flex-direction: column !important;\n }\n .flex-sm-row-reverse {\n flex-direction: row-reverse !important;\n }\n .flex-sm-column-reverse {\n flex-direction: column-reverse !important;\n }\n .flex-sm-wrap {\n flex-wrap: wrap !important;\n }\n .flex-sm-nowrap {\n flex-wrap: nowrap !important;\n }\n .flex-sm-wrap-reverse {\n flex-wrap: wrap-reverse !important;\n }\n .justify-content-sm-start {\n justify-content: flex-start !important;\n }\n .justify-content-sm-end {\n justify-content: flex-end !important;\n }\n .justify-content-sm-center {\n justify-content: center !important;\n }\n .justify-content-sm-between {\n justify-content: space-between !important;\n }\n .justify-content-sm-around {\n justify-content: space-around !important;\n }\n .align-items-sm-start {\n align-items: flex-start !important;\n }\n .align-items-sm-end {\n align-items: flex-end !important;\n }\n .align-items-sm-center {\n align-items: center !important;\n }\n .align-items-sm-baseline {\n align-items: baseline !important;\n }\n .align-items-sm-stretch {\n align-items: stretch !important;\n }\n .align-content-sm-start {\n align-content: flex-start !important;\n }\n .align-content-sm-end {\n align-content: flex-end !important;\n }\n .align-content-sm-center {\n align-content: center !important;\n }\n .align-content-sm-between {\n align-content: space-between !important;\n }\n .align-content-sm-around {\n align-content: space-around !important;\n }\n .align-content-sm-stretch {\n align-content: stretch !important;\n }\n .align-self-sm-auto {\n align-self: auto !important;\n }\n .align-self-sm-start {\n align-self: flex-start !important;\n }\n .align-self-sm-end {\n align-self: flex-end !important;\n }\n .align-self-sm-center {\n align-self: center !important;\n }\n .align-self-sm-baseline {\n align-self: baseline !important;\n }\n .align-self-sm-stretch {\n align-self: stretch !important;\n }\n}\n\n@media (min-width: 768px) {\n .flex-md-row {\n flex-direction: row !important;\n }\n .flex-md-column {\n flex-direction: column !important;\n }\n .flex-md-row-reverse {\n flex-direction: row-reverse !important;\n }\n .flex-md-column-reverse {\n flex-direction: column-reverse !important;\n }\n .flex-md-wrap {\n flex-wrap: wrap !important;\n }\n .flex-md-nowrap {\n flex-wrap: nowrap !important;\n }\n .flex-md-wrap-reverse {\n flex-wrap: wrap-reverse !important;\n }\n .justify-content-md-start {\n justify-content: flex-start !important;\n }\n .justify-content-md-end {\n justify-content: flex-end !important;\n }\n .justify-content-md-center {\n justify-content: center !important;\n }\n .justify-content-md-between {\n justify-content: space-between !important;\n }\n .justify-content-md-around {\n justify-content: space-around !important;\n }\n .align-items-md-start {\n align-items: flex-start !important;\n }\n .align-items-md-end {\n align-items: flex-end !important;\n }\n .align-items-md-center {\n align-items: center !important;\n }\n .align-items-md-baseline {\n align-items: baseline !important;\n }\n .align-items-md-stretch {\n align-items: stretch !important;\n }\n .align-content-md-start {\n align-content: flex-start !important;\n }\n .align-content-md-end {\n align-content: flex-end !important;\n }\n .align-content-md-center {\n align-content: center !important;\n }\n .align-content-md-between {\n align-content: space-between !important;\n }\n .align-content-md-around {\n align-content: space-around !important;\n }\n .align-content-md-stretch {\n align-content: stretch !important;\n }\n .align-self-md-auto {\n align-self: auto !important;\n }\n .align-self-md-start {\n align-self: flex-start !important;\n }\n .align-self-md-end {\n align-self: flex-end !important;\n }\n .align-self-md-center {\n align-self: center !important;\n }\n .align-self-md-baseline {\n align-self: baseline !important;\n }\n .align-self-md-stretch {\n align-self: stretch !important;\n }\n}\n\n@media (min-width: 992px) {\n .flex-lg-row {\n flex-direction: row !important;\n }\n .flex-lg-column {\n flex-direction: column !important;\n }\n .flex-lg-row-reverse {\n flex-direction: row-reverse !important;\n }\n .flex-lg-column-reverse {\n flex-direction: column-reverse !important;\n }\n .flex-lg-wrap {\n flex-wrap: wrap !important;\n }\n .flex-lg-nowrap {\n flex-wrap: nowrap !important;\n }\n .flex-lg-wrap-reverse {\n flex-wrap: wrap-reverse !important;\n }\n .justify-content-lg-start {\n justify-content: flex-start !important;\n }\n .justify-content-lg-end {\n justify-content: flex-end !important;\n }\n .justify-content-lg-center {\n justify-content: center !important;\n }\n .justify-content-lg-between {\n justify-content: space-between !important;\n }\n .justify-content-lg-around {\n justify-content: space-around !important;\n }\n .align-items-lg-start {\n align-items: flex-start !important;\n }\n .align-items-lg-end {\n align-items: flex-end !important;\n }\n .align-items-lg-center {\n align-items: center !important;\n }\n .align-items-lg-baseline {\n align-items: baseline !important;\n }\n .align-items-lg-stretch {\n align-items: stretch !important;\n }\n .align-content-lg-start {\n align-content: flex-start !important;\n }\n .align-content-lg-end {\n align-content: flex-end !important;\n }\n .align-content-lg-center {\n align-content: center !important;\n }\n .align-content-lg-between {\n align-content: space-between !important;\n }\n .align-content-lg-around {\n align-content: space-around !important;\n }\n .align-content-lg-stretch {\n align-content: stretch !important;\n }\n .align-self-lg-auto {\n align-self: auto !important;\n }\n .align-self-lg-start {\n align-self: flex-start !important;\n }\n .align-self-lg-end {\n align-self: flex-end !important;\n }\n .align-self-lg-center {\n align-self: center !important;\n }\n .align-self-lg-baseline {\n align-self: baseline !important;\n }\n .align-self-lg-stretch {\n align-self: stretch !important;\n }\n}\n\n@media (min-width: 1200px) {\n .flex-xl-row {\n flex-direction: row !important;\n }\n .flex-xl-column {\n flex-direction: column !important;\n }\n .flex-xl-row-reverse {\n flex-direction: row-reverse !important;\n }\n .flex-xl-column-reverse {\n flex-direction: column-reverse !important;\n }\n .flex-xl-wrap {\n flex-wrap: wrap !important;\n }\n .flex-xl-nowrap {\n flex-wrap: nowrap !important;\n }\n .flex-xl-wrap-reverse {\n flex-wrap: wrap-reverse !important;\n }\n .justify-content-xl-start {\n justify-content: flex-start !important;\n }\n .justify-content-xl-end {\n justify-content: flex-end !important;\n }\n .justify-content-xl-center {\n justify-content: center !important;\n }\n .justify-content-xl-between {\n justify-content: space-between !important;\n }\n .justify-content-xl-around {\n justify-content: space-around !important;\n }\n .align-items-xl-start {\n align-items: flex-start !important;\n }\n .align-items-xl-end {\n align-items: flex-end !important;\n }\n .align-items-xl-center {\n align-items: center !important;\n }\n .align-items-xl-baseline {\n align-items: baseline !important;\n }\n .align-items-xl-stretch {\n align-items: stretch !important;\n }\n .align-content-xl-start {\n align-content: flex-start !important;\n }\n .align-content-xl-end {\n align-content: flex-end !important;\n }\n .align-content-xl-center {\n align-content: center !important;\n }\n .align-content-xl-between {\n align-content: space-between !important;\n }\n .align-content-xl-around {\n align-content: space-around !important;\n }\n .align-content-xl-stretch {\n align-content: stretch !important;\n }\n .align-self-xl-auto {\n align-self: auto !important;\n }\n .align-self-xl-start {\n align-self: flex-start !important;\n }\n .align-self-xl-end {\n align-self: flex-end !important;\n }\n .align-self-xl-center {\n align-self: center !important;\n }\n .align-self-xl-baseline {\n align-self: baseline !important;\n }\n .align-self-xl-stretch {\n align-self: stretch !important;\n }\n}\n\n/*# sourceMappingURL=bootstrap-grid.css.map */","// Container widths\n//\n// Set the container width, and override it for fixed navbars in media queries.\n\n@if $enable-grid-classes {\n .container {\n @include make-container();\n @include make-container-max-widths();\n }\n}\n\n// Fluid container\n//\n// Utilizes the mixin meant for fixed width containers, but with 100% width for\n// fluid, full width layouts.\n\n@if $enable-grid-classes {\n .container-fluid {\n width: 100%;\n @include make-container();\n }\n}\n\n// Row\n//\n// Rows contain and clear the floats of your columns.\n\n@if $enable-grid-classes {\n .row {\n @include make-row();\n }\n\n // Remove the negative margin from default .row, then the horizontal padding\n // from all immediate children columns (to prevent runaway style inheritance).\n .no-gutters {\n margin-right: 0;\n margin-left: 0;\n\n > .col,\n > [class*=\"col-\"] {\n padding-right: 0;\n padding-left: 0;\n }\n }\n}\n\n// Columns\n//\n// Common styles for small and large grid columns\n\n@if $enable-grid-classes {\n @include make-grid-columns();\n}\n","/// Grid system\n//\n// Generate semantic grid columns with these mixins.\n\n@mixin make-container() {\n margin-right: auto;\n margin-left: auto;\n padding-right: ($grid-gutter-width / 2);\n padding-left: ($grid-gutter-width / 2);\n width: 100%;\n}\n\n\n// For each breakpoint, define the maximum width of the container in a media query\n@mixin make-container-max-widths($max-widths: $container-max-widths, $breakpoints: $grid-breakpoints) {\n @each $breakpoint, $container-max-width in $max-widths {\n @include media-breakpoint-up($breakpoint, $breakpoints) {\n max-width: $container-max-width;\n }\n }\n}\n\n@mixin make-row() {\n display: flex;\n flex-wrap: wrap;\n margin-right: ($grid-gutter-width / -2);\n margin-left: ($grid-gutter-width / -2);\n}\n\n@mixin make-col-ready() {\n position: relative;\n // Prevent columns from becoming too narrow when at smaller grid tiers by\n // always setting `width: 100%;`. This works because we use `flex` values\n // later on to override this initial width.\n width: 100%;\n min-height: 1px; // Prevent collapsing\n padding-right: ($grid-gutter-width / 2);\n padding-left: ($grid-gutter-width / 2);\n}\n\n@mixin make-col($size, $columns: $grid-columns) {\n flex: 0 0 percentage($size / $columns);\n // Add a `max-width` to ensure content within each column does not blow out\n // the width of the column. Applies to IE10+ and Firefox. Chrome and Safari\n // do not appear to require this.\n max-width: percentage($size / $columns);\n}\n","// Breakpoint viewport sizes and media queries.\n//\n// Breakpoints are defined as a map of (name: minimum width), order from small to large:\n//\n// (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px)\n//\n// The map defined in the `$grid-breakpoints` global variable is used as the `$breakpoints` argument by default.\n\n// Name of the next breakpoint, or null for the last breakpoint.\n//\n// >> breakpoint-next(sm)\n// md\n// >> breakpoint-next(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n// md\n// >> breakpoint-next(sm, $breakpoint-names: (xs sm md lg xl))\n// md\n@function breakpoint-next($name, $breakpoints: $grid-breakpoints, $breakpoint-names: map-keys($breakpoints)) {\n $n: index($breakpoint-names, $name);\n @return if($n < length($breakpoint-names), nth($breakpoint-names, $n + 1), null);\n}\n\n// Minimum breakpoint width. Null for the smallest (first) breakpoint.\n//\n// >> breakpoint-min(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n// 576px\n@function breakpoint-min($name, $breakpoints: $grid-breakpoints) {\n $min: map-get($breakpoints, $name);\n @return if($min != 0, $min, null);\n}\n\n// Maximum breakpoint width. Null for the largest (last) breakpoint.\n// The maximum value is calculated as the minimum of the next one less 0.1.\n//\n// >> breakpoint-max(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n// 767px\n@function breakpoint-max($name, $breakpoints: $grid-breakpoints) {\n $next: breakpoint-next($name, $breakpoints);\n @return if($next, breakpoint-min($next, $breakpoints) - 1px, null);\n}\n\n// Returns a blank string if smallest breakpoint, otherwise returns the name with a dash infront.\n// Useful for making responsive utilities.\n//\n// >> breakpoint-infix(xs, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n// \"\" (Returns a blank string)\n// >> breakpoint-infix(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n// \"-sm\"\n@function breakpoint-infix($name, $breakpoints: $grid-breakpoints) {\n @return if(breakpoint-min($name, $breakpoints) == null, \"\", \"-#{$name}\");\n}\n\n// Media of at least the minimum breakpoint width. No query for the smallest breakpoint.\n// Makes the @content apply to the given breakpoint and wider.\n@mixin media-breakpoint-up($name, $breakpoints: $grid-breakpoints) {\n $min: breakpoint-min($name, $breakpoints);\n @if $min {\n @media (min-width: $min) {\n @content;\n }\n } @else {\n @content;\n }\n}\n\n// Media of at most the maximum breakpoint width. No query for the largest breakpoint.\n// Makes the @content apply to the given breakpoint and narrower.\n@mixin media-breakpoint-down($name, $breakpoints: $grid-breakpoints) {\n $max: breakpoint-max($name, $breakpoints);\n @if $max {\n @media (max-width: $max) {\n @content;\n }\n } @else {\n @content;\n }\n}\n\n// Media that spans multiple breakpoint widths.\n// Makes the @content apply between the min and max breakpoints\n@mixin media-breakpoint-between($lower, $upper, $breakpoints: $grid-breakpoints) {\n $min: breakpoint-min($lower, $breakpoints);\n $max: breakpoint-max($upper, $breakpoints);\n\n @media (min-width: $min) and (max-width: $max) {\n @content;\n }\n}\n\n// Media between the breakpoint's minimum and maximum widths.\n// No minimum for the smallest breakpoint, and no maximum for the largest one.\n// Makes the @content apply only to the given breakpoint, not viewports any wider or narrower.\n@mixin media-breakpoint-only($name, $breakpoints: $grid-breakpoints) {\n $min: breakpoint-min($name, $breakpoints);\n $max: breakpoint-max($name, $breakpoints);\n\n @if $min != null and $max != null {\n @media (min-width: $min) and (max-width: $max) {\n @content;\n }\n } @else if $max == null {\n @include media-breakpoint-up($name)\n } @else if $min == null {\n @include media-breakpoint-down($name)\n }\n}\n","// Variables\n//\n// Copy settings from this file into the provided `_custom.scss` to override\n// the Bootstrap defaults without modifying key, versioned files.\n//\n// Variables should follow the `$component-state-property-size` formula for\n// consistent naming. Ex: $nav-link-disabled-color and $modal-content-box-shadow-xs.\n\n// Table of Contents\n//\n// Color system\n// Options\n// Spacing\n// Body\n// Links\n// Grid breakpoints\n// Grid containers\n// Grid columns\n// Fonts\n// Components\n// Tables\n// Buttons\n// Forms\n// Dropdowns\n// Z-index master list\n// Navs\n// Navbar\n// Pagination\n// Jumbotron\n// Form states and alerts\n// Cards\n// Tooltips\n// Popovers\n// Badges\n// Modals\n// Alerts\n// Progress bars\n// List group\n// Image thumbnails\n// Figures\n// Breadcrumbs\n// Carousel\n// Close\n// Code\n\n\n//\n// Color system\n//\n\n$white: #fff !default;\n$gray-100: #f8f9fa !default;\n$gray-200: #e9ecef !default;\n$gray-300: #dee2e6 !default;\n$gray-400: #ced4da !default;\n$gray-500: #adb5bd !default;\n$gray-600: #868e96 !default;\n$gray-700: #495057 !default;\n$gray-800: #343a40 !default;\n$gray-900: #212529 !default;\n$black: #000 !default;\n\n$grays: (\n 100: $gray-100,\n 200: $gray-200,\n 300: $gray-300,\n 400: $gray-400,\n 500: $gray-500,\n 600: $gray-600,\n 700: $gray-700,\n 800: $gray-800,\n 900: $gray-900\n) !default;\n\n$blue: #007bff !default;\n$indigo: #6610f2 !default;\n$purple: #6f42c1 !default;\n$pink: #e83e8c !default;\n$red: #dc3545 !default;\n$orange: #fd7e14 !default;\n$yellow: #ffc107 !default;\n$green: #28a745 !default;\n$teal: #20c997 !default;\n$cyan: #17a2b8 !default;\n\n$colors: (\n blue: $blue,\n indigo: $indigo,\n purple: $purple,\n pink: $pink,\n red: $red,\n orange: $orange,\n yellow: $yellow,\n green: $green,\n teal: $teal,\n cyan: $cyan,\n white: $white,\n gray: $gray-600,\n gray-dark: $gray-800\n) !default;\n\n$theme-colors: (\n primary: $blue,\n secondary: $gray-600,\n success: $green,\n info: $cyan,\n warning: $yellow,\n danger: $red,\n light: $gray-100,\n dark: $gray-800\n) !default;\n\n// Set a specific jump point for requesting color jumps\n$theme-color-interval: 8% !default;\n\n\n// Options\n//\n// Quickly modify global styling by enabling or disabling optional features.\n\n$enable-rounded: true !default;\n$enable-shadows: false !default;\n$enable-gradients: false !default;\n$enable-transitions: true !default;\n$enable-hover-media-query: false !default;\n$enable-grid-classes: true !default;\n$enable-print-styles: true !default;\n\n\n// Spacing\n//\n// Control the default styling of most Bootstrap elements by modifying these\n// variables. Mostly focused on spacing.\n// You can add more entries to the $spacers map, should you need more variation.\n\n$spacer: 1rem !default;\n$spacers: (\n 0: 0,\n 1: ($spacer * .25),\n 2: ($spacer * .5),\n 3: $spacer,\n 4: ($spacer * 1.5),\n 5: ($spacer * 3)\n) !default;\n\n// This variable affects the `.h-*` and `.w-*` classes.\n$sizes: (\n 25: 25%,\n 50: 50%,\n 75: 75%,\n 100: 100%\n) !default;\n\n// Body\n//\n// Settings for the `` element.\n\n$body-bg: $white !default;\n$body-color: $gray-900 !default;\n\n// Links\n//\n// Style anchor elements.\n\n$link-color: theme-color(\"primary\") !default;\n$link-decoration: none !default;\n$link-hover-color: darken($link-color, 15%) !default;\n$link-hover-decoration: underline !default;\n\n\n// Grid breakpoints\n//\n// Define the minimum dimensions at which your layout will change,\n// adapting to different screen sizes, for use in media queries.\n\n$grid-breakpoints: (\n xs: 0,\n sm: 576px,\n md: 768px,\n lg: 992px,\n xl: 1200px\n) !default;\n@include _assert-ascending($grid-breakpoints, \"$grid-breakpoints\");\n@include _assert-starts-at-zero($grid-breakpoints);\n\n\n// Grid containers\n//\n// Define the maximum width of `.container` for different screen sizes.\n\n$container-max-widths: (\n sm: 540px,\n md: 720px,\n lg: 960px,\n xl: 1140px\n) !default;\n@include _assert-ascending($container-max-widths, \"$container-max-widths\");\n\n\n// Grid columns\n//\n// Set the number of columns and specify the width of the gutters.\n\n$grid-columns: 12 !default;\n$grid-gutter-width: 30px !default;\n\n// Components\n//\n// Define common padding and border radius sizes and more.\n\n$line-height-lg: 1.5 !default;\n$line-height-sm: 1.5 !default;\n\n$border-width: 1px !default;\n\n$border-radius: .25rem !default;\n$border-radius-lg: .3rem !default;\n$border-radius-sm: .2rem !default;\n\n$component-active-color: $white !default;\n$component-active-bg: theme-color(\"primary\") !default;\n\n$caret-width: .3em !default;\n\n$transition-base: all .2s ease-in-out !default;\n$transition-fade: opacity .15s linear !default;\n$transition-collapse: height .35s ease !default;\n\n\n// Fonts\n//\n// Font, line-height, and color for body text, headings, and more.\n\n$font-family-sans-serif: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif !default;\n$font-family-monospace: Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace !default;\n$font-family-base: $font-family-sans-serif !default;\n\n$font-size-base: 1rem !default; // Assumes the browser default, typically `16px`\n$font-size-lg: 1.25rem !default;\n$font-size-sm: .875rem !default;\n\n$font-weight-normal: normal !default;\n$font-weight-bold: bold !default;\n\n$font-weight-base: $font-weight-normal !default;\n$line-height-base: 1.5 !default;\n\n$h1-font-size: 2.5rem !default;\n$h2-font-size: 2rem !default;\n$h3-font-size: 1.75rem !default;\n$h4-font-size: 1.5rem !default;\n$h5-font-size: 1.25rem !default;\n$h6-font-size: 1rem !default;\n\n$headings-margin-bottom: ($spacer / 2) !default;\n$headings-font-family: inherit !default;\n$headings-font-weight: 500 !default;\n$headings-line-height: 1.1 !default;\n$headings-color: inherit !default;\n\n$display1-size: 6rem !default;\n$display2-size: 5.5rem !default;\n$display3-size: 4.5rem !default;\n$display4-size: 3.5rem !default;\n\n$display1-weight: 300 !default;\n$display2-weight: 300 !default;\n$display3-weight: 300 !default;\n$display4-weight: 300 !default;\n$display-line-height: $headings-line-height !default;\n\n$lead-font-size: 1.25rem !default;\n$lead-font-weight: 300 !default;\n\n$small-font-size: 80% !default;\n\n$text-muted: $gray-600 !default;\n\n$blockquote-small-color: $gray-600 !default;\n$blockquote-font-size: ($font-size-base * 1.25) !default;\n\n$hr-border-color: rgba($black,.1) !default;\n$hr-border-width: $border-width !default;\n\n$mark-padding: .2em !default;\n\n$dt-font-weight: $font-weight-bold !default;\n\n$kbd-box-shadow: inset 0 -.1rem 0 rgba($black,.25) !default;\n$nested-kbd-font-weight: $font-weight-bold !default;\n\n$list-inline-padding: 5px !default;\n\n$mark-bg: #fcf8e3 !default;\n\n\n// Tables\n//\n// Customizes the `.table` component with basic values, each used across all table variations.\n\n$table-cell-padding: .75rem !default;\n$table-cell-padding-sm: .3rem !default;\n\n$table-bg: transparent !default;\n$table-accent-bg: rgba($black,.05) !default;\n$table-hover-bg: rgba($black,.075) !default;\n$table-active-bg: $table-hover-bg !default;\n\n$table-border-width: $border-width !default;\n$table-border-color: $gray-200 !default;\n\n$table-head-bg: $gray-200 !default;\n$table-head-color: $gray-700 !default;\n\n$table-inverse-bg: $gray-900 !default;\n$table-inverse-accent-bg: rgba($white, .05) !default;\n$table-inverse-hover-bg: rgba($white, .075) !default;\n$table-inverse-border-color: lighten($gray-900, 7.5%) !default;\n$table-inverse-color: $body-bg !default;\n\n\n// Buttons\n//\n// For each of Bootstrap's buttons, define text, background and border color.\n\n$input-btn-padding-y: .5rem !default;\n$input-btn-padding-x: .75rem !default;\n$input-btn-line-height: 1.25 !default;\n\n$input-btn-padding-y-sm: .25rem !default;\n$input-btn-padding-x-sm: .5rem !default;\n$input-btn-line-height-sm: 1.5 !default;\n\n$input-btn-padding-y-lg: .5rem !default;\n$input-btn-padding-x-lg: 1rem !default;\n$input-btn-line-height-lg: 1.5 !default;\n\n$btn-font-weight: $font-weight-normal !default;\n$btn-box-shadow: inset 0 1px 0 rgba($white,.15), 0 1px 1px rgba($black,.075) !default;\n$btn-focus-box-shadow: 0 0 0 3px rgba(theme-color(\"primary\"), .25) !default;\n$btn-active-box-shadow: inset 0 3px 5px rgba($black,.125) !default;\n\n$btn-link-disabled-color: $gray-600 !default;\n\n$btn-block-spacing-y: .5rem !default;\n\n// Allows for customizing button radius independently from global border radius\n$btn-border-radius: $border-radius !default;\n$btn-border-radius-lg: $border-radius-lg !default;\n$btn-border-radius-sm: $border-radius-sm !default;\n\n$btn-transition: all .15s ease-in-out !default;\n\n\n// Forms\n\n$input-bg: $white !default;\n$input-disabled-bg: $gray-200 !default;\n\n$input-color: $gray-700 !default;\n$input-border-color: rgba($black,.15) !default;\n$input-btn-border-width: $border-width !default; // For form controls and buttons\n$input-box-shadow: inset 0 1px 1px rgba($black,.075) !default;\n\n$input-border-radius: $border-radius !default;\n$input-border-radius-lg: $border-radius-lg !default;\n$input-border-radius-sm: $border-radius-sm !default;\n\n$input-focus-bg: $input-bg !default;\n$input-focus-border-color: lighten(theme-color(\"primary\"), 25%) !default;\n$input-focus-box-shadow: $input-box-shadow, $btn-focus-box-shadow !default;\n$input-focus-color: $input-color !default;\n\n$input-placeholder-color: $gray-600 !default;\n\n$input-height-border: $input-btn-border-width * 2 !default;\n\n$input-height-inner: ($font-size-base * $input-btn-line-height) + ($input-btn-padding-y * 2) !default;\n$input-height: calc(#{$input-height-inner} + #{$input-height-border}) !default;\n\n$input-height-inner-sm: ($font-size-sm * $input-btn-line-height-sm) + ($input-btn-padding-y-sm * 2) !default;\n$input-height-sm: calc(#{$input-height-inner-sm} + #{$input-height-border}) !default;\n\n$input-height-inner-lg: ($font-size-sm * $input-btn-line-height-lg) + ($input-btn-padding-y-lg * 2) !default;\n$input-height-lg: calc(#{$input-height-inner-lg} + #{$input-height-border}) !default;\n\n$input-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s !default;\n\n$form-text-margin-top: .25rem !default;\n\n$form-check-margin-bottom: .5rem !default;\n$form-check-input-gutter: 1.25rem !default;\n$form-check-input-margin-y: .25rem !default;\n$form-check-input-margin-x: .25rem !default;\n\n$form-check-inline-margin-x: .75rem !default;\n\n$form-group-margin-bottom: 1rem !default;\n\n$input-group-addon-bg: $gray-200 !default;\n$input-group-addon-border-color: $input-border-color !default;\n\n$custom-control-gutter: 1.5rem !default;\n$custom-control-spacer-y: .25rem !default;\n$custom-control-spacer-x: 1rem !default;\n\n$custom-control-indicator-size: 1rem !default;\n$custom-control-indicator-bg: #ddd !default;\n$custom-control-indicator-bg-size: 50% 50% !default;\n$custom-control-indicator-box-shadow: inset 0 .25rem .25rem rgba($black,.1) !default;\n\n$custom-control-indicator-disabled-bg: $gray-200 !default;\n$custom-control-description-disabled-color: $gray-600 !default;\n\n$custom-control-indicator-checked-color: $white !default;\n$custom-control-indicator-checked-bg: theme-color(\"primary\") !default;\n$custom-control-indicator-checked-box-shadow: none !default;\n\n$custom-control-indicator-focus-box-shadow: 0 0 0 1px $body-bg, 0 0 0 3px theme-color(\"primary\") !default;\n\n$custom-control-indicator-active-color: $white !default;\n$custom-control-indicator-active-bg: lighten(theme-color(\"primary\"), 35%) !default;\n$custom-control-indicator-active-box-shadow: none !default;\n\n$custom-checkbox-indicator-border-radius: $border-radius !default;\n$custom-checkbox-indicator-icon-checked: str-replace(url(\"data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='#{$custom-control-indicator-checked-color}' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E\"), \"#\", \"%23\") !default;\n\n$custom-checkbox-indicator-indeterminate-bg: theme-color(\"primary\") !default;\n$custom-checkbox-indicator-indeterminate-color: $custom-control-indicator-checked-color !default;\n$custom-checkbox-indicator-icon-indeterminate: str-replace(url(\"data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4'%3E%3Cpath stroke='#{$custom-checkbox-indicator-indeterminate-color}' d='M0 2h4'/%3E%3C/svg%3E\"), \"#\", \"%23\") !default;\n$custom-checkbox-indicator-indeterminate-box-shadow: none !default;\n\n$custom-radio-indicator-border-radius: 50% !default;\n$custom-radio-indicator-icon-checked: str-replace(url(\"data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='#{$custom-control-indicator-checked-color}'/%3E%3C/svg%3E\"), \"#\", \"%23\") !default;\n\n$custom-select-padding-y: .375rem !default;\n$custom-select-padding-x: .75rem !default;\n$custom-select-height: $input-height !default;\n$custom-select-indicator-padding: 1rem !default; // Extra padding to account for the presence of the background-image based indicator\n$custom-select-line-height: $input-btn-line-height !default;\n$custom-select-color: $input-color !default;\n$custom-select-disabled-color: $gray-600 !default;\n$custom-select-bg: $white !default;\n$custom-select-disabled-bg: $gray-200 !default;\n$custom-select-bg-size: 8px 10px !default; // In pixels because image dimensions\n$custom-select-indicator-color: #333 !default;\n$custom-select-indicator: str-replace(url(\"data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='#{$custom-select-indicator-color}' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E\"), \"#\", \"%23\") !default;\n$custom-select-border-width: $input-btn-border-width !default;\n$custom-select-border-color: $input-border-color !default;\n$custom-select-border-radius: $border-radius !default;\n\n$custom-select-focus-border-color: lighten(theme-color(\"primary\"), 25%) !default;\n$custom-select-focus-box-shadow: inset 0 1px 2px rgba($black, .075), 0 0 5px rgba($custom-select-focus-border-color, .5) !default;\n\n$custom-select-font-size-sm: 75% !default;\n$custom-select-height-sm: $input-height-sm !default;\n\n$custom-file-height: 2.5rem !default;\n$custom-file-width: 14rem !default;\n$custom-file-focus-box-shadow: 0 0 0 .075rem $white, 0 0 0 .2rem theme-color(\"primary\") !default;\n\n$custom-file-padding-y: 1rem !default;\n$custom-file-padding-x: .5rem !default;\n$custom-file-line-height: 1.5 !default;\n$custom-file-color: $gray-700 !default;\n$custom-file-bg: $white !default;\n$custom-file-border-width: $border-width !default;\n$custom-file-border-color: $input-border-color !default;\n$custom-file-border-radius: $border-radius !default;\n$custom-file-box-shadow: inset 0 .2rem .4rem rgba($black,.05) !default;\n$custom-file-button-color: $custom-file-color !default;\n$custom-file-button-bg: $gray-200 !default;\n$custom-file-text: (\n placeholder: (\n en: \"Choose file...\"\n ),\n button-label: (\n en: \"Browse\"\n )\n) !default;\n\n\n// Form validation\n$form-feedback-valid-color: theme-color(\"success\") !default;\n$form-feedback-invalid-color: theme-color(\"danger\") !default;\n\n\n// Dropdowns\n//\n// Dropdown menu container and contents.\n\n$dropdown-min-width: 10rem !default;\n$dropdown-padding-y: .5rem !default;\n$dropdown-spacer: .125rem !default;\n$dropdown-bg: $white !default;\n$dropdown-border-color: rgba($black,.15) !default;\n$dropdown-border-width: $border-width !default;\n$dropdown-divider-bg: $gray-200 !default;\n$dropdown-box-shadow: 0 .5rem 1rem rgba($black,.175) !default;\n\n$dropdown-link-color: $gray-900 !default;\n$dropdown-link-hover-color: darken($gray-900, 5%) !default;\n$dropdown-link-hover-bg: $gray-100 !default;\n\n$dropdown-link-active-color: $component-active-color !default;\n$dropdown-link-active-bg: $component-active-bg !default;\n\n$dropdown-link-disabled-color: $gray-600 !default;\n\n$dropdown-item-padding-y: .25rem !default;\n$dropdown-item-padding-x: 1.5rem !default;\n\n$dropdown-header-color: $gray-600 !default;\n\n\n// Z-index master list\n//\n// Warning: Avoid customizing these values. They're used for a bird's eye view\n// of components dependent on the z-axis and are designed to all work together.\n\n$zindex-dropdown: 1000 !default;\n$zindex-sticky: 1020 !default;\n$zindex-fixed: 1030 !default;\n$zindex-modal-backdrop: 1040 !default;\n$zindex-modal: 1050 !default;\n$zindex-popover: 1060 !default;\n$zindex-tooltip: 1070 !default;\n\n// Navs\n\n$nav-link-padding-y: .5rem !default;\n$nav-link-padding-x: 1rem !default;\n$nav-link-disabled-color: $gray-600 !default;\n\n$nav-tabs-border-color: #ddd !default;\n$nav-tabs-border-width: $border-width !default;\n$nav-tabs-border-radius: $border-radius !default;\n$nav-tabs-link-hover-border-color: $gray-200 !default;\n$nav-tabs-link-active-color: $gray-700 !default;\n$nav-tabs-link-active-bg: $body-bg !default;\n$nav-tabs-link-active-border-color: #ddd !default;\n\n$nav-pills-border-radius: $border-radius !default;\n$nav-pills-link-active-color: $component-active-color !default;\n$nav-pills-link-active-bg: $component-active-bg !default;\n\n// Navbar\n\n$navbar-padding-y: ($spacer / 2) !default;\n$navbar-padding-x: $spacer !default;\n\n$navbar-brand-font-size: $font-size-lg !default;\n// Compute the navbar-brand padding-y so the navbar-brand will have the same height as navbar-text and nav-link\n$nav-link-height: $navbar-brand-font-size * $line-height-base !default;\n$navbar-brand-height: ($font-size-base * $line-height-base + $nav-link-padding-y * 2) !default;\n$navbar-brand-padding-y: ($navbar-brand-height - $nav-link-height) / 2 !default;\n\n$navbar-toggler-padding-y: .25rem !default;\n$navbar-toggler-padding-x: .75rem !default;\n$navbar-toggler-font-size: $font-size-lg !default;\n$navbar-toggler-border-radius: $btn-border-radius !default;\n\n$navbar-dark-color: rgba($white,.5) !default;\n$navbar-dark-hover-color: rgba($white,.75) !default;\n$navbar-dark-active-color: rgba($white,1) !default;\n$navbar-dark-disabled-color: rgba($white,.25) !default;\n$navbar-dark-toggler-icon-bg: str-replace(url(\"data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='#{$navbar-dark-color}' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E\"), \"#\", \"%23\") !default;\n$navbar-dark-toggler-border-color: rgba($white,.1) !default;\n\n$navbar-light-color: rgba($black,.5) !default;\n$navbar-light-hover-color: rgba($black,.7) !default;\n$navbar-light-active-color: rgba($black,.9) !default;\n$navbar-light-disabled-color: rgba($black,.3) !default;\n$navbar-light-toggler-icon-bg: str-replace(url(\"data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='#{$navbar-light-color}' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E\"), \"#\", \"%23\") !default;\n$navbar-light-toggler-border-color: rgba($black,.1) !default;\n\n// Pagination\n\n$pagination-padding-y: .5rem !default;\n$pagination-padding-x: .75rem !default;\n$pagination-padding-y-sm: .25rem !default;\n$pagination-padding-x-sm: .5rem !default;\n$pagination-padding-y-lg: .75rem !default;\n$pagination-padding-x-lg: 1.5rem !default;\n$pagination-line-height: 1.25 !default;\n\n$pagination-color: $link-color !default;\n$pagination-bg: $white !default;\n$pagination-border-width: $border-width !default;\n$pagination-border-color: #ddd !default;\n\n$pagination-hover-color: $link-hover-color !default;\n$pagination-hover-bg: $gray-200 !default;\n$pagination-hover-border-color: #ddd !default;\n\n$pagination-active-color: $white !default;\n$pagination-active-bg: theme-color(\"primary\") !default;\n$pagination-active-border-color: theme-color(\"primary\") !default;\n\n$pagination-disabled-color: $gray-600 !default;\n$pagination-disabled-bg: $white !default;\n$pagination-disabled-border-color: #ddd !default;\n\n\n// Jumbotron\n\n$jumbotron-padding: 2rem !default;\n$jumbotron-bg: $gray-200 !default;\n\n\n// Cards\n\n$card-spacer-y: .75rem !default;\n$card-spacer-x: 1.25rem !default;\n$card-border-width: 1px !default;\n$card-border-radius: $border-radius !default;\n$card-border-color: rgba($black,.125) !default;\n$card-inner-border-radius: calc(#{$card-border-radius} - #{$card-border-width}) !default;\n$card-cap-bg: rgba($black, .03) !default;\n$card-bg: $white !default;\n\n$card-img-overlay-padding: 1.25rem !default;\n\n$card-deck-margin: ($grid-gutter-width / 2) !default;\n\n$card-columns-count: 3 !default;\n$card-columns-gap: 1.25rem !default;\n$card-columns-margin: $card-spacer-y !default;\n\n\n// Tooltips\n\n$tooltip-max-width: 200px !default;\n$tooltip-color: $white !default;\n$tooltip-bg: $black !default;\n$tooltip-opacity: .9 !default;\n$tooltip-padding-y: 3px !default;\n$tooltip-padding-x: 8px !default;\n$tooltip-margin: 0 !default;\n\n\n$tooltip-arrow-width: 5px !default;\n$tooltip-arrow-height: 5px !default;\n$tooltip-arrow-color: $tooltip-bg !default;\n\n\n// Popovers\n\n$popover-inner-padding: 1px !default;\n$popover-bg: $white !default;\n$popover-max-width: 276px !default;\n$popover-border-width: $border-width !default;\n$popover-border-color: rgba($black,.2) !default;\n$popover-box-shadow: 0 5px 10px rgba($black,.2) !default;\n\n$popover-header-bg: darken($popover-bg, 3%) !default;\n$popover-header-color: $headings-color !default;\n$popover-header-padding-y: 8px !default;\n$popover-header-padding-x: 14px !default;\n\n$popover-body-color: $body-color !default;\n$popover-body-padding-y: 9px !default;\n$popover-body-padding-x: 14px !default;\n\n$popover-arrow-width: 10px !default;\n$popover-arrow-height: 5px !default;\n$popover-arrow-color: $popover-bg !default;\n\n$popover-arrow-outer-width: ($popover-arrow-width + 1px) !default;\n$popover-arrow-outer-color: fade-in($popover-border-color, .05) !default;\n\n\n// Badges\n\n$badge-color: $white !default;\n$badge-font-size: 75% !default;\n$badge-font-weight: $font-weight-bold !default;\n$badge-padding-y: .25em !default;\n$badge-padding-x: .4em !default;\n\n$badge-pill-padding-x: .6em !default;\n// Use a higher than normal value to ensure completely rounded edges when\n// customizing padding or font-size on labels.\n$badge-pill-border-radius: 10rem !default;\n\n\n// Modals\n\n// Padding applied to the modal body\n$modal-inner-padding: 15px !default;\n\n$modal-dialog-margin: 10px !default;\n$modal-dialog-margin-y-sm-up: 30px !default;\n\n$modal-title-line-height: $line-height-base !default;\n\n$modal-content-bg: $white !default;\n$modal-content-border-color: rgba($black,.2) !default;\n$modal-content-border-width: $border-width !default;\n$modal-content-box-shadow-xs: 0 3px 9px rgba($black,.5) !default;\n$modal-content-box-shadow-sm-up: 0 5px 15px rgba($black,.5) !default;\n\n$modal-backdrop-bg: $black !default;\n$modal-backdrop-opacity: .5 !default;\n$modal-header-border-color: $gray-200 !default;\n$modal-footer-border-color: $modal-header-border-color !default;\n$modal-header-border-width: $modal-content-border-width !default;\n$modal-footer-border-width: $modal-header-border-width !default;\n$modal-header-padding: 15px !default;\n\n$modal-lg: 800px !default;\n$modal-md: 500px !default;\n$modal-sm: 300px !default;\n\n$modal-transition: transform .3s ease-out !default;\n\n\n// Alerts\n//\n// Define alert colors, border radius, and padding.\n\n$alert-padding-y: .75rem !default;\n$alert-padding-x: 1.25rem !default;\n$alert-margin-bottom: 1rem !default;\n$alert-border-radius: $border-radius !default;\n$alert-link-font-weight: $font-weight-bold !default;\n$alert-border-width: $border-width !default;\n\n\n// Progress bars\n\n$progress-height: 1rem !default;\n$progress-font-size: .75rem !default;\n$progress-bg: $gray-200 !default;\n$progress-border-radius: $border-radius !default;\n$progress-box-shadow: inset 0 .1rem .1rem rgba($black,.1) !default;\n$progress-bar-color: $white !default;\n$progress-bar-bg: theme-color(\"primary\") !default;\n$progress-bar-animation-timing: 1s linear infinite !default;\n$progress-bar-transition: width .6s ease !default;\n\n// List group\n\n$list-group-bg: $white !default;\n$list-group-border-color: rgba($black,.125) !default;\n$list-group-border-width: $border-width !default;\n$list-group-border-radius: $border-radius !default;\n\n$list-group-item-padding-y: .75rem !default;\n$list-group-item-padding-x: 1.25rem !default;\n\n$list-group-hover-bg: $gray-100 !default;\n$list-group-active-color: $component-active-color !default;\n$list-group-active-bg: $component-active-bg !default;\n$list-group-active-border-color: $list-group-active-bg !default;\n\n$list-group-disabled-color: $gray-600 !default;\n$list-group-disabled-bg: $list-group-bg !default;\n\n$list-group-action-color: $gray-700 !default;\n$list-group-action-hover-color: $list-group-action-color !default;\n\n$list-group-action-active-color: $body-color !default;\n$list-group-action-active-bg: $gray-200 !default;\n\n\n// Image thumbnails\n\n$thumbnail-padding: .25rem !default;\n$thumbnail-bg: $body-bg !default;\n$thumbnail-border-width: $border-width !default;\n$thumbnail-border-color: #ddd !default;\n$thumbnail-border-radius: $border-radius !default;\n$thumbnail-box-shadow: 0 1px 2px rgba($black,.075) !default;\n$thumbnail-transition: all .2s ease-in-out !default;\n\n\n// Figures\n\n$figure-caption-font-size: 90% !default;\n$figure-caption-color: $gray-600 !default;\n\n\n// Breadcrumbs\n\n$breadcrumb-padding-y: .75rem !default;\n$breadcrumb-padding-x: 1rem !default;\n$breadcrumb-item-padding: .5rem !default;\n\n$breadcrumb-bg: $gray-200 !default;\n$breadcrumb-divider-color: $gray-600 !default;\n$breadcrumb-active-color: $gray-600 !default;\n$breadcrumb-divider: \"/\" !default;\n\n\n// Carousel\n\n$carousel-control-color: $white !default;\n$carousel-control-width: 15% !default;\n$carousel-control-opacity: .5 !default;\n\n$carousel-indicator-width: 30px !default;\n$carousel-indicator-height: 3px !default;\n$carousel-indicator-spacer: 3px !default;\n$carousel-indicator-active-bg: $white !default;\n\n$carousel-caption-width: 70% !default;\n$carousel-caption-color: $white !default;\n\n$carousel-control-icon-width: 20px !default;\n\n$carousel-control-prev-icon-bg: str-replace(url(\"data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='#{$carousel-control-color}' viewBox='0 0 8 8'%3E%3Cpath d='M4 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/%3E%3C/svg%3E\"), \"#\", \"%23\") !default;\n$carousel-control-next-icon-bg: str-replace(url(\"data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='#{$carousel-control-color}' viewBox='0 0 8 8'%3E%3Cpath d='M1.5 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z'/%3E%3C/svg%3E\"), \"#\", \"%23\") !default;\n\n$carousel-transition: transform .6s ease !default;\n\n\n// Close\n\n$close-font-size: $font-size-base * 1.5 !default;\n$close-font-weight: $font-weight-bold !default;\n$close-color: $black !default;\n$close-text-shadow: 0 1px 0 $white !default;\n\n// Code\n\n$code-font-size: 90% !default;\n$code-padding-y: .2rem !default;\n$code-padding-x: .4rem !default;\n$code-color: #bd4147 !default;\n$code-bg: $gray-100 !default;\n\n$kbd-color: $white !default;\n$kbd-bg: $gray-900 !default;\n\n$pre-color: $gray-900 !default;\n$pre-scrollable-max-height: 340px !default;\n","// Framework grid generation\n//\n// Used only by Bootstrap to generate the correct number of grid classes given\n// any value of `$grid-columns`.\n\n@mixin make-grid-columns($columns: $grid-columns, $gutter: $grid-gutter-width, $breakpoints: $grid-breakpoints) {\n // Common properties for all breakpoints\n %grid-column {\n position: relative;\n width: 100%;\n min-height: 1px; // Prevent columns from collapsing when empty\n padding-right: ($gutter / 2);\n padding-left: ($gutter / 2);\n }\n\n @each $breakpoint in map-keys($breakpoints) {\n $infix: breakpoint-infix($breakpoint, $breakpoints);\n\n // Allow columns to stretch full width below their breakpoints\n @for $i from 1 through $columns {\n .col#{$infix}-#{$i} {\n @extend %grid-column;\n }\n }\n .col#{$infix},\n .col#{$infix}-auto {\n @extend %grid-column;\n }\n\n @include media-breakpoint-up($breakpoint, $breakpoints) {\n // Provide basic `.col-{bp}` classes for equal-width flexbox columns\n .col#{$infix} {\n flex-basis: 0;\n flex-grow: 1;\n max-width: 100%;\n }\n .col#{$infix}-auto {\n flex: 0 0 auto;\n width: auto;\n max-width: none; // Reset earlier grid tiers\n }\n\n @for $i from 1 through $columns {\n .col#{$infix}-#{$i} {\n @include make-col($i, $columns);\n }\n }\n\n @for $i from 1 through $columns {\n .order#{$infix}-#{$i} {\n order: $i;\n }\n }\n }\n }\n}\n","// Flex variation\n//\n// Custom styles for additional flex alignment options.\n\n@each $breakpoint in map-keys($grid-breakpoints) {\n @include media-breakpoint-up($breakpoint) {\n $infix: breakpoint-infix($breakpoint, $grid-breakpoints);\n\n .flex#{$infix}-row { flex-direction: row !important; }\n .flex#{$infix}-column { flex-direction: column !important; }\n .flex#{$infix}-row-reverse { flex-direction: row-reverse !important; }\n .flex#{$infix}-column-reverse { flex-direction: column-reverse !important; }\n\n .flex#{$infix}-wrap { flex-wrap: wrap !important; }\n .flex#{$infix}-nowrap { flex-wrap: nowrap !important; }\n .flex#{$infix}-wrap-reverse { flex-wrap: wrap-reverse !important; }\n\n .justify-content#{$infix}-start { justify-content: flex-start !important; }\n .justify-content#{$infix}-end { justify-content: flex-end !important; }\n .justify-content#{$infix}-center { justify-content: center !important; }\n .justify-content#{$infix}-between { justify-content: space-between !important; }\n .justify-content#{$infix}-around { justify-content: space-around !important; }\n\n .align-items#{$infix}-start { align-items: flex-start !important; }\n .align-items#{$infix}-end { align-items: flex-end !important; }\n .align-items#{$infix}-center { align-items: center !important; }\n .align-items#{$infix}-baseline { align-items: baseline !important; }\n .align-items#{$infix}-stretch { align-items: stretch !important; }\n\n .align-content#{$infix}-start { align-content: flex-start !important; }\n .align-content#{$infix}-end { align-content: flex-end !important; }\n .align-content#{$infix}-center { align-content: center !important; }\n .align-content#{$infix}-between { align-content: space-between !important; }\n .align-content#{$infix}-around { align-content: space-around !important; }\n .align-content#{$infix}-stretch { align-content: stretch !important; }\n\n .align-self#{$infix}-auto { align-self: auto !important; }\n .align-self#{$infix}-start { align-self: flex-start !important; }\n .align-self#{$infix}-end { align-self: flex-end !important; }\n .align-self#{$infix}-center { align-self: center !important; }\n .align-self#{$infix}-baseline { align-self: baseline !important; }\n .align-self#{$infix}-stretch { align-self: stretch !important; }\n }\n}\n"]} \ No newline at end of file diff --git a/public/vendor/bootstrap/css/bootstrap-grid.min.css b/public/vendor/bootstrap/css/bootstrap-grid.min.css new file mode 100755 index 000000000..b775555cc --- /dev/null +++ b/public/vendor/bootstrap/css/bootstrap-grid.min.css @@ -0,0 +1,2 @@ +@-ms-viewport{width:device-width}html{box-sizing:border-box;-ms-overflow-style:scrollbar}*,::after,::before{box-sizing:inherit}.container{margin-right:auto;margin-left:auto;padding-right:15px;padding-left:15px;width:100%}@media (min-width:576px){.container{max-width:540px}}@media (min-width:768px){.container{max-width:720px}}@media (min-width:992px){.container{max-width:960px}}@media (min-width:1200px){.container{max-width:1140px}}.container-fluid{width:100%;margin-right:auto;margin-left:auto;padding-right:15px;padding-left:15px;width:100%}.row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-15px;margin-left:-15px}.no-gutters{margin-right:0;margin-left:0}.no-gutters>.col,.no-gutters>[class*=col-]{padding-right:0;padding-left:0}.col,.col-1,.col-10,.col-11,.col-12,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-auto,.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-auto,.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-auto,.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-auto,.col-xl,.col-xl-1,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-auto{position:relative;width:100%;min-height:1px;padding-right:15px;padding-left:15px}.col{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-1{-ms-flex-order:1;order:1}.order-2{-ms-flex-order:2;order:2}.order-3{-ms-flex-order:3;order:3}.order-4{-ms-flex-order:4;order:4}.order-5{-ms-flex-order:5;order:5}.order-6{-ms-flex-order:6;order:6}.order-7{-ms-flex-order:7;order:7}.order-8{-ms-flex-order:8;order:8}.order-9{-ms-flex-order:9;order:9}.order-10{-ms-flex-order:10;order:10}.order-11{-ms-flex-order:11;order:11}.order-12{-ms-flex-order:12;order:12}@media (min-width:576px){.col-sm{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-sm-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-sm-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-sm-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-sm-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-sm-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-sm-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-sm-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-sm-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-sm-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-sm-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-sm-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-sm-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-sm-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-sm-1{-ms-flex-order:1;order:1}.order-sm-2{-ms-flex-order:2;order:2}.order-sm-3{-ms-flex-order:3;order:3}.order-sm-4{-ms-flex-order:4;order:4}.order-sm-5{-ms-flex-order:5;order:5}.order-sm-6{-ms-flex-order:6;order:6}.order-sm-7{-ms-flex-order:7;order:7}.order-sm-8{-ms-flex-order:8;order:8}.order-sm-9{-ms-flex-order:9;order:9}.order-sm-10{-ms-flex-order:10;order:10}.order-sm-11{-ms-flex-order:11;order:11}.order-sm-12{-ms-flex-order:12;order:12}}@media (min-width:768px){.col-md{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-md-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-md-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-md-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-md-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-md-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-md-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-md-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-md-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-md-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-md-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-md-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-md-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-md-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-md-1{-ms-flex-order:1;order:1}.order-md-2{-ms-flex-order:2;order:2}.order-md-3{-ms-flex-order:3;order:3}.order-md-4{-ms-flex-order:4;order:4}.order-md-5{-ms-flex-order:5;order:5}.order-md-6{-ms-flex-order:6;order:6}.order-md-7{-ms-flex-order:7;order:7}.order-md-8{-ms-flex-order:8;order:8}.order-md-9{-ms-flex-order:9;order:9}.order-md-10{-ms-flex-order:10;order:10}.order-md-11{-ms-flex-order:11;order:11}.order-md-12{-ms-flex-order:12;order:12}}@media (min-width:992px){.col-lg{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-lg-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-lg-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-lg-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-lg-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-lg-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-lg-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-lg-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-lg-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-lg-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-lg-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-lg-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-lg-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-lg-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-lg-1{-ms-flex-order:1;order:1}.order-lg-2{-ms-flex-order:2;order:2}.order-lg-3{-ms-flex-order:3;order:3}.order-lg-4{-ms-flex-order:4;order:4}.order-lg-5{-ms-flex-order:5;order:5}.order-lg-6{-ms-flex-order:6;order:6}.order-lg-7{-ms-flex-order:7;order:7}.order-lg-8{-ms-flex-order:8;order:8}.order-lg-9{-ms-flex-order:9;order:9}.order-lg-10{-ms-flex-order:10;order:10}.order-lg-11{-ms-flex-order:11;order:11}.order-lg-12{-ms-flex-order:12;order:12}}@media (min-width:1200px){.col-xl{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-xl-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-xl-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-xl-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-xl-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-xl-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-xl-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-xl-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-xl-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-xl-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-xl-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-xl-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-xl-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-xl-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-xl-1{-ms-flex-order:1;order:1}.order-xl-2{-ms-flex-order:2;order:2}.order-xl-3{-ms-flex-order:3;order:3}.order-xl-4{-ms-flex-order:4;order:4}.order-xl-5{-ms-flex-order:5;order:5}.order-xl-6{-ms-flex-order:6;order:6}.order-xl-7{-ms-flex-order:7;order:7}.order-xl-8{-ms-flex-order:8;order:8}.order-xl-9{-ms-flex-order:9;order:9}.order-xl-10{-ms-flex-order:10;order:10}.order-xl-11{-ms-flex-order:11;order:11}.order-xl-12{-ms-flex-order:12;order:12}}.flex-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-center{-ms-flex-align:center!important;align-items:center!important}.align-items-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}@media (min-width:576px){.flex-sm-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-sm-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-sm-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-sm-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-sm-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-sm-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-sm-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-sm-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-sm-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-sm-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-sm-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-sm-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-sm-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-sm-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-sm-center{-ms-flex-align:center!important;align-items:center!important}.align-items-sm-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-sm-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-sm-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-sm-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-sm-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-sm-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-sm-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-sm-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-sm-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-sm-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-sm-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-sm-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-sm-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-sm-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:768px){.flex-md-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-md-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-md-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-md-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-md-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-md-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-md-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-md-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-md-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-md-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-md-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-md-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-md-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-md-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-md-center{-ms-flex-align:center!important;align-items:center!important}.align-items-md-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-md-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-md-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-md-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-md-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-md-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-md-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-md-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-md-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-md-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-md-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-md-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-md-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-md-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:992px){.flex-lg-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-lg-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-lg-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-lg-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-lg-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-lg-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-lg-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-lg-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-lg-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-lg-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-lg-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-lg-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-lg-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-lg-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-lg-center{-ms-flex-align:center!important;align-items:center!important}.align-items-lg-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-lg-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-lg-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-lg-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-lg-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-lg-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-lg-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-lg-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-lg-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-lg-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-lg-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-lg-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-lg-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-lg-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}}@media (min-width:1200px){.flex-xl-row{-ms-flex-direction:row!important;flex-direction:row!important}.flex-xl-column{-ms-flex-direction:column!important;flex-direction:column!important}.flex-xl-row-reverse{-ms-flex-direction:row-reverse!important;flex-direction:row-reverse!important}.flex-xl-column-reverse{-ms-flex-direction:column-reverse!important;flex-direction:column-reverse!important}.flex-xl-wrap{-ms-flex-wrap:wrap!important;flex-wrap:wrap!important}.flex-xl-nowrap{-ms-flex-wrap:nowrap!important;flex-wrap:nowrap!important}.flex-xl-wrap-reverse{-ms-flex-wrap:wrap-reverse!important;flex-wrap:wrap-reverse!important}.justify-content-xl-start{-ms-flex-pack:start!important;justify-content:flex-start!important}.justify-content-xl-end{-ms-flex-pack:end!important;justify-content:flex-end!important}.justify-content-xl-center{-ms-flex-pack:center!important;justify-content:center!important}.justify-content-xl-between{-ms-flex-pack:justify!important;justify-content:space-between!important}.justify-content-xl-around{-ms-flex-pack:distribute!important;justify-content:space-around!important}.align-items-xl-start{-ms-flex-align:start!important;align-items:flex-start!important}.align-items-xl-end{-ms-flex-align:end!important;align-items:flex-end!important}.align-items-xl-center{-ms-flex-align:center!important;align-items:center!important}.align-items-xl-baseline{-ms-flex-align:baseline!important;align-items:baseline!important}.align-items-xl-stretch{-ms-flex-align:stretch!important;align-items:stretch!important}.align-content-xl-start{-ms-flex-line-pack:start!important;align-content:flex-start!important}.align-content-xl-end{-ms-flex-line-pack:end!important;align-content:flex-end!important}.align-content-xl-center{-ms-flex-line-pack:center!important;align-content:center!important}.align-content-xl-between{-ms-flex-line-pack:justify!important;align-content:space-between!important}.align-content-xl-around{-ms-flex-line-pack:distribute!important;align-content:space-around!important}.align-content-xl-stretch{-ms-flex-line-pack:stretch!important;align-content:stretch!important}.align-self-xl-auto{-ms-flex-item-align:auto!important;align-self:auto!important}.align-self-xl-start{-ms-flex-item-align:start!important;align-self:flex-start!important}.align-self-xl-end{-ms-flex-item-align:end!important;align-self:flex-end!important}.align-self-xl-center{-ms-flex-item-align:center!important;align-self:center!important}.align-self-xl-baseline{-ms-flex-item-align:baseline!important;align-self:baseline!important}.align-self-xl-stretch{-ms-flex-item-align:stretch!important;align-self:stretch!important}} +/*# sourceMappingURL=bootstrap-grid.min.css.map */ \ No newline at end of file diff --git a/public/vendor/bootstrap/css/bootstrap-grid.min.css.map b/public/vendor/bootstrap/css/bootstrap-grid.min.css.map new file mode 100755 index 000000000..5e16e09e5 --- /dev/null +++ b/public/vendor/bootstrap/css/bootstrap-grid.min.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../scss/bootstrap-grid.scss","dist/css/bootstrap-grid.css","../../scss/_grid.scss","../../scss/mixins/_grid.scss","../../scss/mixins/_breakpoints.scss","../../scss/mixins/_grid-framework.scss","../../scss/utilities/_flex.scss"],"names":[],"mappings":"AAUE,cAAgB,MAAA,aAGlB,KACE,WAAA,WACA,mBAAA,UAGF,ECPA,QADA,SDWE,WAAA,QEhBA,WCAA,aAAA,KACA,YAAA,KACA,cAAA,KACA,aAAA,KACA,MAAA,KC+CE,yBFnDF,WCYI,UAAA,OCuCF,yBFnDF,WCYI,UAAA,OCuCF,yBFnDF,WCYI,UAAA,OCuCF,0BFnDF,WCYI,UAAA,QDAJ,iBACE,MAAA,KCbF,aAAA,KACA,YAAA,KACA,cAAA,KACA,aAAA,KACA,MAAA,KDmBA,KCLA,QAAA,YAAA,QAAA,KACA,cAAA,KAAA,UAAA,KACA,aAAA,MACA,YAAA,MDQA,YACE,aAAA,EACA,YAAA,EAFF,iBDqCF,0BC/BM,cAAA,EACA,aAAA,EGlCJ,KAAA,OAAA,QAAA,QAAA,QAAA,OAAA,OAAA,OAAA,OAAA,OAAA,OAAA,OAAA,OJsEF,UAEqJ,QAAvI,UAAmG,WAAY,WAAY,WAAhH,UAAW,UAAW,UAAW,UAAW,UAAW,UAAW,UAAW,UACtG,aAFqJ,QAAvI,UAAmG,WAAY,WAAY,WAAhH,UAAW,UAAW,UAAW,UAAW,UAAW,UAAW,UAAW,UACtG,aAFkJ,QAAvI,UAAmG,WAAY,WAAY,WAAhH,UAAW,UAAW,UAAW,UAAW,UAAW,UAAW,UAAW,UACnG,aAEqJ,QAAvI,UAAmG,WAAY,WAAY,WAAhH,UAAW,UAAW,UAAW,UAAW,UAAW,UAAW,UAAW,UACtG,aIzEI,SAAA,SACA,MAAA,KACA,WAAA,IACA,cAAA,KACA,aAAA,KAmBE,KACE,wBAAA,EAAA,WAAA,EACA,kBAAA,EAAA,UAAA,EACA,UAAA,KAEF,UACE,SAAA,EAAA,EAAA,KAAA,KAAA,EAAA,EAAA,KACA,MAAA,KACA,UAAA,KAIA,OFFN,SAAA,EAAA,EAAA,UAAA,KAAA,EAAA,EAAA,UAIA,UAAA,UEFM,OFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,OFFN,SAAA,EAAA,EAAA,IAAA,KAAA,EAAA,EAAA,IAIA,UAAA,IEFM,OFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,OFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,OFFN,SAAA,EAAA,EAAA,IAAA,KAAA,EAAA,EAAA,IAIA,UAAA,IEFM,OFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,OFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,OFFN,SAAA,EAAA,EAAA,IAAA,KAAA,EAAA,EAAA,IAIA,UAAA,IEFM,QFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,QFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,QFFN,SAAA,EAAA,EAAA,KAAA,KAAA,EAAA,EAAA,KAIA,UAAA,KEIM,SACE,eAAA,EAAA,MAAA,EADF,SACE,eAAA,EAAA,MAAA,EADF,SACE,eAAA,EAAA,MAAA,EADF,SACE,eAAA,EAAA,MAAA,EADF,SACE,eAAA,EAAA,MAAA,EADF,SACE,eAAA,EAAA,MAAA,EADF,SACE,eAAA,EAAA,MAAA,EADF,SACE,eAAA,EAAA,MAAA,EADF,SACE,eAAA,EAAA,MAAA,EADF,UACE,eAAA,GAAA,MAAA,GADF,UACE,eAAA,GAAA,MAAA,GADF,UACE,eAAA,GAAA,MAAA,GDMN,yBCzBE,QACE,wBAAA,EAAA,WAAA,EACA,kBAAA,EAAA,UAAA,EACA,UAAA,KAEF,aACE,SAAA,EAAA,EAAA,KAAA,KAAA,EAAA,EAAA,KACA,MAAA,KACA,UAAA,KAIA,UFFN,SAAA,EAAA,EAAA,UAAA,KAAA,EAAA,EAAA,UAIA,UAAA,UEFM,UFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,UFFN,SAAA,EAAA,EAAA,IAAA,KAAA,EAAA,EAAA,IAIA,UAAA,IEFM,UFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,UFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,UFFN,SAAA,EAAA,EAAA,IAAA,KAAA,EAAA,EAAA,IAIA,UAAA,IEFM,UFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,UFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,UFFN,SAAA,EAAA,EAAA,IAAA,KAAA,EAAA,EAAA,IAIA,UAAA,IEFM,WFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,WFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,WFFN,SAAA,EAAA,EAAA,KAAA,KAAA,EAAA,EAAA,KAIA,UAAA,KEIM,YACE,eAAA,EAAA,MAAA,EADF,YACE,eAAA,EAAA,MAAA,EADF,YACE,eAAA,EAAA,MAAA,EADF,YACE,eAAA,EAAA,MAAA,EADF,YACE,eAAA,EAAA,MAAA,EADF,YACE,eAAA,EAAA,MAAA,EADF,YACE,eAAA,EAAA,MAAA,EADF,YACE,eAAA,EAAA,MAAA,EADF,YACE,eAAA,EAAA,MAAA,EADF,aACE,eAAA,GAAA,MAAA,GADF,aACE,eAAA,GAAA,MAAA,GADF,aACE,eAAA,GAAA,MAAA,IDMN,yBCzBE,QACE,wBAAA,EAAA,WAAA,EACA,kBAAA,EAAA,UAAA,EACA,UAAA,KAEF,aACE,SAAA,EAAA,EAAA,KAAA,KAAA,EAAA,EAAA,KACA,MAAA,KACA,UAAA,KAIA,UFFN,SAAA,EAAA,EAAA,UAAA,KAAA,EAAA,EAAA,UAIA,UAAA,UEFM,UFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,UFFN,SAAA,EAAA,EAAA,IAAA,KAAA,EAAA,EAAA,IAIA,UAAA,IEFM,UFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,UFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,UFFN,SAAA,EAAA,EAAA,IAAA,KAAA,EAAA,EAAA,IAIA,UAAA,IEFM,UFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,UFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,UFFN,SAAA,EAAA,EAAA,IAAA,KAAA,EAAA,EAAA,IAIA,UAAA,IEFM,WFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,WFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,WFFN,SAAA,EAAA,EAAA,KAAA,KAAA,EAAA,EAAA,KAIA,UAAA,KEIM,YACE,eAAA,EAAA,MAAA,EADF,YACE,eAAA,EAAA,MAAA,EADF,YACE,eAAA,EAAA,MAAA,EADF,YACE,eAAA,EAAA,MAAA,EADF,YACE,eAAA,EAAA,MAAA,EADF,YACE,eAAA,EAAA,MAAA,EADF,YACE,eAAA,EAAA,MAAA,EADF,YACE,eAAA,EAAA,MAAA,EADF,YACE,eAAA,EAAA,MAAA,EADF,aACE,eAAA,GAAA,MAAA,GADF,aACE,eAAA,GAAA,MAAA,GADF,aACE,eAAA,GAAA,MAAA,IDMN,yBCzBE,QACE,wBAAA,EAAA,WAAA,EACA,kBAAA,EAAA,UAAA,EACA,UAAA,KAEF,aACE,SAAA,EAAA,EAAA,KAAA,KAAA,EAAA,EAAA,KACA,MAAA,KACA,UAAA,KAIA,UFFN,SAAA,EAAA,EAAA,UAAA,KAAA,EAAA,EAAA,UAIA,UAAA,UEFM,UFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,UFFN,SAAA,EAAA,EAAA,IAAA,KAAA,EAAA,EAAA,IAIA,UAAA,IEFM,UFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,UFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,UFFN,SAAA,EAAA,EAAA,IAAA,KAAA,EAAA,EAAA,IAIA,UAAA,IEFM,UFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,UFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,UFFN,SAAA,EAAA,EAAA,IAAA,KAAA,EAAA,EAAA,IAIA,UAAA,IEFM,WFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,WFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,WFFN,SAAA,EAAA,EAAA,KAAA,KAAA,EAAA,EAAA,KAIA,UAAA,KEIM,YACE,eAAA,EAAA,MAAA,EADF,YACE,eAAA,EAAA,MAAA,EADF,YACE,eAAA,EAAA,MAAA,EADF,YACE,eAAA,EAAA,MAAA,EADF,YACE,eAAA,EAAA,MAAA,EADF,YACE,eAAA,EAAA,MAAA,EADF,YACE,eAAA,EAAA,MAAA,EADF,YACE,eAAA,EAAA,MAAA,EADF,YACE,eAAA,EAAA,MAAA,EADF,aACE,eAAA,GAAA,MAAA,GADF,aACE,eAAA,GAAA,MAAA,GADF,aACE,eAAA,GAAA,MAAA,IDMN,0BCzBE,QACE,wBAAA,EAAA,WAAA,EACA,kBAAA,EAAA,UAAA,EACA,UAAA,KAEF,aACE,SAAA,EAAA,EAAA,KAAA,KAAA,EAAA,EAAA,KACA,MAAA,KACA,UAAA,KAIA,UFFN,SAAA,EAAA,EAAA,UAAA,KAAA,EAAA,EAAA,UAIA,UAAA,UEFM,UFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,UFFN,SAAA,EAAA,EAAA,IAAA,KAAA,EAAA,EAAA,IAIA,UAAA,IEFM,UFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,UFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,UFFN,SAAA,EAAA,EAAA,IAAA,KAAA,EAAA,EAAA,IAIA,UAAA,IEFM,UFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,UFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,UFFN,SAAA,EAAA,EAAA,IAAA,KAAA,EAAA,EAAA,IAIA,UAAA,IEFM,WFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,WFFN,SAAA,EAAA,EAAA,WAAA,KAAA,EAAA,EAAA,WAIA,UAAA,WEFM,WFFN,SAAA,EAAA,EAAA,KAAA,KAAA,EAAA,EAAA,KAIA,UAAA,KEIM,YACE,eAAA,EAAA,MAAA,EADF,YACE,eAAA,EAAA,MAAA,EADF,YACE,eAAA,EAAA,MAAA,EADF,YACE,eAAA,EAAA,MAAA,EADF,YACE,eAAA,EAAA,MAAA,EADF,YACE,eAAA,EAAA,MAAA,EADF,YACE,eAAA,EAAA,MAAA,EADF,YACE,eAAA,EAAA,MAAA,EADF,YACE,eAAA,EAAA,MAAA,EADF,aACE,eAAA,GAAA,MAAA,GADF,aACE,eAAA,GAAA,MAAA,GADF,aACE,eAAA,GAAA,MAAA,IC1CN,UAAgC,mBAAA,cAAA,eAAA,cAChC,aAAgC,mBAAA,iBAAA,eAAA,iBAChC,kBAAgC,mBAAA,sBAAA,eAAA,sBAChC,qBAAgC,mBAAA,yBAAA,eAAA,yBAEhC,WAA8B,cAAA,eAAA,UAAA,eAC9B,aAA8B,cAAA,iBAAA,UAAA,iBAC9B,mBAA8B,cAAA,uBAAA,UAAA,uBAE9B,uBAAoC,cAAA,gBAAA,gBAAA,qBACpC,qBAAoC,cAAA,cAAA,gBAAA,mBACpC,wBAAoC,cAAA,iBAAA,gBAAA,iBACpC,yBAAoC,cAAA,kBAAA,gBAAA,wBACpC,wBAAoC,cAAA,qBAAA,gBAAA,uBAEpC,mBAAiC,eAAA,gBAAA,YAAA,qBACjC,iBAAiC,eAAA,cAAA,YAAA,mBACjC,oBAAiC,eAAA,iBAAA,YAAA,iBACjC,sBAAiC,eAAA,mBAAA,YAAA,mBACjC,qBAAiC,eAAA,kBAAA,YAAA,kBAEjC,qBAAkC,mBAAA,gBAAA,cAAA,qBAClC,mBAAkC,mBAAA,cAAA,cAAA,mBAClC,sBAAkC,mBAAA,iBAAA,cAAA,iBAClC,uBAAkC,mBAAA,kBAAA,cAAA,wBAClC,sBAAkC,mBAAA,qBAAA,cAAA,uBAClC,uBAAkC,mBAAA,kBAAA,cAAA,kBAElC,iBAAgC,oBAAA,eAAA,WAAA,eAChC,kBAAgC,oBAAA,gBAAA,WAAA,qBAChC,gBAAgC,oBAAA,cAAA,WAAA,mBAChC,mBAAgC,oBAAA,iBAAA,WAAA,iBAChC,qBAAgC,oBAAA,mBAAA,WAAA,mBAChC,oBAAgC,oBAAA,kBAAA,WAAA,kBFehC,yBEhDA,aAAgC,mBAAA,cAAA,eAAA,cAChC,gBAAgC,mBAAA,iBAAA,eAAA,iBAChC,qBAAgC,mBAAA,sBAAA,eAAA,sBAChC,wBAAgC,mBAAA,yBAAA,eAAA,yBAEhC,cAA8B,cAAA,eAAA,UAAA,eAC9B,gBAA8B,cAAA,iBAAA,UAAA,iBAC9B,sBAA8B,cAAA,uBAAA,UAAA,uBAE9B,0BAAoC,cAAA,gBAAA,gBAAA,qBACpC,wBAAoC,cAAA,cAAA,gBAAA,mBACpC,2BAAoC,cAAA,iBAAA,gBAAA,iBACpC,4BAAoC,cAAA,kBAAA,gBAAA,wBACpC,2BAAoC,cAAA,qBAAA,gBAAA,uBAEpC,sBAAiC,eAAA,gBAAA,YAAA,qBACjC,oBAAiC,eAAA,cAAA,YAAA,mBACjC,uBAAiC,eAAA,iBAAA,YAAA,iBACjC,yBAAiC,eAAA,mBAAA,YAAA,mBACjC,wBAAiC,eAAA,kBAAA,YAAA,kBAEjC,wBAAkC,mBAAA,gBAAA,cAAA,qBAClC,sBAAkC,mBAAA,cAAA,cAAA,mBAClC,yBAAkC,mBAAA,iBAAA,cAAA,iBAClC,0BAAkC,mBAAA,kBAAA,cAAA,wBAClC,yBAAkC,mBAAA,qBAAA,cAAA,uBAClC,0BAAkC,mBAAA,kBAAA,cAAA,kBAElC,oBAAgC,oBAAA,eAAA,WAAA,eAChC,qBAAgC,oBAAA,gBAAA,WAAA,qBAChC,mBAAgC,oBAAA,cAAA,WAAA,mBAChC,sBAAgC,oBAAA,iBAAA,WAAA,iBAChC,wBAAgC,oBAAA,mBAAA,WAAA,mBAChC,uBAAgC,oBAAA,kBAAA,WAAA,mBFehC,yBEhDA,aAAgC,mBAAA,cAAA,eAAA,cAChC,gBAAgC,mBAAA,iBAAA,eAAA,iBAChC,qBAAgC,mBAAA,sBAAA,eAAA,sBAChC,wBAAgC,mBAAA,yBAAA,eAAA,yBAEhC,cAA8B,cAAA,eAAA,UAAA,eAC9B,gBAA8B,cAAA,iBAAA,UAAA,iBAC9B,sBAA8B,cAAA,uBAAA,UAAA,uBAE9B,0BAAoC,cAAA,gBAAA,gBAAA,qBACpC,wBAAoC,cAAA,cAAA,gBAAA,mBACpC,2BAAoC,cAAA,iBAAA,gBAAA,iBACpC,4BAAoC,cAAA,kBAAA,gBAAA,wBACpC,2BAAoC,cAAA,qBAAA,gBAAA,uBAEpC,sBAAiC,eAAA,gBAAA,YAAA,qBACjC,oBAAiC,eAAA,cAAA,YAAA,mBACjC,uBAAiC,eAAA,iBAAA,YAAA,iBACjC,yBAAiC,eAAA,mBAAA,YAAA,mBACjC,wBAAiC,eAAA,kBAAA,YAAA,kBAEjC,wBAAkC,mBAAA,gBAAA,cAAA,qBAClC,sBAAkC,mBAAA,cAAA,cAAA,mBAClC,yBAAkC,mBAAA,iBAAA,cAAA,iBAClC,0BAAkC,mBAAA,kBAAA,cAAA,wBAClC,yBAAkC,mBAAA,qBAAA,cAAA,uBAClC,0BAAkC,mBAAA,kBAAA,cAAA,kBAElC,oBAAgC,oBAAA,eAAA,WAAA,eAChC,qBAAgC,oBAAA,gBAAA,WAAA,qBAChC,mBAAgC,oBAAA,cAAA,WAAA,mBAChC,sBAAgC,oBAAA,iBAAA,WAAA,iBAChC,wBAAgC,oBAAA,mBAAA,WAAA,mBAChC,uBAAgC,oBAAA,kBAAA,WAAA,mBFehC,yBEhDA,aAAgC,mBAAA,cAAA,eAAA,cAChC,gBAAgC,mBAAA,iBAAA,eAAA,iBAChC,qBAAgC,mBAAA,sBAAA,eAAA,sBAChC,wBAAgC,mBAAA,yBAAA,eAAA,yBAEhC,cAA8B,cAAA,eAAA,UAAA,eAC9B,gBAA8B,cAAA,iBAAA,UAAA,iBAC9B,sBAA8B,cAAA,uBAAA,UAAA,uBAE9B,0BAAoC,cAAA,gBAAA,gBAAA,qBACpC,wBAAoC,cAAA,cAAA,gBAAA,mBACpC,2BAAoC,cAAA,iBAAA,gBAAA,iBACpC,4BAAoC,cAAA,kBAAA,gBAAA,wBACpC,2BAAoC,cAAA,qBAAA,gBAAA,uBAEpC,sBAAiC,eAAA,gBAAA,YAAA,qBACjC,oBAAiC,eAAA,cAAA,YAAA,mBACjC,uBAAiC,eAAA,iBAAA,YAAA,iBACjC,yBAAiC,eAAA,mBAAA,YAAA,mBACjC,wBAAiC,eAAA,kBAAA,YAAA,kBAEjC,wBAAkC,mBAAA,gBAAA,cAAA,qBAClC,sBAAkC,mBAAA,cAAA,cAAA,mBAClC,yBAAkC,mBAAA,iBAAA,cAAA,iBAClC,0BAAkC,mBAAA,kBAAA,cAAA,wBAClC,yBAAkC,mBAAA,qBAAA,cAAA,uBAClC,0BAAkC,mBAAA,kBAAA,cAAA,kBAElC,oBAAgC,oBAAA,eAAA,WAAA,eAChC,qBAAgC,oBAAA,gBAAA,WAAA,qBAChC,mBAAgC,oBAAA,cAAA,WAAA,mBAChC,sBAAgC,oBAAA,iBAAA,WAAA,iBAChC,wBAAgC,oBAAA,mBAAA,WAAA,mBAChC,uBAAgC,oBAAA,kBAAA,WAAA,mBFehC,0BEhDA,aAAgC,mBAAA,cAAA,eAAA,cAChC,gBAAgC,mBAAA,iBAAA,eAAA,iBAChC,qBAAgC,mBAAA,sBAAA,eAAA,sBAChC,wBAAgC,mBAAA,yBAAA,eAAA,yBAEhC,cAA8B,cAAA,eAAA,UAAA,eAC9B,gBAA8B,cAAA,iBAAA,UAAA,iBAC9B,sBAA8B,cAAA,uBAAA,UAAA,uBAE9B,0BAAoC,cAAA,gBAAA,gBAAA,qBACpC,wBAAoC,cAAA,cAAA,gBAAA,mBACpC,2BAAoC,cAAA,iBAAA,gBAAA,iBACpC,4BAAoC,cAAA,kBAAA,gBAAA,wBACpC,2BAAoC,cAAA,qBAAA,gBAAA,uBAEpC,sBAAiC,eAAA,gBAAA,YAAA,qBACjC,oBAAiC,eAAA,cAAA,YAAA,mBACjC,uBAAiC,eAAA,iBAAA,YAAA,iBACjC,yBAAiC,eAAA,mBAAA,YAAA,mBACjC,wBAAiC,eAAA,kBAAA,YAAA,kBAEjC,wBAAkC,mBAAA,gBAAA,cAAA,qBAClC,sBAAkC,mBAAA,cAAA,cAAA,mBAClC,yBAAkC,mBAAA,iBAAA,cAAA,iBAClC,0BAAkC,mBAAA,kBAAA,cAAA,wBAClC,yBAAkC,mBAAA,qBAAA,cAAA,uBAClC,0BAAkC,mBAAA,kBAAA,cAAA,kBAElC,oBAAgC,oBAAA,eAAA,WAAA,eAChC,qBAAgC,oBAAA,gBAAA,WAAA,qBAChC,mBAAgC,oBAAA,cAAA,WAAA,mBAChC,sBAAgC,oBAAA,iBAAA,WAAA,iBAChC,wBAAgC,oBAAA,mBAAA,WAAA,mBAChC,uBAAgC,oBAAA,kBAAA,WAAA","sourcesContent":["// Bootstrap Grid only\n//\n// Includes relevant variables and mixins for the flexbox grid\n// system, as well as the generated predefined classes (e.g., `.col-sm-4`).\n\n//\n// Box sizing, responsive, and more\n//\n\n@at-root {\n @-ms-viewport { width: device-width; }\n}\n\nhtml {\n box-sizing: border-box;\n -ms-overflow-style: scrollbar;\n}\n\n*,\n*::before,\n*::after {\n box-sizing: inherit;\n}\n\n@import \"functions\";\n@import \"variables\";\n\n//\n// Grid mixins\n//\n\n@import \"mixins/breakpoints\";\n@import \"mixins/grid-framework\";\n@import \"mixins/grid\";\n\n@import \"grid\";\n@import \"utilities/flex\";\n","@-ms-viewport {\n width: device-width;\n}\n\nhtml {\n box-sizing: border-box;\n -ms-overflow-style: scrollbar;\n}\n\n*,\n*::before,\n*::after {\n box-sizing: inherit;\n}\n\n.container {\n margin-right: auto;\n margin-left: auto;\n padding-right: 15px;\n padding-left: 15px;\n width: 100%;\n}\n\n@media (min-width: 576px) {\n .container {\n max-width: 540px;\n }\n}\n\n@media (min-width: 768px) {\n .container {\n max-width: 720px;\n }\n}\n\n@media (min-width: 992px) {\n .container {\n max-width: 960px;\n }\n}\n\n@media (min-width: 1200px) {\n .container {\n max-width: 1140px;\n }\n}\n\n.container-fluid {\n width: 100%;\n margin-right: auto;\n margin-left: auto;\n padding-right: 15px;\n padding-left: 15px;\n width: 100%;\n}\n\n.row {\n display: -ms-flexbox;\n display: flex;\n -ms-flex-wrap: wrap;\n flex-wrap: wrap;\n margin-right: -15px;\n margin-left: -15px;\n}\n\n.no-gutters {\n margin-right: 0;\n margin-left: 0;\n}\n\n.no-gutters > .col,\n.no-gutters > [class*=\"col-\"] {\n padding-right: 0;\n padding-left: 0;\n}\n\n.col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12, .col,\n.col-auto, .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm,\n.col-sm-auto, .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12, .col-md,\n.col-md-auto, .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg,\n.col-lg-auto, .col-xl-1, .col-xl-2, .col-xl-3, .col-xl-4, .col-xl-5, .col-xl-6, .col-xl-7, .col-xl-8, .col-xl-9, .col-xl-10, .col-xl-11, .col-xl-12, .col-xl,\n.col-xl-auto {\n position: relative;\n width: 100%;\n min-height: 1px;\n padding-right: 15px;\n padding-left: 15px;\n}\n\n.col {\n -ms-flex-preferred-size: 0;\n flex-basis: 0;\n -ms-flex-positive: 1;\n flex-grow: 1;\n max-width: 100%;\n}\n\n.col-auto {\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n width: auto;\n max-width: none;\n}\n\n.col-1 {\n -ms-flex: 0 0 8.333333%;\n flex: 0 0 8.333333%;\n max-width: 8.333333%;\n}\n\n.col-2 {\n -ms-flex: 0 0 16.666667%;\n flex: 0 0 16.666667%;\n max-width: 16.666667%;\n}\n\n.col-3 {\n -ms-flex: 0 0 25%;\n flex: 0 0 25%;\n max-width: 25%;\n}\n\n.col-4 {\n -ms-flex: 0 0 33.333333%;\n flex: 0 0 33.333333%;\n max-width: 33.333333%;\n}\n\n.col-5 {\n -ms-flex: 0 0 41.666667%;\n flex: 0 0 41.666667%;\n max-width: 41.666667%;\n}\n\n.col-6 {\n -ms-flex: 0 0 50%;\n flex: 0 0 50%;\n max-width: 50%;\n}\n\n.col-7 {\n -ms-flex: 0 0 58.333333%;\n flex: 0 0 58.333333%;\n max-width: 58.333333%;\n}\n\n.col-8 {\n -ms-flex: 0 0 66.666667%;\n flex: 0 0 66.666667%;\n max-width: 66.666667%;\n}\n\n.col-9 {\n -ms-flex: 0 0 75%;\n flex: 0 0 75%;\n max-width: 75%;\n}\n\n.col-10 {\n -ms-flex: 0 0 83.333333%;\n flex: 0 0 83.333333%;\n max-width: 83.333333%;\n}\n\n.col-11 {\n -ms-flex: 0 0 91.666667%;\n flex: 0 0 91.666667%;\n max-width: 91.666667%;\n}\n\n.col-12 {\n -ms-flex: 0 0 100%;\n flex: 0 0 100%;\n max-width: 100%;\n}\n\n.order-1 {\n -ms-flex-order: 1;\n order: 1;\n}\n\n.order-2 {\n -ms-flex-order: 2;\n order: 2;\n}\n\n.order-3 {\n -ms-flex-order: 3;\n order: 3;\n}\n\n.order-4 {\n -ms-flex-order: 4;\n order: 4;\n}\n\n.order-5 {\n -ms-flex-order: 5;\n order: 5;\n}\n\n.order-6 {\n -ms-flex-order: 6;\n order: 6;\n}\n\n.order-7 {\n -ms-flex-order: 7;\n order: 7;\n}\n\n.order-8 {\n -ms-flex-order: 8;\n order: 8;\n}\n\n.order-9 {\n -ms-flex-order: 9;\n order: 9;\n}\n\n.order-10 {\n -ms-flex-order: 10;\n order: 10;\n}\n\n.order-11 {\n -ms-flex-order: 11;\n order: 11;\n}\n\n.order-12 {\n -ms-flex-order: 12;\n order: 12;\n}\n\n@media (min-width: 576px) {\n .col-sm {\n -ms-flex-preferred-size: 0;\n flex-basis: 0;\n -ms-flex-positive: 1;\n flex-grow: 1;\n max-width: 100%;\n }\n .col-sm-auto {\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n width: auto;\n max-width: none;\n }\n .col-sm-1 {\n -ms-flex: 0 0 8.333333%;\n flex: 0 0 8.333333%;\n max-width: 8.333333%;\n }\n .col-sm-2 {\n -ms-flex: 0 0 16.666667%;\n flex: 0 0 16.666667%;\n max-width: 16.666667%;\n }\n .col-sm-3 {\n -ms-flex: 0 0 25%;\n flex: 0 0 25%;\n max-width: 25%;\n }\n .col-sm-4 {\n -ms-flex: 0 0 33.333333%;\n flex: 0 0 33.333333%;\n max-width: 33.333333%;\n }\n .col-sm-5 {\n -ms-flex: 0 0 41.666667%;\n flex: 0 0 41.666667%;\n max-width: 41.666667%;\n }\n .col-sm-6 {\n -ms-flex: 0 0 50%;\n flex: 0 0 50%;\n max-width: 50%;\n }\n .col-sm-7 {\n -ms-flex: 0 0 58.333333%;\n flex: 0 0 58.333333%;\n max-width: 58.333333%;\n }\n .col-sm-8 {\n -ms-flex: 0 0 66.666667%;\n flex: 0 0 66.666667%;\n max-width: 66.666667%;\n }\n .col-sm-9 {\n -ms-flex: 0 0 75%;\n flex: 0 0 75%;\n max-width: 75%;\n }\n .col-sm-10 {\n -ms-flex: 0 0 83.333333%;\n flex: 0 0 83.333333%;\n max-width: 83.333333%;\n }\n .col-sm-11 {\n -ms-flex: 0 0 91.666667%;\n flex: 0 0 91.666667%;\n max-width: 91.666667%;\n }\n .col-sm-12 {\n -ms-flex: 0 0 100%;\n flex: 0 0 100%;\n max-width: 100%;\n }\n .order-sm-1 {\n -ms-flex-order: 1;\n order: 1;\n }\n .order-sm-2 {\n -ms-flex-order: 2;\n order: 2;\n }\n .order-sm-3 {\n -ms-flex-order: 3;\n order: 3;\n }\n .order-sm-4 {\n -ms-flex-order: 4;\n order: 4;\n }\n .order-sm-5 {\n -ms-flex-order: 5;\n order: 5;\n }\n .order-sm-6 {\n -ms-flex-order: 6;\n order: 6;\n }\n .order-sm-7 {\n -ms-flex-order: 7;\n order: 7;\n }\n .order-sm-8 {\n -ms-flex-order: 8;\n order: 8;\n }\n .order-sm-9 {\n -ms-flex-order: 9;\n order: 9;\n }\n .order-sm-10 {\n -ms-flex-order: 10;\n order: 10;\n }\n .order-sm-11 {\n -ms-flex-order: 11;\n order: 11;\n }\n .order-sm-12 {\n -ms-flex-order: 12;\n order: 12;\n }\n}\n\n@media (min-width: 768px) {\n .col-md {\n -ms-flex-preferred-size: 0;\n flex-basis: 0;\n -ms-flex-positive: 1;\n flex-grow: 1;\n max-width: 100%;\n }\n .col-md-auto {\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n width: auto;\n max-width: none;\n }\n .col-md-1 {\n -ms-flex: 0 0 8.333333%;\n flex: 0 0 8.333333%;\n max-width: 8.333333%;\n }\n .col-md-2 {\n -ms-flex: 0 0 16.666667%;\n flex: 0 0 16.666667%;\n max-width: 16.666667%;\n }\n .col-md-3 {\n -ms-flex: 0 0 25%;\n flex: 0 0 25%;\n max-width: 25%;\n }\n .col-md-4 {\n -ms-flex: 0 0 33.333333%;\n flex: 0 0 33.333333%;\n max-width: 33.333333%;\n }\n .col-md-5 {\n -ms-flex: 0 0 41.666667%;\n flex: 0 0 41.666667%;\n max-width: 41.666667%;\n }\n .col-md-6 {\n -ms-flex: 0 0 50%;\n flex: 0 0 50%;\n max-width: 50%;\n }\n .col-md-7 {\n -ms-flex: 0 0 58.333333%;\n flex: 0 0 58.333333%;\n max-width: 58.333333%;\n }\n .col-md-8 {\n -ms-flex: 0 0 66.666667%;\n flex: 0 0 66.666667%;\n max-width: 66.666667%;\n }\n .col-md-9 {\n -ms-flex: 0 0 75%;\n flex: 0 0 75%;\n max-width: 75%;\n }\n .col-md-10 {\n -ms-flex: 0 0 83.333333%;\n flex: 0 0 83.333333%;\n max-width: 83.333333%;\n }\n .col-md-11 {\n -ms-flex: 0 0 91.666667%;\n flex: 0 0 91.666667%;\n max-width: 91.666667%;\n }\n .col-md-12 {\n -ms-flex: 0 0 100%;\n flex: 0 0 100%;\n max-width: 100%;\n }\n .order-md-1 {\n -ms-flex-order: 1;\n order: 1;\n }\n .order-md-2 {\n -ms-flex-order: 2;\n order: 2;\n }\n .order-md-3 {\n -ms-flex-order: 3;\n order: 3;\n }\n .order-md-4 {\n -ms-flex-order: 4;\n order: 4;\n }\n .order-md-5 {\n -ms-flex-order: 5;\n order: 5;\n }\n .order-md-6 {\n -ms-flex-order: 6;\n order: 6;\n }\n .order-md-7 {\n -ms-flex-order: 7;\n order: 7;\n }\n .order-md-8 {\n -ms-flex-order: 8;\n order: 8;\n }\n .order-md-9 {\n -ms-flex-order: 9;\n order: 9;\n }\n .order-md-10 {\n -ms-flex-order: 10;\n order: 10;\n }\n .order-md-11 {\n -ms-flex-order: 11;\n order: 11;\n }\n .order-md-12 {\n -ms-flex-order: 12;\n order: 12;\n }\n}\n\n@media (min-width: 992px) {\n .col-lg {\n -ms-flex-preferred-size: 0;\n flex-basis: 0;\n -ms-flex-positive: 1;\n flex-grow: 1;\n max-width: 100%;\n }\n .col-lg-auto {\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n width: auto;\n max-width: none;\n }\n .col-lg-1 {\n -ms-flex: 0 0 8.333333%;\n flex: 0 0 8.333333%;\n max-width: 8.333333%;\n }\n .col-lg-2 {\n -ms-flex: 0 0 16.666667%;\n flex: 0 0 16.666667%;\n max-width: 16.666667%;\n }\n .col-lg-3 {\n -ms-flex: 0 0 25%;\n flex: 0 0 25%;\n max-width: 25%;\n }\n .col-lg-4 {\n -ms-flex: 0 0 33.333333%;\n flex: 0 0 33.333333%;\n max-width: 33.333333%;\n }\n .col-lg-5 {\n -ms-flex: 0 0 41.666667%;\n flex: 0 0 41.666667%;\n max-width: 41.666667%;\n }\n .col-lg-6 {\n -ms-flex: 0 0 50%;\n flex: 0 0 50%;\n max-width: 50%;\n }\n .col-lg-7 {\n -ms-flex: 0 0 58.333333%;\n flex: 0 0 58.333333%;\n max-width: 58.333333%;\n }\n .col-lg-8 {\n -ms-flex: 0 0 66.666667%;\n flex: 0 0 66.666667%;\n max-width: 66.666667%;\n }\n .col-lg-9 {\n -ms-flex: 0 0 75%;\n flex: 0 0 75%;\n max-width: 75%;\n }\n .col-lg-10 {\n -ms-flex: 0 0 83.333333%;\n flex: 0 0 83.333333%;\n max-width: 83.333333%;\n }\n .col-lg-11 {\n -ms-flex: 0 0 91.666667%;\n flex: 0 0 91.666667%;\n max-width: 91.666667%;\n }\n .col-lg-12 {\n -ms-flex: 0 0 100%;\n flex: 0 0 100%;\n max-width: 100%;\n }\n .order-lg-1 {\n -ms-flex-order: 1;\n order: 1;\n }\n .order-lg-2 {\n -ms-flex-order: 2;\n order: 2;\n }\n .order-lg-3 {\n -ms-flex-order: 3;\n order: 3;\n }\n .order-lg-4 {\n -ms-flex-order: 4;\n order: 4;\n }\n .order-lg-5 {\n -ms-flex-order: 5;\n order: 5;\n }\n .order-lg-6 {\n -ms-flex-order: 6;\n order: 6;\n }\n .order-lg-7 {\n -ms-flex-order: 7;\n order: 7;\n }\n .order-lg-8 {\n -ms-flex-order: 8;\n order: 8;\n }\n .order-lg-9 {\n -ms-flex-order: 9;\n order: 9;\n }\n .order-lg-10 {\n -ms-flex-order: 10;\n order: 10;\n }\n .order-lg-11 {\n -ms-flex-order: 11;\n order: 11;\n }\n .order-lg-12 {\n -ms-flex-order: 12;\n order: 12;\n }\n}\n\n@media (min-width: 1200px) {\n .col-xl {\n -ms-flex-preferred-size: 0;\n flex-basis: 0;\n -ms-flex-positive: 1;\n flex-grow: 1;\n max-width: 100%;\n }\n .col-xl-auto {\n -ms-flex: 0 0 auto;\n flex: 0 0 auto;\n width: auto;\n max-width: none;\n }\n .col-xl-1 {\n -ms-flex: 0 0 8.333333%;\n flex: 0 0 8.333333%;\n max-width: 8.333333%;\n }\n .col-xl-2 {\n -ms-flex: 0 0 16.666667%;\n flex: 0 0 16.666667%;\n max-width: 16.666667%;\n }\n .col-xl-3 {\n -ms-flex: 0 0 25%;\n flex: 0 0 25%;\n max-width: 25%;\n }\n .col-xl-4 {\n -ms-flex: 0 0 33.333333%;\n flex: 0 0 33.333333%;\n max-width: 33.333333%;\n }\n .col-xl-5 {\n -ms-flex: 0 0 41.666667%;\n flex: 0 0 41.666667%;\n max-width: 41.666667%;\n }\n .col-xl-6 {\n -ms-flex: 0 0 50%;\n flex: 0 0 50%;\n max-width: 50%;\n }\n .col-xl-7 {\n -ms-flex: 0 0 58.333333%;\n flex: 0 0 58.333333%;\n max-width: 58.333333%;\n }\n .col-xl-8 {\n -ms-flex: 0 0 66.666667%;\n flex: 0 0 66.666667%;\n max-width: 66.666667%;\n }\n .col-xl-9 {\n -ms-flex: 0 0 75%;\n flex: 0 0 75%;\n max-width: 75%;\n }\n .col-xl-10 {\n -ms-flex: 0 0 83.333333%;\n flex: 0 0 83.333333%;\n max-width: 83.333333%;\n }\n .col-xl-11 {\n -ms-flex: 0 0 91.666667%;\n flex: 0 0 91.666667%;\n max-width: 91.666667%;\n }\n .col-xl-12 {\n -ms-flex: 0 0 100%;\n flex: 0 0 100%;\n max-width: 100%;\n }\n .order-xl-1 {\n -ms-flex-order: 1;\n order: 1;\n }\n .order-xl-2 {\n -ms-flex-order: 2;\n order: 2;\n }\n .order-xl-3 {\n -ms-flex-order: 3;\n order: 3;\n }\n .order-xl-4 {\n -ms-flex-order: 4;\n order: 4;\n }\n .order-xl-5 {\n -ms-flex-order: 5;\n order: 5;\n }\n .order-xl-6 {\n -ms-flex-order: 6;\n order: 6;\n }\n .order-xl-7 {\n -ms-flex-order: 7;\n order: 7;\n }\n .order-xl-8 {\n -ms-flex-order: 8;\n order: 8;\n }\n .order-xl-9 {\n -ms-flex-order: 9;\n order: 9;\n }\n .order-xl-10 {\n -ms-flex-order: 10;\n order: 10;\n }\n .order-xl-11 {\n -ms-flex-order: 11;\n order: 11;\n }\n .order-xl-12 {\n -ms-flex-order: 12;\n order: 12;\n }\n}\n\n.flex-row {\n -ms-flex-direction: row !important;\n flex-direction: row !important;\n}\n\n.flex-column {\n -ms-flex-direction: column !important;\n flex-direction: column !important;\n}\n\n.flex-row-reverse {\n -ms-flex-direction: row-reverse !important;\n flex-direction: row-reverse !important;\n}\n\n.flex-column-reverse {\n -ms-flex-direction: column-reverse !important;\n flex-direction: column-reverse !important;\n}\n\n.flex-wrap {\n -ms-flex-wrap: wrap !important;\n flex-wrap: wrap !important;\n}\n\n.flex-nowrap {\n -ms-flex-wrap: nowrap !important;\n flex-wrap: nowrap !important;\n}\n\n.flex-wrap-reverse {\n -ms-flex-wrap: wrap-reverse !important;\n flex-wrap: wrap-reverse !important;\n}\n\n.justify-content-start {\n -ms-flex-pack: start !important;\n justify-content: flex-start !important;\n}\n\n.justify-content-end {\n -ms-flex-pack: end !important;\n justify-content: flex-end !important;\n}\n\n.justify-content-center {\n -ms-flex-pack: center !important;\n justify-content: center !important;\n}\n\n.justify-content-between {\n -ms-flex-pack: justify !important;\n justify-content: space-between !important;\n}\n\n.justify-content-around {\n -ms-flex-pack: distribute !important;\n justify-content: space-around !important;\n}\n\n.align-items-start {\n -ms-flex-align: start !important;\n align-items: flex-start !important;\n}\n\n.align-items-end {\n -ms-flex-align: end !important;\n align-items: flex-end !important;\n}\n\n.align-items-center {\n -ms-flex-align: center !important;\n align-items: center !important;\n}\n\n.align-items-baseline {\n -ms-flex-align: baseline !important;\n align-items: baseline !important;\n}\n\n.align-items-stretch {\n -ms-flex-align: stretch !important;\n align-items: stretch !important;\n}\n\n.align-content-start {\n -ms-flex-line-pack: start !important;\n align-content: flex-start !important;\n}\n\n.align-content-end {\n -ms-flex-line-pack: end !important;\n align-content: flex-end !important;\n}\n\n.align-content-center {\n -ms-flex-line-pack: center !important;\n align-content: center !important;\n}\n\n.align-content-between {\n -ms-flex-line-pack: justify !important;\n align-content: space-between !important;\n}\n\n.align-content-around {\n -ms-flex-line-pack: distribute !important;\n align-content: space-around !important;\n}\n\n.align-content-stretch {\n -ms-flex-line-pack: stretch !important;\n align-content: stretch !important;\n}\n\n.align-self-auto {\n -ms-flex-item-align: auto !important;\n align-self: auto !important;\n}\n\n.align-self-start {\n -ms-flex-item-align: start !important;\n align-self: flex-start !important;\n}\n\n.align-self-end {\n -ms-flex-item-align: end !important;\n align-self: flex-end !important;\n}\n\n.align-self-center {\n -ms-flex-item-align: center !important;\n align-self: center !important;\n}\n\n.align-self-baseline {\n -ms-flex-item-align: baseline !important;\n align-self: baseline !important;\n}\n\n.align-self-stretch {\n -ms-flex-item-align: stretch !important;\n align-self: stretch !important;\n}\n\n@media (min-width: 576px) {\n .flex-sm-row {\n -ms-flex-direction: row !important;\n flex-direction: row !important;\n }\n .flex-sm-column {\n -ms-flex-direction: column !important;\n flex-direction: column !important;\n }\n .flex-sm-row-reverse {\n -ms-flex-direction: row-reverse !important;\n flex-direction: row-reverse !important;\n }\n .flex-sm-column-reverse {\n -ms-flex-direction: column-reverse !important;\n flex-direction: column-reverse !important;\n }\n .flex-sm-wrap {\n -ms-flex-wrap: wrap !important;\n flex-wrap: wrap !important;\n }\n .flex-sm-nowrap {\n -ms-flex-wrap: nowrap !important;\n flex-wrap: nowrap !important;\n }\n .flex-sm-wrap-reverse {\n -ms-flex-wrap: wrap-reverse !important;\n flex-wrap: wrap-reverse !important;\n }\n .justify-content-sm-start {\n -ms-flex-pack: start !important;\n justify-content: flex-start !important;\n }\n .justify-content-sm-end {\n -ms-flex-pack: end !important;\n justify-content: flex-end !important;\n }\n .justify-content-sm-center {\n -ms-flex-pack: center !important;\n justify-content: center !important;\n }\n .justify-content-sm-between {\n -ms-flex-pack: justify !important;\n justify-content: space-between !important;\n }\n .justify-content-sm-around {\n -ms-flex-pack: distribute !important;\n justify-content: space-around !important;\n }\n .align-items-sm-start {\n -ms-flex-align: start !important;\n align-items: flex-start !important;\n }\n .align-items-sm-end {\n -ms-flex-align: end !important;\n align-items: flex-end !important;\n }\n .align-items-sm-center {\n -ms-flex-align: center !important;\n align-items: center !important;\n }\n .align-items-sm-baseline {\n -ms-flex-align: baseline !important;\n align-items: baseline !important;\n }\n .align-items-sm-stretch {\n -ms-flex-align: stretch !important;\n align-items: stretch !important;\n }\n .align-content-sm-start {\n -ms-flex-line-pack: start !important;\n align-content: flex-start !important;\n }\n .align-content-sm-end {\n -ms-flex-line-pack: end !important;\n align-content: flex-end !important;\n }\n .align-content-sm-center {\n -ms-flex-line-pack: center !important;\n align-content: center !important;\n }\n .align-content-sm-between {\n -ms-flex-line-pack: justify !important;\n align-content: space-between !important;\n }\n .align-content-sm-around {\n -ms-flex-line-pack: distribute !important;\n align-content: space-around !important;\n }\n .align-content-sm-stretch {\n -ms-flex-line-pack: stretch !important;\n align-content: stretch !important;\n }\n .align-self-sm-auto {\n -ms-flex-item-align: auto !important;\n align-self: auto !important;\n }\n .align-self-sm-start {\n -ms-flex-item-align: start !important;\n align-self: flex-start !important;\n }\n .align-self-sm-end {\n -ms-flex-item-align: end !important;\n align-self: flex-end !important;\n }\n .align-self-sm-center {\n -ms-flex-item-align: center !important;\n align-self: center !important;\n }\n .align-self-sm-baseline {\n -ms-flex-item-align: baseline !important;\n align-self: baseline !important;\n }\n .align-self-sm-stretch {\n -ms-flex-item-align: stretch !important;\n align-self: stretch !important;\n }\n}\n\n@media (min-width: 768px) {\n .flex-md-row {\n -ms-flex-direction: row !important;\n flex-direction: row !important;\n }\n .flex-md-column {\n -ms-flex-direction: column !important;\n flex-direction: column !important;\n }\n .flex-md-row-reverse {\n -ms-flex-direction: row-reverse !important;\n flex-direction: row-reverse !important;\n }\n .flex-md-column-reverse {\n -ms-flex-direction: column-reverse !important;\n flex-direction: column-reverse !important;\n }\n .flex-md-wrap {\n -ms-flex-wrap: wrap !important;\n flex-wrap: wrap !important;\n }\n .flex-md-nowrap {\n -ms-flex-wrap: nowrap !important;\n flex-wrap: nowrap !important;\n }\n .flex-md-wrap-reverse {\n -ms-flex-wrap: wrap-reverse !important;\n flex-wrap: wrap-reverse !important;\n }\n .justify-content-md-start {\n -ms-flex-pack: start !important;\n justify-content: flex-start !important;\n }\n .justify-content-md-end {\n -ms-flex-pack: end !important;\n justify-content: flex-end !important;\n }\n .justify-content-md-center {\n -ms-flex-pack: center !important;\n justify-content: center !important;\n }\n .justify-content-md-between {\n -ms-flex-pack: justify !important;\n justify-content: space-between !important;\n }\n .justify-content-md-around {\n -ms-flex-pack: distribute !important;\n justify-content: space-around !important;\n }\n .align-items-md-start {\n -ms-flex-align: start !important;\n align-items: flex-start !important;\n }\n .align-items-md-end {\n -ms-flex-align: end !important;\n align-items: flex-end !important;\n }\n .align-items-md-center {\n -ms-flex-align: center !important;\n align-items: center !important;\n }\n .align-items-md-baseline {\n -ms-flex-align: baseline !important;\n align-items: baseline !important;\n }\n .align-items-md-stretch {\n -ms-flex-align: stretch !important;\n align-items: stretch !important;\n }\n .align-content-md-start {\n -ms-flex-line-pack: start !important;\n align-content: flex-start !important;\n }\n .align-content-md-end {\n -ms-flex-line-pack: end !important;\n align-content: flex-end !important;\n }\n .align-content-md-center {\n -ms-flex-line-pack: center !important;\n align-content: center !important;\n }\n .align-content-md-between {\n -ms-flex-line-pack: justify !important;\n align-content: space-between !important;\n }\n .align-content-md-around {\n -ms-flex-line-pack: distribute !important;\n align-content: space-around !important;\n }\n .align-content-md-stretch {\n -ms-flex-line-pack: stretch !important;\n align-content: stretch !important;\n }\n .align-self-md-auto {\n -ms-flex-item-align: auto !important;\n align-self: auto !important;\n }\n .align-self-md-start {\n -ms-flex-item-align: start !important;\n align-self: flex-start !important;\n }\n .align-self-md-end {\n -ms-flex-item-align: end !important;\n align-self: flex-end !important;\n }\n .align-self-md-center {\n -ms-flex-item-align: center !important;\n align-self: center !important;\n }\n .align-self-md-baseline {\n -ms-flex-item-align: baseline !important;\n align-self: baseline !important;\n }\n .align-self-md-stretch {\n -ms-flex-item-align: stretch !important;\n align-self: stretch !important;\n }\n}\n\n@media (min-width: 992px) {\n .flex-lg-row {\n -ms-flex-direction: row !important;\n flex-direction: row !important;\n }\n .flex-lg-column {\n -ms-flex-direction: column !important;\n flex-direction: column !important;\n }\n .flex-lg-row-reverse {\n -ms-flex-direction: row-reverse !important;\n flex-direction: row-reverse !important;\n }\n .flex-lg-column-reverse {\n -ms-flex-direction: column-reverse !important;\n flex-direction: column-reverse !important;\n }\n .flex-lg-wrap {\n -ms-flex-wrap: wrap !important;\n flex-wrap: wrap !important;\n }\n .flex-lg-nowrap {\n -ms-flex-wrap: nowrap !important;\n flex-wrap: nowrap !important;\n }\n .flex-lg-wrap-reverse {\n -ms-flex-wrap: wrap-reverse !important;\n flex-wrap: wrap-reverse !important;\n }\n .justify-content-lg-start {\n -ms-flex-pack: start !important;\n justify-content: flex-start !important;\n }\n .justify-content-lg-end {\n -ms-flex-pack: end !important;\n justify-content: flex-end !important;\n }\n .justify-content-lg-center {\n -ms-flex-pack: center !important;\n justify-content: center !important;\n }\n .justify-content-lg-between {\n -ms-flex-pack: justify !important;\n justify-content: space-between !important;\n }\n .justify-content-lg-around {\n -ms-flex-pack: distribute !important;\n justify-content: space-around !important;\n }\n .align-items-lg-start {\n -ms-flex-align: start !important;\n align-items: flex-start !important;\n }\n .align-items-lg-end {\n -ms-flex-align: end !important;\n align-items: flex-end !important;\n }\n .align-items-lg-center {\n -ms-flex-align: center !important;\n align-items: center !important;\n }\n .align-items-lg-baseline {\n -ms-flex-align: baseline !important;\n align-items: baseline !important;\n }\n .align-items-lg-stretch {\n -ms-flex-align: stretch !important;\n align-items: stretch !important;\n }\n .align-content-lg-start {\n -ms-flex-line-pack: start !important;\n align-content: flex-start !important;\n }\n .align-content-lg-end {\n -ms-flex-line-pack: end !important;\n align-content: flex-end !important;\n }\n .align-content-lg-center {\n -ms-flex-line-pack: center !important;\n align-content: center !important;\n }\n .align-content-lg-between {\n -ms-flex-line-pack: justify !important;\n align-content: space-between !important;\n }\n .align-content-lg-around {\n -ms-flex-line-pack: distribute !important;\n align-content: space-around !important;\n }\n .align-content-lg-stretch {\n -ms-flex-line-pack: stretch !important;\n align-content: stretch !important;\n }\n .align-self-lg-auto {\n -ms-flex-item-align: auto !important;\n align-self: auto !important;\n }\n .align-self-lg-start {\n -ms-flex-item-align: start !important;\n align-self: flex-start !important;\n }\n .align-self-lg-end {\n -ms-flex-item-align: end !important;\n align-self: flex-end !important;\n }\n .align-self-lg-center {\n -ms-flex-item-align: center !important;\n align-self: center !important;\n }\n .align-self-lg-baseline {\n -ms-flex-item-align: baseline !important;\n align-self: baseline !important;\n }\n .align-self-lg-stretch {\n -ms-flex-item-align: stretch !important;\n align-self: stretch !important;\n }\n}\n\n@media (min-width: 1200px) {\n .flex-xl-row {\n -ms-flex-direction: row !important;\n flex-direction: row !important;\n }\n .flex-xl-column {\n -ms-flex-direction: column !important;\n flex-direction: column !important;\n }\n .flex-xl-row-reverse {\n -ms-flex-direction: row-reverse !important;\n flex-direction: row-reverse !important;\n }\n .flex-xl-column-reverse {\n -ms-flex-direction: column-reverse !important;\n flex-direction: column-reverse !important;\n }\n .flex-xl-wrap {\n -ms-flex-wrap: wrap !important;\n flex-wrap: wrap !important;\n }\n .flex-xl-nowrap {\n -ms-flex-wrap: nowrap !important;\n flex-wrap: nowrap !important;\n }\n .flex-xl-wrap-reverse {\n -ms-flex-wrap: wrap-reverse !important;\n flex-wrap: wrap-reverse !important;\n }\n .justify-content-xl-start {\n -ms-flex-pack: start !important;\n justify-content: flex-start !important;\n }\n .justify-content-xl-end {\n -ms-flex-pack: end !important;\n justify-content: flex-end !important;\n }\n .justify-content-xl-center {\n -ms-flex-pack: center !important;\n justify-content: center !important;\n }\n .justify-content-xl-between {\n -ms-flex-pack: justify !important;\n justify-content: space-between !important;\n }\n .justify-content-xl-around {\n -ms-flex-pack: distribute !important;\n justify-content: space-around !important;\n }\n .align-items-xl-start {\n -ms-flex-align: start !important;\n align-items: flex-start !important;\n }\n .align-items-xl-end {\n -ms-flex-align: end !important;\n align-items: flex-end !important;\n }\n .align-items-xl-center {\n -ms-flex-align: center !important;\n align-items: center !important;\n }\n .align-items-xl-baseline {\n -ms-flex-align: baseline !important;\n align-items: baseline !important;\n }\n .align-items-xl-stretch {\n -ms-flex-align: stretch !important;\n align-items: stretch !important;\n }\n .align-content-xl-start {\n -ms-flex-line-pack: start !important;\n align-content: flex-start !important;\n }\n .align-content-xl-end {\n -ms-flex-line-pack: end !important;\n align-content: flex-end !important;\n }\n .align-content-xl-center {\n -ms-flex-line-pack: center !important;\n align-content: center !important;\n }\n .align-content-xl-between {\n -ms-flex-line-pack: justify !important;\n align-content: space-between !important;\n }\n .align-content-xl-around {\n -ms-flex-line-pack: distribute !important;\n align-content: space-around !important;\n }\n .align-content-xl-stretch {\n -ms-flex-line-pack: stretch !important;\n align-content: stretch !important;\n }\n .align-self-xl-auto {\n -ms-flex-item-align: auto !important;\n align-self: auto !important;\n }\n .align-self-xl-start {\n -ms-flex-item-align: start !important;\n align-self: flex-start !important;\n }\n .align-self-xl-end {\n -ms-flex-item-align: end !important;\n align-self: flex-end !important;\n }\n .align-self-xl-center {\n -ms-flex-item-align: center !important;\n align-self: center !important;\n }\n .align-self-xl-baseline {\n -ms-flex-item-align: baseline !important;\n align-self: baseline !important;\n }\n .align-self-xl-stretch {\n -ms-flex-item-align: stretch !important;\n align-self: stretch !important;\n }\n}\n/*# sourceMappingURL=bootstrap-grid.css.map */","// Container widths\n//\n// Set the container width, and override it for fixed navbars in media queries.\n\n@if $enable-grid-classes {\n .container {\n @include make-container();\n @include make-container-max-widths();\n }\n}\n\n// Fluid container\n//\n// Utilizes the mixin meant for fixed width containers, but with 100% width for\n// fluid, full width layouts.\n\n@if $enable-grid-classes {\n .container-fluid {\n width: 100%;\n @include make-container();\n }\n}\n\n// Row\n//\n// Rows contain and clear the floats of your columns.\n\n@if $enable-grid-classes {\n .row {\n @include make-row();\n }\n\n // Remove the negative margin from default .row, then the horizontal padding\n // from all immediate children columns (to prevent runaway style inheritance).\n .no-gutters {\n margin-right: 0;\n margin-left: 0;\n\n > .col,\n > [class*=\"col-\"] {\n padding-right: 0;\n padding-left: 0;\n }\n }\n}\n\n// Columns\n//\n// Common styles for small and large grid columns\n\n@if $enable-grid-classes {\n @include make-grid-columns();\n}\n","/// Grid system\n//\n// Generate semantic grid columns with these mixins.\n\n@mixin make-container() {\n margin-right: auto;\n margin-left: auto;\n padding-right: ($grid-gutter-width / 2);\n padding-left: ($grid-gutter-width / 2);\n width: 100%;\n}\n\n\n// For each breakpoint, define the maximum width of the container in a media query\n@mixin make-container-max-widths($max-widths: $container-max-widths, $breakpoints: $grid-breakpoints) {\n @each $breakpoint, $container-max-width in $max-widths {\n @include media-breakpoint-up($breakpoint, $breakpoints) {\n max-width: $container-max-width;\n }\n }\n}\n\n@mixin make-row() {\n display: flex;\n flex-wrap: wrap;\n margin-right: ($grid-gutter-width / -2);\n margin-left: ($grid-gutter-width / -2);\n}\n\n@mixin make-col-ready() {\n position: relative;\n // Prevent columns from becoming too narrow when at smaller grid tiers by\n // always setting `width: 100%;`. This works because we use `flex` values\n // later on to override this initial width.\n width: 100%;\n min-height: 1px; // Prevent collapsing\n padding-right: ($grid-gutter-width / 2);\n padding-left: ($grid-gutter-width / 2);\n}\n\n@mixin make-col($size, $columns: $grid-columns) {\n flex: 0 0 percentage($size / $columns);\n // Add a `max-width` to ensure content within each column does not blow out\n // the width of the column. Applies to IE10+ and Firefox. Chrome and Safari\n // do not appear to require this.\n max-width: percentage($size / $columns);\n}\n","// Breakpoint viewport sizes and media queries.\n//\n// Breakpoints are defined as a map of (name: minimum width), order from small to large:\n//\n// (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px)\n//\n// The map defined in the `$grid-breakpoints` global variable is used as the `$breakpoints` argument by default.\n\n// Name of the next breakpoint, or null for the last breakpoint.\n//\n// >> breakpoint-next(sm)\n// md\n// >> breakpoint-next(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n// md\n// >> breakpoint-next(sm, $breakpoint-names: (xs sm md lg xl))\n// md\n@function breakpoint-next($name, $breakpoints: $grid-breakpoints, $breakpoint-names: map-keys($breakpoints)) {\n $n: index($breakpoint-names, $name);\n @return if($n < length($breakpoint-names), nth($breakpoint-names, $n + 1), null);\n}\n\n// Minimum breakpoint width. Null for the smallest (first) breakpoint.\n//\n// >> breakpoint-min(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n// 576px\n@function breakpoint-min($name, $breakpoints: $grid-breakpoints) {\n $min: map-get($breakpoints, $name);\n @return if($min != 0, $min, null);\n}\n\n// Maximum breakpoint width. Null for the largest (last) breakpoint.\n// The maximum value is calculated as the minimum of the next one less 0.1.\n//\n// >> breakpoint-max(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n// 767px\n@function breakpoint-max($name, $breakpoints: $grid-breakpoints) {\n $next: breakpoint-next($name, $breakpoints);\n @return if($next, breakpoint-min($next, $breakpoints) - 1px, null);\n}\n\n// Returns a blank string if smallest breakpoint, otherwise returns the name with a dash infront.\n// Useful for making responsive utilities.\n//\n// >> breakpoint-infix(xs, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n// \"\" (Returns a blank string)\n// >> breakpoint-infix(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n// \"-sm\"\n@function breakpoint-infix($name, $breakpoints: $grid-breakpoints) {\n @return if(breakpoint-min($name, $breakpoints) == null, \"\", \"-#{$name}\");\n}\n\n// Media of at least the minimum breakpoint width. No query for the smallest breakpoint.\n// Makes the @content apply to the given breakpoint and wider.\n@mixin media-breakpoint-up($name, $breakpoints: $grid-breakpoints) {\n $min: breakpoint-min($name, $breakpoints);\n @if $min {\n @media (min-width: $min) {\n @content;\n }\n } @else {\n @content;\n }\n}\n\n// Media of at most the maximum breakpoint width. No query for the largest breakpoint.\n// Makes the @content apply to the given breakpoint and narrower.\n@mixin media-breakpoint-down($name, $breakpoints: $grid-breakpoints) {\n $max: breakpoint-max($name, $breakpoints);\n @if $max {\n @media (max-width: $max) {\n @content;\n }\n } @else {\n @content;\n }\n}\n\n// Media that spans multiple breakpoint widths.\n// Makes the @content apply between the min and max breakpoints\n@mixin media-breakpoint-between($lower, $upper, $breakpoints: $grid-breakpoints) {\n $min: breakpoint-min($lower, $breakpoints);\n $max: breakpoint-max($upper, $breakpoints);\n\n @media (min-width: $min) and (max-width: $max) {\n @content;\n }\n}\n\n// Media between the breakpoint's minimum and maximum widths.\n// No minimum for the smallest breakpoint, and no maximum for the largest one.\n// Makes the @content apply only to the given breakpoint, not viewports any wider or narrower.\n@mixin media-breakpoint-only($name, $breakpoints: $grid-breakpoints) {\n $min: breakpoint-min($name, $breakpoints);\n $max: breakpoint-max($name, $breakpoints);\n\n @if $min != null and $max != null {\n @media (min-width: $min) and (max-width: $max) {\n @content;\n }\n } @else if $max == null {\n @include media-breakpoint-up($name)\n } @else if $min == null {\n @include media-breakpoint-down($name)\n }\n}\n","// Framework grid generation\n//\n// Used only by Bootstrap to generate the correct number of grid classes given\n// any value of `$grid-columns`.\n\n@mixin make-grid-columns($columns: $grid-columns, $gutter: $grid-gutter-width, $breakpoints: $grid-breakpoints) {\n // Common properties for all breakpoints\n %grid-column {\n position: relative;\n width: 100%;\n min-height: 1px; // Prevent columns from collapsing when empty\n padding-right: ($gutter / 2);\n padding-left: ($gutter / 2);\n }\n\n @each $breakpoint in map-keys($breakpoints) {\n $infix: breakpoint-infix($breakpoint, $breakpoints);\n\n // Allow columns to stretch full width below their breakpoints\n @for $i from 1 through $columns {\n .col#{$infix}-#{$i} {\n @extend %grid-column;\n }\n }\n .col#{$infix},\n .col#{$infix}-auto {\n @extend %grid-column;\n }\n\n @include media-breakpoint-up($breakpoint, $breakpoints) {\n // Provide basic `.col-{bp}` classes for equal-width flexbox columns\n .col#{$infix} {\n flex-basis: 0;\n flex-grow: 1;\n max-width: 100%;\n }\n .col#{$infix}-auto {\n flex: 0 0 auto;\n width: auto;\n max-width: none; // Reset earlier grid tiers\n }\n\n @for $i from 1 through $columns {\n .col#{$infix}-#{$i} {\n @include make-col($i, $columns);\n }\n }\n\n @for $i from 1 through $columns {\n .order#{$infix}-#{$i} {\n order: $i;\n }\n }\n }\n }\n}\n","// Flex variation\n//\n// Custom styles for additional flex alignment options.\n\n@each $breakpoint in map-keys($grid-breakpoints) {\n @include media-breakpoint-up($breakpoint) {\n $infix: breakpoint-infix($breakpoint, $grid-breakpoints);\n\n .flex#{$infix}-row { flex-direction: row !important; }\n .flex#{$infix}-column { flex-direction: column !important; }\n .flex#{$infix}-row-reverse { flex-direction: row-reverse !important; }\n .flex#{$infix}-column-reverse { flex-direction: column-reverse !important; }\n\n .flex#{$infix}-wrap { flex-wrap: wrap !important; }\n .flex#{$infix}-nowrap { flex-wrap: nowrap !important; }\n .flex#{$infix}-wrap-reverse { flex-wrap: wrap-reverse !important; }\n\n .justify-content#{$infix}-start { justify-content: flex-start !important; }\n .justify-content#{$infix}-end { justify-content: flex-end !important; }\n .justify-content#{$infix}-center { justify-content: center !important; }\n .justify-content#{$infix}-between { justify-content: space-between !important; }\n .justify-content#{$infix}-around { justify-content: space-around !important; }\n\n .align-items#{$infix}-start { align-items: flex-start !important; }\n .align-items#{$infix}-end { align-items: flex-end !important; }\n .align-items#{$infix}-center { align-items: center !important; }\n .align-items#{$infix}-baseline { align-items: baseline !important; }\n .align-items#{$infix}-stretch { align-items: stretch !important; }\n\n .align-content#{$infix}-start { align-content: flex-start !important; }\n .align-content#{$infix}-end { align-content: flex-end !important; }\n .align-content#{$infix}-center { align-content: center !important; }\n .align-content#{$infix}-between { align-content: space-between !important; }\n .align-content#{$infix}-around { align-content: space-around !important; }\n .align-content#{$infix}-stretch { align-content: stretch !important; }\n\n .align-self#{$infix}-auto { align-self: auto !important; }\n .align-self#{$infix}-start { align-self: flex-start !important; }\n .align-self#{$infix}-end { align-self: flex-end !important; }\n .align-self#{$infix}-center { align-self: center !important; }\n .align-self#{$infix}-baseline { align-self: baseline !important; }\n .align-self#{$infix}-stretch { align-self: stretch !important; }\n }\n}\n"]} \ No newline at end of file diff --git a/public/vendor/bootstrap/css/bootstrap-reboot.css b/public/vendor/bootstrap/css/bootstrap-reboot.css new file mode 100755 index 000000000..867ee1771 --- /dev/null +++ b/public/vendor/bootstrap/css/bootstrap-reboot.css @@ -0,0 +1,330 @@ +html { + box-sizing: border-box; + font-family: sans-serif; + line-height: 1.15; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; + -ms-overflow-style: scrollbar; + -webkit-tap-highlight-color: transparent; +} + +*, +*::before, +*::after { + box-sizing: inherit; +} + +@-ms-viewport { + width: device-width; +} + +article, aside, dialog, figcaption, figure, footer, header, hgroup, main, nav, section { + display: block; +} + +body { + margin: 0; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; + font-size: 1rem; + font-weight: normal; + line-height: 1.5; + color: #212529; + background-color: #fff; +} + +[tabindex="-1"]:focus { + outline: none !important; +} + +hr { + box-sizing: content-box; + height: 0; + overflow: visible; +} + +h1, h2, h3, h4, h5, h6 { + margin-top: 0; + margin-bottom: .5rem; +} + +p { + margin-top: 0; + margin-bottom: 1rem; +} + +abbr[title], +abbr[data-original-title] { + text-decoration: underline; + -webkit-text-decoration: underline dotted; + text-decoration: underline dotted; + cursor: help; + border-bottom: 0; +} + +address { + margin-bottom: 1rem; + font-style: normal; + line-height: inherit; +} + +ol, +ul, +dl { + margin-top: 0; + margin-bottom: 1rem; +} + +ol ol, +ul ul, +ol ul, +ul ol { + margin-bottom: 0; +} + +dt { + font-weight: bold; +} + +dd { + margin-bottom: .5rem; + margin-left: 0; +} + +blockquote { + margin: 0 0 1rem; +} + +dfn { + font-style: italic; +} + +b, +strong { + font-weight: bolder; +} + +small { + font-size: 80%; +} + +sub, +sup { + position: relative; + font-size: 75%; + line-height: 0; + vertical-align: baseline; +} + +sub { + bottom: -.25em; +} + +sup { + top: -.5em; +} + +a { + color: #007bff; + text-decoration: none; + background-color: transparent; + -webkit-text-decoration-skip: objects; +} + +a:hover { + color: #0056b3; + text-decoration: underline; +} + +a:not([href]):not([tabindex]) { + color: inherit; + text-decoration: none; +} + +a:not([href]):not([tabindex]):focus, a:not([href]):not([tabindex]):hover { + color: inherit; + text-decoration: none; +} + +a:not([href]):not([tabindex]):focus { + outline: 0; +} + +pre, +code, +kbd, +samp { + font-family: monospace, monospace; + font-size: 1em; +} + +pre { + margin-top: 0; + margin-bottom: 1rem; + overflow: auto; +} + +figure { + margin: 0 0 1rem; +} + +img { + vertical-align: middle; + border-style: none; +} + +svg:not(:root) { + overflow: hidden; +} + +a, +area, +button, +[role="button"], +input, +label, +select, +summary, +textarea { + -ms-touch-action: manipulation; + touch-action: manipulation; +} + +table { + border-collapse: collapse; +} + +caption { + padding-top: 0.75rem; + padding-bottom: 0.75rem; + color: #868e96; + text-align: left; + caption-side: bottom; +} + +th { + text-align: left; +} + +label { + display: inline-block; + margin-bottom: .5rem; +} + +button:focus { + outline: 1px dotted; + outline: 5px auto -webkit-focus-ring-color; +} + +input, +button, +select, +optgroup, +textarea { + margin: 0; + font-family: inherit; + font-size: inherit; + line-height: inherit; +} + +button, +input { + overflow: visible; +} + +button, +select { + text-transform: none; +} + +button, +html [type="button"], +[type="reset"], +[type="submit"] { + -webkit-appearance: button; +} + +button::-moz-focus-inner, +[type="button"]::-moz-focus-inner, +[type="reset"]::-moz-focus-inner, +[type="submit"]::-moz-focus-inner { + padding: 0; + border-style: none; +} + +input[type="radio"], +input[type="checkbox"] { + box-sizing: border-box; + padding: 0; +} + +input[type="date"], +input[type="time"], +input[type="datetime-local"], +input[type="month"] { + -webkit-appearance: listbox; +} + +textarea { + overflow: auto; + resize: vertical; +} + +fieldset { + min-width: 0; + padding: 0; + margin: 0; + border: 0; +} + +legend { + display: block; + width: 100%; + max-width: 100%; + padding: 0; + margin-bottom: .5rem; + font-size: 1.5rem; + line-height: inherit; + color: inherit; + white-space: normal; +} + +progress { + vertical-align: baseline; +} + +[type="number"]::-webkit-inner-spin-button, +[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +[type="search"] { + outline-offset: -2px; + -webkit-appearance: none; +} + +[type="search"]::-webkit-search-cancel-button, +[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +::-webkit-file-upload-button { + font: inherit; + -webkit-appearance: button; +} + +output { + display: inline-block; +} + +summary { + display: list-item; +} + +template { + display: none; +} + +[hidden] { + display: none !important; +} +/*# sourceMappingURL=bootstrap-reboot.css.map */ \ No newline at end of file diff --git a/public/vendor/bootstrap/css/bootstrap-reboot.css.map b/public/vendor/bootstrap/css/bootstrap-reboot.css.map new file mode 100755 index 000000000..425ac48c7 --- /dev/null +++ b/public/vendor/bootstrap/css/bootstrap-reboot.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../scss/_reboot.scss","bootstrap-reboot.css","../../scss/_variables.scss","../../scss/mixins/_hover.scss"],"names":[],"mappings":"AAoBA;EACE,uBAAsB;EACtB,wBAAuB;EACvB,kBAAiB;EACjB,+BAA8B;EAC9B,2BAA0B;EAC1B,8BAA6B;EAC7B,yCAA0C;CAC3C;;AAED;;;EAGE,oBAAmB;CACpB;;AAIC;EAAgB,oBAAmB;CCpBpC;;ADwBD;EACE,eAAc;CACf;;AAOD;EACE,UAAS;EACT,wGEoLiH;EFnLjH,gBEuLmB;EFtLnB,oBE0LyB;EFzLzB,iBE6LoB;EF5LpB,eEEgB;EFDhB,uBERW;CFSZ;;ACzBD;EDiCE,yBAAwB;CACzB;;AAQD;EACE,wBAAuB;EACvB,UAAS;EACT,kBAAiB;CAClB;;AAWD;EACE,cAAa;EACb,qBAAoB;CACrB;;AAMD;EACE,cAAa;EACb,oBAAmB;CACpB;;AASD;;EAEE,2BAA0B;EAC1B,0CAAiC;UAAjC,kCAAiC;EACjC,aAAY;EACZ,iBAAgB;CACjB;;AAED;EACE,oBAAmB;EACnB,mBAAkB;EAClB,qBAAoB;CACrB;;AAED;;;EAGE,cAAa;EACb,oBAAmB;CACpB;;AAED;;;;EAIE,iBAAgB;CACjB;;AAED;EACE,kBEqGqB;CFpGtB;;AAED;EACE,qBAAoB;EACpB,eAAc;CACf;;AAED;EACE,iBAAgB;CACjB;;AAED;EACE,mBAAkB;CACnB;;AAED;;EAEE,oBAAmB;CACpB;;AAED;EACE,eAAc;CACf;;AAOD;;EAEE,mBAAkB;EAClB,eAAc;EACd,eAAc;EACd,yBAAwB;CACzB;;AAED;EAAM,eAAc;CAAK;;AACzB;EAAM,WAAU;CAAK;;AAOrB;EACE,eElHe;EFmHf,sBExB0B;EFyB1B,8BAA6B;EAC7B,sCAAqC;CAMtC;;AG1LG;EHuLA,eE5B4C;EF6B5C,2BE5B6B;CC5JR;;AHkMzB;EACE,eAAc;EACd,sBAAqB;CAUtB;;AGnMG;EH4LA,eAAc;EACd,sBAAqB;CG1LpB;;AHoLL;EAUI,WAAU;CACX;;AAQH;;;;EAIE,kCAAiC;EACjC,eAAc;CACf;;AAED;EAEE,cAAa;EAEb,oBAAmB;EAEnB,eAAc;CACf;;AAOD;EAEE,iBAAgB;CACjB;;AAOD;EACE,uBAAsB;EACtB,mBAAkB;CACnB;;AAED;EACE,iBAAgB;CACjB;;AAaD;;;;;;;;;EASE,+BAA0B;MAA1B,2BAA0B;CAC3B;;AAOD;EACE,0BAAyB;CAC1B;;AAED;EACE,qBEEoC;EFDpC,wBECoC;EFApC,eEpPgB;EFqPhB,iBAAgB;EAChB,qBAAoB;CACrB;;AAED;EAEE,iBAAgB;CACjB;;AAOD;EAEE,sBAAqB;EACrB,qBAAoB;CACrB;;AAMD;EACE,oBAAmB;EACnB,2CAA0C;CAC3C;;AAED;;;;;EAKE,UAAS;EACT,qBAAoB;EACpB,mBAAkB;EAClB,qBAAoB;CACrB;;AAED;;EAEE,kBAAiB;CAClB;;AAED;;EAEE,qBAAoB;CACrB;;AAKD;;;;EAIE,2BAA0B;CAC3B;;AAGD;;;;EAIE,WAAU;EACV,mBAAkB;CACnB;;AAED;;EAEE,uBAAsB;EACtB,WAAU;CACX;;AAGD;;;;EASE,4BAA2B;CAC5B;;AAED;EACE,eAAc;EAEd,iBAAgB;CACjB;;AAED;EAME,aAAY;EAEZ,WAAU;EACV,UAAS;EACT,UAAS;CACV;;AAID;EACE,eAAc;EACd,YAAW;EACX,gBAAe;EACf,WAAU;EACV,qBAAoB;EACpB,kBAAiB;EACjB,qBAAoB;EACpB,eAAc;EACd,oBAAmB;CACpB;;AAED;EACE,yBAAwB;CACzB;;ACpID;;EDyIE,aAAY;CACb;;ACrID;ED4IE,qBAAoB;EACpB,yBAAwB;CACzB;;ACzID;;EDiJE,yBAAwB;CACzB;;AAOD;EACE,cAAa;EACb,2BAA0B;CAC3B;;AAMD;EACE,sBAAqB;CACtB;;AAED;EACE,mBAAkB;CACnB;;AAED;EACE,cAAa;CACd;;ACtJD;ED2JE,yBAAwB;CACzB","file":"bootstrap-reboot.css","sourcesContent":["// scss-lint:disable QualifyingElement, DuplicateProperty, VendorPrefix\n\n// Reboot\n//\n// Normalization of HTML elements, manually forked from Normalize.css to remove\n// styles targeting irrelevant browsers while applying new styles.\n//\n// Normalize is licensed MIT. https://github.com/necolas/normalize.css\n\n\n// Document\n//\n// 1. Change from `box-sizing: content-box` so that `width` is not affected by `padding` or `border`.\n// 2. Change the default font family in all browsers.\n// 3. Correct the line height in all browsers.\n// 4. Prevent adjustments of font size after orientation changes in IE on Windows Phone and in iOS.\n// 5. Setting @viewport causes scrollbars to overlap content in IE11 and Edge, so\n// we force a non-overlapping, non-auto-hiding scrollbar to counteract.\n// 6. Change the default tap highlight to be completely transparent in iOS.\n\nhtml {\n box-sizing: border-box; // 1\n font-family: sans-serif; // 2\n line-height: 1.15; // 3\n -webkit-text-size-adjust: 100%; // 4\n -ms-text-size-adjust: 100%; // 4\n -ms-overflow-style: scrollbar; // 5\n -webkit-tap-highlight-color: rgba(0,0,0,0); // 6\n}\n\n*,\n*::before,\n*::after {\n box-sizing: inherit; // 1\n}\n\n// IE10+ doesn't honor `` in some cases.\n@at-root {\n @-ms-viewport { width: device-width; }\n}\n\n// Shim for \"new\" HTML5 structural elements to display correctly (IE10, older browsers)\narticle, aside, dialog, figcaption, figure, footer, header, hgroup, main, nav, section {\n display: block;\n}\n\n// Body\n//\n// 1. Remove the margin in all browsers.\n// 2. As a best practice, apply a default `background-color`.\n\nbody {\n margin: 0; // 1\n font-family: $font-family-base;\n font-size: $font-size-base;\n font-weight: $font-weight-base;\n line-height: $line-height-base;\n color: $body-color;\n background-color: $body-bg; // 2\n}\n\n// Suppress the focus outline on elements that cannot be accessed via keyboard.\n// This prevents an unwanted focus outline from appearing around elements that\n// might still respond to pointer events.\n//\n// Credit: https://github.com/suitcss/base\n[tabindex=\"-1\"]:focus {\n outline: none !important;\n}\n\n\n// Content grouping\n//\n// 1. Add the correct box sizing in Firefox.\n// 2. Show the overflow in Edge and IE.\n\nhr {\n box-sizing: content-box; // 1\n height: 0; // 1\n overflow: visible; // 2\n}\n\n\n//\n// Typography\n//\n\n// Remove top margins from headings\n//\n// By default, `

    `-`

    ` all receive top and bottom margins. We nuke the top\n// margin for easier control within type scales as it avoids margin collapsing.\nh1, h2, h3, h4, h5, h6 {\n margin-top: 0;\n margin-bottom: .5rem;\n}\n\n// Reset margins on paragraphs\n//\n// Similarly, the top margin on `

    `s get reset. However, we also reset the\n// bottom margin to use `rem` units instead of `em`.\np {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\n// Abbreviations\n//\n// 1. Remove the bottom border in Firefox 39-.\n// 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.\n// 3. Add explicit cursor to indicate changed behavior.\n// 4. Duplicate behavior to the data-* attribute for our tooltip plugin\n\nabbr[title],\nabbr[data-original-title] { // 4\n text-decoration: underline; // 2\n text-decoration: underline dotted; // 2\n cursor: help; // 3\n border-bottom: 0; // 1\n}\n\naddress {\n margin-bottom: 1rem;\n font-style: normal;\n line-height: inherit;\n}\n\nol,\nul,\ndl {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nol ol,\nul ul,\nol ul,\nul ol {\n margin-bottom: 0;\n}\n\ndt {\n font-weight: $dt-font-weight;\n}\n\ndd {\n margin-bottom: .5rem;\n margin-left: 0; // Undo browser default\n}\n\nblockquote {\n margin: 0 0 1rem;\n}\n\ndfn {\n font-style: italic; // Add the correct font style in Android 4.3-\n}\n\nb,\nstrong {\n font-weight: bolder; // Add the correct font weight in Chrome, Edge, and Safari\n}\n\nsmall {\n font-size: 80%; // Add the correct font size in all browsers\n}\n\n//\n// Prevent `sub` and `sup` elements from affecting the line height in\n// all browsers.\n//\n\nsub,\nsup {\n position: relative;\n font-size: 75%;\n line-height: 0;\n vertical-align: baseline;\n}\n\nsub { bottom: -.25em; }\nsup { top: -.5em; }\n\n\n//\n// Links\n//\n\na {\n color: $link-color;\n text-decoration: $link-decoration;\n background-color: transparent; // Remove the gray background on active links in IE 10.\n -webkit-text-decoration-skip: objects; // Remove gaps in links underline in iOS 8+ and Safari 8+.\n\n @include hover {\n color: $link-hover-color;\n text-decoration: $link-hover-decoration;\n }\n}\n\n// And undo these styles for placeholder links/named anchors (without href)\n// which have not been made explicitly keyboard-focusable (without tabindex).\n// It would be more straightforward to just use a[href] in previous block, but that\n// causes specificity issues in many other styles that are too complex to fix.\n// See https://github.com/twbs/bootstrap/issues/19402\n\na:not([href]):not([tabindex]) {\n color: inherit;\n text-decoration: none;\n\n @include hover-focus {\n color: inherit;\n text-decoration: none;\n }\n\n &:focus {\n outline: 0;\n }\n}\n\n\n//\n// Code\n//\n\npre,\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace; // Correct the inheritance and scaling of font size in all browsers.\n font-size: 1em; // Correct the odd `em` font sizing in all browsers.\n}\n\npre {\n // Remove browser default top margin\n margin-top: 0;\n // Reset browser default of `1em` to use `rem`s\n margin-bottom: 1rem;\n // Don't allow content to break outside\n overflow: auto;\n}\n\n\n//\n// Figures\n//\n\nfigure {\n // Apply a consistent margin strategy (matches our type styles).\n margin: 0 0 1rem;\n}\n\n\n//\n// Images and content\n//\n\nimg {\n vertical-align: middle;\n border-style: none; // Remove the border on images inside links in IE 10-.\n}\n\nsvg:not(:root) {\n overflow: hidden; // Hide the overflow in IE\n}\n\n\n// Avoid 300ms click delay on touch devices that support the `touch-action` CSS property.\n//\n// In particular, unlike most other browsers, IE11+Edge on Windows 10 on touch devices and IE Mobile 10-11\n// DON'T remove the click delay when `` is present.\n// However, they DO support removing the click delay via `touch-action: manipulation`.\n// See:\n// * https://v4-alpha.getbootstrap.com/content/reboot/#click-delay-optimization-for-touch\n// * http://caniuse.com/#feat=css-touch-action\n// * https://patrickhlauke.github.io/touch/tests/results/#suppressing-300ms-delay\n\na,\narea,\nbutton,\n[role=\"button\"],\ninput,\nlabel,\nselect,\nsummary,\ntextarea {\n touch-action: manipulation;\n}\n\n\n//\n// Tables\n//\n\ntable {\n border-collapse: collapse; // Prevent double borders\n}\n\ncaption {\n padding-top: $table-cell-padding;\n padding-bottom: $table-cell-padding;\n color: $text-muted;\n text-align: left;\n caption-side: bottom;\n}\n\nth {\n // Matches default `` alignment\n text-align: left;\n}\n\n\n//\n// Forms\n//\n\nlabel {\n // Allow labels to use `margin` for spacing.\n display: inline-block;\n margin-bottom: .5rem;\n}\n\n// Work around a Firefox/IE bug where the transparent `button` background\n// results in a loss of the default `button` focus styles.\n//\n// Credit: https://github.com/suitcss/base/\nbutton:focus {\n outline: 1px dotted;\n outline: 5px auto -webkit-focus-ring-color;\n}\n\ninput,\nbutton,\nselect,\noptgroup,\ntextarea {\n margin: 0; // Remove the margin in Firefox and Safari\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n}\n\nbutton,\ninput {\n overflow: visible; // Show the overflow in Edge\n}\n\nbutton,\nselect {\n text-transform: none; // Remove the inheritance of text transform in Firefox\n}\n\n// 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`\n// controls in Android 4.\n// 2. Correct the inability to style clickable types in iOS and Safari.\nbutton,\nhtml [type=\"button\"], // 1\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button; // 2\n}\n\n// Remove inner border and padding from Firefox, but don't restore the outline like Normalize.\nbutton::-moz-focus-inner,\n[type=\"button\"]::-moz-focus-inner,\n[type=\"reset\"]::-moz-focus-inner,\n[type=\"submit\"]::-moz-focus-inner {\n padding: 0;\n border-style: none;\n}\n\ninput[type=\"radio\"],\ninput[type=\"checkbox\"] {\n box-sizing: border-box; // 1. Add the correct box sizing in IE 10-\n padding: 0; // 2. Remove the padding in IE 10-\n}\n\n\ninput[type=\"date\"],\ninput[type=\"time\"],\ninput[type=\"datetime-local\"],\ninput[type=\"month\"] {\n // Remove the default appearance of temporal inputs to avoid a Mobile Safari\n // bug where setting a custom line-height prevents text from being vertically\n // centered within the input.\n // See https://bugs.webkit.org/show_bug.cgi?id=139848\n // and https://github.com/twbs/bootstrap/issues/11266\n -webkit-appearance: listbox;\n}\n\ntextarea {\n overflow: auto; // Remove the default vertical scrollbar in IE.\n // Textareas should really only resize vertically so they don't break their (horizontal) containers.\n resize: vertical;\n}\n\nfieldset {\n // Browsers set a default `min-width: min-content;` on fieldsets,\n // unlike e.g. `

    `s, which have `min-width: 0;` by default.\n // So we reset that to ensure fieldsets behave more like a standard block element.\n // See https://github.com/twbs/bootstrap/issues/12359\n // and https://html.spec.whatwg.org/multipage/#the-fieldset-and-legend-elements\n min-width: 0;\n // Reset the default outline behavior of fieldsets so they don't affect page layout.\n padding: 0;\n margin: 0;\n border: 0;\n}\n\n// 1. Correct the text wrapping in Edge and IE.\n// 2. Correct the color inheritance from `fieldset` elements in IE.\nlegend {\n display: block;\n width: 100%;\n max-width: 100%; // 1\n padding: 0;\n margin-bottom: .5rem;\n font-size: 1.5rem;\n line-height: inherit;\n color: inherit; // 2\n white-space: normal; // 1\n}\n\nprogress {\n vertical-align: baseline; // Add the correct vertical alignment in Chrome, Firefox, and Opera.\n}\n\n// Correct the cursor style of increment and decrement buttons in Chrome.\n[type=\"number\"]::-webkit-inner-spin-button,\n[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n[type=\"search\"] {\n // This overrides the extra rounded corners on search inputs in iOS so that our\n // `.form-control` class can properly style them. Note that this cannot simply\n // be added to `.form-control` as it's not specific enough. For details, see\n // https://github.com/twbs/bootstrap/issues/11586.\n outline-offset: -2px; // 2. Correct the outline style in Safari.\n -webkit-appearance: none;\n}\n\n//\n// Remove the inner padding and cancel buttons in Chrome and Safari on macOS.\n//\n\n[type=\"search\"]::-webkit-search-cancel-button,\n[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n//\n// 1. Correct the inability to style clickable types in iOS and Safari.\n// 2. Change font properties to `inherit` in Safari.\n//\n\n::-webkit-file-upload-button {\n font: inherit; // 2\n -webkit-appearance: button; // 1\n}\n\n//\n// Correct element displays\n//\n\noutput {\n display: inline-block;\n}\n\nsummary {\n display: list-item; // Add the correct display in all browsers\n}\n\ntemplate {\n display: none; // Add the correct display in IE\n}\n\n// Always hide an element with the `hidden` HTML attribute (from PureCSS).\n// Needed for proper display in IE 10-.\n[hidden] {\n display: none !important;\n}\n","html {\n box-sizing: border-box;\n font-family: sans-serif;\n line-height: 1.15;\n -webkit-text-size-adjust: 100%;\n -ms-text-size-adjust: 100%;\n -ms-overflow-style: scrollbar;\n -webkit-tap-highlight-color: transparent;\n}\n\n*,\n*::before,\n*::after {\n box-sizing: inherit;\n}\n\n@-ms-viewport {\n width: device-width;\n}\n\narticle, aside, dialog, figcaption, figure, footer, header, hgroup, main, nav, section {\n display: block;\n}\n\nbody {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;\n font-size: 1rem;\n font-weight: normal;\n line-height: 1.5;\n color: #212529;\n background-color: #fff;\n}\n\n[tabindex=\"-1\"]:focus {\n outline: none !important;\n}\n\nhr {\n box-sizing: content-box;\n height: 0;\n overflow: visible;\n}\n\nh1, h2, h3, h4, h5, h6 {\n margin-top: 0;\n margin-bottom: .5rem;\n}\n\np {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nabbr[title],\nabbr[data-original-title] {\n text-decoration: underline;\n text-decoration: underline dotted;\n cursor: help;\n border-bottom: 0;\n}\n\naddress {\n margin-bottom: 1rem;\n font-style: normal;\n line-height: inherit;\n}\n\nol,\nul,\ndl {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nol ol,\nul ul,\nol ul,\nul ol {\n margin-bottom: 0;\n}\n\ndt {\n font-weight: bold;\n}\n\ndd {\n margin-bottom: .5rem;\n margin-left: 0;\n}\n\nblockquote {\n margin: 0 0 1rem;\n}\n\ndfn {\n font-style: italic;\n}\n\nb,\nstrong {\n font-weight: bolder;\n}\n\nsmall {\n font-size: 80%;\n}\n\nsub,\nsup {\n position: relative;\n font-size: 75%;\n line-height: 0;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -.25em;\n}\n\nsup {\n top: -.5em;\n}\n\na {\n color: #007bff;\n text-decoration: none;\n background-color: transparent;\n -webkit-text-decoration-skip: objects;\n}\n\na:hover {\n color: #0056b3;\n text-decoration: underline;\n}\n\na:not([href]):not([tabindex]) {\n color: inherit;\n text-decoration: none;\n}\n\na:not([href]):not([tabindex]):focus, a:not([href]):not([tabindex]):hover {\n color: inherit;\n text-decoration: none;\n}\n\na:not([href]):not([tabindex]):focus {\n outline: 0;\n}\n\npre,\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace;\n font-size: 1em;\n}\n\npre {\n margin-top: 0;\n margin-bottom: 1rem;\n overflow: auto;\n}\n\nfigure {\n margin: 0 0 1rem;\n}\n\nimg {\n vertical-align: middle;\n border-style: none;\n}\n\nsvg:not(:root) {\n overflow: hidden;\n}\n\na,\narea,\nbutton,\n[role=\"button\"],\ninput,\nlabel,\nselect,\nsummary,\ntextarea {\n touch-action: manipulation;\n}\n\ntable {\n border-collapse: collapse;\n}\n\ncaption {\n padding-top: 0.75rem;\n padding-bottom: 0.75rem;\n color: #868e96;\n text-align: left;\n caption-side: bottom;\n}\n\nth {\n text-align: left;\n}\n\nlabel {\n display: inline-block;\n margin-bottom: .5rem;\n}\n\nbutton:focus {\n outline: 1px dotted;\n outline: 5px auto -webkit-focus-ring-color;\n}\n\ninput,\nbutton,\nselect,\noptgroup,\ntextarea {\n margin: 0;\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n}\n\nbutton,\ninput {\n overflow: visible;\n}\n\nbutton,\nselect {\n text-transform: none;\n}\n\nbutton,\nhtml [type=\"button\"],\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button;\n}\n\nbutton::-moz-focus-inner,\n[type=\"button\"]::-moz-focus-inner,\n[type=\"reset\"]::-moz-focus-inner,\n[type=\"submit\"]::-moz-focus-inner {\n padding: 0;\n border-style: none;\n}\n\ninput[type=\"radio\"],\ninput[type=\"checkbox\"] {\n box-sizing: border-box;\n padding: 0;\n}\n\ninput[type=\"date\"],\ninput[type=\"time\"],\ninput[type=\"datetime-local\"],\ninput[type=\"month\"] {\n -webkit-appearance: listbox;\n}\n\ntextarea {\n overflow: auto;\n resize: vertical;\n}\n\nfieldset {\n min-width: 0;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\nlegend {\n display: block;\n width: 100%;\n max-width: 100%;\n padding: 0;\n margin-bottom: .5rem;\n font-size: 1.5rem;\n line-height: inherit;\n color: inherit;\n white-space: normal;\n}\n\nprogress {\n vertical-align: baseline;\n}\n\n[type=\"number\"]::-webkit-inner-spin-button,\n[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n[type=\"search\"] {\n outline-offset: -2px;\n -webkit-appearance: none;\n}\n\n[type=\"search\"]::-webkit-search-cancel-button,\n[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n::-webkit-file-upload-button {\n font: inherit;\n -webkit-appearance: button;\n}\n\noutput {\n display: inline-block;\n}\n\nsummary {\n display: list-item;\n}\n\ntemplate {\n display: none;\n}\n\n[hidden] {\n display: none !important;\n}\n\n/*# sourceMappingURL=bootstrap-reboot.css.map */","// Variables\n//\n// Copy settings from this file into the provided `_custom.scss` to override\n// the Bootstrap defaults without modifying key, versioned files.\n//\n// Variables should follow the `$component-state-property-size` formula for\n// consistent naming. Ex: $nav-link-disabled-color and $modal-content-box-shadow-xs.\n\n// Table of Contents\n//\n// Color system\n// Options\n// Spacing\n// Body\n// Links\n// Grid breakpoints\n// Grid containers\n// Grid columns\n// Fonts\n// Components\n// Tables\n// Buttons\n// Forms\n// Dropdowns\n// Z-index master list\n// Navs\n// Navbar\n// Pagination\n// Jumbotron\n// Form states and alerts\n// Cards\n// Tooltips\n// Popovers\n// Badges\n// Modals\n// Alerts\n// Progress bars\n// List group\n// Image thumbnails\n// Figures\n// Breadcrumbs\n// Carousel\n// Close\n// Code\n\n\n//\n// Color system\n//\n\n$white: #fff !default;\n$gray-100: #f8f9fa !default;\n$gray-200: #e9ecef !default;\n$gray-300: #dee2e6 !default;\n$gray-400: #ced4da !default;\n$gray-500: #adb5bd !default;\n$gray-600: #868e96 !default;\n$gray-700: #495057 !default;\n$gray-800: #343a40 !default;\n$gray-900: #212529 !default;\n$black: #000 !default;\n\n$grays: (\n 100: $gray-100,\n 200: $gray-200,\n 300: $gray-300,\n 400: $gray-400,\n 500: $gray-500,\n 600: $gray-600,\n 700: $gray-700,\n 800: $gray-800,\n 900: $gray-900\n) !default;\n\n$blue: #007bff !default;\n$indigo: #6610f2 !default;\n$purple: #6f42c1 !default;\n$pink: #e83e8c !default;\n$red: #dc3545 !default;\n$orange: #fd7e14 !default;\n$yellow: #ffc107 !default;\n$green: #28a745 !default;\n$teal: #20c997 !default;\n$cyan: #17a2b8 !default;\n\n$colors: (\n blue: $blue,\n indigo: $indigo,\n purple: $purple,\n pink: $pink,\n red: $red,\n orange: $orange,\n yellow: $yellow,\n green: $green,\n teal: $teal,\n cyan: $cyan,\n white: $white,\n gray: $gray-600,\n gray-dark: $gray-800\n) !default;\n\n$theme-colors: (\n primary: $blue,\n secondary: $gray-600,\n success: $green,\n info: $cyan,\n warning: $yellow,\n danger: $red,\n light: $gray-100,\n dark: $gray-800\n) !default;\n\n// Set a specific jump point for requesting color jumps\n$theme-color-interval: 8% !default;\n\n\n// Options\n//\n// Quickly modify global styling by enabling or disabling optional features.\n\n$enable-rounded: true !default;\n$enable-shadows: false !default;\n$enable-gradients: false !default;\n$enable-transitions: true !default;\n$enable-hover-media-query: false !default;\n$enable-grid-classes: true !default;\n$enable-print-styles: true !default;\n\n\n// Spacing\n//\n// Control the default styling of most Bootstrap elements by modifying these\n// variables. Mostly focused on spacing.\n// You can add more entries to the $spacers map, should you need more variation.\n\n$spacer: 1rem !default;\n$spacers: (\n 0: 0,\n 1: ($spacer * .25),\n 2: ($spacer * .5),\n 3: $spacer,\n 4: ($spacer * 1.5),\n 5: ($spacer * 3)\n) !default;\n\n// This variable affects the `.h-*` and `.w-*` classes.\n$sizes: (\n 25: 25%,\n 50: 50%,\n 75: 75%,\n 100: 100%\n) !default;\n\n// Body\n//\n// Settings for the `` element.\n\n$body-bg: $white !default;\n$body-color: $gray-900 !default;\n\n// Links\n//\n// Style anchor elements.\n\n$link-color: theme-color(\"primary\") !default;\n$link-decoration: none !default;\n$link-hover-color: darken($link-color, 15%) !default;\n$link-hover-decoration: underline !default;\n\n\n// Grid breakpoints\n//\n// Define the minimum dimensions at which your layout will change,\n// adapting to different screen sizes, for use in media queries.\n\n$grid-breakpoints: (\n xs: 0,\n sm: 576px,\n md: 768px,\n lg: 992px,\n xl: 1200px\n) !default;\n@include _assert-ascending($grid-breakpoints, \"$grid-breakpoints\");\n@include _assert-starts-at-zero($grid-breakpoints);\n\n\n// Grid containers\n//\n// Define the maximum width of `.container` for different screen sizes.\n\n$container-max-widths: (\n sm: 540px,\n md: 720px,\n lg: 960px,\n xl: 1140px\n) !default;\n@include _assert-ascending($container-max-widths, \"$container-max-widths\");\n\n\n// Grid columns\n//\n// Set the number of columns and specify the width of the gutters.\n\n$grid-columns: 12 !default;\n$grid-gutter-width: 30px !default;\n\n// Components\n//\n// Define common padding and border radius sizes and more.\n\n$line-height-lg: 1.5 !default;\n$line-height-sm: 1.5 !default;\n\n$border-width: 1px !default;\n\n$border-radius: .25rem !default;\n$border-radius-lg: .3rem !default;\n$border-radius-sm: .2rem !default;\n\n$component-active-color: $white !default;\n$component-active-bg: theme-color(\"primary\") !default;\n\n$caret-width: .3em !default;\n\n$transition-base: all .2s ease-in-out !default;\n$transition-fade: opacity .15s linear !default;\n$transition-collapse: height .35s ease !default;\n\n\n// Fonts\n//\n// Font, line-height, and color for body text, headings, and more.\n\n$font-family-sans-serif: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif !default;\n$font-family-monospace: Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace !default;\n$font-family-base: $font-family-sans-serif !default;\n\n$font-size-base: 1rem !default; // Assumes the browser default, typically `16px`\n$font-size-lg: 1.25rem !default;\n$font-size-sm: .875rem !default;\n\n$font-weight-normal: normal !default;\n$font-weight-bold: bold !default;\n\n$font-weight-base: $font-weight-normal !default;\n$line-height-base: 1.5 !default;\n\n$h1-font-size: 2.5rem !default;\n$h2-font-size: 2rem !default;\n$h3-font-size: 1.75rem !default;\n$h4-font-size: 1.5rem !default;\n$h5-font-size: 1.25rem !default;\n$h6-font-size: 1rem !default;\n\n$headings-margin-bottom: ($spacer / 2) !default;\n$headings-font-family: inherit !default;\n$headings-font-weight: 500 !default;\n$headings-line-height: 1.1 !default;\n$headings-color: inherit !default;\n\n$display1-size: 6rem !default;\n$display2-size: 5.5rem !default;\n$display3-size: 4.5rem !default;\n$display4-size: 3.5rem !default;\n\n$display1-weight: 300 !default;\n$display2-weight: 300 !default;\n$display3-weight: 300 !default;\n$display4-weight: 300 !default;\n$display-line-height: $headings-line-height !default;\n\n$lead-font-size: 1.25rem !default;\n$lead-font-weight: 300 !default;\n\n$small-font-size: 80% !default;\n\n$text-muted: $gray-600 !default;\n\n$blockquote-small-color: $gray-600 !default;\n$blockquote-font-size: ($font-size-base * 1.25) !default;\n\n$hr-border-color: rgba($black,.1) !default;\n$hr-border-width: $border-width !default;\n\n$mark-padding: .2em !default;\n\n$dt-font-weight: $font-weight-bold !default;\n\n$kbd-box-shadow: inset 0 -.1rem 0 rgba($black,.25) !default;\n$nested-kbd-font-weight: $font-weight-bold !default;\n\n$list-inline-padding: 5px !default;\n\n$mark-bg: #fcf8e3 !default;\n\n\n// Tables\n//\n// Customizes the `.table` component with basic values, each used across all table variations.\n\n$table-cell-padding: .75rem !default;\n$table-cell-padding-sm: .3rem !default;\n\n$table-bg: transparent !default;\n$table-accent-bg: rgba($black,.05) !default;\n$table-hover-bg: rgba($black,.075) !default;\n$table-active-bg: $table-hover-bg !default;\n\n$table-border-width: $border-width !default;\n$table-border-color: $gray-200 !default;\n\n$table-head-bg: $gray-200 !default;\n$table-head-color: $gray-700 !default;\n\n$table-inverse-bg: $gray-900 !default;\n$table-inverse-accent-bg: rgba($white, .05) !default;\n$table-inverse-hover-bg: rgba($white, .075) !default;\n$table-inverse-border-color: lighten($gray-900, 7.5%) !default;\n$table-inverse-color: $body-bg !default;\n\n\n// Buttons\n//\n// For each of Bootstrap's buttons, define text, background and border color.\n\n$input-btn-padding-y: .5rem !default;\n$input-btn-padding-x: .75rem !default;\n$input-btn-line-height: 1.25 !default;\n\n$input-btn-padding-y-sm: .25rem !default;\n$input-btn-padding-x-sm: .5rem !default;\n$input-btn-line-height-sm: 1.5 !default;\n\n$input-btn-padding-y-lg: .5rem !default;\n$input-btn-padding-x-lg: 1rem !default;\n$input-btn-line-height-lg: 1.5 !default;\n\n$btn-font-weight: $font-weight-normal !default;\n$btn-box-shadow: inset 0 1px 0 rgba($white,.15), 0 1px 1px rgba($black,.075) !default;\n$btn-focus-box-shadow: 0 0 0 3px rgba(theme-color(\"primary\"), .25) !default;\n$btn-active-box-shadow: inset 0 3px 5px rgba($black,.125) !default;\n\n$btn-link-disabled-color: $gray-600 !default;\n\n$btn-block-spacing-y: .5rem !default;\n\n// Allows for customizing button radius independently from global border radius\n$btn-border-radius: $border-radius !default;\n$btn-border-radius-lg: $border-radius-lg !default;\n$btn-border-radius-sm: $border-radius-sm !default;\n\n$btn-transition: all .15s ease-in-out !default;\n\n\n// Forms\n\n$input-bg: $white !default;\n$input-disabled-bg: $gray-200 !default;\n\n$input-color: $gray-700 !default;\n$input-border-color: rgba($black,.15) !default;\n$input-btn-border-width: $border-width !default; // For form controls and buttons\n$input-box-shadow: inset 0 1px 1px rgba($black,.075) !default;\n\n$input-border-radius: $border-radius !default;\n$input-border-radius-lg: $border-radius-lg !default;\n$input-border-radius-sm: $border-radius-sm !default;\n\n$input-focus-bg: $input-bg !default;\n$input-focus-border-color: lighten(theme-color(\"primary\"), 25%) !default;\n$input-focus-box-shadow: $input-box-shadow, $btn-focus-box-shadow !default;\n$input-focus-color: $input-color !default;\n\n$input-placeholder-color: $gray-600 !default;\n\n$input-height-border: $input-btn-border-width * 2 !default;\n\n$input-height-inner: ($font-size-base * $input-btn-line-height) + ($input-btn-padding-y * 2) !default;\n$input-height: calc(#{$input-height-inner} + #{$input-height-border}) !default;\n\n$input-height-inner-sm: ($font-size-sm * $input-btn-line-height-sm) + ($input-btn-padding-y-sm * 2) !default;\n$input-height-sm: calc(#{$input-height-inner-sm} + #{$input-height-border}) !default;\n\n$input-height-inner-lg: ($font-size-sm * $input-btn-line-height-lg) + ($input-btn-padding-y-lg * 2) !default;\n$input-height-lg: calc(#{$input-height-inner-lg} + #{$input-height-border}) !default;\n\n$input-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s !default;\n\n$form-text-margin-top: .25rem !default;\n\n$form-check-margin-bottom: .5rem !default;\n$form-check-input-gutter: 1.25rem !default;\n$form-check-input-margin-y: .25rem !default;\n$form-check-input-margin-x: .25rem !default;\n\n$form-check-inline-margin-x: .75rem !default;\n\n$form-group-margin-bottom: 1rem !default;\n\n$input-group-addon-bg: $gray-200 !default;\n$input-group-addon-border-color: $input-border-color !default;\n\n$custom-control-gutter: 1.5rem !default;\n$custom-control-spacer-y: .25rem !default;\n$custom-control-spacer-x: 1rem !default;\n\n$custom-control-indicator-size: 1rem !default;\n$custom-control-indicator-bg: #ddd !default;\n$custom-control-indicator-bg-size: 50% 50% !default;\n$custom-control-indicator-box-shadow: inset 0 .25rem .25rem rgba($black,.1) !default;\n\n$custom-control-indicator-disabled-bg: $gray-200 !default;\n$custom-control-description-disabled-color: $gray-600 !default;\n\n$custom-control-indicator-checked-color: $white !default;\n$custom-control-indicator-checked-bg: theme-color(\"primary\") !default;\n$custom-control-indicator-checked-box-shadow: none !default;\n\n$custom-control-indicator-focus-box-shadow: 0 0 0 1px $body-bg, 0 0 0 3px theme-color(\"primary\") !default;\n\n$custom-control-indicator-active-color: $white !default;\n$custom-control-indicator-active-bg: lighten(theme-color(\"primary\"), 35%) !default;\n$custom-control-indicator-active-box-shadow: none !default;\n\n$custom-checkbox-indicator-border-radius: $border-radius !default;\n$custom-checkbox-indicator-icon-checked: str-replace(url(\"data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='#{$custom-control-indicator-checked-color}' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E\"), \"#\", \"%23\") !default;\n\n$custom-checkbox-indicator-indeterminate-bg: theme-color(\"primary\") !default;\n$custom-checkbox-indicator-indeterminate-color: $custom-control-indicator-checked-color !default;\n$custom-checkbox-indicator-icon-indeterminate: str-replace(url(\"data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4'%3E%3Cpath stroke='#{$custom-checkbox-indicator-indeterminate-color}' d='M0 2h4'/%3E%3C/svg%3E\"), \"#\", \"%23\") !default;\n$custom-checkbox-indicator-indeterminate-box-shadow: none !default;\n\n$custom-radio-indicator-border-radius: 50% !default;\n$custom-radio-indicator-icon-checked: str-replace(url(\"data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='#{$custom-control-indicator-checked-color}'/%3E%3C/svg%3E\"), \"#\", \"%23\") !default;\n\n$custom-select-padding-y: .375rem !default;\n$custom-select-padding-x: .75rem !default;\n$custom-select-height: $input-height !default;\n$custom-select-indicator-padding: 1rem !default; // Extra padding to account for the presence of the background-image based indicator\n$custom-select-line-height: $input-btn-line-height !default;\n$custom-select-color: $input-color !default;\n$custom-select-disabled-color: $gray-600 !default;\n$custom-select-bg: $white !default;\n$custom-select-disabled-bg: $gray-200 !default;\n$custom-select-bg-size: 8px 10px !default; // In pixels because image dimensions\n$custom-select-indicator-color: #333 !default;\n$custom-select-indicator: str-replace(url(\"data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='#{$custom-select-indicator-color}' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E\"), \"#\", \"%23\") !default;\n$custom-select-border-width: $input-btn-border-width !default;\n$custom-select-border-color: $input-border-color !default;\n$custom-select-border-radius: $border-radius !default;\n\n$custom-select-focus-border-color: lighten(theme-color(\"primary\"), 25%) !default;\n$custom-select-focus-box-shadow: inset 0 1px 2px rgba($black, .075), 0 0 5px rgba($custom-select-focus-border-color, .5) !default;\n\n$custom-select-font-size-sm: 75% !default;\n$custom-select-height-sm: $input-height-sm !default;\n\n$custom-file-height: 2.5rem !default;\n$custom-file-width: 14rem !default;\n$custom-file-focus-box-shadow: 0 0 0 .075rem $white, 0 0 0 .2rem theme-color(\"primary\") !default;\n\n$custom-file-padding-y: 1rem !default;\n$custom-file-padding-x: .5rem !default;\n$custom-file-line-height: 1.5 !default;\n$custom-file-color: $gray-700 !default;\n$custom-file-bg: $white !default;\n$custom-file-border-width: $border-width !default;\n$custom-file-border-color: $input-border-color !default;\n$custom-file-border-radius: $border-radius !default;\n$custom-file-box-shadow: inset 0 .2rem .4rem rgba($black,.05) !default;\n$custom-file-button-color: $custom-file-color !default;\n$custom-file-button-bg: $gray-200 !default;\n$custom-file-text: (\n placeholder: (\n en: \"Choose file...\"\n ),\n button-label: (\n en: \"Browse\"\n )\n) !default;\n\n\n// Form validation\n$form-feedback-valid-color: theme-color(\"success\") !default;\n$form-feedback-invalid-color: theme-color(\"danger\") !default;\n\n\n// Dropdowns\n//\n// Dropdown menu container and contents.\n\n$dropdown-min-width: 10rem !default;\n$dropdown-padding-y: .5rem !default;\n$dropdown-spacer: .125rem !default;\n$dropdown-bg: $white !default;\n$dropdown-border-color: rgba($black,.15) !default;\n$dropdown-border-width: $border-width !default;\n$dropdown-divider-bg: $gray-200 !default;\n$dropdown-box-shadow: 0 .5rem 1rem rgba($black,.175) !default;\n\n$dropdown-link-color: $gray-900 !default;\n$dropdown-link-hover-color: darken($gray-900, 5%) !default;\n$dropdown-link-hover-bg: $gray-100 !default;\n\n$dropdown-link-active-color: $component-active-color !default;\n$dropdown-link-active-bg: $component-active-bg !default;\n\n$dropdown-link-disabled-color: $gray-600 !default;\n\n$dropdown-item-padding-y: .25rem !default;\n$dropdown-item-padding-x: 1.5rem !default;\n\n$dropdown-header-color: $gray-600 !default;\n\n\n// Z-index master list\n//\n// Warning: Avoid customizing these values. They're used for a bird's eye view\n// of components dependent on the z-axis and are designed to all work together.\n\n$zindex-dropdown: 1000 !default;\n$zindex-sticky: 1020 !default;\n$zindex-fixed: 1030 !default;\n$zindex-modal-backdrop: 1040 !default;\n$zindex-modal: 1050 !default;\n$zindex-popover: 1060 !default;\n$zindex-tooltip: 1070 !default;\n\n// Navs\n\n$nav-link-padding-y: .5rem !default;\n$nav-link-padding-x: 1rem !default;\n$nav-link-disabled-color: $gray-600 !default;\n\n$nav-tabs-border-color: #ddd !default;\n$nav-tabs-border-width: $border-width !default;\n$nav-tabs-border-radius: $border-radius !default;\n$nav-tabs-link-hover-border-color: $gray-200 !default;\n$nav-tabs-link-active-color: $gray-700 !default;\n$nav-tabs-link-active-bg: $body-bg !default;\n$nav-tabs-link-active-border-color: #ddd !default;\n\n$nav-pills-border-radius: $border-radius !default;\n$nav-pills-link-active-color: $component-active-color !default;\n$nav-pills-link-active-bg: $component-active-bg !default;\n\n// Navbar\n\n$navbar-padding-y: ($spacer / 2) !default;\n$navbar-padding-x: $spacer !default;\n\n$navbar-brand-font-size: $font-size-lg !default;\n// Compute the navbar-brand padding-y so the navbar-brand will have the same height as navbar-text and nav-link\n$nav-link-height: $navbar-brand-font-size * $line-height-base !default;\n$navbar-brand-height: ($font-size-base * $line-height-base + $nav-link-padding-y * 2) !default;\n$navbar-brand-padding-y: ($navbar-brand-height - $nav-link-height) / 2 !default;\n\n$navbar-toggler-padding-y: .25rem !default;\n$navbar-toggler-padding-x: .75rem !default;\n$navbar-toggler-font-size: $font-size-lg !default;\n$navbar-toggler-border-radius: $btn-border-radius !default;\n\n$navbar-dark-color: rgba($white,.5) !default;\n$navbar-dark-hover-color: rgba($white,.75) !default;\n$navbar-dark-active-color: rgba($white,1) !default;\n$navbar-dark-disabled-color: rgba($white,.25) !default;\n$navbar-dark-toggler-icon-bg: str-replace(url(\"data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='#{$navbar-dark-color}' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E\"), \"#\", \"%23\") !default;\n$navbar-dark-toggler-border-color: rgba($white,.1) !default;\n\n$navbar-light-color: rgba($black,.5) !default;\n$navbar-light-hover-color: rgba($black,.7) !default;\n$navbar-light-active-color: rgba($black,.9) !default;\n$navbar-light-disabled-color: rgba($black,.3) !default;\n$navbar-light-toggler-icon-bg: str-replace(url(\"data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='#{$navbar-light-color}' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E\"), \"#\", \"%23\") !default;\n$navbar-light-toggler-border-color: rgba($black,.1) !default;\n\n// Pagination\n\n$pagination-padding-y: .5rem !default;\n$pagination-padding-x: .75rem !default;\n$pagination-padding-y-sm: .25rem !default;\n$pagination-padding-x-sm: .5rem !default;\n$pagination-padding-y-lg: .75rem !default;\n$pagination-padding-x-lg: 1.5rem !default;\n$pagination-line-height: 1.25 !default;\n\n$pagination-color: $link-color !default;\n$pagination-bg: $white !default;\n$pagination-border-width: $border-width !default;\n$pagination-border-color: #ddd !default;\n\n$pagination-hover-color: $link-hover-color !default;\n$pagination-hover-bg: $gray-200 !default;\n$pagination-hover-border-color: #ddd !default;\n\n$pagination-active-color: $white !default;\n$pagination-active-bg: theme-color(\"primary\") !default;\n$pagination-active-border-color: theme-color(\"primary\") !default;\n\n$pagination-disabled-color: $gray-600 !default;\n$pagination-disabled-bg: $white !default;\n$pagination-disabled-border-color: #ddd !default;\n\n\n// Jumbotron\n\n$jumbotron-padding: 2rem !default;\n$jumbotron-bg: $gray-200 !default;\n\n\n// Cards\n\n$card-spacer-y: .75rem !default;\n$card-spacer-x: 1.25rem !default;\n$card-border-width: 1px !default;\n$card-border-radius: $border-radius !default;\n$card-border-color: rgba($black,.125) !default;\n$card-inner-border-radius: calc(#{$card-border-radius} - #{$card-border-width}) !default;\n$card-cap-bg: rgba($black, .03) !default;\n$card-bg: $white !default;\n\n$card-img-overlay-padding: 1.25rem !default;\n\n$card-deck-margin: ($grid-gutter-width / 2) !default;\n\n$card-columns-count: 3 !default;\n$card-columns-gap: 1.25rem !default;\n$card-columns-margin: $card-spacer-y !default;\n\n\n// Tooltips\n\n$tooltip-max-width: 200px !default;\n$tooltip-color: $white !default;\n$tooltip-bg: $black !default;\n$tooltip-opacity: .9 !default;\n$tooltip-padding-y: 3px !default;\n$tooltip-padding-x: 8px !default;\n$tooltip-margin: 0 !default;\n\n\n$tooltip-arrow-width: 5px !default;\n$tooltip-arrow-height: 5px !default;\n$tooltip-arrow-color: $tooltip-bg !default;\n\n\n// Popovers\n\n$popover-inner-padding: 1px !default;\n$popover-bg: $white !default;\n$popover-max-width: 276px !default;\n$popover-border-width: $border-width !default;\n$popover-border-color: rgba($black,.2) !default;\n$popover-box-shadow: 0 5px 10px rgba($black,.2) !default;\n\n$popover-header-bg: darken($popover-bg, 3%) !default;\n$popover-header-color: $headings-color !default;\n$popover-header-padding-y: 8px !default;\n$popover-header-padding-x: 14px !default;\n\n$popover-body-color: $body-color !default;\n$popover-body-padding-y: 9px !default;\n$popover-body-padding-x: 14px !default;\n\n$popover-arrow-width: 10px !default;\n$popover-arrow-height: 5px !default;\n$popover-arrow-color: $popover-bg !default;\n\n$popover-arrow-outer-width: ($popover-arrow-width + 1px) !default;\n$popover-arrow-outer-color: fade-in($popover-border-color, .05) !default;\n\n\n// Badges\n\n$badge-color: $white !default;\n$badge-font-size: 75% !default;\n$badge-font-weight: $font-weight-bold !default;\n$badge-padding-y: .25em !default;\n$badge-padding-x: .4em !default;\n\n$badge-pill-padding-x: .6em !default;\n// Use a higher than normal value to ensure completely rounded edges when\n// customizing padding or font-size on labels.\n$badge-pill-border-radius: 10rem !default;\n\n\n// Modals\n\n// Padding applied to the modal body\n$modal-inner-padding: 15px !default;\n\n$modal-dialog-margin: 10px !default;\n$modal-dialog-margin-y-sm-up: 30px !default;\n\n$modal-title-line-height: $line-height-base !default;\n\n$modal-content-bg: $white !default;\n$modal-content-border-color: rgba($black,.2) !default;\n$modal-content-border-width: $border-width !default;\n$modal-content-box-shadow-xs: 0 3px 9px rgba($black,.5) !default;\n$modal-content-box-shadow-sm-up: 0 5px 15px rgba($black,.5) !default;\n\n$modal-backdrop-bg: $black !default;\n$modal-backdrop-opacity: .5 !default;\n$modal-header-border-color: $gray-200 !default;\n$modal-footer-border-color: $modal-header-border-color !default;\n$modal-header-border-width: $modal-content-border-width !default;\n$modal-footer-border-width: $modal-header-border-width !default;\n$modal-header-padding: 15px !default;\n\n$modal-lg: 800px !default;\n$modal-md: 500px !default;\n$modal-sm: 300px !default;\n\n$modal-transition: transform .3s ease-out !default;\n\n\n// Alerts\n//\n// Define alert colors, border radius, and padding.\n\n$alert-padding-y: .75rem !default;\n$alert-padding-x: 1.25rem !default;\n$alert-margin-bottom: 1rem !default;\n$alert-border-radius: $border-radius !default;\n$alert-link-font-weight: $font-weight-bold !default;\n$alert-border-width: $border-width !default;\n\n\n// Progress bars\n\n$progress-height: 1rem !default;\n$progress-font-size: .75rem !default;\n$progress-bg: $gray-200 !default;\n$progress-border-radius: $border-radius !default;\n$progress-box-shadow: inset 0 .1rem .1rem rgba($black,.1) !default;\n$progress-bar-color: $white !default;\n$progress-bar-bg: theme-color(\"primary\") !default;\n$progress-bar-animation-timing: 1s linear infinite !default;\n$progress-bar-transition: width .6s ease !default;\n\n// List group\n\n$list-group-bg: $white !default;\n$list-group-border-color: rgba($black,.125) !default;\n$list-group-border-width: $border-width !default;\n$list-group-border-radius: $border-radius !default;\n\n$list-group-item-padding-y: .75rem !default;\n$list-group-item-padding-x: 1.25rem !default;\n\n$list-group-hover-bg: $gray-100 !default;\n$list-group-active-color: $component-active-color !default;\n$list-group-active-bg: $component-active-bg !default;\n$list-group-active-border-color: $list-group-active-bg !default;\n\n$list-group-disabled-color: $gray-600 !default;\n$list-group-disabled-bg: $list-group-bg !default;\n\n$list-group-action-color: $gray-700 !default;\n$list-group-action-hover-color: $list-group-action-color !default;\n\n$list-group-action-active-color: $body-color !default;\n$list-group-action-active-bg: $gray-200 !default;\n\n\n// Image thumbnails\n\n$thumbnail-padding: .25rem !default;\n$thumbnail-bg: $body-bg !default;\n$thumbnail-border-width: $border-width !default;\n$thumbnail-border-color: #ddd !default;\n$thumbnail-border-radius: $border-radius !default;\n$thumbnail-box-shadow: 0 1px 2px rgba($black,.075) !default;\n$thumbnail-transition: all .2s ease-in-out !default;\n\n\n// Figures\n\n$figure-caption-font-size: 90% !default;\n$figure-caption-color: $gray-600 !default;\n\n\n// Breadcrumbs\n\n$breadcrumb-padding-y: .75rem !default;\n$breadcrumb-padding-x: 1rem !default;\n$breadcrumb-item-padding: .5rem !default;\n\n$breadcrumb-bg: $gray-200 !default;\n$breadcrumb-divider-color: $gray-600 !default;\n$breadcrumb-active-color: $gray-600 !default;\n$breadcrumb-divider: \"/\" !default;\n\n\n// Carousel\n\n$carousel-control-color: $white !default;\n$carousel-control-width: 15% !default;\n$carousel-control-opacity: .5 !default;\n\n$carousel-indicator-width: 30px !default;\n$carousel-indicator-height: 3px !default;\n$carousel-indicator-spacer: 3px !default;\n$carousel-indicator-active-bg: $white !default;\n\n$carousel-caption-width: 70% !default;\n$carousel-caption-color: $white !default;\n\n$carousel-control-icon-width: 20px !default;\n\n$carousel-control-prev-icon-bg: str-replace(url(\"data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='#{$carousel-control-color}' viewBox='0 0 8 8'%3E%3Cpath d='M4 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/%3E%3C/svg%3E\"), \"#\", \"%23\") !default;\n$carousel-control-next-icon-bg: str-replace(url(\"data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='#{$carousel-control-color}' viewBox='0 0 8 8'%3E%3Cpath d='M1.5 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z'/%3E%3C/svg%3E\"), \"#\", \"%23\") !default;\n\n$carousel-transition: transform .6s ease !default;\n\n\n// Close\n\n$close-font-size: $font-size-base * 1.5 !default;\n$close-font-weight: $font-weight-bold !default;\n$close-color: $black !default;\n$close-text-shadow: 0 1px 0 $white !default;\n\n// Code\n\n$code-font-size: 90% !default;\n$code-padding-y: .2rem !default;\n$code-padding-x: .4rem !default;\n$code-color: #bd4147 !default;\n$code-bg: $gray-100 !default;\n\n$kbd-color: $white !default;\n$kbd-bg: $gray-900 !default;\n\n$pre-color: $gray-900 !default;\n$pre-scrollable-max-height: 340px !default;\n","@mixin hover {\n // TODO: re-enable along with mq4-hover-shim\n// @if $enable-hover-media-query {\n// // See Media Queries Level 4: https://drafts.csswg.org/mediaqueries/#hover\n// // Currently shimmed by https://github.com/twbs/mq4-hover-shim\n// @media (hover: hover) {\n// &:hover { @content }\n// }\n// }\n// @else {\n// scss-lint:disable Indentation\n &:hover { @content }\n// scss-lint:enable Indentation\n// }\n}\n\n\n@mixin hover-focus {\n @if $enable-hover-media-query {\n &:focus { @content }\n @include hover { @content }\n } @else {\n &:focus,\n &:hover {\n @content\n }\n }\n}\n\n@mixin plain-hover-focus {\n @if $enable-hover-media-query {\n &,\n &:focus {\n @content\n }\n @include hover { @content }\n } @else {\n &,\n &:focus,\n &:hover {\n @content\n }\n }\n}\n\n@mixin hover-focus-active {\n @if $enable-hover-media-query {\n &:focus,\n &:active {\n @content\n }\n @include hover { @content }\n } @else {\n &:focus,\n &:active,\n &:hover {\n @content\n }\n }\n}\n"]} \ No newline at end of file diff --git a/public/vendor/bootstrap/css/bootstrap-reboot.min.css b/public/vendor/bootstrap/css/bootstrap-reboot.min.css new file mode 100755 index 000000000..4ee4a4069 --- /dev/null +++ b/public/vendor/bootstrap/css/bootstrap-reboot.min.css @@ -0,0 +1,2 @@ +html{box-sizing:border-box;font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:transparent}*,::after,::before{box-sizing:inherit}@-ms-viewport{width:device-width}article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}body{margin:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;font-size:1rem;font-weight:400;line-height:1.5;color:#212529;background-color:#fff}[tabindex="-1"]:focus{outline:0!important}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto}figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg:not(:root){overflow:hidden}[role=button],a,area,button,input,label,select,summary,textarea{-ms-touch-action:manipulation;touch-action:manipulation}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#868e96;text-align:left;caption-side:bottom}th{text-align:left}label{display:inline-block;margin-bottom:.5rem}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important} +/*# sourceMappingURL=bootstrap-reboot.min.css.map */ \ No newline at end of file diff --git a/public/vendor/bootstrap/css/bootstrap-reboot.min.css.map b/public/vendor/bootstrap/css/bootstrap-reboot.min.css.map new file mode 100755 index 000000000..d461cb58f --- /dev/null +++ b/public/vendor/bootstrap/css/bootstrap-reboot.min.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../scss/_reboot.scss","dist/css/bootstrap-reboot.css","bootstrap-reboot.css","../../scss/mixins/_hover.scss"],"names":[],"mappings":"AAoBA,KACE,WAAA,WACA,YAAA,WACA,YAAA,KACA,yBAAA,KACA,qBAAA,KACA,mBAAA,UACA,4BAAA,YAGF,EClBA,QADA,SDsBE,WAAA,QAKA,cAAgB,MAAA,aAIlB,QAAA,MAAA,OAAA,WAAA,OAAA,OAAA,OAAA,OAAA,KAAA,IAAA,QACE,QAAA,MAQF,KACE,OAAA,EACA,YAAA,aAAA,CAAA,kBAAA,CAAA,UAAA,CAAA,MAAA,CAAA,gBAAA,CAAA,KAAA,CAAA,WACA,UAAA,KACA,YAAA,IACA,YAAA,IACA,MAAA,QACA,iBAAA,KExBF,sBFiCE,QAAA,YASF,GACE,WAAA,YACA,OAAA,EACA,SAAA,QAYF,GAAA,GAAA,GAAA,GAAA,GAAA,GACE,WAAA,EACA,cAAA,MAOF,EACE,WAAA,EACA,cAAA,KC/CF,0BDyDA,YAEE,gBAAA,UACA,wBAAA,UAAA,OAAA,gBAAA,UAAA,OACA,OAAA,KACA,cAAA,EAGF,QACE,cAAA,KACA,WAAA,OACA,YAAA,QCpDF,GDuDA,GCxDA,GD2DE,WAAA,EACA,cAAA,KAGF,MCvDA,MACA,MAFA,MD4DE,cAAA,EAGF,GACE,YAAA,IAGF,GACE,cAAA,MACA,YAAA,EAGF,WACE,OAAA,EAAA,EAAA,KAGF,IACE,WAAA,OAGF,ECxDA,OD0DE,YAAA,OAGF,MACE,UAAA,IAQF,IC7DA,ID+DE,SAAA,SACA,UAAA,IACA,YAAA,EACA,eAAA,SAGF,IAAM,OAAA,OACN,IAAM,IAAA,MAON,EACE,MAAA,QACA,gBAAA,KACA,iBAAA,YACA,6BAAA,QGpLE,QHuLA,MAAA,QACA,gBAAA,UAUJ,8BACE,MAAA,QACA,gBAAA,KGzLE,oCAAA,oCH4LA,MAAA,QACA,gBAAA,KANJ,oCAUI,QAAA,EC/DJ,KACA,IDuEA,ICtEA,KD0EE,YAAA,SAAA,CAAA,UACA,UAAA,IAGF,IAEE,WAAA,EAEA,cAAA,KAEA,SAAA,KAQF,OAEE,OAAA,EAAA,EAAA,KAQF,IACE,eAAA,OACA,aAAA,KAGF,eACE,SAAA,OCjFF,cD+FA,ECjGA,KACA,OAEA,MACA,MACA,OACA,QACA,SDmGE,iBAAA,aAAA,aAAA,aAQF,MACE,gBAAA,SAGF,QACE,YAAA,OACA,eAAA,OACA,MAAA,QACA,WAAA,KACA,aAAA,OAGF,GAEE,WAAA,KAQF,MAEE,QAAA,aACA,cAAA,MAOF,aACE,QAAA,IAAA,OACA,QAAA,IAAA,KAAA,yBC7GF,ODgHA,MC9GA,SADA,OAEA,SDkHE,OAAA,EACA,YAAA,QACA,UAAA,QACA,YAAA,QAGF,OChHA,MDkHE,SAAA,QAGF,OChHA,ODkHE,eAAA,KC5GF,aACA,cDiHA,OCnHA,mBDuHE,mBAAA,OChHF,gCACA,+BACA,gCDkHA,yBAIE,QAAA,EACA,aAAA,KCjHF,qBDoHA,kBAEE,WAAA,WACA,QAAA,EAIF,iBCpHA,2BACA,kBAFA,iBD8HE,mBAAA,QAGF,SACE,SAAA,KAEA,OAAA,SAGF,SAME,UAAA,EAEA,QAAA,EACA,OAAA,EACA,OAAA,EAKF,OACE,QAAA,MACA,MAAA,KACA,UAAA,KACA,QAAA,EACA,cAAA,MACA,UAAA,OACA,YAAA,QACA,MAAA,QACA,YAAA,OAGF,SACE,eAAA,SEnIF,yCDGA,yCDsIE,OAAA,KEpIF,cF4IE,eAAA,KACA,mBAAA,KExIF,4CDGA,yCD8IE,mBAAA,KAQF,6BACE,KAAA,QACA,mBAAA,OAOF,OACE,QAAA,aAGF,QACE,QAAA,UAGF,SACE,QAAA,KErJF,SF2JE,QAAA","sourcesContent":["// scss-lint:disable QualifyingElement, DuplicateProperty, VendorPrefix\n\n// Reboot\n//\n// Normalization of HTML elements, manually forked from Normalize.css to remove\n// styles targeting irrelevant browsers while applying new styles.\n//\n// Normalize is licensed MIT. https://github.com/necolas/normalize.css\n\n\n// Document\n//\n// 1. Change from `box-sizing: content-box` so that `width` is not affected by `padding` or `border`.\n// 2. Change the default font family in all browsers.\n// 3. Correct the line height in all browsers.\n// 4. Prevent adjustments of font size after orientation changes in IE on Windows Phone and in iOS.\n// 5. Setting @viewport causes scrollbars to overlap content in IE11 and Edge, so\n// we force a non-overlapping, non-auto-hiding scrollbar to counteract.\n// 6. Change the default tap highlight to be completely transparent in iOS.\n\nhtml {\n box-sizing: border-box; // 1\n font-family: sans-serif; // 2\n line-height: 1.15; // 3\n -webkit-text-size-adjust: 100%; // 4\n -ms-text-size-adjust: 100%; // 4\n -ms-overflow-style: scrollbar; // 5\n -webkit-tap-highlight-color: rgba(0,0,0,0); // 6\n}\n\n*,\n*::before,\n*::after {\n box-sizing: inherit; // 1\n}\n\n// IE10+ doesn't honor `` in some cases.\n@at-root {\n @-ms-viewport { width: device-width; }\n}\n\n// Shim for \"new\" HTML5 structural elements to display correctly (IE10, older browsers)\narticle, aside, dialog, figcaption, figure, footer, header, hgroup, main, nav, section {\n display: block;\n}\n\n// Body\n//\n// 1. Remove the margin in all browsers.\n// 2. As a best practice, apply a default `background-color`.\n\nbody {\n margin: 0; // 1\n font-family: $font-family-base;\n font-size: $font-size-base;\n font-weight: $font-weight-base;\n line-height: $line-height-base;\n color: $body-color;\n background-color: $body-bg; // 2\n}\n\n// Suppress the focus outline on elements that cannot be accessed via keyboard.\n// This prevents an unwanted focus outline from appearing around elements that\n// might still respond to pointer events.\n//\n// Credit: https://github.com/suitcss/base\n[tabindex=\"-1\"]:focus {\n outline: none !important;\n}\n\n\n// Content grouping\n//\n// 1. Add the correct box sizing in Firefox.\n// 2. Show the overflow in Edge and IE.\n\nhr {\n box-sizing: content-box; // 1\n height: 0; // 1\n overflow: visible; // 2\n}\n\n\n//\n// Typography\n//\n\n// Remove top margins from headings\n//\n// By default, `

    `-`

    ` all receive top and bottom margins. We nuke the top\n// margin for easier control within type scales as it avoids margin collapsing.\nh1, h2, h3, h4, h5, h6 {\n margin-top: 0;\n margin-bottom: .5rem;\n}\n\n// Reset margins on paragraphs\n//\n// Similarly, the top margin on `

    `s get reset. However, we also reset the\n// bottom margin to use `rem` units instead of `em`.\np {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\n// Abbreviations\n//\n// 1. Remove the bottom border in Firefox 39-.\n// 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.\n// 3. Add explicit cursor to indicate changed behavior.\n// 4. Duplicate behavior to the data-* attribute for our tooltip plugin\n\nabbr[title],\nabbr[data-original-title] { // 4\n text-decoration: underline; // 2\n text-decoration: underline dotted; // 2\n cursor: help; // 3\n border-bottom: 0; // 1\n}\n\naddress {\n margin-bottom: 1rem;\n font-style: normal;\n line-height: inherit;\n}\n\nol,\nul,\ndl {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nol ol,\nul ul,\nol ul,\nul ol {\n margin-bottom: 0;\n}\n\ndt {\n font-weight: $dt-font-weight;\n}\n\ndd {\n margin-bottom: .5rem;\n margin-left: 0; // Undo browser default\n}\n\nblockquote {\n margin: 0 0 1rem;\n}\n\ndfn {\n font-style: italic; // Add the correct font style in Android 4.3-\n}\n\nb,\nstrong {\n font-weight: bolder; // Add the correct font weight in Chrome, Edge, and Safari\n}\n\nsmall {\n font-size: 80%; // Add the correct font size in all browsers\n}\n\n//\n// Prevent `sub` and `sup` elements from affecting the line height in\n// all browsers.\n//\n\nsub,\nsup {\n position: relative;\n font-size: 75%;\n line-height: 0;\n vertical-align: baseline;\n}\n\nsub { bottom: -.25em; }\nsup { top: -.5em; }\n\n\n//\n// Links\n//\n\na {\n color: $link-color;\n text-decoration: $link-decoration;\n background-color: transparent; // Remove the gray background on active links in IE 10.\n -webkit-text-decoration-skip: objects; // Remove gaps in links underline in iOS 8+ and Safari 8+.\n\n @include hover {\n color: $link-hover-color;\n text-decoration: $link-hover-decoration;\n }\n}\n\n// And undo these styles for placeholder links/named anchors (without href)\n// which have not been made explicitly keyboard-focusable (without tabindex).\n// It would be more straightforward to just use a[href] in previous block, but that\n// causes specificity issues in many other styles that are too complex to fix.\n// See https://github.com/twbs/bootstrap/issues/19402\n\na:not([href]):not([tabindex]) {\n color: inherit;\n text-decoration: none;\n\n @include hover-focus {\n color: inherit;\n text-decoration: none;\n }\n\n &:focus {\n outline: 0;\n }\n}\n\n\n//\n// Code\n//\n\npre,\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace; // Correct the inheritance and scaling of font size in all browsers.\n font-size: 1em; // Correct the odd `em` font sizing in all browsers.\n}\n\npre {\n // Remove browser default top margin\n margin-top: 0;\n // Reset browser default of `1em` to use `rem`s\n margin-bottom: 1rem;\n // Don't allow content to break outside\n overflow: auto;\n}\n\n\n//\n// Figures\n//\n\nfigure {\n // Apply a consistent margin strategy (matches our type styles).\n margin: 0 0 1rem;\n}\n\n\n//\n// Images and content\n//\n\nimg {\n vertical-align: middle;\n border-style: none; // Remove the border on images inside links in IE 10-.\n}\n\nsvg:not(:root) {\n overflow: hidden; // Hide the overflow in IE\n}\n\n\n// Avoid 300ms click delay on touch devices that support the `touch-action` CSS property.\n//\n// In particular, unlike most other browsers, IE11+Edge on Windows 10 on touch devices and IE Mobile 10-11\n// DON'T remove the click delay when `` is present.\n// However, they DO support removing the click delay via `touch-action: manipulation`.\n// See:\n// * https://v4-alpha.getbootstrap.com/content/reboot/#click-delay-optimization-for-touch\n// * http://caniuse.com/#feat=css-touch-action\n// * https://patrickhlauke.github.io/touch/tests/results/#suppressing-300ms-delay\n\na,\narea,\nbutton,\n[role=\"button\"],\ninput,\nlabel,\nselect,\nsummary,\ntextarea {\n touch-action: manipulation;\n}\n\n\n//\n// Tables\n//\n\ntable {\n border-collapse: collapse; // Prevent double borders\n}\n\ncaption {\n padding-top: $table-cell-padding;\n padding-bottom: $table-cell-padding;\n color: $text-muted;\n text-align: left;\n caption-side: bottom;\n}\n\nth {\n // Matches default `` alignment\n text-align: left;\n}\n\n\n//\n// Forms\n//\n\nlabel {\n // Allow labels to use `margin` for spacing.\n display: inline-block;\n margin-bottom: .5rem;\n}\n\n// Work around a Firefox/IE bug where the transparent `button` background\n// results in a loss of the default `button` focus styles.\n//\n// Credit: https://github.com/suitcss/base/\nbutton:focus {\n outline: 1px dotted;\n outline: 5px auto -webkit-focus-ring-color;\n}\n\ninput,\nbutton,\nselect,\noptgroup,\ntextarea {\n margin: 0; // Remove the margin in Firefox and Safari\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n}\n\nbutton,\ninput {\n overflow: visible; // Show the overflow in Edge\n}\n\nbutton,\nselect {\n text-transform: none; // Remove the inheritance of text transform in Firefox\n}\n\n// 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`\n// controls in Android 4.\n// 2. Correct the inability to style clickable types in iOS and Safari.\nbutton,\nhtml [type=\"button\"], // 1\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button; // 2\n}\n\n// Remove inner border and padding from Firefox, but don't restore the outline like Normalize.\nbutton::-moz-focus-inner,\n[type=\"button\"]::-moz-focus-inner,\n[type=\"reset\"]::-moz-focus-inner,\n[type=\"submit\"]::-moz-focus-inner {\n padding: 0;\n border-style: none;\n}\n\ninput[type=\"radio\"],\ninput[type=\"checkbox\"] {\n box-sizing: border-box; // 1. Add the correct box sizing in IE 10-\n padding: 0; // 2. Remove the padding in IE 10-\n}\n\n\ninput[type=\"date\"],\ninput[type=\"time\"],\ninput[type=\"datetime-local\"],\ninput[type=\"month\"] {\n // Remove the default appearance of temporal inputs to avoid a Mobile Safari\n // bug where setting a custom line-height prevents text from being vertically\n // centered within the input.\n // See https://bugs.webkit.org/show_bug.cgi?id=139848\n // and https://github.com/twbs/bootstrap/issues/11266\n -webkit-appearance: listbox;\n}\n\ntextarea {\n overflow: auto; // Remove the default vertical scrollbar in IE.\n // Textareas should really only resize vertically so they don't break their (horizontal) containers.\n resize: vertical;\n}\n\nfieldset {\n // Browsers set a default `min-width: min-content;` on fieldsets,\n // unlike e.g. `

    `s, which have `min-width: 0;` by default.\n // So we reset that to ensure fieldsets behave more like a standard block element.\n // See https://github.com/twbs/bootstrap/issues/12359\n // and https://html.spec.whatwg.org/multipage/#the-fieldset-and-legend-elements\n min-width: 0;\n // Reset the default outline behavior of fieldsets so they don't affect page layout.\n padding: 0;\n margin: 0;\n border: 0;\n}\n\n// 1. Correct the text wrapping in Edge and IE.\n// 2. Correct the color inheritance from `fieldset` elements in IE.\nlegend {\n display: block;\n width: 100%;\n max-width: 100%; // 1\n padding: 0;\n margin-bottom: .5rem;\n font-size: 1.5rem;\n line-height: inherit;\n color: inherit; // 2\n white-space: normal; // 1\n}\n\nprogress {\n vertical-align: baseline; // Add the correct vertical alignment in Chrome, Firefox, and Opera.\n}\n\n// Correct the cursor style of increment and decrement buttons in Chrome.\n[type=\"number\"]::-webkit-inner-spin-button,\n[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n[type=\"search\"] {\n // This overrides the extra rounded corners on search inputs in iOS so that our\n // `.form-control` class can properly style them. Note that this cannot simply\n // be added to `.form-control` as it's not specific enough. For details, see\n // https://github.com/twbs/bootstrap/issues/11586.\n outline-offset: -2px; // 2. Correct the outline style in Safari.\n -webkit-appearance: none;\n}\n\n//\n// Remove the inner padding and cancel buttons in Chrome and Safari on macOS.\n//\n\n[type=\"search\"]::-webkit-search-cancel-button,\n[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n//\n// 1. Correct the inability to style clickable types in iOS and Safari.\n// 2. Change font properties to `inherit` in Safari.\n//\n\n::-webkit-file-upload-button {\n font: inherit; // 2\n -webkit-appearance: button; // 1\n}\n\n//\n// Correct element displays\n//\n\noutput {\n display: inline-block;\n}\n\nsummary {\n display: list-item; // Add the correct display in all browsers\n}\n\ntemplate {\n display: none; // Add the correct display in IE\n}\n\n// Always hide an element with the `hidden` HTML attribute (from PureCSS).\n// Needed for proper display in IE 10-.\n[hidden] {\n display: none !important;\n}\n","html {\n box-sizing: border-box;\n font-family: sans-serif;\n line-height: 1.15;\n -webkit-text-size-adjust: 100%;\n -ms-text-size-adjust: 100%;\n -ms-overflow-style: scrollbar;\n -webkit-tap-highlight-color: transparent;\n}\n\n*,\n*::before,\n*::after {\n box-sizing: inherit;\n}\n\n@-ms-viewport {\n width: device-width;\n}\n\narticle, aside, dialog, figcaption, figure, footer, header, hgroup, main, nav, section {\n display: block;\n}\n\nbody {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;\n font-size: 1rem;\n font-weight: normal;\n line-height: 1.5;\n color: #212529;\n background-color: #fff;\n}\n\n[tabindex=\"-1\"]:focus {\n outline: none !important;\n}\n\nhr {\n box-sizing: content-box;\n height: 0;\n overflow: visible;\n}\n\nh1, h2, h3, h4, h5, h6 {\n margin-top: 0;\n margin-bottom: .5rem;\n}\n\np {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nabbr[title],\nabbr[data-original-title] {\n text-decoration: underline;\n -webkit-text-decoration: underline dotted;\n text-decoration: underline dotted;\n cursor: help;\n border-bottom: 0;\n}\n\naddress {\n margin-bottom: 1rem;\n font-style: normal;\n line-height: inherit;\n}\n\nol,\nul,\ndl {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nol ol,\nul ul,\nol ul,\nul ol {\n margin-bottom: 0;\n}\n\ndt {\n font-weight: bold;\n}\n\ndd {\n margin-bottom: .5rem;\n margin-left: 0;\n}\n\nblockquote {\n margin: 0 0 1rem;\n}\n\ndfn {\n font-style: italic;\n}\n\nb,\nstrong {\n font-weight: bolder;\n}\n\nsmall {\n font-size: 80%;\n}\n\nsub,\nsup {\n position: relative;\n font-size: 75%;\n line-height: 0;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -.25em;\n}\n\nsup {\n top: -.5em;\n}\n\na {\n color: #007bff;\n text-decoration: none;\n background-color: transparent;\n -webkit-text-decoration-skip: objects;\n}\n\na:hover {\n color: #0056b3;\n text-decoration: underline;\n}\n\na:not([href]):not([tabindex]) {\n color: inherit;\n text-decoration: none;\n}\n\na:not([href]):not([tabindex]):focus, a:not([href]):not([tabindex]):hover {\n color: inherit;\n text-decoration: none;\n}\n\na:not([href]):not([tabindex]):focus {\n outline: 0;\n}\n\npre,\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace;\n font-size: 1em;\n}\n\npre {\n margin-top: 0;\n margin-bottom: 1rem;\n overflow: auto;\n}\n\nfigure {\n margin: 0 0 1rem;\n}\n\nimg {\n vertical-align: middle;\n border-style: none;\n}\n\nsvg:not(:root) {\n overflow: hidden;\n}\n\na,\narea,\nbutton,\n[role=\"button\"],\ninput,\nlabel,\nselect,\nsummary,\ntextarea {\n -ms-touch-action: manipulation;\n touch-action: manipulation;\n}\n\ntable {\n border-collapse: collapse;\n}\n\ncaption {\n padding-top: 0.75rem;\n padding-bottom: 0.75rem;\n color: #868e96;\n text-align: left;\n caption-side: bottom;\n}\n\nth {\n text-align: left;\n}\n\nlabel {\n display: inline-block;\n margin-bottom: .5rem;\n}\n\nbutton:focus {\n outline: 1px dotted;\n outline: 5px auto -webkit-focus-ring-color;\n}\n\ninput,\nbutton,\nselect,\noptgroup,\ntextarea {\n margin: 0;\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n}\n\nbutton,\ninput {\n overflow: visible;\n}\n\nbutton,\nselect {\n text-transform: none;\n}\n\nbutton,\nhtml [type=\"button\"],\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button;\n}\n\nbutton::-moz-focus-inner,\n[type=\"button\"]::-moz-focus-inner,\n[type=\"reset\"]::-moz-focus-inner,\n[type=\"submit\"]::-moz-focus-inner {\n padding: 0;\n border-style: none;\n}\n\ninput[type=\"radio\"],\ninput[type=\"checkbox\"] {\n box-sizing: border-box;\n padding: 0;\n}\n\ninput[type=\"date\"],\ninput[type=\"time\"],\ninput[type=\"datetime-local\"],\ninput[type=\"month\"] {\n -webkit-appearance: listbox;\n}\n\ntextarea {\n overflow: auto;\n resize: vertical;\n}\n\nfieldset {\n min-width: 0;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\nlegend {\n display: block;\n width: 100%;\n max-width: 100%;\n padding: 0;\n margin-bottom: .5rem;\n font-size: 1.5rem;\n line-height: inherit;\n color: inherit;\n white-space: normal;\n}\n\nprogress {\n vertical-align: baseline;\n}\n\n[type=\"number\"]::-webkit-inner-spin-button,\n[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n[type=\"search\"] {\n outline-offset: -2px;\n -webkit-appearance: none;\n}\n\n[type=\"search\"]::-webkit-search-cancel-button,\n[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n::-webkit-file-upload-button {\n font: inherit;\n -webkit-appearance: button;\n}\n\noutput {\n display: inline-block;\n}\n\nsummary {\n display: list-item;\n}\n\ntemplate {\n display: none;\n}\n\n[hidden] {\n display: none !important;\n}\n/*# sourceMappingURL=bootstrap-reboot.css.map */","html {\n box-sizing: border-box;\n font-family: sans-serif;\n line-height: 1.15;\n -webkit-text-size-adjust: 100%;\n -ms-text-size-adjust: 100%;\n -ms-overflow-style: scrollbar;\n -webkit-tap-highlight-color: transparent;\n}\n\n*,\n*::before,\n*::after {\n box-sizing: inherit;\n}\n\n@-ms-viewport {\n width: device-width;\n}\n\narticle, aside, dialog, figcaption, figure, footer, header, hgroup, main, nav, section {\n display: block;\n}\n\nbody {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;\n font-size: 1rem;\n font-weight: normal;\n line-height: 1.5;\n color: #212529;\n background-color: #fff;\n}\n\n[tabindex=\"-1\"]:focus {\n outline: none !important;\n}\n\nhr {\n box-sizing: content-box;\n height: 0;\n overflow: visible;\n}\n\nh1, h2, h3, h4, h5, h6 {\n margin-top: 0;\n margin-bottom: .5rem;\n}\n\np {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nabbr[title],\nabbr[data-original-title] {\n text-decoration: underline;\n text-decoration: underline dotted;\n cursor: help;\n border-bottom: 0;\n}\n\naddress {\n margin-bottom: 1rem;\n font-style: normal;\n line-height: inherit;\n}\n\nol,\nul,\ndl {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nol ol,\nul ul,\nol ul,\nul ol {\n margin-bottom: 0;\n}\n\ndt {\n font-weight: bold;\n}\n\ndd {\n margin-bottom: .5rem;\n margin-left: 0;\n}\n\nblockquote {\n margin: 0 0 1rem;\n}\n\ndfn {\n font-style: italic;\n}\n\nb,\nstrong {\n font-weight: bolder;\n}\n\nsmall {\n font-size: 80%;\n}\n\nsub,\nsup {\n position: relative;\n font-size: 75%;\n line-height: 0;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -.25em;\n}\n\nsup {\n top: -.5em;\n}\n\na {\n color: #007bff;\n text-decoration: none;\n background-color: transparent;\n -webkit-text-decoration-skip: objects;\n}\n\na:hover {\n color: #0056b3;\n text-decoration: underline;\n}\n\na:not([href]):not([tabindex]) {\n color: inherit;\n text-decoration: none;\n}\n\na:not([href]):not([tabindex]):focus, a:not([href]):not([tabindex]):hover {\n color: inherit;\n text-decoration: none;\n}\n\na:not([href]):not([tabindex]):focus {\n outline: 0;\n}\n\npre,\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace;\n font-size: 1em;\n}\n\npre {\n margin-top: 0;\n margin-bottom: 1rem;\n overflow: auto;\n}\n\nfigure {\n margin: 0 0 1rem;\n}\n\nimg {\n vertical-align: middle;\n border-style: none;\n}\n\nsvg:not(:root) {\n overflow: hidden;\n}\n\na,\narea,\nbutton,\n[role=\"button\"],\ninput,\nlabel,\nselect,\nsummary,\ntextarea {\n touch-action: manipulation;\n}\n\ntable {\n border-collapse: collapse;\n}\n\ncaption {\n padding-top: 0.75rem;\n padding-bottom: 0.75rem;\n color: #868e96;\n text-align: left;\n caption-side: bottom;\n}\n\nth {\n text-align: left;\n}\n\nlabel {\n display: inline-block;\n margin-bottom: .5rem;\n}\n\nbutton:focus {\n outline: 1px dotted;\n outline: 5px auto -webkit-focus-ring-color;\n}\n\ninput,\nbutton,\nselect,\noptgroup,\ntextarea {\n margin: 0;\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n}\n\nbutton,\ninput {\n overflow: visible;\n}\n\nbutton,\nselect {\n text-transform: none;\n}\n\nbutton,\nhtml [type=\"button\"],\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button;\n}\n\nbutton::-moz-focus-inner,\n[type=\"button\"]::-moz-focus-inner,\n[type=\"reset\"]::-moz-focus-inner,\n[type=\"submit\"]::-moz-focus-inner {\n padding: 0;\n border-style: none;\n}\n\ninput[type=\"radio\"],\ninput[type=\"checkbox\"] {\n box-sizing: border-box;\n padding: 0;\n}\n\ninput[type=\"date\"],\ninput[type=\"time\"],\ninput[type=\"datetime-local\"],\ninput[type=\"month\"] {\n -webkit-appearance: listbox;\n}\n\ntextarea {\n overflow: auto;\n resize: vertical;\n}\n\nfieldset {\n min-width: 0;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\nlegend {\n display: block;\n width: 100%;\n max-width: 100%;\n padding: 0;\n margin-bottom: .5rem;\n font-size: 1.5rem;\n line-height: inherit;\n color: inherit;\n white-space: normal;\n}\n\nprogress {\n vertical-align: baseline;\n}\n\n[type=\"number\"]::-webkit-inner-spin-button,\n[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n[type=\"search\"] {\n outline-offset: -2px;\n -webkit-appearance: none;\n}\n\n[type=\"search\"]::-webkit-search-cancel-button,\n[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n::-webkit-file-upload-button {\n font: inherit;\n -webkit-appearance: button;\n}\n\noutput {\n display: inline-block;\n}\n\nsummary {\n display: list-item;\n}\n\ntemplate {\n display: none;\n}\n\n[hidden] {\n display: none !important;\n}\n\n/*# sourceMappingURL=bootstrap-reboot.css.map */","@mixin hover {\n // TODO: re-enable along with mq4-hover-shim\n// @if $enable-hover-media-query {\n// // See Media Queries Level 4: https://drafts.csswg.org/mediaqueries/#hover\n// // Currently shimmed by https://github.com/twbs/mq4-hover-shim\n// @media (hover: hover) {\n// &:hover { @content }\n// }\n// }\n// @else {\n// scss-lint:disable Indentation\n &:hover { @content }\n// scss-lint:enable Indentation\n// }\n}\n\n\n@mixin hover-focus {\n @if $enable-hover-media-query {\n &:focus { @content }\n @include hover { @content }\n } @else {\n &:focus,\n &:hover {\n @content\n }\n }\n}\n\n@mixin plain-hover-focus {\n @if $enable-hover-media-query {\n &,\n &:focus {\n @content\n }\n @include hover { @content }\n } @else {\n &,\n &:focus,\n &:hover {\n @content\n }\n }\n}\n\n@mixin hover-focus-active {\n @if $enable-hover-media-query {\n &:focus,\n &:active {\n @content\n }\n @include hover { @content }\n } @else {\n &:focus,\n &:active,\n &:hover {\n @content\n }\n }\n}\n"]} \ No newline at end of file diff --git a/public/vendor/bootstrap/css/bootstrap.css b/public/vendor/bootstrap/css/bootstrap.css new file mode 100755 index 000000000..b39107f6f --- /dev/null +++ b/public/vendor/bootstrap/css/bootstrap.css @@ -0,0 +1,8185 @@ +/*! + * Bootstrap v4.0.0-beta (https://getbootstrap.com) + * Copyright 2011-2017 The Bootstrap Authors + * Copyright 2011-2017 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ +@media print { + *, + *::before, + *::after { + text-shadow: none !important; + box-shadow: none !important; + } + a, + a:visited { + text-decoration: underline; + } + abbr[title]::after { + content: " (" attr(title) ")"; + } + pre { + white-space: pre-wrap !important; + } + pre, + blockquote { + border: 1px solid #999; + page-break-inside: avoid; + } + thead { + display: table-header-group; + } + tr, + img { + page-break-inside: avoid; + } + p, + h2, + h3 { + orphans: 3; + widows: 3; + } + h2, + h3 { + page-break-after: avoid; + } + .navbar { + display: none; + } + .badge { + border: 1px solid #000; + } + .table { + border-collapse: collapse !important; + } + .table td, + .table th { + background-color: #fff !important; + } + .table-bordered th, + .table-bordered td { + border: 1px solid #ddd !important; + } +} + +html { + box-sizing: border-box; + font-family: sans-serif; + line-height: 1.15; + -webkit-text-size-adjust: 100%; + -ms-text-size-adjust: 100%; + -ms-overflow-style: scrollbar; + -webkit-tap-highlight-color: transparent; +} + +*, +*::before, +*::after { + box-sizing: inherit; +} + +@-ms-viewport { + width: device-width; +} + +article, aside, dialog, figcaption, figure, footer, header, hgroup, main, nav, section { + display: block; +} + +body { + margin: 0; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; + font-size: 1rem; + font-weight: normal; + line-height: 1.5; + color: #212529; + background-color: #fff; +} + +[tabindex="-1"]:focus { + outline: none !important; +} + +hr { + box-sizing: content-box; + height: 0; + overflow: visible; +} + +h1, h2, h3, h4, h5, h6 { + margin-top: 0; + margin-bottom: .5rem; +} + +p { + margin-top: 0; + margin-bottom: 1rem; +} + +abbr[title], +abbr[data-original-title] { + text-decoration: underline; + -webkit-text-decoration: underline dotted; + text-decoration: underline dotted; + cursor: help; + border-bottom: 0; +} + +address { + margin-bottom: 1rem; + font-style: normal; + line-height: inherit; +} + +ol, +ul, +dl { + margin-top: 0; + margin-bottom: 1rem; +} + +ol ol, +ul ul, +ol ul, +ul ol { + margin-bottom: 0; +} + +dt { + font-weight: bold; +} + +dd { + margin-bottom: .5rem; + margin-left: 0; +} + +blockquote { + margin: 0 0 1rem; +} + +dfn { + font-style: italic; +} + +b, +strong { + font-weight: bolder; +} + +small { + font-size: 80%; +} + +sub, +sup { + position: relative; + font-size: 75%; + line-height: 0; + vertical-align: baseline; +} + +sub { + bottom: -.25em; +} + +sup { + top: -.5em; +} + +a { + color: #007bff; + text-decoration: none; + background-color: transparent; + -webkit-text-decoration-skip: objects; +} + +a:hover { + color: #0056b3; + text-decoration: underline; +} + +a:not([href]):not([tabindex]) { + color: inherit; + text-decoration: none; +} + +a:not([href]):not([tabindex]):focus, a:not([href]):not([tabindex]):hover { + color: inherit; + text-decoration: none; +} + +a:not([href]):not([tabindex]):focus { + outline: 0; +} + +pre, +code, +kbd, +samp { + font-family: monospace, monospace; + font-size: 1em; +} + +pre { + margin-top: 0; + margin-bottom: 1rem; + overflow: auto; +} + +figure { + margin: 0 0 1rem; +} + +img { + vertical-align: middle; + border-style: none; +} + +svg:not(:root) { + overflow: hidden; +} + +a, +area, +button, +[role="button"], +input, +label, +select, +summary, +textarea { + -ms-touch-action: manipulation; + touch-action: manipulation; +} + +table { + border-collapse: collapse; +} + +caption { + padding-top: 0.75rem; + padding-bottom: 0.75rem; + color: #868e96; + text-align: left; + caption-side: bottom; +} + +th { + text-align: left; +} + +label { + display: inline-block; + margin-bottom: .5rem; +} + +button:focus { + outline: 1px dotted; + outline: 5px auto -webkit-focus-ring-color; +} + +input, +button, +select, +optgroup, +textarea { + margin: 0; + font-family: inherit; + font-size: inherit; + line-height: inherit; +} + +button, +input { + overflow: visible; +} + +button, +select { + text-transform: none; +} + +button, +html [type="button"], +[type="reset"], +[type="submit"] { + -webkit-appearance: button; +} + +button::-moz-focus-inner, +[type="button"]::-moz-focus-inner, +[type="reset"]::-moz-focus-inner, +[type="submit"]::-moz-focus-inner { + padding: 0; + border-style: none; +} + +input[type="radio"], +input[type="checkbox"] { + box-sizing: border-box; + padding: 0; +} + +input[type="date"], +input[type="time"], +input[type="datetime-local"], +input[type="month"] { + -webkit-appearance: listbox; +} + +textarea { + overflow: auto; + resize: vertical; +} + +fieldset { + min-width: 0; + padding: 0; + margin: 0; + border: 0; +} + +legend { + display: block; + width: 100%; + max-width: 100%; + padding: 0; + margin-bottom: .5rem; + font-size: 1.5rem; + line-height: inherit; + color: inherit; + white-space: normal; +} + +progress { + vertical-align: baseline; +} + +[type="number"]::-webkit-inner-spin-button, +[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +[type="search"] { + outline-offset: -2px; + -webkit-appearance: none; +} + +[type="search"]::-webkit-search-cancel-button, +[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +::-webkit-file-upload-button { + font: inherit; + -webkit-appearance: button; +} + +output { + display: inline-block; +} + +summary { + display: list-item; +} + +template { + display: none; +} + +[hidden] { + display: none !important; +} + +h1, h2, h3, h4, h5, h6, +.h1, .h2, .h3, .h4, .h5, .h6 { + margin-bottom: 0.5rem; + font-family: inherit; + font-weight: 500; + line-height: 1.1; + color: inherit; +} + +h1, .h1 { + font-size: 2.5rem; +} + +h2, .h2 { + font-size: 2rem; +} + +h3, .h3 { + font-size: 1.75rem; +} + +h4, .h4 { + font-size: 1.5rem; +} + +h5, .h5 { + font-size: 1.25rem; +} + +h6, .h6 { + font-size: 1rem; +} + +.lead { + font-size: 1.25rem; + font-weight: 300; +} + +.display-1 { + font-size: 6rem; + font-weight: 300; + line-height: 1.1; +} + +.display-2 { + font-size: 5.5rem; + font-weight: 300; + line-height: 1.1; +} + +.display-3 { + font-size: 4.5rem; + font-weight: 300; + line-height: 1.1; +} + +.display-4 { + font-size: 3.5rem; + font-weight: 300; + line-height: 1.1; +} + +hr { + margin-top: 1rem; + margin-bottom: 1rem; + border: 0; + border-top: 1px solid rgba(0, 0, 0, 0.1); +} + +small, +.small { + font-size: 80%; + font-weight: normal; +} + +mark, +.mark { + padding: 0.2em; + background-color: #fcf8e3; +} + +.list-unstyled { + padding-left: 0; + list-style: none; +} + +.list-inline { + padding-left: 0; + list-style: none; +} + +.list-inline-item { + display: inline-block; +} + +.list-inline-item:not(:last-child) { + margin-right: 5px; +} + +.initialism { + font-size: 90%; + text-transform: uppercase; +} + +.blockquote { + margin-bottom: 1rem; + font-size: 1.25rem; +} + +.blockquote-footer { + display: block; + font-size: 80%; + color: #868e96; +} + +.blockquote-footer::before { + content: "\2014 \00A0"; +} + +.img-fluid { + max-width: 100%; + height: auto; +} + +.img-thumbnail { + padding: 0.25rem; + background-color: #fff; + border: 1px solid #ddd; + border-radius: 0.25rem; + transition: all 0.2s ease-in-out; + max-width: 100%; + height: auto; +} + +.figure { + display: inline-block; +} + +.figure-img { + margin-bottom: 0.5rem; + line-height: 1; +} + +.figure-caption { + font-size: 90%; + color: #868e96; +} + +code, +kbd, +pre, +samp { + font-family: Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; +} + +code { + padding: 0.2rem 0.4rem; + font-size: 90%; + color: #bd4147; + background-color: #f8f9fa; + border-radius: 0.25rem; +} + +a > code { + padding: 0; + color: inherit; + background-color: inherit; +} + +kbd { + padding: 0.2rem 0.4rem; + font-size: 90%; + color: #fff; + background-color: #212529; + border-radius: 0.2rem; +} + +kbd kbd { + padding: 0; + font-size: 100%; + font-weight: bold; +} + +pre { + display: block; + margin-top: 0; + margin-bottom: 1rem; + font-size: 90%; + color: #212529; +} + +pre code { + padding: 0; + font-size: inherit; + color: inherit; + background-color: transparent; + border-radius: 0; +} + +.pre-scrollable { + max-height: 340px; + overflow-y: scroll; +} + +.container { + margin-right: auto; + margin-left: auto; + padding-right: 15px; + padding-left: 15px; + width: 100%; +} + +@media (min-width: 576px) { + .container { + max-width: 540px; + } +} + +@media (min-width: 768px) { + .container { + max-width: 720px; + } +} + +@media (min-width: 992px) { + .container { + max-width: 960px; + } +} + +@media (min-width: 1200px) { + .container { + max-width: 1140px; + } +} + +.container-fluid { + width: 100%; + margin-right: auto; + margin-left: auto; + padding-right: 15px; + padding-left: 15px; + width: 100%; +} + +.row { + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + margin-right: -15px; + margin-left: -15px; +} + +.no-gutters { + margin-right: 0; + margin-left: 0; +} + +.no-gutters > .col, +.no-gutters > [class*="col-"] { + padding-right: 0; + padding-left: 0; +} + +.col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12, .col, +.col-auto, .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm, +.col-sm-auto, .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12, .col-md, +.col-md-auto, .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg, +.col-lg-auto, .col-xl-1, .col-xl-2, .col-xl-3, .col-xl-4, .col-xl-5, .col-xl-6, .col-xl-7, .col-xl-8, .col-xl-9, .col-xl-10, .col-xl-11, .col-xl-12, .col-xl, +.col-xl-auto { + position: relative; + width: 100%; + min-height: 1px; + padding-right: 15px; + padding-left: 15px; +} + +.col { + -ms-flex-preferred-size: 0; + flex-basis: 0; + -ms-flex-positive: 1; + flex-grow: 1; + max-width: 100%; +} + +.col-auto { + -ms-flex: 0 0 auto; + flex: 0 0 auto; + width: auto; + max-width: none; +} + +.col-1 { + -ms-flex: 0 0 8.333333%; + flex: 0 0 8.333333%; + max-width: 8.333333%; +} + +.col-2 { + -ms-flex: 0 0 16.666667%; + flex: 0 0 16.666667%; + max-width: 16.666667%; +} + +.col-3 { + -ms-flex: 0 0 25%; + flex: 0 0 25%; + max-width: 25%; +} + +.col-4 { + -ms-flex: 0 0 33.333333%; + flex: 0 0 33.333333%; + max-width: 33.333333%; +} + +.col-5 { + -ms-flex: 0 0 41.666667%; + flex: 0 0 41.666667%; + max-width: 41.666667%; +} + +.col-6 { + -ms-flex: 0 0 50%; + flex: 0 0 50%; + max-width: 50%; +} + +.col-7 { + -ms-flex: 0 0 58.333333%; + flex: 0 0 58.333333%; + max-width: 58.333333%; +} + +.col-8 { + -ms-flex: 0 0 66.666667%; + flex: 0 0 66.666667%; + max-width: 66.666667%; +} + +.col-9 { + -ms-flex: 0 0 75%; + flex: 0 0 75%; + max-width: 75%; +} + +.col-10 { + -ms-flex: 0 0 83.333333%; + flex: 0 0 83.333333%; + max-width: 83.333333%; +} + +.col-11 { + -ms-flex: 0 0 91.666667%; + flex: 0 0 91.666667%; + max-width: 91.666667%; +} + +.col-12 { + -ms-flex: 0 0 100%; + flex: 0 0 100%; + max-width: 100%; +} + +.order-1 { + -ms-flex-order: 1; + order: 1; +} + +.order-2 { + -ms-flex-order: 2; + order: 2; +} + +.order-3 { + -ms-flex-order: 3; + order: 3; +} + +.order-4 { + -ms-flex-order: 4; + order: 4; +} + +.order-5 { + -ms-flex-order: 5; + order: 5; +} + +.order-6 { + -ms-flex-order: 6; + order: 6; +} + +.order-7 { + -ms-flex-order: 7; + order: 7; +} + +.order-8 { + -ms-flex-order: 8; + order: 8; +} + +.order-9 { + -ms-flex-order: 9; + order: 9; +} + +.order-10 { + -ms-flex-order: 10; + order: 10; +} + +.order-11 { + -ms-flex-order: 11; + order: 11; +} + +.order-12 { + -ms-flex-order: 12; + order: 12; +} + +@media (min-width: 576px) { + .col-sm { + -ms-flex-preferred-size: 0; + flex-basis: 0; + -ms-flex-positive: 1; + flex-grow: 1; + max-width: 100%; + } + .col-sm-auto { + -ms-flex: 0 0 auto; + flex: 0 0 auto; + width: auto; + max-width: none; + } + .col-sm-1 { + -ms-flex: 0 0 8.333333%; + flex: 0 0 8.333333%; + max-width: 8.333333%; + } + .col-sm-2 { + -ms-flex: 0 0 16.666667%; + flex: 0 0 16.666667%; + max-width: 16.666667%; + } + .col-sm-3 { + -ms-flex: 0 0 25%; + flex: 0 0 25%; + max-width: 25%; + } + .col-sm-4 { + -ms-flex: 0 0 33.333333%; + flex: 0 0 33.333333%; + max-width: 33.333333%; + } + .col-sm-5 { + -ms-flex: 0 0 41.666667%; + flex: 0 0 41.666667%; + max-width: 41.666667%; + } + .col-sm-6 { + -ms-flex: 0 0 50%; + flex: 0 0 50%; + max-width: 50%; + } + .col-sm-7 { + -ms-flex: 0 0 58.333333%; + flex: 0 0 58.333333%; + max-width: 58.333333%; + } + .col-sm-8 { + -ms-flex: 0 0 66.666667%; + flex: 0 0 66.666667%; + max-width: 66.666667%; + } + .col-sm-9 { + -ms-flex: 0 0 75%; + flex: 0 0 75%; + max-width: 75%; + } + .col-sm-10 { + -ms-flex: 0 0 83.333333%; + flex: 0 0 83.333333%; + max-width: 83.333333%; + } + .col-sm-11 { + -ms-flex: 0 0 91.666667%; + flex: 0 0 91.666667%; + max-width: 91.666667%; + } + .col-sm-12 { + -ms-flex: 0 0 100%; + flex: 0 0 100%; + max-width: 100%; + } + .order-sm-1 { + -ms-flex-order: 1; + order: 1; + } + .order-sm-2 { + -ms-flex-order: 2; + order: 2; + } + .order-sm-3 { + -ms-flex-order: 3; + order: 3; + } + .order-sm-4 { + -ms-flex-order: 4; + order: 4; + } + .order-sm-5 { + -ms-flex-order: 5; + order: 5; + } + .order-sm-6 { + -ms-flex-order: 6; + order: 6; + } + .order-sm-7 { + -ms-flex-order: 7; + order: 7; + } + .order-sm-8 { + -ms-flex-order: 8; + order: 8; + } + .order-sm-9 { + -ms-flex-order: 9; + order: 9; + } + .order-sm-10 { + -ms-flex-order: 10; + order: 10; + } + .order-sm-11 { + -ms-flex-order: 11; + order: 11; + } + .order-sm-12 { + -ms-flex-order: 12; + order: 12; + } +} + +@media (min-width: 768px) { + .col-md { + -ms-flex-preferred-size: 0; + flex-basis: 0; + -ms-flex-positive: 1; + flex-grow: 1; + max-width: 100%; + } + .col-md-auto { + -ms-flex: 0 0 auto; + flex: 0 0 auto; + width: auto; + max-width: none; + } + .col-md-1 { + -ms-flex: 0 0 8.333333%; + flex: 0 0 8.333333%; + max-width: 8.333333%; + } + .col-md-2 { + -ms-flex: 0 0 16.666667%; + flex: 0 0 16.666667%; + max-width: 16.666667%; + } + .col-md-3 { + -ms-flex: 0 0 25%; + flex: 0 0 25%; + max-width: 25%; + } + .col-md-4 { + -ms-flex: 0 0 33.333333%; + flex: 0 0 33.333333%; + max-width: 33.333333%; + } + .col-md-5 { + -ms-flex: 0 0 41.666667%; + flex: 0 0 41.666667%; + max-width: 41.666667%; + } + .col-md-6 { + -ms-flex: 0 0 50%; + flex: 0 0 50%; + max-width: 50%; + } + .col-md-7 { + -ms-flex: 0 0 58.333333%; + flex: 0 0 58.333333%; + max-width: 58.333333%; + } + .col-md-8 { + -ms-flex: 0 0 66.666667%; + flex: 0 0 66.666667%; + max-width: 66.666667%; + } + .col-md-9 { + -ms-flex: 0 0 75%; + flex: 0 0 75%; + max-width: 75%; + } + .col-md-10 { + -ms-flex: 0 0 83.333333%; + flex: 0 0 83.333333%; + max-width: 83.333333%; + } + .col-md-11 { + -ms-flex: 0 0 91.666667%; + flex: 0 0 91.666667%; + max-width: 91.666667%; + } + .col-md-12 { + -ms-flex: 0 0 100%; + flex: 0 0 100%; + max-width: 100%; + } + .order-md-1 { + -ms-flex-order: 1; + order: 1; + } + .order-md-2 { + -ms-flex-order: 2; + order: 2; + } + .order-md-3 { + -ms-flex-order: 3; + order: 3; + } + .order-md-4 { + -ms-flex-order: 4; + order: 4; + } + .order-md-5 { + -ms-flex-order: 5; + order: 5; + } + .order-md-6 { + -ms-flex-order: 6; + order: 6; + } + .order-md-7 { + -ms-flex-order: 7; + order: 7; + } + .order-md-8 { + -ms-flex-order: 8; + order: 8; + } + .order-md-9 { + -ms-flex-order: 9; + order: 9; + } + .order-md-10 { + -ms-flex-order: 10; + order: 10; + } + .order-md-11 { + -ms-flex-order: 11; + order: 11; + } + .order-md-12 { + -ms-flex-order: 12; + order: 12; + } +} + +@media (min-width: 992px) { + .col-lg { + -ms-flex-preferred-size: 0; + flex-basis: 0; + -ms-flex-positive: 1; + flex-grow: 1; + max-width: 100%; + } + .col-lg-auto { + -ms-flex: 0 0 auto; + flex: 0 0 auto; + width: auto; + max-width: none; + } + .col-lg-1 { + -ms-flex: 0 0 8.333333%; + flex: 0 0 8.333333%; + max-width: 8.333333%; + } + .col-lg-2 { + -ms-flex: 0 0 16.666667%; + flex: 0 0 16.666667%; + max-width: 16.666667%; + } + .col-lg-3 { + -ms-flex: 0 0 25%; + flex: 0 0 25%; + max-width: 25%; + } + .col-lg-4 { + -ms-flex: 0 0 33.333333%; + flex: 0 0 33.333333%; + max-width: 33.333333%; + } + .col-lg-5 { + -ms-flex: 0 0 41.666667%; + flex: 0 0 41.666667%; + max-width: 41.666667%; + } + .col-lg-6 { + -ms-flex: 0 0 50%; + flex: 0 0 50%; + max-width: 50%; + } + .col-lg-7 { + -ms-flex: 0 0 58.333333%; + flex: 0 0 58.333333%; + max-width: 58.333333%; + } + .col-lg-8 { + -ms-flex: 0 0 66.666667%; + flex: 0 0 66.666667%; + max-width: 66.666667%; + } + .col-lg-9 { + -ms-flex: 0 0 75%; + flex: 0 0 75%; + max-width: 75%; + } + .col-lg-10 { + -ms-flex: 0 0 83.333333%; + flex: 0 0 83.333333%; + max-width: 83.333333%; + } + .col-lg-11 { + -ms-flex: 0 0 91.666667%; + flex: 0 0 91.666667%; + max-width: 91.666667%; + } + .col-lg-12 { + -ms-flex: 0 0 100%; + flex: 0 0 100%; + max-width: 100%; + } + .order-lg-1 { + -ms-flex-order: 1; + order: 1; + } + .order-lg-2 { + -ms-flex-order: 2; + order: 2; + } + .order-lg-3 { + -ms-flex-order: 3; + order: 3; + } + .order-lg-4 { + -ms-flex-order: 4; + order: 4; + } + .order-lg-5 { + -ms-flex-order: 5; + order: 5; + } + .order-lg-6 { + -ms-flex-order: 6; + order: 6; + } + .order-lg-7 { + -ms-flex-order: 7; + order: 7; + } + .order-lg-8 { + -ms-flex-order: 8; + order: 8; + } + .order-lg-9 { + -ms-flex-order: 9; + order: 9; + } + .order-lg-10 { + -ms-flex-order: 10; + order: 10; + } + .order-lg-11 { + -ms-flex-order: 11; + order: 11; + } + .order-lg-12 { + -ms-flex-order: 12; + order: 12; + } +} + +@media (min-width: 1200px) { + .col-xl { + -ms-flex-preferred-size: 0; + flex-basis: 0; + -ms-flex-positive: 1; + flex-grow: 1; + max-width: 100%; + } + .col-xl-auto { + -ms-flex: 0 0 auto; + flex: 0 0 auto; + width: auto; + max-width: none; + } + .col-xl-1 { + -ms-flex: 0 0 8.333333%; + flex: 0 0 8.333333%; + max-width: 8.333333%; + } + .col-xl-2 { + -ms-flex: 0 0 16.666667%; + flex: 0 0 16.666667%; + max-width: 16.666667%; + } + .col-xl-3 { + -ms-flex: 0 0 25%; + flex: 0 0 25%; + max-width: 25%; + } + .col-xl-4 { + -ms-flex: 0 0 33.333333%; + flex: 0 0 33.333333%; + max-width: 33.333333%; + } + .col-xl-5 { + -ms-flex: 0 0 41.666667%; + flex: 0 0 41.666667%; + max-width: 41.666667%; + } + .col-xl-6 { + -ms-flex: 0 0 50%; + flex: 0 0 50%; + max-width: 50%; + } + .col-xl-7 { + -ms-flex: 0 0 58.333333%; + flex: 0 0 58.333333%; + max-width: 58.333333%; + } + .col-xl-8 { + -ms-flex: 0 0 66.666667%; + flex: 0 0 66.666667%; + max-width: 66.666667%; + } + .col-xl-9 { + -ms-flex: 0 0 75%; + flex: 0 0 75%; + max-width: 75%; + } + .col-xl-10 { + -ms-flex: 0 0 83.333333%; + flex: 0 0 83.333333%; + max-width: 83.333333%; + } + .col-xl-11 { + -ms-flex: 0 0 91.666667%; + flex: 0 0 91.666667%; + max-width: 91.666667%; + } + .col-xl-12 { + -ms-flex: 0 0 100%; + flex: 0 0 100%; + max-width: 100%; + } + .order-xl-1 { + -ms-flex-order: 1; + order: 1; + } + .order-xl-2 { + -ms-flex-order: 2; + order: 2; + } + .order-xl-3 { + -ms-flex-order: 3; + order: 3; + } + .order-xl-4 { + -ms-flex-order: 4; + order: 4; + } + .order-xl-5 { + -ms-flex-order: 5; + order: 5; + } + .order-xl-6 { + -ms-flex-order: 6; + order: 6; + } + .order-xl-7 { + -ms-flex-order: 7; + order: 7; + } + .order-xl-8 { + -ms-flex-order: 8; + order: 8; + } + .order-xl-9 { + -ms-flex-order: 9; + order: 9; + } + .order-xl-10 { + -ms-flex-order: 10; + order: 10; + } + .order-xl-11 { + -ms-flex-order: 11; + order: 11; + } + .order-xl-12 { + -ms-flex-order: 12; + order: 12; + } +} + +.table { + width: 100%; + max-width: 100%; + margin-bottom: 1rem; + background-color: transparent; +} + +.table th, +.table td { + padding: 0.75rem; + vertical-align: top; + border-top: 1px solid #e9ecef; +} + +.table thead th { + vertical-align: bottom; + border-bottom: 2px solid #e9ecef; +} + +.table tbody + tbody { + border-top: 2px solid #e9ecef; +} + +.table .table { + background-color: #fff; +} + +.table-sm th, +.table-sm td { + padding: 0.3rem; +} + +.table-bordered { + border: 1px solid #e9ecef; +} + +.table-bordered th, +.table-bordered td { + border: 1px solid #e9ecef; +} + +.table-bordered thead th, +.table-bordered thead td { + border-bottom-width: 2px; +} + +.table-striped tbody tr:nth-of-type(odd) { + background-color: rgba(0, 0, 0, 0.05); +} + +.table-hover tbody tr:hover { + background-color: rgba(0, 0, 0, 0.075); +} + +.table-primary, +.table-primary > th, +.table-primary > td { + background-color: #b8daff; +} + +.table-hover .table-primary:hover { + background-color: #9fcdff; +} + +.table-hover .table-primary:hover > td, +.table-hover .table-primary:hover > th { + background-color: #9fcdff; +} + +.table-secondary, +.table-secondary > th, +.table-secondary > td { + background-color: #dddfe2; +} + +.table-hover .table-secondary:hover { + background-color: #cfd2d6; +} + +.table-hover .table-secondary:hover > td, +.table-hover .table-secondary:hover > th { + background-color: #cfd2d6; +} + +.table-success, +.table-success > th, +.table-success > td { + background-color: #c3e6cb; +} + +.table-hover .table-success:hover { + background-color: #b1dfbb; +} + +.table-hover .table-success:hover > td, +.table-hover .table-success:hover > th { + background-color: #b1dfbb; +} + +.table-info, +.table-info > th, +.table-info > td { + background-color: #bee5eb; +} + +.table-hover .table-info:hover { + background-color: #abdde5; +} + +.table-hover .table-info:hover > td, +.table-hover .table-info:hover > th { + background-color: #abdde5; +} + +.table-warning, +.table-warning > th, +.table-warning > td { + background-color: #ffeeba; +} + +.table-hover .table-warning:hover { + background-color: #ffe8a1; +} + +.table-hover .table-warning:hover > td, +.table-hover .table-warning:hover > th { + background-color: #ffe8a1; +} + +.table-danger, +.table-danger > th, +.table-danger > td { + background-color: #f5c6cb; +} + +.table-hover .table-danger:hover { + background-color: #f1b0b7; +} + +.table-hover .table-danger:hover > td, +.table-hover .table-danger:hover > th { + background-color: #f1b0b7; +} + +.table-light, +.table-light > th, +.table-light > td { + background-color: #fdfdfe; +} + +.table-hover .table-light:hover { + background-color: #ececf6; +} + +.table-hover .table-light:hover > td, +.table-hover .table-light:hover > th { + background-color: #ececf6; +} + +.table-dark, +.table-dark > th, +.table-dark > td { + background-color: #c6c8ca; +} + +.table-hover .table-dark:hover { + background-color: #b9bbbe; +} + +.table-hover .table-dark:hover > td, +.table-hover .table-dark:hover > th { + background-color: #b9bbbe; +} + +.table-active, +.table-active > th, +.table-active > td { + background-color: rgba(0, 0, 0, 0.075); +} + +.table-hover .table-active:hover { + background-color: rgba(0, 0, 0, 0.075); +} + +.table-hover .table-active:hover > td, +.table-hover .table-active:hover > th { + background-color: rgba(0, 0, 0, 0.075); +} + +.thead-inverse th { + color: #fff; + background-color: #212529; +} + +.thead-default th { + color: #495057; + background-color: #e9ecef; +} + +.table-inverse { + color: #fff; + background-color: #212529; +} + +.table-inverse th, +.table-inverse td, +.table-inverse thead th { + border-color: #32383e; +} + +.table-inverse.table-bordered { + border: 0; +} + +.table-inverse.table-striped tbody tr:nth-of-type(odd) { + background-color: rgba(255, 255, 255, 0.05); +} + +.table-inverse.table-hover tbody tr:hover { + background-color: rgba(255, 255, 255, 0.075); +} + +@media (max-width: 991px) { + .table-responsive { + display: block; + width: 100%; + overflow-x: auto; + -ms-overflow-style: -ms-autohiding-scrollbar; + } + .table-responsive.table-bordered { + border: 0; + } +} + +.form-control { + display: block; + width: 100%; + padding: 0.5rem 0.75rem; + font-size: 1rem; + line-height: 1.25; + color: #495057; + background-color: #fff; + background-image: none; + background-clip: padding-box; + border: 1px solid rgba(0, 0, 0, 0.15); + border-radius: 0.25rem; + transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s; +} + +.form-control::-ms-expand { + background-color: transparent; + border: 0; +} + +.form-control:focus { + color: #495057; + background-color: #fff; + border-color: #80bdff; + outline: none; +} + +.form-control::-webkit-input-placeholder { + color: #868e96; + opacity: 1; +} + +.form-control:-ms-input-placeholder { + color: #868e96; + opacity: 1; +} + +.form-control::placeholder { + color: #868e96; + opacity: 1; +} + +.form-control:disabled, .form-control[readonly] { + background-color: #e9ecef; + opacity: 1; +} + +select.form-control:not([size]):not([multiple]) { + height: calc(2.25rem + 2px); +} + +select.form-control:focus::-ms-value { + color: #495057; + background-color: #fff; +} + +.form-control-file, +.form-control-range { + display: block; +} + +.col-form-label { + padding-top: calc(0.5rem - 1px * 2); + padding-bottom: calc(0.5rem - 1px * 2); + margin-bottom: 0; +} + +.col-form-label-lg { + padding-top: calc(0.5rem - 1px * 2); + padding-bottom: calc(0.5rem - 1px * 2); + font-size: 1.25rem; +} + +.col-form-label-sm { + padding-top: calc(0.25rem - 1px * 2); + padding-bottom: calc(0.25rem - 1px * 2); + font-size: 0.875rem; +} + +.col-form-legend { + padding-top: 0.5rem; + padding-bottom: 0.5rem; + margin-bottom: 0; + font-size: 1rem; +} + +.form-control-plaintext { + padding-top: 0.5rem; + padding-bottom: 0.5rem; + margin-bottom: 0; + line-height: 1.25; + border: solid transparent; + border-width: 1px 0; +} + +.form-control-plaintext.form-control-sm, .input-group-sm > .form-control-plaintext.form-control, +.input-group-sm > .form-control-plaintext.input-group-addon, +.input-group-sm > .input-group-btn > .form-control-plaintext.btn, .form-control-plaintext.form-control-lg, .input-group-lg > .form-control-plaintext.form-control, +.input-group-lg > .form-control-plaintext.input-group-addon, +.input-group-lg > .input-group-btn > .form-control-plaintext.btn { + padding-right: 0; + padding-left: 0; +} + +.form-control-sm, .input-group-sm > .form-control, +.input-group-sm > .input-group-addon, +.input-group-sm > .input-group-btn > .btn { + padding: 0.25rem 0.5rem; + font-size: 0.875rem; + line-height: 1.5; + border-radius: 0.2rem; +} + +select.form-control-sm:not([size]):not([multiple]), .input-group-sm > select.form-control:not([size]):not([multiple]), +.input-group-sm > select.input-group-addon:not([size]):not([multiple]), +.input-group-sm > .input-group-btn > select.btn:not([size]):not([multiple]) { + height: calc(1.8125rem + 2px); +} + +.form-control-lg, .input-group-lg > .form-control, +.input-group-lg > .input-group-addon, +.input-group-lg > .input-group-btn > .btn { + padding: 0.5rem 1rem; + font-size: 1.25rem; + line-height: 1.5; + border-radius: 0.3rem; +} + +select.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.form-control:not([size]):not([multiple]), +.input-group-lg > select.input-group-addon:not([size]):not([multiple]), +.input-group-lg > .input-group-btn > select.btn:not([size]):not([multiple]) { + height: calc(2.3125rem + 2px); +} + +.form-group { + margin-bottom: 1rem; +} + +.form-text { + display: block; + margin-top: 0.25rem; +} + +.form-row { + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + margin-right: -5px; + margin-left: -5px; +} + +.form-row > .col, +.form-row > [class*="col-"] { + padding-right: 5px; + padding-left: 5px; +} + +.form-check { + position: relative; + display: block; + margin-bottom: 0.5rem; +} + +.form-check.disabled .form-check-label { + color: #868e96; +} + +.form-check-label { + padding-left: 1.25rem; + margin-bottom: 0; +} + +.form-check-input { + position: absolute; + margin-top: 0.25rem; + margin-left: -1.25rem; +} + +.form-check-input:only-child { + position: static; +} + +.form-check-inline { + display: inline-block; +} + +.form-check-inline .form-check-label { + vertical-align: middle; +} + +.form-check-inline + .form-check-inline { + margin-left: 0.75rem; +} + +.invalid-feedback { + display: none; + margin-top: .25rem; + font-size: .875rem; + color: #dc3545; +} + +.invalid-tooltip { + position: absolute; + top: 100%; + z-index: 5; + display: none; + width: 250px; + padding: .5rem; + margin-top: .1rem; + font-size: .875rem; + line-height: 1; + color: #fff; + background-color: rgba(220, 53, 69, 0.8); + border-radius: .2rem; +} + +.was-validated .form-control:valid, .form-control.is-valid, .was-validated +.custom-select:valid, +.custom-select.is-valid { + border-color: #28a745; +} + +.was-validated .form-control:valid:focus, .form-control.is-valid:focus, .was-validated +.custom-select:valid:focus, +.custom-select.is-valid:focus { + box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25); +} + +.was-validated .form-control:valid ~ .invalid-feedback, +.was-validated .form-control:valid ~ .invalid-tooltip, .form-control.is-valid ~ .invalid-feedback, +.form-control.is-valid ~ .invalid-tooltip, .was-validated +.custom-select:valid ~ .invalid-feedback, +.was-validated +.custom-select:valid ~ .invalid-tooltip, +.custom-select.is-valid ~ .invalid-feedback, +.custom-select.is-valid ~ .invalid-tooltip { + display: block; +} + +.was-validated .form-check-input:valid + .form-check-label, .form-check-input.is-valid + .form-check-label { + color: #28a745; +} + +.was-validated .custom-control-input:valid ~ .custom-control-indicator, .custom-control-input.is-valid ~ .custom-control-indicator { + background-color: rgba(40, 167, 69, 0.25); +} + +.was-validated .custom-control-input:valid ~ .custom-control-description, .custom-control-input.is-valid ~ .custom-control-description { + color: #28a745; +} + +.was-validated .custom-file-input:valid ~ .custom-file-control, .custom-file-input.is-valid ~ .custom-file-control { + border-color: #28a745; +} + +.was-validated .custom-file-input:valid ~ .custom-file-control::before, .custom-file-input.is-valid ~ .custom-file-control::before { + border-color: inherit; +} + +.was-validated .custom-file-input:valid:focus, .custom-file-input.is-valid:focus { + box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25); +} + +.was-validated .form-control:invalid, .form-control.is-invalid, .was-validated +.custom-select:invalid, +.custom-select.is-invalid { + border-color: #dc3545; +} + +.was-validated .form-control:invalid:focus, .form-control.is-invalid:focus, .was-validated +.custom-select:invalid:focus, +.custom-select.is-invalid:focus { + box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25); +} + +.was-validated .form-control:invalid ~ .invalid-feedback, +.was-validated .form-control:invalid ~ .invalid-tooltip, .form-control.is-invalid ~ .invalid-feedback, +.form-control.is-invalid ~ .invalid-tooltip, .was-validated +.custom-select:invalid ~ .invalid-feedback, +.was-validated +.custom-select:invalid ~ .invalid-tooltip, +.custom-select.is-invalid ~ .invalid-feedback, +.custom-select.is-invalid ~ .invalid-tooltip { + display: block; +} + +.was-validated .form-check-input:invalid + .form-check-label, .form-check-input.is-invalid + .form-check-label { + color: #dc3545; +} + +.was-validated .custom-control-input:invalid ~ .custom-control-indicator, .custom-control-input.is-invalid ~ .custom-control-indicator { + background-color: rgba(220, 53, 69, 0.25); +} + +.was-validated .custom-control-input:invalid ~ .custom-control-description, .custom-control-input.is-invalid ~ .custom-control-description { + color: #dc3545; +} + +.was-validated .custom-file-input:invalid ~ .custom-file-control, .custom-file-input.is-invalid ~ .custom-file-control { + border-color: #dc3545; +} + +.was-validated .custom-file-input:invalid ~ .custom-file-control::before, .custom-file-input.is-invalid ~ .custom-file-control::before { + border-color: inherit; +} + +.was-validated .custom-file-input:invalid:focus, .custom-file-input.is-invalid:focus { + box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25); +} + +.form-inline { + display: -ms-flexbox; + display: flex; + -ms-flex-flow: row wrap; + flex-flow: row wrap; + -ms-flex-align: center; + align-items: center; +} + +.form-inline .form-check { + width: 100%; +} + +@media (min-width: 576px) { + .form-inline label { + display: -ms-flexbox; + display: flex; + -ms-flex-align: center; + align-items: center; + -ms-flex-pack: center; + justify-content: center; + margin-bottom: 0; + } + .form-inline .form-group { + display: -ms-flexbox; + display: flex; + -ms-flex: 0 0 auto; + flex: 0 0 auto; + -ms-flex-flow: row wrap; + flex-flow: row wrap; + -ms-flex-align: center; + align-items: center; + margin-bottom: 0; + } + .form-inline .form-control { + display: inline-block; + width: auto; + vertical-align: middle; + } + .form-inline .form-control-plaintext { + display: inline-block; + } + .form-inline .input-group { + width: auto; + } + .form-inline .form-control-label { + margin-bottom: 0; + vertical-align: middle; + } + .form-inline .form-check { + display: -ms-flexbox; + display: flex; + -ms-flex-align: center; + align-items: center; + -ms-flex-pack: center; + justify-content: center; + width: auto; + margin-top: 0; + margin-bottom: 0; + } + .form-inline .form-check-label { + padding-left: 0; + } + .form-inline .form-check-input { + position: relative; + margin-top: 0; + margin-right: 0.25rem; + margin-left: 0; + } + .form-inline .custom-control { + display: -ms-flexbox; + display: flex; + -ms-flex-align: center; + align-items: center; + -ms-flex-pack: center; + justify-content: center; + padding-left: 0; + } + .form-inline .custom-control-indicator { + position: static; + display: inline-block; + margin-right: 0.25rem; + vertical-align: text-bottom; + } + .form-inline .has-feedback .form-control-feedback { + top: 0; + } +} + +.btn { + display: inline-block; + font-weight: normal; + text-align: center; + white-space: nowrap; + vertical-align: middle; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + border: 1px solid transparent; + padding: 0.5rem 0.75rem; + font-size: 1rem; + line-height: 1.25; + border-radius: 0.25rem; + transition: all 0.15s ease-in-out; +} + +.btn:focus, .btn:hover { + text-decoration: none; +} + +.btn:focus, .btn.focus { + outline: 0; + box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25); +} + +.btn.disabled, .btn:disabled { + opacity: .65; +} + +.btn:active, .btn.active { + background-image: none; +} + +a.btn.disabled, +fieldset[disabled] a.btn { + pointer-events: none; +} + +.btn-primary { + color: #fff; + background-color: #007bff; + border-color: #007bff; +} + +.btn-primary:hover { + color: #fff; + background-color: #0069d9; + border-color: #0062cc; +} + +.btn-primary:focus, .btn-primary.focus { + box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.5); +} + +.btn-primary.disabled, .btn-primary:disabled { + background-color: #007bff; + border-color: #007bff; +} + +.btn-primary:active, .btn-primary.active, +.show > .btn-primary.dropdown-toggle { + background-color: #0069d9; + background-image: none; + border-color: #0062cc; +} + +.btn-secondary { + color: #fff; + background-color: #868e96; + border-color: #868e96; +} + +.btn-secondary:hover { + color: #fff; + background-color: #727b84; + border-color: #6c757d; +} + +.btn-secondary:focus, .btn-secondary.focus { + box-shadow: 0 0 0 3px rgba(134, 142, 150, 0.5); +} + +.btn-secondary.disabled, .btn-secondary:disabled { + background-color: #868e96; + border-color: #868e96; +} + +.btn-secondary:active, .btn-secondary.active, +.show > .btn-secondary.dropdown-toggle { + background-color: #727b84; + background-image: none; + border-color: #6c757d; +} + +.btn-success { + color: #fff; + background-color: #28a745; + border-color: #28a745; +} + +.btn-success:hover { + color: #fff; + background-color: #218838; + border-color: #1e7e34; +} + +.btn-success:focus, .btn-success.focus { + box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.5); +} + +.btn-success.disabled, .btn-success:disabled { + background-color: #28a745; + border-color: #28a745; +} + +.btn-success:active, .btn-success.active, +.show > .btn-success.dropdown-toggle { + background-color: #218838; + background-image: none; + border-color: #1e7e34; +} + +.btn-info { + color: #fff; + background-color: #17a2b8; + border-color: #17a2b8; +} + +.btn-info:hover { + color: #fff; + background-color: #138496; + border-color: #117a8b; +} + +.btn-info:focus, .btn-info.focus { + box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.5); +} + +.btn-info.disabled, .btn-info:disabled { + background-color: #17a2b8; + border-color: #17a2b8; +} + +.btn-info:active, .btn-info.active, +.show > .btn-info.dropdown-toggle { + background-color: #138496; + background-image: none; + border-color: #117a8b; +} + +.btn-warning { + color: #111; + background-color: #ffc107; + border-color: #ffc107; +} + +.btn-warning:hover { + color: #111; + background-color: #e0a800; + border-color: #d39e00; +} + +.btn-warning:focus, .btn-warning.focus { + box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.5); +} + +.btn-warning.disabled, .btn-warning:disabled { + background-color: #ffc107; + border-color: #ffc107; +} + +.btn-warning:active, .btn-warning.active, +.show > .btn-warning.dropdown-toggle { + background-color: #e0a800; + background-image: none; + border-color: #d39e00; +} + +.btn-danger { + color: #fff; + background-color: #dc3545; + border-color: #dc3545; +} + +.btn-danger:hover { + color: #fff; + background-color: #c82333; + border-color: #bd2130; +} + +.btn-danger:focus, .btn-danger.focus { + box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.5); +} + +.btn-danger.disabled, .btn-danger:disabled { + background-color: #dc3545; + border-color: #dc3545; +} + +.btn-danger:active, .btn-danger.active, +.show > .btn-danger.dropdown-toggle { + background-color: #c82333; + background-image: none; + border-color: #bd2130; +} + +.btn-light { + color: #111; + background-color: #f8f9fa; + border-color: #f8f9fa; +} + +.btn-light:hover { + color: #111; + background-color: #e2e6ea; + border-color: #dae0e5; +} + +.btn-light:focus, .btn-light.focus { + box-shadow: 0 0 0 3px rgba(248, 249, 250, 0.5); +} + +.btn-light.disabled, .btn-light:disabled { + background-color: #f8f9fa; + border-color: #f8f9fa; +} + +.btn-light:active, .btn-light.active, +.show > .btn-light.dropdown-toggle { + background-color: #e2e6ea; + background-image: none; + border-color: #dae0e5; +} + +.btn-dark { + color: #fff; + background-color: #343a40; + border-color: #343a40; +} + +.btn-dark:hover { + color: #fff; + background-color: #23272b; + border-color: #1d2124; +} + +.btn-dark:focus, .btn-dark.focus { + box-shadow: 0 0 0 3px rgba(52, 58, 64, 0.5); +} + +.btn-dark.disabled, .btn-dark:disabled { + background-color: #343a40; + border-color: #343a40; +} + +.btn-dark:active, .btn-dark.active, +.show > .btn-dark.dropdown-toggle { + background-color: #23272b; + background-image: none; + border-color: #1d2124; +} + +.btn-outline-primary { + color: #007bff; + background-color: transparent; + background-image: none; + border-color: #007bff; +} + +.btn-outline-primary:hover { + color: #fff; + background-color: #007bff; + border-color: #007bff; +} + +.btn-outline-primary:focus, .btn-outline-primary.focus { + box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.5); +} + +.btn-outline-primary.disabled, .btn-outline-primary:disabled { + color: #007bff; + background-color: transparent; +} + +.btn-outline-primary:active, .btn-outline-primary.active, +.show > .btn-outline-primary.dropdown-toggle { + color: #fff; + background-color: #007bff; + border-color: #007bff; +} + +.btn-outline-secondary { + color: #868e96; + background-color: transparent; + background-image: none; + border-color: #868e96; +} + +.btn-outline-secondary:hover { + color: #fff; + background-color: #868e96; + border-color: #868e96; +} + +.btn-outline-secondary:focus, .btn-outline-secondary.focus { + box-shadow: 0 0 0 3px rgba(134, 142, 150, 0.5); +} + +.btn-outline-secondary.disabled, .btn-outline-secondary:disabled { + color: #868e96; + background-color: transparent; +} + +.btn-outline-secondary:active, .btn-outline-secondary.active, +.show > .btn-outline-secondary.dropdown-toggle { + color: #fff; + background-color: #868e96; + border-color: #868e96; +} + +.btn-outline-success { + color: #28a745; + background-color: transparent; + background-image: none; + border-color: #28a745; +} + +.btn-outline-success:hover { + color: #fff; + background-color: #28a745; + border-color: #28a745; +} + +.btn-outline-success:focus, .btn-outline-success.focus { + box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.5); +} + +.btn-outline-success.disabled, .btn-outline-success:disabled { + color: #28a745; + background-color: transparent; +} + +.btn-outline-success:active, .btn-outline-success.active, +.show > .btn-outline-success.dropdown-toggle { + color: #fff; + background-color: #28a745; + border-color: #28a745; +} + +.btn-outline-info { + color: #17a2b8; + background-color: transparent; + background-image: none; + border-color: #17a2b8; +} + +.btn-outline-info:hover { + color: #fff; + background-color: #17a2b8; + border-color: #17a2b8; +} + +.btn-outline-info:focus, .btn-outline-info.focus { + box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.5); +} + +.btn-outline-info.disabled, .btn-outline-info:disabled { + color: #17a2b8; + background-color: transparent; +} + +.btn-outline-info:active, .btn-outline-info.active, +.show > .btn-outline-info.dropdown-toggle { + color: #fff; + background-color: #17a2b8; + border-color: #17a2b8; +} + +.btn-outline-warning { + color: #ffc107; + background-color: transparent; + background-image: none; + border-color: #ffc107; +} + +.btn-outline-warning:hover { + color: #fff; + background-color: #ffc107; + border-color: #ffc107; +} + +.btn-outline-warning:focus, .btn-outline-warning.focus { + box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.5); +} + +.btn-outline-warning.disabled, .btn-outline-warning:disabled { + color: #ffc107; + background-color: transparent; +} + +.btn-outline-warning:active, .btn-outline-warning.active, +.show > .btn-outline-warning.dropdown-toggle { + color: #fff; + background-color: #ffc107; + border-color: #ffc107; +} + +.btn-outline-danger { + color: #dc3545; + background-color: transparent; + background-image: none; + border-color: #dc3545; +} + +.btn-outline-danger:hover { + color: #fff; + background-color: #dc3545; + border-color: #dc3545; +} + +.btn-outline-danger:focus, .btn-outline-danger.focus { + box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.5); +} + +.btn-outline-danger.disabled, .btn-outline-danger:disabled { + color: #dc3545; + background-color: transparent; +} + +.btn-outline-danger:active, .btn-outline-danger.active, +.show > .btn-outline-danger.dropdown-toggle { + color: #fff; + background-color: #dc3545; + border-color: #dc3545; +} + +.btn-outline-light { + color: #f8f9fa; + background-color: transparent; + background-image: none; + border-color: #f8f9fa; +} + +.btn-outline-light:hover { + color: #fff; + background-color: #f8f9fa; + border-color: #f8f9fa; +} + +.btn-outline-light:focus, .btn-outline-light.focus { + box-shadow: 0 0 0 3px rgba(248, 249, 250, 0.5); +} + +.btn-outline-light.disabled, .btn-outline-light:disabled { + color: #f8f9fa; + background-color: transparent; +} + +.btn-outline-light:active, .btn-outline-light.active, +.show > .btn-outline-light.dropdown-toggle { + color: #fff; + background-color: #f8f9fa; + border-color: #f8f9fa; +} + +.btn-outline-dark { + color: #343a40; + background-color: transparent; + background-image: none; + border-color: #343a40; +} + +.btn-outline-dark:hover { + color: #fff; + background-color: #343a40; + border-color: #343a40; +} + +.btn-outline-dark:focus, .btn-outline-dark.focus { + box-shadow: 0 0 0 3px rgba(52, 58, 64, 0.5); +} + +.btn-outline-dark.disabled, .btn-outline-dark:disabled { + color: #343a40; + background-color: transparent; +} + +.btn-outline-dark:active, .btn-outline-dark.active, +.show > .btn-outline-dark.dropdown-toggle { + color: #fff; + background-color: #343a40; + border-color: #343a40; +} + +.btn-link { + font-weight: normal; + color: #007bff; + border-radius: 0; +} + +.btn-link, .btn-link:active, .btn-link.active, .btn-link:disabled { + background-color: transparent; +} + +.btn-link, .btn-link:focus, .btn-link:active { + border-color: transparent; + box-shadow: none; +} + +.btn-link:hover { + border-color: transparent; +} + +.btn-link:focus, .btn-link:hover { + color: #0056b3; + text-decoration: underline; + background-color: transparent; +} + +.btn-link:disabled { + color: #868e96; +} + +.btn-link:disabled:focus, .btn-link:disabled:hover { + text-decoration: none; +} + +.btn-lg, .btn-group-lg > .btn { + padding: 0.5rem 1rem; + font-size: 1.25rem; + line-height: 1.5; + border-radius: 0.3rem; +} + +.btn-sm, .btn-group-sm > .btn { + padding: 0.25rem 0.5rem; + font-size: 0.875rem; + line-height: 1.5; + border-radius: 0.2rem; +} + +.btn-block { + display: block; + width: 100%; +} + +.btn-block + .btn-block { + margin-top: 0.5rem; +} + +input[type="submit"].btn-block, +input[type="reset"].btn-block, +input[type="button"].btn-block { + width: 100%; +} + +.fade { + opacity: 0; + transition: opacity 0.15s linear; +} + +.fade.show { + opacity: 1; +} + +.collapse { + display: none; +} + +.collapse.show { + display: block; +} + +tr.collapse.show { + display: table-row; +} + +tbody.collapse.show { + display: table-row-group; +} + +.collapsing { + position: relative; + height: 0; + overflow: hidden; + transition: height 0.35s ease; +} + +.dropup, +.dropdown { + position: relative; +} + +.dropdown-toggle::after { + display: inline-block; + width: 0; + height: 0; + margin-left: 0.255em; + vertical-align: 0.255em; + content: ""; + border-top: 0.3em solid; + border-right: 0.3em solid transparent; + border-left: 0.3em solid transparent; +} + +.dropdown-toggle:empty::after { + margin-left: 0; +} + +.dropup .dropdown-menu { + margin-top: 0; + margin-bottom: 0.125rem; +} + +.dropup .dropdown-toggle::after { + border-top: 0; + border-bottom: 0.3em solid; +} + +.dropdown-menu { + position: absolute; + top: 100%; + left: 0; + z-index: 1000; + display: none; + float: left; + min-width: 10rem; + padding: 0.5rem 0; + margin: 0.125rem 0 0; + font-size: 1rem; + color: #212529; + text-align: left; + list-style: none; + background-color: #fff; + background-clip: padding-box; + border: 1px solid rgba(0, 0, 0, 0.15); + border-radius: 0.25rem; +} + +.dropdown-divider { + height: 0; + margin: 0.5rem 0; + overflow: hidden; + border-top: 1px solid #e9ecef; +} + +.dropdown-item { + display: block; + width: 100%; + padding: 0.25rem 1.5rem; + clear: both; + font-weight: normal; + color: #212529; + text-align: inherit; + white-space: nowrap; + background: none; + border: 0; +} + +.dropdown-item:focus, .dropdown-item:hover { + color: #16181b; + text-decoration: none; + background-color: #f8f9fa; +} + +.dropdown-item.active, .dropdown-item:active { + color: #fff; + text-decoration: none; + background-color: #007bff; +} + +.dropdown-item.disabled, .dropdown-item:disabled { + color: #868e96; + background-color: transparent; +} + +.show > a { + outline: 0; +} + +.dropdown-menu.show { + display: block; +} + +.dropdown-header { + display: block; + padding: 0.5rem 1.5rem; + margin-bottom: 0; + font-size: 0.875rem; + color: #868e96; + white-space: nowrap; +} + +.btn-group, +.btn-group-vertical { + position: relative; + display: -ms-inline-flexbox; + display: inline-flex; + vertical-align: middle; +} + +.btn-group > .btn, +.btn-group-vertical > .btn { + position: relative; + -ms-flex: 0 1 auto; + flex: 0 1 auto; + margin-bottom: 0; +} + +.btn-group > .btn:hover, +.btn-group-vertical > .btn:hover { + z-index: 2; +} + +.btn-group > .btn:focus, .btn-group > .btn:active, .btn-group > .btn.active, +.btn-group-vertical > .btn:focus, +.btn-group-vertical > .btn:active, +.btn-group-vertical > .btn.active { + z-index: 2; +} + +.btn-group .btn + .btn, +.btn-group .btn + .btn-group, +.btn-group .btn-group + .btn, +.btn-group .btn-group + .btn-group, +.btn-group-vertical .btn + .btn, +.btn-group-vertical .btn + .btn-group, +.btn-group-vertical .btn-group + .btn, +.btn-group-vertical .btn-group + .btn-group { + margin-left: -1px; +} + +.btn-toolbar { + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + -ms-flex-pack: start; + justify-content: flex-start; +} + +.btn-toolbar .input-group { + width: auto; +} + +.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) { + border-radius: 0; +} + +.btn-group > .btn:first-child { + margin-left: 0; +} + +.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} + +.btn-group > .btn:last-child:not(:first-child), +.btn-group > .dropdown-toggle:not(:first-child) { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} + +.btn-group > .btn-group { + float: left; +} + +.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} + +.btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child, +.btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} + +.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} + +.btn + .dropdown-toggle-split { + padding-right: 0.5625rem; + padding-left: 0.5625rem; +} + +.btn + .dropdown-toggle-split::after { + margin-left: 0; +} + +.btn-sm + .dropdown-toggle-split, .btn-group-sm > .btn + .dropdown-toggle-split { + padding-right: 0.375rem; + padding-left: 0.375rem; +} + +.btn-lg + .dropdown-toggle-split, .btn-group-lg > .btn + .dropdown-toggle-split { + padding-right: 0.75rem; + padding-left: 0.75rem; +} + +.btn-group-vertical { + display: -ms-inline-flexbox; + display: inline-flex; + -ms-flex-direction: column; + flex-direction: column; + -ms-flex-align: start; + align-items: flex-start; + -ms-flex-pack: center; + justify-content: center; +} + +.btn-group-vertical .btn, +.btn-group-vertical .btn-group { + width: 100%; +} + +.btn-group-vertical > .btn + .btn, +.btn-group-vertical > .btn + .btn-group, +.btn-group-vertical > .btn-group + .btn, +.btn-group-vertical > .btn-group + .btn-group { + margin-top: -1px; + margin-left: 0; +} + +.btn-group-vertical > .btn:not(:first-child):not(:last-child) { + border-radius: 0; +} + +.btn-group-vertical > .btn:first-child:not(:last-child) { + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} + +.btn-group-vertical > .btn:last-child:not(:first-child) { + border-top-left-radius: 0; + border-top-right-radius: 0; +} + +.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn { + border-radius: 0; +} + +.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child, +.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle { + border-bottom-right-radius: 0; + border-bottom-left-radius: 0; +} + +.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child { + border-top-left-radius: 0; + border-top-right-radius: 0; +} + +[data-toggle="buttons"] > .btn input[type="radio"], +[data-toggle="buttons"] > .btn input[type="checkbox"], +[data-toggle="buttons"] > .btn-group > .btn input[type="radio"], +[data-toggle="buttons"] > .btn-group > .btn input[type="checkbox"] { + position: absolute; + clip: rect(0, 0, 0, 0); + pointer-events: none; +} + +.input-group { + position: relative; + display: -ms-flexbox; + display: flex; + width: 100%; +} + +.input-group .form-control { + position: relative; + z-index: 2; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + width: 1%; + margin-bottom: 0; +} + +.input-group .form-control:focus, .input-group .form-control:active, .input-group .form-control:hover { + z-index: 3; +} + +.input-group-addon, +.input-group-btn, +.input-group .form-control { + display: -ms-flexbox; + display: flex; + -ms-flex-align: center; + align-items: center; +} + +.input-group-addon:not(:first-child):not(:last-child), +.input-group-btn:not(:first-child):not(:last-child), +.input-group .form-control:not(:first-child):not(:last-child) { + border-radius: 0; +} + +.input-group-addon, +.input-group-btn { + white-space: nowrap; + vertical-align: middle; +} + +.input-group-addon { + padding: 0.5rem 0.75rem; + margin-bottom: 0; + font-size: 1rem; + font-weight: normal; + line-height: 1.25; + color: #495057; + text-align: center; + background-color: #e9ecef; + border: 1px solid rgba(0, 0, 0, 0.15); + border-radius: 0.25rem; +} + +.input-group-addon.form-control-sm, +.input-group-sm > .input-group-addon, +.input-group-sm > .input-group-btn > .input-group-addon.btn { + padding: 0.25rem 0.5rem; + font-size: 0.875rem; + border-radius: 0.2rem; +} + +.input-group-addon.form-control-lg, +.input-group-lg > .input-group-addon, +.input-group-lg > .input-group-btn > .input-group-addon.btn { + padding: 0.5rem 1rem; + font-size: 1.25rem; + border-radius: 0.3rem; +} + +.input-group-addon input[type="radio"], +.input-group-addon input[type="checkbox"] { + margin-top: 0; +} + +.input-group .form-control:not(:last-child), +.input-group-addon:not(:last-child), +.input-group-btn:not(:last-child) > .btn, +.input-group-btn:not(:last-child) > .btn-group > .btn, +.input-group-btn:not(:last-child) > .dropdown-toggle, +.input-group-btn:not(:first-child) > .btn:not(:last-child):not(.dropdown-toggle), +.input-group-btn:not(:first-child) > .btn-group:not(:last-child) > .btn { + border-top-right-radius: 0; + border-bottom-right-radius: 0; +} + +.input-group-addon:not(:last-child) { + border-right: 0; +} + +.input-group .form-control:not(:first-child), +.input-group-addon:not(:first-child), +.input-group-btn:not(:first-child) > .btn, +.input-group-btn:not(:first-child) > .btn-group > .btn, +.input-group-btn:not(:first-child) > .dropdown-toggle, +.input-group-btn:not(:last-child) > .btn:not(:first-child), +.input-group-btn:not(:last-child) > .btn-group:not(:first-child) > .btn { + border-top-left-radius: 0; + border-bottom-left-radius: 0; +} + +.form-control + .input-group-addon:not(:first-child) { + border-left: 0; +} + +.input-group-btn { + position: relative; + font-size: 0; + white-space: nowrap; +} + +.input-group-btn > .btn { + position: relative; +} + +.input-group-btn > .btn + .btn { + margin-left: -1px; +} + +.input-group-btn > .btn:focus, .input-group-btn > .btn:active, .input-group-btn > .btn:hover { + z-index: 3; +} + +.input-group-btn:not(:last-child) > .btn, +.input-group-btn:not(:last-child) > .btn-group { + margin-right: -1px; +} + +.input-group-btn:not(:first-child) > .btn, +.input-group-btn:not(:first-child) > .btn-group { + z-index: 2; + margin-left: -1px; +} + +.input-group-btn:not(:first-child) > .btn:focus, .input-group-btn:not(:first-child) > .btn:active, .input-group-btn:not(:first-child) > .btn:hover, +.input-group-btn:not(:first-child) > .btn-group:focus, +.input-group-btn:not(:first-child) > .btn-group:active, +.input-group-btn:not(:first-child) > .btn-group:hover { + z-index: 3; +} + +.custom-control { + position: relative; + display: -ms-inline-flexbox; + display: inline-flex; + min-height: 1.5rem; + padding-left: 1.5rem; + margin-right: 1rem; +} + +.custom-control-input { + position: absolute; + z-index: -1; + opacity: 0; +} + +.custom-control-input:checked ~ .custom-control-indicator { + color: #fff; + background-color: #007bff; +} + +.custom-control-input:focus ~ .custom-control-indicator { + box-shadow: 0 0 0 1px #fff, 0 0 0 3px #007bff; +} + +.custom-control-input:active ~ .custom-control-indicator { + color: #fff; + background-color: #b3d7ff; +} + +.custom-control-input:disabled ~ .custom-control-indicator { + background-color: #e9ecef; +} + +.custom-control-input:disabled ~ .custom-control-description { + color: #868e96; +} + +.custom-control-indicator { + position: absolute; + top: 0.25rem; + left: 0; + display: block; + width: 1rem; + height: 1rem; + pointer-events: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + background-color: #ddd; + background-repeat: no-repeat; + background-position: center center; + background-size: 50% 50%; +} + +.custom-checkbox .custom-control-indicator { + border-radius: 0.25rem; +} + +.custom-checkbox .custom-control-input:checked ~ .custom-control-indicator { + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E"); +} + +.custom-checkbox .custom-control-input:indeterminate ~ .custom-control-indicator { + background-color: #007bff; + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4'%3E%3Cpath stroke='%23fff' d='M0 2h4'/%3E%3C/svg%3E"); +} + +.custom-radio .custom-control-indicator { + border-radius: 50%; +} + +.custom-radio .custom-control-input:checked ~ .custom-control-indicator { + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='%23fff'/%3E%3C/svg%3E"); +} + +.custom-controls-stacked { + display: -ms-flexbox; + display: flex; + -ms-flex-direction: column; + flex-direction: column; +} + +.custom-controls-stacked .custom-control { + margin-bottom: 0.25rem; +} + +.custom-controls-stacked .custom-control + .custom-control { + margin-left: 0; +} + +.custom-select { + display: inline-block; + max-width: 100%; + height: calc(2.25rem + 2px); + padding: 0.375rem 1.75rem 0.375rem 0.75rem; + line-height: 1.25; + color: #495057; + vertical-align: middle; + background: #fff url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23333' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E") no-repeat right 0.75rem center; + background-size: 8px 10px; + border: 1px solid rgba(0, 0, 0, 0.15); + border-radius: 0.25rem; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; +} + +.custom-select:focus { + border-color: #80bdff; + outline: none; +} + +.custom-select:focus::-ms-value { + color: #495057; + background-color: #fff; +} + +.custom-select:disabled { + color: #868e96; + background-color: #e9ecef; +} + +.custom-select::-ms-expand { + opacity: 0; +} + +.custom-select-sm { + height: calc(1.8125rem + 2px); + padding-top: 0.375rem; + padding-bottom: 0.375rem; + font-size: 75%; +} + +.custom-file { + position: relative; + display: inline-block; + max-width: 100%; + height: 2.5rem; + margin-bottom: 0; +} + +.custom-file-input { + min-width: 14rem; + max-width: 100%; + height: 2.5rem; + margin: 0; + opacity: 0; +} + +.custom-file-control { + position: absolute; + top: 0; + right: 0; + left: 0; + z-index: 5; + height: 2.5rem; + padding: 0.5rem 1rem; + line-height: 1.5; + color: #495057; + pointer-events: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + background-color: #fff; + border: 1px solid rgba(0, 0, 0, 0.15); + border-radius: 0.25rem; +} + +.custom-file-control:lang(en):empty::after { + content: "Choose file..."; +} + +.custom-file-control::before { + position: absolute; + top: -1px; + right: -1px; + bottom: -1px; + z-index: 6; + display: block; + height: 2.5rem; + padding: 0.5rem 1rem; + line-height: 1.5; + color: #495057; + background-color: #e9ecef; + border: 1px solid rgba(0, 0, 0, 0.15); + border-radius: 0 0.25rem 0.25rem 0; +} + +.custom-file-control:lang(en)::before { + content: "Browse"; +} + +.nav { + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + padding-left: 0; + margin-bottom: 0; + list-style: none; +} + +.nav-link { + display: block; + padding: 0.5rem 1rem; +} + +.nav-link:focus, .nav-link:hover { + text-decoration: none; +} + +.nav-link.disabled { + color: #868e96; +} + +.nav-tabs { + border-bottom: 1px solid #ddd; +} + +.nav-tabs .nav-item { + margin-bottom: -1px; +} + +.nav-tabs .nav-link { + border: 1px solid transparent; + border-top-left-radius: 0.25rem; + border-top-right-radius: 0.25rem; +} + +.nav-tabs .nav-link:focus, .nav-tabs .nav-link:hover { + border-color: #e9ecef #e9ecef #ddd; +} + +.nav-tabs .nav-link.disabled { + color: #868e96; + background-color: transparent; + border-color: transparent; +} + +.nav-tabs .nav-link.active, +.nav-tabs .nav-item.show .nav-link { + color: #495057; + background-color: #fff; + border-color: #ddd #ddd #fff; +} + +.nav-tabs .dropdown-menu { + margin-top: -1px; + border-top-left-radius: 0; + border-top-right-radius: 0; +} + +.nav-pills .nav-link { + border-radius: 0.25rem; +} + +.nav-pills .nav-link.active, +.show > .nav-pills .nav-link { + color: #fff; + background-color: #007bff; +} + +.nav-fill .nav-item { + -ms-flex: 1 1 auto; + flex: 1 1 auto; + text-align: center; +} + +.nav-justified .nav-item { + -ms-flex-preferred-size: 0; + flex-basis: 0; + -ms-flex-positive: 1; + flex-grow: 1; + text-align: center; +} + +.tab-content > .tab-pane { + display: none; +} + +.tab-content > .active { + display: block; +} + +.navbar { + position: relative; + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + -ms-flex-align: center; + align-items: center; + -ms-flex-pack: justify; + justify-content: space-between; + padding: 0.5rem 1rem; +} + +.navbar > .container, +.navbar > .container-fluid { + display: -ms-flexbox; + display: flex; + -ms-flex-wrap: wrap; + flex-wrap: wrap; + -ms-flex-align: center; + align-items: center; + -ms-flex-pack: justify; + justify-content: space-between; +} + +.navbar-brand { + display: inline-block; + padding-top: 0.3125rem; + padding-bottom: 0.3125rem; + margin-right: 1rem; + font-size: 1.25rem; + line-height: inherit; + white-space: nowrap; +} + +.navbar-brand:focus, .navbar-brand:hover { + text-decoration: none; +} + +.navbar-nav { + display: -ms-flexbox; + display: flex; + -ms-flex-direction: column; + flex-direction: column; + padding-left: 0; + margin-bottom: 0; + list-style: none; +} + +.navbar-nav .nav-link { + padding-right: 0; + padding-left: 0; +} + +.navbar-nav .dropdown-menu { + position: static; + float: none; +} + +.navbar-text { + display: inline-block; + padding-top: 0.5rem; + padding-bottom: 0.5rem; +} + +.navbar-collapse { + -ms-flex-preferred-size: 100%; + flex-basis: 100%; + -ms-flex-align: center; + align-items: center; +} + +.navbar-toggler { + padding: 0.25rem 0.75rem; + font-size: 1.25rem; + line-height: 1; + background: transparent; + border: 1px solid transparent; + border-radius: 0.25rem; +} + +.navbar-toggler:focus, .navbar-toggler:hover { + text-decoration: none; +} + +.navbar-toggler-icon { + display: inline-block; + width: 1.5em; + height: 1.5em; + vertical-align: middle; + content: ""; + background: no-repeat center center; + background-size: 100% 100%; +} + +@media (max-width: 575px) { + .navbar-expand-sm > .container, + .navbar-expand-sm > .container-fluid { + padding-right: 0; + padding-left: 0; + } +} + +@media (min-width: 576px) { + .navbar-expand-sm { + -ms-flex-direction: row; + flex-direction: row; + -ms-flex-wrap: nowrap; + flex-wrap: nowrap; + -ms-flex-pack: start; + justify-content: flex-start; + } + .navbar-expand-sm .navbar-nav { + -ms-flex-direction: row; + flex-direction: row; + } + .navbar-expand-sm .navbar-nav .dropdown-menu { + position: absolute; + } + .navbar-expand-sm .navbar-nav .dropdown-menu-right { + right: 0; + left: auto; + } + .navbar-expand-sm .navbar-nav .nav-link { + padding-right: .5rem; + padding-left: .5rem; + } + .navbar-expand-sm > .container, + .navbar-expand-sm > .container-fluid { + -ms-flex-wrap: nowrap; + flex-wrap: nowrap; + } + .navbar-expand-sm .navbar-collapse { + display: -ms-flexbox !important; + display: flex !important; + } + .navbar-expand-sm .navbar-toggler { + display: none; + } +} + +@media (max-width: 767px) { + .navbar-expand-md > .container, + .navbar-expand-md > .container-fluid { + padding-right: 0; + padding-left: 0; + } +} + +@media (min-width: 768px) { + .navbar-expand-md { + -ms-flex-direction: row; + flex-direction: row; + -ms-flex-wrap: nowrap; + flex-wrap: nowrap; + -ms-flex-pack: start; + justify-content: flex-start; + } + .navbar-expand-md .navbar-nav { + -ms-flex-direction: row; + flex-direction: row; + } + .navbar-expand-md .navbar-nav .dropdown-menu { + position: absolute; + } + .navbar-expand-md .navbar-nav .dropdown-menu-right { + right: 0; + left: auto; + } + .navbar-expand-md .navbar-nav .nav-link { + padding-right: .5rem; + padding-left: .5rem; + } + .navbar-expand-md > .container, + .navbar-expand-md > .container-fluid { + -ms-flex-wrap: nowrap; + flex-wrap: nowrap; + } + .navbar-expand-md .navbar-collapse { + display: -ms-flexbox !important; + display: flex !important; + } + .navbar-expand-md .navbar-toggler { + display: none; + } +} + +@media (max-width: 991px) { + .navbar-expand-lg > .container, + .navbar-expand-lg > .container-fluid { + padding-right: 0; + padding-left: 0; + } +} + +@media (min-width: 992px) { + .navbar-expand-lg { + -ms-flex-direction: row; + flex-direction: row; + -ms-flex-wrap: nowrap; + flex-wrap: nowrap; + -ms-flex-pack: start; + justify-content: flex-start; + } + .navbar-expand-lg .navbar-nav { + -ms-flex-direction: row; + flex-direction: row; + } + .navbar-expand-lg .navbar-nav .dropdown-menu { + position: absolute; + } + .navbar-expand-lg .navbar-nav .dropdown-menu-right { + right: 0; + left: auto; + } + .navbar-expand-lg .navbar-nav .nav-link { + padding-right: .5rem; + padding-left: .5rem; + } + .navbar-expand-lg > .container, + .navbar-expand-lg > .container-fluid { + -ms-flex-wrap: nowrap; + flex-wrap: nowrap; + } + .navbar-expand-lg .navbar-collapse { + display: -ms-flexbox !important; + display: flex !important; + } + .navbar-expand-lg .navbar-toggler { + display: none; + } +} + +@media (max-width: 1199px) { + .navbar-expand-xl > .container, + .navbar-expand-xl > .container-fluid { + padding-right: 0; + padding-left: 0; + } +} + +@media (min-width: 1200px) { + .navbar-expand-xl { + -ms-flex-direction: row; + flex-direction: row; + -ms-flex-wrap: nowrap; + flex-wrap: nowrap; + -ms-flex-pack: start; + justify-content: flex-start; + } + .navbar-expand-xl .navbar-nav { + -ms-flex-direction: row; + flex-direction: row; + } + .navbar-expand-xl .navbar-nav .dropdown-menu { + position: absolute; + } + .navbar-expand-xl .navbar-nav .dropdown-menu-right { + right: 0; + left: auto; + } + .navbar-expand-xl .navbar-nav .nav-link { + padding-right: .5rem; + padding-left: .5rem; + } + .navbar-expand-xl > .container, + .navbar-expand-xl > .container-fluid { + -ms-flex-wrap: nowrap; + flex-wrap: nowrap; + } + .navbar-expand-xl .navbar-collapse { + display: -ms-flexbox !important; + display: flex !important; + } + .navbar-expand-xl .navbar-toggler { + display: none; + } +} + +.navbar-expand { + -ms-flex-direction: row; + flex-direction: row; + -ms-flex-wrap: nowrap; + flex-wrap: nowrap; + -ms-flex-pack: start; + justify-content: flex-start; +} + +.navbar-expand > .container, +.navbar-expand > .container-fluid { + padding-right: 0; + padding-left: 0; +} + +.navbar-expand .navbar-nav { + -ms-flex-direction: row; + flex-direction: row; +} + +.navbar-expand .navbar-nav .dropdown-menu { + position: absolute; +} + +.navbar-expand .navbar-nav .dropdown-menu-right { + right: 0; + left: auto; +} + +.navbar-expand .navbar-nav .nav-link { + padding-right: .5rem; + padding-left: .5rem; +} + +.navbar-expand > .container, +.navbar-expand > .container-fluid { + -ms-flex-wrap: nowrap; + flex-wrap: nowrap; +} + +.navbar-expand .navbar-collapse { + display: -ms-flexbox !important; + display: flex !important; +} + +.navbar-expand .navbar-toggler { + display: none; +} + +.navbar-light .navbar-brand { + color: rgba(0, 0, 0, 0.9); +} + +.navbar-light .navbar-brand:focus, .navbar-light .navbar-brand:hover { + color: rgba(0, 0, 0, 0.9); +} + +.navbar-light .navbar-nav .nav-link { + color: rgba(0, 0, 0, 0.5); +} + +.navbar-light .navbar-nav .nav-link:focus, .navbar-light .navbar-nav .nav-link:hover { + color: rgba(0, 0, 0, 0.7); +} + +.navbar-light .navbar-nav .nav-link.disabled { + color: rgba(0, 0, 0, 0.3); +} + +.navbar-light .navbar-nav .show > .nav-link, +.navbar-light .navbar-nav .active > .nav-link, +.navbar-light .navbar-nav .nav-link.show, +.navbar-light .navbar-nav .nav-link.active { + color: rgba(0, 0, 0, 0.9); +} + +.navbar-light .navbar-toggler { + color: rgba(0, 0, 0, 0.5); + border-color: rgba(0, 0, 0, 0.1); +} + +.navbar-light .navbar-toggler-icon { + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(0, 0, 0, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E"); +} + +.navbar-light .navbar-text { + color: rgba(0, 0, 0, 0.5); +} + +.navbar-dark .navbar-brand { + color: white; +} + +.navbar-dark .navbar-brand:focus, .navbar-dark .navbar-brand:hover { + color: white; +} + +.navbar-dark .navbar-nav .nav-link { + color: rgba(255, 255, 255, 0.5); +} + +.navbar-dark .navbar-nav .nav-link:focus, .navbar-dark .navbar-nav .nav-link:hover { + color: rgba(255, 255, 255, 0.75); +} + +.navbar-dark .navbar-nav .nav-link.disabled { + color: rgba(255, 255, 255, 0.25); +} + +.navbar-dark .navbar-nav .show > .nav-link, +.navbar-dark .navbar-nav .active > .nav-link, +.navbar-dark .navbar-nav .nav-link.show, +.navbar-dark .navbar-nav .nav-link.active { + color: white; +} + +.navbar-dark .navbar-toggler { + color: rgba(255, 255, 255, 0.5); + border-color: rgba(255, 255, 255, 0.1); +} + +.navbar-dark .navbar-toggler-icon { + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E"); +} + +.navbar-dark .navbar-text { + color: rgba(255, 255, 255, 0.5); +} + +.card { + position: relative; + display: -ms-flexbox; + display: flex; + -ms-flex-direction: column; + flex-direction: column; + min-width: 0; + word-wrap: break-word; + background-color: #fff; + background-clip: border-box; + border: 1px solid rgba(0, 0, 0, 0.125); + border-radius: 0.25rem; +} + +.card-body { + -ms-flex: 1 1 auto; + flex: 1 1 auto; + padding: 1.25rem; +} + +.card-title { + margin-bottom: 0.75rem; +} + +.card-subtitle { + margin-top: -0.375rem; + margin-bottom: 0; +} + +.card-text:last-child { + margin-bottom: 0; +} + +.card-link:hover { + text-decoration: none; +} + +.card-link + .card-link { + margin-left: 1.25rem; +} + +.card > .list-group:first-child .list-group-item:first-child { + border-top-left-radius: 0.25rem; + border-top-right-radius: 0.25rem; +} + +.card > .list-group:last-child .list-group-item:last-child { + border-bottom-right-radius: 0.25rem; + border-bottom-left-radius: 0.25rem; +} + +.card-header { + padding: 0.75rem 1.25rem; + margin-bottom: 0; + background-color: rgba(0, 0, 0, 0.03); + border-bottom: 1px solid rgba(0, 0, 0, 0.125); +} + +.card-header:first-child { + border-radius: calc(0.25rem - 1px) calc(0.25rem - 1px) 0 0; +} + +.card-footer { + padding: 0.75rem 1.25rem; + background-color: rgba(0, 0, 0, 0.03); + border-top: 1px solid rgba(0, 0, 0, 0.125); +} + +.card-footer:last-child { + border-radius: 0 0 calc(0.25rem - 1px) calc(0.25rem - 1px); +} + +.card-header-tabs { + margin-right: -0.625rem; + margin-bottom: -0.75rem; + margin-left: -0.625rem; + border-bottom: 0; +} + +.card-header-pills { + margin-right: -0.625rem; + margin-left: -0.625rem; +} + +.card-img-overlay { + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + padding: 1.25rem; +} + +.card-img { + width: 100%; + border-radius: calc(0.25rem - 1px); +} + +.card-img-top { + width: 100%; + border-top-left-radius: calc(0.25rem - 1px); + border-top-right-radius: calc(0.25rem - 1px); +} + +.card-img-bottom { + width: 100%; + border-bottom-right-radius: calc(0.25rem - 1px); + border-bottom-left-radius: calc(0.25rem - 1px); +} + +@media (min-width: 576px) { + .card-deck { + display: -ms-flexbox; + display: flex; + -ms-flex-flow: row wrap; + flex-flow: row wrap; + margin-right: -15px; + margin-left: -15px; + } + .card-deck .card { + display: -ms-flexbox; + display: flex; + -ms-flex: 1 0 0%; + flex: 1 0 0%; + -ms-flex-direction: column; + flex-direction: column; + margin-right: 15px; + margin-left: 15px; + } +} + +@media (min-width: 576px) { + .card-group { + display: -ms-flexbox; + display: flex; + -ms-flex-flow: row wrap; + flex-flow: row wrap; + } + .card-group .card { + -ms-flex: 1 0 0%; + flex: 1 0 0%; + } + .card-group .card + .card { + margin-left: 0; + border-left: 0; + } + .card-group .card:first-child { + border-top-right-radius: 0; + border-bottom-right-radius: 0; + } + .card-group .card:first-child .card-img-top { + border-top-right-radius: 0; + } + .card-group .card:first-child .card-img-bottom { + border-bottom-right-radius: 0; + } + .card-group .card:last-child { + border-top-left-radius: 0; + border-bottom-left-radius: 0; + } + .card-group .card:last-child .card-img-top { + border-top-left-radius: 0; + } + .card-group .card:last-child .card-img-bottom { + border-bottom-left-radius: 0; + } + .card-group .card:not(:first-child):not(:last-child) { + border-radius: 0; + } + .card-group .card:not(:first-child):not(:last-child) .card-img-top, + .card-group .card:not(:first-child):not(:last-child) .card-img-bottom { + border-radius: 0; + } +} + +.card-columns .card { + margin-bottom: 0.75rem; +} + +@media (min-width: 576px) { + .card-columns { + -webkit-column-count: 3; + column-count: 3; + -webkit-column-gap: 1.25rem; + column-gap: 1.25rem; + } + .card-columns .card { + display: inline-block; + width: 100%; + } +} + +.breadcrumb { + padding: 0.75rem 1rem; + margin-bottom: 1rem; + list-style: none; + background-color: #e9ecef; + border-radius: 0.25rem; +} + +.breadcrumb::after { + display: block; + clear: both; + content: ""; +} + +.breadcrumb-item { + float: left; +} + +.breadcrumb-item + .breadcrumb-item::before { + display: inline-block; + padding-right: 0.5rem; + padding-left: 0.5rem; + color: #868e96; + content: "/"; +} + +.breadcrumb-item + .breadcrumb-item:hover::before { + text-decoration: underline; +} + +.breadcrumb-item + .breadcrumb-item:hover::before { + text-decoration: none; +} + +.breadcrumb-item.active { + color: #868e96; +} + +.pagination { + display: -ms-flexbox; + display: flex; + padding-left: 0; + list-style: none; + border-radius: 0.25rem; +} + +.page-item:first-child .page-link { + margin-left: 0; + border-top-left-radius: 0.25rem; + border-bottom-left-radius: 0.25rem; +} + +.page-item:last-child .page-link { + border-top-right-radius: 0.25rem; + border-bottom-right-radius: 0.25rem; +} + +.page-item.active .page-link { + z-index: 2; + color: #fff; + background-color: #007bff; + border-color: #007bff; +} + +.page-item.disabled .page-link { + color: #868e96; + pointer-events: none; + background-color: #fff; + border-color: #ddd; +} + +.page-link { + position: relative; + display: block; + padding: 0.5rem 0.75rem; + margin-left: -1px; + line-height: 1.25; + color: #007bff; + background-color: #fff; + border: 1px solid #ddd; +} + +.page-link:focus, .page-link:hover { + color: #0056b3; + text-decoration: none; + background-color: #e9ecef; + border-color: #ddd; +} + +.pagination-lg .page-link { + padding: 0.75rem 1.5rem; + font-size: 1.25rem; + line-height: 1.5; +} + +.pagination-lg .page-item:first-child .page-link { + border-top-left-radius: 0.3rem; + border-bottom-left-radius: 0.3rem; +} + +.pagination-lg .page-item:last-child .page-link { + border-top-right-radius: 0.3rem; + border-bottom-right-radius: 0.3rem; +} + +.pagination-sm .page-link { + padding: 0.25rem 0.5rem; + font-size: 0.875rem; + line-height: 1.5; +} + +.pagination-sm .page-item:first-child .page-link { + border-top-left-radius: 0.2rem; + border-bottom-left-radius: 0.2rem; +} + +.pagination-sm .page-item:last-child .page-link { + border-top-right-radius: 0.2rem; + border-bottom-right-radius: 0.2rem; +} + +.badge { + display: inline-block; + padding: 0.25em 0.4em; + font-size: 75%; + font-weight: bold; + line-height: 1; + color: #fff; + text-align: center; + white-space: nowrap; + vertical-align: baseline; + border-radius: 0.25rem; +} + +.badge:empty { + display: none; +} + +.btn .badge { + position: relative; + top: -1px; +} + +.badge-pill { + padding-right: 0.6em; + padding-left: 0.6em; + border-radius: 10rem; +} + +.badge-primary { + color: #fff; + background-color: #007bff; +} + +.badge-primary[href]:focus, .badge-primary[href]:hover { + color: #fff; + text-decoration: none; + background-color: #0062cc; +} + +.badge-secondary { + color: #fff; + background-color: #868e96; +} + +.badge-secondary[href]:focus, .badge-secondary[href]:hover { + color: #fff; + text-decoration: none; + background-color: #6c757d; +} + +.badge-success { + color: #fff; + background-color: #28a745; +} + +.badge-success[href]:focus, .badge-success[href]:hover { + color: #fff; + text-decoration: none; + background-color: #1e7e34; +} + +.badge-info { + color: #fff; + background-color: #17a2b8; +} + +.badge-info[href]:focus, .badge-info[href]:hover { + color: #fff; + text-decoration: none; + background-color: #117a8b; +} + +.badge-warning { + color: #111; + background-color: #ffc107; +} + +.badge-warning[href]:focus, .badge-warning[href]:hover { + color: #111; + text-decoration: none; + background-color: #d39e00; +} + +.badge-danger { + color: #fff; + background-color: #dc3545; +} + +.badge-danger[href]:focus, .badge-danger[href]:hover { + color: #fff; + text-decoration: none; + background-color: #bd2130; +} + +.badge-light { + color: #111; + background-color: #f8f9fa; +} + +.badge-light[href]:focus, .badge-light[href]:hover { + color: #111; + text-decoration: none; + background-color: #dae0e5; +} + +.badge-dark { + color: #fff; + background-color: #343a40; +} + +.badge-dark[href]:focus, .badge-dark[href]:hover { + color: #fff; + text-decoration: none; + background-color: #1d2124; +} + +.jumbotron { + padding: 2rem 1rem; + margin-bottom: 2rem; + background-color: #e9ecef; + border-radius: 0.3rem; +} + +@media (min-width: 576px) { + .jumbotron { + padding: 4rem 2rem; + } +} + +.jumbotron-fluid { + padding-right: 0; + padding-left: 0; + border-radius: 0; +} + +.alert { + padding: 0.75rem 1.25rem; + margin-bottom: 1rem; + border: 1px solid transparent; + border-radius: 0.25rem; +} + +.alert-heading { + color: inherit; +} + +.alert-link { + font-weight: bold; +} + +.alert-dismissible .close { + position: relative; + top: -0.75rem; + right: -1.25rem; + padding: 0.75rem 1.25rem; + color: inherit; +} + +.alert-primary { + color: #004085; + background-color: #cce5ff; + border-color: #b8daff; +} + +.alert-primary hr { + border-top-color: #9fcdff; +} + +.alert-primary .alert-link { + color: #002752; +} + +.alert-secondary { + color: #464a4e; + background-color: #e7e8ea; + border-color: #dddfe2; +} + +.alert-secondary hr { + border-top-color: #cfd2d6; +} + +.alert-secondary .alert-link { + color: #2e3133; +} + +.alert-success { + color: #155724; + background-color: #d4edda; + border-color: #c3e6cb; +} + +.alert-success hr { + border-top-color: #b1dfbb; +} + +.alert-success .alert-link { + color: #0b2e13; +} + +.alert-info { + color: #0c5460; + background-color: #d1ecf1; + border-color: #bee5eb; +} + +.alert-info hr { + border-top-color: #abdde5; +} + +.alert-info .alert-link { + color: #062c33; +} + +.alert-warning { + color: #856404; + background-color: #fff3cd; + border-color: #ffeeba; +} + +.alert-warning hr { + border-top-color: #ffe8a1; +} + +.alert-warning .alert-link { + color: #533f03; +} + +.alert-danger { + color: #721c24; + background-color: #f8d7da; + border-color: #f5c6cb; +} + +.alert-danger hr { + border-top-color: #f1b0b7; +} + +.alert-danger .alert-link { + color: #491217; +} + +.alert-light { + color: #818182; + background-color: #fefefe; + border-color: #fdfdfe; +} + +.alert-light hr { + border-top-color: #ececf6; +} + +.alert-light .alert-link { + color: #686868; +} + +.alert-dark { + color: #1b1e21; + background-color: #d6d8d9; + border-color: #c6c8ca; +} + +.alert-dark hr { + border-top-color: #b9bbbe; +} + +.alert-dark .alert-link { + color: #040505; +} + +@-webkit-keyframes progress-bar-stripes { + from { + background-position: 1rem 0; + } + to { + background-position: 0 0; + } +} + +@keyframes progress-bar-stripes { + from { + background-position: 1rem 0; + } + to { + background-position: 0 0; + } +} + +.progress { + display: -ms-flexbox; + display: flex; + overflow: hidden; + font-size: 0.75rem; + line-height: 1rem; + text-align: center; + background-color: #e9ecef; + border-radius: 0.25rem; +} + +.progress-bar { + height: 1rem; + line-height: 1rem; + color: #fff; + background-color: #007bff; + transition: width 0.6s ease; +} + +.progress-bar-striped { + background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent); + background-size: 1rem 1rem; +} + +.progress-bar-animated { + -webkit-animation: progress-bar-stripes 1s linear infinite; + animation: progress-bar-stripes 1s linear infinite; +} + +.media { + display: -ms-flexbox; + display: flex; + -ms-flex-align: start; + align-items: flex-start; +} + +.media-body { + -ms-flex: 1; + flex: 1; +} + +.list-group { + display: -ms-flexbox; + display: flex; + -ms-flex-direction: column; + flex-direction: column; + padding-left: 0; + margin-bottom: 0; +} + +.list-group-item-action { + width: 100%; + color: #495057; + text-align: inherit; +} + +.list-group-item-action:focus, .list-group-item-action:hover { + color: #495057; + text-decoration: none; + background-color: #f8f9fa; +} + +.list-group-item-action:active { + color: #212529; + background-color: #e9ecef; +} + +.list-group-item { + position: relative; + display: block; + padding: 0.75rem 1.25rem; + margin-bottom: -1px; + background-color: #fff; + border: 1px solid rgba(0, 0, 0, 0.125); +} + +.list-group-item:first-child { + border-top-left-radius: 0.25rem; + border-top-right-radius: 0.25rem; +} + +.list-group-item:last-child { + margin-bottom: 0; + border-bottom-right-radius: 0.25rem; + border-bottom-left-radius: 0.25rem; +} + +.list-group-item:focus, .list-group-item:hover { + text-decoration: none; +} + +.list-group-item.disabled, .list-group-item:disabled { + color: #868e96; + background-color: #fff; +} + +.list-group-item.active { + z-index: 2; + color: #fff; + background-color: #007bff; + border-color: #007bff; +} + +.list-group-flush .list-group-item { + border-right: 0; + border-left: 0; + border-radius: 0; +} + +.list-group-flush:first-child .list-group-item:first-child { + border-top: 0; +} + +.list-group-flush:last-child .list-group-item:last-child { + border-bottom: 0; +} + +.list-group-item-primary { + color: #004085; + background-color: #b8daff; +} + +a.list-group-item-primary, +button.list-group-item-primary { + color: #004085; +} + +a.list-group-item-primary:focus, a.list-group-item-primary:hover, +button.list-group-item-primary:focus, +button.list-group-item-primary:hover { + color: #004085; + background-color: #9fcdff; +} + +a.list-group-item-primary.active, +button.list-group-item-primary.active { + color: #fff; + background-color: #004085; + border-color: #004085; +} + +.list-group-item-secondary { + color: #464a4e; + background-color: #dddfe2; +} + +a.list-group-item-secondary, +button.list-group-item-secondary { + color: #464a4e; +} + +a.list-group-item-secondary:focus, a.list-group-item-secondary:hover, +button.list-group-item-secondary:focus, +button.list-group-item-secondary:hover { + color: #464a4e; + background-color: #cfd2d6; +} + +a.list-group-item-secondary.active, +button.list-group-item-secondary.active { + color: #fff; + background-color: #464a4e; + border-color: #464a4e; +} + +.list-group-item-success { + color: #155724; + background-color: #c3e6cb; +} + +a.list-group-item-success, +button.list-group-item-success { + color: #155724; +} + +a.list-group-item-success:focus, a.list-group-item-success:hover, +button.list-group-item-success:focus, +button.list-group-item-success:hover { + color: #155724; + background-color: #b1dfbb; +} + +a.list-group-item-success.active, +button.list-group-item-success.active { + color: #fff; + background-color: #155724; + border-color: #155724; +} + +.list-group-item-info { + color: #0c5460; + background-color: #bee5eb; +} + +a.list-group-item-info, +button.list-group-item-info { + color: #0c5460; +} + +a.list-group-item-info:focus, a.list-group-item-info:hover, +button.list-group-item-info:focus, +button.list-group-item-info:hover { + color: #0c5460; + background-color: #abdde5; +} + +a.list-group-item-info.active, +button.list-group-item-info.active { + color: #fff; + background-color: #0c5460; + border-color: #0c5460; +} + +.list-group-item-warning { + color: #856404; + background-color: #ffeeba; +} + +a.list-group-item-warning, +button.list-group-item-warning { + color: #856404; +} + +a.list-group-item-warning:focus, a.list-group-item-warning:hover, +button.list-group-item-warning:focus, +button.list-group-item-warning:hover { + color: #856404; + background-color: #ffe8a1; +} + +a.list-group-item-warning.active, +button.list-group-item-warning.active { + color: #fff; + background-color: #856404; + border-color: #856404; +} + +.list-group-item-danger { + color: #721c24; + background-color: #f5c6cb; +} + +a.list-group-item-danger, +button.list-group-item-danger { + color: #721c24; +} + +a.list-group-item-danger:focus, a.list-group-item-danger:hover, +button.list-group-item-danger:focus, +button.list-group-item-danger:hover { + color: #721c24; + background-color: #f1b0b7; +} + +a.list-group-item-danger.active, +button.list-group-item-danger.active { + color: #fff; + background-color: #721c24; + border-color: #721c24; +} + +.list-group-item-light { + color: #818182; + background-color: #fdfdfe; +} + +a.list-group-item-light, +button.list-group-item-light { + color: #818182; +} + +a.list-group-item-light:focus, a.list-group-item-light:hover, +button.list-group-item-light:focus, +button.list-group-item-light:hover { + color: #818182; + background-color: #ececf6; +} + +a.list-group-item-light.active, +button.list-group-item-light.active { + color: #fff; + background-color: #818182; + border-color: #818182; +} + +.list-group-item-dark { + color: #1b1e21; + background-color: #c6c8ca; +} + +a.list-group-item-dark, +button.list-group-item-dark { + color: #1b1e21; +} + +a.list-group-item-dark:focus, a.list-group-item-dark:hover, +button.list-group-item-dark:focus, +button.list-group-item-dark:hover { + color: #1b1e21; + background-color: #b9bbbe; +} + +a.list-group-item-dark.active, +button.list-group-item-dark.active { + color: #fff; + background-color: #1b1e21; + border-color: #1b1e21; +} + +.close { + float: right; + font-size: 1.5rem; + font-weight: bold; + line-height: 1; + color: #000; + text-shadow: 0 1px 0 #fff; + opacity: .5; +} + +.close:focus, .close:hover { + color: #000; + text-decoration: none; + opacity: .75; +} + +button.close { + padding: 0; + background: transparent; + border: 0; + -webkit-appearance: none; +} + +.modal-open { + overflow: hidden; +} + +.modal { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1050; + display: none; + overflow: hidden; + outline: 0; +} + +.modal.fade .modal-dialog { + transition: -webkit-transform 0.3s ease-out; + transition: transform 0.3s ease-out; + transition: transform 0.3s ease-out, -webkit-transform 0.3s ease-out; + -webkit-transform: translate(0, -25%); + transform: translate(0, -25%); +} + +.modal.show .modal-dialog { + -webkit-transform: translate(0, 0); + transform: translate(0, 0); +} + +.modal-open .modal { + overflow-x: hidden; + overflow-y: auto; +} + +.modal-dialog { + position: relative; + width: auto; + margin: 10px; +} + +.modal-content { + position: relative; + display: -ms-flexbox; + display: flex; + -ms-flex-direction: column; + flex-direction: column; + background-color: #fff; + background-clip: padding-box; + border: 1px solid rgba(0, 0, 0, 0.2); + border-radius: 0.3rem; + outline: 0; +} + +.modal-backdrop { + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 1040; + background-color: #000; +} + +.modal-backdrop.fade { + opacity: 0; +} + +.modal-backdrop.show { + opacity: 0.5; +} + +.modal-header { + display: -ms-flexbox; + display: flex; + -ms-flex-align: center; + align-items: center; + -ms-flex-pack: justify; + justify-content: space-between; + padding: 15px; + border-bottom: 1px solid #e9ecef; +} + +.modal-title { + margin-bottom: 0; + line-height: 1.5; +} + +.modal-body { + position: relative; + -ms-flex: 1 1 auto; + flex: 1 1 auto; + padding: 15px; +} + +.modal-footer { + display: -ms-flexbox; + display: flex; + -ms-flex-align: center; + align-items: center; + -ms-flex-pack: end; + justify-content: flex-end; + padding: 15px; + border-top: 1px solid #e9ecef; +} + +.modal-footer > :not(:first-child) { + margin-left: .25rem; +} + +.modal-footer > :not(:last-child) { + margin-right: .25rem; +} + +.modal-scrollbar-measure { + position: absolute; + top: -9999px; + width: 50px; + height: 50px; + overflow: scroll; +} + +@media (min-width: 576px) { + .modal-dialog { + max-width: 500px; + margin: 30px auto; + } + .modal-sm { + max-width: 300px; + } +} + +@media (min-width: 992px) { + .modal-lg { + max-width: 800px; + } +} + +.tooltip { + position: absolute; + z-index: 1070; + display: block; + margin: 0; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; + font-style: normal; + font-weight: normal; + line-height: 1.5; + text-align: left; + text-align: start; + text-decoration: none; + text-shadow: none; + text-transform: none; + letter-spacing: normal; + word-break: normal; + word-spacing: normal; + white-space: normal; + line-break: auto; + font-size: 0.875rem; + word-wrap: break-word; + opacity: 0; +} + +.tooltip.show { + opacity: 0.9; +} + +.tooltip .arrow { + position: absolute; + display: block; + width: 5px; + height: 5px; +} + +.tooltip.bs-tooltip-top, .tooltip.bs-tooltip-auto[x-placement^="top"] { + padding: 5px 0; +} + +.tooltip.bs-tooltip-top .arrow, .tooltip.bs-tooltip-auto[x-placement^="top"] .arrow { + bottom: 0; +} + +.tooltip.bs-tooltip-top .arrow::before, .tooltip.bs-tooltip-auto[x-placement^="top"] .arrow::before { + margin-left: -3px; + content: ""; + border-width: 5px 5px 0; + border-top-color: #000; +} + +.tooltip.bs-tooltip-right, .tooltip.bs-tooltip-auto[x-placement^="right"] { + padding: 0 5px; +} + +.tooltip.bs-tooltip-right .arrow, .tooltip.bs-tooltip-auto[x-placement^="right"] .arrow { + left: 0; +} + +.tooltip.bs-tooltip-right .arrow::before, .tooltip.bs-tooltip-auto[x-placement^="right"] .arrow::before { + margin-top: -3px; + content: ""; + border-width: 5px 5px 5px 0; + border-right-color: #000; +} + +.tooltip.bs-tooltip-bottom, .tooltip.bs-tooltip-auto[x-placement^="bottom"] { + padding: 5px 0; +} + +.tooltip.bs-tooltip-bottom .arrow, .tooltip.bs-tooltip-auto[x-placement^="bottom"] .arrow { + top: 0; +} + +.tooltip.bs-tooltip-bottom .arrow::before, .tooltip.bs-tooltip-auto[x-placement^="bottom"] .arrow::before { + margin-left: -3px; + content: ""; + border-width: 0 5px 5px; + border-bottom-color: #000; +} + +.tooltip.bs-tooltip-left, .tooltip.bs-tooltip-auto[x-placement^="left"] { + padding: 0 5px; +} + +.tooltip.bs-tooltip-left .arrow, .tooltip.bs-tooltip-auto[x-placement^="left"] .arrow { + right: 0; +} + +.tooltip.bs-tooltip-left .arrow::before, .tooltip.bs-tooltip-auto[x-placement^="left"] .arrow::before { + right: 0; + margin-top: -3px; + content: ""; + border-width: 5px 0 5px 5px; + border-left-color: #000; +} + +.tooltip .arrow::before { + position: absolute; + border-color: transparent; + border-style: solid; +} + +.tooltip-inner { + max-width: 200px; + padding: 3px 8px; + color: #fff; + text-align: center; + background-color: #000; + border-radius: 0.25rem; +} + +.popover { + position: absolute; + top: 0; + left: 0; + z-index: 1060; + display: block; + max-width: 276px; + padding: 1px; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; + font-style: normal; + font-weight: normal; + line-height: 1.5; + text-align: left; + text-align: start; + text-decoration: none; + text-shadow: none; + text-transform: none; + letter-spacing: normal; + word-break: normal; + word-spacing: normal; + white-space: normal; + line-break: auto; + font-size: 0.875rem; + word-wrap: break-word; + background-color: #fff; + background-clip: padding-box; + border: 1px solid rgba(0, 0, 0, 0.2); + border-radius: 0.3rem; +} + +.popover .arrow { + position: absolute; + display: block; + width: 10px; + height: 5px; +} + +.popover .arrow::before, +.popover .arrow::after { + position: absolute; + display: block; + border-color: transparent; + border-style: solid; +} + +.popover .arrow::before { + content: ""; + border-width: 11px; +} + +.popover .arrow::after { + content: ""; + border-width: 11px; +} + +.popover.bs-popover-top, .popover.bs-popover-auto[x-placement^="top"] { + margin-bottom: 10px; +} + +.popover.bs-popover-top .arrow, .popover.bs-popover-auto[x-placement^="top"] .arrow { + bottom: 0; +} + +.popover.bs-popover-top .arrow::before, .popover.bs-popover-auto[x-placement^="top"] .arrow::before, +.popover.bs-popover-top .arrow::after, .popover.bs-popover-auto[x-placement^="top"] .arrow::after { + border-bottom-width: 0; +} + +.popover.bs-popover-top .arrow::before, .popover.bs-popover-auto[x-placement^="top"] .arrow::before { + bottom: -11px; + margin-left: -6px; + border-top-color: rgba(0, 0, 0, 0.25); +} + +.popover.bs-popover-top .arrow::after, .popover.bs-popover-auto[x-placement^="top"] .arrow::after { + bottom: -10px; + margin-left: -6px; + border-top-color: #fff; +} + +.popover.bs-popover-right, .popover.bs-popover-auto[x-placement^="right"] { + margin-left: 10px; +} + +.popover.bs-popover-right .arrow, .popover.bs-popover-auto[x-placement^="right"] .arrow { + left: 0; +} + +.popover.bs-popover-right .arrow::before, .popover.bs-popover-auto[x-placement^="right"] .arrow::before, +.popover.bs-popover-right .arrow::after, .popover.bs-popover-auto[x-placement^="right"] .arrow::after { + margin-top: -8px; + border-left-width: 0; +} + +.popover.bs-popover-right .arrow::before, .popover.bs-popover-auto[x-placement^="right"] .arrow::before { + left: -11px; + border-right-color: rgba(0, 0, 0, 0.25); +} + +.popover.bs-popover-right .arrow::after, .popover.bs-popover-auto[x-placement^="right"] .arrow::after { + left: -10px; + border-right-color: #fff; +} + +.popover.bs-popover-bottom, .popover.bs-popover-auto[x-placement^="bottom"] { + margin-top: 10px; +} + +.popover.bs-popover-bottom .arrow, .popover.bs-popover-auto[x-placement^="bottom"] .arrow { + top: 0; +} + +.popover.bs-popover-bottom .arrow::before, .popover.bs-popover-auto[x-placement^="bottom"] .arrow::before, +.popover.bs-popover-bottom .arrow::after, .popover.bs-popover-auto[x-placement^="bottom"] .arrow::after { + margin-left: -7px; + border-top-width: 0; +} + +.popover.bs-popover-bottom .arrow::before, .popover.bs-popover-auto[x-placement^="bottom"] .arrow::before { + top: -11px; + border-bottom-color: rgba(0, 0, 0, 0.25); +} + +.popover.bs-popover-bottom .arrow::after, .popover.bs-popover-auto[x-placement^="bottom"] .arrow::after { + top: -10px; + border-bottom-color: #fff; +} + +.popover.bs-popover-bottom .popover-header::before, .popover.bs-popover-auto[x-placement^="bottom"] .popover-header::before { + position: absolute; + top: 0; + left: 50%; + display: block; + width: 20px; + margin-left: -10px; + content: ""; + border-bottom: 1px solid #f7f7f7; +} + +.popover.bs-popover-left, .popover.bs-popover-auto[x-placement^="left"] { + margin-right: 10px; +} + +.popover.bs-popover-left .arrow, .popover.bs-popover-auto[x-placement^="left"] .arrow { + right: 0; +} + +.popover.bs-popover-left .arrow::before, .popover.bs-popover-auto[x-placement^="left"] .arrow::before, +.popover.bs-popover-left .arrow::after, .popover.bs-popover-auto[x-placement^="left"] .arrow::after { + margin-top: -8px; + border-right-width: 0; +} + +.popover.bs-popover-left .arrow::before, .popover.bs-popover-auto[x-placement^="left"] .arrow::before { + right: -11px; + border-left-color: rgba(0, 0, 0, 0.25); +} + +.popover.bs-popover-left .arrow::after, .popover.bs-popover-auto[x-placement^="left"] .arrow::after { + right: -10px; + border-left-color: #fff; +} + +.popover-header { + padding: 8px 14px; + margin-bottom: 0; + font-size: 1rem; + color: inherit; + background-color: #f7f7f7; + border-bottom: 1px solid #ebebeb; + border-top-left-radius: calc(0.3rem - 1px); + border-top-right-radius: calc(0.3rem - 1px); +} + +.popover-header:empty { + display: none; +} + +.popover-body { + padding: 9px 14px; + color: #212529; +} + +.carousel { + position: relative; +} + +.carousel-inner { + position: relative; + width: 100%; + overflow: hidden; +} + +.carousel-item { + position: relative; + display: none; + -ms-flex-align: center; + align-items: center; + width: 100%; + transition: -webkit-transform 0.6s ease; + transition: transform 0.6s ease; + transition: transform 0.6s ease, -webkit-transform 0.6s ease; + -webkit-backface-visibility: hidden; + backface-visibility: hidden; + -webkit-perspective: 1000px; + perspective: 1000px; +} + +.carousel-item.active, +.carousel-item-next, +.carousel-item-prev { + display: block; +} + +.carousel-item-next, +.carousel-item-prev { + position: absolute; + top: 0; +} + +.carousel-item-next.carousel-item-left, +.carousel-item-prev.carousel-item-right { + -webkit-transform: translateX(0); + transform: translateX(0); +} + +@supports ((-webkit-transform-style: preserve-3d) or (transform-style: preserve-3d)) { + .carousel-item-next.carousel-item-left, + .carousel-item-prev.carousel-item-right { + -webkit-transform: translate3d(0, 0, 0); + transform: translate3d(0, 0, 0); + } +} + +.carousel-item-next, +.active.carousel-item-right { + -webkit-transform: translateX(100%); + transform: translateX(100%); +} + +@supports ((-webkit-transform-style: preserve-3d) or (transform-style: preserve-3d)) { + .carousel-item-next, + .active.carousel-item-right { + -webkit-transform: translate3d(100%, 0, 0); + transform: translate3d(100%, 0, 0); + } +} + +.carousel-item-prev, +.active.carousel-item-left { + -webkit-transform: translateX(-100%); + transform: translateX(-100%); +} + +@supports ((-webkit-transform-style: preserve-3d) or (transform-style: preserve-3d)) { + .carousel-item-prev, + .active.carousel-item-left { + -webkit-transform: translate3d(-100%, 0, 0); + transform: translate3d(-100%, 0, 0); + } +} + +.carousel-control-prev, +.carousel-control-next { + position: absolute; + top: 0; + bottom: 0; + display: -ms-flexbox; + display: flex; + -ms-flex-align: center; + align-items: center; + -ms-flex-pack: center; + justify-content: center; + width: 15%; + color: #fff; + text-align: center; + opacity: 0.5; +} + +.carousel-control-prev:focus, .carousel-control-prev:hover, +.carousel-control-next:focus, +.carousel-control-next:hover { + color: #fff; + text-decoration: none; + outline: 0; + opacity: .9; +} + +.carousel-control-prev { + left: 0; +} + +.carousel-control-next { + right: 0; +} + +.carousel-control-prev-icon, +.carousel-control-next-icon { + display: inline-block; + width: 20px; + height: 20px; + background: transparent no-repeat center center; + background-size: 100% 100%; +} + +.carousel-control-prev-icon { + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3E%3Cpath d='M4 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/%3E%3C/svg%3E"); +} + +.carousel-control-next-icon { + background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3E%3Cpath d='M1.5 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z'/%3E%3C/svg%3E"); +} + +.carousel-indicators { + position: absolute; + right: 0; + bottom: 10px; + left: 0; + z-index: 15; + display: -ms-flexbox; + display: flex; + -ms-flex-pack: center; + justify-content: center; + padding-left: 0; + margin-right: 15%; + margin-left: 15%; + list-style: none; +} + +.carousel-indicators li { + position: relative; + -ms-flex: 0 1 auto; + flex: 0 1 auto; + width: 30px; + height: 3px; + margin-right: 3px; + margin-left: 3px; + text-indent: -999px; + background-color: rgba(255, 255, 255, 0.5); +} + +.carousel-indicators li::before { + position: absolute; + top: -10px; + left: 0; + display: inline-block; + width: 100%; + height: 10px; + content: ""; +} + +.carousel-indicators li::after { + position: absolute; + bottom: -10px; + left: 0; + display: inline-block; + width: 100%; + height: 10px; + content: ""; +} + +.carousel-indicators .active { + background-color: #fff; +} + +.carousel-caption { + position: absolute; + right: 15%; + bottom: 20px; + left: 15%; + z-index: 10; + padding-top: 20px; + padding-bottom: 20px; + color: #fff; + text-align: center; +} + +.align-baseline { + vertical-align: baseline !important; +} + +.align-top { + vertical-align: top !important; +} + +.align-middle { + vertical-align: middle !important; +} + +.align-bottom { + vertical-align: bottom !important; +} + +.align-text-bottom { + vertical-align: text-bottom !important; +} + +.align-text-top { + vertical-align: text-top !important; +} + +.bg-primary { + background-color: #007bff !important; +} + +a.bg-primary:focus, a.bg-primary:hover { + background-color: #0062cc !important; +} + +.bg-secondary { + background-color: #868e96 !important; +} + +a.bg-secondary:focus, a.bg-secondary:hover { + background-color: #6c757d !important; +} + +.bg-success { + background-color: #28a745 !important; +} + +a.bg-success:focus, a.bg-success:hover { + background-color: #1e7e34 !important; +} + +.bg-info { + background-color: #17a2b8 !important; +} + +a.bg-info:focus, a.bg-info:hover { + background-color: #117a8b !important; +} + +.bg-warning { + background-color: #ffc107 !important; +} + +a.bg-warning:focus, a.bg-warning:hover { + background-color: #d39e00 !important; +} + +.bg-danger { + background-color: #dc3545 !important; +} + +a.bg-danger:focus, a.bg-danger:hover { + background-color: #bd2130 !important; +} + +.bg-light { + background-color: #f8f9fa !important; +} + +a.bg-light:focus, a.bg-light:hover { + background-color: #dae0e5 !important; +} + +.bg-dark { + background-color: #343a40 !important; +} + +a.bg-dark:focus, a.bg-dark:hover { + background-color: #1d2124 !important; +} + +.bg-white { + background-color: #fff !important; +} + +.bg-transparent { + background-color: transparent !important; +} + +.border { + border: 1px solid #e9ecef !important; +} + +.border-0 { + border: 0 !important; +} + +.border-top-0 { + border-top: 0 !important; +} + +.border-right-0 { + border-right: 0 !important; +} + +.border-bottom-0 { + border-bottom: 0 !important; +} + +.border-left-0 { + border-left: 0 !important; +} + +.border-primary { + border-color: #007bff !important; +} + +.border-secondary { + border-color: #868e96 !important; +} + +.border-success { + border-color: #28a745 !important; +} + +.border-info { + border-color: #17a2b8 !important; +} + +.border-warning { + border-color: #ffc107 !important; +} + +.border-danger { + border-color: #dc3545 !important; +} + +.border-light { + border-color: #f8f9fa !important; +} + +.border-dark { + border-color: #343a40 !important; +} + +.border-white { + border-color: #fff !important; +} + +.rounded { + border-radius: 0.25rem !important; +} + +.rounded-top { + border-top-left-radius: 0.25rem !important; + border-top-right-radius: 0.25rem !important; +} + +.rounded-right { + border-top-right-radius: 0.25rem !important; + border-bottom-right-radius: 0.25rem !important; +} + +.rounded-bottom { + border-bottom-right-radius: 0.25rem !important; + border-bottom-left-radius: 0.25rem !important; +} + +.rounded-left { + border-top-left-radius: 0.25rem !important; + border-bottom-left-radius: 0.25rem !important; +} + +.rounded-circle { + border-radius: 50%; +} + +.rounded-0 { + border-radius: 0; +} + +.clearfix::after { + display: block; + clear: both; + content: ""; +} + +.d-none { + display: none !important; +} + +.d-inline { + display: inline !important; +} + +.d-inline-block { + display: inline-block !important; +} + +.d-block { + display: block !important; +} + +.d-table { + display: table !important; +} + +.d-table-cell { + display: table-cell !important; +} + +.d-flex { + display: -ms-flexbox !important; + display: flex !important; +} + +.d-inline-flex { + display: -ms-inline-flexbox !important; + display: inline-flex !important; +} + +@media (min-width: 576px) { + .d-sm-none { + display: none !important; + } + .d-sm-inline { + display: inline !important; + } + .d-sm-inline-block { + display: inline-block !important; + } + .d-sm-block { + display: block !important; + } + .d-sm-table { + display: table !important; + } + .d-sm-table-cell { + display: table-cell !important; + } + .d-sm-flex { + display: -ms-flexbox !important; + display: flex !important; + } + .d-sm-inline-flex { + display: -ms-inline-flexbox !important; + display: inline-flex !important; + } +} + +@media (min-width: 768px) { + .d-md-none { + display: none !important; + } + .d-md-inline { + display: inline !important; + } + .d-md-inline-block { + display: inline-block !important; + } + .d-md-block { + display: block !important; + } + .d-md-table { + display: table !important; + } + .d-md-table-cell { + display: table-cell !important; + } + .d-md-flex { + display: -ms-flexbox !important; + display: flex !important; + } + .d-md-inline-flex { + display: -ms-inline-flexbox !important; + display: inline-flex !important; + } +} + +@media (min-width: 992px) { + .d-lg-none { + display: none !important; + } + .d-lg-inline { + display: inline !important; + } + .d-lg-inline-block { + display: inline-block !important; + } + .d-lg-block { + display: block !important; + } + .d-lg-table { + display: table !important; + } + .d-lg-table-cell { + display: table-cell !important; + } + .d-lg-flex { + display: -ms-flexbox !important; + display: flex !important; + } + .d-lg-inline-flex { + display: -ms-inline-flexbox !important; + display: inline-flex !important; + } +} + +@media (min-width: 1200px) { + .d-xl-none { + display: none !important; + } + .d-xl-inline { + display: inline !important; + } + .d-xl-inline-block { + display: inline-block !important; + } + .d-xl-block { + display: block !important; + } + .d-xl-table { + display: table !important; + } + .d-xl-table-cell { + display: table-cell !important; + } + .d-xl-flex { + display: -ms-flexbox !important; + display: flex !important; + } + .d-xl-inline-flex { + display: -ms-inline-flexbox !important; + display: inline-flex !important; + } +} + +.d-print-block { + display: none !important; +} + +@media print { + .d-print-block { + display: block !important; + } +} + +.d-print-inline { + display: none !important; +} + +@media print { + .d-print-inline { + display: inline !important; + } +} + +.d-print-inline-block { + display: none !important; +} + +@media print { + .d-print-inline-block { + display: inline-block !important; + } +} + +@media print { + .d-print-none { + display: none !important; + } +} + +.embed-responsive { + position: relative; + display: block; + width: 100%; + padding: 0; + overflow: hidden; +} + +.embed-responsive::before { + display: block; + content: ""; +} + +.embed-responsive .embed-responsive-item, +.embed-responsive iframe, +.embed-responsive embed, +.embed-responsive object, +.embed-responsive video { + position: absolute; + top: 0; + bottom: 0; + left: 0; + width: 100%; + height: 100%; + border: 0; +} + +.embed-responsive-21by9::before { + padding-top: 42.857143%; +} + +.embed-responsive-16by9::before { + padding-top: 56.25%; +} + +.embed-responsive-4by3::before { + padding-top: 75%; +} + +.embed-responsive-1by1::before { + padding-top: 100%; +} + +.flex-row { + -ms-flex-direction: row !important; + flex-direction: row !important; +} + +.flex-column { + -ms-flex-direction: column !important; + flex-direction: column !important; +} + +.flex-row-reverse { + -ms-flex-direction: row-reverse !important; + flex-direction: row-reverse !important; +} + +.flex-column-reverse { + -ms-flex-direction: column-reverse !important; + flex-direction: column-reverse !important; +} + +.flex-wrap { + -ms-flex-wrap: wrap !important; + flex-wrap: wrap !important; +} + +.flex-nowrap { + -ms-flex-wrap: nowrap !important; + flex-wrap: nowrap !important; +} + +.flex-wrap-reverse { + -ms-flex-wrap: wrap-reverse !important; + flex-wrap: wrap-reverse !important; +} + +.justify-content-start { + -ms-flex-pack: start !important; + justify-content: flex-start !important; +} + +.justify-content-end { + -ms-flex-pack: end !important; + justify-content: flex-end !important; +} + +.justify-content-center { + -ms-flex-pack: center !important; + justify-content: center !important; +} + +.justify-content-between { + -ms-flex-pack: justify !important; + justify-content: space-between !important; +} + +.justify-content-around { + -ms-flex-pack: distribute !important; + justify-content: space-around !important; +} + +.align-items-start { + -ms-flex-align: start !important; + align-items: flex-start !important; +} + +.align-items-end { + -ms-flex-align: end !important; + align-items: flex-end !important; +} + +.align-items-center { + -ms-flex-align: center !important; + align-items: center !important; +} + +.align-items-baseline { + -ms-flex-align: baseline !important; + align-items: baseline !important; +} + +.align-items-stretch { + -ms-flex-align: stretch !important; + align-items: stretch !important; +} + +.align-content-start { + -ms-flex-line-pack: start !important; + align-content: flex-start !important; +} + +.align-content-end { + -ms-flex-line-pack: end !important; + align-content: flex-end !important; +} + +.align-content-center { + -ms-flex-line-pack: center !important; + align-content: center !important; +} + +.align-content-between { + -ms-flex-line-pack: justify !important; + align-content: space-between !important; +} + +.align-content-around { + -ms-flex-line-pack: distribute !important; + align-content: space-around !important; +} + +.align-content-stretch { + -ms-flex-line-pack: stretch !important; + align-content: stretch !important; +} + +.align-self-auto { + -ms-flex-item-align: auto !important; + align-self: auto !important; +} + +.align-self-start { + -ms-flex-item-align: start !important; + align-self: flex-start !important; +} + +.align-self-end { + -ms-flex-item-align: end !important; + align-self: flex-end !important; +} + +.align-self-center { + -ms-flex-item-align: center !important; + align-self: center !important; +} + +.align-self-baseline { + -ms-flex-item-align: baseline !important; + align-self: baseline !important; +} + +.align-self-stretch { + -ms-flex-item-align: stretch !important; + align-self: stretch !important; +} + +@media (min-width: 576px) { + .flex-sm-row { + -ms-flex-direction: row !important; + flex-direction: row !important; + } + .flex-sm-column { + -ms-flex-direction: column !important; + flex-direction: column !important; + } + .flex-sm-row-reverse { + -ms-flex-direction: row-reverse !important; + flex-direction: row-reverse !important; + } + .flex-sm-column-reverse { + -ms-flex-direction: column-reverse !important; + flex-direction: column-reverse !important; + } + .flex-sm-wrap { + -ms-flex-wrap: wrap !important; + flex-wrap: wrap !important; + } + .flex-sm-nowrap { + -ms-flex-wrap: nowrap !important; + flex-wrap: nowrap !important; + } + .flex-sm-wrap-reverse { + -ms-flex-wrap: wrap-reverse !important; + flex-wrap: wrap-reverse !important; + } + .justify-content-sm-start { + -ms-flex-pack: start !important; + justify-content: flex-start !important; + } + .justify-content-sm-end { + -ms-flex-pack: end !important; + justify-content: flex-end !important; + } + .justify-content-sm-center { + -ms-flex-pack: center !important; + justify-content: center !important; + } + .justify-content-sm-between { + -ms-flex-pack: justify !important; + justify-content: space-between !important; + } + .justify-content-sm-around { + -ms-flex-pack: distribute !important; + justify-content: space-around !important; + } + .align-items-sm-start { + -ms-flex-align: start !important; + align-items: flex-start !important; + } + .align-items-sm-end { + -ms-flex-align: end !important; + align-items: flex-end !important; + } + .align-items-sm-center { + -ms-flex-align: center !important; + align-items: center !important; + } + .align-items-sm-baseline { + -ms-flex-align: baseline !important; + align-items: baseline !important; + } + .align-items-sm-stretch { + -ms-flex-align: stretch !important; + align-items: stretch !important; + } + .align-content-sm-start { + -ms-flex-line-pack: start !important; + align-content: flex-start !important; + } + .align-content-sm-end { + -ms-flex-line-pack: end !important; + align-content: flex-end !important; + } + .align-content-sm-center { + -ms-flex-line-pack: center !important; + align-content: center !important; + } + .align-content-sm-between { + -ms-flex-line-pack: justify !important; + align-content: space-between !important; + } + .align-content-sm-around { + -ms-flex-line-pack: distribute !important; + align-content: space-around !important; + } + .align-content-sm-stretch { + -ms-flex-line-pack: stretch !important; + align-content: stretch !important; + } + .align-self-sm-auto { + -ms-flex-item-align: auto !important; + align-self: auto !important; + } + .align-self-sm-start { + -ms-flex-item-align: start !important; + align-self: flex-start !important; + } + .align-self-sm-end { + -ms-flex-item-align: end !important; + align-self: flex-end !important; + } + .align-self-sm-center { + -ms-flex-item-align: center !important; + align-self: center !important; + } + .align-self-sm-baseline { + -ms-flex-item-align: baseline !important; + align-self: baseline !important; + } + .align-self-sm-stretch { + -ms-flex-item-align: stretch !important; + align-self: stretch !important; + } +} + +@media (min-width: 768px) { + .flex-md-row { + -ms-flex-direction: row !important; + flex-direction: row !important; + } + .flex-md-column { + -ms-flex-direction: column !important; + flex-direction: column !important; + } + .flex-md-row-reverse { + -ms-flex-direction: row-reverse !important; + flex-direction: row-reverse !important; + } + .flex-md-column-reverse { + -ms-flex-direction: column-reverse !important; + flex-direction: column-reverse !important; + } + .flex-md-wrap { + -ms-flex-wrap: wrap !important; + flex-wrap: wrap !important; + } + .flex-md-nowrap { + -ms-flex-wrap: nowrap !important; + flex-wrap: nowrap !important; + } + .flex-md-wrap-reverse { + -ms-flex-wrap: wrap-reverse !important; + flex-wrap: wrap-reverse !important; + } + .justify-content-md-start { + -ms-flex-pack: start !important; + justify-content: flex-start !important; + } + .justify-content-md-end { + -ms-flex-pack: end !important; + justify-content: flex-end !important; + } + .justify-content-md-center { + -ms-flex-pack: center !important; + justify-content: center !important; + } + .justify-content-md-between { + -ms-flex-pack: justify !important; + justify-content: space-between !important; + } + .justify-content-md-around { + -ms-flex-pack: distribute !important; + justify-content: space-around !important; + } + .align-items-md-start { + -ms-flex-align: start !important; + align-items: flex-start !important; + } + .align-items-md-end { + -ms-flex-align: end !important; + align-items: flex-end !important; + } + .align-items-md-center { + -ms-flex-align: center !important; + align-items: center !important; + } + .align-items-md-baseline { + -ms-flex-align: baseline !important; + align-items: baseline !important; + } + .align-items-md-stretch { + -ms-flex-align: stretch !important; + align-items: stretch !important; + } + .align-content-md-start { + -ms-flex-line-pack: start !important; + align-content: flex-start !important; + } + .align-content-md-end { + -ms-flex-line-pack: end !important; + align-content: flex-end !important; + } + .align-content-md-center { + -ms-flex-line-pack: center !important; + align-content: center !important; + } + .align-content-md-between { + -ms-flex-line-pack: justify !important; + align-content: space-between !important; + } + .align-content-md-around { + -ms-flex-line-pack: distribute !important; + align-content: space-around !important; + } + .align-content-md-stretch { + -ms-flex-line-pack: stretch !important; + align-content: stretch !important; + } + .align-self-md-auto { + -ms-flex-item-align: auto !important; + align-self: auto !important; + } + .align-self-md-start { + -ms-flex-item-align: start !important; + align-self: flex-start !important; + } + .align-self-md-end { + -ms-flex-item-align: end !important; + align-self: flex-end !important; + } + .align-self-md-center { + -ms-flex-item-align: center !important; + align-self: center !important; + } + .align-self-md-baseline { + -ms-flex-item-align: baseline !important; + align-self: baseline !important; + } + .align-self-md-stretch { + -ms-flex-item-align: stretch !important; + align-self: stretch !important; + } +} + +@media (min-width: 992px) { + .flex-lg-row { + -ms-flex-direction: row !important; + flex-direction: row !important; + } + .flex-lg-column { + -ms-flex-direction: column !important; + flex-direction: column !important; + } + .flex-lg-row-reverse { + -ms-flex-direction: row-reverse !important; + flex-direction: row-reverse !important; + } + .flex-lg-column-reverse { + -ms-flex-direction: column-reverse !important; + flex-direction: column-reverse !important; + } + .flex-lg-wrap { + -ms-flex-wrap: wrap !important; + flex-wrap: wrap !important; + } + .flex-lg-nowrap { + -ms-flex-wrap: nowrap !important; + flex-wrap: nowrap !important; + } + .flex-lg-wrap-reverse { + -ms-flex-wrap: wrap-reverse !important; + flex-wrap: wrap-reverse !important; + } + .justify-content-lg-start { + -ms-flex-pack: start !important; + justify-content: flex-start !important; + } + .justify-content-lg-end { + -ms-flex-pack: end !important; + justify-content: flex-end !important; + } + .justify-content-lg-center { + -ms-flex-pack: center !important; + justify-content: center !important; + } + .justify-content-lg-between { + -ms-flex-pack: justify !important; + justify-content: space-between !important; + } + .justify-content-lg-around { + -ms-flex-pack: distribute !important; + justify-content: space-around !important; + } + .align-items-lg-start { + -ms-flex-align: start !important; + align-items: flex-start !important; + } + .align-items-lg-end { + -ms-flex-align: end !important; + align-items: flex-end !important; + } + .align-items-lg-center { + -ms-flex-align: center !important; + align-items: center !important; + } + .align-items-lg-baseline { + -ms-flex-align: baseline !important; + align-items: baseline !important; + } + .align-items-lg-stretch { + -ms-flex-align: stretch !important; + align-items: stretch !important; + } + .align-content-lg-start { + -ms-flex-line-pack: start !important; + align-content: flex-start !important; + } + .align-content-lg-end { + -ms-flex-line-pack: end !important; + align-content: flex-end !important; + } + .align-content-lg-center { + -ms-flex-line-pack: center !important; + align-content: center !important; + } + .align-content-lg-between { + -ms-flex-line-pack: justify !important; + align-content: space-between !important; + } + .align-content-lg-around { + -ms-flex-line-pack: distribute !important; + align-content: space-around !important; + } + .align-content-lg-stretch { + -ms-flex-line-pack: stretch !important; + align-content: stretch !important; + } + .align-self-lg-auto { + -ms-flex-item-align: auto !important; + align-self: auto !important; + } + .align-self-lg-start { + -ms-flex-item-align: start !important; + align-self: flex-start !important; + } + .align-self-lg-end { + -ms-flex-item-align: end !important; + align-self: flex-end !important; + } + .align-self-lg-center { + -ms-flex-item-align: center !important; + align-self: center !important; + } + .align-self-lg-baseline { + -ms-flex-item-align: baseline !important; + align-self: baseline !important; + } + .align-self-lg-stretch { + -ms-flex-item-align: stretch !important; + align-self: stretch !important; + } +} + +@media (min-width: 1200px) { + .flex-xl-row { + -ms-flex-direction: row !important; + flex-direction: row !important; + } + .flex-xl-column { + -ms-flex-direction: column !important; + flex-direction: column !important; + } + .flex-xl-row-reverse { + -ms-flex-direction: row-reverse !important; + flex-direction: row-reverse !important; + } + .flex-xl-column-reverse { + -ms-flex-direction: column-reverse !important; + flex-direction: column-reverse !important; + } + .flex-xl-wrap { + -ms-flex-wrap: wrap !important; + flex-wrap: wrap !important; + } + .flex-xl-nowrap { + -ms-flex-wrap: nowrap !important; + flex-wrap: nowrap !important; + } + .flex-xl-wrap-reverse { + -ms-flex-wrap: wrap-reverse !important; + flex-wrap: wrap-reverse !important; + } + .justify-content-xl-start { + -ms-flex-pack: start !important; + justify-content: flex-start !important; + } + .justify-content-xl-end { + -ms-flex-pack: end !important; + justify-content: flex-end !important; + } + .justify-content-xl-center { + -ms-flex-pack: center !important; + justify-content: center !important; + } + .justify-content-xl-between { + -ms-flex-pack: justify !important; + justify-content: space-between !important; + } + .justify-content-xl-around { + -ms-flex-pack: distribute !important; + justify-content: space-around !important; + } + .align-items-xl-start { + -ms-flex-align: start !important; + align-items: flex-start !important; + } + .align-items-xl-end { + -ms-flex-align: end !important; + align-items: flex-end !important; + } + .align-items-xl-center { + -ms-flex-align: center !important; + align-items: center !important; + } + .align-items-xl-baseline { + -ms-flex-align: baseline !important; + align-items: baseline !important; + } + .align-items-xl-stretch { + -ms-flex-align: stretch !important; + align-items: stretch !important; + } + .align-content-xl-start { + -ms-flex-line-pack: start !important; + align-content: flex-start !important; + } + .align-content-xl-end { + -ms-flex-line-pack: end !important; + align-content: flex-end !important; + } + .align-content-xl-center { + -ms-flex-line-pack: center !important; + align-content: center !important; + } + .align-content-xl-between { + -ms-flex-line-pack: justify !important; + align-content: space-between !important; + } + .align-content-xl-around { + -ms-flex-line-pack: distribute !important; + align-content: space-around !important; + } + .align-content-xl-stretch { + -ms-flex-line-pack: stretch !important; + align-content: stretch !important; + } + .align-self-xl-auto { + -ms-flex-item-align: auto !important; + align-self: auto !important; + } + .align-self-xl-start { + -ms-flex-item-align: start !important; + align-self: flex-start !important; + } + .align-self-xl-end { + -ms-flex-item-align: end !important; + align-self: flex-end !important; + } + .align-self-xl-center { + -ms-flex-item-align: center !important; + align-self: center !important; + } + .align-self-xl-baseline { + -ms-flex-item-align: baseline !important; + align-self: baseline !important; + } + .align-self-xl-stretch { + -ms-flex-item-align: stretch !important; + align-self: stretch !important; + } +} + +.float-left { + float: left !important; +} + +.float-right { + float: right !important; +} + +.float-none { + float: none !important; +} + +@media (min-width: 576px) { + .float-sm-left { + float: left !important; + } + .float-sm-right { + float: right !important; + } + .float-sm-none { + float: none !important; + } +} + +@media (min-width: 768px) { + .float-md-left { + float: left !important; + } + .float-md-right { + float: right !important; + } + .float-md-none { + float: none !important; + } +} + +@media (min-width: 992px) { + .float-lg-left { + float: left !important; + } + .float-lg-right { + float: right !important; + } + .float-lg-none { + float: none !important; + } +} + +@media (min-width: 1200px) { + .float-xl-left { + float: left !important; + } + .float-xl-right { + float: right !important; + } + .float-xl-none { + float: none !important; + } +} + +.fixed-top { + position: fixed; + top: 0; + right: 0; + left: 0; + z-index: 1030; +} + +.fixed-bottom { + position: fixed; + right: 0; + bottom: 0; + left: 0; + z-index: 1030; +} + +@supports ((position: -webkit-sticky) or (position: sticky)) { + .sticky-top { + position: -webkit-sticky; + position: sticky; + top: 0; + z-index: 1020; + } +} + +.sr-only { + position: absolute; + width: 1px; + height: 1px; + padding: 0; + overflow: hidden; + clip: rect(0, 0, 0, 0); + white-space: nowrap; + -webkit-clip-path: inset(50%); + clip-path: inset(50%); + border: 0; +} + +.sr-only-focusable:active, .sr-only-focusable:focus { + position: static; + width: auto; + height: auto; + overflow: visible; + clip: auto; + white-space: normal; + -webkit-clip-path: none; + clip-path: none; +} + +.w-25 { + width: 25% !important; +} + +.w-50 { + width: 50% !important; +} + +.w-75 { + width: 75% !important; +} + +.w-100 { + width: 100% !important; +} + +.h-25 { + height: 25% !important; +} + +.h-50 { + height: 50% !important; +} + +.h-75 { + height: 75% !important; +} + +.h-100 { + height: 100% !important; +} + +.mw-100 { + max-width: 100% !important; +} + +.mh-100 { + max-height: 100% !important; +} + +.m-0 { + margin: 0 !important; +} + +.mt-0 { + margin-top: 0 !important; +} + +.mr-0 { + margin-right: 0 !important; +} + +.mb-0 { + margin-bottom: 0 !important; +} + +.ml-0 { + margin-left: 0 !important; +} + +.mx-0 { + margin-right: 0 !important; + margin-left: 0 !important; +} + +.my-0 { + margin-top: 0 !important; + margin-bottom: 0 !important; +} + +.m-1 { + margin: 0.25rem !important; +} + +.mt-1 { + margin-top: 0.25rem !important; +} + +.mr-1 { + margin-right: 0.25rem !important; +} + +.mb-1 { + margin-bottom: 0.25rem !important; +} + +.ml-1 { + margin-left: 0.25rem !important; +} + +.mx-1 { + margin-right: 0.25rem !important; + margin-left: 0.25rem !important; +} + +.my-1 { + margin-top: 0.25rem !important; + margin-bottom: 0.25rem !important; +} + +.m-2 { + margin: 0.5rem !important; +} + +.mt-2 { + margin-top: 0.5rem !important; +} + +.mr-2 { + margin-right: 0.5rem !important; +} + +.mb-2 { + margin-bottom: 0.5rem !important; +} + +.ml-2 { + margin-left: 0.5rem !important; +} + +.mx-2 { + margin-right: 0.5rem !important; + margin-left: 0.5rem !important; +} + +.my-2 { + margin-top: 0.5rem !important; + margin-bottom: 0.5rem !important; +} + +.m-3 { + margin: 1rem !important; +} + +.mt-3 { + margin-top: 1rem !important; +} + +.mr-3 { + margin-right: 1rem !important; +} + +.mb-3 { + margin-bottom: 1rem !important; +} + +.ml-3 { + margin-left: 1rem !important; +} + +.mx-3 { + margin-right: 1rem !important; + margin-left: 1rem !important; +} + +.my-3 { + margin-top: 1rem !important; + margin-bottom: 1rem !important; +} + +.m-4 { + margin: 1.5rem !important; +} + +.mt-4 { + margin-top: 1.5rem !important; +} + +.mr-4 { + margin-right: 1.5rem !important; +} + +.mb-4 { + margin-bottom: 1.5rem !important; +} + +.ml-4 { + margin-left: 1.5rem !important; +} + +.mx-4 { + margin-right: 1.5rem !important; + margin-left: 1.5rem !important; +} + +.my-4 { + margin-top: 1.5rem !important; + margin-bottom: 1.5rem !important; +} + +.m-5 { + margin: 3rem !important; +} + +.mt-5 { + margin-top: 3rem !important; +} + +.mr-5 { + margin-right: 3rem !important; +} + +.mb-5 { + margin-bottom: 3rem !important; +} + +.ml-5 { + margin-left: 3rem !important; +} + +.mx-5 { + margin-right: 3rem !important; + margin-left: 3rem !important; +} + +.my-5 { + margin-top: 3rem !important; + margin-bottom: 3rem !important; +} + +.p-0 { + padding: 0 !important; +} + +.pt-0 { + padding-top: 0 !important; +} + +.pr-0 { + padding-right: 0 !important; +} + +.pb-0 { + padding-bottom: 0 !important; +} + +.pl-0 { + padding-left: 0 !important; +} + +.px-0 { + padding-right: 0 !important; + padding-left: 0 !important; +} + +.py-0 { + padding-top: 0 !important; + padding-bottom: 0 !important; +} + +.p-1 { + padding: 0.25rem !important; +} + +.pt-1 { + padding-top: 0.25rem !important; +} + +.pr-1 { + padding-right: 0.25rem !important; +} + +.pb-1 { + padding-bottom: 0.25rem !important; +} + +.pl-1 { + padding-left: 0.25rem !important; +} + +.px-1 { + padding-right: 0.25rem !important; + padding-left: 0.25rem !important; +} + +.py-1 { + padding-top: 0.25rem !important; + padding-bottom: 0.25rem !important; +} + +.p-2 { + padding: 0.5rem !important; +} + +.pt-2 { + padding-top: 0.5rem !important; +} + +.pr-2 { + padding-right: 0.5rem !important; +} + +.pb-2 { + padding-bottom: 0.5rem !important; +} + +.pl-2 { + padding-left: 0.5rem !important; +} + +.px-2 { + padding-right: 0.5rem !important; + padding-left: 0.5rem !important; +} + +.py-2 { + padding-top: 0.5rem !important; + padding-bottom: 0.5rem !important; +} + +.p-3 { + padding: 1rem !important; +} + +.pt-3 { + padding-top: 1rem !important; +} + +.pr-3 { + padding-right: 1rem !important; +} + +.pb-3 { + padding-bottom: 1rem !important; +} + +.pl-3 { + padding-left: 1rem !important; +} + +.px-3 { + padding-right: 1rem !important; + padding-left: 1rem !important; +} + +.py-3 { + padding-top: 1rem !important; + padding-bottom: 1rem !important; +} + +.p-4 { + padding: 1.5rem !important; +} + +.pt-4 { + padding-top: 1.5rem !important; +} + +.pr-4 { + padding-right: 1.5rem !important; +} + +.pb-4 { + padding-bottom: 1.5rem !important; +} + +.pl-4 { + padding-left: 1.5rem !important; +} + +.px-4 { + padding-right: 1.5rem !important; + padding-left: 1.5rem !important; +} + +.py-4 { + padding-top: 1.5rem !important; + padding-bottom: 1.5rem !important; +} + +.p-5 { + padding: 3rem !important; +} + +.pt-5 { + padding-top: 3rem !important; +} + +.pr-5 { + padding-right: 3rem !important; +} + +.pb-5 { + padding-bottom: 3rem !important; +} + +.pl-5 { + padding-left: 3rem !important; +} + +.px-5 { + padding-right: 3rem !important; + padding-left: 3rem !important; +} + +.py-5 { + padding-top: 3rem !important; + padding-bottom: 3rem !important; +} + +.m-auto { + margin: auto !important; +} + +.mt-auto { + margin-top: auto !important; +} + +.mr-auto { + margin-right: auto !important; +} + +.mb-auto { + margin-bottom: auto !important; +} + +.ml-auto { + margin-left: auto !important; +} + +.mx-auto { + margin-right: auto !important; + margin-left: auto !important; +} + +.my-auto { + margin-top: auto !important; + margin-bottom: auto !important; +} + +@media (min-width: 576px) { + .m-sm-0 { + margin: 0 !important; + } + .mt-sm-0 { + margin-top: 0 !important; + } + .mr-sm-0 { + margin-right: 0 !important; + } + .mb-sm-0 { + margin-bottom: 0 !important; + } + .ml-sm-0 { + margin-left: 0 !important; + } + .mx-sm-0 { + margin-right: 0 !important; + margin-left: 0 !important; + } + .my-sm-0 { + margin-top: 0 !important; + margin-bottom: 0 !important; + } + .m-sm-1 { + margin: 0.25rem !important; + } + .mt-sm-1 { + margin-top: 0.25rem !important; + } + .mr-sm-1 { + margin-right: 0.25rem !important; + } + .mb-sm-1 { + margin-bottom: 0.25rem !important; + } + .ml-sm-1 { + margin-left: 0.25rem !important; + } + .mx-sm-1 { + margin-right: 0.25rem !important; + margin-left: 0.25rem !important; + } + .my-sm-1 { + margin-top: 0.25rem !important; + margin-bottom: 0.25rem !important; + } + .m-sm-2 { + margin: 0.5rem !important; + } + .mt-sm-2 { + margin-top: 0.5rem !important; + } + .mr-sm-2 { + margin-right: 0.5rem !important; + } + .mb-sm-2 { + margin-bottom: 0.5rem !important; + } + .ml-sm-2 { + margin-left: 0.5rem !important; + } + .mx-sm-2 { + margin-right: 0.5rem !important; + margin-left: 0.5rem !important; + } + .my-sm-2 { + margin-top: 0.5rem !important; + margin-bottom: 0.5rem !important; + } + .m-sm-3 { + margin: 1rem !important; + } + .mt-sm-3 { + margin-top: 1rem !important; + } + .mr-sm-3 { + margin-right: 1rem !important; + } + .mb-sm-3 { + margin-bottom: 1rem !important; + } + .ml-sm-3 { + margin-left: 1rem !important; + } + .mx-sm-3 { + margin-right: 1rem !important; + margin-left: 1rem !important; + } + .my-sm-3 { + margin-top: 1rem !important; + margin-bottom: 1rem !important; + } + .m-sm-4 { + margin: 1.5rem !important; + } + .mt-sm-4 { + margin-top: 1.5rem !important; + } + .mr-sm-4 { + margin-right: 1.5rem !important; + } + .mb-sm-4 { + margin-bottom: 1.5rem !important; + } + .ml-sm-4 { + margin-left: 1.5rem !important; + } + .mx-sm-4 { + margin-right: 1.5rem !important; + margin-left: 1.5rem !important; + } + .my-sm-4 { + margin-top: 1.5rem !important; + margin-bottom: 1.5rem !important; + } + .m-sm-5 { + margin: 3rem !important; + } + .mt-sm-5 { + margin-top: 3rem !important; + } + .mr-sm-5 { + margin-right: 3rem !important; + } + .mb-sm-5 { + margin-bottom: 3rem !important; + } + .ml-sm-5 { + margin-left: 3rem !important; + } + .mx-sm-5 { + margin-right: 3rem !important; + margin-left: 3rem !important; + } + .my-sm-5 { + margin-top: 3rem !important; + margin-bottom: 3rem !important; + } + .p-sm-0 { + padding: 0 !important; + } + .pt-sm-0 { + padding-top: 0 !important; + } + .pr-sm-0 { + padding-right: 0 !important; + } + .pb-sm-0 { + padding-bottom: 0 !important; + } + .pl-sm-0 { + padding-left: 0 !important; + } + .px-sm-0 { + padding-right: 0 !important; + padding-left: 0 !important; + } + .py-sm-0 { + padding-top: 0 !important; + padding-bottom: 0 !important; + } + .p-sm-1 { + padding: 0.25rem !important; + } + .pt-sm-1 { + padding-top: 0.25rem !important; + } + .pr-sm-1 { + padding-right: 0.25rem !important; + } + .pb-sm-1 { + padding-bottom: 0.25rem !important; + } + .pl-sm-1 { + padding-left: 0.25rem !important; + } + .px-sm-1 { + padding-right: 0.25rem !important; + padding-left: 0.25rem !important; + } + .py-sm-1 { + padding-top: 0.25rem !important; + padding-bottom: 0.25rem !important; + } + .p-sm-2 { + padding: 0.5rem !important; + } + .pt-sm-2 { + padding-top: 0.5rem !important; + } + .pr-sm-2 { + padding-right: 0.5rem !important; + } + .pb-sm-2 { + padding-bottom: 0.5rem !important; + } + .pl-sm-2 { + padding-left: 0.5rem !important; + } + .px-sm-2 { + padding-right: 0.5rem !important; + padding-left: 0.5rem !important; + } + .py-sm-2 { + padding-top: 0.5rem !important; + padding-bottom: 0.5rem !important; + } + .p-sm-3 { + padding: 1rem !important; + } + .pt-sm-3 { + padding-top: 1rem !important; + } + .pr-sm-3 { + padding-right: 1rem !important; + } + .pb-sm-3 { + padding-bottom: 1rem !important; + } + .pl-sm-3 { + padding-left: 1rem !important; + } + .px-sm-3 { + padding-right: 1rem !important; + padding-left: 1rem !important; + } + .py-sm-3 { + padding-top: 1rem !important; + padding-bottom: 1rem !important; + } + .p-sm-4 { + padding: 1.5rem !important; + } + .pt-sm-4 { + padding-top: 1.5rem !important; + } + .pr-sm-4 { + padding-right: 1.5rem !important; + } + .pb-sm-4 { + padding-bottom: 1.5rem !important; + } + .pl-sm-4 { + padding-left: 1.5rem !important; + } + .px-sm-4 { + padding-right: 1.5rem !important; + padding-left: 1.5rem !important; + } + .py-sm-4 { + padding-top: 1.5rem !important; + padding-bottom: 1.5rem !important; + } + .p-sm-5 { + padding: 3rem !important; + } + .pt-sm-5 { + padding-top: 3rem !important; + } + .pr-sm-5 { + padding-right: 3rem !important; + } + .pb-sm-5 { + padding-bottom: 3rem !important; + } + .pl-sm-5 { + padding-left: 3rem !important; + } + .px-sm-5 { + padding-right: 3rem !important; + padding-left: 3rem !important; + } + .py-sm-5 { + padding-top: 3rem !important; + padding-bottom: 3rem !important; + } + .m-sm-auto { + margin: auto !important; + } + .mt-sm-auto { + margin-top: auto !important; + } + .mr-sm-auto { + margin-right: auto !important; + } + .mb-sm-auto { + margin-bottom: auto !important; + } + .ml-sm-auto { + margin-left: auto !important; + } + .mx-sm-auto { + margin-right: auto !important; + margin-left: auto !important; + } + .my-sm-auto { + margin-top: auto !important; + margin-bottom: auto !important; + } +} + +@media (min-width: 768px) { + .m-md-0 { + margin: 0 !important; + } + .mt-md-0 { + margin-top: 0 !important; + } + .mr-md-0 { + margin-right: 0 !important; + } + .mb-md-0 { + margin-bottom: 0 !important; + } + .ml-md-0 { + margin-left: 0 !important; + } + .mx-md-0 { + margin-right: 0 !important; + margin-left: 0 !important; + } + .my-md-0 { + margin-top: 0 !important; + margin-bottom: 0 !important; + } + .m-md-1 { + margin: 0.25rem !important; + } + .mt-md-1 { + margin-top: 0.25rem !important; + } + .mr-md-1 { + margin-right: 0.25rem !important; + } + .mb-md-1 { + margin-bottom: 0.25rem !important; + } + .ml-md-1 { + margin-left: 0.25rem !important; + } + .mx-md-1 { + margin-right: 0.25rem !important; + margin-left: 0.25rem !important; + } + .my-md-1 { + margin-top: 0.25rem !important; + margin-bottom: 0.25rem !important; + } + .m-md-2 { + margin: 0.5rem !important; + } + .mt-md-2 { + margin-top: 0.5rem !important; + } + .mr-md-2 { + margin-right: 0.5rem !important; + } + .mb-md-2 { + margin-bottom: 0.5rem !important; + } + .ml-md-2 { + margin-left: 0.5rem !important; + } + .mx-md-2 { + margin-right: 0.5rem !important; + margin-left: 0.5rem !important; + } + .my-md-2 { + margin-top: 0.5rem !important; + margin-bottom: 0.5rem !important; + } + .m-md-3 { + margin: 1rem !important; + } + .mt-md-3 { + margin-top: 1rem !important; + } + .mr-md-3 { + margin-right: 1rem !important; + } + .mb-md-3 { + margin-bottom: 1rem !important; + } + .ml-md-3 { + margin-left: 1rem !important; + } + .mx-md-3 { + margin-right: 1rem !important; + margin-left: 1rem !important; + } + .my-md-3 { + margin-top: 1rem !important; + margin-bottom: 1rem !important; + } + .m-md-4 { + margin: 1.5rem !important; + } + .mt-md-4 { + margin-top: 1.5rem !important; + } + .mr-md-4 { + margin-right: 1.5rem !important; + } + .mb-md-4 { + margin-bottom: 1.5rem !important; + } + .ml-md-4 { + margin-left: 1.5rem !important; + } + .mx-md-4 { + margin-right: 1.5rem !important; + margin-left: 1.5rem !important; + } + .my-md-4 { + margin-top: 1.5rem !important; + margin-bottom: 1.5rem !important; + } + .m-md-5 { + margin: 3rem !important; + } + .mt-md-5 { + margin-top: 3rem !important; + } + .mr-md-5 { + margin-right: 3rem !important; + } + .mb-md-5 { + margin-bottom: 3rem !important; + } + .ml-md-5 { + margin-left: 3rem !important; + } + .mx-md-5 { + margin-right: 3rem !important; + margin-left: 3rem !important; + } + .my-md-5 { + margin-top: 3rem !important; + margin-bottom: 3rem !important; + } + .p-md-0 { + padding: 0 !important; + } + .pt-md-0 { + padding-top: 0 !important; + } + .pr-md-0 { + padding-right: 0 !important; + } + .pb-md-0 { + padding-bottom: 0 !important; + } + .pl-md-0 { + padding-left: 0 !important; + } + .px-md-0 { + padding-right: 0 !important; + padding-left: 0 !important; + } + .py-md-0 { + padding-top: 0 !important; + padding-bottom: 0 !important; + } + .p-md-1 { + padding: 0.25rem !important; + } + .pt-md-1 { + padding-top: 0.25rem !important; + } + .pr-md-1 { + padding-right: 0.25rem !important; + } + .pb-md-1 { + padding-bottom: 0.25rem !important; + } + .pl-md-1 { + padding-left: 0.25rem !important; + } + .px-md-1 { + padding-right: 0.25rem !important; + padding-left: 0.25rem !important; + } + .py-md-1 { + padding-top: 0.25rem !important; + padding-bottom: 0.25rem !important; + } + .p-md-2 { + padding: 0.5rem !important; + } + .pt-md-2 { + padding-top: 0.5rem !important; + } + .pr-md-2 { + padding-right: 0.5rem !important; + } + .pb-md-2 { + padding-bottom: 0.5rem !important; + } + .pl-md-2 { + padding-left: 0.5rem !important; + } + .px-md-2 { + padding-right: 0.5rem !important; + padding-left: 0.5rem !important; + } + .py-md-2 { + padding-top: 0.5rem !important; + padding-bottom: 0.5rem !important; + } + .p-md-3 { + padding: 1rem !important; + } + .pt-md-3 { + padding-top: 1rem !important; + } + .pr-md-3 { + padding-right: 1rem !important; + } + .pb-md-3 { + padding-bottom: 1rem !important; + } + .pl-md-3 { + padding-left: 1rem !important; + } + .px-md-3 { + padding-right: 1rem !important; + padding-left: 1rem !important; + } + .py-md-3 { + padding-top: 1rem !important; + padding-bottom: 1rem !important; + } + .p-md-4 { + padding: 1.5rem !important; + } + .pt-md-4 { + padding-top: 1.5rem !important; + } + .pr-md-4 { + padding-right: 1.5rem !important; + } + .pb-md-4 { + padding-bottom: 1.5rem !important; + } + .pl-md-4 { + padding-left: 1.5rem !important; + } + .px-md-4 { + padding-right: 1.5rem !important; + padding-left: 1.5rem !important; + } + .py-md-4 { + padding-top: 1.5rem !important; + padding-bottom: 1.5rem !important; + } + .p-md-5 { + padding: 3rem !important; + } + .pt-md-5 { + padding-top: 3rem !important; + } + .pr-md-5 { + padding-right: 3rem !important; + } + .pb-md-5 { + padding-bottom: 3rem !important; + } + .pl-md-5 { + padding-left: 3rem !important; + } + .px-md-5 { + padding-right: 3rem !important; + padding-left: 3rem !important; + } + .py-md-5 { + padding-top: 3rem !important; + padding-bottom: 3rem !important; + } + .m-md-auto { + margin: auto !important; + } + .mt-md-auto { + margin-top: auto !important; + } + .mr-md-auto { + margin-right: auto !important; + } + .mb-md-auto { + margin-bottom: auto !important; + } + .ml-md-auto { + margin-left: auto !important; + } + .mx-md-auto { + margin-right: auto !important; + margin-left: auto !important; + } + .my-md-auto { + margin-top: auto !important; + margin-bottom: auto !important; + } +} + +@media (min-width: 992px) { + .m-lg-0 { + margin: 0 !important; + } + .mt-lg-0 { + margin-top: 0 !important; + } + .mr-lg-0 { + margin-right: 0 !important; + } + .mb-lg-0 { + margin-bottom: 0 !important; + } + .ml-lg-0 { + margin-left: 0 !important; + } + .mx-lg-0 { + margin-right: 0 !important; + margin-left: 0 !important; + } + .my-lg-0 { + margin-top: 0 !important; + margin-bottom: 0 !important; + } + .m-lg-1 { + margin: 0.25rem !important; + } + .mt-lg-1 { + margin-top: 0.25rem !important; + } + .mr-lg-1 { + margin-right: 0.25rem !important; + } + .mb-lg-1 { + margin-bottom: 0.25rem !important; + } + .ml-lg-1 { + margin-left: 0.25rem !important; + } + .mx-lg-1 { + margin-right: 0.25rem !important; + margin-left: 0.25rem !important; + } + .my-lg-1 { + margin-top: 0.25rem !important; + margin-bottom: 0.25rem !important; + } + .m-lg-2 { + margin: 0.5rem !important; + } + .mt-lg-2 { + margin-top: 0.5rem !important; + } + .mr-lg-2 { + margin-right: 0.5rem !important; + } + .mb-lg-2 { + margin-bottom: 0.5rem !important; + } + .ml-lg-2 { + margin-left: 0.5rem !important; + } + .mx-lg-2 { + margin-right: 0.5rem !important; + margin-left: 0.5rem !important; + } + .my-lg-2 { + margin-top: 0.5rem !important; + margin-bottom: 0.5rem !important; + } + .m-lg-3 { + margin: 1rem !important; + } + .mt-lg-3 { + margin-top: 1rem !important; + } + .mr-lg-3 { + margin-right: 1rem !important; + } + .mb-lg-3 { + margin-bottom: 1rem !important; + } + .ml-lg-3 { + margin-left: 1rem !important; + } + .mx-lg-3 { + margin-right: 1rem !important; + margin-left: 1rem !important; + } + .my-lg-3 { + margin-top: 1rem !important; + margin-bottom: 1rem !important; + } + .m-lg-4 { + margin: 1.5rem !important; + } + .mt-lg-4 { + margin-top: 1.5rem !important; + } + .mr-lg-4 { + margin-right: 1.5rem !important; + } + .mb-lg-4 { + margin-bottom: 1.5rem !important; + } + .ml-lg-4 { + margin-left: 1.5rem !important; + } + .mx-lg-4 { + margin-right: 1.5rem !important; + margin-left: 1.5rem !important; + } + .my-lg-4 { + margin-top: 1.5rem !important; + margin-bottom: 1.5rem !important; + } + .m-lg-5 { + margin: 3rem !important; + } + .mt-lg-5 { + margin-top: 3rem !important; + } + .mr-lg-5 { + margin-right: 3rem !important; + } + .mb-lg-5 { + margin-bottom: 3rem !important; + } + .ml-lg-5 { + margin-left: 3rem !important; + } + .mx-lg-5 { + margin-right: 3rem !important; + margin-left: 3rem !important; + } + .my-lg-5 { + margin-top: 3rem !important; + margin-bottom: 3rem !important; + } + .p-lg-0 { + padding: 0 !important; + } + .pt-lg-0 { + padding-top: 0 !important; + } + .pr-lg-0 { + padding-right: 0 !important; + } + .pb-lg-0 { + padding-bottom: 0 !important; + } + .pl-lg-0 { + padding-left: 0 !important; + } + .px-lg-0 { + padding-right: 0 !important; + padding-left: 0 !important; + } + .py-lg-0 { + padding-top: 0 !important; + padding-bottom: 0 !important; + } + .p-lg-1 { + padding: 0.25rem !important; + } + .pt-lg-1 { + padding-top: 0.25rem !important; + } + .pr-lg-1 { + padding-right: 0.25rem !important; + } + .pb-lg-1 { + padding-bottom: 0.25rem !important; + } + .pl-lg-1 { + padding-left: 0.25rem !important; + } + .px-lg-1 { + padding-right: 0.25rem !important; + padding-left: 0.25rem !important; + } + .py-lg-1 { + padding-top: 0.25rem !important; + padding-bottom: 0.25rem !important; + } + .p-lg-2 { + padding: 0.5rem !important; + } + .pt-lg-2 { + padding-top: 0.5rem !important; + } + .pr-lg-2 { + padding-right: 0.5rem !important; + } + .pb-lg-2 { + padding-bottom: 0.5rem !important; + } + .pl-lg-2 { + padding-left: 0.5rem !important; + } + .px-lg-2 { + padding-right: 0.5rem !important; + padding-left: 0.5rem !important; + } + .py-lg-2 { + padding-top: 0.5rem !important; + padding-bottom: 0.5rem !important; + } + .p-lg-3 { + padding: 1rem !important; + } + .pt-lg-3 { + padding-top: 1rem !important; + } + .pr-lg-3 { + padding-right: 1rem !important; + } + .pb-lg-3 { + padding-bottom: 1rem !important; + } + .pl-lg-3 { + padding-left: 1rem !important; + } + .px-lg-3 { + padding-right: 1rem !important; + padding-left: 1rem !important; + } + .py-lg-3 { + padding-top: 1rem !important; + padding-bottom: 1rem !important; + } + .p-lg-4 { + padding: 1.5rem !important; + } + .pt-lg-4 { + padding-top: 1.5rem !important; + } + .pr-lg-4 { + padding-right: 1.5rem !important; + } + .pb-lg-4 { + padding-bottom: 1.5rem !important; + } + .pl-lg-4 { + padding-left: 1.5rem !important; + } + .px-lg-4 { + padding-right: 1.5rem !important; + padding-left: 1.5rem !important; + } + .py-lg-4 { + padding-top: 1.5rem !important; + padding-bottom: 1.5rem !important; + } + .p-lg-5 { + padding: 3rem !important; + } + .pt-lg-5 { + padding-top: 3rem !important; + } + .pr-lg-5 { + padding-right: 3rem !important; + } + .pb-lg-5 { + padding-bottom: 3rem !important; + } + .pl-lg-5 { + padding-left: 3rem !important; + } + .px-lg-5 { + padding-right: 3rem !important; + padding-left: 3rem !important; + } + .py-lg-5 { + padding-top: 3rem !important; + padding-bottom: 3rem !important; + } + .m-lg-auto { + margin: auto !important; + } + .mt-lg-auto { + margin-top: auto !important; + } + .mr-lg-auto { + margin-right: auto !important; + } + .mb-lg-auto { + margin-bottom: auto !important; + } + .ml-lg-auto { + margin-left: auto !important; + } + .mx-lg-auto { + margin-right: auto !important; + margin-left: auto !important; + } + .my-lg-auto { + margin-top: auto !important; + margin-bottom: auto !important; + } +} + +@media (min-width: 1200px) { + .m-xl-0 { + margin: 0 !important; + } + .mt-xl-0 { + margin-top: 0 !important; + } + .mr-xl-0 { + margin-right: 0 !important; + } + .mb-xl-0 { + margin-bottom: 0 !important; + } + .ml-xl-0 { + margin-left: 0 !important; + } + .mx-xl-0 { + margin-right: 0 !important; + margin-left: 0 !important; + } + .my-xl-0 { + margin-top: 0 !important; + margin-bottom: 0 !important; + } + .m-xl-1 { + margin: 0.25rem !important; + } + .mt-xl-1 { + margin-top: 0.25rem !important; + } + .mr-xl-1 { + margin-right: 0.25rem !important; + } + .mb-xl-1 { + margin-bottom: 0.25rem !important; + } + .ml-xl-1 { + margin-left: 0.25rem !important; + } + .mx-xl-1 { + margin-right: 0.25rem !important; + margin-left: 0.25rem !important; + } + .my-xl-1 { + margin-top: 0.25rem !important; + margin-bottom: 0.25rem !important; + } + .m-xl-2 { + margin: 0.5rem !important; + } + .mt-xl-2 { + margin-top: 0.5rem !important; + } + .mr-xl-2 { + margin-right: 0.5rem !important; + } + .mb-xl-2 { + margin-bottom: 0.5rem !important; + } + .ml-xl-2 { + margin-left: 0.5rem !important; + } + .mx-xl-2 { + margin-right: 0.5rem !important; + margin-left: 0.5rem !important; + } + .my-xl-2 { + margin-top: 0.5rem !important; + margin-bottom: 0.5rem !important; + } + .m-xl-3 { + margin: 1rem !important; + } + .mt-xl-3 { + margin-top: 1rem !important; + } + .mr-xl-3 { + margin-right: 1rem !important; + } + .mb-xl-3 { + margin-bottom: 1rem !important; + } + .ml-xl-3 { + margin-left: 1rem !important; + } + .mx-xl-3 { + margin-right: 1rem !important; + margin-left: 1rem !important; + } + .my-xl-3 { + margin-top: 1rem !important; + margin-bottom: 1rem !important; + } + .m-xl-4 { + margin: 1.5rem !important; + } + .mt-xl-4 { + margin-top: 1.5rem !important; + } + .mr-xl-4 { + margin-right: 1.5rem !important; + } + .mb-xl-4 { + margin-bottom: 1.5rem !important; + } + .ml-xl-4 { + margin-left: 1.5rem !important; + } + .mx-xl-4 { + margin-right: 1.5rem !important; + margin-left: 1.5rem !important; + } + .my-xl-4 { + margin-top: 1.5rem !important; + margin-bottom: 1.5rem !important; + } + .m-xl-5 { + margin: 3rem !important; + } + .mt-xl-5 { + margin-top: 3rem !important; + } + .mr-xl-5 { + margin-right: 3rem !important; + } + .mb-xl-5 { + margin-bottom: 3rem !important; + } + .ml-xl-5 { + margin-left: 3rem !important; + } + .mx-xl-5 { + margin-right: 3rem !important; + margin-left: 3rem !important; + } + .my-xl-5 { + margin-top: 3rem !important; + margin-bottom: 3rem !important; + } + .p-xl-0 { + padding: 0 !important; + } + .pt-xl-0 { + padding-top: 0 !important; + } + .pr-xl-0 { + padding-right: 0 !important; + } + .pb-xl-0 { + padding-bottom: 0 !important; + } + .pl-xl-0 { + padding-left: 0 !important; + } + .px-xl-0 { + padding-right: 0 !important; + padding-left: 0 !important; + } + .py-xl-0 { + padding-top: 0 !important; + padding-bottom: 0 !important; + } + .p-xl-1 { + padding: 0.25rem !important; + } + .pt-xl-1 { + padding-top: 0.25rem !important; + } + .pr-xl-1 { + padding-right: 0.25rem !important; + } + .pb-xl-1 { + padding-bottom: 0.25rem !important; + } + .pl-xl-1 { + padding-left: 0.25rem !important; + } + .px-xl-1 { + padding-right: 0.25rem !important; + padding-left: 0.25rem !important; + } + .py-xl-1 { + padding-top: 0.25rem !important; + padding-bottom: 0.25rem !important; + } + .p-xl-2 { + padding: 0.5rem !important; + } + .pt-xl-2 { + padding-top: 0.5rem !important; + } + .pr-xl-2 { + padding-right: 0.5rem !important; + } + .pb-xl-2 { + padding-bottom: 0.5rem !important; + } + .pl-xl-2 { + padding-left: 0.5rem !important; + } + .px-xl-2 { + padding-right: 0.5rem !important; + padding-left: 0.5rem !important; + } + .py-xl-2 { + padding-top: 0.5rem !important; + padding-bottom: 0.5rem !important; + } + .p-xl-3 { + padding: 1rem !important; + } + .pt-xl-3 { + padding-top: 1rem !important; + } + .pr-xl-3 { + padding-right: 1rem !important; + } + .pb-xl-3 { + padding-bottom: 1rem !important; + } + .pl-xl-3 { + padding-left: 1rem !important; + } + .px-xl-3 { + padding-right: 1rem !important; + padding-left: 1rem !important; + } + .py-xl-3 { + padding-top: 1rem !important; + padding-bottom: 1rem !important; + } + .p-xl-4 { + padding: 1.5rem !important; + } + .pt-xl-4 { + padding-top: 1.5rem !important; + } + .pr-xl-4 { + padding-right: 1.5rem !important; + } + .pb-xl-4 { + padding-bottom: 1.5rem !important; + } + .pl-xl-4 { + padding-left: 1.5rem !important; + } + .px-xl-4 { + padding-right: 1.5rem !important; + padding-left: 1.5rem !important; + } + .py-xl-4 { + padding-top: 1.5rem !important; + padding-bottom: 1.5rem !important; + } + .p-xl-5 { + padding: 3rem !important; + } + .pt-xl-5 { + padding-top: 3rem !important; + } + .pr-xl-5 { + padding-right: 3rem !important; + } + .pb-xl-5 { + padding-bottom: 3rem !important; + } + .pl-xl-5 { + padding-left: 3rem !important; + } + .px-xl-5 { + padding-right: 3rem !important; + padding-left: 3rem !important; + } + .py-xl-5 { + padding-top: 3rem !important; + padding-bottom: 3rem !important; + } + .m-xl-auto { + margin: auto !important; + } + .mt-xl-auto { + margin-top: auto !important; + } + .mr-xl-auto { + margin-right: auto !important; + } + .mb-xl-auto { + margin-bottom: auto !important; + } + .ml-xl-auto { + margin-left: auto !important; + } + .mx-xl-auto { + margin-right: auto !important; + margin-left: auto !important; + } + .my-xl-auto { + margin-top: auto !important; + margin-bottom: auto !important; + } +} + +.text-justify { + text-align: justify !important; +} + +.text-nowrap { + white-space: nowrap !important; +} + +.text-truncate { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.text-left { + text-align: left !important; +} + +.text-right { + text-align: right !important; +} + +.text-center { + text-align: center !important; +} + +@media (min-width: 576px) { + .text-sm-left { + text-align: left !important; + } + .text-sm-right { + text-align: right !important; + } + .text-sm-center { + text-align: center !important; + } +} + +@media (min-width: 768px) { + .text-md-left { + text-align: left !important; + } + .text-md-right { + text-align: right !important; + } + .text-md-center { + text-align: center !important; + } +} + +@media (min-width: 992px) { + .text-lg-left { + text-align: left !important; + } + .text-lg-right { + text-align: right !important; + } + .text-lg-center { + text-align: center !important; + } +} + +@media (min-width: 1200px) { + .text-xl-left { + text-align: left !important; + } + .text-xl-right { + text-align: right !important; + } + .text-xl-center { + text-align: center !important; + } +} + +.text-lowercase { + text-transform: lowercase !important; +} + +.text-uppercase { + text-transform: uppercase !important; +} + +.text-capitalize { + text-transform: capitalize !important; +} + +.font-weight-normal { + font-weight: normal; +} + +.font-weight-bold { + font-weight: bold; +} + +.font-italic { + font-style: italic; +} + +.text-white { + color: #fff !important; +} + +.text-primary { + color: #007bff !important; +} + +a.text-primary:focus, a.text-primary:hover { + color: #0062cc !important; +} + +.text-secondary { + color: #868e96 !important; +} + +a.text-secondary:focus, a.text-secondary:hover { + color: #6c757d !important; +} + +.text-success { + color: #28a745 !important; +} + +a.text-success:focus, a.text-success:hover { + color: #1e7e34 !important; +} + +.text-info { + color: #17a2b8 !important; +} + +a.text-info:focus, a.text-info:hover { + color: #117a8b !important; +} + +.text-warning { + color: #ffc107 !important; +} + +a.text-warning:focus, a.text-warning:hover { + color: #d39e00 !important; +} + +.text-danger { + color: #dc3545 !important; +} + +a.text-danger:focus, a.text-danger:hover { + color: #bd2130 !important; +} + +.text-light { + color: #f8f9fa !important; +} + +a.text-light:focus, a.text-light:hover { + color: #dae0e5 !important; +} + +.text-dark { + color: #343a40 !important; +} + +a.text-dark:focus, a.text-dark:hover { + color: #1d2124 !important; +} + +.text-muted { + color: #868e96 !important; +} + +.text-hide { + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0; +} + +.visible { + visibility: visible !important; +} + +.invisible { + visibility: hidden !important; +} +/*# sourceMappingURL=bootstrap.css.map */ \ No newline at end of file diff --git a/public/vendor/bootstrap/css/bootstrap.css.map b/public/vendor/bootstrap/css/bootstrap.css.map new file mode 100755 index 000000000..14530357a --- /dev/null +++ b/public/vendor/bootstrap/css/bootstrap.css.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../scss/bootstrap.scss","../../scss/_print.scss","bootstrap.css","../../scss/_reboot.scss","../../scss/_variables.scss","../../scss/mixins/_hover.scss","../../scss/_type.scss","../../scss/mixins/_lists.scss","../../scss/_images.scss","../../scss/mixins/_image.scss","../../scss/mixins/_border-radius.scss","../../scss/mixins/_transition.scss","../../scss/_code.scss","../../scss/_grid.scss","../../scss/mixins/_grid.scss","../../scss/mixins/_breakpoints.scss","../../scss/mixins/_grid-framework.scss","../../scss/_tables.scss","../../scss/mixins/_table-row.scss","../../scss/_functions.scss","../../scss/_forms.scss","../../scss/mixins/_forms.scss","../../scss/_buttons.scss","../../scss/mixins/_buttons.scss","../../scss/_transitions.scss","../../scss/_dropdown.scss","../../scss/mixins/_nav-divider.scss","../../scss/_button-group.scss","../../scss/_input-group.scss","../../scss/_custom-forms.scss","../../scss/_nav.scss","../../scss/_navbar.scss","../../scss/_card.scss","../../scss/_breadcrumb.scss","../../scss/mixins/_clearfix.scss","../../scss/_pagination.scss","../../scss/mixins/_pagination.scss","../../scss/_badge.scss","../../scss/mixins/_badge.scss","../../scss/_jumbotron.scss","../../scss/_alert.scss","../../scss/mixins/_alert.scss","../../scss/_progress.scss","../../scss/mixins/_gradients.scss","../../scss/_media.scss","../../scss/_list-group.scss","../../scss/mixins/_list-group.scss","../../scss/_close.scss","../../scss/_modal.scss","../../scss/_tooltip.scss","../../scss/mixins/_reset-text.scss","../../scss/_popover.scss","../../scss/_carousel.scss","../../scss/utilities/_align.scss","../../scss/mixins/_background-variant.scss","../../scss/utilities/_background.scss","../../scss/utilities/_borders.scss","../../scss/utilities/_display.scss","../../scss/utilities/_embed.scss","../../scss/utilities/_flex.scss","../../scss/utilities/_float.scss","../../scss/mixins/_float.scss","../../scss/utilities/_position.scss","../../scss/utilities/_screenreaders.scss","../../scss/mixins/_screen-reader.scss","../../scss/utilities/_sizing.scss","../../scss/utilities/_spacing.scss","../../scss/utilities/_text.scss","../../scss/mixins/_text-truncate.scss","../../scss/mixins/_text-emphasis.scss","../../scss/mixins/_text-hide.scss","../../scss/utilities/_visibility.scss","../../scss/mixins/_visibility.scss"],"names":[],"mappings":"AAAA;;;;;GAKG;ACMD;EACE;;;IAME,6BAA4B;IAE5B,4BAA2B;GAC5B;EAED;;IAEE,2BAA0B;GAC3B;EAOD;IACE,8BAA6B;GAC9B;EAaD;IACE,iCAAgC;GACjC;EACD;;IAEE,uBAAgC;IAChC,yBAAwB;GACzB;EAOD;IACE,4BAA2B;GAC5B;EAED;;IAEE,yBAAwB;GACzB;EAED;;;IAGE,WAAU;IACV,UAAS;GACV;EAED;;IAEE,wBAAuB;GACxB;EAKD;IACE,cAAa;GACd;EACD;IACE,uBAAgC;GACjC;EAED;IACE,qCAAoC;GAMrC;EAPD;;IAKI,kCAAiC;GAClC;EAEH;;IAGI,kCAAiC;GAClC;CC3CN;;AC1CD;EACE,uBAAsB;EACtB,wBAAuB;EACvB,kBAAiB;EACjB,+BAA8B;EAC9B,2BAA0B;EAC1B,8BAA6B;EAC7B,yCAA0C;CAC3C;;AAED;;;EAGE,oBAAmB;CACpB;;AAIC;EAAgB,oBAAmB;CD4CpC;;ACxCD;EACE,eAAc;CACf;;AAOD;EACE,UAAS;EACT,wGCoLiH;EDnLjH,gBCuLmB;EDtLnB,oBC0LyB;EDzLzB,iBC6LoB;ED5LpB,eCEgB;EDDhB,uBCRW;CDSZ;;ADuCD;EC/BE,yBAAwB;CACzB;;AAQD;EACE,wBAAuB;EACvB,UAAS;EACT,kBAAiB;CAClB;;AAWD;EACE,cAAa;EACb,qBAAoB;CACrB;;AAMD;EACE,cAAa;EACb,oBAAmB;CACpB;;AASD;;EAEE,2BAA0B;EAC1B,0CAAiC;UAAjC,kCAAiC;EACjC,aAAY;EACZ,iBAAgB;CACjB;;AAED;EACE,oBAAmB;EACnB,mBAAkB;EAClB,qBAAoB;CACrB;;AAED;;;EAGE,cAAa;EACb,oBAAmB;CACpB;;AAED;;;;EAIE,iBAAgB;CACjB;;AAED;EACE,kBCqGqB;CDpGtB;;AAED;EACE,qBAAoB;EACpB,eAAc;CACf;;AAED;EACE,iBAAgB;CACjB;;AAED;EACE,mBAAkB;CACnB;;AAED;;EAEE,oBAAmB;CACpB;;AAED;EACE,eAAc;CACf;;AAOD;;EAEE,mBAAkB;EAClB,eAAc;EACd,eAAc;EACd,yBAAwB;CACzB;;AAED;EAAM,eAAc;CAAK;;AACzB;EAAM,WAAU;CAAK;;AAOrB;EACE,eClHe;EDmHf,sBCxB0B;EDyB1B,8BAA6B;EAC7B,sCAAqC;CAMtC;;AE1LG;EFuLA,eC5B4C;ED6B5C,2BC5B6B;CC5JR;;AFkMzB;EACE,eAAc;EACd,sBAAqB;CAUtB;;AEnMG;EF4LA,eAAc;EACd,sBAAqB;CE1LpB;;AFoLL;EAUI,WAAU;CACX;;AAQH;;;;EAIE,kCAAiC;EACjC,eAAc;CACf;;AAED;EAEE,cAAa;EAEb,oBAAmB;EAEnB,eAAc;CACf;;AAOD;EAEE,iBAAgB;CACjB;;AAOD;EACE,uBAAsB;EACtB,mBAAkB;CACnB;;AAED;EACE,iBAAgB;CACjB;;AAaD;;;;;;;;;EASE,+BAA0B;MAA1B,2BAA0B;CAC3B;;AAOD;EACE,0BAAyB;CAC1B;;AAED;EACE,qBCEoC;EDDpC,wBCCoC;EDApC,eCpPgB;EDqPhB,iBAAgB;EAChB,qBAAoB;CACrB;;AAED;EAEE,iBAAgB;CACjB;;AAOD;EAEE,sBAAqB;EACrB,qBAAoB;CACrB;;AAMD;EACE,oBAAmB;EACnB,2CAA0C;CAC3C;;AAED;;;;;EAKE,UAAS;EACT,qBAAoB;EACpB,mBAAkB;EAClB,qBAAoB;CACrB;;AAED;;EAEE,kBAAiB;CAClB;;AAED;;EAEE,qBAAoB;CACrB;;AAKD;;;;EAIE,2BAA0B;CAC3B;;AAGD;;;;EAIE,WAAU;EACV,mBAAkB;CACnB;;AAED;;EAEE,uBAAsB;EACtB,WAAU;CACX;;AAGD;;;;EASE,4BAA2B;CAC5B;;AAED;EACE,eAAc;EAEd,iBAAgB;CACjB;;AAED;EAME,aAAY;EAEZ,WAAU;EACV,UAAS;EACT,UAAS;CACV;;AAID;EACE,eAAc;EACd,YAAW;EACX,gBAAe;EACf,WAAU;EACV,qBAAoB;EACpB,kBAAiB;EACjB,qBAAoB;EACpB,eAAc;EACd,oBAAmB;CACpB;;AAED;EACE,yBAAwB;CACzB;;ADpED;;ECyEE,aAAY;CACb;;ADrED;EC4EE,qBAAoB;EACpB,yBAAwB;CACzB;;ADzED;;ECiFE,yBAAwB;CACzB;;AAOD;EACE,cAAa;EACb,2BAA0B;CAC3B;;AAMD;EACE,sBAAqB;CACtB;;AAED;EACE,mBAAkB;CACnB;;AAED;EACE,cAAa;CACd;;ADtFD;EC2FE,yBAAwB;CACzB;;AG5dD;;EAEE,sBFwPoC;EEvPpC,qBFwP8B;EEvP9B,iBFwP0B;EEvP1B,iBFwP0B;EEvP1B,eFwP8B;CEvP/B;;AAED;EAAU,kBF0OW;CE1OiB;;AACtC;EAAU,gBF0OS;CE1OmB;;AACtC;EAAU,mBF0OY;CE1OgB;;AACtC;EAAU,kBF0OW;CE1OiB;;AACtC;EAAU,mBF0OY;CE1OgB;;AACtC;EAAU,gBF0OS;CE1OmB;;AAEtC;EACE,mBF0PwB;EEzPxB,iBF0PoB;CEzPrB;;AAGD;EACE,gBFyOkB;EExOlB,iBF6OuB;EE5OvB,iBFoO0B;CEnO3B;;AACD;EACE,kBFqOoB;EEpOpB,iBFyOuB;EExOvB,iBF+N0B;CE9N3B;;AACD;EACE,kBFiOoB;EEhOpB,iBFqOuB;EEpOvB,iBF0N0B;CEzN3B;;AACD;EACE,kBF6NoB;EE5NpB,iBFiOuB;EEhOvB,iBFqN0B;CEpN3B;;AAOD;EACE,iBAAgB;EAChB,oBAAmB;EACnB,UAAS;EACT,yCFIW;CEHZ;;AAOD;;EAEE,eFgNmB;EE/MnB,oBF8KyB;CE7K1B;;AAED;;EAEE,eFoNiB;EEnNjB,0BF4Ne;CE3NhB;;AAOD;EC7EE,gBAAe;EACf,iBAAgB;CD8EjB;;AAGD;EClFE,gBAAe;EACf,iBAAgB;CDmFjB;;AACD;EACE,sBAAqB;CAKtB;;AAND;EAII,kBFsMqB;CErMtB;;AASH;EACE,eAAc;EACd,0BAAyB;CAC1B;;AAGD;EACE,oBFyBW;EExBX,mBFwKgD;CEvKjD;;AAED;EACE,eAAc;EACd,eAAc;EACd,eF7DgB;CEkEjB;;AARD;EAMI,uBAAsB;CACvB;;AElHH;ECIE,gBAAe;EAGf,aAAY;CDLb;;AAID;EACE,iBJkvBkC;EIjvBlC,uBJmCW;EIlCX,uBJmvBgC;EM/vB9B,uBNmN2B;EOlNzB,iCPiwB2C;EK3vB/C,gBAAe;EAGf,aAAY;CDSb;;AAMD;EAEE,sBAAqB;CACtB;;AAED;EACE,sBAA4B;EAC5B,eAAc;CACf;;AAED;EACE,eJmuB4B;EIluB5B,eJegB;CIdjB;;AIzCD;;;;EAIE,kFRqO2F;CQpO5F;;AAGD;EACE,uBRkzBiC;EQjzBjC,eR+yB+B;EQ9yB/B,eRizBmC;EQhzBnC,0BRsCgB;EM/Cd,uBNmN2B;CQjM9B;;AALC;EACE,WAAU;EACV,eAAc;EACd,0BAAyB;CAC1B;;AAIH;EACE,uBRkyBiC;EQjyBjC,eR+xB+B;EQ9xB/B,YRsBW;EQrBX,0BR8BgB;EMvDd,sBNqN0B;CQlL7B;;AAdD;EASI,WAAU;EACV,gBAAe;EACf,kBR8MmB;CQ5MpB;;AAIH;EACE,eAAc;EACd,cAAa;EACb,oBAAmB;EACnB,eR4wB+B;EQ3wB/B,eRYgB;CQFjB;;AAfD;EASI,WAAU;EACV,mBAAkB;EAClB,eAAc;EACd,8BAA6B;EAC7B,iBAAgB;CACjB;;AAIH;EACE,kBRuwBiC;EQtwBjC,mBAAkB;CACnB;;AC1DC;ECAA,mBAAkB;EAClB,kBAAiB;EACjB,oBAAuC;EACvC,mBAAuC;EACvC,YAAW;CDDV;;AEgDC;EFnDF;ICYI,iBV8KK;GSvLR;CXwlBF;;AaxiBG;EFnDF;ICYI,iBV+KK;GSxLR;CX8lBF;;Aa9iBG;EFnDF;ICYI,iBVgLK;GSzLR;CXomBF;;AapjBG;EFnDF;ICYI,kBViLM;GS1LT;CX0mBF;;AWjmBC;EACE,YAAW;ECbb,mBAAkB;EAClB,kBAAiB;EACjB,oBAAuC;EACvC,mBAAuC;EACvC,YAAW;CDWV;;AAQD;ECLA,qBAAa;EAAb,cAAa;EACb,oBAAe;MAAf,gBAAe;EACf,oBAAuC;EACvC,mBAAuC;CDItC;;AAID;EACE,gBAAe;EACf,eAAc;CAOf;;AATD;;EAMI,iBAAgB;EAChB,gBAAe;CAChB;;AGnCH;;;;;;EACE,mBAAkB;EAClB,YAAW;EACX,gBAAe;EACf,oBAA4B;EAC5B,mBAA4B;CAC7B;;AAkBG;EACE,2BAAa;MAAb,cAAa;EACb,qBAAY;MAAZ,aAAY;EACZ,gBAAe;CAChB;;AACD;EACE,mBAAc;MAAd,eAAc;EACd,YAAW;EACX,gBAAe;CAChB;;AAGC;EFFN,wBAAsC;MAAtC,oBAAsC;EAItC,qBAAuC;CEAhC;;AAFD;EFFN,yBAAsC;MAAtC,qBAAsC;EAItC,sBAAuC;CEAhC;;AAFD;EFFN,kBAAsC;MAAtC,cAAsC;EAItC,eAAuC;CEAhC;;AAFD;EFFN,yBAAsC;MAAtC,qBAAsC;EAItC,sBAAuC;CEAhC;;AAFD;EFFN,yBAAsC;MAAtC,qBAAsC;EAItC,sBAAuC;CEAhC;;AAFD;EFFN,kBAAsC;MAAtC,cAAsC;EAItC,eAAuC;CEAhC;;AAFD;EFFN,yBAAsC;MAAtC,qBAAsC;EAItC,sBAAuC;CEAhC;;AAFD;EFFN,yBAAsC;MAAtC,qBAAsC;EAItC,sBAAuC;CEAhC;;AAFD;EFFN,kBAAsC;MAAtC,cAAsC;EAItC,eAAuC;CEAhC;;AAFD;EFFN,yBAAsC;MAAtC,qBAAsC;EAItC,sBAAuC;CEAhC;;AAFD;EFFN,yBAAsC;MAAtC,qBAAsC;EAItC,sBAAuC;CEAhC;;AAFD;EFFN,mBAAsC;MAAtC,eAAsC;EAItC,gBAAuC;CEAhC;;AAID;EACE,kBAFU;MAEV,SAFU;CAGX;;AAFD;EACE,kBAFU;MAEV,SAFU;CAGX;;AAFD;EACE,kBAFU;MAEV,SAFU;CAGX;;AAFD;EACE,kBAFU;MAEV,SAFU;CAGX;;AAFD;EACE,kBAFU;MAEV,SAFU;CAGX;;AAFD;EACE,kBAFU;MAEV,SAFU;CAGX;;AAFD;EACE,kBAFU;MAEV,SAFU;CAGX;;AAFD;EACE,kBAFU;MAEV,SAFU;CAGX;;AAFD;EACE,kBAFU;MAEV,SAFU;CAGX;;AAFD;EACE,mBAFU;MAEV,UAFU;CAGX;;AAFD;EACE,mBAFU;MAEV,UAFU;CAGX;;AAFD;EACE,mBAFU;MAEV,UAFU;CAGX;;ADKL;ECzBE;IACE,2BAAa;QAAb,cAAa;IACb,qBAAY;QAAZ,aAAY;IACZ,gBAAe;GAChB;EACD;IACE,mBAAc;QAAd,eAAc;IACd,YAAW;IACX,gBAAe;GAChB;EAGC;IFFN,wBAAsC;QAAtC,oBAAsC;IAItC,qBAAuC;GEAhC;EAFD;IFFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GEAhC;EAFD;IFFN,kBAAsC;QAAtC,cAAsC;IAItC,eAAuC;GEAhC;EAFD;IFFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GEAhC;EAFD;IFFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GEAhC;EAFD;IFFN,kBAAsC;QAAtC,cAAsC;IAItC,eAAuC;GEAhC;EAFD;IFFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GEAhC;EAFD;IFFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GEAhC;EAFD;IFFN,kBAAsC;QAAtC,cAAsC;IAItC,eAAuC;GEAhC;EAFD;IFFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GEAhC;EAFD;IFFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GEAhC;EAFD;IFFN,mBAAsC;QAAtC,eAAsC;IAItC,gBAAuC;GEAhC;EAID;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,mBAFU;QAEV,UAFU;GAGX;EAFD;IACE,mBAFU;QAEV,UAFU;GAGX;EAFD;IACE,mBAFU;QAEV,UAFU;GAGX;Cdg0BR;;Aa3zBG;ECzBE;IACE,2BAAa;QAAb,cAAa;IACb,qBAAY;QAAZ,aAAY;IACZ,gBAAe;GAChB;EACD;IACE,mBAAc;QAAd,eAAc;IACd,YAAW;IACX,gBAAe;GAChB;EAGC;IFFN,wBAAsC;QAAtC,oBAAsC;IAItC,qBAAuC;GEAhC;EAFD;IFFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GEAhC;EAFD;IFFN,kBAAsC;QAAtC,cAAsC;IAItC,eAAuC;GEAhC;EAFD;IFFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GEAhC;EAFD;IFFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GEAhC;EAFD;IFFN,kBAAsC;QAAtC,cAAsC;IAItC,eAAuC;GEAhC;EAFD;IFFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GEAhC;EAFD;IFFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GEAhC;EAFD;IFFN,kBAAsC;QAAtC,cAAsC;IAItC,eAAuC;GEAhC;EAFD;IFFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GEAhC;EAFD;IFFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GEAhC;EAFD;IFFN,mBAAsC;QAAtC,eAAsC;IAItC,gBAAuC;GEAhC;EAID;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,mBAFU;QAEV,UAFU;GAGX;EAFD;IACE,mBAFU;QAEV,UAFU;GAGX;EAFD;IACE,mBAFU;QAEV,UAFU;GAGX;Cdi6BR;;Aa55BG;ECzBE;IACE,2BAAa;QAAb,cAAa;IACb,qBAAY;QAAZ,aAAY;IACZ,gBAAe;GAChB;EACD;IACE,mBAAc;QAAd,eAAc;IACd,YAAW;IACX,gBAAe;GAChB;EAGC;IFFN,wBAAsC;QAAtC,oBAAsC;IAItC,qBAAuC;GEAhC;EAFD;IFFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GEAhC;EAFD;IFFN,kBAAsC;QAAtC,cAAsC;IAItC,eAAuC;GEAhC;EAFD;IFFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GEAhC;EAFD;IFFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GEAhC;EAFD;IFFN,kBAAsC;QAAtC,cAAsC;IAItC,eAAuC;GEAhC;EAFD;IFFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GEAhC;EAFD;IFFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GEAhC;EAFD;IFFN,kBAAsC;QAAtC,cAAsC;IAItC,eAAuC;GEAhC;EAFD;IFFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GEAhC;EAFD;IFFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GEAhC;EAFD;IFFN,mBAAsC;QAAtC,eAAsC;IAItC,gBAAuC;GEAhC;EAID;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,mBAFU;QAEV,UAFU;GAGX;EAFD;IACE,mBAFU;QAEV,UAFU;GAGX;EAFD;IACE,mBAFU;QAEV,UAFU;GAGX;CdkgCR;;Aa7/BG;ECzBE;IACE,2BAAa;QAAb,cAAa;IACb,qBAAY;QAAZ,aAAY;IACZ,gBAAe;GAChB;EACD;IACE,mBAAc;QAAd,eAAc;IACd,YAAW;IACX,gBAAe;GAChB;EAGC;IFFN,wBAAsC;QAAtC,oBAAsC;IAItC,qBAAuC;GEAhC;EAFD;IFFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GEAhC;EAFD;IFFN,kBAAsC;QAAtC,cAAsC;IAItC,eAAuC;GEAhC;EAFD;IFFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GEAhC;EAFD;IFFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GEAhC;EAFD;IFFN,kBAAsC;QAAtC,cAAsC;IAItC,eAAuC;GEAhC;EAFD;IFFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GEAhC;EAFD;IFFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GEAhC;EAFD;IFFN,kBAAsC;QAAtC,cAAsC;IAItC,eAAuC;GEAhC;EAFD;IFFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GEAhC;EAFD;IFFN,yBAAsC;QAAtC,qBAAsC;IAItC,sBAAuC;GEAhC;EAFD;IFFN,mBAAsC;QAAtC,eAAsC;IAItC,gBAAuC;GEAhC;EAID;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,kBAFU;QAEV,SAFU;GAGX;EAFD;IACE,mBAFU;QAEV,UAFU;GAGX;EAFD;IACE,mBAFU;QAEV,UAFU;GAGX;EAFD;IACE,mBAFU;QAEV,UAFU;GAGX;CdmmCR;;AelpCD;EACE,YAAW;EACX,gBAAe;EACf,oBbgIW;Ea/HX,8BbuSyC;CalR1C;;AAzBD;;EAQI,iBbgSkC;Ea/RlC,oBAAmB;EACnB,8BbsCc;CarCf;;AAXH;EAcI,uBAAsB;EACtB,iCbiCc;CahCf;;AAhBH;EAmBI,8Bb6Bc;Ca5Bf;;AApBH;EAuBI,uBbuBS;CatBV;;AAQH;;EAGI,gBbsQiC;CarQlC;;AAQH;EACE,0BbGgB;CaUjB;;AAdD;;EAKI,0BbDc;CaEf;;AANH;;EAWM,yBAA8C;CAC/C;;AASL;EAEI,sCbXS;CaYV;;AAQH;EAGM,uCbvBO;CCjDY;;AaNvB;;;EAII,0BC4EmE;CD3EpE;;AAKH;EAKM,0BAJsC;CbLrB;;AaIvB;;EASQ,0BARoC;CASrC;;AApBP;;;EAII,0BC4EmE;CD3EpE;;AAKH;EAKM,0BAJsC;CbLrB;;AaIvB;;EASQ,0BARoC;CASrC;;AApBP;;;EAII,0BC4EmE;CD3EpE;;AAKH;EAKM,0BAJsC;CbLrB;;AaIvB;;EASQ,0BARoC;CASrC;;AApBP;;;EAII,0BC4EmE;CD3EpE;;AAKH;EAKM,0BAJsC;CbLrB;;AaIvB;;EASQ,0BARoC;CASrC;;AApBP;;;EAII,0BC4EmE;CD3EpE;;AAKH;EAKM,0BAJsC;CbLrB;;AaIvB;;EASQ,0BARoC;CASrC;;AApBP;;;EAII,0BC4EmE;CD3EpE;;AAKH;EAKM,0BAJsC;CbLrB;;AaIvB;;EASQ,0BARoC;CASrC;;AApBP;;;EAII,0BC4EmE;CD3EpE;;AAKH;EAKM,0BAJsC;CbLrB;;AaIvB;;EASQ,0BARoC;CASrC;;AApBP;;;EAII,0BC4EmE;CD3EpE;;AAKH;EAKM,0BAJsC;CbLrB;;AaIvB;;EASQ,0BARoC;CASrC;;AApBP;;;EAII,uCdmDO;CclDR;;AAKH;EAKM,uCAJsC;CbLrB;;AaIvB;;EASQ,uCARoC;CASrC;;ADgFT;EAEI,YbzDS;Ea0DT,0BbjDc;CakDf;;AAGH;EAEI,ebzDc;Ea0Dd,0Bb/Dc;CagEf;;AAGH;EACE,YbtEW;EauEX,0Bb9DgB;CauFjB;;AA3BD;;;EAOI,sBb+LoD;Ca9LrD;;AARH;EAWI,UAAS;CACV;;AAZH;EAgBM,4CbrFO;CasFR;;AAjBL;EAuBQ,6Cb5FK;CCvCY;;AU0DrB;EEsFJ;IAEI,eAAc;IACd,YAAW;IACX,iBAAgB;IAChB,6CAA4C;GAO/C;EAZD;IASM,UAAS;GACV;Cf2tCJ;;AkB13CD;EACE,eAAc;EACd,YAAW;EAGX,wBhB2TgC;EgB1ThC,gBhBiOmB;EgBhOnB,kBhB0T8B;EgBzT9B,ehB2CgB;EgB1ChB,uBhBmCW;EgBjCX,uBAAsB;EACtB,6BAA4B;EAC5B,sChByCW;EgBpCT,uBhB+L2B;EOlNzB,yEP6XqF;CgBtU1F;;AAtDD;EA6BI,8BAA6B;EAC7B,UAAS;CACV;;ACxBD;EACE,ejB2Cc;EiB1Cd,uBjBmCS;EiBlCT,sBjBiWiE;EiBhWjE,cAAa;CAEd;;ADbH;EAsCI,ehBYc;EgBVd,WAAU;CACX;;AAzCH;EAsCI,ehBYc;EgBVd,WAAU;CACX;;AAzCH;EAsCI,ehBYc;EgBVd,WAAU;CACX;;AAzCH;EAkDI,0BhBJc;EgBMd,WAAU;CACX;;AAGH;EAEI,4BhB0TkF;CgBzTnF;;AAHH;EAWI,ehBhBc;EgBiBd,uBhBxBS;CgByBV;;AAIH;;EAEE,eAAc;CACf;;AASD;EACE,oCAA2E;EAC3E,uCAA8E;EAC9E,iBAAgB;CACjB;;AAED;EACE,oCAA8E;EAC9E,uCAAiF;EACjF,mBhB0IsB;CgBzIvB;;AAED;EACE,qCAA8E;EAC9E,wCAAiF;EACjF,oBhBqIsB;CgBpIvB;;AASD;EACE,oBhBgN+B;EgB/M/B,uBhB+M+B;EgB9M/B,iBAAgB;EAChB,gBhBqHmB;CgBpHpB;;AAQD;EACE,oBhBmM+B;EgBlM/B,uBhBkM+B;EgBjM/B,iBAAgB;EAChB,kBhBkM8B;EgBjM9B,0BAAyB;EACzB,oBAAuC;CAOxC;;AAbD;;;;;EAUI,iBAAgB;EAChB,gBAAe;CAChB;;AAYH;;;EACE,wBhBgL+B;EgB/K/B,oBhBoFsB;EgBnFtB,iBhB+K6B;EMvU3B,sBNqN0B;CgB3D7B;;AAED;;;EAEI,8BhB2NqF;CgB1NtF;;AAGH;;;EACE,qBhBuK8B;EgBtK9B,mBhBsEsB;EgBrEtB,iBhBsK6B;EM3U3B,sBNoN0B;CgB7C7B;;AAED;;;EAEI,8BhBiNqF;CgBhNtF;;AASH;EACE,oBhBmNmC;CgBlNpC;;AAED;EACE,eAAc;EACd,oBhBqM+B;CgBpMhC;;AAOD;EACE,qBAAa;EAAb,cAAa;EACb,oBAAe;MAAf,gBAAe;EACf,mBAAkB;EAClB,kBAAiB;CAOlB;;AAXD;;EAQI,mBAAkB;EAClB,kBAAiB;CAClB;;AAQH;EACE,mBAAkB;EAClB,eAAc;EACd,sBhB0K+B;CgBnKhC;;AAVD;EAOM,ehBxKY;CgByKb;;AAIL;EACE,sBhBiKiC;EgBhKjC,iBAAgB;CACjB;;AAED;EACE,mBAAkB;EAClB,oBhB4JgC;EgB3JhC,sBhB0JiC;CgBrJlC;;AARD;EAMI,iBAAgB;CACjB;;AAIH;EACE,sBAAqB;CAStB;;AAVD;EAII,uBAAsB;CACvB;;AALH;EAQI,qBhB8I+B;CgB7IhC;;AAWH;EACE,cAAa;EACb,mBAAkB;EAClB,mBAAkB;EAClB,ehB/Le;CgBgMhB;;AAED;EACE,mBAAkB;EAClB,UAAS;EACT,WAAU;EACV,cAAa;EACb,aAAY;EACZ,eAAc;EACd,kBAAiB;EACjB,mBAAkB;EAClB,eAAc;EACd,YAAW;EACX,yChB7Me;EgB8Mf,qBAAoB;CACrB;;AClQG;;;EAEE,sBjBoDW;CiB1CZ;;AAZD;;;EAKI,iDjBiDS;CiBhDV;;AANH;;;;;;;;EAUI,eAAc;CACf;;AAOH;EAGI,ejBiCS;CiBhCV;;AAMH;EAGI,0CjBuBS;CiBtBV;;AAJH;EAMI,ejBoBS;CiBnBV;;AAMH;EAGI,sBjBUS;CiBPV;;AANH;EAKgB,sBAAqB;CAAK;;AAL1C;EAQI,iDjBKS;CiBJV;;AAlDH;;;EAEE,sBjBiDW;CiBvCZ;;AAZD;;;EAKI,iDjB8CS;CiB7CV;;AANH;;;;;;;;EAUI,eAAc;CACf;;AAOH;EAGI,ejB8BS;CiB7BV;;AAMH;EAGI,0CjBoBS;CiBnBV;;AAJH;EAMI,ejBiBS;CiBhBV;;AAMH;EAGI,sBjBOS;CiBJV;;AANH;EAKgB,sBAAqB;CAAK;;AAL1C;EAQI,iDjBES;CiBDV;;AD8NP;EACE,qBAAa;EAAb,cAAa;EACb,wBAAmB;MAAnB,oBAAmB;EACnB,uBAAmB;MAAnB,oBAAmB;CAuFpB;;AA1FD;EASI,YAAW;CACZ;;AL7PC;EKmPJ;IAeM,qBAAa;IAAb,cAAa;IACb,uBAAmB;QAAnB,oBAAmB;IACnB,sBAAuB;QAAvB,wBAAuB;IACvB,iBAAgB;GACjB;EAnBL;IAuBM,qBAAa;IAAb,cAAa;IACb,mBAAc;QAAd,eAAc;IACd,wBAAmB;QAAnB,oBAAmB;IACnB,uBAAmB;QAAnB,oBAAmB;IACnB,iBAAgB;GACjB;EA5BL;IAgCM,sBAAqB;IACrB,YAAW;IACX,uBAAsB;GACvB;EAnCL;IAuCM,sBAAqB;GACtB;EAxCL;IA2CM,YAAW;GACZ;EA5CL;IA+CM,iBAAgB;IAChB,uBAAsB;GACvB;EAjDL;IAsDM,qBAAa;IAAb,cAAa;IACb,uBAAmB;QAAnB,oBAAmB;IACnB,sBAAuB;QAAvB,wBAAuB;IACvB,YAAW;IACX,cAAa;IACb,iBAAgB;GACjB;EA5DL;IA8DM,gBAAe;GAChB;EA/DL;IAiEM,mBAAkB;IAClB,cAAa;IACb,sBhB2B4B;IgB1B5B,eAAc;GACf;EArEL;IAyEM,qBAAa;IAAb,cAAa;IACb,uBAAmB;QAAnB,oBAAmB;IACnB,sBAAuB;QAAvB,wBAAuB;IACvB,gBAAe;GAChB;EA7EL;IA+EM,iBAAgB;IAChB,sBAAqB;IACrB,sBhBa4B;IgBZ5B,4BAA2B;GAC5B;EAnFL;IAuFM,OAAM;GACP;ClBi3CJ;;AoB9uDD;EACE,sBAAqB;EACrB,oBlByOyB;EkBxOzB,mBAAkB;EAClB,oBAAmB;EACnB,uBAAsB;EACtB,0BAAiB;KAAjB,uBAAiB;MAAjB,sBAAiB;UAAjB,kBAAiB;EACjB,8BAAiD;ECiEjD,wBnBwPgC;EmBvPhC,gBnB8JmB;EmB7JnB,kBnBuP8B;EMnU5B,uBNmN2B;EOlNzB,kCP0V+C;CkBxTpD;;AjBjBG;EiBHA,sBAAqB;CjBMpB;;AiBnBL;EAiBI,WAAU;EACV,8ClBkDa;CkBjDd;;AAnBH;EAwBI,aAAY;CAEb;;AA1BH;EA8BI,uBAAsB;CAEvB;;AAIH;;EAEE,qBAAoB;CACrB;;AAQC;EHQE,YAAW;EItDb,0BnBmEe;EmBlEf,sBnBkEe;CkBnBd;;AC5CD;EJkDE,YAAW;EIhDX,0BARqF;EASrF,sBAT2H;CAU5H;;AAED;EAMI,6CnBmDW;CmBjDd;;AAGD;EAEE,0BnB4Ca;EmB3Cb,sBnB2Ca;CmB1Cd;;AAED;;EAGE,0BAhCqF;EAiCrF,uBAAsB;EACtB,sBAlC2H;CAoC5H;;ADYD;EHQE,YAAW;EItDb,0BnBiDgB;EmBhDhB,sBnBgDgB;CkBDf;;AC5CD;EJkDE,YAAW;EIhDX,0BARqF;EASrF,sBAT2H;CAU5H;;AAED;EAMI,+CnBiCY;CmB/Bf;;AAGD;EAEE,0BnB0Bc;EmBzBd,sBnByBc;CmBxBf;;AAED;;EAGE,0BAhCqF;EAiCrF,uBAAsB;EACtB,sBAlC2H;CAoC5H;;ADYD;EHQE,YAAW;EItDb,0BnB0Ee;EmBzEf,sBnByEe;CkB1Bd;;AC5CD;EJkDE,YAAW;EIhDX,0BARqF;EASrF,sBAT2H;CAU5H;;AAED;EAMI,6CnB0DW;CmBxDd;;AAGD;EAEE,0BnBmDa;EmBlDb,sBnBkDa;CmBjDd;;AAED;;EAGE,0BAhCqF;EAiCrF,uBAAsB;EACtB,sBAlC2H;CAoC5H;;ADYD;EHQE,YAAW;EItDb,0BnB4Ee;EmB3Ef,sBnB2Ee;CkB5Bd;;AC5CD;EJkDE,YAAW;EIhDX,0BARqF;EASrF,sBAT2H;CAU5H;;AAED;EAMI,8CnB4DW;CmB1Dd;;AAGD;EAEE,0BnBqDa;EmBpDb,sBnBoDa;CmBnDd;;AAED;;EAGE,0BAhCqF;EAiCrF,uBAAsB;EACtB,sBAlC2H;CAoC5H;;ADYD;EHME,YAAW;EIpDb,0BnByEe;EmBxEf,sBnBwEe;CkBzBd;;AC5CD;EJgDE,YAAW;EI9CX,0BARqF;EASrF,sBAT2H;CAU5H;;AAED;EAMI,6CnByDW;CmBvDd;;AAGD;EAEE,0BnBkDa;EmBjDb,sBnBiDa;CmBhDd;;AAED;;EAGE,0BAhCqF;EAiCrF,uBAAsB;EACtB,sBAlC2H;CAoC5H;;ADYD;EHQE,YAAW;EItDb,0BnBuEe;EmBtEf,sBnBsEe;CkBvBd;;AC5CD;EJkDE,YAAW;EIhDX,0BARqF;EASrF,sBAT2H;CAU5H;;AAED;EAMI,6CnBuDW;CmBrDd;;AAGD;EAEE,0BnBgDa;EmB/Cb,sBnB+Ca;CmB9Cd;;AAED;;EAGE,0BAhCqF;EAiCrF,uBAAsB;EACtB,sBAlC2H;CAoC5H;;ADYD;EHME,YAAW;EIpDb,0BnB4CgB;EmB3ChB,sBnB2CgB;CkBIf;;AC5CD;EJgDE,YAAW;EI9CX,0BARqF;EASrF,sBAT2H;CAU5H;;AAED;EAMI,+CnB4BY;CmB1Bf;;AAGD;EAEE,0BnBqBc;EmBpBd,sBnBoBc;CmBnBf;;AAED;;EAGE,0BAhCqF;EAiCrF,uBAAsB;EACtB,sBAlC2H;CAoC5H;;ADYD;EHQE,YAAW;EItDb,0BnBmDgB;EmBlDhB,sBnBkDgB;CkBHf;;AC5CD;EJkDE,YAAW;EIhDX,0BARqF;EASrF,sBAT2H;CAU5H;;AAED;EAMI,4CnBmCY;CmBjCf;;AAGD;EAEE,0BnB4Bc;EmB3Bd,sBnB2Bc;CmB1Bf;;AAED;;EAGE,0BAhCqF;EAiCrF,uBAAsB;EACtB,sBAlC2H;CAoC5H;;ADkBD;ECdA,enB6Be;EmB5Bf,8BAA6B;EAC7B,uBAAsB;EACtB,sBnB0Be;CkBbd;;AjBlDC;EkBwCA,YDS4C;ECR5C,0BnBsBa;EmBrBb,sBnBqBa;CC/DQ;;AkB6CvB;EAEE,6CnBgBa;CmBfd;;AAED;EAEE,enBWa;EmBVb,8BAA6B;CAC9B;;AAED;;EAGE,YDV4C;ECW5C,0BnBGa;EmBFb,sBnBEa;CmBDd;;ADdD;ECdA,enBWgB;EmBVhB,8BAA6B;EAC7B,uBAAsB;EACtB,sBnBQgB;CkBKf;;AjBlDC;EkBwCA,YDS4C;ECR5C,0BnBIc;EmBHd,sBnBGc;CC7CO;;AkB6CvB;EAEE,+CnBFc;CmBGf;;AAED;EAEE,enBPc;EmBQd,8BAA6B;CAC9B;;AAED;;EAGE,YDV4C;ECW5C,0BnBfc;EmBgBd,sBnBhBc;CmBiBf;;ADdD;ECdA,enBoCe;EmBnCf,8BAA6B;EAC7B,uBAAsB;EACtB,sBnBiCe;CkBpBd;;AjBlDC;EkBwCA,YDS4C;ECR5C,0BnB6Ba;EmB5Bb,sBnB4Ba;CCtEQ;;AkB6CvB;EAEE,6CnBuBa;CmBtBd;;AAED;EAEE,enBkBa;EmBjBb,8BAA6B;CAC9B;;AAED;;EAGE,YDV4C;ECW5C,0BnBUa;EmBTb,sBnBSa;CmBRd;;ADdD;ECdA,enBsCe;EmBrCf,8BAA6B;EAC7B,uBAAsB;EACtB,sBnBmCe;CkBtBd;;AjBlDC;EkBwCA,YDS4C;ECR5C,0BnB+Ba;EmB9Bb,sBnB8Ba;CCxEQ;;AkB6CvB;EAEE,8CnByBa;CmBxBd;;AAED;EAEE,enBoBa;EmBnBb,8BAA6B;CAC9B;;AAED;;EAGE,YDV4C;ECW5C,0BnBYa;EmBXb,sBnBWa;CmBVd;;ADdD;ECdA,enBmCe;EmBlCf,8BAA6B;EAC7B,uBAAsB;EACtB,sBnBgCe;CkBnBd;;AjBlDC;EkBwCA,YDS4C;ECR5C,0BnB4Ba;EmB3Bb,sBnB2Ba;CCrEQ;;AkB6CvB;EAEE,6CnBsBa;CmBrBd;;AAED;EAEE,enBiBa;EmBhBb,8BAA6B;CAC9B;;AAED;;EAGE,YDV4C;ECW5C,0BnBSa;EmBRb,sBnBQa;CmBPd;;ADdD;ECdA,enBiCe;EmBhCf,8BAA6B;EAC7B,uBAAsB;EACtB,sBnB8Be;CkBjBd;;AjBlDC;EkBwCA,YDS4C;ECR5C,0BnB0Ba;EmBzBb,sBnByBa;CCnEQ;;AkB6CvB;EAEE,6CnBoBa;CmBnBd;;AAED;EAEE,enBea;EmBdb,8BAA6B;CAC9B;;AAED;;EAGE,YDV4C;ECW5C,0BnBOa;EmBNb,sBnBMa;CmBLd;;ADdD;ECdA,enBMgB;EmBLhB,8BAA6B;EAC7B,uBAAsB;EACtB,sBnBGgB;CkBUf;;AjBlDC;EkBwCA,YDS4C;ECR5C,0BnBDc;EmBEd,sBnBFc;CCxCO;;AkB6CvB;EAEE,+CnBPc;CmBQf;;AAED;EAEE,enBZc;EmBad,8BAA6B;CAC9B;;AAED;;EAGE,YDV4C;ECW5C,0BnBpBc;EmBqBd,sBnBrBc;CmBsBf;;ADdD;ECdA,enBagB;EmBZhB,8BAA6B;EAC7B,uBAAsB;EACtB,sBnBUgB;CkBGf;;AjBlDC;EkBwCA,YDS4C;ECR5C,0BnBMc;EmBLd,sBnBKc;CC/CO;;AkB6CvB;EAEE,4CnBAc;CmBCf;;AAED;EAEE,enBLc;EmBMd,8BAA6B;CAC9B;;AAED;;EAGE,YDV4C;ECW5C,0BnBbc;EmBcd,sBnBdc;CmBef;;ADHH;EACE,oBlB0KyB;EkBzKzB,elBEe;EkBDf,iBAAgB;CA8BjB;;AAjCD;EASI,8BAA6B;CAE9B;;AAXH;EAeI,0BAAyB;EACzB,iBAAgB;CACjB;;AjB5EC;EiB8EA,0BAAyB;CjB9EJ;;AAWrB;EiBsEA,elB0E4C;EkBzE5C,2BlB0E6B;EkBzE7B,8BAA6B;CjBrE5B;;AiB6CL;EA2BI,elBzCc;CkB8Cf;;AjBhFC;EiB8EE,sBAAqB;CjB3EtB;;AiBqFL;EChCE,qBnBgQ8B;EmB/P9B,mBnB+JsB;EmB9JtB,iBnBkI0B;EM9MxB,sBNoN0B;CkBxG7B;;AAED;ECpCE,wBnB4P+B;EmB3P/B,oBnBgKsB;EmB/JtB,iBnBmI0B;EM/MxB,sBNqN0B;CkBrG7B;;AAOD;EACE,eAAc;EACd,YAAW;CACZ;;AAGD;EACE,mBlBsNoC;CkBrNrC;;AAGD;;;EAII,YAAW;CACZ;;AE3IH;EACE,WAAU;EbIN,iCP4NsC;CoB1N3C;;AAPD;EAKI,WAAU;CACX;;AAGH;EACE,cAAa;CAId;;AALD;EAGI,eAAc;CACf;;AAGH;EAEI,mBAAkB;CACnB;;AAGH;EAEI,yBAAwB;CACzB;;AAGH;EACE,mBAAkB;EAClB,UAAS;EACT,iBAAgB;Eb1BZ,8BP6NmC;CoBjMxC;;AChCD;;EAEE,mBAAkB;CACnB;;AAED;EAGI,sBAAqB;EACrB,SAAQ;EACR,UAAS;EACT,qBAA+B;EAC/B,wBAAkC;EAClC,YAAW;EACX,wBAA8B;EAC9B,sCAA4C;EAC5C,qCAA2C;CAC5C;;AAZH;EAeI,eAAc;CACf;;AAKH;EAEI,cAAa;EACb,wBrB+coC;CqB9crC;;AAJH;EAQM,cAAa;EACb,2BAAiC;CAClC;;AAKL;EACE,mBAAkB;EAClB,UAAS;EACT,QAAO;EACP,crB0d8B;EqBzd9B,cAAa;EACb,YAAW;EACX,iBrB0boC;EqBzbpC,kBAA8B;EAC9B,qBAA4B;EAC5B,gBrByLmB;EqBxLnB,erBMgB;EqBLhB,iBAAgB;EAChB,iBAAgB;EAChB,uBrBNW;EqBOX,6BAA4B;EAC5B,sCrBEW;EMxDT,uBNmN2B;CqB1J9B;;AAGD;EC3DE,UAAS;EACT,iBAAuB;EACvB,iBAAgB;EAChB,8BtB4CgB;CqBcjB;;AAKD;EACE,eAAc;EACd,YAAW;EACX,wBrBobqC;EqBnbrC,YAAW;EACX,oBrBqKyB;EqBpKzB,erBlBgB;EqBmBhB,oBAAmB;EACnB,oBAAmB;EACnB,iBAAgB;EAChB,UAAS;CAwBV;;ApBnFG;EoB8DA,erBiakD;EqBhalD,sBAAqB;EACrB,0BrBnCc;CC1Bb;;AoB8CL;EAoBI,YrBzCS;EqB0CT,sBAAqB;EACrB,0BrBnBa;CqBoBd;;AAvBH;EA2BI,erB1Cc;EqB2Cd,8BAA6B;CAK9B;;AAIH;EAGI,WAAU;CACX;;AAGH;EACE,eAAc;CACf;;AAGD;EACE,eAAc;EACd,uBrBoYqC;EqBnYrC,iBAAgB;EAChB,oBrBmHsB;EqBlHtB,erBrEgB;EqBsEhB,oBAAmB;CACpB;;AE5HD;;EAEE,mBAAkB;EAClB,4BAAoB;EAApB,qBAAoB;EACpB,uBAAsB;CA0BvB;;AA9BD;;EAOI,mBAAkB;EAClB,mBAAc;MAAd,eAAc;EACd,iBAAgB;CAYjB;;AArBH;;EAcM,WAAU;CtBNS;;AsBRzB;;;;EAmBM,WAAU;CACX;;AApBL;;;;;;;;EA4BI,kBvBsLc;CuBrLf;;AAIH;EACE,qBAAa;EAAb,cAAa;EACb,oBAAe;MAAf,gBAAe;EACf,qBAA2B;MAA3B,4BAA2B;CAK5B;;AARD;EAMI,YAAW;CACZ;;AAGH;EACE,iBAAgB;CACjB;;AAGD;EACE,eAAc;CAKf;;AAND;EjBlCI,2BiBsC8B;EjBrC9B,8BiBqC8B;CAC/B;;AAGH;;EjB5BI,0BiB8B2B;EjB7B3B,6BiB6B2B;CAC9B;;AAGD;EACE,YAAW;CACZ;;AACD;EACE,iBAAgB;CACjB;;AACD;;EjBtDI,2BiByD8B;EjBxD9B,8BiBwD8B;CAC/B;;AAEH;EjB9CI,0BiB+C2B;EjB9C3B,6BiB8C2B;CAC9B;;AAeD;EACE,yBAAyC;EACzC,wBAAwC;CAKzC;;AAPD;EAKI,eAAc;CACf;;AAGH;EACE,wBAA4C;EAC5C,uBAA2C;CAC5C;;AAED;EACE,uBAA4C;EAC5C,sBAA2C;CAC5C;;AAmBD;EACE,4BAAoB;EAApB,qBAAoB;EACpB,2BAAsB;MAAtB,uBAAsB;EACtB,sBAAuB;MAAvB,wBAAuB;EACvB,sBAAuB;MAAvB,wBAAuB;CAcxB;;AAlBD;;EAQI,YAAW;CACZ;;AATH;;;;EAeI,iBvBoEc;EuBnEd,eAAc;CACf;;AAGH;EAEI,iBAAgB;CACjB;;AAHH;EjB9HI,8BiBmI+B;EjBlI/B,6BiBkI+B;CAChC;;AANH;EjB5II,0BiBoJ4B;EjBnJ5B,2BiBmJ4B;CAC7B;;AAEH;EACE,iBAAgB;CACjB;;AACD;;EjB5II,8BiB+I+B;EjB9I/B,6BiB8I+B;CAChC;;AAEH;EjBhKI,0BiBiK0B;EjBhK1B,2BiBgK0B;CAC7B;;AzBu5ED;;;;EyBn4EM,mBAAkB;EAClB,uBAAmB;EACnB,qBAAoB;CACrB;;AC/LL;EACE,mBAAkB;EAClB,qBAAa;EAAb,cAAa;EACb,YAAW;CAkBZ;;AArBD;EAQI,mBAAkB;EAClB,WAAU;EACV,mBAAc;MAAd,eAAc;EAGd,UAAS;EACT,iBAAgB;CAMjB;;AApBH;EAkBM,WAAU;CvBmCX;;AuB9BL;;;EAIE,qBAAa;EAAb,cAAa;EACb,uBAAmB;MAAnB,oBAAmB;CAKpB;;AAVD;;;ElBvBI,iBkB+BwB;CACzB;;AAGH;;EAEE,oBAAmB;EACnB,uBAAsB;CACvB;;AAwBD;EACE,wBxBkQgC;EwBjQhC,iBAAgB;EAChB,gBxBuKmB;EwBtKnB,oBxB0KyB;EwBzKzB,kBxB+P8B;EwB9P9B,exBhBgB;EwBiBhB,mBAAkB;EAClB,0BxBvBgB;EwBwBhB,sCxBhBW;EMxDT,uBNmN2B;CwBpH9B;;AAhCD;;;EAcI,wBxByP6B;EwBxP7B,oBxB6JoB;EM3OpB,sBNqN0B;CwBrI3B;;AAjBH;;;EAoBI,qBxBuP4B;EwBtP5B,mBxBsJoB;EM1OpB,sBNoN0B;CwB9H3B;;AAvBH;;EA6BI,cAAa;CACd;;AASH;;;;;;;ElBzFI,2BkBgG4B;ElB/F5B,8BkB+F4B;CAC/B;;AACD;EACE,gBAAe;CAChB;;AACD;;;;;;;ElBvFI,0BkB8F2B;ElB7F3B,6BkB6F2B;CAC9B;;AACD;EACE,eAAc;CACf;;AAMD;EACE,mBAAkB;EAGlB,aAAY;EACZ,oBAAmB;CAmCpB;;AAxCD;EAUI,mBAAkB;CAUnB;;AApBH;EAaM,kBxBiEY;CwBhEb;;AAdL;EAkBM,WAAU;CvBhGX;;AuB8EL;;EA0BM,mBxBoDY;CwBnDb;;AA3BL;;EAgCM,WAAU;EACV,kBxB6CY;CwBxCb;;AAtCL;;;;EAoCQ,WAAU;CvBlHb;;AwB9CL;EACE,mBAAkB;EAClB,4BAAoB;EAApB,qBAAoB;EACpB,mBAAsC;EACtC,qBzBmY8B;EyBlY9B,mBzBoY4B;CyBnY7B;;AAED;EACE,mBAAkB;EAClB,YAAW;EACX,WAAU;CA4BX;;AA/BD;EAMI,YzByBS;EyBxBT,0BzBgDa;CyB9Cd;;AATH;EAaI,8CzB0Ca;CyBzCd;;AAdH;EAiBI,YzBcS;EyBbT,0BzBgY6E;CyB9X9E;;AApBH;EAwBM,0BzBSY;CyBRb;;AAzBL;EA4BM,ezBSY;CyBRb;;AAQL;EACE,mBAAkB;EAClB,aAA+D;EAC/D,QAAO;EACP,eAAc;EACd,YzByVwC;EyBxVxC,azBwVwC;EyBvVxC,qBAAoB;EACpB,0BAAiB;KAAjB,uBAAiB;MAAjB,sBAAiB;UAAjB,kBAAiB;EACjB,uBzBsVwC;EyBrVxC,6BAA4B;EAC5B,mCAAkC;EAClC,yBzBoV2C;CyBlV5C;;AAMD;EnBxEI,uBNmN2B;CyBxI5B;;AAHH;EAMI,2NVtCuI;CUuCxI;;AAPH;EAUI,0BzBZa;EyBab,wKV3CuI;CU6CxI;;AAOH;EAEI,mBzB8UsC;CyB7UvC;;AAHH;EAMI,qKV1DuI;CU2DxI;;AASH;EACE,qBAAa;EAAb,cAAa;EACb,2BAAsB;MAAtB,uBAAsB;CASvB;;AAXD;EAKI,uBzB8R4B;CyBzR7B;;AAVH;EAQM,eAAc;CACf;;AAWL;EACE,sBAAqB;EACrB,gBAAe;EACf,4BzBmPoF;EyBlPpF,2CzB4SuC;EyB3SvC,kBzB8L8B;EyB7L9B,ezBjFgB;EyBkFhB,uBAAsB;EACtB,oNAAsG;EACtG,0BzB+SoC;EyB9SpC,sCzBlFW;EyBoFT,uBzBuE2B;EyBnE7B,yBAAgB;KAAhB,sBAAgB;UAAhB,iBAAgB;CA2BjB;;AA3CD;EAmBI,sBzB4SmE;EyB3SnE,cAAa;CAYd;;AAhCH;EA6BM,ezBxGY;EyByGZ,uBzBhHO;CyBiHR;;AA/BL;EAmCI,ezB/Gc;EyBgHd,0BzBpHc;CyBqHf;;AArCH;EAyCI,WAAU;CACX;;AAGH;EACE,8BzB2MuF;EyB1MvF,sBzBgQwC;EyB/PxC,yBzB+PwC;EyB9PxC,ezBiR+B;CyBhRhC;;AAOD;EACE,mBAAkB;EAClB,sBAAqB;EACrB,gBAAe;EACf,ezBwQmC;EyBvQnC,iBAAgB;CACjB;;AAED;EACE,iBzBoQkC;EyBnQlC,gBAAe;EACf,ezBiQmC;EyBhQnC,UAAS;EACT,WAAU;CAKX;;AAED;EACE,mBAAkB;EAClB,OAAM;EACN,SAAQ;EACR,QAAO;EACP,WAAU;EACV,ezBkPmC;EyBjPnC,qBzBqP8B;EyBpP9B,iBzBsP6B;EyBrP7B,ezBjKgB;EyBkKhB,qBAAoB;EACpB,0BAAiB;KAAjB,uBAAiB;MAAjB,sBAAiB;UAAjB,kBAAiB;EACjB,uBzB3KW;EyB4KX,sCzBlKW;EMxDT,uBNmN2B;CyBsC9B;;AA5CD;EAmBM,0BzBsPkB;CyBrPnB;;AApBL;EAwBI,mBAAkB;EAClB,UzBrBc;EyBsBd,YzBtBc;EyBuBd,azBvBc;EyBwBd,WAAU;EACV,eAAc;EACd,ezB0NiC;EyBzNjC,qBzB6N4B;EyB5N5B,iBzB8N2B;EyB7N3B,ezBzLc;EyB0Ld,0BzB/Lc;EyBgMd,sCzBxLS;EMxDT,mCmBiPgF;CACjF;;AArCH;EAyCM,kBzBmOU;CyBlOX;;ACtPL;EACE,qBAAa;EAAb,cAAa;EACb,oBAAe;MAAf,gBAAe;EACf,gBAAe;EACf,iBAAgB;EAChB,iBAAgB;CACjB;;AAED;EACE,eAAc;EACd,qB1BogBkC;C0B1fnC;;AzBHG;EyBJA,sBAAqB;CzBOpB;;AyBZL;EAUI,e1BiCc;C0BhCf;;AAOH;EACE,8B1BsfgD;C0BpdjD;;AAnCD;EAII,oB1BkLc;C0BjLf;;AALH;EAQI,8BAAgD;EpB7BhD,gCN6M2B;EM5M3B,iCN4M2B;C0BpK5B;;AApBH;EAYM,mC1B2e4C;CC7f7C;;AyBML;EAgBM,e1BSY;E0BRZ,8BAA6B;EAC7B,0BAAyB;CAC1B;;AAnBL;;EAwBI,e1BEc;E0BDd,uB1BNS;E0BOT,6B1BPS;C0BQV;;AA3BH;EA+BI,iB1BuJc;EM3Md,0BoBsD4B;EpBrD5B,2BoBqD4B;CAC7B;;AAQH;EpBrEI,uBNmN2B;C0BrI5B;;AATH;;EAMM,Y1B7BO;E0B8BP,0B1BNW;C0BOZ;;AASL;EAEI,mBAAc;MAAd,eAAc;EACd,mBAAkB;CACnB;;AAGH;EAEI,2BAAa;MAAb,cAAa;EACb,qBAAY;MAAZ,aAAY;EACZ,mBAAkB;CACnB;;AAQH;EAEI,cAAa;CACd;;AAHH;EAKI,eAAc;CACf;;ACnGH;EACE,mBAAkB;EAClB,qBAAa;EAAb,cAAa;EACb,oBAAe;MAAf,gBAAe;EACf,uBAAmB;MAAnB,oBAAmB;EACnB,uBAA8B;MAA9B,+BAA8B;EAC9B,qB3BgHW;C2BrGZ;;AAjBD;;EAYI,qBAAa;EAAb,cAAa;EACb,oBAAe;MAAf,gBAAe;EACf,uBAAmB;MAAnB,oBAAmB;EACnB,uBAA8B;MAA9B,+BAA8B;CAC/B;;AAQH;EACE,sBAAqB;EACrB,uB3BggB+E;E2B/f/E,0B3B+f+E;E2B9f/E,mB3B0FW;E2BzFX,mB3BgMsB;E2B/LtB,qBAAoB;EACpB,oBAAmB;CAKpB;;A1B/BG;E0B6BA,sBAAqB;C1B1BpB;;A0BmCL;EACE,qBAAa;EAAb,cAAa;EACb,2BAAsB;MAAtB,uBAAsB;EACtB,gBAAe;EACf,iBAAgB;EAChB,iBAAgB;CAWjB;;AAhBD;EAQI,iBAAgB;EAChB,gBAAe;CAChB;;AAVH;EAaI,iBAAgB;EAChB,YAAW;CACZ;;AAQH;EACE,sBAAqB;EACrB,oB3B6bmC;E2B5bnC,uB3B4bmC;C2B3bpC;;AAWD;EACE,8BAAgB;MAAhB,iBAAgB;EAGhB,uBAAmB;MAAnB,oBAAmB;CACpB;;AAGD;EACE,yB3BmcyC;E2BlczC,mB3BkIsB;E2BjItB,eAAc;EACd,wBAAuB;EACvB,8BAAuC;ErB3GrC,uBNmN2B;C2BlG9B;;A1B/FG;E0B6FA,sBAAqB;C1B1FpB;;A0BgGL;EACE,sBAAqB;EACrB,aAAY;EACZ,cAAa;EACb,uBAAsB;EACtB,YAAW;EACX,oCAAmC;EACnC,2BAA0B;CAC3B;;AhB5DG;EgBqEA;;IAIM,iBAAgB;IAChB,gBAAe;GAChB;C7B46FR;;AapgGG;EgBkFA;IAUI,wBAAmB;QAAnB,oBAAmB;IACnB,sBAAiB;QAAjB,kBAAiB;IACjB,qBAA2B;QAA3B,4BAA2B;GAoC9B;EAhDD;IAeM,wBAAmB;QAAnB,oBAAmB;GAepB;EA9BL;IAkBQ,mBAAkB;GACnB;EAnBP;IAsBQ,SAAQ;IACR,WAAU;GACX;EAxBP;IA2BQ,qBAAoB;IACpB,oBAAmB;GACpB;EA7BP;;IAmCM,sBAAiB;QAAjB,kBAAiB;GAClB;EApCL;IAwCM,gCAAwB;IAAxB,yBAAwB;GACzB;EAzCL;IA6CM,cAAa;GACd;C7Bo6FR;;AavhGG;EgBqEA;;IAIM,iBAAgB;IAChB,gBAAe;GAChB;C7Bo9FR;;Aa5iGG;EgBkFA;IAUI,wBAAmB;QAAnB,oBAAmB;IACnB,sBAAiB;QAAjB,kBAAiB;IACjB,qBAA2B;QAA3B,4BAA2B;GAoC9B;EAhDD;IAeM,wBAAmB;QAAnB,oBAAmB;GAepB;EA9BL;IAkBQ,mBAAkB;GACnB;EAnBP;IAsBQ,SAAQ;IACR,WAAU;GACX;EAxBP;IA2BQ,qBAAoB;IACpB,oBAAmB;GACpB;EA7BP;;IAmCM,sBAAiB;QAAjB,kBAAiB;GAClB;EApCL;IAwCM,gCAAwB;IAAxB,yBAAwB;GACzB;EAzCL;IA6CM,cAAa;GACd;C7B48FR;;Aa/jGG;EgBqEA;;IAIM,iBAAgB;IAChB,gBAAe;GAChB;C7B4/FR;;AaplGG;EgBkFA;IAUI,wBAAmB;QAAnB,oBAAmB;IACnB,sBAAiB;QAAjB,kBAAiB;IACjB,qBAA2B;QAA3B,4BAA2B;GAoC9B;EAhDD;IAeM,wBAAmB;QAAnB,oBAAmB;GAepB;EA9BL;IAkBQ,mBAAkB;GACnB;EAnBP;IAsBQ,SAAQ;IACR,WAAU;GACX;EAxBP;IA2BQ,qBAAoB;IACpB,oBAAmB;GACpB;EA7BP;;IAmCM,sBAAiB;QAAjB,kBAAiB;GAClB;EApCL;IAwCM,gCAAwB;IAAxB,yBAAwB;GACzB;EAzCL;IA6CM,cAAa;GACd;C7Bo/FR;;AavmGG;EgBqEA;;IAIM,iBAAgB;IAChB,gBAAe;GAChB;C7BoiGR;;Aa5nGG;EgBkFA;IAUI,wBAAmB;QAAnB,oBAAmB;IACnB,sBAAiB;QAAjB,kBAAiB;IACjB,qBAA2B;QAA3B,4BAA2B;GAoC9B;EAhDD;IAeM,wBAAmB;QAAnB,oBAAmB;GAepB;EA9BL;IAkBQ,mBAAkB;GACnB;EAnBP;IAsBQ,SAAQ;IACR,WAAU;GACX;EAxBP;IA2BQ,qBAAoB;IACpB,oBAAmB;GACpB;EA7BP;;IAmCM,sBAAiB;QAAjB,kBAAiB;GAClB;EApCL;IAwCM,gCAAwB;IAAxB,yBAAwB;GACzB;EAzCL;IA6CM,cAAa;GACd;C7B4hGR;;A6B/kGD;EAeQ,wBAAmB;MAAnB,oBAAmB;EACnB,sBAAiB;MAAjB,kBAAiB;EACjB,qBAA2B;MAA3B,4BAA2B;CAoC9B;;AArDL;;EASU,iBAAgB;EAChB,gBAAe;CAChB;;AAXT;EAoBU,wBAAmB;MAAnB,oBAAmB;CAepB;;AAnCT;EAuBY,mBAAkB;CACnB;;AAxBX;EA2BY,SAAQ;EACR,WAAU;CACX;;AA7BX;EAgCY,qBAAoB;EACpB,oBAAmB;CACpB;;AAlCX;;EAwCU,sBAAiB;MAAjB,kBAAiB;CAClB;;AAzCT;EA6CU,gCAAwB;EAAxB,yBAAwB;CACzB;;AA9CT;EAkDU,cAAa;CACd;;AAYT;EAEI,0B3B1IS;C2B+IV;;AAPH;EAKM,0B3B7IO;CCnCR;;A0B2KL;EAWM,0B3BnJO;C2B4JR;;AApBL;EAcQ,0B3BtJK;CCnCR;;A0B2KL;EAkBQ,0B3B1JK;C2B2JN;;AAnBP;;;;EA0BM,0B3BlKO;C2BmKR;;AA3BL;EA+BI,0B3BvKS;E2BwKT,iC3BxKS;C2ByKV;;AAjCH;EAoCI,sQ3BqV8R;C2BpV/R;;AArCH;EAwCI,0B3BhLS;C2BiLV;;AAIH;EAEI,a3BjMS;C2BsMV;;AAPH;EAKM,a3BpMO;CCzBR;;A0BwNL;EAWM,gC3B1MO;C2BmNR;;AApBL;EAcQ,iC3B7MK;CCzBR;;A0BwNL;EAkBQ,iC3BjNK;C2BkNN;;AAnBP;;;;EA0BM,a3BzNO;C2B0NR;;AA3BL;EA+BI,gC3B9NS;E2B+NT,uC3B/NS;C2BgOV;;AAjCH;EAoCI,4Q3BiS4R;C2BhS7R;;AArCH;EAwCI,gC3BvOS;C2BwOV;;ACtRH;EACE,mBAAkB;EAClB,qBAAa;EAAb,cAAa;EACb,2BAAsB;MAAtB,uBAAsB;EACtB,aAAY;EACZ,sBAAqB;EACrB,uB5BwCW;E4BvCX,4BAA2B;EAC3B,uC5BgDW;EMxDT,uBNmN2B;C4BzM9B;;AAED;EAGE,mBAAc;MAAd,eAAc;EACd,iB5BilBgC;C4BhlBjC;;AAED;EACE,uB5B4kB+B;C4B3kBhC;;AAED;EACE,sBAAgC;EAChC,iBAAgB;CACjB;;AAED;EACE,iBAAgB;CACjB;;A3BvBG;E2B2BA,sBAAqB;C3B3BA;;A2ByBzB;EAMI,qB5B2jB8B;C4B1jB/B;;AAGH;EtBpCI,gCN6M2B;EM5M3B,iCN4M2B;C4BrK1B;;AAJL;EtBtBI,oCN+L2B;EM9L3B,mCN8L2B;C4B/J1B;;AASL;EACE,yB5BmiBgC;E4BliBhC,iBAAgB;EAChB,sC5BRW;E4BSX,8C5BTW;C4BcZ;;AATD;EtB7DI,2DsBoE8E;CAC/E;;AAGH;EACE,yB5BwhBgC;E4BvhBhC,sC5BlBW;E4BmBX,2C5BnBW;C4BwBZ;;AARD;EtBxEI,2DNqmB2E;C4BthB5E;;AAQH;EACE,wBAAkC;EAClC,wB5BugB+B;E4BtgB/B,uBAAiC;EACjC,iBAAgB;CACjB;;AAED;EACE,wBAAkC;EAClC,uBAAiC;CAClC;;AAGD;EACE,mBAAkB;EAClB,OAAM;EACN,SAAQ;EACR,UAAS;EACT,QAAO;EACP,iB5B+fgC;C4B9fjC;;AAED;EACE,YAAW;EtB9GT,mCNqmB2E;C4Brf9E;;AAGD;EACE,YAAW;EtB9GT,4CN+lB2E;EM9lB3E,6CN8lB2E;C4B/e9E;;AAED;EACE,YAAW;EtBrGT,gDNilB2E;EMhlB3E,+CNglB2E;C4B1e9E;;AjBvEG;EiB6EF;IACE,qBAAa;IAAb,cAAa;IACb,wBAAmB;QAAnB,oBAAmB;IACnB,oB5BuegD;I4BtehD,mB5BsegD;G4B7djD;EAbD;IAOI,qBAAa;IAAb,cAAa;IACb,iBAAY;QAAZ,aAAY;IACZ,2BAAsB;QAAtB,uBAAsB;IACtB,mB5Bge8C;I4B/d9C,kB5B+d8C;G4B9d/C;C9ByzGJ;;Aal5GG;EiBmGF;IACE,qBAAa;IAAb,cAAa;IACb,wBAAmB;QAAnB,oBAAmB;GA2CpB;EA7CD;IAKI,iBAAY;QAAZ,aAAY;GAuCb;EA5CH;IAQM,eAAc;IACd,eAAc;GACf;EAVL;ItB1IE,2BsByJoC;ItBxJpC,8BsBwJoC;GAQ/B;EAvBP;IAkBU,2BAA0B;GAC3B;EAnBT;IAqBU,8BAA6B;GAC9B;EAtBT;ItB5HE,0BsBqJmC;ItBpJnC,6BsBoJmC;GAQ9B;EAjCP;IA4BU,0BAAyB;GAC1B;EA7BT;IA+BU,6BAA4B;GAC7B;EAhCT;IAoCQ,iBAAgB;GAMjB;EA1CP;;IAwCU,iBAAgB;GACjB;C9B+yGV;;A8BnyGD;EAEI,uB5BkZ6B;C4BjZ9B;;AjB3JC;EiBwJJ;IAMI,wB5B2ZyB;Y4B3ZzB,gB5B2ZyB;I4B1ZzB,4B5B2Z+B;Y4B3Z/B,oB5B2Z+B;G4BpZlC;EAdD;IAUM,sBAAqB;IACrB,YAAW;GACZ;C9BsyGJ;;A+BlgHD;EACE,sB7BixBkC;E6BhxBlC,oBAAmB;EACnB,iBAAgB;EAChB,0B7BgDgB;EMhDd,uBNmN2B;C6BhN9B;;ACNC;EACE,eAAc;EACd,YAAW;EACX,YAAW;CACZ;;ADIH;EACE,YAAW;CA2BZ;;AA5BD;EAKI,sBAAqB;EACrB,sB7BowBiC;E6BnwBjC,qB7BmwBiC;E6BlwBjC,e7BuCc;E6BtCd,aAAiC;CAClC;;AAVH;EAmBI,2BAA0B;CAC3B;;AApBH;EAsBI,sBAAqB;CACtB;;AAvBH;EA0BI,e7BqBc;C6BpBf;;AEpCH;EACE,qBAAa;EAAb,cAAa;EAEb,gBAAe;EACf,iBAAgB;EzBAd,uBNmN2B;C+BjN9B;;AAED;EAGM,eAAc;EzBoBhB,gCNwL2B;EMvL3B,mCNuL2B;C+B1M1B;;AALL;EzBSI,iCNsM2B;EMrM3B,oCNqM2B;C+BrM1B;;AAVL;EAcI,WAAU;EACV,Y/B2BS;E+B1BT,0B/BkDa;E+BjDb,sB/BiDa;C+BhDd;;AAlBH;EAqBI,e/B2Bc;E+B1Bd,qBAAoB;EACpB,uB/BmBS;E+BlBT,mB/ByjBuC;C+BxjBxC;;AAGH;EACE,mBAAkB;EAClB,eAAc;EACd,wB/B4hB0C;E+B3hB1C,kBAAiB;EACjB,kB/B+hBwC;E+B9hBxC,e/BgCe;E+B/Bf,uB/BOW;E+BNX,uB/BiiByC;C+BzhB1C;;A9B9BG;E8ByBA,e/BuH4C;E+BtH5C,sBAAqB;EACrB,0B/BGc;E+BFd,mB/B+hBuC;CCxjBtC;;A+BtBH;EACE,wBhCmkBwC;EgClkBxC,mBhCyOoB;EgCxOpB,iBhC4MwB;CgC3MzB;;AAIG;E1BoBF,+BNyL0B;EMxL1B,kCNwL0B;CgC3MvB;;AAGD;E1BCF,gCNuM0B;EMtM1B,mCNsM0B;CgCtMvB;;AAfL;EACE,wBhCikBuC;EgChkBvC,oBhC0OoB;EgCzOpB,iBhC6MwB;CgC5MzB;;AAIG;E1BoBF,+BN0L0B;EMzL1B,kCNyL0B;CgC5MvB;;AAGD;E1BCF,gCNwM0B;EMvM1B,mCNuM0B;CgCvMvB;;ACbP;EACE,sBAAqB;EACrB,sBjC+pBgC;EiC9pBhC,ejC2pB+B;EiC1pB/B,kBjCyOqB;EiCxOrB,eAAc;EACd,YjCuCW;EiCtCX,mBAAkB;EAClB,oBAAmB;EACnB,yBAAwB;E3BVtB,uBNmN2B;CiClM9B;;AAhBD;EAcI,cAAa;CACd;;AAIH;EACE,mBAAkB;EAClB,UAAS;CACV;;AAMD;EACE,qBjCsoBgC;EiCroBhC,oBjCqoBgC;EMpqB9B,qBNuqB+B;CiCtoBlC;;AAOC;ElBiBE,YAAW;EmB3Db,0BlCwEe;CiC5Bd;;AhCxBC;EcuCA,YAAW;EmBtDT,sBAAqB;EACrB,0BAAkC;CjCiBnC;;AgCmBH;ElBiBE,YAAW;EmB3Db,0BlCsDgB;CiCVf;;AhCxBC;EcuCA,YAAW;EmBtDT,sBAAqB;EACrB,0BAAkC;CjCiBnC;;AgCmBH;ElBiBE,YAAW;EmB3Db,0BlC+Ee;CiCnCd;;AhCxBC;EcuCA,YAAW;EmBtDT,sBAAqB;EACrB,0BAAkC;CjCiBnC;;AgCmBH;ElBiBE,YAAW;EmB3Db,0BlCiFe;CiCrCd;;AhCxBC;EcuCA,YAAW;EmBtDT,sBAAqB;EACrB,0BAAkC;CjCiBnC;;AgCmBH;ElBeE,YAAW;EmBzDb,0BlC8Ee;CiClCd;;AhCxBC;EcqCA,YAAW;EmBpDT,sBAAqB;EACrB,0BAAkC;CjCiBnC;;AgCmBH;ElBiBE,YAAW;EmB3Db,0BlC4Ee;CiChCd;;AhCxBC;EcuCA,YAAW;EmBtDT,sBAAqB;EACrB,0BAAkC;CjCiBnC;;AgCmBH;ElBeE,YAAW;EmBzDb,0BlCiDgB;CiCLf;;AhCxBC;EcqCA,YAAW;EmBpDT,sBAAqB;EACrB,0BAAkC;CjCiBnC;;AgCmBH;ElBiBE,YAAW;EmB3Db,0BlCwDgB;CiCZf;;AhCxBC;EcuCA,YAAW;EmBtDT,sBAAqB;EACrB,0BAAkC;CjCiBnC;;AkCzBL;EACE,mBAAoD;EACpD,oBnC4lBmC;EmC3lBnC,0BnCiDgB;EMhDd,sBNoN0B;CmC/M7B;;AxB+CG;EwBxDJ;IAOI,mBnCulBiC;GmCrlBpC;CrCkvHA;;AqChvHD;EACE,iBAAgB;EAChB,gBAAe;E7BTb,iB6BUsB;CACzB;;ACXD;EACE,yBpC6sBmC;EoC5sBnC,oBpC6sBgC;EoC5sBhC,8BAA6C;E9BH3C,uBNmN2B;CoC9M9B;;AAGD;EAEE,eAAc;CACf;;AAGD;EACE,kBpC+NqB;CoC9NtB;;AAOD;EAGI,mBAAkB;EAClB,cpCkrBgC;EoCjrBhC,gBpCkrBiC;EoCjrBjC,yBpCirBiC;EoChrBjC,eAAc;CACf;;AASD;EC3CA,etBsFkE;EsBrFlE,0BtBmFuE;EsBlFvE,sBtBkFuE;CqBvCtE;;ACzCD;EACE,0BAAqC;CACtC;;AAED;EACE,eAA0B;CAC3B;;ADiCD;EC3CA,etBsFkE;EsBrFlE,0BtBmFuE;EsBlFvE,sBtBkFuE;CqBvCtE;;ACzCD;EACE,0BAAqC;CACtC;;AAED;EACE,eAA0B;CAC3B;;ADiCD;EC3CA,etBsFkE;EsBrFlE,0BtBmFuE;EsBlFvE,sBtBkFuE;CqBvCtE;;ACzCD;EACE,0BAAqC;CACtC;;AAED;EACE,eAA0B;CAC3B;;ADiCD;EC3CA,etBsFkE;EsBrFlE,0BtBmFuE;EsBlFvE,sBtBkFuE;CqBvCtE;;ACzCD;EACE,0BAAqC;CACtC;;AAED;EACE,eAA0B;CAC3B;;ADiCD;EC3CA,etBsFkE;EsBrFlE,0BtBmFuE;EsBlFvE,sBtBkFuE;CqBvCtE;;ACzCD;EACE,0BAAqC;CACtC;;AAED;EACE,eAA0B;CAC3B;;ADiCD;EC3CA,etBsFkE;EsBrFlE,0BtBmFuE;EsBlFvE,sBtBkFuE;CqBvCtE;;ACzCD;EACE,0BAAqC;CACtC;;AAED;EACE,eAA0B;CAC3B;;ADiCD;EC3CA,etBsFkE;EsBrFlE,0BtBmFuE;EsBlFvE,sBtBkFuE;CqBvCtE;;ACzCD;EACE,0BAAqC;CACtC;;AAED;EACE,eAA0B;CAC3B;;ADiCD;EC3CA,etBsFkE;EsBrFlE,0BtBmFuE;EsBlFvE,sBtBkFuE;CqBvCtE;;ACzCD;EACE,0BAAqC;CACtC;;AAED;EACE,eAA0B;CAC3B;;ACXH;EACE;IAAO,4BAAuC;GxC44H7C;EwC34HD;IAAK,yBAAwB;GxC84H5B;CACF;;AwCj5HD;EACE;IAAO,4BAAuC;GxC44H7C;EwC34HD;IAAK,yBAAwB;GxC84H5B;CACF;;AwC54HD;EACE,qBAAa;EAAb,cAAa;EACb,iBAAgB;EAChB,mBtCotBoC;EsCntBpC,kBtCktBkC;EsCjtBlC,mBAAkB;EAClB,0BtCyCgB;EMhDd,uBNmN2B;CsCzM9B;;AAED;EACE,atC0sBkC;EsCzsBlC,kBtCysBkC;EsCxsBlC,YtC+BW;EsC9BX,0BtCsDe;EOrEX,4BP8tBwC;CsC7sB7C;;AAED;ECWE,sMAA6I;EDT7I,2BtCisBkC;CsChsBnC;;AAED;EACE,2DtCosBgD;UsCpsBhD,mDtCosBgD;CsCnsBjD;;AE/BD;EACE,qBAAa;EAAb,cAAa;EACb,sBAAuB;MAAvB,wBAAuB;CACxB;;AAED;EACE,YAAO;MAAP,QAAO;CACR;;ACHD;EACE,qBAAa;EAAb,cAAa;EACb,2BAAsB;MAAtB,uBAAsB;EAGtB,gBAAe;EACf,iBAAgB;CACjB;;AAQD;EACE,YAAW;EACX,ezCoCgB;EyCnChB,oBAAmB;CAapB;;AxCbG;EwCIA,ezC+Bc;EyC9Bd,sBAAqB;EACrB,0BzCuBc;CC1Bb;;AwCNL;EAaI,ezC2Bc;EyC1Bd,0BzCmBc;CyClBf;;AAQH;EACE,mBAAkB;EAClB,eAAc;EACd,yBzCgsBsC;EyC9rBtC,oBzCsKgB;EyCrKhB,uBzCEW;EyCDX,uCzCWW;CyCiBZ;;AAnCD;EnChCI,gCN6M2B;EM5M3B,iCN4M2B;CyClK5B;;AAXH;EAcI,iBAAgB;EnChChB,oCN+L2B;EM9L3B,mCN8L2B;CyC7J5B;;AxCpCC;EwCuCA,sBAAqB;CxCpCpB;;AwCiBL;EAwBI,ezCVc;EyCWd,uBzCjBS;CyCkBV;;AA1BH;EA8BI,WAAU;EACV,YzCvBS;EyCwBT,0BzCAa;EyCCb,sBzCDa;CyCEd;;AASH;EAEI,gBAAe;EACf,eAAc;EACd,iBAAgB;CACjB;;AALH;EASM,cAAa;CACd;;AAVL;EAeM,iBAAgB;CACjB;;AClGH;EACE,e3BmFgE;E2BlFhE,0B3BgFqE;C2B/EtE;;AAGD;;EAEE,e3B4EgE;C2BhEjE;;AzCDC;;;EyCRE,e3ByE8D;E2BxE9D,0BAAyC;CzCU1C;;AyChBH;;EAUI,YAAW;EACX,0B3BmE8D;E2BlE9D,sB3BkE8D;C2BjE/D;;AAnBH;EACE,e3BmFgE;E2BlFhE,0B3BgFqE;C2B/EtE;;AAGD;;EAEE,e3B4EgE;C2BhEjE;;AzCDC;;;EyCRE,e3ByE8D;E2BxE9D,0BAAyC;CzCU1C;;AyChBH;;EAUI,YAAW;EACX,0B3BmE8D;E2BlE9D,sB3BkE8D;C2BjE/D;;AAnBH;EACE,e3BmFgE;E2BlFhE,0B3BgFqE;C2B/EtE;;AAGD;;EAEE,e3B4EgE;C2BhEjE;;AzCDC;;;EyCRE,e3ByE8D;E2BxE9D,0BAAyC;CzCU1C;;AyChBH;;EAUI,YAAW;EACX,0B3BmE8D;E2BlE9D,sB3BkE8D;C2BjE/D;;AAnBH;EACE,e3BmFgE;E2BlFhE,0B3BgFqE;C2B/EtE;;AAGD;;EAEE,e3B4EgE;C2BhEjE;;AzCDC;;;EyCRE,e3ByE8D;E2BxE9D,0BAAyC;CzCU1C;;AyChBH;;EAUI,YAAW;EACX,0B3BmE8D;E2BlE9D,sB3BkE8D;C2BjE/D;;AAnBH;EACE,e3BmFgE;E2BlFhE,0B3BgFqE;C2B/EtE;;AAGD;;EAEE,e3B4EgE;C2BhEjE;;AzCDC;;;EyCRE,e3ByE8D;E2BxE9D,0BAAyC;CzCU1C;;AyChBH;;EAUI,YAAW;EACX,0B3BmE8D;E2BlE9D,sB3BkE8D;C2BjE/D;;AAnBH;EACE,e3BmFgE;E2BlFhE,0B3BgFqE;C2B/EtE;;AAGD;;EAEE,e3B4EgE;C2BhEjE;;AzCDC;;;EyCRE,e3ByE8D;E2BxE9D,0BAAyC;CzCU1C;;AyChBH;;EAUI,YAAW;EACX,0B3BmE8D;E2BlE9D,sB3BkE8D;C2BjE/D;;AAnBH;EACE,e3BmFgE;E2BlFhE,0B3BgFqE;C2B/EtE;;AAGD;;EAEE,e3B4EgE;C2BhEjE;;AzCDC;;;EyCRE,e3ByE8D;E2BxE9D,0BAAyC;CzCU1C;;AyChBH;;EAUI,YAAW;EACX,0B3BmE8D;E2BlE9D,sB3BkE8D;C2BjE/D;;AAnBH;EACE,e3BmFgE;E2BlFhE,0B3BgFqE;C2B/EtE;;AAGD;;EAEE,e3B4EgE;C2BhEjE;;AzCDC;;;EyCRE,e3ByE8D;E2BxE9D,0BAAyC;CzCU1C;;AyChBH;;EAUI,YAAW;EACX,0B3BmE8D;E2BlE9D,sB3BkE8D;C2BjE/D;;ACtBL;EACE,aAAY;EACZ,kB3CizBiD;E2ChzBjD,kB3C+OqB;E2C9OrB,eAAc;EACd,Y3CuDW;E2CtDX,0B3C4CW;E2C3CX,YAAW;CAOZ;;A1CQG;E0CZA,Y3CkDS;E2CjDT,sBAAqB;EACrB,aAAY;C1CaX;;A0CHL;EACE,WAAU;EACV,wBAAuB;EACvB,UAAS;EACT,yBAAwB;CACzB;;ACpBD;EACE,iBAAgB;CACjB;;AAGD;EACE,gBAAe;EACf,OAAM;EACN,SAAQ;EACR,UAAS;EACT,QAAO;EACP,c5C0f8B;E4Czf9B,cAAa;EACb,iBAAgB;EAGhB,WAAU;CAWX;;AAtBD;ErCPM,4CPqsB8C;EOrsB9C,oCPqsB8C;EOrsB9C,qEPqsB8C;E4C3qBhD,sCAA6B;UAA7B,8BAA6B;CAC9B;;AApBH;EAqByB,mCAA0B;UAA1B,2BAA0B;CAAI;;AAEvD;EACE,mBAAkB;EAClB,iBAAgB;CACjB;;AAGD;EACE,mBAAkB;EAClB,YAAW;EACX,a5CuoBgC;C4CtoBjC;;AAGD;EACE,mBAAkB;EAClB,qBAAa;EAAb,cAAa;EACb,2BAAsB;MAAtB,uBAAsB;EACtB,uB5CFW;E4CGX,6BAA4B;EAC5B,qC5CMW;EMxDT,sBNoN0B;E4C9J5B,WAAU;CACX;;AAGD;EACE,gBAAe;EACf,OAAM;EACN,SAAQ;EACR,UAAS;EACT,QAAO;EACP,c5Cuc8B;E4Ctc9B,uB5CTW;C4CcZ;;AAZD;EAUW,WAAU;CAAK;;AAV1B;EAWW,a5CsnBqB;C4CtnBe;;AAK/C;EACE,qBAAa;EAAb,cAAa;EACb,uBAAmB;MAAnB,oBAAmB;EACnB,uBAA8B;MAA9B,+BAA8B;EAC9B,c5CknBgC;E4CjnBhC,iC5C/BgB;C4CgCjB;;AAGD;EACE,iBAAgB;EAChB,iB5C4JoB;C4C3JrB;;AAID;EACE,mBAAkB;EAGlB,mBAAc;MAAd,eAAc;EACd,c5C8kBgC;C4C7kBjC;;AAGD;EACE,qBAAa;EAAb,cAAa;EACb,uBAAmB;MAAnB,oBAAmB;EACnB,mBAAyB;MAAzB,0BAAyB;EACzB,c5CskBgC;E4CrkBhC,8B5CxDgB;C4C6DjB;;AAVD;EAQyB,oBAAmB;CAAK;;AARjD;EASwB,qBAAoB;CAAK;;AAIjD;EACE,mBAAkB;EAClB,aAAY;EACZ,YAAW;EACX,aAAY;EACZ,iBAAgB;CACjB;;AjClEG;EiCuEF;IACE,iB5CukB+B;I4CtkB/B,kBAAyC;GAC1C;EAMD;IAAY,iB5CgkBqB;G4ChkBG;C9CosIrC;;AapxIG;EiCoFF;IAAY,iB5C0jBqB;G4C1jBG;C9CssIrC;;A+Cj1ID;EACE,mBAAkB;EAClB,c7C2gB8B;E6C1gB9B,eAAc;EACd,U7CynB6B;E8C5nB7B,wG9CuOiH;E8CrOjH,mBAAkB;EAClB,oB9C4OyB;E8C3OzB,iB9C+OoB;E8C9OpB,iBAAgB;EAChB,kBAAiB;EACjB,sBAAqB;EACrB,kBAAiB;EACjB,qBAAoB;EACpB,uBAAsB;EACtB,mBAAkB;EAClB,qBAAoB;EACpB,oBAAmB;EACnB,iBAAgB;EDPhB,oB7CsOsB;E6CpOtB,sBAAqB;EACrB,WAAU;CAoFX;;AA/FD;EAaW,a7C6mBqB;C6C7mBQ;;AAbxC;EAgBI,mBAAkB;EAClB,eAAc;EACd,W7C8mB6B;E6C7mB7B,Y7C8mB6B;C6C7mB9B;;AApBH;EAuBI,eAA+B;CAWhC;;AAlCH;EAyBM,UAAS;CACV;;AA1BL;EA6BM,kBAAuC;EACvC,YAAW;EACX,wBAAyD;EACzD,uB7C2BO;C6C1BR;;AAjCL;EAoCI,e7C4lB6B;C6CjlB9B;;AA/CH;EAsCM,QAAO;CACR;;AAvCL;EA0CM,iBAAsC;EACtC,YAAW;EACX,4BAA8E;EAC9E,yB7CcO;C6CbR;;AA9CL;EAiDI,eAA+B;CAWhC;;AA5DH;EAmDM,OAAM;CACP;;AApDL;EAuDM,kBAAuC;EACvC,YAAW;EACX,wB7CukB2B;E6CtkB3B,0B7CCO;C6CAR;;AA3DL;EA8DI,e7CkkB6B;C6CtjB9B;;AA1EH;EAgEM,SAAQ;CACT;;AAjEL;EAoEM,SAAQ;EACR,iBAAsC;EACtC,YAAW;EACX,4B7CyjB2B;E6CxjB3B,wB7CbO;C6CcR;;AAzEL;EA2FI,mBAAkB;EAClB,0BAAyB;EACzB,oBAAmB;CACpB;;AAIH;EACE,iB7CohBiC;E6CnhBjC,iB7CwhB+B;E6CvhB/B,Y7CpDW;E6CqDX,mBAAkB;EAClB,uB7C5CW;EMxDT,uBNmN2B;C6C7G9B;;AE1GD;EACE,mBAAkB;EAClB,OAAM;EACN,QAAO;EACP,c/CygB8B;E+CxgB9B,eAAc;EACd,iB/CooByC;E+CnoBzC,a/CioBuC;E8CtoBvC,wG9CuOiH;E8CrOjH,mBAAkB;EAClB,oB9C4OyB;E8C3OzB,iB9C+OoB;E8C9OpB,iBAAgB;EAChB,kBAAiB;EACjB,sBAAqB;EACrB,kBAAiB;EACjB,qBAAoB;EACpB,uBAAsB;EACtB,mBAAkB;EAClB,qBAAoB;EACpB,oBAAmB;EACnB,iBAAgB;ECLhB,oB/CoOsB;E+ClOtB,sBAAqB;EACrB,uB/CoCW;E+CnCX,6BAA4B;EAC5B,qC/C4CW;EMxDT,sBNoN0B;C+C5C7B;;AA5KD;EAyBI,mBAAkB;EAClB,eAAc;EACd,Y/C6nBsC;E+C5nBtC,Y/C6nBqC;C+C5nBtC;;AA7BH;;EAiCI,mBAAkB;EAClB,eAAc;EACd,0BAAyB;EACzB,oBAAmB;CACpB;;AArCH;EAwCI,YAAW;EACX,mB/CmnB8D;C+ClnB/D;;AA1CH;EA4CI,YAAW;EACX,mB/C+mB8D;C+C9mB/D;;AA9CH;EAmDI,oB/CqmBsC;C+C/kBvC;;AAzEH;EAsDM,UAAS;CACV;;AAvDL;;EA2DM,uBAAsB;CACvB;;AA5DL;EA+DM,c/C6lB4D;E+C5lB5D,kBAA6C;EAC7C,sC/C4lBmE;C+C3lBpE;;AAlEL;EAqEM,cAAwC;EACxC,kBAA6C;EAC7C,uB/CrBO;C+CsBR;;AAxEL;EA4EI,kB/C4kBsC;C+CvjBvC;;AAjGH;EA+EM,QAAO;CACR;;AAhFL;;EAoFM,iBAA4C;EAC5C,qBAAoB;CACrB;;AAtFL;EAyFM,Y/CmkB4D;E+ClkB5D,wC/CmkBmE;C+ClkBpE;;AA3FL;EA8FM,YAAsC;EACtC,yB/C7CO;C+C8CR;;AAhGL;EAoGI,iB/CojBsC;C+CnhBvC;;AArIH;EAuGM,OAAM;CACP;;AAxGL;;EA4GM,kBAAuC;EACvC,oBAAmB;CACpB;;AA9GL;EAiHM,W/C2iB4D;E+C1iB5D,yC/C2iBmE;C+C1iBpE;;AAnHL;EAsHM,WAAqC;EACrC,0B/CrEO;C+CsER;;AAxHL;EA4HM,mBAAkB;EAClB,OAAM;EACN,UAAS;EACT,eAAc;EACd,YAAW;EACX,mBAAkB;EAClB,YAAW;EACX,iC/C4gBwD;C+C3gBzD;;AApIL;EAwII,mB/CghBsC;C+C3fvC;;AA7JH;EA2IM,SAAQ;CACT;;AA5IL;;EAgJM,iBAA4C;EAC5C,sBAAqB;CACtB;;AAlJL;EAqJM,a/CugB4D;E+CtgB5D,uC/CugBmE;C+CtgBpE;;AAvJL;EA0JM,aAAuC;EACvC,wB/CzGO;C+C0GR;;AAoBL;EACE,kB/CieyC;E+ChezC,iBAAgB;EAChB,gB/C0DmB;E+CzDnB,e/C8E8B;E+C7E9B,0B/C0d4D;E+Czd5D,iCAAyE;EzC5KvE,2CyC6KyE;EzC5KzE,4CyC4KyE;CAM5E;;AAbD;EAWI,cAAa;CACd;;AAGH;EACE,kB/CsdqC;E+CrdrC,e/CtIgB;C+CuIjB;;ACjMD;EACE,mBAAkB;CACnB;;AAED;EACE,mBAAkB;EAClB,YAAW;EACX,iBAAgB;CACjB;;AAED;EACE,mBAAkB;EAClB,cAAa;EACb,uBAAmB;MAAnB,oBAAmB;EACnB,YAAW;EzCVP,wCPyyB4C;EOzyB5C,gCPyyB4C;EOzyB5C,6DPyyB4C;EgD7xBhD,oCAA2B;UAA3B,4BAA2B;EAC3B,4BAAmB;UAAnB,oBAAmB;CACpB;;AAED;;;EAGE,eAAc;CACf;;AAED;;EAEE,mBAAkB;EAClB,OAAM;CACP;;AAGD;;EAEE,iCAAwB;UAAxB,yBAAwB;CAKzB;;AAHyC;EAJ1C;;IAKI,wCAA+B;YAA/B,gCAA+B;GAElC;ClD2nJA;;AkDznJD;;EAEE,oCAA2B;UAA3B,4BAA2B;CAK5B;;AAHyC;EAJ1C;;IAKI,2CAAkC;YAAlC,mCAAkC;GAErC;ClD8nJA;;AkD5nJD;;EAEE,qCAA4B;UAA5B,6BAA4B;CAK7B;;AAHyC;EAJ1C;;IAKI,4CAAmC;YAAnC,oCAAmC;GAEtC;ClDioJA;;AkD1nJD;;EAEE,mBAAkB;EAClB,OAAM;EACN,UAAS;EAET,qBAAa;EAAb,cAAa;EACb,uBAAmB;MAAnB,oBAAmB;EACnB,sBAAuB;MAAvB,wBAAuB;EACvB,WhDmtB+C;EgDltB/C,YhD1BW;EgD2BX,mBAAkB;EAClB,ahDitB8C;CgDtsB/C;;A/CnEG;;;E+C8DA,YhDlCS;EgDmCT,sBAAqB;EACrB,WAAU;EACV,YAAW;C/C9DV;;A+CiEL;EACE,QAAO;CACR;;AACD;EACE,SAAQ;CACT;;AAGD;;EAEE,sBAAqB;EACrB,YhDosBgD;EgDnsBhD,ahDmsBgD;EgDlsBhD,gDAA+C;EAC/C,2BAA0B;CAC3B;;AACD;EACE,8MjC/DyI;CiCgE1I;;AACD;EACE,gNjClEyI;CiCmE1I;;AAQD;EACE,mBAAkB;EAClB,SAAQ;EACR,aAAY;EACZ,QAAO;EACP,YAAW;EACX,qBAAa;EAAb,cAAa;EACb,sBAAuB;MAAvB,wBAAuB;EACvB,gBAAe;EAEf,kBhD6pB+C;EgD5pB/C,iBhD4pB+C;EgD3pB/C,iBAAgB;CAoCjB;;AAhDD;EAeI,mBAAkB;EAClB,mBAAc;MAAd,eAAc;EACd,YhDypB8C;EgDxpB9C,YhDypB6C;EgDxpB7C,kBhDypB6C;EgDxpB7C,iBhDwpB6C;EgDvpB7C,oBAAmB;EACnB,2ChD3FS;CgDgHV;;AA3CH;EA0BM,mBAAkB;EAClB,WAAU;EACV,QAAO;EACP,sBAAqB;EACrB,YAAW;EACX,aAAY;EACZ,YAAW;CACZ;;AAjCL;EAmCM,mBAAkB;EAClB,cAAa;EACb,QAAO;EACP,sBAAqB;EACrB,YAAW;EACX,aAAY;EACZ,YAAW;CACZ;;AA1CL;EA8CI,uBhDnHS;CgDoHV;;AAQH;EACE,mBAAkB;EAClB,WAA6C;EAC7C,aAAY;EACZ,UAA4C;EAC5C,YAAW;EACX,kBAAiB;EACjB,qBAAoB;EACpB,YhDpIW;EgDqIX,mBAAkB;CACnB;;ACxLD;EAAqB,oCAAmC;CAAK;;AAC7D;EAAqB,+BAA8B;CAAK;;AACxD;EAAqB,kCAAiC;CAAK;;AAC3D;EAAqB,kCAAiC;CAAK;;AAC3D;EAAqB,uCAAsC;CAAK;;AAChE;EAAqB,oCAAmC;CAAK;;ACF3D;EACE,qCAAmC;CACpC;;AjDiBC;EiDdE,qCAAgD;CjDiBjD;;AiDtBH;EACE,qCAAmC;CACpC;;AjDiBC;EiDdE,qCAAgD;CjDiBjD;;AiDtBH;EACE,qCAAmC;CACpC;;AjDiBC;EiDdE,qCAAgD;CjDiBjD;;AiDtBH;EACE,qCAAmC;CACpC;;AjDiBC;EiDdE,qCAAgD;CjDiBjD;;AiDtBH;EACE,qCAAmC;CACpC;;AjDiBC;EiDdE,qCAAgD;CjDiBjD;;AiDtBH;EACE,qCAAmC;CACpC;;AjDiBC;EiDdE,qCAAgD;CjDiBjD;;AiDtBH;EACE,qCAAmC;CACpC;;AjDiBC;EiDdE,qCAAgD;CjDiBjD;;AiDtBH;EACE,qCAAmC;CACpC;;AjDiBC;EiDdE,qCAAgD;CjDiBjD;;AkDrBL;EAAY,kCAAmC;CAAI;;AACnD;EAAkB,yCAAwC;CAAK;;ACD/D;EAAmB,qCAAsC;CAAI;;AAC7D;EAAmB,qBAAoB;CAAK;;AAC5C;EAAmB,yBAAwB;CAAK;;AAChD;EAAmB,2BAA0B;CAAK;;AAClD;EAAmB,4BAA2B;CAAK;;AACnD;EAAmB,0BAAyB;CAAK;;AAG/C;EACE,iCAA+B;CAChC;;AAFD;EACE,iCAA+B;CAChC;;AAFD;EACE,iCAA+B;CAChC;;AAFD;EACE,iCAA+B;CAChC;;AAFD;EACE,iCAA+B;CAChC;;AAFD;EACE,iCAA+B;CAChC;;AAFD;EACE,iCAA+B;CAChC;;AAFD;EACE,iCAA+B;CAChC;;AAGH;EACE,8BAA+B;CAChC;;AAMD;EACE,kCAAwC;CACzC;;AACD;EACE,2CAAiD;EACjD,4CAAkD;CACnD;;AACD;EACE,4CAAkD;EAClD,+CAAqD;CACtD;;AACD;EACE,+CAAqD;EACrD,8CAAoD;CACrD;;AACD;EACE,2CAAiD;EACjD,8CAAoD;CACrD;;AAED;EACE,mBAAkB;CACnB;;AAED;EACE,iBAAgB;CACjB;;AtBlDC;EACE,eAAc;EACd,YAAW;EACX,YAAW;CACZ;;AuBGC;EAA2B,yBAAwB;CAAK;;AACxD;EAA2B,2BAA0B;CAAK;;AAC1D;EAA2B,iCAAgC;CAAK;;AAChE;EAA2B,0BAAyB;CAAK;;AACzD;EAA2B,0BAAyB;CAAK;;AACzD;EAA2B,+BAA8B;CAAK;;AAC9D;EAA2B,gCAAwB;EAAxB,yBAAwB;CAAK;;AACxD;EAA2B,uCAA+B;EAA/B,gCAA+B;CAAK;;A1CyC/D;E0ChDA;IAA2B,yBAAwB;GAAK;EACxD;IAA2B,2BAA0B;GAAK;EAC1D;IAA2B,iCAAgC;GAAK;EAChE;IAA2B,0BAAyB;GAAK;EACzD;IAA2B,0BAAyB;GAAK;EACzD;IAA2B,+BAA8B;GAAK;EAC9D;IAA2B,gCAAwB;IAAxB,yBAAwB;GAAK;EACxD;IAA2B,uCAA+B;IAA/B,gCAA+B;GAAK;CvDuhKlE;;Aa9+JG;E0ChDA;IAA2B,yBAAwB;GAAK;EACxD;IAA2B,2BAA0B;GAAK;EAC1D;IAA2B,iCAAgC;GAAK;EAChE;IAA2B,0BAAyB;GAAK;EACzD;IAA2B,0BAAyB;GAAK;EACzD;IAA2B,+BAA8B;GAAK;EAC9D;IAA2B,gCAAwB;IAAxB,yBAAwB;GAAK;EACxD;IAA2B,uCAA+B;IAA/B,gCAA+B;GAAK;CvDkjKlE;;AazgKG;E0ChDA;IAA2B,yBAAwB;GAAK;EACxD;IAA2B,2BAA0B;GAAK;EAC1D;IAA2B,iCAAgC;GAAK;EAChE;IAA2B,0BAAyB;GAAK;EACzD;IAA2B,0BAAyB;GAAK;EACzD;IAA2B,+BAA8B;GAAK;EAC9D;IAA2B,gCAAwB;IAAxB,yBAAwB;GAAK;EACxD;IAA2B,uCAA+B;IAA/B,gCAA+B;GAAK;CvD6kKlE;;AapiKG;E0ChDA;IAA2B,yBAAwB;GAAK;EACxD;IAA2B,2BAA0B;GAAK;EAC1D;IAA2B,iCAAgC;GAAK;EAChE;IAA2B,0BAAyB;GAAK;EACzD;IAA2B,0BAAyB;GAAK;EACzD;IAA2B,+BAA8B;GAAK;EAC9D;IAA2B,gCAAwB;IAAxB,yBAAwB;GAAK;EACxD;IAA2B,uCAA+B;IAA/B,gCAA+B;GAAK;CvDwmKlE;;AuD/lKD;EACE,yBAAwB;CAKzB;;AAHC;EAHF;IAII,0BAAyB;GAE5B;CvDmmKA;;AuDjmKD;EACE,yBAAwB;CAKzB;;AAHC;EAHF;IAII,2BAA0B;GAE7B;CvDqmKA;;AuDnmKD;EACE,yBAAwB;CAKzB;;AAHC;EAHF;IAII,iCAAgC;GAEnC;CvDumKA;;AuDpmKC;EADF;IAEI,yBAAwB;GAE3B;CvDumKA;;AwDzpKD;EACE,mBAAkB;EAClB,eAAc;EACd,YAAW;EACX,WAAU;EACV,iBAAgB;CAoBjB;;AAzBD;EAQI,eAAc;EACd,YAAW;CACZ;;AAVH;;;;;EAiBI,mBAAkB;EAClB,OAAM;EACN,UAAS;EACT,QAAO;EACP,YAAW;EACX,aAAY;EACZ,UAAS;CACV;;AAGH;EAEI,wBAA+B;CAChC;;AAGH;EAEI,oBAA+B;CAChC;;AAGH;EAEI,iBAA8B;CAC/B;;AAGH;EAEI,kBAA8B;CAC/B;;AC1CC;EAAgC,mCAA8B;MAA9B,+BAA8B;CAAK;;AACnE;EAAgC,sCAAiC;MAAjC,kCAAiC;CAAK;;AACtE;EAAgC,2CAAsC;MAAtC,uCAAsC;CAAK;;AAC3E;EAAgC,8CAAyC;MAAzC,0CAAyC;CAAK;;AAE9E;EAA8B,+BAA0B;MAA1B,2BAA0B;CAAK;;AAC7D;EAA8B,iCAA4B;MAA5B,6BAA4B;CAAK;;AAC/D;EAA8B,uCAAkC;MAAlC,mCAAkC;CAAK;;AAErE;EAAoC,gCAAsC;MAAtC,uCAAsC;CAAK;;AAC/E;EAAoC,8BAAoC;MAApC,qCAAoC;CAAK;;AAC7E;EAAoC,iCAAkC;MAAlC,mCAAkC;CAAK;;AAC3E;EAAoC,kCAAyC;MAAzC,0CAAyC;CAAK;;AAClF;EAAoC,qCAAwC;MAAxC,yCAAwC;CAAK;;AAEjF;EAAiC,iCAAkC;MAAlC,mCAAkC;CAAK;;AACxE;EAAiC,+BAAgC;MAAhC,iCAAgC;CAAK;;AACtE;EAAiC,kCAA8B;MAA9B,+BAA8B;CAAK;;AACpE;EAAiC,oCAAgC;MAAhC,iCAAgC;CAAK;;AACtE;EAAiC,mCAA+B;MAA/B,gCAA+B;CAAK;;AAErE;EAAkC,qCAAoC;MAApC,qCAAoC;CAAK;;AAC3E;EAAkC,mCAAkC;MAAlC,mCAAkC;CAAK;;AACzE;EAAkC,sCAAgC;MAAhC,iCAAgC;CAAK;;AACvE;EAAkC,uCAAuC;MAAvC,wCAAuC;CAAK;;AAC9E;EAAkC,0CAAsC;MAAtC,uCAAsC;CAAK;;AAC7E;EAAkC,uCAAiC;MAAjC,kCAAiC;CAAK;;AAExE;EAAgC,qCAA2B;MAA3B,4BAA2B;CAAK;;AAChE;EAAgC,sCAAiC;MAAjC,kCAAiC;CAAK;;AACtE;EAAgC,oCAA+B;MAA/B,gCAA+B;CAAK;;AACpE;EAAgC,uCAA6B;MAA7B,8BAA6B;CAAK;;AAClE;EAAgC,yCAA+B;MAA/B,gCAA+B;CAAK;;AACpE;EAAgC,wCAA8B;MAA9B,+BAA8B;CAAK;;A5CenE;E4ChDA;IAAgC,mCAA8B;QAA9B,+BAA8B;GAAK;EACnE;IAAgC,sCAAiC;QAAjC,kCAAiC;GAAK;EACtE;IAAgC,2CAAsC;QAAtC,uCAAsC;GAAK;EAC3E;IAAgC,8CAAyC;QAAzC,0CAAyC;GAAK;EAE9E;IAA8B,+BAA0B;QAA1B,2BAA0B;GAAK;EAC7D;IAA8B,iCAA4B;QAA5B,6BAA4B;GAAK;EAC/D;IAA8B,uCAAkC;QAAlC,mCAAkC;GAAK;EAErE;IAAoC,gCAAsC;QAAtC,uCAAsC;GAAK;EAC/E;IAAoC,8BAAoC;QAApC,qCAAoC;GAAK;EAC7E;IAAoC,iCAAkC;QAAlC,mCAAkC;GAAK;EAC3E;IAAoC,kCAAyC;QAAzC,0CAAyC;GAAK;EAClF;IAAoC,qCAAwC;QAAxC,yCAAwC;GAAK;EAEjF;IAAiC,iCAAkC;QAAlC,mCAAkC;GAAK;EACxE;IAAiC,+BAAgC;QAAhC,iCAAgC;GAAK;EACtE;IAAiC,kCAA8B;QAA9B,+BAA8B;GAAK;EACpE;IAAiC,oCAAgC;QAAhC,iCAAgC;GAAK;EACtE;IAAiC,mCAA+B;QAA/B,gCAA+B;GAAK;EAErE;IAAkC,qCAAoC;QAApC,qCAAoC;GAAK;EAC3E;IAAkC,mCAAkC;QAAlC,mCAAkC;GAAK;EACzE;IAAkC,sCAAgC;QAAhC,iCAAgC;GAAK;EACvE;IAAkC,uCAAuC;QAAvC,wCAAuC;GAAK;EAC9E;IAAkC,0CAAsC;QAAtC,uCAAsC;GAAK;EAC7E;IAAkC,uCAAiC;QAAjC,kCAAiC;GAAK;EAExE;IAAgC,qCAA2B;QAA3B,4BAA2B;GAAK;EAChE;IAAgC,sCAAiC;QAAjC,kCAAiC;GAAK;EACtE;IAAgC,oCAA+B;QAA/B,gCAA+B;GAAK;EACpE;IAAgC,uCAA6B;QAA7B,8BAA6B;GAAK;EAClE;IAAgC,yCAA+B;QAA/B,gCAA+B;GAAK;EACpE;IAAgC,wCAA8B;QAA9B,+BAA8B;GAAK;CzD22KtE;;Aa51KG;E4ChDA;IAAgC,mCAA8B;QAA9B,+BAA8B;GAAK;EACnE;IAAgC,sCAAiC;QAAjC,kCAAiC;GAAK;EACtE;IAAgC,2CAAsC;QAAtC,uCAAsC;GAAK;EAC3E;IAAgC,8CAAyC;QAAzC,0CAAyC;GAAK;EAE9E;IAA8B,+BAA0B;QAA1B,2BAA0B;GAAK;EAC7D;IAA8B,iCAA4B;QAA5B,6BAA4B;GAAK;EAC/D;IAA8B,uCAAkC;QAAlC,mCAAkC;GAAK;EAErE;IAAoC,gCAAsC;QAAtC,uCAAsC;GAAK;EAC/E;IAAoC,8BAAoC;QAApC,qCAAoC;GAAK;EAC7E;IAAoC,iCAAkC;QAAlC,mCAAkC;GAAK;EAC3E;IAAoC,kCAAyC;QAAzC,0CAAyC;GAAK;EAClF;IAAoC,qCAAwC;QAAxC,yCAAwC;GAAK;EAEjF;IAAiC,iCAAkC;QAAlC,mCAAkC;GAAK;EACxE;IAAiC,+BAAgC;QAAhC,iCAAgC;GAAK;EACtE;IAAiC,kCAA8B;QAA9B,+BAA8B;GAAK;EACpE;IAAiC,oCAAgC;QAAhC,iCAAgC;GAAK;EACtE;IAAiC,mCAA+B;QAA/B,gCAA+B;GAAK;EAErE;IAAkC,qCAAoC;QAApC,qCAAoC;GAAK;EAC3E;IAAkC,mCAAkC;QAAlC,mCAAkC;GAAK;EACzE;IAAkC,sCAAgC;QAAhC,iCAAgC;GAAK;EACvE;IAAkC,uCAAuC;QAAvC,wCAAuC;GAAK;EAC9E;IAAkC,0CAAsC;QAAtC,uCAAsC;GAAK;EAC7E;IAAkC,uCAAiC;QAAjC,kCAAiC;GAAK;EAExE;IAAgC,qCAA2B;QAA3B,4BAA2B;GAAK;EAChE;IAAgC,sCAAiC;QAAjC,kCAAiC;GAAK;EACtE;IAAgC,oCAA+B;QAA/B,gCAA+B;GAAK;EACpE;IAAgC,uCAA6B;QAA7B,8BAA6B;GAAK;EAClE;IAAgC,yCAA+B;QAA/B,gCAA+B;GAAK;EACpE;IAAgC,wCAA8B;QAA9B,+BAA8B;GAAK;CzDq8KtE;;Aat7KG;E4ChDA;IAAgC,mCAA8B;QAA9B,+BAA8B;GAAK;EACnE;IAAgC,sCAAiC;QAAjC,kCAAiC;GAAK;EACtE;IAAgC,2CAAsC;QAAtC,uCAAsC;GAAK;EAC3E;IAAgC,8CAAyC;QAAzC,0CAAyC;GAAK;EAE9E;IAA8B,+BAA0B;QAA1B,2BAA0B;GAAK;EAC7D;IAA8B,iCAA4B;QAA5B,6BAA4B;GAAK;EAC/D;IAA8B,uCAAkC;QAAlC,mCAAkC;GAAK;EAErE;IAAoC,gCAAsC;QAAtC,uCAAsC;GAAK;EAC/E;IAAoC,8BAAoC;QAApC,qCAAoC;GAAK;EAC7E;IAAoC,iCAAkC;QAAlC,mCAAkC;GAAK;EAC3E;IAAoC,kCAAyC;QAAzC,0CAAyC;GAAK;EAClF;IAAoC,qCAAwC;QAAxC,yCAAwC;GAAK;EAEjF;IAAiC,iCAAkC;QAAlC,mCAAkC;GAAK;EACxE;IAAiC,+BAAgC;QAAhC,iCAAgC;GAAK;EACtE;IAAiC,kCAA8B;QAA9B,+BAA8B;GAAK;EACpE;IAAiC,oCAAgC;QAAhC,iCAAgC;GAAK;EACtE;IAAiC,mCAA+B;QAA/B,gCAA+B;GAAK;EAErE;IAAkC,qCAAoC;QAApC,qCAAoC;GAAK;EAC3E;IAAkC,mCAAkC;QAAlC,mCAAkC;GAAK;EACzE;IAAkC,sCAAgC;QAAhC,iCAAgC;GAAK;EACvE;IAAkC,uCAAuC;QAAvC,wCAAuC;GAAK;EAC9E;IAAkC,0CAAsC;QAAtC,uCAAsC;GAAK;EAC7E;IAAkC,uCAAiC;QAAjC,kCAAiC;GAAK;EAExE;IAAgC,qCAA2B;QAA3B,4BAA2B;GAAK;EAChE;IAAgC,sCAAiC;QAAjC,kCAAiC;GAAK;EACtE;IAAgC,oCAA+B;QAA/B,gCAA+B;GAAK;EACpE;IAAgC,uCAA6B;QAA7B,8BAA6B;GAAK;EAClE;IAAgC,yCAA+B;QAA/B,gCAA+B;GAAK;EACpE;IAAgC,wCAA8B;QAA9B,+BAA8B;GAAK;CzD+hLtE;;AahhLG;E4ChDA;IAAgC,mCAA8B;QAA9B,+BAA8B;GAAK;EACnE;IAAgC,sCAAiC;QAAjC,kCAAiC;GAAK;EACtE;IAAgC,2CAAsC;QAAtC,uCAAsC;GAAK;EAC3E;IAAgC,8CAAyC;QAAzC,0CAAyC;GAAK;EAE9E;IAA8B,+BAA0B;QAA1B,2BAA0B;GAAK;EAC7D;IAA8B,iCAA4B;QAA5B,6BAA4B;GAAK;EAC/D;IAA8B,uCAAkC;QAAlC,mCAAkC;GAAK;EAErE;IAAoC,gCAAsC;QAAtC,uCAAsC;GAAK;EAC/E;IAAoC,8BAAoC;QAApC,qCAAoC;GAAK;EAC7E;IAAoC,iCAAkC;QAAlC,mCAAkC;GAAK;EAC3E;IAAoC,kCAAyC;QAAzC,0CAAyC;GAAK;EAClF;IAAoC,qCAAwC;QAAxC,yCAAwC;GAAK;EAEjF;IAAiC,iCAAkC;QAAlC,mCAAkC;GAAK;EACxE;IAAiC,+BAAgC;QAAhC,iCAAgC;GAAK;EACtE;IAAiC,kCAA8B;QAA9B,+BAA8B;GAAK;EACpE;IAAiC,oCAAgC;QAAhC,iCAAgC;GAAK;EACtE;IAAiC,mCAA+B;QAA/B,gCAA+B;GAAK;EAErE;IAAkC,qCAAoC;QAApC,qCAAoC;GAAK;EAC3E;IAAkC,mCAAkC;QAAlC,mCAAkC;GAAK;EACzE;IAAkC,sCAAgC;QAAhC,iCAAgC;GAAK;EACvE;IAAkC,uCAAuC;QAAvC,wCAAuC;GAAK;EAC9E;IAAkC,0CAAsC;QAAtC,uCAAsC;GAAK;EAC7E;IAAkC,uCAAiC;QAAjC,kCAAiC;GAAK;EAExE;IAAgC,qCAA2B;QAA3B,4BAA2B;GAAK;EAChE;IAAgC,sCAAiC;QAAjC,kCAAiC;GAAK;EACtE;IAAgC,oCAA+B;QAA/B,gCAA+B;GAAK;EACpE;IAAgC,uCAA6B;QAA7B,8BAA6B;GAAK;EAClE;IAAgC,yCAA+B;QAA/B,gCAA+B;GAAK;EACpE;IAAgC,wCAA8B;QAA9B,+BAA8B;GAAK;CzDynLtE;;A0D9pLG;ECHF,uBAAsB;CDG2B;;AAC/C;ECDF,wBAAuB;CDC2B;;AAChD;ECCF,uBAAsB;CDD2B;;A7CkD/C;E6CpDA;ICHF,uBAAsB;GDG2B;EAC/C;ICDF,wBAAuB;GDC2B;EAChD;ICCF,uBAAsB;GDD2B;C1DorLlD;;AaloLG;E6CpDA;ICHF,uBAAsB;GDG2B;EAC/C;ICDF,wBAAuB;GDC2B;EAChD;ICCF,uBAAsB;GDD2B;C1DgsLlD;;Aa9oLG;E6CpDA;ICHF,uBAAsB;GDG2B;EAC/C;ICDF,wBAAuB;GDC2B;EAChD;ICCF,uBAAsB;GDD2B;C1D4sLlD;;Aa1pLG;E6CpDA;ICHF,uBAAsB;GDG2B;EAC/C;ICDF,wBAAuB;GDC2B;EAChD;ICCF,uBAAsB;GDD2B;C1DwtLlD;;A4D5tLD;EACE,gBAAe;EACf,OAAM;EACN,SAAQ;EACR,QAAO;EACP,c1DmgB8B;C0DlgB/B;;AAED;EACE,gBAAe;EACf,SAAQ;EACR,UAAS;EACT,QAAO;EACP,c1D2f8B;C0D1f/B;;AAG6B;EAD9B;IAEI,yBAAgB;IAAhB,iBAAgB;IAChB,OAAM;IACN,c1Dmf4B;G0Djf/B;C5D8tLA;;A6DlvLD;ECEE,mBAAkB;EAClB,WAAU;EACV,YAAW;EACX,WAAU;EACV,iBAAgB;EAChB,uBAAmB;EACnB,oBAAmB;EACnB,8BAAqB;UAArB,sBAAqB;EACrB,UAAS;CDRV;;ACkBC;EAEE,iBAAgB;EAChB,YAAW;EACX,aAAY;EACZ,kBAAiB;EACjB,WAAU;EACV,oBAAmB;EACnB,wBAAe;UAAf,gBAAe;CAChB;;AC7BC;EAAuB,sBAA4B;CAAI;;AAAvD;EAAuB,sBAA4B;CAAI;;AAAvD;EAAuB,sBAA4B;CAAI;;AAAvD;EAAuB,uBAA4B;CAAI;;AAAvD;EAAuB,uBAA4B;CAAI;;AAAvD;EAAuB,uBAA4B;CAAI;;AAAvD;EAAuB,uBAA4B;CAAI;;AAAvD;EAAuB,wBAA4B;CAAI;;AAI3D;EAAU,2BAA0B;CAAK;;AACzC;EAAU,4BAA2B;CAAK;;ACAlC;EAAiC,qBAAmC;CAAI;;AACxE;EAAiC,yBAAuC;CAAI;;AAC5E;EAAiC,2BAAyC;CAAI;;AAC9E;EAAiC,4BAA0C;CAAI;;AAC/E;EAAiC,0BAAwC;CAAI;;AAC7E;EACE,2BAAwC;EACxC,0BAAuC;CACxC;;AACD;EACE,yBAAuC;EACvC,4BAA0C;CAC3C;;AAZD;EAAiC,2BAAmC;CAAI;;AACxE;EAAiC,+BAAuC;CAAI;;AAC5E;EAAiC,iCAAyC;CAAI;;AAC9E;EAAiC,kCAA0C;CAAI;;AAC/E;EAAiC,gCAAwC;CAAI;;AAC7E;EACE,iCAAwC;EACxC,gCAAuC;CACxC;;AACD;EACE,+BAAuC;EACvC,kCAA0C;CAC3C;;AAZD;EAAiC,0BAAmC;CAAI;;AACxE;EAAiC,8BAAuC;CAAI;;AAC5E;EAAiC,gCAAyC;CAAI;;AAC9E;EAAiC,iCAA0C;CAAI;;AAC/E;EAAiC,+BAAwC;CAAI;;AAC7E;EACE,gCAAwC;EACxC,+BAAuC;CACxC;;AACD;EACE,8BAAuC;EACvC,iCAA0C;CAC3C;;AAZD;EAAiC,wBAAmC;CAAI;;AACxE;EAAiC,4BAAuC;CAAI;;AAC5E;EAAiC,8BAAyC;CAAI;;AAC9E;EAAiC,+BAA0C;CAAI;;AAC/E;EAAiC,6BAAwC;CAAI;;AAC7E;EACE,8BAAwC;EACxC,6BAAuC;CACxC;;AACD;EACE,4BAAuC;EACvC,+BAA0C;CAC3C;;AAZD;EAAiC,0BAAmC;CAAI;;AACxE;EAAiC,8BAAuC;CAAI;;AAC5E;EAAiC,gCAAyC;CAAI;;AAC9E;EAAiC,iCAA0C;CAAI;;AAC/E;EAAiC,+BAAwC;CAAI;;AAC7E;EACE,gCAAwC;EACxC,+BAAuC;CACxC;;AACD;EACE,8BAAuC;EACvC,iCAA0C;CAC3C;;AAZD;EAAiC,wBAAmC;CAAI;;AACxE;EAAiC,4BAAuC;CAAI;;AAC5E;EAAiC,8BAAyC;CAAI;;AAC9E;EAAiC,+BAA0C;CAAI;;AAC/E;EAAiC,6BAAwC;CAAI;;AAC7E;EACE,8BAAwC;EACxC,6BAAuC;CACxC;;AACD;EACE,4BAAuC;EACvC,+BAA0C;CAC3C;;AAZD;EAAiC,sBAAmC;CAAI;;AACxE;EAAiC,0BAAuC;CAAI;;AAC5E;EAAiC,4BAAyC;CAAI;;AAC9E;EAAiC,6BAA0C;CAAI;;AAC/E;EAAiC,2BAAwC;CAAI;;AAC7E;EACE,4BAAwC;EACxC,2BAAuC;CACxC;;AACD;EACE,0BAAuC;EACvC,6BAA0C;CAC3C;;AAZD;EAAiC,4BAAmC;CAAI;;AACxE;EAAiC,gCAAuC;CAAI;;AAC5E;EAAiC,kCAAyC;CAAI;;AAC9E;EAAiC,mCAA0C;CAAI;;AAC/E;EAAiC,iCAAwC;CAAI;;AAC7E;EACE,kCAAwC;EACxC,iCAAuC;CACxC;;AACD;EACE,gCAAuC;EACvC,mCAA0C;CAC3C;;AAZD;EAAiC,2BAAmC;CAAI;;AACxE;EAAiC,+BAAuC;CAAI;;AAC5E;EAAiC,iCAAyC;CAAI;;AAC9E;EAAiC,kCAA0C;CAAI;;AAC/E;EAAiC,gCAAwC;CAAI;;AAC7E;EACE,iCAAwC;EACxC,gCAAuC;CACxC;;AACD;EACE,+BAAuC;EACvC,kCAA0C;CAC3C;;AAZD;EAAiC,yBAAmC;CAAI;;AACxE;EAAiC,6BAAuC;CAAI;;AAC5E;EAAiC,+BAAyC;CAAI;;AAC9E;EAAiC,gCAA0C;CAAI;;AAC/E;EAAiC,8BAAwC;CAAI;;AAC7E;EACE,+BAAwC;EACxC,8BAAuC;CACxC;;AACD;EACE,6BAAuC;EACvC,gCAA0C;CAC3C;;AAZD;EAAiC,2BAAmC;CAAI;;AACxE;EAAiC,+BAAuC;CAAI;;AAC5E;EAAiC,iCAAyC;CAAI;;AAC9E;EAAiC,kCAA0C;CAAI;;AAC/E;EAAiC,gCAAwC;CAAI;;AAC7E;EACE,iCAAwC;EACxC,gCAAuC;CACxC;;AACD;EACE,+BAAuC;EACvC,kCAA0C;CAC3C;;AAZD;EAAiC,yBAAmC;CAAI;;AACxE;EAAiC,6BAAuC;CAAI;;AAC5E;EAAiC,+BAAyC;CAAI;;AAC9E;EAAiC,gCAA0C;CAAI;;AAC/E;EAAiC,8BAAwC;CAAI;;AAC7E;EACE,+BAAwC;EACxC,8BAAuC;CACxC;;AACD;EACE,6BAAuC;EACvC,gCAA0C;CAC3C;;AAKL;EAAoB,wBAA8B;CAAK;;AACvD;EAAoB,4BAA8B;CAAK;;AACvD;EAAoB,8BAA8B;CAAK;;AACvD;EAAoB,+BAA8B;CAAK;;AACvD;EAAoB,6BAA8B;CAAK;;AACvD;EACE,8BAA6B;EAC7B,6BAA6B;CAC9B;;AACD;EACE,4BAA8B;EAC9B,+BAA8B;CAC/B;;AnDkBD;EmD/CI;IAAiC,qBAAmC;GAAI;EACxE;IAAiC,yBAAuC;GAAI;EAC5E;IAAiC,2BAAyC;GAAI;EAC9E;IAAiC,4BAA0C;GAAI;EAC/E;IAAiC,0BAAwC;GAAI;EAC7E;IACE,2BAAwC;IACxC,0BAAuC;GACxC;EACD;IACE,yBAAuC;IACvC,4BAA0C;GAC3C;EAZD;IAAiC,2BAAmC;GAAI;EACxE;IAAiC,+BAAuC;GAAI;EAC5E;IAAiC,iCAAyC;GAAI;EAC9E;IAAiC,kCAA0C;GAAI;EAC/E;IAAiC,gCAAwC;GAAI;EAC7E;IACE,iCAAwC;IACxC,gCAAuC;GACxC;EACD;IACE,+BAAuC;IACvC,kCAA0C;GAC3C;EAZD;IAAiC,0BAAmC;GAAI;EACxE;IAAiC,8BAAuC;GAAI;EAC5E;IAAiC,gCAAyC;GAAI;EAC9E;IAAiC,iCAA0C;GAAI;EAC/E;IAAiC,+BAAwC;GAAI;EAC7E;IACE,gCAAwC;IACxC,+BAAuC;GACxC;EACD;IACE,8BAAuC;IACvC,iCAA0C;GAC3C;EAZD;IAAiC,wBAAmC;GAAI;EACxE;IAAiC,4BAAuC;GAAI;EAC5E;IAAiC,8BAAyC;GAAI;EAC9E;IAAiC,+BAA0C;GAAI;EAC/E;IAAiC,6BAAwC;GAAI;EAC7E;IACE,8BAAwC;IACxC,6BAAuC;GACxC;EACD;IACE,4BAAuC;IACvC,+BAA0C;GAC3C;EAZD;IAAiC,0BAAmC;GAAI;EACxE;IAAiC,8BAAuC;GAAI;EAC5E;IAAiC,gCAAyC;GAAI;EAC9E;IAAiC,iCAA0C;GAAI;EAC/E;IAAiC,+BAAwC;GAAI;EAC7E;IACE,gCAAwC;IACxC,+BAAuC;GACxC;EACD;IACE,8BAAuC;IACvC,iCAA0C;GAC3C;EAZD;IAAiC,wBAAmC;GAAI;EACxE;IAAiC,4BAAuC;GAAI;EAC5E;IAAiC,8BAAyC;GAAI;EAC9E;IAAiC,+BAA0C;GAAI;EAC/E;IAAiC,6BAAwC;GAAI;EAC7E;IACE,8BAAwC;IACxC,6BAAuC;GACxC;EACD;IACE,4BAAuC;IACvC,+BAA0C;GAC3C;EAZD;IAAiC,sBAAmC;GAAI;EACxE;IAAiC,0BAAuC;GAAI;EAC5E;IAAiC,4BAAyC;GAAI;EAC9E;IAAiC,6BAA0C;GAAI;EAC/E;IAAiC,2BAAwC;GAAI;EAC7E;IACE,4BAAwC;IACxC,2BAAuC;GACxC;EACD;IACE,0BAAuC;IACvC,6BAA0C;GAC3C;EAZD;IAAiC,4BAAmC;GAAI;EACxE;IAAiC,gCAAuC;GAAI;EAC5E;IAAiC,kCAAyC;GAAI;EAC9E;IAAiC,mCAA0C;GAAI;EAC/E;IAAiC,iCAAwC;GAAI;EAC7E;IACE,kCAAwC;IACxC,iCAAuC;GACxC;EACD;IACE,gCAAuC;IACvC,mCAA0C;GAC3C;EAZD;IAAiC,2BAAmC;GAAI;EACxE;IAAiC,+BAAuC;GAAI;EAC5E;IAAiC,iCAAyC;GAAI;EAC9E;IAAiC,kCAA0C;GAAI;EAC/E;IAAiC,gCAAwC;GAAI;EAC7E;IACE,iCAAwC;IACxC,gCAAuC;GACxC;EACD;IACE,+BAAuC;IACvC,kCAA0C;GAC3C;EAZD;IAAiC,yBAAmC;GAAI;EACxE;IAAiC,6BAAuC;GAAI;EAC5E;IAAiC,+BAAyC;GAAI;EAC9E;IAAiC,gCAA0C;GAAI;EAC/E;IAAiC,8BAAwC;GAAI;EAC7E;IACE,+BAAwC;IACxC,8BAAuC;GACxC;EACD;IACE,6BAAuC;IACvC,gCAA0C;GAC3C;EAZD;IAAiC,2BAAmC;GAAI;EACxE;IAAiC,+BAAuC;GAAI;EAC5E;IAAiC,iCAAyC;GAAI;EAC9E;IAAiC,kCAA0C;GAAI;EAC/E;IAAiC,gCAAwC;GAAI;EAC7E;IACE,iCAAwC;IACxC,gCAAuC;GACxC;EACD;IACE,+BAAuC;IACvC,kCAA0C;GAC3C;EAZD;IAAiC,yBAAmC;GAAI;EACxE;IAAiC,6BAAuC;GAAI;EAC5E;IAAiC,+BAAyC;GAAI;EAC9E;IAAiC,gCAA0C;GAAI;EAC/E;IAAiC,8BAAwC;GAAI;EAC7E;IACE,+BAAwC;IACxC,8BAAuC;GACxC;EACD;IACE,6BAAuC;IACvC,gCAA0C;GAC3C;EAKL;IAAoB,wBAA8B;GAAK;EACvD;IAAoB,4BAA8B;GAAK;EACvD;IAAoB,8BAA8B;GAAK;EACvD;IAAoB,+BAA8B;GAAK;EACvD;IAAoB,6BAA8B;GAAK;EACvD;IACE,8BAA6B;IAC7B,6BAA6B;GAC9B;EACD;IACE,4BAA8B;IAC9B,+BAA8B;GAC/B;ChEk8MJ;;Aah7MG;EmD/CI;IAAiC,qBAAmC;GAAI;EACxE;IAAiC,yBAAuC;GAAI;EAC5E;IAAiC,2BAAyC;GAAI;EAC9E;IAAiC,4BAA0C;GAAI;EAC/E;IAAiC,0BAAwC;GAAI;EAC7E;IACE,2BAAwC;IACxC,0BAAuC;GACxC;EACD;IACE,yBAAuC;IACvC,4BAA0C;GAC3C;EAZD;IAAiC,2BAAmC;GAAI;EACxE;IAAiC,+BAAuC;GAAI;EAC5E;IAAiC,iCAAyC;GAAI;EAC9E;IAAiC,kCAA0C;GAAI;EAC/E;IAAiC,gCAAwC;GAAI;EAC7E;IACE,iCAAwC;IACxC,gCAAuC;GACxC;EACD;IACE,+BAAuC;IACvC,kCAA0C;GAC3C;EAZD;IAAiC,0BAAmC;GAAI;EACxE;IAAiC,8BAAuC;GAAI;EAC5E;IAAiC,gCAAyC;GAAI;EAC9E;IAAiC,iCAA0C;GAAI;EAC/E;IAAiC,+BAAwC;GAAI;EAC7E;IACE,gCAAwC;IACxC,+BAAuC;GACxC;EACD;IACE,8BAAuC;IACvC,iCAA0C;GAC3C;EAZD;IAAiC,wBAAmC;GAAI;EACxE;IAAiC,4BAAuC;GAAI;EAC5E;IAAiC,8BAAyC;GAAI;EAC9E;IAAiC,+BAA0C;GAAI;EAC/E;IAAiC,6BAAwC;GAAI;EAC7E;IACE,8BAAwC;IACxC,6BAAuC;GACxC;EACD;IACE,4BAAuC;IACvC,+BAA0C;GAC3C;EAZD;IAAiC,0BAAmC;GAAI;EACxE;IAAiC,8BAAuC;GAAI;EAC5E;IAAiC,gCAAyC;GAAI;EAC9E;IAAiC,iCAA0C;GAAI;EAC/E;IAAiC,+BAAwC;GAAI;EAC7E;IACE,gCAAwC;IACxC,+BAAuC;GACxC;EACD;IACE,8BAAuC;IACvC,iCAA0C;GAC3C;EAZD;IAAiC,wBAAmC;GAAI;EACxE;IAAiC,4BAAuC;GAAI;EAC5E;IAAiC,8BAAyC;GAAI;EAC9E;IAAiC,+BAA0C;GAAI;EAC/E;IAAiC,6BAAwC;GAAI;EAC7E;IACE,8BAAwC;IACxC,6BAAuC;GACxC;EACD;IACE,4BAAuC;IACvC,+BAA0C;GAC3C;EAZD;IAAiC,sBAAmC;GAAI;EACxE;IAAiC,0BAAuC;GAAI;EAC5E;IAAiC,4BAAyC;GAAI;EAC9E;IAAiC,6BAA0C;GAAI;EAC/E;IAAiC,2BAAwC;GAAI;EAC7E;IACE,4BAAwC;IACxC,2BAAuC;GACxC;EACD;IACE,0BAAuC;IACvC,6BAA0C;GAC3C;EAZD;IAAiC,4BAAmC;GAAI;EACxE;IAAiC,gCAAuC;GAAI;EAC5E;IAAiC,kCAAyC;GAAI;EAC9E;IAAiC,mCAA0C;GAAI;EAC/E;IAAiC,iCAAwC;GAAI;EAC7E;IACE,kCAAwC;IACxC,iCAAuC;GACxC;EACD;IACE,gCAAuC;IACvC,mCAA0C;GAC3C;EAZD;IAAiC,2BAAmC;GAAI;EACxE;IAAiC,+BAAuC;GAAI;EAC5E;IAAiC,iCAAyC;GAAI;EAC9E;IAAiC,kCAA0C;GAAI;EAC/E;IAAiC,gCAAwC;GAAI;EAC7E;IACE,iCAAwC;IACxC,gCAAuC;GACxC;EACD;IACE,+BAAuC;IACvC,kCAA0C;GAC3C;EAZD;IAAiC,yBAAmC;GAAI;EACxE;IAAiC,6BAAuC;GAAI;EAC5E;IAAiC,+BAAyC;GAAI;EAC9E;IAAiC,gCAA0C;GAAI;EAC/E;IAAiC,8BAAwC;GAAI;EAC7E;IACE,+BAAwC;IACxC,8BAAuC;GACxC;EACD;IACE,6BAAuC;IACvC,gCAA0C;GAC3C;EAZD;IAAiC,2BAAmC;GAAI;EACxE;IAAiC,+BAAuC;GAAI;EAC5E;IAAiC,iCAAyC;GAAI;EAC9E;IAAiC,kCAA0C;GAAI;EAC/E;IAAiC,gCAAwC;GAAI;EAC7E;IACE,iCAAwC;IACxC,gCAAuC;GACxC;EACD;IACE,+BAAuC;IACvC,kCAA0C;GAC3C;EAZD;IAAiC,yBAAmC;GAAI;EACxE;IAAiC,6BAAuC;GAAI;EAC5E;IAAiC,+BAAyC;GAAI;EAC9E;IAAiC,gCAA0C;GAAI;EAC/E;IAAiC,8BAAwC;GAAI;EAC7E;IACE,+BAAwC;IACxC,8BAAuC;GACxC;EACD;IACE,6BAAuC;IACvC,gCAA0C;GAC3C;EAKL;IAAoB,wBAA8B;GAAK;EACvD;IAAoB,4BAA8B;GAAK;EACvD;IAAoB,8BAA8B;GAAK;EACvD;IAAoB,+BAA8B;GAAK;EACvD;IAAoB,6BAA8B;GAAK;EACvD;IACE,8BAA6B;IAC7B,6BAA6B;GAC9B;EACD;IACE,4BAA8B;IAC9B,+BAA8B;GAC/B;ChEgvNJ;;Aa9tNG;EmD/CI;IAAiC,qBAAmC;GAAI;EACxE;IAAiC,yBAAuC;GAAI;EAC5E;IAAiC,2BAAyC;GAAI;EAC9E;IAAiC,4BAA0C;GAAI;EAC/E;IAAiC,0BAAwC;GAAI;EAC7E;IACE,2BAAwC;IACxC,0BAAuC;GACxC;EACD;IACE,yBAAuC;IACvC,4BAA0C;GAC3C;EAZD;IAAiC,2BAAmC;GAAI;EACxE;IAAiC,+BAAuC;GAAI;EAC5E;IAAiC,iCAAyC;GAAI;EAC9E;IAAiC,kCAA0C;GAAI;EAC/E;IAAiC,gCAAwC;GAAI;EAC7E;IACE,iCAAwC;IACxC,gCAAuC;GACxC;EACD;IACE,+BAAuC;IACvC,kCAA0C;GAC3C;EAZD;IAAiC,0BAAmC;GAAI;EACxE;IAAiC,8BAAuC;GAAI;EAC5E;IAAiC,gCAAyC;GAAI;EAC9E;IAAiC,iCAA0C;GAAI;EAC/E;IAAiC,+BAAwC;GAAI;EAC7E;IACE,gCAAwC;IACxC,+BAAuC;GACxC;EACD;IACE,8BAAuC;IACvC,iCAA0C;GAC3C;EAZD;IAAiC,wBAAmC;GAAI;EACxE;IAAiC,4BAAuC;GAAI;EAC5E;IAAiC,8BAAyC;GAAI;EAC9E;IAAiC,+BAA0C;GAAI;EAC/E;IAAiC,6BAAwC;GAAI;EAC7E;IACE,8BAAwC;IACxC,6BAAuC;GACxC;EACD;IACE,4BAAuC;IACvC,+BAA0C;GAC3C;EAZD;IAAiC,0BAAmC;GAAI;EACxE;IAAiC,8BAAuC;GAAI;EAC5E;IAAiC,gCAAyC;GAAI;EAC9E;IAAiC,iCAA0C;GAAI;EAC/E;IAAiC,+BAAwC;GAAI;EAC7E;IACE,gCAAwC;IACxC,+BAAuC;GACxC;EACD;IACE,8BAAuC;IACvC,iCAA0C;GAC3C;EAZD;IAAiC,wBAAmC;GAAI;EACxE;IAAiC,4BAAuC;GAAI;EAC5E;IAAiC,8BAAyC;GAAI;EAC9E;IAAiC,+BAA0C;GAAI;EAC/E;IAAiC,6BAAwC;GAAI;EAC7E;IACE,8BAAwC;IACxC,6BAAuC;GACxC;EACD;IACE,4BAAuC;IACvC,+BAA0C;GAC3C;EAZD;IAAiC,sBAAmC;GAAI;EACxE;IAAiC,0BAAuC;GAAI;EAC5E;IAAiC,4BAAyC;GAAI;EAC9E;IAAiC,6BAA0C;GAAI;EAC/E;IAAiC,2BAAwC;GAAI;EAC7E;IACE,4BAAwC;IACxC,2BAAuC;GACxC;EACD;IACE,0BAAuC;IACvC,6BAA0C;GAC3C;EAZD;IAAiC,4BAAmC;GAAI;EACxE;IAAiC,gCAAuC;GAAI;EAC5E;IAAiC,kCAAyC;GAAI;EAC9E;IAAiC,mCAA0C;GAAI;EAC/E;IAAiC,iCAAwC;GAAI;EAC7E;IACE,kCAAwC;IACxC,iCAAuC;GACxC;EACD;IACE,gCAAuC;IACvC,mCAA0C;GAC3C;EAZD;IAAiC,2BAAmC;GAAI;EACxE;IAAiC,+BAAuC;GAAI;EAC5E;IAAiC,iCAAyC;GAAI;EAC9E;IAAiC,kCAA0C;GAAI;EAC/E;IAAiC,gCAAwC;GAAI;EAC7E;IACE,iCAAwC;IACxC,gCAAuC;GACxC;EACD;IACE,+BAAuC;IACvC,kCAA0C;GAC3C;EAZD;IAAiC,yBAAmC;GAAI;EACxE;IAAiC,6BAAuC;GAAI;EAC5E;IAAiC,+BAAyC;GAAI;EAC9E;IAAiC,gCAA0C;GAAI;EAC/E;IAAiC,8BAAwC;GAAI;EAC7E;IACE,+BAAwC;IACxC,8BAAuC;GACxC;EACD;IACE,6BAAuC;IACvC,gCAA0C;GAC3C;EAZD;IAAiC,2BAAmC;GAAI;EACxE;IAAiC,+BAAuC;GAAI;EAC5E;IAAiC,iCAAyC;GAAI;EAC9E;IAAiC,kCAA0C;GAAI;EAC/E;IAAiC,gCAAwC;GAAI;EAC7E;IACE,iCAAwC;IACxC,gCAAuC;GACxC;EACD;IACE,+BAAuC;IACvC,kCAA0C;GAC3C;EAZD;IAAiC,yBAAmC;GAAI;EACxE;IAAiC,6BAAuC;GAAI;EAC5E;IAAiC,+BAAyC;GAAI;EAC9E;IAAiC,gCAA0C;GAAI;EAC/E;IAAiC,8BAAwC;GAAI;EAC7E;IACE,+BAAwC;IACxC,8BAAuC;GACxC;EACD;IACE,6BAAuC;IACvC,gCAA0C;GAC3C;EAKL;IAAoB,wBAA8B;GAAK;EACvD;IAAoB,4BAA8B;GAAK;EACvD;IAAoB,8BAA8B;GAAK;EACvD;IAAoB,+BAA8B;GAAK;EACvD;IAAoB,6BAA8B;GAAK;EACvD;IACE,8BAA6B;IAC7B,6BAA6B;GAC9B;EACD;IACE,4BAA8B;IAC9B,+BAA8B;GAC/B;ChE8hOJ;;Aa5gOG;EmD/CI;IAAiC,qBAAmC;GAAI;EACxE;IAAiC,yBAAuC;GAAI;EAC5E;IAAiC,2BAAyC;GAAI;EAC9E;IAAiC,4BAA0C;GAAI;EAC/E;IAAiC,0BAAwC;GAAI;EAC7E;IACE,2BAAwC;IACxC,0BAAuC;GACxC;EACD;IACE,yBAAuC;IACvC,4BAA0C;GAC3C;EAZD;IAAiC,2BAAmC;GAAI;EACxE;IAAiC,+BAAuC;GAAI;EAC5E;IAAiC,iCAAyC;GAAI;EAC9E;IAAiC,kCAA0C;GAAI;EAC/E;IAAiC,gCAAwC;GAAI;EAC7E;IACE,iCAAwC;IACxC,gCAAuC;GACxC;EACD;IACE,+BAAuC;IACvC,kCAA0C;GAC3C;EAZD;IAAiC,0BAAmC;GAAI;EACxE;IAAiC,8BAAuC;GAAI;EAC5E;IAAiC,gCAAyC;GAAI;EAC9E;IAAiC,iCAA0C;GAAI;EAC/E;IAAiC,+BAAwC;GAAI;EAC7E;IACE,gCAAwC;IACxC,+BAAuC;GACxC;EACD;IACE,8BAAuC;IACvC,iCAA0C;GAC3C;EAZD;IAAiC,wBAAmC;GAAI;EACxE;IAAiC,4BAAuC;GAAI;EAC5E;IAAiC,8BAAyC;GAAI;EAC9E;IAAiC,+BAA0C;GAAI;EAC/E;IAAiC,6BAAwC;GAAI;EAC7E;IACE,8BAAwC;IACxC,6BAAuC;GACxC;EACD;IACE,4BAAuC;IACvC,+BAA0C;GAC3C;EAZD;IAAiC,0BAAmC;GAAI;EACxE;IAAiC,8BAAuC;GAAI;EAC5E;IAAiC,gCAAyC;GAAI;EAC9E;IAAiC,iCAA0C;GAAI;EAC/E;IAAiC,+BAAwC;GAAI;EAC7E;IACE,gCAAwC;IACxC,+BAAuC;GACxC;EACD;IACE,8BAAuC;IACvC,iCAA0C;GAC3C;EAZD;IAAiC,wBAAmC;GAAI;EACxE;IAAiC,4BAAuC;GAAI;EAC5E;IAAiC,8BAAyC;GAAI;EAC9E;IAAiC,+BAA0C;GAAI;EAC/E;IAAiC,6BAAwC;GAAI;EAC7E;IACE,8BAAwC;IACxC,6BAAuC;GACxC;EACD;IACE,4BAAuC;IACvC,+BAA0C;GAC3C;EAZD;IAAiC,sBAAmC;GAAI;EACxE;IAAiC,0BAAuC;GAAI;EAC5E;IAAiC,4BAAyC;GAAI;EAC9E;IAAiC,6BAA0C;GAAI;EAC/E;IAAiC,2BAAwC;GAAI;EAC7E;IACE,4BAAwC;IACxC,2BAAuC;GACxC;EACD;IACE,0BAAuC;IACvC,6BAA0C;GAC3C;EAZD;IAAiC,4BAAmC;GAAI;EACxE;IAAiC,gCAAuC;GAAI;EAC5E;IAAiC,kCAAyC;GAAI;EAC9E;IAAiC,mCAA0C;GAAI;EAC/E;IAAiC,iCAAwC;GAAI;EAC7E;IACE,kCAAwC;IACxC,iCAAuC;GACxC;EACD;IACE,gCAAuC;IACvC,mCAA0C;GAC3C;EAZD;IAAiC,2BAAmC;GAAI;EACxE;IAAiC,+BAAuC;GAAI;EAC5E;IAAiC,iCAAyC;GAAI;EAC9E;IAAiC,kCAA0C;GAAI;EAC/E;IAAiC,gCAAwC;GAAI;EAC7E;IACE,iCAAwC;IACxC,gCAAuC;GACxC;EACD;IACE,+BAAuC;IACvC,kCAA0C;GAC3C;EAZD;IAAiC,yBAAmC;GAAI;EACxE;IAAiC,6BAAuC;GAAI;EAC5E;IAAiC,+BAAyC;GAAI;EAC9E;IAAiC,gCAA0C;GAAI;EAC/E;IAAiC,8BAAwC;GAAI;EAC7E;IACE,+BAAwC;IACxC,8BAAuC;GACxC;EACD;IACE,6BAAuC;IACvC,gCAA0C;GAC3C;EAZD;IAAiC,2BAAmC;GAAI;EACxE;IAAiC,+BAAuC;GAAI;EAC5E;IAAiC,iCAAyC;GAAI;EAC9E;IAAiC,kCAA0C;GAAI;EAC/E;IAAiC,gCAAwC;GAAI;EAC7E;IACE,iCAAwC;IACxC,gCAAuC;GACxC;EACD;IACE,+BAAuC;IACvC,kCAA0C;GAC3C;EAZD;IAAiC,yBAAmC;GAAI;EACxE;IAAiC,6BAAuC;GAAI;EAC5E;IAAiC,+BAAyC;GAAI;EAC9E;IAAiC,gCAA0C;GAAI;EAC/E;IAAiC,8BAAwC;GAAI;EAC7E;IACE,+BAAwC;IACxC,8BAAuC;GACxC;EACD;IACE,6BAAuC;IACvC,gCAA0C;GAC3C;EAKL;IAAoB,wBAA8B;GAAK;EACvD;IAAoB,4BAA8B;GAAK;EACvD;IAAoB,8BAA8B;GAAK;EACvD;IAAoB,+BAA8B;GAAK;EACvD;IAAoB,6BAA8B;GAAK;EACvD;IACE,8BAA6B;IAC7B,6BAA6B;GAC9B;EACD;IACE,4BAA8B;IAC9B,+BAA8B;GAC/B;ChE40OJ;;AiE52OD;EAAiB,+BAA8B;CAAK;;AACpD;EAAiB,+BAA8B;CAAK;;AACpD;ECJE,iBAAgB;EAChB,wBAAuB;EACvB,oBAAmB;CDEsB;;AAQvC;EAAwB,4BAA2B;CAAK;;AACxD;EAAwB,6BAA4B;CAAK;;AACzD;EAAwB,8BAA6B;CAAK;;ApDsC1D;EoDxCA;IAAwB,4BAA2B;GAAK;EACxD;IAAwB,6BAA4B;GAAK;EACzD;IAAwB,8BAA6B;GAAK;CjEs4O7D;;Aah2OG;EoDxCA;IAAwB,4BAA2B;GAAK;EACxD;IAAwB,6BAA4B;GAAK;EACzD;IAAwB,8BAA6B;GAAK;CjEk5O7D;;Aa52OG;EoDxCA;IAAwB,4BAA2B;GAAK;EACxD;IAAwB,6BAA4B;GAAK;EACzD;IAAwB,8BAA6B;GAAK;CjE85O7D;;Aax3OG;EoDxCA;IAAwB,4BAA2B;GAAK;EACxD;IAAwB,6BAA4B;GAAK;EACzD;IAAwB,8BAA6B;GAAK;CjE06O7D;;AiEp6OD;EAAmB,qCAAoC;CAAK;;AAC5D;EAAmB,qCAAoC;CAAK;;AAC5D;EAAmB,sCAAqC;CAAK;;AAI7D;EAAsB,oB/DmNK;C+DnN+B;;AAC1D;EAAsB,kB/DmNC;C+DnNiC;;AACxD;EAAsB,mBAAkB;CAAK;;AAI7C;EAAc,uBAAsB;CAAK;;AEjCvC;EACE,0BAAwB;CACzB;;AhEiBC;EgEdE,0BAAqC;ChEiBtC;;AgEtBH;EACE,0BAAwB;CACzB;;AhEiBC;EgEdE,0BAAqC;ChEiBtC;;AgEtBH;EACE,0BAAwB;CACzB;;AhEiBC;EgEdE,0BAAqC;ChEiBtC;;AgEtBH;EACE,0BAAwB;CACzB;;AhEiBC;EgEdE,0BAAqC;ChEiBtC;;AgEtBH;EACE,0BAAwB;CACzB;;AhEiBC;EgEdE,0BAAqC;ChEiBtC;;AgEtBH;EACE,0BAAwB;CACzB;;AhEiBC;EgEdE,0BAAqC;ChEiBtC;;AgEtBH;EACE,0BAAwB;CACzB;;AhEiBC;EgEdE,0BAAqC;ChEiBtC;;AgEtBH;EACE,0BAAwB;CACzB;;AhEiBC;EgEdE,0BAAqC;ChEiBtC;;A8DiBL;EAAc,0BAA6B;CAAI;;AAI/C;EG5CE,YAAW;EACX,mBAAkB;EAClB,kBAAiB;EACjB,8BAA6B;EAC7B,UAAS;CH0CV;;AI5CD;ECDE,+BAAkC;CDGnC;;AAED;ECLE,8BAAkC;CDOnC","file":"bootstrap.css","sourcesContent":["/*!\n * Bootstrap v4.0.0-beta (https://getbootstrap.com)\n * Copyright 2011-2017 The Bootstrap Authors\n * Copyright 2011-2017 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n */\n\n@import \"functions\";\n@import \"variables\";\n@import \"mixins\";\n@import \"print\";\n@import \"reboot\";\n@import \"type\";\n@import \"images\";\n@import \"code\";\n@import \"grid\";\n@import \"tables\";\n@import \"forms\";\n@import \"buttons\";\n@import \"transitions\";\n@import \"dropdown\";\n@import \"button-group\";\n@import \"input-group\";\n@import \"custom-forms\";\n@import \"nav\";\n@import \"navbar\";\n@import \"card\";\n@import \"breadcrumb\";\n@import \"pagination\";\n@import \"badge\";\n@import \"jumbotron\";\n@import \"alert\";\n@import \"progress\";\n@import \"media\";\n@import \"list-group\";\n@import \"close\";\n@import \"modal\";\n@import \"tooltip\";\n@import \"popover\";\n@import \"carousel\";\n@import \"utilities\";\n","// scss-lint:disable QualifyingElement\n\n// Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css\n\n// ==========================================================================\n// Print styles.\n// Inlined to avoid the additional HTTP request:\n// http://www.phpied.com/delay-loading-your-print-css/\n// ==========================================================================\n\n@if $enable-print-styles {\n @media print {\n *,\n *::before,\n *::after {\n // Bootstrap specific; comment out `color` and `background`\n //color: #000 !important; // Black prints faster:\n // http://www.sanbeiji.com/archives/953\n text-shadow: none !important;\n //background: transparent !important;\n box-shadow: none !important;\n }\n\n a,\n a:visited {\n text-decoration: underline;\n }\n\n // Bootstrap specific; comment the following selector out\n //a[href]::after {\n // content: \" (\" attr(href) \")\";\n //}\n\n abbr[title]::after {\n content: \" (\" attr(title) \")\";\n }\n\n // Bootstrap specific; comment the following selector out\n //\n // Don't show links that are fragment identifiers,\n // or use the `javascript:` pseudo protocol\n //\n\n //a[href^=\"#\"]::after,\n //a[href^=\"javascript:\"]::after {\n // content: \"\";\n //}\n\n pre {\n white-space: pre-wrap !important;\n }\n pre,\n blockquote {\n border: $border-width solid #999; // Bootstrap custom code; using `$border-width` instead of 1px\n page-break-inside: avoid;\n }\n\n //\n // Printing Tables:\n // http://css-discuss.incutio.com/wiki/Printing_Tables\n //\n\n thead {\n display: table-header-group;\n }\n\n tr,\n img {\n page-break-inside: avoid;\n }\n\n p,\n h2,\n h3 {\n orphans: 3;\n widows: 3;\n }\n\n h2,\n h3 {\n page-break-after: avoid;\n }\n\n // Bootstrap specific changes start\n\n // Bootstrap components\n .navbar {\n display: none;\n }\n .badge {\n border: $border-width solid #000;\n }\n\n .table {\n border-collapse: collapse !important;\n\n td,\n th {\n background-color: #fff !important;\n }\n }\n .table-bordered {\n th,\n td {\n border: 1px solid #ddd !important;\n }\n }\n\n // Bootstrap specific changes end\n }\n}\n","/*!\n * Bootstrap v4.0.0-beta (https://getbootstrap.com)\n * Copyright 2011-2017 The Bootstrap Authors\n * Copyright 2011-2017 Twitter, Inc.\n * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)\n */\n@media print {\n *,\n *::before,\n *::after {\n text-shadow: none !important;\n box-shadow: none !important;\n }\n a,\n a:visited {\n text-decoration: underline;\n }\n abbr[title]::after {\n content: \" (\" attr(title) \")\";\n }\n pre {\n white-space: pre-wrap !important;\n }\n pre,\n blockquote {\n border: 1px solid #999;\n page-break-inside: avoid;\n }\n thead {\n display: table-header-group;\n }\n tr,\n img {\n page-break-inside: avoid;\n }\n p,\n h2,\n h3 {\n orphans: 3;\n widows: 3;\n }\n h2,\n h3 {\n page-break-after: avoid;\n }\n .navbar {\n display: none;\n }\n .badge {\n border: 1px solid #000;\n }\n .table {\n border-collapse: collapse !important;\n }\n .table td,\n .table th {\n background-color: #fff !important;\n }\n .table-bordered th,\n .table-bordered td {\n border: 1px solid #ddd !important;\n }\n}\n\nhtml {\n box-sizing: border-box;\n font-family: sans-serif;\n line-height: 1.15;\n -webkit-text-size-adjust: 100%;\n -ms-text-size-adjust: 100%;\n -ms-overflow-style: scrollbar;\n -webkit-tap-highlight-color: transparent;\n}\n\n*,\n*::before,\n*::after {\n box-sizing: inherit;\n}\n\n@-ms-viewport {\n width: device-width;\n}\n\narticle, aside, dialog, figcaption, figure, footer, header, hgroup, main, nav, section {\n display: block;\n}\n\nbody {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;\n font-size: 1rem;\n font-weight: normal;\n line-height: 1.5;\n color: #212529;\n background-color: #fff;\n}\n\n[tabindex=\"-1\"]:focus {\n outline: none !important;\n}\n\nhr {\n box-sizing: content-box;\n height: 0;\n overflow: visible;\n}\n\nh1, h2, h3, h4, h5, h6 {\n margin-top: 0;\n margin-bottom: .5rem;\n}\n\np {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nabbr[title],\nabbr[data-original-title] {\n text-decoration: underline;\n text-decoration: underline dotted;\n cursor: help;\n border-bottom: 0;\n}\n\naddress {\n margin-bottom: 1rem;\n font-style: normal;\n line-height: inherit;\n}\n\nol,\nul,\ndl {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nol ol,\nul ul,\nol ul,\nul ol {\n margin-bottom: 0;\n}\n\ndt {\n font-weight: bold;\n}\n\ndd {\n margin-bottom: .5rem;\n margin-left: 0;\n}\n\nblockquote {\n margin: 0 0 1rem;\n}\n\ndfn {\n font-style: italic;\n}\n\nb,\nstrong {\n font-weight: bolder;\n}\n\nsmall {\n font-size: 80%;\n}\n\nsub,\nsup {\n position: relative;\n font-size: 75%;\n line-height: 0;\n vertical-align: baseline;\n}\n\nsub {\n bottom: -.25em;\n}\n\nsup {\n top: -.5em;\n}\n\na {\n color: #007bff;\n text-decoration: none;\n background-color: transparent;\n -webkit-text-decoration-skip: objects;\n}\n\na:hover {\n color: #0056b3;\n text-decoration: underline;\n}\n\na:not([href]):not([tabindex]) {\n color: inherit;\n text-decoration: none;\n}\n\na:not([href]):not([tabindex]):focus, a:not([href]):not([tabindex]):hover {\n color: inherit;\n text-decoration: none;\n}\n\na:not([href]):not([tabindex]):focus {\n outline: 0;\n}\n\npre,\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace;\n font-size: 1em;\n}\n\npre {\n margin-top: 0;\n margin-bottom: 1rem;\n overflow: auto;\n}\n\nfigure {\n margin: 0 0 1rem;\n}\n\nimg {\n vertical-align: middle;\n border-style: none;\n}\n\nsvg:not(:root) {\n overflow: hidden;\n}\n\na,\narea,\nbutton,\n[role=\"button\"],\ninput,\nlabel,\nselect,\nsummary,\ntextarea {\n touch-action: manipulation;\n}\n\ntable {\n border-collapse: collapse;\n}\n\ncaption {\n padding-top: 0.75rem;\n padding-bottom: 0.75rem;\n color: #868e96;\n text-align: left;\n caption-side: bottom;\n}\n\nth {\n text-align: left;\n}\n\nlabel {\n display: inline-block;\n margin-bottom: .5rem;\n}\n\nbutton:focus {\n outline: 1px dotted;\n outline: 5px auto -webkit-focus-ring-color;\n}\n\ninput,\nbutton,\nselect,\noptgroup,\ntextarea {\n margin: 0;\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n}\n\nbutton,\ninput {\n overflow: visible;\n}\n\nbutton,\nselect {\n text-transform: none;\n}\n\nbutton,\nhtml [type=\"button\"],\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button;\n}\n\nbutton::-moz-focus-inner,\n[type=\"button\"]::-moz-focus-inner,\n[type=\"reset\"]::-moz-focus-inner,\n[type=\"submit\"]::-moz-focus-inner {\n padding: 0;\n border-style: none;\n}\n\ninput[type=\"radio\"],\ninput[type=\"checkbox\"] {\n box-sizing: border-box;\n padding: 0;\n}\n\ninput[type=\"date\"],\ninput[type=\"time\"],\ninput[type=\"datetime-local\"],\ninput[type=\"month\"] {\n -webkit-appearance: listbox;\n}\n\ntextarea {\n overflow: auto;\n resize: vertical;\n}\n\nfieldset {\n min-width: 0;\n padding: 0;\n margin: 0;\n border: 0;\n}\n\nlegend {\n display: block;\n width: 100%;\n max-width: 100%;\n padding: 0;\n margin-bottom: .5rem;\n font-size: 1.5rem;\n line-height: inherit;\n color: inherit;\n white-space: normal;\n}\n\nprogress {\n vertical-align: baseline;\n}\n\n[type=\"number\"]::-webkit-inner-spin-button,\n[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n[type=\"search\"] {\n outline-offset: -2px;\n -webkit-appearance: none;\n}\n\n[type=\"search\"]::-webkit-search-cancel-button,\n[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n::-webkit-file-upload-button {\n font: inherit;\n -webkit-appearance: button;\n}\n\noutput {\n display: inline-block;\n}\n\nsummary {\n display: list-item;\n}\n\ntemplate {\n display: none;\n}\n\n[hidden] {\n display: none !important;\n}\n\nh1, h2, h3, h4, h5, h6,\n.h1, .h2, .h3, .h4, .h5, .h6 {\n margin-bottom: 0.5rem;\n font-family: inherit;\n font-weight: 500;\n line-height: 1.1;\n color: inherit;\n}\n\nh1, .h1 {\n font-size: 2.5rem;\n}\n\nh2, .h2 {\n font-size: 2rem;\n}\n\nh3, .h3 {\n font-size: 1.75rem;\n}\n\nh4, .h4 {\n font-size: 1.5rem;\n}\n\nh5, .h5 {\n font-size: 1.25rem;\n}\n\nh6, .h6 {\n font-size: 1rem;\n}\n\n.lead {\n font-size: 1.25rem;\n font-weight: 300;\n}\n\n.display-1 {\n font-size: 6rem;\n font-weight: 300;\n line-height: 1.1;\n}\n\n.display-2 {\n font-size: 5.5rem;\n font-weight: 300;\n line-height: 1.1;\n}\n\n.display-3 {\n font-size: 4.5rem;\n font-weight: 300;\n line-height: 1.1;\n}\n\n.display-4 {\n font-size: 3.5rem;\n font-weight: 300;\n line-height: 1.1;\n}\n\nhr {\n margin-top: 1rem;\n margin-bottom: 1rem;\n border: 0;\n border-top: 1px solid rgba(0, 0, 0, 0.1);\n}\n\nsmall,\n.small {\n font-size: 80%;\n font-weight: normal;\n}\n\nmark,\n.mark {\n padding: 0.2em;\n background-color: #fcf8e3;\n}\n\n.list-unstyled {\n padding-left: 0;\n list-style: none;\n}\n\n.list-inline {\n padding-left: 0;\n list-style: none;\n}\n\n.list-inline-item {\n display: inline-block;\n}\n\n.list-inline-item:not(:last-child) {\n margin-right: 5px;\n}\n\n.initialism {\n font-size: 90%;\n text-transform: uppercase;\n}\n\n.blockquote {\n margin-bottom: 1rem;\n font-size: 1.25rem;\n}\n\n.blockquote-footer {\n display: block;\n font-size: 80%;\n color: #868e96;\n}\n\n.blockquote-footer::before {\n content: \"\\2014 \\00A0\";\n}\n\n.img-fluid {\n max-width: 100%;\n height: auto;\n}\n\n.img-thumbnail {\n padding: 0.25rem;\n background-color: #fff;\n border: 1px solid #ddd;\n border-radius: 0.25rem;\n transition: all 0.2s ease-in-out;\n max-width: 100%;\n height: auto;\n}\n\n.figure {\n display: inline-block;\n}\n\n.figure-img {\n margin-bottom: 0.5rem;\n line-height: 1;\n}\n\n.figure-caption {\n font-size: 90%;\n color: #868e96;\n}\n\ncode,\nkbd,\npre,\nsamp {\n font-family: Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace;\n}\n\ncode {\n padding: 0.2rem 0.4rem;\n font-size: 90%;\n color: #bd4147;\n background-color: #f8f9fa;\n border-radius: 0.25rem;\n}\n\na > code {\n padding: 0;\n color: inherit;\n background-color: inherit;\n}\n\nkbd {\n padding: 0.2rem 0.4rem;\n font-size: 90%;\n color: #fff;\n background-color: #212529;\n border-radius: 0.2rem;\n}\n\nkbd kbd {\n padding: 0;\n font-size: 100%;\n font-weight: bold;\n}\n\npre {\n display: block;\n margin-top: 0;\n margin-bottom: 1rem;\n font-size: 90%;\n color: #212529;\n}\n\npre code {\n padding: 0;\n font-size: inherit;\n color: inherit;\n background-color: transparent;\n border-radius: 0;\n}\n\n.pre-scrollable {\n max-height: 340px;\n overflow-y: scroll;\n}\n\n.container {\n margin-right: auto;\n margin-left: auto;\n padding-right: 15px;\n padding-left: 15px;\n width: 100%;\n}\n\n@media (min-width: 576px) {\n .container {\n max-width: 540px;\n }\n}\n\n@media (min-width: 768px) {\n .container {\n max-width: 720px;\n }\n}\n\n@media (min-width: 992px) {\n .container {\n max-width: 960px;\n }\n}\n\n@media (min-width: 1200px) {\n .container {\n max-width: 1140px;\n }\n}\n\n.container-fluid {\n width: 100%;\n margin-right: auto;\n margin-left: auto;\n padding-right: 15px;\n padding-left: 15px;\n width: 100%;\n}\n\n.row {\n display: flex;\n flex-wrap: wrap;\n margin-right: -15px;\n margin-left: -15px;\n}\n\n.no-gutters {\n margin-right: 0;\n margin-left: 0;\n}\n\n.no-gutters > .col,\n.no-gutters > [class*=\"col-\"] {\n padding-right: 0;\n padding-left: 0;\n}\n\n.col-1, .col-2, .col-3, .col-4, .col-5, .col-6, .col-7, .col-8, .col-9, .col-10, .col-11, .col-12, .col,\n.col-auto, .col-sm-1, .col-sm-2, .col-sm-3, .col-sm-4, .col-sm-5, .col-sm-6, .col-sm-7, .col-sm-8, .col-sm-9, .col-sm-10, .col-sm-11, .col-sm-12, .col-sm,\n.col-sm-auto, .col-md-1, .col-md-2, .col-md-3, .col-md-4, .col-md-5, .col-md-6, .col-md-7, .col-md-8, .col-md-9, .col-md-10, .col-md-11, .col-md-12, .col-md,\n.col-md-auto, .col-lg-1, .col-lg-2, .col-lg-3, .col-lg-4, .col-lg-5, .col-lg-6, .col-lg-7, .col-lg-8, .col-lg-9, .col-lg-10, .col-lg-11, .col-lg-12, .col-lg,\n.col-lg-auto, .col-xl-1, .col-xl-2, .col-xl-3, .col-xl-4, .col-xl-5, .col-xl-6, .col-xl-7, .col-xl-8, .col-xl-9, .col-xl-10, .col-xl-11, .col-xl-12, .col-xl,\n.col-xl-auto {\n position: relative;\n width: 100%;\n min-height: 1px;\n padding-right: 15px;\n padding-left: 15px;\n}\n\n.col {\n flex-basis: 0;\n flex-grow: 1;\n max-width: 100%;\n}\n\n.col-auto {\n flex: 0 0 auto;\n width: auto;\n max-width: none;\n}\n\n.col-1 {\n flex: 0 0 8.333333%;\n max-width: 8.333333%;\n}\n\n.col-2 {\n flex: 0 0 16.666667%;\n max-width: 16.666667%;\n}\n\n.col-3 {\n flex: 0 0 25%;\n max-width: 25%;\n}\n\n.col-4 {\n flex: 0 0 33.333333%;\n max-width: 33.333333%;\n}\n\n.col-5 {\n flex: 0 0 41.666667%;\n max-width: 41.666667%;\n}\n\n.col-6 {\n flex: 0 0 50%;\n max-width: 50%;\n}\n\n.col-7 {\n flex: 0 0 58.333333%;\n max-width: 58.333333%;\n}\n\n.col-8 {\n flex: 0 0 66.666667%;\n max-width: 66.666667%;\n}\n\n.col-9 {\n flex: 0 0 75%;\n max-width: 75%;\n}\n\n.col-10 {\n flex: 0 0 83.333333%;\n max-width: 83.333333%;\n}\n\n.col-11 {\n flex: 0 0 91.666667%;\n max-width: 91.666667%;\n}\n\n.col-12 {\n flex: 0 0 100%;\n max-width: 100%;\n}\n\n.order-1 {\n order: 1;\n}\n\n.order-2 {\n order: 2;\n}\n\n.order-3 {\n order: 3;\n}\n\n.order-4 {\n order: 4;\n}\n\n.order-5 {\n order: 5;\n}\n\n.order-6 {\n order: 6;\n}\n\n.order-7 {\n order: 7;\n}\n\n.order-8 {\n order: 8;\n}\n\n.order-9 {\n order: 9;\n}\n\n.order-10 {\n order: 10;\n}\n\n.order-11 {\n order: 11;\n}\n\n.order-12 {\n order: 12;\n}\n\n@media (min-width: 576px) {\n .col-sm {\n flex-basis: 0;\n flex-grow: 1;\n max-width: 100%;\n }\n .col-sm-auto {\n flex: 0 0 auto;\n width: auto;\n max-width: none;\n }\n .col-sm-1 {\n flex: 0 0 8.333333%;\n max-width: 8.333333%;\n }\n .col-sm-2 {\n flex: 0 0 16.666667%;\n max-width: 16.666667%;\n }\n .col-sm-3 {\n flex: 0 0 25%;\n max-width: 25%;\n }\n .col-sm-4 {\n flex: 0 0 33.333333%;\n max-width: 33.333333%;\n }\n .col-sm-5 {\n flex: 0 0 41.666667%;\n max-width: 41.666667%;\n }\n .col-sm-6 {\n flex: 0 0 50%;\n max-width: 50%;\n }\n .col-sm-7 {\n flex: 0 0 58.333333%;\n max-width: 58.333333%;\n }\n .col-sm-8 {\n flex: 0 0 66.666667%;\n max-width: 66.666667%;\n }\n .col-sm-9 {\n flex: 0 0 75%;\n max-width: 75%;\n }\n .col-sm-10 {\n flex: 0 0 83.333333%;\n max-width: 83.333333%;\n }\n .col-sm-11 {\n flex: 0 0 91.666667%;\n max-width: 91.666667%;\n }\n .col-sm-12 {\n flex: 0 0 100%;\n max-width: 100%;\n }\n .order-sm-1 {\n order: 1;\n }\n .order-sm-2 {\n order: 2;\n }\n .order-sm-3 {\n order: 3;\n }\n .order-sm-4 {\n order: 4;\n }\n .order-sm-5 {\n order: 5;\n }\n .order-sm-6 {\n order: 6;\n }\n .order-sm-7 {\n order: 7;\n }\n .order-sm-8 {\n order: 8;\n }\n .order-sm-9 {\n order: 9;\n }\n .order-sm-10 {\n order: 10;\n }\n .order-sm-11 {\n order: 11;\n }\n .order-sm-12 {\n order: 12;\n }\n}\n\n@media (min-width: 768px) {\n .col-md {\n flex-basis: 0;\n flex-grow: 1;\n max-width: 100%;\n }\n .col-md-auto {\n flex: 0 0 auto;\n width: auto;\n max-width: none;\n }\n .col-md-1 {\n flex: 0 0 8.333333%;\n max-width: 8.333333%;\n }\n .col-md-2 {\n flex: 0 0 16.666667%;\n max-width: 16.666667%;\n }\n .col-md-3 {\n flex: 0 0 25%;\n max-width: 25%;\n }\n .col-md-4 {\n flex: 0 0 33.333333%;\n max-width: 33.333333%;\n }\n .col-md-5 {\n flex: 0 0 41.666667%;\n max-width: 41.666667%;\n }\n .col-md-6 {\n flex: 0 0 50%;\n max-width: 50%;\n }\n .col-md-7 {\n flex: 0 0 58.333333%;\n max-width: 58.333333%;\n }\n .col-md-8 {\n flex: 0 0 66.666667%;\n max-width: 66.666667%;\n }\n .col-md-9 {\n flex: 0 0 75%;\n max-width: 75%;\n }\n .col-md-10 {\n flex: 0 0 83.333333%;\n max-width: 83.333333%;\n }\n .col-md-11 {\n flex: 0 0 91.666667%;\n max-width: 91.666667%;\n }\n .col-md-12 {\n flex: 0 0 100%;\n max-width: 100%;\n }\n .order-md-1 {\n order: 1;\n }\n .order-md-2 {\n order: 2;\n }\n .order-md-3 {\n order: 3;\n }\n .order-md-4 {\n order: 4;\n }\n .order-md-5 {\n order: 5;\n }\n .order-md-6 {\n order: 6;\n }\n .order-md-7 {\n order: 7;\n }\n .order-md-8 {\n order: 8;\n }\n .order-md-9 {\n order: 9;\n }\n .order-md-10 {\n order: 10;\n }\n .order-md-11 {\n order: 11;\n }\n .order-md-12 {\n order: 12;\n }\n}\n\n@media (min-width: 992px) {\n .col-lg {\n flex-basis: 0;\n flex-grow: 1;\n max-width: 100%;\n }\n .col-lg-auto {\n flex: 0 0 auto;\n width: auto;\n max-width: none;\n }\n .col-lg-1 {\n flex: 0 0 8.333333%;\n max-width: 8.333333%;\n }\n .col-lg-2 {\n flex: 0 0 16.666667%;\n max-width: 16.666667%;\n }\n .col-lg-3 {\n flex: 0 0 25%;\n max-width: 25%;\n }\n .col-lg-4 {\n flex: 0 0 33.333333%;\n max-width: 33.333333%;\n }\n .col-lg-5 {\n flex: 0 0 41.666667%;\n max-width: 41.666667%;\n }\n .col-lg-6 {\n flex: 0 0 50%;\n max-width: 50%;\n }\n .col-lg-7 {\n flex: 0 0 58.333333%;\n max-width: 58.333333%;\n }\n .col-lg-8 {\n flex: 0 0 66.666667%;\n max-width: 66.666667%;\n }\n .col-lg-9 {\n flex: 0 0 75%;\n max-width: 75%;\n }\n .col-lg-10 {\n flex: 0 0 83.333333%;\n max-width: 83.333333%;\n }\n .col-lg-11 {\n flex: 0 0 91.666667%;\n max-width: 91.666667%;\n }\n .col-lg-12 {\n flex: 0 0 100%;\n max-width: 100%;\n }\n .order-lg-1 {\n order: 1;\n }\n .order-lg-2 {\n order: 2;\n }\n .order-lg-3 {\n order: 3;\n }\n .order-lg-4 {\n order: 4;\n }\n .order-lg-5 {\n order: 5;\n }\n .order-lg-6 {\n order: 6;\n }\n .order-lg-7 {\n order: 7;\n }\n .order-lg-8 {\n order: 8;\n }\n .order-lg-9 {\n order: 9;\n }\n .order-lg-10 {\n order: 10;\n }\n .order-lg-11 {\n order: 11;\n }\n .order-lg-12 {\n order: 12;\n }\n}\n\n@media (min-width: 1200px) {\n .col-xl {\n flex-basis: 0;\n flex-grow: 1;\n max-width: 100%;\n }\n .col-xl-auto {\n flex: 0 0 auto;\n width: auto;\n max-width: none;\n }\n .col-xl-1 {\n flex: 0 0 8.333333%;\n max-width: 8.333333%;\n }\n .col-xl-2 {\n flex: 0 0 16.666667%;\n max-width: 16.666667%;\n }\n .col-xl-3 {\n flex: 0 0 25%;\n max-width: 25%;\n }\n .col-xl-4 {\n flex: 0 0 33.333333%;\n max-width: 33.333333%;\n }\n .col-xl-5 {\n flex: 0 0 41.666667%;\n max-width: 41.666667%;\n }\n .col-xl-6 {\n flex: 0 0 50%;\n max-width: 50%;\n }\n .col-xl-7 {\n flex: 0 0 58.333333%;\n max-width: 58.333333%;\n }\n .col-xl-8 {\n flex: 0 0 66.666667%;\n max-width: 66.666667%;\n }\n .col-xl-9 {\n flex: 0 0 75%;\n max-width: 75%;\n }\n .col-xl-10 {\n flex: 0 0 83.333333%;\n max-width: 83.333333%;\n }\n .col-xl-11 {\n flex: 0 0 91.666667%;\n max-width: 91.666667%;\n }\n .col-xl-12 {\n flex: 0 0 100%;\n max-width: 100%;\n }\n .order-xl-1 {\n order: 1;\n }\n .order-xl-2 {\n order: 2;\n }\n .order-xl-3 {\n order: 3;\n }\n .order-xl-4 {\n order: 4;\n }\n .order-xl-5 {\n order: 5;\n }\n .order-xl-6 {\n order: 6;\n }\n .order-xl-7 {\n order: 7;\n }\n .order-xl-8 {\n order: 8;\n }\n .order-xl-9 {\n order: 9;\n }\n .order-xl-10 {\n order: 10;\n }\n .order-xl-11 {\n order: 11;\n }\n .order-xl-12 {\n order: 12;\n }\n}\n\n.table {\n width: 100%;\n max-width: 100%;\n margin-bottom: 1rem;\n background-color: transparent;\n}\n\n.table th,\n.table td {\n padding: 0.75rem;\n vertical-align: top;\n border-top: 1px solid #e9ecef;\n}\n\n.table thead th {\n vertical-align: bottom;\n border-bottom: 2px solid #e9ecef;\n}\n\n.table tbody + tbody {\n border-top: 2px solid #e9ecef;\n}\n\n.table .table {\n background-color: #fff;\n}\n\n.table-sm th,\n.table-sm td {\n padding: 0.3rem;\n}\n\n.table-bordered {\n border: 1px solid #e9ecef;\n}\n\n.table-bordered th,\n.table-bordered td {\n border: 1px solid #e9ecef;\n}\n\n.table-bordered thead th,\n.table-bordered thead td {\n border-bottom-width: 2px;\n}\n\n.table-striped tbody tr:nth-of-type(odd) {\n background-color: rgba(0, 0, 0, 0.05);\n}\n\n.table-hover tbody tr:hover {\n background-color: rgba(0, 0, 0, 0.075);\n}\n\n.table-primary,\n.table-primary > th,\n.table-primary > td {\n background-color: #b8daff;\n}\n\n.table-hover .table-primary:hover {\n background-color: #9fcdff;\n}\n\n.table-hover .table-primary:hover > td,\n.table-hover .table-primary:hover > th {\n background-color: #9fcdff;\n}\n\n.table-secondary,\n.table-secondary > th,\n.table-secondary > td {\n background-color: #dddfe2;\n}\n\n.table-hover .table-secondary:hover {\n background-color: #cfd2d6;\n}\n\n.table-hover .table-secondary:hover > td,\n.table-hover .table-secondary:hover > th {\n background-color: #cfd2d6;\n}\n\n.table-success,\n.table-success > th,\n.table-success > td {\n background-color: #c3e6cb;\n}\n\n.table-hover .table-success:hover {\n background-color: #b1dfbb;\n}\n\n.table-hover .table-success:hover > td,\n.table-hover .table-success:hover > th {\n background-color: #b1dfbb;\n}\n\n.table-info,\n.table-info > th,\n.table-info > td {\n background-color: #bee5eb;\n}\n\n.table-hover .table-info:hover {\n background-color: #abdde5;\n}\n\n.table-hover .table-info:hover > td,\n.table-hover .table-info:hover > th {\n background-color: #abdde5;\n}\n\n.table-warning,\n.table-warning > th,\n.table-warning > td {\n background-color: #ffeeba;\n}\n\n.table-hover .table-warning:hover {\n background-color: #ffe8a1;\n}\n\n.table-hover .table-warning:hover > td,\n.table-hover .table-warning:hover > th {\n background-color: #ffe8a1;\n}\n\n.table-danger,\n.table-danger > th,\n.table-danger > td {\n background-color: #f5c6cb;\n}\n\n.table-hover .table-danger:hover {\n background-color: #f1b0b7;\n}\n\n.table-hover .table-danger:hover > td,\n.table-hover .table-danger:hover > th {\n background-color: #f1b0b7;\n}\n\n.table-light,\n.table-light > th,\n.table-light > td {\n background-color: #fdfdfe;\n}\n\n.table-hover .table-light:hover {\n background-color: #ececf6;\n}\n\n.table-hover .table-light:hover > td,\n.table-hover .table-light:hover > th {\n background-color: #ececf6;\n}\n\n.table-dark,\n.table-dark > th,\n.table-dark > td {\n background-color: #c6c8ca;\n}\n\n.table-hover .table-dark:hover {\n background-color: #b9bbbe;\n}\n\n.table-hover .table-dark:hover > td,\n.table-hover .table-dark:hover > th {\n background-color: #b9bbbe;\n}\n\n.table-active,\n.table-active > th,\n.table-active > td {\n background-color: rgba(0, 0, 0, 0.075);\n}\n\n.table-hover .table-active:hover {\n background-color: rgba(0, 0, 0, 0.075);\n}\n\n.table-hover .table-active:hover > td,\n.table-hover .table-active:hover > th {\n background-color: rgba(0, 0, 0, 0.075);\n}\n\n.thead-inverse th {\n color: #fff;\n background-color: #212529;\n}\n\n.thead-default th {\n color: #495057;\n background-color: #e9ecef;\n}\n\n.table-inverse {\n color: #fff;\n background-color: #212529;\n}\n\n.table-inverse th,\n.table-inverse td,\n.table-inverse thead th {\n border-color: #32383e;\n}\n\n.table-inverse.table-bordered {\n border: 0;\n}\n\n.table-inverse.table-striped tbody tr:nth-of-type(odd) {\n background-color: rgba(255, 255, 255, 0.05);\n}\n\n.table-inverse.table-hover tbody tr:hover {\n background-color: rgba(255, 255, 255, 0.075);\n}\n\n@media (max-width: 991px) {\n .table-responsive {\n display: block;\n width: 100%;\n overflow-x: auto;\n -ms-overflow-style: -ms-autohiding-scrollbar;\n }\n .table-responsive.table-bordered {\n border: 0;\n }\n}\n\n.form-control {\n display: block;\n width: 100%;\n padding: 0.5rem 0.75rem;\n font-size: 1rem;\n line-height: 1.25;\n color: #495057;\n background-color: #fff;\n background-image: none;\n background-clip: padding-box;\n border: 1px solid rgba(0, 0, 0, 0.15);\n border-radius: 0.25rem;\n transition: border-color ease-in-out 0.15s, box-shadow ease-in-out 0.15s;\n}\n\n.form-control::-ms-expand {\n background-color: transparent;\n border: 0;\n}\n\n.form-control:focus {\n color: #495057;\n background-color: #fff;\n border-color: #80bdff;\n outline: none;\n}\n\n.form-control::placeholder {\n color: #868e96;\n opacity: 1;\n}\n\n.form-control:disabled, .form-control[readonly] {\n background-color: #e9ecef;\n opacity: 1;\n}\n\nselect.form-control:not([size]):not([multiple]) {\n height: calc(2.25rem + 2px);\n}\n\nselect.form-control:focus::-ms-value {\n color: #495057;\n background-color: #fff;\n}\n\n.form-control-file,\n.form-control-range {\n display: block;\n}\n\n.col-form-label {\n padding-top: calc(0.5rem - 1px * 2);\n padding-bottom: calc(0.5rem - 1px * 2);\n margin-bottom: 0;\n}\n\n.col-form-label-lg {\n padding-top: calc(0.5rem - 1px * 2);\n padding-bottom: calc(0.5rem - 1px * 2);\n font-size: 1.25rem;\n}\n\n.col-form-label-sm {\n padding-top: calc(0.25rem - 1px * 2);\n padding-bottom: calc(0.25rem - 1px * 2);\n font-size: 0.875rem;\n}\n\n.col-form-legend {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n margin-bottom: 0;\n font-size: 1rem;\n}\n\n.form-control-plaintext {\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n margin-bottom: 0;\n line-height: 1.25;\n border: solid transparent;\n border-width: 1px 0;\n}\n\n.form-control-plaintext.form-control-sm, .input-group-sm > .form-control-plaintext.form-control,\n.input-group-sm > .form-control-plaintext.input-group-addon,\n.input-group-sm > .input-group-btn > .form-control-plaintext.btn, .form-control-plaintext.form-control-lg, .input-group-lg > .form-control-plaintext.form-control,\n.input-group-lg > .form-control-plaintext.input-group-addon,\n.input-group-lg > .input-group-btn > .form-control-plaintext.btn {\n padding-right: 0;\n padding-left: 0;\n}\n\n.form-control-sm, .input-group-sm > .form-control,\n.input-group-sm > .input-group-addon,\n.input-group-sm > .input-group-btn > .btn {\n padding: 0.25rem 0.5rem;\n font-size: 0.875rem;\n line-height: 1.5;\n border-radius: 0.2rem;\n}\n\nselect.form-control-sm:not([size]):not([multiple]), .input-group-sm > select.form-control:not([size]):not([multiple]),\n.input-group-sm > select.input-group-addon:not([size]):not([multiple]),\n.input-group-sm > .input-group-btn > select.btn:not([size]):not([multiple]) {\n height: calc(1.8125rem + 2px);\n}\n\n.form-control-lg, .input-group-lg > .form-control,\n.input-group-lg > .input-group-addon,\n.input-group-lg > .input-group-btn > .btn {\n padding: 0.5rem 1rem;\n font-size: 1.25rem;\n line-height: 1.5;\n border-radius: 0.3rem;\n}\n\nselect.form-control-lg:not([size]):not([multiple]), .input-group-lg > select.form-control:not([size]):not([multiple]),\n.input-group-lg > select.input-group-addon:not([size]):not([multiple]),\n.input-group-lg > .input-group-btn > select.btn:not([size]):not([multiple]) {\n height: calc(2.3125rem + 2px);\n}\n\n.form-group {\n margin-bottom: 1rem;\n}\n\n.form-text {\n display: block;\n margin-top: 0.25rem;\n}\n\n.form-row {\n display: flex;\n flex-wrap: wrap;\n margin-right: -5px;\n margin-left: -5px;\n}\n\n.form-row > .col,\n.form-row > [class*=\"col-\"] {\n padding-right: 5px;\n padding-left: 5px;\n}\n\n.form-check {\n position: relative;\n display: block;\n margin-bottom: 0.5rem;\n}\n\n.form-check.disabled .form-check-label {\n color: #868e96;\n}\n\n.form-check-label {\n padding-left: 1.25rem;\n margin-bottom: 0;\n}\n\n.form-check-input {\n position: absolute;\n margin-top: 0.25rem;\n margin-left: -1.25rem;\n}\n\n.form-check-input:only-child {\n position: static;\n}\n\n.form-check-inline {\n display: inline-block;\n}\n\n.form-check-inline .form-check-label {\n vertical-align: middle;\n}\n\n.form-check-inline + .form-check-inline {\n margin-left: 0.75rem;\n}\n\n.invalid-feedback {\n display: none;\n margin-top: .25rem;\n font-size: .875rem;\n color: #dc3545;\n}\n\n.invalid-tooltip {\n position: absolute;\n top: 100%;\n z-index: 5;\n display: none;\n width: 250px;\n padding: .5rem;\n margin-top: .1rem;\n font-size: .875rem;\n line-height: 1;\n color: #fff;\n background-color: rgba(220, 53, 69, 0.8);\n border-radius: .2rem;\n}\n\n.was-validated .form-control:valid, .form-control.is-valid, .was-validated\n.custom-select:valid,\n.custom-select.is-valid {\n border-color: #28a745;\n}\n\n.was-validated .form-control:valid:focus, .form-control.is-valid:focus, .was-validated\n.custom-select:valid:focus,\n.custom-select.is-valid:focus {\n box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);\n}\n\n.was-validated .form-control:valid ~ .invalid-feedback,\n.was-validated .form-control:valid ~ .invalid-tooltip, .form-control.is-valid ~ .invalid-feedback,\n.form-control.is-valid ~ .invalid-tooltip, .was-validated\n.custom-select:valid ~ .invalid-feedback,\n.was-validated\n.custom-select:valid ~ .invalid-tooltip,\n.custom-select.is-valid ~ .invalid-feedback,\n.custom-select.is-valid ~ .invalid-tooltip {\n display: block;\n}\n\n.was-validated .form-check-input:valid + .form-check-label, .form-check-input.is-valid + .form-check-label {\n color: #28a745;\n}\n\n.was-validated .custom-control-input:valid ~ .custom-control-indicator, .custom-control-input.is-valid ~ .custom-control-indicator {\n background-color: rgba(40, 167, 69, 0.25);\n}\n\n.was-validated .custom-control-input:valid ~ .custom-control-description, .custom-control-input.is-valid ~ .custom-control-description {\n color: #28a745;\n}\n\n.was-validated .custom-file-input:valid ~ .custom-file-control, .custom-file-input.is-valid ~ .custom-file-control {\n border-color: #28a745;\n}\n\n.was-validated .custom-file-input:valid ~ .custom-file-control::before, .custom-file-input.is-valid ~ .custom-file-control::before {\n border-color: inherit;\n}\n\n.was-validated .custom-file-input:valid:focus, .custom-file-input.is-valid:focus {\n box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25);\n}\n\n.was-validated .form-control:invalid, .form-control.is-invalid, .was-validated\n.custom-select:invalid,\n.custom-select.is-invalid {\n border-color: #dc3545;\n}\n\n.was-validated .form-control:invalid:focus, .form-control.is-invalid:focus, .was-validated\n.custom-select:invalid:focus,\n.custom-select.is-invalid:focus {\n box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);\n}\n\n.was-validated .form-control:invalid ~ .invalid-feedback,\n.was-validated .form-control:invalid ~ .invalid-tooltip, .form-control.is-invalid ~ .invalid-feedback,\n.form-control.is-invalid ~ .invalid-tooltip, .was-validated\n.custom-select:invalid ~ .invalid-feedback,\n.was-validated\n.custom-select:invalid ~ .invalid-tooltip,\n.custom-select.is-invalid ~ .invalid-feedback,\n.custom-select.is-invalid ~ .invalid-tooltip {\n display: block;\n}\n\n.was-validated .form-check-input:invalid + .form-check-label, .form-check-input.is-invalid + .form-check-label {\n color: #dc3545;\n}\n\n.was-validated .custom-control-input:invalid ~ .custom-control-indicator, .custom-control-input.is-invalid ~ .custom-control-indicator {\n background-color: rgba(220, 53, 69, 0.25);\n}\n\n.was-validated .custom-control-input:invalid ~ .custom-control-description, .custom-control-input.is-invalid ~ .custom-control-description {\n color: #dc3545;\n}\n\n.was-validated .custom-file-input:invalid ~ .custom-file-control, .custom-file-input.is-invalid ~ .custom-file-control {\n border-color: #dc3545;\n}\n\n.was-validated .custom-file-input:invalid ~ .custom-file-control::before, .custom-file-input.is-invalid ~ .custom-file-control::before {\n border-color: inherit;\n}\n\n.was-validated .custom-file-input:invalid:focus, .custom-file-input.is-invalid:focus {\n box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);\n}\n\n.form-inline {\n display: flex;\n flex-flow: row wrap;\n align-items: center;\n}\n\n.form-inline .form-check {\n width: 100%;\n}\n\n@media (min-width: 576px) {\n .form-inline label {\n display: flex;\n align-items: center;\n justify-content: center;\n margin-bottom: 0;\n }\n .form-inline .form-group {\n display: flex;\n flex: 0 0 auto;\n flex-flow: row wrap;\n align-items: center;\n margin-bottom: 0;\n }\n .form-inline .form-control {\n display: inline-block;\n width: auto;\n vertical-align: middle;\n }\n .form-inline .form-control-plaintext {\n display: inline-block;\n }\n .form-inline .input-group {\n width: auto;\n }\n .form-inline .form-control-label {\n margin-bottom: 0;\n vertical-align: middle;\n }\n .form-inline .form-check {\n display: flex;\n align-items: center;\n justify-content: center;\n width: auto;\n margin-top: 0;\n margin-bottom: 0;\n }\n .form-inline .form-check-label {\n padding-left: 0;\n }\n .form-inline .form-check-input {\n position: relative;\n margin-top: 0;\n margin-right: 0.25rem;\n margin-left: 0;\n }\n .form-inline .custom-control {\n display: flex;\n align-items: center;\n justify-content: center;\n padding-left: 0;\n }\n .form-inline .custom-control-indicator {\n position: static;\n display: inline-block;\n margin-right: 0.25rem;\n vertical-align: text-bottom;\n }\n .form-inline .has-feedback .form-control-feedback {\n top: 0;\n }\n}\n\n.btn {\n display: inline-block;\n font-weight: normal;\n text-align: center;\n white-space: nowrap;\n vertical-align: middle;\n user-select: none;\n border: 1px solid transparent;\n padding: 0.5rem 0.75rem;\n font-size: 1rem;\n line-height: 1.25;\n border-radius: 0.25rem;\n transition: all 0.15s ease-in-out;\n}\n\n.btn:focus, .btn:hover {\n text-decoration: none;\n}\n\n.btn:focus, .btn.focus {\n outline: 0;\n box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);\n}\n\n.btn.disabled, .btn:disabled {\n opacity: .65;\n}\n\n.btn:active, .btn.active {\n background-image: none;\n}\n\na.btn.disabled,\nfieldset[disabled] a.btn {\n pointer-events: none;\n}\n\n.btn-primary {\n color: #fff;\n background-color: #007bff;\n border-color: #007bff;\n}\n\n.btn-primary:hover {\n color: #fff;\n background-color: #0069d9;\n border-color: #0062cc;\n}\n\n.btn-primary:focus, .btn-primary.focus {\n box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.5);\n}\n\n.btn-primary.disabled, .btn-primary:disabled {\n background-color: #007bff;\n border-color: #007bff;\n}\n\n.btn-primary:active, .btn-primary.active,\n.show > .btn-primary.dropdown-toggle {\n background-color: #0069d9;\n background-image: none;\n border-color: #0062cc;\n}\n\n.btn-secondary {\n color: #fff;\n background-color: #868e96;\n border-color: #868e96;\n}\n\n.btn-secondary:hover {\n color: #fff;\n background-color: #727b84;\n border-color: #6c757d;\n}\n\n.btn-secondary:focus, .btn-secondary.focus {\n box-shadow: 0 0 0 3px rgba(134, 142, 150, 0.5);\n}\n\n.btn-secondary.disabled, .btn-secondary:disabled {\n background-color: #868e96;\n border-color: #868e96;\n}\n\n.btn-secondary:active, .btn-secondary.active,\n.show > .btn-secondary.dropdown-toggle {\n background-color: #727b84;\n background-image: none;\n border-color: #6c757d;\n}\n\n.btn-success {\n color: #fff;\n background-color: #28a745;\n border-color: #28a745;\n}\n\n.btn-success:hover {\n color: #fff;\n background-color: #218838;\n border-color: #1e7e34;\n}\n\n.btn-success:focus, .btn-success.focus {\n box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.5);\n}\n\n.btn-success.disabled, .btn-success:disabled {\n background-color: #28a745;\n border-color: #28a745;\n}\n\n.btn-success:active, .btn-success.active,\n.show > .btn-success.dropdown-toggle {\n background-color: #218838;\n background-image: none;\n border-color: #1e7e34;\n}\n\n.btn-info {\n color: #fff;\n background-color: #17a2b8;\n border-color: #17a2b8;\n}\n\n.btn-info:hover {\n color: #fff;\n background-color: #138496;\n border-color: #117a8b;\n}\n\n.btn-info:focus, .btn-info.focus {\n box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.5);\n}\n\n.btn-info.disabled, .btn-info:disabled {\n background-color: #17a2b8;\n border-color: #17a2b8;\n}\n\n.btn-info:active, .btn-info.active,\n.show > .btn-info.dropdown-toggle {\n background-color: #138496;\n background-image: none;\n border-color: #117a8b;\n}\n\n.btn-warning {\n color: #111;\n background-color: #ffc107;\n border-color: #ffc107;\n}\n\n.btn-warning:hover {\n color: #111;\n background-color: #e0a800;\n border-color: #d39e00;\n}\n\n.btn-warning:focus, .btn-warning.focus {\n box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.5);\n}\n\n.btn-warning.disabled, .btn-warning:disabled {\n background-color: #ffc107;\n border-color: #ffc107;\n}\n\n.btn-warning:active, .btn-warning.active,\n.show > .btn-warning.dropdown-toggle {\n background-color: #e0a800;\n background-image: none;\n border-color: #d39e00;\n}\n\n.btn-danger {\n color: #fff;\n background-color: #dc3545;\n border-color: #dc3545;\n}\n\n.btn-danger:hover {\n color: #fff;\n background-color: #c82333;\n border-color: #bd2130;\n}\n\n.btn-danger:focus, .btn-danger.focus {\n box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.5);\n}\n\n.btn-danger.disabled, .btn-danger:disabled {\n background-color: #dc3545;\n border-color: #dc3545;\n}\n\n.btn-danger:active, .btn-danger.active,\n.show > .btn-danger.dropdown-toggle {\n background-color: #c82333;\n background-image: none;\n border-color: #bd2130;\n}\n\n.btn-light {\n color: #111;\n background-color: #f8f9fa;\n border-color: #f8f9fa;\n}\n\n.btn-light:hover {\n color: #111;\n background-color: #e2e6ea;\n border-color: #dae0e5;\n}\n\n.btn-light:focus, .btn-light.focus {\n box-shadow: 0 0 0 3px rgba(248, 249, 250, 0.5);\n}\n\n.btn-light.disabled, .btn-light:disabled {\n background-color: #f8f9fa;\n border-color: #f8f9fa;\n}\n\n.btn-light:active, .btn-light.active,\n.show > .btn-light.dropdown-toggle {\n background-color: #e2e6ea;\n background-image: none;\n border-color: #dae0e5;\n}\n\n.btn-dark {\n color: #fff;\n background-color: #343a40;\n border-color: #343a40;\n}\n\n.btn-dark:hover {\n color: #fff;\n background-color: #23272b;\n border-color: #1d2124;\n}\n\n.btn-dark:focus, .btn-dark.focus {\n box-shadow: 0 0 0 3px rgba(52, 58, 64, 0.5);\n}\n\n.btn-dark.disabled, .btn-dark:disabled {\n background-color: #343a40;\n border-color: #343a40;\n}\n\n.btn-dark:active, .btn-dark.active,\n.show > .btn-dark.dropdown-toggle {\n background-color: #23272b;\n background-image: none;\n border-color: #1d2124;\n}\n\n.btn-outline-primary {\n color: #007bff;\n background-color: transparent;\n background-image: none;\n border-color: #007bff;\n}\n\n.btn-outline-primary:hover {\n color: #fff;\n background-color: #007bff;\n border-color: #007bff;\n}\n\n.btn-outline-primary:focus, .btn-outline-primary.focus {\n box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.5);\n}\n\n.btn-outline-primary.disabled, .btn-outline-primary:disabled {\n color: #007bff;\n background-color: transparent;\n}\n\n.btn-outline-primary:active, .btn-outline-primary.active,\n.show > .btn-outline-primary.dropdown-toggle {\n color: #fff;\n background-color: #007bff;\n border-color: #007bff;\n}\n\n.btn-outline-secondary {\n color: #868e96;\n background-color: transparent;\n background-image: none;\n border-color: #868e96;\n}\n\n.btn-outline-secondary:hover {\n color: #fff;\n background-color: #868e96;\n border-color: #868e96;\n}\n\n.btn-outline-secondary:focus, .btn-outline-secondary.focus {\n box-shadow: 0 0 0 3px rgba(134, 142, 150, 0.5);\n}\n\n.btn-outline-secondary.disabled, .btn-outline-secondary:disabled {\n color: #868e96;\n background-color: transparent;\n}\n\n.btn-outline-secondary:active, .btn-outline-secondary.active,\n.show > .btn-outline-secondary.dropdown-toggle {\n color: #fff;\n background-color: #868e96;\n border-color: #868e96;\n}\n\n.btn-outline-success {\n color: #28a745;\n background-color: transparent;\n background-image: none;\n border-color: #28a745;\n}\n\n.btn-outline-success:hover {\n color: #fff;\n background-color: #28a745;\n border-color: #28a745;\n}\n\n.btn-outline-success:focus, .btn-outline-success.focus {\n box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.5);\n}\n\n.btn-outline-success.disabled, .btn-outline-success:disabled {\n color: #28a745;\n background-color: transparent;\n}\n\n.btn-outline-success:active, .btn-outline-success.active,\n.show > .btn-outline-success.dropdown-toggle {\n color: #fff;\n background-color: #28a745;\n border-color: #28a745;\n}\n\n.btn-outline-info {\n color: #17a2b8;\n background-color: transparent;\n background-image: none;\n border-color: #17a2b8;\n}\n\n.btn-outline-info:hover {\n color: #fff;\n background-color: #17a2b8;\n border-color: #17a2b8;\n}\n\n.btn-outline-info:focus, .btn-outline-info.focus {\n box-shadow: 0 0 0 3px rgba(23, 162, 184, 0.5);\n}\n\n.btn-outline-info.disabled, .btn-outline-info:disabled {\n color: #17a2b8;\n background-color: transparent;\n}\n\n.btn-outline-info:active, .btn-outline-info.active,\n.show > .btn-outline-info.dropdown-toggle {\n color: #fff;\n background-color: #17a2b8;\n border-color: #17a2b8;\n}\n\n.btn-outline-warning {\n color: #ffc107;\n background-color: transparent;\n background-image: none;\n border-color: #ffc107;\n}\n\n.btn-outline-warning:hover {\n color: #fff;\n background-color: #ffc107;\n border-color: #ffc107;\n}\n\n.btn-outline-warning:focus, .btn-outline-warning.focus {\n box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.5);\n}\n\n.btn-outline-warning.disabled, .btn-outline-warning:disabled {\n color: #ffc107;\n background-color: transparent;\n}\n\n.btn-outline-warning:active, .btn-outline-warning.active,\n.show > .btn-outline-warning.dropdown-toggle {\n color: #fff;\n background-color: #ffc107;\n border-color: #ffc107;\n}\n\n.btn-outline-danger {\n color: #dc3545;\n background-color: transparent;\n background-image: none;\n border-color: #dc3545;\n}\n\n.btn-outline-danger:hover {\n color: #fff;\n background-color: #dc3545;\n border-color: #dc3545;\n}\n\n.btn-outline-danger:focus, .btn-outline-danger.focus {\n box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.5);\n}\n\n.btn-outline-danger.disabled, .btn-outline-danger:disabled {\n color: #dc3545;\n background-color: transparent;\n}\n\n.btn-outline-danger:active, .btn-outline-danger.active,\n.show > .btn-outline-danger.dropdown-toggle {\n color: #fff;\n background-color: #dc3545;\n border-color: #dc3545;\n}\n\n.btn-outline-light {\n color: #f8f9fa;\n background-color: transparent;\n background-image: none;\n border-color: #f8f9fa;\n}\n\n.btn-outline-light:hover {\n color: #fff;\n background-color: #f8f9fa;\n border-color: #f8f9fa;\n}\n\n.btn-outline-light:focus, .btn-outline-light.focus {\n box-shadow: 0 0 0 3px rgba(248, 249, 250, 0.5);\n}\n\n.btn-outline-light.disabled, .btn-outline-light:disabled {\n color: #f8f9fa;\n background-color: transparent;\n}\n\n.btn-outline-light:active, .btn-outline-light.active,\n.show > .btn-outline-light.dropdown-toggle {\n color: #fff;\n background-color: #f8f9fa;\n border-color: #f8f9fa;\n}\n\n.btn-outline-dark {\n color: #343a40;\n background-color: transparent;\n background-image: none;\n border-color: #343a40;\n}\n\n.btn-outline-dark:hover {\n color: #fff;\n background-color: #343a40;\n border-color: #343a40;\n}\n\n.btn-outline-dark:focus, .btn-outline-dark.focus {\n box-shadow: 0 0 0 3px rgba(52, 58, 64, 0.5);\n}\n\n.btn-outline-dark.disabled, .btn-outline-dark:disabled {\n color: #343a40;\n background-color: transparent;\n}\n\n.btn-outline-dark:active, .btn-outline-dark.active,\n.show > .btn-outline-dark.dropdown-toggle {\n color: #fff;\n background-color: #343a40;\n border-color: #343a40;\n}\n\n.btn-link {\n font-weight: normal;\n color: #007bff;\n border-radius: 0;\n}\n\n.btn-link, .btn-link:active, .btn-link.active, .btn-link:disabled {\n background-color: transparent;\n}\n\n.btn-link, .btn-link:focus, .btn-link:active {\n border-color: transparent;\n box-shadow: none;\n}\n\n.btn-link:hover {\n border-color: transparent;\n}\n\n.btn-link:focus, .btn-link:hover {\n color: #0056b3;\n text-decoration: underline;\n background-color: transparent;\n}\n\n.btn-link:disabled {\n color: #868e96;\n}\n\n.btn-link:disabled:focus, .btn-link:disabled:hover {\n text-decoration: none;\n}\n\n.btn-lg, .btn-group-lg > .btn {\n padding: 0.5rem 1rem;\n font-size: 1.25rem;\n line-height: 1.5;\n border-radius: 0.3rem;\n}\n\n.btn-sm, .btn-group-sm > .btn {\n padding: 0.25rem 0.5rem;\n font-size: 0.875rem;\n line-height: 1.5;\n border-radius: 0.2rem;\n}\n\n.btn-block {\n display: block;\n width: 100%;\n}\n\n.btn-block + .btn-block {\n margin-top: 0.5rem;\n}\n\ninput[type=\"submit\"].btn-block,\ninput[type=\"reset\"].btn-block,\ninput[type=\"button\"].btn-block {\n width: 100%;\n}\n\n.fade {\n opacity: 0;\n transition: opacity 0.15s linear;\n}\n\n.fade.show {\n opacity: 1;\n}\n\n.collapse {\n display: none;\n}\n\n.collapse.show {\n display: block;\n}\n\ntr.collapse.show {\n display: table-row;\n}\n\ntbody.collapse.show {\n display: table-row-group;\n}\n\n.collapsing {\n position: relative;\n height: 0;\n overflow: hidden;\n transition: height 0.35s ease;\n}\n\n.dropup,\n.dropdown {\n position: relative;\n}\n\n.dropdown-toggle::after {\n display: inline-block;\n width: 0;\n height: 0;\n margin-left: 0.255em;\n vertical-align: 0.255em;\n content: \"\";\n border-top: 0.3em solid;\n border-right: 0.3em solid transparent;\n border-left: 0.3em solid transparent;\n}\n\n.dropdown-toggle:empty::after {\n margin-left: 0;\n}\n\n.dropup .dropdown-menu {\n margin-top: 0;\n margin-bottom: 0.125rem;\n}\n\n.dropup .dropdown-toggle::after {\n border-top: 0;\n border-bottom: 0.3em solid;\n}\n\n.dropdown-menu {\n position: absolute;\n top: 100%;\n left: 0;\n z-index: 1000;\n display: none;\n float: left;\n min-width: 10rem;\n padding: 0.5rem 0;\n margin: 0.125rem 0 0;\n font-size: 1rem;\n color: #212529;\n text-align: left;\n list-style: none;\n background-color: #fff;\n background-clip: padding-box;\n border: 1px solid rgba(0, 0, 0, 0.15);\n border-radius: 0.25rem;\n}\n\n.dropdown-divider {\n height: 0;\n margin: 0.5rem 0;\n overflow: hidden;\n border-top: 1px solid #e9ecef;\n}\n\n.dropdown-item {\n display: block;\n width: 100%;\n padding: 0.25rem 1.5rem;\n clear: both;\n font-weight: normal;\n color: #212529;\n text-align: inherit;\n white-space: nowrap;\n background: none;\n border: 0;\n}\n\n.dropdown-item:focus, .dropdown-item:hover {\n color: #16181b;\n text-decoration: none;\n background-color: #f8f9fa;\n}\n\n.dropdown-item.active, .dropdown-item:active {\n color: #fff;\n text-decoration: none;\n background-color: #007bff;\n}\n\n.dropdown-item.disabled, .dropdown-item:disabled {\n color: #868e96;\n background-color: transparent;\n}\n\n.show > a {\n outline: 0;\n}\n\n.dropdown-menu.show {\n display: block;\n}\n\n.dropdown-header {\n display: block;\n padding: 0.5rem 1.5rem;\n margin-bottom: 0;\n font-size: 0.875rem;\n color: #868e96;\n white-space: nowrap;\n}\n\n.btn-group,\n.btn-group-vertical {\n position: relative;\n display: inline-flex;\n vertical-align: middle;\n}\n\n.btn-group > .btn,\n.btn-group-vertical > .btn {\n position: relative;\n flex: 0 1 auto;\n margin-bottom: 0;\n}\n\n.btn-group > .btn:hover,\n.btn-group-vertical > .btn:hover {\n z-index: 2;\n}\n\n.btn-group > .btn:focus, .btn-group > .btn:active, .btn-group > .btn.active,\n.btn-group-vertical > .btn:focus,\n.btn-group-vertical > .btn:active,\n.btn-group-vertical > .btn.active {\n z-index: 2;\n}\n\n.btn-group .btn + .btn,\n.btn-group .btn + .btn-group,\n.btn-group .btn-group + .btn,\n.btn-group .btn-group + .btn-group,\n.btn-group-vertical .btn + .btn,\n.btn-group-vertical .btn + .btn-group,\n.btn-group-vertical .btn-group + .btn,\n.btn-group-vertical .btn-group + .btn-group {\n margin-left: -1px;\n}\n\n.btn-toolbar {\n display: flex;\n flex-wrap: wrap;\n justify-content: flex-start;\n}\n\n.btn-toolbar .input-group {\n width: auto;\n}\n\n.btn-group > .btn:not(:first-child):not(:last-child):not(.dropdown-toggle) {\n border-radius: 0;\n}\n\n.btn-group > .btn:first-child {\n margin-left: 0;\n}\n\n.btn-group > .btn:first-child:not(:last-child):not(.dropdown-toggle) {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n\n.btn-group > .btn:last-child:not(:first-child),\n.btn-group > .dropdown-toggle:not(:first-child) {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.btn-group > .btn-group {\n float: left;\n}\n\n.btn-group > .btn-group:not(:first-child):not(:last-child) > .btn {\n border-radius: 0;\n}\n\n.btn-group > .btn-group:first-child:not(:last-child) > .btn:last-child,\n.btn-group > .btn-group:first-child:not(:last-child) > .dropdown-toggle {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n\n.btn-group > .btn-group:last-child:not(:first-child) > .btn:first-child {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.btn + .dropdown-toggle-split {\n padding-right: 0.5625rem;\n padding-left: 0.5625rem;\n}\n\n.btn + .dropdown-toggle-split::after {\n margin-left: 0;\n}\n\n.btn-sm + .dropdown-toggle-split, .btn-group-sm > .btn + .dropdown-toggle-split {\n padding-right: 0.375rem;\n padding-left: 0.375rem;\n}\n\n.btn-lg + .dropdown-toggle-split, .btn-group-lg > .btn + .dropdown-toggle-split {\n padding-right: 0.75rem;\n padding-left: 0.75rem;\n}\n\n.btn-group-vertical {\n display: inline-flex;\n flex-direction: column;\n align-items: flex-start;\n justify-content: center;\n}\n\n.btn-group-vertical .btn,\n.btn-group-vertical .btn-group {\n width: 100%;\n}\n\n.btn-group-vertical > .btn + .btn,\n.btn-group-vertical > .btn + .btn-group,\n.btn-group-vertical > .btn-group + .btn,\n.btn-group-vertical > .btn-group + .btn-group {\n margin-top: -1px;\n margin-left: 0;\n}\n\n.btn-group-vertical > .btn:not(:first-child):not(:last-child) {\n border-radius: 0;\n}\n\n.btn-group-vertical > .btn:first-child:not(:last-child) {\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.btn-group-vertical > .btn:last-child:not(:first-child) {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n}\n\n.btn-group-vertical > .btn-group:not(:first-child):not(:last-child) > .btn {\n border-radius: 0;\n}\n\n.btn-group-vertical > .btn-group:first-child:not(:last-child) > .btn:last-child,\n.btn-group-vertical > .btn-group:first-child:not(:last-child) > .dropdown-toggle {\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.btn-group-vertical > .btn-group:last-child:not(:first-child) > .btn:first-child {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n}\n\n[data-toggle=\"buttons\"] > .btn input[type=\"radio\"],\n[data-toggle=\"buttons\"] > .btn input[type=\"checkbox\"],\n[data-toggle=\"buttons\"] > .btn-group > .btn input[type=\"radio\"],\n[data-toggle=\"buttons\"] > .btn-group > .btn input[type=\"checkbox\"] {\n position: absolute;\n clip: rect(0, 0, 0, 0);\n pointer-events: none;\n}\n\n.input-group {\n position: relative;\n display: flex;\n width: 100%;\n}\n\n.input-group .form-control {\n position: relative;\n z-index: 2;\n flex: 1 1 auto;\n width: 1%;\n margin-bottom: 0;\n}\n\n.input-group .form-control:focus, .input-group .form-control:active, .input-group .form-control:hover {\n z-index: 3;\n}\n\n.input-group-addon,\n.input-group-btn,\n.input-group .form-control {\n display: flex;\n align-items: center;\n}\n\n.input-group-addon:not(:first-child):not(:last-child),\n.input-group-btn:not(:first-child):not(:last-child),\n.input-group .form-control:not(:first-child):not(:last-child) {\n border-radius: 0;\n}\n\n.input-group-addon,\n.input-group-btn {\n white-space: nowrap;\n vertical-align: middle;\n}\n\n.input-group-addon {\n padding: 0.5rem 0.75rem;\n margin-bottom: 0;\n font-size: 1rem;\n font-weight: normal;\n line-height: 1.25;\n color: #495057;\n text-align: center;\n background-color: #e9ecef;\n border: 1px solid rgba(0, 0, 0, 0.15);\n border-radius: 0.25rem;\n}\n\n.input-group-addon.form-control-sm,\n.input-group-sm > .input-group-addon,\n.input-group-sm > .input-group-btn > .input-group-addon.btn {\n padding: 0.25rem 0.5rem;\n font-size: 0.875rem;\n border-radius: 0.2rem;\n}\n\n.input-group-addon.form-control-lg,\n.input-group-lg > .input-group-addon,\n.input-group-lg > .input-group-btn > .input-group-addon.btn {\n padding: 0.5rem 1rem;\n font-size: 1.25rem;\n border-radius: 0.3rem;\n}\n\n.input-group-addon input[type=\"radio\"],\n.input-group-addon input[type=\"checkbox\"] {\n margin-top: 0;\n}\n\n.input-group .form-control:not(:last-child),\n.input-group-addon:not(:last-child),\n.input-group-btn:not(:last-child) > .btn,\n.input-group-btn:not(:last-child) > .btn-group > .btn,\n.input-group-btn:not(:last-child) > .dropdown-toggle,\n.input-group-btn:not(:first-child) > .btn:not(:last-child):not(.dropdown-toggle),\n.input-group-btn:not(:first-child) > .btn-group:not(:last-child) > .btn {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n}\n\n.input-group-addon:not(:last-child) {\n border-right: 0;\n}\n\n.input-group .form-control:not(:first-child),\n.input-group-addon:not(:first-child),\n.input-group-btn:not(:first-child) > .btn,\n.input-group-btn:not(:first-child) > .btn-group > .btn,\n.input-group-btn:not(:first-child) > .dropdown-toggle,\n.input-group-btn:not(:last-child) > .btn:not(:first-child),\n.input-group-btn:not(:last-child) > .btn-group:not(:first-child) > .btn {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n}\n\n.form-control + .input-group-addon:not(:first-child) {\n border-left: 0;\n}\n\n.input-group-btn {\n position: relative;\n font-size: 0;\n white-space: nowrap;\n}\n\n.input-group-btn > .btn {\n position: relative;\n}\n\n.input-group-btn > .btn + .btn {\n margin-left: -1px;\n}\n\n.input-group-btn > .btn:focus, .input-group-btn > .btn:active, .input-group-btn > .btn:hover {\n z-index: 3;\n}\n\n.input-group-btn:not(:last-child) > .btn,\n.input-group-btn:not(:last-child) > .btn-group {\n margin-right: -1px;\n}\n\n.input-group-btn:not(:first-child) > .btn,\n.input-group-btn:not(:first-child) > .btn-group {\n z-index: 2;\n margin-left: -1px;\n}\n\n.input-group-btn:not(:first-child) > .btn:focus, .input-group-btn:not(:first-child) > .btn:active, .input-group-btn:not(:first-child) > .btn:hover,\n.input-group-btn:not(:first-child) > .btn-group:focus,\n.input-group-btn:not(:first-child) > .btn-group:active,\n.input-group-btn:not(:first-child) > .btn-group:hover {\n z-index: 3;\n}\n\n.custom-control {\n position: relative;\n display: inline-flex;\n min-height: 1.5rem;\n padding-left: 1.5rem;\n margin-right: 1rem;\n}\n\n.custom-control-input {\n position: absolute;\n z-index: -1;\n opacity: 0;\n}\n\n.custom-control-input:checked ~ .custom-control-indicator {\n color: #fff;\n background-color: #007bff;\n}\n\n.custom-control-input:focus ~ .custom-control-indicator {\n box-shadow: 0 0 0 1px #fff, 0 0 0 3px #007bff;\n}\n\n.custom-control-input:active ~ .custom-control-indicator {\n color: #fff;\n background-color: #b3d7ff;\n}\n\n.custom-control-input:disabled ~ .custom-control-indicator {\n background-color: #e9ecef;\n}\n\n.custom-control-input:disabled ~ .custom-control-description {\n color: #868e96;\n}\n\n.custom-control-indicator {\n position: absolute;\n top: 0.25rem;\n left: 0;\n display: block;\n width: 1rem;\n height: 1rem;\n pointer-events: none;\n user-select: none;\n background-color: #ddd;\n background-repeat: no-repeat;\n background-position: center center;\n background-size: 50% 50%;\n}\n\n.custom-checkbox .custom-control-indicator {\n border-radius: 0.25rem;\n}\n\n.custom-checkbox .custom-control-input:checked ~ .custom-control-indicator {\n background-image: url(\"data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='%23fff' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E\");\n}\n\n.custom-checkbox .custom-control-input:indeterminate ~ .custom-control-indicator {\n background-color: #007bff;\n background-image: url(\"data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4'%3E%3Cpath stroke='%23fff' d='M0 2h4'/%3E%3C/svg%3E\");\n}\n\n.custom-radio .custom-control-indicator {\n border-radius: 50%;\n}\n\n.custom-radio .custom-control-input:checked ~ .custom-control-indicator {\n background-image: url(\"data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='%23fff'/%3E%3C/svg%3E\");\n}\n\n.custom-controls-stacked {\n display: flex;\n flex-direction: column;\n}\n\n.custom-controls-stacked .custom-control {\n margin-bottom: 0.25rem;\n}\n\n.custom-controls-stacked .custom-control + .custom-control {\n margin-left: 0;\n}\n\n.custom-select {\n display: inline-block;\n max-width: 100%;\n height: calc(2.25rem + 2px);\n padding: 0.375rem 1.75rem 0.375rem 0.75rem;\n line-height: 1.25;\n color: #495057;\n vertical-align: middle;\n background: #fff url(\"data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='%23333' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E\") no-repeat right 0.75rem center;\n background-size: 8px 10px;\n border: 1px solid rgba(0, 0, 0, 0.15);\n border-radius: 0.25rem;\n appearance: none;\n}\n\n.custom-select:focus {\n border-color: #80bdff;\n outline: none;\n}\n\n.custom-select:focus::-ms-value {\n color: #495057;\n background-color: #fff;\n}\n\n.custom-select:disabled {\n color: #868e96;\n background-color: #e9ecef;\n}\n\n.custom-select::-ms-expand {\n opacity: 0;\n}\n\n.custom-select-sm {\n height: calc(1.8125rem + 2px);\n padding-top: 0.375rem;\n padding-bottom: 0.375rem;\n font-size: 75%;\n}\n\n.custom-file {\n position: relative;\n display: inline-block;\n max-width: 100%;\n height: 2.5rem;\n margin-bottom: 0;\n}\n\n.custom-file-input {\n min-width: 14rem;\n max-width: 100%;\n height: 2.5rem;\n margin: 0;\n opacity: 0;\n}\n\n.custom-file-control {\n position: absolute;\n top: 0;\n right: 0;\n left: 0;\n z-index: 5;\n height: 2.5rem;\n padding: 0.5rem 1rem;\n line-height: 1.5;\n color: #495057;\n pointer-events: none;\n user-select: none;\n background-color: #fff;\n border: 1px solid rgba(0, 0, 0, 0.15);\n border-radius: 0.25rem;\n}\n\n.custom-file-control:lang(en):empty::after {\n content: \"Choose file...\";\n}\n\n.custom-file-control::before {\n position: absolute;\n top: -1px;\n right: -1px;\n bottom: -1px;\n z-index: 6;\n display: block;\n height: 2.5rem;\n padding: 0.5rem 1rem;\n line-height: 1.5;\n color: #495057;\n background-color: #e9ecef;\n border: 1px solid rgba(0, 0, 0, 0.15);\n border-radius: 0 0.25rem 0.25rem 0;\n}\n\n.custom-file-control:lang(en)::before {\n content: \"Browse\";\n}\n\n.nav {\n display: flex;\n flex-wrap: wrap;\n padding-left: 0;\n margin-bottom: 0;\n list-style: none;\n}\n\n.nav-link {\n display: block;\n padding: 0.5rem 1rem;\n}\n\n.nav-link:focus, .nav-link:hover {\n text-decoration: none;\n}\n\n.nav-link.disabled {\n color: #868e96;\n}\n\n.nav-tabs {\n border-bottom: 1px solid #ddd;\n}\n\n.nav-tabs .nav-item {\n margin-bottom: -1px;\n}\n\n.nav-tabs .nav-link {\n border: 1px solid transparent;\n border-top-left-radius: 0.25rem;\n border-top-right-radius: 0.25rem;\n}\n\n.nav-tabs .nav-link:focus, .nav-tabs .nav-link:hover {\n border-color: #e9ecef #e9ecef #ddd;\n}\n\n.nav-tabs .nav-link.disabled {\n color: #868e96;\n background-color: transparent;\n border-color: transparent;\n}\n\n.nav-tabs .nav-link.active,\n.nav-tabs .nav-item.show .nav-link {\n color: #495057;\n background-color: #fff;\n border-color: #ddd #ddd #fff;\n}\n\n.nav-tabs .dropdown-menu {\n margin-top: -1px;\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n}\n\n.nav-pills .nav-link {\n border-radius: 0.25rem;\n}\n\n.nav-pills .nav-link.active,\n.show > .nav-pills .nav-link {\n color: #fff;\n background-color: #007bff;\n}\n\n.nav-fill .nav-item {\n flex: 1 1 auto;\n text-align: center;\n}\n\n.nav-justified .nav-item {\n flex-basis: 0;\n flex-grow: 1;\n text-align: center;\n}\n\n.tab-content > .tab-pane {\n display: none;\n}\n\n.tab-content > .active {\n display: block;\n}\n\n.navbar {\n position: relative;\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: space-between;\n padding: 0.5rem 1rem;\n}\n\n.navbar > .container,\n.navbar > .container-fluid {\n display: flex;\n flex-wrap: wrap;\n align-items: center;\n justify-content: space-between;\n}\n\n.navbar-brand {\n display: inline-block;\n padding-top: 0.3125rem;\n padding-bottom: 0.3125rem;\n margin-right: 1rem;\n font-size: 1.25rem;\n line-height: inherit;\n white-space: nowrap;\n}\n\n.navbar-brand:focus, .navbar-brand:hover {\n text-decoration: none;\n}\n\n.navbar-nav {\n display: flex;\n flex-direction: column;\n padding-left: 0;\n margin-bottom: 0;\n list-style: none;\n}\n\n.navbar-nav .nav-link {\n padding-right: 0;\n padding-left: 0;\n}\n\n.navbar-nav .dropdown-menu {\n position: static;\n float: none;\n}\n\n.navbar-text {\n display: inline-block;\n padding-top: 0.5rem;\n padding-bottom: 0.5rem;\n}\n\n.navbar-collapse {\n flex-basis: 100%;\n align-items: center;\n}\n\n.navbar-toggler {\n padding: 0.25rem 0.75rem;\n font-size: 1.25rem;\n line-height: 1;\n background: transparent;\n border: 1px solid transparent;\n border-radius: 0.25rem;\n}\n\n.navbar-toggler:focus, .navbar-toggler:hover {\n text-decoration: none;\n}\n\n.navbar-toggler-icon {\n display: inline-block;\n width: 1.5em;\n height: 1.5em;\n vertical-align: middle;\n content: \"\";\n background: no-repeat center center;\n background-size: 100% 100%;\n}\n\n@media (max-width: 575px) {\n .navbar-expand-sm > .container,\n .navbar-expand-sm > .container-fluid {\n padding-right: 0;\n padding-left: 0;\n }\n}\n\n@media (min-width: 576px) {\n .navbar-expand-sm {\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n }\n .navbar-expand-sm .navbar-nav {\n flex-direction: row;\n }\n .navbar-expand-sm .navbar-nav .dropdown-menu {\n position: absolute;\n }\n .navbar-expand-sm .navbar-nav .dropdown-menu-right {\n right: 0;\n left: auto;\n }\n .navbar-expand-sm .navbar-nav .nav-link {\n padding-right: .5rem;\n padding-left: .5rem;\n }\n .navbar-expand-sm > .container,\n .navbar-expand-sm > .container-fluid {\n flex-wrap: nowrap;\n }\n .navbar-expand-sm .navbar-collapse {\n display: flex !important;\n }\n .navbar-expand-sm .navbar-toggler {\n display: none;\n }\n}\n\n@media (max-width: 767px) {\n .navbar-expand-md > .container,\n .navbar-expand-md > .container-fluid {\n padding-right: 0;\n padding-left: 0;\n }\n}\n\n@media (min-width: 768px) {\n .navbar-expand-md {\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n }\n .navbar-expand-md .navbar-nav {\n flex-direction: row;\n }\n .navbar-expand-md .navbar-nav .dropdown-menu {\n position: absolute;\n }\n .navbar-expand-md .navbar-nav .dropdown-menu-right {\n right: 0;\n left: auto;\n }\n .navbar-expand-md .navbar-nav .nav-link {\n padding-right: .5rem;\n padding-left: .5rem;\n }\n .navbar-expand-md > .container,\n .navbar-expand-md > .container-fluid {\n flex-wrap: nowrap;\n }\n .navbar-expand-md .navbar-collapse {\n display: flex !important;\n }\n .navbar-expand-md .navbar-toggler {\n display: none;\n }\n}\n\n@media (max-width: 991px) {\n .navbar-expand-lg > .container,\n .navbar-expand-lg > .container-fluid {\n padding-right: 0;\n padding-left: 0;\n }\n}\n\n@media (min-width: 992px) {\n .navbar-expand-lg {\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n }\n .navbar-expand-lg .navbar-nav {\n flex-direction: row;\n }\n .navbar-expand-lg .navbar-nav .dropdown-menu {\n position: absolute;\n }\n .navbar-expand-lg .navbar-nav .dropdown-menu-right {\n right: 0;\n left: auto;\n }\n .navbar-expand-lg .navbar-nav .nav-link {\n padding-right: .5rem;\n padding-left: .5rem;\n }\n .navbar-expand-lg > .container,\n .navbar-expand-lg > .container-fluid {\n flex-wrap: nowrap;\n }\n .navbar-expand-lg .navbar-collapse {\n display: flex !important;\n }\n .navbar-expand-lg .navbar-toggler {\n display: none;\n }\n}\n\n@media (max-width: 1199px) {\n .navbar-expand-xl > .container,\n .navbar-expand-xl > .container-fluid {\n padding-right: 0;\n padding-left: 0;\n }\n}\n\n@media (min-width: 1200px) {\n .navbar-expand-xl {\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n }\n .navbar-expand-xl .navbar-nav {\n flex-direction: row;\n }\n .navbar-expand-xl .navbar-nav .dropdown-menu {\n position: absolute;\n }\n .navbar-expand-xl .navbar-nav .dropdown-menu-right {\n right: 0;\n left: auto;\n }\n .navbar-expand-xl .navbar-nav .nav-link {\n padding-right: .5rem;\n padding-left: .5rem;\n }\n .navbar-expand-xl > .container,\n .navbar-expand-xl > .container-fluid {\n flex-wrap: nowrap;\n }\n .navbar-expand-xl .navbar-collapse {\n display: flex !important;\n }\n .navbar-expand-xl .navbar-toggler {\n display: none;\n }\n}\n\n.navbar-expand {\n flex-direction: row;\n flex-wrap: nowrap;\n justify-content: flex-start;\n}\n\n.navbar-expand > .container,\n.navbar-expand > .container-fluid {\n padding-right: 0;\n padding-left: 0;\n}\n\n.navbar-expand .navbar-nav {\n flex-direction: row;\n}\n\n.navbar-expand .navbar-nav .dropdown-menu {\n position: absolute;\n}\n\n.navbar-expand .navbar-nav .dropdown-menu-right {\n right: 0;\n left: auto;\n}\n\n.navbar-expand .navbar-nav .nav-link {\n padding-right: .5rem;\n padding-left: .5rem;\n}\n\n.navbar-expand > .container,\n.navbar-expand > .container-fluid {\n flex-wrap: nowrap;\n}\n\n.navbar-expand .navbar-collapse {\n display: flex !important;\n}\n\n.navbar-expand .navbar-toggler {\n display: none;\n}\n\n.navbar-light .navbar-brand {\n color: rgba(0, 0, 0, 0.9);\n}\n\n.navbar-light .navbar-brand:focus, .navbar-light .navbar-brand:hover {\n color: rgba(0, 0, 0, 0.9);\n}\n\n.navbar-light .navbar-nav .nav-link {\n color: rgba(0, 0, 0, 0.5);\n}\n\n.navbar-light .navbar-nav .nav-link:focus, .navbar-light .navbar-nav .nav-link:hover {\n color: rgba(0, 0, 0, 0.7);\n}\n\n.navbar-light .navbar-nav .nav-link.disabled {\n color: rgba(0, 0, 0, 0.3);\n}\n\n.navbar-light .navbar-nav .show > .nav-link,\n.navbar-light .navbar-nav .active > .nav-link,\n.navbar-light .navbar-nav .nav-link.show,\n.navbar-light .navbar-nav .nav-link.active {\n color: rgba(0, 0, 0, 0.9);\n}\n\n.navbar-light .navbar-toggler {\n color: rgba(0, 0, 0, 0.5);\n border-color: rgba(0, 0, 0, 0.1);\n}\n\n.navbar-light .navbar-toggler-icon {\n background-image: url(\"data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(0, 0, 0, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E\");\n}\n\n.navbar-light .navbar-text {\n color: rgba(0, 0, 0, 0.5);\n}\n\n.navbar-dark .navbar-brand {\n color: white;\n}\n\n.navbar-dark .navbar-brand:focus, .navbar-dark .navbar-brand:hover {\n color: white;\n}\n\n.navbar-dark .navbar-nav .nav-link {\n color: rgba(255, 255, 255, 0.5);\n}\n\n.navbar-dark .navbar-nav .nav-link:focus, .navbar-dark .navbar-nav .nav-link:hover {\n color: rgba(255, 255, 255, 0.75);\n}\n\n.navbar-dark .navbar-nav .nav-link.disabled {\n color: rgba(255, 255, 255, 0.25);\n}\n\n.navbar-dark .navbar-nav .show > .nav-link,\n.navbar-dark .navbar-nav .active > .nav-link,\n.navbar-dark .navbar-nav .nav-link.show,\n.navbar-dark .navbar-nav .nav-link.active {\n color: white;\n}\n\n.navbar-dark .navbar-toggler {\n color: rgba(255, 255, 255, 0.5);\n border-color: rgba(255, 255, 255, 0.1);\n}\n\n.navbar-dark .navbar-toggler-icon {\n background-image: url(\"data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='rgba(255, 255, 255, 0.5)' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E\");\n}\n\n.navbar-dark .navbar-text {\n color: rgba(255, 255, 255, 0.5);\n}\n\n.card {\n position: relative;\n display: flex;\n flex-direction: column;\n min-width: 0;\n word-wrap: break-word;\n background-color: #fff;\n background-clip: border-box;\n border: 1px solid rgba(0, 0, 0, 0.125);\n border-radius: 0.25rem;\n}\n\n.card-body {\n flex: 1 1 auto;\n padding: 1.25rem;\n}\n\n.card-title {\n margin-bottom: 0.75rem;\n}\n\n.card-subtitle {\n margin-top: -0.375rem;\n margin-bottom: 0;\n}\n\n.card-text:last-child {\n margin-bottom: 0;\n}\n\n.card-link:hover {\n text-decoration: none;\n}\n\n.card-link + .card-link {\n margin-left: 1.25rem;\n}\n\n.card > .list-group:first-child .list-group-item:first-child {\n border-top-left-radius: 0.25rem;\n border-top-right-radius: 0.25rem;\n}\n\n.card > .list-group:last-child .list-group-item:last-child {\n border-bottom-right-radius: 0.25rem;\n border-bottom-left-radius: 0.25rem;\n}\n\n.card-header {\n padding: 0.75rem 1.25rem;\n margin-bottom: 0;\n background-color: rgba(0, 0, 0, 0.03);\n border-bottom: 1px solid rgba(0, 0, 0, 0.125);\n}\n\n.card-header:first-child {\n border-radius: calc(0.25rem - 1px) calc(0.25rem - 1px) 0 0;\n}\n\n.card-footer {\n padding: 0.75rem 1.25rem;\n background-color: rgba(0, 0, 0, 0.03);\n border-top: 1px solid rgba(0, 0, 0, 0.125);\n}\n\n.card-footer:last-child {\n border-radius: 0 0 calc(0.25rem - 1px) calc(0.25rem - 1px);\n}\n\n.card-header-tabs {\n margin-right: -0.625rem;\n margin-bottom: -0.75rem;\n margin-left: -0.625rem;\n border-bottom: 0;\n}\n\n.card-header-pills {\n margin-right: -0.625rem;\n margin-left: -0.625rem;\n}\n\n.card-img-overlay {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n padding: 1.25rem;\n}\n\n.card-img {\n width: 100%;\n border-radius: calc(0.25rem - 1px);\n}\n\n.card-img-top {\n width: 100%;\n border-top-left-radius: calc(0.25rem - 1px);\n border-top-right-radius: calc(0.25rem - 1px);\n}\n\n.card-img-bottom {\n width: 100%;\n border-bottom-right-radius: calc(0.25rem - 1px);\n border-bottom-left-radius: calc(0.25rem - 1px);\n}\n\n@media (min-width: 576px) {\n .card-deck {\n display: flex;\n flex-flow: row wrap;\n margin-right: -15px;\n margin-left: -15px;\n }\n .card-deck .card {\n display: flex;\n flex: 1 0 0%;\n flex-direction: column;\n margin-right: 15px;\n margin-left: 15px;\n }\n}\n\n@media (min-width: 576px) {\n .card-group {\n display: flex;\n flex-flow: row wrap;\n }\n .card-group .card {\n flex: 1 0 0%;\n }\n .card-group .card + .card {\n margin-left: 0;\n border-left: 0;\n }\n .card-group .card:first-child {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n }\n .card-group .card:first-child .card-img-top {\n border-top-right-radius: 0;\n }\n .card-group .card:first-child .card-img-bottom {\n border-bottom-right-radius: 0;\n }\n .card-group .card:last-child {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n }\n .card-group .card:last-child .card-img-top {\n border-top-left-radius: 0;\n }\n .card-group .card:last-child .card-img-bottom {\n border-bottom-left-radius: 0;\n }\n .card-group .card:not(:first-child):not(:last-child) {\n border-radius: 0;\n }\n .card-group .card:not(:first-child):not(:last-child) .card-img-top,\n .card-group .card:not(:first-child):not(:last-child) .card-img-bottom {\n border-radius: 0;\n }\n}\n\n.card-columns .card {\n margin-bottom: 0.75rem;\n}\n\n@media (min-width: 576px) {\n .card-columns {\n column-count: 3;\n column-gap: 1.25rem;\n }\n .card-columns .card {\n display: inline-block;\n width: 100%;\n }\n}\n\n.breadcrumb {\n padding: 0.75rem 1rem;\n margin-bottom: 1rem;\n list-style: none;\n background-color: #e9ecef;\n border-radius: 0.25rem;\n}\n\n.breadcrumb::after {\n display: block;\n clear: both;\n content: \"\";\n}\n\n.breadcrumb-item {\n float: left;\n}\n\n.breadcrumb-item + .breadcrumb-item::before {\n display: inline-block;\n padding-right: 0.5rem;\n padding-left: 0.5rem;\n color: #868e96;\n content: \"/\";\n}\n\n.breadcrumb-item + .breadcrumb-item:hover::before {\n text-decoration: underline;\n}\n\n.breadcrumb-item + .breadcrumb-item:hover::before {\n text-decoration: none;\n}\n\n.breadcrumb-item.active {\n color: #868e96;\n}\n\n.pagination {\n display: flex;\n padding-left: 0;\n list-style: none;\n border-radius: 0.25rem;\n}\n\n.page-item:first-child .page-link {\n margin-left: 0;\n border-top-left-radius: 0.25rem;\n border-bottom-left-radius: 0.25rem;\n}\n\n.page-item:last-child .page-link {\n border-top-right-radius: 0.25rem;\n border-bottom-right-radius: 0.25rem;\n}\n\n.page-item.active .page-link {\n z-index: 2;\n color: #fff;\n background-color: #007bff;\n border-color: #007bff;\n}\n\n.page-item.disabled .page-link {\n color: #868e96;\n pointer-events: none;\n background-color: #fff;\n border-color: #ddd;\n}\n\n.page-link {\n position: relative;\n display: block;\n padding: 0.5rem 0.75rem;\n margin-left: -1px;\n line-height: 1.25;\n color: #007bff;\n background-color: #fff;\n border: 1px solid #ddd;\n}\n\n.page-link:focus, .page-link:hover {\n color: #0056b3;\n text-decoration: none;\n background-color: #e9ecef;\n border-color: #ddd;\n}\n\n.pagination-lg .page-link {\n padding: 0.75rem 1.5rem;\n font-size: 1.25rem;\n line-height: 1.5;\n}\n\n.pagination-lg .page-item:first-child .page-link {\n border-top-left-radius: 0.3rem;\n border-bottom-left-radius: 0.3rem;\n}\n\n.pagination-lg .page-item:last-child .page-link {\n border-top-right-radius: 0.3rem;\n border-bottom-right-radius: 0.3rem;\n}\n\n.pagination-sm .page-link {\n padding: 0.25rem 0.5rem;\n font-size: 0.875rem;\n line-height: 1.5;\n}\n\n.pagination-sm .page-item:first-child .page-link {\n border-top-left-radius: 0.2rem;\n border-bottom-left-radius: 0.2rem;\n}\n\n.pagination-sm .page-item:last-child .page-link {\n border-top-right-radius: 0.2rem;\n border-bottom-right-radius: 0.2rem;\n}\n\n.badge {\n display: inline-block;\n padding: 0.25em 0.4em;\n font-size: 75%;\n font-weight: bold;\n line-height: 1;\n color: #fff;\n text-align: center;\n white-space: nowrap;\n vertical-align: baseline;\n border-radius: 0.25rem;\n}\n\n.badge:empty {\n display: none;\n}\n\n.btn .badge {\n position: relative;\n top: -1px;\n}\n\n.badge-pill {\n padding-right: 0.6em;\n padding-left: 0.6em;\n border-radius: 10rem;\n}\n\n.badge-primary {\n color: #fff;\n background-color: #007bff;\n}\n\n.badge-primary[href]:focus, .badge-primary[href]:hover {\n color: #fff;\n text-decoration: none;\n background-color: #0062cc;\n}\n\n.badge-secondary {\n color: #fff;\n background-color: #868e96;\n}\n\n.badge-secondary[href]:focus, .badge-secondary[href]:hover {\n color: #fff;\n text-decoration: none;\n background-color: #6c757d;\n}\n\n.badge-success {\n color: #fff;\n background-color: #28a745;\n}\n\n.badge-success[href]:focus, .badge-success[href]:hover {\n color: #fff;\n text-decoration: none;\n background-color: #1e7e34;\n}\n\n.badge-info {\n color: #fff;\n background-color: #17a2b8;\n}\n\n.badge-info[href]:focus, .badge-info[href]:hover {\n color: #fff;\n text-decoration: none;\n background-color: #117a8b;\n}\n\n.badge-warning {\n color: #111;\n background-color: #ffc107;\n}\n\n.badge-warning[href]:focus, .badge-warning[href]:hover {\n color: #111;\n text-decoration: none;\n background-color: #d39e00;\n}\n\n.badge-danger {\n color: #fff;\n background-color: #dc3545;\n}\n\n.badge-danger[href]:focus, .badge-danger[href]:hover {\n color: #fff;\n text-decoration: none;\n background-color: #bd2130;\n}\n\n.badge-light {\n color: #111;\n background-color: #f8f9fa;\n}\n\n.badge-light[href]:focus, .badge-light[href]:hover {\n color: #111;\n text-decoration: none;\n background-color: #dae0e5;\n}\n\n.badge-dark {\n color: #fff;\n background-color: #343a40;\n}\n\n.badge-dark[href]:focus, .badge-dark[href]:hover {\n color: #fff;\n text-decoration: none;\n background-color: #1d2124;\n}\n\n.jumbotron {\n padding: 2rem 1rem;\n margin-bottom: 2rem;\n background-color: #e9ecef;\n border-radius: 0.3rem;\n}\n\n@media (min-width: 576px) {\n .jumbotron {\n padding: 4rem 2rem;\n }\n}\n\n.jumbotron-fluid {\n padding-right: 0;\n padding-left: 0;\n border-radius: 0;\n}\n\n.alert {\n padding: 0.75rem 1.25rem;\n margin-bottom: 1rem;\n border: 1px solid transparent;\n border-radius: 0.25rem;\n}\n\n.alert-heading {\n color: inherit;\n}\n\n.alert-link {\n font-weight: bold;\n}\n\n.alert-dismissible .close {\n position: relative;\n top: -0.75rem;\n right: -1.25rem;\n padding: 0.75rem 1.25rem;\n color: inherit;\n}\n\n.alert-primary {\n color: #004085;\n background-color: #cce5ff;\n border-color: #b8daff;\n}\n\n.alert-primary hr {\n border-top-color: #9fcdff;\n}\n\n.alert-primary .alert-link {\n color: #002752;\n}\n\n.alert-secondary {\n color: #464a4e;\n background-color: #e7e8ea;\n border-color: #dddfe2;\n}\n\n.alert-secondary hr {\n border-top-color: #cfd2d6;\n}\n\n.alert-secondary .alert-link {\n color: #2e3133;\n}\n\n.alert-success {\n color: #155724;\n background-color: #d4edda;\n border-color: #c3e6cb;\n}\n\n.alert-success hr {\n border-top-color: #b1dfbb;\n}\n\n.alert-success .alert-link {\n color: #0b2e13;\n}\n\n.alert-info {\n color: #0c5460;\n background-color: #d1ecf1;\n border-color: #bee5eb;\n}\n\n.alert-info hr {\n border-top-color: #abdde5;\n}\n\n.alert-info .alert-link {\n color: #062c33;\n}\n\n.alert-warning {\n color: #856404;\n background-color: #fff3cd;\n border-color: #ffeeba;\n}\n\n.alert-warning hr {\n border-top-color: #ffe8a1;\n}\n\n.alert-warning .alert-link {\n color: #533f03;\n}\n\n.alert-danger {\n color: #721c24;\n background-color: #f8d7da;\n border-color: #f5c6cb;\n}\n\n.alert-danger hr {\n border-top-color: #f1b0b7;\n}\n\n.alert-danger .alert-link {\n color: #491217;\n}\n\n.alert-light {\n color: #818182;\n background-color: #fefefe;\n border-color: #fdfdfe;\n}\n\n.alert-light hr {\n border-top-color: #ececf6;\n}\n\n.alert-light .alert-link {\n color: #686868;\n}\n\n.alert-dark {\n color: #1b1e21;\n background-color: #d6d8d9;\n border-color: #c6c8ca;\n}\n\n.alert-dark hr {\n border-top-color: #b9bbbe;\n}\n\n.alert-dark .alert-link {\n color: #040505;\n}\n\n@keyframes progress-bar-stripes {\n from {\n background-position: 1rem 0;\n }\n to {\n background-position: 0 0;\n }\n}\n\n.progress {\n display: flex;\n overflow: hidden;\n font-size: 0.75rem;\n line-height: 1rem;\n text-align: center;\n background-color: #e9ecef;\n border-radius: 0.25rem;\n}\n\n.progress-bar {\n height: 1rem;\n line-height: 1rem;\n color: #fff;\n background-color: #007bff;\n transition: width 0.6s ease;\n}\n\n.progress-bar-striped {\n background-image: linear-gradient(45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);\n background-size: 1rem 1rem;\n}\n\n.progress-bar-animated {\n animation: progress-bar-stripes 1s linear infinite;\n}\n\n.media {\n display: flex;\n align-items: flex-start;\n}\n\n.media-body {\n flex: 1;\n}\n\n.list-group {\n display: flex;\n flex-direction: column;\n padding-left: 0;\n margin-bottom: 0;\n}\n\n.list-group-item-action {\n width: 100%;\n color: #495057;\n text-align: inherit;\n}\n\n.list-group-item-action:focus, .list-group-item-action:hover {\n color: #495057;\n text-decoration: none;\n background-color: #f8f9fa;\n}\n\n.list-group-item-action:active {\n color: #212529;\n background-color: #e9ecef;\n}\n\n.list-group-item {\n position: relative;\n display: block;\n padding: 0.75rem 1.25rem;\n margin-bottom: -1px;\n background-color: #fff;\n border: 1px solid rgba(0, 0, 0, 0.125);\n}\n\n.list-group-item:first-child {\n border-top-left-radius: 0.25rem;\n border-top-right-radius: 0.25rem;\n}\n\n.list-group-item:last-child {\n margin-bottom: 0;\n border-bottom-right-radius: 0.25rem;\n border-bottom-left-radius: 0.25rem;\n}\n\n.list-group-item:focus, .list-group-item:hover {\n text-decoration: none;\n}\n\n.list-group-item.disabled, .list-group-item:disabled {\n color: #868e96;\n background-color: #fff;\n}\n\n.list-group-item.active {\n z-index: 2;\n color: #fff;\n background-color: #007bff;\n border-color: #007bff;\n}\n\n.list-group-flush .list-group-item {\n border-right: 0;\n border-left: 0;\n border-radius: 0;\n}\n\n.list-group-flush:first-child .list-group-item:first-child {\n border-top: 0;\n}\n\n.list-group-flush:last-child .list-group-item:last-child {\n border-bottom: 0;\n}\n\n.list-group-item-primary {\n color: #004085;\n background-color: #b8daff;\n}\n\na.list-group-item-primary,\nbutton.list-group-item-primary {\n color: #004085;\n}\n\na.list-group-item-primary:focus, a.list-group-item-primary:hover,\nbutton.list-group-item-primary:focus,\nbutton.list-group-item-primary:hover {\n color: #004085;\n background-color: #9fcdff;\n}\n\na.list-group-item-primary.active,\nbutton.list-group-item-primary.active {\n color: #fff;\n background-color: #004085;\n border-color: #004085;\n}\n\n.list-group-item-secondary {\n color: #464a4e;\n background-color: #dddfe2;\n}\n\na.list-group-item-secondary,\nbutton.list-group-item-secondary {\n color: #464a4e;\n}\n\na.list-group-item-secondary:focus, a.list-group-item-secondary:hover,\nbutton.list-group-item-secondary:focus,\nbutton.list-group-item-secondary:hover {\n color: #464a4e;\n background-color: #cfd2d6;\n}\n\na.list-group-item-secondary.active,\nbutton.list-group-item-secondary.active {\n color: #fff;\n background-color: #464a4e;\n border-color: #464a4e;\n}\n\n.list-group-item-success {\n color: #155724;\n background-color: #c3e6cb;\n}\n\na.list-group-item-success,\nbutton.list-group-item-success {\n color: #155724;\n}\n\na.list-group-item-success:focus, a.list-group-item-success:hover,\nbutton.list-group-item-success:focus,\nbutton.list-group-item-success:hover {\n color: #155724;\n background-color: #b1dfbb;\n}\n\na.list-group-item-success.active,\nbutton.list-group-item-success.active {\n color: #fff;\n background-color: #155724;\n border-color: #155724;\n}\n\n.list-group-item-info {\n color: #0c5460;\n background-color: #bee5eb;\n}\n\na.list-group-item-info,\nbutton.list-group-item-info {\n color: #0c5460;\n}\n\na.list-group-item-info:focus, a.list-group-item-info:hover,\nbutton.list-group-item-info:focus,\nbutton.list-group-item-info:hover {\n color: #0c5460;\n background-color: #abdde5;\n}\n\na.list-group-item-info.active,\nbutton.list-group-item-info.active {\n color: #fff;\n background-color: #0c5460;\n border-color: #0c5460;\n}\n\n.list-group-item-warning {\n color: #856404;\n background-color: #ffeeba;\n}\n\na.list-group-item-warning,\nbutton.list-group-item-warning {\n color: #856404;\n}\n\na.list-group-item-warning:focus, a.list-group-item-warning:hover,\nbutton.list-group-item-warning:focus,\nbutton.list-group-item-warning:hover {\n color: #856404;\n background-color: #ffe8a1;\n}\n\na.list-group-item-warning.active,\nbutton.list-group-item-warning.active {\n color: #fff;\n background-color: #856404;\n border-color: #856404;\n}\n\n.list-group-item-danger {\n color: #721c24;\n background-color: #f5c6cb;\n}\n\na.list-group-item-danger,\nbutton.list-group-item-danger {\n color: #721c24;\n}\n\na.list-group-item-danger:focus, a.list-group-item-danger:hover,\nbutton.list-group-item-danger:focus,\nbutton.list-group-item-danger:hover {\n color: #721c24;\n background-color: #f1b0b7;\n}\n\na.list-group-item-danger.active,\nbutton.list-group-item-danger.active {\n color: #fff;\n background-color: #721c24;\n border-color: #721c24;\n}\n\n.list-group-item-light {\n color: #818182;\n background-color: #fdfdfe;\n}\n\na.list-group-item-light,\nbutton.list-group-item-light {\n color: #818182;\n}\n\na.list-group-item-light:focus, a.list-group-item-light:hover,\nbutton.list-group-item-light:focus,\nbutton.list-group-item-light:hover {\n color: #818182;\n background-color: #ececf6;\n}\n\na.list-group-item-light.active,\nbutton.list-group-item-light.active {\n color: #fff;\n background-color: #818182;\n border-color: #818182;\n}\n\n.list-group-item-dark {\n color: #1b1e21;\n background-color: #c6c8ca;\n}\n\na.list-group-item-dark,\nbutton.list-group-item-dark {\n color: #1b1e21;\n}\n\na.list-group-item-dark:focus, a.list-group-item-dark:hover,\nbutton.list-group-item-dark:focus,\nbutton.list-group-item-dark:hover {\n color: #1b1e21;\n background-color: #b9bbbe;\n}\n\na.list-group-item-dark.active,\nbutton.list-group-item-dark.active {\n color: #fff;\n background-color: #1b1e21;\n border-color: #1b1e21;\n}\n\n.close {\n float: right;\n font-size: 1.5rem;\n font-weight: bold;\n line-height: 1;\n color: #000;\n text-shadow: 0 1px 0 #fff;\n opacity: .5;\n}\n\n.close:focus, .close:hover {\n color: #000;\n text-decoration: none;\n opacity: .75;\n}\n\nbutton.close {\n padding: 0;\n background: transparent;\n border: 0;\n -webkit-appearance: none;\n}\n\n.modal-open {\n overflow: hidden;\n}\n\n.modal {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 1050;\n display: none;\n overflow: hidden;\n outline: 0;\n}\n\n.modal.fade .modal-dialog {\n transition: transform 0.3s ease-out;\n transform: translate(0, -25%);\n}\n\n.modal.show .modal-dialog {\n transform: translate(0, 0);\n}\n\n.modal-open .modal {\n overflow-x: hidden;\n overflow-y: auto;\n}\n\n.modal-dialog {\n position: relative;\n width: auto;\n margin: 10px;\n}\n\n.modal-content {\n position: relative;\n display: flex;\n flex-direction: column;\n background-color: #fff;\n background-clip: padding-box;\n border: 1px solid rgba(0, 0, 0, 0.2);\n border-radius: 0.3rem;\n outline: 0;\n}\n\n.modal-backdrop {\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 1040;\n background-color: #000;\n}\n\n.modal-backdrop.fade {\n opacity: 0;\n}\n\n.modal-backdrop.show {\n opacity: 0.5;\n}\n\n.modal-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 15px;\n border-bottom: 1px solid #e9ecef;\n}\n\n.modal-title {\n margin-bottom: 0;\n line-height: 1.5;\n}\n\n.modal-body {\n position: relative;\n flex: 1 1 auto;\n padding: 15px;\n}\n\n.modal-footer {\n display: flex;\n align-items: center;\n justify-content: flex-end;\n padding: 15px;\n border-top: 1px solid #e9ecef;\n}\n\n.modal-footer > :not(:first-child) {\n margin-left: .25rem;\n}\n\n.modal-footer > :not(:last-child) {\n margin-right: .25rem;\n}\n\n.modal-scrollbar-measure {\n position: absolute;\n top: -9999px;\n width: 50px;\n height: 50px;\n overflow: scroll;\n}\n\n@media (min-width: 576px) {\n .modal-dialog {\n max-width: 500px;\n margin: 30px auto;\n }\n .modal-sm {\n max-width: 300px;\n }\n}\n\n@media (min-width: 992px) {\n .modal-lg {\n max-width: 800px;\n }\n}\n\n.tooltip {\n position: absolute;\n z-index: 1070;\n display: block;\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;\n font-style: normal;\n font-weight: normal;\n line-height: 1.5;\n text-align: left;\n text-align: start;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n letter-spacing: normal;\n word-break: normal;\n word-spacing: normal;\n white-space: normal;\n line-break: auto;\n font-size: 0.875rem;\n word-wrap: break-word;\n opacity: 0;\n}\n\n.tooltip.show {\n opacity: 0.9;\n}\n\n.tooltip .arrow {\n position: absolute;\n display: block;\n width: 5px;\n height: 5px;\n}\n\n.tooltip.bs-tooltip-top, .tooltip.bs-tooltip-auto[x-placement^=\"top\"] {\n padding: 5px 0;\n}\n\n.tooltip.bs-tooltip-top .arrow, .tooltip.bs-tooltip-auto[x-placement^=\"top\"] .arrow {\n bottom: 0;\n}\n\n.tooltip.bs-tooltip-top .arrow::before, .tooltip.bs-tooltip-auto[x-placement^=\"top\"] .arrow::before {\n margin-left: -3px;\n content: \"\";\n border-width: 5px 5px 0;\n border-top-color: #000;\n}\n\n.tooltip.bs-tooltip-right, .tooltip.bs-tooltip-auto[x-placement^=\"right\"] {\n padding: 0 5px;\n}\n\n.tooltip.bs-tooltip-right .arrow, .tooltip.bs-tooltip-auto[x-placement^=\"right\"] .arrow {\n left: 0;\n}\n\n.tooltip.bs-tooltip-right .arrow::before, .tooltip.bs-tooltip-auto[x-placement^=\"right\"] .arrow::before {\n margin-top: -3px;\n content: \"\";\n border-width: 5px 5px 5px 0;\n border-right-color: #000;\n}\n\n.tooltip.bs-tooltip-bottom, .tooltip.bs-tooltip-auto[x-placement^=\"bottom\"] {\n padding: 5px 0;\n}\n\n.tooltip.bs-tooltip-bottom .arrow, .tooltip.bs-tooltip-auto[x-placement^=\"bottom\"] .arrow {\n top: 0;\n}\n\n.tooltip.bs-tooltip-bottom .arrow::before, .tooltip.bs-tooltip-auto[x-placement^=\"bottom\"] .arrow::before {\n margin-left: -3px;\n content: \"\";\n border-width: 0 5px 5px;\n border-bottom-color: #000;\n}\n\n.tooltip.bs-tooltip-left, .tooltip.bs-tooltip-auto[x-placement^=\"left\"] {\n padding: 0 5px;\n}\n\n.tooltip.bs-tooltip-left .arrow, .tooltip.bs-tooltip-auto[x-placement^=\"left\"] .arrow {\n right: 0;\n}\n\n.tooltip.bs-tooltip-left .arrow::before, .tooltip.bs-tooltip-auto[x-placement^=\"left\"] .arrow::before {\n right: 0;\n margin-top: -3px;\n content: \"\";\n border-width: 5px 0 5px 5px;\n border-left-color: #000;\n}\n\n.tooltip .arrow::before {\n position: absolute;\n border-color: transparent;\n border-style: solid;\n}\n\n.tooltip-inner {\n max-width: 200px;\n padding: 3px 8px;\n color: #fff;\n text-align: center;\n background-color: #000;\n border-radius: 0.25rem;\n}\n\n.popover {\n position: absolute;\n top: 0;\n left: 0;\n z-index: 1060;\n display: block;\n max-width: 276px;\n padding: 1px;\n font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif;\n font-style: normal;\n font-weight: normal;\n line-height: 1.5;\n text-align: left;\n text-align: start;\n text-decoration: none;\n text-shadow: none;\n text-transform: none;\n letter-spacing: normal;\n word-break: normal;\n word-spacing: normal;\n white-space: normal;\n line-break: auto;\n font-size: 0.875rem;\n word-wrap: break-word;\n background-color: #fff;\n background-clip: padding-box;\n border: 1px solid rgba(0, 0, 0, 0.2);\n border-radius: 0.3rem;\n}\n\n.popover .arrow {\n position: absolute;\n display: block;\n width: 10px;\n height: 5px;\n}\n\n.popover .arrow::before,\n.popover .arrow::after {\n position: absolute;\n display: block;\n border-color: transparent;\n border-style: solid;\n}\n\n.popover .arrow::before {\n content: \"\";\n border-width: 11px;\n}\n\n.popover .arrow::after {\n content: \"\";\n border-width: 11px;\n}\n\n.popover.bs-popover-top, .popover.bs-popover-auto[x-placement^=\"top\"] {\n margin-bottom: 10px;\n}\n\n.popover.bs-popover-top .arrow, .popover.bs-popover-auto[x-placement^=\"top\"] .arrow {\n bottom: 0;\n}\n\n.popover.bs-popover-top .arrow::before, .popover.bs-popover-auto[x-placement^=\"top\"] .arrow::before,\n.popover.bs-popover-top .arrow::after, .popover.bs-popover-auto[x-placement^=\"top\"] .arrow::after {\n border-bottom-width: 0;\n}\n\n.popover.bs-popover-top .arrow::before, .popover.bs-popover-auto[x-placement^=\"top\"] .arrow::before {\n bottom: -11px;\n margin-left: -6px;\n border-top-color: rgba(0, 0, 0, 0.25);\n}\n\n.popover.bs-popover-top .arrow::after, .popover.bs-popover-auto[x-placement^=\"top\"] .arrow::after {\n bottom: -10px;\n margin-left: -6px;\n border-top-color: #fff;\n}\n\n.popover.bs-popover-right, .popover.bs-popover-auto[x-placement^=\"right\"] {\n margin-left: 10px;\n}\n\n.popover.bs-popover-right .arrow, .popover.bs-popover-auto[x-placement^=\"right\"] .arrow {\n left: 0;\n}\n\n.popover.bs-popover-right .arrow::before, .popover.bs-popover-auto[x-placement^=\"right\"] .arrow::before,\n.popover.bs-popover-right .arrow::after, .popover.bs-popover-auto[x-placement^=\"right\"] .arrow::after {\n margin-top: -8px;\n border-left-width: 0;\n}\n\n.popover.bs-popover-right .arrow::before, .popover.bs-popover-auto[x-placement^=\"right\"] .arrow::before {\n left: -11px;\n border-right-color: rgba(0, 0, 0, 0.25);\n}\n\n.popover.bs-popover-right .arrow::after, .popover.bs-popover-auto[x-placement^=\"right\"] .arrow::after {\n left: -10px;\n border-right-color: #fff;\n}\n\n.popover.bs-popover-bottom, .popover.bs-popover-auto[x-placement^=\"bottom\"] {\n margin-top: 10px;\n}\n\n.popover.bs-popover-bottom .arrow, .popover.bs-popover-auto[x-placement^=\"bottom\"] .arrow {\n top: 0;\n}\n\n.popover.bs-popover-bottom .arrow::before, .popover.bs-popover-auto[x-placement^=\"bottom\"] .arrow::before,\n.popover.bs-popover-bottom .arrow::after, .popover.bs-popover-auto[x-placement^=\"bottom\"] .arrow::after {\n margin-left: -7px;\n border-top-width: 0;\n}\n\n.popover.bs-popover-bottom .arrow::before, .popover.bs-popover-auto[x-placement^=\"bottom\"] .arrow::before {\n top: -11px;\n border-bottom-color: rgba(0, 0, 0, 0.25);\n}\n\n.popover.bs-popover-bottom .arrow::after, .popover.bs-popover-auto[x-placement^=\"bottom\"] .arrow::after {\n top: -10px;\n border-bottom-color: #fff;\n}\n\n.popover.bs-popover-bottom .popover-header::before, .popover.bs-popover-auto[x-placement^=\"bottom\"] .popover-header::before {\n position: absolute;\n top: 0;\n left: 50%;\n display: block;\n width: 20px;\n margin-left: -10px;\n content: \"\";\n border-bottom: 1px solid #f7f7f7;\n}\n\n.popover.bs-popover-left, .popover.bs-popover-auto[x-placement^=\"left\"] {\n margin-right: 10px;\n}\n\n.popover.bs-popover-left .arrow, .popover.bs-popover-auto[x-placement^=\"left\"] .arrow {\n right: 0;\n}\n\n.popover.bs-popover-left .arrow::before, .popover.bs-popover-auto[x-placement^=\"left\"] .arrow::before,\n.popover.bs-popover-left .arrow::after, .popover.bs-popover-auto[x-placement^=\"left\"] .arrow::after {\n margin-top: -8px;\n border-right-width: 0;\n}\n\n.popover.bs-popover-left .arrow::before, .popover.bs-popover-auto[x-placement^=\"left\"] .arrow::before {\n right: -11px;\n border-left-color: rgba(0, 0, 0, 0.25);\n}\n\n.popover.bs-popover-left .arrow::after, .popover.bs-popover-auto[x-placement^=\"left\"] .arrow::after {\n right: -10px;\n border-left-color: #fff;\n}\n\n.popover-header {\n padding: 8px 14px;\n margin-bottom: 0;\n font-size: 1rem;\n color: inherit;\n background-color: #f7f7f7;\n border-bottom: 1px solid #ebebeb;\n border-top-left-radius: calc(0.3rem - 1px);\n border-top-right-radius: calc(0.3rem - 1px);\n}\n\n.popover-header:empty {\n display: none;\n}\n\n.popover-body {\n padding: 9px 14px;\n color: #212529;\n}\n\n.carousel {\n position: relative;\n}\n\n.carousel-inner {\n position: relative;\n width: 100%;\n overflow: hidden;\n}\n\n.carousel-item {\n position: relative;\n display: none;\n align-items: center;\n width: 100%;\n transition: transform 0.6s ease;\n backface-visibility: hidden;\n perspective: 1000px;\n}\n\n.carousel-item.active,\n.carousel-item-next,\n.carousel-item-prev {\n display: block;\n}\n\n.carousel-item-next,\n.carousel-item-prev {\n position: absolute;\n top: 0;\n}\n\n.carousel-item-next.carousel-item-left,\n.carousel-item-prev.carousel-item-right {\n transform: translateX(0);\n}\n\n@supports (transform-style: preserve-3d) {\n .carousel-item-next.carousel-item-left,\n .carousel-item-prev.carousel-item-right {\n transform: translate3d(0, 0, 0);\n }\n}\n\n.carousel-item-next,\n.active.carousel-item-right {\n transform: translateX(100%);\n}\n\n@supports (transform-style: preserve-3d) {\n .carousel-item-next,\n .active.carousel-item-right {\n transform: translate3d(100%, 0, 0);\n }\n}\n\n.carousel-item-prev,\n.active.carousel-item-left {\n transform: translateX(-100%);\n}\n\n@supports (transform-style: preserve-3d) {\n .carousel-item-prev,\n .active.carousel-item-left {\n transform: translate3d(-100%, 0, 0);\n }\n}\n\n.carousel-control-prev,\n.carousel-control-next {\n position: absolute;\n top: 0;\n bottom: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n width: 15%;\n color: #fff;\n text-align: center;\n opacity: 0.5;\n}\n\n.carousel-control-prev:focus, .carousel-control-prev:hover,\n.carousel-control-next:focus,\n.carousel-control-next:hover {\n color: #fff;\n text-decoration: none;\n outline: 0;\n opacity: .9;\n}\n\n.carousel-control-prev {\n left: 0;\n}\n\n.carousel-control-next {\n right: 0;\n}\n\n.carousel-control-prev-icon,\n.carousel-control-next-icon {\n display: inline-block;\n width: 20px;\n height: 20px;\n background: transparent no-repeat center center;\n background-size: 100% 100%;\n}\n\n.carousel-control-prev-icon {\n background-image: url(\"data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3E%3Cpath d='M4 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/%3E%3C/svg%3E\");\n}\n\n.carousel-control-next-icon {\n background-image: url(\"data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23fff' viewBox='0 0 8 8'%3E%3Cpath d='M1.5 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z'/%3E%3C/svg%3E\");\n}\n\n.carousel-indicators {\n position: absolute;\n right: 0;\n bottom: 10px;\n left: 0;\n z-index: 15;\n display: flex;\n justify-content: center;\n padding-left: 0;\n margin-right: 15%;\n margin-left: 15%;\n list-style: none;\n}\n\n.carousel-indicators li {\n position: relative;\n flex: 0 1 auto;\n width: 30px;\n height: 3px;\n margin-right: 3px;\n margin-left: 3px;\n text-indent: -999px;\n background-color: rgba(255, 255, 255, 0.5);\n}\n\n.carousel-indicators li::before {\n position: absolute;\n top: -10px;\n left: 0;\n display: inline-block;\n width: 100%;\n height: 10px;\n content: \"\";\n}\n\n.carousel-indicators li::after {\n position: absolute;\n bottom: -10px;\n left: 0;\n display: inline-block;\n width: 100%;\n height: 10px;\n content: \"\";\n}\n\n.carousel-indicators .active {\n background-color: #fff;\n}\n\n.carousel-caption {\n position: absolute;\n right: 15%;\n bottom: 20px;\n left: 15%;\n z-index: 10;\n padding-top: 20px;\n padding-bottom: 20px;\n color: #fff;\n text-align: center;\n}\n\n.align-baseline {\n vertical-align: baseline !important;\n}\n\n.align-top {\n vertical-align: top !important;\n}\n\n.align-middle {\n vertical-align: middle !important;\n}\n\n.align-bottom {\n vertical-align: bottom !important;\n}\n\n.align-text-bottom {\n vertical-align: text-bottom !important;\n}\n\n.align-text-top {\n vertical-align: text-top !important;\n}\n\n.bg-primary {\n background-color: #007bff !important;\n}\n\na.bg-primary:focus, a.bg-primary:hover {\n background-color: #0062cc !important;\n}\n\n.bg-secondary {\n background-color: #868e96 !important;\n}\n\na.bg-secondary:focus, a.bg-secondary:hover {\n background-color: #6c757d !important;\n}\n\n.bg-success {\n background-color: #28a745 !important;\n}\n\na.bg-success:focus, a.bg-success:hover {\n background-color: #1e7e34 !important;\n}\n\n.bg-info {\n background-color: #17a2b8 !important;\n}\n\na.bg-info:focus, a.bg-info:hover {\n background-color: #117a8b !important;\n}\n\n.bg-warning {\n background-color: #ffc107 !important;\n}\n\na.bg-warning:focus, a.bg-warning:hover {\n background-color: #d39e00 !important;\n}\n\n.bg-danger {\n background-color: #dc3545 !important;\n}\n\na.bg-danger:focus, a.bg-danger:hover {\n background-color: #bd2130 !important;\n}\n\n.bg-light {\n background-color: #f8f9fa !important;\n}\n\na.bg-light:focus, a.bg-light:hover {\n background-color: #dae0e5 !important;\n}\n\n.bg-dark {\n background-color: #343a40 !important;\n}\n\na.bg-dark:focus, a.bg-dark:hover {\n background-color: #1d2124 !important;\n}\n\n.bg-white {\n background-color: #fff !important;\n}\n\n.bg-transparent {\n background-color: transparent !important;\n}\n\n.border {\n border: 1px solid #e9ecef !important;\n}\n\n.border-0 {\n border: 0 !important;\n}\n\n.border-top-0 {\n border-top: 0 !important;\n}\n\n.border-right-0 {\n border-right: 0 !important;\n}\n\n.border-bottom-0 {\n border-bottom: 0 !important;\n}\n\n.border-left-0 {\n border-left: 0 !important;\n}\n\n.border-primary {\n border-color: #007bff !important;\n}\n\n.border-secondary {\n border-color: #868e96 !important;\n}\n\n.border-success {\n border-color: #28a745 !important;\n}\n\n.border-info {\n border-color: #17a2b8 !important;\n}\n\n.border-warning {\n border-color: #ffc107 !important;\n}\n\n.border-danger {\n border-color: #dc3545 !important;\n}\n\n.border-light {\n border-color: #f8f9fa !important;\n}\n\n.border-dark {\n border-color: #343a40 !important;\n}\n\n.border-white {\n border-color: #fff !important;\n}\n\n.rounded {\n border-radius: 0.25rem !important;\n}\n\n.rounded-top {\n border-top-left-radius: 0.25rem !important;\n border-top-right-radius: 0.25rem !important;\n}\n\n.rounded-right {\n border-top-right-radius: 0.25rem !important;\n border-bottom-right-radius: 0.25rem !important;\n}\n\n.rounded-bottom {\n border-bottom-right-radius: 0.25rem !important;\n border-bottom-left-radius: 0.25rem !important;\n}\n\n.rounded-left {\n border-top-left-radius: 0.25rem !important;\n border-bottom-left-radius: 0.25rem !important;\n}\n\n.rounded-circle {\n border-radius: 50%;\n}\n\n.rounded-0 {\n border-radius: 0;\n}\n\n.clearfix::after {\n display: block;\n clear: both;\n content: \"\";\n}\n\n.d-none {\n display: none !important;\n}\n\n.d-inline {\n display: inline !important;\n}\n\n.d-inline-block {\n display: inline-block !important;\n}\n\n.d-block {\n display: block !important;\n}\n\n.d-table {\n display: table !important;\n}\n\n.d-table-cell {\n display: table-cell !important;\n}\n\n.d-flex {\n display: flex !important;\n}\n\n.d-inline-flex {\n display: inline-flex !important;\n}\n\n@media (min-width: 576px) {\n .d-sm-none {\n display: none !important;\n }\n .d-sm-inline {\n display: inline !important;\n }\n .d-sm-inline-block {\n display: inline-block !important;\n }\n .d-sm-block {\n display: block !important;\n }\n .d-sm-table {\n display: table !important;\n }\n .d-sm-table-cell {\n display: table-cell !important;\n }\n .d-sm-flex {\n display: flex !important;\n }\n .d-sm-inline-flex {\n display: inline-flex !important;\n }\n}\n\n@media (min-width: 768px) {\n .d-md-none {\n display: none !important;\n }\n .d-md-inline {\n display: inline !important;\n }\n .d-md-inline-block {\n display: inline-block !important;\n }\n .d-md-block {\n display: block !important;\n }\n .d-md-table {\n display: table !important;\n }\n .d-md-table-cell {\n display: table-cell !important;\n }\n .d-md-flex {\n display: flex !important;\n }\n .d-md-inline-flex {\n display: inline-flex !important;\n }\n}\n\n@media (min-width: 992px) {\n .d-lg-none {\n display: none !important;\n }\n .d-lg-inline {\n display: inline !important;\n }\n .d-lg-inline-block {\n display: inline-block !important;\n }\n .d-lg-block {\n display: block !important;\n }\n .d-lg-table {\n display: table !important;\n }\n .d-lg-table-cell {\n display: table-cell !important;\n }\n .d-lg-flex {\n display: flex !important;\n }\n .d-lg-inline-flex {\n display: inline-flex !important;\n }\n}\n\n@media (min-width: 1200px) {\n .d-xl-none {\n display: none !important;\n }\n .d-xl-inline {\n display: inline !important;\n }\n .d-xl-inline-block {\n display: inline-block !important;\n }\n .d-xl-block {\n display: block !important;\n }\n .d-xl-table {\n display: table !important;\n }\n .d-xl-table-cell {\n display: table-cell !important;\n }\n .d-xl-flex {\n display: flex !important;\n }\n .d-xl-inline-flex {\n display: inline-flex !important;\n }\n}\n\n.d-print-block {\n display: none !important;\n}\n\n@media print {\n .d-print-block {\n display: block !important;\n }\n}\n\n.d-print-inline {\n display: none !important;\n}\n\n@media print {\n .d-print-inline {\n display: inline !important;\n }\n}\n\n.d-print-inline-block {\n display: none !important;\n}\n\n@media print {\n .d-print-inline-block {\n display: inline-block !important;\n }\n}\n\n@media print {\n .d-print-none {\n display: none !important;\n }\n}\n\n.embed-responsive {\n position: relative;\n display: block;\n width: 100%;\n padding: 0;\n overflow: hidden;\n}\n\n.embed-responsive::before {\n display: block;\n content: \"\";\n}\n\n.embed-responsive .embed-responsive-item,\n.embed-responsive iframe,\n.embed-responsive embed,\n.embed-responsive object,\n.embed-responsive video {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n width: 100%;\n height: 100%;\n border: 0;\n}\n\n.embed-responsive-21by9::before {\n padding-top: 42.857143%;\n}\n\n.embed-responsive-16by9::before {\n padding-top: 56.25%;\n}\n\n.embed-responsive-4by3::before {\n padding-top: 75%;\n}\n\n.embed-responsive-1by1::before {\n padding-top: 100%;\n}\n\n.flex-row {\n flex-direction: row !important;\n}\n\n.flex-column {\n flex-direction: column !important;\n}\n\n.flex-row-reverse {\n flex-direction: row-reverse !important;\n}\n\n.flex-column-reverse {\n flex-direction: column-reverse !important;\n}\n\n.flex-wrap {\n flex-wrap: wrap !important;\n}\n\n.flex-nowrap {\n flex-wrap: nowrap !important;\n}\n\n.flex-wrap-reverse {\n flex-wrap: wrap-reverse !important;\n}\n\n.justify-content-start {\n justify-content: flex-start !important;\n}\n\n.justify-content-end {\n justify-content: flex-end !important;\n}\n\n.justify-content-center {\n justify-content: center !important;\n}\n\n.justify-content-between {\n justify-content: space-between !important;\n}\n\n.justify-content-around {\n justify-content: space-around !important;\n}\n\n.align-items-start {\n align-items: flex-start !important;\n}\n\n.align-items-end {\n align-items: flex-end !important;\n}\n\n.align-items-center {\n align-items: center !important;\n}\n\n.align-items-baseline {\n align-items: baseline !important;\n}\n\n.align-items-stretch {\n align-items: stretch !important;\n}\n\n.align-content-start {\n align-content: flex-start !important;\n}\n\n.align-content-end {\n align-content: flex-end !important;\n}\n\n.align-content-center {\n align-content: center !important;\n}\n\n.align-content-between {\n align-content: space-between !important;\n}\n\n.align-content-around {\n align-content: space-around !important;\n}\n\n.align-content-stretch {\n align-content: stretch !important;\n}\n\n.align-self-auto {\n align-self: auto !important;\n}\n\n.align-self-start {\n align-self: flex-start !important;\n}\n\n.align-self-end {\n align-self: flex-end !important;\n}\n\n.align-self-center {\n align-self: center !important;\n}\n\n.align-self-baseline {\n align-self: baseline !important;\n}\n\n.align-self-stretch {\n align-self: stretch !important;\n}\n\n@media (min-width: 576px) {\n .flex-sm-row {\n flex-direction: row !important;\n }\n .flex-sm-column {\n flex-direction: column !important;\n }\n .flex-sm-row-reverse {\n flex-direction: row-reverse !important;\n }\n .flex-sm-column-reverse {\n flex-direction: column-reverse !important;\n }\n .flex-sm-wrap {\n flex-wrap: wrap !important;\n }\n .flex-sm-nowrap {\n flex-wrap: nowrap !important;\n }\n .flex-sm-wrap-reverse {\n flex-wrap: wrap-reverse !important;\n }\n .justify-content-sm-start {\n justify-content: flex-start !important;\n }\n .justify-content-sm-end {\n justify-content: flex-end !important;\n }\n .justify-content-sm-center {\n justify-content: center !important;\n }\n .justify-content-sm-between {\n justify-content: space-between !important;\n }\n .justify-content-sm-around {\n justify-content: space-around !important;\n }\n .align-items-sm-start {\n align-items: flex-start !important;\n }\n .align-items-sm-end {\n align-items: flex-end !important;\n }\n .align-items-sm-center {\n align-items: center !important;\n }\n .align-items-sm-baseline {\n align-items: baseline !important;\n }\n .align-items-sm-stretch {\n align-items: stretch !important;\n }\n .align-content-sm-start {\n align-content: flex-start !important;\n }\n .align-content-sm-end {\n align-content: flex-end !important;\n }\n .align-content-sm-center {\n align-content: center !important;\n }\n .align-content-sm-between {\n align-content: space-between !important;\n }\n .align-content-sm-around {\n align-content: space-around !important;\n }\n .align-content-sm-stretch {\n align-content: stretch !important;\n }\n .align-self-sm-auto {\n align-self: auto !important;\n }\n .align-self-sm-start {\n align-self: flex-start !important;\n }\n .align-self-sm-end {\n align-self: flex-end !important;\n }\n .align-self-sm-center {\n align-self: center !important;\n }\n .align-self-sm-baseline {\n align-self: baseline !important;\n }\n .align-self-sm-stretch {\n align-self: stretch !important;\n }\n}\n\n@media (min-width: 768px) {\n .flex-md-row {\n flex-direction: row !important;\n }\n .flex-md-column {\n flex-direction: column !important;\n }\n .flex-md-row-reverse {\n flex-direction: row-reverse !important;\n }\n .flex-md-column-reverse {\n flex-direction: column-reverse !important;\n }\n .flex-md-wrap {\n flex-wrap: wrap !important;\n }\n .flex-md-nowrap {\n flex-wrap: nowrap !important;\n }\n .flex-md-wrap-reverse {\n flex-wrap: wrap-reverse !important;\n }\n .justify-content-md-start {\n justify-content: flex-start !important;\n }\n .justify-content-md-end {\n justify-content: flex-end !important;\n }\n .justify-content-md-center {\n justify-content: center !important;\n }\n .justify-content-md-between {\n justify-content: space-between !important;\n }\n .justify-content-md-around {\n justify-content: space-around !important;\n }\n .align-items-md-start {\n align-items: flex-start !important;\n }\n .align-items-md-end {\n align-items: flex-end !important;\n }\n .align-items-md-center {\n align-items: center !important;\n }\n .align-items-md-baseline {\n align-items: baseline !important;\n }\n .align-items-md-stretch {\n align-items: stretch !important;\n }\n .align-content-md-start {\n align-content: flex-start !important;\n }\n .align-content-md-end {\n align-content: flex-end !important;\n }\n .align-content-md-center {\n align-content: center !important;\n }\n .align-content-md-between {\n align-content: space-between !important;\n }\n .align-content-md-around {\n align-content: space-around !important;\n }\n .align-content-md-stretch {\n align-content: stretch !important;\n }\n .align-self-md-auto {\n align-self: auto !important;\n }\n .align-self-md-start {\n align-self: flex-start !important;\n }\n .align-self-md-end {\n align-self: flex-end !important;\n }\n .align-self-md-center {\n align-self: center !important;\n }\n .align-self-md-baseline {\n align-self: baseline !important;\n }\n .align-self-md-stretch {\n align-self: stretch !important;\n }\n}\n\n@media (min-width: 992px) {\n .flex-lg-row {\n flex-direction: row !important;\n }\n .flex-lg-column {\n flex-direction: column !important;\n }\n .flex-lg-row-reverse {\n flex-direction: row-reverse !important;\n }\n .flex-lg-column-reverse {\n flex-direction: column-reverse !important;\n }\n .flex-lg-wrap {\n flex-wrap: wrap !important;\n }\n .flex-lg-nowrap {\n flex-wrap: nowrap !important;\n }\n .flex-lg-wrap-reverse {\n flex-wrap: wrap-reverse !important;\n }\n .justify-content-lg-start {\n justify-content: flex-start !important;\n }\n .justify-content-lg-end {\n justify-content: flex-end !important;\n }\n .justify-content-lg-center {\n justify-content: center !important;\n }\n .justify-content-lg-between {\n justify-content: space-between !important;\n }\n .justify-content-lg-around {\n justify-content: space-around !important;\n }\n .align-items-lg-start {\n align-items: flex-start !important;\n }\n .align-items-lg-end {\n align-items: flex-end !important;\n }\n .align-items-lg-center {\n align-items: center !important;\n }\n .align-items-lg-baseline {\n align-items: baseline !important;\n }\n .align-items-lg-stretch {\n align-items: stretch !important;\n }\n .align-content-lg-start {\n align-content: flex-start !important;\n }\n .align-content-lg-end {\n align-content: flex-end !important;\n }\n .align-content-lg-center {\n align-content: center !important;\n }\n .align-content-lg-between {\n align-content: space-between !important;\n }\n .align-content-lg-around {\n align-content: space-around !important;\n }\n .align-content-lg-stretch {\n align-content: stretch !important;\n }\n .align-self-lg-auto {\n align-self: auto !important;\n }\n .align-self-lg-start {\n align-self: flex-start !important;\n }\n .align-self-lg-end {\n align-self: flex-end !important;\n }\n .align-self-lg-center {\n align-self: center !important;\n }\n .align-self-lg-baseline {\n align-self: baseline !important;\n }\n .align-self-lg-stretch {\n align-self: stretch !important;\n }\n}\n\n@media (min-width: 1200px) {\n .flex-xl-row {\n flex-direction: row !important;\n }\n .flex-xl-column {\n flex-direction: column !important;\n }\n .flex-xl-row-reverse {\n flex-direction: row-reverse !important;\n }\n .flex-xl-column-reverse {\n flex-direction: column-reverse !important;\n }\n .flex-xl-wrap {\n flex-wrap: wrap !important;\n }\n .flex-xl-nowrap {\n flex-wrap: nowrap !important;\n }\n .flex-xl-wrap-reverse {\n flex-wrap: wrap-reverse !important;\n }\n .justify-content-xl-start {\n justify-content: flex-start !important;\n }\n .justify-content-xl-end {\n justify-content: flex-end !important;\n }\n .justify-content-xl-center {\n justify-content: center !important;\n }\n .justify-content-xl-between {\n justify-content: space-between !important;\n }\n .justify-content-xl-around {\n justify-content: space-around !important;\n }\n .align-items-xl-start {\n align-items: flex-start !important;\n }\n .align-items-xl-end {\n align-items: flex-end !important;\n }\n .align-items-xl-center {\n align-items: center !important;\n }\n .align-items-xl-baseline {\n align-items: baseline !important;\n }\n .align-items-xl-stretch {\n align-items: stretch !important;\n }\n .align-content-xl-start {\n align-content: flex-start !important;\n }\n .align-content-xl-end {\n align-content: flex-end !important;\n }\n .align-content-xl-center {\n align-content: center !important;\n }\n .align-content-xl-between {\n align-content: space-between !important;\n }\n .align-content-xl-around {\n align-content: space-around !important;\n }\n .align-content-xl-stretch {\n align-content: stretch !important;\n }\n .align-self-xl-auto {\n align-self: auto !important;\n }\n .align-self-xl-start {\n align-self: flex-start !important;\n }\n .align-self-xl-end {\n align-self: flex-end !important;\n }\n .align-self-xl-center {\n align-self: center !important;\n }\n .align-self-xl-baseline {\n align-self: baseline !important;\n }\n .align-self-xl-stretch {\n align-self: stretch !important;\n }\n}\n\n.float-left {\n float: left !important;\n}\n\n.float-right {\n float: right !important;\n}\n\n.float-none {\n float: none !important;\n}\n\n@media (min-width: 576px) {\n .float-sm-left {\n float: left !important;\n }\n .float-sm-right {\n float: right !important;\n }\n .float-sm-none {\n float: none !important;\n }\n}\n\n@media (min-width: 768px) {\n .float-md-left {\n float: left !important;\n }\n .float-md-right {\n float: right !important;\n }\n .float-md-none {\n float: none !important;\n }\n}\n\n@media (min-width: 992px) {\n .float-lg-left {\n float: left !important;\n }\n .float-lg-right {\n float: right !important;\n }\n .float-lg-none {\n float: none !important;\n }\n}\n\n@media (min-width: 1200px) {\n .float-xl-left {\n float: left !important;\n }\n .float-xl-right {\n float: right !important;\n }\n .float-xl-none {\n float: none !important;\n }\n}\n\n.fixed-top {\n position: fixed;\n top: 0;\n right: 0;\n left: 0;\n z-index: 1030;\n}\n\n.fixed-bottom {\n position: fixed;\n right: 0;\n bottom: 0;\n left: 0;\n z-index: 1030;\n}\n\n@supports (position: sticky) {\n .sticky-top {\n position: sticky;\n top: 0;\n z-index: 1020;\n }\n}\n\n.sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n clip-path: inset(50%);\n border: 0;\n}\n\n.sr-only-focusable:active, .sr-only-focusable:focus {\n position: static;\n width: auto;\n height: auto;\n overflow: visible;\n clip: auto;\n white-space: normal;\n clip-path: none;\n}\n\n.w-25 {\n width: 25% !important;\n}\n\n.w-50 {\n width: 50% !important;\n}\n\n.w-75 {\n width: 75% !important;\n}\n\n.w-100 {\n width: 100% !important;\n}\n\n.h-25 {\n height: 25% !important;\n}\n\n.h-50 {\n height: 50% !important;\n}\n\n.h-75 {\n height: 75% !important;\n}\n\n.h-100 {\n height: 100% !important;\n}\n\n.mw-100 {\n max-width: 100% !important;\n}\n\n.mh-100 {\n max-height: 100% !important;\n}\n\n.m-0 {\n margin: 0 !important;\n}\n\n.mt-0 {\n margin-top: 0 !important;\n}\n\n.mr-0 {\n margin-right: 0 !important;\n}\n\n.mb-0 {\n margin-bottom: 0 !important;\n}\n\n.ml-0 {\n margin-left: 0 !important;\n}\n\n.mx-0 {\n margin-right: 0 !important;\n margin-left: 0 !important;\n}\n\n.my-0 {\n margin-top: 0 !important;\n margin-bottom: 0 !important;\n}\n\n.m-1 {\n margin: 0.25rem !important;\n}\n\n.mt-1 {\n margin-top: 0.25rem !important;\n}\n\n.mr-1 {\n margin-right: 0.25rem !important;\n}\n\n.mb-1 {\n margin-bottom: 0.25rem !important;\n}\n\n.ml-1 {\n margin-left: 0.25rem !important;\n}\n\n.mx-1 {\n margin-right: 0.25rem !important;\n margin-left: 0.25rem !important;\n}\n\n.my-1 {\n margin-top: 0.25rem !important;\n margin-bottom: 0.25rem !important;\n}\n\n.m-2 {\n margin: 0.5rem !important;\n}\n\n.mt-2 {\n margin-top: 0.5rem !important;\n}\n\n.mr-2 {\n margin-right: 0.5rem !important;\n}\n\n.mb-2 {\n margin-bottom: 0.5rem !important;\n}\n\n.ml-2 {\n margin-left: 0.5rem !important;\n}\n\n.mx-2 {\n margin-right: 0.5rem !important;\n margin-left: 0.5rem !important;\n}\n\n.my-2 {\n margin-top: 0.5rem !important;\n margin-bottom: 0.5rem !important;\n}\n\n.m-3 {\n margin: 1rem !important;\n}\n\n.mt-3 {\n margin-top: 1rem !important;\n}\n\n.mr-3 {\n margin-right: 1rem !important;\n}\n\n.mb-3 {\n margin-bottom: 1rem !important;\n}\n\n.ml-3 {\n margin-left: 1rem !important;\n}\n\n.mx-3 {\n margin-right: 1rem !important;\n margin-left: 1rem !important;\n}\n\n.my-3 {\n margin-top: 1rem !important;\n margin-bottom: 1rem !important;\n}\n\n.m-4 {\n margin: 1.5rem !important;\n}\n\n.mt-4 {\n margin-top: 1.5rem !important;\n}\n\n.mr-4 {\n margin-right: 1.5rem !important;\n}\n\n.mb-4 {\n margin-bottom: 1.5rem !important;\n}\n\n.ml-4 {\n margin-left: 1.5rem !important;\n}\n\n.mx-4 {\n margin-right: 1.5rem !important;\n margin-left: 1.5rem !important;\n}\n\n.my-4 {\n margin-top: 1.5rem !important;\n margin-bottom: 1.5rem !important;\n}\n\n.m-5 {\n margin: 3rem !important;\n}\n\n.mt-5 {\n margin-top: 3rem !important;\n}\n\n.mr-5 {\n margin-right: 3rem !important;\n}\n\n.mb-5 {\n margin-bottom: 3rem !important;\n}\n\n.ml-5 {\n margin-left: 3rem !important;\n}\n\n.mx-5 {\n margin-right: 3rem !important;\n margin-left: 3rem !important;\n}\n\n.my-5 {\n margin-top: 3rem !important;\n margin-bottom: 3rem !important;\n}\n\n.p-0 {\n padding: 0 !important;\n}\n\n.pt-0 {\n padding-top: 0 !important;\n}\n\n.pr-0 {\n padding-right: 0 !important;\n}\n\n.pb-0 {\n padding-bottom: 0 !important;\n}\n\n.pl-0 {\n padding-left: 0 !important;\n}\n\n.px-0 {\n padding-right: 0 !important;\n padding-left: 0 !important;\n}\n\n.py-0 {\n padding-top: 0 !important;\n padding-bottom: 0 !important;\n}\n\n.p-1 {\n padding: 0.25rem !important;\n}\n\n.pt-1 {\n padding-top: 0.25rem !important;\n}\n\n.pr-1 {\n padding-right: 0.25rem !important;\n}\n\n.pb-1 {\n padding-bottom: 0.25rem !important;\n}\n\n.pl-1 {\n padding-left: 0.25rem !important;\n}\n\n.px-1 {\n padding-right: 0.25rem !important;\n padding-left: 0.25rem !important;\n}\n\n.py-1 {\n padding-top: 0.25rem !important;\n padding-bottom: 0.25rem !important;\n}\n\n.p-2 {\n padding: 0.5rem !important;\n}\n\n.pt-2 {\n padding-top: 0.5rem !important;\n}\n\n.pr-2 {\n padding-right: 0.5rem !important;\n}\n\n.pb-2 {\n padding-bottom: 0.5rem !important;\n}\n\n.pl-2 {\n padding-left: 0.5rem !important;\n}\n\n.px-2 {\n padding-right: 0.5rem !important;\n padding-left: 0.5rem !important;\n}\n\n.py-2 {\n padding-top: 0.5rem !important;\n padding-bottom: 0.5rem !important;\n}\n\n.p-3 {\n padding: 1rem !important;\n}\n\n.pt-3 {\n padding-top: 1rem !important;\n}\n\n.pr-3 {\n padding-right: 1rem !important;\n}\n\n.pb-3 {\n padding-bottom: 1rem !important;\n}\n\n.pl-3 {\n padding-left: 1rem !important;\n}\n\n.px-3 {\n padding-right: 1rem !important;\n padding-left: 1rem !important;\n}\n\n.py-3 {\n padding-top: 1rem !important;\n padding-bottom: 1rem !important;\n}\n\n.p-4 {\n padding: 1.5rem !important;\n}\n\n.pt-4 {\n padding-top: 1.5rem !important;\n}\n\n.pr-4 {\n padding-right: 1.5rem !important;\n}\n\n.pb-4 {\n padding-bottom: 1.5rem !important;\n}\n\n.pl-4 {\n padding-left: 1.5rem !important;\n}\n\n.px-4 {\n padding-right: 1.5rem !important;\n padding-left: 1.5rem !important;\n}\n\n.py-4 {\n padding-top: 1.5rem !important;\n padding-bottom: 1.5rem !important;\n}\n\n.p-5 {\n padding: 3rem !important;\n}\n\n.pt-5 {\n padding-top: 3rem !important;\n}\n\n.pr-5 {\n padding-right: 3rem !important;\n}\n\n.pb-5 {\n padding-bottom: 3rem !important;\n}\n\n.pl-5 {\n padding-left: 3rem !important;\n}\n\n.px-5 {\n padding-right: 3rem !important;\n padding-left: 3rem !important;\n}\n\n.py-5 {\n padding-top: 3rem !important;\n padding-bottom: 3rem !important;\n}\n\n.m-auto {\n margin: auto !important;\n}\n\n.mt-auto {\n margin-top: auto !important;\n}\n\n.mr-auto {\n margin-right: auto !important;\n}\n\n.mb-auto {\n margin-bottom: auto !important;\n}\n\n.ml-auto {\n margin-left: auto !important;\n}\n\n.mx-auto {\n margin-right: auto !important;\n margin-left: auto !important;\n}\n\n.my-auto {\n margin-top: auto !important;\n margin-bottom: auto !important;\n}\n\n@media (min-width: 576px) {\n .m-sm-0 {\n margin: 0 !important;\n }\n .mt-sm-0 {\n margin-top: 0 !important;\n }\n .mr-sm-0 {\n margin-right: 0 !important;\n }\n .mb-sm-0 {\n margin-bottom: 0 !important;\n }\n .ml-sm-0 {\n margin-left: 0 !important;\n }\n .mx-sm-0 {\n margin-right: 0 !important;\n margin-left: 0 !important;\n }\n .my-sm-0 {\n margin-top: 0 !important;\n margin-bottom: 0 !important;\n }\n .m-sm-1 {\n margin: 0.25rem !important;\n }\n .mt-sm-1 {\n margin-top: 0.25rem !important;\n }\n .mr-sm-1 {\n margin-right: 0.25rem !important;\n }\n .mb-sm-1 {\n margin-bottom: 0.25rem !important;\n }\n .ml-sm-1 {\n margin-left: 0.25rem !important;\n }\n .mx-sm-1 {\n margin-right: 0.25rem !important;\n margin-left: 0.25rem !important;\n }\n .my-sm-1 {\n margin-top: 0.25rem !important;\n margin-bottom: 0.25rem !important;\n }\n .m-sm-2 {\n margin: 0.5rem !important;\n }\n .mt-sm-2 {\n margin-top: 0.5rem !important;\n }\n .mr-sm-2 {\n margin-right: 0.5rem !important;\n }\n .mb-sm-2 {\n margin-bottom: 0.5rem !important;\n }\n .ml-sm-2 {\n margin-left: 0.5rem !important;\n }\n .mx-sm-2 {\n margin-right: 0.5rem !important;\n margin-left: 0.5rem !important;\n }\n .my-sm-2 {\n margin-top: 0.5rem !important;\n margin-bottom: 0.5rem !important;\n }\n .m-sm-3 {\n margin: 1rem !important;\n }\n .mt-sm-3 {\n margin-top: 1rem !important;\n }\n .mr-sm-3 {\n margin-right: 1rem !important;\n }\n .mb-sm-3 {\n margin-bottom: 1rem !important;\n }\n .ml-sm-3 {\n margin-left: 1rem !important;\n }\n .mx-sm-3 {\n margin-right: 1rem !important;\n margin-left: 1rem !important;\n }\n .my-sm-3 {\n margin-top: 1rem !important;\n margin-bottom: 1rem !important;\n }\n .m-sm-4 {\n margin: 1.5rem !important;\n }\n .mt-sm-4 {\n margin-top: 1.5rem !important;\n }\n .mr-sm-4 {\n margin-right: 1.5rem !important;\n }\n .mb-sm-4 {\n margin-bottom: 1.5rem !important;\n }\n .ml-sm-4 {\n margin-left: 1.5rem !important;\n }\n .mx-sm-4 {\n margin-right: 1.5rem !important;\n margin-left: 1.5rem !important;\n }\n .my-sm-4 {\n margin-top: 1.5rem !important;\n margin-bottom: 1.5rem !important;\n }\n .m-sm-5 {\n margin: 3rem !important;\n }\n .mt-sm-5 {\n margin-top: 3rem !important;\n }\n .mr-sm-5 {\n margin-right: 3rem !important;\n }\n .mb-sm-5 {\n margin-bottom: 3rem !important;\n }\n .ml-sm-5 {\n margin-left: 3rem !important;\n }\n .mx-sm-5 {\n margin-right: 3rem !important;\n margin-left: 3rem !important;\n }\n .my-sm-5 {\n margin-top: 3rem !important;\n margin-bottom: 3rem !important;\n }\n .p-sm-0 {\n padding: 0 !important;\n }\n .pt-sm-0 {\n padding-top: 0 !important;\n }\n .pr-sm-0 {\n padding-right: 0 !important;\n }\n .pb-sm-0 {\n padding-bottom: 0 !important;\n }\n .pl-sm-0 {\n padding-left: 0 !important;\n }\n .px-sm-0 {\n padding-right: 0 !important;\n padding-left: 0 !important;\n }\n .py-sm-0 {\n padding-top: 0 !important;\n padding-bottom: 0 !important;\n }\n .p-sm-1 {\n padding: 0.25rem !important;\n }\n .pt-sm-1 {\n padding-top: 0.25rem !important;\n }\n .pr-sm-1 {\n padding-right: 0.25rem !important;\n }\n .pb-sm-1 {\n padding-bottom: 0.25rem !important;\n }\n .pl-sm-1 {\n padding-left: 0.25rem !important;\n }\n .px-sm-1 {\n padding-right: 0.25rem !important;\n padding-left: 0.25rem !important;\n }\n .py-sm-1 {\n padding-top: 0.25rem !important;\n padding-bottom: 0.25rem !important;\n }\n .p-sm-2 {\n padding: 0.5rem !important;\n }\n .pt-sm-2 {\n padding-top: 0.5rem !important;\n }\n .pr-sm-2 {\n padding-right: 0.5rem !important;\n }\n .pb-sm-2 {\n padding-bottom: 0.5rem !important;\n }\n .pl-sm-2 {\n padding-left: 0.5rem !important;\n }\n .px-sm-2 {\n padding-right: 0.5rem !important;\n padding-left: 0.5rem !important;\n }\n .py-sm-2 {\n padding-top: 0.5rem !important;\n padding-bottom: 0.5rem !important;\n }\n .p-sm-3 {\n padding: 1rem !important;\n }\n .pt-sm-3 {\n padding-top: 1rem !important;\n }\n .pr-sm-3 {\n padding-right: 1rem !important;\n }\n .pb-sm-3 {\n padding-bottom: 1rem !important;\n }\n .pl-sm-3 {\n padding-left: 1rem !important;\n }\n .px-sm-3 {\n padding-right: 1rem !important;\n padding-left: 1rem !important;\n }\n .py-sm-3 {\n padding-top: 1rem !important;\n padding-bottom: 1rem !important;\n }\n .p-sm-4 {\n padding: 1.5rem !important;\n }\n .pt-sm-4 {\n padding-top: 1.5rem !important;\n }\n .pr-sm-4 {\n padding-right: 1.5rem !important;\n }\n .pb-sm-4 {\n padding-bottom: 1.5rem !important;\n }\n .pl-sm-4 {\n padding-left: 1.5rem !important;\n }\n .px-sm-4 {\n padding-right: 1.5rem !important;\n padding-left: 1.5rem !important;\n }\n .py-sm-4 {\n padding-top: 1.5rem !important;\n padding-bottom: 1.5rem !important;\n }\n .p-sm-5 {\n padding: 3rem !important;\n }\n .pt-sm-5 {\n padding-top: 3rem !important;\n }\n .pr-sm-5 {\n padding-right: 3rem !important;\n }\n .pb-sm-5 {\n padding-bottom: 3rem !important;\n }\n .pl-sm-5 {\n padding-left: 3rem !important;\n }\n .px-sm-5 {\n padding-right: 3rem !important;\n padding-left: 3rem !important;\n }\n .py-sm-5 {\n padding-top: 3rem !important;\n padding-bottom: 3rem !important;\n }\n .m-sm-auto {\n margin: auto !important;\n }\n .mt-sm-auto {\n margin-top: auto !important;\n }\n .mr-sm-auto {\n margin-right: auto !important;\n }\n .mb-sm-auto {\n margin-bottom: auto !important;\n }\n .ml-sm-auto {\n margin-left: auto !important;\n }\n .mx-sm-auto {\n margin-right: auto !important;\n margin-left: auto !important;\n }\n .my-sm-auto {\n margin-top: auto !important;\n margin-bottom: auto !important;\n }\n}\n\n@media (min-width: 768px) {\n .m-md-0 {\n margin: 0 !important;\n }\n .mt-md-0 {\n margin-top: 0 !important;\n }\n .mr-md-0 {\n margin-right: 0 !important;\n }\n .mb-md-0 {\n margin-bottom: 0 !important;\n }\n .ml-md-0 {\n margin-left: 0 !important;\n }\n .mx-md-0 {\n margin-right: 0 !important;\n margin-left: 0 !important;\n }\n .my-md-0 {\n margin-top: 0 !important;\n margin-bottom: 0 !important;\n }\n .m-md-1 {\n margin: 0.25rem !important;\n }\n .mt-md-1 {\n margin-top: 0.25rem !important;\n }\n .mr-md-1 {\n margin-right: 0.25rem !important;\n }\n .mb-md-1 {\n margin-bottom: 0.25rem !important;\n }\n .ml-md-1 {\n margin-left: 0.25rem !important;\n }\n .mx-md-1 {\n margin-right: 0.25rem !important;\n margin-left: 0.25rem !important;\n }\n .my-md-1 {\n margin-top: 0.25rem !important;\n margin-bottom: 0.25rem !important;\n }\n .m-md-2 {\n margin: 0.5rem !important;\n }\n .mt-md-2 {\n margin-top: 0.5rem !important;\n }\n .mr-md-2 {\n margin-right: 0.5rem !important;\n }\n .mb-md-2 {\n margin-bottom: 0.5rem !important;\n }\n .ml-md-2 {\n margin-left: 0.5rem !important;\n }\n .mx-md-2 {\n margin-right: 0.5rem !important;\n margin-left: 0.5rem !important;\n }\n .my-md-2 {\n margin-top: 0.5rem !important;\n margin-bottom: 0.5rem !important;\n }\n .m-md-3 {\n margin: 1rem !important;\n }\n .mt-md-3 {\n margin-top: 1rem !important;\n }\n .mr-md-3 {\n margin-right: 1rem !important;\n }\n .mb-md-3 {\n margin-bottom: 1rem !important;\n }\n .ml-md-3 {\n margin-left: 1rem !important;\n }\n .mx-md-3 {\n margin-right: 1rem !important;\n margin-left: 1rem !important;\n }\n .my-md-3 {\n margin-top: 1rem !important;\n margin-bottom: 1rem !important;\n }\n .m-md-4 {\n margin: 1.5rem !important;\n }\n .mt-md-4 {\n margin-top: 1.5rem !important;\n }\n .mr-md-4 {\n margin-right: 1.5rem !important;\n }\n .mb-md-4 {\n margin-bottom: 1.5rem !important;\n }\n .ml-md-4 {\n margin-left: 1.5rem !important;\n }\n .mx-md-4 {\n margin-right: 1.5rem !important;\n margin-left: 1.5rem !important;\n }\n .my-md-4 {\n margin-top: 1.5rem !important;\n margin-bottom: 1.5rem !important;\n }\n .m-md-5 {\n margin: 3rem !important;\n }\n .mt-md-5 {\n margin-top: 3rem !important;\n }\n .mr-md-5 {\n margin-right: 3rem !important;\n }\n .mb-md-5 {\n margin-bottom: 3rem !important;\n }\n .ml-md-5 {\n margin-left: 3rem !important;\n }\n .mx-md-5 {\n margin-right: 3rem !important;\n margin-left: 3rem !important;\n }\n .my-md-5 {\n margin-top: 3rem !important;\n margin-bottom: 3rem !important;\n }\n .p-md-0 {\n padding: 0 !important;\n }\n .pt-md-0 {\n padding-top: 0 !important;\n }\n .pr-md-0 {\n padding-right: 0 !important;\n }\n .pb-md-0 {\n padding-bottom: 0 !important;\n }\n .pl-md-0 {\n padding-left: 0 !important;\n }\n .px-md-0 {\n padding-right: 0 !important;\n padding-left: 0 !important;\n }\n .py-md-0 {\n padding-top: 0 !important;\n padding-bottom: 0 !important;\n }\n .p-md-1 {\n padding: 0.25rem !important;\n }\n .pt-md-1 {\n padding-top: 0.25rem !important;\n }\n .pr-md-1 {\n padding-right: 0.25rem !important;\n }\n .pb-md-1 {\n padding-bottom: 0.25rem !important;\n }\n .pl-md-1 {\n padding-left: 0.25rem !important;\n }\n .px-md-1 {\n padding-right: 0.25rem !important;\n padding-left: 0.25rem !important;\n }\n .py-md-1 {\n padding-top: 0.25rem !important;\n padding-bottom: 0.25rem !important;\n }\n .p-md-2 {\n padding: 0.5rem !important;\n }\n .pt-md-2 {\n padding-top: 0.5rem !important;\n }\n .pr-md-2 {\n padding-right: 0.5rem !important;\n }\n .pb-md-2 {\n padding-bottom: 0.5rem !important;\n }\n .pl-md-2 {\n padding-left: 0.5rem !important;\n }\n .px-md-2 {\n padding-right: 0.5rem !important;\n padding-left: 0.5rem !important;\n }\n .py-md-2 {\n padding-top: 0.5rem !important;\n padding-bottom: 0.5rem !important;\n }\n .p-md-3 {\n padding: 1rem !important;\n }\n .pt-md-3 {\n padding-top: 1rem !important;\n }\n .pr-md-3 {\n padding-right: 1rem !important;\n }\n .pb-md-3 {\n padding-bottom: 1rem !important;\n }\n .pl-md-3 {\n padding-left: 1rem !important;\n }\n .px-md-3 {\n padding-right: 1rem !important;\n padding-left: 1rem !important;\n }\n .py-md-3 {\n padding-top: 1rem !important;\n padding-bottom: 1rem !important;\n }\n .p-md-4 {\n padding: 1.5rem !important;\n }\n .pt-md-4 {\n padding-top: 1.5rem !important;\n }\n .pr-md-4 {\n padding-right: 1.5rem !important;\n }\n .pb-md-4 {\n padding-bottom: 1.5rem !important;\n }\n .pl-md-4 {\n padding-left: 1.5rem !important;\n }\n .px-md-4 {\n padding-right: 1.5rem !important;\n padding-left: 1.5rem !important;\n }\n .py-md-4 {\n padding-top: 1.5rem !important;\n padding-bottom: 1.5rem !important;\n }\n .p-md-5 {\n padding: 3rem !important;\n }\n .pt-md-5 {\n padding-top: 3rem !important;\n }\n .pr-md-5 {\n padding-right: 3rem !important;\n }\n .pb-md-5 {\n padding-bottom: 3rem !important;\n }\n .pl-md-5 {\n padding-left: 3rem !important;\n }\n .px-md-5 {\n padding-right: 3rem !important;\n padding-left: 3rem !important;\n }\n .py-md-5 {\n padding-top: 3rem !important;\n padding-bottom: 3rem !important;\n }\n .m-md-auto {\n margin: auto !important;\n }\n .mt-md-auto {\n margin-top: auto !important;\n }\n .mr-md-auto {\n margin-right: auto !important;\n }\n .mb-md-auto {\n margin-bottom: auto !important;\n }\n .ml-md-auto {\n margin-left: auto !important;\n }\n .mx-md-auto {\n margin-right: auto !important;\n margin-left: auto !important;\n }\n .my-md-auto {\n margin-top: auto !important;\n margin-bottom: auto !important;\n }\n}\n\n@media (min-width: 992px) {\n .m-lg-0 {\n margin: 0 !important;\n }\n .mt-lg-0 {\n margin-top: 0 !important;\n }\n .mr-lg-0 {\n margin-right: 0 !important;\n }\n .mb-lg-0 {\n margin-bottom: 0 !important;\n }\n .ml-lg-0 {\n margin-left: 0 !important;\n }\n .mx-lg-0 {\n margin-right: 0 !important;\n margin-left: 0 !important;\n }\n .my-lg-0 {\n margin-top: 0 !important;\n margin-bottom: 0 !important;\n }\n .m-lg-1 {\n margin: 0.25rem !important;\n }\n .mt-lg-1 {\n margin-top: 0.25rem !important;\n }\n .mr-lg-1 {\n margin-right: 0.25rem !important;\n }\n .mb-lg-1 {\n margin-bottom: 0.25rem !important;\n }\n .ml-lg-1 {\n margin-left: 0.25rem !important;\n }\n .mx-lg-1 {\n margin-right: 0.25rem !important;\n margin-left: 0.25rem !important;\n }\n .my-lg-1 {\n margin-top: 0.25rem !important;\n margin-bottom: 0.25rem !important;\n }\n .m-lg-2 {\n margin: 0.5rem !important;\n }\n .mt-lg-2 {\n margin-top: 0.5rem !important;\n }\n .mr-lg-2 {\n margin-right: 0.5rem !important;\n }\n .mb-lg-2 {\n margin-bottom: 0.5rem !important;\n }\n .ml-lg-2 {\n margin-left: 0.5rem !important;\n }\n .mx-lg-2 {\n margin-right: 0.5rem !important;\n margin-left: 0.5rem !important;\n }\n .my-lg-2 {\n margin-top: 0.5rem !important;\n margin-bottom: 0.5rem !important;\n }\n .m-lg-3 {\n margin: 1rem !important;\n }\n .mt-lg-3 {\n margin-top: 1rem !important;\n }\n .mr-lg-3 {\n margin-right: 1rem !important;\n }\n .mb-lg-3 {\n margin-bottom: 1rem !important;\n }\n .ml-lg-3 {\n margin-left: 1rem !important;\n }\n .mx-lg-3 {\n margin-right: 1rem !important;\n margin-left: 1rem !important;\n }\n .my-lg-3 {\n margin-top: 1rem !important;\n margin-bottom: 1rem !important;\n }\n .m-lg-4 {\n margin: 1.5rem !important;\n }\n .mt-lg-4 {\n margin-top: 1.5rem !important;\n }\n .mr-lg-4 {\n margin-right: 1.5rem !important;\n }\n .mb-lg-4 {\n margin-bottom: 1.5rem !important;\n }\n .ml-lg-4 {\n margin-left: 1.5rem !important;\n }\n .mx-lg-4 {\n margin-right: 1.5rem !important;\n margin-left: 1.5rem !important;\n }\n .my-lg-4 {\n margin-top: 1.5rem !important;\n margin-bottom: 1.5rem !important;\n }\n .m-lg-5 {\n margin: 3rem !important;\n }\n .mt-lg-5 {\n margin-top: 3rem !important;\n }\n .mr-lg-5 {\n margin-right: 3rem !important;\n }\n .mb-lg-5 {\n margin-bottom: 3rem !important;\n }\n .ml-lg-5 {\n margin-left: 3rem !important;\n }\n .mx-lg-5 {\n margin-right: 3rem !important;\n margin-left: 3rem !important;\n }\n .my-lg-5 {\n margin-top: 3rem !important;\n margin-bottom: 3rem !important;\n }\n .p-lg-0 {\n padding: 0 !important;\n }\n .pt-lg-0 {\n padding-top: 0 !important;\n }\n .pr-lg-0 {\n padding-right: 0 !important;\n }\n .pb-lg-0 {\n padding-bottom: 0 !important;\n }\n .pl-lg-0 {\n padding-left: 0 !important;\n }\n .px-lg-0 {\n padding-right: 0 !important;\n padding-left: 0 !important;\n }\n .py-lg-0 {\n padding-top: 0 !important;\n padding-bottom: 0 !important;\n }\n .p-lg-1 {\n padding: 0.25rem !important;\n }\n .pt-lg-1 {\n padding-top: 0.25rem !important;\n }\n .pr-lg-1 {\n padding-right: 0.25rem !important;\n }\n .pb-lg-1 {\n padding-bottom: 0.25rem !important;\n }\n .pl-lg-1 {\n padding-left: 0.25rem !important;\n }\n .px-lg-1 {\n padding-right: 0.25rem !important;\n padding-left: 0.25rem !important;\n }\n .py-lg-1 {\n padding-top: 0.25rem !important;\n padding-bottom: 0.25rem !important;\n }\n .p-lg-2 {\n padding: 0.5rem !important;\n }\n .pt-lg-2 {\n padding-top: 0.5rem !important;\n }\n .pr-lg-2 {\n padding-right: 0.5rem !important;\n }\n .pb-lg-2 {\n padding-bottom: 0.5rem !important;\n }\n .pl-lg-2 {\n padding-left: 0.5rem !important;\n }\n .px-lg-2 {\n padding-right: 0.5rem !important;\n padding-left: 0.5rem !important;\n }\n .py-lg-2 {\n padding-top: 0.5rem !important;\n padding-bottom: 0.5rem !important;\n }\n .p-lg-3 {\n padding: 1rem !important;\n }\n .pt-lg-3 {\n padding-top: 1rem !important;\n }\n .pr-lg-3 {\n padding-right: 1rem !important;\n }\n .pb-lg-3 {\n padding-bottom: 1rem !important;\n }\n .pl-lg-3 {\n padding-left: 1rem !important;\n }\n .px-lg-3 {\n padding-right: 1rem !important;\n padding-left: 1rem !important;\n }\n .py-lg-3 {\n padding-top: 1rem !important;\n padding-bottom: 1rem !important;\n }\n .p-lg-4 {\n padding: 1.5rem !important;\n }\n .pt-lg-4 {\n padding-top: 1.5rem !important;\n }\n .pr-lg-4 {\n padding-right: 1.5rem !important;\n }\n .pb-lg-4 {\n padding-bottom: 1.5rem !important;\n }\n .pl-lg-4 {\n padding-left: 1.5rem !important;\n }\n .px-lg-4 {\n padding-right: 1.5rem !important;\n padding-left: 1.5rem !important;\n }\n .py-lg-4 {\n padding-top: 1.5rem !important;\n padding-bottom: 1.5rem !important;\n }\n .p-lg-5 {\n padding: 3rem !important;\n }\n .pt-lg-5 {\n padding-top: 3rem !important;\n }\n .pr-lg-5 {\n padding-right: 3rem !important;\n }\n .pb-lg-5 {\n padding-bottom: 3rem !important;\n }\n .pl-lg-5 {\n padding-left: 3rem !important;\n }\n .px-lg-5 {\n padding-right: 3rem !important;\n padding-left: 3rem !important;\n }\n .py-lg-5 {\n padding-top: 3rem !important;\n padding-bottom: 3rem !important;\n }\n .m-lg-auto {\n margin: auto !important;\n }\n .mt-lg-auto {\n margin-top: auto !important;\n }\n .mr-lg-auto {\n margin-right: auto !important;\n }\n .mb-lg-auto {\n margin-bottom: auto !important;\n }\n .ml-lg-auto {\n margin-left: auto !important;\n }\n .mx-lg-auto {\n margin-right: auto !important;\n margin-left: auto !important;\n }\n .my-lg-auto {\n margin-top: auto !important;\n margin-bottom: auto !important;\n }\n}\n\n@media (min-width: 1200px) {\n .m-xl-0 {\n margin: 0 !important;\n }\n .mt-xl-0 {\n margin-top: 0 !important;\n }\n .mr-xl-0 {\n margin-right: 0 !important;\n }\n .mb-xl-0 {\n margin-bottom: 0 !important;\n }\n .ml-xl-0 {\n margin-left: 0 !important;\n }\n .mx-xl-0 {\n margin-right: 0 !important;\n margin-left: 0 !important;\n }\n .my-xl-0 {\n margin-top: 0 !important;\n margin-bottom: 0 !important;\n }\n .m-xl-1 {\n margin: 0.25rem !important;\n }\n .mt-xl-1 {\n margin-top: 0.25rem !important;\n }\n .mr-xl-1 {\n margin-right: 0.25rem !important;\n }\n .mb-xl-1 {\n margin-bottom: 0.25rem !important;\n }\n .ml-xl-1 {\n margin-left: 0.25rem !important;\n }\n .mx-xl-1 {\n margin-right: 0.25rem !important;\n margin-left: 0.25rem !important;\n }\n .my-xl-1 {\n margin-top: 0.25rem !important;\n margin-bottom: 0.25rem !important;\n }\n .m-xl-2 {\n margin: 0.5rem !important;\n }\n .mt-xl-2 {\n margin-top: 0.5rem !important;\n }\n .mr-xl-2 {\n margin-right: 0.5rem !important;\n }\n .mb-xl-2 {\n margin-bottom: 0.5rem !important;\n }\n .ml-xl-2 {\n margin-left: 0.5rem !important;\n }\n .mx-xl-2 {\n margin-right: 0.5rem !important;\n margin-left: 0.5rem !important;\n }\n .my-xl-2 {\n margin-top: 0.5rem !important;\n margin-bottom: 0.5rem !important;\n }\n .m-xl-3 {\n margin: 1rem !important;\n }\n .mt-xl-3 {\n margin-top: 1rem !important;\n }\n .mr-xl-3 {\n margin-right: 1rem !important;\n }\n .mb-xl-3 {\n margin-bottom: 1rem !important;\n }\n .ml-xl-3 {\n margin-left: 1rem !important;\n }\n .mx-xl-3 {\n margin-right: 1rem !important;\n margin-left: 1rem !important;\n }\n .my-xl-3 {\n margin-top: 1rem !important;\n margin-bottom: 1rem !important;\n }\n .m-xl-4 {\n margin: 1.5rem !important;\n }\n .mt-xl-4 {\n margin-top: 1.5rem !important;\n }\n .mr-xl-4 {\n margin-right: 1.5rem !important;\n }\n .mb-xl-4 {\n margin-bottom: 1.5rem !important;\n }\n .ml-xl-4 {\n margin-left: 1.5rem !important;\n }\n .mx-xl-4 {\n margin-right: 1.5rem !important;\n margin-left: 1.5rem !important;\n }\n .my-xl-4 {\n margin-top: 1.5rem !important;\n margin-bottom: 1.5rem !important;\n }\n .m-xl-5 {\n margin: 3rem !important;\n }\n .mt-xl-5 {\n margin-top: 3rem !important;\n }\n .mr-xl-5 {\n margin-right: 3rem !important;\n }\n .mb-xl-5 {\n margin-bottom: 3rem !important;\n }\n .ml-xl-5 {\n margin-left: 3rem !important;\n }\n .mx-xl-5 {\n margin-right: 3rem !important;\n margin-left: 3rem !important;\n }\n .my-xl-5 {\n margin-top: 3rem !important;\n margin-bottom: 3rem !important;\n }\n .p-xl-0 {\n padding: 0 !important;\n }\n .pt-xl-0 {\n padding-top: 0 !important;\n }\n .pr-xl-0 {\n padding-right: 0 !important;\n }\n .pb-xl-0 {\n padding-bottom: 0 !important;\n }\n .pl-xl-0 {\n padding-left: 0 !important;\n }\n .px-xl-0 {\n padding-right: 0 !important;\n padding-left: 0 !important;\n }\n .py-xl-0 {\n padding-top: 0 !important;\n padding-bottom: 0 !important;\n }\n .p-xl-1 {\n padding: 0.25rem !important;\n }\n .pt-xl-1 {\n padding-top: 0.25rem !important;\n }\n .pr-xl-1 {\n padding-right: 0.25rem !important;\n }\n .pb-xl-1 {\n padding-bottom: 0.25rem !important;\n }\n .pl-xl-1 {\n padding-left: 0.25rem !important;\n }\n .px-xl-1 {\n padding-right: 0.25rem !important;\n padding-left: 0.25rem !important;\n }\n .py-xl-1 {\n padding-top: 0.25rem !important;\n padding-bottom: 0.25rem !important;\n }\n .p-xl-2 {\n padding: 0.5rem !important;\n }\n .pt-xl-2 {\n padding-top: 0.5rem !important;\n }\n .pr-xl-2 {\n padding-right: 0.5rem !important;\n }\n .pb-xl-2 {\n padding-bottom: 0.5rem !important;\n }\n .pl-xl-2 {\n padding-left: 0.5rem !important;\n }\n .px-xl-2 {\n padding-right: 0.5rem !important;\n padding-left: 0.5rem !important;\n }\n .py-xl-2 {\n padding-top: 0.5rem !important;\n padding-bottom: 0.5rem !important;\n }\n .p-xl-3 {\n padding: 1rem !important;\n }\n .pt-xl-3 {\n padding-top: 1rem !important;\n }\n .pr-xl-3 {\n padding-right: 1rem !important;\n }\n .pb-xl-3 {\n padding-bottom: 1rem !important;\n }\n .pl-xl-3 {\n padding-left: 1rem !important;\n }\n .px-xl-3 {\n padding-right: 1rem !important;\n padding-left: 1rem !important;\n }\n .py-xl-3 {\n padding-top: 1rem !important;\n padding-bottom: 1rem !important;\n }\n .p-xl-4 {\n padding: 1.5rem !important;\n }\n .pt-xl-4 {\n padding-top: 1.5rem !important;\n }\n .pr-xl-4 {\n padding-right: 1.5rem !important;\n }\n .pb-xl-4 {\n padding-bottom: 1.5rem !important;\n }\n .pl-xl-4 {\n padding-left: 1.5rem !important;\n }\n .px-xl-4 {\n padding-right: 1.5rem !important;\n padding-left: 1.5rem !important;\n }\n .py-xl-4 {\n padding-top: 1.5rem !important;\n padding-bottom: 1.5rem !important;\n }\n .p-xl-5 {\n padding: 3rem !important;\n }\n .pt-xl-5 {\n padding-top: 3rem !important;\n }\n .pr-xl-5 {\n padding-right: 3rem !important;\n }\n .pb-xl-5 {\n padding-bottom: 3rem !important;\n }\n .pl-xl-5 {\n padding-left: 3rem !important;\n }\n .px-xl-5 {\n padding-right: 3rem !important;\n padding-left: 3rem !important;\n }\n .py-xl-5 {\n padding-top: 3rem !important;\n padding-bottom: 3rem !important;\n }\n .m-xl-auto {\n margin: auto !important;\n }\n .mt-xl-auto {\n margin-top: auto !important;\n }\n .mr-xl-auto {\n margin-right: auto !important;\n }\n .mb-xl-auto {\n margin-bottom: auto !important;\n }\n .ml-xl-auto {\n margin-left: auto !important;\n }\n .mx-xl-auto {\n margin-right: auto !important;\n margin-left: auto !important;\n }\n .my-xl-auto {\n margin-top: auto !important;\n margin-bottom: auto !important;\n }\n}\n\n.text-justify {\n text-align: justify !important;\n}\n\n.text-nowrap {\n white-space: nowrap !important;\n}\n\n.text-truncate {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.text-left {\n text-align: left !important;\n}\n\n.text-right {\n text-align: right !important;\n}\n\n.text-center {\n text-align: center !important;\n}\n\n@media (min-width: 576px) {\n .text-sm-left {\n text-align: left !important;\n }\n .text-sm-right {\n text-align: right !important;\n }\n .text-sm-center {\n text-align: center !important;\n }\n}\n\n@media (min-width: 768px) {\n .text-md-left {\n text-align: left !important;\n }\n .text-md-right {\n text-align: right !important;\n }\n .text-md-center {\n text-align: center !important;\n }\n}\n\n@media (min-width: 992px) {\n .text-lg-left {\n text-align: left !important;\n }\n .text-lg-right {\n text-align: right !important;\n }\n .text-lg-center {\n text-align: center !important;\n }\n}\n\n@media (min-width: 1200px) {\n .text-xl-left {\n text-align: left !important;\n }\n .text-xl-right {\n text-align: right !important;\n }\n .text-xl-center {\n text-align: center !important;\n }\n}\n\n.text-lowercase {\n text-transform: lowercase !important;\n}\n\n.text-uppercase {\n text-transform: uppercase !important;\n}\n\n.text-capitalize {\n text-transform: capitalize !important;\n}\n\n.font-weight-normal {\n font-weight: normal;\n}\n\n.font-weight-bold {\n font-weight: bold;\n}\n\n.font-italic {\n font-style: italic;\n}\n\n.text-white {\n color: #fff !important;\n}\n\n.text-primary {\n color: #007bff !important;\n}\n\na.text-primary:focus, a.text-primary:hover {\n color: #0062cc !important;\n}\n\n.text-secondary {\n color: #868e96 !important;\n}\n\na.text-secondary:focus, a.text-secondary:hover {\n color: #6c757d !important;\n}\n\n.text-success {\n color: #28a745 !important;\n}\n\na.text-success:focus, a.text-success:hover {\n color: #1e7e34 !important;\n}\n\n.text-info {\n color: #17a2b8 !important;\n}\n\na.text-info:focus, a.text-info:hover {\n color: #117a8b !important;\n}\n\n.text-warning {\n color: #ffc107 !important;\n}\n\na.text-warning:focus, a.text-warning:hover {\n color: #d39e00 !important;\n}\n\n.text-danger {\n color: #dc3545 !important;\n}\n\na.text-danger:focus, a.text-danger:hover {\n color: #bd2130 !important;\n}\n\n.text-light {\n color: #f8f9fa !important;\n}\n\na.text-light:focus, a.text-light:hover {\n color: #dae0e5 !important;\n}\n\n.text-dark {\n color: #343a40 !important;\n}\n\na.text-dark:focus, a.text-dark:hover {\n color: #1d2124 !important;\n}\n\n.text-muted {\n color: #868e96 !important;\n}\n\n.text-hide {\n font: 0/0 a;\n color: transparent;\n text-shadow: none;\n background-color: transparent;\n border: 0;\n}\n\n.visible {\n visibility: visible !important;\n}\n\n.invisible {\n visibility: hidden !important;\n}\n\n/*# sourceMappingURL=bootstrap.css.map */","// scss-lint:disable QualifyingElement, DuplicateProperty, VendorPrefix\n\n// Reboot\n//\n// Normalization of HTML elements, manually forked from Normalize.css to remove\n// styles targeting irrelevant browsers while applying new styles.\n//\n// Normalize is licensed MIT. https://github.com/necolas/normalize.css\n\n\n// Document\n//\n// 1. Change from `box-sizing: content-box` so that `width` is not affected by `padding` or `border`.\n// 2. Change the default font family in all browsers.\n// 3. Correct the line height in all browsers.\n// 4. Prevent adjustments of font size after orientation changes in IE on Windows Phone and in iOS.\n// 5. Setting @viewport causes scrollbars to overlap content in IE11 and Edge, so\n// we force a non-overlapping, non-auto-hiding scrollbar to counteract.\n// 6. Change the default tap highlight to be completely transparent in iOS.\n\nhtml {\n box-sizing: border-box; // 1\n font-family: sans-serif; // 2\n line-height: 1.15; // 3\n -webkit-text-size-adjust: 100%; // 4\n -ms-text-size-adjust: 100%; // 4\n -ms-overflow-style: scrollbar; // 5\n -webkit-tap-highlight-color: rgba(0,0,0,0); // 6\n}\n\n*,\n*::before,\n*::after {\n box-sizing: inherit; // 1\n}\n\n// IE10+ doesn't honor `` in some cases.\n@at-root {\n @-ms-viewport { width: device-width; }\n}\n\n// Shim for \"new\" HTML5 structural elements to display correctly (IE10, older browsers)\narticle, aside, dialog, figcaption, figure, footer, header, hgroup, main, nav, section {\n display: block;\n}\n\n// Body\n//\n// 1. Remove the margin in all browsers.\n// 2. As a best practice, apply a default `background-color`.\n\nbody {\n margin: 0; // 1\n font-family: $font-family-base;\n font-size: $font-size-base;\n font-weight: $font-weight-base;\n line-height: $line-height-base;\n color: $body-color;\n background-color: $body-bg; // 2\n}\n\n// Suppress the focus outline on elements that cannot be accessed via keyboard.\n// This prevents an unwanted focus outline from appearing around elements that\n// might still respond to pointer events.\n//\n// Credit: https://github.com/suitcss/base\n[tabindex=\"-1\"]:focus {\n outline: none !important;\n}\n\n\n// Content grouping\n//\n// 1. Add the correct box sizing in Firefox.\n// 2. Show the overflow in Edge and IE.\n\nhr {\n box-sizing: content-box; // 1\n height: 0; // 1\n overflow: visible; // 2\n}\n\n\n//\n// Typography\n//\n\n// Remove top margins from headings\n//\n// By default, `

    `-`

    ` all receive top and bottom margins. We nuke the top\n// margin for easier control within type scales as it avoids margin collapsing.\nh1, h2, h3, h4, h5, h6 {\n margin-top: 0;\n margin-bottom: .5rem;\n}\n\n// Reset margins on paragraphs\n//\n// Similarly, the top margin on `

    `s get reset. However, we also reset the\n// bottom margin to use `rem` units instead of `em`.\np {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\n// Abbreviations\n//\n// 1. Remove the bottom border in Firefox 39-.\n// 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.\n// 3. Add explicit cursor to indicate changed behavior.\n// 4. Duplicate behavior to the data-* attribute for our tooltip plugin\n\nabbr[title],\nabbr[data-original-title] { // 4\n text-decoration: underline; // 2\n text-decoration: underline dotted; // 2\n cursor: help; // 3\n border-bottom: 0; // 1\n}\n\naddress {\n margin-bottom: 1rem;\n font-style: normal;\n line-height: inherit;\n}\n\nol,\nul,\ndl {\n margin-top: 0;\n margin-bottom: 1rem;\n}\n\nol ol,\nul ul,\nol ul,\nul ol {\n margin-bottom: 0;\n}\n\ndt {\n font-weight: $dt-font-weight;\n}\n\ndd {\n margin-bottom: .5rem;\n margin-left: 0; // Undo browser default\n}\n\nblockquote {\n margin: 0 0 1rem;\n}\n\ndfn {\n font-style: italic; // Add the correct font style in Android 4.3-\n}\n\nb,\nstrong {\n font-weight: bolder; // Add the correct font weight in Chrome, Edge, and Safari\n}\n\nsmall {\n font-size: 80%; // Add the correct font size in all browsers\n}\n\n//\n// Prevent `sub` and `sup` elements from affecting the line height in\n// all browsers.\n//\n\nsub,\nsup {\n position: relative;\n font-size: 75%;\n line-height: 0;\n vertical-align: baseline;\n}\n\nsub { bottom: -.25em; }\nsup { top: -.5em; }\n\n\n//\n// Links\n//\n\na {\n color: $link-color;\n text-decoration: $link-decoration;\n background-color: transparent; // Remove the gray background on active links in IE 10.\n -webkit-text-decoration-skip: objects; // Remove gaps in links underline in iOS 8+ and Safari 8+.\n\n @include hover {\n color: $link-hover-color;\n text-decoration: $link-hover-decoration;\n }\n}\n\n// And undo these styles for placeholder links/named anchors (without href)\n// which have not been made explicitly keyboard-focusable (without tabindex).\n// It would be more straightforward to just use a[href] in previous block, but that\n// causes specificity issues in many other styles that are too complex to fix.\n// See https://github.com/twbs/bootstrap/issues/19402\n\na:not([href]):not([tabindex]) {\n color: inherit;\n text-decoration: none;\n\n @include hover-focus {\n color: inherit;\n text-decoration: none;\n }\n\n &:focus {\n outline: 0;\n }\n}\n\n\n//\n// Code\n//\n\npre,\ncode,\nkbd,\nsamp {\n font-family: monospace, monospace; // Correct the inheritance and scaling of font size in all browsers.\n font-size: 1em; // Correct the odd `em` font sizing in all browsers.\n}\n\npre {\n // Remove browser default top margin\n margin-top: 0;\n // Reset browser default of `1em` to use `rem`s\n margin-bottom: 1rem;\n // Don't allow content to break outside\n overflow: auto;\n}\n\n\n//\n// Figures\n//\n\nfigure {\n // Apply a consistent margin strategy (matches our type styles).\n margin: 0 0 1rem;\n}\n\n\n//\n// Images and content\n//\n\nimg {\n vertical-align: middle;\n border-style: none; // Remove the border on images inside links in IE 10-.\n}\n\nsvg:not(:root) {\n overflow: hidden; // Hide the overflow in IE\n}\n\n\n// Avoid 300ms click delay on touch devices that support the `touch-action` CSS property.\n//\n// In particular, unlike most other browsers, IE11+Edge on Windows 10 on touch devices and IE Mobile 10-11\n// DON'T remove the click delay when `` is present.\n// However, they DO support removing the click delay via `touch-action: manipulation`.\n// See:\n// * https://v4-alpha.getbootstrap.com/content/reboot/#click-delay-optimization-for-touch\n// * http://caniuse.com/#feat=css-touch-action\n// * https://patrickhlauke.github.io/touch/tests/results/#suppressing-300ms-delay\n\na,\narea,\nbutton,\n[role=\"button\"],\ninput,\nlabel,\nselect,\nsummary,\ntextarea {\n touch-action: manipulation;\n}\n\n\n//\n// Tables\n//\n\ntable {\n border-collapse: collapse; // Prevent double borders\n}\n\ncaption {\n padding-top: $table-cell-padding;\n padding-bottom: $table-cell-padding;\n color: $text-muted;\n text-align: left;\n caption-side: bottom;\n}\n\nth {\n // Matches default `` alignment\n text-align: left;\n}\n\n\n//\n// Forms\n//\n\nlabel {\n // Allow labels to use `margin` for spacing.\n display: inline-block;\n margin-bottom: .5rem;\n}\n\n// Work around a Firefox/IE bug where the transparent `button` background\n// results in a loss of the default `button` focus styles.\n//\n// Credit: https://github.com/suitcss/base/\nbutton:focus {\n outline: 1px dotted;\n outline: 5px auto -webkit-focus-ring-color;\n}\n\ninput,\nbutton,\nselect,\noptgroup,\ntextarea {\n margin: 0; // Remove the margin in Firefox and Safari\n font-family: inherit;\n font-size: inherit;\n line-height: inherit;\n}\n\nbutton,\ninput {\n overflow: visible; // Show the overflow in Edge\n}\n\nbutton,\nselect {\n text-transform: none; // Remove the inheritance of text transform in Firefox\n}\n\n// 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`\n// controls in Android 4.\n// 2. Correct the inability to style clickable types in iOS and Safari.\nbutton,\nhtml [type=\"button\"], // 1\n[type=\"reset\"],\n[type=\"submit\"] {\n -webkit-appearance: button; // 2\n}\n\n// Remove inner border and padding from Firefox, but don't restore the outline like Normalize.\nbutton::-moz-focus-inner,\n[type=\"button\"]::-moz-focus-inner,\n[type=\"reset\"]::-moz-focus-inner,\n[type=\"submit\"]::-moz-focus-inner {\n padding: 0;\n border-style: none;\n}\n\ninput[type=\"radio\"],\ninput[type=\"checkbox\"] {\n box-sizing: border-box; // 1. Add the correct box sizing in IE 10-\n padding: 0; // 2. Remove the padding in IE 10-\n}\n\n\ninput[type=\"date\"],\ninput[type=\"time\"],\ninput[type=\"datetime-local\"],\ninput[type=\"month\"] {\n // Remove the default appearance of temporal inputs to avoid a Mobile Safari\n // bug where setting a custom line-height prevents text from being vertically\n // centered within the input.\n // See https://bugs.webkit.org/show_bug.cgi?id=139848\n // and https://github.com/twbs/bootstrap/issues/11266\n -webkit-appearance: listbox;\n}\n\ntextarea {\n overflow: auto; // Remove the default vertical scrollbar in IE.\n // Textareas should really only resize vertically so they don't break their (horizontal) containers.\n resize: vertical;\n}\n\nfieldset {\n // Browsers set a default `min-width: min-content;` on fieldsets,\n // unlike e.g. `

    `s, which have `min-width: 0;` by default.\n // So we reset that to ensure fieldsets behave more like a standard block element.\n // See https://github.com/twbs/bootstrap/issues/12359\n // and https://html.spec.whatwg.org/multipage/#the-fieldset-and-legend-elements\n min-width: 0;\n // Reset the default outline behavior of fieldsets so they don't affect page layout.\n padding: 0;\n margin: 0;\n border: 0;\n}\n\n// 1. Correct the text wrapping in Edge and IE.\n// 2. Correct the color inheritance from `fieldset` elements in IE.\nlegend {\n display: block;\n width: 100%;\n max-width: 100%; // 1\n padding: 0;\n margin-bottom: .5rem;\n font-size: 1.5rem;\n line-height: inherit;\n color: inherit; // 2\n white-space: normal; // 1\n}\n\nprogress {\n vertical-align: baseline; // Add the correct vertical alignment in Chrome, Firefox, and Opera.\n}\n\n// Correct the cursor style of increment and decrement buttons in Chrome.\n[type=\"number\"]::-webkit-inner-spin-button,\n[type=\"number\"]::-webkit-outer-spin-button {\n height: auto;\n}\n\n[type=\"search\"] {\n // This overrides the extra rounded corners on search inputs in iOS so that our\n // `.form-control` class can properly style them. Note that this cannot simply\n // be added to `.form-control` as it's not specific enough. For details, see\n // https://github.com/twbs/bootstrap/issues/11586.\n outline-offset: -2px; // 2. Correct the outline style in Safari.\n -webkit-appearance: none;\n}\n\n//\n// Remove the inner padding and cancel buttons in Chrome and Safari on macOS.\n//\n\n[type=\"search\"]::-webkit-search-cancel-button,\n[type=\"search\"]::-webkit-search-decoration {\n -webkit-appearance: none;\n}\n\n//\n// 1. Correct the inability to style clickable types in iOS and Safari.\n// 2. Change font properties to `inherit` in Safari.\n//\n\n::-webkit-file-upload-button {\n font: inherit; // 2\n -webkit-appearance: button; // 1\n}\n\n//\n// Correct element displays\n//\n\noutput {\n display: inline-block;\n}\n\nsummary {\n display: list-item; // Add the correct display in all browsers\n}\n\ntemplate {\n display: none; // Add the correct display in IE\n}\n\n// Always hide an element with the `hidden` HTML attribute (from PureCSS).\n// Needed for proper display in IE 10-.\n[hidden] {\n display: none !important;\n}\n","// Variables\n//\n// Copy settings from this file into the provided `_custom.scss` to override\n// the Bootstrap defaults without modifying key, versioned files.\n//\n// Variables should follow the `$component-state-property-size` formula for\n// consistent naming. Ex: $nav-link-disabled-color and $modal-content-box-shadow-xs.\n\n// Table of Contents\n//\n// Color system\n// Options\n// Spacing\n// Body\n// Links\n// Grid breakpoints\n// Grid containers\n// Grid columns\n// Fonts\n// Components\n// Tables\n// Buttons\n// Forms\n// Dropdowns\n// Z-index master list\n// Navs\n// Navbar\n// Pagination\n// Jumbotron\n// Form states and alerts\n// Cards\n// Tooltips\n// Popovers\n// Badges\n// Modals\n// Alerts\n// Progress bars\n// List group\n// Image thumbnails\n// Figures\n// Breadcrumbs\n// Carousel\n// Close\n// Code\n\n\n//\n// Color system\n//\n\n$white: #fff !default;\n$gray-100: #f8f9fa !default;\n$gray-200: #e9ecef !default;\n$gray-300: #dee2e6 !default;\n$gray-400: #ced4da !default;\n$gray-500: #adb5bd !default;\n$gray-600: #868e96 !default;\n$gray-700: #495057 !default;\n$gray-800: #343a40 !default;\n$gray-900: #212529 !default;\n$black: #000 !default;\n\n$grays: (\n 100: $gray-100,\n 200: $gray-200,\n 300: $gray-300,\n 400: $gray-400,\n 500: $gray-500,\n 600: $gray-600,\n 700: $gray-700,\n 800: $gray-800,\n 900: $gray-900\n) !default;\n\n$blue: #007bff !default;\n$indigo: #6610f2 !default;\n$purple: #6f42c1 !default;\n$pink: #e83e8c !default;\n$red: #dc3545 !default;\n$orange: #fd7e14 !default;\n$yellow: #ffc107 !default;\n$green: #28a745 !default;\n$teal: #20c997 !default;\n$cyan: #17a2b8 !default;\n\n$colors: (\n blue: $blue,\n indigo: $indigo,\n purple: $purple,\n pink: $pink,\n red: $red,\n orange: $orange,\n yellow: $yellow,\n green: $green,\n teal: $teal,\n cyan: $cyan,\n white: $white,\n gray: $gray-600,\n gray-dark: $gray-800\n) !default;\n\n$theme-colors: (\n primary: $blue,\n secondary: $gray-600,\n success: $green,\n info: $cyan,\n warning: $yellow,\n danger: $red,\n light: $gray-100,\n dark: $gray-800\n) !default;\n\n// Set a specific jump point for requesting color jumps\n$theme-color-interval: 8% !default;\n\n\n// Options\n//\n// Quickly modify global styling by enabling or disabling optional features.\n\n$enable-rounded: true !default;\n$enable-shadows: false !default;\n$enable-gradients: false !default;\n$enable-transitions: true !default;\n$enable-hover-media-query: false !default;\n$enable-grid-classes: true !default;\n$enable-print-styles: true !default;\n\n\n// Spacing\n//\n// Control the default styling of most Bootstrap elements by modifying these\n// variables. Mostly focused on spacing.\n// You can add more entries to the $spacers map, should you need more variation.\n\n$spacer: 1rem !default;\n$spacers: (\n 0: 0,\n 1: ($spacer * .25),\n 2: ($spacer * .5),\n 3: $spacer,\n 4: ($spacer * 1.5),\n 5: ($spacer * 3)\n) !default;\n\n// This variable affects the `.h-*` and `.w-*` classes.\n$sizes: (\n 25: 25%,\n 50: 50%,\n 75: 75%,\n 100: 100%\n) !default;\n\n// Body\n//\n// Settings for the `` element.\n\n$body-bg: $white !default;\n$body-color: $gray-900 !default;\n\n// Links\n//\n// Style anchor elements.\n\n$link-color: theme-color(\"primary\") !default;\n$link-decoration: none !default;\n$link-hover-color: darken($link-color, 15%) !default;\n$link-hover-decoration: underline !default;\n\n\n// Grid breakpoints\n//\n// Define the minimum dimensions at which your layout will change,\n// adapting to different screen sizes, for use in media queries.\n\n$grid-breakpoints: (\n xs: 0,\n sm: 576px,\n md: 768px,\n lg: 992px,\n xl: 1200px\n) !default;\n@include _assert-ascending($grid-breakpoints, \"$grid-breakpoints\");\n@include _assert-starts-at-zero($grid-breakpoints);\n\n\n// Grid containers\n//\n// Define the maximum width of `.container` for different screen sizes.\n\n$container-max-widths: (\n sm: 540px,\n md: 720px,\n lg: 960px,\n xl: 1140px\n) !default;\n@include _assert-ascending($container-max-widths, \"$container-max-widths\");\n\n\n// Grid columns\n//\n// Set the number of columns and specify the width of the gutters.\n\n$grid-columns: 12 !default;\n$grid-gutter-width: 30px !default;\n\n// Components\n//\n// Define common padding and border radius sizes and more.\n\n$line-height-lg: 1.5 !default;\n$line-height-sm: 1.5 !default;\n\n$border-width: 1px !default;\n\n$border-radius: .25rem !default;\n$border-radius-lg: .3rem !default;\n$border-radius-sm: .2rem !default;\n\n$component-active-color: $white !default;\n$component-active-bg: theme-color(\"primary\") !default;\n\n$caret-width: .3em !default;\n\n$transition-base: all .2s ease-in-out !default;\n$transition-fade: opacity .15s linear !default;\n$transition-collapse: height .35s ease !default;\n\n\n// Fonts\n//\n// Font, line-height, and color for body text, headings, and more.\n\n$font-family-sans-serif: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif !default;\n$font-family-monospace: Menlo, Monaco, Consolas, \"Liberation Mono\", \"Courier New\", monospace !default;\n$font-family-base: $font-family-sans-serif !default;\n\n$font-size-base: 1rem !default; // Assumes the browser default, typically `16px`\n$font-size-lg: 1.25rem !default;\n$font-size-sm: .875rem !default;\n\n$font-weight-normal: normal !default;\n$font-weight-bold: bold !default;\n\n$font-weight-base: $font-weight-normal !default;\n$line-height-base: 1.5 !default;\n\n$h1-font-size: 2.5rem !default;\n$h2-font-size: 2rem !default;\n$h3-font-size: 1.75rem !default;\n$h4-font-size: 1.5rem !default;\n$h5-font-size: 1.25rem !default;\n$h6-font-size: 1rem !default;\n\n$headings-margin-bottom: ($spacer / 2) !default;\n$headings-font-family: inherit !default;\n$headings-font-weight: 500 !default;\n$headings-line-height: 1.1 !default;\n$headings-color: inherit !default;\n\n$display1-size: 6rem !default;\n$display2-size: 5.5rem !default;\n$display3-size: 4.5rem !default;\n$display4-size: 3.5rem !default;\n\n$display1-weight: 300 !default;\n$display2-weight: 300 !default;\n$display3-weight: 300 !default;\n$display4-weight: 300 !default;\n$display-line-height: $headings-line-height !default;\n\n$lead-font-size: 1.25rem !default;\n$lead-font-weight: 300 !default;\n\n$small-font-size: 80% !default;\n\n$text-muted: $gray-600 !default;\n\n$blockquote-small-color: $gray-600 !default;\n$blockquote-font-size: ($font-size-base * 1.25) !default;\n\n$hr-border-color: rgba($black,.1) !default;\n$hr-border-width: $border-width !default;\n\n$mark-padding: .2em !default;\n\n$dt-font-weight: $font-weight-bold !default;\n\n$kbd-box-shadow: inset 0 -.1rem 0 rgba($black,.25) !default;\n$nested-kbd-font-weight: $font-weight-bold !default;\n\n$list-inline-padding: 5px !default;\n\n$mark-bg: #fcf8e3 !default;\n\n\n// Tables\n//\n// Customizes the `.table` component with basic values, each used across all table variations.\n\n$table-cell-padding: .75rem !default;\n$table-cell-padding-sm: .3rem !default;\n\n$table-bg: transparent !default;\n$table-accent-bg: rgba($black,.05) !default;\n$table-hover-bg: rgba($black,.075) !default;\n$table-active-bg: $table-hover-bg !default;\n\n$table-border-width: $border-width !default;\n$table-border-color: $gray-200 !default;\n\n$table-head-bg: $gray-200 !default;\n$table-head-color: $gray-700 !default;\n\n$table-inverse-bg: $gray-900 !default;\n$table-inverse-accent-bg: rgba($white, .05) !default;\n$table-inverse-hover-bg: rgba($white, .075) !default;\n$table-inverse-border-color: lighten($gray-900, 7.5%) !default;\n$table-inverse-color: $body-bg !default;\n\n\n// Buttons\n//\n// For each of Bootstrap's buttons, define text, background and border color.\n\n$input-btn-padding-y: .5rem !default;\n$input-btn-padding-x: .75rem !default;\n$input-btn-line-height: 1.25 !default;\n\n$input-btn-padding-y-sm: .25rem !default;\n$input-btn-padding-x-sm: .5rem !default;\n$input-btn-line-height-sm: 1.5 !default;\n\n$input-btn-padding-y-lg: .5rem !default;\n$input-btn-padding-x-lg: 1rem !default;\n$input-btn-line-height-lg: 1.5 !default;\n\n$btn-font-weight: $font-weight-normal !default;\n$btn-box-shadow: inset 0 1px 0 rgba($white,.15), 0 1px 1px rgba($black,.075) !default;\n$btn-focus-box-shadow: 0 0 0 3px rgba(theme-color(\"primary\"), .25) !default;\n$btn-active-box-shadow: inset 0 3px 5px rgba($black,.125) !default;\n\n$btn-link-disabled-color: $gray-600 !default;\n\n$btn-block-spacing-y: .5rem !default;\n\n// Allows for customizing button radius independently from global border radius\n$btn-border-radius: $border-radius !default;\n$btn-border-radius-lg: $border-radius-lg !default;\n$btn-border-radius-sm: $border-radius-sm !default;\n\n$btn-transition: all .15s ease-in-out !default;\n\n\n// Forms\n\n$input-bg: $white !default;\n$input-disabled-bg: $gray-200 !default;\n\n$input-color: $gray-700 !default;\n$input-border-color: rgba($black,.15) !default;\n$input-btn-border-width: $border-width !default; // For form controls and buttons\n$input-box-shadow: inset 0 1px 1px rgba($black,.075) !default;\n\n$input-border-radius: $border-radius !default;\n$input-border-radius-lg: $border-radius-lg !default;\n$input-border-radius-sm: $border-radius-sm !default;\n\n$input-focus-bg: $input-bg !default;\n$input-focus-border-color: lighten(theme-color(\"primary\"), 25%) !default;\n$input-focus-box-shadow: $input-box-shadow, $btn-focus-box-shadow !default;\n$input-focus-color: $input-color !default;\n\n$input-placeholder-color: $gray-600 !default;\n\n$input-height-border: $input-btn-border-width * 2 !default;\n\n$input-height-inner: ($font-size-base * $input-btn-line-height) + ($input-btn-padding-y * 2) !default;\n$input-height: calc(#{$input-height-inner} + #{$input-height-border}) !default;\n\n$input-height-inner-sm: ($font-size-sm * $input-btn-line-height-sm) + ($input-btn-padding-y-sm * 2) !default;\n$input-height-sm: calc(#{$input-height-inner-sm} + #{$input-height-border}) !default;\n\n$input-height-inner-lg: ($font-size-sm * $input-btn-line-height-lg) + ($input-btn-padding-y-lg * 2) !default;\n$input-height-lg: calc(#{$input-height-inner-lg} + #{$input-height-border}) !default;\n\n$input-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s !default;\n\n$form-text-margin-top: .25rem !default;\n\n$form-check-margin-bottom: .5rem !default;\n$form-check-input-gutter: 1.25rem !default;\n$form-check-input-margin-y: .25rem !default;\n$form-check-input-margin-x: .25rem !default;\n\n$form-check-inline-margin-x: .75rem !default;\n\n$form-group-margin-bottom: 1rem !default;\n\n$input-group-addon-bg: $gray-200 !default;\n$input-group-addon-border-color: $input-border-color !default;\n\n$custom-control-gutter: 1.5rem !default;\n$custom-control-spacer-y: .25rem !default;\n$custom-control-spacer-x: 1rem !default;\n\n$custom-control-indicator-size: 1rem !default;\n$custom-control-indicator-bg: #ddd !default;\n$custom-control-indicator-bg-size: 50% 50% !default;\n$custom-control-indicator-box-shadow: inset 0 .25rem .25rem rgba($black,.1) !default;\n\n$custom-control-indicator-disabled-bg: $gray-200 !default;\n$custom-control-description-disabled-color: $gray-600 !default;\n\n$custom-control-indicator-checked-color: $white !default;\n$custom-control-indicator-checked-bg: theme-color(\"primary\") !default;\n$custom-control-indicator-checked-box-shadow: none !default;\n\n$custom-control-indicator-focus-box-shadow: 0 0 0 1px $body-bg, 0 0 0 3px theme-color(\"primary\") !default;\n\n$custom-control-indicator-active-color: $white !default;\n$custom-control-indicator-active-bg: lighten(theme-color(\"primary\"), 35%) !default;\n$custom-control-indicator-active-box-shadow: none !default;\n\n$custom-checkbox-indicator-border-radius: $border-radius !default;\n$custom-checkbox-indicator-icon-checked: str-replace(url(\"data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3E%3Cpath fill='#{$custom-control-indicator-checked-color}' d='M6.564.75l-3.59 3.612-1.538-1.55L0 4.26 2.974 7.25 8 2.193z'/%3E%3C/svg%3E\"), \"#\", \"%23\") !default;\n\n$custom-checkbox-indicator-indeterminate-bg: theme-color(\"primary\") !default;\n$custom-checkbox-indicator-indeterminate-color: $custom-control-indicator-checked-color !default;\n$custom-checkbox-indicator-icon-indeterminate: str-replace(url(\"data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 4'%3E%3Cpath stroke='#{$custom-checkbox-indicator-indeterminate-color}' d='M0 2h4'/%3E%3C/svg%3E\"), \"#\", \"%23\") !default;\n$custom-checkbox-indicator-indeterminate-box-shadow: none !default;\n\n$custom-radio-indicator-border-radius: 50% !default;\n$custom-radio-indicator-icon-checked: str-replace(url(\"data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3E%3Ccircle r='3' fill='#{$custom-control-indicator-checked-color}'/%3E%3C/svg%3E\"), \"#\", \"%23\") !default;\n\n$custom-select-padding-y: .375rem !default;\n$custom-select-padding-x: .75rem !default;\n$custom-select-height: $input-height !default;\n$custom-select-indicator-padding: 1rem !default; // Extra padding to account for the presence of the background-image based indicator\n$custom-select-line-height: $input-btn-line-height !default;\n$custom-select-color: $input-color !default;\n$custom-select-disabled-color: $gray-600 !default;\n$custom-select-bg: $white !default;\n$custom-select-disabled-bg: $gray-200 !default;\n$custom-select-bg-size: 8px 10px !default; // In pixels because image dimensions\n$custom-select-indicator-color: #333 !default;\n$custom-select-indicator: str-replace(url(\"data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'%3E%3Cpath fill='#{$custom-select-indicator-color}' d='M2 0L0 2h4zm0 5L0 3h4z'/%3E%3C/svg%3E\"), \"#\", \"%23\") !default;\n$custom-select-border-width: $input-btn-border-width !default;\n$custom-select-border-color: $input-border-color !default;\n$custom-select-border-radius: $border-radius !default;\n\n$custom-select-focus-border-color: lighten(theme-color(\"primary\"), 25%) !default;\n$custom-select-focus-box-shadow: inset 0 1px 2px rgba($black, .075), 0 0 5px rgba($custom-select-focus-border-color, .5) !default;\n\n$custom-select-font-size-sm: 75% !default;\n$custom-select-height-sm: $input-height-sm !default;\n\n$custom-file-height: 2.5rem !default;\n$custom-file-width: 14rem !default;\n$custom-file-focus-box-shadow: 0 0 0 .075rem $white, 0 0 0 .2rem theme-color(\"primary\") !default;\n\n$custom-file-padding-y: 1rem !default;\n$custom-file-padding-x: .5rem !default;\n$custom-file-line-height: 1.5 !default;\n$custom-file-color: $gray-700 !default;\n$custom-file-bg: $white !default;\n$custom-file-border-width: $border-width !default;\n$custom-file-border-color: $input-border-color !default;\n$custom-file-border-radius: $border-radius !default;\n$custom-file-box-shadow: inset 0 .2rem .4rem rgba($black,.05) !default;\n$custom-file-button-color: $custom-file-color !default;\n$custom-file-button-bg: $gray-200 !default;\n$custom-file-text: (\n placeholder: (\n en: \"Choose file...\"\n ),\n button-label: (\n en: \"Browse\"\n )\n) !default;\n\n\n// Form validation\n$form-feedback-valid-color: theme-color(\"success\") !default;\n$form-feedback-invalid-color: theme-color(\"danger\") !default;\n\n\n// Dropdowns\n//\n// Dropdown menu container and contents.\n\n$dropdown-min-width: 10rem !default;\n$dropdown-padding-y: .5rem !default;\n$dropdown-spacer: .125rem !default;\n$dropdown-bg: $white !default;\n$dropdown-border-color: rgba($black,.15) !default;\n$dropdown-border-width: $border-width !default;\n$dropdown-divider-bg: $gray-200 !default;\n$dropdown-box-shadow: 0 .5rem 1rem rgba($black,.175) !default;\n\n$dropdown-link-color: $gray-900 !default;\n$dropdown-link-hover-color: darken($gray-900, 5%) !default;\n$dropdown-link-hover-bg: $gray-100 !default;\n\n$dropdown-link-active-color: $component-active-color !default;\n$dropdown-link-active-bg: $component-active-bg !default;\n\n$dropdown-link-disabled-color: $gray-600 !default;\n\n$dropdown-item-padding-y: .25rem !default;\n$dropdown-item-padding-x: 1.5rem !default;\n\n$dropdown-header-color: $gray-600 !default;\n\n\n// Z-index master list\n//\n// Warning: Avoid customizing these values. They're used for a bird's eye view\n// of components dependent on the z-axis and are designed to all work together.\n\n$zindex-dropdown: 1000 !default;\n$zindex-sticky: 1020 !default;\n$zindex-fixed: 1030 !default;\n$zindex-modal-backdrop: 1040 !default;\n$zindex-modal: 1050 !default;\n$zindex-popover: 1060 !default;\n$zindex-tooltip: 1070 !default;\n\n// Navs\n\n$nav-link-padding-y: .5rem !default;\n$nav-link-padding-x: 1rem !default;\n$nav-link-disabled-color: $gray-600 !default;\n\n$nav-tabs-border-color: #ddd !default;\n$nav-tabs-border-width: $border-width !default;\n$nav-tabs-border-radius: $border-radius !default;\n$nav-tabs-link-hover-border-color: $gray-200 !default;\n$nav-tabs-link-active-color: $gray-700 !default;\n$nav-tabs-link-active-bg: $body-bg !default;\n$nav-tabs-link-active-border-color: #ddd !default;\n\n$nav-pills-border-radius: $border-radius !default;\n$nav-pills-link-active-color: $component-active-color !default;\n$nav-pills-link-active-bg: $component-active-bg !default;\n\n// Navbar\n\n$navbar-padding-y: ($spacer / 2) !default;\n$navbar-padding-x: $spacer !default;\n\n$navbar-brand-font-size: $font-size-lg !default;\n// Compute the navbar-brand padding-y so the navbar-brand will have the same height as navbar-text and nav-link\n$nav-link-height: $navbar-brand-font-size * $line-height-base !default;\n$navbar-brand-height: ($font-size-base * $line-height-base + $nav-link-padding-y * 2) !default;\n$navbar-brand-padding-y: ($navbar-brand-height - $nav-link-height) / 2 !default;\n\n$navbar-toggler-padding-y: .25rem !default;\n$navbar-toggler-padding-x: .75rem !default;\n$navbar-toggler-font-size: $font-size-lg !default;\n$navbar-toggler-border-radius: $btn-border-radius !default;\n\n$navbar-dark-color: rgba($white,.5) !default;\n$navbar-dark-hover-color: rgba($white,.75) !default;\n$navbar-dark-active-color: rgba($white,1) !default;\n$navbar-dark-disabled-color: rgba($white,.25) !default;\n$navbar-dark-toggler-icon-bg: str-replace(url(\"data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='#{$navbar-dark-color}' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E\"), \"#\", \"%23\") !default;\n$navbar-dark-toggler-border-color: rgba($white,.1) !default;\n\n$navbar-light-color: rgba($black,.5) !default;\n$navbar-light-hover-color: rgba($black,.7) !default;\n$navbar-light-active-color: rgba($black,.9) !default;\n$navbar-light-disabled-color: rgba($black,.3) !default;\n$navbar-light-toggler-icon-bg: str-replace(url(\"data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='#{$navbar-light-color}' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E\"), \"#\", \"%23\") !default;\n$navbar-light-toggler-border-color: rgba($black,.1) !default;\n\n// Pagination\n\n$pagination-padding-y: .5rem !default;\n$pagination-padding-x: .75rem !default;\n$pagination-padding-y-sm: .25rem !default;\n$pagination-padding-x-sm: .5rem !default;\n$pagination-padding-y-lg: .75rem !default;\n$pagination-padding-x-lg: 1.5rem !default;\n$pagination-line-height: 1.25 !default;\n\n$pagination-color: $link-color !default;\n$pagination-bg: $white !default;\n$pagination-border-width: $border-width !default;\n$pagination-border-color: #ddd !default;\n\n$pagination-hover-color: $link-hover-color !default;\n$pagination-hover-bg: $gray-200 !default;\n$pagination-hover-border-color: #ddd !default;\n\n$pagination-active-color: $white !default;\n$pagination-active-bg: theme-color(\"primary\") !default;\n$pagination-active-border-color: theme-color(\"primary\") !default;\n\n$pagination-disabled-color: $gray-600 !default;\n$pagination-disabled-bg: $white !default;\n$pagination-disabled-border-color: #ddd !default;\n\n\n// Jumbotron\n\n$jumbotron-padding: 2rem !default;\n$jumbotron-bg: $gray-200 !default;\n\n\n// Cards\n\n$card-spacer-y: .75rem !default;\n$card-spacer-x: 1.25rem !default;\n$card-border-width: 1px !default;\n$card-border-radius: $border-radius !default;\n$card-border-color: rgba($black,.125) !default;\n$card-inner-border-radius: calc(#{$card-border-radius} - #{$card-border-width}) !default;\n$card-cap-bg: rgba($black, .03) !default;\n$card-bg: $white !default;\n\n$card-img-overlay-padding: 1.25rem !default;\n\n$card-deck-margin: ($grid-gutter-width / 2) !default;\n\n$card-columns-count: 3 !default;\n$card-columns-gap: 1.25rem !default;\n$card-columns-margin: $card-spacer-y !default;\n\n\n// Tooltips\n\n$tooltip-max-width: 200px !default;\n$tooltip-color: $white !default;\n$tooltip-bg: $black !default;\n$tooltip-opacity: .9 !default;\n$tooltip-padding-y: 3px !default;\n$tooltip-padding-x: 8px !default;\n$tooltip-margin: 0 !default;\n\n\n$tooltip-arrow-width: 5px !default;\n$tooltip-arrow-height: 5px !default;\n$tooltip-arrow-color: $tooltip-bg !default;\n\n\n// Popovers\n\n$popover-inner-padding: 1px !default;\n$popover-bg: $white !default;\n$popover-max-width: 276px !default;\n$popover-border-width: $border-width !default;\n$popover-border-color: rgba($black,.2) !default;\n$popover-box-shadow: 0 5px 10px rgba($black,.2) !default;\n\n$popover-header-bg: darken($popover-bg, 3%) !default;\n$popover-header-color: $headings-color !default;\n$popover-header-padding-y: 8px !default;\n$popover-header-padding-x: 14px !default;\n\n$popover-body-color: $body-color !default;\n$popover-body-padding-y: 9px !default;\n$popover-body-padding-x: 14px !default;\n\n$popover-arrow-width: 10px !default;\n$popover-arrow-height: 5px !default;\n$popover-arrow-color: $popover-bg !default;\n\n$popover-arrow-outer-width: ($popover-arrow-width + 1px) !default;\n$popover-arrow-outer-color: fade-in($popover-border-color, .05) !default;\n\n\n// Badges\n\n$badge-color: $white !default;\n$badge-font-size: 75% !default;\n$badge-font-weight: $font-weight-bold !default;\n$badge-padding-y: .25em !default;\n$badge-padding-x: .4em !default;\n\n$badge-pill-padding-x: .6em !default;\n// Use a higher than normal value to ensure completely rounded edges when\n// customizing padding or font-size on labels.\n$badge-pill-border-radius: 10rem !default;\n\n\n// Modals\n\n// Padding applied to the modal body\n$modal-inner-padding: 15px !default;\n\n$modal-dialog-margin: 10px !default;\n$modal-dialog-margin-y-sm-up: 30px !default;\n\n$modal-title-line-height: $line-height-base !default;\n\n$modal-content-bg: $white !default;\n$modal-content-border-color: rgba($black,.2) !default;\n$modal-content-border-width: $border-width !default;\n$modal-content-box-shadow-xs: 0 3px 9px rgba($black,.5) !default;\n$modal-content-box-shadow-sm-up: 0 5px 15px rgba($black,.5) !default;\n\n$modal-backdrop-bg: $black !default;\n$modal-backdrop-opacity: .5 !default;\n$modal-header-border-color: $gray-200 !default;\n$modal-footer-border-color: $modal-header-border-color !default;\n$modal-header-border-width: $modal-content-border-width !default;\n$modal-footer-border-width: $modal-header-border-width !default;\n$modal-header-padding: 15px !default;\n\n$modal-lg: 800px !default;\n$modal-md: 500px !default;\n$modal-sm: 300px !default;\n\n$modal-transition: transform .3s ease-out !default;\n\n\n// Alerts\n//\n// Define alert colors, border radius, and padding.\n\n$alert-padding-y: .75rem !default;\n$alert-padding-x: 1.25rem !default;\n$alert-margin-bottom: 1rem !default;\n$alert-border-radius: $border-radius !default;\n$alert-link-font-weight: $font-weight-bold !default;\n$alert-border-width: $border-width !default;\n\n\n// Progress bars\n\n$progress-height: 1rem !default;\n$progress-font-size: .75rem !default;\n$progress-bg: $gray-200 !default;\n$progress-border-radius: $border-radius !default;\n$progress-box-shadow: inset 0 .1rem .1rem rgba($black,.1) !default;\n$progress-bar-color: $white !default;\n$progress-bar-bg: theme-color(\"primary\") !default;\n$progress-bar-animation-timing: 1s linear infinite !default;\n$progress-bar-transition: width .6s ease !default;\n\n// List group\n\n$list-group-bg: $white !default;\n$list-group-border-color: rgba($black,.125) !default;\n$list-group-border-width: $border-width !default;\n$list-group-border-radius: $border-radius !default;\n\n$list-group-item-padding-y: .75rem !default;\n$list-group-item-padding-x: 1.25rem !default;\n\n$list-group-hover-bg: $gray-100 !default;\n$list-group-active-color: $component-active-color !default;\n$list-group-active-bg: $component-active-bg !default;\n$list-group-active-border-color: $list-group-active-bg !default;\n\n$list-group-disabled-color: $gray-600 !default;\n$list-group-disabled-bg: $list-group-bg !default;\n\n$list-group-action-color: $gray-700 !default;\n$list-group-action-hover-color: $list-group-action-color !default;\n\n$list-group-action-active-color: $body-color !default;\n$list-group-action-active-bg: $gray-200 !default;\n\n\n// Image thumbnails\n\n$thumbnail-padding: .25rem !default;\n$thumbnail-bg: $body-bg !default;\n$thumbnail-border-width: $border-width !default;\n$thumbnail-border-color: #ddd !default;\n$thumbnail-border-radius: $border-radius !default;\n$thumbnail-box-shadow: 0 1px 2px rgba($black,.075) !default;\n$thumbnail-transition: all .2s ease-in-out !default;\n\n\n// Figures\n\n$figure-caption-font-size: 90% !default;\n$figure-caption-color: $gray-600 !default;\n\n\n// Breadcrumbs\n\n$breadcrumb-padding-y: .75rem !default;\n$breadcrumb-padding-x: 1rem !default;\n$breadcrumb-item-padding: .5rem !default;\n\n$breadcrumb-bg: $gray-200 !default;\n$breadcrumb-divider-color: $gray-600 !default;\n$breadcrumb-active-color: $gray-600 !default;\n$breadcrumb-divider: \"/\" !default;\n\n\n// Carousel\n\n$carousel-control-color: $white !default;\n$carousel-control-width: 15% !default;\n$carousel-control-opacity: .5 !default;\n\n$carousel-indicator-width: 30px !default;\n$carousel-indicator-height: 3px !default;\n$carousel-indicator-spacer: 3px !default;\n$carousel-indicator-active-bg: $white !default;\n\n$carousel-caption-width: 70% !default;\n$carousel-caption-color: $white !default;\n\n$carousel-control-icon-width: 20px !default;\n\n$carousel-control-prev-icon-bg: str-replace(url(\"data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='#{$carousel-control-color}' viewBox='0 0 8 8'%3E%3Cpath d='M4 0l-4 4 4 4 1.5-1.5-2.5-2.5 2.5-2.5-1.5-1.5z'/%3E%3C/svg%3E\"), \"#\", \"%23\") !default;\n$carousel-control-next-icon-bg: str-replace(url(\"data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='#{$carousel-control-color}' viewBox='0 0 8 8'%3E%3Cpath d='M1.5 0l-1.5 1.5 2.5 2.5-2.5 2.5 1.5 1.5 4-4-4-4z'/%3E%3C/svg%3E\"), \"#\", \"%23\") !default;\n\n$carousel-transition: transform .6s ease !default;\n\n\n// Close\n\n$close-font-size: $font-size-base * 1.5 !default;\n$close-font-weight: $font-weight-bold !default;\n$close-color: $black !default;\n$close-text-shadow: 0 1px 0 $white !default;\n\n// Code\n\n$code-font-size: 90% !default;\n$code-padding-y: .2rem !default;\n$code-padding-x: .4rem !default;\n$code-color: #bd4147 !default;\n$code-bg: $gray-100 !default;\n\n$kbd-color: $white !default;\n$kbd-bg: $gray-900 !default;\n\n$pre-color: $gray-900 !default;\n$pre-scrollable-max-height: 340px !default;\n","@mixin hover {\n // TODO: re-enable along with mq4-hover-shim\n// @if $enable-hover-media-query {\n// // See Media Queries Level 4: https://drafts.csswg.org/mediaqueries/#hover\n// // Currently shimmed by https://github.com/twbs/mq4-hover-shim\n// @media (hover: hover) {\n// &:hover { @content }\n// }\n// }\n// @else {\n// scss-lint:disable Indentation\n &:hover { @content }\n// scss-lint:enable Indentation\n// }\n}\n\n\n@mixin hover-focus {\n @if $enable-hover-media-query {\n &:focus { @content }\n @include hover { @content }\n } @else {\n &:focus,\n &:hover {\n @content\n }\n }\n}\n\n@mixin plain-hover-focus {\n @if $enable-hover-media-query {\n &,\n &:focus {\n @content\n }\n @include hover { @content }\n } @else {\n &,\n &:focus,\n &:hover {\n @content\n }\n }\n}\n\n@mixin hover-focus-active {\n @if $enable-hover-media-query {\n &:focus,\n &:active {\n @content\n }\n @include hover { @content }\n } @else {\n &:focus,\n &:active,\n &:hover {\n @content\n }\n }\n}\n","//\n// Headings\n//\n\nh1, h2, h3, h4, h5, h6,\n.h1, .h2, .h3, .h4, .h5, .h6 {\n margin-bottom: $headings-margin-bottom;\n font-family: $headings-font-family;\n font-weight: $headings-font-weight;\n line-height: $headings-line-height;\n color: $headings-color;\n}\n\nh1, .h1 { font-size: $h1-font-size; }\nh2, .h2 { font-size: $h2-font-size; }\nh3, .h3 { font-size: $h3-font-size; }\nh4, .h4 { font-size: $h4-font-size; }\nh5, .h5 { font-size: $h5-font-size; }\nh6, .h6 { font-size: $h6-font-size; }\n\n.lead {\n font-size: $lead-font-size;\n font-weight: $lead-font-weight;\n}\n\n// Type display classes\n.display-1 {\n font-size: $display1-size;\n font-weight: $display1-weight;\n line-height: $display-line-height;\n}\n.display-2 {\n font-size: $display2-size;\n font-weight: $display2-weight;\n line-height: $display-line-height;\n}\n.display-3 {\n font-size: $display3-size;\n font-weight: $display3-weight;\n line-height: $display-line-height;\n}\n.display-4 {\n font-size: $display4-size;\n font-weight: $display4-weight;\n line-height: $display-line-height;\n}\n\n\n//\n// Horizontal rules\n//\n\nhr {\n margin-top: 1rem;\n margin-bottom: 1rem;\n border: 0;\n border-top: $hr-border-width solid $hr-border-color;\n}\n\n\n//\n// Emphasis\n//\n\nsmall,\n.small {\n font-size: $small-font-size;\n font-weight: $font-weight-normal;\n}\n\nmark,\n.mark {\n padding: $mark-padding;\n background-color: $mark-bg;\n}\n\n\n//\n// Lists\n//\n\n.list-unstyled {\n @include list-unstyled;\n}\n\n// Inline turns list items into inline-block\n.list-inline {\n @include list-unstyled;\n}\n.list-inline-item {\n display: inline-block;\n\n &:not(:last-child) {\n margin-right: $list-inline-padding;\n }\n}\n\n\n//\n// Misc\n//\n\n// Builds on `abbr`\n.initialism {\n font-size: 90%;\n text-transform: uppercase;\n}\n\n// Blockquotes\n.blockquote {\n margin-bottom: $spacer;\n font-size: $blockquote-font-size;\n}\n\n.blockquote-footer {\n display: block;\n font-size: 80%; // back to default font-size\n color: $blockquote-small-color;\n\n &::before {\n content: \"\\2014 \\00A0\"; // em dash, nbsp\n }\n}\n","// Lists\n\n// Unstyled keeps list items block level, just removes default browser padding and list-style\n@mixin list-unstyled {\n padding-left: 0;\n list-style: none;\n}\n","// Responsive images (ensure images don't scale beyond their parents)\n//\n// This is purposefully opt-in via an explicit class rather than being the default for all ``s.\n// We previously tried the \"images are responsive by default\" approach in Bootstrap v2,\n// and abandoned it in Bootstrap v3 because it breaks lots of third-party widgets (including Google Maps)\n// which weren't expecting the images within themselves to be involuntarily resized.\n// See also https://github.com/twbs/bootstrap/issues/18178\n.img-fluid {\n @include img-fluid;\n}\n\n\n// Image thumbnails\n.img-thumbnail {\n padding: $thumbnail-padding;\n background-color: $thumbnail-bg;\n border: $thumbnail-border-width solid $thumbnail-border-color;\n @include border-radius($thumbnail-border-radius);\n @include transition($thumbnail-transition);\n @include box-shadow($thumbnail-box-shadow);\n\n // Keep them at most 100% wide\n @include img-fluid;\n}\n\n//\n// Figures\n//\n\n.figure {\n // Ensures the caption's text aligns with the image.\n display: inline-block;\n}\n\n.figure-img {\n margin-bottom: ($spacer / 2);\n line-height: 1;\n}\n\n.figure-caption {\n font-size: $figure-caption-font-size;\n color: $figure-caption-color;\n}\n","// Image Mixins\n// - Responsive image\n// - Retina image\n\n\n// Responsive image\n//\n// Keep images from scaling beyond the width of their parents.\n\n@mixin img-fluid {\n // Part 1: Set a maximum relative to the parent\n max-width: 100%;\n // Part 2: Override the height to auto, otherwise images will be stretched\n // when setting a width and height attribute on the img element.\n height: auto;\n}\n\n\n// Retina image\n//\n// Short retina mixin for setting background-image and -size.\n\n@mixin img-retina($file-1x, $file-2x, $width-1x, $height-1x) {\n background-image: url($file-1x);\n\n // Autoprefixer takes care of adding -webkit-min-device-pixel-ratio and -o-min-device-pixel-ratio,\n // but doesn't convert dppx=>dpi.\n // There's no such thing as unprefixed min-device-pixel-ratio since it's nonstandard.\n // Compatibility info: http://caniuse.com/#feat=css-media-resolution\n @media\n only screen and (min-resolution: 192dpi), // IE9-11 don't support dppx\n only screen and (min-resolution: 2dppx) { // Standardized\n background-image: url($file-2x);\n background-size: $width-1x $height-1x;\n }\n}\n","// Single side border-radius\n\n@mixin border-radius($radius: $border-radius) {\n @if $enable-rounded {\n border-radius: $radius;\n }\n}\n\n@mixin border-top-radius($radius) {\n @if $enable-rounded {\n border-top-left-radius: $radius;\n border-top-right-radius: $radius;\n }\n}\n\n@mixin border-right-radius($radius) {\n @if $enable-rounded {\n border-top-right-radius: $radius;\n border-bottom-right-radius: $radius;\n }\n}\n\n@mixin border-bottom-radius($radius) {\n @if $enable-rounded {\n border-bottom-right-radius: $radius;\n border-bottom-left-radius: $radius;\n }\n}\n\n@mixin border-left-radius($radius) {\n @if $enable-rounded {\n border-top-left-radius: $radius;\n border-bottom-left-radius: $radius;\n }\n}\n","@mixin transition($transition...) {\n @if $enable-transitions {\n @if length($transition) == 0 {\n transition: $transition-base;\n } @else {\n transition: $transition;\n }\n }\n}\n","// Inline and block code styles\ncode,\nkbd,\npre,\nsamp {\n font-family: $font-family-monospace;\n}\n\n// Inline code\ncode {\n padding: $code-padding-y $code-padding-x;\n font-size: $code-font-size;\n color: $code-color;\n background-color: $code-bg;\n @include border-radius($border-radius);\n\n // Streamline the style when inside anchors to avoid broken underline and more\n a > & {\n padding: 0;\n color: inherit;\n background-color: inherit;\n }\n}\n\n// User input typically entered via keyboard\nkbd {\n padding: $code-padding-y $code-padding-x;\n font-size: $code-font-size;\n color: $kbd-color;\n background-color: $kbd-bg;\n @include border-radius($border-radius-sm);\n @include box-shadow($kbd-box-shadow);\n\n kbd {\n padding: 0;\n font-size: 100%;\n font-weight: $nested-kbd-font-weight;\n @include box-shadow(none);\n }\n}\n\n// Blocks of code\npre {\n display: block;\n margin-top: 0;\n margin-bottom: 1rem;\n font-size: $code-font-size;\n color: $pre-color;\n\n // Account for some code outputs that place code tags in pre tags\n code {\n padding: 0;\n font-size: inherit;\n color: inherit;\n background-color: transparent;\n border-radius: 0;\n }\n}\n\n// Enable scrollable blocks of code\n.pre-scrollable {\n max-height: $pre-scrollable-max-height;\n overflow-y: scroll;\n}\n","// Container widths\n//\n// Set the container width, and override it for fixed navbars in media queries.\n\n@if $enable-grid-classes {\n .container {\n @include make-container();\n @include make-container-max-widths();\n }\n}\n\n// Fluid container\n//\n// Utilizes the mixin meant for fixed width containers, but with 100% width for\n// fluid, full width layouts.\n\n@if $enable-grid-classes {\n .container-fluid {\n width: 100%;\n @include make-container();\n }\n}\n\n// Row\n//\n// Rows contain and clear the floats of your columns.\n\n@if $enable-grid-classes {\n .row {\n @include make-row();\n }\n\n // Remove the negative margin from default .row, then the horizontal padding\n // from all immediate children columns (to prevent runaway style inheritance).\n .no-gutters {\n margin-right: 0;\n margin-left: 0;\n\n > .col,\n > [class*=\"col-\"] {\n padding-right: 0;\n padding-left: 0;\n }\n }\n}\n\n// Columns\n//\n// Common styles for small and large grid columns\n\n@if $enable-grid-classes {\n @include make-grid-columns();\n}\n","/// Grid system\n//\n// Generate semantic grid columns with these mixins.\n\n@mixin make-container() {\n margin-right: auto;\n margin-left: auto;\n padding-right: ($grid-gutter-width / 2);\n padding-left: ($grid-gutter-width / 2);\n width: 100%;\n}\n\n\n// For each breakpoint, define the maximum width of the container in a media query\n@mixin make-container-max-widths($max-widths: $container-max-widths, $breakpoints: $grid-breakpoints) {\n @each $breakpoint, $container-max-width in $max-widths {\n @include media-breakpoint-up($breakpoint, $breakpoints) {\n max-width: $container-max-width;\n }\n }\n}\n\n@mixin make-row() {\n display: flex;\n flex-wrap: wrap;\n margin-right: ($grid-gutter-width / -2);\n margin-left: ($grid-gutter-width / -2);\n}\n\n@mixin make-col-ready() {\n position: relative;\n // Prevent columns from becoming too narrow when at smaller grid tiers by\n // always setting `width: 100%;`. This works because we use `flex` values\n // later on to override this initial width.\n width: 100%;\n min-height: 1px; // Prevent collapsing\n padding-right: ($grid-gutter-width / 2);\n padding-left: ($grid-gutter-width / 2);\n}\n\n@mixin make-col($size, $columns: $grid-columns) {\n flex: 0 0 percentage($size / $columns);\n // Add a `max-width` to ensure content within each column does not blow out\n // the width of the column. Applies to IE10+ and Firefox. Chrome and Safari\n // do not appear to require this.\n max-width: percentage($size / $columns);\n}\n","// Breakpoint viewport sizes and media queries.\n//\n// Breakpoints are defined as a map of (name: minimum width), order from small to large:\n//\n// (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px)\n//\n// The map defined in the `$grid-breakpoints` global variable is used as the `$breakpoints` argument by default.\n\n// Name of the next breakpoint, or null for the last breakpoint.\n//\n// >> breakpoint-next(sm)\n// md\n// >> breakpoint-next(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n// md\n// >> breakpoint-next(sm, $breakpoint-names: (xs sm md lg xl))\n// md\n@function breakpoint-next($name, $breakpoints: $grid-breakpoints, $breakpoint-names: map-keys($breakpoints)) {\n $n: index($breakpoint-names, $name);\n @return if($n < length($breakpoint-names), nth($breakpoint-names, $n + 1), null);\n}\n\n// Minimum breakpoint width. Null for the smallest (first) breakpoint.\n//\n// >> breakpoint-min(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n// 576px\n@function breakpoint-min($name, $breakpoints: $grid-breakpoints) {\n $min: map-get($breakpoints, $name);\n @return if($min != 0, $min, null);\n}\n\n// Maximum breakpoint width. Null for the largest (last) breakpoint.\n// The maximum value is calculated as the minimum of the next one less 0.1.\n//\n// >> breakpoint-max(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n// 767px\n@function breakpoint-max($name, $breakpoints: $grid-breakpoints) {\n $next: breakpoint-next($name, $breakpoints);\n @return if($next, breakpoint-min($next, $breakpoints) - 1px, null);\n}\n\n// Returns a blank string if smallest breakpoint, otherwise returns the name with a dash infront.\n// Useful for making responsive utilities.\n//\n// >> breakpoint-infix(xs, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n// \"\" (Returns a blank string)\n// >> breakpoint-infix(sm, (xs: 0, sm: 576px, md: 768px, lg: 992px, xl: 1200px))\n// \"-sm\"\n@function breakpoint-infix($name, $breakpoints: $grid-breakpoints) {\n @return if(breakpoint-min($name, $breakpoints) == null, \"\", \"-#{$name}\");\n}\n\n// Media of at least the minimum breakpoint width. No query for the smallest breakpoint.\n// Makes the @content apply to the given breakpoint and wider.\n@mixin media-breakpoint-up($name, $breakpoints: $grid-breakpoints) {\n $min: breakpoint-min($name, $breakpoints);\n @if $min {\n @media (min-width: $min) {\n @content;\n }\n } @else {\n @content;\n }\n}\n\n// Media of at most the maximum breakpoint width. No query for the largest breakpoint.\n// Makes the @content apply to the given breakpoint and narrower.\n@mixin media-breakpoint-down($name, $breakpoints: $grid-breakpoints) {\n $max: breakpoint-max($name, $breakpoints);\n @if $max {\n @media (max-width: $max) {\n @content;\n }\n } @else {\n @content;\n }\n}\n\n// Media that spans multiple breakpoint widths.\n// Makes the @content apply between the min and max breakpoints\n@mixin media-breakpoint-between($lower, $upper, $breakpoints: $grid-breakpoints) {\n $min: breakpoint-min($lower, $breakpoints);\n $max: breakpoint-max($upper, $breakpoints);\n\n @media (min-width: $min) and (max-width: $max) {\n @content;\n }\n}\n\n// Media between the breakpoint's minimum and maximum widths.\n// No minimum for the smallest breakpoint, and no maximum for the largest one.\n// Makes the @content apply only to the given breakpoint, not viewports any wider or narrower.\n@mixin media-breakpoint-only($name, $breakpoints: $grid-breakpoints) {\n $min: breakpoint-min($name, $breakpoints);\n $max: breakpoint-max($name, $breakpoints);\n\n @if $min != null and $max != null {\n @media (min-width: $min) and (max-width: $max) {\n @content;\n }\n } @else if $max == null {\n @include media-breakpoint-up($name)\n } @else if $min == null {\n @include media-breakpoint-down($name)\n }\n}\n","// Framework grid generation\n//\n// Used only by Bootstrap to generate the correct number of grid classes given\n// any value of `$grid-columns`.\n\n@mixin make-grid-columns($columns: $grid-columns, $gutter: $grid-gutter-width, $breakpoints: $grid-breakpoints) {\n // Common properties for all breakpoints\n %grid-column {\n position: relative;\n width: 100%;\n min-height: 1px; // Prevent columns from collapsing when empty\n padding-right: ($gutter / 2);\n padding-left: ($gutter / 2);\n }\n\n @each $breakpoint in map-keys($breakpoints) {\n $infix: breakpoint-infix($breakpoint, $breakpoints);\n\n // Allow columns to stretch full width below their breakpoints\n @for $i from 1 through $columns {\n .col#{$infix}-#{$i} {\n @extend %grid-column;\n }\n }\n .col#{$infix},\n .col#{$infix}-auto {\n @extend %grid-column;\n }\n\n @include media-breakpoint-up($breakpoint, $breakpoints) {\n // Provide basic `.col-{bp}` classes for equal-width flexbox columns\n .col#{$infix} {\n flex-basis: 0;\n flex-grow: 1;\n max-width: 100%;\n }\n .col#{$infix}-auto {\n flex: 0 0 auto;\n width: auto;\n max-width: none; // Reset earlier grid tiers\n }\n\n @for $i from 1 through $columns {\n .col#{$infix}-#{$i} {\n @include make-col($i, $columns);\n }\n }\n\n @for $i from 1 through $columns {\n .order#{$infix}-#{$i} {\n order: $i;\n }\n }\n }\n }\n}\n","//\n// Basic Bootstrap table\n//\n\n.table {\n width: 100%;\n max-width: 100%;\n margin-bottom: $spacer;\n background-color: $table-bg; // Reset for nesting within parents with `background-color`.\n\n th,\n td {\n padding: $table-cell-padding;\n vertical-align: top;\n border-top: $table-border-width solid $table-border-color;\n }\n\n thead th {\n vertical-align: bottom;\n border-bottom: (2 * $table-border-width) solid $table-border-color;\n }\n\n tbody + tbody {\n border-top: (2 * $table-border-width) solid $table-border-color;\n }\n\n .table {\n background-color: $body-bg;\n }\n}\n\n\n//\n// Condensed table w/ half padding\n//\n\n.table-sm {\n th,\n td {\n padding: $table-cell-padding-sm;\n }\n}\n\n\n// Bordered version\n//\n// Add borders all around the table and between all the columns.\n\n.table-bordered {\n border: $table-border-width solid $table-border-color;\n\n th,\n td {\n border: $table-border-width solid $table-border-color;\n }\n\n thead {\n th,\n td {\n border-bottom-width: (2 * $table-border-width);\n }\n }\n}\n\n\n// Zebra-striping\n//\n// Default zebra-stripe styles (alternating gray and transparent backgrounds)\n\n.table-striped {\n tbody tr:nth-of-type(odd) {\n background-color: $table-accent-bg;\n }\n}\n\n\n// Hover effect\n//\n// Placed here since it has to come after the potential zebra striping\n\n.table-hover {\n tbody tr {\n @include hover {\n background-color: $table-hover-bg;\n }\n }\n}\n\n\n// Table backgrounds\n//\n// Exact selectors below required to override `.table-striped` and prevent\n// inheritance to nested tables.\n\n@each $color, $value in $theme-colors {\n @include table-row-variant($color, theme-color-level($color, -9));\n}\n\n@include table-row-variant(active, $table-active-bg);\n\n\n// Inverse styles\n//\n// Same table markup, but inverted color scheme: dark background and light text.\n\n.thead-inverse {\n th {\n color: $table-inverse-color;\n background-color: $table-inverse-bg;\n }\n}\n\n.thead-default {\n th {\n color: $table-head-color;\n background-color: $table-head-bg;\n }\n}\n\n.table-inverse {\n color: $table-inverse-color;\n background-color: $table-inverse-bg;\n\n th,\n td,\n thead th {\n border-color: $table-inverse-border-color;\n }\n\n &.table-bordered {\n border: 0;\n }\n\n &.table-striped {\n tbody tr:nth-of-type(odd) {\n background-color: $table-inverse-accent-bg;\n }\n }\n\n &.table-hover {\n tbody tr {\n @include hover {\n background-color: $table-inverse-hover-bg;\n }\n }\n }\n}\n\n\n// Responsive tables\n//\n// Add `.table-responsive` to `.table`s and we'll make them mobile friendly by\n// enabling horizontal scrolling. Only applies <768px. Everything above that\n// will display normally.\n\n.table-responsive {\n @include media-breakpoint-down(md) {\n display: block;\n width: 100%;\n overflow-x: auto;\n -ms-overflow-style: -ms-autohiding-scrollbar; // See https://github.com/twbs/bootstrap/pull/10057\n\n // Prevent double border on horizontal scroll due to use of `display: block;`\n &.table-bordered {\n border: 0;\n }\n }\n}\n","// Tables\n\n@mixin table-row-variant($state, $background) {\n // Exact selectors below required to override `.table-striped` and prevent\n // inheritance to nested tables.\n .table-#{$state} {\n &,\n > th,\n > td {\n background-color: $background;\n }\n }\n\n // Hover states for `.table-hover`\n // Note: this is not available for cells or rows within `thead` or `tfoot`.\n .table-hover {\n $hover-background: darken($background, 5%);\n\n .table-#{$state} {\n @include hover {\n background-color: $hover-background;\n\n > td,\n > th {\n background-color: $hover-background;\n }\n }\n }\n }\n}\n","// Bootstrap functions\n//\n// Utility mixins and functions for evalutating source code across our variables, maps, and mixins.\n\n// Ascending\n// Used to evaluate Sass maps like our grid breakpoints.\n@mixin _assert-ascending($map, $map-name) {\n $prev-key: null;\n $prev-num: null;\n @each $key, $num in $map {\n @if $prev-num == null {\n // Do nothing\n } @else if not comparable($prev-num, $num) {\n @warn \"Potentially invalid value for #{$map-name}: This map must be in ascending order, but key '#{$key}' has value #{$num} whose unit makes it incomparable to #{$prev-num}, the value of the previous key '#{$prev-key}' !\";\n } @else if $prev-num >= $num {\n @warn \"Invalid value for #{$map-name}: This map must be in ascending order, but key '#{$key}' has value #{$num} which isn't greater than #{$prev-num}, the value of the previous key '#{$prev-key}' !\";\n }\n $prev-key: $key;\n $prev-num: $num;\n }\n}\n\n// Starts at zero\n// Another grid mixin that ensures the min-width of the lowest breakpoint starts at 0.\n@mixin _assert-starts-at-zero($map) {\n $values: map-values($map);\n $first-value: nth($values, 1);\n @if $first-value != 0 {\n @warn \"First breakpoint in `$grid-breakpoints` must start at 0, but starts at #{$first-value}.\";\n }\n}\n\n// Replace `$search` with `$replace` in `$string`\n// Used on our SVG icon backgrounds for custom forms.\n//\n// @author Hugo Giraudel\n// @param {String} $string - Initial string\n// @param {String} $search - Substring to replace\n// @param {String} $replace ('') - New value\n// @return {String} - Updated string\n@function str-replace($string, $search, $replace: \"\") {\n $index: str-index($string, $search);\n\n @if $index {\n @return str-slice($string, 1, $index - 1) + $replace + str-replace(str-slice($string, $index + str-length($search)), $search, $replace);\n }\n\n @return $string;\n}\n\n// Color contrast\n@mixin color-yiq($color) {\n $r: red($color);\n $g: green($color);\n $b: blue($color);\n\n $yiq: (($r * 299) + ($g * 587) + ($b * 114)) / 1000;\n\n @if ($yiq >= 150) {\n color: #111;\n } @else {\n color: #fff;\n }\n}\n\n// Retreive color Sass maps\n@function color($key: \"blue\") {\n @return map-get($colors, $key);\n}\n\n@function theme-color($key: \"primary\") {\n @return map-get($theme-colors, $key);\n}\n\n@function grayscale($key: \"100\") {\n @return map-get($grays, $key);\n}\n\n// Request a theme color level\n@function theme-color-level($color-name: \"primary\", $level: 0) {\n $color: theme-color($color-name);\n $color-base: if($level > 0, #000, #fff);\n\n @if $level < 0 {\n // Lighter values need a quick double negative for the Sass math to work\n @return mix($color-base, $color, $level * -1 * $theme-color-interval);\n } @else {\n @return mix($color-base, $color, $level * $theme-color-interval);\n }\n}\n","// scss-lint:disable QualifyingElement, VendorPrefix\n\n//\n// Textual form controls\n//\n\n.form-control {\n display: block;\n width: 100%;\n // // Make inputs at least the height of their button counterpart (base line-height + padding + border)\n // height: $input-height;\n padding: $input-btn-padding-y $input-btn-padding-x;\n font-size: $font-size-base;\n line-height: $input-btn-line-height;\n color: $input-color;\n background-color: $input-bg;\n // Reset unusual Firefox-on-Android default style; see https://github.com/necolas/normalize.css/issues/214.\n background-image: none;\n background-clip: padding-box;\n border: $input-btn-border-width solid $input-border-color;\n\n // Note: This has no effect on `s in CSS.\n @if $enable-rounded {\n // Manually use the if/else instead of the mixin to account for iOS override\n border-radius: $input-border-radius;\n } @else {\n // Otherwise undo the iOS default\n border-radius: 0;\n }\n\n @include box-shadow($input-box-shadow);\n @include transition($input-transition);\n\n // Unstyle the caret on ` receives focus\n // in IE and (under certain conditions) Edge, as it looks bad and cannot be made to\n // match the appearance of the native widget.\n // See https://github.com/twbs/bootstrap/issues/19398.\n color: $input-color;\n background-color: $input-bg;\n }\n}\n\n// Make file inputs better match text inputs by forcing them to new lines.\n.form-control-file,\n.form-control-range {\n display: block;\n}\n\n\n//\n// Labels\n//\n\n// For use with horizontal and inline forms, when you need the label text to\n// align with the form controls.\n.col-form-label {\n padding-top: calc(#{$input-btn-padding-y} - #{$input-btn-border-width} * 2);\n padding-bottom: calc(#{$input-btn-padding-y} - #{$input-btn-border-width} * 2);\n margin-bottom: 0; // Override the `
    ', + trigger: 'hover focus', + offset: 0 +}; + +var Tooltip = function () { + /** + * Create a new Tooltip.js instance + * @class Tooltip + * @param {HTMLElement} reference - The DOM node used as reference of the tooltip (it can be a jQuery element). + * @param {Object} options + * @param {String} options.placement=bottom + * Placement of the popper accepted values: `top(-start, -end), right(-start, -end), bottom(-start, -end), + * left(-start, -end)` + * @param {HTMLElement|String|false} options.container=false - Append the tooltip to a specific element. + * @param {Number|Object} options.delay=0 + * Delay showing and hiding the tooltip (ms) - does not apply to manual trigger type. + * If a number is supplied, delay is applied to both hide/show. + * Object structure is: `{ show: 500, hide: 100 }` + * @param {Boolean} options.html=false - Insert HTML into the tooltip. If false, the content will inserted with `innerText`. + * @param {String|PlacementFunction} options.placement='top' - One of the allowed placements, or a function returning one of them. + * @param {String} [options.template=''] + * Base HTML to used when creating the tooltip. + * The tooltip's `title` will be injected into the `.tooltip-inner` or `.tooltip__inner`. + * `.tooltip-arrow` or `.tooltip__arrow` will become the tooltip's arrow. + * The outermost wrapper element should have the `.tooltip` class. + * @param {String|HTMLElement|TitleFunction} options.title='' - Default title value if `title` attribute isn't present. + * @param {String} [options.trigger='hover focus'] + * How tooltip is triggered - click, hover, focus, manual. + * You may pass multiple triggers; separate them with a space. `manual` cannot be combined with any other trigger. + * @param {HTMLElement} options.boundariesElement + * The element used as boundaries for the tooltip. For more information refer to Popper.js' + * [boundariesElement docs](https://popper.js.org/popper-documentation.html) + * @param {Number|String} options.offset=0 - Offset of the tooltip relative to its reference. For more information refer to Popper.js' + * [offset docs](https://popper.js.org/popper-documentation.html) + * @param {Object} options.popperOptions={} - Popper options, will be passed directly to popper instance. For more information refer to Popper.js' + * [options docs](https://popper.js.org/popper-documentation.html) + * @return {Object} instance - The generated tooltip instance + */ + function Tooltip(reference, options) { + classCallCheck(this, Tooltip); + + _initialiseProps.call(this); + + // apply user options over default ones + options = _extends({}, DEFAULT_OPTIONS, options); + + reference.jquery && (reference = reference[0]); + + // cache reference and options + this.reference = reference; + this.options = options; + + // get events list + var events = typeof options.trigger === 'string' ? options.trigger.split(' ').filter(function (trigger) { + return ['click', 'hover', 'focus'].indexOf(trigger) !== -1; + }) : []; + + // set initial state + this._isOpen = false; + + // set event listeners + this._setEventListeners(reference, events, options); + } + + // + // Public methods + // + + /** + * Reveals an element's tooltip. This is considered a "manual" triggering of the tooltip. + * Tooltips with zero-length titles are never displayed. + * @method Tooltip#show + * @memberof Tooltip + */ + + + /** + * Hides an element’s tooltip. This is considered a “manual” triggering of the tooltip. + * @method Tooltip#hide + * @memberof Tooltip + */ + + + /** + * Hides and destroys an element’s tooltip. + * @method Tooltip#dispose + * @memberof Tooltip + */ + + + /** + * Toggles an element’s tooltip. This is considered a “manual” triggering of the tooltip. + * @method Tooltip#toggle + * @memberof Tooltip + */ + + + // + // Defaults + // + + + // + // Private methods + // + + createClass(Tooltip, [{ + key: '_create', + + + /** + * Creates a new tooltip node + * @memberof Tooltip + * @private + * @param {HTMLElement} reference + * @param {String} template + * @param {String|HTMLElement|TitleFunction} title + * @param {Boolean} allowHtml + * @return {HTMLelement} tooltipNode + */ + value: function _create(reference, template, title, allowHtml) { + // create tooltip element + var tooltipGenerator = window.document.createElement('div'); + tooltipGenerator.innerHTML = template.trim(); + var tooltipNode = tooltipGenerator.childNodes[0]; + + // add unique ID to our tooltip (needed for accessibility reasons) + tooltipNode.id = 'tooltip_' + Math.random().toString(36).substr(2, 10); + + // set initial `aria-hidden` state to `false` (it's visible!) + tooltipNode.setAttribute('aria-hidden', 'false'); + + // add title to tooltip + var titleNode = tooltipGenerator.querySelector(this.innerSelector); + if (title.nodeType === 1) { + // if title is a node, append it only if allowHtml is true + allowHtml && titleNode.appendChild(title); + } else if (isFunction(title)) { + // if title is a function, call it and set innerText or innerHtml depending by `allowHtml` value + var titleText = title.call(reference); + allowHtml ? titleNode.innerHTML = titleText : titleNode.innerText = titleText; + } else { + // if it's just a simple text, set innerText or innerHtml depending by `allowHtml` value + allowHtml ? titleNode.innerHTML = title : titleNode.innerText = title; + } + + // return the generated tooltip node + return tooltipNode; + } + }, { + key: '_show', + value: function _show(reference, options) { + // don't show if it's already visible + if (this._isOpen) { + return this; + } + this._isOpen = true; + + // if the tooltipNode already exists, just show it + if (this._tooltipNode) { + this._tooltipNode.style.display = ''; + this._tooltipNode.setAttribute('aria-hidden', 'false'); + this.popperInstance.update(); + return this; + } + + // get title + var title = reference.getAttribute('title') || options.title; + + // don't show tooltip if no title is defined + if (!title) { + return this; + } + + // create tooltip node + var tooltipNode = this._create(reference, options.template, title, options.html); + + // Add `aria-describedby` to our reference element for accessibility reasons + reference.setAttribute('aria-describedby', tooltipNode.id); + + // append tooltip to container + var container = this._findContainer(options.container, reference); + + this._append(tooltipNode, container); + + var popperOptions = _extends({}, options.popperOptions, { + placement: options.placement + }); + + popperOptions.modifiers = _extends({}, popperOptions.modifiers, { + arrow: { + element: this.arrowSelector + } + }); + + if (options.boundariesElement) { + popperOptions.modifiers.preventOverflow = { + boundariesElement: options.boundariesElement + }; + } + + this.popperInstance = new Popper(reference, tooltipNode, popperOptions); + + this._tooltipNode = tooltipNode; + + return this; + } + }, { + key: '_hide', + value: function _hide() /*reference, options*/{ + // don't hide if it's already hidden + if (!this._isOpen) { + return this; + } + + this._isOpen = false; + + // hide tooltipNode + this._tooltipNode.style.display = 'none'; + this._tooltipNode.setAttribute('aria-hidden', 'true'); + + return this; + } + }, { + key: '_dispose', + value: function _dispose() { + var _this = this; + + if (this._tooltipNode) { + this._hide(); + + // destroy instance + this.popperInstance.destroy(); + + // remove event listeners + this._events.forEach(function (_ref) { + var func = _ref.func, + event = _ref.event; + + _this.reference.removeEventListener(event, func); + }); + this._events = []; + + // destroy tooltipNode + this._tooltipNode.parentNode.removeChild(this._tooltipNode); + this._tooltipNode = null; + } + return this; + } + }, { + key: '_findContainer', + value: function _findContainer(container, reference) { + // if container is a query, get the relative element + if (typeof container === 'string') { + container = window.document.querySelector(container); + } else if (container === false) { + // if container is `false`, set it to reference parent + container = reference.parentNode; + } + return container; + } + + /** + * Append tooltip to container + * @memberof Tooltip + * @private + * @param {HTMLElement} tooltip + * @param {HTMLElement|String|false} container + */ + + }, { + key: '_append', + value: function _append(tooltipNode, container) { + container.appendChild(tooltipNode); + } + }, { + key: '_setEventListeners', + value: function _setEventListeners(reference, events, options) { + var _this2 = this; + + var directEvents = []; + var oppositeEvents = []; + + events.forEach(function (event) { + switch (event) { + case 'hover': + directEvents.push('mouseenter'); + oppositeEvents.push('mouseleave'); + break; + case 'focus': + directEvents.push('focus'); + oppositeEvents.push('blur'); + break; + case 'click': + directEvents.push('click'); + oppositeEvents.push('click'); + break; + } + }); + + // schedule show tooltip + directEvents.forEach(function (event) { + var func = function func(evt) { + if (_this2._isOpen === true) { + return; + } + evt.usedByTooltip = true; + _this2._scheduleShow(reference, options.delay, options, evt); + }; + _this2._events.push({ event: event, func: func }); + reference.addEventListener(event, func); + }); + + // schedule hide tooltip + oppositeEvents.forEach(function (event) { + var func = function func(evt) { + if (evt.usedByTooltip === true) { + return; + } + _this2._scheduleHide(reference, options.delay, options, evt); + }; + _this2._events.push({ event: event, func: func }); + reference.addEventListener(event, func); + }); + } + }, { + key: '_scheduleShow', + value: function _scheduleShow(reference, delay, options /*, evt */) { + var _this3 = this; + + // defaults to 0 + var computedDelay = delay && delay.show || delay || 0; + window.setTimeout(function () { + return _this3._show(reference, options); + }, computedDelay); + } + }, { + key: '_scheduleHide', + value: function _scheduleHide(reference, delay, options, evt) { + var _this4 = this; + + // defaults to 0 + var computedDelay = delay && delay.hide || delay || 0; + window.setTimeout(function () { + if (_this4._isOpen === false) { + return; + } + if (!document.body.contains(_this4._tooltipNode)) { + return; + } + + // if we are hiding because of a mouseleave, we must check that the new + // reference isn't the tooltip, because in this case we don't want to hide it + if (evt.type === 'mouseleave') { + var isSet = _this4._setTooltipNodeEvent(evt, reference, delay, options); + + // if we set the new event, don't hide the tooltip yet + // the new event will take care to hide it if necessary + if (isSet) { + return; + } + } + + _this4._hide(reference, options); + }, computedDelay); + } + }]); + return Tooltip; +}(); + +/** + * Placement function, its context is the Tooltip instance. + * @memberof Tooltip + * @callback PlacementFunction + * @param {HTMLElement} tooltip - tooltip DOM node. + * @param {HTMLElement} reference - reference DOM node. + * @return {String} placement - One of the allowed placement options. + */ + +/** + * Title function, its context is the Tooltip instance. + * @memberof Tooltip + * @callback TitleFunction + * @return {String} placement - The desired title. + */ + + +var _initialiseProps = function _initialiseProps() { + var _this5 = this; + + this.show = function () { + return _this5._show(_this5.reference, _this5.options); + }; + + this.hide = function () { + return _this5._hide(); + }; + + this.dispose = function () { + return _this5._dispose(); + }; + + this.toggle = function () { + if (_this5._isOpen) { + return _this5.hide(); + } else { + return _this5.show(); + } + }; + + this.arrowSelector = '.tooltip-arrow, .tooltip__arrow'; + this.innerSelector = '.tooltip-inner, .tooltip__inner'; + this._events = []; + + this._setTooltipNodeEvent = function (evt, reference, delay, options) { + var relatedreference = evt.relatedreference || evt.toElement; + + var callback = function callback(evt2) { + var relatedreference2 = evt2.relatedreference || evt2.toElement; + + // Remove event listener after call + _this5._tooltipNode.removeEventListener(evt.type, callback); + + // If the new reference is not the reference element + if (!reference.contains(relatedreference2)) { + // Schedule to hide tooltip + _this5._scheduleHide(reference, options.delay, options, evt2); + } + }; + + if (_this5._tooltipNode.contains(relatedreference)) { + // listen to mouseleave on the tooltip element to be able to hide the tooltip + _this5._tooltipNode.addEventListener(evt.type, callback); + return true; + } + + return false; + }; +}; + +return Tooltip; + +}))); +//# sourceMappingURL=tooltip.js.map diff --git a/public/vendor/codemirror/codemirror.css b/public/vendor/codemirror/codemirror.css new file mode 100644 index 000000000..bc910fb9b --- /dev/null +++ b/public/vendor/codemirror/codemirror.css @@ -0,0 +1,349 @@ +/* BASICS */ + +.CodeMirror { + /* Set height, width, borders, and global font properties here */ + font-family: monospace; + height: 300px; + color: black; + direction: ltr; +} + +/* PADDING */ + +.CodeMirror-lines { + padding: 4px 0; /* Vertical padding around content */ +} +.CodeMirror pre.CodeMirror-line, +.CodeMirror pre.CodeMirror-line-like { + padding: 0 4px; /* Horizontal padding of content */ +} + +.CodeMirror-scrollbar-filler, .CodeMirror-gutter-filler { + background-color: white; /* The little square between H and V scrollbars */ +} + +/* GUTTER */ + +.CodeMirror-gutters { + border-right: 1px solid #ddd; + background-color: #f7f7f7; + white-space: nowrap; +} +.CodeMirror-linenumbers {} +.CodeMirror-linenumber { + padding: 0 3px 0 5px; + min-width: 20px; + text-align: right; + color: #999; + white-space: nowrap; +} + +.CodeMirror-guttermarker { color: black; } +.CodeMirror-guttermarker-subtle { color: #999; } + +/* CURSOR */ + +.CodeMirror-cursor { + border-left: 1px solid black; + border-right: none; + width: 0; +} +/* Shown when moving in bi-directional text */ +.CodeMirror div.CodeMirror-secondarycursor { + border-left: 1px solid silver; +} +.cm-fat-cursor .CodeMirror-cursor { + width: auto; + border: 0 !important; + background: #7e7; +} +.cm-fat-cursor div.CodeMirror-cursors { + z-index: 1; +} +.cm-fat-cursor-mark { + background-color: rgba(20, 255, 20, 0.5); + -webkit-animation: blink 1.06s steps(1) infinite; + -moz-animation: blink 1.06s steps(1) infinite; + animation: blink 1.06s steps(1) infinite; +} +.cm-animate-fat-cursor { + width: auto; + border: 0; + -webkit-animation: blink 1.06s steps(1) infinite; + -moz-animation: blink 1.06s steps(1) infinite; + animation: blink 1.06s steps(1) infinite; + background-color: #7e7; +} +@-moz-keyframes blink { + 0% {} + 50% { background-color: transparent; } + 100% {} +} +@-webkit-keyframes blink { + 0% {} + 50% { background-color: transparent; } + 100% {} +} +@keyframes blink { + 0% {} + 50% { background-color: transparent; } + 100% {} +} + +/* Can style cursor different in overwrite (non-insert) mode */ +.CodeMirror-overwrite .CodeMirror-cursor {} + +.cm-tab { display: inline-block; text-decoration: inherit; } + +.CodeMirror-rulers { + position: absolute; + left: 0; right: 0; top: -50px; bottom: 0; + overflow: hidden; +} +.CodeMirror-ruler { + border-left: 1px solid #ccc; + top: 0; bottom: 0; + position: absolute; +} + +/* DEFAULT THEME */ + +.cm-s-default .cm-header {color: blue;} +.cm-s-default .cm-quote {color: #090;} +.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-strikethrough {text-decoration: line-through;} + +.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, +.cm-s-default .cm-punctuation, +.cm-s-default .cm-property, +.cm-s-default .cm-operator {} +.cm-s-default .cm-variable-2 {color: #05a;} +.cm-s-default .cm-variable-3, .cm-s-default .cm-type {color: #085;} +.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-hr {color: #999;} +.cm-s-default .cm-link {color: #00c;} + +.cm-s-default .cm-error {color: #f00;} +.cm-invalidchar {color: #f00;} + +.CodeMirror-composing { border-bottom: 2px solid; } + +/* Default styles for common addons */ + +div.CodeMirror span.CodeMirror-matchingbracket {color: #0b0;} +div.CodeMirror span.CodeMirror-nonmatchingbracket {color: #a22;} +.CodeMirror-matchingtag { background: rgba(255, 150, 0, .3); } +.CodeMirror-activeline-background {background: #e8f2ff;} + +/* STOP */ + +/* The rest of this file contains styles related to the mechanics of + the editor. You probably shouldn't touch them. */ + +.CodeMirror { + position: relative; + overflow: hidden; + background: white; +} + +.CodeMirror-scroll { + overflow: scroll !important; /* Things will break if this is overridden */ + /* 30px is the magic margin used to hide the element's real scrollbars */ + /* See overflow: hidden in .CodeMirror */ + margin-bottom: -30px; margin-right: -30px; + padding-bottom: 30px; + height: 100%; + outline: none; /* Prevent dragging from highlighting the element */ + position: relative; +} +.CodeMirror-sizer { + position: relative; + border-right: 30px solid transparent; +} + +/* The fake, visible scrollbars. Used to force redraw during scrolling + before actual scrolling happens, thus preventing shaking and + flickering artifacts. */ +.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; + min-height: 100%; + z-index: 3; +} +.CodeMirror-gutter { + white-space: normal; + height: 100%; + display: inline-block; + vertical-align: top; + margin-bottom: -30px; +} +.CodeMirror-gutter-wrapper { + position: absolute; + z-index: 4; + background: none !important; + border: none !important; +} +.CodeMirror-gutter-background { + position: absolute; + top: 0; bottom: 0; + z-index: 4; +} +.CodeMirror-gutter-elt { + position: absolute; + cursor: default; + z-index: 4; +} +.CodeMirror-gutter-wrapper ::selection { background-color: transparent } +.CodeMirror-gutter-wrapper ::-moz-selection { background-color: transparent } + +.CodeMirror-lines { + cursor: text; + min-height: 1px; /* prevents collapsing before first draw */ +} +.CodeMirror pre.CodeMirror-line, +.CodeMirror pre.CodeMirror-line-like { + /* Reset some styles that the rest of the page might have set */ + -moz-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; + -webkit-tap-highlight-color: transparent; + -webkit-font-variant-ligatures: contextual; + font-variant-ligatures: contextual; +} +.CodeMirror-wrap pre.CodeMirror-line, +.CodeMirror-wrap pre.CodeMirror-line-like { + word-wrap: break-word; + white-space: pre-wrap; + word-break: normal; +} + +.CodeMirror-linebackground { + position: absolute; + left: 0; right: 0; top: 0; bottom: 0; + z-index: 0; +} + +.CodeMirror-linewidget { + position: relative; + z-index: 2; + padding: 0.1px; /* Force widget margins to stay inside of the container */ +} + +.CodeMirror-widget {} + +.CodeMirror-rtl pre { direction: rtl; } + +.CodeMirror-code { + outline: none; +} + +/* Force content-box sizing for the elements where we expect it */ +.CodeMirror-scroll, +.CodeMirror-sizer, +.CodeMirror-gutter, +.CodeMirror-gutters, +.CodeMirror-linenumber { + -moz-box-sizing: content-box; + box-sizing: content-box; +} + +.CodeMirror-measure { + position: absolute; + width: 100%; + height: 0; + overflow: hidden; + visibility: hidden; +} + +.CodeMirror-cursor { + position: absolute; + pointer-events: none; +} +.CodeMirror-measure pre { position: static; } + +div.CodeMirror-cursors { + visibility: hidden; + position: relative; + z-index: 3; +} +div.CodeMirror-dragcursors { + visibility: visible; +} + +.CodeMirror-focused div.CodeMirror-cursors { + visibility: visible; +} + +.CodeMirror-selected { background: #d9d9d9; } +.CodeMirror-focused .CodeMirror-selected { background: #d7d4f0; } +.CodeMirror-crosshair { cursor: crosshair; } +.CodeMirror-line::selection, .CodeMirror-line > span::selection, .CodeMirror-line > span > span::selection { background: #d7d4f0; } +.CodeMirror-line::-moz-selection, .CodeMirror-line > span::-moz-selection, .CodeMirror-line > span > span::-moz-selection { background: #d7d4f0; } + +.cm-searching { + background-color: #ffa; + background-color: rgba(255, 255, 0, .4); +} + +/* Used to force a border model for a node */ +.cm-force-border { padding-right: .1px; } + +@media print { + /* Hide the cursor when printing */ + .CodeMirror div.CodeMirror-cursors { + visibility: hidden; + } +} + +/* See issue #2901 */ +.cm-tab-wrap-hack:after { content: ''; } + +/* Help users use markselection to safely style text background */ +span.CodeMirror-selectedtext { background: none; } diff --git a/public/vendor/codemirror/codemirror.js b/public/vendor/codemirror/codemirror.js new file mode 100644 index 000000000..076a0b89e --- /dev/null +++ b/public/vendor/codemirror/codemirror.js @@ -0,0 +1,9765 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: https://codemirror.net/LICENSE + +// This is CodeMirror (https://codemirror.net), a code editor +// implemented in JavaScript on top of the browser's DOM. +// +// You can find some technical background for some of the code below +// at http://marijnhaverbeke.nl/blog/#cm-internals . + +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global.CodeMirror = factory()); +}(this, (function () { 'use strict'; + + // Kludges for bugs and behavior differences that can't be feature + // detected are enabled based on userAgent etc sniffing. + var userAgent = navigator.userAgent; + var platform = navigator.platform; + + var gecko = /gecko\/\d/i.test(userAgent); + var ie_upto10 = /MSIE \d/.test(userAgent); + var ie_11up = /Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(userAgent); + var edge = /Edge\/(\d+)/.exec(userAgent); + var ie = ie_upto10 || ie_11up || edge; + var ie_version = ie && (ie_upto10 ? document.documentMode || 6 : +(edge || ie_11up)[1]); + var webkit = !edge && /WebKit\//.test(userAgent); + var qtwebkit = webkit && /Qt\/\d+\.\d+/.test(userAgent); + var chrome = !edge && /Chrome\//.test(userAgent); + var presto = /Opera\//.test(userAgent); + var safari = /Apple Computer/.test(navigator.vendor); + var mac_geMountainLion = /Mac OS X 1\d\D([8-9]|\d\d)\D/.test(userAgent); + var phantom = /PhantomJS/.test(userAgent); + + var ios = !edge && /AppleWebKit/.test(userAgent) && /Mobile\/\w+/.test(userAgent); + var android = /Android/.test(userAgent); + // This is woefully incomplete. Suggestions for alternative methods welcome. + var mobile = ios || android || /webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(userAgent); + var mac = ios || /Mac/.test(platform); + var chromeOS = /\bCrOS\b/.test(userAgent); + var windows = /win/i.test(platform); + + var presto_version = presto && userAgent.match(/Version\/(\d*\.\d*)/); + if (presto_version) { presto_version = Number(presto_version[1]); } + if (presto_version && presto_version >= 15) { presto = false; webkit = true; } + // Some browsers use the wrong event properties to signal cmd/ctrl on OS X + var flipCtrlCmd = mac && (qtwebkit || presto && (presto_version == null || presto_version < 12.11)); + var captureRightClick = gecko || (ie && ie_version >= 9); + + function classTest(cls) { return new RegExp("(^|\\s)" + cls + "(?:$|\\s)\\s*") } + + var rmClass = function(node, cls) { + var current = node.className; + var match = classTest(cls).exec(current); + if (match) { + var after = current.slice(match.index + match[0].length); + node.className = current.slice(0, match.index) + (after ? match[1] + after : ""); + } + }; + + function removeChildren(e) { + for (var count = e.childNodes.length; count > 0; --count) + { e.removeChild(e.firstChild); } + return e + } + + function removeChildrenAndAdd(parent, e) { + return removeChildren(parent).appendChild(e) + } + + function elt(tag, content, className, style) { + var e = document.createElement(tag); + if (className) { e.className = className; } + if (style) { e.style.cssText = style; } + if (typeof content == "string") { e.appendChild(document.createTextNode(content)); } + else if (content) { for (var i = 0; i < content.length; ++i) { e.appendChild(content[i]); } } + return e + } + // wrapper for elt, which removes the elt from the accessibility tree + function eltP(tag, content, className, style) { + var e = elt(tag, content, className, style); + e.setAttribute("role", "presentation"); + return e + } + + var range; + if (document.createRange) { range = function(node, start, end, endNode) { + var r = document.createRange(); + r.setEnd(endNode || node, end); + r.setStart(node, start); + return r + }; } + else { range = function(node, start, end) { + var r = document.body.createTextRange(); + try { r.moveToElementText(node.parentNode); } + catch(e) { return r } + r.collapse(true); + r.moveEnd("character", end); + r.moveStart("character", start); + return r + }; } + + function contains(parent, child) { + if (child.nodeType == 3) // Android browser always returns false when child is a textnode + { child = child.parentNode; } + if (parent.contains) + { return parent.contains(child) } + do { + if (child.nodeType == 11) { child = child.host; } + if (child == parent) { return true } + } while (child = child.parentNode) + } + + function activeElt() { + // IE and Edge may throw an "Unspecified Error" when accessing document.activeElement. + // IE < 10 will throw when accessed while the page is loading or in an iframe. + // IE > 9 and Edge will throw when accessed in an iframe if document.body is unavailable. + var activeElement; + try { + activeElement = document.activeElement; + } catch(e) { + activeElement = document.body || null; + } + while (activeElement && activeElement.shadowRoot && activeElement.shadowRoot.activeElement) + { activeElement = activeElement.shadowRoot.activeElement; } + return activeElement + } + + function addClass(node, cls) { + var current = node.className; + if (!classTest(cls).test(current)) { node.className += (current ? " " : "") + cls; } + } + function joinClasses(a, b) { + var as = a.split(" "); + for (var i = 0; i < as.length; i++) + { if (as[i] && !classTest(as[i]).test(b)) { b += " " + as[i]; } } + return b + } + + var selectInput = function(node) { node.select(); }; + if (ios) // Mobile Safari apparently has a bug where select() is broken. + { selectInput = function(node) { node.selectionStart = 0; node.selectionEnd = node.value.length; }; } + else if (ie) // Suppress mysterious IE10 errors + { selectInput = function(node) { try { node.select(); } catch(_e) {} }; } + + function bind(f) { + var args = Array.prototype.slice.call(arguments, 1); + return function(){return f.apply(null, args)} + } + + function copyObj(obj, target, overwrite) { + if (!target) { target = {}; } + for (var prop in obj) + { if (obj.hasOwnProperty(prop) && (overwrite !== false || !target.hasOwnProperty(prop))) + { target[prop] = obj[prop]; } } + return target + } + + // Counts the column offset in a string, taking tabs into account. + // Used mostly to find indentation. + function countColumn(string, end, tabSize, startIndex, startValue) { + if (end == null) { + end = string.search(/[^\s\u00a0]/); + if (end == -1) { end = string.length; } + } + for (var i = startIndex || 0, n = startValue || 0;;) { + var nextTab = string.indexOf("\t", i); + if (nextTab < 0 || nextTab >= end) + { return n + (end - i) } + n += nextTab - i; + n += tabSize - (n % tabSize); + i = nextTab + 1; + } + } + + var Delayed = function() {this.id = null;}; + Delayed.prototype.set = function (ms, f) { + clearTimeout(this.id); + this.id = setTimeout(f, ms); + }; + + function indexOf(array, elt) { + for (var i = 0; i < array.length; ++i) + { if (array[i] == elt) { return i } } + return -1 + } + + // Number of pixels added to scroller and sizer to hide scrollbar + var scrollerGap = 30; + + // Returned or thrown by various protocols to signal 'I'm not + // handling this'. + var Pass = {toString: function(){return "CodeMirror.Pass"}}; + + // Reused option objects for setSelection & friends + var sel_dontScroll = {scroll: false}, sel_mouse = {origin: "*mouse"}, sel_move = {origin: "+move"}; + + // The inverse of countColumn -- find the offset that corresponds to + // a particular column. + function findColumn(string, goal, tabSize) { + for (var pos = 0, col = 0;;) { + var nextTab = string.indexOf("\t", pos); + if (nextTab == -1) { nextTab = string.length; } + var skipped = nextTab - pos; + if (nextTab == string.length || col + skipped >= goal) + { return pos + Math.min(skipped, goal - col) } + col += nextTab - pos; + col += tabSize - (col % tabSize); + pos = nextTab + 1; + if (col >= goal) { return pos } + } + } + + var spaceStrs = [""]; + function spaceStr(n) { + while (spaceStrs.length <= n) + { spaceStrs.push(lst(spaceStrs) + " "); } + return spaceStrs[n] + } + + function lst(arr) { return arr[arr.length-1] } + + function map(array, f) { + var out = []; + for (var i = 0; i < array.length; i++) { out[i] = f(array[i], i); } + return out + } + + function insertSorted(array, value, score) { + var pos = 0, priority = score(value); + while (pos < array.length && score(array[pos]) <= priority) { pos++; } + array.splice(pos, 0, value); + } + + function nothing() {} + + function createObj(base, props) { + var inst; + if (Object.create) { + inst = Object.create(base); + } else { + nothing.prototype = base; + inst = new nothing(); + } + if (props) { copyObj(props, inst); } + return inst + } + + var nonASCIISingleCaseWordChar = /[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/; + function isWordCharBasic(ch) { + return /\w/.test(ch) || ch > "\x80" && + (ch.toUpperCase() != ch.toLowerCase() || nonASCIISingleCaseWordChar.test(ch)) + } + function isWordChar(ch, helper) { + if (!helper) { return isWordCharBasic(ch) } + if (helper.source.indexOf("\\w") > -1 && isWordCharBasic(ch)) { return true } + return helper.test(ch) + } + + function isEmpty(obj) { + for (var n in obj) { if (obj.hasOwnProperty(n) && obj[n]) { return false } } + return true + } + + // Extending unicode characters. A series of a non-extending char + + // any number of extending chars is treated as a single unit as far + // as editing and measuring is concerned. This is not fully correct, + // since some scripts/fonts/browsers also treat other configurations + // of code points as a group. + var extendingChars = /[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/; + function isExtendingChar(ch) { return ch.charCodeAt(0) >= 768 && extendingChars.test(ch) } + + // Returns a number from the range [`0`; `str.length`] unless `pos` is outside that range. + function skipExtendingChars(str, pos, dir) { + while ((dir < 0 ? pos > 0 : pos < str.length) && isExtendingChar(str.charAt(pos))) { pos += dir; } + return pos + } + + // Returns the value from the range [`from`; `to`] that satisfies + // `pred` and is closest to `from`. Assumes that at least `to` + // satisfies `pred`. Supports `from` being greater than `to`. + function findFirst(pred, from, to) { + // At any point we are certain `to` satisfies `pred`, don't know + // whether `from` does. + var dir = from > to ? -1 : 1; + for (;;) { + if (from == to) { return from } + var midF = (from + to) / 2, mid = dir < 0 ? Math.ceil(midF) : Math.floor(midF); + if (mid == from) { return pred(mid) ? from : to } + if (pred(mid)) { to = mid; } + else { from = mid + dir; } + } + } + + // BIDI HELPERS + + function iterateBidiSections(order, from, to, f) { + if (!order) { return f(from, to, "ltr", 0) } + var found = false; + for (var i = 0; i < order.length; ++i) { + var part = order[i]; + if (part.from < to && part.to > from || from == to && part.to == from) { + f(Math.max(part.from, from), Math.min(part.to, to), part.level == 1 ? "rtl" : "ltr", i); + found = true; + } + } + if (!found) { f(from, to, "ltr"); } + } + + var bidiOther = null; + function getBidiPartAt(order, ch, sticky) { + var found; + bidiOther = null; + for (var i = 0; i < order.length; ++i) { + var cur = order[i]; + if (cur.from < ch && cur.to > ch) { return i } + if (cur.to == ch) { + if (cur.from != cur.to && sticky == "before") { found = i; } + else { bidiOther = i; } + } + if (cur.from == ch) { + if (cur.from != cur.to && sticky != "before") { found = i; } + else { bidiOther = i; } + } + } + return found != null ? found : bidiOther + } + + // Bidirectional ordering algorithm + // See http://unicode.org/reports/tr9/tr9-13.html for the algorithm + // that this (partially) implements. + + // One-char codes used for character types: + // L (L): Left-to-Right + // R (R): Right-to-Left + // r (AL): Right-to-Left Arabic + // 1 (EN): European Number + // + (ES): European Number Separator + // % (ET): European Number Terminator + // n (AN): Arabic Number + // , (CS): Common Number Separator + // m (NSM): Non-Spacing Mark + // b (BN): Boundary Neutral + // s (B): Paragraph Separator + // t (S): Segment Separator + // w (WS): Whitespace + // N (ON): Other Neutrals + + // Returns null if characters are ordered as they appear + // (left-to-right), or an array of sections ({from, to, level} + // objects) in the order in which they occur visually. + var bidiOrdering = (function() { + // Character types for codepoints 0 to 0xff + var lowTypes = "bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN"; + // Character types for codepoints 0x600 to 0x6f9 + var arabicTypes = "nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111"; + function charType(code) { + if (code <= 0xf7) { return lowTypes.charAt(code) } + else if (0x590 <= code && code <= 0x5f4) { return "R" } + else if (0x600 <= code && code <= 0x6f9) { return arabicTypes.charAt(code - 0x600) } + else if (0x6ee <= code && code <= 0x8ac) { return "r" } + else if (0x2000 <= code && code <= 0x200b) { return "w" } + else if (code == 0x200c) { return "b" } + else { return "L" } + } + + var bidiRE = /[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/; + var isNeutral = /[stwN]/, isStrong = /[LRr]/, countsAsLeft = /[Lb1n]/, countsAsNum = /[1n]/; + + function BidiSpan(level, from, to) { + this.level = level; + this.from = from; this.to = to; + } + + return function(str, direction) { + var outerType = direction == "ltr" ? "L" : "R"; + + if (str.length == 0 || direction == "ltr" && !bidiRE.test(str)) { return false } + var len = str.length, types = []; + for (var i = 0; i < len; ++i) + { types.push(charType(str.charCodeAt(i))); } + + // W1. Examine each non-spacing mark (NSM) in the level run, and + // change the type of the NSM to the type of the previous + // character. If the NSM is at the start of the level run, it will + // get the type of sor. + for (var i$1 = 0, prev = outerType; i$1 < len; ++i$1) { + var type = types[i$1]; + if (type == "m") { types[i$1] = prev; } + else { prev = type; } + } + + // W2. Search backwards from each instance of a European number + // until the first strong type (R, L, AL, or sor) is found. If an + // AL is found, change the type of the European number to Arabic + // number. + // W3. Change all ALs to R. + for (var i$2 = 0, cur = outerType; i$2 < len; ++i$2) { + var type$1 = types[i$2]; + if (type$1 == "1" && cur == "r") { types[i$2] = "n"; } + else if (isStrong.test(type$1)) { cur = type$1; if (type$1 == "r") { types[i$2] = "R"; } } + } + + // W4. A single European separator between two European numbers + // changes to a European number. A single common separator between + // two numbers of the same type changes to that type. + for (var i$3 = 1, prev$1 = types[0]; i$3 < len - 1; ++i$3) { + var type$2 = types[i$3]; + if (type$2 == "+" && prev$1 == "1" && types[i$3+1] == "1") { types[i$3] = "1"; } + else if (type$2 == "," && prev$1 == types[i$3+1] && + (prev$1 == "1" || prev$1 == "n")) { types[i$3] = prev$1; } + prev$1 = type$2; + } + + // W5. A sequence of European terminators adjacent to European + // numbers changes to all European numbers. + // W6. Otherwise, separators and terminators change to Other + // Neutral. + for (var i$4 = 0; i$4 < len; ++i$4) { + var type$3 = types[i$4]; + if (type$3 == ",") { types[i$4] = "N"; } + else if (type$3 == "%") { + var end = (void 0); + for (end = i$4 + 1; end < len && types[end] == "%"; ++end) {} + var replace = (i$4 && types[i$4-1] == "!") || (end < len && types[end] == "1") ? "1" : "N"; + for (var j = i$4; j < end; ++j) { types[j] = replace; } + i$4 = end - 1; + } + } + + // W7. Search backwards from each instance of a European number + // until the first strong type (R, L, or sor) is found. If an L is + // found, then change the type of the European number to L. + for (var i$5 = 0, cur$1 = outerType; i$5 < len; ++i$5) { + var type$4 = types[i$5]; + if (cur$1 == "L" && type$4 == "1") { types[i$5] = "L"; } + else if (isStrong.test(type$4)) { cur$1 = type$4; } + } + + // N1. A sequence of neutrals takes the direction of the + // surrounding strong text if the text on both sides has the same + // direction. European and Arabic numbers act as if they were R in + // terms of their influence on neutrals. Start-of-level-run (sor) + // and end-of-level-run (eor) are used at level run boundaries. + // N2. Any remaining neutrals take the embedding direction. + for (var i$6 = 0; i$6 < len; ++i$6) { + if (isNeutral.test(types[i$6])) { + var end$1 = (void 0); + for (end$1 = i$6 + 1; end$1 < len && isNeutral.test(types[end$1]); ++end$1) {} + var before = (i$6 ? types[i$6-1] : outerType) == "L"; + var after = (end$1 < len ? types[end$1] : outerType) == "L"; + var replace$1 = before == after ? (before ? "L" : "R") : outerType; + for (var j$1 = i$6; j$1 < end$1; ++j$1) { types[j$1] = replace$1; } + i$6 = end$1 - 1; + } + } + + // Here we depart from the documented algorithm, in order to avoid + // building up an actual levels array. Since there are only three + // levels (0, 1, 2) in an implementation that doesn't take + // explicit embedding into account, we can build up the order on + // the fly, without following the level-based algorithm. + var order = [], m; + for (var i$7 = 0; i$7 < len;) { + if (countsAsLeft.test(types[i$7])) { + var start = i$7; + for (++i$7; i$7 < len && countsAsLeft.test(types[i$7]); ++i$7) {} + order.push(new BidiSpan(0, start, i$7)); + } else { + var pos = i$7, at = order.length; + for (++i$7; i$7 < len && types[i$7] != "L"; ++i$7) {} + for (var j$2 = pos; j$2 < i$7;) { + if (countsAsNum.test(types[j$2])) { + if (pos < j$2) { order.splice(at, 0, new BidiSpan(1, pos, j$2)); } + var nstart = j$2; + for (++j$2; j$2 < i$7 && countsAsNum.test(types[j$2]); ++j$2) {} + order.splice(at, 0, new BidiSpan(2, nstart, j$2)); + pos = j$2; + } else { ++j$2; } + } + if (pos < i$7) { order.splice(at, 0, new BidiSpan(1, pos, i$7)); } + } + } + if (direction == "ltr") { + if (order[0].level == 1 && (m = str.match(/^\s+/))) { + order[0].from = m[0].length; + order.unshift(new BidiSpan(0, 0, m[0].length)); + } + if (lst(order).level == 1 && (m = str.match(/\s+$/))) { + lst(order).to -= m[0].length; + order.push(new BidiSpan(0, len - m[0].length, len)); + } + } + + return direction == "rtl" ? order.reverse() : order + } + })(); + + // Get the bidi ordering for the given line (and cache it). Returns + // false for lines that are fully left-to-right, and an array of + // BidiSpan objects otherwise. + function getOrder(line, direction) { + var order = line.order; + if (order == null) { order = line.order = bidiOrdering(line.text, direction); } + return order + } + + // EVENT HANDLING + + // Lightweight event framework. on/off also work on DOM nodes, + // registering native DOM handlers. + + var noHandlers = []; + + var on = function(emitter, type, f) { + if (emitter.addEventListener) { + emitter.addEventListener(type, f, false); + } else if (emitter.attachEvent) { + emitter.attachEvent("on" + type, f); + } else { + var map$$1 = emitter._handlers || (emitter._handlers = {}); + map$$1[type] = (map$$1[type] || noHandlers).concat(f); + } + }; + + function getHandlers(emitter, type) { + return emitter._handlers && emitter._handlers[type] || noHandlers + } + + function off(emitter, type, f) { + if (emitter.removeEventListener) { + emitter.removeEventListener(type, f, false); + } else if (emitter.detachEvent) { + emitter.detachEvent("on" + type, f); + } else { + var map$$1 = emitter._handlers, arr = map$$1 && map$$1[type]; + if (arr) { + var index = indexOf(arr, f); + if (index > -1) + { map$$1[type] = arr.slice(0, index).concat(arr.slice(index + 1)); } + } + } + } + + function signal(emitter, type /*, values...*/) { + var handlers = getHandlers(emitter, type); + if (!handlers.length) { return } + var args = Array.prototype.slice.call(arguments, 2); + for (var i = 0; i < handlers.length; ++i) { handlers[i].apply(null, args); } + } + + // The DOM events that CodeMirror handles can be overridden by + // registering a (non-DOM) handler on the editor for the event name, + // and preventDefault-ing the event in that handler. + function signalDOMEvent(cm, e, override) { + if (typeof e == "string") + { e = {type: e, preventDefault: function() { this.defaultPrevented = true; }}; } + signal(cm, override || e.type, cm, e); + return e_defaultPrevented(e) || e.codemirrorIgnore + } + + function signalCursorActivity(cm) { + var arr = cm._handlers && cm._handlers.cursorActivity; + if (!arr) { return } + var set = cm.curOp.cursorActivityHandlers || (cm.curOp.cursorActivityHandlers = []); + for (var i = 0; i < arr.length; ++i) { if (indexOf(set, arr[i]) == -1) + { set.push(arr[i]); } } + } + + function hasHandler(emitter, type) { + return getHandlers(emitter, type).length > 0 + } + + // Add on and off methods to a constructor's prototype, to make + // registering events on such objects more convenient. + function eventMixin(ctor) { + ctor.prototype.on = function(type, f) {on(this, type, f);}; + ctor.prototype.off = function(type, f) {off(this, type, f);}; + } + + // Due to the fact that we still support jurassic IE versions, some + // compatibility wrappers are needed. + + function e_preventDefault(e) { + if (e.preventDefault) { e.preventDefault(); } + else { e.returnValue = false; } + } + function e_stopPropagation(e) { + if (e.stopPropagation) { e.stopPropagation(); } + else { e.cancelBubble = true; } + } + function e_defaultPrevented(e) { + return e.defaultPrevented != null ? e.defaultPrevented : e.returnValue == false + } + function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);} + + function e_target(e) {return e.target || e.srcElement} + function e_button(e) { + var b = e.which; + if (b == null) { + if (e.button & 1) { b = 1; } + else if (e.button & 2) { b = 3; } + else if (e.button & 4) { b = 2; } + } + if (mac && e.ctrlKey && b == 1) { b = 3; } + return b + } + + // Detect drag-and-drop + var dragAndDrop = function() { + // There is *some* kind of drag-and-drop support in IE6-8, but I + // couldn't get it to work yet. + if (ie && ie_version < 9) { return false } + var div = elt('div'); + return "draggable" in div || "dragDrop" in div + }(); + + var zwspSupported; + function zeroWidthElement(measure) { + if (zwspSupported == null) { + var test = elt("span", "\u200b"); + removeChildrenAndAdd(measure, elt("span", [test, document.createTextNode("x")])); + if (measure.firstChild.offsetHeight != 0) + { zwspSupported = test.offsetWidth <= 1 && test.offsetHeight > 2 && !(ie && ie_version < 8); } + } + var node = zwspSupported ? elt("span", "\u200b") : + elt("span", "\u00a0", null, "display: inline-block; width: 1px; margin-right: -1px"); + node.setAttribute("cm-text", ""); + return node + } + + // Feature-detect IE's crummy client rect reporting for bidi text + var badBidiRects; + function hasBadBidiRects(measure) { + if (badBidiRects != null) { return badBidiRects } + var txt = removeChildrenAndAdd(measure, document.createTextNode("A\u062eA")); + var r0 = range(txt, 0, 1).getBoundingClientRect(); + var r1 = range(txt, 1, 2).getBoundingClientRect(); + removeChildren(measure); + if (!r0 || r0.left == r0.right) { return false } // Safari returns null in some cases (#2780) + return badBidiRects = (r1.right - r0.right < 3) + } + + // See if "".split is the broken IE version, if so, provide an + // alternative way to split lines. + var splitLinesAuto = "\n\nb".split(/\n/).length != 3 ? function (string) { + var pos = 0, result = [], l = string.length; + while (pos <= l) { + var nl = string.indexOf("\n", pos); + if (nl == -1) { nl = string.length; } + var line = string.slice(pos, string.charAt(nl - 1) == "\r" ? nl - 1 : nl); + var rt = line.indexOf("\r"); + if (rt != -1) { + result.push(line.slice(0, rt)); + pos += rt + 1; + } else { + result.push(line); + pos = nl + 1; + } + } + return result + } : function (string) { return string.split(/\r\n?|\n/); }; + + var hasSelection = window.getSelection ? function (te) { + try { return te.selectionStart != te.selectionEnd } + catch(e) { return false } + } : function (te) { + var range$$1; + try {range$$1 = te.ownerDocument.selection.createRange();} + catch(e) {} + if (!range$$1 || range$$1.parentElement() != te) { return false } + return range$$1.compareEndPoints("StartToEnd", range$$1) != 0 + }; + + var hasCopyEvent = (function () { + var e = elt("div"); + if ("oncopy" in e) { return true } + e.setAttribute("oncopy", "return;"); + return typeof e.oncopy == "function" + })(); + + var badZoomedRects = null; + function hasBadZoomedRects(measure) { + if (badZoomedRects != null) { return badZoomedRects } + var node = removeChildrenAndAdd(measure, elt("span", "x")); + var normal = node.getBoundingClientRect(); + var fromRange = range(node, 0, 1).getBoundingClientRect(); + return badZoomedRects = Math.abs(normal.left - fromRange.left) > 1 + } + + // Known modes, by name and by MIME + var modes = {}, mimeModes = {}; + + // Extra arguments are stored as the mode's dependencies, which is + // used by (legacy) mechanisms like loadmode.js to automatically + // load a mode. (Preferred mechanism is the require/define calls.) + function defineMode(name, mode) { + if (arguments.length > 2) + { mode.dependencies = Array.prototype.slice.call(arguments, 2); } + modes[name] = mode; + } + + function defineMIME(mime, spec) { + mimeModes[mime] = spec; + } + + // Given a MIME type, a {name, ...options} config object, or a name + // string, return a mode config object. + function resolveMode(spec) { + if (typeof spec == "string" && mimeModes.hasOwnProperty(spec)) { + spec = mimeModes[spec]; + } else if (spec && typeof spec.name == "string" && mimeModes.hasOwnProperty(spec.name)) { + var found = mimeModes[spec.name]; + if (typeof found == "string") { found = {name: found}; } + spec = createObj(found, spec); + spec.name = found.name; + } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+xml$/.test(spec)) { + return resolveMode("application/xml") + } else if (typeof spec == "string" && /^[\w\-]+\/[\w\-]+\+json$/.test(spec)) { + return resolveMode("application/json") + } + if (typeof spec == "string") { return {name: spec} } + else { return spec || {name: "null"} } + } + + // Given a mode spec (anything that resolveMode accepts), find and + // initialize an actual mode object. + function getMode(options, spec) { + spec = resolveMode(spec); + var mfactory = modes[spec.name]; + if (!mfactory) { return getMode(options, "text/plain") } + var modeObj = mfactory(options, spec); + if (modeExtensions.hasOwnProperty(spec.name)) { + var exts = modeExtensions[spec.name]; + for (var prop in exts) { + if (!exts.hasOwnProperty(prop)) { continue } + if (modeObj.hasOwnProperty(prop)) { modeObj["_" + prop] = modeObj[prop]; } + modeObj[prop] = exts[prop]; + } + } + modeObj.name = spec.name; + if (spec.helperType) { modeObj.helperType = spec.helperType; } + if (spec.modeProps) { for (var prop$1 in spec.modeProps) + { modeObj[prop$1] = spec.modeProps[prop$1]; } } + + return modeObj + } + + // This can be used to attach properties to mode objects from + // outside the actual mode definition. + var modeExtensions = {}; + function extendMode(mode, properties) { + var exts = modeExtensions.hasOwnProperty(mode) ? modeExtensions[mode] : (modeExtensions[mode] = {}); + copyObj(properties, exts); + } + + function copyState(mode, state) { + if (state === true) { return state } + if (mode.copyState) { return mode.copyState(state) } + var nstate = {}; + for (var n in state) { + var val = state[n]; + if (val instanceof Array) { val = val.concat([]); } + nstate[n] = val; + } + return nstate + } + + // Given a mode and a state (for that mode), find the inner mode and + // state at the position that the state refers to. + function innerMode(mode, state) { + var info; + while (mode.innerMode) { + info = mode.innerMode(state); + if (!info || info.mode == mode) { break } + state = info.state; + mode = info.mode; + } + return info || {mode: mode, state: state} + } + + function startState(mode, a1, a2) { + return mode.startState ? mode.startState(a1, a2) : true + } + + // STRING STREAM + + // Fed to the mode parsers, provides helper functions to make + // parsers more succinct. + + var StringStream = function(string, tabSize, lineOracle) { + this.pos = this.start = 0; + this.string = string; + this.tabSize = tabSize || 8; + this.lastColumnPos = this.lastColumnValue = 0; + this.lineStart = 0; + this.lineOracle = lineOracle; + }; + + StringStream.prototype.eol = function () {return this.pos >= this.string.length}; + StringStream.prototype.sol = function () {return this.pos == this.lineStart}; + StringStream.prototype.peek = function () {return this.string.charAt(this.pos) || undefined}; + StringStream.prototype.next = function () { + if (this.pos < this.string.length) + { return this.string.charAt(this.pos++) } + }; + StringStream.prototype.eat = function (match) { + var ch = this.string.charAt(this.pos); + var ok; + if (typeof match == "string") { ok = ch == match; } + else { ok = ch && (match.test ? match.test(ch) : match(ch)); } + if (ok) {++this.pos; return ch} + }; + StringStream.prototype.eatWhile = function (match) { + var start = this.pos; + while (this.eat(match)){} + return this.pos > start + }; + StringStream.prototype.eatSpace = function () { + var this$1 = this; + + var start = this.pos; + while (/[\s\u00a0]/.test(this.string.charAt(this.pos))) { ++this$1.pos; } + return this.pos > start + }; + StringStream.prototype.skipToEnd = function () {this.pos = this.string.length;}; + StringStream.prototype.skipTo = function (ch) { + var found = this.string.indexOf(ch, this.pos); + if (found > -1) {this.pos = found; return true} + }; + StringStream.prototype.backUp = function (n) {this.pos -= n;}; + StringStream.prototype.column = function () { + if (this.lastColumnPos < this.start) { + this.lastColumnValue = countColumn(this.string, this.start, this.tabSize, this.lastColumnPos, this.lastColumnValue); + this.lastColumnPos = this.start; + } + return this.lastColumnValue - (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0) + }; + StringStream.prototype.indentation = function () { + return countColumn(this.string, null, this.tabSize) - + (this.lineStart ? countColumn(this.string, this.lineStart, this.tabSize) : 0) + }; + StringStream.prototype.match = function (pattern, consume, caseInsensitive) { + if (typeof pattern == "string") { + var cased = function (str) { return caseInsensitive ? str.toLowerCase() : str; }; + var substr = this.string.substr(this.pos, pattern.length); + if (cased(substr) == cased(pattern)) { + if (consume !== false) { this.pos += pattern.length; } + return true + } + } else { + var match = this.string.slice(this.pos).match(pattern); + if (match && match.index > 0) { return null } + if (match && consume !== false) { this.pos += match[0].length; } + return match + } + }; + StringStream.prototype.current = function (){return this.string.slice(this.start, this.pos)}; + StringStream.prototype.hideFirstChars = function (n, inner) { + this.lineStart += n; + try { return inner() } + finally { this.lineStart -= n; } + }; + StringStream.prototype.lookAhead = function (n) { + var oracle = this.lineOracle; + return oracle && oracle.lookAhead(n) + }; + StringStream.prototype.baseToken = function () { + var oracle = this.lineOracle; + return oracle && oracle.baseToken(this.pos) + }; + + // Find the line object corresponding to the given line number. + function getLine(doc, n) { + n -= doc.first; + if (n < 0 || n >= doc.size) { throw new Error("There is no line " + (n + doc.first) + " in the document.") } + var chunk = doc; + while (!chunk.lines) { + for (var i = 0;; ++i) { + var child = chunk.children[i], sz = child.chunkSize(); + if (n < sz) { chunk = child; break } + n -= sz; + } + } + return chunk.lines[n] + } + + // Get the part of a document between two positions, as an array of + // strings. + function getBetween(doc, start, end) { + var out = [], n = start.line; + doc.iter(start.line, end.line + 1, function (line) { + var text = line.text; + if (n == end.line) { text = text.slice(0, end.ch); } + if (n == start.line) { text = text.slice(start.ch); } + out.push(text); + ++n; + }); + return out + } + // Get the lines between from and to, as array of strings. + function getLines(doc, from, to) { + var out = []; + doc.iter(from, to, function (line) { out.push(line.text); }); // iter aborts when callback returns truthy value + return out + } + + // Update the height of a line, propagating the height change + // upwards to parent nodes. + function updateLineHeight(line, height) { + var diff = height - line.height; + if (diff) { for (var n = line; n; n = n.parent) { n.height += diff; } } + } + + // Given a line object, find its line number by walking up through + // its parent links. + function lineNo(line) { + if (line.parent == null) { return null } + var cur = line.parent, no = indexOf(cur.lines, line); + for (var chunk = cur.parent; chunk; cur = chunk, chunk = chunk.parent) { + for (var i = 0;; ++i) { + if (chunk.children[i] == cur) { break } + no += chunk.children[i].chunkSize(); + } + } + return no + cur.first + } + + // Find the line at the given vertical position, using the height + // information in the document tree. + function lineAtHeight(chunk, h) { + var n = chunk.first; + outer: do { + for (var i$1 = 0; i$1 < chunk.children.length; ++i$1) { + var child = chunk.children[i$1], ch = child.height; + if (h < ch) { chunk = child; continue outer } + h -= ch; + n += child.chunkSize(); + } + return n + } while (!chunk.lines) + var i = 0; + for (; i < chunk.lines.length; ++i) { + var line = chunk.lines[i], lh = line.height; + if (h < lh) { break } + h -= lh; + } + return n + i + } + + function isLine(doc, l) {return l >= doc.first && l < doc.first + doc.size} + + function lineNumberFor(options, i) { + return String(options.lineNumberFormatter(i + options.firstLineNumber)) + } + + // A Pos instance represents a position within the text. + function Pos(line, ch, sticky) { + if ( sticky === void 0 ) sticky = null; + + if (!(this instanceof Pos)) { return new Pos(line, ch, sticky) } + this.line = line; + this.ch = ch; + this.sticky = sticky; + } + + // Compare two positions, return 0 if they are the same, a negative + // number when a is less, and a positive number otherwise. + function cmp(a, b) { return a.line - b.line || a.ch - b.ch } + + function equalCursorPos(a, b) { return a.sticky == b.sticky && cmp(a, b) == 0 } + + function copyPos(x) {return Pos(x.line, x.ch)} + function maxPos(a, b) { return cmp(a, b) < 0 ? b : a } + function minPos(a, b) { return cmp(a, b) < 0 ? a : b } + + // Most of the external API clips given positions to make sure they + // actually exist within the document. + function clipLine(doc, n) {return Math.max(doc.first, Math.min(n, doc.first + doc.size - 1))} + function clipPos(doc, pos) { + if (pos.line < doc.first) { return Pos(doc.first, 0) } + var last = doc.first + doc.size - 1; + if (pos.line > last) { return Pos(last, getLine(doc, last).text.length) } + return clipToLen(pos, getLine(doc, pos.line).text.length) + } + function clipToLen(pos, linelen) { + var ch = pos.ch; + if (ch == null || ch > linelen) { return Pos(pos.line, linelen) } + else if (ch < 0) { return Pos(pos.line, 0) } + else { return pos } + } + function clipPosArray(doc, array) { + var out = []; + for (var i = 0; i < array.length; i++) { out[i] = clipPos(doc, array[i]); } + return out + } + + var SavedContext = function(state, lookAhead) { + this.state = state; + this.lookAhead = lookAhead; + }; + + var Context = function(doc, state, line, lookAhead) { + this.state = state; + this.doc = doc; + this.line = line; + this.maxLookAhead = lookAhead || 0; + this.baseTokens = null; + this.baseTokenPos = 1; + }; + + Context.prototype.lookAhead = function (n) { + var line = this.doc.getLine(this.line + n); + if (line != null && n > this.maxLookAhead) { this.maxLookAhead = n; } + return line + }; + + Context.prototype.baseToken = function (n) { + var this$1 = this; + + if (!this.baseTokens) { return null } + while (this.baseTokens[this.baseTokenPos] <= n) + { this$1.baseTokenPos += 2; } + var type = this.baseTokens[this.baseTokenPos + 1]; + return {type: type && type.replace(/( |^)overlay .*/, ""), + size: this.baseTokens[this.baseTokenPos] - n} + }; + + Context.prototype.nextLine = function () { + this.line++; + if (this.maxLookAhead > 0) { this.maxLookAhead--; } + }; + + Context.fromSaved = function (doc, saved, line) { + if (saved instanceof SavedContext) + { return new Context(doc, copyState(doc.mode, saved.state), line, saved.lookAhead) } + else + { return new Context(doc, copyState(doc.mode, saved), line) } + }; + + Context.prototype.save = function (copy) { + var state = copy !== false ? copyState(this.doc.mode, this.state) : this.state; + return this.maxLookAhead > 0 ? new SavedContext(state, this.maxLookAhead) : state + }; + + + // Compute a style array (an array starting with a mode generation + // -- for invalidation -- followed by pairs of end positions and + // style strings), which is used to highlight the tokens on the + // line. + function highlightLine(cm, line, context, forceToEnd) { + // A styles array always starts with a number identifying the + // mode/overlays that it is based on (for easy invalidation). + var st = [cm.state.modeGen], lineClasses = {}; + // Compute the base array of styles + runMode(cm, line.text, cm.doc.mode, context, function (end, style) { return st.push(end, style); }, + lineClasses, forceToEnd); + var state = context.state; + + // Run overlays, adjust style array. + var loop = function ( o ) { + context.baseTokens = st; + var overlay = cm.state.overlays[o], i = 1, at = 0; + context.state = true; + runMode(cm, line.text, overlay.mode, context, function (end, style) { + var start = i; + // Ensure there's a token end at the current position, and that i points at it + while (at < end) { + var i_end = st[i]; + if (i_end > end) + { st.splice(i, 1, end, st[i+1], i_end); } + i += 2; + at = Math.min(end, i_end); + } + if (!style) { return } + if (overlay.opaque) { + st.splice(start, i - start, end, "overlay " + style); + i = start + 2; + } else { + for (; start < i; start += 2) { + var cur = st[start+1]; + st[start+1] = (cur ? cur + " " : "") + "overlay " + style; + } + } + }, lineClasses); + context.state = state; + context.baseTokens = null; + context.baseTokenPos = 1; + }; + + for (var o = 0; o < cm.state.overlays.length; ++o) loop( o ); + + return {styles: st, classes: lineClasses.bgClass || lineClasses.textClass ? lineClasses : null} + } + + function getLineStyles(cm, line, updateFrontier) { + if (!line.styles || line.styles[0] != cm.state.modeGen) { + var context = getContextBefore(cm, lineNo(line)); + var resetState = line.text.length > cm.options.maxHighlightLength && copyState(cm.doc.mode, context.state); + var result = highlightLine(cm, line, context); + if (resetState) { context.state = resetState; } + line.stateAfter = context.save(!resetState); + line.styles = result.styles; + if (result.classes) { line.styleClasses = result.classes; } + else if (line.styleClasses) { line.styleClasses = null; } + if (updateFrontier === cm.doc.highlightFrontier) + { cm.doc.modeFrontier = Math.max(cm.doc.modeFrontier, ++cm.doc.highlightFrontier); } + } + return line.styles + } + + function getContextBefore(cm, n, precise) { + var doc = cm.doc, display = cm.display; + if (!doc.mode.startState) { return new Context(doc, true, n) } + var start = findStartLine(cm, n, precise); + var saved = start > doc.first && getLine(doc, start - 1).stateAfter; + var context = saved ? Context.fromSaved(doc, saved, start) : new Context(doc, startState(doc.mode), start); + + doc.iter(start, n, function (line) { + processLine(cm, line.text, context); + var pos = context.line; + line.stateAfter = pos == n - 1 || pos % 5 == 0 || pos >= display.viewFrom && pos < display.viewTo ? context.save() : null; + context.nextLine(); + }); + if (precise) { doc.modeFrontier = context.line; } + return context + } + + // Lightweight form of highlight -- proceed over this line and + // update state, but don't save a style array. Used for lines that + // aren't currently visible. + function processLine(cm, text, context, startAt) { + var mode = cm.doc.mode; + var stream = new StringStream(text, cm.options.tabSize, context); + stream.start = stream.pos = startAt || 0; + if (text == "") { callBlankLine(mode, context.state); } + while (!stream.eol()) { + readToken(mode, stream, context.state); + stream.start = stream.pos; + } + } + + function callBlankLine(mode, state) { + if (mode.blankLine) { return mode.blankLine(state) } + if (!mode.innerMode) { return } + var inner = innerMode(mode, state); + if (inner.mode.blankLine) { return inner.mode.blankLine(inner.state) } + } + + function readToken(mode, stream, state, inner) { + for (var i = 0; i < 10; i++) { + if (inner) { inner[0] = innerMode(mode, state).mode; } + var style = mode.token(stream, state); + if (stream.pos > stream.start) { return style } + } + throw new Error("Mode " + mode.name + " failed to advance stream.") + } + + var Token = function(stream, type, state) { + this.start = stream.start; this.end = stream.pos; + this.string = stream.current(); + this.type = type || null; + this.state = state; + }; + + // Utility for getTokenAt and getLineTokens + function takeToken(cm, pos, precise, asArray) { + var doc = cm.doc, mode = doc.mode, style; + pos = clipPos(doc, pos); + var line = getLine(doc, pos.line), context = getContextBefore(cm, pos.line, precise); + var stream = new StringStream(line.text, cm.options.tabSize, context), tokens; + if (asArray) { tokens = []; } + while ((asArray || stream.pos < pos.ch) && !stream.eol()) { + stream.start = stream.pos; + style = readToken(mode, stream, context.state); + if (asArray) { tokens.push(new Token(stream, style, copyState(doc.mode, context.state))); } + } + return asArray ? tokens : new Token(stream, style, context.state) + } + + function extractLineClasses(type, output) { + if (type) { for (;;) { + var lineClass = type.match(/(?:^|\s+)line-(background-)?(\S+)/); + if (!lineClass) { break } + type = type.slice(0, lineClass.index) + type.slice(lineClass.index + lineClass[0].length); + var prop = lineClass[1] ? "bgClass" : "textClass"; + if (output[prop] == null) + { output[prop] = lineClass[2]; } + else if (!(new RegExp("(?:^|\s)" + lineClass[2] + "(?:$|\s)")).test(output[prop])) + { output[prop] += " " + lineClass[2]; } + } } + return type + } + + // Run the given mode's parser over a line, calling f for each token. + function runMode(cm, text, mode, context, f, lineClasses, forceToEnd) { + var flattenSpans = mode.flattenSpans; + if (flattenSpans == null) { flattenSpans = cm.options.flattenSpans; } + var curStart = 0, curStyle = null; + var stream = new StringStream(text, cm.options.tabSize, context), style; + var inner = cm.options.addModeClass && [null]; + if (text == "") { extractLineClasses(callBlankLine(mode, context.state), lineClasses); } + while (!stream.eol()) { + if (stream.pos > cm.options.maxHighlightLength) { + flattenSpans = false; + if (forceToEnd) { processLine(cm, text, context, stream.pos); } + stream.pos = text.length; + style = null; + } else { + style = extractLineClasses(readToken(mode, stream, context.state, inner), lineClasses); + } + if (inner) { + var mName = inner[0].name; + if (mName) { style = "m-" + (style ? mName + " " + style : mName); } + } + if (!flattenSpans || curStyle != style) { + while (curStart < stream.start) { + curStart = Math.min(stream.start, curStart + 5000); + f(curStart, curStyle); + } + curStyle = style; + } + stream.start = stream.pos; + } + while (curStart < stream.pos) { + // Webkit seems to refuse to render text nodes longer than 57444 + // characters, and returns inaccurate measurements in nodes + // starting around 5000 chars. + var pos = Math.min(stream.pos, curStart + 5000); + f(pos, curStyle); + curStart = pos; + } + } + + // Finds the line to start with when starting a parse. Tries to + // find a line with a stateAfter, so that it can start with a + // valid state. If that fails, it returns the line with the + // smallest indentation, which tends to need the least context to + // parse correctly. + function findStartLine(cm, n, precise) { + var minindent, minline, doc = cm.doc; + var lim = precise ? -1 : n - (cm.doc.mode.innerMode ? 1000 : 100); + for (var search = n; search > lim; --search) { + if (search <= doc.first) { return doc.first } + var line = getLine(doc, search - 1), after = line.stateAfter; + if (after && (!precise || search + (after instanceof SavedContext ? after.lookAhead : 0) <= doc.modeFrontier)) + { return search } + var indented = countColumn(line.text, null, cm.options.tabSize); + if (minline == null || minindent > indented) { + minline = search - 1; + minindent = indented; + } + } + return minline + } + + function retreatFrontier(doc, n) { + doc.modeFrontier = Math.min(doc.modeFrontier, n); + if (doc.highlightFrontier < n - 10) { return } + var start = doc.first; + for (var line = n - 1; line > start; line--) { + var saved = getLine(doc, line).stateAfter; + // change is on 3 + // state on line 1 looked ahead 2 -- so saw 3 + // test 1 + 2 < 3 should cover this + if (saved && (!(saved instanceof SavedContext) || line + saved.lookAhead < n)) { + start = line + 1; + break + } + } + doc.highlightFrontier = Math.min(doc.highlightFrontier, start); + } + + // Optimize some code when these features are not used. + var sawReadOnlySpans = false, sawCollapsedSpans = false; + + function seeReadOnlySpans() { + sawReadOnlySpans = true; + } + + function seeCollapsedSpans() { + sawCollapsedSpans = true; + } + + // TEXTMARKER SPANS + + function MarkedSpan(marker, from, to) { + this.marker = marker; + this.from = from; this.to = to; + } + + // Search an array of spans for a span matching the given marker. + function getMarkedSpanFor(spans, marker) { + if (spans) { for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if (span.marker == marker) { return span } + } } + } + // Remove a span from an array, returning undefined if no spans are + // left (we don't store arrays for lines without spans). + function removeMarkedSpan(spans, span) { + var r; + for (var i = 0; i < spans.length; ++i) + { if (spans[i] != span) { (r || (r = [])).push(spans[i]); } } + return r + } + // Add a span to a line. + function addMarkedSpan(line, span) { + line.markedSpans = line.markedSpans ? line.markedSpans.concat([span]) : [span]; + span.marker.attachLine(line); + } + + // Used for the algorithm that adjusts markers for a change in the + // document. These functions cut an array of spans at a given + // character position, returning an array of remaining chunks (or + // undefined if nothing remains). + function markedSpansBefore(old, startCh, isInsert) { + var nw; + if (old) { for (var i = 0; i < old.length; ++i) { + var span = old[i], marker = span.marker; + var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= startCh : span.from < startCh); + if (startsBefore || span.from == startCh && marker.type == "bookmark" && (!isInsert || !span.marker.insertLeft)) { + var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= startCh : span.to > startCh) + ;(nw || (nw = [])).push(new MarkedSpan(marker, span.from, endsAfter ? null : span.to)); + } + } } + return nw + } + function markedSpansAfter(old, endCh, isInsert) { + var nw; + if (old) { for (var i = 0; i < old.length; ++i) { + var span = old[i], marker = span.marker; + var endsAfter = span.to == null || (marker.inclusiveRight ? span.to >= endCh : span.to > endCh); + if (endsAfter || span.from == endCh && marker.type == "bookmark" && (!isInsert || span.marker.insertLeft)) { + var startsBefore = span.from == null || (marker.inclusiveLeft ? span.from <= endCh : span.from < endCh) + ;(nw || (nw = [])).push(new MarkedSpan(marker, startsBefore ? null : span.from - endCh, + span.to == null ? null : span.to - endCh)); + } + } } + return nw + } + + // Given a change object, compute the new set of marker spans that + // cover the line in which the change took place. Removes spans + // entirely within the change, reconnects spans belonging to the + // same marker that appear on both sides of the change, and cuts off + // spans partially within the change. Returns an array of span + // arrays with one element for each line in (after) the change. + function stretchSpansOverChange(doc, change) { + if (change.full) { return null } + var oldFirst = isLine(doc, change.from.line) && getLine(doc, change.from.line).markedSpans; + var oldLast = isLine(doc, change.to.line) && getLine(doc, change.to.line).markedSpans; + if (!oldFirst && !oldLast) { return null } + + var startCh = change.from.ch, endCh = change.to.ch, isInsert = cmp(change.from, change.to) == 0; + // Get the spans that 'stick out' on both sides + var first = markedSpansBefore(oldFirst, startCh, isInsert); + var last = markedSpansAfter(oldLast, endCh, isInsert); + + // Next, merge those two ends + var sameLine = change.text.length == 1, offset = lst(change.text).length + (sameLine ? startCh : 0); + if (first) { + // Fix up .to properties of first + for (var i = 0; i < first.length; ++i) { + var span = first[i]; + if (span.to == null) { + var found = getMarkedSpanFor(last, span.marker); + if (!found) { span.to = startCh; } + else if (sameLine) { span.to = found.to == null ? null : found.to + offset; } + } + } + } + if (last) { + // Fix up .from in last (or move them into first in case of sameLine) + for (var i$1 = 0; i$1 < last.length; ++i$1) { + var span$1 = last[i$1]; + if (span$1.to != null) { span$1.to += offset; } + if (span$1.from == null) { + var found$1 = getMarkedSpanFor(first, span$1.marker); + if (!found$1) { + span$1.from = offset; + if (sameLine) { (first || (first = [])).push(span$1); } + } + } else { + span$1.from += offset; + if (sameLine) { (first || (first = [])).push(span$1); } + } + } + } + // Make sure we didn't create any zero-length spans + if (first) { first = clearEmptySpans(first); } + if (last && last != first) { last = clearEmptySpans(last); } + + var newMarkers = [first]; + if (!sameLine) { + // Fill gap with whole-line-spans + var gap = change.text.length - 2, gapMarkers; + if (gap > 0 && first) + { for (var i$2 = 0; i$2 < first.length; ++i$2) + { if (first[i$2].to == null) + { (gapMarkers || (gapMarkers = [])).push(new MarkedSpan(first[i$2].marker, null, null)); } } } + for (var i$3 = 0; i$3 < gap; ++i$3) + { newMarkers.push(gapMarkers); } + newMarkers.push(last); + } + return newMarkers + } + + // Remove spans that are empty and don't have a clearWhenEmpty + // option of false. + function clearEmptySpans(spans) { + for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if (span.from != null && span.from == span.to && span.marker.clearWhenEmpty !== false) + { spans.splice(i--, 1); } + } + if (!spans.length) { return null } + return spans + } + + // Used to 'clip' out readOnly ranges when making a change. + function removeReadOnlyRanges(doc, from, to) { + var markers = null; + doc.iter(from.line, to.line + 1, function (line) { + if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) { + var mark = line.markedSpans[i].marker; + if (mark.readOnly && (!markers || indexOf(markers, mark) == -1)) + { (markers || (markers = [])).push(mark); } + } } + }); + if (!markers) { return null } + var parts = [{from: from, to: to}]; + for (var i = 0; i < markers.length; ++i) { + var mk = markers[i], m = mk.find(0); + for (var j = 0; j < parts.length; ++j) { + var p = parts[j]; + if (cmp(p.to, m.from) < 0 || cmp(p.from, m.to) > 0) { continue } + var newParts = [j, 1], dfrom = cmp(p.from, m.from), dto = cmp(p.to, m.to); + if (dfrom < 0 || !mk.inclusiveLeft && !dfrom) + { newParts.push({from: p.from, to: m.from}); } + if (dto > 0 || !mk.inclusiveRight && !dto) + { newParts.push({from: m.to, to: p.to}); } + parts.splice.apply(parts, newParts); + j += newParts.length - 3; + } + } + return parts + } + + // Connect or disconnect spans from a line. + function detachMarkedSpans(line) { + var spans = line.markedSpans; + if (!spans) { return } + for (var i = 0; i < spans.length; ++i) + { spans[i].marker.detachLine(line); } + line.markedSpans = null; + } + function attachMarkedSpans(line, spans) { + if (!spans) { return } + for (var i = 0; i < spans.length; ++i) + { spans[i].marker.attachLine(line); } + line.markedSpans = spans; + } + + // Helpers used when computing which overlapping collapsed span + // counts as the larger one. + function extraLeft(marker) { return marker.inclusiveLeft ? -1 : 0 } + function extraRight(marker) { return marker.inclusiveRight ? 1 : 0 } + + // Returns a number indicating which of two overlapping collapsed + // spans is larger (and thus includes the other). Falls back to + // comparing ids when the spans cover exactly the same range. + function compareCollapsedMarkers(a, b) { + var lenDiff = a.lines.length - b.lines.length; + if (lenDiff != 0) { return lenDiff } + var aPos = a.find(), bPos = b.find(); + var fromCmp = cmp(aPos.from, bPos.from) || extraLeft(a) - extraLeft(b); + if (fromCmp) { return -fromCmp } + var toCmp = cmp(aPos.to, bPos.to) || extraRight(a) - extraRight(b); + if (toCmp) { return toCmp } + return b.id - a.id + } + + // Find out whether a line ends or starts in a collapsed span. If + // so, return the marker for that span. + function collapsedSpanAtSide(line, start) { + var sps = sawCollapsedSpans && line.markedSpans, found; + if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) { + sp = sps[i]; + if (sp.marker.collapsed && (start ? sp.from : sp.to) == null && + (!found || compareCollapsedMarkers(found, sp.marker) < 0)) + { found = sp.marker; } + } } + return found + } + function collapsedSpanAtStart(line) { return collapsedSpanAtSide(line, true) } + function collapsedSpanAtEnd(line) { return collapsedSpanAtSide(line, false) } + + function collapsedSpanAround(line, ch) { + var sps = sawCollapsedSpans && line.markedSpans, found; + if (sps) { for (var i = 0; i < sps.length; ++i) { + var sp = sps[i]; + if (sp.marker.collapsed && (sp.from == null || sp.from < ch) && (sp.to == null || sp.to > ch) && + (!found || compareCollapsedMarkers(found, sp.marker) < 0)) { found = sp.marker; } + } } + return found + } + + // Test whether there exists a collapsed span that partially + // overlaps (covers the start or end, but not both) of a new span. + // Such overlap is not allowed. + function conflictingCollapsedRange(doc, lineNo$$1, from, to, marker) { + var line = getLine(doc, lineNo$$1); + var sps = sawCollapsedSpans && line.markedSpans; + if (sps) { for (var i = 0; i < sps.length; ++i) { + var sp = sps[i]; + if (!sp.marker.collapsed) { continue } + var found = sp.marker.find(0); + var fromCmp = cmp(found.from, from) || extraLeft(sp.marker) - extraLeft(marker); + var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker); + if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue } + if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) || + fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0)) + { return true } + } } + } + + // A visual line is a line as drawn on the screen. Folding, for + // example, can cause multiple logical lines to appear on the same + // visual line. This finds the start of the visual line that the + // given line is part of (usually that is the line itself). + function visualLine(line) { + var merged; + while (merged = collapsedSpanAtStart(line)) + { line = merged.find(-1, true).line; } + return line + } + + function visualLineEnd(line) { + var merged; + while (merged = collapsedSpanAtEnd(line)) + { line = merged.find(1, true).line; } + return line + } + + // Returns an array of logical lines that continue the visual line + // started by the argument, or undefined if there are no such lines. + function visualLineContinued(line) { + var merged, lines; + while (merged = collapsedSpanAtEnd(line)) { + line = merged.find(1, true).line + ;(lines || (lines = [])).push(line); + } + return lines + } + + // Get the line number of the start of the visual line that the + // given line number is part of. + function visualLineNo(doc, lineN) { + var line = getLine(doc, lineN), vis = visualLine(line); + if (line == vis) { return lineN } + return lineNo(vis) + } + + // Get the line number of the start of the next visual line after + // the given line. + function visualLineEndNo(doc, lineN) { + if (lineN > doc.lastLine()) { return lineN } + var line = getLine(doc, lineN), merged; + if (!lineIsHidden(doc, line)) { return lineN } + while (merged = collapsedSpanAtEnd(line)) + { line = merged.find(1, true).line; } + return lineNo(line) + 1 + } + + // Compute whether a line is hidden. Lines count as hidden when they + // are part of a visual line that starts with another line, or when + // they are entirely covered by collapsed, non-widget span. + function lineIsHidden(doc, line) { + var sps = sawCollapsedSpans && line.markedSpans; + if (sps) { for (var sp = (void 0), i = 0; i < sps.length; ++i) { + sp = sps[i]; + if (!sp.marker.collapsed) { continue } + if (sp.from == null) { return true } + if (sp.marker.widgetNode) { continue } + if (sp.from == 0 && sp.marker.inclusiveLeft && lineIsHiddenInner(doc, line, sp)) + { return true } + } } + } + function lineIsHiddenInner(doc, line, span) { + if (span.to == null) { + var end = span.marker.find(1, true); + return lineIsHiddenInner(doc, end.line, getMarkedSpanFor(end.line.markedSpans, span.marker)) + } + if (span.marker.inclusiveRight && span.to == line.text.length) + { return true } + for (var sp = (void 0), i = 0; i < line.markedSpans.length; ++i) { + sp = line.markedSpans[i]; + if (sp.marker.collapsed && !sp.marker.widgetNode && sp.from == span.to && + (sp.to == null || sp.to != span.from) && + (sp.marker.inclusiveLeft || span.marker.inclusiveRight) && + lineIsHiddenInner(doc, line, sp)) { return true } + } + } + + // Find the height above the given line. + function heightAtLine(lineObj) { + lineObj = visualLine(lineObj); + + var h = 0, chunk = lineObj.parent; + for (var i = 0; i < chunk.lines.length; ++i) { + var line = chunk.lines[i]; + if (line == lineObj) { break } + else { h += line.height; } + } + for (var p = chunk.parent; p; chunk = p, p = chunk.parent) { + for (var i$1 = 0; i$1 < p.children.length; ++i$1) { + var cur = p.children[i$1]; + if (cur == chunk) { break } + else { h += cur.height; } + } + } + return h + } + + // Compute the character length of a line, taking into account + // collapsed ranges (see markText) that might hide parts, and join + // other lines onto it. + function lineLength(line) { + if (line.height == 0) { return 0 } + var len = line.text.length, merged, cur = line; + while (merged = collapsedSpanAtStart(cur)) { + var found = merged.find(0, true); + cur = found.from.line; + len += found.from.ch - found.to.ch; + } + cur = line; + while (merged = collapsedSpanAtEnd(cur)) { + var found$1 = merged.find(0, true); + len -= cur.text.length - found$1.from.ch; + cur = found$1.to.line; + len += cur.text.length - found$1.to.ch; + } + return len + } + + // Find the longest line in the document. + function findMaxLine(cm) { + var d = cm.display, doc = cm.doc; + d.maxLine = getLine(doc, doc.first); + d.maxLineLength = lineLength(d.maxLine); + d.maxLineChanged = true; + doc.iter(function (line) { + var len = lineLength(line); + if (len > d.maxLineLength) { + d.maxLineLength = len; + d.maxLine = line; + } + }); + } + + // LINE DATA STRUCTURE + + // Line objects. These hold state related to a line, including + // highlighting info (the styles array). + var Line = function(text, markedSpans, estimateHeight) { + this.text = text; + attachMarkedSpans(this, markedSpans); + this.height = estimateHeight ? estimateHeight(this) : 1; + }; + + Line.prototype.lineNo = function () { return lineNo(this) }; + eventMixin(Line); + + // Change the content (text, markers) of a line. Automatically + // invalidates cached information and tries to re-estimate the + // line's height. + function updateLine(line, text, markedSpans, estimateHeight) { + line.text = text; + if (line.stateAfter) { line.stateAfter = null; } + if (line.styles) { line.styles = null; } + if (line.order != null) { line.order = null; } + detachMarkedSpans(line); + attachMarkedSpans(line, markedSpans); + var estHeight = estimateHeight ? estimateHeight(line) : 1; + if (estHeight != line.height) { updateLineHeight(line, estHeight); } + } + + // Detach a line from the document tree and its markers. + function cleanUpLine(line) { + line.parent = null; + detachMarkedSpans(line); + } + + // Convert a style as returned by a mode (either null, or a string + // containing one or more styles) to a CSS style. This is cached, + // and also looks for line-wide styles. + var styleToClassCache = {}, styleToClassCacheWithMode = {}; + function interpretTokenStyle(style, options) { + if (!style || /^\s*$/.test(style)) { return null } + var cache = options.addModeClass ? styleToClassCacheWithMode : styleToClassCache; + return cache[style] || + (cache[style] = style.replace(/\S+/g, "cm-$&")) + } + + // Render the DOM representation of the text of a line. Also builds + // up a 'line map', which points at the DOM nodes that represent + // specific stretches of text, and is used by the measuring code. + // The returned object contains the DOM node, this map, and + // information about line-wide styles that were set by the mode. + function buildLineContent(cm, lineView) { + // The padding-right forces the element to have a 'border', which + // is needed on Webkit to be able to get line-level bounding + // rectangles for it (in measureChar). + var content = eltP("span", null, null, webkit ? "padding-right: .1px" : null); + var builder = {pre: eltP("pre", [content], "CodeMirror-line"), content: content, + col: 0, pos: 0, cm: cm, + trailingSpace: false, + splitSpaces: cm.getOption("lineWrapping")}; + lineView.measure = {}; + + // Iterate over the logical lines that make up this visual line. + for (var i = 0; i <= (lineView.rest ? lineView.rest.length : 0); i++) { + var line = i ? lineView.rest[i - 1] : lineView.line, order = (void 0); + builder.pos = 0; + builder.addToken = buildToken; + // Optionally wire in some hacks into the token-rendering + // algorithm, to deal with browser quirks. + if (hasBadBidiRects(cm.display.measure) && (order = getOrder(line, cm.doc.direction))) + { builder.addToken = buildTokenBadBidi(builder.addToken, order); } + builder.map = []; + var allowFrontierUpdate = lineView != cm.display.externalMeasured && lineNo(line); + insertLineContent(line, builder, getLineStyles(cm, line, allowFrontierUpdate)); + if (line.styleClasses) { + if (line.styleClasses.bgClass) + { builder.bgClass = joinClasses(line.styleClasses.bgClass, builder.bgClass || ""); } + if (line.styleClasses.textClass) + { builder.textClass = joinClasses(line.styleClasses.textClass, builder.textClass || ""); } + } + + // Ensure at least a single node is present, for measuring. + if (builder.map.length == 0) + { builder.map.push(0, 0, builder.content.appendChild(zeroWidthElement(cm.display.measure))); } + + // Store the map and a cache object for the current logical line + if (i == 0) { + lineView.measure.map = builder.map; + lineView.measure.cache = {}; + } else { + (lineView.measure.maps || (lineView.measure.maps = [])).push(builder.map) + ;(lineView.measure.caches || (lineView.measure.caches = [])).push({}); + } + } + + // See issue #2901 + if (webkit) { + var last = builder.content.lastChild; + if (/\bcm-tab\b/.test(last.className) || (last.querySelector && last.querySelector(".cm-tab"))) + { builder.content.className = "cm-tab-wrap-hack"; } + } + + signal(cm, "renderLine", cm, lineView.line, builder.pre); + if (builder.pre.className) + { builder.textClass = joinClasses(builder.pre.className, builder.textClass || ""); } + + return builder + } + + function defaultSpecialCharPlaceholder(ch) { + var token = elt("span", "\u2022", "cm-invalidchar"); + token.title = "\\u" + ch.charCodeAt(0).toString(16); + token.setAttribute("aria-label", token.title); + return token + } + + // Build up the DOM representation for a single token, and add it to + // the line map. Takes care to render special characters separately. + function buildToken(builder, text, style, startStyle, endStyle, css, attributes) { + if (!text) { return } + var displayText = builder.splitSpaces ? splitSpaces(text, builder.trailingSpace) : text; + var special = builder.cm.state.specialChars, mustWrap = false; + var content; + if (!special.test(text)) { + builder.col += text.length; + content = document.createTextNode(displayText); + builder.map.push(builder.pos, builder.pos + text.length, content); + if (ie && ie_version < 9) { mustWrap = true; } + builder.pos += text.length; + } else { + content = document.createDocumentFragment(); + var pos = 0; + while (true) { + special.lastIndex = pos; + var m = special.exec(text); + var skipped = m ? m.index - pos : text.length - pos; + if (skipped) { + var txt = document.createTextNode(displayText.slice(pos, pos + skipped)); + if (ie && ie_version < 9) { content.appendChild(elt("span", [txt])); } + else { content.appendChild(txt); } + builder.map.push(builder.pos, builder.pos + skipped, txt); + builder.col += skipped; + builder.pos += skipped; + } + if (!m) { break } + pos += skipped + 1; + var txt$1 = (void 0); + if (m[0] == "\t") { + var tabSize = builder.cm.options.tabSize, tabWidth = tabSize - builder.col % tabSize; + txt$1 = content.appendChild(elt("span", spaceStr(tabWidth), "cm-tab")); + txt$1.setAttribute("role", "presentation"); + txt$1.setAttribute("cm-text", "\t"); + builder.col += tabWidth; + } else if (m[0] == "\r" || m[0] == "\n") { + txt$1 = content.appendChild(elt("span", m[0] == "\r" ? "\u240d" : "\u2424", "cm-invalidchar")); + txt$1.setAttribute("cm-text", m[0]); + builder.col += 1; + } else { + txt$1 = builder.cm.options.specialCharPlaceholder(m[0]); + txt$1.setAttribute("cm-text", m[0]); + if (ie && ie_version < 9) { content.appendChild(elt("span", [txt$1])); } + else { content.appendChild(txt$1); } + builder.col += 1; + } + builder.map.push(builder.pos, builder.pos + 1, txt$1); + builder.pos++; + } + } + builder.trailingSpace = displayText.charCodeAt(text.length - 1) == 32; + if (style || startStyle || endStyle || mustWrap || css) { + var fullStyle = style || ""; + if (startStyle) { fullStyle += startStyle; } + if (endStyle) { fullStyle += endStyle; } + var token = elt("span", [content], fullStyle, css); + if (attributes) { + for (var attr in attributes) { if (attributes.hasOwnProperty(attr) && attr != "style" && attr != "class") + { token.setAttribute(attr, attributes[attr]); } } + } + return builder.content.appendChild(token) + } + builder.content.appendChild(content); + } + + // Change some spaces to NBSP to prevent the browser from collapsing + // trailing spaces at the end of a line when rendering text (issue #1362). + function splitSpaces(text, trailingBefore) { + if (text.length > 1 && !/ /.test(text)) { return text } + var spaceBefore = trailingBefore, result = ""; + for (var i = 0; i < text.length; i++) { + var ch = text.charAt(i); + if (ch == " " && spaceBefore && (i == text.length - 1 || text.charCodeAt(i + 1) == 32)) + { ch = "\u00a0"; } + result += ch; + spaceBefore = ch == " "; + } + return result + } + + // Work around nonsense dimensions being reported for stretches of + // right-to-left text. + function buildTokenBadBidi(inner, order) { + return function (builder, text, style, startStyle, endStyle, css, attributes) { + style = style ? style + " cm-force-border" : "cm-force-border"; + var start = builder.pos, end = start + text.length; + for (;;) { + // Find the part that overlaps with the start of this text + var part = (void 0); + for (var i = 0; i < order.length; i++) { + part = order[i]; + if (part.to > start && part.from <= start) { break } + } + if (part.to >= end) { return inner(builder, text, style, startStyle, endStyle, css, attributes) } + inner(builder, text.slice(0, part.to - start), style, startStyle, null, css, attributes); + startStyle = null; + text = text.slice(part.to - start); + start = part.to; + } + } + } + + function buildCollapsedSpan(builder, size, marker, ignoreWidget) { + var widget = !ignoreWidget && marker.widgetNode; + if (widget) { builder.map.push(builder.pos, builder.pos + size, widget); } + if (!ignoreWidget && builder.cm.display.input.needsContentAttribute) { + if (!widget) + { widget = builder.content.appendChild(document.createElement("span")); } + widget.setAttribute("cm-marker", marker.id); + } + if (widget) { + builder.cm.display.input.setUneditable(widget); + builder.content.appendChild(widget); + } + builder.pos += size; + builder.trailingSpace = false; + } + + // Outputs a number of spans to make up a line, taking highlighting + // and marked text into account. + function insertLineContent(line, builder, styles) { + var spans = line.markedSpans, allText = line.text, at = 0; + if (!spans) { + for (var i$1 = 1; i$1 < styles.length; i$1+=2) + { builder.addToken(builder, allText.slice(at, at = styles[i$1]), interpretTokenStyle(styles[i$1+1], builder.cm.options)); } + return + } + + var len = allText.length, pos = 0, i = 1, text = "", style, css; + var nextChange = 0, spanStyle, spanEndStyle, spanStartStyle, collapsed, attributes; + for (;;) { + if (nextChange == pos) { // Update current marker set + spanStyle = spanEndStyle = spanStartStyle = css = ""; + attributes = null; + collapsed = null; nextChange = Infinity; + var foundBookmarks = [], endStyles = (void 0); + for (var j = 0; j < spans.length; ++j) { + var sp = spans[j], m = sp.marker; + if (m.type == "bookmark" && sp.from == pos && m.widgetNode) { + foundBookmarks.push(m); + } else if (sp.from <= pos && (sp.to == null || sp.to > pos || m.collapsed && sp.to == pos && sp.from == pos)) { + if (sp.to != null && sp.to != pos && nextChange > sp.to) { + nextChange = sp.to; + spanEndStyle = ""; + } + if (m.className) { spanStyle += " " + m.className; } + if (m.css) { css = (css ? css + ";" : "") + m.css; } + if (m.startStyle && sp.from == pos) { spanStartStyle += " " + m.startStyle; } + if (m.endStyle && sp.to == nextChange) { (endStyles || (endStyles = [])).push(m.endStyle, sp.to); } + // support for the old title property + // https://github.com/codemirror/CodeMirror/pull/5673 + if (m.title) { (attributes || (attributes = {})).title = m.title; } + if (m.attributes) { + for (var attr in m.attributes) + { (attributes || (attributes = {}))[attr] = m.attributes[attr]; } + } + if (m.collapsed && (!collapsed || compareCollapsedMarkers(collapsed.marker, m) < 0)) + { collapsed = sp; } + } else if (sp.from > pos && nextChange > sp.from) { + nextChange = sp.from; + } + } + if (endStyles) { for (var j$1 = 0; j$1 < endStyles.length; j$1 += 2) + { if (endStyles[j$1 + 1] == nextChange) { spanEndStyle += " " + endStyles[j$1]; } } } + + if (!collapsed || collapsed.from == pos) { for (var j$2 = 0; j$2 < foundBookmarks.length; ++j$2) + { buildCollapsedSpan(builder, 0, foundBookmarks[j$2]); } } + if (collapsed && (collapsed.from || 0) == pos) { + buildCollapsedSpan(builder, (collapsed.to == null ? len + 1 : collapsed.to) - pos, + collapsed.marker, collapsed.from == null); + if (collapsed.to == null) { return } + if (collapsed.to == pos) { collapsed = false; } + } + } + if (pos >= len) { break } + + var upto = Math.min(len, nextChange); + while (true) { + if (text) { + var end = pos + text.length; + if (!collapsed) { + var tokenText = end > upto ? text.slice(0, upto - pos) : text; + builder.addToken(builder, tokenText, style ? style + spanStyle : spanStyle, + spanStartStyle, pos + tokenText.length == nextChange ? spanEndStyle : "", css, attributes); + } + if (end >= upto) {text = text.slice(upto - pos); pos = upto; break} + pos = end; + spanStartStyle = ""; + } + text = allText.slice(at, at = styles[i++]); + style = interpretTokenStyle(styles[i++], builder.cm.options); + } + } + } + + + // These objects are used to represent the visible (currently drawn) + // part of the document. A LineView may correspond to multiple + // logical lines, if those are connected by collapsed ranges. + function LineView(doc, line, lineN) { + // The starting line + this.line = line; + // Continuing lines, if any + this.rest = visualLineContinued(line); + // Number of logical lines in this visual line + this.size = this.rest ? lineNo(lst(this.rest)) - lineN + 1 : 1; + this.node = this.text = null; + this.hidden = lineIsHidden(doc, line); + } + + // Create a range of LineView objects for the given lines. + function buildViewArray(cm, from, to) { + var array = [], nextPos; + for (var pos = from; pos < to; pos = nextPos) { + var view = new LineView(cm.doc, getLine(cm.doc, pos), pos); + nextPos = pos + view.size; + array.push(view); + } + return array + } + + var operationGroup = null; + + function pushOperation(op) { + if (operationGroup) { + operationGroup.ops.push(op); + } else { + op.ownsGroup = operationGroup = { + ops: [op], + delayedCallbacks: [] + }; + } + } + + function fireCallbacksForOps(group) { + // Calls delayed callbacks and cursorActivity handlers until no + // new ones appear + var callbacks = group.delayedCallbacks, i = 0; + do { + for (; i < callbacks.length; i++) + { callbacks[i].call(null); } + for (var j = 0; j < group.ops.length; j++) { + var op = group.ops[j]; + if (op.cursorActivityHandlers) + { while (op.cursorActivityCalled < op.cursorActivityHandlers.length) + { op.cursorActivityHandlers[op.cursorActivityCalled++].call(null, op.cm); } } + } + } while (i < callbacks.length) + } + + function finishOperation(op, endCb) { + var group = op.ownsGroup; + if (!group) { return } + + try { fireCallbacksForOps(group); } + finally { + operationGroup = null; + endCb(group); + } + } + + var orphanDelayedCallbacks = null; + + // Often, we want to signal events at a point where we are in the + // middle of some work, but don't want the handler to start calling + // other methods on the editor, which might be in an inconsistent + // state or simply not expect any other events to happen. + // signalLater looks whether there are any handlers, and schedules + // them to be executed when the last operation ends, or, if no + // operation is active, when a timeout fires. + function signalLater(emitter, type /*, values...*/) { + var arr = getHandlers(emitter, type); + if (!arr.length) { return } + var args = Array.prototype.slice.call(arguments, 2), list; + if (operationGroup) { + list = operationGroup.delayedCallbacks; + } else if (orphanDelayedCallbacks) { + list = orphanDelayedCallbacks; + } else { + list = orphanDelayedCallbacks = []; + setTimeout(fireOrphanDelayed, 0); + } + var loop = function ( i ) { + list.push(function () { return arr[i].apply(null, args); }); + }; + + for (var i = 0; i < arr.length; ++i) + loop( i ); + } + + function fireOrphanDelayed() { + var delayed = orphanDelayedCallbacks; + orphanDelayedCallbacks = null; + for (var i = 0; i < delayed.length; ++i) { delayed[i](); } + } + + // When an aspect of a line changes, a string is added to + // lineView.changes. This updates the relevant part of the line's + // DOM structure. + function updateLineForChanges(cm, lineView, lineN, dims) { + for (var j = 0; j < lineView.changes.length; j++) { + var type = lineView.changes[j]; + if (type == "text") { updateLineText(cm, lineView); } + else if (type == "gutter") { updateLineGutter(cm, lineView, lineN, dims); } + else if (type == "class") { updateLineClasses(cm, lineView); } + else if (type == "widget") { updateLineWidgets(cm, lineView, dims); } + } + lineView.changes = null; + } + + // Lines with gutter elements, widgets or a background class need to + // be wrapped, and have the extra elements added to the wrapper div + function ensureLineWrapped(lineView) { + if (lineView.node == lineView.text) { + lineView.node = elt("div", null, null, "position: relative"); + if (lineView.text.parentNode) + { lineView.text.parentNode.replaceChild(lineView.node, lineView.text); } + lineView.node.appendChild(lineView.text); + if (ie && ie_version < 8) { lineView.node.style.zIndex = 2; } + } + return lineView.node + } + + function updateLineBackground(cm, lineView) { + var cls = lineView.bgClass ? lineView.bgClass + " " + (lineView.line.bgClass || "") : lineView.line.bgClass; + if (cls) { cls += " CodeMirror-linebackground"; } + if (lineView.background) { + if (cls) { lineView.background.className = cls; } + else { lineView.background.parentNode.removeChild(lineView.background); lineView.background = null; } + } else if (cls) { + var wrap = ensureLineWrapped(lineView); + lineView.background = wrap.insertBefore(elt("div", null, cls), wrap.firstChild); + cm.display.input.setUneditable(lineView.background); + } + } + + // Wrapper around buildLineContent which will reuse the structure + // in display.externalMeasured when possible. + function getLineContent(cm, lineView) { + var ext = cm.display.externalMeasured; + if (ext && ext.line == lineView.line) { + cm.display.externalMeasured = null; + lineView.measure = ext.measure; + return ext.built + } + return buildLineContent(cm, lineView) + } + + // Redraw the line's text. Interacts with the background and text + // classes because the mode may output tokens that influence these + // classes. + function updateLineText(cm, lineView) { + var cls = lineView.text.className; + var built = getLineContent(cm, lineView); + if (lineView.text == lineView.node) { lineView.node = built.pre; } + lineView.text.parentNode.replaceChild(built.pre, lineView.text); + lineView.text = built.pre; + if (built.bgClass != lineView.bgClass || built.textClass != lineView.textClass) { + lineView.bgClass = built.bgClass; + lineView.textClass = built.textClass; + updateLineClasses(cm, lineView); + } else if (cls) { + lineView.text.className = cls; + } + } + + function updateLineClasses(cm, lineView) { + updateLineBackground(cm, lineView); + if (lineView.line.wrapClass) + { ensureLineWrapped(lineView).className = lineView.line.wrapClass; } + else if (lineView.node != lineView.text) + { lineView.node.className = ""; } + var textClass = lineView.textClass ? lineView.textClass + " " + (lineView.line.textClass || "") : lineView.line.textClass; + lineView.text.className = textClass || ""; + } + + function updateLineGutter(cm, lineView, lineN, dims) { + if (lineView.gutter) { + lineView.node.removeChild(lineView.gutter); + lineView.gutter = null; + } + if (lineView.gutterBackground) { + lineView.node.removeChild(lineView.gutterBackground); + lineView.gutterBackground = null; + } + if (lineView.line.gutterClass) { + var wrap = ensureLineWrapped(lineView); + lineView.gutterBackground = elt("div", null, "CodeMirror-gutter-background " + lineView.line.gutterClass, + ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px; width: " + (dims.gutterTotalWidth) + "px")); + cm.display.input.setUneditable(lineView.gutterBackground); + wrap.insertBefore(lineView.gutterBackground, lineView.text); + } + var markers = lineView.line.gutterMarkers; + if (cm.options.lineNumbers || markers) { + var wrap$1 = ensureLineWrapped(lineView); + var gutterWrap = lineView.gutter = elt("div", null, "CodeMirror-gutter-wrapper", ("left: " + (cm.options.fixedGutter ? dims.fixedPos : -dims.gutterTotalWidth) + "px")); + cm.display.input.setUneditable(gutterWrap); + wrap$1.insertBefore(gutterWrap, lineView.text); + if (lineView.line.gutterClass) + { gutterWrap.className += " " + lineView.line.gutterClass; } + if (cm.options.lineNumbers && (!markers || !markers["CodeMirror-linenumbers"])) + { lineView.lineNumber = gutterWrap.appendChild( + elt("div", lineNumberFor(cm.options, lineN), + "CodeMirror-linenumber CodeMirror-gutter-elt", + ("left: " + (dims.gutterLeft["CodeMirror-linenumbers"]) + "px; width: " + (cm.display.lineNumInnerWidth) + "px"))); } + if (markers) { for (var k = 0; k < cm.display.gutterSpecs.length; ++k) { + var id = cm.display.gutterSpecs[k].className, found = markers.hasOwnProperty(id) && markers[id]; + if (found) + { gutterWrap.appendChild(elt("div", [found], "CodeMirror-gutter-elt", + ("left: " + (dims.gutterLeft[id]) + "px; width: " + (dims.gutterWidth[id]) + "px"))); } + } } + } + } + + function updateLineWidgets(cm, lineView, dims) { + if (lineView.alignable) { lineView.alignable = null; } + for (var node = lineView.node.firstChild, next = (void 0); node; node = next) { + next = node.nextSibling; + if (node.className == "CodeMirror-linewidget") + { lineView.node.removeChild(node); } + } + insertLineWidgets(cm, lineView, dims); + } + + // Build a line's DOM representation from scratch + function buildLineElement(cm, lineView, lineN, dims) { + var built = getLineContent(cm, lineView); + lineView.text = lineView.node = built.pre; + if (built.bgClass) { lineView.bgClass = built.bgClass; } + if (built.textClass) { lineView.textClass = built.textClass; } + + updateLineClasses(cm, lineView); + updateLineGutter(cm, lineView, lineN, dims); + insertLineWidgets(cm, lineView, dims); + return lineView.node + } + + // A lineView may contain multiple logical lines (when merged by + // collapsed spans). The widgets for all of them need to be drawn. + function insertLineWidgets(cm, lineView, dims) { + insertLineWidgetsFor(cm, lineView.line, lineView, dims, true); + if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++) + { insertLineWidgetsFor(cm, lineView.rest[i], lineView, dims, false); } } + } + + function insertLineWidgetsFor(cm, line, lineView, dims, allowAbove) { + if (!line.widgets) { return } + var wrap = ensureLineWrapped(lineView); + for (var i = 0, ws = line.widgets; i < ws.length; ++i) { + var widget = ws[i], node = elt("div", [widget.node], "CodeMirror-linewidget"); + if (!widget.handleMouseEvents) { node.setAttribute("cm-ignore-events", "true"); } + positionLineWidget(widget, node, lineView, dims); + cm.display.input.setUneditable(node); + if (allowAbove && widget.above) + { wrap.insertBefore(node, lineView.gutter || lineView.text); } + else + { wrap.appendChild(node); } + signalLater(widget, "redraw"); + } + } + + function positionLineWidget(widget, node, lineView, dims) { + if (widget.noHScroll) { + (lineView.alignable || (lineView.alignable = [])).push(node); + var width = dims.wrapperWidth; + node.style.left = dims.fixedPos + "px"; + if (!widget.coverGutter) { + width -= dims.gutterTotalWidth; + node.style.paddingLeft = dims.gutterTotalWidth + "px"; + } + node.style.width = width + "px"; + } + if (widget.coverGutter) { + node.style.zIndex = 5; + node.style.position = "relative"; + if (!widget.noHScroll) { node.style.marginLeft = -dims.gutterTotalWidth + "px"; } + } + } + + function widgetHeight(widget) { + if (widget.height != null) { return widget.height } + var cm = widget.doc.cm; + if (!cm) { return 0 } + if (!contains(document.body, widget.node)) { + var parentStyle = "position: relative;"; + if (widget.coverGutter) + { parentStyle += "margin-left: -" + cm.display.gutters.offsetWidth + "px;"; } + if (widget.noHScroll) + { parentStyle += "width: " + cm.display.wrapper.clientWidth + "px;"; } + removeChildrenAndAdd(cm.display.measure, elt("div", [widget.node], null, parentStyle)); + } + return widget.height = widget.node.parentNode.offsetHeight + } + + // Return true when the given mouse event happened in a widget + function eventInWidget(display, e) { + for (var n = e_target(e); n != display.wrapper; n = n.parentNode) { + if (!n || (n.nodeType == 1 && n.getAttribute("cm-ignore-events") == "true") || + (n.parentNode == display.sizer && n != display.mover)) + { return true } + } + } + + // POSITION MEASUREMENT + + function paddingTop(display) {return display.lineSpace.offsetTop} + function paddingVert(display) {return display.mover.offsetHeight - display.lineSpace.offsetHeight} + function paddingH(display) { + if (display.cachedPaddingH) { return display.cachedPaddingH } + var e = removeChildrenAndAdd(display.measure, elt("pre", "x", "CodeMirror-line-like")); + var style = window.getComputedStyle ? window.getComputedStyle(e) : e.currentStyle; + var data = {left: parseInt(style.paddingLeft), right: parseInt(style.paddingRight)}; + if (!isNaN(data.left) && !isNaN(data.right)) { display.cachedPaddingH = data; } + return data + } + + function scrollGap(cm) { return scrollerGap - cm.display.nativeBarWidth } + function displayWidth(cm) { + return cm.display.scroller.clientWidth - scrollGap(cm) - cm.display.barWidth + } + function displayHeight(cm) { + return cm.display.scroller.clientHeight - scrollGap(cm) - cm.display.barHeight + } + + // Ensure the lineView.wrapping.heights array is populated. This is + // an array of bottom offsets for the lines that make up a drawn + // line. When lineWrapping is on, there might be more than one + // height. + function ensureLineHeights(cm, lineView, rect) { + var wrapping = cm.options.lineWrapping; + var curWidth = wrapping && displayWidth(cm); + if (!lineView.measure.heights || wrapping && lineView.measure.width != curWidth) { + var heights = lineView.measure.heights = []; + if (wrapping) { + lineView.measure.width = curWidth; + var rects = lineView.text.firstChild.getClientRects(); + for (var i = 0; i < rects.length - 1; i++) { + var cur = rects[i], next = rects[i + 1]; + if (Math.abs(cur.bottom - next.bottom) > 2) + { heights.push((cur.bottom + next.top) / 2 - rect.top); } + } + } + heights.push(rect.bottom - rect.top); + } + } + + // Find a line map (mapping character offsets to text nodes) and a + // measurement cache for the given line number. (A line view might + // contain multiple lines when collapsed ranges are present.) + function mapFromLineView(lineView, line, lineN) { + if (lineView.line == line) + { return {map: lineView.measure.map, cache: lineView.measure.cache} } + for (var i = 0; i < lineView.rest.length; i++) + { if (lineView.rest[i] == line) + { return {map: lineView.measure.maps[i], cache: lineView.measure.caches[i]} } } + for (var i$1 = 0; i$1 < lineView.rest.length; i$1++) + { if (lineNo(lineView.rest[i$1]) > lineN) + { return {map: lineView.measure.maps[i$1], cache: lineView.measure.caches[i$1], before: true} } } + } + + // Render a line into the hidden node display.externalMeasured. Used + // when measurement is needed for a line that's not in the viewport. + function updateExternalMeasurement(cm, line) { + line = visualLine(line); + var lineN = lineNo(line); + var view = cm.display.externalMeasured = new LineView(cm.doc, line, lineN); + view.lineN = lineN; + var built = view.built = buildLineContent(cm, view); + view.text = built.pre; + removeChildrenAndAdd(cm.display.lineMeasure, built.pre); + return view + } + + // Get a {top, bottom, left, right} box (in line-local coordinates) + // for a given character. + function measureChar(cm, line, ch, bias) { + return measureCharPrepared(cm, prepareMeasureForLine(cm, line), ch, bias) + } + + // Find a line view that corresponds to the given line number. + function findViewForLine(cm, lineN) { + if (lineN >= cm.display.viewFrom && lineN < cm.display.viewTo) + { return cm.display.view[findViewIndex(cm, lineN)] } + var ext = cm.display.externalMeasured; + if (ext && lineN >= ext.lineN && lineN < ext.lineN + ext.size) + { return ext } + } + + // Measurement can be split in two steps, the set-up work that + // applies to the whole line, and the measurement of the actual + // character. Functions like coordsChar, that need to do a lot of + // measurements in a row, can thus ensure that the set-up work is + // only done once. + function prepareMeasureForLine(cm, line) { + var lineN = lineNo(line); + var view = findViewForLine(cm, lineN); + if (view && !view.text) { + view = null; + } else if (view && view.changes) { + updateLineForChanges(cm, view, lineN, getDimensions(cm)); + cm.curOp.forceUpdate = true; + } + if (!view) + { view = updateExternalMeasurement(cm, line); } + + var info = mapFromLineView(view, line, lineN); + return { + line: line, view: view, rect: null, + map: info.map, cache: info.cache, before: info.before, + hasHeights: false + } + } + + // Given a prepared measurement object, measures the position of an + // actual character (or fetches it from the cache). + function measureCharPrepared(cm, prepared, ch, bias, varHeight) { + if (prepared.before) { ch = -1; } + var key = ch + (bias || ""), found; + if (prepared.cache.hasOwnProperty(key)) { + found = prepared.cache[key]; + } else { + if (!prepared.rect) + { prepared.rect = prepared.view.text.getBoundingClientRect(); } + if (!prepared.hasHeights) { + ensureLineHeights(cm, prepared.view, prepared.rect); + prepared.hasHeights = true; + } + found = measureCharInner(cm, prepared, ch, bias); + if (!found.bogus) { prepared.cache[key] = found; } + } + return {left: found.left, right: found.right, + top: varHeight ? found.rtop : found.top, + bottom: varHeight ? found.rbottom : found.bottom} + } + + var nullRect = {left: 0, right: 0, top: 0, bottom: 0}; + + function nodeAndOffsetInLineMap(map$$1, ch, bias) { + var node, start, end, collapse, mStart, mEnd; + // First, search the line map for the text node corresponding to, + // or closest to, the target character. + for (var i = 0; i < map$$1.length; i += 3) { + mStart = map$$1[i]; + mEnd = map$$1[i + 1]; + if (ch < mStart) { + start = 0; end = 1; + collapse = "left"; + } else if (ch < mEnd) { + start = ch - mStart; + end = start + 1; + } else if (i == map$$1.length - 3 || ch == mEnd && map$$1[i + 3] > ch) { + end = mEnd - mStart; + start = end - 1; + if (ch >= mEnd) { collapse = "right"; } + } + if (start != null) { + node = map$$1[i + 2]; + if (mStart == mEnd && bias == (node.insertLeft ? "left" : "right")) + { collapse = bias; } + if (bias == "left" && start == 0) + { while (i && map$$1[i - 2] == map$$1[i - 3] && map$$1[i - 1].insertLeft) { + node = map$$1[(i -= 3) + 2]; + collapse = "left"; + } } + if (bias == "right" && start == mEnd - mStart) + { while (i < map$$1.length - 3 && map$$1[i + 3] == map$$1[i + 4] && !map$$1[i + 5].insertLeft) { + node = map$$1[(i += 3) + 2]; + collapse = "right"; + } } + break + } + } + return {node: node, start: start, end: end, collapse: collapse, coverStart: mStart, coverEnd: mEnd} + } + + function getUsefulRect(rects, bias) { + var rect = nullRect; + if (bias == "left") { for (var i = 0; i < rects.length; i++) { + if ((rect = rects[i]).left != rect.right) { break } + } } else { for (var i$1 = rects.length - 1; i$1 >= 0; i$1--) { + if ((rect = rects[i$1]).left != rect.right) { break } + } } + return rect + } + + function measureCharInner(cm, prepared, ch, bias) { + var place = nodeAndOffsetInLineMap(prepared.map, ch, bias); + var node = place.node, start = place.start, end = place.end, collapse = place.collapse; + + var rect; + if (node.nodeType == 3) { // If it is a text node, use a range to retrieve the coordinates. + for (var i$1 = 0; i$1 < 4; i$1++) { // Retry a maximum of 4 times when nonsense rectangles are returned + while (start && isExtendingChar(prepared.line.text.charAt(place.coverStart + start))) { --start; } + while (place.coverStart + end < place.coverEnd && isExtendingChar(prepared.line.text.charAt(place.coverStart + end))) { ++end; } + if (ie && ie_version < 9 && start == 0 && end == place.coverEnd - place.coverStart) + { rect = node.parentNode.getBoundingClientRect(); } + else + { rect = getUsefulRect(range(node, start, end).getClientRects(), bias); } + if (rect.left || rect.right || start == 0) { break } + end = start; + start = start - 1; + collapse = "right"; + } + if (ie && ie_version < 11) { rect = maybeUpdateRectForZooming(cm.display.measure, rect); } + } else { // If it is a widget, simply get the box for the whole widget. + if (start > 0) { collapse = bias = "right"; } + var rects; + if (cm.options.lineWrapping && (rects = node.getClientRects()).length > 1) + { rect = rects[bias == "right" ? rects.length - 1 : 0]; } + else + { rect = node.getBoundingClientRect(); } + } + if (ie && ie_version < 9 && !start && (!rect || !rect.left && !rect.right)) { + var rSpan = node.parentNode.getClientRects()[0]; + if (rSpan) + { rect = {left: rSpan.left, right: rSpan.left + charWidth(cm.display), top: rSpan.top, bottom: rSpan.bottom}; } + else + { rect = nullRect; } + } + + var rtop = rect.top - prepared.rect.top, rbot = rect.bottom - prepared.rect.top; + var mid = (rtop + rbot) / 2; + var heights = prepared.view.measure.heights; + var i = 0; + for (; i < heights.length - 1; i++) + { if (mid < heights[i]) { break } } + var top = i ? heights[i - 1] : 0, bot = heights[i]; + var result = {left: (collapse == "right" ? rect.right : rect.left) - prepared.rect.left, + right: (collapse == "left" ? rect.left : rect.right) - prepared.rect.left, + top: top, bottom: bot}; + if (!rect.left && !rect.right) { result.bogus = true; } + if (!cm.options.singleCursorHeightPerLine) { result.rtop = rtop; result.rbottom = rbot; } + + return result + } + + // Work around problem with bounding client rects on ranges being + // returned incorrectly when zoomed on IE10 and below. + function maybeUpdateRectForZooming(measure, rect) { + if (!window.screen || screen.logicalXDPI == null || + screen.logicalXDPI == screen.deviceXDPI || !hasBadZoomedRects(measure)) + { return rect } + var scaleX = screen.logicalXDPI / screen.deviceXDPI; + var scaleY = screen.logicalYDPI / screen.deviceYDPI; + return {left: rect.left * scaleX, right: rect.right * scaleX, + top: rect.top * scaleY, bottom: rect.bottom * scaleY} + } + + function clearLineMeasurementCacheFor(lineView) { + if (lineView.measure) { + lineView.measure.cache = {}; + lineView.measure.heights = null; + if (lineView.rest) { for (var i = 0; i < lineView.rest.length; i++) + { lineView.measure.caches[i] = {}; } } + } + } + + function clearLineMeasurementCache(cm) { + cm.display.externalMeasure = null; + removeChildren(cm.display.lineMeasure); + for (var i = 0; i < cm.display.view.length; i++) + { clearLineMeasurementCacheFor(cm.display.view[i]); } + } + + function clearCaches(cm) { + clearLineMeasurementCache(cm); + cm.display.cachedCharWidth = cm.display.cachedTextHeight = cm.display.cachedPaddingH = null; + if (!cm.options.lineWrapping) { cm.display.maxLineChanged = true; } + cm.display.lineNumChars = null; + } + + function pageScrollX() { + // Work around https://bugs.chromium.org/p/chromium/issues/detail?id=489206 + // which causes page_Offset and bounding client rects to use + // different reference viewports and invalidate our calculations. + if (chrome && android) { return -(document.body.getBoundingClientRect().left - parseInt(getComputedStyle(document.body).marginLeft)) } + return window.pageXOffset || (document.documentElement || document.body).scrollLeft + } + function pageScrollY() { + if (chrome && android) { return -(document.body.getBoundingClientRect().top - parseInt(getComputedStyle(document.body).marginTop)) } + return window.pageYOffset || (document.documentElement || document.body).scrollTop + } + + function widgetTopHeight(lineObj) { + var height = 0; + if (lineObj.widgets) { for (var i = 0; i < lineObj.widgets.length; ++i) { if (lineObj.widgets[i].above) + { height += widgetHeight(lineObj.widgets[i]); } } } + return height + } + + // Converts a {top, bottom, left, right} box from line-local + // coordinates into another coordinate system. Context may be one of + // "line", "div" (display.lineDiv), "local"./null (editor), "window", + // or "page". + function intoCoordSystem(cm, lineObj, rect, context, includeWidgets) { + if (!includeWidgets) { + var height = widgetTopHeight(lineObj); + rect.top += height; rect.bottom += height; + } + if (context == "line") { return rect } + if (!context) { context = "local"; } + var yOff = heightAtLine(lineObj); + if (context == "local") { yOff += paddingTop(cm.display); } + else { yOff -= cm.display.viewOffset; } + if (context == "page" || context == "window") { + var lOff = cm.display.lineSpace.getBoundingClientRect(); + yOff += lOff.top + (context == "window" ? 0 : pageScrollY()); + var xOff = lOff.left + (context == "window" ? 0 : pageScrollX()); + rect.left += xOff; rect.right += xOff; + } + rect.top += yOff; rect.bottom += yOff; + return rect + } + + // Coverts a box from "div" coords to another coordinate system. + // Context may be "window", "page", "div", or "local"./null. + function fromCoordSystem(cm, coords, context) { + if (context == "div") { return coords } + var left = coords.left, top = coords.top; + // First move into "page" coordinate system + if (context == "page") { + left -= pageScrollX(); + top -= pageScrollY(); + } else if (context == "local" || !context) { + var localBox = cm.display.sizer.getBoundingClientRect(); + left += localBox.left; + top += localBox.top; + } + + var lineSpaceBox = cm.display.lineSpace.getBoundingClientRect(); + return {left: left - lineSpaceBox.left, top: top - lineSpaceBox.top} + } + + function charCoords(cm, pos, context, lineObj, bias) { + if (!lineObj) { lineObj = getLine(cm.doc, pos.line); } + return intoCoordSystem(cm, lineObj, measureChar(cm, lineObj, pos.ch, bias), context) + } + + // Returns a box for a given cursor position, which may have an + // 'other' property containing the position of the secondary cursor + // on a bidi boundary. + // A cursor Pos(line, char, "before") is on the same visual line as `char - 1` + // and after `char - 1` in writing order of `char - 1` + // A cursor Pos(line, char, "after") is on the same visual line as `char` + // and before `char` in writing order of `char` + // Examples (upper-case letters are RTL, lower-case are LTR): + // Pos(0, 1, ...) + // before after + // ab a|b a|b + // aB a|B aB| + // Ab |Ab A|b + // AB B|A B|A + // Every position after the last character on a line is considered to stick + // to the last character on the line. + function cursorCoords(cm, pos, context, lineObj, preparedMeasure, varHeight) { + lineObj = lineObj || getLine(cm.doc, pos.line); + if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); } + function get(ch, right) { + var m = measureCharPrepared(cm, preparedMeasure, ch, right ? "right" : "left", varHeight); + if (right) { m.left = m.right; } else { m.right = m.left; } + return intoCoordSystem(cm, lineObj, m, context) + } + var order = getOrder(lineObj, cm.doc.direction), ch = pos.ch, sticky = pos.sticky; + if (ch >= lineObj.text.length) { + ch = lineObj.text.length; + sticky = "before"; + } else if (ch <= 0) { + ch = 0; + sticky = "after"; + } + if (!order) { return get(sticky == "before" ? ch - 1 : ch, sticky == "before") } + + function getBidi(ch, partPos, invert) { + var part = order[partPos], right = part.level == 1; + return get(invert ? ch - 1 : ch, right != invert) + } + var partPos = getBidiPartAt(order, ch, sticky); + var other = bidiOther; + var val = getBidi(ch, partPos, sticky == "before"); + if (other != null) { val.other = getBidi(ch, other, sticky != "before"); } + return val + } + + // Used to cheaply estimate the coordinates for a position. Used for + // intermediate scroll updates. + function estimateCoords(cm, pos) { + var left = 0; + pos = clipPos(cm.doc, pos); + if (!cm.options.lineWrapping) { left = charWidth(cm.display) * pos.ch; } + var lineObj = getLine(cm.doc, pos.line); + var top = heightAtLine(lineObj) + paddingTop(cm.display); + return {left: left, right: left, top: top, bottom: top + lineObj.height} + } + + // Positions returned by coordsChar contain some extra information. + // xRel is the relative x position of the input coordinates compared + // to the found position (so xRel > 0 means the coordinates are to + // the right of the character position, for example). When outside + // is true, that means the coordinates lie outside the line's + // vertical range. + function PosWithInfo(line, ch, sticky, outside, xRel) { + var pos = Pos(line, ch, sticky); + pos.xRel = xRel; + if (outside) { pos.outside = outside; } + return pos + } + + // Compute the character position closest to the given coordinates. + // Input must be lineSpace-local ("div" coordinate system). + function coordsChar(cm, x, y) { + var doc = cm.doc; + y += cm.display.viewOffset; + if (y < 0) { return PosWithInfo(doc.first, 0, null, -1, -1) } + var lineN = lineAtHeight(doc, y), last = doc.first + doc.size - 1; + if (lineN > last) + { return PosWithInfo(doc.first + doc.size - 1, getLine(doc, last).text.length, null, 1, 1) } + if (x < 0) { x = 0; } + + var lineObj = getLine(doc, lineN); + for (;;) { + var found = coordsCharInner(cm, lineObj, lineN, x, y); + var collapsed = collapsedSpanAround(lineObj, found.ch + (found.xRel > 0 || found.outside > 0 ? 1 : 0)); + if (!collapsed) { return found } + var rangeEnd = collapsed.find(1); + if (rangeEnd.line == lineN) { return rangeEnd } + lineObj = getLine(doc, lineN = rangeEnd.line); + } + } + + function wrappedLineExtent(cm, lineObj, preparedMeasure, y) { + y -= widgetTopHeight(lineObj); + var end = lineObj.text.length; + var begin = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch - 1).bottom <= y; }, end, 0); + end = findFirst(function (ch) { return measureCharPrepared(cm, preparedMeasure, ch).top > y; }, begin, end); + return {begin: begin, end: end} + } + + function wrappedLineExtentChar(cm, lineObj, preparedMeasure, target) { + if (!preparedMeasure) { preparedMeasure = prepareMeasureForLine(cm, lineObj); } + var targetTop = intoCoordSystem(cm, lineObj, measureCharPrepared(cm, preparedMeasure, target), "line").top; + return wrappedLineExtent(cm, lineObj, preparedMeasure, targetTop) + } + + // Returns true if the given side of a box is after the given + // coordinates, in top-to-bottom, left-to-right order. + function boxIsAfter(box, x, y, left) { + return box.bottom <= y ? false : box.top > y ? true : (left ? box.left : box.right) > x + } + + function coordsCharInner(cm, lineObj, lineNo$$1, x, y) { + // Move y into line-local coordinate space + y -= heightAtLine(lineObj); + var preparedMeasure = prepareMeasureForLine(cm, lineObj); + // When directly calling `measureCharPrepared`, we have to adjust + // for the widgets at this line. + var widgetHeight$$1 = widgetTopHeight(lineObj); + var begin = 0, end = lineObj.text.length, ltr = true; + + var order = getOrder(lineObj, cm.doc.direction); + // If the line isn't plain left-to-right text, first figure out + // which bidi section the coordinates fall into. + if (order) { + var part = (cm.options.lineWrapping ? coordsBidiPartWrapped : coordsBidiPart) + (cm, lineObj, lineNo$$1, preparedMeasure, order, x, y); + ltr = part.level != 1; + // The awkward -1 offsets are needed because findFirst (called + // on these below) will treat its first bound as inclusive, + // second as exclusive, but we want to actually address the + // characters in the part's range + begin = ltr ? part.from : part.to - 1; + end = ltr ? part.to : part.from - 1; + } + + // A binary search to find the first character whose bounding box + // starts after the coordinates. If we run across any whose box wrap + // the coordinates, store that. + var chAround = null, boxAround = null; + var ch = findFirst(function (ch) { + var box = measureCharPrepared(cm, preparedMeasure, ch); + box.top += widgetHeight$$1; box.bottom += widgetHeight$$1; + if (!boxIsAfter(box, x, y, false)) { return false } + if (box.top <= y && box.left <= x) { + chAround = ch; + boxAround = box; + } + return true + }, begin, end); + + var baseX, sticky, outside = false; + // If a box around the coordinates was found, use that + if (boxAround) { + // Distinguish coordinates nearer to the left or right side of the box + var atLeft = x - boxAround.left < boxAround.right - x, atStart = atLeft == ltr; + ch = chAround + (atStart ? 0 : 1); + sticky = atStart ? "after" : "before"; + baseX = atLeft ? boxAround.left : boxAround.right; + } else { + // (Adjust for extended bound, if necessary.) + if (!ltr && (ch == end || ch == begin)) { ch++; } + // To determine which side to associate with, get the box to the + // left of the character and compare it's vertical position to the + // coordinates + sticky = ch == 0 ? "after" : ch == lineObj.text.length ? "before" : + (measureCharPrepared(cm, preparedMeasure, ch - (ltr ? 1 : 0)).bottom + widgetHeight$$1 <= y) == ltr ? + "after" : "before"; + // Now get accurate coordinates for this place, in order to get a + // base X position + var coords = cursorCoords(cm, Pos(lineNo$$1, ch, sticky), "line", lineObj, preparedMeasure); + baseX = coords.left; + outside = y < coords.top ? -1 : y >= coords.bottom ? 1 : 0; + } + + ch = skipExtendingChars(lineObj.text, ch, 1); + return PosWithInfo(lineNo$$1, ch, sticky, outside, x - baseX) + } + + function coordsBidiPart(cm, lineObj, lineNo$$1, preparedMeasure, order, x, y) { + // Bidi parts are sorted left-to-right, and in a non-line-wrapping + // situation, we can take this ordering to correspond to the visual + // ordering. This finds the first part whose end is after the given + // coordinates. + var index = findFirst(function (i) { + var part = order[i], ltr = part.level != 1; + return boxIsAfter(cursorCoords(cm, Pos(lineNo$$1, ltr ? part.to : part.from, ltr ? "before" : "after"), + "line", lineObj, preparedMeasure), x, y, true) + }, 0, order.length - 1); + var part = order[index]; + // If this isn't the first part, the part's start is also after + // the coordinates, and the coordinates aren't on the same line as + // that start, move one part back. + if (index > 0) { + var ltr = part.level != 1; + var start = cursorCoords(cm, Pos(lineNo$$1, ltr ? part.from : part.to, ltr ? "after" : "before"), + "line", lineObj, preparedMeasure); + if (boxIsAfter(start, x, y, true) && start.top > y) + { part = order[index - 1]; } + } + return part + } + + function coordsBidiPartWrapped(cm, lineObj, _lineNo, preparedMeasure, order, x, y) { + // In a wrapped line, rtl text on wrapping boundaries can do things + // that don't correspond to the ordering in our `order` array at + // all, so a binary search doesn't work, and we want to return a + // part that only spans one line so that the binary search in + // coordsCharInner is safe. As such, we first find the extent of the + // wrapped line, and then do a flat search in which we discard any + // spans that aren't on the line. + var ref = wrappedLineExtent(cm, lineObj, preparedMeasure, y); + var begin = ref.begin; + var end = ref.end; + if (/\s/.test(lineObj.text.charAt(end - 1))) { end--; } + var part = null, closestDist = null; + for (var i = 0; i < order.length; i++) { + var p = order[i]; + if (p.from >= end || p.to <= begin) { continue } + var ltr = p.level != 1; + var endX = measureCharPrepared(cm, preparedMeasure, ltr ? Math.min(end, p.to) - 1 : Math.max(begin, p.from)).right; + // Weigh against spans ending before this, so that they are only + // picked if nothing ends after + var dist = endX < x ? x - endX + 1e9 : endX - x; + if (!part || closestDist > dist) { + part = p; + closestDist = dist; + } + } + if (!part) { part = order[order.length - 1]; } + // Clip the part to the wrapped line. + if (part.from < begin) { part = {from: begin, to: part.to, level: part.level}; } + if (part.to > end) { part = {from: part.from, to: end, level: part.level}; } + return part + } + + var measureText; + // Compute the default text height. + function textHeight(display) { + if (display.cachedTextHeight != null) { return display.cachedTextHeight } + if (measureText == null) { + measureText = elt("pre", null, "CodeMirror-line-like"); + // Measure a bunch of lines, for browsers that compute + // fractional heights. + for (var i = 0; i < 49; ++i) { + measureText.appendChild(document.createTextNode("x")); + measureText.appendChild(elt("br")); + } + measureText.appendChild(document.createTextNode("x")); + } + removeChildrenAndAdd(display.measure, measureText); + var height = measureText.offsetHeight / 50; + if (height > 3) { display.cachedTextHeight = height; } + removeChildren(display.measure); + return height || 1 + } + + // Compute the default character width. + function charWidth(display) { + if (display.cachedCharWidth != null) { return display.cachedCharWidth } + var anchor = elt("span", "xxxxxxxxxx"); + var pre = elt("pre", [anchor], "CodeMirror-line-like"); + removeChildrenAndAdd(display.measure, pre); + var rect = anchor.getBoundingClientRect(), width = (rect.right - rect.left) / 10; + if (width > 2) { display.cachedCharWidth = width; } + return width || 10 + } + + // Do a bulk-read of the DOM positions and sizes needed to draw the + // view, so that we don't interleave reading and writing to the DOM. + function getDimensions(cm) { + var d = cm.display, left = {}, width = {}; + var gutterLeft = d.gutters.clientLeft; + for (var n = d.gutters.firstChild, i = 0; n; n = n.nextSibling, ++i) { + var id = cm.display.gutterSpecs[i].className; + left[id] = n.offsetLeft + n.clientLeft + gutterLeft; + width[id] = n.clientWidth; + } + return {fixedPos: compensateForHScroll(d), + gutterTotalWidth: d.gutters.offsetWidth, + gutterLeft: left, + gutterWidth: width, + wrapperWidth: d.wrapper.clientWidth} + } + + // Computes display.scroller.scrollLeft + display.gutters.offsetWidth, + // but using getBoundingClientRect to get a sub-pixel-accurate + // result. + function compensateForHScroll(display) { + return display.scroller.getBoundingClientRect().left - display.sizer.getBoundingClientRect().left + } + + // Returns a function that estimates the height of a line, to use as + // first approximation until the line becomes visible (and is thus + // properly measurable). + function estimateHeight(cm) { + var th = textHeight(cm.display), wrapping = cm.options.lineWrapping; + var perLine = wrapping && Math.max(5, cm.display.scroller.clientWidth / charWidth(cm.display) - 3); + return function (line) { + if (lineIsHidden(cm.doc, line)) { return 0 } + + var widgetsHeight = 0; + if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) { + if (line.widgets[i].height) { widgetsHeight += line.widgets[i].height; } + } } + + if (wrapping) + { return widgetsHeight + (Math.ceil(line.text.length / perLine) || 1) * th } + else + { return widgetsHeight + th } + } + } + + function estimateLineHeights(cm) { + var doc = cm.doc, est = estimateHeight(cm); + doc.iter(function (line) { + var estHeight = est(line); + if (estHeight != line.height) { updateLineHeight(line, estHeight); } + }); + } + + // Given a mouse event, find the corresponding position. If liberal + // is false, it checks whether a gutter or scrollbar was clicked, + // and returns null if it was. forRect is used by rectangular + // selections, and tries to estimate a character position even for + // coordinates beyond the right of the text. + function posFromMouse(cm, e, liberal, forRect) { + var display = cm.display; + if (!liberal && e_target(e).getAttribute("cm-not-content") == "true") { return null } + + var x, y, space = display.lineSpace.getBoundingClientRect(); + // Fails unpredictably on IE[67] when mouse is dragged around quickly. + try { x = e.clientX - space.left; y = e.clientY - space.top; } + catch (e) { return null } + var coords = coordsChar(cm, x, y), line; + if (forRect && coords.xRel == 1 && (line = getLine(cm.doc, coords.line).text).length == coords.ch) { + var colDiff = countColumn(line, line.length, cm.options.tabSize) - line.length; + coords = Pos(coords.line, Math.max(0, Math.round((x - paddingH(cm.display).left) / charWidth(cm.display)) - colDiff)); + } + return coords + } + + // Find the view element corresponding to a given line. Return null + // when the line isn't visible. + function findViewIndex(cm, n) { + if (n >= cm.display.viewTo) { return null } + n -= cm.display.viewFrom; + if (n < 0) { return null } + var view = cm.display.view; + for (var i = 0; i < view.length; i++) { + n -= view[i].size; + if (n < 0) { return i } + } + } + + // Updates the display.view data structure for a given change to the + // document. From and to are in pre-change coordinates. Lendiff is + // the amount of lines added or subtracted by the change. This is + // used for changes that span multiple lines, or change the way + // lines are divided into visual lines. regLineChange (below) + // registers single-line changes. + function regChange(cm, from, to, lendiff) { + if (from == null) { from = cm.doc.first; } + if (to == null) { to = cm.doc.first + cm.doc.size; } + if (!lendiff) { lendiff = 0; } + + var display = cm.display; + if (lendiff && to < display.viewTo && + (display.updateLineNumbers == null || display.updateLineNumbers > from)) + { display.updateLineNumbers = from; } + + cm.curOp.viewChanged = true; + + if (from >= display.viewTo) { // Change after + if (sawCollapsedSpans && visualLineNo(cm.doc, from) < display.viewTo) + { resetView(cm); } + } else if (to <= display.viewFrom) { // Change before + if (sawCollapsedSpans && visualLineEndNo(cm.doc, to + lendiff) > display.viewFrom) { + resetView(cm); + } else { + display.viewFrom += lendiff; + display.viewTo += lendiff; + } + } else if (from <= display.viewFrom && to >= display.viewTo) { // Full overlap + resetView(cm); + } else if (from <= display.viewFrom) { // Top overlap + var cut = viewCuttingPoint(cm, to, to + lendiff, 1); + if (cut) { + display.view = display.view.slice(cut.index); + display.viewFrom = cut.lineN; + display.viewTo += lendiff; + } else { + resetView(cm); + } + } else if (to >= display.viewTo) { // Bottom overlap + var cut$1 = viewCuttingPoint(cm, from, from, -1); + if (cut$1) { + display.view = display.view.slice(0, cut$1.index); + display.viewTo = cut$1.lineN; + } else { + resetView(cm); + } + } else { // Gap in the middle + var cutTop = viewCuttingPoint(cm, from, from, -1); + var cutBot = viewCuttingPoint(cm, to, to + lendiff, 1); + if (cutTop && cutBot) { + display.view = display.view.slice(0, cutTop.index) + .concat(buildViewArray(cm, cutTop.lineN, cutBot.lineN)) + .concat(display.view.slice(cutBot.index)); + display.viewTo += lendiff; + } else { + resetView(cm); + } + } + + var ext = display.externalMeasured; + if (ext) { + if (to < ext.lineN) + { ext.lineN += lendiff; } + else if (from < ext.lineN + ext.size) + { display.externalMeasured = null; } + } + } + + // Register a change to a single line. Type must be one of "text", + // "gutter", "class", "widget" + function regLineChange(cm, line, type) { + cm.curOp.viewChanged = true; + var display = cm.display, ext = cm.display.externalMeasured; + if (ext && line >= ext.lineN && line < ext.lineN + ext.size) + { display.externalMeasured = null; } + + if (line < display.viewFrom || line >= display.viewTo) { return } + var lineView = display.view[findViewIndex(cm, line)]; + if (lineView.node == null) { return } + var arr = lineView.changes || (lineView.changes = []); + if (indexOf(arr, type) == -1) { arr.push(type); } + } + + // Clear the view. + function resetView(cm) { + cm.display.viewFrom = cm.display.viewTo = cm.doc.first; + cm.display.view = []; + cm.display.viewOffset = 0; + } + + function viewCuttingPoint(cm, oldN, newN, dir) { + var index = findViewIndex(cm, oldN), diff, view = cm.display.view; + if (!sawCollapsedSpans || newN == cm.doc.first + cm.doc.size) + { return {index: index, lineN: newN} } + var n = cm.display.viewFrom; + for (var i = 0; i < index; i++) + { n += view[i].size; } + if (n != oldN) { + if (dir > 0) { + if (index == view.length - 1) { return null } + diff = (n + view[index].size) - oldN; + index++; + } else { + diff = n - oldN; + } + oldN += diff; newN += diff; + } + while (visualLineNo(cm.doc, newN) != newN) { + if (index == (dir < 0 ? 0 : view.length - 1)) { return null } + newN += dir * view[index - (dir < 0 ? 1 : 0)].size; + index += dir; + } + return {index: index, lineN: newN} + } + + // Force the view to cover a given range, adding empty view element + // or clipping off existing ones as needed. + function adjustView(cm, from, to) { + var display = cm.display, view = display.view; + if (view.length == 0 || from >= display.viewTo || to <= display.viewFrom) { + display.view = buildViewArray(cm, from, to); + display.viewFrom = from; + } else { + if (display.viewFrom > from) + { display.view = buildViewArray(cm, from, display.viewFrom).concat(display.view); } + else if (display.viewFrom < from) + { display.view = display.view.slice(findViewIndex(cm, from)); } + display.viewFrom = from; + if (display.viewTo < to) + { display.view = display.view.concat(buildViewArray(cm, display.viewTo, to)); } + else if (display.viewTo > to) + { display.view = display.view.slice(0, findViewIndex(cm, to)); } + } + display.viewTo = to; + } + + // Count the number of lines in the view whose DOM representation is + // out of date (or nonexistent). + function countDirtyView(cm) { + var view = cm.display.view, dirty = 0; + for (var i = 0; i < view.length; i++) { + var lineView = view[i]; + if (!lineView.hidden && (!lineView.node || lineView.changes)) { ++dirty; } + } + return dirty + } + + function updateSelection(cm) { + cm.display.input.showSelection(cm.display.input.prepareSelection()); + } + + function prepareSelection(cm, primary) { + if ( primary === void 0 ) primary = true; + + var doc = cm.doc, result = {}; + var curFragment = result.cursors = document.createDocumentFragment(); + var selFragment = result.selection = document.createDocumentFragment(); + + for (var i = 0; i < doc.sel.ranges.length; i++) { + if (!primary && i == doc.sel.primIndex) { continue } + var range$$1 = doc.sel.ranges[i]; + if (range$$1.from().line >= cm.display.viewTo || range$$1.to().line < cm.display.viewFrom) { continue } + var collapsed = range$$1.empty(); + if (collapsed || cm.options.showCursorWhenSelecting) + { drawSelectionCursor(cm, range$$1.head, curFragment); } + if (!collapsed) + { drawSelectionRange(cm, range$$1, selFragment); } + } + return result + } + + // Draws a cursor for the given range + function drawSelectionCursor(cm, head, output) { + var pos = cursorCoords(cm, head, "div", null, null, !cm.options.singleCursorHeightPerLine); + + var cursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor")); + cursor.style.left = pos.left + "px"; + cursor.style.top = pos.top + "px"; + cursor.style.height = Math.max(0, pos.bottom - pos.top) * cm.options.cursorHeight + "px"; + + if (pos.other) { + // Secondary cursor, shown when on a 'jump' in bi-directional text + var otherCursor = output.appendChild(elt("div", "\u00a0", "CodeMirror-cursor CodeMirror-secondarycursor")); + otherCursor.style.display = ""; + otherCursor.style.left = pos.other.left + "px"; + otherCursor.style.top = pos.other.top + "px"; + otherCursor.style.height = (pos.other.bottom - pos.other.top) * .85 + "px"; + } + } + + function cmpCoords(a, b) { return a.top - b.top || a.left - b.left } + + // Draws the given range as a highlighted selection + function drawSelectionRange(cm, range$$1, output) { + var display = cm.display, doc = cm.doc; + var fragment = document.createDocumentFragment(); + var padding = paddingH(cm.display), leftSide = padding.left; + var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right; + var docLTR = doc.direction == "ltr"; + + function add(left, top, width, bottom) { + if (top < 0) { top = 0; } + top = Math.round(top); + bottom = Math.round(bottom); + fragment.appendChild(elt("div", null, "CodeMirror-selected", ("position: absolute; left: " + left + "px;\n top: " + top + "px; width: " + (width == null ? rightSide - left : width) + "px;\n height: " + (bottom - top) + "px"))); + } + + function drawForLine(line, fromArg, toArg) { + var lineObj = getLine(doc, line); + var lineLen = lineObj.text.length; + var start, end; + function coords(ch, bias) { + return charCoords(cm, Pos(line, ch), "div", lineObj, bias) + } + + function wrapX(pos, dir, side) { + var extent = wrappedLineExtentChar(cm, lineObj, null, pos); + var prop = (dir == "ltr") == (side == "after") ? "left" : "right"; + var ch = side == "after" ? extent.begin : extent.end - (/\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1); + return coords(ch, prop)[prop] + } + + var order = getOrder(lineObj, doc.direction); + iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) { + var ltr = dir == "ltr"; + var fromPos = coords(from, ltr ? "left" : "right"); + var toPos = coords(to - 1, ltr ? "right" : "left"); + + var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen; + var first = i == 0, last = !order || i == order.length - 1; + if (toPos.top - fromPos.top <= 3) { // Single line + var openLeft = (docLTR ? openStart : openEnd) && first; + var openRight = (docLTR ? openEnd : openStart) && last; + var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left; + var right = openRight ? rightSide : (ltr ? toPos : fromPos).right; + add(left, fromPos.top, right - left, fromPos.bottom); + } else { // Multiple lines + var topLeft, topRight, botLeft, botRight; + if (ltr) { + topLeft = docLTR && openStart && first ? leftSide : fromPos.left; + topRight = docLTR ? rightSide : wrapX(from, dir, "before"); + botLeft = docLTR ? leftSide : wrapX(to, dir, "after"); + botRight = docLTR && openEnd && last ? rightSide : toPos.right; + } else { + topLeft = !docLTR ? leftSide : wrapX(from, dir, "before"); + topRight = !docLTR && openStart && first ? rightSide : fromPos.right; + botLeft = !docLTR && openEnd && last ? leftSide : toPos.left; + botRight = !docLTR ? rightSide : wrapX(to, dir, "after"); + } + add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom); + if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); } + add(botLeft, toPos.top, botRight - botLeft, toPos.bottom); + } + + if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; } + if (cmpCoords(toPos, start) < 0) { start = toPos; } + if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; } + if (cmpCoords(toPos, end) < 0) { end = toPos; } + }); + return {start: start, end: end} + } + + var sFrom = range$$1.from(), sTo = range$$1.to(); + if (sFrom.line == sTo.line) { + drawForLine(sFrom.line, sFrom.ch, sTo.ch); + } else { + var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line); + var singleVLine = visualLine(fromLine) == visualLine(toLine); + var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end; + var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start; + if (singleVLine) { + if (leftEnd.top < rightStart.top - 2) { + add(leftEnd.right, leftEnd.top, null, leftEnd.bottom); + add(leftSide, rightStart.top, rightStart.left, rightStart.bottom); + } else { + add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom); + } + } + if (leftEnd.bottom < rightStart.top) + { add(leftSide, leftEnd.bottom, null, rightStart.top); } + } + + output.appendChild(fragment); + } + + // Cursor-blinking + function restartBlink(cm) { + if (!cm.state.focused) { return } + var display = cm.display; + clearInterval(display.blinker); + var on = true; + display.cursorDiv.style.visibility = ""; + if (cm.options.cursorBlinkRate > 0) + { display.blinker = setInterval(function () { return display.cursorDiv.style.visibility = (on = !on) ? "" : "hidden"; }, + cm.options.cursorBlinkRate); } + else if (cm.options.cursorBlinkRate < 0) + { display.cursorDiv.style.visibility = "hidden"; } + } + + function ensureFocus(cm) { + if (!cm.state.focused) { cm.display.input.focus(); onFocus(cm); } + } + + function delayBlurEvent(cm) { + cm.state.delayingBlurEvent = true; + setTimeout(function () { if (cm.state.delayingBlurEvent) { + cm.state.delayingBlurEvent = false; + onBlur(cm); + } }, 100); + } + + function onFocus(cm, e) { + if (cm.state.delayingBlurEvent) { cm.state.delayingBlurEvent = false; } + + if (cm.options.readOnly == "nocursor") { return } + if (!cm.state.focused) { + signal(cm, "focus", cm, e); + cm.state.focused = true; + addClass(cm.display.wrapper, "CodeMirror-focused"); + // This test prevents this from firing when a context + // menu is closed (since the input reset would kill the + // select-all detection hack) + if (!cm.curOp && cm.display.selForContextMenu != cm.doc.sel) { + cm.display.input.reset(); + if (webkit) { setTimeout(function () { return cm.display.input.reset(true); }, 20); } // Issue #1730 + } + cm.display.input.receivedFocus(); + } + restartBlink(cm); + } + function onBlur(cm, e) { + if (cm.state.delayingBlurEvent) { return } + + if (cm.state.focused) { + signal(cm, "blur", cm, e); + cm.state.focused = false; + rmClass(cm.display.wrapper, "CodeMirror-focused"); + } + clearInterval(cm.display.blinker); + setTimeout(function () { if (!cm.state.focused) { cm.display.shift = false; } }, 150); + } + + // Read the actual heights of the rendered lines, and update their + // stored heights to match. + function updateHeightsInViewport(cm) { + var display = cm.display; + var prevBottom = display.lineDiv.offsetTop; + for (var i = 0; i < display.view.length; i++) { + var cur = display.view[i], wrapping = cm.options.lineWrapping; + var height = (void 0), width = 0; + if (cur.hidden) { continue } + if (ie && ie_version < 8) { + var bot = cur.node.offsetTop + cur.node.offsetHeight; + height = bot - prevBottom; + prevBottom = bot; + } else { + var box = cur.node.getBoundingClientRect(); + height = box.bottom - box.top; + // Check that lines don't extend past the right of the current + // editor width + if (!wrapping && cur.text.firstChild) + { width = cur.text.firstChild.getBoundingClientRect().right - box.left - 1; } + } + var diff = cur.line.height - height; + if (diff > .005 || diff < -.005) { + updateLineHeight(cur.line, height); + updateWidgetHeight(cur.line); + if (cur.rest) { for (var j = 0; j < cur.rest.length; j++) + { updateWidgetHeight(cur.rest[j]); } } + } + if (width > cm.display.sizerWidth) { + var chWidth = Math.ceil(width / charWidth(cm.display)); + if (chWidth > cm.display.maxLineLength) { + cm.display.maxLineLength = chWidth; + cm.display.maxLine = cur.line; + cm.display.maxLineChanged = true; + } + } + } + } + + // Read and store the height of line widgets associated with the + // given line. + function updateWidgetHeight(line) { + if (line.widgets) { for (var i = 0; i < line.widgets.length; ++i) { + var w = line.widgets[i], parent = w.node.parentNode; + if (parent) { w.height = parent.offsetHeight; } + } } + } + + // Compute the lines that are visible in a given viewport (defaults + // the the current scroll position). viewport may contain top, + // height, and ensure (see op.scrollToPos) properties. + function visibleLines(display, doc, viewport) { + var top = viewport && viewport.top != null ? Math.max(0, viewport.top) : display.scroller.scrollTop; + top = Math.floor(top - paddingTop(display)); + var bottom = viewport && viewport.bottom != null ? viewport.bottom : top + display.wrapper.clientHeight; + + var from = lineAtHeight(doc, top), to = lineAtHeight(doc, bottom); + // Ensure is a {from: {line, ch}, to: {line, ch}} object, and + // forces those lines into the viewport (if possible). + if (viewport && viewport.ensure) { + var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line; + if (ensureFrom < from) { + from = ensureFrom; + to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight); + } else if (Math.min(ensureTo, doc.lastLine()) >= to) { + from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight); + to = ensureTo; + } + } + return {from: from, to: Math.max(to, from + 1)} + } + + // SCROLLING THINGS INTO VIEW + + // If an editor sits on the top or bottom of the window, partially + // scrolled out of view, this ensures that the cursor is visible. + function maybeScrollWindow(cm, rect) { + if (signalDOMEvent(cm, "scrollCursorIntoView")) { return } + + var display = cm.display, box = display.sizer.getBoundingClientRect(), doScroll = null; + if (rect.top + box.top < 0) { doScroll = true; } + else if (rect.bottom + box.top > (window.innerHeight || document.documentElement.clientHeight)) { doScroll = false; } + if (doScroll != null && !phantom) { + var scrollNode = elt("div", "\u200b", null, ("position: absolute;\n top: " + (rect.top - display.viewOffset - paddingTop(cm.display)) + "px;\n height: " + (rect.bottom - rect.top + scrollGap(cm) + display.barHeight) + "px;\n left: " + (rect.left) + "px; width: " + (Math.max(2, rect.right - rect.left)) + "px;")); + cm.display.lineSpace.appendChild(scrollNode); + scrollNode.scrollIntoView(doScroll); + cm.display.lineSpace.removeChild(scrollNode); + } + } + + // Scroll a given position into view (immediately), verifying that + // it actually became visible (as line heights are accurately + // measured, the position of something may 'drift' during drawing). + function scrollPosIntoView(cm, pos, end, margin) { + if (margin == null) { margin = 0; } + var rect; + if (!cm.options.lineWrapping && pos == end) { + // Set pos and end to the cursor positions around the character pos sticks to + // If pos.sticky == "before", that is around pos.ch - 1, otherwise around pos.ch + // If pos == Pos(_, 0, "before"), pos and end are unchanged + pos = pos.ch ? Pos(pos.line, pos.sticky == "before" ? pos.ch - 1 : pos.ch, "after") : pos; + end = pos.sticky == "before" ? Pos(pos.line, pos.ch + 1, "before") : pos; + } + for (var limit = 0; limit < 5; limit++) { + var changed = false; + var coords = cursorCoords(cm, pos); + var endCoords = !end || end == pos ? coords : cursorCoords(cm, end); + rect = {left: Math.min(coords.left, endCoords.left), + top: Math.min(coords.top, endCoords.top) - margin, + right: Math.max(coords.left, endCoords.left), + bottom: Math.max(coords.bottom, endCoords.bottom) + margin}; + var scrollPos = calculateScrollPos(cm, rect); + var startTop = cm.doc.scrollTop, startLeft = cm.doc.scrollLeft; + if (scrollPos.scrollTop != null) { + updateScrollTop(cm, scrollPos.scrollTop); + if (Math.abs(cm.doc.scrollTop - startTop) > 1) { changed = true; } + } + if (scrollPos.scrollLeft != null) { + setScrollLeft(cm, scrollPos.scrollLeft); + if (Math.abs(cm.doc.scrollLeft - startLeft) > 1) { changed = true; } + } + if (!changed) { break } + } + return rect + } + + // Scroll a given set of coordinates into view (immediately). + function scrollIntoView(cm, rect) { + var scrollPos = calculateScrollPos(cm, rect); + if (scrollPos.scrollTop != null) { updateScrollTop(cm, scrollPos.scrollTop); } + if (scrollPos.scrollLeft != null) { setScrollLeft(cm, scrollPos.scrollLeft); } + } + + // Calculate a new scroll position needed to scroll the given + // rectangle into view. Returns an object with scrollTop and + // scrollLeft properties. When these are undefined, the + // vertical/horizontal position does not need to be adjusted. + function calculateScrollPos(cm, rect) { + var display = cm.display, snapMargin = textHeight(cm.display); + if (rect.top < 0) { rect.top = 0; } + var screentop = cm.curOp && cm.curOp.scrollTop != null ? cm.curOp.scrollTop : display.scroller.scrollTop; + var screen = displayHeight(cm), result = {}; + if (rect.bottom - rect.top > screen) { rect.bottom = rect.top + screen; } + var docBottom = cm.doc.height + paddingVert(display); + var atTop = rect.top < snapMargin, atBottom = rect.bottom > docBottom - snapMargin; + if (rect.top < screentop) { + result.scrollTop = atTop ? 0 : rect.top; + } else if (rect.bottom > screentop + screen) { + var newTop = Math.min(rect.top, (atBottom ? docBottom : rect.bottom) - screen); + if (newTop != screentop) { result.scrollTop = newTop; } + } + + var screenleft = cm.curOp && cm.curOp.scrollLeft != null ? cm.curOp.scrollLeft : display.scroller.scrollLeft; + var screenw = displayWidth(cm) - (cm.options.fixedGutter ? display.gutters.offsetWidth : 0); + var tooWide = rect.right - rect.left > screenw; + if (tooWide) { rect.right = rect.left + screenw; } + if (rect.left < 10) + { result.scrollLeft = 0; } + else if (rect.left < screenleft) + { result.scrollLeft = Math.max(0, rect.left - (tooWide ? 0 : 10)); } + else if (rect.right > screenw + screenleft - 3) + { result.scrollLeft = rect.right + (tooWide ? 0 : 10) - screenw; } + return result + } + + // Store a relative adjustment to the scroll position in the current + // operation (to be applied when the operation finishes). + function addToScrollTop(cm, top) { + if (top == null) { return } + resolveScrollToPos(cm); + cm.curOp.scrollTop = (cm.curOp.scrollTop == null ? cm.doc.scrollTop : cm.curOp.scrollTop) + top; + } + + // Make sure that at the end of the operation the current cursor is + // shown. + function ensureCursorVisible(cm) { + resolveScrollToPos(cm); + var cur = cm.getCursor(); + cm.curOp.scrollToPos = {from: cur, to: cur, margin: cm.options.cursorScrollMargin}; + } + + function scrollToCoords(cm, x, y) { + if (x != null || y != null) { resolveScrollToPos(cm); } + if (x != null) { cm.curOp.scrollLeft = x; } + if (y != null) { cm.curOp.scrollTop = y; } + } + + function scrollToRange(cm, range$$1) { + resolveScrollToPos(cm); + cm.curOp.scrollToPos = range$$1; + } + + // When an operation has its scrollToPos property set, and another + // scroll action is applied before the end of the operation, this + // 'simulates' scrolling that position into view in a cheap way, so + // that the effect of intermediate scroll commands is not ignored. + function resolveScrollToPos(cm) { + var range$$1 = cm.curOp.scrollToPos; + if (range$$1) { + cm.curOp.scrollToPos = null; + var from = estimateCoords(cm, range$$1.from), to = estimateCoords(cm, range$$1.to); + scrollToCoordsRange(cm, from, to, range$$1.margin); + } + } + + function scrollToCoordsRange(cm, from, to, margin) { + var sPos = calculateScrollPos(cm, { + left: Math.min(from.left, to.left), + top: Math.min(from.top, to.top) - margin, + right: Math.max(from.right, to.right), + bottom: Math.max(from.bottom, to.bottom) + margin + }); + scrollToCoords(cm, sPos.scrollLeft, sPos.scrollTop); + } + + // Sync the scrollable area and scrollbars, ensure the viewport + // covers the visible area. + function updateScrollTop(cm, val) { + if (Math.abs(cm.doc.scrollTop - val) < 2) { return } + if (!gecko) { updateDisplaySimple(cm, {top: val}); } + setScrollTop(cm, val, true); + if (gecko) { updateDisplaySimple(cm); } + startWorker(cm, 100); + } + + function setScrollTop(cm, val, forceScroll) { + val = Math.min(cm.display.scroller.scrollHeight - cm.display.scroller.clientHeight, val); + if (cm.display.scroller.scrollTop == val && !forceScroll) { return } + cm.doc.scrollTop = val; + cm.display.scrollbars.setScrollTop(val); + if (cm.display.scroller.scrollTop != val) { cm.display.scroller.scrollTop = val; } + } + + // Sync scroller and scrollbar, ensure the gutter elements are + // aligned. + function setScrollLeft(cm, val, isScroller, forceScroll) { + val = Math.min(val, cm.display.scroller.scrollWidth - cm.display.scroller.clientWidth); + if ((isScroller ? val == cm.doc.scrollLeft : Math.abs(cm.doc.scrollLeft - val) < 2) && !forceScroll) { return } + cm.doc.scrollLeft = val; + alignHorizontally(cm); + if (cm.display.scroller.scrollLeft != val) { cm.display.scroller.scrollLeft = val; } + cm.display.scrollbars.setScrollLeft(val); + } + + // SCROLLBARS + + // Prepare DOM reads needed to update the scrollbars. Done in one + // shot to minimize update/measure roundtrips. + function measureForScrollbars(cm) { + var d = cm.display, gutterW = d.gutters.offsetWidth; + var docH = Math.round(cm.doc.height + paddingVert(cm.display)); + return { + clientHeight: d.scroller.clientHeight, + viewHeight: d.wrapper.clientHeight, + scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth, + viewWidth: d.wrapper.clientWidth, + barLeft: cm.options.fixedGutter ? gutterW : 0, + docHeight: docH, + scrollHeight: docH + scrollGap(cm) + d.barHeight, + nativeBarWidth: d.nativeBarWidth, + gutterWidth: gutterW + } + } + + var NativeScrollbars = function(place, scroll, cm) { + this.cm = cm; + var vert = this.vert = elt("div", [elt("div", null, null, "min-width: 1px")], "CodeMirror-vscrollbar"); + var horiz = this.horiz = elt("div", [elt("div", null, null, "height: 100%; min-height: 1px")], "CodeMirror-hscrollbar"); + vert.tabIndex = horiz.tabIndex = -1; + place(vert); place(horiz); + + on(vert, "scroll", function () { + if (vert.clientHeight) { scroll(vert.scrollTop, "vertical"); } + }); + on(horiz, "scroll", function () { + if (horiz.clientWidth) { scroll(horiz.scrollLeft, "horizontal"); } + }); + + this.checkedZeroWidth = false; + // Need to set a minimum width to see the scrollbar on IE7 (but must not set it on IE8). + if (ie && ie_version < 8) { this.horiz.style.minHeight = this.vert.style.minWidth = "18px"; } + }; + + NativeScrollbars.prototype.update = function (measure) { + var needsH = measure.scrollWidth > measure.clientWidth + 1; + var needsV = measure.scrollHeight > measure.clientHeight + 1; + var sWidth = measure.nativeBarWidth; + + if (needsV) { + this.vert.style.display = "block"; + this.vert.style.bottom = needsH ? sWidth + "px" : "0"; + var totalHeight = measure.viewHeight - (needsH ? sWidth : 0); + // A bug in IE8 can cause this value to be negative, so guard it. + this.vert.firstChild.style.height = + Math.max(0, measure.scrollHeight - measure.clientHeight + totalHeight) + "px"; + } else { + this.vert.style.display = ""; + this.vert.firstChild.style.height = "0"; + } + + if (needsH) { + this.horiz.style.display = "block"; + this.horiz.style.right = needsV ? sWidth + "px" : "0"; + this.horiz.style.left = measure.barLeft + "px"; + var totalWidth = measure.viewWidth - measure.barLeft - (needsV ? sWidth : 0); + this.horiz.firstChild.style.width = + Math.max(0, measure.scrollWidth - measure.clientWidth + totalWidth) + "px"; + } else { + this.horiz.style.display = ""; + this.horiz.firstChild.style.width = "0"; + } + + if (!this.checkedZeroWidth && measure.clientHeight > 0) { + if (sWidth == 0) { this.zeroWidthHack(); } + this.checkedZeroWidth = true; + } + + return {right: needsV ? sWidth : 0, bottom: needsH ? sWidth : 0} + }; + + NativeScrollbars.prototype.setScrollLeft = function (pos) { + if (this.horiz.scrollLeft != pos) { this.horiz.scrollLeft = pos; } + if (this.disableHoriz) { this.enableZeroWidthBar(this.horiz, this.disableHoriz, "horiz"); } + }; + + NativeScrollbars.prototype.setScrollTop = function (pos) { + if (this.vert.scrollTop != pos) { this.vert.scrollTop = pos; } + if (this.disableVert) { this.enableZeroWidthBar(this.vert, this.disableVert, "vert"); } + }; + + NativeScrollbars.prototype.zeroWidthHack = function () { + var w = mac && !mac_geMountainLion ? "12px" : "18px"; + this.horiz.style.height = this.vert.style.width = w; + this.horiz.style.pointerEvents = this.vert.style.pointerEvents = "none"; + this.disableHoriz = new Delayed; + this.disableVert = new Delayed; + }; + + NativeScrollbars.prototype.enableZeroWidthBar = function (bar, delay, type) { + bar.style.pointerEvents = "auto"; + function maybeDisable() { + // To find out whether the scrollbar is still visible, we + // check whether the element under the pixel in the bottom + // right corner of the scrollbar box is the scrollbar box + // itself (when the bar is still visible) or its filler child + // (when the bar is hidden). If it is still visible, we keep + // it enabled, if it's hidden, we disable pointer events. + var box = bar.getBoundingClientRect(); + var elt$$1 = type == "vert" ? document.elementFromPoint(box.right - 1, (box.top + box.bottom) / 2) + : document.elementFromPoint((box.right + box.left) / 2, box.bottom - 1); + if (elt$$1 != bar) { bar.style.pointerEvents = "none"; } + else { delay.set(1000, maybeDisable); } + } + delay.set(1000, maybeDisable); + }; + + NativeScrollbars.prototype.clear = function () { + var parent = this.horiz.parentNode; + parent.removeChild(this.horiz); + parent.removeChild(this.vert); + }; + + var NullScrollbars = function () {}; + + NullScrollbars.prototype.update = function () { return {bottom: 0, right: 0} }; + NullScrollbars.prototype.setScrollLeft = function () {}; + NullScrollbars.prototype.setScrollTop = function () {}; + NullScrollbars.prototype.clear = function () {}; + + function updateScrollbars(cm, measure) { + if (!measure) { measure = measureForScrollbars(cm); } + var startWidth = cm.display.barWidth, startHeight = cm.display.barHeight; + updateScrollbarsInner(cm, measure); + for (var i = 0; i < 4 && startWidth != cm.display.barWidth || startHeight != cm.display.barHeight; i++) { + if (startWidth != cm.display.barWidth && cm.options.lineWrapping) + { updateHeightsInViewport(cm); } + updateScrollbarsInner(cm, measureForScrollbars(cm)); + startWidth = cm.display.barWidth; startHeight = cm.display.barHeight; + } + } + + // Re-synchronize the fake scrollbars with the actual size of the + // content. + function updateScrollbarsInner(cm, measure) { + var d = cm.display; + var sizes = d.scrollbars.update(measure); + + d.sizer.style.paddingRight = (d.barWidth = sizes.right) + "px"; + d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + "px"; + d.heightForcer.style.borderBottom = sizes.bottom + "px solid transparent"; + + if (sizes.right && sizes.bottom) { + d.scrollbarFiller.style.display = "block"; + d.scrollbarFiller.style.height = sizes.bottom + "px"; + d.scrollbarFiller.style.width = sizes.right + "px"; + } else { d.scrollbarFiller.style.display = ""; } + if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) { + d.gutterFiller.style.display = "block"; + d.gutterFiller.style.height = sizes.bottom + "px"; + d.gutterFiller.style.width = measure.gutterWidth + "px"; + } else { d.gutterFiller.style.display = ""; } + } + + var scrollbarModel = {"native": NativeScrollbars, "null": NullScrollbars}; + + function initScrollbars(cm) { + if (cm.display.scrollbars) { + cm.display.scrollbars.clear(); + if (cm.display.scrollbars.addClass) + { rmClass(cm.display.wrapper, cm.display.scrollbars.addClass); } + } + + cm.display.scrollbars = new scrollbarModel[cm.options.scrollbarStyle](function (node) { + cm.display.wrapper.insertBefore(node, cm.display.scrollbarFiller); + // Prevent clicks in the scrollbars from killing focus + on(node, "mousedown", function () { + if (cm.state.focused) { setTimeout(function () { return cm.display.input.focus(); }, 0); } + }); + node.setAttribute("cm-not-content", "true"); + }, function (pos, axis) { + if (axis == "horizontal") { setScrollLeft(cm, pos); } + else { updateScrollTop(cm, pos); } + }, cm); + if (cm.display.scrollbars.addClass) + { addClass(cm.display.wrapper, cm.display.scrollbars.addClass); } + } + + // Operations are used to wrap a series of changes to the editor + // state in such a way that each change won't have to update the + // cursor and display (which would be awkward, slow, and + // error-prone). Instead, display updates are batched and then all + // combined and executed at once. + + var nextOpId = 0; + // Start a new operation. + function startOperation(cm) { + cm.curOp = { + cm: cm, + viewChanged: false, // Flag that indicates that lines might need to be redrawn + startHeight: cm.doc.height, // Used to detect need to update scrollbar + forceUpdate: false, // Used to force a redraw + updateInput: 0, // Whether to reset the input textarea + typing: false, // Whether this reset should be careful to leave existing text (for compositing) + changeObjs: null, // Accumulated changes, for firing change events + cursorActivityHandlers: null, // Set of handlers to fire cursorActivity on + cursorActivityCalled: 0, // Tracks which cursorActivity handlers have been called already + selectionChanged: false, // Whether the selection needs to be redrawn + updateMaxLine: false, // Set when the widest line needs to be determined anew + scrollLeft: null, scrollTop: null, // Intermediate scroll position, not pushed to DOM yet + scrollToPos: null, // Used to scroll to a specific position + focus: false, + id: ++nextOpId // Unique ID + }; + pushOperation(cm.curOp); + } + + // Finish an operation, updating the display and signalling delayed events + function endOperation(cm) { + var op = cm.curOp; + if (op) { finishOperation(op, function (group) { + for (var i = 0; i < group.ops.length; i++) + { group.ops[i].cm.curOp = null; } + endOperations(group); + }); } + } + + // The DOM updates done when an operation finishes are batched so + // that the minimum number of relayouts are required. + function endOperations(group) { + var ops = group.ops; + for (var i = 0; i < ops.length; i++) // Read DOM + { endOperation_R1(ops[i]); } + for (var i$1 = 0; i$1 < ops.length; i$1++) // Write DOM (maybe) + { endOperation_W1(ops[i$1]); } + for (var i$2 = 0; i$2 < ops.length; i$2++) // Read DOM + { endOperation_R2(ops[i$2]); } + for (var i$3 = 0; i$3 < ops.length; i$3++) // Write DOM (maybe) + { endOperation_W2(ops[i$3]); } + for (var i$4 = 0; i$4 < ops.length; i$4++) // Read DOM + { endOperation_finish(ops[i$4]); } + } + + function endOperation_R1(op) { + var cm = op.cm, display = cm.display; + maybeClipScrollbars(cm); + if (op.updateMaxLine) { findMaxLine(cm); } + + op.mustUpdate = op.viewChanged || op.forceUpdate || op.scrollTop != null || + op.scrollToPos && (op.scrollToPos.from.line < display.viewFrom || + op.scrollToPos.to.line >= display.viewTo) || + display.maxLineChanged && cm.options.lineWrapping; + op.update = op.mustUpdate && + new DisplayUpdate(cm, op.mustUpdate && {top: op.scrollTop, ensure: op.scrollToPos}, op.forceUpdate); + } + + function endOperation_W1(op) { + op.updatedDisplay = op.mustUpdate && updateDisplayIfNeeded(op.cm, op.update); + } + + function endOperation_R2(op) { + var cm = op.cm, display = cm.display; + if (op.updatedDisplay) { updateHeightsInViewport(cm); } + + op.barMeasure = measureForScrollbars(cm); + + // If the max line changed since it was last measured, measure it, + // and ensure the document's width matches it. + // updateDisplay_W2 will use these properties to do the actual resizing + if (display.maxLineChanged && !cm.options.lineWrapping) { + op.adjustWidthTo = measureChar(cm, display.maxLine, display.maxLine.text.length).left + 3; + cm.display.sizerWidth = op.adjustWidthTo; + op.barMeasure.scrollWidth = + Math.max(display.scroller.clientWidth, display.sizer.offsetLeft + op.adjustWidthTo + scrollGap(cm) + cm.display.barWidth); + op.maxScrollLeft = Math.max(0, display.sizer.offsetLeft + op.adjustWidthTo - displayWidth(cm)); + } + + if (op.updatedDisplay || op.selectionChanged) + { op.preparedSelection = display.input.prepareSelection(); } + } + + function endOperation_W2(op) { + var cm = op.cm; + + if (op.adjustWidthTo != null) { + cm.display.sizer.style.minWidth = op.adjustWidthTo + "px"; + if (op.maxScrollLeft < cm.doc.scrollLeft) + { setScrollLeft(cm, Math.min(cm.display.scroller.scrollLeft, op.maxScrollLeft), true); } + cm.display.maxLineChanged = false; + } + + var takeFocus = op.focus && op.focus == activeElt(); + if (op.preparedSelection) + { cm.display.input.showSelection(op.preparedSelection, takeFocus); } + if (op.updatedDisplay || op.startHeight != cm.doc.height) + { updateScrollbars(cm, op.barMeasure); } + if (op.updatedDisplay) + { setDocumentHeight(cm, op.barMeasure); } + + if (op.selectionChanged) { restartBlink(cm); } + + if (cm.state.focused && op.updateInput) + { cm.display.input.reset(op.typing); } + if (takeFocus) { ensureFocus(op.cm); } + } + + function endOperation_finish(op) { + var cm = op.cm, display = cm.display, doc = cm.doc; + + if (op.updatedDisplay) { postUpdateDisplay(cm, op.update); } + + // Abort mouse wheel delta measurement, when scrolling explicitly + if (display.wheelStartX != null && (op.scrollTop != null || op.scrollLeft != null || op.scrollToPos)) + { display.wheelStartX = display.wheelStartY = null; } + + // Propagate the scroll position to the actual DOM scroller + if (op.scrollTop != null) { setScrollTop(cm, op.scrollTop, op.forceScroll); } + + if (op.scrollLeft != null) { setScrollLeft(cm, op.scrollLeft, true, true); } + // If we need to scroll a specific position into view, do so. + if (op.scrollToPos) { + var rect = scrollPosIntoView(cm, clipPos(doc, op.scrollToPos.from), + clipPos(doc, op.scrollToPos.to), op.scrollToPos.margin); + maybeScrollWindow(cm, rect); + } + + // Fire events for markers that are hidden/unidden by editing or + // undoing + var hidden = op.maybeHiddenMarkers, unhidden = op.maybeUnhiddenMarkers; + if (hidden) { for (var i = 0; i < hidden.length; ++i) + { if (!hidden[i].lines.length) { signal(hidden[i], "hide"); } } } + if (unhidden) { for (var i$1 = 0; i$1 < unhidden.length; ++i$1) + { if (unhidden[i$1].lines.length) { signal(unhidden[i$1], "unhide"); } } } + + if (display.wrapper.offsetHeight) + { doc.scrollTop = cm.display.scroller.scrollTop; } + + // Fire change events, and delayed event handlers + if (op.changeObjs) + { signal(cm, "changes", cm, op.changeObjs); } + if (op.update) + { op.update.finish(); } + } + + // Run the given function in an operation + function runInOp(cm, f) { + if (cm.curOp) { return f() } + startOperation(cm); + try { return f() } + finally { endOperation(cm); } + } + // Wraps a function in an operation. Returns the wrapped function. + function operation(cm, f) { + return function() { + if (cm.curOp) { return f.apply(cm, arguments) } + startOperation(cm); + try { return f.apply(cm, arguments) } + finally { endOperation(cm); } + } + } + // Used to add methods to editor and doc instances, wrapping them in + // operations. + function methodOp(f) { + return function() { + if (this.curOp) { return f.apply(this, arguments) } + startOperation(this); + try { return f.apply(this, arguments) } + finally { endOperation(this); } + } + } + function docMethodOp(f) { + return function() { + var cm = this.cm; + if (!cm || cm.curOp) { return f.apply(this, arguments) } + startOperation(cm); + try { return f.apply(this, arguments) } + finally { endOperation(cm); } + } + } + + // HIGHLIGHT WORKER + + function startWorker(cm, time) { + if (cm.doc.highlightFrontier < cm.display.viewTo) + { cm.state.highlight.set(time, bind(highlightWorker, cm)); } + } + + function highlightWorker(cm) { + var doc = cm.doc; + if (doc.highlightFrontier >= cm.display.viewTo) { return } + var end = +new Date + cm.options.workTime; + var context = getContextBefore(cm, doc.highlightFrontier); + var changedLines = []; + + doc.iter(context.line, Math.min(doc.first + doc.size, cm.display.viewTo + 500), function (line) { + if (context.line >= cm.display.viewFrom) { // Visible + var oldStyles = line.styles; + var resetState = line.text.length > cm.options.maxHighlightLength ? copyState(doc.mode, context.state) : null; + var highlighted = highlightLine(cm, line, context, true); + if (resetState) { context.state = resetState; } + line.styles = highlighted.styles; + var oldCls = line.styleClasses, newCls = highlighted.classes; + if (newCls) { line.styleClasses = newCls; } + else if (oldCls) { line.styleClasses = null; } + var ischange = !oldStyles || oldStyles.length != line.styles.length || + oldCls != newCls && (!oldCls || !newCls || oldCls.bgClass != newCls.bgClass || oldCls.textClass != newCls.textClass); + for (var i = 0; !ischange && i < oldStyles.length; ++i) { ischange = oldStyles[i] != line.styles[i]; } + if (ischange) { changedLines.push(context.line); } + line.stateAfter = context.save(); + context.nextLine(); + } else { + if (line.text.length <= cm.options.maxHighlightLength) + { processLine(cm, line.text, context); } + line.stateAfter = context.line % 5 == 0 ? context.save() : null; + context.nextLine(); + } + if (+new Date > end) { + startWorker(cm, cm.options.workDelay); + return true + } + }); + doc.highlightFrontier = context.line; + doc.modeFrontier = Math.max(doc.modeFrontier, context.line); + if (changedLines.length) { runInOp(cm, function () { + for (var i = 0; i < changedLines.length; i++) + { regLineChange(cm, changedLines[i], "text"); } + }); } + } + + // DISPLAY DRAWING + + var DisplayUpdate = function(cm, viewport, force) { + var display = cm.display; + + this.viewport = viewport; + // Store some values that we'll need later (but don't want to force a relayout for) + this.visible = visibleLines(display, cm.doc, viewport); + this.editorIsHidden = !display.wrapper.offsetWidth; + this.wrapperHeight = display.wrapper.clientHeight; + this.wrapperWidth = display.wrapper.clientWidth; + this.oldDisplayWidth = displayWidth(cm); + this.force = force; + this.dims = getDimensions(cm); + this.events = []; + }; + + DisplayUpdate.prototype.signal = function (emitter, type) { + if (hasHandler(emitter, type)) + { this.events.push(arguments); } + }; + DisplayUpdate.prototype.finish = function () { + var this$1 = this; + + for (var i = 0; i < this.events.length; i++) + { signal.apply(null, this$1.events[i]); } + }; + + function maybeClipScrollbars(cm) { + var display = cm.display; + if (!display.scrollbarsClipped && display.scroller.offsetWidth) { + display.nativeBarWidth = display.scroller.offsetWidth - display.scroller.clientWidth; + display.heightForcer.style.height = scrollGap(cm) + "px"; + display.sizer.style.marginBottom = -display.nativeBarWidth + "px"; + display.sizer.style.borderRightWidth = scrollGap(cm) + "px"; + display.scrollbarsClipped = true; + } + } + + function selectionSnapshot(cm) { + if (cm.hasFocus()) { return null } + var active = activeElt(); + if (!active || !contains(cm.display.lineDiv, active)) { return null } + var result = {activeElt: active}; + if (window.getSelection) { + var sel = window.getSelection(); + if (sel.anchorNode && sel.extend && contains(cm.display.lineDiv, sel.anchorNode)) { + result.anchorNode = sel.anchorNode; + result.anchorOffset = sel.anchorOffset; + result.focusNode = sel.focusNode; + result.focusOffset = sel.focusOffset; + } + } + return result + } + + function restoreSelection(snapshot) { + if (!snapshot || !snapshot.activeElt || snapshot.activeElt == activeElt()) { return } + snapshot.activeElt.focus(); + if (snapshot.anchorNode && contains(document.body, snapshot.anchorNode) && contains(document.body, snapshot.focusNode)) { + var sel = window.getSelection(), range$$1 = document.createRange(); + range$$1.setEnd(snapshot.anchorNode, snapshot.anchorOffset); + range$$1.collapse(false); + sel.removeAllRanges(); + sel.addRange(range$$1); + sel.extend(snapshot.focusNode, snapshot.focusOffset); + } + } + + // Does the actual updating of the line display. Bails out + // (returning false) when there is nothing to be done and forced is + // false. + function updateDisplayIfNeeded(cm, update) { + var display = cm.display, doc = cm.doc; + + if (update.editorIsHidden) { + resetView(cm); + return false + } + + // Bail out if the visible area is already rendered and nothing changed. + if (!update.force && + update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo && + (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) && + display.renderedView == display.view && countDirtyView(cm) == 0) + { return false } + + if (maybeUpdateLineNumberWidth(cm)) { + resetView(cm); + update.dims = getDimensions(cm); + } + + // Compute a suitable new viewport (from & to) + var end = doc.first + doc.size; + var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first); + var to = Math.min(end, update.visible.to + cm.options.viewportMargin); + if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); } + if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); } + if (sawCollapsedSpans) { + from = visualLineNo(cm.doc, from); + to = visualLineEndNo(cm.doc, to); + } + + var different = from != display.viewFrom || to != display.viewTo || + display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth; + adjustView(cm, from, to); + + display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom)); + // Position the mover div to align with the current scroll position + cm.display.mover.style.top = display.viewOffset + "px"; + + var toUpdate = countDirtyView(cm); + if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view && + (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo)) + { return false } + + // For big changes, we hide the enclosing element during the + // update, since that speeds up the operations on most browsers. + var selSnapshot = selectionSnapshot(cm); + if (toUpdate > 4) { display.lineDiv.style.display = "none"; } + patchDisplay(cm, display.updateLineNumbers, update.dims); + if (toUpdate > 4) { display.lineDiv.style.display = ""; } + display.renderedView = display.view; + // There might have been a widget with a focused element that got + // hidden or updated, if so re-focus it. + restoreSelection(selSnapshot); + + // Prevent selection and cursors from interfering with the scroll + // width and height. + removeChildren(display.cursorDiv); + removeChildren(display.selectionDiv); + display.gutters.style.height = display.sizer.style.minHeight = 0; + + if (different) { + display.lastWrapHeight = update.wrapperHeight; + display.lastWrapWidth = update.wrapperWidth; + startWorker(cm, 400); + } + + display.updateLineNumbers = null; + + return true + } + + function postUpdateDisplay(cm, update) { + var viewport = update.viewport; + + for (var first = true;; first = false) { + if (!first || !cm.options.lineWrapping || update.oldDisplayWidth == displayWidth(cm)) { + // Clip forced viewport to actual scrollable area. + if (viewport && viewport.top != null) + { viewport = {top: Math.min(cm.doc.height + paddingVert(cm.display) - displayHeight(cm), viewport.top)}; } + // Updated line heights might result in the drawn area not + // actually covering the viewport. Keep looping until it does. + update.visible = visibleLines(cm.display, cm.doc, viewport); + if (update.visible.from >= cm.display.viewFrom && update.visible.to <= cm.display.viewTo) + { break } + } + if (!updateDisplayIfNeeded(cm, update)) { break } + updateHeightsInViewport(cm); + var barMeasure = measureForScrollbars(cm); + updateSelection(cm); + updateScrollbars(cm, barMeasure); + setDocumentHeight(cm, barMeasure); + update.force = false; + } + + update.signal(cm, "update", cm); + if (cm.display.viewFrom != cm.display.reportedViewFrom || cm.display.viewTo != cm.display.reportedViewTo) { + update.signal(cm, "viewportChange", cm, cm.display.viewFrom, cm.display.viewTo); + cm.display.reportedViewFrom = cm.display.viewFrom; cm.display.reportedViewTo = cm.display.viewTo; + } + } + + function updateDisplaySimple(cm, viewport) { + var update = new DisplayUpdate(cm, viewport); + if (updateDisplayIfNeeded(cm, update)) { + updateHeightsInViewport(cm); + postUpdateDisplay(cm, update); + var barMeasure = measureForScrollbars(cm); + updateSelection(cm); + updateScrollbars(cm, barMeasure); + setDocumentHeight(cm, barMeasure); + update.finish(); + } + } + + // Sync the actual display DOM structure with display.view, removing + // nodes for lines that are no longer in view, and creating the ones + // that are not there yet, and updating the ones that are out of + // date. + function patchDisplay(cm, updateNumbersFrom, dims) { + var display = cm.display, lineNumbers = cm.options.lineNumbers; + var container = display.lineDiv, cur = container.firstChild; + + function rm(node) { + var next = node.nextSibling; + // Works around a throw-scroll bug in OS X Webkit + if (webkit && mac && cm.display.currentWheelTarget == node) + { node.style.display = "none"; } + else + { node.parentNode.removeChild(node); } + return next + } + + var view = display.view, lineN = display.viewFrom; + // Loop over the elements in the view, syncing cur (the DOM nodes + // in display.lineDiv) with the view as we go. + for (var i = 0; i < view.length; i++) { + var lineView = view[i]; + if (lineView.hidden) ; else if (!lineView.node || lineView.node.parentNode != container) { // Not drawn yet + var node = buildLineElement(cm, lineView, lineN, dims); + container.insertBefore(node, cur); + } else { // Already drawn + while (cur != lineView.node) { cur = rm(cur); } + var updateNumber = lineNumbers && updateNumbersFrom != null && + updateNumbersFrom <= lineN && lineView.lineNumber; + if (lineView.changes) { + if (indexOf(lineView.changes, "gutter") > -1) { updateNumber = false; } + updateLineForChanges(cm, lineView, lineN, dims); + } + if (updateNumber) { + removeChildren(lineView.lineNumber); + lineView.lineNumber.appendChild(document.createTextNode(lineNumberFor(cm.options, lineN))); + } + cur = lineView.node.nextSibling; + } + lineN += lineView.size; + } + while (cur) { cur = rm(cur); } + } + + function updateGutterSpace(display) { + var width = display.gutters.offsetWidth; + display.sizer.style.marginLeft = width + "px"; + } + + function setDocumentHeight(cm, measure) { + cm.display.sizer.style.minHeight = measure.docHeight + "px"; + cm.display.heightForcer.style.top = measure.docHeight + "px"; + cm.display.gutters.style.height = (measure.docHeight + cm.display.barHeight + scrollGap(cm)) + "px"; + } + + // Re-align line numbers and gutter marks to compensate for + // horizontal scrolling. + function alignHorizontally(cm) { + var display = cm.display, view = display.view; + if (!display.alignWidgets && (!display.gutters.firstChild || !cm.options.fixedGutter)) { return } + var comp = compensateForHScroll(display) - display.scroller.scrollLeft + cm.doc.scrollLeft; + var gutterW = display.gutters.offsetWidth, left = comp + "px"; + for (var i = 0; i < view.length; i++) { if (!view[i].hidden) { + if (cm.options.fixedGutter) { + if (view[i].gutter) + { view[i].gutter.style.left = left; } + if (view[i].gutterBackground) + { view[i].gutterBackground.style.left = left; } + } + var align = view[i].alignable; + if (align) { for (var j = 0; j < align.length; j++) + { align[j].style.left = left; } } + } } + if (cm.options.fixedGutter) + { display.gutters.style.left = (comp + gutterW) + "px"; } + } + + // Used to ensure that the line number gutter is still the right + // size for the current document size. Returns true when an update + // is needed. + function maybeUpdateLineNumberWidth(cm) { + if (!cm.options.lineNumbers) { return false } + var doc = cm.doc, last = lineNumberFor(cm.options, doc.first + doc.size - 1), display = cm.display; + if (last.length != display.lineNumChars) { + var test = display.measure.appendChild(elt("div", [elt("div", last)], + "CodeMirror-linenumber CodeMirror-gutter-elt")); + var innerW = test.firstChild.offsetWidth, padding = test.offsetWidth - innerW; + display.lineGutter.style.width = ""; + display.lineNumInnerWidth = Math.max(innerW, display.lineGutter.offsetWidth - padding) + 1; + display.lineNumWidth = display.lineNumInnerWidth + padding; + display.lineNumChars = display.lineNumInnerWidth ? last.length : -1; + display.lineGutter.style.width = display.lineNumWidth + "px"; + updateGutterSpace(cm.display); + return true + } + return false + } + + function getGutters(gutters, lineNumbers) { + var result = [], sawLineNumbers = false; + for (var i = 0; i < gutters.length; i++) { + var name = gutters[i], style = null; + if (typeof name != "string") { style = name.style; name = name.className; } + if (name == "CodeMirror-linenumbers") { + if (!lineNumbers) { continue } + else { sawLineNumbers = true; } + } + result.push({className: name, style: style}); + } + if (lineNumbers && !sawLineNumbers) { result.push({className: "CodeMirror-linenumbers", style: null}); } + return result + } + + // Rebuild the gutter elements, ensure the margin to the left of the + // code matches their width. + function renderGutters(display) { + var gutters = display.gutters, specs = display.gutterSpecs; + removeChildren(gutters); + display.lineGutter = null; + for (var i = 0; i < specs.length; ++i) { + var ref = specs[i]; + var className = ref.className; + var style = ref.style; + var gElt = gutters.appendChild(elt("div", null, "CodeMirror-gutter " + className)); + if (style) { gElt.style.cssText = style; } + if (className == "CodeMirror-linenumbers") { + display.lineGutter = gElt; + gElt.style.width = (display.lineNumWidth || 1) + "px"; + } + } + gutters.style.display = specs.length ? "" : "none"; + updateGutterSpace(display); + } + + function updateGutters(cm) { + renderGutters(cm.display); + regChange(cm); + alignHorizontally(cm); + } + + // The display handles the DOM integration, both for input reading + // and content drawing. It holds references to DOM nodes and + // display-related state. + + function Display(place, doc, input, options) { + var d = this; + this.input = input; + + // Covers bottom-right square when both scrollbars are present. + d.scrollbarFiller = elt("div", null, "CodeMirror-scrollbar-filler"); + d.scrollbarFiller.setAttribute("cm-not-content", "true"); + // Covers bottom of gutter when coverGutterNextToScrollbar is on + // and h scrollbar is present. + d.gutterFiller = elt("div", null, "CodeMirror-gutter-filler"); + d.gutterFiller.setAttribute("cm-not-content", "true"); + // Will contain the actual code, positioned to cover the viewport. + d.lineDiv = eltP("div", null, "CodeMirror-code"); + // Elements are added to these to represent selection and cursors. + d.selectionDiv = elt("div", null, null, "position: relative; z-index: 1"); + d.cursorDiv = elt("div", null, "CodeMirror-cursors"); + // A visibility: hidden element used to find the size of things. + d.measure = elt("div", null, "CodeMirror-measure"); + // When lines outside of the viewport are measured, they are drawn in this. + d.lineMeasure = elt("div", null, "CodeMirror-measure"); + // Wraps everything that needs to exist inside the vertically-padded coordinate system + d.lineSpace = eltP("div", [d.measure, d.lineMeasure, d.selectionDiv, d.cursorDiv, d.lineDiv], + null, "position: relative; outline: none"); + var lines = eltP("div", [d.lineSpace], "CodeMirror-lines"); + // Moved around its parent to cover visible view. + d.mover = elt("div", [lines], null, "position: relative"); + // Set to the height of the document, allowing scrolling. + d.sizer = elt("div", [d.mover], "CodeMirror-sizer"); + d.sizerWidth = null; + // Behavior of elts with overflow: auto and padding is + // inconsistent across browsers. This is used to ensure the + // scrollable area is big enough. + d.heightForcer = elt("div", null, null, "position: absolute; height: " + scrollerGap + "px; width: 1px;"); + // Will contain the gutters, if any. + d.gutters = elt("div", null, "CodeMirror-gutters"); + d.lineGutter = null; + // Actual scrollable element. + d.scroller = elt("div", [d.sizer, d.heightForcer, d.gutters], "CodeMirror-scroll"); + d.scroller.setAttribute("tabIndex", "-1"); + // The element in which the editor lives. + d.wrapper = elt("div", [d.scrollbarFiller, d.gutterFiller, d.scroller], "CodeMirror"); + + // Work around IE7 z-index bug (not perfect, hence IE7 not really being supported) + if (ie && ie_version < 8) { d.gutters.style.zIndex = -1; d.scroller.style.paddingRight = 0; } + if (!webkit && !(gecko && mobile)) { d.scroller.draggable = true; } + + if (place) { + if (place.appendChild) { place.appendChild(d.wrapper); } + else { place(d.wrapper); } + } + + // Current rendered range (may be bigger than the view window). + d.viewFrom = d.viewTo = doc.first; + d.reportedViewFrom = d.reportedViewTo = doc.first; + // Information about the rendered lines. + d.view = []; + d.renderedView = null; + // Holds info about a single rendered line when it was rendered + // for measurement, while not in view. + d.externalMeasured = null; + // Empty space (in pixels) above the view + d.viewOffset = 0; + d.lastWrapHeight = d.lastWrapWidth = 0; + d.updateLineNumbers = null; + + d.nativeBarWidth = d.barHeight = d.barWidth = 0; + d.scrollbarsClipped = false; + + // Used to only resize the line number gutter when necessary (when + // the amount of lines crosses a boundary that makes its width change) + d.lineNumWidth = d.lineNumInnerWidth = d.lineNumChars = null; + // Set to true when a non-horizontal-scrolling line widget is + // added. As an optimization, line widget aligning is skipped when + // this is false. + d.alignWidgets = false; + + d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; + + // Tracks the maximum line length so that the horizontal scrollbar + // can be kept static when scrolling. + d.maxLine = null; + d.maxLineLength = 0; + d.maxLineChanged = false; + + // Used for measuring wheel scrolling granularity + d.wheelDX = d.wheelDY = d.wheelStartX = d.wheelStartY = null; + + // True when shift is held down. + d.shift = false; + + // Used to track whether anything happened since the context menu + // was opened. + d.selForContextMenu = null; + + d.activeTouch = null; + + d.gutterSpecs = getGutters(options.gutters, options.lineNumbers); + renderGutters(d); + + input.init(d); + } + + // Since the delta values reported on mouse wheel events are + // unstandardized between browsers and even browser versions, and + // generally horribly unpredictable, this code starts by measuring + // the scroll effect that the first few mouse wheel events have, + // and, from that, detects the way it can convert deltas to pixel + // offsets afterwards. + // + // The reason we want to know the amount a wheel event will scroll + // is that it gives us a chance to update the display before the + // actual scrolling happens, reducing flickering. + + var wheelSamples = 0, wheelPixelsPerUnit = null; + // Fill in a browser-detected starting value on browsers where we + // know one. These don't have to be accurate -- the result of them + // being wrong would just be a slight flicker on the first wheel + // scroll (if it is large enough). + if (ie) { wheelPixelsPerUnit = -.53; } + else if (gecko) { wheelPixelsPerUnit = 15; } + else if (chrome) { wheelPixelsPerUnit = -.7; } + else if (safari) { wheelPixelsPerUnit = -1/3; } + + function wheelEventDelta(e) { + var dx = e.wheelDeltaX, dy = e.wheelDeltaY; + if (dx == null && e.detail && e.axis == e.HORIZONTAL_AXIS) { dx = e.detail; } + if (dy == null && e.detail && e.axis == e.VERTICAL_AXIS) { dy = e.detail; } + else if (dy == null) { dy = e.wheelDelta; } + return {x: dx, y: dy} + } + function wheelEventPixels(e) { + var delta = wheelEventDelta(e); + delta.x *= wheelPixelsPerUnit; + delta.y *= wheelPixelsPerUnit; + return delta + } + + function onScrollWheel(cm, e) { + var delta = wheelEventDelta(e), dx = delta.x, dy = delta.y; + + var display = cm.display, scroll = display.scroller; + // Quit if there's nothing to scroll here + var canScrollX = scroll.scrollWidth > scroll.clientWidth; + var canScrollY = scroll.scrollHeight > scroll.clientHeight; + if (!(dx && canScrollX || dy && canScrollY)) { return } + + // Webkit browsers on OS X abort momentum scrolls when the target + // of the scroll event is removed from the scrollable element. + // This hack (see related code in patchDisplay) makes sure the + // element is kept around. + if (dy && mac && webkit) { + outer: for (var cur = e.target, view = display.view; cur != scroll; cur = cur.parentNode) { + for (var i = 0; i < view.length; i++) { + if (view[i].node == cur) { + cm.display.currentWheelTarget = cur; + break outer + } + } + } + } + + // On some browsers, horizontal scrolling will cause redraws to + // happen before the gutter has been realigned, causing it to + // wriggle around in a most unseemly way. When we have an + // estimated pixels/delta value, we just handle horizontal + // scrolling entirely here. It'll be slightly off from native, but + // better than glitching out. + if (dx && !gecko && !presto && wheelPixelsPerUnit != null) { + if (dy && canScrollY) + { updateScrollTop(cm, Math.max(0, scroll.scrollTop + dy * wheelPixelsPerUnit)); } + setScrollLeft(cm, Math.max(0, scroll.scrollLeft + dx * wheelPixelsPerUnit)); + // Only prevent default scrolling if vertical scrolling is + // actually possible. Otherwise, it causes vertical scroll + // jitter on OSX trackpads when deltaX is small and deltaY + // is large (issue #3579) + if (!dy || (dy && canScrollY)) + { e_preventDefault(e); } + display.wheelStartX = null; // Abort measurement, if in progress + return + } + + // 'Project' the visible viewport to cover the area that is being + // scrolled into view (if we know enough to estimate it). + if (dy && wheelPixelsPerUnit != null) { + var pixels = dy * wheelPixelsPerUnit; + var top = cm.doc.scrollTop, bot = top + display.wrapper.clientHeight; + if (pixels < 0) { top = Math.max(0, top + pixels - 50); } + else { bot = Math.min(cm.doc.height, bot + pixels + 50); } + updateDisplaySimple(cm, {top: top, bottom: bot}); + } + + if (wheelSamples < 20) { + if (display.wheelStartX == null) { + display.wheelStartX = scroll.scrollLeft; display.wheelStartY = scroll.scrollTop; + display.wheelDX = dx; display.wheelDY = dy; + setTimeout(function () { + if (display.wheelStartX == null) { return } + var movedX = scroll.scrollLeft - display.wheelStartX; + var movedY = scroll.scrollTop - display.wheelStartY; + var sample = (movedY && display.wheelDY && movedY / display.wheelDY) || + (movedX && display.wheelDX && movedX / display.wheelDX); + display.wheelStartX = display.wheelStartY = null; + if (!sample) { return } + wheelPixelsPerUnit = (wheelPixelsPerUnit * wheelSamples + sample) / (wheelSamples + 1); + ++wheelSamples; + }, 200); + } else { + display.wheelDX += dx; display.wheelDY += dy; + } + } + } + + // Selection objects are immutable. A new one is created every time + // the selection changes. A selection is one or more non-overlapping + // (and non-touching) ranges, sorted, and an integer that indicates + // which one is the primary selection (the one that's scrolled into + // view, that getCursor returns, etc). + var Selection = function(ranges, primIndex) { + this.ranges = ranges; + this.primIndex = primIndex; + }; + + Selection.prototype.primary = function () { return this.ranges[this.primIndex] }; + + Selection.prototype.equals = function (other) { + var this$1 = this; + + if (other == this) { return true } + if (other.primIndex != this.primIndex || other.ranges.length != this.ranges.length) { return false } + for (var i = 0; i < this.ranges.length; i++) { + var here = this$1.ranges[i], there = other.ranges[i]; + if (!equalCursorPos(here.anchor, there.anchor) || !equalCursorPos(here.head, there.head)) { return false } + } + return true + }; + + Selection.prototype.deepCopy = function () { + var this$1 = this; + + var out = []; + for (var i = 0; i < this.ranges.length; i++) + { out[i] = new Range(copyPos(this$1.ranges[i].anchor), copyPos(this$1.ranges[i].head)); } + return new Selection(out, this.primIndex) + }; + + Selection.prototype.somethingSelected = function () { + var this$1 = this; + + for (var i = 0; i < this.ranges.length; i++) + { if (!this$1.ranges[i].empty()) { return true } } + return false + }; + + Selection.prototype.contains = function (pos, end) { + var this$1 = this; + + if (!end) { end = pos; } + for (var i = 0; i < this.ranges.length; i++) { + var range = this$1.ranges[i]; + if (cmp(end, range.from()) >= 0 && cmp(pos, range.to()) <= 0) + { return i } + } + return -1 + }; + + var Range = function(anchor, head) { + this.anchor = anchor; this.head = head; + }; + + Range.prototype.from = function () { return minPos(this.anchor, this.head) }; + Range.prototype.to = function () { return maxPos(this.anchor, this.head) }; + Range.prototype.empty = function () { return this.head.line == this.anchor.line && this.head.ch == this.anchor.ch }; + + // Take an unsorted, potentially overlapping set of ranges, and + // build a selection out of it. 'Consumes' ranges array (modifying + // it). + function normalizeSelection(cm, ranges, primIndex) { + var mayTouch = cm && cm.options.selectionsMayTouch; + var prim = ranges[primIndex]; + ranges.sort(function (a, b) { return cmp(a.from(), b.from()); }); + primIndex = indexOf(ranges, prim); + for (var i = 1; i < ranges.length; i++) { + var cur = ranges[i], prev = ranges[i - 1]; + var diff = cmp(prev.to(), cur.from()); + if (mayTouch && !cur.empty() ? diff > 0 : diff >= 0) { + var from = minPos(prev.from(), cur.from()), to = maxPos(prev.to(), cur.to()); + var inv = prev.empty() ? cur.from() == cur.head : prev.from() == prev.head; + if (i <= primIndex) { --primIndex; } + ranges.splice(--i, 2, new Range(inv ? to : from, inv ? from : to)); + } + } + return new Selection(ranges, primIndex) + } + + function simpleSelection(anchor, head) { + return new Selection([new Range(anchor, head || anchor)], 0) + } + + // Compute the position of the end of a change (its 'to' property + // refers to the pre-change end). + function changeEnd(change) { + if (!change.text) { return change.to } + return Pos(change.from.line + change.text.length - 1, + lst(change.text).length + (change.text.length == 1 ? change.from.ch : 0)) + } + + // Adjust a position to refer to the post-change position of the + // same text, or the end of the change if the change covers it. + function adjustForChange(pos, change) { + if (cmp(pos, change.from) < 0) { return pos } + if (cmp(pos, change.to) <= 0) { return changeEnd(change) } + + var line = pos.line + change.text.length - (change.to.line - change.from.line) - 1, ch = pos.ch; + if (pos.line == change.to.line) { ch += changeEnd(change).ch - change.to.ch; } + return Pos(line, ch) + } + + function computeSelAfterChange(doc, change) { + var out = []; + for (var i = 0; i < doc.sel.ranges.length; i++) { + var range = doc.sel.ranges[i]; + out.push(new Range(adjustForChange(range.anchor, change), + adjustForChange(range.head, change))); + } + return normalizeSelection(doc.cm, out, doc.sel.primIndex) + } + + function offsetPos(pos, old, nw) { + if (pos.line == old.line) + { return Pos(nw.line, pos.ch - old.ch + nw.ch) } + else + { return Pos(nw.line + (pos.line - old.line), pos.ch) } + } + + // Used by replaceSelections to allow moving the selection to the + // start or around the replaced test. Hint may be "start" or "around". + function computeReplacedSel(doc, changes, hint) { + var out = []; + var oldPrev = Pos(doc.first, 0), newPrev = oldPrev; + for (var i = 0; i < changes.length; i++) { + var change = changes[i]; + var from = offsetPos(change.from, oldPrev, newPrev); + var to = offsetPos(changeEnd(change), oldPrev, newPrev); + oldPrev = change.to; + newPrev = to; + if (hint == "around") { + var range = doc.sel.ranges[i], inv = cmp(range.head, range.anchor) < 0; + out[i] = new Range(inv ? to : from, inv ? from : to); + } else { + out[i] = new Range(from, from); + } + } + return new Selection(out, doc.sel.primIndex) + } + + // Used to get the editor into a consistent state again when options change. + + function loadMode(cm) { + cm.doc.mode = getMode(cm.options, cm.doc.modeOption); + resetModeState(cm); + } + + function resetModeState(cm) { + cm.doc.iter(function (line) { + if (line.stateAfter) { line.stateAfter = null; } + if (line.styles) { line.styles = null; } + }); + cm.doc.modeFrontier = cm.doc.highlightFrontier = cm.doc.first; + startWorker(cm, 100); + cm.state.modeGen++; + if (cm.curOp) { regChange(cm); } + } + + // DOCUMENT DATA STRUCTURE + + // By default, updates that start and end at the beginning of a line + // are treated specially, in order to make the association of line + // widgets and marker elements with the text behave more intuitive. + function isWholeLineUpdate(doc, change) { + return change.from.ch == 0 && change.to.ch == 0 && lst(change.text) == "" && + (!doc.cm || doc.cm.options.wholeLineUpdateBefore) + } + + // Perform a change on the document data structure. + function updateDoc(doc, change, markedSpans, estimateHeight$$1) { + function spansFor(n) {return markedSpans ? markedSpans[n] : null} + function update(line, text, spans) { + updateLine(line, text, spans, estimateHeight$$1); + signalLater(line, "change", line, change); + } + function linesFor(start, end) { + var result = []; + for (var i = start; i < end; ++i) + { result.push(new Line(text[i], spansFor(i), estimateHeight$$1)); } + return result + } + + var from = change.from, to = change.to, text = change.text; + var firstLine = getLine(doc, from.line), lastLine = getLine(doc, to.line); + var lastText = lst(text), lastSpans = spansFor(text.length - 1), nlines = to.line - from.line; + + // Adjust the line structure + if (change.full) { + doc.insert(0, linesFor(0, text.length)); + doc.remove(text.length, doc.size - text.length); + } else if (isWholeLineUpdate(doc, change)) { + // This is a whole-line replace. Treated specially to make + // sure line objects move the way they are supposed to. + var added = linesFor(0, text.length - 1); + update(lastLine, lastLine.text, lastSpans); + if (nlines) { doc.remove(from.line, nlines); } + if (added.length) { doc.insert(from.line, added); } + } else if (firstLine == lastLine) { + if (text.length == 1) { + update(firstLine, firstLine.text.slice(0, from.ch) + lastText + firstLine.text.slice(to.ch), lastSpans); + } else { + var added$1 = linesFor(1, text.length - 1); + added$1.push(new Line(lastText + firstLine.text.slice(to.ch), lastSpans, estimateHeight$$1)); + update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); + doc.insert(from.line + 1, added$1); + } + } else if (text.length == 1) { + update(firstLine, firstLine.text.slice(0, from.ch) + text[0] + lastLine.text.slice(to.ch), spansFor(0)); + doc.remove(from.line + 1, nlines); + } else { + update(firstLine, firstLine.text.slice(0, from.ch) + text[0], spansFor(0)); + update(lastLine, lastText + lastLine.text.slice(to.ch), lastSpans); + var added$2 = linesFor(1, text.length - 1); + if (nlines > 1) { doc.remove(from.line + 1, nlines - 1); } + doc.insert(from.line + 1, added$2); + } + + signalLater(doc, "change", doc, change); + } + + // Call f for all linked documents. + function linkedDocs(doc, f, sharedHistOnly) { + function propagate(doc, skip, sharedHist) { + if (doc.linked) { for (var i = 0; i < doc.linked.length; ++i) { + var rel = doc.linked[i]; + if (rel.doc == skip) { continue } + var shared = sharedHist && rel.sharedHist; + if (sharedHistOnly && !shared) { continue } + f(rel.doc, shared); + propagate(rel.doc, doc, shared); + } } + } + propagate(doc, null, true); + } + + // Attach a document to an editor. + function attachDoc(cm, doc) { + if (doc.cm) { throw new Error("This document is already in use.") } + cm.doc = doc; + doc.cm = cm; + estimateLineHeights(cm); + loadMode(cm); + setDirectionClass(cm); + if (!cm.options.lineWrapping) { findMaxLine(cm); } + cm.options.mode = doc.modeOption; + regChange(cm); + } + + function setDirectionClass(cm) { + (cm.doc.direction == "rtl" ? addClass : rmClass)(cm.display.lineDiv, "CodeMirror-rtl"); + } + + function directionChanged(cm) { + runInOp(cm, function () { + setDirectionClass(cm); + regChange(cm); + }); + } + + function History(startGen) { + // Arrays of change events and selections. Doing something adds an + // event to done and clears undo. Undoing moves events from done + // to undone, redoing moves them in the other direction. + this.done = []; this.undone = []; + this.undoDepth = Infinity; + // Used to track when changes can be merged into a single undo + // event + this.lastModTime = this.lastSelTime = 0; + this.lastOp = this.lastSelOp = null; + this.lastOrigin = this.lastSelOrigin = null; + // Used by the isClean() method + this.generation = this.maxGeneration = startGen || 1; + } + + // Create a history change event from an updateDoc-style change + // object. + function historyChangeFromChange(doc, change) { + var histChange = {from: copyPos(change.from), to: changeEnd(change), text: getBetween(doc, change.from, change.to)}; + attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); + linkedDocs(doc, function (doc) { return attachLocalSpans(doc, histChange, change.from.line, change.to.line + 1); }, true); + return histChange + } + + // Pop all selection events off the end of a history array. Stop at + // a change event. + function clearSelectionEvents(array) { + while (array.length) { + var last = lst(array); + if (last.ranges) { array.pop(); } + else { break } + } + } + + // Find the top change event in the history. Pop off selection + // events that are in the way. + function lastChangeEvent(hist, force) { + if (force) { + clearSelectionEvents(hist.done); + return lst(hist.done) + } else if (hist.done.length && !lst(hist.done).ranges) { + return lst(hist.done) + } else if (hist.done.length > 1 && !hist.done[hist.done.length - 2].ranges) { + hist.done.pop(); + return lst(hist.done) + } + } + + // Register a change in the history. Merges changes that are within + // a single operation, or are close together with an origin that + // allows merging (starting with "+") into a single event. + function addChangeToHistory(doc, change, selAfter, opId) { + var hist = doc.history; + hist.undone.length = 0; + var time = +new Date, cur; + var last; + + if ((hist.lastOp == opId || + hist.lastOrigin == change.origin && change.origin && + ((change.origin.charAt(0) == "+" && hist.lastModTime > time - (doc.cm ? doc.cm.options.historyEventDelay : 500)) || + change.origin.charAt(0) == "*")) && + (cur = lastChangeEvent(hist, hist.lastOp == opId))) { + // Merge this change into the last event + last = lst(cur.changes); + if (cmp(change.from, change.to) == 0 && cmp(change.from, last.to) == 0) { + // Optimized case for simple insertion -- don't want to add + // new changesets for every character typed + last.to = changeEnd(change); + } else { + // Add new sub-event + cur.changes.push(historyChangeFromChange(doc, change)); + } + } else { + // Can not be merged, start a new event. + var before = lst(hist.done); + if (!before || !before.ranges) + { pushSelectionToHistory(doc.sel, hist.done); } + cur = {changes: [historyChangeFromChange(doc, change)], + generation: hist.generation}; + hist.done.push(cur); + while (hist.done.length > hist.undoDepth) { + hist.done.shift(); + if (!hist.done[0].ranges) { hist.done.shift(); } + } + } + hist.done.push(selAfter); + hist.generation = ++hist.maxGeneration; + hist.lastModTime = hist.lastSelTime = time; + hist.lastOp = hist.lastSelOp = opId; + hist.lastOrigin = hist.lastSelOrigin = change.origin; + + if (!last) { signal(doc, "historyAdded"); } + } + + function selectionEventCanBeMerged(doc, origin, prev, sel) { + var ch = origin.charAt(0); + return ch == "*" || + ch == "+" && + prev.ranges.length == sel.ranges.length && + prev.somethingSelected() == sel.somethingSelected() && + new Date - doc.history.lastSelTime <= (doc.cm ? doc.cm.options.historyEventDelay : 500) + } + + // Called whenever the selection changes, sets the new selection as + // the pending selection in the history, and pushes the old pending + // selection into the 'done' array when it was significantly + // different (in number of selected ranges, emptiness, or time). + function addSelectionToHistory(doc, sel, opId, options) { + var hist = doc.history, origin = options && options.origin; + + // A new event is started when the previous origin does not match + // the current, or the origins don't allow matching. Origins + // starting with * are always merged, those starting with + are + // merged when similar and close together in time. + if (opId == hist.lastSelOp || + (origin && hist.lastSelOrigin == origin && + (hist.lastModTime == hist.lastSelTime && hist.lastOrigin == origin || + selectionEventCanBeMerged(doc, origin, lst(hist.done), sel)))) + { hist.done[hist.done.length - 1] = sel; } + else + { pushSelectionToHistory(sel, hist.done); } + + hist.lastSelTime = +new Date; + hist.lastSelOrigin = origin; + hist.lastSelOp = opId; + if (options && options.clearRedo !== false) + { clearSelectionEvents(hist.undone); } + } + + function pushSelectionToHistory(sel, dest) { + var top = lst(dest); + if (!(top && top.ranges && top.equals(sel))) + { dest.push(sel); } + } + + // Used to store marked span information in the history. + function attachLocalSpans(doc, change, from, to) { + var existing = change["spans_" + doc.id], n = 0; + doc.iter(Math.max(doc.first, from), Math.min(doc.first + doc.size, to), function (line) { + if (line.markedSpans) + { (existing || (existing = change["spans_" + doc.id] = {}))[n] = line.markedSpans; } + ++n; + }); + } + + // When un/re-doing restores text containing marked spans, those + // that have been explicitly cleared should not be restored. + function removeClearedSpans(spans) { + if (!spans) { return null } + var out; + for (var i = 0; i < spans.length; ++i) { + if (spans[i].marker.explicitlyCleared) { if (!out) { out = spans.slice(0, i); } } + else if (out) { out.push(spans[i]); } + } + return !out ? spans : out.length ? out : null + } + + // Retrieve and filter the old marked spans stored in a change event. + function getOldSpans(doc, change) { + var found = change["spans_" + doc.id]; + if (!found) { return null } + var nw = []; + for (var i = 0; i < change.text.length; ++i) + { nw.push(removeClearedSpans(found[i])); } + return nw + } + + // Used for un/re-doing changes from the history. Combines the + // result of computing the existing spans with the set of spans that + // existed in the history (so that deleting around a span and then + // undoing brings back the span). + function mergeOldSpans(doc, change) { + var old = getOldSpans(doc, change); + var stretched = stretchSpansOverChange(doc, change); + if (!old) { return stretched } + if (!stretched) { return old } + + for (var i = 0; i < old.length; ++i) { + var oldCur = old[i], stretchCur = stretched[i]; + if (oldCur && stretchCur) { + spans: for (var j = 0; j < stretchCur.length; ++j) { + var span = stretchCur[j]; + for (var k = 0; k < oldCur.length; ++k) + { if (oldCur[k].marker == span.marker) { continue spans } } + oldCur.push(span); + } + } else if (stretchCur) { + old[i] = stretchCur; + } + } + return old + } + + // Used both to provide a JSON-safe object in .getHistory, and, when + // detaching a document, to split the history in two + function copyHistoryArray(events, newGroup, instantiateSel) { + var copy = []; + for (var i = 0; i < events.length; ++i) { + var event = events[i]; + if (event.ranges) { + copy.push(instantiateSel ? Selection.prototype.deepCopy.call(event) : event); + continue + } + var changes = event.changes, newChanges = []; + copy.push({changes: newChanges}); + for (var j = 0; j < changes.length; ++j) { + var change = changes[j], m = (void 0); + newChanges.push({from: change.from, to: change.to, text: change.text}); + if (newGroup) { for (var prop in change) { if (m = prop.match(/^spans_(\d+)$/)) { + if (indexOf(newGroup, Number(m[1])) > -1) { + lst(newChanges)[prop] = change[prop]; + delete change[prop]; + } + } } } + } + } + return copy + } + + // The 'scroll' parameter given to many of these indicated whether + // the new cursor position should be scrolled into view after + // modifying the selection. + + // If shift is held or the extend flag is set, extends a range to + // include a given position (and optionally a second position). + // Otherwise, simply returns the range between the given positions. + // Used for cursor motion and such. + function extendRange(range, head, other, extend) { + if (extend) { + var anchor = range.anchor; + if (other) { + var posBefore = cmp(head, anchor) < 0; + if (posBefore != (cmp(other, anchor) < 0)) { + anchor = head; + head = other; + } else if (posBefore != (cmp(head, other) < 0)) { + head = other; + } + } + return new Range(anchor, head) + } else { + return new Range(other || head, head) + } + } + + // Extend the primary selection range, discard the rest. + function extendSelection(doc, head, other, options, extend) { + if (extend == null) { extend = doc.cm && (doc.cm.display.shift || doc.extend); } + setSelection(doc, new Selection([extendRange(doc.sel.primary(), head, other, extend)], 0), options); + } + + // Extend all selections (pos is an array of selections with length + // equal the number of selections) + function extendSelections(doc, heads, options) { + var out = []; + var extend = doc.cm && (doc.cm.display.shift || doc.extend); + for (var i = 0; i < doc.sel.ranges.length; i++) + { out[i] = extendRange(doc.sel.ranges[i], heads[i], null, extend); } + var newSel = normalizeSelection(doc.cm, out, doc.sel.primIndex); + setSelection(doc, newSel, options); + } + + // Updates a single range in the selection. + function replaceOneSelection(doc, i, range, options) { + var ranges = doc.sel.ranges.slice(0); + ranges[i] = range; + setSelection(doc, normalizeSelection(doc.cm, ranges, doc.sel.primIndex), options); + } + + // Reset the selection to a single range. + function setSimpleSelection(doc, anchor, head, options) { + setSelection(doc, simpleSelection(anchor, head), options); + } + + // Give beforeSelectionChange handlers a change to influence a + // selection update. + function filterSelectionChange(doc, sel, options) { + var obj = { + ranges: sel.ranges, + update: function(ranges) { + var this$1 = this; + + this.ranges = []; + for (var i = 0; i < ranges.length; i++) + { this$1.ranges[i] = new Range(clipPos(doc, ranges[i].anchor), + clipPos(doc, ranges[i].head)); } + }, + origin: options && options.origin + }; + signal(doc, "beforeSelectionChange", doc, obj); + if (doc.cm) { signal(doc.cm, "beforeSelectionChange", doc.cm, obj); } + if (obj.ranges != sel.ranges) { return normalizeSelection(doc.cm, obj.ranges, obj.ranges.length - 1) } + else { return sel } + } + + function setSelectionReplaceHistory(doc, sel, options) { + var done = doc.history.done, last = lst(done); + if (last && last.ranges) { + done[done.length - 1] = sel; + setSelectionNoUndo(doc, sel, options); + } else { + setSelection(doc, sel, options); + } + } + + // Set a new selection. + function setSelection(doc, sel, options) { + setSelectionNoUndo(doc, sel, options); + addSelectionToHistory(doc, doc.sel, doc.cm ? doc.cm.curOp.id : NaN, options); + } + + function setSelectionNoUndo(doc, sel, options) { + if (hasHandler(doc, "beforeSelectionChange") || doc.cm && hasHandler(doc.cm, "beforeSelectionChange")) + { sel = filterSelectionChange(doc, sel, options); } + + var bias = options && options.bias || + (cmp(sel.primary().head, doc.sel.primary().head) < 0 ? -1 : 1); + setSelectionInner(doc, skipAtomicInSelection(doc, sel, bias, true)); + + if (!(options && options.scroll === false) && doc.cm) + { ensureCursorVisible(doc.cm); } + } + + function setSelectionInner(doc, sel) { + if (sel.equals(doc.sel)) { return } + + doc.sel = sel; + + if (doc.cm) { + doc.cm.curOp.updateInput = 1; + doc.cm.curOp.selectionChanged = true; + signalCursorActivity(doc.cm); + } + signalLater(doc, "cursorActivity", doc); + } + + // Verify that the selection does not partially select any atomic + // marked ranges. + function reCheckSelection(doc) { + setSelectionInner(doc, skipAtomicInSelection(doc, doc.sel, null, false)); + } + + // Return a selection that does not partially select any atomic + // ranges. + function skipAtomicInSelection(doc, sel, bias, mayClear) { + var out; + for (var i = 0; i < sel.ranges.length; i++) { + var range = sel.ranges[i]; + var old = sel.ranges.length == doc.sel.ranges.length && doc.sel.ranges[i]; + var newAnchor = skipAtomic(doc, range.anchor, old && old.anchor, bias, mayClear); + var newHead = skipAtomic(doc, range.head, old && old.head, bias, mayClear); + if (out || newAnchor != range.anchor || newHead != range.head) { + if (!out) { out = sel.ranges.slice(0, i); } + out[i] = new Range(newAnchor, newHead); + } + } + return out ? normalizeSelection(doc.cm, out, sel.primIndex) : sel + } + + function skipAtomicInner(doc, pos, oldPos, dir, mayClear) { + var line = getLine(doc, pos.line); + if (line.markedSpans) { for (var i = 0; i < line.markedSpans.length; ++i) { + var sp = line.markedSpans[i], m = sp.marker; + + // Determine if we should prevent the cursor being placed to the left/right of an atomic marker + // Historically this was determined using the inclusiveLeft/Right option, but the new way to control it + // is with selectLeft/Right + var preventCursorLeft = ("selectLeft" in m) ? !m.selectLeft : m.inclusiveLeft; + var preventCursorRight = ("selectRight" in m) ? !m.selectRight : m.inclusiveRight; + + if ((sp.from == null || (preventCursorLeft ? sp.from <= pos.ch : sp.from < pos.ch)) && + (sp.to == null || (preventCursorRight ? sp.to >= pos.ch : sp.to > pos.ch))) { + if (mayClear) { + signal(m, "beforeCursorEnter"); + if (m.explicitlyCleared) { + if (!line.markedSpans) { break } + else {--i; continue} + } + } + if (!m.atomic) { continue } + + if (oldPos) { + var near = m.find(dir < 0 ? 1 : -1), diff = (void 0); + if (dir < 0 ? preventCursorRight : preventCursorLeft) + { near = movePos(doc, near, -dir, near && near.line == pos.line ? line : null); } + if (near && near.line == pos.line && (diff = cmp(near, oldPos)) && (dir < 0 ? diff < 0 : diff > 0)) + { return skipAtomicInner(doc, near, pos, dir, mayClear) } + } + + var far = m.find(dir < 0 ? -1 : 1); + if (dir < 0 ? preventCursorLeft : preventCursorRight) + { far = movePos(doc, far, dir, far.line == pos.line ? line : null); } + return far ? skipAtomicInner(doc, far, pos, dir, mayClear) : null + } + } } + return pos + } + + // Ensure a given position is not inside an atomic range. + function skipAtomic(doc, pos, oldPos, bias, mayClear) { + var dir = bias || 1; + var found = skipAtomicInner(doc, pos, oldPos, dir, mayClear) || + (!mayClear && skipAtomicInner(doc, pos, oldPos, dir, true)) || + skipAtomicInner(doc, pos, oldPos, -dir, mayClear) || + (!mayClear && skipAtomicInner(doc, pos, oldPos, -dir, true)); + if (!found) { + doc.cantEdit = true; + return Pos(doc.first, 0) + } + return found + } + + function movePos(doc, pos, dir, line) { + if (dir < 0 && pos.ch == 0) { + if (pos.line > doc.first) { return clipPos(doc, Pos(pos.line - 1)) } + else { return null } + } else if (dir > 0 && pos.ch == (line || getLine(doc, pos.line)).text.length) { + if (pos.line < doc.first + doc.size - 1) { return Pos(pos.line + 1, 0) } + else { return null } + } else { + return new Pos(pos.line, pos.ch + dir) + } + } + + function selectAll(cm) { + cm.setSelection(Pos(cm.firstLine(), 0), Pos(cm.lastLine()), sel_dontScroll); + } + + // UPDATING + + // Allow "beforeChange" event handlers to influence a change + function filterChange(doc, change, update) { + var obj = { + canceled: false, + from: change.from, + to: change.to, + text: change.text, + origin: change.origin, + cancel: function () { return obj.canceled = true; } + }; + if (update) { obj.update = function (from, to, text, origin) { + if (from) { obj.from = clipPos(doc, from); } + if (to) { obj.to = clipPos(doc, to); } + if (text) { obj.text = text; } + if (origin !== undefined) { obj.origin = origin; } + }; } + signal(doc, "beforeChange", doc, obj); + if (doc.cm) { signal(doc.cm, "beforeChange", doc.cm, obj); } + + if (obj.canceled) { + if (doc.cm) { doc.cm.curOp.updateInput = 2; } + return null + } + return {from: obj.from, to: obj.to, text: obj.text, origin: obj.origin} + } + + // Apply a change to a document, and add it to the document's + // history, and propagating it to all linked documents. + function makeChange(doc, change, ignoreReadOnly) { + if (doc.cm) { + if (!doc.cm.curOp) { return operation(doc.cm, makeChange)(doc, change, ignoreReadOnly) } + if (doc.cm.state.suppressEdits) { return } + } + + if (hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange")) { + change = filterChange(doc, change, true); + if (!change) { return } + } + + // Possibly split or suppress the update based on the presence + // of read-only spans in its range. + var split = sawReadOnlySpans && !ignoreReadOnly && removeReadOnlyRanges(doc, change.from, change.to); + if (split) { + for (var i = split.length - 1; i >= 0; --i) + { makeChangeInner(doc, {from: split[i].from, to: split[i].to, text: i ? [""] : change.text, origin: change.origin}); } + } else { + makeChangeInner(doc, change); + } + } + + function makeChangeInner(doc, change) { + if (change.text.length == 1 && change.text[0] == "" && cmp(change.from, change.to) == 0) { return } + var selAfter = computeSelAfterChange(doc, change); + addChangeToHistory(doc, change, selAfter, doc.cm ? doc.cm.curOp.id : NaN); + + makeChangeSingleDoc(doc, change, selAfter, stretchSpansOverChange(doc, change)); + var rebased = []; + + linkedDocs(doc, function (doc, sharedHist) { + if (!sharedHist && indexOf(rebased, doc.history) == -1) { + rebaseHist(doc.history, change); + rebased.push(doc.history); + } + makeChangeSingleDoc(doc, change, null, stretchSpansOverChange(doc, change)); + }); + } + + // Revert a change stored in a document's history. + function makeChangeFromHistory(doc, type, allowSelectionOnly) { + var suppress = doc.cm && doc.cm.state.suppressEdits; + if (suppress && !allowSelectionOnly) { return } + + var hist = doc.history, event, selAfter = doc.sel; + var source = type == "undo" ? hist.done : hist.undone, dest = type == "undo" ? hist.undone : hist.done; + + // Verify that there is a useable event (so that ctrl-z won't + // needlessly clear selection events) + var i = 0; + for (; i < source.length; i++) { + event = source[i]; + if (allowSelectionOnly ? event.ranges && !event.equals(doc.sel) : !event.ranges) + { break } + } + if (i == source.length) { return } + hist.lastOrigin = hist.lastSelOrigin = null; + + for (;;) { + event = source.pop(); + if (event.ranges) { + pushSelectionToHistory(event, dest); + if (allowSelectionOnly && !event.equals(doc.sel)) { + setSelection(doc, event, {clearRedo: false}); + return + } + selAfter = event; + } else if (suppress) { + source.push(event); + return + } else { break } + } + + // Build up a reverse change object to add to the opposite history + // stack (redo when undoing, and vice versa). + var antiChanges = []; + pushSelectionToHistory(selAfter, dest); + dest.push({changes: antiChanges, generation: hist.generation}); + hist.generation = event.generation || ++hist.maxGeneration; + + var filter = hasHandler(doc, "beforeChange") || doc.cm && hasHandler(doc.cm, "beforeChange"); + + var loop = function ( i ) { + var change = event.changes[i]; + change.origin = type; + if (filter && !filterChange(doc, change, false)) { + source.length = 0; + return {} + } + + antiChanges.push(historyChangeFromChange(doc, change)); + + var after = i ? computeSelAfterChange(doc, change) : lst(source); + makeChangeSingleDoc(doc, change, after, mergeOldSpans(doc, change)); + if (!i && doc.cm) { doc.cm.scrollIntoView({from: change.from, to: changeEnd(change)}); } + var rebased = []; + + // Propagate to the linked documents + linkedDocs(doc, function (doc, sharedHist) { + if (!sharedHist && indexOf(rebased, doc.history) == -1) { + rebaseHist(doc.history, change); + rebased.push(doc.history); + } + makeChangeSingleDoc(doc, change, null, mergeOldSpans(doc, change)); + }); + }; + + for (var i$1 = event.changes.length - 1; i$1 >= 0; --i$1) { + var returned = loop( i$1 ); + + if ( returned ) return returned.v; + } + } + + // Sub-views need their line numbers shifted when text is added + // above or below them in the parent document. + function shiftDoc(doc, distance) { + if (distance == 0) { return } + doc.first += distance; + doc.sel = new Selection(map(doc.sel.ranges, function (range) { return new Range( + Pos(range.anchor.line + distance, range.anchor.ch), + Pos(range.head.line + distance, range.head.ch) + ); }), doc.sel.primIndex); + if (doc.cm) { + regChange(doc.cm, doc.first, doc.first - distance, distance); + for (var d = doc.cm.display, l = d.viewFrom; l < d.viewTo; l++) + { regLineChange(doc.cm, l, "gutter"); } + } + } + + // More lower-level change function, handling only a single document + // (not linked ones). + function makeChangeSingleDoc(doc, change, selAfter, spans) { + if (doc.cm && !doc.cm.curOp) + { return operation(doc.cm, makeChangeSingleDoc)(doc, change, selAfter, spans) } + + if (change.to.line < doc.first) { + shiftDoc(doc, change.text.length - 1 - (change.to.line - change.from.line)); + return + } + if (change.from.line > doc.lastLine()) { return } + + // Clip the change to the size of this doc + if (change.from.line < doc.first) { + var shift = change.text.length - 1 - (doc.first - change.from.line); + shiftDoc(doc, shift); + change = {from: Pos(doc.first, 0), to: Pos(change.to.line + shift, change.to.ch), + text: [lst(change.text)], origin: change.origin}; + } + var last = doc.lastLine(); + if (change.to.line > last) { + change = {from: change.from, to: Pos(last, getLine(doc, last).text.length), + text: [change.text[0]], origin: change.origin}; + } + + change.removed = getBetween(doc, change.from, change.to); + + if (!selAfter) { selAfter = computeSelAfterChange(doc, change); } + if (doc.cm) { makeChangeSingleDocInEditor(doc.cm, change, spans); } + else { updateDoc(doc, change, spans); } + setSelectionNoUndo(doc, selAfter, sel_dontScroll); + + if (doc.cantEdit && skipAtomic(doc, Pos(doc.firstLine(), 0))) + { doc.cantEdit = false; } + } + + // Handle the interaction of a change to a document with the editor + // that this document is part of. + function makeChangeSingleDocInEditor(cm, change, spans) { + var doc = cm.doc, display = cm.display, from = change.from, to = change.to; + + var recomputeMaxLength = false, checkWidthStart = from.line; + if (!cm.options.lineWrapping) { + checkWidthStart = lineNo(visualLine(getLine(doc, from.line))); + doc.iter(checkWidthStart, to.line + 1, function (line) { + if (line == display.maxLine) { + recomputeMaxLength = true; + return true + } + }); + } + + if (doc.sel.contains(change.from, change.to) > -1) + { signalCursorActivity(cm); } + + updateDoc(doc, change, spans, estimateHeight(cm)); + + if (!cm.options.lineWrapping) { + doc.iter(checkWidthStart, from.line + change.text.length, function (line) { + var len = lineLength(line); + if (len > display.maxLineLength) { + display.maxLine = line; + display.maxLineLength = len; + display.maxLineChanged = true; + recomputeMaxLength = false; + } + }); + if (recomputeMaxLength) { cm.curOp.updateMaxLine = true; } + } + + retreatFrontier(doc, from.line); + startWorker(cm, 400); + + var lendiff = change.text.length - (to.line - from.line) - 1; + // Remember that these lines changed, for updating the display + if (change.full) + { regChange(cm); } + else if (from.line == to.line && change.text.length == 1 && !isWholeLineUpdate(cm.doc, change)) + { regLineChange(cm, from.line, "text"); } + else + { regChange(cm, from.line, to.line + 1, lendiff); } + + var changesHandler = hasHandler(cm, "changes"), changeHandler = hasHandler(cm, "change"); + if (changeHandler || changesHandler) { + var obj = { + from: from, to: to, + text: change.text, + removed: change.removed, + origin: change.origin + }; + if (changeHandler) { signalLater(cm, "change", cm, obj); } + if (changesHandler) { (cm.curOp.changeObjs || (cm.curOp.changeObjs = [])).push(obj); } + } + cm.display.selForContextMenu = null; + } + + function replaceRange(doc, code, from, to, origin) { + var assign; + + if (!to) { to = from; } + if (cmp(to, from) < 0) { (assign = [to, from], from = assign[0], to = assign[1]); } + if (typeof code == "string") { code = doc.splitLines(code); } + makeChange(doc, {from: from, to: to, text: code, origin: origin}); + } + + // Rebasing/resetting history to deal with externally-sourced changes + + function rebaseHistSelSingle(pos, from, to, diff) { + if (to < pos.line) { + pos.line += diff; + } else if (from < pos.line) { + pos.line = from; + pos.ch = 0; + } + } + + // Tries to rebase an array of history events given a change in the + // document. If the change touches the same lines as the event, the + // event, and everything 'behind' it, is discarded. If the change is + // before the event, the event's positions are updated. Uses a + // copy-on-write scheme for the positions, to avoid having to + // reallocate them all on every rebase, but also avoid problems with + // shared position objects being unsafely updated. + function rebaseHistArray(array, from, to, diff) { + for (var i = 0; i < array.length; ++i) { + var sub = array[i], ok = true; + if (sub.ranges) { + if (!sub.copied) { sub = array[i] = sub.deepCopy(); sub.copied = true; } + for (var j = 0; j < sub.ranges.length; j++) { + rebaseHistSelSingle(sub.ranges[j].anchor, from, to, diff); + rebaseHistSelSingle(sub.ranges[j].head, from, to, diff); + } + continue + } + for (var j$1 = 0; j$1 < sub.changes.length; ++j$1) { + var cur = sub.changes[j$1]; + if (to < cur.from.line) { + cur.from = Pos(cur.from.line + diff, cur.from.ch); + cur.to = Pos(cur.to.line + diff, cur.to.ch); + } else if (from <= cur.to.line) { + ok = false; + break + } + } + if (!ok) { + array.splice(0, i + 1); + i = 0; + } + } + } + + function rebaseHist(hist, change) { + var from = change.from.line, to = change.to.line, diff = change.text.length - (to - from) - 1; + rebaseHistArray(hist.done, from, to, diff); + rebaseHistArray(hist.undone, from, to, diff); + } + + // Utility for applying a change to a line by handle or number, + // returning the number and optionally registering the line as + // changed. + function changeLine(doc, handle, changeType, op) { + var no = handle, line = handle; + if (typeof handle == "number") { line = getLine(doc, clipLine(doc, handle)); } + else { no = lineNo(handle); } + if (no == null) { return null } + if (op(line, no) && doc.cm) { regLineChange(doc.cm, no, changeType); } + return line + } + + // The document is represented as a BTree consisting of leaves, with + // chunk of lines in them, and branches, with up to ten leaves or + // other branch nodes below them. The top node is always a branch + // node, and is the document object itself (meaning it has + // additional methods and properties). + // + // All nodes have parent links. The tree is used both to go from + // line numbers to line objects, and to go from objects to numbers. + // It also indexes by height, and is used to convert between height + // and line object, and to find the total height of the document. + // + // See also http://marijnhaverbeke.nl/blog/codemirror-line-tree.html + + function LeafChunk(lines) { + var this$1 = this; + + this.lines = lines; + this.parent = null; + var height = 0; + for (var i = 0; i < lines.length; ++i) { + lines[i].parent = this$1; + height += lines[i].height; + } + this.height = height; + } + + LeafChunk.prototype = { + chunkSize: function() { return this.lines.length }, + + // Remove the n lines at offset 'at'. + removeInner: function(at, n) { + var this$1 = this; + + for (var i = at, e = at + n; i < e; ++i) { + var line = this$1.lines[i]; + this$1.height -= line.height; + cleanUpLine(line); + signalLater(line, "delete"); + } + this.lines.splice(at, n); + }, + + // Helper used to collapse a small branch into a single leaf. + collapse: function(lines) { + lines.push.apply(lines, this.lines); + }, + + // Insert the given array of lines at offset 'at', count them as + // having the given height. + insertInner: function(at, lines, height) { + var this$1 = this; + + this.height += height; + this.lines = this.lines.slice(0, at).concat(lines).concat(this.lines.slice(at)); + for (var i = 0; i < lines.length; ++i) { lines[i].parent = this$1; } + }, + + // Used to iterate over a part of the tree. + iterN: function(at, n, op) { + var this$1 = this; + + for (var e = at + n; at < e; ++at) + { if (op(this$1.lines[at])) { return true } } + } + }; + + function BranchChunk(children) { + var this$1 = this; + + this.children = children; + var size = 0, height = 0; + for (var i = 0; i < children.length; ++i) { + var ch = children[i]; + size += ch.chunkSize(); height += ch.height; + ch.parent = this$1; + } + this.size = size; + this.height = height; + this.parent = null; + } + + BranchChunk.prototype = { + chunkSize: function() { return this.size }, + + removeInner: function(at, n) { + var this$1 = this; + + this.size -= n; + for (var i = 0; i < this.children.length; ++i) { + var child = this$1.children[i], sz = child.chunkSize(); + if (at < sz) { + var rm = Math.min(n, sz - at), oldHeight = child.height; + child.removeInner(at, rm); + this$1.height -= oldHeight - child.height; + if (sz == rm) { this$1.children.splice(i--, 1); child.parent = null; } + if ((n -= rm) == 0) { break } + at = 0; + } else { at -= sz; } + } + // If the result is smaller than 25 lines, ensure that it is a + // single leaf node. + if (this.size - n < 25 && + (this.children.length > 1 || !(this.children[0] instanceof LeafChunk))) { + var lines = []; + this.collapse(lines); + this.children = [new LeafChunk(lines)]; + this.children[0].parent = this; + } + }, + + collapse: function(lines) { + var this$1 = this; + + for (var i = 0; i < this.children.length; ++i) { this$1.children[i].collapse(lines); } + }, + + insertInner: function(at, lines, height) { + var this$1 = this; + + this.size += lines.length; + this.height += height; + for (var i = 0; i < this.children.length; ++i) { + var child = this$1.children[i], sz = child.chunkSize(); + if (at <= sz) { + child.insertInner(at, lines, height); + if (child.lines && child.lines.length > 50) { + // To avoid memory thrashing when child.lines is huge (e.g. first view of a large file), it's never spliced. + // Instead, small slices are taken. They're taken in order because sequential memory accesses are fastest. + var remaining = child.lines.length % 25 + 25; + for (var pos = remaining; pos < child.lines.length;) { + var leaf = new LeafChunk(child.lines.slice(pos, pos += 25)); + child.height -= leaf.height; + this$1.children.splice(++i, 0, leaf); + leaf.parent = this$1; + } + child.lines = child.lines.slice(0, remaining); + this$1.maybeSpill(); + } + break + } + at -= sz; + } + }, + + // When a node has grown, check whether it should be split. + maybeSpill: function() { + if (this.children.length <= 10) { return } + var me = this; + do { + var spilled = me.children.splice(me.children.length - 5, 5); + var sibling = new BranchChunk(spilled); + if (!me.parent) { // Become the parent node + var copy = new BranchChunk(me.children); + copy.parent = me; + me.children = [copy, sibling]; + me = copy; + } else { + me.size -= sibling.size; + me.height -= sibling.height; + var myIndex = indexOf(me.parent.children, me); + me.parent.children.splice(myIndex + 1, 0, sibling); + } + sibling.parent = me.parent; + } while (me.children.length > 10) + me.parent.maybeSpill(); + }, + + iterN: function(at, n, op) { + var this$1 = this; + + for (var i = 0; i < this.children.length; ++i) { + var child = this$1.children[i], sz = child.chunkSize(); + if (at < sz) { + var used = Math.min(n, sz - at); + if (child.iterN(at, used, op)) { return true } + if ((n -= used) == 0) { break } + at = 0; + } else { at -= sz; } + } + } + }; + + // Line widgets are block elements displayed above or below a line. + + var LineWidget = function(doc, node, options) { + var this$1 = this; + + if (options) { for (var opt in options) { if (options.hasOwnProperty(opt)) + { this$1[opt] = options[opt]; } } } + this.doc = doc; + this.node = node; + }; + + LineWidget.prototype.clear = function () { + var this$1 = this; + + var cm = this.doc.cm, ws = this.line.widgets, line = this.line, no = lineNo(line); + if (no == null || !ws) { return } + for (var i = 0; i < ws.length; ++i) { if (ws[i] == this$1) { ws.splice(i--, 1); } } + if (!ws.length) { line.widgets = null; } + var height = widgetHeight(this); + updateLineHeight(line, Math.max(0, line.height - height)); + if (cm) { + runInOp(cm, function () { + adjustScrollWhenAboveVisible(cm, line, -height); + regLineChange(cm, no, "widget"); + }); + signalLater(cm, "lineWidgetCleared", cm, this, no); + } + }; + + LineWidget.prototype.changed = function () { + var this$1 = this; + + var oldH = this.height, cm = this.doc.cm, line = this.line; + this.height = null; + var diff = widgetHeight(this) - oldH; + if (!diff) { return } + if (!lineIsHidden(this.doc, line)) { updateLineHeight(line, line.height + diff); } + if (cm) { + runInOp(cm, function () { + cm.curOp.forceUpdate = true; + adjustScrollWhenAboveVisible(cm, line, diff); + signalLater(cm, "lineWidgetChanged", cm, this$1, lineNo(line)); + }); + } + }; + eventMixin(LineWidget); + + function adjustScrollWhenAboveVisible(cm, line, diff) { + if (heightAtLine(line) < ((cm.curOp && cm.curOp.scrollTop) || cm.doc.scrollTop)) + { addToScrollTop(cm, diff); } + } + + function addLineWidget(doc, handle, node, options) { + var widget = new LineWidget(doc, node, options); + var cm = doc.cm; + if (cm && widget.noHScroll) { cm.display.alignWidgets = true; } + changeLine(doc, handle, "widget", function (line) { + var widgets = line.widgets || (line.widgets = []); + if (widget.insertAt == null) { widgets.push(widget); } + else { widgets.splice(Math.min(widgets.length - 1, Math.max(0, widget.insertAt)), 0, widget); } + widget.line = line; + if (cm && !lineIsHidden(doc, line)) { + var aboveVisible = heightAtLine(line) < doc.scrollTop; + updateLineHeight(line, line.height + widgetHeight(widget)); + if (aboveVisible) { addToScrollTop(cm, widget.height); } + cm.curOp.forceUpdate = true; + } + return true + }); + if (cm) { signalLater(cm, "lineWidgetAdded", cm, widget, typeof handle == "number" ? handle : lineNo(handle)); } + return widget + } + + // TEXTMARKERS + + // Created with markText and setBookmark methods. A TextMarker is a + // handle that can be used to clear or find a marked position in the + // document. Line objects hold arrays (markedSpans) containing + // {from, to, marker} object pointing to such marker objects, and + // indicating that such a marker is present on that line. Multiple + // lines may point to the same marker when it spans across lines. + // The spans will have null for their from/to properties when the + // marker continues beyond the start/end of the line. Markers have + // links back to the lines they currently touch. + + // Collapsed markers have unique ids, in order to be able to order + // them, which is needed for uniquely determining an outer marker + // when they overlap (they may nest, but not partially overlap). + var nextMarkerId = 0; + + var TextMarker = function(doc, type) { + this.lines = []; + this.type = type; + this.doc = doc; + this.id = ++nextMarkerId; + }; + + // Clear the marker. + TextMarker.prototype.clear = function () { + var this$1 = this; + + if (this.explicitlyCleared) { return } + var cm = this.doc.cm, withOp = cm && !cm.curOp; + if (withOp) { startOperation(cm); } + if (hasHandler(this, "clear")) { + var found = this.find(); + if (found) { signalLater(this, "clear", found.from, found.to); } + } + var min = null, max = null; + for (var i = 0; i < this.lines.length; ++i) { + var line = this$1.lines[i]; + var span = getMarkedSpanFor(line.markedSpans, this$1); + if (cm && !this$1.collapsed) { regLineChange(cm, lineNo(line), "text"); } + else if (cm) { + if (span.to != null) { max = lineNo(line); } + if (span.from != null) { min = lineNo(line); } + } + line.markedSpans = removeMarkedSpan(line.markedSpans, span); + if (span.from == null && this$1.collapsed && !lineIsHidden(this$1.doc, line) && cm) + { updateLineHeight(line, textHeight(cm.display)); } + } + if (cm && this.collapsed && !cm.options.lineWrapping) { for (var i$1 = 0; i$1 < this.lines.length; ++i$1) { + var visual = visualLine(this$1.lines[i$1]), len = lineLength(visual); + if (len > cm.display.maxLineLength) { + cm.display.maxLine = visual; + cm.display.maxLineLength = len; + cm.display.maxLineChanged = true; + } + } } + + if (min != null && cm && this.collapsed) { regChange(cm, min, max + 1); } + this.lines.length = 0; + this.explicitlyCleared = true; + if (this.atomic && this.doc.cantEdit) { + this.doc.cantEdit = false; + if (cm) { reCheckSelection(cm.doc); } + } + if (cm) { signalLater(cm, "markerCleared", cm, this, min, max); } + if (withOp) { endOperation(cm); } + if (this.parent) { this.parent.clear(); } + }; + + // Find the position of the marker in the document. Returns a {from, + // to} object by default. Side can be passed to get a specific side + // -- 0 (both), -1 (left), or 1 (right). When lineObj is true, the + // Pos objects returned contain a line object, rather than a line + // number (used to prevent looking up the same line twice). + TextMarker.prototype.find = function (side, lineObj) { + var this$1 = this; + + if (side == null && this.type == "bookmark") { side = 1; } + var from, to; + for (var i = 0; i < this.lines.length; ++i) { + var line = this$1.lines[i]; + var span = getMarkedSpanFor(line.markedSpans, this$1); + if (span.from != null) { + from = Pos(lineObj ? line : lineNo(line), span.from); + if (side == -1) { return from } + } + if (span.to != null) { + to = Pos(lineObj ? line : lineNo(line), span.to); + if (side == 1) { return to } + } + } + return from && {from: from, to: to} + }; + + // Signals that the marker's widget changed, and surrounding layout + // should be recomputed. + TextMarker.prototype.changed = function () { + var this$1 = this; + + var pos = this.find(-1, true), widget = this, cm = this.doc.cm; + if (!pos || !cm) { return } + runInOp(cm, function () { + var line = pos.line, lineN = lineNo(pos.line); + var view = findViewForLine(cm, lineN); + if (view) { + clearLineMeasurementCacheFor(view); + cm.curOp.selectionChanged = cm.curOp.forceUpdate = true; + } + cm.curOp.updateMaxLine = true; + if (!lineIsHidden(widget.doc, line) && widget.height != null) { + var oldHeight = widget.height; + widget.height = null; + var dHeight = widgetHeight(widget) - oldHeight; + if (dHeight) + { updateLineHeight(line, line.height + dHeight); } + } + signalLater(cm, "markerChanged", cm, this$1); + }); + }; + + TextMarker.prototype.attachLine = function (line) { + if (!this.lines.length && this.doc.cm) { + var op = this.doc.cm.curOp; + if (!op.maybeHiddenMarkers || indexOf(op.maybeHiddenMarkers, this) == -1) + { (op.maybeUnhiddenMarkers || (op.maybeUnhiddenMarkers = [])).push(this); } + } + this.lines.push(line); + }; + + TextMarker.prototype.detachLine = function (line) { + this.lines.splice(indexOf(this.lines, line), 1); + if (!this.lines.length && this.doc.cm) { + var op = this.doc.cm.curOp + ;(op.maybeHiddenMarkers || (op.maybeHiddenMarkers = [])).push(this); + } + }; + eventMixin(TextMarker); + + // Create a marker, wire it up to the right lines, and + function markText(doc, from, to, options, type) { + // Shared markers (across linked documents) are handled separately + // (markTextShared will call out to this again, once per + // document). + if (options && options.shared) { return markTextShared(doc, from, to, options, type) } + // Ensure we are in an operation. + if (doc.cm && !doc.cm.curOp) { return operation(doc.cm, markText)(doc, from, to, options, type) } + + var marker = new TextMarker(doc, type), diff = cmp(from, to); + if (options) { copyObj(options, marker, false); } + // Don't connect empty markers unless clearWhenEmpty is false + if (diff > 0 || diff == 0 && marker.clearWhenEmpty !== false) + { return marker } + if (marker.replacedWith) { + // Showing up as a widget implies collapsed (widget replaces text) + marker.collapsed = true; + marker.widgetNode = eltP("span", [marker.replacedWith], "CodeMirror-widget"); + if (!options.handleMouseEvents) { marker.widgetNode.setAttribute("cm-ignore-events", "true"); } + if (options.insertLeft) { marker.widgetNode.insertLeft = true; } + } + if (marker.collapsed) { + if (conflictingCollapsedRange(doc, from.line, from, to, marker) || + from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker)) + { throw new Error("Inserting collapsed marker partially overlapping an existing one") } + seeCollapsedSpans(); + } + + if (marker.addToHistory) + { addChangeToHistory(doc, {from: from, to: to, origin: "markText"}, doc.sel, NaN); } + + var curLine = from.line, cm = doc.cm, updateMaxLine; + doc.iter(curLine, to.line + 1, function (line) { + if (cm && marker.collapsed && !cm.options.lineWrapping && visualLine(line) == cm.display.maxLine) + { updateMaxLine = true; } + if (marker.collapsed && curLine != from.line) { updateLineHeight(line, 0); } + addMarkedSpan(line, new MarkedSpan(marker, + curLine == from.line ? from.ch : null, + curLine == to.line ? to.ch : null)); + ++curLine; + }); + // lineIsHidden depends on the presence of the spans, so needs a second pass + if (marker.collapsed) { doc.iter(from.line, to.line + 1, function (line) { + if (lineIsHidden(doc, line)) { updateLineHeight(line, 0); } + }); } + + if (marker.clearOnEnter) { on(marker, "beforeCursorEnter", function () { return marker.clear(); }); } + + if (marker.readOnly) { + seeReadOnlySpans(); + if (doc.history.done.length || doc.history.undone.length) + { doc.clearHistory(); } + } + if (marker.collapsed) { + marker.id = ++nextMarkerId; + marker.atomic = true; + } + if (cm) { + // Sync editor state + if (updateMaxLine) { cm.curOp.updateMaxLine = true; } + if (marker.collapsed) + { regChange(cm, from.line, to.line + 1); } + else if (marker.className || marker.startStyle || marker.endStyle || marker.css || + marker.attributes || marker.title) + { for (var i = from.line; i <= to.line; i++) { regLineChange(cm, i, "text"); } } + if (marker.atomic) { reCheckSelection(cm.doc); } + signalLater(cm, "markerAdded", cm, marker); + } + return marker + } + + // SHARED TEXTMARKERS + + // A shared marker spans multiple linked documents. It is + // implemented as a meta-marker-object controlling multiple normal + // markers. + var SharedTextMarker = function(markers, primary) { + var this$1 = this; + + this.markers = markers; + this.primary = primary; + for (var i = 0; i < markers.length; ++i) + { markers[i].parent = this$1; } + }; + + SharedTextMarker.prototype.clear = function () { + var this$1 = this; + + if (this.explicitlyCleared) { return } + this.explicitlyCleared = true; + for (var i = 0; i < this.markers.length; ++i) + { this$1.markers[i].clear(); } + signalLater(this, "clear"); + }; + + SharedTextMarker.prototype.find = function (side, lineObj) { + return this.primary.find(side, lineObj) + }; + eventMixin(SharedTextMarker); + + function markTextShared(doc, from, to, options, type) { + options = copyObj(options); + options.shared = false; + var markers = [markText(doc, from, to, options, type)], primary = markers[0]; + var widget = options.widgetNode; + linkedDocs(doc, function (doc) { + if (widget) { options.widgetNode = widget.cloneNode(true); } + markers.push(markText(doc, clipPos(doc, from), clipPos(doc, to), options, type)); + for (var i = 0; i < doc.linked.length; ++i) + { if (doc.linked[i].isParent) { return } } + primary = lst(markers); + }); + return new SharedTextMarker(markers, primary) + } + + function findSharedMarkers(doc) { + return doc.findMarks(Pos(doc.first, 0), doc.clipPos(Pos(doc.lastLine())), function (m) { return m.parent; }) + } + + function copySharedMarkers(doc, markers) { + for (var i = 0; i < markers.length; i++) { + var marker = markers[i], pos = marker.find(); + var mFrom = doc.clipPos(pos.from), mTo = doc.clipPos(pos.to); + if (cmp(mFrom, mTo)) { + var subMark = markText(doc, mFrom, mTo, marker.primary, marker.primary.type); + marker.markers.push(subMark); + subMark.parent = marker; + } + } + } + + function detachSharedMarkers(markers) { + var loop = function ( i ) { + var marker = markers[i], linked = [marker.primary.doc]; + linkedDocs(marker.primary.doc, function (d) { return linked.push(d); }); + for (var j = 0; j < marker.markers.length; j++) { + var subMarker = marker.markers[j]; + if (indexOf(linked, subMarker.doc) == -1) { + subMarker.parent = null; + marker.markers.splice(j--, 1); + } + } + }; + + for (var i = 0; i < markers.length; i++) loop( i ); + } + + var nextDocId = 0; + var Doc = function(text, mode, firstLine, lineSep, direction) { + if (!(this instanceof Doc)) { return new Doc(text, mode, firstLine, lineSep, direction) } + if (firstLine == null) { firstLine = 0; } + + BranchChunk.call(this, [new LeafChunk([new Line("", null)])]); + this.first = firstLine; + this.scrollTop = this.scrollLeft = 0; + this.cantEdit = false; + this.cleanGeneration = 1; + this.modeFrontier = this.highlightFrontier = firstLine; + var start = Pos(firstLine, 0); + this.sel = simpleSelection(start); + this.history = new History(null); + this.id = ++nextDocId; + this.modeOption = mode; + this.lineSep = lineSep; + this.direction = (direction == "rtl") ? "rtl" : "ltr"; + this.extend = false; + + if (typeof text == "string") { text = this.splitLines(text); } + updateDoc(this, {from: start, to: start, text: text}); + setSelection(this, simpleSelection(start), sel_dontScroll); + }; + + Doc.prototype = createObj(BranchChunk.prototype, { + constructor: Doc, + // Iterate over the document. Supports two forms -- with only one + // argument, it calls that for each line in the document. With + // three, it iterates over the range given by the first two (with + // the second being non-inclusive). + iter: function(from, to, op) { + if (op) { this.iterN(from - this.first, to - from, op); } + else { this.iterN(this.first, this.first + this.size, from); } + }, + + // Non-public interface for adding and removing lines. + insert: function(at, lines) { + var height = 0; + for (var i = 0; i < lines.length; ++i) { height += lines[i].height; } + this.insertInner(at - this.first, lines, height); + }, + remove: function(at, n) { this.removeInner(at - this.first, n); }, + + // From here, the methods are part of the public interface. Most + // are also available from CodeMirror (editor) instances. + + getValue: function(lineSep) { + var lines = getLines(this, this.first, this.first + this.size); + if (lineSep === false) { return lines } + return lines.join(lineSep || this.lineSeparator()) + }, + setValue: docMethodOp(function(code) { + var top = Pos(this.first, 0), last = this.first + this.size - 1; + makeChange(this, {from: top, to: Pos(last, getLine(this, last).text.length), + text: this.splitLines(code), origin: "setValue", full: true}, true); + if (this.cm) { scrollToCoords(this.cm, 0, 0); } + setSelection(this, simpleSelection(top), sel_dontScroll); + }), + replaceRange: function(code, from, to, origin) { + from = clipPos(this, from); + to = to ? clipPos(this, to) : from; + replaceRange(this, code, from, to, origin); + }, + getRange: function(from, to, lineSep) { + var lines = getBetween(this, clipPos(this, from), clipPos(this, to)); + if (lineSep === false) { return lines } + return lines.join(lineSep || this.lineSeparator()) + }, + + getLine: function(line) {var l = this.getLineHandle(line); return l && l.text}, + + getLineHandle: function(line) {if (isLine(this, line)) { return getLine(this, line) }}, + getLineNumber: function(line) {return lineNo(line)}, + + getLineHandleVisualStart: function(line) { + if (typeof line == "number") { line = getLine(this, line); } + return visualLine(line) + }, + + lineCount: function() {return this.size}, + firstLine: function() {return this.first}, + lastLine: function() {return this.first + this.size - 1}, + + clipPos: function(pos) {return clipPos(this, pos)}, + + getCursor: function(start) { + var range$$1 = this.sel.primary(), pos; + if (start == null || start == "head") { pos = range$$1.head; } + else if (start == "anchor") { pos = range$$1.anchor; } + else if (start == "end" || start == "to" || start === false) { pos = range$$1.to(); } + else { pos = range$$1.from(); } + return pos + }, + listSelections: function() { return this.sel.ranges }, + somethingSelected: function() {return this.sel.somethingSelected()}, + + setCursor: docMethodOp(function(line, ch, options) { + setSimpleSelection(this, clipPos(this, typeof line == "number" ? Pos(line, ch || 0) : line), null, options); + }), + setSelection: docMethodOp(function(anchor, head, options) { + setSimpleSelection(this, clipPos(this, anchor), clipPos(this, head || anchor), options); + }), + extendSelection: docMethodOp(function(head, other, options) { + extendSelection(this, clipPos(this, head), other && clipPos(this, other), options); + }), + extendSelections: docMethodOp(function(heads, options) { + extendSelections(this, clipPosArray(this, heads), options); + }), + extendSelectionsBy: docMethodOp(function(f, options) { + var heads = map(this.sel.ranges, f); + extendSelections(this, clipPosArray(this, heads), options); + }), + setSelections: docMethodOp(function(ranges, primary, options) { + var this$1 = this; + + if (!ranges.length) { return } + var out = []; + for (var i = 0; i < ranges.length; i++) + { out[i] = new Range(clipPos(this$1, ranges[i].anchor), + clipPos(this$1, ranges[i].head)); } + if (primary == null) { primary = Math.min(ranges.length - 1, this.sel.primIndex); } + setSelection(this, normalizeSelection(this.cm, out, primary), options); + }), + addSelection: docMethodOp(function(anchor, head, options) { + var ranges = this.sel.ranges.slice(0); + ranges.push(new Range(clipPos(this, anchor), clipPos(this, head || anchor))); + setSelection(this, normalizeSelection(this.cm, ranges, ranges.length - 1), options); + }), + + getSelection: function(lineSep) { + var this$1 = this; + + var ranges = this.sel.ranges, lines; + for (var i = 0; i < ranges.length; i++) { + var sel = getBetween(this$1, ranges[i].from(), ranges[i].to()); + lines = lines ? lines.concat(sel) : sel; + } + if (lineSep === false) { return lines } + else { return lines.join(lineSep || this.lineSeparator()) } + }, + getSelections: function(lineSep) { + var this$1 = this; + + var parts = [], ranges = this.sel.ranges; + for (var i = 0; i < ranges.length; i++) { + var sel = getBetween(this$1, ranges[i].from(), ranges[i].to()); + if (lineSep !== false) { sel = sel.join(lineSep || this$1.lineSeparator()); } + parts[i] = sel; + } + return parts + }, + replaceSelection: function(code, collapse, origin) { + var dup = []; + for (var i = 0; i < this.sel.ranges.length; i++) + { dup[i] = code; } + this.replaceSelections(dup, collapse, origin || "+input"); + }, + replaceSelections: docMethodOp(function(code, collapse, origin) { + var this$1 = this; + + var changes = [], sel = this.sel; + for (var i = 0; i < sel.ranges.length; i++) { + var range$$1 = sel.ranges[i]; + changes[i] = {from: range$$1.from(), to: range$$1.to(), text: this$1.splitLines(code[i]), origin: origin}; + } + var newSel = collapse && collapse != "end" && computeReplacedSel(this, changes, collapse); + for (var i$1 = changes.length - 1; i$1 >= 0; i$1--) + { makeChange(this$1, changes[i$1]); } + if (newSel) { setSelectionReplaceHistory(this, newSel); } + else if (this.cm) { ensureCursorVisible(this.cm); } + }), + undo: docMethodOp(function() {makeChangeFromHistory(this, "undo");}), + redo: docMethodOp(function() {makeChangeFromHistory(this, "redo");}), + undoSelection: docMethodOp(function() {makeChangeFromHistory(this, "undo", true);}), + redoSelection: docMethodOp(function() {makeChangeFromHistory(this, "redo", true);}), + + setExtending: function(val) {this.extend = val;}, + getExtending: function() {return this.extend}, + + historySize: function() { + var hist = this.history, done = 0, undone = 0; + for (var i = 0; i < hist.done.length; i++) { if (!hist.done[i].ranges) { ++done; } } + for (var i$1 = 0; i$1 < hist.undone.length; i$1++) { if (!hist.undone[i$1].ranges) { ++undone; } } + return {undo: done, redo: undone} + }, + clearHistory: function() {this.history = new History(this.history.maxGeneration);}, + + markClean: function() { + this.cleanGeneration = this.changeGeneration(true); + }, + changeGeneration: function(forceSplit) { + if (forceSplit) + { this.history.lastOp = this.history.lastSelOp = this.history.lastOrigin = null; } + return this.history.generation + }, + isClean: function (gen) { + return this.history.generation == (gen || this.cleanGeneration) + }, + + getHistory: function() { + return {done: copyHistoryArray(this.history.done), + undone: copyHistoryArray(this.history.undone)} + }, + setHistory: function(histData) { + var hist = this.history = new History(this.history.maxGeneration); + hist.done = copyHistoryArray(histData.done.slice(0), null, true); + hist.undone = copyHistoryArray(histData.undone.slice(0), null, true); + }, + + setGutterMarker: docMethodOp(function(line, gutterID, value) { + return changeLine(this, line, "gutter", function (line) { + var markers = line.gutterMarkers || (line.gutterMarkers = {}); + markers[gutterID] = value; + if (!value && isEmpty(markers)) { line.gutterMarkers = null; } + return true + }) + }), + + clearGutter: docMethodOp(function(gutterID) { + var this$1 = this; + + this.iter(function (line) { + if (line.gutterMarkers && line.gutterMarkers[gutterID]) { + changeLine(this$1, line, "gutter", function () { + line.gutterMarkers[gutterID] = null; + if (isEmpty(line.gutterMarkers)) { line.gutterMarkers = null; } + return true + }); + } + }); + }), + + lineInfo: function(line) { + var n; + if (typeof line == "number") { + if (!isLine(this, line)) { return null } + n = line; + line = getLine(this, line); + if (!line) { return null } + } else { + n = lineNo(line); + if (n == null) { return null } + } + return {line: n, handle: line, text: line.text, gutterMarkers: line.gutterMarkers, + textClass: line.textClass, bgClass: line.bgClass, wrapClass: line.wrapClass, + widgets: line.widgets} + }, + + addLineClass: docMethodOp(function(handle, where, cls) { + return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) { + var prop = where == "text" ? "textClass" + : where == "background" ? "bgClass" + : where == "gutter" ? "gutterClass" : "wrapClass"; + if (!line[prop]) { line[prop] = cls; } + else if (classTest(cls).test(line[prop])) { return false } + else { line[prop] += " " + cls; } + return true + }) + }), + removeLineClass: docMethodOp(function(handle, where, cls) { + return changeLine(this, handle, where == "gutter" ? "gutter" : "class", function (line) { + var prop = where == "text" ? "textClass" + : where == "background" ? "bgClass" + : where == "gutter" ? "gutterClass" : "wrapClass"; + var cur = line[prop]; + if (!cur) { return false } + else if (cls == null) { line[prop] = null; } + else { + var found = cur.match(classTest(cls)); + if (!found) { return false } + var end = found.index + found[0].length; + line[prop] = cur.slice(0, found.index) + (!found.index || end == cur.length ? "" : " ") + cur.slice(end) || null; + } + return true + }) + }), + + addLineWidget: docMethodOp(function(handle, node, options) { + return addLineWidget(this, handle, node, options) + }), + removeLineWidget: function(widget) { widget.clear(); }, + + markText: function(from, to, options) { + return markText(this, clipPos(this, from), clipPos(this, to), options, options && options.type || "range") + }, + setBookmark: function(pos, options) { + var realOpts = {replacedWith: options && (options.nodeType == null ? options.widget : options), + insertLeft: options && options.insertLeft, + clearWhenEmpty: false, shared: options && options.shared, + handleMouseEvents: options && options.handleMouseEvents}; + pos = clipPos(this, pos); + return markText(this, pos, pos, realOpts, "bookmark") + }, + findMarksAt: function(pos) { + pos = clipPos(this, pos); + var markers = [], spans = getLine(this, pos.line).markedSpans; + if (spans) { for (var i = 0; i < spans.length; ++i) { + var span = spans[i]; + if ((span.from == null || span.from <= pos.ch) && + (span.to == null || span.to >= pos.ch)) + { markers.push(span.marker.parent || span.marker); } + } } + return markers + }, + findMarks: function(from, to, filter) { + from = clipPos(this, from); to = clipPos(this, to); + var found = [], lineNo$$1 = from.line; + this.iter(from.line, to.line + 1, function (line) { + var spans = line.markedSpans; + if (spans) { for (var i = 0; i < spans.length; i++) { + var span = spans[i]; + if (!(span.to != null && lineNo$$1 == from.line && from.ch >= span.to || + span.from == null && lineNo$$1 != from.line || + span.from != null && lineNo$$1 == to.line && span.from >= to.ch) && + (!filter || filter(span.marker))) + { found.push(span.marker.parent || span.marker); } + } } + ++lineNo$$1; + }); + return found + }, + getAllMarks: function() { + var markers = []; + this.iter(function (line) { + var sps = line.markedSpans; + if (sps) { for (var i = 0; i < sps.length; ++i) + { if (sps[i].from != null) { markers.push(sps[i].marker); } } } + }); + return markers + }, + + posFromIndex: function(off) { + var ch, lineNo$$1 = this.first, sepSize = this.lineSeparator().length; + this.iter(function (line) { + var sz = line.text.length + sepSize; + if (sz > off) { ch = off; return true } + off -= sz; + ++lineNo$$1; + }); + return clipPos(this, Pos(lineNo$$1, ch)) + }, + indexFromPos: function (coords) { + coords = clipPos(this, coords); + var index = coords.ch; + if (coords.line < this.first || coords.ch < 0) { return 0 } + var sepSize = this.lineSeparator().length; + this.iter(this.first, coords.line, function (line) { // iter aborts when callback returns a truthy value + index += line.text.length + sepSize; + }); + return index + }, + + copy: function(copyHistory) { + var doc = new Doc(getLines(this, this.first, this.first + this.size), + this.modeOption, this.first, this.lineSep, this.direction); + doc.scrollTop = this.scrollTop; doc.scrollLeft = this.scrollLeft; + doc.sel = this.sel; + doc.extend = false; + if (copyHistory) { + doc.history.undoDepth = this.history.undoDepth; + doc.setHistory(this.getHistory()); + } + return doc + }, + + linkedDoc: function(options) { + if (!options) { options = {}; } + var from = this.first, to = this.first + this.size; + if (options.from != null && options.from > from) { from = options.from; } + if (options.to != null && options.to < to) { to = options.to; } + var copy = new Doc(getLines(this, from, to), options.mode || this.modeOption, from, this.lineSep, this.direction); + if (options.sharedHist) { copy.history = this.history + ; }(this.linked || (this.linked = [])).push({doc: copy, sharedHist: options.sharedHist}); + copy.linked = [{doc: this, isParent: true, sharedHist: options.sharedHist}]; + copySharedMarkers(copy, findSharedMarkers(this)); + return copy + }, + unlinkDoc: function(other) { + var this$1 = this; + + if (other instanceof CodeMirror) { other = other.doc; } + if (this.linked) { for (var i = 0; i < this.linked.length; ++i) { + var link = this$1.linked[i]; + if (link.doc != other) { continue } + this$1.linked.splice(i, 1); + other.unlinkDoc(this$1); + detachSharedMarkers(findSharedMarkers(this$1)); + break + } } + // If the histories were shared, split them again + if (other.history == this.history) { + var splitIds = [other.id]; + linkedDocs(other, function (doc) { return splitIds.push(doc.id); }, true); + other.history = new History(null); + other.history.done = copyHistoryArray(this.history.done, splitIds); + other.history.undone = copyHistoryArray(this.history.undone, splitIds); + } + }, + iterLinkedDocs: function(f) {linkedDocs(this, f);}, + + getMode: function() {return this.mode}, + getEditor: function() {return this.cm}, + + splitLines: function(str) { + if (this.lineSep) { return str.split(this.lineSep) } + return splitLinesAuto(str) + }, + lineSeparator: function() { return this.lineSep || "\n" }, + + setDirection: docMethodOp(function (dir) { + if (dir != "rtl") { dir = "ltr"; } + if (dir == this.direction) { return } + this.direction = dir; + this.iter(function (line) { return line.order = null; }); + if (this.cm) { directionChanged(this.cm); } + }) + }); + + // Public alias. + Doc.prototype.eachLine = Doc.prototype.iter; + + // Kludge to work around strange IE behavior where it'll sometimes + // re-fire a series of drag-related events right after the drop (#1551) + var lastDrop = 0; + + function onDrop(e) { + var cm = this; + clearDragCursor(cm); + if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) + { return } + e_preventDefault(e); + if (ie) { lastDrop = +new Date; } + var pos = posFromMouse(cm, e, true), files = e.dataTransfer.files; + if (!pos || cm.isReadOnly()) { return } + // Might be a file drop, in which case we simply extract the text + // and insert it. + if (files && files.length && window.FileReader && window.File) { + var n = files.length, text = Array(n), read = 0; + var loadFile = function (file, i) { + if (cm.options.allowDropFileTypes && + indexOf(cm.options.allowDropFileTypes, file.type) == -1) + { return } + + var reader = new FileReader; + reader.onload = operation(cm, function () { + var content = reader.result; + if (/[\x00-\x08\x0e-\x1f]{2}/.test(content)) { content = ""; } + text[i] = content; + if (++read == n) { + pos = clipPos(cm.doc, pos); + var change = {from: pos, to: pos, + text: cm.doc.splitLines(text.join(cm.doc.lineSeparator())), + origin: "paste"}; + makeChange(cm.doc, change); + setSelectionReplaceHistory(cm.doc, simpleSelection(pos, changeEnd(change))); + } + }); + reader.readAsText(file); + }; + for (var i = 0; i < n; ++i) { loadFile(files[i], i); } + } else { // Normal drop + // Don't do a replace if the drop happened inside of the selected text. + if (cm.state.draggingText && cm.doc.sel.contains(pos) > -1) { + cm.state.draggingText(e); + // Ensure the editor is re-focused + setTimeout(function () { return cm.display.input.focus(); }, 20); + return + } + try { + var text$1 = e.dataTransfer.getData("Text"); + if (text$1) { + var selected; + if (cm.state.draggingText && !cm.state.draggingText.copy) + { selected = cm.listSelections(); } + setSelectionNoUndo(cm.doc, simpleSelection(pos, pos)); + if (selected) { for (var i$1 = 0; i$1 < selected.length; ++i$1) + { replaceRange(cm.doc, "", selected[i$1].anchor, selected[i$1].head, "drag"); } } + cm.replaceSelection(text$1, "around", "paste"); + cm.display.input.focus(); + } + } + catch(e){} + } + } + + function onDragStart(cm, e) { + if (ie && (!cm.state.draggingText || +new Date - lastDrop < 100)) { e_stop(e); return } + if (signalDOMEvent(cm, e) || eventInWidget(cm.display, e)) { return } + + e.dataTransfer.setData("Text", cm.getSelection()); + e.dataTransfer.effectAllowed = "copyMove"; + + // Use dummy image instead of default browsers image. + // Recent Safari (~6.0.2) have a tendency to segfault when this happens, so we don't do it there. + if (e.dataTransfer.setDragImage && !safari) { + var img = elt("img", null, null, "position: fixed; left: 0; top: 0;"); + img.src = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="; + if (presto) { + img.width = img.height = 1; + cm.display.wrapper.appendChild(img); + // Force a relayout, or Opera won't use our image for some obscure reason + img._top = img.offsetTop; + } + e.dataTransfer.setDragImage(img, 0, 0); + if (presto) { img.parentNode.removeChild(img); } + } + } + + function onDragOver(cm, e) { + var pos = posFromMouse(cm, e); + if (!pos) { return } + var frag = document.createDocumentFragment(); + drawSelectionCursor(cm, pos, frag); + if (!cm.display.dragCursor) { + cm.display.dragCursor = elt("div", null, "CodeMirror-cursors CodeMirror-dragcursors"); + cm.display.lineSpace.insertBefore(cm.display.dragCursor, cm.display.cursorDiv); + } + removeChildrenAndAdd(cm.display.dragCursor, frag); + } + + function clearDragCursor(cm) { + if (cm.display.dragCursor) { + cm.display.lineSpace.removeChild(cm.display.dragCursor); + cm.display.dragCursor = null; + } + } + + // These must be handled carefully, because naively registering a + // handler for each editor will cause the editors to never be + // garbage collected. + + function forEachCodeMirror(f) { + if (!document.getElementsByClassName) { return } + var byClass = document.getElementsByClassName("CodeMirror"), editors = []; + for (var i = 0; i < byClass.length; i++) { + var cm = byClass[i].CodeMirror; + if (cm) { editors.push(cm); } + } + if (editors.length) { editors[0].operation(function () { + for (var i = 0; i < editors.length; i++) { f(editors[i]); } + }); } + } + + var globalsRegistered = false; + function ensureGlobalHandlers() { + if (globalsRegistered) { return } + registerGlobalHandlers(); + globalsRegistered = true; + } + function registerGlobalHandlers() { + // When the window resizes, we need to refresh active editors. + var resizeTimer; + on(window, "resize", function () { + if (resizeTimer == null) { resizeTimer = setTimeout(function () { + resizeTimer = null; + forEachCodeMirror(onResize); + }, 100); } + }); + // When the window loses focus, we want to show the editor as blurred + on(window, "blur", function () { return forEachCodeMirror(onBlur); }); + } + // Called when the window resizes + function onResize(cm) { + var d = cm.display; + // Might be a text scaling operation, clear size caches. + d.cachedCharWidth = d.cachedTextHeight = d.cachedPaddingH = null; + d.scrollbarsClipped = false; + cm.setSize(); + } + + var keyNames = { + 3: "Pause", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", + 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", + 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert", + 46: "Delete", 59: ";", 61: "=", 91: "Mod", 92: "Mod", 93: "Mod", + 106: "*", 107: "=", 109: "-", 110: ".", 111: "/", 145: "ScrollLock", + 173: "-", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", + 221: "]", 222: "'", 63232: "Up", 63233: "Down", 63234: "Left", 63235: "Right", 63272: "Delete", + 63273: "Home", 63275: "End", 63276: "PageUp", 63277: "PageDown", 63302: "Insert" + }; + + // Number keys + for (var i = 0; i < 10; i++) { keyNames[i + 48] = keyNames[i + 96] = String(i); } + // Alphabetic keys + for (var i$1 = 65; i$1 <= 90; i$1++) { keyNames[i$1] = String.fromCharCode(i$1); } + // Function keys + for (var i$2 = 1; i$2 <= 12; i$2++) { keyNames[i$2 + 111] = keyNames[i$2 + 63235] = "F" + i$2; } + + var keyMap = {}; + + keyMap.basic = { + "Left": "goCharLeft", "Right": "goCharRight", "Up": "goLineUp", "Down": "goLineDown", + "End": "goLineEnd", "Home": "goLineStartSmart", "PageUp": "goPageUp", "PageDown": "goPageDown", + "Delete": "delCharAfter", "Backspace": "delCharBefore", "Shift-Backspace": "delCharBefore", + "Tab": "defaultTab", "Shift-Tab": "indentAuto", + "Enter": "newlineAndIndent", "Insert": "toggleOverwrite", + "Esc": "singleSelection" + }; + // Note that the save and find-related commands aren't defined by + // default. User code or addons can define them. Unknown commands + // are simply ignored. + keyMap.pcDefault = { + "Ctrl-A": "selectAll", "Ctrl-D": "deleteLine", "Ctrl-Z": "undo", "Shift-Ctrl-Z": "redo", "Ctrl-Y": "redo", + "Ctrl-Home": "goDocStart", "Ctrl-End": "goDocEnd", "Ctrl-Up": "goLineUp", "Ctrl-Down": "goLineDown", + "Ctrl-Left": "goGroupLeft", "Ctrl-Right": "goGroupRight", "Alt-Left": "goLineStart", "Alt-Right": "goLineEnd", + "Ctrl-Backspace": "delGroupBefore", "Ctrl-Delete": "delGroupAfter", "Ctrl-S": "save", "Ctrl-F": "find", + "Ctrl-G": "findNext", "Shift-Ctrl-G": "findPrev", "Shift-Ctrl-F": "replace", "Shift-Ctrl-R": "replaceAll", + "Ctrl-[": "indentLess", "Ctrl-]": "indentMore", + "Ctrl-U": "undoSelection", "Shift-Ctrl-U": "redoSelection", "Alt-U": "redoSelection", + "fallthrough": "basic" + }; + // Very basic readline/emacs-style bindings, which are standard on Mac. + keyMap.emacsy = { + "Ctrl-F": "goCharRight", "Ctrl-B": "goCharLeft", "Ctrl-P": "goLineUp", "Ctrl-N": "goLineDown", + "Alt-F": "goWordRight", "Alt-B": "goWordLeft", "Ctrl-A": "goLineStart", "Ctrl-E": "goLineEnd", + "Ctrl-V": "goPageDown", "Shift-Ctrl-V": "goPageUp", "Ctrl-D": "delCharAfter", "Ctrl-H": "delCharBefore", + "Alt-D": "delWordAfter", "Alt-Backspace": "delWordBefore", "Ctrl-K": "killLine", "Ctrl-T": "transposeChars", + "Ctrl-O": "openLine" + }; + keyMap.macDefault = { + "Cmd-A": "selectAll", "Cmd-D": "deleteLine", "Cmd-Z": "undo", "Shift-Cmd-Z": "redo", "Cmd-Y": "redo", + "Cmd-Home": "goDocStart", "Cmd-Up": "goDocStart", "Cmd-End": "goDocEnd", "Cmd-Down": "goDocEnd", "Alt-Left": "goGroupLeft", + "Alt-Right": "goGroupRight", "Cmd-Left": "goLineLeft", "Cmd-Right": "goLineRight", "Alt-Backspace": "delGroupBefore", + "Ctrl-Alt-Backspace": "delGroupAfter", "Alt-Delete": "delGroupAfter", "Cmd-S": "save", "Cmd-F": "find", + "Cmd-G": "findNext", "Shift-Cmd-G": "findPrev", "Cmd-Alt-F": "replace", "Shift-Cmd-Alt-F": "replaceAll", + "Cmd-[": "indentLess", "Cmd-]": "indentMore", "Cmd-Backspace": "delWrappedLineLeft", "Cmd-Delete": "delWrappedLineRight", + "Cmd-U": "undoSelection", "Shift-Cmd-U": "redoSelection", "Ctrl-Up": "goDocStart", "Ctrl-Down": "goDocEnd", + "fallthrough": ["basic", "emacsy"] + }; + keyMap["default"] = mac ? keyMap.macDefault : keyMap.pcDefault; + + // KEYMAP DISPATCH + + function normalizeKeyName(name) { + var parts = name.split(/-(?!$)/); + name = parts[parts.length - 1]; + var alt, ctrl, shift, cmd; + for (var i = 0; i < parts.length - 1; i++) { + var mod = parts[i]; + if (/^(cmd|meta|m)$/i.test(mod)) { cmd = true; } + else if (/^a(lt)?$/i.test(mod)) { alt = true; } + else if (/^(c|ctrl|control)$/i.test(mod)) { ctrl = true; } + else if (/^s(hift)?$/i.test(mod)) { shift = true; } + else { throw new Error("Unrecognized modifier name: " + mod) } + } + if (alt) { name = "Alt-" + name; } + if (ctrl) { name = "Ctrl-" + name; } + if (cmd) { name = "Cmd-" + name; } + if (shift) { name = "Shift-" + name; } + return name + } + + // This is a kludge to keep keymaps mostly working as raw objects + // (backwards compatibility) while at the same time support features + // like normalization and multi-stroke key bindings. It compiles a + // new normalized keymap, and then updates the old object to reflect + // this. + function normalizeKeyMap(keymap) { + var copy = {}; + for (var keyname in keymap) { if (keymap.hasOwnProperty(keyname)) { + var value = keymap[keyname]; + if (/^(name|fallthrough|(de|at)tach)$/.test(keyname)) { continue } + if (value == "...") { delete keymap[keyname]; continue } + + var keys = map(keyname.split(" "), normalizeKeyName); + for (var i = 0; i < keys.length; i++) { + var val = (void 0), name = (void 0); + if (i == keys.length - 1) { + name = keys.join(" "); + val = value; + } else { + name = keys.slice(0, i + 1).join(" "); + val = "..."; + } + var prev = copy[name]; + if (!prev) { copy[name] = val; } + else if (prev != val) { throw new Error("Inconsistent bindings for " + name) } + } + delete keymap[keyname]; + } } + for (var prop in copy) { keymap[prop] = copy[prop]; } + return keymap + } + + function lookupKey(key, map$$1, handle, context) { + map$$1 = getKeyMap(map$$1); + var found = map$$1.call ? map$$1.call(key, context) : map$$1[key]; + if (found === false) { return "nothing" } + if (found === "...") { return "multi" } + if (found != null && handle(found)) { return "handled" } + + if (map$$1.fallthrough) { + if (Object.prototype.toString.call(map$$1.fallthrough) != "[object Array]") + { return lookupKey(key, map$$1.fallthrough, handle, context) } + for (var i = 0; i < map$$1.fallthrough.length; i++) { + var result = lookupKey(key, map$$1.fallthrough[i], handle, context); + if (result) { return result } + } + } + } + + // Modifier key presses don't count as 'real' key presses for the + // purpose of keymap fallthrough. + function isModifierKey(value) { + var name = typeof value == "string" ? value : keyNames[value.keyCode]; + return name == "Ctrl" || name == "Alt" || name == "Shift" || name == "Mod" + } + + function addModifierNames(name, event, noShift) { + var base = name; + if (event.altKey && base != "Alt") { name = "Alt-" + name; } + if ((flipCtrlCmd ? event.metaKey : event.ctrlKey) && base != "Ctrl") { name = "Ctrl-" + name; } + if ((flipCtrlCmd ? event.ctrlKey : event.metaKey) && base != "Cmd") { name = "Cmd-" + name; } + if (!noShift && event.shiftKey && base != "Shift") { name = "Shift-" + name; } + return name + } + + // Look up the name of a key as indicated by an event object. + function keyName(event, noShift) { + if (presto && event.keyCode == 34 && event["char"]) { return false } + var name = keyNames[event.keyCode]; + if (name == null || event.altGraphKey) { return false } + // Ctrl-ScrollLock has keyCode 3, same as Ctrl-Pause, + // so we'll use event.code when available (Chrome 48+, FF 38+, Safari 10.1+) + if (event.keyCode == 3 && event.code) { name = event.code; } + return addModifierNames(name, event, noShift) + } + + function getKeyMap(val) { + return typeof val == "string" ? keyMap[val] : val + } + + // Helper for deleting text near the selection(s), used to implement + // backspace, delete, and similar functionality. + function deleteNearSelection(cm, compute) { + var ranges = cm.doc.sel.ranges, kill = []; + // Build up a set of ranges to kill first, merging overlapping + // ranges. + for (var i = 0; i < ranges.length; i++) { + var toKill = compute(ranges[i]); + while (kill.length && cmp(toKill.from, lst(kill).to) <= 0) { + var replaced = kill.pop(); + if (cmp(replaced.from, toKill.from) < 0) { + toKill.from = replaced.from; + break + } + } + kill.push(toKill); + } + // Next, remove those actual ranges. + runInOp(cm, function () { + for (var i = kill.length - 1; i >= 0; i--) + { replaceRange(cm.doc, "", kill[i].from, kill[i].to, "+delete"); } + ensureCursorVisible(cm); + }); + } + + function moveCharLogically(line, ch, dir) { + var target = skipExtendingChars(line.text, ch + dir, dir); + return target < 0 || target > line.text.length ? null : target + } + + function moveLogically(line, start, dir) { + var ch = moveCharLogically(line, start.ch, dir); + return ch == null ? null : new Pos(start.line, ch, dir < 0 ? "after" : "before") + } + + function endOfLine(visually, cm, lineObj, lineNo, dir) { + if (visually) { + var order = getOrder(lineObj, cm.doc.direction); + if (order) { + var part = dir < 0 ? lst(order) : order[0]; + var moveInStorageOrder = (dir < 0) == (part.level == 1); + var sticky = moveInStorageOrder ? "after" : "before"; + var ch; + // With a wrapped rtl chunk (possibly spanning multiple bidi parts), + // it could be that the last bidi part is not on the last visual line, + // since visual lines contain content order-consecutive chunks. + // Thus, in rtl, we are looking for the first (content-order) character + // in the rtl chunk that is on the last line (that is, the same line + // as the last (content-order) character). + if (part.level > 0 || cm.doc.direction == "rtl") { + var prep = prepareMeasureForLine(cm, lineObj); + ch = dir < 0 ? lineObj.text.length - 1 : 0; + var targetTop = measureCharPrepared(cm, prep, ch).top; + ch = findFirst(function (ch) { return measureCharPrepared(cm, prep, ch).top == targetTop; }, (dir < 0) == (part.level == 1) ? part.from : part.to - 1, ch); + if (sticky == "before") { ch = moveCharLogically(lineObj, ch, 1); } + } else { ch = dir < 0 ? part.to : part.from; } + return new Pos(lineNo, ch, sticky) + } + } + return new Pos(lineNo, dir < 0 ? lineObj.text.length : 0, dir < 0 ? "before" : "after") + } + + function moveVisually(cm, line, start, dir) { + var bidi = getOrder(line, cm.doc.direction); + if (!bidi) { return moveLogically(line, start, dir) } + if (start.ch >= line.text.length) { + start.ch = line.text.length; + start.sticky = "before"; + } else if (start.ch <= 0) { + start.ch = 0; + start.sticky = "after"; + } + var partPos = getBidiPartAt(bidi, start.ch, start.sticky), part = bidi[partPos]; + if (cm.doc.direction == "ltr" && part.level % 2 == 0 && (dir > 0 ? part.to > start.ch : part.from < start.ch)) { + // Case 1: We move within an ltr part in an ltr editor. Even with wrapped lines, + // nothing interesting happens. + return moveLogically(line, start, dir) + } + + var mv = function (pos, dir) { return moveCharLogically(line, pos instanceof Pos ? pos.ch : pos, dir); }; + var prep; + var getWrappedLineExtent = function (ch) { + if (!cm.options.lineWrapping) { return {begin: 0, end: line.text.length} } + prep = prep || prepareMeasureForLine(cm, line); + return wrappedLineExtentChar(cm, line, prep, ch) + }; + var wrappedLineExtent = getWrappedLineExtent(start.sticky == "before" ? mv(start, -1) : start.ch); + + if (cm.doc.direction == "rtl" || part.level == 1) { + var moveInStorageOrder = (part.level == 1) == (dir < 0); + var ch = mv(start, moveInStorageOrder ? 1 : -1); + if (ch != null && (!moveInStorageOrder ? ch >= part.from && ch >= wrappedLineExtent.begin : ch <= part.to && ch <= wrappedLineExtent.end)) { + // Case 2: We move within an rtl part or in an rtl editor on the same visual line + var sticky = moveInStorageOrder ? "before" : "after"; + return new Pos(start.line, ch, sticky) + } + } + + // Case 3: Could not move within this bidi part in this visual line, so leave + // the current bidi part + + var searchInVisualLine = function (partPos, dir, wrappedLineExtent) { + var getRes = function (ch, moveInStorageOrder) { return moveInStorageOrder + ? new Pos(start.line, mv(ch, 1), "before") + : new Pos(start.line, ch, "after"); }; + + for (; partPos >= 0 && partPos < bidi.length; partPos += dir) { + var part = bidi[partPos]; + var moveInStorageOrder = (dir > 0) == (part.level != 1); + var ch = moveInStorageOrder ? wrappedLineExtent.begin : mv(wrappedLineExtent.end, -1); + if (part.from <= ch && ch < part.to) { return getRes(ch, moveInStorageOrder) } + ch = moveInStorageOrder ? part.from : mv(part.to, -1); + if (wrappedLineExtent.begin <= ch && ch < wrappedLineExtent.end) { return getRes(ch, moveInStorageOrder) } + } + }; + + // Case 3a: Look for other bidi parts on the same visual line + var res = searchInVisualLine(partPos + dir, dir, wrappedLineExtent); + if (res) { return res } + + // Case 3b: Look for other bidi parts on the next visual line + var nextCh = dir > 0 ? wrappedLineExtent.end : mv(wrappedLineExtent.begin, -1); + if (nextCh != null && !(dir > 0 && nextCh == line.text.length)) { + res = searchInVisualLine(dir > 0 ? 0 : bidi.length - 1, dir, getWrappedLineExtent(nextCh)); + if (res) { return res } + } + + // Case 4: Nowhere to move + return null + } + + // Commands are parameter-less actions that can be performed on an + // editor, mostly used for keybindings. + var commands = { + selectAll: selectAll, + singleSelection: function (cm) { return cm.setSelection(cm.getCursor("anchor"), cm.getCursor("head"), sel_dontScroll); }, + killLine: function (cm) { return deleteNearSelection(cm, function (range) { + if (range.empty()) { + var len = getLine(cm.doc, range.head.line).text.length; + if (range.head.ch == len && range.head.line < cm.lastLine()) + { return {from: range.head, to: Pos(range.head.line + 1, 0)} } + else + { return {from: range.head, to: Pos(range.head.line, len)} } + } else { + return {from: range.from(), to: range.to()} + } + }); }, + deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({ + from: Pos(range.from().line, 0), + to: clipPos(cm.doc, Pos(range.to().line + 1, 0)) + }); }); }, + delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({ + from: Pos(range.from().line, 0), to: range.from() + }); }); }, + delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { + var top = cm.charCoords(range.head, "div").top + 5; + var leftPos = cm.coordsChar({left: 0, top: top}, "div"); + return {from: leftPos, to: range.from()} + }); }, + delWrappedLineRight: function (cm) { return deleteNearSelection(cm, function (range) { + var top = cm.charCoords(range.head, "div").top + 5; + var rightPos = cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div"); + return {from: range.from(), to: rightPos } + }); }, + undo: function (cm) { return cm.undo(); }, + redo: function (cm) { return cm.redo(); }, + undoSelection: function (cm) { return cm.undoSelection(); }, + redoSelection: function (cm) { return cm.redoSelection(); }, + goDocStart: function (cm) { return cm.extendSelection(Pos(cm.firstLine(), 0)); }, + goDocEnd: function (cm) { return cm.extendSelection(Pos(cm.lastLine())); }, + goLineStart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStart(cm, range.head.line); }, + {origin: "+move", bias: 1} + ); }, + goLineStartSmart: function (cm) { return cm.extendSelectionsBy(function (range) { return lineStartSmart(cm, range.head); }, + {origin: "+move", bias: 1} + ); }, + goLineEnd: function (cm) { return cm.extendSelectionsBy(function (range) { return lineEnd(cm, range.head.line); }, + {origin: "+move", bias: -1} + ); }, + goLineRight: function (cm) { return cm.extendSelectionsBy(function (range) { + var top = cm.cursorCoords(range.head, "div").top + 5; + return cm.coordsChar({left: cm.display.lineDiv.offsetWidth + 100, top: top}, "div") + }, sel_move); }, + goLineLeft: function (cm) { return cm.extendSelectionsBy(function (range) { + var top = cm.cursorCoords(range.head, "div").top + 5; + return cm.coordsChar({left: 0, top: top}, "div") + }, sel_move); }, + goLineLeftSmart: function (cm) { return cm.extendSelectionsBy(function (range) { + var top = cm.cursorCoords(range.head, "div").top + 5; + var pos = cm.coordsChar({left: 0, top: top}, "div"); + if (pos.ch < cm.getLine(pos.line).search(/\S/)) { return lineStartSmart(cm, range.head) } + return pos + }, sel_move); }, + goLineUp: function (cm) { return cm.moveV(-1, "line"); }, + goLineDown: function (cm) { return cm.moveV(1, "line"); }, + goPageUp: function (cm) { return cm.moveV(-1, "page"); }, + goPageDown: function (cm) { return cm.moveV(1, "page"); }, + goCharLeft: function (cm) { return cm.moveH(-1, "char"); }, + goCharRight: function (cm) { return cm.moveH(1, "char"); }, + goColumnLeft: function (cm) { return cm.moveH(-1, "column"); }, + goColumnRight: function (cm) { return cm.moveH(1, "column"); }, + goWordLeft: function (cm) { return cm.moveH(-1, "word"); }, + goGroupRight: function (cm) { return cm.moveH(1, "group"); }, + goGroupLeft: function (cm) { return cm.moveH(-1, "group"); }, + goWordRight: function (cm) { return cm.moveH(1, "word"); }, + delCharBefore: function (cm) { return cm.deleteH(-1, "char"); }, + delCharAfter: function (cm) { return cm.deleteH(1, "char"); }, + delWordBefore: function (cm) { return cm.deleteH(-1, "word"); }, + delWordAfter: function (cm) { return cm.deleteH(1, "word"); }, + delGroupBefore: function (cm) { return cm.deleteH(-1, "group"); }, + delGroupAfter: function (cm) { return cm.deleteH(1, "group"); }, + indentAuto: function (cm) { return cm.indentSelection("smart"); }, + indentMore: function (cm) { return cm.indentSelection("add"); }, + indentLess: function (cm) { return cm.indentSelection("subtract"); }, + insertTab: function (cm) { return cm.replaceSelection("\t"); }, + insertSoftTab: function (cm) { + var spaces = [], ranges = cm.listSelections(), tabSize = cm.options.tabSize; + for (var i = 0; i < ranges.length; i++) { + var pos = ranges[i].from(); + var col = countColumn(cm.getLine(pos.line), pos.ch, tabSize); + spaces.push(spaceStr(tabSize - col % tabSize)); + } + cm.replaceSelections(spaces); + }, + defaultTab: function (cm) { + if (cm.somethingSelected()) { cm.indentSelection("add"); } + else { cm.execCommand("insertTab"); } + }, + // Swap the two chars left and right of each selection's head. + // Move cursor behind the two swapped characters afterwards. + // + // Doesn't consider line feeds a character. + // Doesn't scan more than one line above to find a character. + // Doesn't do anything on an empty line. + // Doesn't do anything with non-empty selections. + transposeChars: function (cm) { return runInOp(cm, function () { + var ranges = cm.listSelections(), newSel = []; + for (var i = 0; i < ranges.length; i++) { + if (!ranges[i].empty()) { continue } + var cur = ranges[i].head, line = getLine(cm.doc, cur.line).text; + if (line) { + if (cur.ch == line.length) { cur = new Pos(cur.line, cur.ch - 1); } + if (cur.ch > 0) { + cur = new Pos(cur.line, cur.ch + 1); + cm.replaceRange(line.charAt(cur.ch - 1) + line.charAt(cur.ch - 2), + Pos(cur.line, cur.ch - 2), cur, "+transpose"); + } else if (cur.line > cm.doc.first) { + var prev = getLine(cm.doc, cur.line - 1).text; + if (prev) { + cur = new Pos(cur.line, 1); + cm.replaceRange(line.charAt(0) + cm.doc.lineSeparator() + + prev.charAt(prev.length - 1), + Pos(cur.line - 1, prev.length - 1), cur, "+transpose"); + } + } + } + newSel.push(new Range(cur, cur)); + } + cm.setSelections(newSel); + }); }, + newlineAndIndent: function (cm) { return runInOp(cm, function () { + var sels = cm.listSelections(); + for (var i = sels.length - 1; i >= 0; i--) + { cm.replaceRange(cm.doc.lineSeparator(), sels[i].anchor, sels[i].head, "+input"); } + sels = cm.listSelections(); + for (var i$1 = 0; i$1 < sels.length; i$1++) + { cm.indentLine(sels[i$1].from().line, null, true); } + ensureCursorVisible(cm); + }); }, + openLine: function (cm) { return cm.replaceSelection("\n", "start"); }, + toggleOverwrite: function (cm) { return cm.toggleOverwrite(); } + }; + + + function lineStart(cm, lineN) { + var line = getLine(cm.doc, lineN); + var visual = visualLine(line); + if (visual != line) { lineN = lineNo(visual); } + return endOfLine(true, cm, visual, lineN, 1) + } + function lineEnd(cm, lineN) { + var line = getLine(cm.doc, lineN); + var visual = visualLineEnd(line); + if (visual != line) { lineN = lineNo(visual); } + return endOfLine(true, cm, line, lineN, -1) + } + function lineStartSmart(cm, pos) { + var start = lineStart(cm, pos.line); + var line = getLine(cm.doc, start.line); + var order = getOrder(line, cm.doc.direction); + if (!order || order[0].level == 0) { + var firstNonWS = Math.max(0, line.text.search(/\S/)); + var inWS = pos.line == start.line && pos.ch <= firstNonWS && pos.ch; + return Pos(start.line, inWS ? 0 : firstNonWS, start.sticky) + } + return start + } + + // Run a handler that was bound to a key. + function doHandleBinding(cm, bound, dropShift) { + if (typeof bound == "string") { + bound = commands[bound]; + if (!bound) { return false } + } + // Ensure previous input has been read, so that the handler sees a + // consistent view of the document + cm.display.input.ensurePolled(); + var prevShift = cm.display.shift, done = false; + try { + if (cm.isReadOnly()) { cm.state.suppressEdits = true; } + if (dropShift) { cm.display.shift = false; } + done = bound(cm) != Pass; + } finally { + cm.display.shift = prevShift; + cm.state.suppressEdits = false; + } + return done + } + + function lookupKeyForEditor(cm, name, handle) { + for (var i = 0; i < cm.state.keyMaps.length; i++) { + var result = lookupKey(name, cm.state.keyMaps[i], handle, cm); + if (result) { return result } + } + return (cm.options.extraKeys && lookupKey(name, cm.options.extraKeys, handle, cm)) + || lookupKey(name, cm.options.keyMap, handle, cm) + } + + // Note that, despite the name, this function is also used to check + // for bound mouse clicks. + + var stopSeq = new Delayed; + + function dispatchKey(cm, name, e, handle) { + var seq = cm.state.keySeq; + if (seq) { + if (isModifierKey(name)) { return "handled" } + if (/\'$/.test(name)) + { cm.state.keySeq = null; } + else + { stopSeq.set(50, function () { + if (cm.state.keySeq == seq) { + cm.state.keySeq = null; + cm.display.input.reset(); + } + }); } + if (dispatchKeyInner(cm, seq + " " + name, e, handle)) { return true } + } + return dispatchKeyInner(cm, name, e, handle) + } + + function dispatchKeyInner(cm, name, e, handle) { + var result = lookupKeyForEditor(cm, name, handle); + + if (result == "multi") + { cm.state.keySeq = name; } + if (result == "handled") + { signalLater(cm, "keyHandled", cm, name, e); } + + if (result == "handled" || result == "multi") { + e_preventDefault(e); + restartBlink(cm); + } + + return !!result + } + + // Handle a key from the keydown event. + function handleKeyBinding(cm, e) { + var name = keyName(e, true); + if (!name) { return false } + + if (e.shiftKey && !cm.state.keySeq) { + // First try to resolve full name (including 'Shift-'). Failing + // that, see if there is a cursor-motion command (starting with + // 'go') bound to the keyname without 'Shift-'. + return dispatchKey(cm, "Shift-" + name, e, function (b) { return doHandleBinding(cm, b, true); }) + || dispatchKey(cm, name, e, function (b) { + if (typeof b == "string" ? /^go[A-Z]/.test(b) : b.motion) + { return doHandleBinding(cm, b) } + }) + } else { + return dispatchKey(cm, name, e, function (b) { return doHandleBinding(cm, b); }) + } + } + + // Handle a key from the keypress event + function handleCharBinding(cm, e, ch) { + return dispatchKey(cm, "'" + ch + "'", e, function (b) { return doHandleBinding(cm, b, true); }) + } + + var lastStoppedKey = null; + function onKeyDown(e) { + var cm = this; + cm.curOp.focus = activeElt(); + if (signalDOMEvent(cm, e)) { return } + // IE does strange things with escape. + if (ie && ie_version < 11 && e.keyCode == 27) { e.returnValue = false; } + var code = e.keyCode; + cm.display.shift = code == 16 || e.shiftKey; + var handled = handleKeyBinding(cm, e); + if (presto) { + lastStoppedKey = handled ? code : null; + // Opera has no cut event... we try to at least catch the key combo + if (!handled && code == 88 && !hasCopyEvent && (mac ? e.metaKey : e.ctrlKey)) + { cm.replaceSelection("", null, "cut"); } + } + + // Turn mouse into crosshair when Alt is held on Mac. + if (code == 18 && !/\bCodeMirror-crosshair\b/.test(cm.display.lineDiv.className)) + { showCrossHair(cm); } + } + + function showCrossHair(cm) { + var lineDiv = cm.display.lineDiv; + addClass(lineDiv, "CodeMirror-crosshair"); + + function up(e) { + if (e.keyCode == 18 || !e.altKey) { + rmClass(lineDiv, "CodeMirror-crosshair"); + off(document, "keyup", up); + off(document, "mouseover", up); + } + } + on(document, "keyup", up); + on(document, "mouseover", up); + } + + function onKeyUp(e) { + if (e.keyCode == 16) { this.doc.sel.shift = false; } + signalDOMEvent(this, e); + } + + function onKeyPress(e) { + var cm = this; + if (eventInWidget(cm.display, e) || signalDOMEvent(cm, e) || e.ctrlKey && !e.altKey || mac && e.metaKey) { return } + var keyCode = e.keyCode, charCode = e.charCode; + if (presto && keyCode == lastStoppedKey) {lastStoppedKey = null; e_preventDefault(e); return} + if ((presto && (!e.which || e.which < 10)) && handleKeyBinding(cm, e)) { return } + var ch = String.fromCharCode(charCode == null ? keyCode : charCode); + // Some browsers fire keypress events for backspace + if (ch == "\x08") { return } + if (handleCharBinding(cm, e, ch)) { return } + cm.display.input.onKeyPress(e); + } + + var DOUBLECLICK_DELAY = 400; + + var PastClick = function(time, pos, button) { + this.time = time; + this.pos = pos; + this.button = button; + }; + + PastClick.prototype.compare = function (time, pos, button) { + return this.time + DOUBLECLICK_DELAY > time && + cmp(pos, this.pos) == 0 && button == this.button + }; + + var lastClick, lastDoubleClick; + function clickRepeat(pos, button) { + var now = +new Date; + if (lastDoubleClick && lastDoubleClick.compare(now, pos, button)) { + lastClick = lastDoubleClick = null; + return "triple" + } else if (lastClick && lastClick.compare(now, pos, button)) { + lastDoubleClick = new PastClick(now, pos, button); + lastClick = null; + return "double" + } else { + lastClick = new PastClick(now, pos, button); + lastDoubleClick = null; + return "single" + } + } + + // A mouse down can be a single click, double click, triple click, + // start of selection drag, start of text drag, new cursor + // (ctrl-click), rectangle drag (alt-drag), or xwin + // middle-click-paste. Or it might be a click on something we should + // not interfere with, such as a scrollbar or widget. + function onMouseDown(e) { + var cm = this, display = cm.display; + if (signalDOMEvent(cm, e) || display.activeTouch && display.input.supportsTouch()) { return } + display.input.ensurePolled(); + display.shift = e.shiftKey; + + if (eventInWidget(display, e)) { + if (!webkit) { + // Briefly turn off draggability, to allow widgets to do + // normal dragging things. + display.scroller.draggable = false; + setTimeout(function () { return display.scroller.draggable = true; }, 100); + } + return + } + if (clickInGutter(cm, e)) { return } + var pos = posFromMouse(cm, e), button = e_button(e), repeat = pos ? clickRepeat(pos, button) : "single"; + window.focus(); + + // #3261: make sure, that we're not starting a second selection + if (button == 1 && cm.state.selectingText) + { cm.state.selectingText(e); } + + if (pos && handleMappedButton(cm, button, pos, repeat, e)) { return } + + if (button == 1) { + if (pos) { leftButtonDown(cm, pos, repeat, e); } + else if (e_target(e) == display.scroller) { e_preventDefault(e); } + } else if (button == 2) { + if (pos) { extendSelection(cm.doc, pos); } + setTimeout(function () { return display.input.focus(); }, 20); + } else if (button == 3) { + if (captureRightClick) { cm.display.input.onContextMenu(e); } + else { delayBlurEvent(cm); } + } + } + + function handleMappedButton(cm, button, pos, repeat, event) { + var name = "Click"; + if (repeat == "double") { name = "Double" + name; } + else if (repeat == "triple") { name = "Triple" + name; } + name = (button == 1 ? "Left" : button == 2 ? "Middle" : "Right") + name; + + return dispatchKey(cm, addModifierNames(name, event), event, function (bound) { + if (typeof bound == "string") { bound = commands[bound]; } + if (!bound) { return false } + var done = false; + try { + if (cm.isReadOnly()) { cm.state.suppressEdits = true; } + done = bound(cm, pos) != Pass; + } finally { + cm.state.suppressEdits = false; + } + return done + }) + } + + function configureMouse(cm, repeat, event) { + var option = cm.getOption("configureMouse"); + var value = option ? option(cm, repeat, event) : {}; + if (value.unit == null) { + var rect = chromeOS ? event.shiftKey && event.metaKey : event.altKey; + value.unit = rect ? "rectangle" : repeat == "single" ? "char" : repeat == "double" ? "word" : "line"; + } + if (value.extend == null || cm.doc.extend) { value.extend = cm.doc.extend || event.shiftKey; } + if (value.addNew == null) { value.addNew = mac ? event.metaKey : event.ctrlKey; } + if (value.moveOnDrag == null) { value.moveOnDrag = !(mac ? event.altKey : event.ctrlKey); } + return value + } + + function leftButtonDown(cm, pos, repeat, event) { + if (ie) { setTimeout(bind(ensureFocus, cm), 0); } + else { cm.curOp.focus = activeElt(); } + + var behavior = configureMouse(cm, repeat, event); + + var sel = cm.doc.sel, contained; + if (cm.options.dragDrop && dragAndDrop && !cm.isReadOnly() && + repeat == "single" && (contained = sel.contains(pos)) > -1 && + (cmp((contained = sel.ranges[contained]).from(), pos) < 0 || pos.xRel > 0) && + (cmp(contained.to(), pos) > 0 || pos.xRel < 0)) + { leftButtonStartDrag(cm, event, pos, behavior); } + else + { leftButtonSelect(cm, event, pos, behavior); } + } + + // Start a text drag. When it ends, see if any dragging actually + // happen, and treat as a click if it didn't. + function leftButtonStartDrag(cm, event, pos, behavior) { + var display = cm.display, moved = false; + var dragEnd = operation(cm, function (e) { + if (webkit) { display.scroller.draggable = false; } + cm.state.draggingText = false; + off(display.wrapper.ownerDocument, "mouseup", dragEnd); + off(display.wrapper.ownerDocument, "mousemove", mouseMove); + off(display.scroller, "dragstart", dragStart); + off(display.scroller, "drop", dragEnd); + if (!moved) { + e_preventDefault(e); + if (!behavior.addNew) + { extendSelection(cm.doc, pos, null, null, behavior.extend); } + // Work around unexplainable focus problem in IE9 (#2127) and Chrome (#3081) + if (webkit || ie && ie_version == 9) + { setTimeout(function () {display.wrapper.ownerDocument.body.focus(); display.input.focus();}, 20); } + else + { display.input.focus(); } + } + }); + var mouseMove = function(e2) { + moved = moved || Math.abs(event.clientX - e2.clientX) + Math.abs(event.clientY - e2.clientY) >= 10; + }; + var dragStart = function () { return moved = true; }; + // Let the drag handler handle this. + if (webkit) { display.scroller.draggable = true; } + cm.state.draggingText = dragEnd; + dragEnd.copy = !behavior.moveOnDrag; + // IE's approach to draggable + if (display.scroller.dragDrop) { display.scroller.dragDrop(); } + on(display.wrapper.ownerDocument, "mouseup", dragEnd); + on(display.wrapper.ownerDocument, "mousemove", mouseMove); + on(display.scroller, "dragstart", dragStart); + on(display.scroller, "drop", dragEnd); + + delayBlurEvent(cm); + setTimeout(function () { return display.input.focus(); }, 20); + } + + function rangeForUnit(cm, pos, unit) { + if (unit == "char") { return new Range(pos, pos) } + if (unit == "word") { return cm.findWordAt(pos) } + if (unit == "line") { return new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))) } + var result = unit(cm, pos); + return new Range(result.from, result.to) + } + + // Normal selection, as opposed to text dragging. + function leftButtonSelect(cm, event, start, behavior) { + var display = cm.display, doc = cm.doc; + e_preventDefault(event); + + var ourRange, ourIndex, startSel = doc.sel, ranges = startSel.ranges; + if (behavior.addNew && !behavior.extend) { + ourIndex = doc.sel.contains(start); + if (ourIndex > -1) + { ourRange = ranges[ourIndex]; } + else + { ourRange = new Range(start, start); } + } else { + ourRange = doc.sel.primary(); + ourIndex = doc.sel.primIndex; + } + + if (behavior.unit == "rectangle") { + if (!behavior.addNew) { ourRange = new Range(start, start); } + start = posFromMouse(cm, event, true, true); + ourIndex = -1; + } else { + var range$$1 = rangeForUnit(cm, start, behavior.unit); + if (behavior.extend) + { ourRange = extendRange(ourRange, range$$1.anchor, range$$1.head, behavior.extend); } + else + { ourRange = range$$1; } + } + + if (!behavior.addNew) { + ourIndex = 0; + setSelection(doc, new Selection([ourRange], 0), sel_mouse); + startSel = doc.sel; + } else if (ourIndex == -1) { + ourIndex = ranges.length; + setSelection(doc, normalizeSelection(cm, ranges.concat([ourRange]), ourIndex), + {scroll: false, origin: "*mouse"}); + } else if (ranges.length > 1 && ranges[ourIndex].empty() && behavior.unit == "char" && !behavior.extend) { + setSelection(doc, normalizeSelection(cm, ranges.slice(0, ourIndex).concat(ranges.slice(ourIndex + 1)), 0), + {scroll: false, origin: "*mouse"}); + startSel = doc.sel; + } else { + replaceOneSelection(doc, ourIndex, ourRange, sel_mouse); + } + + var lastPos = start; + function extendTo(pos) { + if (cmp(lastPos, pos) == 0) { return } + lastPos = pos; + + if (behavior.unit == "rectangle") { + var ranges = [], tabSize = cm.options.tabSize; + var startCol = countColumn(getLine(doc, start.line).text, start.ch, tabSize); + var posCol = countColumn(getLine(doc, pos.line).text, pos.ch, tabSize); + var left = Math.min(startCol, posCol), right = Math.max(startCol, posCol); + for (var line = Math.min(start.line, pos.line), end = Math.min(cm.lastLine(), Math.max(start.line, pos.line)); + line <= end; line++) { + var text = getLine(doc, line).text, leftPos = findColumn(text, left, tabSize); + if (left == right) + { ranges.push(new Range(Pos(line, leftPos), Pos(line, leftPos))); } + else if (text.length > leftPos) + { ranges.push(new Range(Pos(line, leftPos), Pos(line, findColumn(text, right, tabSize)))); } + } + if (!ranges.length) { ranges.push(new Range(start, start)); } + setSelection(doc, normalizeSelection(cm, startSel.ranges.slice(0, ourIndex).concat(ranges), ourIndex), + {origin: "*mouse", scroll: false}); + cm.scrollIntoView(pos); + } else { + var oldRange = ourRange; + var range$$1 = rangeForUnit(cm, pos, behavior.unit); + var anchor = oldRange.anchor, head; + if (cmp(range$$1.anchor, anchor) > 0) { + head = range$$1.head; + anchor = minPos(oldRange.from(), range$$1.anchor); + } else { + head = range$$1.anchor; + anchor = maxPos(oldRange.to(), range$$1.head); + } + var ranges$1 = startSel.ranges.slice(0); + ranges$1[ourIndex] = bidiSimplify(cm, new Range(clipPos(doc, anchor), head)); + setSelection(doc, normalizeSelection(cm, ranges$1, ourIndex), sel_mouse); + } + } + + var editorSize = display.wrapper.getBoundingClientRect(); + // Used to ensure timeout re-tries don't fire when another extend + // happened in the meantime (clearTimeout isn't reliable -- at + // least on Chrome, the timeouts still happen even when cleared, + // if the clear happens after their scheduled firing time). + var counter = 0; + + function extend(e) { + var curCount = ++counter; + var cur = posFromMouse(cm, e, true, behavior.unit == "rectangle"); + if (!cur) { return } + if (cmp(cur, lastPos) != 0) { + cm.curOp.focus = activeElt(); + extendTo(cur); + var visible = visibleLines(display, doc); + if (cur.line >= visible.to || cur.line < visible.from) + { setTimeout(operation(cm, function () {if (counter == curCount) { extend(e); }}), 150); } + } else { + var outside = e.clientY < editorSize.top ? -20 : e.clientY > editorSize.bottom ? 20 : 0; + if (outside) { setTimeout(operation(cm, function () { + if (counter != curCount) { return } + display.scroller.scrollTop += outside; + extend(e); + }), 50); } + } + } + + function done(e) { + cm.state.selectingText = false; + counter = Infinity; + // If e is null or undefined we interpret this as someone trying + // to explicitly cancel the selection rather than the user + // letting go of the mouse button. + if (e) { + e_preventDefault(e); + display.input.focus(); + } + off(display.wrapper.ownerDocument, "mousemove", move); + off(display.wrapper.ownerDocument, "mouseup", up); + doc.history.lastSelOrigin = null; + } + + var move = operation(cm, function (e) { + if (e.buttons === 0 || !e_button(e)) { done(e); } + else { extend(e); } + }); + var up = operation(cm, done); + cm.state.selectingText = up; + on(display.wrapper.ownerDocument, "mousemove", move); + on(display.wrapper.ownerDocument, "mouseup", up); + } + + // Used when mouse-selecting to adjust the anchor to the proper side + // of a bidi jump depending on the visual position of the head. + function bidiSimplify(cm, range$$1) { + var anchor = range$$1.anchor; + var head = range$$1.head; + var anchorLine = getLine(cm.doc, anchor.line); + if (cmp(anchor, head) == 0 && anchor.sticky == head.sticky) { return range$$1 } + var order = getOrder(anchorLine); + if (!order) { return range$$1 } + var index = getBidiPartAt(order, anchor.ch, anchor.sticky), part = order[index]; + if (part.from != anchor.ch && part.to != anchor.ch) { return range$$1 } + var boundary = index + ((part.from == anchor.ch) == (part.level != 1) ? 0 : 1); + if (boundary == 0 || boundary == order.length) { return range$$1 } + + // Compute the relative visual position of the head compared to the + // anchor (<0 is to the left, >0 to the right) + var leftSide; + if (head.line != anchor.line) { + leftSide = (head.line - anchor.line) * (cm.doc.direction == "ltr" ? 1 : -1) > 0; + } else { + var headIndex = getBidiPartAt(order, head.ch, head.sticky); + var dir = headIndex - index || (head.ch - anchor.ch) * (part.level == 1 ? -1 : 1); + if (headIndex == boundary - 1 || headIndex == boundary) + { leftSide = dir < 0; } + else + { leftSide = dir > 0; } + } + + var usePart = order[boundary + (leftSide ? -1 : 0)]; + var from = leftSide == (usePart.level == 1); + var ch = from ? usePart.from : usePart.to, sticky = from ? "after" : "before"; + return anchor.ch == ch && anchor.sticky == sticky ? range$$1 : new Range(new Pos(anchor.line, ch, sticky), head) + } + + + // Determines whether an event happened in the gutter, and fires the + // handlers for the corresponding event. + function gutterEvent(cm, e, type, prevent) { + var mX, mY; + if (e.touches) { + mX = e.touches[0].clientX; + mY = e.touches[0].clientY; + } else { + try { mX = e.clientX; mY = e.clientY; } + catch(e) { return false } + } + if (mX >= Math.floor(cm.display.gutters.getBoundingClientRect().right)) { return false } + if (prevent) { e_preventDefault(e); } + + var display = cm.display; + var lineBox = display.lineDiv.getBoundingClientRect(); + + if (mY > lineBox.bottom || !hasHandler(cm, type)) { return e_defaultPrevented(e) } + mY -= lineBox.top - display.viewOffset; + + for (var i = 0; i < cm.display.gutterSpecs.length; ++i) { + var g = display.gutters.childNodes[i]; + if (g && g.getBoundingClientRect().right >= mX) { + var line = lineAtHeight(cm.doc, mY); + var gutter = cm.display.gutterSpecs[i]; + signal(cm, type, cm, line, gutter.className, e); + return e_defaultPrevented(e) + } + } + } + + function clickInGutter(cm, e) { + return gutterEvent(cm, e, "gutterClick", true) + } + + // CONTEXT MENU HANDLING + + // To make the context menu work, we need to briefly unhide the + // textarea (making it as unobtrusive as possible) to let the + // right-click take effect on it. + function onContextMenu(cm, e) { + if (eventInWidget(cm.display, e) || contextMenuInGutter(cm, e)) { return } + if (signalDOMEvent(cm, e, "contextmenu")) { return } + if (!captureRightClick) { cm.display.input.onContextMenu(e); } + } + + function contextMenuInGutter(cm, e) { + if (!hasHandler(cm, "gutterContextMenu")) { return false } + return gutterEvent(cm, e, "gutterContextMenu", false) + } + + function themeChanged(cm) { + cm.display.wrapper.className = cm.display.wrapper.className.replace(/\s*cm-s-\S+/g, "") + + cm.options.theme.replace(/(^|\s)\s*/g, " cm-s-"); + clearCaches(cm); + } + + var Init = {toString: function(){return "CodeMirror.Init"}}; + + var defaults = {}; + var optionHandlers = {}; + + function defineOptions(CodeMirror) { + var optionHandlers = CodeMirror.optionHandlers; + + function option(name, deflt, handle, notOnInit) { + CodeMirror.defaults[name] = deflt; + if (handle) { optionHandlers[name] = + notOnInit ? function (cm, val, old) {if (old != Init) { handle(cm, val, old); }} : handle; } + } + + CodeMirror.defineOption = option; + + // Passed to option handlers when there is no old value. + CodeMirror.Init = Init; + + // These two are, on init, called from the constructor because they + // have to be initialized before the editor can start at all. + option("value", "", function (cm, val) { return cm.setValue(val); }, true); + option("mode", null, function (cm, val) { + cm.doc.modeOption = val; + loadMode(cm); + }, true); + + option("indentUnit", 2, loadMode, true); + option("indentWithTabs", false); + option("smartIndent", true); + option("tabSize", 4, function (cm) { + resetModeState(cm); + clearCaches(cm); + regChange(cm); + }, true); + + option("lineSeparator", null, function (cm, val) { + cm.doc.lineSep = val; + if (!val) { return } + var newBreaks = [], lineNo = cm.doc.first; + cm.doc.iter(function (line) { + for (var pos = 0;;) { + var found = line.text.indexOf(val, pos); + if (found == -1) { break } + pos = found + val.length; + newBreaks.push(Pos(lineNo, found)); + } + lineNo++; + }); + for (var i = newBreaks.length - 1; i >= 0; i--) + { replaceRange(cm.doc, val, newBreaks[i], Pos(newBreaks[i].line, newBreaks[i].ch + val.length)); } + }); + option("specialChars", /[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g, function (cm, val, old) { + cm.state.specialChars = new RegExp(val.source + (val.test("\t") ? "" : "|\t"), "g"); + if (old != Init) { cm.refresh(); } + }); + option("specialCharPlaceholder", defaultSpecialCharPlaceholder, function (cm) { return cm.refresh(); }, true); + option("electricChars", true); + option("inputStyle", mobile ? "contenteditable" : "textarea", function () { + throw new Error("inputStyle can not (yet) be changed in a running editor") // FIXME + }, true); + option("spellcheck", false, function (cm, val) { return cm.getInputField().spellcheck = val; }, true); + option("autocorrect", false, function (cm, val) { return cm.getInputField().autocorrect = val; }, true); + option("autocapitalize", false, function (cm, val) { return cm.getInputField().autocapitalize = val; }, true); + option("rtlMoveVisually", !windows); + option("wholeLineUpdateBefore", true); + + option("theme", "default", function (cm) { + themeChanged(cm); + updateGutters(cm); + }, true); + option("keyMap", "default", function (cm, val, old) { + var next = getKeyMap(val); + var prev = old != Init && getKeyMap(old); + if (prev && prev.detach) { prev.detach(cm, next); } + if (next.attach) { next.attach(cm, prev || null); } + }); + option("extraKeys", null); + option("configureMouse", null); + + option("lineWrapping", false, wrappingChanged, true); + option("gutters", [], function (cm, val) { + cm.display.gutterSpecs = getGutters(val, cm.options.lineNumbers); + updateGutters(cm); + }, true); + option("fixedGutter", true, function (cm, val) { + cm.display.gutters.style.left = val ? compensateForHScroll(cm.display) + "px" : "0"; + cm.refresh(); + }, true); + option("coverGutterNextToScrollbar", false, function (cm) { return updateScrollbars(cm); }, true); + option("scrollbarStyle", "native", function (cm) { + initScrollbars(cm); + updateScrollbars(cm); + cm.display.scrollbars.setScrollTop(cm.doc.scrollTop); + cm.display.scrollbars.setScrollLeft(cm.doc.scrollLeft); + }, true); + option("lineNumbers", false, function (cm, val) { + cm.display.gutterSpecs = getGutters(cm.options.gutters, val); + updateGutters(cm); + }, true); + option("firstLineNumber", 1, updateGutters, true); + option("lineNumberFormatter", function (integer) { return integer; }, updateGutters, true); + option("showCursorWhenSelecting", false, updateSelection, true); + + option("resetSelectionOnContextMenu", true); + option("lineWiseCopyCut", true); + option("pasteLinesPerSelection", true); + option("selectionsMayTouch", false); + + option("readOnly", false, function (cm, val) { + if (val == "nocursor") { + onBlur(cm); + cm.display.input.blur(); + } + cm.display.input.readOnlyChanged(val); + }); + option("disableInput", false, function (cm, val) {if (!val) { cm.display.input.reset(); }}, true); + option("dragDrop", true, dragDropChanged); + option("allowDropFileTypes", null); + + option("cursorBlinkRate", 530); + option("cursorScrollMargin", 0); + option("cursorHeight", 1, updateSelection, true); + option("singleCursorHeightPerLine", true, updateSelection, true); + option("workTime", 100); + option("workDelay", 100); + option("flattenSpans", true, resetModeState, true); + option("addModeClass", false, resetModeState, true); + option("pollInterval", 100); + option("undoDepth", 200, function (cm, val) { return cm.doc.history.undoDepth = val; }); + option("historyEventDelay", 1250); + option("viewportMargin", 10, function (cm) { return cm.refresh(); }, true); + option("maxHighlightLength", 10000, resetModeState, true); + option("moveInputWithCursor", true, function (cm, val) { + if (!val) { cm.display.input.resetPosition(); } + }); + + option("tabindex", null, function (cm, val) { return cm.display.input.getField().tabIndex = val || ""; }); + option("autofocus", null); + option("direction", "ltr", function (cm, val) { return cm.doc.setDirection(val); }, true); + option("phrases", null); + } + + function dragDropChanged(cm, value, old) { + var wasOn = old && old != Init; + if (!value != !wasOn) { + var funcs = cm.display.dragFunctions; + var toggle = value ? on : off; + toggle(cm.display.scroller, "dragstart", funcs.start); + toggle(cm.display.scroller, "dragenter", funcs.enter); + toggle(cm.display.scroller, "dragover", funcs.over); + toggle(cm.display.scroller, "dragleave", funcs.leave); + toggle(cm.display.scroller, "drop", funcs.drop); + } + } + + function wrappingChanged(cm) { + if (cm.options.lineWrapping) { + addClass(cm.display.wrapper, "CodeMirror-wrap"); + cm.display.sizer.style.minWidth = ""; + cm.display.sizerWidth = null; + } else { + rmClass(cm.display.wrapper, "CodeMirror-wrap"); + findMaxLine(cm); + } + estimateLineHeights(cm); + regChange(cm); + clearCaches(cm); + setTimeout(function () { return updateScrollbars(cm); }, 100); + } + + // A CodeMirror instance represents an editor. This is the object + // that user code is usually dealing with. + + function CodeMirror(place, options) { + var this$1 = this; + + if (!(this instanceof CodeMirror)) { return new CodeMirror(place, options) } + + this.options = options = options ? copyObj(options) : {}; + // Determine effective options based on given values and defaults. + copyObj(defaults, options, false); + + var doc = options.value; + if (typeof doc == "string") { doc = new Doc(doc, options.mode, null, options.lineSeparator, options.direction); } + else if (options.mode) { doc.modeOption = options.mode; } + this.doc = doc; + + var input = new CodeMirror.inputStyles[options.inputStyle](this); + var display = this.display = new Display(place, doc, input, options); + display.wrapper.CodeMirror = this; + themeChanged(this); + if (options.lineWrapping) + { this.display.wrapper.className += " CodeMirror-wrap"; } + initScrollbars(this); + + this.state = { + keyMaps: [], // stores maps added by addKeyMap + overlays: [], // highlighting overlays, as added by addOverlay + modeGen: 0, // bumped when mode/overlay changes, used to invalidate highlighting info + overwrite: false, + delayingBlurEvent: false, + focused: false, + suppressEdits: false, // used to disable editing during key handlers when in readOnly mode + pasteIncoming: -1, cutIncoming: -1, // help recognize paste/cut edits in input.poll + selectingText: false, + draggingText: false, + highlight: new Delayed(), // stores highlight worker timeout + keySeq: null, // Unfinished key sequence + specialChars: null + }; + + if (options.autofocus && !mobile) { display.input.focus(); } + + // Override magic textarea content restore that IE sometimes does + // on our hidden textarea on reload + if (ie && ie_version < 11) { setTimeout(function () { return this$1.display.input.reset(true); }, 20); } + + registerEventHandlers(this); + ensureGlobalHandlers(); + + startOperation(this); + this.curOp.forceUpdate = true; + attachDoc(this, doc); + + if ((options.autofocus && !mobile) || this.hasFocus()) + { setTimeout(bind(onFocus, this), 20); } + else + { onBlur(this); } + + for (var opt in optionHandlers) { if (optionHandlers.hasOwnProperty(opt)) + { optionHandlers[opt](this$1, options[opt], Init); } } + maybeUpdateLineNumberWidth(this); + if (options.finishInit) { options.finishInit(this); } + for (var i = 0; i < initHooks.length; ++i) { initHooks[i](this$1); } + endOperation(this); + // Suppress optimizelegibility in Webkit, since it breaks text + // measuring on line wrapping boundaries. + if (webkit && options.lineWrapping && + getComputedStyle(display.lineDiv).textRendering == "optimizelegibility") + { display.lineDiv.style.textRendering = "auto"; } + } + + // The default configuration options. + CodeMirror.defaults = defaults; + // Functions to run when options are changed. + CodeMirror.optionHandlers = optionHandlers; + + // Attach the necessary event handlers when initializing the editor + function registerEventHandlers(cm) { + var d = cm.display; + on(d.scroller, "mousedown", operation(cm, onMouseDown)); + // Older IE's will not fire a second mousedown for a double click + if (ie && ie_version < 11) + { on(d.scroller, "dblclick", operation(cm, function (e) { + if (signalDOMEvent(cm, e)) { return } + var pos = posFromMouse(cm, e); + if (!pos || clickInGutter(cm, e) || eventInWidget(cm.display, e)) { return } + e_preventDefault(e); + var word = cm.findWordAt(pos); + extendSelection(cm.doc, word.anchor, word.head); + })); } + else + { on(d.scroller, "dblclick", function (e) { return signalDOMEvent(cm, e) || e_preventDefault(e); }); } + // Some browsers fire contextmenu *after* opening the menu, at + // which point we can't mess with it anymore. Context menu is + // handled in onMouseDown for these browsers. + on(d.scroller, "contextmenu", function (e) { return onContextMenu(cm, e); }); + + // Used to suppress mouse event handling when a touch happens + var touchFinished, prevTouch = {end: 0}; + function finishTouch() { + if (d.activeTouch) { + touchFinished = setTimeout(function () { return d.activeTouch = null; }, 1000); + prevTouch = d.activeTouch; + prevTouch.end = +new Date; + } + } + function isMouseLikeTouchEvent(e) { + if (e.touches.length != 1) { return false } + var touch = e.touches[0]; + return touch.radiusX <= 1 && touch.radiusY <= 1 + } + function farAway(touch, other) { + if (other.left == null) { return true } + var dx = other.left - touch.left, dy = other.top - touch.top; + return dx * dx + dy * dy > 20 * 20 + } + on(d.scroller, "touchstart", function (e) { + if (!signalDOMEvent(cm, e) && !isMouseLikeTouchEvent(e) && !clickInGutter(cm, e)) { + d.input.ensurePolled(); + clearTimeout(touchFinished); + var now = +new Date; + d.activeTouch = {start: now, moved: false, + prev: now - prevTouch.end <= 300 ? prevTouch : null}; + if (e.touches.length == 1) { + d.activeTouch.left = e.touches[0].pageX; + d.activeTouch.top = e.touches[0].pageY; + } + } + }); + on(d.scroller, "touchmove", function () { + if (d.activeTouch) { d.activeTouch.moved = true; } + }); + on(d.scroller, "touchend", function (e) { + var touch = d.activeTouch; + if (touch && !eventInWidget(d, e) && touch.left != null && + !touch.moved && new Date - touch.start < 300) { + var pos = cm.coordsChar(d.activeTouch, "page"), range; + if (!touch.prev || farAway(touch, touch.prev)) // Single tap + { range = new Range(pos, pos); } + else if (!touch.prev.prev || farAway(touch, touch.prev.prev)) // Double tap + { range = cm.findWordAt(pos); } + else // Triple tap + { range = new Range(Pos(pos.line, 0), clipPos(cm.doc, Pos(pos.line + 1, 0))); } + cm.setSelection(range.anchor, range.head); + cm.focus(); + e_preventDefault(e); + } + finishTouch(); + }); + on(d.scroller, "touchcancel", finishTouch); + + // Sync scrolling between fake scrollbars and real scrollable + // area, ensure viewport is updated when scrolling. + on(d.scroller, "scroll", function () { + if (d.scroller.clientHeight) { + updateScrollTop(cm, d.scroller.scrollTop); + setScrollLeft(cm, d.scroller.scrollLeft, true); + signal(cm, "scroll", cm); + } + }); + + // Listen to wheel events in order to try and update the viewport on time. + on(d.scroller, "mousewheel", function (e) { return onScrollWheel(cm, e); }); + on(d.scroller, "DOMMouseScroll", function (e) { return onScrollWheel(cm, e); }); + + // Prevent wrapper from ever scrolling + on(d.wrapper, "scroll", function () { return d.wrapper.scrollTop = d.wrapper.scrollLeft = 0; }); + + d.dragFunctions = { + enter: function (e) {if (!signalDOMEvent(cm, e)) { e_stop(e); }}, + over: function (e) {if (!signalDOMEvent(cm, e)) { onDragOver(cm, e); e_stop(e); }}, + start: function (e) { return onDragStart(cm, e); }, + drop: operation(cm, onDrop), + leave: function (e) {if (!signalDOMEvent(cm, e)) { clearDragCursor(cm); }} + }; + + var inp = d.input.getField(); + on(inp, "keyup", function (e) { return onKeyUp.call(cm, e); }); + on(inp, "keydown", operation(cm, onKeyDown)); + on(inp, "keypress", operation(cm, onKeyPress)); + on(inp, "focus", function (e) { return onFocus(cm, e); }); + on(inp, "blur", function (e) { return onBlur(cm, e); }); + } + + var initHooks = []; + CodeMirror.defineInitHook = function (f) { return initHooks.push(f); }; + + // Indent the given line. The how parameter can be "smart", + // "add"/null, "subtract", or "prev". When aggressive is false + // (typically set to true for forced single-line indents), empty + // lines are not indented, and places where the mode returns Pass + // are left alone. + function indentLine(cm, n, how, aggressive) { + var doc = cm.doc, state; + if (how == null) { how = "add"; } + if (how == "smart") { + // Fall back to "prev" when the mode doesn't have an indentation + // method. + if (!doc.mode.indent) { how = "prev"; } + else { state = getContextBefore(cm, n).state; } + } + + var tabSize = cm.options.tabSize; + var line = getLine(doc, n), curSpace = countColumn(line.text, null, tabSize); + if (line.stateAfter) { line.stateAfter = null; } + var curSpaceString = line.text.match(/^\s*/)[0], indentation; + if (!aggressive && !/\S/.test(line.text)) { + indentation = 0; + how = "not"; + } else if (how == "smart") { + indentation = doc.mode.indent(state, line.text.slice(curSpaceString.length), line.text); + if (indentation == Pass || indentation > 150) { + if (!aggressive) { return } + how = "prev"; + } + } + if (how == "prev") { + if (n > doc.first) { indentation = countColumn(getLine(doc, n-1).text, null, tabSize); } + else { indentation = 0; } + } else if (how == "add") { + indentation = curSpace + cm.options.indentUnit; + } else if (how == "subtract") { + indentation = curSpace - cm.options.indentUnit; + } else if (typeof how == "number") { + indentation = curSpace + how; + } + indentation = Math.max(0, indentation); + + var indentString = "", pos = 0; + if (cm.options.indentWithTabs) + { for (var i = Math.floor(indentation / tabSize); i; --i) {pos += tabSize; indentString += "\t";} } + if (pos < indentation) { indentString += spaceStr(indentation - pos); } + + if (indentString != curSpaceString) { + replaceRange(doc, indentString, Pos(n, 0), Pos(n, curSpaceString.length), "+input"); + line.stateAfter = null; + return true + } else { + // Ensure that, if the cursor was in the whitespace at the start + // of the line, it is moved to the end of that space. + for (var i$1 = 0; i$1 < doc.sel.ranges.length; i$1++) { + var range = doc.sel.ranges[i$1]; + if (range.head.line == n && range.head.ch < curSpaceString.length) { + var pos$1 = Pos(n, curSpaceString.length); + replaceOneSelection(doc, i$1, new Range(pos$1, pos$1)); + break + } + } + } + } + + // This will be set to a {lineWise: bool, text: [string]} object, so + // that, when pasting, we know what kind of selections the copied + // text was made out of. + var lastCopied = null; + + function setLastCopied(newLastCopied) { + lastCopied = newLastCopied; + } + + function applyTextInput(cm, inserted, deleted, sel, origin) { + var doc = cm.doc; + cm.display.shift = false; + if (!sel) { sel = doc.sel; } + + var recent = +new Date - 200; + var paste = origin == "paste" || cm.state.pasteIncoming > recent; + var textLines = splitLinesAuto(inserted), multiPaste = null; + // When pasting N lines into N selections, insert one line per selection + if (paste && sel.ranges.length > 1) { + if (lastCopied && lastCopied.text.join("\n") == inserted) { + if (sel.ranges.length % lastCopied.text.length == 0) { + multiPaste = []; + for (var i = 0; i < lastCopied.text.length; i++) + { multiPaste.push(doc.splitLines(lastCopied.text[i])); } + } + } else if (textLines.length == sel.ranges.length && cm.options.pasteLinesPerSelection) { + multiPaste = map(textLines, function (l) { return [l]; }); + } + } + + var updateInput = cm.curOp.updateInput; + // Normal behavior is to insert the new text into every selection + for (var i$1 = sel.ranges.length - 1; i$1 >= 0; i$1--) { + var range$$1 = sel.ranges[i$1]; + var from = range$$1.from(), to = range$$1.to(); + if (range$$1.empty()) { + if (deleted && deleted > 0) // Handle deletion + { from = Pos(from.line, from.ch - deleted); } + else if (cm.state.overwrite && !paste) // Handle overwrite + { to = Pos(to.line, Math.min(getLine(doc, to.line).text.length, to.ch + lst(textLines).length)); } + else if (paste && lastCopied && lastCopied.lineWise && lastCopied.text.join("\n") == inserted) + { from = to = Pos(from.line, 0); } + } + var changeEvent = {from: from, to: to, text: multiPaste ? multiPaste[i$1 % multiPaste.length] : textLines, + origin: origin || (paste ? "paste" : cm.state.cutIncoming > recent ? "cut" : "+input")}; + makeChange(cm.doc, changeEvent); + signalLater(cm, "inputRead", cm, changeEvent); + } + if (inserted && !paste) + { triggerElectric(cm, inserted); } + + ensureCursorVisible(cm); + if (cm.curOp.updateInput < 2) { cm.curOp.updateInput = updateInput; } + cm.curOp.typing = true; + cm.state.pasteIncoming = cm.state.cutIncoming = -1; + } + + function handlePaste(e, cm) { + var pasted = e.clipboardData && e.clipboardData.getData("Text"); + if (pasted) { + e.preventDefault(); + if (!cm.isReadOnly() && !cm.options.disableInput) + { runInOp(cm, function () { return applyTextInput(cm, pasted, 0, null, "paste"); }); } + return true + } + } + + function triggerElectric(cm, inserted) { + // When an 'electric' character is inserted, immediately trigger a reindent + if (!cm.options.electricChars || !cm.options.smartIndent) { return } + var sel = cm.doc.sel; + + for (var i = sel.ranges.length - 1; i >= 0; i--) { + var range$$1 = sel.ranges[i]; + if (range$$1.head.ch > 100 || (i && sel.ranges[i - 1].head.line == range$$1.head.line)) { continue } + var mode = cm.getModeAt(range$$1.head); + var indented = false; + if (mode.electricChars) { + for (var j = 0; j < mode.electricChars.length; j++) + { if (inserted.indexOf(mode.electricChars.charAt(j)) > -1) { + indented = indentLine(cm, range$$1.head.line, "smart"); + break + } } + } else if (mode.electricInput) { + if (mode.electricInput.test(getLine(cm.doc, range$$1.head.line).text.slice(0, range$$1.head.ch))) + { indented = indentLine(cm, range$$1.head.line, "smart"); } + } + if (indented) { signalLater(cm, "electricInput", cm, range$$1.head.line); } + } + } + + function copyableRanges(cm) { + var text = [], ranges = []; + for (var i = 0; i < cm.doc.sel.ranges.length; i++) { + var line = cm.doc.sel.ranges[i].head.line; + var lineRange = {anchor: Pos(line, 0), head: Pos(line + 1, 0)}; + ranges.push(lineRange); + text.push(cm.getRange(lineRange.anchor, lineRange.head)); + } + return {text: text, ranges: ranges} + } + + function disableBrowserMagic(field, spellcheck, autocorrect, autocapitalize) { + field.setAttribute("autocorrect", autocorrect ? "" : "off"); + field.setAttribute("autocapitalize", autocapitalize ? "" : "off"); + field.setAttribute("spellcheck", !!spellcheck); + } + + function hiddenTextarea() { + var te = elt("textarea", null, null, "position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"); + var div = elt("div", [te], null, "overflow: hidden; position: relative; width: 3px; height: 0px;"); + // The textarea is kept positioned near the cursor to prevent the + // fact that it'll be scrolled into view on input from scrolling + // our fake cursor out of view. On webkit, when wrap=off, paste is + // very slow. So make the area wide instead. + if (webkit) { te.style.width = "1000px"; } + else { te.setAttribute("wrap", "off"); } + // If border: 0; -- iOS fails to open keyboard (issue #1287) + if (ios) { te.style.border = "1px solid black"; } + disableBrowserMagic(te); + return div + } + + // The publicly visible API. Note that methodOp(f) means + // 'wrap f in an operation, performed on its `this` parameter'. + + // This is not the complete set of editor methods. Most of the + // methods defined on the Doc type are also injected into + // CodeMirror.prototype, for backwards compatibility and + // convenience. + + function addEditorMethods(CodeMirror) { + var optionHandlers = CodeMirror.optionHandlers; + + var helpers = CodeMirror.helpers = {}; + + CodeMirror.prototype = { + constructor: CodeMirror, + focus: function(){window.focus(); this.display.input.focus();}, + + setOption: function(option, value) { + var options = this.options, old = options[option]; + if (options[option] == value && option != "mode") { return } + options[option] = value; + if (optionHandlers.hasOwnProperty(option)) + { operation(this, optionHandlers[option])(this, value, old); } + signal(this, "optionChange", this, option); + }, + + getOption: function(option) {return this.options[option]}, + getDoc: function() {return this.doc}, + + addKeyMap: function(map$$1, bottom) { + this.state.keyMaps[bottom ? "push" : "unshift"](getKeyMap(map$$1)); + }, + removeKeyMap: function(map$$1) { + var maps = this.state.keyMaps; + for (var i = 0; i < maps.length; ++i) + { if (maps[i] == map$$1 || maps[i].name == map$$1) { + maps.splice(i, 1); + return true + } } + }, + + addOverlay: methodOp(function(spec, options) { + var mode = spec.token ? spec : CodeMirror.getMode(this.options, spec); + if (mode.startState) { throw new Error("Overlays may not be stateful.") } + insertSorted(this.state.overlays, + {mode: mode, modeSpec: spec, opaque: options && options.opaque, + priority: (options && options.priority) || 0}, + function (overlay) { return overlay.priority; }); + this.state.modeGen++; + regChange(this); + }), + removeOverlay: methodOp(function(spec) { + var this$1 = this; + + var overlays = this.state.overlays; + for (var i = 0; i < overlays.length; ++i) { + var cur = overlays[i].modeSpec; + if (cur == spec || typeof spec == "string" && cur.name == spec) { + overlays.splice(i, 1); + this$1.state.modeGen++; + regChange(this$1); + return + } + } + }), + + indentLine: methodOp(function(n, dir, aggressive) { + if (typeof dir != "string" && typeof dir != "number") { + if (dir == null) { dir = this.options.smartIndent ? "smart" : "prev"; } + else { dir = dir ? "add" : "subtract"; } + } + if (isLine(this.doc, n)) { indentLine(this, n, dir, aggressive); } + }), + indentSelection: methodOp(function(how) { + var this$1 = this; + + var ranges = this.doc.sel.ranges, end = -1; + for (var i = 0; i < ranges.length; i++) { + var range$$1 = ranges[i]; + if (!range$$1.empty()) { + var from = range$$1.from(), to = range$$1.to(); + var start = Math.max(end, from.line); + end = Math.min(this$1.lastLine(), to.line - (to.ch ? 0 : 1)) + 1; + for (var j = start; j < end; ++j) + { indentLine(this$1, j, how); } + var newRanges = this$1.doc.sel.ranges; + if (from.ch == 0 && ranges.length == newRanges.length && newRanges[i].from().ch > 0) + { replaceOneSelection(this$1.doc, i, new Range(from, newRanges[i].to()), sel_dontScroll); } + } else if (range$$1.head.line > end) { + indentLine(this$1, range$$1.head.line, how, true); + end = range$$1.head.line; + if (i == this$1.doc.sel.primIndex) { ensureCursorVisible(this$1); } + } + } + }), + + // Fetch the parser token for a given character. Useful for hacks + // that want to inspect the mode state (say, for completion). + getTokenAt: function(pos, precise) { + return takeToken(this, pos, precise) + }, + + getLineTokens: function(line, precise) { + return takeToken(this, Pos(line), precise, true) + }, + + getTokenTypeAt: function(pos) { + pos = clipPos(this.doc, pos); + var styles = getLineStyles(this, getLine(this.doc, pos.line)); + var before = 0, after = (styles.length - 1) / 2, ch = pos.ch; + var type; + if (ch == 0) { type = styles[2]; } + else { for (;;) { + var mid = (before + after) >> 1; + if ((mid ? styles[mid * 2 - 1] : 0) >= ch) { after = mid; } + else if (styles[mid * 2 + 1] < ch) { before = mid + 1; } + else { type = styles[mid * 2 + 2]; break } + } } + var cut = type ? type.indexOf("overlay ") : -1; + return cut < 0 ? type : cut == 0 ? null : type.slice(0, cut - 1) + }, + + getModeAt: function(pos) { + var mode = this.doc.mode; + if (!mode.innerMode) { return mode } + return CodeMirror.innerMode(mode, this.getTokenAt(pos).state).mode + }, + + getHelper: function(pos, type) { + return this.getHelpers(pos, type)[0] + }, + + getHelpers: function(pos, type) { + var this$1 = this; + + var found = []; + if (!helpers.hasOwnProperty(type)) { return found } + var help = helpers[type], mode = this.getModeAt(pos); + if (typeof mode[type] == "string") { + if (help[mode[type]]) { found.push(help[mode[type]]); } + } else if (mode[type]) { + for (var i = 0; i < mode[type].length; i++) { + var val = help[mode[type][i]]; + if (val) { found.push(val); } + } + } else if (mode.helperType && help[mode.helperType]) { + found.push(help[mode.helperType]); + } else if (help[mode.name]) { + found.push(help[mode.name]); + } + for (var i$1 = 0; i$1 < help._global.length; i$1++) { + var cur = help._global[i$1]; + if (cur.pred(mode, this$1) && indexOf(found, cur.val) == -1) + { found.push(cur.val); } + } + return found + }, + + getStateAfter: function(line, precise) { + var doc = this.doc; + line = clipLine(doc, line == null ? doc.first + doc.size - 1: line); + return getContextBefore(this, line + 1, precise).state + }, + + cursorCoords: function(start, mode) { + var pos, range$$1 = this.doc.sel.primary(); + if (start == null) { pos = range$$1.head; } + else if (typeof start == "object") { pos = clipPos(this.doc, start); } + else { pos = start ? range$$1.from() : range$$1.to(); } + return cursorCoords(this, pos, mode || "page") + }, + + charCoords: function(pos, mode) { + return charCoords(this, clipPos(this.doc, pos), mode || "page") + }, + + coordsChar: function(coords, mode) { + coords = fromCoordSystem(this, coords, mode || "page"); + return coordsChar(this, coords.left, coords.top) + }, + + lineAtHeight: function(height, mode) { + height = fromCoordSystem(this, {top: height, left: 0}, mode || "page").top; + return lineAtHeight(this.doc, height + this.display.viewOffset) + }, + heightAtLine: function(line, mode, includeWidgets) { + var end = false, lineObj; + if (typeof line == "number") { + var last = this.doc.first + this.doc.size - 1; + if (line < this.doc.first) { line = this.doc.first; } + else if (line > last) { line = last; end = true; } + lineObj = getLine(this.doc, line); + } else { + lineObj = line; + } + return intoCoordSystem(this, lineObj, {top: 0, left: 0}, mode || "page", includeWidgets || end).top + + (end ? this.doc.height - heightAtLine(lineObj) : 0) + }, + + defaultTextHeight: function() { return textHeight(this.display) }, + defaultCharWidth: function() { return charWidth(this.display) }, + + getViewport: function() { return {from: this.display.viewFrom, to: this.display.viewTo}}, + + addWidget: function(pos, node, scroll, vert, horiz) { + var display = this.display; + pos = cursorCoords(this, clipPos(this.doc, pos)); + var top = pos.bottom, left = pos.left; + node.style.position = "absolute"; + node.setAttribute("cm-ignore-events", "true"); + this.display.input.setUneditable(node); + display.sizer.appendChild(node); + if (vert == "over") { + top = pos.top; + } else if (vert == "above" || vert == "near") { + var vspace = Math.max(display.wrapper.clientHeight, this.doc.height), + hspace = Math.max(display.sizer.clientWidth, display.lineSpace.clientWidth); + // Default to positioning above (if specified and possible); otherwise default to positioning below + if ((vert == 'above' || pos.bottom + node.offsetHeight > vspace) && pos.top > node.offsetHeight) + { top = pos.top - node.offsetHeight; } + else if (pos.bottom + node.offsetHeight <= vspace) + { top = pos.bottom; } + if (left + node.offsetWidth > hspace) + { left = hspace - node.offsetWidth; } + } + node.style.top = top + "px"; + node.style.left = node.style.right = ""; + if (horiz == "right") { + left = display.sizer.clientWidth - node.offsetWidth; + node.style.right = "0px"; + } else { + if (horiz == "left") { left = 0; } + else if (horiz == "middle") { left = (display.sizer.clientWidth - node.offsetWidth) / 2; } + node.style.left = left + "px"; + } + if (scroll) + { scrollIntoView(this, {left: left, top: top, right: left + node.offsetWidth, bottom: top + node.offsetHeight}); } + }, + + triggerOnKeyDown: methodOp(onKeyDown), + triggerOnKeyPress: methodOp(onKeyPress), + triggerOnKeyUp: onKeyUp, + triggerOnMouseDown: methodOp(onMouseDown), + + execCommand: function(cmd) { + if (commands.hasOwnProperty(cmd)) + { return commands[cmd].call(null, this) } + }, + + triggerElectric: methodOp(function(text) { triggerElectric(this, text); }), + + findPosH: function(from, amount, unit, visually) { + var this$1 = this; + + var dir = 1; + if (amount < 0) { dir = -1; amount = -amount; } + var cur = clipPos(this.doc, from); + for (var i = 0; i < amount; ++i) { + cur = findPosH(this$1.doc, cur, dir, unit, visually); + if (cur.hitSide) { break } + } + return cur + }, + + moveH: methodOp(function(dir, unit) { + var this$1 = this; + + this.extendSelectionsBy(function (range$$1) { + if (this$1.display.shift || this$1.doc.extend || range$$1.empty()) + { return findPosH(this$1.doc, range$$1.head, dir, unit, this$1.options.rtlMoveVisually) } + else + { return dir < 0 ? range$$1.from() : range$$1.to() } + }, sel_move); + }), + + deleteH: methodOp(function(dir, unit) { + var sel = this.doc.sel, doc = this.doc; + if (sel.somethingSelected()) + { doc.replaceSelection("", null, "+delete"); } + else + { deleteNearSelection(this, function (range$$1) { + var other = findPosH(doc, range$$1.head, dir, unit, false); + return dir < 0 ? {from: other, to: range$$1.head} : {from: range$$1.head, to: other} + }); } + }), + + findPosV: function(from, amount, unit, goalColumn) { + var this$1 = this; + + var dir = 1, x = goalColumn; + if (amount < 0) { dir = -1; amount = -amount; } + var cur = clipPos(this.doc, from); + for (var i = 0; i < amount; ++i) { + var coords = cursorCoords(this$1, cur, "div"); + if (x == null) { x = coords.left; } + else { coords.left = x; } + cur = findPosV(this$1, coords, dir, unit); + if (cur.hitSide) { break } + } + return cur + }, + + moveV: methodOp(function(dir, unit) { + var this$1 = this; + + var doc = this.doc, goals = []; + var collapse = !this.display.shift && !doc.extend && doc.sel.somethingSelected(); + doc.extendSelectionsBy(function (range$$1) { + if (collapse) + { return dir < 0 ? range$$1.from() : range$$1.to() } + var headPos = cursorCoords(this$1, range$$1.head, "div"); + if (range$$1.goalColumn != null) { headPos.left = range$$1.goalColumn; } + goals.push(headPos.left); + var pos = findPosV(this$1, headPos, dir, unit); + if (unit == "page" && range$$1 == doc.sel.primary()) + { addToScrollTop(this$1, charCoords(this$1, pos, "div").top - headPos.top); } + return pos + }, sel_move); + if (goals.length) { for (var i = 0; i < doc.sel.ranges.length; i++) + { doc.sel.ranges[i].goalColumn = goals[i]; } } + }), + + // Find the word at the given position (as returned by coordsChar). + findWordAt: function(pos) { + var doc = this.doc, line = getLine(doc, pos.line).text; + var start = pos.ch, end = pos.ch; + if (line) { + var helper = this.getHelper(pos, "wordChars"); + if ((pos.sticky == "before" || end == line.length) && start) { --start; } else { ++end; } + var startChar = line.charAt(start); + var check = isWordChar(startChar, helper) + ? function (ch) { return isWordChar(ch, helper); } + : /\s/.test(startChar) ? function (ch) { return /\s/.test(ch); } + : function (ch) { return (!/\s/.test(ch) && !isWordChar(ch)); }; + while (start > 0 && check(line.charAt(start - 1))) { --start; } + while (end < line.length && check(line.charAt(end))) { ++end; } + } + return new Range(Pos(pos.line, start), Pos(pos.line, end)) + }, + + toggleOverwrite: function(value) { + if (value != null && value == this.state.overwrite) { return } + if (this.state.overwrite = !this.state.overwrite) + { addClass(this.display.cursorDiv, "CodeMirror-overwrite"); } + else + { rmClass(this.display.cursorDiv, "CodeMirror-overwrite"); } + + signal(this, "overwriteToggle", this, this.state.overwrite); + }, + hasFocus: function() { return this.display.input.getField() == activeElt() }, + isReadOnly: function() { return !!(this.options.readOnly || this.doc.cantEdit) }, + + scrollTo: methodOp(function (x, y) { scrollToCoords(this, x, y); }), + getScrollInfo: function() { + var scroller = this.display.scroller; + return {left: scroller.scrollLeft, top: scroller.scrollTop, + height: scroller.scrollHeight - scrollGap(this) - this.display.barHeight, + width: scroller.scrollWidth - scrollGap(this) - this.display.barWidth, + clientHeight: displayHeight(this), clientWidth: displayWidth(this)} + }, + + scrollIntoView: methodOp(function(range$$1, margin) { + if (range$$1 == null) { + range$$1 = {from: this.doc.sel.primary().head, to: null}; + if (margin == null) { margin = this.options.cursorScrollMargin; } + } else if (typeof range$$1 == "number") { + range$$1 = {from: Pos(range$$1, 0), to: null}; + } else if (range$$1.from == null) { + range$$1 = {from: range$$1, to: null}; + } + if (!range$$1.to) { range$$1.to = range$$1.from; } + range$$1.margin = margin || 0; + + if (range$$1.from.line != null) { + scrollToRange(this, range$$1); + } else { + scrollToCoordsRange(this, range$$1.from, range$$1.to, range$$1.margin); + } + }), + + setSize: methodOp(function(width, height) { + var this$1 = this; + + var interpret = function (val) { return typeof val == "number" || /^\d+$/.test(String(val)) ? val + "px" : val; }; + if (width != null) { this.display.wrapper.style.width = interpret(width); } + if (height != null) { this.display.wrapper.style.height = interpret(height); } + if (this.options.lineWrapping) { clearLineMeasurementCache(this); } + var lineNo$$1 = this.display.viewFrom; + this.doc.iter(lineNo$$1, this.display.viewTo, function (line) { + if (line.widgets) { for (var i = 0; i < line.widgets.length; i++) + { if (line.widgets[i].noHScroll) { regLineChange(this$1, lineNo$$1, "widget"); break } } } + ++lineNo$$1; + }); + this.curOp.forceUpdate = true; + signal(this, "refresh", this); + }), + + operation: function(f){return runInOp(this, f)}, + startOperation: function(){return startOperation(this)}, + endOperation: function(){return endOperation(this)}, + + refresh: methodOp(function() { + var oldHeight = this.display.cachedTextHeight; + regChange(this); + this.curOp.forceUpdate = true; + clearCaches(this); + scrollToCoords(this, this.doc.scrollLeft, this.doc.scrollTop); + updateGutterSpace(this.display); + if (oldHeight == null || Math.abs(oldHeight - textHeight(this.display)) > .5) + { estimateLineHeights(this); } + signal(this, "refresh", this); + }), + + swapDoc: methodOp(function(doc) { + var old = this.doc; + old.cm = null; + // Cancel the current text selection if any (#5821) + if (this.state.selectingText) { this.state.selectingText(); } + attachDoc(this, doc); + clearCaches(this); + this.display.input.reset(); + scrollToCoords(this, doc.scrollLeft, doc.scrollTop); + this.curOp.forceScroll = true; + signalLater(this, "swapDoc", this, old); + return old + }), + + phrase: function(phraseText) { + var phrases = this.options.phrases; + return phrases && Object.prototype.hasOwnProperty.call(phrases, phraseText) ? phrases[phraseText] : phraseText + }, + + getInputField: function(){return this.display.input.getField()}, + getWrapperElement: function(){return this.display.wrapper}, + getScrollerElement: function(){return this.display.scroller}, + getGutterElement: function(){return this.display.gutters} + }; + eventMixin(CodeMirror); + + CodeMirror.registerHelper = function(type, name, value) { + if (!helpers.hasOwnProperty(type)) { helpers[type] = CodeMirror[type] = {_global: []}; } + helpers[type][name] = value; + }; + CodeMirror.registerGlobalHelper = function(type, name, predicate, value) { + CodeMirror.registerHelper(type, name, value); + helpers[type]._global.push({pred: predicate, val: value}); + }; + } + + // Used for horizontal relative motion. Dir is -1 or 1 (left or + // right), unit can be "char", "column" (like char, but doesn't + // cross line boundaries), "word" (across next word), or "group" (to + // the start of next group of word or non-word-non-whitespace + // chars). The visually param controls whether, in right-to-left + // text, direction 1 means to move towards the next index in the + // string, or towards the character to the right of the current + // position. The resulting position will have a hitSide=true + // property if it reached the end of the document. + function findPosH(doc, pos, dir, unit, visually) { + var oldPos = pos; + var origDir = dir; + var lineObj = getLine(doc, pos.line); + function findNextLine() { + var l = pos.line + dir; + if (l < doc.first || l >= doc.first + doc.size) { return false } + pos = new Pos(l, pos.ch, pos.sticky); + return lineObj = getLine(doc, l) + } + function moveOnce(boundToLine) { + var next; + if (visually) { + next = moveVisually(doc.cm, lineObj, pos, dir); + } else { + next = moveLogically(lineObj, pos, dir); + } + if (next == null) { + if (!boundToLine && findNextLine()) + { pos = endOfLine(visually, doc.cm, lineObj, pos.line, dir); } + else + { return false } + } else { + pos = next; + } + return true + } + + if (unit == "char") { + moveOnce(); + } else if (unit == "column") { + moveOnce(true); + } else if (unit == "word" || unit == "group") { + var sawType = null, group = unit == "group"; + var helper = doc.cm && doc.cm.getHelper(pos, "wordChars"); + for (var first = true;; first = false) { + if (dir < 0 && !moveOnce(!first)) { break } + var cur = lineObj.text.charAt(pos.ch) || "\n"; + var type = isWordChar(cur, helper) ? "w" + : group && cur == "\n" ? "n" + : !group || /\s/.test(cur) ? null + : "p"; + if (group && !first && !type) { type = "s"; } + if (sawType && sawType != type) { + if (dir < 0) {dir = 1; moveOnce(); pos.sticky = "after";} + break + } + + if (type) { sawType = type; } + if (dir > 0 && !moveOnce(!first)) { break } + } + } + var result = skipAtomic(doc, pos, oldPos, origDir, true); + if (equalCursorPos(oldPos, result)) { result.hitSide = true; } + return result + } + + // For relative vertical movement. Dir may be -1 or 1. Unit can be + // "page" or "line". The resulting position will have a hitSide=true + // property if it reached the end of the document. + function findPosV(cm, pos, dir, unit) { + var doc = cm.doc, x = pos.left, y; + if (unit == "page") { + var pageSize = Math.min(cm.display.wrapper.clientHeight, window.innerHeight || document.documentElement.clientHeight); + var moveAmount = Math.max(pageSize - .5 * textHeight(cm.display), 3); + y = (dir > 0 ? pos.bottom : pos.top) + dir * moveAmount; + + } else if (unit == "line") { + y = dir > 0 ? pos.bottom + 3 : pos.top - 3; + } + var target; + for (;;) { + target = coordsChar(cm, x, y); + if (!target.outside) { break } + if (dir < 0 ? y <= 0 : y >= doc.height) { target.hitSide = true; break } + y += dir * 5; + } + return target + } + + // CONTENTEDITABLE INPUT STYLE + + var ContentEditableInput = function(cm) { + this.cm = cm; + this.lastAnchorNode = this.lastAnchorOffset = this.lastFocusNode = this.lastFocusOffset = null; + this.polling = new Delayed(); + this.composing = null; + this.gracePeriod = false; + this.readDOMTimeout = null; + }; + + ContentEditableInput.prototype.init = function (display) { + var this$1 = this; + + var input = this, cm = input.cm; + var div = input.div = display.lineDiv; + disableBrowserMagic(div, cm.options.spellcheck, cm.options.autocorrect, cm.options.autocapitalize); + + on(div, "paste", function (e) { + if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return } + // IE doesn't fire input events, so we schedule a read for the pasted content in this way + if (ie_version <= 11) { setTimeout(operation(cm, function () { return this$1.updateFromDOM(); }), 20); } + }); + + on(div, "compositionstart", function (e) { + this$1.composing = {data: e.data, done: false}; + }); + on(div, "compositionupdate", function (e) { + if (!this$1.composing) { this$1.composing = {data: e.data, done: false}; } + }); + on(div, "compositionend", function (e) { + if (this$1.composing) { + if (e.data != this$1.composing.data) { this$1.readFromDOMSoon(); } + this$1.composing.done = true; + } + }); + + on(div, "touchstart", function () { return input.forceCompositionEnd(); }); + + on(div, "input", function () { + if (!this$1.composing) { this$1.readFromDOMSoon(); } + }); + + function onCopyCut(e) { + if (signalDOMEvent(cm, e)) { return } + if (cm.somethingSelected()) { + setLastCopied({lineWise: false, text: cm.getSelections()}); + if (e.type == "cut") { cm.replaceSelection("", null, "cut"); } + } else if (!cm.options.lineWiseCopyCut) { + return + } else { + var ranges = copyableRanges(cm); + setLastCopied({lineWise: true, text: ranges.text}); + if (e.type == "cut") { + cm.operation(function () { + cm.setSelections(ranges.ranges, 0, sel_dontScroll); + cm.replaceSelection("", null, "cut"); + }); + } + } + if (e.clipboardData) { + e.clipboardData.clearData(); + var content = lastCopied.text.join("\n"); + // iOS exposes the clipboard API, but seems to discard content inserted into it + e.clipboardData.setData("Text", content); + if (e.clipboardData.getData("Text") == content) { + e.preventDefault(); + return + } + } + // Old-fashioned briefly-focus-a-textarea hack + var kludge = hiddenTextarea(), te = kludge.firstChild; + cm.display.lineSpace.insertBefore(kludge, cm.display.lineSpace.firstChild); + te.value = lastCopied.text.join("\n"); + var hadFocus = document.activeElement; + selectInput(te); + setTimeout(function () { + cm.display.lineSpace.removeChild(kludge); + hadFocus.focus(); + if (hadFocus == div) { input.showPrimarySelection(); } + }, 50); + } + on(div, "copy", onCopyCut); + on(div, "cut", onCopyCut); + }; + + ContentEditableInput.prototype.prepareSelection = function () { + var result = prepareSelection(this.cm, false); + result.focus = this.cm.state.focused; + return result + }; + + ContentEditableInput.prototype.showSelection = function (info, takeFocus) { + if (!info || !this.cm.display.view.length) { return } + if (info.focus || takeFocus) { this.showPrimarySelection(); } + this.showMultipleSelections(info); + }; + + ContentEditableInput.prototype.getSelection = function () { + return this.cm.display.wrapper.ownerDocument.getSelection() + }; + + ContentEditableInput.prototype.showPrimarySelection = function () { + var sel = this.getSelection(), cm = this.cm, prim = cm.doc.sel.primary(); + var from = prim.from(), to = prim.to(); + + if (cm.display.viewTo == cm.display.viewFrom || from.line >= cm.display.viewTo || to.line < cm.display.viewFrom) { + sel.removeAllRanges(); + return + } + + var curAnchor = domToPos(cm, sel.anchorNode, sel.anchorOffset); + var curFocus = domToPos(cm, sel.focusNode, sel.focusOffset); + if (curAnchor && !curAnchor.bad && curFocus && !curFocus.bad && + cmp(minPos(curAnchor, curFocus), from) == 0 && + cmp(maxPos(curAnchor, curFocus), to) == 0) + { return } + + var view = cm.display.view; + var start = (from.line >= cm.display.viewFrom && posToDOM(cm, from)) || + {node: view[0].measure.map[2], offset: 0}; + var end = to.line < cm.display.viewTo && posToDOM(cm, to); + if (!end) { + var measure = view[view.length - 1].measure; + var map$$1 = measure.maps ? measure.maps[measure.maps.length - 1] : measure.map; + end = {node: map$$1[map$$1.length - 1], offset: map$$1[map$$1.length - 2] - map$$1[map$$1.length - 3]}; + } + + if (!start || !end) { + sel.removeAllRanges(); + return + } + + var old = sel.rangeCount && sel.getRangeAt(0), rng; + try { rng = range(start.node, start.offset, end.offset, end.node); } + catch(e) {} // Our model of the DOM might be outdated, in which case the range we try to set can be impossible + if (rng) { + if (!gecko && cm.state.focused) { + sel.collapse(start.node, start.offset); + if (!rng.collapsed) { + sel.removeAllRanges(); + sel.addRange(rng); + } + } else { + sel.removeAllRanges(); + sel.addRange(rng); + } + if (old && sel.anchorNode == null) { sel.addRange(old); } + else if (gecko) { this.startGracePeriod(); } + } + this.rememberSelection(); + }; + + ContentEditableInput.prototype.startGracePeriod = function () { + var this$1 = this; + + clearTimeout(this.gracePeriod); + this.gracePeriod = setTimeout(function () { + this$1.gracePeriod = false; + if (this$1.selectionChanged()) + { this$1.cm.operation(function () { return this$1.cm.curOp.selectionChanged = true; }); } + }, 20); + }; + + ContentEditableInput.prototype.showMultipleSelections = function (info) { + removeChildrenAndAdd(this.cm.display.cursorDiv, info.cursors); + removeChildrenAndAdd(this.cm.display.selectionDiv, info.selection); + }; + + ContentEditableInput.prototype.rememberSelection = function () { + var sel = this.getSelection(); + this.lastAnchorNode = sel.anchorNode; this.lastAnchorOffset = sel.anchorOffset; + this.lastFocusNode = sel.focusNode; this.lastFocusOffset = sel.focusOffset; + }; + + ContentEditableInput.prototype.selectionInEditor = function () { + var sel = this.getSelection(); + if (!sel.rangeCount) { return false } + var node = sel.getRangeAt(0).commonAncestorContainer; + return contains(this.div, node) + }; + + ContentEditableInput.prototype.focus = function () { + if (this.cm.options.readOnly != "nocursor") { + if (!this.selectionInEditor()) + { this.showSelection(this.prepareSelection(), true); } + this.div.focus(); + } + }; + ContentEditableInput.prototype.blur = function () { this.div.blur(); }; + ContentEditableInput.prototype.getField = function () { return this.div }; + + ContentEditableInput.prototype.supportsTouch = function () { return true }; + + ContentEditableInput.prototype.receivedFocus = function () { + var input = this; + if (this.selectionInEditor()) + { this.pollSelection(); } + else + { runInOp(this.cm, function () { return input.cm.curOp.selectionChanged = true; }); } + + function poll() { + if (input.cm.state.focused) { + input.pollSelection(); + input.polling.set(input.cm.options.pollInterval, poll); + } + } + this.polling.set(this.cm.options.pollInterval, poll); + }; + + ContentEditableInput.prototype.selectionChanged = function () { + var sel = this.getSelection(); + return sel.anchorNode != this.lastAnchorNode || sel.anchorOffset != this.lastAnchorOffset || + sel.focusNode != this.lastFocusNode || sel.focusOffset != this.lastFocusOffset + }; + + ContentEditableInput.prototype.pollSelection = function () { + if (this.readDOMTimeout != null || this.gracePeriod || !this.selectionChanged()) { return } + var sel = this.getSelection(), cm = this.cm; + // On Android Chrome (version 56, at least), backspacing into an + // uneditable block element will put the cursor in that element, + // and then, because it's not editable, hide the virtual keyboard. + // Because Android doesn't allow us to actually detect backspace + // presses in a sane way, this code checks for when that happens + // and simulates a backspace press in this case. + if (android && chrome && this.cm.display.gutterSpecs.length && isInGutter(sel.anchorNode)) { + this.cm.triggerOnKeyDown({type: "keydown", keyCode: 8, preventDefault: Math.abs}); + this.blur(); + this.focus(); + return + } + if (this.composing) { return } + this.rememberSelection(); + var anchor = domToPos(cm, sel.anchorNode, sel.anchorOffset); + var head = domToPos(cm, sel.focusNode, sel.focusOffset); + if (anchor && head) { runInOp(cm, function () { + setSelection(cm.doc, simpleSelection(anchor, head), sel_dontScroll); + if (anchor.bad || head.bad) { cm.curOp.selectionChanged = true; } + }); } + }; + + ContentEditableInput.prototype.pollContent = function () { + if (this.readDOMTimeout != null) { + clearTimeout(this.readDOMTimeout); + this.readDOMTimeout = null; + } + + var cm = this.cm, display = cm.display, sel = cm.doc.sel.primary(); + var from = sel.from(), to = sel.to(); + if (from.ch == 0 && from.line > cm.firstLine()) + { from = Pos(from.line - 1, getLine(cm.doc, from.line - 1).length); } + if (to.ch == getLine(cm.doc, to.line).text.length && to.line < cm.lastLine()) + { to = Pos(to.line + 1, 0); } + if (from.line < display.viewFrom || to.line > display.viewTo - 1) { return false } + + var fromIndex, fromLine, fromNode; + if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) { + fromLine = lineNo(display.view[0].line); + fromNode = display.view[0].node; + } else { + fromLine = lineNo(display.view[fromIndex].line); + fromNode = display.view[fromIndex - 1].node.nextSibling; + } + var toIndex = findViewIndex(cm, to.line); + var toLine, toNode; + if (toIndex == display.view.length - 1) { + toLine = display.viewTo - 1; + toNode = display.lineDiv.lastChild; + } else { + toLine = lineNo(display.view[toIndex + 1].line) - 1; + toNode = display.view[toIndex + 1].node.previousSibling; + } + + if (!fromNode) { return false } + var newText = cm.doc.splitLines(domTextBetween(cm, fromNode, toNode, fromLine, toLine)); + var oldText = getBetween(cm.doc, Pos(fromLine, 0), Pos(toLine, getLine(cm.doc, toLine).text.length)); + while (newText.length > 1 && oldText.length > 1) { + if (lst(newText) == lst(oldText)) { newText.pop(); oldText.pop(); toLine--; } + else if (newText[0] == oldText[0]) { newText.shift(); oldText.shift(); fromLine++; } + else { break } + } + + var cutFront = 0, cutEnd = 0; + var newTop = newText[0], oldTop = oldText[0], maxCutFront = Math.min(newTop.length, oldTop.length); + while (cutFront < maxCutFront && newTop.charCodeAt(cutFront) == oldTop.charCodeAt(cutFront)) + { ++cutFront; } + var newBot = lst(newText), oldBot = lst(oldText); + var maxCutEnd = Math.min(newBot.length - (newText.length == 1 ? cutFront : 0), + oldBot.length - (oldText.length == 1 ? cutFront : 0)); + while (cutEnd < maxCutEnd && + newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) + { ++cutEnd; } + // Try to move start of change to start of selection if ambiguous + if (newText.length == 1 && oldText.length == 1 && fromLine == from.line) { + while (cutFront && cutFront > from.ch && + newBot.charCodeAt(newBot.length - cutEnd - 1) == oldBot.charCodeAt(oldBot.length - cutEnd - 1)) { + cutFront--; + cutEnd++; + } + } + + newText[newText.length - 1] = newBot.slice(0, newBot.length - cutEnd).replace(/^\u200b+/, ""); + newText[0] = newText[0].slice(cutFront).replace(/\u200b+$/, ""); + + var chFrom = Pos(fromLine, cutFront); + var chTo = Pos(toLine, oldText.length ? lst(oldText).length - cutEnd : 0); + if (newText.length > 1 || newText[0] || cmp(chFrom, chTo)) { + replaceRange(cm.doc, newText, chFrom, chTo, "+input"); + return true + } + }; + + ContentEditableInput.prototype.ensurePolled = function () { + this.forceCompositionEnd(); + }; + ContentEditableInput.prototype.reset = function () { + this.forceCompositionEnd(); + }; + ContentEditableInput.prototype.forceCompositionEnd = function () { + if (!this.composing) { return } + clearTimeout(this.readDOMTimeout); + this.composing = null; + this.updateFromDOM(); + this.div.blur(); + this.div.focus(); + }; + ContentEditableInput.prototype.readFromDOMSoon = function () { + var this$1 = this; + + if (this.readDOMTimeout != null) { return } + this.readDOMTimeout = setTimeout(function () { + this$1.readDOMTimeout = null; + if (this$1.composing) { + if (this$1.composing.done) { this$1.composing = null; } + else { return } + } + this$1.updateFromDOM(); + }, 80); + }; + + ContentEditableInput.prototype.updateFromDOM = function () { + var this$1 = this; + + if (this.cm.isReadOnly() || !this.pollContent()) + { runInOp(this.cm, function () { return regChange(this$1.cm); }); } + }; + + ContentEditableInput.prototype.setUneditable = function (node) { + node.contentEditable = "false"; + }; + + ContentEditableInput.prototype.onKeyPress = function (e) { + if (e.charCode == 0 || this.composing) { return } + e.preventDefault(); + if (!this.cm.isReadOnly()) + { operation(this.cm, applyTextInput)(this.cm, String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode), 0); } + }; + + ContentEditableInput.prototype.readOnlyChanged = function (val) { + this.div.contentEditable = String(val != "nocursor"); + }; + + ContentEditableInput.prototype.onContextMenu = function () {}; + ContentEditableInput.prototype.resetPosition = function () {}; + + ContentEditableInput.prototype.needsContentAttribute = true; + + function posToDOM(cm, pos) { + var view = findViewForLine(cm, pos.line); + if (!view || view.hidden) { return null } + var line = getLine(cm.doc, pos.line); + var info = mapFromLineView(view, line, pos.line); + + var order = getOrder(line, cm.doc.direction), side = "left"; + if (order) { + var partPos = getBidiPartAt(order, pos.ch); + side = partPos % 2 ? "right" : "left"; + } + var result = nodeAndOffsetInLineMap(info.map, pos.ch, side); + result.offset = result.collapse == "right" ? result.end : result.start; + return result + } + + function isInGutter(node) { + for (var scan = node; scan; scan = scan.parentNode) + { if (/CodeMirror-gutter-wrapper/.test(scan.className)) { return true } } + return false + } + + function badPos(pos, bad) { if (bad) { pos.bad = true; } return pos } + + function domTextBetween(cm, from, to, fromLine, toLine) { + var text = "", closing = false, lineSep = cm.doc.lineSeparator(), extraLinebreak = false; + function recognizeMarker(id) { return function (marker) { return marker.id == id; } } + function close() { + if (closing) { + text += lineSep; + if (extraLinebreak) { text += lineSep; } + closing = extraLinebreak = false; + } + } + function addText(str) { + if (str) { + close(); + text += str; + } + } + function walk(node) { + if (node.nodeType == 1) { + var cmText = node.getAttribute("cm-text"); + if (cmText) { + addText(cmText); + return + } + var markerID = node.getAttribute("cm-marker"), range$$1; + if (markerID) { + var found = cm.findMarks(Pos(fromLine, 0), Pos(toLine + 1, 0), recognizeMarker(+markerID)); + if (found.length && (range$$1 = found[0].find(0))) + { addText(getBetween(cm.doc, range$$1.from, range$$1.to).join(lineSep)); } + return + } + if (node.getAttribute("contenteditable") == "false") { return } + var isBlock = /^(pre|div|p|li|table|br)$/i.test(node.nodeName); + if (!/^br$/i.test(node.nodeName) && node.textContent.length == 0) { return } + + if (isBlock) { close(); } + for (var i = 0; i < node.childNodes.length; i++) + { walk(node.childNodes[i]); } + + if (/^(pre|p)$/i.test(node.nodeName)) { extraLinebreak = true; } + if (isBlock) { closing = true; } + } else if (node.nodeType == 3) { + addText(node.nodeValue.replace(/\u200b/g, "").replace(/\u00a0/g, " ")); + } + } + for (;;) { + walk(from); + if (from == to) { break } + from = from.nextSibling; + extraLinebreak = false; + } + return text + } + + function domToPos(cm, node, offset) { + var lineNode; + if (node == cm.display.lineDiv) { + lineNode = cm.display.lineDiv.childNodes[offset]; + if (!lineNode) { return badPos(cm.clipPos(Pos(cm.display.viewTo - 1)), true) } + node = null; offset = 0; + } else { + for (lineNode = node;; lineNode = lineNode.parentNode) { + if (!lineNode || lineNode == cm.display.lineDiv) { return null } + if (lineNode.parentNode && lineNode.parentNode == cm.display.lineDiv) { break } + } + } + for (var i = 0; i < cm.display.view.length; i++) { + var lineView = cm.display.view[i]; + if (lineView.node == lineNode) + { return locateNodeInLineView(lineView, node, offset) } + } + } + + function locateNodeInLineView(lineView, node, offset) { + var wrapper = lineView.text.firstChild, bad = false; + if (!node || !contains(wrapper, node)) { return badPos(Pos(lineNo(lineView.line), 0), true) } + if (node == wrapper) { + bad = true; + node = wrapper.childNodes[offset]; + offset = 0; + if (!node) { + var line = lineView.rest ? lst(lineView.rest) : lineView.line; + return badPos(Pos(lineNo(line), line.text.length), bad) + } + } + + var textNode = node.nodeType == 3 ? node : null, topNode = node; + if (!textNode && node.childNodes.length == 1 && node.firstChild.nodeType == 3) { + textNode = node.firstChild; + if (offset) { offset = textNode.nodeValue.length; } + } + while (topNode.parentNode != wrapper) { topNode = topNode.parentNode; } + var measure = lineView.measure, maps = measure.maps; + + function find(textNode, topNode, offset) { + for (var i = -1; i < (maps ? maps.length : 0); i++) { + var map$$1 = i < 0 ? measure.map : maps[i]; + for (var j = 0; j < map$$1.length; j += 3) { + var curNode = map$$1[j + 2]; + if (curNode == textNode || curNode == topNode) { + var line = lineNo(i < 0 ? lineView.line : lineView.rest[i]); + var ch = map$$1[j] + offset; + if (offset < 0 || curNode != textNode) { ch = map$$1[j + (offset ? 1 : 0)]; } + return Pos(line, ch) + } + } + } + } + var found = find(textNode, topNode, offset); + if (found) { return badPos(found, bad) } + + // FIXME this is all really shaky. might handle the few cases it needs to handle, but likely to cause problems + for (var after = topNode.nextSibling, dist = textNode ? textNode.nodeValue.length - offset : 0; after; after = after.nextSibling) { + found = find(after, after.firstChild, 0); + if (found) + { return badPos(Pos(found.line, found.ch - dist), bad) } + else + { dist += after.textContent.length; } + } + for (var before = topNode.previousSibling, dist$1 = offset; before; before = before.previousSibling) { + found = find(before, before.firstChild, -1); + if (found) + { return badPos(Pos(found.line, found.ch + dist$1), bad) } + else + { dist$1 += before.textContent.length; } + } + } + + // TEXTAREA INPUT STYLE + + var TextareaInput = function(cm) { + this.cm = cm; + // See input.poll and input.reset + this.prevInput = ""; + + // Flag that indicates whether we expect input to appear real soon + // now (after some event like 'keypress' or 'input') and are + // polling intensively. + this.pollingFast = false; + // Self-resetting timeout for the poller + this.polling = new Delayed(); + // Used to work around IE issue with selection being forgotten when focus moves away from textarea + this.hasSelection = false; + this.composing = null; + }; + + TextareaInput.prototype.init = function (display) { + var this$1 = this; + + var input = this, cm = this.cm; + this.createField(display); + var te = this.textarea; + + display.wrapper.insertBefore(this.wrapper, display.wrapper.firstChild); + + // Needed to hide big blue blinking cursor on Mobile Safari (doesn't seem to work in iOS 8 anymore) + if (ios) { te.style.width = "0px"; } + + on(te, "input", function () { + if (ie && ie_version >= 9 && this$1.hasSelection) { this$1.hasSelection = null; } + input.poll(); + }); + + on(te, "paste", function (e) { + if (signalDOMEvent(cm, e) || handlePaste(e, cm)) { return } + + cm.state.pasteIncoming = +new Date; + input.fastPoll(); + }); + + function prepareCopyCut(e) { + if (signalDOMEvent(cm, e)) { return } + if (cm.somethingSelected()) { + setLastCopied({lineWise: false, text: cm.getSelections()}); + } else if (!cm.options.lineWiseCopyCut) { + return + } else { + var ranges = copyableRanges(cm); + setLastCopied({lineWise: true, text: ranges.text}); + if (e.type == "cut") { + cm.setSelections(ranges.ranges, null, sel_dontScroll); + } else { + input.prevInput = ""; + te.value = ranges.text.join("\n"); + selectInput(te); + } + } + if (e.type == "cut") { cm.state.cutIncoming = +new Date; } + } + on(te, "cut", prepareCopyCut); + on(te, "copy", prepareCopyCut); + + on(display.scroller, "paste", function (e) { + if (eventInWidget(display, e) || signalDOMEvent(cm, e)) { return } + if (!te.dispatchEvent) { + cm.state.pasteIncoming = +new Date; + input.focus(); + return + } + + // Pass the `paste` event to the textarea so it's handled by its event listener. + var event = new Event("paste"); + event.clipboardData = e.clipboardData; + te.dispatchEvent(event); + }); + + // Prevent normal selection in the editor (we handle our own) + on(display.lineSpace, "selectstart", function (e) { + if (!eventInWidget(display, e)) { e_preventDefault(e); } + }); + + on(te, "compositionstart", function () { + var start = cm.getCursor("from"); + if (input.composing) { input.composing.range.clear(); } + input.composing = { + start: start, + range: cm.markText(start, cm.getCursor("to"), {className: "CodeMirror-composing"}) + }; + }); + on(te, "compositionend", function () { + if (input.composing) { + input.poll(); + input.composing.range.clear(); + input.composing = null; + } + }); + }; + + TextareaInput.prototype.createField = function (_display) { + // Wraps and hides input textarea + this.wrapper = hiddenTextarea(); + // The semihidden textarea that is focused when the editor is + // focused, and receives input. + this.textarea = this.wrapper.firstChild; + }; + + TextareaInput.prototype.prepareSelection = function () { + // Redraw the selection and/or cursor + var cm = this.cm, display = cm.display, doc = cm.doc; + var result = prepareSelection(cm); + + // Move the hidden textarea near the cursor to prevent scrolling artifacts + if (cm.options.moveInputWithCursor) { + var headPos = cursorCoords(cm, doc.sel.primary().head, "div"); + var wrapOff = display.wrapper.getBoundingClientRect(), lineOff = display.lineDiv.getBoundingClientRect(); + result.teTop = Math.max(0, Math.min(display.wrapper.clientHeight - 10, + headPos.top + lineOff.top - wrapOff.top)); + result.teLeft = Math.max(0, Math.min(display.wrapper.clientWidth - 10, + headPos.left + lineOff.left - wrapOff.left)); + } + + return result + }; + + TextareaInput.prototype.showSelection = function (drawn) { + var cm = this.cm, display = cm.display; + removeChildrenAndAdd(display.cursorDiv, drawn.cursors); + removeChildrenAndAdd(display.selectionDiv, drawn.selection); + if (drawn.teTop != null) { + this.wrapper.style.top = drawn.teTop + "px"; + this.wrapper.style.left = drawn.teLeft + "px"; + } + }; + + // Reset the input to correspond to the selection (or to be empty, + // when not typing and nothing is selected) + TextareaInput.prototype.reset = function (typing) { + if (this.contextMenuPending || this.composing) { return } + var cm = this.cm; + if (cm.somethingSelected()) { + this.prevInput = ""; + var content = cm.getSelection(); + this.textarea.value = content; + if (cm.state.focused) { selectInput(this.textarea); } + if (ie && ie_version >= 9) { this.hasSelection = content; } + } else if (!typing) { + this.prevInput = this.textarea.value = ""; + if (ie && ie_version >= 9) { this.hasSelection = null; } + } + }; + + TextareaInput.prototype.getField = function () { return this.textarea }; + + TextareaInput.prototype.supportsTouch = function () { return false }; + + TextareaInput.prototype.focus = function () { + if (this.cm.options.readOnly != "nocursor" && (!mobile || activeElt() != this.textarea)) { + try { this.textarea.focus(); } + catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM + } + }; + + TextareaInput.prototype.blur = function () { this.textarea.blur(); }; + + TextareaInput.prototype.resetPosition = function () { + this.wrapper.style.top = this.wrapper.style.left = 0; + }; + + TextareaInput.prototype.receivedFocus = function () { this.slowPoll(); }; + + // Poll for input changes, using the normal rate of polling. This + // runs as long as the editor is focused. + TextareaInput.prototype.slowPoll = function () { + var this$1 = this; + + if (this.pollingFast) { return } + this.polling.set(this.cm.options.pollInterval, function () { + this$1.poll(); + if (this$1.cm.state.focused) { this$1.slowPoll(); } + }); + }; + + // When an event has just come in that is likely to add or change + // something in the input textarea, we poll faster, to ensure that + // the change appears on the screen quickly. + TextareaInput.prototype.fastPoll = function () { + var missed = false, input = this; + input.pollingFast = true; + function p() { + var changed = input.poll(); + if (!changed && !missed) {missed = true; input.polling.set(60, p);} + else {input.pollingFast = false; input.slowPoll();} + } + input.polling.set(20, p); + }; + + // Read input from the textarea, and update the document to match. + // When something is selected, it is present in the textarea, and + // selected (unless it is huge, in which case a placeholder is + // used). When nothing is selected, the cursor sits after previously + // seen text (can be empty), which is stored in prevInput (we must + // not reset the textarea when typing, because that breaks IME). + TextareaInput.prototype.poll = function () { + var this$1 = this; + + var cm = this.cm, input = this.textarea, prevInput = this.prevInput; + // Since this is called a *lot*, try to bail out as cheaply as + // possible when it is clear that nothing happened. hasSelection + // will be the case when there is a lot of text in the textarea, + // in which case reading its value would be expensive. + if (this.contextMenuPending || !cm.state.focused || + (hasSelection(input) && !prevInput && !this.composing) || + cm.isReadOnly() || cm.options.disableInput || cm.state.keySeq) + { return false } + + var text = input.value; + // If nothing changed, bail. + if (text == prevInput && !cm.somethingSelected()) { return false } + // Work around nonsensical selection resetting in IE9/10, and + // inexplicable appearance of private area unicode characters on + // some key combos in Mac (#2689). + if (ie && ie_version >= 9 && this.hasSelection === text || + mac && /[\uf700-\uf7ff]/.test(text)) { + cm.display.input.reset(); + return false + } + + if (cm.doc.sel == cm.display.selForContextMenu) { + var first = text.charCodeAt(0); + if (first == 0x200b && !prevInput) { prevInput = "\u200b"; } + if (first == 0x21da) { this.reset(); return this.cm.execCommand("undo") } + } + // Find the part of the input that is actually new + var same = 0, l = Math.min(prevInput.length, text.length); + while (same < l && prevInput.charCodeAt(same) == text.charCodeAt(same)) { ++same; } + + runInOp(cm, function () { + applyTextInput(cm, text.slice(same), prevInput.length - same, + null, this$1.composing ? "*compose" : null); + + // Don't leave long text in the textarea, since it makes further polling slow + if (text.length > 1000 || text.indexOf("\n") > -1) { input.value = this$1.prevInput = ""; } + else { this$1.prevInput = text; } + + if (this$1.composing) { + this$1.composing.range.clear(); + this$1.composing.range = cm.markText(this$1.composing.start, cm.getCursor("to"), + {className: "CodeMirror-composing"}); + } + }); + return true + }; + + TextareaInput.prototype.ensurePolled = function () { + if (this.pollingFast && this.poll()) { this.pollingFast = false; } + }; + + TextareaInput.prototype.onKeyPress = function () { + if (ie && ie_version >= 9) { this.hasSelection = null; } + this.fastPoll(); + }; + + TextareaInput.prototype.onContextMenu = function (e) { + var input = this, cm = input.cm, display = cm.display, te = input.textarea; + if (input.contextMenuPending) { input.contextMenuPending(); } + var pos = posFromMouse(cm, e), scrollPos = display.scroller.scrollTop; + if (!pos || presto) { return } // Opera is difficult. + + // Reset the current text selection only if the click is done outside of the selection + // and 'resetSelectionOnContextMenu' option is true. + var reset = cm.options.resetSelectionOnContextMenu; + if (reset && cm.doc.sel.contains(pos) == -1) + { operation(cm, setSelection)(cm.doc, simpleSelection(pos), sel_dontScroll); } + + var oldCSS = te.style.cssText, oldWrapperCSS = input.wrapper.style.cssText; + var wrapperBox = input.wrapper.offsetParent.getBoundingClientRect(); + input.wrapper.style.cssText = "position: static"; + te.style.cssText = "position: absolute; width: 30px; height: 30px;\n top: " + (e.clientY - wrapperBox.top - 5) + "px; left: " + (e.clientX - wrapperBox.left - 5) + "px;\n z-index: 1000; background: " + (ie ? "rgba(255, 255, 255, .05)" : "transparent") + ";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);"; + var oldScrollY; + if (webkit) { oldScrollY = window.scrollY; } // Work around Chrome issue (#2712) + display.input.focus(); + if (webkit) { window.scrollTo(null, oldScrollY); } + display.input.reset(); + // Adds "Select all" to context menu in FF + if (!cm.somethingSelected()) { te.value = input.prevInput = " "; } + input.contextMenuPending = rehide; + display.selForContextMenu = cm.doc.sel; + clearTimeout(display.detectingSelectAll); + + // Select-all will be greyed out if there's nothing to select, so + // this adds a zero-width space so that we can later check whether + // it got selected. + function prepareSelectAllHack() { + if (te.selectionStart != null) { + var selected = cm.somethingSelected(); + var extval = "\u200b" + (selected ? te.value : ""); + te.value = "\u21da"; // Used to catch context-menu undo + te.value = extval; + input.prevInput = selected ? "" : "\u200b"; + te.selectionStart = 1; te.selectionEnd = extval.length; + // Re-set this, in case some other handler touched the + // selection in the meantime. + display.selForContextMenu = cm.doc.sel; + } + } + function rehide() { + if (input.contextMenuPending != rehide) { return } + input.contextMenuPending = false; + input.wrapper.style.cssText = oldWrapperCSS; + te.style.cssText = oldCSS; + if (ie && ie_version < 9) { display.scrollbars.setScrollTop(display.scroller.scrollTop = scrollPos); } + + // Try to detect the user choosing select-all + if (te.selectionStart != null) { + if (!ie || (ie && ie_version < 9)) { prepareSelectAllHack(); } + var i = 0, poll = function () { + if (display.selForContextMenu == cm.doc.sel && te.selectionStart == 0 && + te.selectionEnd > 0 && input.prevInput == "\u200b") { + operation(cm, selectAll)(cm); + } else if (i++ < 10) { + display.detectingSelectAll = setTimeout(poll, 500); + } else { + display.selForContextMenu = null; + display.input.reset(); + } + }; + display.detectingSelectAll = setTimeout(poll, 200); + } + } + + if (ie && ie_version >= 9) { prepareSelectAllHack(); } + if (captureRightClick) { + e_stop(e); + var mouseup = function () { + off(window, "mouseup", mouseup); + setTimeout(rehide, 20); + }; + on(window, "mouseup", mouseup); + } else { + setTimeout(rehide, 50); + } + }; + + TextareaInput.prototype.readOnlyChanged = function (val) { + if (!val) { this.reset(); } + this.textarea.disabled = val == "nocursor"; + }; + + TextareaInput.prototype.setUneditable = function () {}; + + TextareaInput.prototype.needsContentAttribute = false; + + function fromTextArea(textarea, options) { + options = options ? copyObj(options) : {}; + options.value = textarea.value; + if (!options.tabindex && textarea.tabIndex) + { options.tabindex = textarea.tabIndex; } + if (!options.placeholder && textarea.placeholder) + { options.placeholder = textarea.placeholder; } + // Set autofocus to true if this textarea is focused, or if it has + // autofocus and no other element is focused. + if (options.autofocus == null) { + var hasFocus = activeElt(); + options.autofocus = hasFocus == textarea || + textarea.getAttribute("autofocus") != null && hasFocus == document.body; + } + + function save() {textarea.value = cm.getValue();} + + var realSubmit; + if (textarea.form) { + on(textarea.form, "submit", save); + // Deplorable hack to make the submit method do the right thing. + if (!options.leaveSubmitMethodAlone) { + var form = textarea.form; + realSubmit = form.submit; + try { + var wrappedSubmit = form.submit = function () { + save(); + form.submit = realSubmit; + form.submit(); + form.submit = wrappedSubmit; + }; + } catch(e) {} + } + } + + options.finishInit = function (cm) { + cm.save = save; + cm.getTextArea = function () { return textarea; }; + cm.toTextArea = function () { + cm.toTextArea = isNaN; // Prevent this from being ran twice + save(); + textarea.parentNode.removeChild(cm.getWrapperElement()); + textarea.style.display = ""; + if (textarea.form) { + off(textarea.form, "submit", save); + if (typeof textarea.form.submit == "function") + { textarea.form.submit = realSubmit; } + } + }; + }; + + textarea.style.display = "none"; + var cm = CodeMirror(function (node) { return textarea.parentNode.insertBefore(node, textarea.nextSibling); }, + options); + return cm + } + + function addLegacyProps(CodeMirror) { + CodeMirror.off = off; + CodeMirror.on = on; + CodeMirror.wheelEventPixels = wheelEventPixels; + CodeMirror.Doc = Doc; + CodeMirror.splitLines = splitLinesAuto; + CodeMirror.countColumn = countColumn; + CodeMirror.findColumn = findColumn; + CodeMirror.isWordChar = isWordCharBasic; + CodeMirror.Pass = Pass; + CodeMirror.signal = signal; + CodeMirror.Line = Line; + CodeMirror.changeEnd = changeEnd; + CodeMirror.scrollbarModel = scrollbarModel; + CodeMirror.Pos = Pos; + CodeMirror.cmpPos = cmp; + CodeMirror.modes = modes; + CodeMirror.mimeModes = mimeModes; + CodeMirror.resolveMode = resolveMode; + CodeMirror.getMode = getMode; + CodeMirror.modeExtensions = modeExtensions; + CodeMirror.extendMode = extendMode; + CodeMirror.copyState = copyState; + CodeMirror.startState = startState; + CodeMirror.innerMode = innerMode; + CodeMirror.commands = commands; + CodeMirror.keyMap = keyMap; + CodeMirror.keyName = keyName; + CodeMirror.isModifierKey = isModifierKey; + CodeMirror.lookupKey = lookupKey; + CodeMirror.normalizeKeyMap = normalizeKeyMap; + CodeMirror.StringStream = StringStream; + CodeMirror.SharedTextMarker = SharedTextMarker; + CodeMirror.TextMarker = TextMarker; + CodeMirror.LineWidget = LineWidget; + CodeMirror.e_preventDefault = e_preventDefault; + CodeMirror.e_stopPropagation = e_stopPropagation; + CodeMirror.e_stop = e_stop; + CodeMirror.addClass = addClass; + CodeMirror.contains = contains; + CodeMirror.rmClass = rmClass; + CodeMirror.keyNames = keyNames; + } + + // EDITOR CONSTRUCTOR + + defineOptions(CodeMirror); + + addEditorMethods(CodeMirror); + + // Set up methods on CodeMirror's prototype to redirect to the editor's document. + var dontDelegate = "iter insert remove copy getEditor constructor".split(" "); + for (var prop in Doc.prototype) { if (Doc.prototype.hasOwnProperty(prop) && indexOf(dontDelegate, prop) < 0) + { CodeMirror.prototype[prop] = (function(method) { + return function() {return method.apply(this.doc, arguments)} + })(Doc.prototype[prop]); } } + + eventMixin(Doc); + CodeMirror.inputStyles = {"textarea": TextareaInput, "contenteditable": ContentEditableInput}; + + // Extra arguments are stored as the mode's dependencies, which is + // used by (legacy) mechanisms like loadmode.js to automatically + // load a mode. (Preferred mechanism is the require/define calls.) + CodeMirror.defineMode = function(name/*, mode, …*/) { + if (!CodeMirror.defaults.mode && name != "null") { CodeMirror.defaults.mode = name; } + defineMode.apply(this, arguments); + }; + + CodeMirror.defineMIME = defineMIME; + + // Minimal default mode. + CodeMirror.defineMode("null", function () { return ({token: function (stream) { return stream.skipToEnd(); }}); }); + CodeMirror.defineMIME("text/plain", "null"); + + // EXTENSIONS + + CodeMirror.defineExtension = function (name, func) { + CodeMirror.prototype[name] = func; + }; + CodeMirror.defineDocExtension = function (name, func) { + Doc.prototype[name] = func; + }; + + CodeMirror.fromTextArea = fromTextArea; + + addLegacyProps(CodeMirror); + + CodeMirror.version = "5.48.4"; + + return CodeMirror; + +}))); diff --git a/public/vendor/codemirror/javascript.js b/public/vendor/codemirror/javascript.js new file mode 100644 index 000000000..8055f1ba2 --- /dev/null +++ b/public/vendor/codemirror/javascript.js @@ -0,0 +1,927 @@ +// CodeMirror, copyright (c) by Marijn Haverbeke and others +// Distributed under an MIT license: https://codemirror.net/LICENSE + +(function(mod) { + if (typeof exports == "object" && typeof module == "object") // CommonJS + mod(require("../../lib/codemirror")); + else if (typeof define == "function" && define.amd) // AMD + define(["../../lib/codemirror"], mod); + else // Plain browser env + mod(CodeMirror); +})(function(CodeMirror) { +"use strict"; + +CodeMirror.defineMode("javascript", function(config, parserConfig) { + var indentUnit = config.indentUnit; + var statementIndent = parserConfig.statementIndent; + var jsonldMode = parserConfig.jsonld; + var jsonMode = parserConfig.json || jsonldMode; + var isTS = parserConfig.typescript; + var wordRE = parserConfig.wordCharacters || /[\w$\xa1-\uffff]/; + + // Tokenizer + + var keywords = function(){ + function kw(type) {return {type: type, style: "keyword"};} + var A = kw("keyword a"), B = kw("keyword b"), C = kw("keyword c"), D = kw("keyword d"); + var operator = kw("operator"), atom = {type: "atom", style: "atom"}; + + return { + "if": kw("if"), "while": A, "with": A, "else": B, "do": B, "try": B, "finally": B, + "return": D, "break": D, "continue": D, "new": kw("new"), "delete": C, "void": C, "throw": C, + "debugger": kw("debugger"), "var": kw("var"), "const": kw("var"), "let": kw("var"), + "function": kw("function"), "catch": kw("catch"), + "for": kw("for"), "switch": kw("switch"), "case": kw("case"), "default": kw("default"), + "in": operator, "typeof": operator, "instanceof": operator, + "true": atom, "false": atom, "null": atom, "undefined": atom, "NaN": atom, "Infinity": atom, + "this": kw("this"), "class": kw("class"), "super": kw("atom"), + "yield": C, "export": kw("export"), "import": kw("import"), "extends": C, + "await": C + }; + }(); + + var isOperatorChar = /[+\-*&%=<>!?|~^@]/; + var isJsonldKeyword = /^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/; + + function readRegexp(stream) { + var escaped = false, next, inSet = false; + while ((next = stream.next()) != null) { + if (!escaped) { + if (next == "/" && !inSet) return; + if (next == "[") inSet = true; + else if (inSet && next == "]") inSet = false; + } + escaped = !escaped && next == "\\"; + } + } + + // Used as scratch variables to communicate multiple values without + // consing up tons of objects. + var type, content; + function ret(tp, style, cont) { + type = tp; content = cont; + return style; + } + function tokenBase(stream, state) { + var ch = stream.next(); + if (ch == '"' || ch == "'") { + state.tokenize = tokenString(ch); + return state.tokenize(stream, state); + } else if (ch == "." && stream.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/)) { + return ret("number", "number"); + } else if (ch == "." && stream.match("..")) { + return ret("spread", "meta"); + } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) { + return ret(ch); + } else if (ch == "=" && stream.eat(">")) { + return ret("=>", "operator"); + } else if (ch == "0" && stream.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)) { + return ret("number", "number"); + } else if (/\d/.test(ch)) { + stream.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/); + return ret("number", "number"); + } else if (ch == "/") { + if (stream.eat("*")) { + state.tokenize = tokenComment; + return tokenComment(stream, state); + } else if (stream.eat("/")) { + stream.skipToEnd(); + return ret("comment", "comment"); + } else if (expressionAllowed(stream, state, 1)) { + readRegexp(stream); + stream.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/); + return ret("regexp", "string-2"); + } else { + stream.eat("="); + return ret("operator", "operator", stream.current()); + } + } else if (ch == "`") { + state.tokenize = tokenQuasi; + return tokenQuasi(stream, state); + } else if (ch == "#") { + stream.skipToEnd(); + return ret("error", "error"); + } else if (isOperatorChar.test(ch)) { + if (ch != ">" || !state.lexical || state.lexical.type != ">") { + if (stream.eat("=")) { + if (ch == "!" || ch == "=") stream.eat("=") + } else if (/[<>*+\-]/.test(ch)) { + stream.eat(ch) + if (ch == ">") stream.eat(ch) + } + } + return ret("operator", "operator", stream.current()); + } else if (wordRE.test(ch)) { + stream.eatWhile(wordRE); + var word = stream.current() + if (state.lastType != ".") { + if (keywords.propertyIsEnumerable(word)) { + var kw = keywords[word] + return ret(kw.type, kw.style, word) + } + if (word == "async" && stream.match(/^(\s|\/\*.*?\*\/)*[\[\(\w]/, false)) + return ret("async", "keyword", word) + } + return ret("variable", "variable", word) + } + } + + function tokenString(quote) { + return function(stream, state) { + var escaped = false, next; + if (jsonldMode && stream.peek() == "@" && stream.match(isJsonldKeyword)){ + state.tokenize = tokenBase; + return ret("jsonld-keyword", "meta"); + } + while ((next = stream.next()) != null) { + if (next == quote && !escaped) break; + escaped = !escaped && next == "\\"; + } + if (!escaped) state.tokenize = tokenBase; + return ret("string", "string"); + }; + } + + function tokenComment(stream, state) { + var maybeEnd = false, ch; + while (ch = stream.next()) { + if (ch == "/" && maybeEnd) { + state.tokenize = tokenBase; + break; + } + maybeEnd = (ch == "*"); + } + return ret("comment", "comment"); + } + + function tokenQuasi(stream, state) { + var escaped = false, next; + while ((next = stream.next()) != null) { + if (!escaped && (next == "`" || next == "$" && stream.eat("{"))) { + state.tokenize = tokenBase; + break; + } + escaped = !escaped && next == "\\"; + } + return ret("quasi", "string-2", stream.current()); + } + + var brackets = "([{}])"; + // This is a crude lookahead trick to try and notice that we're + // parsing the argument patterns for a fat-arrow function before we + // actually hit the arrow token. It only works if the arrow is on + // the same line as the arguments and there's no strange noise + // (comments) in between. Fallback is to only notice when we hit the + // arrow, and not declare the arguments as locals for the arrow + // body. + function findFatArrow(stream, state) { + if (state.fatArrowAt) state.fatArrowAt = null; + var arrow = stream.string.indexOf("=>", stream.start); + if (arrow < 0) return; + + if (isTS) { // Try to skip TypeScript return type declarations after the arguments + var m = /:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(stream.string.slice(stream.start, arrow)) + if (m) arrow = m.index + } + + var depth = 0, sawSomething = false; + for (var pos = arrow - 1; pos >= 0; --pos) { + var ch = stream.string.charAt(pos); + var bracket = brackets.indexOf(ch); + if (bracket >= 0 && bracket < 3) { + if (!depth) { ++pos; break; } + if (--depth == 0) { if (ch == "(") sawSomething = true; break; } + } else if (bracket >= 3 && bracket < 6) { + ++depth; + } else if (wordRE.test(ch)) { + sawSomething = true; + } else if (/["'\/`]/.test(ch)) { + for (;; --pos) { + if (pos == 0) return + var next = stream.string.charAt(pos - 1) + if (next == ch && stream.string.charAt(pos - 2) != "\\") { pos--; break } + } + } else if (sawSomething && !depth) { + ++pos; + break; + } + } + if (sawSomething && !depth) state.fatArrowAt = pos; + } + + // Parser + + var atomicTypes = {"atom": true, "number": true, "variable": true, "string": true, "regexp": true, "this": true, "jsonld-keyword": true}; + + function JSLexical(indented, column, type, align, prev, info) { + this.indented = indented; + this.column = column; + this.type = type; + this.prev = prev; + this.info = info; + if (align != null) this.align = align; + } + + function inScope(state, varname) { + for (var v = state.localVars; v; v = v.next) + if (v.name == varname) return true; + for (var cx = state.context; cx; cx = cx.prev) { + for (var v = cx.vars; v; v = v.next) + if (v.name == varname) return true; + } + } + + function parseJS(state, style, type, content, stream) { + var cc = state.cc; + // Communicate our context to the combinators. + // (Less wasteful than consing up a hundred closures on every call.) + cx.state = state; cx.stream = stream; cx.marked = null, cx.cc = cc; cx.style = style; + + if (!state.lexical.hasOwnProperty("align")) + state.lexical.align = true; + + while(true) { + var combinator = cc.length ? cc.pop() : jsonMode ? expression : statement; + if (combinator(type, content)) { + while(cc.length && cc[cc.length - 1].lex) + cc.pop()(); + if (cx.marked) return cx.marked; + if (type == "variable" && inScope(state, content)) return "variable-2"; + return style; + } + } + } + + // Combinator utils + + var cx = {state: null, column: null, marked: null, cc: null}; + function pass() { + for (var i = arguments.length - 1; i >= 0; i--) cx.cc.push(arguments[i]); + } + function cont() { + pass.apply(null, arguments); + return true; + } + function inList(name, list) { + for (var v = list; v; v = v.next) if (v.name == name) return true + return false; + } + function register(varname) { + var state = cx.state; + cx.marked = "def"; + if (state.context) { + if (state.lexical.info == "var" && state.context && state.context.block) { + // FIXME function decls are also not block scoped + var newContext = registerVarScoped(varname, state.context) + if (newContext != null) { + state.context = newContext + return + } + } else if (!inList(varname, state.localVars)) { + state.localVars = new Var(varname, state.localVars) + return + } + } + // Fall through means this is global + if (parserConfig.globalVars && !inList(varname, state.globalVars)) + state.globalVars = new Var(varname, state.globalVars) + } + function registerVarScoped(varname, context) { + if (!context) { + return null + } else if (context.block) { + var inner = registerVarScoped(varname, context.prev) + if (!inner) return null + if (inner == context.prev) return context + return new Context(inner, context.vars, true) + } else if (inList(varname, context.vars)) { + return context + } else { + return new Context(context.prev, new Var(varname, context.vars), false) + } + } + + function isModifier(name) { + return name == "public" || name == "private" || name == "protected" || name == "abstract" || name == "readonly" + } + + // Combinators + + function Context(prev, vars, block) { this.prev = prev; this.vars = vars; this.block = block } + function Var(name, next) { this.name = name; this.next = next } + + var defaultVars = new Var("this", new Var("arguments", null)) + function pushcontext() { + cx.state.context = new Context(cx.state.context, cx.state.localVars, false) + cx.state.localVars = defaultVars + } + function pushblockcontext() { + cx.state.context = new Context(cx.state.context, cx.state.localVars, true) + cx.state.localVars = null + } + function popcontext() { + cx.state.localVars = cx.state.context.vars + cx.state.context = cx.state.context.prev + } + popcontext.lex = true + function pushlex(type, info) { + var result = function() { + var state = cx.state, indent = state.indented; + if (state.lexical.type == "stat") indent = state.lexical.indented; + else for (var outer = state.lexical; outer && outer.type == ")" && outer.align; outer = outer.prev) + indent = outer.indented; + state.lexical = new JSLexical(indent, cx.stream.column(), type, null, state.lexical, info); + }; + result.lex = true; + return result; + } + function poplex() { + var state = cx.state; + if (state.lexical.prev) { + if (state.lexical.type == ")") + state.indented = state.lexical.indented; + state.lexical = state.lexical.prev; + } + } + poplex.lex = true; + + function expect(wanted) { + function exp(type) { + if (type == wanted) return cont(); + else if (wanted == ";" || type == "}" || type == ")" || type == "]") return pass(); + else return cont(exp); + }; + return exp; + } + + function statement(type, value) { + if (type == "var") return cont(pushlex("vardef", value), vardef, expect(";"), poplex); + if (type == "keyword a") return cont(pushlex("form"), parenExpr, statement, poplex); + if (type == "keyword b") return cont(pushlex("form"), statement, poplex); + if (type == "keyword d") return cx.stream.match(/^\s*$/, false) ? cont() : cont(pushlex("stat"), maybeexpression, expect(";"), poplex); + if (type == "debugger") return cont(expect(";")); + if (type == "{") return cont(pushlex("}"), pushblockcontext, block, poplex, popcontext); + if (type == ";") return cont(); + if (type == "if") { + if (cx.state.lexical.info == "else" && cx.state.cc[cx.state.cc.length - 1] == poplex) + cx.state.cc.pop()(); + return cont(pushlex("form"), parenExpr, statement, poplex, maybeelse); + } + if (type == "function") return cont(functiondef); + if (type == "for") return cont(pushlex("form"), forspec, statement, poplex); + if (type == "class" || (isTS && value == "interface")) { + cx.marked = "keyword" + return cont(pushlex("form", type == "class" ? type : value), className, poplex) + } + if (type == "variable") { + if (isTS && value == "declare") { + cx.marked = "keyword" + return cont(statement) + } else if (isTS && (value == "module" || value == "enum" || value == "type") && cx.stream.match(/^\s*\w/, false)) { + cx.marked = "keyword" + if (value == "enum") return cont(enumdef); + else if (value == "type") return cont(typename, expect("operator"), typeexpr, expect(";")); + else return cont(pushlex("form"), pattern, expect("{"), pushlex("}"), block, poplex, poplex) + } else if (isTS && value == "namespace") { + cx.marked = "keyword" + return cont(pushlex("form"), expression, statement, poplex) + } else if (isTS && value == "abstract") { + cx.marked = "keyword" + return cont(statement) + } else { + return cont(pushlex("stat"), maybelabel); + } + } + if (type == "switch") return cont(pushlex("form"), parenExpr, expect("{"), pushlex("}", "switch"), pushblockcontext, + block, poplex, poplex, popcontext); + if (type == "case") return cont(expression, expect(":")); + if (type == "default") return cont(expect(":")); + if (type == "catch") return cont(pushlex("form"), pushcontext, maybeCatchBinding, statement, poplex, popcontext); + if (type == "export") return cont(pushlex("stat"), afterExport, poplex); + if (type == "import") return cont(pushlex("stat"), afterImport, poplex); + if (type == "async") return cont(statement) + if (value == "@") return cont(expression, statement) + return pass(pushlex("stat"), expression, expect(";"), poplex); + } + function maybeCatchBinding(type) { + if (type == "(") return cont(funarg, expect(")")) + } + function expression(type, value) { + return expressionInner(type, value, false); + } + function expressionNoComma(type, value) { + return expressionInner(type, value, true); + } + function parenExpr(type) { + if (type != "(") return pass() + return cont(pushlex(")"), expression, expect(")"), poplex) + } + function expressionInner(type, value, noComma) { + if (cx.state.fatArrowAt == cx.stream.start) { + var body = noComma ? arrowBodyNoComma : arrowBody; + if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, expect("=>"), body, popcontext); + else if (type == "variable") return pass(pushcontext, pattern, expect("=>"), body, popcontext); + } + + var maybeop = noComma ? maybeoperatorNoComma : maybeoperatorComma; + if (atomicTypes.hasOwnProperty(type)) return cont(maybeop); + if (type == "function") return cont(functiondef, maybeop); + if (type == "class" || (isTS && value == "interface")) { cx.marked = "keyword"; return cont(pushlex("form"), classExpression, poplex); } + if (type == "keyword c" || type == "async") return cont(noComma ? expressionNoComma : expression); + if (type == "(") return cont(pushlex(")"), maybeexpression, expect(")"), poplex, maybeop); + if (type == "operator" || type == "spread") return cont(noComma ? expressionNoComma : expression); + if (type == "[") return cont(pushlex("]"), arrayLiteral, poplex, maybeop); + if (type == "{") return contCommasep(objprop, "}", null, maybeop); + if (type == "quasi") return pass(quasi, maybeop); + if (type == "new") return cont(maybeTarget(noComma)); + if (type == "import") return cont(expression); + return cont(); + } + function maybeexpression(type) { + if (type.match(/[;\}\)\],]/)) return pass(); + return pass(expression); + } + + function maybeoperatorComma(type, value) { + if (type == ",") return cont(expression); + return maybeoperatorNoComma(type, value, false); + } + function maybeoperatorNoComma(type, value, noComma) { + var me = noComma == false ? maybeoperatorComma : maybeoperatorNoComma; + var expr = noComma == false ? expression : expressionNoComma; + if (type == "=>") return cont(pushcontext, noComma ? arrowBodyNoComma : arrowBody, popcontext); + if (type == "operator") { + if (/\+\+|--/.test(value) || isTS && value == "!") return cont(me); + if (isTS && value == "<" && cx.stream.match(/^([^>]|<.*?>)*>\s*\(/, false)) + return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, me); + if (value == "?") return cont(expression, expect(":"), expr); + return cont(expr); + } + if (type == "quasi") { return pass(quasi, me); } + if (type == ";") return; + if (type == "(") return contCommasep(expressionNoComma, ")", "call", me); + if (type == ".") return cont(property, me); + if (type == "[") return cont(pushlex("]"), maybeexpression, expect("]"), poplex, me); + if (isTS && value == "as") { cx.marked = "keyword"; return cont(typeexpr, me) } + if (type == "regexp") { + cx.state.lastType = cx.marked = "operator" + cx.stream.backUp(cx.stream.pos - cx.stream.start - 1) + return cont(expr) + } + } + function quasi(type, value) { + if (type != "quasi") return pass(); + if (value.slice(value.length - 2) != "${") return cont(quasi); + return cont(expression, continueQuasi); + } + function continueQuasi(type) { + if (type == "}") { + cx.marked = "string-2"; + cx.state.tokenize = tokenQuasi; + return cont(quasi); + } + } + function arrowBody(type) { + findFatArrow(cx.stream, cx.state); + return pass(type == "{" ? statement : expression); + } + function arrowBodyNoComma(type) { + findFatArrow(cx.stream, cx.state); + return pass(type == "{" ? statement : expressionNoComma); + } + function maybeTarget(noComma) { + return function(type) { + if (type == ".") return cont(noComma ? targetNoComma : target); + else if (type == "variable" && isTS) return cont(maybeTypeArgs, noComma ? maybeoperatorNoComma : maybeoperatorComma) + else return pass(noComma ? expressionNoComma : expression); + }; + } + function target(_, value) { + if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorComma); } + } + function targetNoComma(_, value) { + if (value == "target") { cx.marked = "keyword"; return cont(maybeoperatorNoComma); } + } + function maybelabel(type) { + if (type == ":") return cont(poplex, statement); + return pass(maybeoperatorComma, expect(";"), poplex); + } + function property(type) { + if (type == "variable") {cx.marked = "property"; return cont();} + } + function objprop(type, value) { + if (type == "async") { + cx.marked = "property"; + return cont(objprop); + } else if (type == "variable" || cx.style == "keyword") { + cx.marked = "property"; + if (value == "get" || value == "set") return cont(getterSetter); + var m // Work around fat-arrow-detection complication for detecting typescript typed arrow params + if (isTS && cx.state.fatArrowAt == cx.stream.start && (m = cx.stream.match(/^\s*:\s*/, false))) + cx.state.fatArrowAt = cx.stream.pos + m[0].length + return cont(afterprop); + } else if (type == "number" || type == "string") { + cx.marked = jsonldMode ? "property" : (cx.style + " property"); + return cont(afterprop); + } else if (type == "jsonld-keyword") { + return cont(afterprop); + } else if (isTS && isModifier(value)) { + cx.marked = "keyword" + return cont(objprop) + } else if (type == "[") { + return cont(expression, maybetype, expect("]"), afterprop); + } else if (type == "spread") { + return cont(expressionNoComma, afterprop); + } else if (value == "*") { + cx.marked = "keyword"; + return cont(objprop); + } else if (type == ":") { + return pass(afterprop) + } + } + function getterSetter(type) { + if (type != "variable") return pass(afterprop); + cx.marked = "property"; + return cont(functiondef); + } + function afterprop(type) { + if (type == ":") return cont(expressionNoComma); + if (type == "(") return pass(functiondef); + } + function commasep(what, end, sep) { + function proceed(type, value) { + if (sep ? sep.indexOf(type) > -1 : type == ",") { + var lex = cx.state.lexical; + if (lex.info == "call") lex.pos = (lex.pos || 0) + 1; + return cont(function(type, value) { + if (type == end || value == end) return pass() + return pass(what) + }, proceed); + } + if (type == end || value == end) return cont(); + if (sep && sep.indexOf(";") > -1) return pass(what) + return cont(expect(end)); + } + return function(type, value) { + if (type == end || value == end) return cont(); + return pass(what, proceed); + }; + } + function contCommasep(what, end, info) { + for (var i = 3; i < arguments.length; i++) + cx.cc.push(arguments[i]); + return cont(pushlex(end, info), commasep(what, end), poplex); + } + function block(type) { + if (type == "}") return cont(); + return pass(statement, block); + } + function maybetype(type, value) { + if (isTS) { + if (type == ":") return cont(typeexpr); + if (value == "?") return cont(maybetype); + } + } + function maybetypeOrIn(type, value) { + if (isTS && (type == ":" || value == "in")) return cont(typeexpr) + } + function mayberettype(type) { + if (isTS && type == ":") { + if (cx.stream.match(/^\s*\w+\s+is\b/, false)) return cont(expression, isKW, typeexpr) + else return cont(typeexpr) + } + } + function isKW(_, value) { + if (value == "is") { + cx.marked = "keyword" + return cont() + } + } + function typeexpr(type, value) { + if (value == "keyof" || value == "typeof" || value == "infer") { + cx.marked = "keyword" + return cont(value == "typeof" ? expressionNoComma : typeexpr) + } + if (type == "variable" || value == "void") { + cx.marked = "type" + return cont(afterType) + } + if (value == "|" || value == "&") return cont(typeexpr) + if (type == "string" || type == "number" || type == "atom") return cont(afterType); + if (type == "[") return cont(pushlex("]"), commasep(typeexpr, "]", ","), poplex, afterType) + if (type == "{") return cont(pushlex("}"), commasep(typeprop, "}", ",;"), poplex, afterType) + if (type == "(") return cont(commasep(typearg, ")"), maybeReturnType, afterType) + if (type == "<") return cont(commasep(typeexpr, ">"), typeexpr) + } + function maybeReturnType(type) { + if (type == "=>") return cont(typeexpr) + } + function typeprop(type, value) { + if (type == "variable" || cx.style == "keyword") { + cx.marked = "property" + return cont(typeprop) + } else if (value == "?" || type == "number" || type == "string") { + return cont(typeprop) + } else if (type == ":") { + return cont(typeexpr) + } else if (type == "[") { + return cont(expect("variable"), maybetypeOrIn, expect("]"), typeprop) + } else if (type == "(") { + return pass(functiondecl, typeprop) + } + } + function typearg(type, value) { + if (type == "variable" && cx.stream.match(/^\s*[?:]/, false) || value == "?") return cont(typearg) + if (type == ":") return cont(typeexpr) + if (type == "spread") return cont(typearg) + return pass(typeexpr) + } + function afterType(type, value) { + if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType) + if (value == "|" || type == "." || value == "&") return cont(typeexpr) + if (type == "[") return cont(typeexpr, expect("]"), afterType) + if (value == "extends" || value == "implements") { cx.marked = "keyword"; return cont(typeexpr) } + if (value == "?") return cont(typeexpr, expect(":"), typeexpr) + } + function maybeTypeArgs(_, value) { + if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType) + } + function typeparam() { + return pass(typeexpr, maybeTypeDefault) + } + function maybeTypeDefault(_, value) { + if (value == "=") return cont(typeexpr) + } + function vardef(_, value) { + if (value == "enum") {cx.marked = "keyword"; return cont(enumdef)} + return pass(pattern, maybetype, maybeAssign, vardefCont); + } + function pattern(type, value) { + if (isTS && isModifier(value)) { cx.marked = "keyword"; return cont(pattern) } + if (type == "variable") { register(value); return cont(); } + if (type == "spread") return cont(pattern); + if (type == "[") return contCommasep(eltpattern, "]"); + if (type == "{") return contCommasep(proppattern, "}"); + } + function proppattern(type, value) { + if (type == "variable" && !cx.stream.match(/^\s*:/, false)) { + register(value); + return cont(maybeAssign); + } + if (type == "variable") cx.marked = "property"; + if (type == "spread") return cont(pattern); + if (type == "}") return pass(); + if (type == "[") return cont(expression, expect(']'), expect(':'), proppattern); + return cont(expect(":"), pattern, maybeAssign); + } + function eltpattern() { + return pass(pattern, maybeAssign) + } + function maybeAssign(_type, value) { + if (value == "=") return cont(expressionNoComma); + } + function vardefCont(type) { + if (type == ",") return cont(vardef); + } + function maybeelse(type, value) { + if (type == "keyword b" && value == "else") return cont(pushlex("form", "else"), statement, poplex); + } + function forspec(type, value) { + if (value == "await") return cont(forspec); + if (type == "(") return cont(pushlex(")"), forspec1, poplex); + } + function forspec1(type) { + if (type == "var") return cont(vardef, forspec2); + if (type == "variable") return cont(forspec2); + return pass(forspec2) + } + function forspec2(type, value) { + if (type == ")") return cont() + if (type == ";") return cont(forspec2) + if (value == "in" || value == "of") { cx.marked = "keyword"; return cont(expression, forspec2) } + return pass(expression, forspec2) + } + function functiondef(type, value) { + if (value == "*") {cx.marked = "keyword"; return cont(functiondef);} + if (type == "variable") {register(value); return cont(functiondef);} + if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, statement, popcontext); + if (isTS && value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondef) + } + function functiondecl(type, value) { + if (value == "*") {cx.marked = "keyword"; return cont(functiondecl);} + if (type == "variable") {register(value); return cont(functiondecl);} + if (type == "(") return cont(pushcontext, pushlex(")"), commasep(funarg, ")"), poplex, mayberettype, popcontext); + if (isTS && value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, functiondecl) + } + function typename(type, value) { + if (type == "keyword" || type == "variable") { + cx.marked = "type" + return cont(typename) + } else if (value == "<") { + return cont(pushlex(">"), commasep(typeparam, ">"), poplex) + } + } + function funarg(type, value) { + if (value == "@") cont(expression, funarg) + if (type == "spread") return cont(funarg); + if (isTS && isModifier(value)) { cx.marked = "keyword"; return cont(funarg); } + if (isTS && type == "this") return cont(maybetype, maybeAssign) + return pass(pattern, maybetype, maybeAssign); + } + function classExpression(type, value) { + // Class expressions may have an optional name. + if (type == "variable") return className(type, value); + return classNameAfter(type, value); + } + function className(type, value) { + if (type == "variable") {register(value); return cont(classNameAfter);} + } + function classNameAfter(type, value) { + if (value == "<") return cont(pushlex(">"), commasep(typeparam, ">"), poplex, classNameAfter) + if (value == "extends" || value == "implements" || (isTS && type == ",")) { + if (value == "implements") cx.marked = "keyword"; + return cont(isTS ? typeexpr : expression, classNameAfter); + } + if (type == "{") return cont(pushlex("}"), classBody, poplex); + } + function classBody(type, value) { + if (type == "async" || + (type == "variable" && + (value == "static" || value == "get" || value == "set" || (isTS && isModifier(value))) && + cx.stream.match(/^\s+[\w$\xa1-\uffff]/, false))) { + cx.marked = "keyword"; + return cont(classBody); + } + if (type == "variable" || cx.style == "keyword") { + cx.marked = "property"; + return cont(isTS ? classfield : functiondef, classBody); + } + if (type == "number" || type == "string") return cont(isTS ? classfield : functiondef, classBody); + if (type == "[") + return cont(expression, maybetype, expect("]"), isTS ? classfield : functiondef, classBody) + if (value == "*") { + cx.marked = "keyword"; + return cont(classBody); + } + if (isTS && type == "(") return pass(functiondecl, classBody) + if (type == ";" || type == ",") return cont(classBody); + if (type == "}") return cont(); + if (value == "@") return cont(expression, classBody) + } + function classfield(type, value) { + if (value == "?") return cont(classfield) + if (type == ":") return cont(typeexpr, maybeAssign) + if (value == "=") return cont(expressionNoComma) + var context = cx.state.lexical.prev, isInterface = context && context.info == "interface" + return pass(isInterface ? functiondecl : functiondef) + } + function afterExport(type, value) { + if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); } + if (value == "default") { cx.marked = "keyword"; return cont(expression, expect(";")); } + if (type == "{") return cont(commasep(exportField, "}"), maybeFrom, expect(";")); + return pass(statement); + } + function exportField(type, value) { + if (value == "as") { cx.marked = "keyword"; return cont(expect("variable")); } + if (type == "variable") return pass(expressionNoComma, exportField); + } + function afterImport(type) { + if (type == "string") return cont(); + if (type == "(") return pass(expression); + return pass(importSpec, maybeMoreImports, maybeFrom); + } + function importSpec(type, value) { + if (type == "{") return contCommasep(importSpec, "}"); + if (type == "variable") register(value); + if (value == "*") cx.marked = "keyword"; + return cont(maybeAs); + } + function maybeMoreImports(type) { + if (type == ",") return cont(importSpec, maybeMoreImports) + } + function maybeAs(_type, value) { + if (value == "as") { cx.marked = "keyword"; return cont(importSpec); } + } + function maybeFrom(_type, value) { + if (value == "from") { cx.marked = "keyword"; return cont(expression); } + } + function arrayLiteral(type) { + if (type == "]") return cont(); + return pass(commasep(expressionNoComma, "]")); + } + function enumdef() { + return pass(pushlex("form"), pattern, expect("{"), pushlex("}"), commasep(enummember, "}"), poplex, poplex) + } + function enummember() { + return pass(pattern, maybeAssign); + } + + function isContinuedStatement(state, textAfter) { + return state.lastType == "operator" || state.lastType == "," || + isOperatorChar.test(textAfter.charAt(0)) || + /[,.]/.test(textAfter.charAt(0)); + } + + function expressionAllowed(stream, state, backUp) { + return state.tokenize == tokenBase && + /^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(state.lastType) || + (state.lastType == "quasi" && /\{\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0)))) + } + + // Interface + + return { + startState: function(basecolumn) { + var state = { + tokenize: tokenBase, + lastType: "sof", + cc: [], + lexical: new JSLexical((basecolumn || 0) - indentUnit, 0, "block", false), + localVars: parserConfig.localVars, + context: parserConfig.localVars && new Context(null, null, false), + indented: basecolumn || 0 + }; + if (parserConfig.globalVars && typeof parserConfig.globalVars == "object") + state.globalVars = parserConfig.globalVars; + return state; + }, + + token: function(stream, state) { + if (stream.sol()) { + if (!state.lexical.hasOwnProperty("align")) + state.lexical.align = false; + state.indented = stream.indentation(); + findFatArrow(stream, state); + } + if (state.tokenize != tokenComment && stream.eatSpace()) return null; + var style = state.tokenize(stream, state); + if (type == "comment") return style; + state.lastType = type == "operator" && (content == "++" || content == "--") ? "incdec" : type; + return parseJS(state, style, type, content, stream); + }, + + indent: function(state, textAfter) { + if (state.tokenize == tokenComment) return CodeMirror.Pass; + if (state.tokenize != tokenBase) return 0; + var firstChar = textAfter && textAfter.charAt(0), lexical = state.lexical, top + // Kludge to prevent 'maybelse' from blocking lexical scope pops + if (!/^\s*else\b/.test(textAfter)) for (var i = state.cc.length - 1; i >= 0; --i) { + var c = state.cc[i]; + if (c == poplex) lexical = lexical.prev; + else if (c != maybeelse) break; + } + while ((lexical.type == "stat" || lexical.type == "form") && + (firstChar == "}" || ((top = state.cc[state.cc.length - 1]) && + (top == maybeoperatorComma || top == maybeoperatorNoComma) && + !/^[,\.=+\-*:?[\(]/.test(textAfter)))) + lexical = lexical.prev; + if (statementIndent && lexical.type == ")" && lexical.prev.type == "stat") + lexical = lexical.prev; + var type = lexical.type, closing = firstChar == type; + + if (type == "vardef") return lexical.indented + (state.lastType == "operator" || state.lastType == "," ? lexical.info.length + 1 : 0); + else if (type == "form" && firstChar == "{") return lexical.indented; + else if (type == "form") return lexical.indented + indentUnit; + else if (type == "stat") + return lexical.indented + (isContinuedStatement(state, textAfter) ? statementIndent || indentUnit : 0); + else if (lexical.info == "switch" && !closing && parserConfig.doubleIndentSwitch != false) + return lexical.indented + (/^(?:case|default)\b/.test(textAfter) ? indentUnit : 2 * indentUnit); + else if (lexical.align) return lexical.column + (closing ? 0 : 1); + else return lexical.indented + (closing ? 0 : indentUnit); + }, + + electricInput: /^\s*(?:case .*?:|default:|\{|\})$/, + blockCommentStart: jsonMode ? null : "/*", + blockCommentEnd: jsonMode ? null : "*/", + blockCommentContinue: jsonMode ? null : " * ", + lineComment: jsonMode ? null : "//", + fold: "brace", + closeBrackets: "()[]{}''\"\"``", + + helperType: jsonMode ? "json" : "javascript", + jsonldMode: jsonldMode, + jsonMode: jsonMode, + + expressionAllowed: expressionAllowed, + + skipExpression: function(state) { + var top = state.cc[state.cc.length - 1] + if (top == expression || top == expressionNoComma) state.cc.pop() + } + }; +}); + +CodeMirror.registerHelper("wordChars", "javascript", /[\w$]/); + +CodeMirror.defineMIME("text/javascript", "javascript"); +CodeMirror.defineMIME("text/ecmascript", "javascript"); +CodeMirror.defineMIME("application/javascript", "javascript"); +CodeMirror.defineMIME("application/x-javascript", "javascript"); +CodeMirror.defineMIME("application/ecmascript", "javascript"); +CodeMirror.defineMIME("application/json", {name: "javascript", json: true}); +CodeMirror.defineMIME("application/x-json", {name: "javascript", json: true}); +CodeMirror.defineMIME("application/ld+json", {name: "javascript", jsonld: true}); +CodeMirror.defineMIME("text/typescript", { name: "javascript", typescript: true }); +CodeMirror.defineMIME("application/typescript", { name: "javascript", typescript: true }); + +}); diff --git a/public/vendor/countdowntime/countdowntime.js b/public/vendor/countdowntime/countdowntime.js new file mode 100755 index 000000000..573832d97 --- /dev/null +++ b/public/vendor/countdowntime/countdowntime.js @@ -0,0 +1,45 @@ +(function ($) { + "use strict"; + + function getTimeRemaining(endtime) { + var t = Date.parse(endtime) - Date.parse(new Date()); + var seconds = Math.floor((t / 1000) % 60); + var minutes = Math.floor((t / 1000 / 60) % 60); + var hours = Math.floor((t / (1000 * 60 * 60)) % 24); + var days = Math.floor(t / (1000 * 60 * 60 * 24)); + return { + 'total': t, + 'days': days, + 'hours': hours, + 'minutes': minutes, + 'seconds': seconds + }; + } + + function initializeClock(id, endtime) { + var daysSpan = $('.days'); + var hoursSpan = $('.hours'); + var minutesSpan = $('.minutes'); + var secondsSpan = $('.seconds'); + + function updateClock() { + var t = getTimeRemaining(endtime); + + daysSpan.html(t.days); + hoursSpan.html(('0' + t.hours).slice(-2)); + minutesSpan.html(('0' + t.minutes).slice(-2)); + secondsSpan.html(('0' + t.seconds).slice(-2)) + + if (t.total <= 0) { + clearInterval(timeinterval); + } + } + + updateClock(); + var timeinterval = setInterval(updateClock, 1000); + } + + var deadline = new Date(Date.parse(new Date()) + 25 * 24 * 60 * 60 * 1000 + 13 * 60 * 60 * 1000); + initializeClock('clockdiv', deadline); + +})(jQuery); \ No newline at end of file diff --git a/public/vendor/css-hamburgers/hamburgers.css b/public/vendor/css-hamburgers/hamburgers.css new file mode 100755 index 000000000..7e068e1f7 --- /dev/null +++ b/public/vendor/css-hamburgers/hamburgers.css @@ -0,0 +1,626 @@ +/*! + * Hamburgers + * @description Tasty CSS-animated hamburgers + * @author Jonathan Suh @jonsuh + * @site https://jonsuh.com/hamburgers + * @link https://github.com/jonsuh/hamburgers + */ +.hamburger { + padding: 15px 15px; + display: inline-block; + cursor: pointer; + transition-property: opacity, filter; + transition-duration: 0.15s; + transition-timing-function: linear; + font: inherit; + color: inherit; + text-transform: none; + background-color: transparent; + border: 0; + margin: 0; + overflow: visible; } + .hamburger:hover { + opacity: 0.7; } + +.hamburger-box { + width: 40px; + height: 24px; + display: inline-block; + position: relative; } + +.hamburger-inner { + display: block; + top: 50%; + margin-top: -2px; } + .hamburger-inner, .hamburger-inner::before, .hamburger-inner::after { + width: 40px; + height: 4px; + background-color: #000; + border-radius: 4px; + position: absolute; + transition-property: transform; + transition-duration: 0.15s; + transition-timing-function: ease; } + .hamburger-inner::before, .hamburger-inner::after { + content: ""; + display: block; } + .hamburger-inner::before { + top: -10px; } + .hamburger-inner::after { + bottom: -10px; } + +/* + * 3DX + */ +.hamburger--3dx .hamburger-box { + perspective: 80px; } + +.hamburger--3dx .hamburger-inner { + transition: transform 0.2s cubic-bezier(0.645, 0.045, 0.355, 1), background-color 0s 0.1s cubic-bezier(0.645, 0.045, 0.355, 1); } + .hamburger--3dx .hamburger-inner::before, .hamburger--3dx .hamburger-inner::after { + transition: transform 0s 0.1s cubic-bezier(0.645, 0.045, 0.355, 1); } + +.hamburger--3dx.is-active .hamburger-inner { + background-color: transparent; + transform: rotateY(180deg); } + .hamburger--3dx.is-active .hamburger-inner::before { + transform: translate3d(0, 10px, 0) rotate(45deg); } + .hamburger--3dx.is-active .hamburger-inner::after { + transform: translate3d(0, -10px, 0) rotate(-45deg); } + +/* + * 3DX Reverse + */ +.hamburger--3dx-r .hamburger-box { + perspective: 80px; } + +.hamburger--3dx-r .hamburger-inner { + transition: transform 0.2s cubic-bezier(0.645, 0.045, 0.355, 1), background-color 0s 0.1s cubic-bezier(0.645, 0.045, 0.355, 1); } + .hamburger--3dx-r .hamburger-inner::before, .hamburger--3dx-r .hamburger-inner::after { + transition: transform 0s 0.1s cubic-bezier(0.645, 0.045, 0.355, 1); } + +.hamburger--3dx-r.is-active .hamburger-inner { + background-color: transparent; + transform: rotateY(-180deg); } + .hamburger--3dx-r.is-active .hamburger-inner::before { + transform: translate3d(0, 10px, 0) rotate(45deg); } + .hamburger--3dx-r.is-active .hamburger-inner::after { + transform: translate3d(0, -10px, 0) rotate(-45deg); } + +/* + * 3DY + */ +.hamburger--3dy .hamburger-box { + perspective: 80px; } + +.hamburger--3dy .hamburger-inner { + transition: transform 0.2s cubic-bezier(0.645, 0.045, 0.355, 1), background-color 0s 0.1s cubic-bezier(0.645, 0.045, 0.355, 1); } + .hamburger--3dy .hamburger-inner::before, .hamburger--3dy .hamburger-inner::after { + transition: transform 0s 0.1s cubic-bezier(0.645, 0.045, 0.355, 1); } + +.hamburger--3dy.is-active .hamburger-inner { + background-color: transparent; + transform: rotateX(-180deg); } + .hamburger--3dy.is-active .hamburger-inner::before { + transform: translate3d(0, 10px, 0) rotate(45deg); } + .hamburger--3dy.is-active .hamburger-inner::after { + transform: translate3d(0, -10px, 0) rotate(-45deg); } + +/* + * 3DY Reverse + */ +.hamburger--3dy-r .hamburger-box { + perspective: 80px; } + +.hamburger--3dy-r .hamburger-inner { + transition: transform 0.2s cubic-bezier(0.645, 0.045, 0.355, 1), background-color 0s 0.1s cubic-bezier(0.645, 0.045, 0.355, 1); } + .hamburger--3dy-r .hamburger-inner::before, .hamburger--3dy-r .hamburger-inner::after { + transition: transform 0s 0.1s cubic-bezier(0.645, 0.045, 0.355, 1); } + +.hamburger--3dy-r.is-active .hamburger-inner { + background-color: transparent; + transform: rotateX(180deg); } + .hamburger--3dy-r.is-active .hamburger-inner::before { + transform: translate3d(0, 10px, 0) rotate(45deg); } + .hamburger--3dy-r.is-active .hamburger-inner::after { + transform: translate3d(0, -10px, 0) rotate(-45deg); } + +/* + * Arrow + */ +.hamburger--arrow.is-active .hamburger-inner::before { + transform: translate3d(-8px, 0, 0) rotate(-45deg) scale(0.7, 1); } + +.hamburger--arrow.is-active .hamburger-inner::after { + transform: translate3d(-8px, 0, 0) rotate(45deg) scale(0.7, 1); } + +/* + * Arrow Right + */ +.hamburger--arrow-r.is-active .hamburger-inner::before { + transform: translate3d(8px, 0, 0) rotate(45deg) scale(0.7, 1); } + +.hamburger--arrow-r.is-active .hamburger-inner::after { + transform: translate3d(8px, 0, 0) rotate(-45deg) scale(0.7, 1); } + +/* + * Arrow Alt + */ +.hamburger--arrowalt .hamburger-inner::before { + transition: top 0.1s 0.15s ease, transform 0.15s cubic-bezier(0.165, 0.84, 0.44, 1); } + +.hamburger--arrowalt .hamburger-inner::after { + transition: bottom 0.1s 0.15s ease, transform 0.15s cubic-bezier(0.165, 0.84, 0.44, 1); } + +.hamburger--arrowalt.is-active .hamburger-inner::before { + top: 0; + transform: translate3d(-8px, -10px, 0) rotate(-45deg) scale(0.7, 1); + transition: top 0.1s ease, transform 0.15s 0.1s cubic-bezier(0.895, 0.03, 0.685, 0.22); } + +.hamburger--arrowalt.is-active .hamburger-inner::after { + bottom: 0; + transform: translate3d(-8px, 10px, 0) rotate(45deg) scale(0.7, 1); + transition: bottom 0.1s ease, transform 0.15s 0.1s cubic-bezier(0.895, 0.03, 0.685, 0.22); } + +/* + * Arrow Alt Right + */ +.hamburger--arrowalt-r .hamburger-inner::before { + transition: top 0.1s 0.15s ease, transform 0.15s cubic-bezier(0.165, 0.84, 0.44, 1); } + +.hamburger--arrowalt-r .hamburger-inner::after { + transition: bottom 0.1s 0.15s ease, transform 0.15s cubic-bezier(0.165, 0.84, 0.44, 1); } + +.hamburger--arrowalt-r.is-active .hamburger-inner::before { + top: 0; + transform: translate3d(8px, -10px, 0) rotate(45deg) scale(0.7, 1); + transition: top 0.1s ease, transform 0.15s 0.1s cubic-bezier(0.895, 0.03, 0.685, 0.22); } + +.hamburger--arrowalt-r.is-active .hamburger-inner::after { + bottom: 0; + transform: translate3d(8px, 10px, 0) rotate(-45deg) scale(0.7, 1); + transition: bottom 0.1s ease, transform 0.15s 0.1s cubic-bezier(0.895, 0.03, 0.685, 0.22); } + +/* + * Boring + */ +.hamburger--boring .hamburger-inner, .hamburger--boring .hamburger-inner::before, .hamburger--boring .hamburger-inner::after { + transition-property: none; } + +.hamburger--boring.is-active .hamburger-inner { + transform: rotate(45deg); } + .hamburger--boring.is-active .hamburger-inner::before { + top: 0; + opacity: 0; } + .hamburger--boring.is-active .hamburger-inner::after { + bottom: 0; + transform: rotate(-90deg); } + +/* + * Collapse + */ +.hamburger--collapse .hamburger-inner { + top: auto; + bottom: 0; + transition-duration: 0.15s; + transition-delay: 0.15s; + transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); } + .hamburger--collapse .hamburger-inner::after { + top: -20px; + transition: top 0.3s 0.3s cubic-bezier(0.33333, 0.66667, 0.66667, 1), opacity 0.1s linear; } + .hamburger--collapse .hamburger-inner::before { + transition: top 0.12s 0.3s cubic-bezier(0.33333, 0.66667, 0.66667, 1), transform 0.15s cubic-bezier(0.55, 0.055, 0.675, 0.19); } + +.hamburger--collapse.is-active .hamburger-inner { + transform: translate3d(0, -10px, 0) rotate(-45deg); + transition-delay: 0.32s; + transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); } + .hamburger--collapse.is-active .hamburger-inner::after { + top: 0; + opacity: 0; + transition: top 0.3s cubic-bezier(0.33333, 0, 0.66667, 0.33333), opacity 0.1s 0.27s linear; } + .hamburger--collapse.is-active .hamburger-inner::before { + top: 0; + transform: rotate(-90deg); + transition: top 0.12s 0.18s cubic-bezier(0.33333, 0, 0.66667, 0.33333), transform 0.15s 0.42s cubic-bezier(0.215, 0.61, 0.355, 1); } + +/* + * Collapse Reverse + */ +.hamburger--collapse-r .hamburger-inner { + top: auto; + bottom: 0; + transition-duration: 0.15s; + transition-delay: 0.15s; + transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); } + .hamburger--collapse-r .hamburger-inner::after { + top: -20px; + transition: top 0.3s 0.3s cubic-bezier(0.33333, 0.66667, 0.66667, 1), opacity 0.1s linear; } + .hamburger--collapse-r .hamburger-inner::before { + transition: top 0.12s 0.3s cubic-bezier(0.33333, 0.66667, 0.66667, 1), transform 0.15s cubic-bezier(0.55, 0.055, 0.675, 0.19); } + +.hamburger--collapse-r.is-active .hamburger-inner { + transform: translate3d(0, -10px, 0) rotate(45deg); + transition-delay: 0.32s; + transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); } + .hamburger--collapse-r.is-active .hamburger-inner::after { + top: 0; + opacity: 0; + transition: top 0.3s cubic-bezier(0.33333, 0, 0.66667, 0.33333), opacity 0.1s 0.27s linear; } + .hamburger--collapse-r.is-active .hamburger-inner::before { + top: 0; + transform: rotate(90deg); + transition: top 0.12s 0.18s cubic-bezier(0.33333, 0, 0.66667, 0.33333), transform 0.15s 0.42s cubic-bezier(0.215, 0.61, 0.355, 1); } + +/* + * Elastic + */ +.hamburger--elastic .hamburger-inner { + top: 2px; + transition-duration: 0.4s; + transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55); } + .hamburger--elastic .hamburger-inner::before { + top: 10px; + transition: opacity 0.15s 0.4s ease; } + .hamburger--elastic .hamburger-inner::after { + top: 20px; + transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); } + +.hamburger--elastic.is-active .hamburger-inner { + transform: translate3d(0, 10px, 0) rotate(135deg); + transition-delay: 0.1s; } + .hamburger--elastic.is-active .hamburger-inner::before { + transition-delay: 0s; + opacity: 0; } + .hamburger--elastic.is-active .hamburger-inner::after { + transform: translate3d(0, -20px, 0) rotate(-270deg); + transition-delay: 0.1s; } + +/* + * Elastic Reverse + */ +.hamburger--elastic-r .hamburger-inner { + top: 2px; + transition-duration: 0.4s; + transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55); } + .hamburger--elastic-r .hamburger-inner::before { + top: 10px; + transition: opacity 0.15s 0.4s ease; } + .hamburger--elastic-r .hamburger-inner::after { + top: 20px; + transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); } + +.hamburger--elastic-r.is-active .hamburger-inner { + transform: translate3d(0, 10px, 0) rotate(-135deg); + transition-delay: 0.1s; } + .hamburger--elastic-r.is-active .hamburger-inner::before { + transition-delay: 0s; + opacity: 0; } + .hamburger--elastic-r.is-active .hamburger-inner::after { + transform: translate3d(0, -20px, 0) rotate(270deg); + transition-delay: 0.1s; } + +/* + * Emphatic + */ +.hamburger--emphatic { + overflow: hidden; } + .hamburger--emphatic .hamburger-inner { + transition: background-color 0.2s 0.25s ease-in; } + .hamburger--emphatic .hamburger-inner::before { + left: 0; + transition: transform 0.2s cubic-bezier(0.6, 0.04, 0.98, 0.335), top 0.05s 0.2s linear, left 0.2s 0.25s ease-in; } + .hamburger--emphatic .hamburger-inner::after { + top: 10px; + right: 0; + transition: transform 0.2s cubic-bezier(0.6, 0.04, 0.98, 0.335), top 0.05s 0.2s linear, right 0.2s 0.25s ease-in; } + .hamburger--emphatic.is-active .hamburger-inner { + transition-delay: 0s; + transition-timing-function: ease-out; + background-color: transparent; } + .hamburger--emphatic.is-active .hamburger-inner::before { + left: -80px; + top: -80px; + transform: translate3d(80px, 80px, 0) rotate(45deg); + transition: left 0.2s ease-out, top 0.05s 0.2s linear, transform 0.2s 0.25s cubic-bezier(0.075, 0.82, 0.165, 1); } + .hamburger--emphatic.is-active .hamburger-inner::after { + right: -80px; + top: -80px; + transform: translate3d(-80px, 80px, 0) rotate(-45deg); + transition: right 0.2s ease-out, top 0.05s 0.2s linear, transform 0.2s 0.25s cubic-bezier(0.075, 0.82, 0.165, 1); } + +/* + * Emphatic Reverse + */ +.hamburger--emphatic-r { + overflow: hidden; } + .hamburger--emphatic-r .hamburger-inner { + transition: background-color 0.2s 0.25s ease-in; } + .hamburger--emphatic-r .hamburger-inner::before { + left: 0; + transition: transform 0.2s cubic-bezier(0.6, 0.04, 0.98, 0.335), top 0.05s 0.2s linear, left 0.2s 0.25s ease-in; } + .hamburger--emphatic-r .hamburger-inner::after { + top: 10px; + right: 0; + transition: transform 0.2s cubic-bezier(0.6, 0.04, 0.98, 0.335), top 0.05s 0.2s linear, right 0.2s 0.25s ease-in; } + .hamburger--emphatic-r.is-active .hamburger-inner { + transition-delay: 0s; + transition-timing-function: ease-out; + background-color: transparent; } + .hamburger--emphatic-r.is-active .hamburger-inner::before { + left: -80px; + top: 80px; + transform: translate3d(80px, -80px, 0) rotate(-45deg); + transition: left 0.2s ease-out, top 0.05s 0.2s linear, transform 0.2s 0.25s cubic-bezier(0.075, 0.82, 0.165, 1); } + .hamburger--emphatic-r.is-active .hamburger-inner::after { + right: -80px; + top: 80px; + transform: translate3d(-80px, -80px, 0) rotate(45deg); + transition: right 0.2s ease-out, top 0.05s 0.2s linear, transform 0.2s 0.25s cubic-bezier(0.075, 0.82, 0.165, 1); } + +/* + * Slider + */ +.hamburger--slider .hamburger-inner { + top: 2px; } + .hamburger--slider .hamburger-inner::before { + top: 10px; + transition-property: transform, opacity; + transition-timing-function: ease; + transition-duration: 0.2s; } + .hamburger--slider .hamburger-inner::after { + top: 20px; } + +.hamburger--slider.is-active .hamburger-inner { + transform: translate3d(0, 10px, 0) rotate(45deg); } + .hamburger--slider.is-active .hamburger-inner::before { + transform: rotate(-45deg) translate3d(-5.71429px, -6px, 0); + opacity: 0; } + .hamburger--slider.is-active .hamburger-inner::after { + transform: translate3d(0, -20px, 0) rotate(-90deg); } + +/* + * Slider Reverse + */ +.hamburger--slider-r .hamburger-inner { + top: 2px; } + .hamburger--slider-r .hamburger-inner::before { + top: 10px; + transition-property: transform, opacity; + transition-timing-function: ease; + transition-duration: 0.2s; } + .hamburger--slider-r .hamburger-inner::after { + top: 20px; } + +.hamburger--slider-r.is-active .hamburger-inner { + transform: translate3d(0, 10px, 0) rotate(-45deg); } + .hamburger--slider-r.is-active .hamburger-inner::before { + transform: rotate(45deg) translate3d(5.71429px, -6px, 0); + opacity: 0; } + .hamburger--slider-r.is-active .hamburger-inner::after { + transform: translate3d(0, -20px, 0) rotate(90deg); } + +/* + * Spring + */ +.hamburger--spring .hamburger-inner { + top: 2px; + transition: background-color 0s 0.15s linear; } + .hamburger--spring .hamburger-inner::before { + top: 10px; + transition: top 0.12s 0.3s cubic-bezier(0.33333, 0.66667, 0.66667, 1), transform 0.15s cubic-bezier(0.55, 0.055, 0.675, 0.19); } + .hamburger--spring .hamburger-inner::after { + top: 20px; + transition: top 0.3s 0.3s cubic-bezier(0.33333, 0.66667, 0.66667, 1), transform 0.15s cubic-bezier(0.55, 0.055, 0.675, 0.19); } + +.hamburger--spring.is-active .hamburger-inner { + transition-delay: 0.32s; + background-color: transparent; } + .hamburger--spring.is-active .hamburger-inner::before { + top: 0; + transition: top 0.12s 0.18s cubic-bezier(0.33333, 0, 0.66667, 0.33333), transform 0.15s 0.32s cubic-bezier(0.215, 0.61, 0.355, 1); + transform: translate3d(0, 10px, 0) rotate(45deg); } + .hamburger--spring.is-active .hamburger-inner::after { + top: 0; + transition: top 0.3s cubic-bezier(0.33333, 0, 0.66667, 0.33333), transform 0.15s 0.32s cubic-bezier(0.215, 0.61, 0.355, 1); + transform: translate3d(0, 10px, 0) rotate(-45deg); } + +/* + * Spring Reverse + */ +.hamburger--spring-r .hamburger-inner { + top: auto; + bottom: 0; + transition-duration: 0.15s; + transition-delay: 0s; + transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); } + .hamburger--spring-r .hamburger-inner::after { + top: -20px; + transition: top 0.3s 0.3s cubic-bezier(0.33333, 0.66667, 0.66667, 1), opacity 0s linear; } + .hamburger--spring-r .hamburger-inner::before { + transition: top 0.12s 0.3s cubic-bezier(0.33333, 0.66667, 0.66667, 1), transform 0.15s cubic-bezier(0.55, 0.055, 0.675, 0.19); } + +.hamburger--spring-r.is-active .hamburger-inner { + transform: translate3d(0, -10px, 0) rotate(-45deg); + transition-delay: 0.32s; + transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); } + .hamburger--spring-r.is-active .hamburger-inner::after { + top: 0; + opacity: 0; + transition: top 0.3s cubic-bezier(0.33333, 0, 0.66667, 0.33333), opacity 0s 0.32s linear; } + .hamburger--spring-r.is-active .hamburger-inner::before { + top: 0; + transform: rotate(90deg); + transition: top 0.12s 0.18s cubic-bezier(0.33333, 0, 0.66667, 0.33333), transform 0.15s 0.32s cubic-bezier(0.215, 0.61, 0.355, 1); } + +/* + * Stand + */ +.hamburger--stand .hamburger-inner { + transition: transform 0.1s 0.22s cubic-bezier(0.55, 0.055, 0.675, 0.19), background-color 0s 0.1s linear; } + .hamburger--stand .hamburger-inner::before { + transition: top 0.1s 0.1s ease-in, transform 0.1s 0s cubic-bezier(0.55, 0.055, 0.675, 0.19); } + .hamburger--stand .hamburger-inner::after { + transition: bottom 0.1s 0.1s ease-in, transform 0.1s 0s cubic-bezier(0.55, 0.055, 0.675, 0.19); } + +.hamburger--stand.is-active .hamburger-inner { + transform: rotate(90deg); + background-color: transparent; + transition: transform 0.1s 0s cubic-bezier(0.215, 0.61, 0.355, 1), background-color 0s 0.22s linear; } + .hamburger--stand.is-active .hamburger-inner::before { + top: 0; + transform: rotate(-45deg); + transition: top 0.1s 0.12s ease-out, transform 0.1s 0.22s cubic-bezier(0.215, 0.61, 0.355, 1); } + .hamburger--stand.is-active .hamburger-inner::after { + bottom: 0; + transform: rotate(45deg); + transition: bottom 0.1s 0.12s ease-out, transform 0.1s 0.22s cubic-bezier(0.215, 0.61, 0.355, 1); } + +/* + * Stand Reverse + */ +.hamburger--stand-r .hamburger-inner { + transition: transform 0.1s 0.22s cubic-bezier(0.55, 0.055, 0.675, 0.19), background-color 0s 0.1s linear; } + .hamburger--stand-r .hamburger-inner::before { + transition: top 0.1s 0.1s ease-in, transform 0.1s 0s cubic-bezier(0.55, 0.055, 0.675, 0.19); } + .hamburger--stand-r .hamburger-inner::after { + transition: bottom 0.1s 0.1s ease-in, transform 0.1s 0s cubic-bezier(0.55, 0.055, 0.675, 0.19); } + +.hamburger--stand-r.is-active .hamburger-inner { + transform: rotate(-90deg); + background-color: transparent; + transition: transform 0.1s 0s cubic-bezier(0.215, 0.61, 0.355, 1), background-color 0s 0.22s linear; } + .hamburger--stand-r.is-active .hamburger-inner::before { + top: 0; + transform: rotate(-45deg); + transition: top 0.1s 0.12s ease-out, transform 0.1s 0.22s cubic-bezier(0.215, 0.61, 0.355, 1); } + .hamburger--stand-r.is-active .hamburger-inner::after { + bottom: 0; + transform: rotate(45deg); + transition: bottom 0.1s 0.12s ease-out, transform 0.1s 0.22s cubic-bezier(0.215, 0.61, 0.355, 1); } + +/* + * Spin + */ +.hamburger--spin .hamburger-inner { + transition-duration: 0.3s; + transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); } + .hamburger--spin .hamburger-inner::before { + transition: top 0.1s 0.34s ease-in, opacity 0.1s ease-in; } + .hamburger--spin .hamburger-inner::after { + transition: bottom 0.1s 0.34s ease-in, transform 0.3s cubic-bezier(0.55, 0.055, 0.675, 0.19); } + +.hamburger--spin.is-active .hamburger-inner { + transform: rotate(225deg); + transition-delay: 0.14s; + transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); } + .hamburger--spin.is-active .hamburger-inner::before { + top: 0; + opacity: 0; + transition: top 0.1s ease-out, opacity 0.1s 0.14s ease-out; } + .hamburger--spin.is-active .hamburger-inner::after { + bottom: 0; + transform: rotate(-90deg); + transition: bottom 0.1s ease-out, transform 0.3s 0.14s cubic-bezier(0.215, 0.61, 0.355, 1); } + +/* + * Spin Reverse + */ +.hamburger--spin-r .hamburger-inner { + transition-duration: 0.3s; + transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); } + .hamburger--spin-r .hamburger-inner::before { + transition: top 0.1s 0.34s ease-in, opacity 0.1s ease-in; } + .hamburger--spin-r .hamburger-inner::after { + transition: bottom 0.1s 0.34s ease-in, transform 0.3s cubic-bezier(0.55, 0.055, 0.675, 0.19); } + +.hamburger--spin-r.is-active .hamburger-inner { + transform: rotate(-225deg); + transition-delay: 0.14s; + transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); } + .hamburger--spin-r.is-active .hamburger-inner::before { + top: 0; + opacity: 0; + transition: top 0.1s ease-out, opacity 0.1s 0.14s ease-out; } + .hamburger--spin-r.is-active .hamburger-inner::after { + bottom: 0; + transform: rotate(90deg); + transition: bottom 0.1s ease-out, transform 0.3s 0.14s cubic-bezier(0.215, 0.61, 0.355, 1); } + +/* + * Squeeze + */ +.hamburger--squeeze .hamburger-inner { + transition-duration: 0.1s; + transition-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); } + .hamburger--squeeze .hamburger-inner::before { + transition: top 0.1s 0.14s ease, opacity 0.1s ease; } + .hamburger--squeeze .hamburger-inner::after { + transition: bottom 0.1s 0.14s ease, transform 0.1s cubic-bezier(0.55, 0.055, 0.675, 0.19); } + +.hamburger--squeeze.is-active .hamburger-inner { + transform: rotate(45deg); + transition-delay: 0.14s; + transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1); } + .hamburger--squeeze.is-active .hamburger-inner::before { + top: 0; + opacity: 0; + transition: top 0.1s ease, opacity 0.1s 0.14s ease; } + .hamburger--squeeze.is-active .hamburger-inner::after { + bottom: 0; + transform: rotate(-90deg); + transition: bottom 0.1s ease, transform 0.1s 0.14s cubic-bezier(0.215, 0.61, 0.355, 1); } + +/* + * Vortex + */ +.hamburger--vortex .hamburger-inner { + transition-duration: 0.3s; + transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1); } + .hamburger--vortex .hamburger-inner::before, .hamburger--vortex .hamburger-inner::after { + transition-duration: 0s; + transition-delay: 0.1s; + transition-timing-function: linear; } + .hamburger--vortex .hamburger-inner::before { + transition-property: top, opacity; } + .hamburger--vortex .hamburger-inner::after { + transition-property: bottom, transform; } + +.hamburger--vortex.is-active .hamburger-inner { + transform: rotate(765deg); + transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1); } + .hamburger--vortex.is-active .hamburger-inner::before, .hamburger--vortex.is-active .hamburger-inner::after { + transition-delay: 0s; } + .hamburger--vortex.is-active .hamburger-inner::before { + top: 0; + opacity: 0; } + .hamburger--vortex.is-active .hamburger-inner::after { + bottom: 0; + transform: rotate(90deg); } + +/* + * Vortex Reverse + */ +.hamburger--vortex-r .hamburger-inner { + transition-duration: 0.3s; + transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1); } + .hamburger--vortex-r .hamburger-inner::before, .hamburger--vortex-r .hamburger-inner::after { + transition-duration: 0s; + transition-delay: 0.1s; + transition-timing-function: linear; } + .hamburger--vortex-r .hamburger-inner::before { + transition-property: top, opacity; } + .hamburger--vortex-r .hamburger-inner::after { + transition-property: bottom, transform; } + +.hamburger--vortex-r.is-active .hamburger-inner { + transform: rotate(-765deg); + transition-timing-function: cubic-bezier(0.19, 1, 0.22, 1); } + .hamburger--vortex-r.is-active .hamburger-inner::before, .hamburger--vortex-r.is-active .hamburger-inner::after { + transition-delay: 0s; } + .hamburger--vortex-r.is-active .hamburger-inner::before { + top: 0; + opacity: 0; } + .hamburger--vortex-r.is-active .hamburger-inner::after { + bottom: 0; + transform: rotate(-90deg); } diff --git a/public/vendor/css-hamburgers/hamburgers.min.css b/public/vendor/css-hamburgers/hamburgers.min.css new file mode 100755 index 000000000..10b3b0655 --- /dev/null +++ b/public/vendor/css-hamburgers/hamburgers.min.css @@ -0,0 +1,7 @@ +/*! + * Hamburgers + * @description Tasty CSS-animated hamburgers + * @author Jonathan Suh @jonsuh + * @site https://jonsuh.com/hamburgers + * @link https://github.com/jonsuh/hamburgers + */.hamburger{font:inherit;display:inline-block;overflow:visible;margin:0;padding:15px;cursor:pointer;transition-timing-function:linear;transition-duration:.15s;transition-property:opacity,filter;text-transform:none;color:inherit;border:0;background-color:transparent}.hamburger:hover{opacity:.7}.hamburger-box{position:relative;display:inline-block;width:40px;height:24px}.hamburger-inner{top:50%;display:block;margin-top:-2px}.hamburger-inner,.hamburger-inner:after,.hamburger-inner:before{position:absolute;width:40px;height:4px;transition-timing-function:ease;transition-duration:.15s;transition-property:transform;border-radius:4px;background-color:#000}.hamburger-inner:after,.hamburger-inner:before{display:block;content:''}.hamburger-inner:before{top:-10px}.hamburger-inner:after{bottom:-10px}.hamburger--3dx .hamburger-box{perspective:80px}.hamburger--3dx .hamburger-inner{transition:transform .2s cubic-bezier(.645,.045,.355,1),background-color 0s cubic-bezier(.645,.045,.355,1) .1s}.hamburger--3dx .hamburger-inner:after,.hamburger--3dx .hamburger-inner:before{transition:transform 0s cubic-bezier(.645,.045,.355,1) .1s}.hamburger--3dx.is-active .hamburger-inner{transform:rotateY(180deg);background-color:transparent}.hamburger--3dx.is-active .hamburger-inner:before{transform:translate3d(0,10px,0) rotate(45deg)}.hamburger--3dx.is-active .hamburger-inner:after{transform:translate3d(0,-10px,0) rotate(-45deg)}.hamburger--3dx-r .hamburger-box{perspective:80px}.hamburger--3dx-r .hamburger-inner{transition:transform .2s cubic-bezier(.645,.045,.355,1),background-color 0s cubic-bezier(.645,.045,.355,1) .1s}.hamburger--3dx-r .hamburger-inner:after,.hamburger--3dx-r .hamburger-inner:before{transition:transform 0s cubic-bezier(.645,.045,.355,1) .1s}.hamburger--3dx-r.is-active .hamburger-inner{transform:rotateY(-180deg);background-color:transparent}.hamburger--3dx-r.is-active .hamburger-inner:before{transform:translate3d(0,10px,0) rotate(45deg)}.hamburger--3dx-r.is-active .hamburger-inner:after{transform:translate3d(0,-10px,0) rotate(-45deg)}.hamburger--3dy .hamburger-box{perspective:80px}.hamburger--3dy .hamburger-inner{transition:transform .2s cubic-bezier(.645,.045,.355,1),background-color 0s cubic-bezier(.645,.045,.355,1) .1s}.hamburger--3dy .hamburger-inner:after,.hamburger--3dy .hamburger-inner:before{transition:transform 0s cubic-bezier(.645,.045,.355,1) .1s}.hamburger--3dy.is-active .hamburger-inner{transform:rotateX(-180deg);background-color:transparent}.hamburger--3dy.is-active .hamburger-inner:before{transform:translate3d(0,10px,0) rotate(45deg)}.hamburger--3dy.is-active .hamburger-inner:after{transform:translate3d(0,-10px,0) rotate(-45deg)}.hamburger--3dy-r .hamburger-box{perspective:80px}.hamburger--3dy-r .hamburger-inner{transition:transform .2s cubic-bezier(.645,.045,.355,1),background-color 0s cubic-bezier(.645,.045,.355,1) .1s}.hamburger--3dy-r .hamburger-inner:after,.hamburger--3dy-r .hamburger-inner:before{transition:transform 0s cubic-bezier(.645,.045,.355,1) .1s}.hamburger--3dy-r.is-active .hamburger-inner{transform:rotateX(180deg);background-color:transparent}.hamburger--3dy-r.is-active .hamburger-inner:before{transform:translate3d(0,10px,0) rotate(45deg)}.hamburger--3dy-r.is-active .hamburger-inner:after{transform:translate3d(0,-10px,0) rotate(-45deg)}.hamburger--arrow.is-active .hamburger-inner:before{transform:translate3d(-8px,0,0) rotate(-45deg) scaleX(.7)}.hamburger--arrow.is-active .hamburger-inner:after{transform:translate3d(-8px,0,0) rotate(45deg) scaleX(.7)}.hamburger--arrow-r.is-active .hamburger-inner:before{transform:translate3d(8px,0,0) rotate(45deg) scaleX(.7)}.hamburger--arrow-r.is-active .hamburger-inner:after{transform:translate3d(8px,0,0) rotate(-45deg) scaleX(.7)}.hamburger--arrowalt .hamburger-inner:before{transition:top .1s ease .15s,transform .15s cubic-bezier(.165,.84,.44,1)}.hamburger--arrowalt .hamburger-inner:after{transition:bottom .1s ease .15s,transform .15s cubic-bezier(.165,.84,.44,1)}.hamburger--arrowalt.is-active .hamburger-inner:before{top:0;transition:top .1s ease,transform .15s cubic-bezier(.895,.03,.685,.22) .1s;transform:translate3d(-8px,-10px,0) rotate(-45deg) scaleX(.7)}.hamburger--arrowalt.is-active .hamburger-inner:after{bottom:0;transition:bottom .1s ease,transform .15s cubic-bezier(.895,.03,.685,.22) .1s;transform:translate3d(-8px,10px,0) rotate(45deg) scaleX(.7)}.hamburger--arrowalt-r .hamburger-inner:before{transition:top .1s ease .15s,transform .15s cubic-bezier(.165,.84,.44,1)}.hamburger--arrowalt-r .hamburger-inner:after{transition:bottom .1s ease .15s,transform .15s cubic-bezier(.165,.84,.44,1)}.hamburger--arrowalt-r.is-active .hamburger-inner:before{top:0;transition:top .1s ease,transform .15s cubic-bezier(.895,.03,.685,.22) .1s;transform:translate3d(8px,-10px,0) rotate(45deg) scaleX(.7)}.hamburger--arrowalt-r.is-active .hamburger-inner:after{bottom:0;transition:bottom .1s ease,transform .15s cubic-bezier(.895,.03,.685,.22) .1s;transform:translate3d(8px,10px,0) rotate(-45deg) scaleX(.7)}.hamburger--boring .hamburger-inner,.hamburger--boring .hamburger-inner:after,.hamburger--boring .hamburger-inner:before{transition-property:none}.hamburger--boring.is-active .hamburger-inner{transform:rotate(45deg)}.hamburger--boring.is-active .hamburger-inner:before{top:0;opacity:0}.hamburger--boring.is-active .hamburger-inner:after{bottom:0;transform:rotate(-90deg)}.hamburger--collapse .hamburger-inner{top:auto;bottom:0;transition-delay:.15s;transition-timing-function:cubic-bezier(.55,.055,.675,.19);transition-duration:.15s}.hamburger--collapse .hamburger-inner:after{top:-20px;transition:top .3s cubic-bezier(.33333,.66667,.66667,1) .3s,opacity .1s linear}.hamburger--collapse .hamburger-inner:before{transition:top .12s cubic-bezier(.33333,.66667,.66667,1) .3s,transform .15s cubic-bezier(.55,.055,.675,.19)}.hamburger--collapse.is-active .hamburger-inner{transition-delay:.32s;transition-timing-function:cubic-bezier(.215,.61,.355,1);transform:translate3d(0,-10px,0) rotate(-45deg)}.hamburger--collapse.is-active .hamburger-inner:after{top:0;transition:top .3s cubic-bezier(.33333,0,.66667,.33333),opacity .1s linear .27s;opacity:0}.hamburger--collapse.is-active .hamburger-inner:before{top:0;transition:top .12s cubic-bezier(.33333,0,.66667,.33333) .18s,transform .15s cubic-bezier(.215,.61,.355,1) .42s;transform:rotate(-90deg)}.hamburger--collapse-r .hamburger-inner{top:auto;bottom:0;transition-delay:.15s;transition-timing-function:cubic-bezier(.55,.055,.675,.19);transition-duration:.15s}.hamburger--collapse-r .hamburger-inner:after{top:-20px;transition:top .3s cubic-bezier(.33333,.66667,.66667,1) .3s,opacity .1s linear}.hamburger--collapse-r .hamburger-inner:before{transition:top .12s cubic-bezier(.33333,.66667,.66667,1) .3s,transform .15s cubic-bezier(.55,.055,.675,.19)}.hamburger--collapse-r.is-active .hamburger-inner{transition-delay:.32s;transition-timing-function:cubic-bezier(.215,.61,.355,1);transform:translate3d(0,-10px,0) rotate(45deg)}.hamburger--collapse-r.is-active .hamburger-inner:after{top:0;transition:top .3s cubic-bezier(.33333,0,.66667,.33333),opacity .1s linear .27s;opacity:0}.hamburger--collapse-r.is-active .hamburger-inner:before{top:0;transition:top .12s cubic-bezier(.33333,0,.66667,.33333) .18s,transform .15s cubic-bezier(.215,.61,.355,1) .42s;transform:rotate(90deg)}.hamburger--elastic .hamburger-inner{top:2px;transition-timing-function:cubic-bezier(.68,-.55,.265,1.55);transition-duration:.4s}.hamburger--elastic .hamburger-inner:before{top:10px;transition:opacity .15s ease .4s}.hamburger--elastic .hamburger-inner:after{top:20px;transition:transform .4s cubic-bezier(.68,-.55,.265,1.55)}.hamburger--elastic.is-active .hamburger-inner{transition-delay:.1s;transform:translate3d(0,10px,0) rotate(135deg)}.hamburger--elastic.is-active .hamburger-inner:before{transition-delay:0s;opacity:0}.hamburger--elastic.is-active .hamburger-inner:after{transition-delay:.1s;transform:translate3d(0,-20px,0) rotate(-270deg)}.hamburger--elastic-r .hamburger-inner{top:2px;transition-timing-function:cubic-bezier(.68,-.55,.265,1.55);transition-duration:.4s}.hamburger--elastic-r .hamburger-inner:before{top:10px;transition:opacity .15s ease .4s}.hamburger--elastic-r .hamburger-inner:after{top:20px;transition:transform .4s cubic-bezier(.68,-.55,.265,1.55)}.hamburger--elastic-r.is-active .hamburger-inner{transition-delay:.1s;transform:translate3d(0,10px,0) rotate(-135deg)}.hamburger--elastic-r.is-active .hamburger-inner:before{transition-delay:0s;opacity:0}.hamburger--elastic-r.is-active .hamburger-inner:after{transition-delay:.1s;transform:translate3d(0,-20px,0) rotate(270deg)}.hamburger--emphatic{overflow:hidden}.hamburger--emphatic .hamburger-inner{transition:background-color .2s ease-in .25s}.hamburger--emphatic .hamburger-inner:before{left:0;transition:transform .2s cubic-bezier(.6,.04,.98,.335),top .05s linear .2s,left .2s ease-in .25s}.hamburger--emphatic .hamburger-inner:after{top:10px;right:0;transition:transform .2s cubic-bezier(.6,.04,.98,.335),top .05s linear .2s,right .2s ease-in .25s}.hamburger--emphatic.is-active .hamburger-inner{transition-delay:0s;transition-timing-function:ease-out;background-color:transparent}.hamburger--emphatic.is-active .hamburger-inner:before{top:-80px;left:-80px;transition:left .2s ease-out,top .05s linear .2s,transform .2s cubic-bezier(.075,.82,.165,1) .25s;transform:translate3d(80px,80px,0) rotate(45deg)}.hamburger--emphatic.is-active .hamburger-inner:after{top:-80px;right:-80px;transition:right .2s ease-out,top .05s linear .2s,transform .2s cubic-bezier(.075,.82,.165,1) .25s;transform:translate3d(-80px,80px,0) rotate(-45deg)}.hamburger--emphatic-r{overflow:hidden}.hamburger--emphatic-r .hamburger-inner{transition:background-color .2s ease-in .25s}.hamburger--emphatic-r .hamburger-inner:before{left:0;transition:transform .2s cubic-bezier(.6,.04,.98,.335),top .05s linear .2s,left .2s ease-in .25s}.hamburger--emphatic-r .hamburger-inner:after{top:10px;right:0;transition:transform .2s cubic-bezier(.6,.04,.98,.335),top .05s linear .2s,right .2s ease-in .25s}.hamburger--emphatic-r.is-active .hamburger-inner{transition-delay:0s;transition-timing-function:ease-out;background-color:transparent}.hamburger--emphatic-r.is-active .hamburger-inner:before{top:80px;left:-80px;transition:left .2s ease-out,top .05s linear .2s,transform .2s cubic-bezier(.075,.82,.165,1) .25s;transform:translate3d(80px,-80px,0) rotate(-45deg)}.hamburger--emphatic-r.is-active .hamburger-inner:after{top:80px;right:-80px;transition:right .2s ease-out,top .05s linear .2s,transform .2s cubic-bezier(.075,.82,.165,1) .25s;transform:translate3d(-80px,-80px,0) rotate(45deg)}.hamburger--slider .hamburger-inner{top:2px}.hamburger--slider .hamburger-inner:before{top:10px;transition-timing-function:ease;transition-duration:.2s;transition-property:transform,opacity}.hamburger--slider .hamburger-inner:after{top:20px}.hamburger--slider.is-active .hamburger-inner{transform:translate3d(0,10px,0) rotate(45deg)}.hamburger--slider.is-active .hamburger-inner:before{transform:rotate(-45deg) translate3d(-5.71429px,-6px,0);opacity:0}.hamburger--slider.is-active .hamburger-inner:after{transform:translate3d(0,-20px,0) rotate(-90deg)}.hamburger--slider-r .hamburger-inner{top:2px}.hamburger--slider-r .hamburger-inner:before{top:10px;transition-timing-function:ease;transition-duration:.2s;transition-property:transform,opacity}.hamburger--slider-r .hamburger-inner:after{top:20px}.hamburger--slider-r.is-active .hamburger-inner{transform:translate3d(0,10px,0) rotate(-45deg)}.hamburger--slider-r.is-active .hamburger-inner:before{transform:rotate(45deg) translate3d(5.71429px,-6px,0);opacity:0}.hamburger--slider-r.is-active .hamburger-inner:after{transform:translate3d(0,-20px,0) rotate(90deg)}.hamburger--spring .hamburger-inner{top:2px;transition:background-color 0s linear .15s}.hamburger--spring .hamburger-inner:before{top:10px;transition:top .12s cubic-bezier(.33333,.66667,.66667,1) .3s,transform .15s cubic-bezier(.55,.055,.675,.19)}.hamburger--spring .hamburger-inner:after{top:20px;transition:top .3s cubic-bezier(.33333,.66667,.66667,1) .3s,transform .15s cubic-bezier(.55,.055,.675,.19)}.hamburger--spring.is-active .hamburger-inner{transition-delay:.32s;background-color:transparent}.hamburger--spring.is-active .hamburger-inner:before{top:0;transition:top .12s cubic-bezier(.33333,0,.66667,.33333) .18s,transform .15s cubic-bezier(.215,.61,.355,1) .32s;transform:translate3d(0,10px,0) rotate(45deg)}.hamburger--spring.is-active .hamburger-inner:after{top:0;transition:top .3s cubic-bezier(.33333,0,.66667,.33333),transform .15s cubic-bezier(.215,.61,.355,1) .32s;transform:translate3d(0,10px,0) rotate(-45deg)}.hamburger--spring-r .hamburger-inner{top:auto;bottom:0;transition-delay:0s;transition-timing-function:cubic-bezier(.55,.055,.675,.19);transition-duration:.15s}.hamburger--spring-r .hamburger-inner:after{top:-20px;transition:top .3s cubic-bezier(.33333,.66667,.66667,1) .3s,opacity 0s linear}.hamburger--spring-r .hamburger-inner:before{transition:top .12s cubic-bezier(.33333,.66667,.66667,1) .3s,transform .15s cubic-bezier(.55,.055,.675,.19)}.hamburger--spring-r.is-active .hamburger-inner{transition-delay:.32s;transition-timing-function:cubic-bezier(.215,.61,.355,1);transform:translate3d(0,-10px,0) rotate(-45deg)}.hamburger--spring-r.is-active .hamburger-inner:after{top:0;transition:top .3s cubic-bezier(.33333,0,.66667,.33333),opacity 0s linear .32s;opacity:0}.hamburger--spring-r.is-active .hamburger-inner:before{top:0;transition:top .12s cubic-bezier(.33333,0,.66667,.33333) .18s,transform .15s cubic-bezier(.215,.61,.355,1) .32s;transform:rotate(90deg)}.hamburger--stand .hamburger-inner{transition:transform .1s cubic-bezier(.55,.055,.675,.19) .22s,background-color 0s linear .1s}.hamburger--stand .hamburger-inner:before{transition:top .1s ease-in .1s,transform .1s cubic-bezier(.55,.055,.675,.19) 0s}.hamburger--stand .hamburger-inner:after{transition:bottom .1s ease-in .1s,transform .1s cubic-bezier(.55,.055,.675,.19) 0s}.hamburger--stand.is-active .hamburger-inner{transition:transform .1s cubic-bezier(.215,.61,.355,1) 0s,background-color 0s linear .22s;transform:rotate(90deg);background-color:transparent}.hamburger--stand.is-active .hamburger-inner:before{top:0;transition:top .1s ease-out .12s,transform .1s cubic-bezier(.215,.61,.355,1) .22s;transform:rotate(-45deg)}.hamburger--stand.is-active .hamburger-inner:after{bottom:0;transition:bottom .1s ease-out .12s,transform .1s cubic-bezier(.215,.61,.355,1) .22s;transform:rotate(45deg)}.hamburger--stand-r .hamburger-inner{transition:transform .1s cubic-bezier(.55,.055,.675,.19) .22s,background-color 0s linear .1s}.hamburger--stand-r .hamburger-inner:before{transition:top .1s ease-in .1s,transform .1s cubic-bezier(.55,.055,.675,.19) 0s}.hamburger--stand-r .hamburger-inner:after{transition:bottom .1s ease-in .1s,transform .1s cubic-bezier(.55,.055,.675,.19) 0s}.hamburger--stand-r.is-active .hamburger-inner{transition:transform .1s cubic-bezier(.215,.61,.355,1) 0s,background-color 0s linear .22s;transform:rotate(-90deg);background-color:transparent}.hamburger--stand-r.is-active .hamburger-inner:before{top:0;transition:top .1s ease-out .12s,transform .1s cubic-bezier(.215,.61,.355,1) .22s;transform:rotate(-45deg)}.hamburger--stand-r.is-active .hamburger-inner:after{bottom:0;transition:bottom .1s ease-out .12s,transform .1s cubic-bezier(.215,.61,.355,1) .22s;transform:rotate(45deg)}.hamburger--spin .hamburger-inner{transition-timing-function:cubic-bezier(.55,.055,.675,.19);transition-duration:.3s}.hamburger--spin .hamburger-inner:before{transition:top .1s ease-in .34s,opacity .1s ease-in}.hamburger--spin .hamburger-inner:after{transition:bottom .1s ease-in .34s,transform .3s cubic-bezier(.55,.055,.675,.19)}.hamburger--spin.is-active .hamburger-inner{transition-delay:.14s;transition-timing-function:cubic-bezier(.215,.61,.355,1);transform:rotate(225deg)}.hamburger--spin.is-active .hamburger-inner:before{top:0;transition:top .1s ease-out,opacity .1s ease-out .14s;opacity:0}.hamburger--spin.is-active .hamburger-inner:after{bottom:0;transition:bottom .1s ease-out,transform .3s cubic-bezier(.215,.61,.355,1) .14s;transform:rotate(-90deg)}.hamburger--spin-r .hamburger-inner{transition-timing-function:cubic-bezier(.55,.055,.675,.19);transition-duration:.3s}.hamburger--spin-r .hamburger-inner:before{transition:top .1s ease-in .34s,opacity .1s ease-in}.hamburger--spin-r .hamburger-inner:after{transition:bottom .1s ease-in .34s,transform .3s cubic-bezier(.55,.055,.675,.19)}.hamburger--spin-r.is-active .hamburger-inner{transition-delay:.14s;transition-timing-function:cubic-bezier(.215,.61,.355,1);transform:rotate(-225deg)}.hamburger--spin-r.is-active .hamburger-inner:before{top:0;transition:top .1s ease-out,opacity .1s ease-out .14s;opacity:0}.hamburger--spin-r.is-active .hamburger-inner:after{bottom:0;transition:bottom .1s ease-out,transform .3s cubic-bezier(.215,.61,.355,1) .14s;transform:rotate(90deg)}.hamburger--squeeze .hamburger-inner{transition-timing-function:cubic-bezier(.55,.055,.675,.19);transition-duration:.1s}.hamburger--squeeze .hamburger-inner:before{transition:top .1s ease .14s,opacity .1s ease}.hamburger--squeeze .hamburger-inner:after{transition:bottom .1s ease .14s,transform .1s cubic-bezier(.55,.055,.675,.19)}.hamburger--squeeze.is-active .hamburger-inner{transition-delay:.14s;transition-timing-function:cubic-bezier(.215,.61,.355,1);transform:rotate(45deg)}.hamburger--squeeze.is-active .hamburger-inner:before{top:0;transition:top .1s ease,opacity .1s ease .14s;opacity:0}.hamburger--squeeze.is-active .hamburger-inner:after{bottom:0;transition:bottom .1s ease,transform .1s cubic-bezier(.215,.61,.355,1) .14s;transform:rotate(-90deg)}.hamburger--vortex .hamburger-inner{transition-timing-function:cubic-bezier(.19,1,.22,1);transition-duration:.3s}.hamburger--vortex .hamburger-inner:after,.hamburger--vortex .hamburger-inner:before{transition-delay:.1s;transition-timing-function:linear;transition-duration:0s}.hamburger--vortex .hamburger-inner:before{transition-property:top,opacity}.hamburger--vortex .hamburger-inner:after{transition-property:bottom,transform}.hamburger--vortex.is-active .hamburger-inner{transition-timing-function:cubic-bezier(.19,1,.22,1);transform:rotate(765deg)}.hamburger--vortex.is-active .hamburger-inner:after,.hamburger--vortex.is-active .hamburger-inner:before{transition-delay:0s}.hamburger--vortex.is-active .hamburger-inner:before{top:0;opacity:0}.hamburger--vortex.is-active .hamburger-inner:after{bottom:0;transform:rotate(90deg)}.hamburger--vortex-r .hamburger-inner{transition-timing-function:cubic-bezier(.19,1,.22,1);transition-duration:.3s}.hamburger--vortex-r .hamburger-inner:after,.hamburger--vortex-r .hamburger-inner:before{transition-delay:.1s;transition-timing-function:linear;transition-duration:0s}.hamburger--vortex-r .hamburger-inner:before{transition-property:top,opacity}.hamburger--vortex-r .hamburger-inner:after{transition-property:bottom,transform}.hamburger--vortex-r.is-active .hamburger-inner{transition-timing-function:cubic-bezier(.19,1,.22,1);transform:rotate(-765deg)}.hamburger--vortex-r.is-active .hamburger-inner:after,.hamburger--vortex-r.is-active .hamburger-inner:before{transition-delay:0s}.hamburger--vortex-r.is-active .hamburger-inner:before{top:0;opacity:0}.hamburger--vortex-r.is-active .hamburger-inner:after{bottom:0;transform:rotate(-90deg)} \ No newline at end of file diff --git a/public/vendor/dat.gui.js b/public/vendor/dat.gui.js new file mode 100644 index 000000000..5c42637d6 --- /dev/null +++ b/public/vendor/dat.gui.js @@ -0,0 +1,2537 @@ +/** + * dat-gui JavaScript Controller Library + * http://code.google.com/p/dat-gui + * + * Copyright 2011 Data Arts Team, Google Creative Lab + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + */ + +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (factory((global.dat = {}))); +}(this, (function (exports) { 'use strict'; + + function ___$insertStyle(css) { + if (!css) { + return; + } + if (typeof window === 'undefined') { + return; + } + + var style = document.createElement('style'); + + style.setAttribute('type', 'text/css'); + style.innerHTML = css; + document.head.appendChild(style); + + return css; + } + + function colorToString (color, forceCSSHex) { + var colorFormat = color.__state.conversionName.toString(); + var r = Math.round(color.r); + var g = Math.round(color.g); + var b = Math.round(color.b); + var a = color.a; + var h = Math.round(color.h); + var s = color.s.toFixed(1); + var v = color.v.toFixed(1); + if (forceCSSHex || colorFormat === 'THREE_CHAR_HEX' || colorFormat === 'SIX_CHAR_HEX') { + var str = color.hex.toString(16); + while (str.length < 6) { + str = '0' + str; + } + return '#' + str; + } else if (colorFormat === 'CSS_RGB') { + return 'rgb(' + r + ',' + g + ',' + b + ')'; + } else if (colorFormat === 'CSS_RGBA') { + return 'rgba(' + r + ',' + g + ',' + b + ',' + a + ')'; + } else if (colorFormat === 'HEX') { + return '0x' + color.hex.toString(16); + } else if (colorFormat === 'RGB_ARRAY') { + return '[' + r + ',' + g + ',' + b + ']'; + } else if (colorFormat === 'RGBA_ARRAY') { + return '[' + r + ',' + g + ',' + b + ',' + a + ']'; + } else if (colorFormat === 'RGB_OBJ') { + return '{r:' + r + ',g:' + g + ',b:' + b + '}'; + } else if (colorFormat === 'RGBA_OBJ') { + return '{r:' + r + ',g:' + g + ',b:' + b + ',a:' + a + '}'; + } else if (colorFormat === 'HSV_OBJ') { + return '{h:' + h + ',s:' + s + ',v:' + v + '}'; + } else if (colorFormat === 'HSVA_OBJ') { + return '{h:' + h + ',s:' + s + ',v:' + v + ',a:' + a + '}'; + } + return 'unknown format'; + } + + var ARR_EACH = Array.prototype.forEach; + var ARR_SLICE = Array.prototype.slice; + var Common = { + BREAK: {}, + extend: function extend(target) { + this.each(ARR_SLICE.call(arguments, 1), function (obj) { + var keys = this.isObject(obj) ? Object.keys(obj) : []; + keys.forEach(function (key) { + if (!this.isUndefined(obj[key])) { + target[key] = obj[key]; + } + }.bind(this)); + }, this); + return target; + }, + defaults: function defaults(target) { + this.each(ARR_SLICE.call(arguments, 1), function (obj) { + var keys = this.isObject(obj) ? Object.keys(obj) : []; + keys.forEach(function (key) { + if (this.isUndefined(target[key])) { + target[key] = obj[key]; + } + }.bind(this)); + }, this); + return target; + }, + compose: function compose() { + var toCall = ARR_SLICE.call(arguments); + return function () { + var args = ARR_SLICE.call(arguments); + for (var i = toCall.length - 1; i >= 0; i--) { + args = [toCall[i].apply(this, args)]; + } + return args[0]; + }; + }, + each: function each(obj, itr, scope) { + if (!obj) { + return; + } + if (ARR_EACH && obj.forEach && obj.forEach === ARR_EACH) { + obj.forEach(itr, scope); + } else if (obj.length === obj.length + 0) { + var key = void 0; + var l = void 0; + for (key = 0, l = obj.length; key < l; key++) { + if (key in obj && itr.call(scope, obj[key], key) === this.BREAK) { + return; + } + } + } else { + for (var _key in obj) { + if (itr.call(scope, obj[_key], _key) === this.BREAK) { + return; + } + } + } + }, + defer: function defer(fnc) { + setTimeout(fnc, 0); + }, + debounce: function debounce(func, threshold, callImmediately) { + var timeout = void 0; + return function () { + var obj = this; + var args = arguments; + function delayed() { + timeout = null; + if (!callImmediately) func.apply(obj, args); + } + var callNow = callImmediately || !timeout; + clearTimeout(timeout); + timeout = setTimeout(delayed, threshold); + if (callNow) { + func.apply(obj, args); + } + }; + }, + toArray: function toArray(obj) { + if (obj.toArray) return obj.toArray(); + return ARR_SLICE.call(obj); + }, + isUndefined: function isUndefined(obj) { + return obj === undefined; + }, + isNull: function isNull(obj) { + return obj === null; + }, + isNaN: function (_isNaN) { + function isNaN(_x) { + return _isNaN.apply(this, arguments); + } + isNaN.toString = function () { + return _isNaN.toString(); + }; + return isNaN; + }(function (obj) { + return isNaN(obj); + }), + isArray: Array.isArray || function (obj) { + return obj.constructor === Array; + }, + isObject: function isObject(obj) { + return obj === Object(obj); + }, + isNumber: function isNumber(obj) { + return obj === obj + 0; + }, + isString: function isString(obj) { + return obj === obj + ''; + }, + isBoolean: function isBoolean(obj) { + return obj === false || obj === true; + }, + isFunction: function isFunction(obj) { + return Object.prototype.toString.call(obj) === '[object Function]'; + } + }; + + var INTERPRETATIONS = [ + { + litmus: Common.isString, + conversions: { + THREE_CHAR_HEX: { + read: function read(original) { + var test = original.match(/^#([A-F0-9])([A-F0-9])([A-F0-9])$/i); + if (test === null) { + return false; + } + return { + space: 'HEX', + hex: parseInt('0x' + test[1].toString() + test[1].toString() + test[2].toString() + test[2].toString() + test[3].toString() + test[3].toString(), 0) + }; + }, + write: colorToString + }, + SIX_CHAR_HEX: { + read: function read(original) { + var test = original.match(/^#([A-F0-9]{6})$/i); + if (test === null) { + return false; + } + return { + space: 'HEX', + hex: parseInt('0x' + test[1].toString(), 0) + }; + }, + write: colorToString + }, + CSS_RGB: { + read: function read(original) { + var test = original.match(/^rgb\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/); + if (test === null) { + return false; + } + return { + space: 'RGB', + r: parseFloat(test[1]), + g: parseFloat(test[2]), + b: parseFloat(test[3]) + }; + }, + write: colorToString + }, + CSS_RGBA: { + read: function read(original) { + var test = original.match(/^rgba\(\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*,\s*(.+)\s*\)/); + if (test === null) { + return false; + } + return { + space: 'RGB', + r: parseFloat(test[1]), + g: parseFloat(test[2]), + b: parseFloat(test[3]), + a: parseFloat(test[4]) + }; + }, + write: colorToString + } + } + }, + { + litmus: Common.isNumber, + conversions: { + HEX: { + read: function read(original) { + return { + space: 'HEX', + hex: original, + conversionName: 'HEX' + }; + }, + write: function write(color) { + return color.hex; + } + } + } + }, + { + litmus: Common.isArray, + conversions: { + RGB_ARRAY: { + read: function read(original) { + if (original.length !== 3) { + return false; + } + return { + space: 'RGB', + r: original[0], + g: original[1], + b: original[2] + }; + }, + write: function write(color) { + return [color.r, color.g, color.b]; + } + }, + RGBA_ARRAY: { + read: function read(original) { + if (original.length !== 4) return false; + return { + space: 'RGB', + r: original[0], + g: original[1], + b: original[2], + a: original[3] + }; + }, + write: function write(color) { + return [color.r, color.g, color.b, color.a]; + } + } + } + }, + { + litmus: Common.isObject, + conversions: { + RGBA_OBJ: { + read: function read(original) { + if (Common.isNumber(original.r) && Common.isNumber(original.g) && Common.isNumber(original.b) && Common.isNumber(original.a)) { + return { + space: 'RGB', + r: original.r, + g: original.g, + b: original.b, + a: original.a + }; + } + return false; + }, + write: function write(color) { + return { + r: color.r, + g: color.g, + b: color.b, + a: color.a + }; + } + }, + RGB_OBJ: { + read: function read(original) { + if (Common.isNumber(original.r) && Common.isNumber(original.g) && Common.isNumber(original.b)) { + return { + space: 'RGB', + r: original.r, + g: original.g, + b: original.b + }; + } + return false; + }, + write: function write(color) { + return { + r: color.r, + g: color.g, + b: color.b + }; + } + }, + HSVA_OBJ: { + read: function read(original) { + if (Common.isNumber(original.h) && Common.isNumber(original.s) && Common.isNumber(original.v) && Common.isNumber(original.a)) { + return { + space: 'HSV', + h: original.h, + s: original.s, + v: original.v, + a: original.a + }; + } + return false; + }, + write: function write(color) { + return { + h: color.h, + s: color.s, + v: color.v, + a: color.a + }; + } + }, + HSV_OBJ: { + read: function read(original) { + if (Common.isNumber(original.h) && Common.isNumber(original.s) && Common.isNumber(original.v)) { + return { + space: 'HSV', + h: original.h, + s: original.s, + v: original.v + }; + } + return false; + }, + write: function write(color) { + return { + h: color.h, + s: color.s, + v: color.v + }; + } + } + } + }]; + var result = void 0; + var toReturn = void 0; + var interpret = function interpret() { + toReturn = false; + var original = arguments.length > 1 ? Common.toArray(arguments) : arguments[0]; + Common.each(INTERPRETATIONS, function (family) { + if (family.litmus(original)) { + Common.each(family.conversions, function (conversion, conversionName) { + result = conversion.read(original); + if (toReturn === false && result !== false) { + toReturn = result; + result.conversionName = conversionName; + result.conversion = conversion; + return Common.BREAK; + } + }); + return Common.BREAK; + } + }); + return toReturn; + }; + + var tmpComponent = void 0; + var ColorMath = { + hsv_to_rgb: function hsv_to_rgb(h, s, v) { + var hi = Math.floor(h / 60) % 6; + var f = h / 60 - Math.floor(h / 60); + var p = v * (1.0 - s); + var q = v * (1.0 - f * s); + var t = v * (1.0 - (1.0 - f) * s); + var c = [[v, t, p], [q, v, p], [p, v, t], [p, q, v], [t, p, v], [v, p, q]][hi]; + return { + r: c[0] * 255, + g: c[1] * 255, + b: c[2] * 255 + }; + }, + rgb_to_hsv: function rgb_to_hsv(r, g, b) { + var min = Math.min(r, g, b); + var max = Math.max(r, g, b); + var delta = max - min; + var h = void 0; + var s = void 0; + if (max !== 0) { + s = delta / max; + } else { + return { + h: NaN, + s: 0, + v: 0 + }; + } + if (r === max) { + h = (g - b) / delta; + } else if (g === max) { + h = 2 + (b - r) / delta; + } else { + h = 4 + (r - g) / delta; + } + h /= 6; + if (h < 0) { + h += 1; + } + return { + h: h * 360, + s: s, + v: max / 255 + }; + }, + rgb_to_hex: function rgb_to_hex(r, g, b) { + var hex = this.hex_with_component(0, 2, r); + hex = this.hex_with_component(hex, 1, g); + hex = this.hex_with_component(hex, 0, b); + return hex; + }, + component_from_hex: function component_from_hex(hex, componentIndex) { + return hex >> componentIndex * 8 & 0xFF; + }, + hex_with_component: function hex_with_component(hex, componentIndex, value) { + return value << (tmpComponent = componentIndex * 8) | hex & ~(0xFF << tmpComponent); + } + }; + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + + + + + + + + + + + + var classCallCheck = function (instance, Constructor) { + if (!(instance instanceof Constructor)) { + throw new TypeError("Cannot call a class as a function"); + } + }; + + var createClass = function () { + function defineProperties(target, props) { + for (var i = 0; i < props.length; i++) { + var descriptor = props[i]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) descriptor.writable = true; + Object.defineProperty(target, descriptor.key, descriptor); + } + } + + return function (Constructor, protoProps, staticProps) { + if (protoProps) defineProperties(Constructor.prototype, protoProps); + if (staticProps) defineProperties(Constructor, staticProps); + return Constructor; + }; + }(); + + + + + + + + var get = function get(object, property, receiver) { + if (object === null) object = Function.prototype; + var desc = Object.getOwnPropertyDescriptor(object, property); + + if (desc === undefined) { + var parent = Object.getPrototypeOf(object); + + if (parent === null) { + return undefined; + } else { + return get(parent, property, receiver); + } + } else if ("value" in desc) { + return desc.value; + } else { + var getter = desc.get; + + if (getter === undefined) { + return undefined; + } + + return getter.call(receiver); + } + }; + + var inherits = function (subClass, superClass) { + if (typeof superClass !== "function" && superClass !== null) { + throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); + } + + subClass.prototype = Object.create(superClass && superClass.prototype, { + constructor: { + value: subClass, + enumerable: false, + writable: true, + configurable: true + } + }); + if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; + }; + + + + + + + + + + + + var possibleConstructorReturn = function (self, call) { + if (!self) { + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); + } + + return call && (typeof call === "object" || typeof call === "function") ? call : self; + }; + + var Color = function () { + function Color() { + classCallCheck(this, Color); + this.__state = interpret.apply(this, arguments); + if (this.__state === false) { + throw new Error('Failed to interpret color arguments'); + } + this.__state.a = this.__state.a || 1; + } + createClass(Color, [{ + key: 'toString', + value: function toString() { + return colorToString(this); + } + }, { + key: 'toHexString', + value: function toHexString() { + return colorToString(this, true); + } + }, { + key: 'toOriginal', + value: function toOriginal() { + return this.__state.conversion.write(this); + } + }]); + return Color; + }(); + function defineRGBComponent(target, component, componentHexIndex) { + Object.defineProperty(target, component, { + get: function get$$1() { + if (this.__state.space === 'RGB') { + return this.__state[component]; + } + Color.recalculateRGB(this, component, componentHexIndex); + return this.__state[component]; + }, + set: function set$$1(v) { + if (this.__state.space !== 'RGB') { + Color.recalculateRGB(this, component, componentHexIndex); + this.__state.space = 'RGB'; + } + this.__state[component] = v; + } + }); + } + function defineHSVComponent(target, component) { + Object.defineProperty(target, component, { + get: function get$$1() { + if (this.__state.space === 'HSV') { + return this.__state[component]; + } + Color.recalculateHSV(this); + return this.__state[component]; + }, + set: function set$$1(v) { + if (this.__state.space !== 'HSV') { + Color.recalculateHSV(this); + this.__state.space = 'HSV'; + } + this.__state[component] = v; + } + }); + } + Color.recalculateRGB = function (color, component, componentHexIndex) { + if (color.__state.space === 'HEX') { + color.__state[component] = ColorMath.component_from_hex(color.__state.hex, componentHexIndex); + } else if (color.__state.space === 'HSV') { + Common.extend(color.__state, ColorMath.hsv_to_rgb(color.__state.h, color.__state.s, color.__state.v)); + } else { + throw new Error('Corrupted color state'); + } + }; + Color.recalculateHSV = function (color) { + var result = ColorMath.rgb_to_hsv(color.r, color.g, color.b); + Common.extend(color.__state, { + s: result.s, + v: result.v + }); + if (!Common.isNaN(result.h)) { + color.__state.h = result.h; + } else if (Common.isUndefined(color.__state.h)) { + color.__state.h = 0; + } + }; + Color.COMPONENTS = ['r', 'g', 'b', 'h', 's', 'v', 'hex', 'a']; + defineRGBComponent(Color.prototype, 'r', 2); + defineRGBComponent(Color.prototype, 'g', 1); + defineRGBComponent(Color.prototype, 'b', 0); + defineHSVComponent(Color.prototype, 'h'); + defineHSVComponent(Color.prototype, 's'); + defineHSVComponent(Color.prototype, 'v'); + Object.defineProperty(Color.prototype, 'a', { + get: function get$$1() { + return this.__state.a; + }, + set: function set$$1(v) { + this.__state.a = v; + } + }); + Object.defineProperty(Color.prototype, 'hex', { + get: function get$$1() { + if (!this.__state.space !== 'HEX') { + this.__state.hex = ColorMath.rgb_to_hex(this.r, this.g, this.b); + } + return this.__state.hex; + }, + set: function set$$1(v) { + this.__state.space = 'HEX'; + this.__state.hex = v; + } + }); + + var Controller = function () { + function Controller(object, property) { + classCallCheck(this, Controller); + this.initialValue = object[property]; + this.domElement = document.createElement('div'); + this.object = object; + this.property = property; + this.__onChange = undefined; + this.__onFinishChange = undefined; + } + createClass(Controller, [{ + key: 'onChange', + value: function onChange(fnc) { + this.__onChange = fnc; + return this; + } + }, { + key: 'onFinishChange', + value: function onFinishChange(fnc) { + this.__onFinishChange = fnc; + return this; + } + }, { + key: 'setValue', + value: function setValue(newValue) { + this.object[this.property] = newValue; + if (this.__onChange) { + this.__onChange.call(this, newValue); + } + this.updateDisplay(); + return this; + } + }, { + key: 'getValue', + value: function getValue() { + return this.object[this.property]; + } + }, { + key: 'updateDisplay', + value: function updateDisplay() { + return this; + } + }, { + key: 'isModified', + value: function isModified() { + return this.initialValue !== this.getValue(); + } + }]); + return Controller; + }(); + + var EVENT_MAP = { + HTMLEvents: ['change'], + MouseEvents: ['click', 'mousemove', 'mousedown', 'mouseup', 'mouseover'], + KeyboardEvents: ['keydown'] + }; + var EVENT_MAP_INV = {}; + Common.each(EVENT_MAP, function (v, k) { + Common.each(v, function (e) { + EVENT_MAP_INV[e] = k; + }); + }); + var CSS_VALUE_PIXELS = /(\d+(\.\d+)?)px/; + function cssValueToPixels(val) { + if (val === '0' || Common.isUndefined(val)) { + return 0; + } + var match = val.match(CSS_VALUE_PIXELS); + if (!Common.isNull(match)) { + return parseFloat(match[1]); + } + return 0; + } + var dom = { + makeSelectable: function makeSelectable(elem, selectable) { + if (elem === undefined || elem.style === undefined) return; + elem.onselectstart = selectable ? function () { + return false; + } : function () {}; + elem.style.MozUserSelect = selectable ? 'auto' : 'none'; + elem.style.KhtmlUserSelect = selectable ? 'auto' : 'none'; + elem.unselectable = selectable ? 'on' : 'off'; + }, + makeFullscreen: function makeFullscreen(elem, hor, vert) { + var vertical = vert; + var horizontal = hor; + if (Common.isUndefined(horizontal)) { + horizontal = true; + } + if (Common.isUndefined(vertical)) { + vertical = true; + } + elem.style.position = 'absolute'; + if (horizontal) { + elem.style.left = 0; + elem.style.right = 0; + } + if (vertical) { + elem.style.top = 0; + elem.style.bottom = 0; + } + }, + fakeEvent: function fakeEvent(elem, eventType, pars, aux) { + var params = pars || {}; + var className = EVENT_MAP_INV[eventType]; + if (!className) { + throw new Error('Event type ' + eventType + ' not supported.'); + } + var evt = document.createEvent(className); + switch (className) { + case 'MouseEvents': + { + var clientX = params.x || params.clientX || 0; + var clientY = params.y || params.clientY || 0; + evt.initMouseEvent(eventType, params.bubbles || false, params.cancelable || true, window, params.clickCount || 1, 0, + 0, + clientX, + clientY, + false, false, false, false, 0, null); + break; + } + case 'KeyboardEvents': + { + var init = evt.initKeyboardEvent || evt.initKeyEvent; + Common.defaults(params, { + cancelable: true, + ctrlKey: false, + altKey: false, + shiftKey: false, + metaKey: false, + keyCode: undefined, + charCode: undefined + }); + init(eventType, params.bubbles || false, params.cancelable, window, params.ctrlKey, params.altKey, params.shiftKey, params.metaKey, params.keyCode, params.charCode); + break; + } + default: + { + evt.initEvent(eventType, params.bubbles || false, params.cancelable || true); + break; + } + } + Common.defaults(evt, aux); + elem.dispatchEvent(evt); + }, + bind: function bind(elem, event, func, newBool) { + var bool = newBool || false; + if (elem.addEventListener) { + elem.addEventListener(event, func, bool); + } else if (elem.attachEvent) { + elem.attachEvent('on' + event, func); + } + return dom; + }, + unbind: function unbind(elem, event, func, newBool) { + var bool = newBool || false; + if (elem.removeEventListener) { + elem.removeEventListener(event, func, bool); + } else if (elem.detachEvent) { + elem.detachEvent('on' + event, func); + } + return dom; + }, + addClass: function addClass(elem, className) { + if (elem.className === undefined) { + elem.className = className; + } else if (elem.className !== className) { + var classes = elem.className.split(/ +/); + if (classes.indexOf(className) === -1) { + classes.push(className); + elem.className = classes.join(' ').replace(/^\s+/, '').replace(/\s+$/, ''); + } + } + return dom; + }, + removeClass: function removeClass(elem, className) { + if (className) { + if (elem.className === className) { + elem.removeAttribute('class'); + } else { + var classes = elem.className.split(/ +/); + var index = classes.indexOf(className); + if (index !== -1) { + classes.splice(index, 1); + elem.className = classes.join(' '); + } + } + } else { + elem.className = undefined; + } + return dom; + }, + hasClass: function hasClass(elem, className) { + return new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)').test(elem.className) || false; + }, + getWidth: function getWidth(elem) { + var style = getComputedStyle(elem); + return cssValueToPixels(style['border-left-width']) + cssValueToPixels(style['border-right-width']) + cssValueToPixels(style['padding-left']) + cssValueToPixels(style['padding-right']) + cssValueToPixels(style.width); + }, + getHeight: function getHeight(elem) { + var style = getComputedStyle(elem); + return cssValueToPixels(style['border-top-width']) + cssValueToPixels(style['border-bottom-width']) + cssValueToPixels(style['padding-top']) + cssValueToPixels(style['padding-bottom']) + cssValueToPixels(style.height); + }, + getOffset: function getOffset(el) { + var elem = el; + var offset = { left: 0, top: 0 }; + if (elem.offsetParent) { + do { + offset.left += elem.offsetLeft; + offset.top += elem.offsetTop; + elem = elem.offsetParent; + } while (elem); + } + return offset; + }, + isActive: function isActive(elem) { + return elem === document.activeElement && (elem.type || elem.href); + } + }; + + var BooleanController = function (_Controller) { + inherits(BooleanController, _Controller); + function BooleanController(object, property) { + classCallCheck(this, BooleanController); + var _this2 = possibleConstructorReturn(this, (BooleanController.__proto__ || Object.getPrototypeOf(BooleanController)).call(this, object, property)); + var _this = _this2; + _this2.__prev = _this2.getValue(); + _this2.__checkbox = document.createElement('input'); + _this2.__checkbox.setAttribute('type', 'checkbox'); + function onChange() { + _this.setValue(!_this.__prev); + } + dom.bind(_this2.__checkbox, 'change', onChange, false); + _this2.domElement.appendChild(_this2.__checkbox); + _this2.updateDisplay(); + return _this2; + } + createClass(BooleanController, [{ + key: 'setValue', + value: function setValue(v) { + var toReturn = get(BooleanController.prototype.__proto__ || Object.getPrototypeOf(BooleanController.prototype), 'setValue', this).call(this, v); + if (this.__onFinishChange) { + this.__onFinishChange.call(this, this.getValue()); + } + this.__prev = this.getValue(); + return toReturn; + } + }, { + key: 'updateDisplay', + value: function updateDisplay() { + if (this.getValue() === true) { + this.__checkbox.setAttribute('checked', 'checked'); + this.__checkbox.checked = true; + this.__prev = true; + } else { + this.__checkbox.checked = false; + this.__prev = false; + } + return get(BooleanController.prototype.__proto__ || Object.getPrototypeOf(BooleanController.prototype), 'updateDisplay', this).call(this); + } + }]); + return BooleanController; + }(Controller); + + var OptionController = function (_Controller) { + inherits(OptionController, _Controller); + function OptionController(object, property, opts) { + classCallCheck(this, OptionController); + var _this2 = possibleConstructorReturn(this, (OptionController.__proto__ || Object.getPrototypeOf(OptionController)).call(this, object, property)); + var options = opts; + var _this = _this2; + _this2.__select = document.createElement('select'); + if (Common.isArray(options)) { + var map = {}; + Common.each(options, function (element) { + map[element] = element; + }); + options = map; + } + Common.each(options, function (value, key) { + var opt = document.createElement('option'); + opt.innerHTML = key; + opt.setAttribute('value', value); + _this.__select.appendChild(opt); + }); + _this2.updateDisplay(); + dom.bind(_this2.__select, 'change', function () { + var desiredValue = this.options[this.selectedIndex].value; + _this.setValue(desiredValue); + }); + _this2.domElement.appendChild(_this2.__select); + return _this2; + } + createClass(OptionController, [{ + key: 'setValue', + value: function setValue(v) { + var toReturn = get(OptionController.prototype.__proto__ || Object.getPrototypeOf(OptionController.prototype), 'setValue', this).call(this, v); + if (this.__onFinishChange) { + this.__onFinishChange.call(this, this.getValue()); + } + return toReturn; + } + }, { + key: 'updateDisplay', + value: function updateDisplay() { + if (dom.isActive(this.__select)) return this; + this.__select.value = this.getValue(); + return get(OptionController.prototype.__proto__ || Object.getPrototypeOf(OptionController.prototype), 'updateDisplay', this).call(this); + } + }]); + return OptionController; + }(Controller); + + var StringController = function (_Controller) { + inherits(StringController, _Controller); + function StringController(object, property) { + classCallCheck(this, StringController); + var _this2 = possibleConstructorReturn(this, (StringController.__proto__ || Object.getPrototypeOf(StringController)).call(this, object, property)); + var _this = _this2; + function onChange() { + _this.setValue(_this.__input.value); + } + function onBlur() { + if (_this.__onFinishChange) { + _this.__onFinishChange.call(_this, _this.getValue()); + } + } + _this2.__input = document.createElement('input'); + _this2.__input.setAttribute('type', 'text'); + dom.bind(_this2.__input, 'keyup', onChange); + dom.bind(_this2.__input, 'change', onChange); + dom.bind(_this2.__input, 'blur', onBlur); + dom.bind(_this2.__input, 'keydown', function (e) { + if (e.keyCode === 13) { + this.blur(); + } + }); + _this2.updateDisplay(); + _this2.domElement.appendChild(_this2.__input); + return _this2; + } + createClass(StringController, [{ + key: 'updateDisplay', + value: function updateDisplay() { + if (!dom.isActive(this.__input)) { + this.__input.value = this.getValue(); + } + return get(StringController.prototype.__proto__ || Object.getPrototypeOf(StringController.prototype), 'updateDisplay', this).call(this); + } + }]); + return StringController; + }(Controller); + + function numDecimals(x) { + var _x = x.toString(); + if (_x.indexOf('.') > -1) { + return _x.length - _x.indexOf('.') - 1; + } + return 0; + } + var NumberController = function (_Controller) { + inherits(NumberController, _Controller); + function NumberController(object, property, params) { + classCallCheck(this, NumberController); + var _this = possibleConstructorReturn(this, (NumberController.__proto__ || Object.getPrototypeOf(NumberController)).call(this, object, property)); + var _params = params || {}; + _this.__min = _params.min; + _this.__max = _params.max; + _this.__step = _params.step; + if (Common.isUndefined(_this.__step)) { + if (_this.initialValue === 0) { + _this.__impliedStep = 1; + } else { + _this.__impliedStep = Math.pow(10, Math.floor(Math.log(Math.abs(_this.initialValue)) / Math.LN10)) / 10; + } + } else { + _this.__impliedStep = _this.__step; + } + _this.__precision = numDecimals(_this.__impliedStep); + return _this; + } + createClass(NumberController, [{ + key: 'setValue', + value: function setValue(v) { + var _v = v; + if (this.__min !== undefined && _v < this.__min) { + _v = this.__min; + } else if (this.__max !== undefined && _v > this.__max) { + _v = this.__max; + } + if (this.__step !== undefined && _v % this.__step !== 0) { + _v = Math.round(_v / this.__step) * this.__step; + } + return get(NumberController.prototype.__proto__ || Object.getPrototypeOf(NumberController.prototype), 'setValue', this).call(this, _v); + } + }, { + key: 'min', + value: function min(minValue) { + this.__min = minValue; + return this; + } + }, { + key: 'max', + value: function max(maxValue) { + this.__max = maxValue; + return this; + } + }, { + key: 'step', + value: function step(stepValue) { + this.__step = stepValue; + this.__impliedStep = stepValue; + this.__precision = numDecimals(stepValue); + return this; + } + }]); + return NumberController; + }(Controller); + + function roundToDecimal(value, decimals) { + var tenTo = Math.pow(10, decimals); + return Math.round(value * tenTo) / tenTo; + } + var NumberControllerBox = function (_NumberController) { + inherits(NumberControllerBox, _NumberController); + function NumberControllerBox(object, property, params) { + classCallCheck(this, NumberControllerBox); + var _this2 = possibleConstructorReturn(this, (NumberControllerBox.__proto__ || Object.getPrototypeOf(NumberControllerBox)).call(this, object, property, params)); + _this2.__truncationSuspended = false; + var _this = _this2; + var prevY = void 0; + function onChange() { + var attempted = parseFloat(_this.__input.value); + if (!Common.isNaN(attempted)) { + _this.setValue(attempted); + } + } + function onFinish() { + if (_this.__onFinishChange) { + _this.__onFinishChange.call(_this, _this.getValue()); + } + } + function onBlur() { + onFinish(); + } + function onMouseDrag(e) { + var diff = prevY - e.clientY; + _this.setValue(_this.getValue() + diff * _this.__impliedStep); + prevY = e.clientY; + } + function onMouseUp() { + dom.unbind(window, 'mousemove', onMouseDrag); + dom.unbind(window, 'mouseup', onMouseUp); + onFinish(); + } + function onMouseDown(e) { + dom.bind(window, 'mousemove', onMouseDrag); + dom.bind(window, 'mouseup', onMouseUp); + prevY = e.clientY; + } + _this2.__input = document.createElement('input'); + _this2.__input.setAttribute('type', 'text'); + dom.bind(_this2.__input, 'change', onChange); + dom.bind(_this2.__input, 'blur', onBlur); + dom.bind(_this2.__input, 'mousedown', onMouseDown); + dom.bind(_this2.__input, 'keydown', function (e) { + if (e.keyCode === 13) { + _this.__truncationSuspended = true; + this.blur(); + _this.__truncationSuspended = false; + onFinish(); + } + }); + _this2.updateDisplay(); + _this2.domElement.appendChild(_this2.__input); + return _this2; + } + createClass(NumberControllerBox, [{ + key: 'updateDisplay', + value: function updateDisplay() { + this.__input.value = this.__truncationSuspended ? this.getValue() : roundToDecimal(this.getValue(), this.__precision); + return get(NumberControllerBox.prototype.__proto__ || Object.getPrototypeOf(NumberControllerBox.prototype), 'updateDisplay', this).call(this); + } + }]); + return NumberControllerBox; + }(NumberController); + + function map(v, i1, i2, o1, o2) { + return o1 + (o2 - o1) * ((v - i1) / (i2 - i1)); + } + var NumberControllerSlider = function (_NumberController) { + inherits(NumberControllerSlider, _NumberController); + function NumberControllerSlider(object, property, min, max, step) { + classCallCheck(this, NumberControllerSlider); + var _this2 = possibleConstructorReturn(this, (NumberControllerSlider.__proto__ || Object.getPrototypeOf(NumberControllerSlider)).call(this, object, property, { min: min, max: max, step: step })); + var _this = _this2; + _this2.__background = document.createElement('div'); + _this2.__foreground = document.createElement('div'); + dom.bind(_this2.__background, 'mousedown', onMouseDown); + dom.bind(_this2.__background, 'touchstart', onTouchStart); + dom.addClass(_this2.__background, 'slider'); + dom.addClass(_this2.__foreground, 'slider-fg'); + function onMouseDown(e) { + document.activeElement.blur(); + dom.bind(window, 'mousemove', onMouseDrag); + dom.bind(window, 'mouseup', onMouseUp); + onMouseDrag(e); + } + function onMouseDrag(e) { + e.preventDefault(); + var bgRect = _this.__background.getBoundingClientRect(); + _this.setValue(map(e.clientX, bgRect.left, bgRect.right, _this.__min, _this.__max)); + return false; + } + function onMouseUp() { + dom.unbind(window, 'mousemove', onMouseDrag); + dom.unbind(window, 'mouseup', onMouseUp); + if (_this.__onFinishChange) { + _this.__onFinishChange.call(_this, _this.getValue()); + } + } + function onTouchStart(e) { + if (e.touches.length !== 1) { + return; + } + dom.bind(window, 'touchmove', onTouchMove); + dom.bind(window, 'touchend', onTouchEnd); + onTouchMove(e); + } + function onTouchMove(e) { + var clientX = e.touches[0].clientX; + var bgRect = _this.__background.getBoundingClientRect(); + _this.setValue(map(clientX, bgRect.left, bgRect.right, _this.__min, _this.__max)); + } + function onTouchEnd() { + dom.unbind(window, 'touchmove', onTouchMove); + dom.unbind(window, 'touchend', onTouchEnd); + if (_this.__onFinishChange) { + _this.__onFinishChange.call(_this, _this.getValue()); + } + } + _this2.updateDisplay(); + _this2.__background.appendChild(_this2.__foreground); + _this2.domElement.appendChild(_this2.__background); + return _this2; + } + createClass(NumberControllerSlider, [{ + key: 'updateDisplay', + value: function updateDisplay() { + var pct = (this.getValue() - this.__min) / (this.__max - this.__min); + this.__foreground.style.width = pct * 100 + '%'; + return get(NumberControllerSlider.prototype.__proto__ || Object.getPrototypeOf(NumberControllerSlider.prototype), 'updateDisplay', this).call(this); + } + }]); + return NumberControllerSlider; + }(NumberController); + + var FunctionController = function (_Controller) { + inherits(FunctionController, _Controller); + function FunctionController(object, property, text) { + classCallCheck(this, FunctionController); + var _this2 = possibleConstructorReturn(this, (FunctionController.__proto__ || Object.getPrototypeOf(FunctionController)).call(this, object, property)); + var _this = _this2; + _this2.__button = document.createElement('div'); + _this2.__button.innerHTML = text === undefined ? 'Fire' : text; + dom.bind(_this2.__button, 'click', function (e) { + e.preventDefault(); + _this.fire(); + return false; + }); + dom.addClass(_this2.__button, 'button'); + _this2.domElement.appendChild(_this2.__button); + return _this2; + } + createClass(FunctionController, [{ + key: 'fire', + value: function fire() { + if (this.__onChange) { + this.__onChange.call(this); + } + this.getValue().call(this.object); + if (this.__onFinishChange) { + this.__onFinishChange.call(this, this.getValue()); + } + } + }]); + return FunctionController; + }(Controller); + + var ColorController = function (_Controller) { + inherits(ColorController, _Controller); + function ColorController(object, property) { + classCallCheck(this, ColorController); + var _this2 = possibleConstructorReturn(this, (ColorController.__proto__ || Object.getPrototypeOf(ColorController)).call(this, object, property)); + _this2.__color = new Color(_this2.getValue()); + _this2.__temp = new Color(0); + var _this = _this2; + _this2.domElement = document.createElement('div'); + dom.makeSelectable(_this2.domElement, false); + _this2.__selector = document.createElement('div'); + _this2.__selector.className = 'selector'; + _this2.__saturation_field = document.createElement('div'); + _this2.__saturation_field.className = 'saturation-field'; + _this2.__field_knob = document.createElement('div'); + _this2.__field_knob.className = 'field-knob'; + _this2.__field_knob_border = '2px solid '; + _this2.__hue_knob = document.createElement('div'); + _this2.__hue_knob.className = 'hue-knob'; + _this2.__hue_field = document.createElement('div'); + _this2.__hue_field.className = 'hue-field'; + _this2.__input = document.createElement('input'); + _this2.__input.type = 'text'; + _this2.__input_textShadow = '0 1px 1px '; + dom.bind(_this2.__input, 'keydown', function (e) { + if (e.keyCode === 13) { + onBlur.call(this); + } + }); + dom.bind(_this2.__input, 'blur', onBlur); + dom.bind(_this2.__selector, 'mousedown', function () { + dom.addClass(this, 'drag').bind(window, 'mouseup', function () { + dom.removeClass(_this.__selector, 'drag'); + }); + }); + dom.bind(_this2.__selector, 'touchstart', function () { + dom.addClass(this, 'drag').bind(window, 'touchend', function () { + dom.removeClass(_this.__selector, 'drag'); + }); + }); + var valueField = document.createElement('div'); + Common.extend(_this2.__selector.style, { + width: '122px', + height: '102px', + padding: '3px', + backgroundColor: '#222', + boxShadow: '0px 1px 3px rgba(0,0,0,0.3)' + }); + Common.extend(_this2.__field_knob.style, { + position: 'absolute', + width: '12px', + height: '12px', + border: _this2.__field_knob_border + (_this2.__color.v < 0.5 ? '#fff' : '#000'), + boxShadow: '0px 1px 3px rgba(0,0,0,0.5)', + borderRadius: '12px', + zIndex: 1 + }); + Common.extend(_this2.__hue_knob.style, { + position: 'absolute', + width: '15px', + height: '2px', + borderRight: '4px solid #fff', + zIndex: 1 + }); + Common.extend(_this2.__saturation_field.style, { + width: '100px', + height: '100px', + border: '1px solid #555', + marginRight: '3px', + display: 'inline-block', + cursor: 'pointer' + }); + Common.extend(valueField.style, { + width: '100%', + height: '100%', + background: 'none' + }); + linearGradient(valueField, 'top', 'rgba(0,0,0,0)', '#000'); + Common.extend(_this2.__hue_field.style, { + width: '15px', + height: '100px', + border: '1px solid #555', + cursor: 'ns-resize', + position: 'absolute', + top: '3px', + right: '3px' + }); + hueGradient(_this2.__hue_field); + Common.extend(_this2.__input.style, { + outline: 'none', + textAlign: 'center', + color: '#fff', + border: 0, + fontWeight: 'bold', + textShadow: _this2.__input_textShadow + 'rgba(0,0,0,0.7)' + }); + dom.bind(_this2.__saturation_field, 'mousedown', fieldDown); + dom.bind(_this2.__saturation_field, 'touchstart', fieldDown); + dom.bind(_this2.__field_knob, 'mousedown', fieldDown); + dom.bind(_this2.__field_knob, 'touchstart', fieldDown); + dom.bind(_this2.__hue_field, 'mousedown', fieldDownH); + dom.bind(_this2.__hue_field, 'touchstart', fieldDownH); + function fieldDown(e) { + setSV(e); + dom.bind(window, 'mousemove', setSV); + dom.bind(window, 'touchmove', setSV); + dom.bind(window, 'mouseup', fieldUpSV); + dom.bind(window, 'touchend', fieldUpSV); + } + function fieldDownH(e) { + setH(e); + dom.bind(window, 'mousemove', setH); + dom.bind(window, 'touchmove', setH); + dom.bind(window, 'mouseup', fieldUpH); + dom.bind(window, 'touchend', fieldUpH); + } + function fieldUpSV() { + dom.unbind(window, 'mousemove', setSV); + dom.unbind(window, 'touchmove', setSV); + dom.unbind(window, 'mouseup', fieldUpSV); + dom.unbind(window, 'touchend', fieldUpSV); + onFinish(); + } + function fieldUpH() { + dom.unbind(window, 'mousemove', setH); + dom.unbind(window, 'touchmove', setH); + dom.unbind(window, 'mouseup', fieldUpH); + dom.unbind(window, 'touchend', fieldUpH); + onFinish(); + } + function onBlur() { + var i = interpret(this.value); + if (i !== false) { + _this.__color.__state = i; + _this.setValue(_this.__color.toOriginal()); + } else { + this.value = _this.__color.toString(); + } + } + function onFinish() { + if (_this.__onFinishChange) { + _this.__onFinishChange.call(_this, _this.__color.toOriginal()); + } + } + _this2.__saturation_field.appendChild(valueField); + _this2.__selector.appendChild(_this2.__field_knob); + _this2.__selector.appendChild(_this2.__saturation_field); + _this2.__selector.appendChild(_this2.__hue_field); + _this2.__hue_field.appendChild(_this2.__hue_knob); + _this2.domElement.appendChild(_this2.__input); + _this2.domElement.appendChild(_this2.__selector); + _this2.updateDisplay(); + function setSV(e) { + if (e.type.indexOf('touch') === -1) { + e.preventDefault(); + } + var fieldRect = _this.__saturation_field.getBoundingClientRect(); + var _ref = e.touches && e.touches[0] || e, + clientX = _ref.clientX, + clientY = _ref.clientY; + var s = (clientX - fieldRect.left) / (fieldRect.right - fieldRect.left); + var v = 1 - (clientY - fieldRect.top) / (fieldRect.bottom - fieldRect.top); + if (v > 1) { + v = 1; + } else if (v < 0) { + v = 0; + } + if (s > 1) { + s = 1; + } else if (s < 0) { + s = 0; + } + _this.__color.v = v; + _this.__color.s = s; + _this.setValue(_this.__color.toOriginal()); + return false; + } + function setH(e) { + if (e.type.indexOf('touch') === -1) { + e.preventDefault(); + } + var fieldRect = _this.__hue_field.getBoundingClientRect(); + var _ref2 = e.touches && e.touches[0] || e, + clientY = _ref2.clientY; + var h = 1 - (clientY - fieldRect.top) / (fieldRect.bottom - fieldRect.top); + if (h > 1) { + h = 1; + } else if (h < 0) { + h = 0; + } + _this.__color.h = h * 360; + _this.setValue(_this.__color.toOriginal()); + return false; + } + return _this2; + } + createClass(ColorController, [{ + key: 'updateDisplay', + value: function updateDisplay() { + var i = interpret(this.getValue()); + if (i !== false) { + var mismatch = false; + Common.each(Color.COMPONENTS, function (component) { + if (!Common.isUndefined(i[component]) && !Common.isUndefined(this.__color.__state[component]) && i[component] !== this.__color.__state[component]) { + mismatch = true; + return {}; + } + }, this); + if (mismatch) { + Common.extend(this.__color.__state, i); + } + } + Common.extend(this.__temp.__state, this.__color.__state); + this.__temp.a = 1; + var flip = this.__color.v < 0.5 || this.__color.s > 0.5 ? 255 : 0; + var _flip = 255 - flip; + Common.extend(this.__field_knob.style, { + marginLeft: 100 * this.__color.s - 7 + 'px', + marginTop: 100 * (1 - this.__color.v) - 7 + 'px', + backgroundColor: this.__temp.toHexString(), + border: this.__field_knob_border + 'rgb(' + flip + ',' + flip + ',' + flip + ')' + }); + this.__hue_knob.style.marginTop = (1 - this.__color.h / 360) * 100 + 'px'; + this.__temp.s = 1; + this.__temp.v = 1; + linearGradient(this.__saturation_field, 'left', '#fff', this.__temp.toHexString()); + this.__input.value = this.__color.toString(); + Common.extend(this.__input.style, { + backgroundColor: this.__color.toHexString(), + color: 'rgb(' + flip + ',' + flip + ',' + flip + ')', + textShadow: this.__input_textShadow + 'rgba(' + _flip + ',' + _flip + ',' + _flip + ',.7)' + }); + } + }]); + return ColorController; + }(Controller); + var vendors = ['-moz-', '-o-', '-webkit-', '-ms-', '']; + function linearGradient(elem, x, a, b) { + elem.style.background = ''; + Common.each(vendors, function (vendor) { + elem.style.cssText += 'background: ' + vendor + 'linear-gradient(' + x + ', ' + a + ' 0%, ' + b + ' 100%); '; + }); + } + function hueGradient(elem) { + elem.style.background = ''; + elem.style.cssText += 'background: -moz-linear-gradient(top, #ff0000 0%, #ff00ff 17%, #0000ff 34%, #00ffff 50%, #00ff00 67%, #ffff00 84%, #ff0000 100%);'; + elem.style.cssText += 'background: -webkit-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'; + elem.style.cssText += 'background: -o-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'; + elem.style.cssText += 'background: -ms-linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'; + elem.style.cssText += 'background: linear-gradient(top, #ff0000 0%,#ff00ff 17%,#0000ff 34%,#00ffff 50%,#00ff00 67%,#ffff00 84%,#ff0000 100%);'; + } + + var css = { + load: function load(url, indoc) { + var doc = indoc || document; + var link = doc.createElement('link'); + link.type = 'text/css'; + link.rel = 'stylesheet'; + link.href = url; + doc.getElementsByTagName('head')[0].appendChild(link); + }, + inject: function inject(cssContent, indoc) { + var doc = indoc || document; + var injected = document.createElement('style'); + injected.type = 'text/css'; + injected.innerHTML = cssContent; + var head = doc.getElementsByTagName('head')[0]; + try { + head.appendChild(injected); + } catch (e) { + } + } + }; + + var saveDialogContents = "
    \n\n Here's the new load parameter for your GUI's constructor:\n\n \n\n
    \n\n Automatically save\n values to localStorage on exit.\n\n
    The values saved to localStorage will\n override those passed to dat.GUI's constructor. This makes it\n easier to work incrementally, but localStorage is fragile,\n and your friends may not see the same values you do.\n\n
    \n\n
    \n\n
    "; + + var ControllerFactory = function ControllerFactory(object, property) { + var initialValue = object[property]; + if (Common.isArray(arguments[2]) || Common.isObject(arguments[2])) { + return new OptionController(object, property, arguments[2]); + } + if (Common.isNumber(initialValue)) { + if (Common.isNumber(arguments[2]) && Common.isNumber(arguments[3])) { + if (Common.isNumber(arguments[4])) { + return new NumberControllerSlider(object, property, arguments[2], arguments[3], arguments[4]); + } + return new NumberControllerSlider(object, property, arguments[2], arguments[3]); + } + if (Common.isNumber(arguments[4])) { + return new NumberControllerBox(object, property, { min: arguments[2], max: arguments[3], step: arguments[4] }); + } + return new NumberControllerBox(object, property, { min: arguments[2], max: arguments[3] }); + } + if (Common.isString(initialValue)) { + return new StringController(object, property); + } + if (Common.isFunction(initialValue)) { + return new FunctionController(object, property, ''); + } + if (Common.isBoolean(initialValue)) { + return new BooleanController(object, property); + } + return null; + }; + + function requestAnimationFrame(callback) { + setTimeout(callback, 1000 / 60); + } + var requestAnimationFrame$1 = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || requestAnimationFrame; + + var CenteredDiv = function () { + function CenteredDiv() { + classCallCheck(this, CenteredDiv); + this.backgroundElement = document.createElement('div'); + Common.extend(this.backgroundElement.style, { + backgroundColor: 'rgba(0,0,0,0.8)', + top: 0, + left: 0, + display: 'none', + zIndex: '1000', + opacity: 0, + WebkitTransition: 'opacity 0.2s linear', + transition: 'opacity 0.2s linear' + }); + dom.makeFullscreen(this.backgroundElement); + this.backgroundElement.style.position = 'fixed'; + this.domElement = document.createElement('div'); + Common.extend(this.domElement.style, { + position: 'fixed', + display: 'none', + zIndex: '1001', + opacity: 0, + WebkitTransition: '-webkit-transform 0.2s ease-out, opacity 0.2s linear', + transition: 'transform 0.2s ease-out, opacity 0.2s linear' + }); + document.body.appendChild(this.backgroundElement); + document.body.appendChild(this.domElement); + var _this = this; + dom.bind(this.backgroundElement, 'click', function () { + _this.hide(); + }); + } + createClass(CenteredDiv, [{ + key: 'show', + value: function show() { + var _this = this; + this.backgroundElement.style.display = 'block'; + this.domElement.style.display = 'block'; + this.domElement.style.opacity = 0; + this.domElement.style.webkitTransform = 'scale(1.1)'; + this.layout(); + Common.defer(function () { + _this.backgroundElement.style.opacity = 1; + _this.domElement.style.opacity = 1; + _this.domElement.style.webkitTransform = 'scale(1)'; + }); + } + }, { + key: 'hide', + value: function hide() { + var _this = this; + var hide = function hide() { + _this.domElement.style.display = 'none'; + _this.backgroundElement.style.display = 'none'; + dom.unbind(_this.domElement, 'webkitTransitionEnd', hide); + dom.unbind(_this.domElement, 'transitionend', hide); + dom.unbind(_this.domElement, 'oTransitionEnd', hide); + }; + dom.bind(this.domElement, 'webkitTransitionEnd', hide); + dom.bind(this.domElement, 'transitionend', hide); + dom.bind(this.domElement, 'oTransitionEnd', hide); + this.backgroundElement.style.opacity = 0; + this.domElement.style.opacity = 0; + this.domElement.style.webkitTransform = 'scale(1.1)'; + } + }, { + key: 'layout', + value: function layout() { + this.domElement.style.left = window.innerWidth / 2 - dom.getWidth(this.domElement) / 2 + 'px'; + this.domElement.style.top = window.innerHeight / 2 - dom.getHeight(this.domElement) / 2 + 'px'; + } + }]); + return CenteredDiv; + }(); + + var styleSheet = ___$insertStyle(".dg ul{list-style:none;margin:0;padding:0;width:100%;clear:both}.dg.ac{position:fixed;top:0;left:0;right:0;height:0;z-index:0}.dg:not(.ac) .main{overflow:hidden}.dg.main{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear}.dg.main.taller-than-window{overflow-y:auto}.dg.main.taller-than-window .close-button{opacity:1;margin-top:-1px;border-top:1px solid #2c2c2c}.dg.main ul.closed .close-button{opacity:1 !important}.dg.main:hover .close-button,.dg.main .close-button.drag{opacity:1}.dg.main .close-button{-webkit-transition:opacity .1s linear;-o-transition:opacity .1s linear;-moz-transition:opacity .1s linear;transition:opacity .1s linear;border:0;line-height:19px;height:20px;cursor:pointer;text-align:center;background-color:#000}.dg.main .close-button.close-top{position:relative}.dg.main .close-button.close-bottom{position:absolute}.dg.main .close-button:hover{background-color:#111}.dg.a{float:right;margin-right:15px;overflow-y:visible}.dg.a.has-save>ul.close-top{margin-top:0}.dg.a.has-save>ul.close-bottom{margin-top:27px}.dg.a.has-save>ul.closed{margin-top:0}.dg.a .save-row{top:0;z-index:1002}.dg.a .save-row.close-top{position:relative}.dg.a .save-row.close-bottom{position:fixed}.dg li{-webkit-transition:height .1s ease-out;-o-transition:height .1s ease-out;-moz-transition:height .1s ease-out;transition:height .1s ease-out;-webkit-transition:overflow .1s linear;-o-transition:overflow .1s linear;-moz-transition:overflow .1s linear;transition:overflow .1s linear}.dg li:not(.folder){cursor:auto;height:27px;line-height:27px;padding:0 4px 0 5px}.dg li.folder{padding:0;border-left:4px solid rgba(0,0,0,0)}.dg li.title{cursor:pointer;margin-left:-4px}.dg .closed li:not(.title),.dg .closed ul li,.dg .closed ul li>*{height:0;overflow:hidden;border:0}.dg .cr{clear:both;padding-left:3px;height:27px;overflow:hidden}.dg .property-name{cursor:default;float:left;clear:left;width:40%;overflow:hidden;text-overflow:ellipsis}.dg .c{float:left;width:60%;position:relative}.dg .c input[type=text]{border:0;margin-top:4px;padding:3px;width:100%;float:right}.dg .has-slider input[type=text]{width:30%;margin-left:0}.dg .slider{float:left;width:66%;margin-left:-5px;margin-right:0;height:19px;margin-top:4px}.dg .slider-fg{height:100%}.dg .c input[type=checkbox]{margin-top:7px}.dg .c select{margin-top:5px}.dg .cr.function,.dg .cr.function .property-name,.dg .cr.function *,.dg .cr.boolean,.dg .cr.boolean *{cursor:pointer}.dg .cr.color{overflow:visible}.dg .selector{display:none;position:absolute;margin-left:-9px;margin-top:23px;z-index:10}.dg .c:hover .selector,.dg .selector.drag{display:block}.dg li.save-row{padding:0}.dg li.save-row .button{display:inline-block;padding:0px 6px}.dg.dialogue{background-color:#222;width:460px;padding:15px;font-size:13px;line-height:15px}#dg-new-constructor{padding:10px;color:#222;font-family:Monaco, monospace;font-size:10px;border:0;resize:none;box-shadow:inset 1px 1px 1px #888;word-wrap:break-word;margin:12px 0;display:block;width:440px;overflow-y:scroll;height:100px;position:relative}#dg-local-explain{display:none;font-size:11px;line-height:17px;border-radius:3px;background-color:#333;padding:8px;margin-top:10px}#dg-local-explain code{font-size:10px}#dat-gui-save-locally{display:none}.dg{color:#eee;font:11px 'Lucida Grande', sans-serif;text-shadow:0 -1px 0 #111}.dg.main::-webkit-scrollbar{width:5px;background:#1a1a1a}.dg.main::-webkit-scrollbar-corner{height:0;display:none}.dg.main::-webkit-scrollbar-thumb{border-radius:5px;background:#676767}.dg li:not(.folder){background:#1a1a1a;border-bottom:1px solid #2c2c2c}.dg li.save-row{line-height:25px;background:#dad5cb;border:0}.dg li.save-row select{margin-left:5px;width:108px}.dg li.save-row .button{margin-left:5px;margin-top:1px;border-radius:2px;font-size:9px;line-height:7px;padding:4px 4px 5px 4px;background:#c5bdad;color:#fff;text-shadow:0 1px 0 #b0a58f;box-shadow:0 -1px 0 #b0a58f;cursor:pointer}.dg li.save-row .button.gears{background:#c5bdad url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAANCAYAAAB/9ZQ7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQJJREFUeNpiYKAU/P//PwGIC/ApCABiBSAW+I8AClAcgKxQ4T9hoMAEUrxx2QSGN6+egDX+/vWT4e7N82AMYoPAx/evwWoYoSYbACX2s7KxCxzcsezDh3evFoDEBYTEEqycggWAzA9AuUSQQgeYPa9fPv6/YWm/Acx5IPb7ty/fw+QZblw67vDs8R0YHyQhgObx+yAJkBqmG5dPPDh1aPOGR/eugW0G4vlIoTIfyFcA+QekhhHJhPdQxbiAIguMBTQZrPD7108M6roWYDFQiIAAv6Aow/1bFwXgis+f2LUAynwoIaNcz8XNx3Dl7MEJUDGQpx9gtQ8YCueB+D26OECAAQDadt7e46D42QAAAABJRU5ErkJggg==) 2px 1px no-repeat;height:7px;width:8px}.dg li.save-row .button:hover{background-color:#bab19e;box-shadow:0 -1px 0 #b0a58f}.dg li.folder{border-bottom:0}.dg li.title{padding-left:16px;background:#000 url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlI+hKgFxoCgAOw==) 6px 10px no-repeat;cursor:pointer;border-bottom:1px solid rgba(255,255,255,0.2)}.dg .closed li.title{background-image:url(data:image/gif;base64,R0lGODlhBQAFAJEAAP////Pz8////////yH5BAEAAAIALAAAAAAFAAUAAAIIlGIWqMCbWAEAOw==)}.dg .cr.boolean{border-left:3px solid #806787}.dg .cr.color{border-left:3px solid}.dg .cr.function{border-left:3px solid #e61d5f}.dg .cr.number{border-left:3px solid #2FA1D6}.dg .cr.number input[type=text]{color:#2FA1D6}.dg .cr.string{border-left:3px solid #1ed36f}.dg .cr.string input[type=text]{color:#1ed36f}.dg .cr.function:hover,.dg .cr.boolean:hover{background:#111}.dg .c input[type=text]{background:#303030;outline:none}.dg .c input[type=text]:hover{background:#3c3c3c}.dg .c input[type=text]:focus{background:#494949;color:#fff}.dg .c .slider{background:#303030;cursor:ew-resize}.dg .c .slider-fg{background:#2FA1D6;max-width:100%}.dg .c .slider:hover{background:#3c3c3c}.dg .c .slider:hover .slider-fg{background:#44abda}\n"); + + css.inject(styleSheet); + var CSS_NAMESPACE = 'dg'; + var HIDE_KEY_CODE = 72; + var CLOSE_BUTTON_HEIGHT = 20; + var DEFAULT_DEFAULT_PRESET_NAME = 'Default'; + var SUPPORTS_LOCAL_STORAGE = function () { + try { + return !!window.localStorage; + } catch (e) { + return false; + } + }(); + var SAVE_DIALOGUE = void 0; + var autoPlaceVirgin = true; + var autoPlaceContainer = void 0; + var hide = false; + var hideableGuis = []; + var GUI = function GUI(pars) { + var _this = this; + var params = pars || {}; + this.domElement = document.createElement('div'); + this.__ul = document.createElement('ul'); + this.domElement.appendChild(this.__ul); + dom.addClass(this.domElement, CSS_NAMESPACE); + this.__folders = {}; + this.__controllers = []; + this.__rememberedObjects = []; + this.__rememberedObjectIndecesToControllers = []; + this.__listening = []; + params = Common.defaults(params, { + closeOnTop: false, + autoPlace: true, + width: GUI.DEFAULT_WIDTH + }); + params = Common.defaults(params, { + resizable: params.autoPlace, + hideable: params.autoPlace + }); + if (!Common.isUndefined(params.load)) { + if (params.preset) { + params.load.preset = params.preset; + } + } else { + params.load = { preset: DEFAULT_DEFAULT_PRESET_NAME }; + } + if (Common.isUndefined(params.parent) && params.hideable) { + hideableGuis.push(this); + } + params.resizable = Common.isUndefined(params.parent) && params.resizable; + if (params.autoPlace && Common.isUndefined(params.scrollable)) { + params.scrollable = true; + } + var useLocalStorage = SUPPORTS_LOCAL_STORAGE && localStorage.getItem(getLocalStorageHash(this, 'isLocal')) === 'true'; + var saveToLocalStorage = void 0; + var titleRow = void 0; + Object.defineProperties(this, + { + parent: { + get: function get$$1() { + return params.parent; + } + }, + scrollable: { + get: function get$$1() { + return params.scrollable; + } + }, + autoPlace: { + get: function get$$1() { + return params.autoPlace; + } + }, + closeOnTop: { + get: function get$$1() { + return params.closeOnTop; + } + }, + preset: { + get: function get$$1() { + if (_this.parent) { + return _this.getRoot().preset; + } + return params.load.preset; + }, + set: function set$$1(v) { + if (_this.parent) { + _this.getRoot().preset = v; + } else { + params.load.preset = v; + } + setPresetSelectIndex(this); + _this.revert(); + } + }, + width: { + get: function get$$1() { + return params.width; + }, + set: function set$$1(v) { + params.width = v; + setWidth(_this, v); + } + }, + name: { + get: function get$$1() { + return params.name; + }, + set: function set$$1(v) { + params.name = v; + if (titleRow) { + titleRow.innerHTML = params.name; + } + } + }, + closed: { + get: function get$$1() { + return params.closed; + }, + set: function set$$1(v) { + params.closed = v; + if (params.closed) { + dom.addClass(_this.__ul, GUI.CLASS_CLOSED); + } else { + dom.removeClass(_this.__ul, GUI.CLASS_CLOSED); + } + this.onResize(); + if (_this.__closeButton) { + _this.__closeButton.innerHTML = v ? GUI.TEXT_OPEN : GUI.TEXT_CLOSED; + } + } + }, + load: { + get: function get$$1() { + return params.load; + } + }, + useLocalStorage: { + get: function get$$1() { + return useLocalStorage; + }, + set: function set$$1(bool) { + if (SUPPORTS_LOCAL_STORAGE) { + useLocalStorage = bool; + if (bool) { + dom.bind(window, 'unload', saveToLocalStorage); + } else { + dom.unbind(window, 'unload', saveToLocalStorage); + } + localStorage.setItem(getLocalStorageHash(_this, 'isLocal'), bool); + } + } + } + }); + if (Common.isUndefined(params.parent)) { + this.closed = params.closed || false; + dom.addClass(this.domElement, GUI.CLASS_MAIN); + dom.makeSelectable(this.domElement, false); + if (SUPPORTS_LOCAL_STORAGE) { + if (useLocalStorage) { + _this.useLocalStorage = true; + var savedGui = localStorage.getItem(getLocalStorageHash(this, 'gui')); + if (savedGui) { + params.load = JSON.parse(savedGui); + } + } + } + this.__closeButton = document.createElement('div'); + this.__closeButton.innerHTML = GUI.TEXT_CLOSED; + dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_BUTTON); + if (params.closeOnTop) { + dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_TOP); + this.domElement.insertBefore(this.__closeButton, this.domElement.childNodes[0]); + } else { + dom.addClass(this.__closeButton, GUI.CLASS_CLOSE_BOTTOM); + this.domElement.appendChild(this.__closeButton); + } + dom.bind(this.__closeButton, 'click', function () { + _this.closed = !_this.closed; + }); + } else { + if (params.closed === undefined) { + params.closed = true; + } + var titleRowName = document.createTextNode(params.name); + dom.addClass(titleRowName, 'controller-name'); + titleRow = addRow(_this, titleRowName); + var onClickTitle = function onClickTitle(e) { + e.preventDefault(); + _this.closed = !_this.closed; + return false; + }; + dom.addClass(this.__ul, GUI.CLASS_CLOSED); + dom.addClass(titleRow, 'title'); + dom.bind(titleRow, 'click', onClickTitle); + if (!params.closed) { + this.closed = false; + } + } + if (params.autoPlace) { + if (Common.isUndefined(params.parent)) { + if (autoPlaceVirgin) { + autoPlaceContainer = document.createElement('div'); + dom.addClass(autoPlaceContainer, CSS_NAMESPACE); + dom.addClass(autoPlaceContainer, GUI.CLASS_AUTO_PLACE_CONTAINER); + document.body.appendChild(autoPlaceContainer); + autoPlaceVirgin = false; + } + autoPlaceContainer.appendChild(this.domElement); + dom.addClass(this.domElement, GUI.CLASS_AUTO_PLACE); + } + if (!this.parent) { + setWidth(_this, params.width); + } + } + this.__resizeHandler = function () { + _this.onResizeDebounced(); + }; + dom.bind(window, 'resize', this.__resizeHandler); + dom.bind(this.__ul, 'webkitTransitionEnd', this.__resizeHandler); + dom.bind(this.__ul, 'transitionend', this.__resizeHandler); + dom.bind(this.__ul, 'oTransitionEnd', this.__resizeHandler); + this.onResize(); + if (params.resizable) { + addResizeHandle(this); + } + saveToLocalStorage = function saveToLocalStorage() { + if (SUPPORTS_LOCAL_STORAGE && localStorage.getItem(getLocalStorageHash(_this, 'isLocal')) === 'true') { + localStorage.setItem(getLocalStorageHash(_this, 'gui'), JSON.stringify(_this.getSaveObject())); + } + }; + this.saveToLocalStorageIfPossible = saveToLocalStorage; + function resetWidth() { + var root = _this.getRoot(); + root.width += 1; + Common.defer(function () { + root.width -= 1; + }); + } + if (!params.parent) { + resetWidth(); + } + }; + GUI.toggleHide = function () { + hide = !hide; + Common.each(hideableGuis, function (gui) { + gui.domElement.style.display = hide ? 'none' : ''; + }); + }; + GUI.CLASS_AUTO_PLACE = 'a'; + GUI.CLASS_AUTO_PLACE_CONTAINER = 'ac'; + GUI.CLASS_MAIN = 'main'; + GUI.CLASS_CONTROLLER_ROW = 'cr'; + GUI.CLASS_TOO_TALL = 'taller-than-window'; + GUI.CLASS_CLOSED = 'closed'; + GUI.CLASS_CLOSE_BUTTON = 'close-button'; + GUI.CLASS_CLOSE_TOP = 'close-top'; + GUI.CLASS_CLOSE_BOTTOM = 'close-bottom'; + GUI.CLASS_DRAG = 'drag'; + GUI.DEFAULT_WIDTH = 245; + GUI.TEXT_CLOSED = 'Close Controls'; + GUI.TEXT_OPEN = 'Open Controls'; + GUI._keydownHandler = function (e) { + if (document.activeElement.type !== 'text' && (e.which === HIDE_KEY_CODE || e.keyCode === HIDE_KEY_CODE)) { + GUI.toggleHide(); + } + }; + dom.bind(window, 'keydown', GUI._keydownHandler, false); + Common.extend(GUI.prototype, + { + add: function add(object, property) { + return _add(this, object, property, { + factoryArgs: Array.prototype.slice.call(arguments, 2) + }); + }, + addColor: function addColor(object, property) { + return _add(this, object, property, { + color: true + }); + }, + remove: function remove(controller) { + this.__ul.removeChild(controller.__li); + this.__controllers.splice(this.__controllers.indexOf(controller), 1); + var _this = this; + Common.defer(function () { + _this.onResize(); + }); + }, + destroy: function destroy() { + if (this.parent) { + throw new Error('Only the root GUI should be removed with .destroy(). ' + 'For subfolders, use gui.removeFolder(folder) instead.'); + } + if (this.autoPlace) { + autoPlaceContainer.removeChild(this.domElement); + } + var _this = this; + Common.each(this.__folders, function (subfolder) { + _this.removeFolder(subfolder); + }); + dom.unbind(window, 'keydown', GUI._keydownHandler, false); + removeListeners(this); + }, + addFolder: function addFolder(name) { + if (this.__folders[name] !== undefined) { + throw new Error('You already have a folder in this GUI by the' + ' name "' + name + '"'); + } + var newGuiParams = { name: name, parent: this }; + newGuiParams.autoPlace = this.autoPlace; + if (this.load && + this.load.folders && + this.load.folders[name]) { + newGuiParams.closed = this.load.folders[name].closed; + newGuiParams.load = this.load.folders[name]; + } + var gui = new GUI(newGuiParams); + this.__folders[name] = gui; + var li = addRow(this, gui.domElement); + dom.addClass(li, 'folder'); + return gui; + }, + removeFolder: function removeFolder(folder) { + this.__ul.removeChild(folder.domElement.parentElement); + delete this.__folders[folder.name]; + if (this.load && + this.load.folders && + this.load.folders[folder.name]) { + delete this.load.folders[folder.name]; + } + removeListeners(folder); + var _this = this; + Common.each(folder.__folders, function (subfolder) { + folder.removeFolder(subfolder); + }); + Common.defer(function () { + _this.onResize(); + }); + }, + open: function open() { + this.closed = false; + }, + close: function close() { + this.closed = true; + }, + hide: function hide() { + this.domElement.style.display = 'none'; + }, + show: function show() { + this.domElement.style.display = ''; + }, + onResize: function onResize() { + var root = this.getRoot(); + if (root.scrollable) { + var top = dom.getOffset(root.__ul).top; + var h = 0; + Common.each(root.__ul.childNodes, function (node) { + if (!(root.autoPlace && node === root.__save_row)) { + h += dom.getHeight(node); + } + }); + if (window.innerHeight - top - CLOSE_BUTTON_HEIGHT < h) { + dom.addClass(root.domElement, GUI.CLASS_TOO_TALL); + root.__ul.style.height = window.innerHeight - top - CLOSE_BUTTON_HEIGHT + 'px'; + } else { + dom.removeClass(root.domElement, GUI.CLASS_TOO_TALL); + root.__ul.style.height = 'auto'; + } + } + if (root.__resize_handle) { + Common.defer(function () { + root.__resize_handle.style.height = root.__ul.offsetHeight + 'px'; + }); + } + if (root.__closeButton) { + root.__closeButton.style.width = root.width + 'px'; + } + }, + onResizeDebounced: Common.debounce(function () { + this.onResize(); + }, 50), + remember: function remember() { + if (Common.isUndefined(SAVE_DIALOGUE)) { + SAVE_DIALOGUE = new CenteredDiv(); + SAVE_DIALOGUE.domElement.innerHTML = saveDialogContents; + } + if (this.parent) { + throw new Error('You can only call remember on a top level GUI.'); + } + var _this = this; + Common.each(Array.prototype.slice.call(arguments), function (object) { + if (_this.__rememberedObjects.length === 0) { + addSaveMenu(_this); + } + if (_this.__rememberedObjects.indexOf(object) === -1) { + _this.__rememberedObjects.push(object); + } + }); + if (this.autoPlace) { + setWidth(this, this.width); + } + }, + getRoot: function getRoot() { + var gui = this; + while (gui.parent) { + gui = gui.parent; + } + return gui; + }, + getSaveObject: function getSaveObject() { + var toReturn = this.load; + toReturn.closed = this.closed; + if (this.__rememberedObjects.length > 0) { + toReturn.preset = this.preset; + if (!toReturn.remembered) { + toReturn.remembered = {}; + } + toReturn.remembered[this.preset] = getCurrentPreset(this); + } + toReturn.folders = {}; + Common.each(this.__folders, function (element, key) { + toReturn.folders[key] = element.getSaveObject(); + }); + return toReturn; + }, + save: function save() { + if (!this.load.remembered) { + this.load.remembered = {}; + } + this.load.remembered[this.preset] = getCurrentPreset(this); + markPresetModified(this, false); + this.saveToLocalStorageIfPossible(); + }, + saveAs: function saveAs(presetName) { + if (!this.load.remembered) { + this.load.remembered = {}; + this.load.remembered[DEFAULT_DEFAULT_PRESET_NAME] = getCurrentPreset(this, true); + } + this.load.remembered[presetName] = getCurrentPreset(this); + this.preset = presetName; + addPresetOption(this, presetName, true); + this.saveToLocalStorageIfPossible(); + }, + revert: function revert(gui) { + Common.each(this.__controllers, function (controller) { + if (!this.getRoot().load.remembered) { + controller.setValue(controller.initialValue); + } else { + recallSavedValue(gui || this.getRoot(), controller); + } + if (controller.__onFinishChange) { + controller.__onFinishChange.call(controller, controller.getValue()); + } + }, this); + Common.each(this.__folders, function (folder) { + folder.revert(folder); + }); + if (!gui) { + markPresetModified(this.getRoot(), false); + } + }, + listen: function listen(controller) { + var init = this.__listening.length === 0; + this.__listening.push(controller); + if (init) { + updateDisplays(this.__listening); + } + }, + updateDisplay: function updateDisplay() { + Common.each(this.__controllers, function (controller) { + controller.updateDisplay(); + }); + Common.each(this.__folders, function (folder) { + folder.updateDisplay(); + }); + } + }); + function addRow(gui, newDom, liBefore) { + var li = document.createElement('li'); + if (newDom) { + li.appendChild(newDom); + } + if (liBefore) { + gui.__ul.insertBefore(li, liBefore); + } else { + gui.__ul.appendChild(li); + } + gui.onResize(); + return li; + } + function removeListeners(gui) { + dom.unbind(window, 'resize', gui.__resizeHandler); + if (gui.saveToLocalStorageIfPossible) { + dom.unbind(window, 'unload', gui.saveToLocalStorageIfPossible); + } + } + function markPresetModified(gui, modified) { + var opt = gui.__preset_select[gui.__preset_select.selectedIndex]; + if (modified) { + opt.innerHTML = opt.value + '*'; + } else { + opt.innerHTML = opt.value; + } + } + function augmentController(gui, li, controller) { + controller.__li = li; + controller.__gui = gui; + Common.extend(controller, { + options: function options(_options) { + if (arguments.length > 1) { + var nextSibling = controller.__li.nextElementSibling; + controller.remove(); + return _add(gui, controller.object, controller.property, { + before: nextSibling, + factoryArgs: [Common.toArray(arguments)] + }); + } + if (Common.isArray(_options) || Common.isObject(_options)) { + var _nextSibling = controller.__li.nextElementSibling; + controller.remove(); + return _add(gui, controller.object, controller.property, { + before: _nextSibling, + factoryArgs: [_options] + }); + } + }, + name: function name(_name) { + controller.__li.firstElementChild.firstElementChild.innerHTML = _name; + return controller; + }, + listen: function listen() { + controller.__gui.listen(controller); + return controller; + }, + remove: function remove() { + controller.__gui.remove(controller); + return controller; + } + }); + if (controller instanceof NumberControllerSlider) { + var box = new NumberControllerBox(controller.object, controller.property, { min: controller.__min, max: controller.__max, step: controller.__step }); + Common.each(['updateDisplay', 'onChange', 'onFinishChange', 'step', 'min', 'max'], function (method) { + var pc = controller[method]; + var pb = box[method]; + controller[method] = box[method] = function () { + var args = Array.prototype.slice.call(arguments); + pb.apply(box, args); + return pc.apply(controller, args); + }; + }); + dom.addClass(li, 'has-slider'); + controller.domElement.insertBefore(box.domElement, controller.domElement.firstElementChild); + } else if (controller instanceof NumberControllerBox) { + var r = function r(returned) { + if (Common.isNumber(controller.__min) && Common.isNumber(controller.__max)) { + var oldName = controller.__li.firstElementChild.firstElementChild.innerHTML; + var wasListening = controller.__gui.__listening.indexOf(controller) > -1; + controller.remove(); + var newController = _add(gui, controller.object, controller.property, { + before: controller.__li.nextElementSibling, + factoryArgs: [controller.__min, controller.__max, controller.__step] + }); + newController.name(oldName); + if (wasListening) newController.listen(); + return newController; + } + return returned; + }; + controller.min = Common.compose(r, controller.min); + controller.max = Common.compose(r, controller.max); + } else if (controller instanceof BooleanController) { + dom.bind(li, 'click', function () { + dom.fakeEvent(controller.__checkbox, 'click'); + }); + dom.bind(controller.__checkbox, 'click', function (e) { + e.stopPropagation(); + }); + } else if (controller instanceof FunctionController) { + dom.bind(li, 'click', function () { + dom.fakeEvent(controller.__button, 'click'); + }); + dom.bind(li, 'mouseover', function () { + dom.addClass(controller.__button, 'hover'); + }); + dom.bind(li, 'mouseout', function () { + dom.removeClass(controller.__button, 'hover'); + }); + } else if (controller instanceof ColorController) { + dom.addClass(li, 'color'); + controller.updateDisplay = Common.compose(function (val) { + li.style.borderLeftColor = controller.__color.toString(); + return val; + }, controller.updateDisplay); + controller.updateDisplay(); + } + controller.setValue = Common.compose(function (val) { + if (gui.getRoot().__preset_select && controller.isModified()) { + markPresetModified(gui.getRoot(), true); + } + return val; + }, controller.setValue); + } + function recallSavedValue(gui, controller) { + var root = gui.getRoot(); + var matchedIndex = root.__rememberedObjects.indexOf(controller.object); + if (matchedIndex !== -1) { + var controllerMap = root.__rememberedObjectIndecesToControllers[matchedIndex]; + if (controllerMap === undefined) { + controllerMap = {}; + root.__rememberedObjectIndecesToControllers[matchedIndex] = controllerMap; + } + controllerMap[controller.property] = controller; + if (root.load && root.load.remembered) { + var presetMap = root.load.remembered; + var preset = void 0; + if (presetMap[gui.preset]) { + preset = presetMap[gui.preset]; + } else if (presetMap[DEFAULT_DEFAULT_PRESET_NAME]) { + preset = presetMap[DEFAULT_DEFAULT_PRESET_NAME]; + } else { + return; + } + if (preset[matchedIndex] && preset[matchedIndex][controller.property] !== undefined) { + var value = preset[matchedIndex][controller.property]; + controller.initialValue = value; + controller.setValue(value); + } + } + } + } + function _add(gui, object, property, params) { + if (object[property] === undefined) { + throw new Error('Object "' + object + '" has no property "' + property + '"'); + } + var controller = void 0; + if (params.color) { + controller = new ColorController(object, property); + } else { + var factoryArgs = [object, property].concat(params.factoryArgs); + controller = ControllerFactory.apply(gui, factoryArgs); + } + if (params.before instanceof Controller) { + params.before = params.before.__li; + } + recallSavedValue(gui, controller); + dom.addClass(controller.domElement, 'c'); + var name = document.createElement('span'); + dom.addClass(name, 'property-name'); + name.innerHTML = controller.property; + var container = document.createElement('div'); + container.appendChild(name); + container.appendChild(controller.domElement); + var li = addRow(gui, container, params.before); + dom.addClass(li, GUI.CLASS_CONTROLLER_ROW); + if (controller instanceof ColorController) { + dom.addClass(li, 'color'); + } else { + dom.addClass(li, _typeof(controller.getValue())); + } + augmentController(gui, li, controller); + gui.__controllers.push(controller); + return controller; + } + function getLocalStorageHash(gui, key) { + return document.location.href + '.' + key; + } + function addPresetOption(gui, name, setSelected) { + var opt = document.createElement('option'); + opt.innerHTML = name; + opt.value = name; + gui.__preset_select.appendChild(opt); + if (setSelected) { + gui.__preset_select.selectedIndex = gui.__preset_select.length - 1; + } + } + function showHideExplain(gui, explain) { + explain.style.display = gui.useLocalStorage ? 'block' : 'none'; + } + function addSaveMenu(gui) { + var div = gui.__save_row = document.createElement('li'); + dom.addClass(gui.domElement, 'has-save'); + gui.__ul.insertBefore(div, gui.__ul.firstChild); + dom.addClass(div, 'save-row'); + var gears = document.createElement('span'); + gears.innerHTML = ' '; + dom.addClass(gears, 'button gears'); + var button = document.createElement('span'); + button.innerHTML = 'Save'; + dom.addClass(button, 'button'); + dom.addClass(button, 'save'); + var button2 = document.createElement('span'); + button2.innerHTML = 'New'; + dom.addClass(button2, 'button'); + dom.addClass(button2, 'save-as'); + var button3 = document.createElement('span'); + button3.innerHTML = 'Revert'; + dom.addClass(button3, 'button'); + dom.addClass(button3, 'revert'); + var select = gui.__preset_select = document.createElement('select'); + if (gui.load && gui.load.remembered) { + Common.each(gui.load.remembered, function (value, key) { + addPresetOption(gui, key, key === gui.preset); + }); + } else { + addPresetOption(gui, DEFAULT_DEFAULT_PRESET_NAME, false); + } + dom.bind(select, 'change', function () { + for (var index = 0; index < gui.__preset_select.length; index++) { + gui.__preset_select[index].innerHTML = gui.__preset_select[index].value; + } + gui.preset = this.value; + }); + div.appendChild(select); + div.appendChild(gears); + div.appendChild(button); + div.appendChild(button2); + div.appendChild(button3); + if (SUPPORTS_LOCAL_STORAGE) { + var explain = document.getElementById('dg-local-explain'); + var localStorageCheckBox = document.getElementById('dg-local-storage'); + var saveLocally = document.getElementById('dg-save-locally'); + saveLocally.style.display = 'block'; + if (localStorage.getItem(getLocalStorageHash(gui, 'isLocal')) === 'true') { + localStorageCheckBox.setAttribute('checked', 'checked'); + } + showHideExplain(gui, explain); + dom.bind(localStorageCheckBox, 'change', function () { + gui.useLocalStorage = !gui.useLocalStorage; + showHideExplain(gui, explain); + }); + } + var newConstructorTextArea = document.getElementById('dg-new-constructor'); + dom.bind(newConstructorTextArea, 'keydown', function (e) { + if (e.metaKey && (e.which === 67 || e.keyCode === 67)) { + SAVE_DIALOGUE.hide(); + } + }); + dom.bind(gears, 'click', function () { + newConstructorTextArea.innerHTML = JSON.stringify(gui.getSaveObject(), undefined, 2); + SAVE_DIALOGUE.show(); + newConstructorTextArea.focus(); + newConstructorTextArea.select(); + }); + dom.bind(button, 'click', function () { + gui.save(); + }); + dom.bind(button2, 'click', function () { + var presetName = prompt('Enter a new preset name.'); + if (presetName) { + gui.saveAs(presetName); + } + }); + dom.bind(button3, 'click', function () { + gui.revert(); + }); + } + function addResizeHandle(gui) { + var pmouseX = void 0; + gui.__resize_handle = document.createElement('div'); + Common.extend(gui.__resize_handle.style, { + width: '6px', + marginLeft: '-3px', + height: '200px', + cursor: 'ew-resize', + position: 'absolute' + }); + function drag(e) { + e.preventDefault(); + gui.width += pmouseX - e.clientX; + gui.onResize(); + pmouseX = e.clientX; + return false; + } + function dragStop() { + dom.removeClass(gui.__closeButton, GUI.CLASS_DRAG); + dom.unbind(window, 'mousemove', drag); + dom.unbind(window, 'mouseup', dragStop); + } + function dragStart(e) { + e.preventDefault(); + pmouseX = e.clientX; + dom.addClass(gui.__closeButton, GUI.CLASS_DRAG); + dom.bind(window, 'mousemove', drag); + dom.bind(window, 'mouseup', dragStop); + return false; + } + dom.bind(gui.__resize_handle, 'mousedown', dragStart); + dom.bind(gui.__closeButton, 'mousedown', dragStart); + gui.domElement.insertBefore(gui.__resize_handle, gui.domElement.firstElementChild); + } + function setWidth(gui, w) { + gui.domElement.style.width = w + 'px'; + if (gui.__save_row && gui.autoPlace) { + gui.__save_row.style.width = w + 'px'; + } + if (gui.__closeButton) { + gui.__closeButton.style.width = w + 'px'; + } + } + function getCurrentPreset(gui, useInitialValues) { + var toReturn = {}; + Common.each(gui.__rememberedObjects, function (val, index) { + var savedValues = {}; + var controllerMap = gui.__rememberedObjectIndecesToControllers[index]; + Common.each(controllerMap, function (controller, property) { + savedValues[property] = useInitialValues ? controller.initialValue : controller.getValue(); + }); + toReturn[index] = savedValues; + }); + return toReturn; + } + function setPresetSelectIndex(gui) { + for (var index = 0; index < gui.__preset_select.length; index++) { + if (gui.__preset_select[index].value === gui.preset) { + gui.__preset_select.selectedIndex = index; + } + } + } + function updateDisplays(controllerArray) { + if (controllerArray.length !== 0) { + requestAnimationFrame$1.call(window, function () { + updateDisplays(controllerArray); + }); + } + Common.each(controllerArray, function (c) { + c.updateDisplay(); + }); + } + + var color = { + Color: Color, + math: ColorMath, + interpret: interpret + }; + var controllers = { + Controller: Controller, + BooleanController: BooleanController, + OptionController: OptionController, + StringController: StringController, + NumberController: NumberController, + NumberControllerBox: NumberControllerBox, + NumberControllerSlider: NumberControllerSlider, + FunctionController: FunctionController, + ColorController: ColorController + }; + var dom$1 = { dom: dom }; + var gui = { GUI: GUI }; + var GUI$1 = GUI; + var index = { + color: color, + controllers: controllers, + dom: dom$1, + gui: gui, + GUI: GUI$1 + }; + + exports.color = color; + exports.controllers = controllers; + exports.dom = dom$1; + exports.gui = gui; + exports.GUI = GUI$1; + exports['default'] = index; + + Object.defineProperty(exports, '__esModule', { value: true }); + +}))); +//# sourceMappingURL=dat.gui.js.map \ No newline at end of file diff --git a/public/vendor/daterangepicker/daterangepicker.css b/public/vendor/daterangepicker/daterangepicker.css new file mode 100755 index 000000000..86f4b775e --- /dev/null +++ b/public/vendor/daterangepicker/daterangepicker.css @@ -0,0 +1,269 @@ +.daterangepicker { + position: absolute; + color: inherit; + background-color: #fff; + border-radius: 4px; + width: 278px; + padding: 4px; + margin-top: 1px; + top: 100px; + left: 20px; + /* Calendars */ } + .daterangepicker:before, .daterangepicker:after { + position: absolute; + display: inline-block; + border-bottom-color: rgba(0, 0, 0, 0.2); + content: ''; } + .daterangepicker:before { + top: -7px; + border-right: 7px solid transparent; + border-left: 7px solid transparent; + border-bottom: 7px solid #ccc; } + .daterangepicker:after { + top: -6px; + border-right: 6px solid transparent; + border-bottom: 6px solid #fff; + border-left: 6px solid transparent; } + .daterangepicker.opensleft:before { + right: 9px; } + .daterangepicker.opensleft:after { + right: 10px; } + .daterangepicker.openscenter:before { + left: 0; + right: 0; + width: 0; + margin-left: auto; + margin-right: auto; } + .daterangepicker.openscenter:after { + left: 0; + right: 0; + width: 0; + margin-left: auto; + margin-right: auto; } + .daterangepicker.opensright:before { + left: 9px; } + .daterangepicker.opensright:after { + left: 10px; } + .daterangepicker.dropup { + margin-top: -5px; } + .daterangepicker.dropup:before { + top: initial; + bottom: -7px; + border-bottom: initial; + border-top: 7px solid #ccc; } + .daterangepicker.dropup:after { + top: initial; + bottom: -6px; + border-bottom: initial; + border-top: 6px solid #fff; } + .daterangepicker.dropdown-menu { + max-width: none; + z-index: 3001; } + .daterangepicker.single .ranges, .daterangepicker.single .calendar { + float: none; } + .daterangepicker.show-calendar .calendar { + display: block; } + .daterangepicker .calendar { + display: none; + max-width: 270px; + margin: 4px; } + .daterangepicker .calendar.single .calendar-table { + border: none; } + .daterangepicker .calendar th, .daterangepicker .calendar td { + white-space: nowrap; + text-align: center; + min-width: 32px; } + .daterangepicker .calendar-table { + border: 1px solid #fff; + padding: 4px; + border-radius: 4px; + background-color: #fff; } + .daterangepicker table { + width: 100%; + margin: 0; } + .daterangepicker td, .daterangepicker th { + text-align: center; + width: 20px; + height: 20px; + border-radius: 4px; + border: 1px solid transparent; + white-space: nowrap; + cursor: pointer; } + .daterangepicker td.available:hover, .daterangepicker th.available:hover { + background-color: #eee; + border-color: transparent; + color: inherit; } + .daterangepicker td.week, .daterangepicker th.week { + font-size: 80%; + color: #ccc; } + .daterangepicker td.off, .daterangepicker td.off.in-range, .daterangepicker td.off.start-date, .daterangepicker td.off.end-date { + background-color: #fff; + border-color: transparent; + color: #999; } + .daterangepicker td.in-range { + background-color: #ebf4f8; + border-color: transparent; + color: #000; + border-radius: 0; } + .daterangepicker td.start-date { + border-radius: 4px 0 0 4px; } + .daterangepicker td.end-date { + border-radius: 0 4px 4px 0; } + .daterangepicker td.start-date.end-date { + border-radius: 4px; } + .daterangepicker td.active, .daterangepicker td.active:hover { + background-color: #357ebd; + border-color: transparent; + color: #fff; } + .daterangepicker th.month { + width: auto; } + .daterangepicker td.disabled, .daterangepicker option.disabled { + color: #999; + cursor: not-allowed; + text-decoration: line-through; } + .daterangepicker select.monthselect, .daterangepicker select.yearselect { + font-size: 12px; + padding: 1px; + height: auto; + margin: 0; + cursor: default; } + .daterangepicker select.monthselect { + margin-right: 2%; + width: 56%; } + .daterangepicker select.yearselect { + width: 40%; } + .daterangepicker select.hourselect, .daterangepicker select.minuteselect, .daterangepicker select.secondselect, .daterangepicker select.ampmselect { + width: 50px; + margin-bottom: 0; } + .daterangepicker .input-mini { + border: 1px solid #ccc; + border-radius: 4px; + color: #555; + height: 30px; + line-height: 30px; + display: block; + vertical-align: middle; + margin: 0 0 5px 0; + padding: 0 6px 0 28px; + width: 100%; } + .daterangepicker .input-mini.active { + border: 1px solid #08c; + border-radius: 4px; } + .daterangepicker .daterangepicker_input { + position: relative; } + .daterangepicker .daterangepicker_input i { + position: absolute; + left: 8px; + top: 8px; } + .daterangepicker.rtl .input-mini { + padding-right: 28px; + padding-left: 6px; } + .daterangepicker.rtl .daterangepicker_input i { + left: auto; + right: 8px; } + .daterangepicker .calendar-time { + text-align: center; + margin: 5px auto; + line-height: 30px; + position: relative; + padding-left: 28px; } + .daterangepicker .calendar-time select.disabled { + color: #ccc; + cursor: not-allowed; } + +.ranges { + font-size: 11px; + float: none; + margin: 4px; + text-align: left; } + .ranges ul { + list-style: none; + margin: 0 auto; + padding: 0; + width: 100%; } + .ranges li { + font-size: 13px; + background-color: #f5f5f5; + border: 1px solid #f5f5f5; + border-radius: 4px; + color: #08c; + padding: 3px 12px; + margin-bottom: 8px; + cursor: pointer; } + .ranges li:hover { + background-color: #08c; + border: 1px solid #08c; + color: #fff; } + .ranges li.active { + background-color: #08c; + border: 1px solid #08c; + color: #fff; } + +/* Larger Screen Styling */ +@media (min-width: 564px) { + .daterangepicker { + width: auto; } + .daterangepicker .ranges ul { + width: 160px; } + .daterangepicker.single .ranges ul { + width: 100%; } + .daterangepicker.single .calendar.left { + clear: none; } + .daterangepicker.single.ltr .ranges, .daterangepicker.single.ltr .calendar { + float: left; } + .daterangepicker.single.rtl .ranges, .daterangepicker.single.rtl .calendar { + float: right; } + .daterangepicker.ltr { + direction: ltr; + text-align: left; } + .daterangepicker.ltr .calendar.left { + clear: left; + margin-right: 0; } + .daterangepicker.ltr .calendar.left .calendar-table { + border-right: none; + border-top-right-radius: 0; + border-bottom-right-radius: 0; } + .daterangepicker.ltr .calendar.right { + margin-left: 0; } + .daterangepicker.ltr .calendar.right .calendar-table { + border-left: none; + border-top-left-radius: 0; + border-bottom-left-radius: 0; } + .daterangepicker.ltr .left .daterangepicker_input { + padding-right: 12px; } + .daterangepicker.ltr .calendar.left .calendar-table { + padding-right: 12px; } + .daterangepicker.ltr .ranges, .daterangepicker.ltr .calendar { + float: left; } + .daterangepicker.rtl { + direction: rtl; + text-align: right; } + .daterangepicker.rtl .calendar.left { + clear: right; + margin-left: 0; } + .daterangepicker.rtl .calendar.left .calendar-table { + border-left: none; + border-top-left-radius: 0; + border-bottom-left-radius: 0; } + .daterangepicker.rtl .calendar.right { + margin-right: 0; } + .daterangepicker.rtl .calendar.right .calendar-table { + border-right: none; + border-top-right-radius: 0; + border-bottom-right-radius: 0; } + .daterangepicker.rtl .left .daterangepicker_input { + padding-left: 12px; } + .daterangepicker.rtl .calendar.left .calendar-table { + padding-left: 12px; } + .daterangepicker.rtl .ranges, .daterangepicker.rtl .calendar { + text-align: right; + float: right; } } +@media (min-width: 730px) { + .daterangepicker .ranges { + width: auto; } + .daterangepicker.ltr .ranges { + float: left; } + .daterangepicker.rtl .ranges { + float: right; } + .daterangepicker .calendar.left { + clear: none !important; } } diff --git a/public/vendor/daterangepicker/daterangepicker.js b/public/vendor/daterangepicker/daterangepicker.js new file mode 100755 index 000000000..dee8d697f --- /dev/null +++ b/public/vendor/daterangepicker/daterangepicker.js @@ -0,0 +1,1628 @@ +/** +* @version: 2.1.25 +* @author: Dan Grossman http://www.dangrossman.info/ +* @copyright: Copyright (c) 2012-2017 Dan Grossman. All rights reserved. +* @license: Licensed under the MIT license. See http://www.opensource.org/licenses/mit-license.php +* @website: http://www.daterangepicker.com/ +*/ +// Follow the UMD template https://github.com/umdjs/umd/blob/master/templates/returnExportsGlobal.js +(function (root, factory) { + if (typeof define === 'function' && define.amd) { + // AMD. Make globaly available as well + define(['moment', 'jquery'], function (moment, jquery) { + if (!jquery.fn) jquery.fn = {}; // webpack server rendering + return (root.daterangepicker = factory(moment, jquery)); + }); + } else if (typeof module === 'object' && module.exports) { + // Node / Browserify + //isomorphic issue + var jQuery = (typeof window != 'undefined') ? window.jQuery : undefined; + if (!jQuery) { + jQuery = require('jquery'); + if (!jQuery.fn) jQuery.fn = {}; + } + var moment = (typeof window != 'undefined' && typeof window.moment != 'undefined') ? window.moment : require('moment'); + module.exports = factory(moment, jQuery); + } else { + // Browser globals + root.daterangepicker = factory(root.moment, root.jQuery); + } +}(this, function(moment, $) { + var DateRangePicker = function(element, options, cb) { + + //default settings for options + this.parentEl = 'body'; + this.element = $(element); + this.startDate = moment().startOf('day'); + this.endDate = moment().endOf('day'); + this.minDate = false; + this.maxDate = false; + this.dateLimit = false; + this.autoApply = false; + this.singleDatePicker = false; + this.showDropdowns = false; + this.showWeekNumbers = false; + this.showISOWeekNumbers = false; + this.showCustomRangeLabel = true; + this.timePicker = false; + this.timePicker24Hour = false; + this.timePickerIncrement = 1; + this.timePickerSeconds = false; + this.linkedCalendars = true; + this.autoUpdateInput = true; + this.alwaysShowCalendars = false; + this.ranges = {}; + + this.opens = 'right'; + if (this.element.hasClass('pull-right')) + this.opens = 'left'; + + this.drops = 'down'; + if (this.element.hasClass('dropup')) + this.drops = 'up'; + + this.buttonClasses = 'btn btn-sm'; + this.applyClass = 'btn-success'; + this.cancelClass = 'btn-default'; + + this.locale = { + direction: 'ltr', + format: moment.localeData().longDateFormat('L'), + separator: ' - ', + applyLabel: 'Apply', + cancelLabel: 'Cancel', + weekLabel: 'W', + customRangeLabel: 'Custom Range', + daysOfWeek: moment.weekdaysMin(), + monthNames: moment.monthsShort(), + firstDay: moment.localeData().firstDayOfWeek() + }; + + this.callback = function() { }; + + //some state information + this.isShowing = false; + this.leftCalendar = {}; + this.rightCalendar = {}; + + //custom options from user + if (typeof options !== 'object' || options === null) + options = {}; + + //allow setting options with data attributes + //data-api options will be overwritten with custom javascript options + options = $.extend(this.element.data(), options); + + //html template for the picker UI + if (typeof options.template !== 'string' && !(options.template instanceof $)) + options.template = ''; + + this.parentEl = (options.parentEl && $(options.parentEl).length) ? $(options.parentEl) : $(this.parentEl); + this.container = $(options.template).appendTo(this.parentEl); + + // + // handle all the possible options overriding defaults + // + + if (typeof options.locale === 'object') { + + if (typeof options.locale.direction === 'string') + this.locale.direction = options.locale.direction; + + if (typeof options.locale.format === 'string') + this.locale.format = options.locale.format; + + if (typeof options.locale.separator === 'string') + this.locale.separator = options.locale.separator; + + if (typeof options.locale.daysOfWeek === 'object') + this.locale.daysOfWeek = options.locale.daysOfWeek.slice(); + + if (typeof options.locale.monthNames === 'object') + this.locale.monthNames = options.locale.monthNames.slice(); + + if (typeof options.locale.firstDay === 'number') + this.locale.firstDay = options.locale.firstDay; + + if (typeof options.locale.applyLabel === 'string') + this.locale.applyLabel = options.locale.applyLabel; + + if (typeof options.locale.cancelLabel === 'string') + this.locale.cancelLabel = options.locale.cancelLabel; + + if (typeof options.locale.weekLabel === 'string') + this.locale.weekLabel = options.locale.weekLabel; + + if (typeof options.locale.customRangeLabel === 'string'){ + //Support unicode chars in the custom range name. + var elem = document.createElement('textarea'); + elem.innerHTML = options.locale.customRangeLabel; + var rangeHtml = elem.value; + this.locale.customRangeLabel = rangeHtml; + } + } + this.container.addClass(this.locale.direction); + + if (typeof options.startDate === 'string') + this.startDate = moment(options.startDate, this.locale.format); + + if (typeof options.endDate === 'string') + this.endDate = moment(options.endDate, this.locale.format); + + if (typeof options.minDate === 'string') + this.minDate = moment(options.minDate, this.locale.format); + + if (typeof options.maxDate === 'string') + this.maxDate = moment(options.maxDate, this.locale.format); + + if (typeof options.startDate === 'object') + this.startDate = moment(options.startDate); + + if (typeof options.endDate === 'object') + this.endDate = moment(options.endDate); + + if (typeof options.minDate === 'object') + this.minDate = moment(options.minDate); + + if (typeof options.maxDate === 'object') + this.maxDate = moment(options.maxDate); + + // sanity check for bad options + if (this.minDate && this.startDate.isBefore(this.minDate)) + this.startDate = this.minDate.clone(); + + // sanity check for bad options + if (this.maxDate && this.endDate.isAfter(this.maxDate)) + this.endDate = this.maxDate.clone(); + + if (typeof options.applyClass === 'string') + this.applyClass = options.applyClass; + + if (typeof options.cancelClass === 'string') + this.cancelClass = options.cancelClass; + + if (typeof options.dateLimit === 'object') + this.dateLimit = options.dateLimit; + + if (typeof options.opens === 'string') + this.opens = options.opens; + + if (typeof options.drops === 'string') + this.drops = options.drops; + + if (typeof options.showWeekNumbers === 'boolean') + this.showWeekNumbers = options.showWeekNumbers; + + if (typeof options.showISOWeekNumbers === 'boolean') + this.showISOWeekNumbers = options.showISOWeekNumbers; + + if (typeof options.buttonClasses === 'string') + this.buttonClasses = options.buttonClasses; + + if (typeof options.buttonClasses === 'object') + this.buttonClasses = options.buttonClasses.join(' '); + + if (typeof options.showDropdowns === 'boolean') + this.showDropdowns = options.showDropdowns; + + if (typeof options.showCustomRangeLabel === 'boolean') + this.showCustomRangeLabel = options.showCustomRangeLabel; + + if (typeof options.singleDatePicker === 'boolean') { + this.singleDatePicker = options.singleDatePicker; + if (this.singleDatePicker) + this.endDate = this.startDate.clone(); + } + + if (typeof options.timePicker === 'boolean') + this.timePicker = options.timePicker; + + if (typeof options.timePickerSeconds === 'boolean') + this.timePickerSeconds = options.timePickerSeconds; + + if (typeof options.timePickerIncrement === 'number') + this.timePickerIncrement = options.timePickerIncrement; + + if (typeof options.timePicker24Hour === 'boolean') + this.timePicker24Hour = options.timePicker24Hour; + + if (typeof options.autoApply === 'boolean') + this.autoApply = options.autoApply; + + if (typeof options.autoUpdateInput === 'boolean') + this.autoUpdateInput = options.autoUpdateInput; + + if (typeof options.linkedCalendars === 'boolean') + this.linkedCalendars = options.linkedCalendars; + + if (typeof options.isInvalidDate === 'function') + this.isInvalidDate = options.isInvalidDate; + + if (typeof options.isCustomDate === 'function') + this.isCustomDate = options.isCustomDate; + + if (typeof options.alwaysShowCalendars === 'boolean') + this.alwaysShowCalendars = options.alwaysShowCalendars; + + // update day names order to firstDay + if (this.locale.firstDay != 0) { + var iterator = this.locale.firstDay; + while (iterator > 0) { + this.locale.daysOfWeek.push(this.locale.daysOfWeek.shift()); + iterator--; + } + } + + var start, end, range; + + //if no start/end dates set, check if an input element contains initial values + if (typeof options.startDate === 'undefined' && typeof options.endDate === 'undefined') { + if ($(this.element).is('input[type=text]')) { + var val = $(this.element).val(), + split = val.split(this.locale.separator); + + start = end = null; + + if (split.length == 2) { + start = moment(split[0], this.locale.format); + end = moment(split[1], this.locale.format); + } else if (this.singleDatePicker && val !== "") { + start = moment(val, this.locale.format); + end = moment(val, this.locale.format); + } + if (start !== null && end !== null) { + this.setStartDate(start); + this.setEndDate(end); + } + } + } + + if (typeof options.ranges === 'object') { + for (range in options.ranges) { + + if (typeof options.ranges[range][0] === 'string') + start = moment(options.ranges[range][0], this.locale.format); + else + start = moment(options.ranges[range][0]); + + if (typeof options.ranges[range][1] === 'string') + end = moment(options.ranges[range][1], this.locale.format); + else + end = moment(options.ranges[range][1]); + + // If the start or end date exceed those allowed by the minDate or dateLimit + // options, shorten the range to the allowable period. + if (this.minDate && start.isBefore(this.minDate)) + start = this.minDate.clone(); + + var maxDate = this.maxDate; + if (this.dateLimit && maxDate && start.clone().add(this.dateLimit).isAfter(maxDate)) + maxDate = start.clone().add(this.dateLimit); + if (maxDate && end.isAfter(maxDate)) + end = maxDate.clone(); + + // If the end of the range is before the minimum or the start of the range is + // after the maximum, don't display this range option at all. + if ((this.minDate && end.isBefore(this.minDate, this.timepicker ? 'minute' : 'day')) + || (maxDate && start.isAfter(maxDate, this.timepicker ? 'minute' : 'day'))) + continue; + + //Support unicode chars in the range names. + var elem = document.createElement('textarea'); + elem.innerHTML = range; + var rangeHtml = elem.value; + + this.ranges[rangeHtml] = [start, end]; + } + + var list = '
      '; + for (range in this.ranges) { + list += '
    • ' + range + '
    • '; + } + if (this.showCustomRangeLabel) { + list += '
    • ' + this.locale.customRangeLabel + '
    • '; + } + list += '
    '; + this.container.find('.ranges').prepend(list); + } + + if (typeof cb === 'function') { + this.callback = cb; + } + + if (!this.timePicker) { + this.startDate = this.startDate.startOf('day'); + this.endDate = this.endDate.endOf('day'); + this.container.find('.calendar-time').hide(); + } + + //can't be used together for now + if (this.timePicker && this.autoApply) + this.autoApply = false; + + if (this.autoApply && typeof options.ranges !== 'object') { + this.container.find('.ranges').hide(); + } else if (this.autoApply) { + this.container.find('.applyBtn, .cancelBtn').addClass('hide'); + } + + if (this.singleDatePicker) { + this.container.addClass('single'); + this.container.find('.calendar.left').addClass('single'); + this.container.find('.calendar.left').show(); + this.container.find('.calendar.right').hide(); + this.container.find('.daterangepicker_input input, .daterangepicker_input > i').hide(); + if (this.timePicker) { + this.container.find('.ranges ul').hide(); + } else { + this.container.find('.ranges').hide(); + } + } + + if ((typeof options.ranges === 'undefined' && !this.singleDatePicker) || this.alwaysShowCalendars) { + this.container.addClass('show-calendar'); + } + + this.container.addClass('opens' + this.opens); + + //swap the position of the predefined ranges if opens right + if (typeof options.ranges !== 'undefined' && this.opens == 'right') { + this.container.find('.ranges').prependTo( this.container.find('.calendar.left').parent() ); + } + + //apply CSS classes and labels to buttons + this.container.find('.applyBtn, .cancelBtn').addClass(this.buttonClasses); + if (this.applyClass.length) + this.container.find('.applyBtn').addClass(this.applyClass); + if (this.cancelClass.length) + this.container.find('.cancelBtn').addClass(this.cancelClass); + this.container.find('.applyBtn').html(this.locale.applyLabel); + this.container.find('.cancelBtn').html(this.locale.cancelLabel); + + // + // event listeners + // + + this.container.find('.calendar') + .on('click.daterangepicker', '.prev', $.proxy(this.clickPrev, this)) + .on('click.daterangepicker', '.next', $.proxy(this.clickNext, this)) + .on('mousedown.daterangepicker', 'td.available', $.proxy(this.clickDate, this)) + .on('mouseenter.daterangepicker', 'td.available', $.proxy(this.hoverDate, this)) + .on('mouseleave.daterangepicker', 'td.available', $.proxy(this.updateFormInputs, this)) + .on('change.daterangepicker', 'select.yearselect', $.proxy(this.monthOrYearChanged, this)) + .on('change.daterangepicker', 'select.monthselect', $.proxy(this.monthOrYearChanged, this)) + .on('change.daterangepicker', 'select.hourselect,select.minuteselect,select.secondselect,select.ampmselect', $.proxy(this.timeChanged, this)) + .on('click.daterangepicker', '.daterangepicker_input input', $.proxy(this.showCalendars, this)) + .on('focus.daterangepicker', '.daterangepicker_input input', $.proxy(this.formInputsFocused, this)) + .on('blur.daterangepicker', '.daterangepicker_input input', $.proxy(this.formInputsBlurred, this)) + .on('change.daterangepicker', '.daterangepicker_input input', $.proxy(this.formInputsChanged, this)); + + this.container.find('.ranges') + .on('click.daterangepicker', 'button.applyBtn', $.proxy(this.clickApply, this)) + .on('click.daterangepicker', 'button.cancelBtn', $.proxy(this.clickCancel, this)) + .on('click.daterangepicker', 'li', $.proxy(this.clickRange, this)) + .on('mouseenter.daterangepicker', 'li', $.proxy(this.hoverRange, this)) + .on('mouseleave.daterangepicker', 'li', $.proxy(this.updateFormInputs, this)); + + if (this.element.is('input') || this.element.is('button')) { + this.element.on({ + 'click.daterangepicker': $.proxy(this.show, this), + 'focus.daterangepicker': $.proxy(this.show, this), + 'keyup.daterangepicker': $.proxy(this.elementChanged, this), + 'keydown.daterangepicker': $.proxy(this.keydown, this) + }); + } else { + this.element.on('click.daterangepicker', $.proxy(this.toggle, this)); + } + + // + // if attached to a text input, set the initial value + // + + if (this.element.is('input') && !this.singleDatePicker && this.autoUpdateInput) { + this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format)); + this.element.trigger('change'); + } else if (this.element.is('input') && this.autoUpdateInput) { + this.element.val(this.startDate.format(this.locale.format)); + this.element.trigger('change'); + } + + }; + + DateRangePicker.prototype = { + + constructor: DateRangePicker, + + setStartDate: function(startDate) { + if (typeof startDate === 'string') + this.startDate = moment(startDate, this.locale.format); + + if (typeof startDate === 'object') + this.startDate = moment(startDate); + + if (!this.timePicker) + this.startDate = this.startDate.startOf('day'); + + if (this.timePicker && this.timePickerIncrement) + this.startDate.minute(Math.round(this.startDate.minute() / this.timePickerIncrement) * this.timePickerIncrement); + + if (this.minDate && this.startDate.isBefore(this.minDate)) { + this.startDate = this.minDate.clone(); + if (this.timePicker && this.timePickerIncrement) + this.startDate.minute(Math.round(this.startDate.minute() / this.timePickerIncrement) * this.timePickerIncrement); + } + + if (this.maxDate && this.startDate.isAfter(this.maxDate)) { + this.startDate = this.maxDate.clone(); + if (this.timePicker && this.timePickerIncrement) + this.startDate.minute(Math.floor(this.startDate.minute() / this.timePickerIncrement) * this.timePickerIncrement); + } + + if (!this.isShowing) + this.updateElement(); + + this.updateMonthsInView(); + }, + + setEndDate: function(endDate) { + if (typeof endDate === 'string') + this.endDate = moment(endDate, this.locale.format); + + if (typeof endDate === 'object') + this.endDate = moment(endDate); + + if (!this.timePicker) + this.endDate = this.endDate.endOf('day'); + + if (this.timePicker && this.timePickerIncrement) + this.endDate.minute(Math.round(this.endDate.minute() / this.timePickerIncrement) * this.timePickerIncrement); + + if (this.endDate.isBefore(this.startDate)) + this.endDate = this.startDate.clone(); + + if (this.maxDate && this.endDate.isAfter(this.maxDate)) + this.endDate = this.maxDate.clone(); + + if (this.dateLimit && this.startDate.clone().add(this.dateLimit).isBefore(this.endDate)) + this.endDate = this.startDate.clone().add(this.dateLimit); + + this.previousRightTime = this.endDate.clone(); + + if (!this.isShowing) + this.updateElement(); + + this.updateMonthsInView(); + }, + + isInvalidDate: function() { + return false; + }, + + isCustomDate: function() { + return false; + }, + + updateView: function() { + if (this.timePicker) { + this.renderTimePicker('left'); + this.renderTimePicker('right'); + if (!this.endDate) { + this.container.find('.right .calendar-time select').attr('disabled', 'disabled').addClass('disabled'); + } else { + this.container.find('.right .calendar-time select').removeAttr('disabled').removeClass('disabled'); + } + } + if (this.endDate) { + this.container.find('input[name="daterangepicker_end"]').removeClass('active'); + this.container.find('input[name="daterangepicker_start"]').addClass('active'); + } else { + this.container.find('input[name="daterangepicker_end"]').addClass('active'); + this.container.find('input[name="daterangepicker_start"]').removeClass('active'); + } + this.updateMonthsInView(); + this.updateCalendars(); + this.updateFormInputs(); + }, + + updateMonthsInView: function() { + if (this.endDate) { + + //if both dates are visible already, do nothing + if (!this.singleDatePicker && this.leftCalendar.month && this.rightCalendar.month && + (this.startDate.format('YYYY-MM') == this.leftCalendar.month.format('YYYY-MM') || this.startDate.format('YYYY-MM') == this.rightCalendar.month.format('YYYY-MM')) + && + (this.endDate.format('YYYY-MM') == this.leftCalendar.month.format('YYYY-MM') || this.endDate.format('YYYY-MM') == this.rightCalendar.month.format('YYYY-MM')) + ) { + return; + } + + this.leftCalendar.month = this.startDate.clone().date(2); + if (!this.linkedCalendars && (this.endDate.month() != this.startDate.month() || this.endDate.year() != this.startDate.year())) { + this.rightCalendar.month = this.endDate.clone().date(2); + } else { + this.rightCalendar.month = this.startDate.clone().date(2).add(1, 'month'); + } + + } else { + if (this.leftCalendar.month.format('YYYY-MM') != this.startDate.format('YYYY-MM') && this.rightCalendar.month.format('YYYY-MM') != this.startDate.format('YYYY-MM')) { + this.leftCalendar.month = this.startDate.clone().date(2); + this.rightCalendar.month = this.startDate.clone().date(2).add(1, 'month'); + } + } + if (this.maxDate && this.linkedCalendars && !this.singleDatePicker && this.rightCalendar.month > this.maxDate) { + this.rightCalendar.month = this.maxDate.clone().date(2); + this.leftCalendar.month = this.maxDate.clone().date(2).subtract(1, 'month'); + } + }, + + updateCalendars: function() { + + if (this.timePicker) { + var hour, minute, second; + if (this.endDate) { + hour = parseInt(this.container.find('.left .hourselect').val(), 10); + minute = parseInt(this.container.find('.left .minuteselect').val(), 10); + second = this.timePickerSeconds ? parseInt(this.container.find('.left .secondselect').val(), 10) : 0; + if (!this.timePicker24Hour) { + var ampm = this.container.find('.left .ampmselect').val(); + if (ampm === 'PM' && hour < 12) + hour += 12; + if (ampm === 'AM' && hour === 12) + hour = 0; + } + } else { + hour = parseInt(this.container.find('.right .hourselect').val(), 10); + minute = parseInt(this.container.find('.right .minuteselect').val(), 10); + second = this.timePickerSeconds ? parseInt(this.container.find('.right .secondselect').val(), 10) : 0; + if (!this.timePicker24Hour) { + var ampm = this.container.find('.right .ampmselect').val(); + if (ampm === 'PM' && hour < 12) + hour += 12; + if (ampm === 'AM' && hour === 12) + hour = 0; + } + } + this.leftCalendar.month.hour(hour).minute(minute).second(second); + this.rightCalendar.month.hour(hour).minute(minute).second(second); + } + + this.renderCalendar('left'); + this.renderCalendar('right'); + + //highlight any predefined range matching the current start and end dates + this.container.find('.ranges li').removeClass('active'); + if (this.endDate == null) return; + + this.calculateChosenLabel(); + }, + + renderCalendar: function(side) { + + // + // Build the matrix of dates that will populate the calendar + // + + var calendar = side == 'left' ? this.leftCalendar : this.rightCalendar; + var month = calendar.month.month(); + var year = calendar.month.year(); + var hour = calendar.month.hour(); + var minute = calendar.month.minute(); + var second = calendar.month.second(); + var daysInMonth = moment([year, month]).daysInMonth(); + var firstDay = moment([year, month, 1]); + var lastDay = moment([year, month, daysInMonth]); + var lastMonth = moment(firstDay).subtract(1, 'month').month(); + var lastYear = moment(firstDay).subtract(1, 'month').year(); + var daysInLastMonth = moment([lastYear, lastMonth]).daysInMonth(); + var dayOfWeek = firstDay.day(); + + //initialize a 6 rows x 7 columns array for the calendar + var calendar = []; + calendar.firstDay = firstDay; + calendar.lastDay = lastDay; + + for (var i = 0; i < 6; i++) { + calendar[i] = []; + } + + //populate the calendar with date objects + var startDay = daysInLastMonth - dayOfWeek + this.locale.firstDay + 1; + if (startDay > daysInLastMonth) + startDay -= 7; + + if (dayOfWeek == this.locale.firstDay) + startDay = daysInLastMonth - 6; + + var curDate = moment([lastYear, lastMonth, startDay, 12, minute, second]); + + var col, row; + for (var i = 0, col = 0, row = 0; i < 42; i++, col++, curDate = moment(curDate).add(24, 'hour')) { + if (i > 0 && col % 7 === 0) { + col = 0; + row++; + } + calendar[row][col] = curDate.clone().hour(hour).minute(minute).second(second); + curDate.hour(12); + + if (this.minDate && calendar[row][col].format('YYYY-MM-DD') == this.minDate.format('YYYY-MM-DD') && calendar[row][col].isBefore(this.minDate) && side == 'left') { + calendar[row][col] = this.minDate.clone(); + } + + if (this.maxDate && calendar[row][col].format('YYYY-MM-DD') == this.maxDate.format('YYYY-MM-DD') && calendar[row][col].isAfter(this.maxDate) && side == 'right') { + calendar[row][col] = this.maxDate.clone(); + } + + } + + //make the calendar object available to hoverDate/clickDate + if (side == 'left') { + this.leftCalendar.calendar = calendar; + } else { + this.rightCalendar.calendar = calendar; + } + + // + // Display the calendar + // + + var minDate = side == 'left' ? this.minDate : this.startDate; + var maxDate = this.maxDate; + var selected = side == 'left' ? this.startDate : this.endDate; + var arrow = this.locale.direction == 'ltr' ? {left: 'chevron-left', right: 'chevron-right'} : {left: 'chevron-right', right: 'chevron-left'}; + + var html = ''; + html += ''; + html += ''; + + // add empty cell for week number + if (this.showWeekNumbers || this.showISOWeekNumbers) + html += ''; + + if ((!minDate || minDate.isBefore(calendar.firstDay)) && (!this.linkedCalendars || side == 'left')) { + html += ''; + } else { + html += ''; + } + + var dateHtml = this.locale.monthNames[calendar[1][1].month()] + calendar[1][1].format(" YYYY"); + + if (this.showDropdowns) { + var currentMonth = calendar[1][1].month(); + var currentYear = calendar[1][1].year(); + var maxYear = (maxDate && maxDate.year()) || (currentYear + 5); + var minYear = (minDate && minDate.year()) || (currentYear - 50); + var inMinYear = currentYear == minYear; + var inMaxYear = currentYear == maxYear; + + var monthHtml = '"; + + var yearHtml = ''; + + dateHtml = monthHtml + yearHtml; + } + + html += ''; + if ((!maxDate || maxDate.isAfter(calendar.lastDay)) && (!this.linkedCalendars || side == 'right' || this.singleDatePicker)) { + html += ''; + } else { + html += ''; + } + + html += ''; + html += ''; + + // add week number label + if (this.showWeekNumbers || this.showISOWeekNumbers) + html += ''; + + $.each(this.locale.daysOfWeek, function(index, dayOfWeek) { + html += ''; + }); + + html += ''; + html += ''; + html += ''; + + //adjust maxDate to reflect the dateLimit setting in order to + //grey out end dates beyond the dateLimit + if (this.endDate == null && this.dateLimit) { + var maxLimit = this.startDate.clone().add(this.dateLimit).endOf('day'); + if (!maxDate || maxLimit.isBefore(maxDate)) { + maxDate = maxLimit; + } + } + + for (var row = 0; row < 6; row++) { + html += ''; + + // add week number + if (this.showWeekNumbers) + html += ''; + else if (this.showISOWeekNumbers) + html += ''; + + for (var col = 0; col < 7; col++) { + + var classes = []; + + //highlight today's date + if (calendar[row][col].isSame(new Date(), "day")) + classes.push('today'); + + //highlight weekends + if (calendar[row][col].isoWeekday() > 5) + classes.push('weekend'); + + //grey out the dates in other months displayed at beginning and end of this calendar + if (calendar[row][col].month() != calendar[1][1].month()) + classes.push('off'); + + //don't allow selection of dates before the minimum date + if (this.minDate && calendar[row][col].isBefore(this.minDate, 'day')) + classes.push('off', 'disabled'); + + //don't allow selection of dates after the maximum date + if (maxDate && calendar[row][col].isAfter(maxDate, 'day')) + classes.push('off', 'disabled'); + + //don't allow selection of date if a custom function decides it's invalid + if (this.isInvalidDate(calendar[row][col])) + classes.push('off', 'disabled'); + + //highlight the currently selected start date + if (calendar[row][col].format('YYYY-MM-DD') == this.startDate.format('YYYY-MM-DD')) + classes.push('active', 'start-date'); + + //highlight the currently selected end date + if (this.endDate != null && calendar[row][col].format('YYYY-MM-DD') == this.endDate.format('YYYY-MM-DD')) + classes.push('active', 'end-date'); + + //highlight dates in-between the selected dates + if (this.endDate != null && calendar[row][col] > this.startDate && calendar[row][col] < this.endDate) + classes.push('in-range'); + + //apply custom classes for this date + var isCustom = this.isCustomDate(calendar[row][col]); + if (isCustom !== false) { + if (typeof isCustom === 'string') + classes.push(isCustom); + else + Array.prototype.push.apply(classes, isCustom); + } + + var cname = '', disabled = false; + for (var i = 0; i < classes.length; i++) { + cname += classes[i] + ' '; + if (classes[i] == 'disabled') + disabled = true; + } + if (!disabled) + cname += 'available'; + + html += ''; + + } + html += ''; + } + + html += ''; + html += '
    ' + dateHtml + '
    ' + this.locale.weekLabel + '' + dayOfWeek + '
    ' + calendar[row][0].week() + '' + calendar[row][0].isoWeek() + '' + calendar[row][col].date() + '
    '; + + this.container.find('.calendar.' + side + ' .calendar-table').html(html); + + }, + + renderTimePicker: function(side) { + + // Don't bother updating the time picker if it's currently disabled + // because an end date hasn't been clicked yet + if (side == 'right' && !this.endDate) return; + + var html, selected, minDate, maxDate = this.maxDate; + + if (this.dateLimit && (!this.maxDate || this.startDate.clone().add(this.dateLimit).isAfter(this.maxDate))) + maxDate = this.startDate.clone().add(this.dateLimit); + + if (side == 'left') { + selected = this.startDate.clone(); + minDate = this.minDate; + } else if (side == 'right') { + selected = this.endDate.clone(); + minDate = this.startDate; + + //Preserve the time already selected + var timeSelector = this.container.find('.calendar.right .calendar-time div'); + if (timeSelector.html() != '') { + + selected.hour(timeSelector.find('.hourselect option:selected').val() || selected.hour()); + selected.minute(timeSelector.find('.minuteselect option:selected').val() || selected.minute()); + selected.second(timeSelector.find('.secondselect option:selected').val() || selected.second()); + + if (!this.timePicker24Hour) { + var ampm = timeSelector.find('.ampmselect option:selected').val(); + if (ampm === 'PM' && selected.hour() < 12) + selected.hour(selected.hour() + 12); + if (ampm === 'AM' && selected.hour() === 12) + selected.hour(0); + } + + } + + if (selected.isBefore(this.startDate)) + selected = this.startDate.clone(); + + if (maxDate && selected.isAfter(maxDate)) + selected = maxDate.clone(); + + } + + // + // hours + // + + html = ' '; + + // + // minutes + // + + html += ': '; + + // + // seconds + // + + if (this.timePickerSeconds) { + html += ': '; + } + + // + // AM/PM + // + + if (!this.timePicker24Hour) { + html += ''; + } + + this.container.find('.calendar.' + side + ' .calendar-time div').html(html); + + }, + + updateFormInputs: function() { + + //ignore mouse movements while an above-calendar text input has focus + if (this.container.find('input[name=daterangepicker_start]').is(":focus") || this.container.find('input[name=daterangepicker_end]').is(":focus")) + return; + + this.container.find('input[name=daterangepicker_start]').val(this.startDate.format(this.locale.format)); + if (this.endDate) + this.container.find('input[name=daterangepicker_end]').val(this.endDate.format(this.locale.format)); + + if (this.singleDatePicker || (this.endDate && (this.startDate.isBefore(this.endDate) || this.startDate.isSame(this.endDate)))) { + this.container.find('button.applyBtn').removeAttr('disabled'); + } else { + this.container.find('button.applyBtn').attr('disabled', 'disabled'); + } + + }, + + move: function() { + var parentOffset = { top: 0, left: 0 }, + containerTop; + var parentRightEdge = $(window).width(); + if (!this.parentEl.is('body')) { + parentOffset = { + top: this.parentEl.offset().top - this.parentEl.scrollTop(), + left: this.parentEl.offset().left - this.parentEl.scrollLeft() + }; + parentRightEdge = this.parentEl[0].clientWidth + this.parentEl.offset().left; + } + + if (this.drops == 'up') + containerTop = this.element.offset().top - this.container.outerHeight() - parentOffset.top; + else + containerTop = this.element.offset().top + this.element.outerHeight() - parentOffset.top; + this.container[this.drops == 'up' ? 'addClass' : 'removeClass']('dropup'); + + if (this.opens == 'left') { + this.container.css({ + top: containerTop, + right: parentRightEdge - this.element.offset().left - this.element.outerWidth(), + left: 'auto' + }); + if (this.container.offset().left < 0) { + this.container.css({ + right: 'auto', + left: 9 + }); + } + } else if (this.opens == 'center') { + this.container.css({ + top: containerTop, + left: this.element.offset().left - parentOffset.left + this.element.outerWidth() / 2 + - this.container.outerWidth() / 2, + right: 'auto' + }); + if (this.container.offset().left < 0) { + this.container.css({ + right: 'auto', + left: 9 + }); + } + } else { + this.container.css({ + top: containerTop, + left: this.element.offset().left - parentOffset.left, + right: 'auto' + }); + if (this.container.offset().left + this.container.outerWidth() > $(window).width()) { + this.container.css({ + left: 'auto', + right: 0 + }); + } + } + }, + + show: function(e) { + if (this.isShowing) return; + + // Create a click proxy that is private to this instance of datepicker, for unbinding + this._outsideClickProxy = $.proxy(function(e) { this.outsideClick(e); }, this); + + // Bind global datepicker mousedown for hiding and + $(document) + .on('mousedown.daterangepicker', this._outsideClickProxy) + // also support mobile devices + .on('touchend.daterangepicker', this._outsideClickProxy) + // also explicitly play nice with Bootstrap dropdowns, which stopPropagation when clicking them + .on('click.daterangepicker', '[data-toggle=dropdown]', this._outsideClickProxy) + // and also close when focus changes to outside the picker (eg. tabbing between controls) + .on('focusin.daterangepicker', this._outsideClickProxy); + + // Reposition the picker if the window is resized while it's open + $(window).on('resize.daterangepicker', $.proxy(function(e) { this.move(e); }, this)); + + this.oldStartDate = this.startDate.clone(); + this.oldEndDate = this.endDate.clone(); + this.previousRightTime = this.endDate.clone(); + + this.updateView(); + this.container.show(); + this.move(); + this.element.trigger('show.daterangepicker', this); + this.isShowing = true; + }, + + hide: function(e) { + if (!this.isShowing) return; + + //incomplete date selection, revert to last values + if (!this.endDate) { + this.startDate = this.oldStartDate.clone(); + this.endDate = this.oldEndDate.clone(); + } + + //if a new date range was selected, invoke the user callback function + if (!this.startDate.isSame(this.oldStartDate) || !this.endDate.isSame(this.oldEndDate)) + this.callback(this.startDate, this.endDate, this.chosenLabel); + + //if picker is attached to a text input, update it + this.updateElement(); + + $(document).off('.daterangepicker'); + $(window).off('.daterangepicker'); + this.container.hide(); + this.element.trigger('hide.daterangepicker', this); + this.isShowing = false; + }, + + toggle: function(e) { + if (this.isShowing) { + this.hide(); + } else { + this.show(); + } + }, + + outsideClick: function(e) { + var target = $(e.target); + // if the page is clicked anywhere except within the daterangerpicker/button + // itself then call this.hide() + if ( + // ie modal dialog fix + e.type == "focusin" || + target.closest(this.element).length || + target.closest(this.container).length || + target.closest('.calendar-table').length + ) return; + this.hide(); + this.element.trigger('outsideClick.daterangepicker', this); + }, + + showCalendars: function() { + this.container.addClass('show-calendar'); + this.move(); + this.element.trigger('showCalendar.daterangepicker', this); + }, + + hideCalendars: function() { + this.container.removeClass('show-calendar'); + this.element.trigger('hideCalendar.daterangepicker', this); + }, + + hoverRange: function(e) { + + //ignore mouse movements while an above-calendar text input has focus + if (this.container.find('input[name=daterangepicker_start]').is(":focus") || this.container.find('input[name=daterangepicker_end]').is(":focus")) + return; + + var label = e.target.getAttribute('data-range-key'); + + if (label == this.locale.customRangeLabel) { + this.updateView(); + } else { + var dates = this.ranges[label]; + this.container.find('input[name=daterangepicker_start]').val(dates[0].format(this.locale.format)); + this.container.find('input[name=daterangepicker_end]').val(dates[1].format(this.locale.format)); + } + + }, + + clickRange: function(e) { + var label = e.target.getAttribute('data-range-key'); + this.chosenLabel = label; + if (label == this.locale.customRangeLabel) { + this.showCalendars(); + } else { + var dates = this.ranges[label]; + this.startDate = dates[0]; + this.endDate = dates[1]; + + if (!this.timePicker) { + this.startDate.startOf('day'); + this.endDate.endOf('day'); + } + + if (!this.alwaysShowCalendars) + this.hideCalendars(); + this.clickApply(); + } + }, + + clickPrev: function(e) { + var cal = $(e.target).parents('.calendar'); + if (cal.hasClass('left')) { + this.leftCalendar.month.subtract(1, 'month'); + if (this.linkedCalendars) + this.rightCalendar.month.subtract(1, 'month'); + } else { + this.rightCalendar.month.subtract(1, 'month'); + } + this.updateCalendars(); + }, + + clickNext: function(e) { + var cal = $(e.target).parents('.calendar'); + if (cal.hasClass('left')) { + this.leftCalendar.month.add(1, 'month'); + } else { + this.rightCalendar.month.add(1, 'month'); + if (this.linkedCalendars) + this.leftCalendar.month.add(1, 'month'); + } + this.updateCalendars(); + }, + + hoverDate: function(e) { + + //ignore mouse movements while an above-calendar text input has focus + //if (this.container.find('input[name=daterangepicker_start]').is(":focus") || this.container.find('input[name=daterangepicker_end]').is(":focus")) + // return; + + //ignore dates that can't be selected + if (!$(e.target).hasClass('available')) return; + + //have the text inputs above calendars reflect the date being hovered over + var title = $(e.target).attr('data-title'); + var row = title.substr(1, 1); + var col = title.substr(3, 1); + var cal = $(e.target).parents('.calendar'); + var date = cal.hasClass('left') ? this.leftCalendar.calendar[row][col] : this.rightCalendar.calendar[row][col]; + + if (this.endDate && !this.container.find('input[name=daterangepicker_start]').is(":focus")) { + this.container.find('input[name=daterangepicker_start]').val(date.format(this.locale.format)); + } else if (!this.endDate && !this.container.find('input[name=daterangepicker_end]').is(":focus")) { + this.container.find('input[name=daterangepicker_end]').val(date.format(this.locale.format)); + } + + //highlight the dates between the start date and the date being hovered as a potential end date + var leftCalendar = this.leftCalendar; + var rightCalendar = this.rightCalendar; + var startDate = this.startDate; + if (!this.endDate) { + this.container.find('.calendar tbody td').each(function(index, el) { + + //skip week numbers, only look at dates + if ($(el).hasClass('week')) return; + + var title = $(el).attr('data-title'); + var row = title.substr(1, 1); + var col = title.substr(3, 1); + var cal = $(el).parents('.calendar'); + var dt = cal.hasClass('left') ? leftCalendar.calendar[row][col] : rightCalendar.calendar[row][col]; + + if ((dt.isAfter(startDate) && dt.isBefore(date)) || dt.isSame(date, 'day')) { + $(el).addClass('in-range'); + } else { + $(el).removeClass('in-range'); + } + + }); + } + + }, + + clickDate: function(e) { + + if (!$(e.target).hasClass('available')) return; + + var title = $(e.target).attr('data-title'); + var row = title.substr(1, 1); + var col = title.substr(3, 1); + var cal = $(e.target).parents('.calendar'); + var date = cal.hasClass('left') ? this.leftCalendar.calendar[row][col] : this.rightCalendar.calendar[row][col]; + + // + // this function needs to do a few things: + // * alternate between selecting a start and end date for the range, + // * if the time picker is enabled, apply the hour/minute/second from the select boxes to the clicked date + // * if autoapply is enabled, and an end date was chosen, apply the selection + // * if single date picker mode, and time picker isn't enabled, apply the selection immediately + // * if one of the inputs above the calendars was focused, cancel that manual input + // + + if (this.endDate || date.isBefore(this.startDate, 'day')) { //picking start + if (this.timePicker) { + var hour = parseInt(this.container.find('.left .hourselect').val(), 10); + if (!this.timePicker24Hour) { + var ampm = this.container.find('.left .ampmselect').val(); + if (ampm === 'PM' && hour < 12) + hour += 12; + if (ampm === 'AM' && hour === 12) + hour = 0; + } + var minute = parseInt(this.container.find('.left .minuteselect').val(), 10); + var second = this.timePickerSeconds ? parseInt(this.container.find('.left .secondselect').val(), 10) : 0; + date = date.clone().hour(hour).minute(minute).second(second); + } + this.endDate = null; + this.setStartDate(date.clone()); + } else if (!this.endDate && date.isBefore(this.startDate)) { + //special case: clicking the same date for start/end, + //but the time of the end date is before the start date + this.setEndDate(this.startDate.clone()); + } else { // picking end + if (this.timePicker) { + var hour = parseInt(this.container.find('.right .hourselect').val(), 10); + if (!this.timePicker24Hour) { + var ampm = this.container.find('.right .ampmselect').val(); + if (ampm === 'PM' && hour < 12) + hour += 12; + if (ampm === 'AM' && hour === 12) + hour = 0; + } + var minute = parseInt(this.container.find('.right .minuteselect').val(), 10); + var second = this.timePickerSeconds ? parseInt(this.container.find('.right .secondselect').val(), 10) : 0; + date = date.clone().hour(hour).minute(minute).second(second); + } + this.setEndDate(date.clone()); + if (this.autoApply) { + this.calculateChosenLabel(); + this.clickApply(); + } + } + + if (this.singleDatePicker) { + this.setEndDate(this.startDate); + if (!this.timePicker) + this.clickApply(); + } + + this.updateView(); + + //This is to cancel the blur event handler if the mouse was in one of the inputs + e.stopPropagation(); + + }, + + calculateChosenLabel: function () { + var customRange = true; + var i = 0; + for (var range in this.ranges) { + if (this.timePicker) { + if (this.startDate.isSame(this.ranges[range][0]) && this.endDate.isSame(this.ranges[range][1])) { + customRange = false; + this.chosenLabel = this.container.find('.ranges li:eq(' + i + ')').addClass('active').html(); + break; + } + } else { + //ignore times when comparing dates if time picker is not enabled + if (this.startDate.format('YYYY-MM-DD') == this.ranges[range][0].format('YYYY-MM-DD') && this.endDate.format('YYYY-MM-DD') == this.ranges[range][1].format('YYYY-MM-DD')) { + customRange = false; + this.chosenLabel = this.container.find('.ranges li:eq(' + i + ')').addClass('active').html(); + break; + } + } + i++; + } + if (customRange) { + if (this.showCustomRangeLabel) { + this.chosenLabel = this.container.find('.ranges li:last').addClass('active').html(); + } else { + this.chosenLabel = null; + } + this.showCalendars(); + } + }, + + clickApply: function(e) { + this.hide(); + this.element.trigger('apply.daterangepicker', this); + }, + + clickCancel: function(e) { + this.startDate = this.oldStartDate; + this.endDate = this.oldEndDate; + this.hide(); + this.element.trigger('cancel.daterangepicker', this); + }, + + monthOrYearChanged: function(e) { + var isLeft = $(e.target).closest('.calendar').hasClass('left'), + leftOrRight = isLeft ? 'left' : 'right', + cal = this.container.find('.calendar.'+leftOrRight); + + // Month must be Number for new moment versions + var month = parseInt(cal.find('.monthselect').val(), 10); + var year = cal.find('.yearselect').val(); + + if (!isLeft) { + if (year < this.startDate.year() || (year == this.startDate.year() && month < this.startDate.month())) { + month = this.startDate.month(); + year = this.startDate.year(); + } + } + + if (this.minDate) { + if (year < this.minDate.year() || (year == this.minDate.year() && month < this.minDate.month())) { + month = this.minDate.month(); + year = this.minDate.year(); + } + } + + if (this.maxDate) { + if (year > this.maxDate.year() || (year == this.maxDate.year() && month > this.maxDate.month())) { + month = this.maxDate.month(); + year = this.maxDate.year(); + } + } + + if (isLeft) { + this.leftCalendar.month.month(month).year(year); + if (this.linkedCalendars) + this.rightCalendar.month = this.leftCalendar.month.clone().add(1, 'month'); + } else { + this.rightCalendar.month.month(month).year(year); + if (this.linkedCalendars) + this.leftCalendar.month = this.rightCalendar.month.clone().subtract(1, 'month'); + } + this.updateCalendars(); + }, + + timeChanged: function(e) { + + var cal = $(e.target).closest('.calendar'), + isLeft = cal.hasClass('left'); + + var hour = parseInt(cal.find('.hourselect').val(), 10); + var minute = parseInt(cal.find('.minuteselect').val(), 10); + var second = this.timePickerSeconds ? parseInt(cal.find('.secondselect').val(), 10) : 0; + + if (!this.timePicker24Hour) { + var ampm = cal.find('.ampmselect').val(); + if (ampm === 'PM' && hour < 12) + hour += 12; + if (ampm === 'AM' && hour === 12) + hour = 0; + } + + if (isLeft) { + var start = this.startDate.clone(); + start.hour(hour); + start.minute(minute); + start.second(second); + this.setStartDate(start); + if (this.singleDatePicker) { + this.endDate = this.startDate.clone(); + } else if (this.endDate && this.endDate.format('YYYY-MM-DD') == start.format('YYYY-MM-DD') && this.endDate.isBefore(start)) { + this.setEndDate(start.clone()); + } + } else if (this.endDate) { + var end = this.endDate.clone(); + end.hour(hour); + end.minute(minute); + end.second(second); + this.setEndDate(end); + } + + //update the calendars so all clickable dates reflect the new time component + this.updateCalendars(); + + //update the form inputs above the calendars with the new time + this.updateFormInputs(); + + //re-render the time pickers because changing one selection can affect what's enabled in another + this.renderTimePicker('left'); + this.renderTimePicker('right'); + + }, + + formInputsChanged: function(e) { + var isRight = $(e.target).closest('.calendar').hasClass('right'); + var start = moment(this.container.find('input[name="daterangepicker_start"]').val(), this.locale.format); + var end = moment(this.container.find('input[name="daterangepicker_end"]').val(), this.locale.format); + + if (start.isValid() && end.isValid()) { + + if (isRight && end.isBefore(start)) + start = end.clone(); + + this.setStartDate(start); + this.setEndDate(end); + + if (isRight) { + this.container.find('input[name="daterangepicker_start"]').val(this.startDate.format(this.locale.format)); + } else { + this.container.find('input[name="daterangepicker_end"]').val(this.endDate.format(this.locale.format)); + } + + } + + this.updateView(); + }, + + formInputsFocused: function(e) { + + // Highlight the focused input + this.container.find('input[name="daterangepicker_start"], input[name="daterangepicker_end"]').removeClass('active'); + $(e.target).addClass('active'); + + // Set the state such that if the user goes back to using a mouse, + // the calendars are aware we're selecting the end of the range, not + // the start. This allows someone to edit the end of a date range without + // re-selecting the beginning, by clicking on the end date input then + // using the calendar. + var isRight = $(e.target).closest('.calendar').hasClass('right'); + if (isRight) { + this.endDate = null; + this.setStartDate(this.startDate.clone()); + this.updateView(); + } + + }, + + formInputsBlurred: function(e) { + + // this function has one purpose right now: if you tab from the first + // text input to the second in the UI, the endDate is nulled so that + // you can click another, but if you tab out without clicking anything + // or changing the input value, the old endDate should be retained + + if (!this.endDate) { + var val = this.container.find('input[name="daterangepicker_end"]').val(); + var end = moment(val, this.locale.format); + if (end.isValid()) { + this.setEndDate(end); + this.updateView(); + } + } + + }, + + elementChanged: function() { + if (!this.element.is('input')) return; + if (!this.element.val().length) return; + if (this.element.val().length < this.locale.format.length) return; + + var dateString = this.element.val().split(this.locale.separator), + start = null, + end = null; + + if (dateString.length === 2) { + start = moment(dateString[0], this.locale.format); + end = moment(dateString[1], this.locale.format); + } + + if (this.singleDatePicker || start === null || end === null) { + start = moment(this.element.val(), this.locale.format); + end = start; + } + + if (!start.isValid() || !end.isValid()) return; + + this.setStartDate(start); + this.setEndDate(end); + this.updateView(); + }, + + keydown: function(e) { + //hide on tab or enter + if ((e.keyCode === 9) || (e.keyCode === 13)) { + this.hide(); + } + }, + + updateElement: function() { + if (this.element.is('input') && !this.singleDatePicker && this.autoUpdateInput) { + this.element.val(this.startDate.format(this.locale.format) + this.locale.separator + this.endDate.format(this.locale.format)); + this.element.trigger('change'); + } else if (this.element.is('input') && this.autoUpdateInput) { + this.element.val(this.startDate.format(this.locale.format)); + this.element.trigger('change'); + } + }, + + remove: function() { + this.container.remove(); + this.element.off('.daterangepicker'); + this.element.removeData(); + } + + }; + + $.fn.daterangepicker = function(options, callback) { + this.each(function() { + var el = $(this); + if (el.data('daterangepicker')) + el.data('daterangepicker').remove(); + el.data('daterangepicker', new DateRangePicker(el, options, callback)); + }); + return this; + }; + + return DateRangePicker; + +})); diff --git a/public/vendor/daterangepicker/moment.js b/public/vendor/daterangepicker/moment.js new file mode 100755 index 000000000..ed94e44a1 --- /dev/null +++ b/public/vendor/daterangepicker/moment.js @@ -0,0 +1,4040 @@ +//! moment.js +//! version : 2.13.0 +//! authors : Tim Wood, Iskren Chernev, Moment.js contributors +//! license : MIT +//! momentjs.com + +;(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + global.moment = factory() +}(this, function () { 'use strict'; + + var hookCallback; + + function utils_hooks__hooks () { + return hookCallback.apply(null, arguments); + } + + // This is done to register the method called with moment() + // without creating circular dependencies. + function setHookCallback (callback) { + hookCallback = callback; + } + + function isArray(input) { + return input instanceof Array || Object.prototype.toString.call(input) === '[object Array]'; + } + + function isDate(input) { + return input instanceof Date || Object.prototype.toString.call(input) === '[object Date]'; + } + + function map(arr, fn) { + var res = [], i; + for (i = 0; i < arr.length; ++i) { + res.push(fn(arr[i], i)); + } + return res; + } + + function hasOwnProp(a, b) { + return Object.prototype.hasOwnProperty.call(a, b); + } + + function extend(a, b) { + for (var i in b) { + if (hasOwnProp(b, i)) { + a[i] = b[i]; + } + } + + if (hasOwnProp(b, 'toString')) { + a.toString = b.toString; + } + + if (hasOwnProp(b, 'valueOf')) { + a.valueOf = b.valueOf; + } + + return a; + } + + function create_utc__createUTC (input, format, locale, strict) { + return createLocalOrUTC(input, format, locale, strict, true).utc(); + } + + function defaultParsingFlags() { + // We need to deep clone this object. + return { + empty : false, + unusedTokens : [], + unusedInput : [], + overflow : -2, + charsLeftOver : 0, + nullInput : false, + invalidMonth : null, + invalidFormat : false, + userInvalidated : false, + iso : false, + parsedDateParts : [], + meridiem : null + }; + } + + function getParsingFlags(m) { + if (m._pf == null) { + m._pf = defaultParsingFlags(); + } + return m._pf; + } + + var some; + if (Array.prototype.some) { + some = Array.prototype.some; + } else { + some = function (fun) { + var t = Object(this); + var len = t.length >>> 0; + + for (var i = 0; i < len; i++) { + if (i in t && fun.call(this, t[i], i, t)) { + return true; + } + } + + return false; + }; + } + + function valid__isValid(m) { + if (m._isValid == null) { + var flags = getParsingFlags(m); + var parsedParts = some.call(flags.parsedDateParts, function (i) { + return i != null; + }); + m._isValid = !isNaN(m._d.getTime()) && + flags.overflow < 0 && + !flags.empty && + !flags.invalidMonth && + !flags.invalidWeekday && + !flags.nullInput && + !flags.invalidFormat && + !flags.userInvalidated && + (!flags.meridiem || (flags.meridiem && parsedParts)); + + if (m._strict) { + m._isValid = m._isValid && + flags.charsLeftOver === 0 && + flags.unusedTokens.length === 0 && + flags.bigHour === undefined; + } + } + return m._isValid; + } + + function valid__createInvalid (flags) { + var m = create_utc__createUTC(NaN); + if (flags != null) { + extend(getParsingFlags(m), flags); + } + else { + getParsingFlags(m).userInvalidated = true; + } + + return m; + } + + function isUndefined(input) { + return input === void 0; + } + + // Plugins that add properties should also add the key here (null value), + // so we can properly clone ourselves. + var momentProperties = utils_hooks__hooks.momentProperties = []; + + function copyConfig(to, from) { + var i, prop, val; + + if (!isUndefined(from._isAMomentObject)) { + to._isAMomentObject = from._isAMomentObject; + } + if (!isUndefined(from._i)) { + to._i = from._i; + } + if (!isUndefined(from._f)) { + to._f = from._f; + } + if (!isUndefined(from._l)) { + to._l = from._l; + } + if (!isUndefined(from._strict)) { + to._strict = from._strict; + } + if (!isUndefined(from._tzm)) { + to._tzm = from._tzm; + } + if (!isUndefined(from._isUTC)) { + to._isUTC = from._isUTC; + } + if (!isUndefined(from._offset)) { + to._offset = from._offset; + } + if (!isUndefined(from._pf)) { + to._pf = getParsingFlags(from); + } + if (!isUndefined(from._locale)) { + to._locale = from._locale; + } + + if (momentProperties.length > 0) { + for (i in momentProperties) { + prop = momentProperties[i]; + val = from[prop]; + if (!isUndefined(val)) { + to[prop] = val; + } + } + } + + return to; + } + + var updateInProgress = false; + + // Moment prototype object + function Moment(config) { + copyConfig(this, config); + this._d = new Date(config._d != null ? config._d.getTime() : NaN); + // Prevent infinite loop in case updateOffset creates new moment + // objects. + if (updateInProgress === false) { + updateInProgress = true; + utils_hooks__hooks.updateOffset(this); + updateInProgress = false; + } + } + + function isMoment (obj) { + return obj instanceof Moment || (obj != null && obj._isAMomentObject != null); + } + + function absFloor (number) { + if (number < 0) { + return Math.ceil(number); + } else { + return Math.floor(number); + } + } + + function toInt(argumentForCoercion) { + var coercedNumber = +argumentForCoercion, + value = 0; + + if (coercedNumber !== 0 && isFinite(coercedNumber)) { + value = absFloor(coercedNumber); + } + + return value; + } + + // compare two arrays, return the number of differences + function compareArrays(array1, array2, dontConvert) { + var len = Math.min(array1.length, array2.length), + lengthDiff = Math.abs(array1.length - array2.length), + diffs = 0, + i; + for (i = 0; i < len; i++) { + if ((dontConvert && array1[i] !== array2[i]) || + (!dontConvert && toInt(array1[i]) !== toInt(array2[i]))) { + diffs++; + } + } + return diffs + lengthDiff; + } + + function warn(msg) { + if (utils_hooks__hooks.suppressDeprecationWarnings === false && + (typeof console !== 'undefined') && console.warn) { + console.warn('Deprecation warning: ' + msg); + } + } + + function deprecate(msg, fn) { + var firstTime = true; + + return extend(function () { + if (utils_hooks__hooks.deprecationHandler != null) { + utils_hooks__hooks.deprecationHandler(null, msg); + } + if (firstTime) { + warn(msg + '\nArguments: ' + Array.prototype.slice.call(arguments).join(', ') + '\n' + (new Error()).stack); + firstTime = false; + } + return fn.apply(this, arguments); + }, fn); + } + + var deprecations = {}; + + function deprecateSimple(name, msg) { + if (utils_hooks__hooks.deprecationHandler != null) { + utils_hooks__hooks.deprecationHandler(name, msg); + } + if (!deprecations[name]) { + warn(msg); + deprecations[name] = true; + } + } + + utils_hooks__hooks.suppressDeprecationWarnings = false; + utils_hooks__hooks.deprecationHandler = null; + + function isFunction(input) { + return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; + } + + function isObject(input) { + return Object.prototype.toString.call(input) === '[object Object]'; + } + + function locale_set__set (config) { + var prop, i; + for (i in config) { + prop = config[i]; + if (isFunction(prop)) { + this[i] = prop; + } else { + this['_' + i] = prop; + } + } + this._config = config; + // Lenient ordinal parsing accepts just a number in addition to + // number + (possibly) stuff coming from _ordinalParseLenient. + this._ordinalParseLenient = new RegExp(this._ordinalParse.source + '|' + (/\d{1,2}/).source); + } + + function mergeConfigs(parentConfig, childConfig) { + var res = extend({}, parentConfig), prop; + for (prop in childConfig) { + if (hasOwnProp(childConfig, prop)) { + if (isObject(parentConfig[prop]) && isObject(childConfig[prop])) { + res[prop] = {}; + extend(res[prop], parentConfig[prop]); + extend(res[prop], childConfig[prop]); + } else if (childConfig[prop] != null) { + res[prop] = childConfig[prop]; + } else { + delete res[prop]; + } + } + } + return res; + } + + function Locale(config) { + if (config != null) { + this.set(config); + } + } + + var keys; + + if (Object.keys) { + keys = Object.keys; + } else { + keys = function (obj) { + var i, res = []; + for (i in obj) { + if (hasOwnProp(obj, i)) { + res.push(i); + } + } + return res; + }; + } + + // internal storage for locale config files + var locales = {}; + var globalLocale; + + function normalizeLocale(key) { + return key ? key.toLowerCase().replace('_', '-') : key; + } + + // pick the locale from the array + // try ['en-au', 'en-gb'] as 'en-au', 'en-gb', 'en', as in move through the list trying each + // substring from most specific to least, but move to the next array item if it's a more specific variant than the current root + function chooseLocale(names) { + var i = 0, j, next, locale, split; + + while (i < names.length) { + split = normalizeLocale(names[i]).split('-'); + j = split.length; + next = normalizeLocale(names[i + 1]); + next = next ? next.split('-') : null; + while (j > 0) { + locale = loadLocale(split.slice(0, j).join('-')); + if (locale) { + return locale; + } + if (next && next.length >= j && compareArrays(split, next, true) >= j - 1) { + //the next array item is better than a shallower substring of this one + break; + } + j--; + } + i++; + } + return null; + } + + function loadLocale(name) { + var oldLocale = null; + // TODO: Find a better way to register and load all the locales in Node + if (!locales[name] && (typeof module !== 'undefined') && + module && module.exports) { + try { + oldLocale = globalLocale._abbr; + require('./locale/' + name); + // because defineLocale currently also sets the global locale, we + // want to undo that for lazy loaded locales + locale_locales__getSetGlobalLocale(oldLocale); + } catch (e) { } + } + return locales[name]; + } + + // This function will load locale and then set the global locale. If + // no arguments are passed in, it will simply return the current global + // locale key. + function locale_locales__getSetGlobalLocale (key, values) { + var data; + if (key) { + if (isUndefined(values)) { + data = locale_locales__getLocale(key); + } + else { + data = defineLocale(key, values); + } + + if (data) { + // moment.duration._locale = moment._locale = data; + globalLocale = data; + } + } + + return globalLocale._abbr; + } + + function defineLocale (name, config) { + if (config !== null) { + config.abbr = name; + if (locales[name] != null) { + deprecateSimple('defineLocaleOverride', + 'use moment.updateLocale(localeName, config) to change ' + + 'an existing locale. moment.defineLocale(localeName, ' + + 'config) should only be used for creating a new locale'); + config = mergeConfigs(locales[name]._config, config); + } else if (config.parentLocale != null) { + if (locales[config.parentLocale] != null) { + config = mergeConfigs(locales[config.parentLocale]._config, config); + } else { + // treat as if there is no base config + deprecateSimple('parentLocaleUndefined', + 'specified parentLocale is not defined yet'); + } + } + locales[name] = new Locale(config); + + // backwards compat for now: also set the locale + locale_locales__getSetGlobalLocale(name); + + return locales[name]; + } else { + // useful for testing + delete locales[name]; + return null; + } + } + + function updateLocale(name, config) { + if (config != null) { + var locale; + if (locales[name] != null) { + config = mergeConfigs(locales[name]._config, config); + } + locale = new Locale(config); + locale.parentLocale = locales[name]; + locales[name] = locale; + + // backwards compat for now: also set the locale + locale_locales__getSetGlobalLocale(name); + } else { + // pass null for config to unupdate, useful for tests + if (locales[name] != null) { + if (locales[name].parentLocale != null) { + locales[name] = locales[name].parentLocale; + } else if (locales[name] != null) { + delete locales[name]; + } + } + } + return locales[name]; + } + + // returns locale data + function locale_locales__getLocale (key) { + var locale; + + if (key && key._locale && key._locale._abbr) { + key = key._locale._abbr; + } + + if (!key) { + return globalLocale; + } + + if (!isArray(key)) { + //short-circuit everything else + locale = loadLocale(key); + if (locale) { + return locale; + } + key = [key]; + } + + return chooseLocale(key); + } + + function locale_locales__listLocales() { + return keys(locales); + } + + var aliases = {}; + + function addUnitAlias (unit, shorthand) { + var lowerCase = unit.toLowerCase(); + aliases[lowerCase] = aliases[lowerCase + 's'] = aliases[shorthand] = unit; + } + + function normalizeUnits(units) { + return typeof units === 'string' ? aliases[units] || aliases[units.toLowerCase()] : undefined; + } + + function normalizeObjectUnits(inputObject) { + var normalizedInput = {}, + normalizedProp, + prop; + + for (prop in inputObject) { + if (hasOwnProp(inputObject, prop)) { + normalizedProp = normalizeUnits(prop); + if (normalizedProp) { + normalizedInput[normalizedProp] = inputObject[prop]; + } + } + } + + return normalizedInput; + } + + function makeGetSet (unit, keepTime) { + return function (value) { + if (value != null) { + get_set__set(this, unit, value); + utils_hooks__hooks.updateOffset(this, keepTime); + return this; + } else { + return get_set__get(this, unit); + } + }; + } + + function get_set__get (mom, unit) { + return mom.isValid() ? + mom._d['get' + (mom._isUTC ? 'UTC' : '') + unit]() : NaN; + } + + function get_set__set (mom, unit, value) { + if (mom.isValid()) { + mom._d['set' + (mom._isUTC ? 'UTC' : '') + unit](value); + } + } + + // MOMENTS + + function getSet (units, value) { + var unit; + if (typeof units === 'object') { + for (unit in units) { + this.set(unit, units[unit]); + } + } else { + units = normalizeUnits(units); + if (isFunction(this[units])) { + return this[units](value); + } + } + return this; + } + + function zeroFill(number, targetLength, forceSign) { + var absNumber = '' + Math.abs(number), + zerosToFill = targetLength - absNumber.length, + sign = number >= 0; + return (sign ? (forceSign ? '+' : '') : '-') + + Math.pow(10, Math.max(0, zerosToFill)).toString().substr(1) + absNumber; + } + + var formattingTokens = /(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g; + + var localFormattingTokens = /(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g; + + var formatFunctions = {}; + + var formatTokenFunctions = {}; + + // token: 'M' + // padded: ['MM', 2] + // ordinal: 'Mo' + // callback: function () { this.month() + 1 } + function addFormatToken (token, padded, ordinal, callback) { + var func = callback; + if (typeof callback === 'string') { + func = function () { + return this[callback](); + }; + } + if (token) { + formatTokenFunctions[token] = func; + } + if (padded) { + formatTokenFunctions[padded[0]] = function () { + return zeroFill(func.apply(this, arguments), padded[1], padded[2]); + }; + } + if (ordinal) { + formatTokenFunctions[ordinal] = function () { + return this.localeData().ordinal(func.apply(this, arguments), token); + }; + } + } + + function removeFormattingTokens(input) { + if (input.match(/\[[\s\S]/)) { + return input.replace(/^\[|\]$/g, ''); + } + return input.replace(/\\/g, ''); + } + + function makeFormatFunction(format) { + var array = format.match(formattingTokens), i, length; + + for (i = 0, length = array.length; i < length; i++) { + if (formatTokenFunctions[array[i]]) { + array[i] = formatTokenFunctions[array[i]]; + } else { + array[i] = removeFormattingTokens(array[i]); + } + } + + return function (mom) { + var output = '', i; + for (i = 0; i < length; i++) { + output += array[i] instanceof Function ? array[i].call(mom, format) : array[i]; + } + return output; + }; + } + + // format date using native date object + function formatMoment(m, format) { + if (!m.isValid()) { + return m.localeData().invalidDate(); + } + + format = expandFormat(format, m.localeData()); + formatFunctions[format] = formatFunctions[format] || makeFormatFunction(format); + + return formatFunctions[format](m); + } + + function expandFormat(format, locale) { + var i = 5; + + function replaceLongDateFormatTokens(input) { + return locale.longDateFormat(input) || input; + } + + localFormattingTokens.lastIndex = 0; + while (i >= 0 && localFormattingTokens.test(format)) { + format = format.replace(localFormattingTokens, replaceLongDateFormatTokens); + localFormattingTokens.lastIndex = 0; + i -= 1; + } + + return format; + } + + var match1 = /\d/; // 0 - 9 + var match2 = /\d\d/; // 00 - 99 + var match3 = /\d{3}/; // 000 - 999 + var match4 = /\d{4}/; // 0000 - 9999 + var match6 = /[+-]?\d{6}/; // -999999 - 999999 + var match1to2 = /\d\d?/; // 0 - 99 + var match3to4 = /\d\d\d\d?/; // 999 - 9999 + var match5to6 = /\d\d\d\d\d\d?/; // 99999 - 999999 + var match1to3 = /\d{1,3}/; // 0 - 999 + var match1to4 = /\d{1,4}/; // 0 - 9999 + var match1to6 = /[+-]?\d{1,6}/; // -999999 - 999999 + + var matchUnsigned = /\d+/; // 0 - inf + var matchSigned = /[+-]?\d+/; // -inf - inf + + var matchOffset = /Z|[+-]\d\d:?\d\d/gi; // +00:00 -00:00 +0000 -0000 or Z + var matchShortOffset = /Z|[+-]\d\d(?::?\d\d)?/gi; // +00 -00 +00:00 -00:00 +0000 -0000 or Z + + var matchTimestamp = /[+-]?\d+(\.\d{1,3})?/; // 123456789 123456789.123 + + // any word (or two) characters or numbers including two/three word month in arabic. + // includes scottish gaelic two word and hyphenated months + var matchWord = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i; + + + var regexes = {}; + + function addRegexToken (token, regex, strictRegex) { + regexes[token] = isFunction(regex) ? regex : function (isStrict, localeData) { + return (isStrict && strictRegex) ? strictRegex : regex; + }; + } + + function getParseRegexForToken (token, config) { + if (!hasOwnProp(regexes, token)) { + return new RegExp(unescapeFormat(token)); + } + + return regexes[token](config._strict, config._locale); + } + + // Code from http://stackoverflow.com/questions/3561493/is-there-a-regexp-escape-function-in-javascript + function unescapeFormat(s) { + return regexEscape(s.replace('\\', '').replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g, function (matched, p1, p2, p3, p4) { + return p1 || p2 || p3 || p4; + })); + } + + function regexEscape(s) { + return s.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); + } + + var tokens = {}; + + function addParseToken (token, callback) { + var i, func = callback; + if (typeof token === 'string') { + token = [token]; + } + if (typeof callback === 'number') { + func = function (input, array) { + array[callback] = toInt(input); + }; + } + for (i = 0; i < token.length; i++) { + tokens[token[i]] = func; + } + } + + function addWeekParseToken (token, callback) { + addParseToken(token, function (input, array, config, token) { + config._w = config._w || {}; + callback(input, config._w, config, token); + }); + } + + function addTimeToArrayFromToken(token, input, config) { + if (input != null && hasOwnProp(tokens, token)) { + tokens[token](input, config._a, config, token); + } + } + + var YEAR = 0; + var MONTH = 1; + var DATE = 2; + var HOUR = 3; + var MINUTE = 4; + var SECOND = 5; + var MILLISECOND = 6; + var WEEK = 7; + var WEEKDAY = 8; + + var indexOf; + + if (Array.prototype.indexOf) { + indexOf = Array.prototype.indexOf; + } else { + indexOf = function (o) { + // I know + var i; + for (i = 0; i < this.length; ++i) { + if (this[i] === o) { + return i; + } + } + return -1; + }; + } + + function daysInMonth(year, month) { + return new Date(Date.UTC(year, month + 1, 0)).getUTCDate(); + } + + // FORMATTING + + addFormatToken('M', ['MM', 2], 'Mo', function () { + return this.month() + 1; + }); + + addFormatToken('MMM', 0, 0, function (format) { + return this.localeData().monthsShort(this, format); + }); + + addFormatToken('MMMM', 0, 0, function (format) { + return this.localeData().months(this, format); + }); + + // ALIASES + + addUnitAlias('month', 'M'); + + // PARSING + + addRegexToken('M', match1to2); + addRegexToken('MM', match1to2, match2); + addRegexToken('MMM', function (isStrict, locale) { + return locale.monthsShortRegex(isStrict); + }); + addRegexToken('MMMM', function (isStrict, locale) { + return locale.monthsRegex(isStrict); + }); + + addParseToken(['M', 'MM'], function (input, array) { + array[MONTH] = toInt(input) - 1; + }); + + addParseToken(['MMM', 'MMMM'], function (input, array, config, token) { + var month = config._locale.monthsParse(input, token, config._strict); + // if we didn't find a month name, mark the date as invalid. + if (month != null) { + array[MONTH] = month; + } else { + getParsingFlags(config).invalidMonth = input; + } + }); + + // LOCALES + + var MONTHS_IN_FORMAT = /D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/; + var defaultLocaleMonths = 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'); + function localeMonths (m, format) { + return isArray(this._months) ? this._months[m.month()] : + this._months[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; + } + + var defaultLocaleMonthsShort = 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'); + function localeMonthsShort (m, format) { + return isArray(this._monthsShort) ? this._monthsShort[m.month()] : + this._monthsShort[MONTHS_IN_FORMAT.test(format) ? 'format' : 'standalone'][m.month()]; + } + + function units_month__handleStrictParse(monthName, format, strict) { + var i, ii, mom, llc = monthName.toLocaleLowerCase(); + if (!this._monthsParse) { + // this is not used + this._monthsParse = []; + this._longMonthsParse = []; + this._shortMonthsParse = []; + for (i = 0; i < 12; ++i) { + mom = create_utc__createUTC([2000, i]); + this._shortMonthsParse[i] = this.monthsShort(mom, '').toLocaleLowerCase(); + this._longMonthsParse[i] = this.months(mom, '').toLocaleLowerCase(); + } + } + + if (strict) { + if (format === 'MMM') { + ii = indexOf.call(this._shortMonthsParse, llc); + return ii !== -1 ? ii : null; + } else { + ii = indexOf.call(this._longMonthsParse, llc); + return ii !== -1 ? ii : null; + } + } else { + if (format === 'MMM') { + ii = indexOf.call(this._shortMonthsParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf.call(this._longMonthsParse, llc); + return ii !== -1 ? ii : null; + } else { + ii = indexOf.call(this._longMonthsParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf.call(this._shortMonthsParse, llc); + return ii !== -1 ? ii : null; + } + } + } + + function localeMonthsParse (monthName, format, strict) { + var i, mom, regex; + + if (this._monthsParseExact) { + return units_month__handleStrictParse.call(this, monthName, format, strict); + } + + if (!this._monthsParse) { + this._monthsParse = []; + this._longMonthsParse = []; + this._shortMonthsParse = []; + } + + // TODO: add sorting + // Sorting makes sure if one month (or abbr) is a prefix of another + // see sorting in computeMonthsParse + for (i = 0; i < 12; i++) { + // make the regex if we don't have it already + mom = create_utc__createUTC([2000, i]); + if (strict && !this._longMonthsParse[i]) { + this._longMonthsParse[i] = new RegExp('^' + this.months(mom, '').replace('.', '') + '$', 'i'); + this._shortMonthsParse[i] = new RegExp('^' + this.monthsShort(mom, '').replace('.', '') + '$', 'i'); + } + if (!strict && !this._monthsParse[i]) { + regex = '^' + this.months(mom, '') + '|^' + this.monthsShort(mom, ''); + this._monthsParse[i] = new RegExp(regex.replace('.', ''), 'i'); + } + // test the regex + if (strict && format === 'MMMM' && this._longMonthsParse[i].test(monthName)) { + return i; + } else if (strict && format === 'MMM' && this._shortMonthsParse[i].test(monthName)) { + return i; + } else if (!strict && this._monthsParse[i].test(monthName)) { + return i; + } + } + } + + // MOMENTS + + function setMonth (mom, value) { + var dayOfMonth; + + if (!mom.isValid()) { + // No op + return mom; + } + + if (typeof value === 'string') { + if (/^\d+$/.test(value)) { + value = toInt(value); + } else { + value = mom.localeData().monthsParse(value); + // TODO: Another silent failure? + if (typeof value !== 'number') { + return mom; + } + } + } + + dayOfMonth = Math.min(mom.date(), daysInMonth(mom.year(), value)); + mom._d['set' + (mom._isUTC ? 'UTC' : '') + 'Month'](value, dayOfMonth); + return mom; + } + + function getSetMonth (value) { + if (value != null) { + setMonth(this, value); + utils_hooks__hooks.updateOffset(this, true); + return this; + } else { + return get_set__get(this, 'Month'); + } + } + + function getDaysInMonth () { + return daysInMonth(this.year(), this.month()); + } + + var defaultMonthsShortRegex = matchWord; + function monthsShortRegex (isStrict) { + if (this._monthsParseExact) { + if (!hasOwnProp(this, '_monthsRegex')) { + computeMonthsParse.call(this); + } + if (isStrict) { + return this._monthsShortStrictRegex; + } else { + return this._monthsShortRegex; + } + } else { + return this._monthsShortStrictRegex && isStrict ? + this._monthsShortStrictRegex : this._monthsShortRegex; + } + } + + var defaultMonthsRegex = matchWord; + function monthsRegex (isStrict) { + if (this._monthsParseExact) { + if (!hasOwnProp(this, '_monthsRegex')) { + computeMonthsParse.call(this); + } + if (isStrict) { + return this._monthsStrictRegex; + } else { + return this._monthsRegex; + } + } else { + return this._monthsStrictRegex && isStrict ? + this._monthsStrictRegex : this._monthsRegex; + } + } + + function computeMonthsParse () { + function cmpLenRev(a, b) { + return b.length - a.length; + } + + var shortPieces = [], longPieces = [], mixedPieces = [], + i, mom; + for (i = 0; i < 12; i++) { + // make the regex if we don't have it already + mom = create_utc__createUTC([2000, i]); + shortPieces.push(this.monthsShort(mom, '')); + longPieces.push(this.months(mom, '')); + mixedPieces.push(this.months(mom, '')); + mixedPieces.push(this.monthsShort(mom, '')); + } + // Sorting makes sure if one month (or abbr) is a prefix of another it + // will match the longer piece. + shortPieces.sort(cmpLenRev); + longPieces.sort(cmpLenRev); + mixedPieces.sort(cmpLenRev); + for (i = 0; i < 12; i++) { + shortPieces[i] = regexEscape(shortPieces[i]); + longPieces[i] = regexEscape(longPieces[i]); + mixedPieces[i] = regexEscape(mixedPieces[i]); + } + + this._monthsRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); + this._monthsShortRegex = this._monthsRegex; + this._monthsStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i'); + this._monthsShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i'); + } + + function checkOverflow (m) { + var overflow; + var a = m._a; + + if (a && getParsingFlags(m).overflow === -2) { + overflow = + a[MONTH] < 0 || a[MONTH] > 11 ? MONTH : + a[DATE] < 1 || a[DATE] > daysInMonth(a[YEAR], a[MONTH]) ? DATE : + a[HOUR] < 0 || a[HOUR] > 24 || (a[HOUR] === 24 && (a[MINUTE] !== 0 || a[SECOND] !== 0 || a[MILLISECOND] !== 0)) ? HOUR : + a[MINUTE] < 0 || a[MINUTE] > 59 ? MINUTE : + a[SECOND] < 0 || a[SECOND] > 59 ? SECOND : + a[MILLISECOND] < 0 || a[MILLISECOND] > 999 ? MILLISECOND : + -1; + + if (getParsingFlags(m)._overflowDayOfYear && (overflow < YEAR || overflow > DATE)) { + overflow = DATE; + } + if (getParsingFlags(m)._overflowWeeks && overflow === -1) { + overflow = WEEK; + } + if (getParsingFlags(m)._overflowWeekday && overflow === -1) { + overflow = WEEKDAY; + } + + getParsingFlags(m).overflow = overflow; + } + + return m; + } + + // iso 8601 regex + // 0000-00-00 0000-W00 or 0000-W00-0 + T + 00 or 00:00 or 00:00:00 or 00:00:00.000 + +00:00 or +0000 or +00) + var extendedIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/; + var basicIsoRegex = /^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/; + + var tzRegex = /Z|[+-]\d\d(?::?\d\d)?/; + + var isoDates = [ + ['YYYYYY-MM-DD', /[+-]\d{6}-\d\d-\d\d/], + ['YYYY-MM-DD', /\d{4}-\d\d-\d\d/], + ['GGGG-[W]WW-E', /\d{4}-W\d\d-\d/], + ['GGGG-[W]WW', /\d{4}-W\d\d/, false], + ['YYYY-DDD', /\d{4}-\d{3}/], + ['YYYY-MM', /\d{4}-\d\d/, false], + ['YYYYYYMMDD', /[+-]\d{10}/], + ['YYYYMMDD', /\d{8}/], + // YYYYMM is NOT allowed by the standard + ['GGGG[W]WWE', /\d{4}W\d{3}/], + ['GGGG[W]WW', /\d{4}W\d{2}/, false], + ['YYYYDDD', /\d{7}/] + ]; + + // iso time formats and regexes + var isoTimes = [ + ['HH:mm:ss.SSSS', /\d\d:\d\d:\d\d\.\d+/], + ['HH:mm:ss,SSSS', /\d\d:\d\d:\d\d,\d+/], + ['HH:mm:ss', /\d\d:\d\d:\d\d/], + ['HH:mm', /\d\d:\d\d/], + ['HHmmss.SSSS', /\d\d\d\d\d\d\.\d+/], + ['HHmmss,SSSS', /\d\d\d\d\d\d,\d+/], + ['HHmmss', /\d\d\d\d\d\d/], + ['HHmm', /\d\d\d\d/], + ['HH', /\d\d/] + ]; + + var aspNetJsonRegex = /^\/?Date\((\-?\d+)/i; + + // date from iso format + function configFromISO(config) { + var i, l, + string = config._i, + match = extendedIsoRegex.exec(string) || basicIsoRegex.exec(string), + allowTime, dateFormat, timeFormat, tzFormat; + + if (match) { + getParsingFlags(config).iso = true; + + for (i = 0, l = isoDates.length; i < l; i++) { + if (isoDates[i][1].exec(match[1])) { + dateFormat = isoDates[i][0]; + allowTime = isoDates[i][2] !== false; + break; + } + } + if (dateFormat == null) { + config._isValid = false; + return; + } + if (match[3]) { + for (i = 0, l = isoTimes.length; i < l; i++) { + if (isoTimes[i][1].exec(match[3])) { + // match[2] should be 'T' or space + timeFormat = (match[2] || ' ') + isoTimes[i][0]; + break; + } + } + if (timeFormat == null) { + config._isValid = false; + return; + } + } + if (!allowTime && timeFormat != null) { + config._isValid = false; + return; + } + if (match[4]) { + if (tzRegex.exec(match[4])) { + tzFormat = 'Z'; + } else { + config._isValid = false; + return; + } + } + config._f = dateFormat + (timeFormat || '') + (tzFormat || ''); + configFromStringAndFormat(config); + } else { + config._isValid = false; + } + } + + // date from iso format or fallback + function configFromString(config) { + var matched = aspNetJsonRegex.exec(config._i); + + if (matched !== null) { + config._d = new Date(+matched[1]); + return; + } + + configFromISO(config); + if (config._isValid === false) { + delete config._isValid; + utils_hooks__hooks.createFromInputFallback(config); + } + } + + utils_hooks__hooks.createFromInputFallback = deprecate( + 'moment construction falls back to js Date. This is ' + + 'discouraged and will be removed in upcoming major ' + + 'release. Please refer to ' + + 'https://github.com/moment/moment/issues/1407 for more info.', + function (config) { + config._d = new Date(config._i + (config._useUTC ? ' UTC' : '')); + } + ); + + function createDate (y, m, d, h, M, s, ms) { + //can't just apply() to create a date: + //http://stackoverflow.com/questions/181348/instantiating-a-javascript-object-by-calling-prototype-constructor-apply + var date = new Date(y, m, d, h, M, s, ms); + + //the date constructor remaps years 0-99 to 1900-1999 + if (y < 100 && y >= 0 && isFinite(date.getFullYear())) { + date.setFullYear(y); + } + return date; + } + + function createUTCDate (y) { + var date = new Date(Date.UTC.apply(null, arguments)); + + //the Date.UTC function remaps years 0-99 to 1900-1999 + if (y < 100 && y >= 0 && isFinite(date.getUTCFullYear())) { + date.setUTCFullYear(y); + } + return date; + } + + // FORMATTING + + addFormatToken('Y', 0, 0, function () { + var y = this.year(); + return y <= 9999 ? '' + y : '+' + y; + }); + + addFormatToken(0, ['YY', 2], 0, function () { + return this.year() % 100; + }); + + addFormatToken(0, ['YYYY', 4], 0, 'year'); + addFormatToken(0, ['YYYYY', 5], 0, 'year'); + addFormatToken(0, ['YYYYYY', 6, true], 0, 'year'); + + // ALIASES + + addUnitAlias('year', 'y'); + + // PARSING + + addRegexToken('Y', matchSigned); + addRegexToken('YY', match1to2, match2); + addRegexToken('YYYY', match1to4, match4); + addRegexToken('YYYYY', match1to6, match6); + addRegexToken('YYYYYY', match1to6, match6); + + addParseToken(['YYYYY', 'YYYYYY'], YEAR); + addParseToken('YYYY', function (input, array) { + array[YEAR] = input.length === 2 ? utils_hooks__hooks.parseTwoDigitYear(input) : toInt(input); + }); + addParseToken('YY', function (input, array) { + array[YEAR] = utils_hooks__hooks.parseTwoDigitYear(input); + }); + addParseToken('Y', function (input, array) { + array[YEAR] = parseInt(input, 10); + }); + + // HELPERS + + function daysInYear(year) { + return isLeapYear(year) ? 366 : 365; + } + + function isLeapYear(year) { + return (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0; + } + + // HOOKS + + utils_hooks__hooks.parseTwoDigitYear = function (input) { + return toInt(input) + (toInt(input) > 68 ? 1900 : 2000); + }; + + // MOMENTS + + var getSetYear = makeGetSet('FullYear', true); + + function getIsLeapYear () { + return isLeapYear(this.year()); + } + + // start-of-first-week - start-of-year + function firstWeekOffset(year, dow, doy) { + var // first-week day -- which january is always in the first week (4 for iso, 1 for other) + fwd = 7 + dow - doy, + // first-week day local weekday -- which local weekday is fwd + fwdlw = (7 + createUTCDate(year, 0, fwd).getUTCDay() - dow) % 7; + + return -fwdlw + fwd - 1; + } + + //http://en.wikipedia.org/wiki/ISO_week_date#Calculating_a_date_given_the_year.2C_week_number_and_weekday + function dayOfYearFromWeeks(year, week, weekday, dow, doy) { + var localWeekday = (7 + weekday - dow) % 7, + weekOffset = firstWeekOffset(year, dow, doy), + dayOfYear = 1 + 7 * (week - 1) + localWeekday + weekOffset, + resYear, resDayOfYear; + + if (dayOfYear <= 0) { + resYear = year - 1; + resDayOfYear = daysInYear(resYear) + dayOfYear; + } else if (dayOfYear > daysInYear(year)) { + resYear = year + 1; + resDayOfYear = dayOfYear - daysInYear(year); + } else { + resYear = year; + resDayOfYear = dayOfYear; + } + + return { + year: resYear, + dayOfYear: resDayOfYear + }; + } + + function weekOfYear(mom, dow, doy) { + var weekOffset = firstWeekOffset(mom.year(), dow, doy), + week = Math.floor((mom.dayOfYear() - weekOffset - 1) / 7) + 1, + resWeek, resYear; + + if (week < 1) { + resYear = mom.year() - 1; + resWeek = week + weeksInYear(resYear, dow, doy); + } else if (week > weeksInYear(mom.year(), dow, doy)) { + resWeek = week - weeksInYear(mom.year(), dow, doy); + resYear = mom.year() + 1; + } else { + resYear = mom.year(); + resWeek = week; + } + + return { + week: resWeek, + year: resYear + }; + } + + function weeksInYear(year, dow, doy) { + var weekOffset = firstWeekOffset(year, dow, doy), + weekOffsetNext = firstWeekOffset(year + 1, dow, doy); + return (daysInYear(year) - weekOffset + weekOffsetNext) / 7; + } + + // Pick the first defined of two or three arguments. + function defaults(a, b, c) { + if (a != null) { + return a; + } + if (b != null) { + return b; + } + return c; + } + + function currentDateArray(config) { + // hooks is actually the exported moment object + var nowValue = new Date(utils_hooks__hooks.now()); + if (config._useUTC) { + return [nowValue.getUTCFullYear(), nowValue.getUTCMonth(), nowValue.getUTCDate()]; + } + return [nowValue.getFullYear(), nowValue.getMonth(), nowValue.getDate()]; + } + + // convert an array to a date. + // the array should mirror the parameters below + // note: all values past the year are optional and will default to the lowest possible value. + // [year, month, day , hour, minute, second, millisecond] + function configFromArray (config) { + var i, date, input = [], currentDate, yearToUse; + + if (config._d) { + return; + } + + currentDate = currentDateArray(config); + + //compute day of the year from weeks and weekdays + if (config._w && config._a[DATE] == null && config._a[MONTH] == null) { + dayOfYearFromWeekInfo(config); + } + + //if the day of the year is set, figure out what it is + if (config._dayOfYear) { + yearToUse = defaults(config._a[YEAR], currentDate[YEAR]); + + if (config._dayOfYear > daysInYear(yearToUse)) { + getParsingFlags(config)._overflowDayOfYear = true; + } + + date = createUTCDate(yearToUse, 0, config._dayOfYear); + config._a[MONTH] = date.getUTCMonth(); + config._a[DATE] = date.getUTCDate(); + } + + // Default to current date. + // * if no year, month, day of month are given, default to today + // * if day of month is given, default month and year + // * if month is given, default only year + // * if year is given, don't default anything + for (i = 0; i < 3 && config._a[i] == null; ++i) { + config._a[i] = input[i] = currentDate[i]; + } + + // Zero out whatever was not defaulted, including time + for (; i < 7; i++) { + config._a[i] = input[i] = (config._a[i] == null) ? (i === 2 ? 1 : 0) : config._a[i]; + } + + // Check for 24:00:00.000 + if (config._a[HOUR] === 24 && + config._a[MINUTE] === 0 && + config._a[SECOND] === 0 && + config._a[MILLISECOND] === 0) { + config._nextDay = true; + config._a[HOUR] = 0; + } + + config._d = (config._useUTC ? createUTCDate : createDate).apply(null, input); + // Apply timezone offset from input. The actual utcOffset can be changed + // with parseZone. + if (config._tzm != null) { + config._d.setUTCMinutes(config._d.getUTCMinutes() - config._tzm); + } + + if (config._nextDay) { + config._a[HOUR] = 24; + } + } + + function dayOfYearFromWeekInfo(config) { + var w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow; + + w = config._w; + if (w.GG != null || w.W != null || w.E != null) { + dow = 1; + doy = 4; + + // TODO: We need to take the current isoWeekYear, but that depends on + // how we interpret now (local, utc, fixed offset). So create + // a now version of current config (take local/utc/offset flags, and + // create now). + weekYear = defaults(w.GG, config._a[YEAR], weekOfYear(local__createLocal(), 1, 4).year); + week = defaults(w.W, 1); + weekday = defaults(w.E, 1); + if (weekday < 1 || weekday > 7) { + weekdayOverflow = true; + } + } else { + dow = config._locale._week.dow; + doy = config._locale._week.doy; + + weekYear = defaults(w.gg, config._a[YEAR], weekOfYear(local__createLocal(), dow, doy).year); + week = defaults(w.w, 1); + + if (w.d != null) { + // weekday -- low day numbers are considered next week + weekday = w.d; + if (weekday < 0 || weekday > 6) { + weekdayOverflow = true; + } + } else if (w.e != null) { + // local weekday -- counting starts from begining of week + weekday = w.e + dow; + if (w.e < 0 || w.e > 6) { + weekdayOverflow = true; + } + } else { + // default to begining of week + weekday = dow; + } + } + if (week < 1 || week > weeksInYear(weekYear, dow, doy)) { + getParsingFlags(config)._overflowWeeks = true; + } else if (weekdayOverflow != null) { + getParsingFlags(config)._overflowWeekday = true; + } else { + temp = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy); + config._a[YEAR] = temp.year; + config._dayOfYear = temp.dayOfYear; + } + } + + // constant that refers to the ISO standard + utils_hooks__hooks.ISO_8601 = function () {}; + + // date from string and format string + function configFromStringAndFormat(config) { + // TODO: Move this to another part of the creation flow to prevent circular deps + if (config._f === utils_hooks__hooks.ISO_8601) { + configFromISO(config); + return; + } + + config._a = []; + getParsingFlags(config).empty = true; + + // This array is used to make a Date, either with `new Date` or `Date.UTC` + var string = '' + config._i, + i, parsedInput, tokens, token, skipped, + stringLength = string.length, + totalParsedInputLength = 0; + + tokens = expandFormat(config._f, config._locale).match(formattingTokens) || []; + + for (i = 0; i < tokens.length; i++) { + token = tokens[i]; + parsedInput = (string.match(getParseRegexForToken(token, config)) || [])[0]; + // console.log('token', token, 'parsedInput', parsedInput, + // 'regex', getParseRegexForToken(token, config)); + if (parsedInput) { + skipped = string.substr(0, string.indexOf(parsedInput)); + if (skipped.length > 0) { + getParsingFlags(config).unusedInput.push(skipped); + } + string = string.slice(string.indexOf(parsedInput) + parsedInput.length); + totalParsedInputLength += parsedInput.length; + } + // don't parse if it's not a known token + if (formatTokenFunctions[token]) { + if (parsedInput) { + getParsingFlags(config).empty = false; + } + else { + getParsingFlags(config).unusedTokens.push(token); + } + addTimeToArrayFromToken(token, parsedInput, config); + } + else if (config._strict && !parsedInput) { + getParsingFlags(config).unusedTokens.push(token); + } + } + + // add remaining unparsed input length to the string + getParsingFlags(config).charsLeftOver = stringLength - totalParsedInputLength; + if (string.length > 0) { + getParsingFlags(config).unusedInput.push(string); + } + + // clear _12h flag if hour is <= 12 + if (getParsingFlags(config).bigHour === true && + config._a[HOUR] <= 12 && + config._a[HOUR] > 0) { + getParsingFlags(config).bigHour = undefined; + } + + getParsingFlags(config).parsedDateParts = config._a.slice(0); + getParsingFlags(config).meridiem = config._meridiem; + // handle meridiem + config._a[HOUR] = meridiemFixWrap(config._locale, config._a[HOUR], config._meridiem); + + configFromArray(config); + checkOverflow(config); + } + + + function meridiemFixWrap (locale, hour, meridiem) { + var isPm; + + if (meridiem == null) { + // nothing to do + return hour; + } + if (locale.meridiemHour != null) { + return locale.meridiemHour(hour, meridiem); + } else if (locale.isPM != null) { + // Fallback + isPm = locale.isPM(meridiem); + if (isPm && hour < 12) { + hour += 12; + } + if (!isPm && hour === 12) { + hour = 0; + } + return hour; + } else { + // this is not supposed to happen + return hour; + } + } + + // date from string and array of format strings + function configFromStringAndArray(config) { + var tempConfig, + bestMoment, + + scoreToBeat, + i, + currentScore; + + if (config._f.length === 0) { + getParsingFlags(config).invalidFormat = true; + config._d = new Date(NaN); + return; + } + + for (i = 0; i < config._f.length; i++) { + currentScore = 0; + tempConfig = copyConfig({}, config); + if (config._useUTC != null) { + tempConfig._useUTC = config._useUTC; + } + tempConfig._f = config._f[i]; + configFromStringAndFormat(tempConfig); + + if (!valid__isValid(tempConfig)) { + continue; + } + + // if there is any input that was not parsed add a penalty for that format + currentScore += getParsingFlags(tempConfig).charsLeftOver; + + //or tokens + currentScore += getParsingFlags(tempConfig).unusedTokens.length * 10; + + getParsingFlags(tempConfig).score = currentScore; + + if (scoreToBeat == null || currentScore < scoreToBeat) { + scoreToBeat = currentScore; + bestMoment = tempConfig; + } + } + + extend(config, bestMoment || tempConfig); + } + + function configFromObject(config) { + if (config._d) { + return; + } + + var i = normalizeObjectUnits(config._i); + config._a = map([i.year, i.month, i.day || i.date, i.hour, i.minute, i.second, i.millisecond], function (obj) { + return obj && parseInt(obj, 10); + }); + + configFromArray(config); + } + + function createFromConfig (config) { + var res = new Moment(checkOverflow(prepareConfig(config))); + if (res._nextDay) { + // Adding is smart enough around DST + res.add(1, 'd'); + res._nextDay = undefined; + } + + return res; + } + + function prepareConfig (config) { + var input = config._i, + format = config._f; + + config._locale = config._locale || locale_locales__getLocale(config._l); + + if (input === null || (format === undefined && input === '')) { + return valid__createInvalid({nullInput: true}); + } + + if (typeof input === 'string') { + config._i = input = config._locale.preparse(input); + } + + if (isMoment(input)) { + return new Moment(checkOverflow(input)); + } else if (isArray(format)) { + configFromStringAndArray(config); + } else if (format) { + configFromStringAndFormat(config); + } else if (isDate(input)) { + config._d = input; + } else { + configFromInput(config); + } + + if (!valid__isValid(config)) { + config._d = null; + } + + return config; + } + + function configFromInput(config) { + var input = config._i; + if (input === undefined) { + config._d = new Date(utils_hooks__hooks.now()); + } else if (isDate(input)) { + config._d = new Date(input.valueOf()); + } else if (typeof input === 'string') { + configFromString(config); + } else if (isArray(input)) { + config._a = map(input.slice(0), function (obj) { + return parseInt(obj, 10); + }); + configFromArray(config); + } else if (typeof(input) === 'object') { + configFromObject(config); + } else if (typeof(input) === 'number') { + // from milliseconds + config._d = new Date(input); + } else { + utils_hooks__hooks.createFromInputFallback(config); + } + } + + function createLocalOrUTC (input, format, locale, strict, isUTC) { + var c = {}; + + if (typeof(locale) === 'boolean') { + strict = locale; + locale = undefined; + } + // object construction must be done this way. + // https://github.com/moment/moment/issues/1423 + c._isAMomentObject = true; + c._useUTC = c._isUTC = isUTC; + c._l = locale; + c._i = input; + c._f = format; + c._strict = strict; + + return createFromConfig(c); + } + + function local__createLocal (input, format, locale, strict) { + return createLocalOrUTC(input, format, locale, strict, false); + } + + var prototypeMin = deprecate( + 'moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548', + function () { + var other = local__createLocal.apply(null, arguments); + if (this.isValid() && other.isValid()) { + return other < this ? this : other; + } else { + return valid__createInvalid(); + } + } + ); + + var prototypeMax = deprecate( + 'moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548', + function () { + var other = local__createLocal.apply(null, arguments); + if (this.isValid() && other.isValid()) { + return other > this ? this : other; + } else { + return valid__createInvalid(); + } + } + ); + + // Pick a moment m from moments so that m[fn](other) is true for all + // other. This relies on the function fn to be transitive. + // + // moments should either be an array of moment objects or an array, whose + // first element is an array of moment objects. + function pickBy(fn, moments) { + var res, i; + if (moments.length === 1 && isArray(moments[0])) { + moments = moments[0]; + } + if (!moments.length) { + return local__createLocal(); + } + res = moments[0]; + for (i = 1; i < moments.length; ++i) { + if (!moments[i].isValid() || moments[i][fn](res)) { + res = moments[i]; + } + } + return res; + } + + // TODO: Use [].sort instead? + function min () { + var args = [].slice.call(arguments, 0); + + return pickBy('isBefore', args); + } + + function max () { + var args = [].slice.call(arguments, 0); + + return pickBy('isAfter', args); + } + + var now = function () { + return Date.now ? Date.now() : +(new Date()); + }; + + function Duration (duration) { + var normalizedInput = normalizeObjectUnits(duration), + years = normalizedInput.year || 0, + quarters = normalizedInput.quarter || 0, + months = normalizedInput.month || 0, + weeks = normalizedInput.week || 0, + days = normalizedInput.day || 0, + hours = normalizedInput.hour || 0, + minutes = normalizedInput.minute || 0, + seconds = normalizedInput.second || 0, + milliseconds = normalizedInput.millisecond || 0; + + // representation for dateAddRemove + this._milliseconds = +milliseconds + + seconds * 1e3 + // 1000 + minutes * 6e4 + // 1000 * 60 + hours * 1000 * 60 * 60; //using 1000 * 60 * 60 instead of 36e5 to avoid floating point rounding errors https://github.com/moment/moment/issues/2978 + // Because of dateAddRemove treats 24 hours as different from a + // day when working around DST, we need to store them separately + this._days = +days + + weeks * 7; + // It is impossible translate months into days without knowing + // which months you are are talking about, so we have to store + // it separately. + this._months = +months + + quarters * 3 + + years * 12; + + this._data = {}; + + this._locale = locale_locales__getLocale(); + + this._bubble(); + } + + function isDuration (obj) { + return obj instanceof Duration; + } + + // FORMATTING + + function offset (token, separator) { + addFormatToken(token, 0, 0, function () { + var offset = this.utcOffset(); + var sign = '+'; + if (offset < 0) { + offset = -offset; + sign = '-'; + } + return sign + zeroFill(~~(offset / 60), 2) + separator + zeroFill(~~(offset) % 60, 2); + }); + } + + offset('Z', ':'); + offset('ZZ', ''); + + // PARSING + + addRegexToken('Z', matchShortOffset); + addRegexToken('ZZ', matchShortOffset); + addParseToken(['Z', 'ZZ'], function (input, array, config) { + config._useUTC = true; + config._tzm = offsetFromString(matchShortOffset, input); + }); + + // HELPERS + + // timezone chunker + // '+10:00' > ['10', '00'] + // '-1530' > ['-15', '30'] + var chunkOffset = /([\+\-]|\d\d)/gi; + + function offsetFromString(matcher, string) { + var matches = ((string || '').match(matcher) || []); + var chunk = matches[matches.length - 1] || []; + var parts = (chunk + '').match(chunkOffset) || ['-', 0, 0]; + var minutes = +(parts[1] * 60) + toInt(parts[2]); + + return parts[0] === '+' ? minutes : -minutes; + } + + // Return a moment from input, that is local/utc/zone equivalent to model. + function cloneWithOffset(input, model) { + var res, diff; + if (model._isUTC) { + res = model.clone(); + diff = (isMoment(input) || isDate(input) ? input.valueOf() : local__createLocal(input).valueOf()) - res.valueOf(); + // Use low-level api, because this fn is low-level api. + res._d.setTime(res._d.valueOf() + diff); + utils_hooks__hooks.updateOffset(res, false); + return res; + } else { + return local__createLocal(input).local(); + } + } + + function getDateOffset (m) { + // On Firefox.24 Date#getTimezoneOffset returns a floating point. + // https://github.com/moment/moment/pull/1871 + return -Math.round(m._d.getTimezoneOffset() / 15) * 15; + } + + // HOOKS + + // This function will be called whenever a moment is mutated. + // It is intended to keep the offset in sync with the timezone. + utils_hooks__hooks.updateOffset = function () {}; + + // MOMENTS + + // keepLocalTime = true means only change the timezone, without + // affecting the local hour. So 5:31:26 +0300 --[utcOffset(2, true)]--> + // 5:31:26 +0200 It is possible that 5:31:26 doesn't exist with offset + // +0200, so we adjust the time as needed, to be valid. + // + // Keeping the time actually adds/subtracts (one hour) + // from the actual represented time. That is why we call updateOffset + // a second time. In case it wants us to change the offset again + // _changeInProgress == true case, then we have to adjust, because + // there is no such time in the given timezone. + function getSetOffset (input, keepLocalTime) { + var offset = this._offset || 0, + localAdjust; + if (!this.isValid()) { + return input != null ? this : NaN; + } + if (input != null) { + if (typeof input === 'string') { + input = offsetFromString(matchShortOffset, input); + } else if (Math.abs(input) < 16) { + input = input * 60; + } + if (!this._isUTC && keepLocalTime) { + localAdjust = getDateOffset(this); + } + this._offset = input; + this._isUTC = true; + if (localAdjust != null) { + this.add(localAdjust, 'm'); + } + if (offset !== input) { + if (!keepLocalTime || this._changeInProgress) { + add_subtract__addSubtract(this, create__createDuration(input - offset, 'm'), 1, false); + } else if (!this._changeInProgress) { + this._changeInProgress = true; + utils_hooks__hooks.updateOffset(this, true); + this._changeInProgress = null; + } + } + return this; + } else { + return this._isUTC ? offset : getDateOffset(this); + } + } + + function getSetZone (input, keepLocalTime) { + if (input != null) { + if (typeof input !== 'string') { + input = -input; + } + + this.utcOffset(input, keepLocalTime); + + return this; + } else { + return -this.utcOffset(); + } + } + + function setOffsetToUTC (keepLocalTime) { + return this.utcOffset(0, keepLocalTime); + } + + function setOffsetToLocal (keepLocalTime) { + if (this._isUTC) { + this.utcOffset(0, keepLocalTime); + this._isUTC = false; + + if (keepLocalTime) { + this.subtract(getDateOffset(this), 'm'); + } + } + return this; + } + + function setOffsetToParsedOffset () { + if (this._tzm) { + this.utcOffset(this._tzm); + } else if (typeof this._i === 'string') { + this.utcOffset(offsetFromString(matchOffset, this._i)); + } + return this; + } + + function hasAlignedHourOffset (input) { + if (!this.isValid()) { + return false; + } + input = input ? local__createLocal(input).utcOffset() : 0; + + return (this.utcOffset() - input) % 60 === 0; + } + + function isDaylightSavingTime () { + return ( + this.utcOffset() > this.clone().month(0).utcOffset() || + this.utcOffset() > this.clone().month(5).utcOffset() + ); + } + + function isDaylightSavingTimeShifted () { + if (!isUndefined(this._isDSTShifted)) { + return this._isDSTShifted; + } + + var c = {}; + + copyConfig(c, this); + c = prepareConfig(c); + + if (c._a) { + var other = c._isUTC ? create_utc__createUTC(c._a) : local__createLocal(c._a); + this._isDSTShifted = this.isValid() && + compareArrays(c._a, other.toArray()) > 0; + } else { + this._isDSTShifted = false; + } + + return this._isDSTShifted; + } + + function isLocal () { + return this.isValid() ? !this._isUTC : false; + } + + function isUtcOffset () { + return this.isValid() ? this._isUTC : false; + } + + function isUtc () { + return this.isValid() ? this._isUTC && this._offset === 0 : false; + } + + // ASP.NET json date format regex + var aspNetRegex = /^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/; + + // from http://docs.closure-library.googlecode.com/git/closure_goog_date_date.js.source.html + // somewhat more in line with 4.4.3.2 2004 spec, but allows decimal anywhere + // and further modified to allow for strings containing both week and day + var isoRegex = /^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/; + + function create__createDuration (input, key) { + var duration = input, + // matching against regexp is expensive, do it on demand + match = null, + sign, + ret, + diffRes; + + if (isDuration(input)) { + duration = { + ms : input._milliseconds, + d : input._days, + M : input._months + }; + } else if (typeof input === 'number') { + duration = {}; + if (key) { + duration[key] = input; + } else { + duration.milliseconds = input; + } + } else if (!!(match = aspNetRegex.exec(input))) { + sign = (match[1] === '-') ? -1 : 1; + duration = { + y : 0, + d : toInt(match[DATE]) * sign, + h : toInt(match[HOUR]) * sign, + m : toInt(match[MINUTE]) * sign, + s : toInt(match[SECOND]) * sign, + ms : toInt(match[MILLISECOND]) * sign + }; + } else if (!!(match = isoRegex.exec(input))) { + sign = (match[1] === '-') ? -1 : 1; + duration = { + y : parseIso(match[2], sign), + M : parseIso(match[3], sign), + w : parseIso(match[4], sign), + d : parseIso(match[5], sign), + h : parseIso(match[6], sign), + m : parseIso(match[7], sign), + s : parseIso(match[8], sign) + }; + } else if (duration == null) {// checks for null or undefined + duration = {}; + } else if (typeof duration === 'object' && ('from' in duration || 'to' in duration)) { + diffRes = momentsDifference(local__createLocal(duration.from), local__createLocal(duration.to)); + + duration = {}; + duration.ms = diffRes.milliseconds; + duration.M = diffRes.months; + } + + ret = new Duration(duration); + + if (isDuration(input) && hasOwnProp(input, '_locale')) { + ret._locale = input._locale; + } + + return ret; + } + + create__createDuration.fn = Duration.prototype; + + function parseIso (inp, sign) { + // We'd normally use ~~inp for this, but unfortunately it also + // converts floats to ints. + // inp may be undefined, so careful calling replace on it. + var res = inp && parseFloat(inp.replace(',', '.')); + // apply sign while we're at it + return (isNaN(res) ? 0 : res) * sign; + } + + function positiveMomentsDifference(base, other) { + var res = {milliseconds: 0, months: 0}; + + res.months = other.month() - base.month() + + (other.year() - base.year()) * 12; + if (base.clone().add(res.months, 'M').isAfter(other)) { + --res.months; + } + + res.milliseconds = +other - +(base.clone().add(res.months, 'M')); + + return res; + } + + function momentsDifference(base, other) { + var res; + if (!(base.isValid() && other.isValid())) { + return {milliseconds: 0, months: 0}; + } + + other = cloneWithOffset(other, base); + if (base.isBefore(other)) { + res = positiveMomentsDifference(base, other); + } else { + res = positiveMomentsDifference(other, base); + res.milliseconds = -res.milliseconds; + res.months = -res.months; + } + + return res; + } + + function absRound (number) { + if (number < 0) { + return Math.round(-1 * number) * -1; + } else { + return Math.round(number); + } + } + + // TODO: remove 'name' arg after deprecation is removed + function createAdder(direction, name) { + return function (val, period) { + var dur, tmp; + //invert the arguments, but complain about it + if (period !== null && !isNaN(+period)) { + deprecateSimple(name, 'moment().' + name + '(period, number) is deprecated. Please use moment().' + name + '(number, period).'); + tmp = val; val = period; period = tmp; + } + + val = typeof val === 'string' ? +val : val; + dur = create__createDuration(val, period); + add_subtract__addSubtract(this, dur, direction); + return this; + }; + } + + function add_subtract__addSubtract (mom, duration, isAdding, updateOffset) { + var milliseconds = duration._milliseconds, + days = absRound(duration._days), + months = absRound(duration._months); + + if (!mom.isValid()) { + // No op + return; + } + + updateOffset = updateOffset == null ? true : updateOffset; + + if (milliseconds) { + mom._d.setTime(mom._d.valueOf() + milliseconds * isAdding); + } + if (days) { + get_set__set(mom, 'Date', get_set__get(mom, 'Date') + days * isAdding); + } + if (months) { + setMonth(mom, get_set__get(mom, 'Month') + months * isAdding); + } + if (updateOffset) { + utils_hooks__hooks.updateOffset(mom, days || months); + } + } + + var add_subtract__add = createAdder(1, 'add'); + var add_subtract__subtract = createAdder(-1, 'subtract'); + + function moment_calendar__calendar (time, formats) { + // We want to compare the start of today, vs this. + // Getting start-of-today depends on whether we're local/utc/offset or not. + var now = time || local__createLocal(), + sod = cloneWithOffset(now, this).startOf('day'), + diff = this.diff(sod, 'days', true), + format = diff < -6 ? 'sameElse' : + diff < -1 ? 'lastWeek' : + diff < 0 ? 'lastDay' : + diff < 1 ? 'sameDay' : + diff < 2 ? 'nextDay' : + diff < 7 ? 'nextWeek' : 'sameElse'; + + var output = formats && (isFunction(formats[format]) ? formats[format]() : formats[format]); + + return this.format(output || this.localeData().calendar(format, this, local__createLocal(now))); + } + + function clone () { + return new Moment(this); + } + + function isAfter (input, units) { + var localInput = isMoment(input) ? input : local__createLocal(input); + if (!(this.isValid() && localInput.isValid())) { + return false; + } + units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); + if (units === 'millisecond') { + return this.valueOf() > localInput.valueOf(); + } else { + return localInput.valueOf() < this.clone().startOf(units).valueOf(); + } + } + + function isBefore (input, units) { + var localInput = isMoment(input) ? input : local__createLocal(input); + if (!(this.isValid() && localInput.isValid())) { + return false; + } + units = normalizeUnits(!isUndefined(units) ? units : 'millisecond'); + if (units === 'millisecond') { + return this.valueOf() < localInput.valueOf(); + } else { + return this.clone().endOf(units).valueOf() < localInput.valueOf(); + } + } + + function isBetween (from, to, units, inclusivity) { + inclusivity = inclusivity || '()'; + return (inclusivity[0] === '(' ? this.isAfter(from, units) : !this.isBefore(from, units)) && + (inclusivity[1] === ')' ? this.isBefore(to, units) : !this.isAfter(to, units)); + } + + function isSame (input, units) { + var localInput = isMoment(input) ? input : local__createLocal(input), + inputMs; + if (!(this.isValid() && localInput.isValid())) { + return false; + } + units = normalizeUnits(units || 'millisecond'); + if (units === 'millisecond') { + return this.valueOf() === localInput.valueOf(); + } else { + inputMs = localInput.valueOf(); + return this.clone().startOf(units).valueOf() <= inputMs && inputMs <= this.clone().endOf(units).valueOf(); + } + } + + function isSameOrAfter (input, units) { + return this.isSame(input, units) || this.isAfter(input,units); + } + + function isSameOrBefore (input, units) { + return this.isSame(input, units) || this.isBefore(input,units); + } + + function diff (input, units, asFloat) { + var that, + zoneDelta, + delta, output; + + if (!this.isValid()) { + return NaN; + } + + that = cloneWithOffset(input, this); + + if (!that.isValid()) { + return NaN; + } + + zoneDelta = (that.utcOffset() - this.utcOffset()) * 6e4; + + units = normalizeUnits(units); + + if (units === 'year' || units === 'month' || units === 'quarter') { + output = monthDiff(this, that); + if (units === 'quarter') { + output = output / 3; + } else if (units === 'year') { + output = output / 12; + } + } else { + delta = this - that; + output = units === 'second' ? delta / 1e3 : // 1000 + units === 'minute' ? delta / 6e4 : // 1000 * 60 + units === 'hour' ? delta / 36e5 : // 1000 * 60 * 60 + units === 'day' ? (delta - zoneDelta) / 864e5 : // 1000 * 60 * 60 * 24, negate dst + units === 'week' ? (delta - zoneDelta) / 6048e5 : // 1000 * 60 * 60 * 24 * 7, negate dst + delta; + } + return asFloat ? output : absFloor(output); + } + + function monthDiff (a, b) { + // difference in months + var wholeMonthDiff = ((b.year() - a.year()) * 12) + (b.month() - a.month()), + // b is in (anchor - 1 month, anchor + 1 month) + anchor = a.clone().add(wholeMonthDiff, 'months'), + anchor2, adjust; + + if (b - anchor < 0) { + anchor2 = a.clone().add(wholeMonthDiff - 1, 'months'); + // linear across the month + adjust = (b - anchor) / (anchor - anchor2); + } else { + anchor2 = a.clone().add(wholeMonthDiff + 1, 'months'); + // linear across the month + adjust = (b - anchor) / (anchor2 - anchor); + } + + //check for negative zero, return zero if negative zero + return -(wholeMonthDiff + adjust) || 0; + } + + utils_hooks__hooks.defaultFormat = 'YYYY-MM-DDTHH:mm:ssZ'; + utils_hooks__hooks.defaultFormatUtc = 'YYYY-MM-DDTHH:mm:ss[Z]'; + + function toString () { + return this.clone().locale('en').format('ddd MMM DD YYYY HH:mm:ss [GMT]ZZ'); + } + + function moment_format__toISOString () { + var m = this.clone().utc(); + if (0 < m.year() && m.year() <= 9999) { + if (isFunction(Date.prototype.toISOString)) { + // native implementation is ~50x faster, use it when we can + return this.toDate().toISOString(); + } else { + return formatMoment(m, 'YYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); + } + } else { + return formatMoment(m, 'YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]'); + } + } + + function format (inputString) { + if (!inputString) { + inputString = this.isUtc() ? utils_hooks__hooks.defaultFormatUtc : utils_hooks__hooks.defaultFormat; + } + var output = formatMoment(this, inputString); + return this.localeData().postformat(output); + } + + function from (time, withoutSuffix) { + if (this.isValid() && + ((isMoment(time) && time.isValid()) || + local__createLocal(time).isValid())) { + return create__createDuration({to: this, from: time}).locale(this.locale()).humanize(!withoutSuffix); + } else { + return this.localeData().invalidDate(); + } + } + + function fromNow (withoutSuffix) { + return this.from(local__createLocal(), withoutSuffix); + } + + function to (time, withoutSuffix) { + if (this.isValid() && + ((isMoment(time) && time.isValid()) || + local__createLocal(time).isValid())) { + return create__createDuration({from: this, to: time}).locale(this.locale()).humanize(!withoutSuffix); + } else { + return this.localeData().invalidDate(); + } + } + + function toNow (withoutSuffix) { + return this.to(local__createLocal(), withoutSuffix); + } + + // If passed a locale key, it will set the locale for this + // instance. Otherwise, it will return the locale configuration + // variables for this instance. + function locale (key) { + var newLocaleData; + + if (key === undefined) { + return this._locale._abbr; + } else { + newLocaleData = locale_locales__getLocale(key); + if (newLocaleData != null) { + this._locale = newLocaleData; + } + return this; + } + } + + var lang = deprecate( + 'moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.', + function (key) { + if (key === undefined) { + return this.localeData(); + } else { + return this.locale(key); + } + } + ); + + function localeData () { + return this._locale; + } + + function startOf (units) { + units = normalizeUnits(units); + // the following switch intentionally omits break keywords + // to utilize falling through the cases. + switch (units) { + case 'year': + this.month(0); + /* falls through */ + case 'quarter': + case 'month': + this.date(1); + /* falls through */ + case 'week': + case 'isoWeek': + case 'day': + case 'date': + this.hours(0); + /* falls through */ + case 'hour': + this.minutes(0); + /* falls through */ + case 'minute': + this.seconds(0); + /* falls through */ + case 'second': + this.milliseconds(0); + } + + // weeks are a special case + if (units === 'week') { + this.weekday(0); + } + if (units === 'isoWeek') { + this.isoWeekday(1); + } + + // quarters are also special + if (units === 'quarter') { + this.month(Math.floor(this.month() / 3) * 3); + } + + return this; + } + + function endOf (units) { + units = normalizeUnits(units); + if (units === undefined || units === 'millisecond') { + return this; + } + + // 'date' is an alias for 'day', so it should be considered as such. + if (units === 'date') { + units = 'day'; + } + + return this.startOf(units).add(1, (units === 'isoWeek' ? 'week' : units)).subtract(1, 'ms'); + } + + function to_type__valueOf () { + return this._d.valueOf() - ((this._offset || 0) * 60000); + } + + function unix () { + return Math.floor(this.valueOf() / 1000); + } + + function toDate () { + return this._offset ? new Date(this.valueOf()) : this._d; + } + + function toArray () { + var m = this; + return [m.year(), m.month(), m.date(), m.hour(), m.minute(), m.second(), m.millisecond()]; + } + + function toObject () { + var m = this; + return { + years: m.year(), + months: m.month(), + date: m.date(), + hours: m.hours(), + minutes: m.minutes(), + seconds: m.seconds(), + milliseconds: m.milliseconds() + }; + } + + function toJSON () { + // new Date(NaN).toJSON() === null + return this.isValid() ? this.toISOString() : null; + } + + function moment_valid__isValid () { + return valid__isValid(this); + } + + function parsingFlags () { + return extend({}, getParsingFlags(this)); + } + + function invalidAt () { + return getParsingFlags(this).overflow; + } + + function creationData() { + return { + input: this._i, + format: this._f, + locale: this._locale, + isUTC: this._isUTC, + strict: this._strict + }; + } + + // FORMATTING + + addFormatToken(0, ['gg', 2], 0, function () { + return this.weekYear() % 100; + }); + + addFormatToken(0, ['GG', 2], 0, function () { + return this.isoWeekYear() % 100; + }); + + function addWeekYearFormatToken (token, getter) { + addFormatToken(0, [token, token.length], 0, getter); + } + + addWeekYearFormatToken('gggg', 'weekYear'); + addWeekYearFormatToken('ggggg', 'weekYear'); + addWeekYearFormatToken('GGGG', 'isoWeekYear'); + addWeekYearFormatToken('GGGGG', 'isoWeekYear'); + + // ALIASES + + addUnitAlias('weekYear', 'gg'); + addUnitAlias('isoWeekYear', 'GG'); + + // PARSING + + addRegexToken('G', matchSigned); + addRegexToken('g', matchSigned); + addRegexToken('GG', match1to2, match2); + addRegexToken('gg', match1to2, match2); + addRegexToken('GGGG', match1to4, match4); + addRegexToken('gggg', match1to4, match4); + addRegexToken('GGGGG', match1to6, match6); + addRegexToken('ggggg', match1to6, match6); + + addWeekParseToken(['gggg', 'ggggg', 'GGGG', 'GGGGG'], function (input, week, config, token) { + week[token.substr(0, 2)] = toInt(input); + }); + + addWeekParseToken(['gg', 'GG'], function (input, week, config, token) { + week[token] = utils_hooks__hooks.parseTwoDigitYear(input); + }); + + // MOMENTS + + function getSetWeekYear (input) { + return getSetWeekYearHelper.call(this, + input, + this.week(), + this.weekday(), + this.localeData()._week.dow, + this.localeData()._week.doy); + } + + function getSetISOWeekYear (input) { + return getSetWeekYearHelper.call(this, + input, this.isoWeek(), this.isoWeekday(), 1, 4); + } + + function getISOWeeksInYear () { + return weeksInYear(this.year(), 1, 4); + } + + function getWeeksInYear () { + var weekInfo = this.localeData()._week; + return weeksInYear(this.year(), weekInfo.dow, weekInfo.doy); + } + + function getSetWeekYearHelper(input, week, weekday, dow, doy) { + var weeksTarget; + if (input == null) { + return weekOfYear(this, dow, doy).year; + } else { + weeksTarget = weeksInYear(input, dow, doy); + if (week > weeksTarget) { + week = weeksTarget; + } + return setWeekAll.call(this, input, week, weekday, dow, doy); + } + } + + function setWeekAll(weekYear, week, weekday, dow, doy) { + var dayOfYearData = dayOfYearFromWeeks(weekYear, week, weekday, dow, doy), + date = createUTCDate(dayOfYearData.year, 0, dayOfYearData.dayOfYear); + + this.year(date.getUTCFullYear()); + this.month(date.getUTCMonth()); + this.date(date.getUTCDate()); + return this; + } + + // FORMATTING + + addFormatToken('Q', 0, 'Qo', 'quarter'); + + // ALIASES + + addUnitAlias('quarter', 'Q'); + + // PARSING + + addRegexToken('Q', match1); + addParseToken('Q', function (input, array) { + array[MONTH] = (toInt(input) - 1) * 3; + }); + + // MOMENTS + + function getSetQuarter (input) { + return input == null ? Math.ceil((this.month() + 1) / 3) : this.month((input - 1) * 3 + this.month() % 3); + } + + // FORMATTING + + addFormatToken('w', ['ww', 2], 'wo', 'week'); + addFormatToken('W', ['WW', 2], 'Wo', 'isoWeek'); + + // ALIASES + + addUnitAlias('week', 'w'); + addUnitAlias('isoWeek', 'W'); + + // PARSING + + addRegexToken('w', match1to2); + addRegexToken('ww', match1to2, match2); + addRegexToken('W', match1to2); + addRegexToken('WW', match1to2, match2); + + addWeekParseToken(['w', 'ww', 'W', 'WW'], function (input, week, config, token) { + week[token.substr(0, 1)] = toInt(input); + }); + + // HELPERS + + // LOCALES + + function localeWeek (mom) { + return weekOfYear(mom, this._week.dow, this._week.doy).week; + } + + var defaultLocaleWeek = { + dow : 0, // Sunday is the first day of the week. + doy : 6 // The week that contains Jan 1st is the first week of the year. + }; + + function localeFirstDayOfWeek () { + return this._week.dow; + } + + function localeFirstDayOfYear () { + return this._week.doy; + } + + // MOMENTS + + function getSetWeek (input) { + var week = this.localeData().week(this); + return input == null ? week : this.add((input - week) * 7, 'd'); + } + + function getSetISOWeek (input) { + var week = weekOfYear(this, 1, 4).week; + return input == null ? week : this.add((input - week) * 7, 'd'); + } + + // FORMATTING + + addFormatToken('D', ['DD', 2], 'Do', 'date'); + + // ALIASES + + addUnitAlias('date', 'D'); + + // PARSING + + addRegexToken('D', match1to2); + addRegexToken('DD', match1to2, match2); + addRegexToken('Do', function (isStrict, locale) { + return isStrict ? locale._ordinalParse : locale._ordinalParseLenient; + }); + + addParseToken(['D', 'DD'], DATE); + addParseToken('Do', function (input, array) { + array[DATE] = toInt(input.match(match1to2)[0], 10); + }); + + // MOMENTS + + var getSetDayOfMonth = makeGetSet('Date', true); + + // FORMATTING + + addFormatToken('d', 0, 'do', 'day'); + + addFormatToken('dd', 0, 0, function (format) { + return this.localeData().weekdaysMin(this, format); + }); + + addFormatToken('ddd', 0, 0, function (format) { + return this.localeData().weekdaysShort(this, format); + }); + + addFormatToken('dddd', 0, 0, function (format) { + return this.localeData().weekdays(this, format); + }); + + addFormatToken('e', 0, 0, 'weekday'); + addFormatToken('E', 0, 0, 'isoWeekday'); + + // ALIASES + + addUnitAlias('day', 'd'); + addUnitAlias('weekday', 'e'); + addUnitAlias('isoWeekday', 'E'); + + // PARSING + + addRegexToken('d', match1to2); + addRegexToken('e', match1to2); + addRegexToken('E', match1to2); + addRegexToken('dd', function (isStrict, locale) { + return locale.weekdaysMinRegex(isStrict); + }); + addRegexToken('ddd', function (isStrict, locale) { + return locale.weekdaysShortRegex(isStrict); + }); + addRegexToken('dddd', function (isStrict, locale) { + return locale.weekdaysRegex(isStrict); + }); + + addWeekParseToken(['dd', 'ddd', 'dddd'], function (input, week, config, token) { + var weekday = config._locale.weekdaysParse(input, token, config._strict); + // if we didn't get a weekday name, mark the date as invalid + if (weekday != null) { + week.d = weekday; + } else { + getParsingFlags(config).invalidWeekday = input; + } + }); + + addWeekParseToken(['d', 'e', 'E'], function (input, week, config, token) { + week[token] = toInt(input); + }); + + // HELPERS + + function parseWeekday(input, locale) { + if (typeof input !== 'string') { + return input; + } + + if (!isNaN(input)) { + return parseInt(input, 10); + } + + input = locale.weekdaysParse(input); + if (typeof input === 'number') { + return input; + } + + return null; + } + + // LOCALES + + var defaultLocaleWeekdays = 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'); + function localeWeekdays (m, format) { + return isArray(this._weekdays) ? this._weekdays[m.day()] : + this._weekdays[this._weekdays.isFormat.test(format) ? 'format' : 'standalone'][m.day()]; + } + + var defaultLocaleWeekdaysShort = 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'); + function localeWeekdaysShort (m) { + return this._weekdaysShort[m.day()]; + } + + var defaultLocaleWeekdaysMin = 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'); + function localeWeekdaysMin (m) { + return this._weekdaysMin[m.day()]; + } + + function day_of_week__handleStrictParse(weekdayName, format, strict) { + var i, ii, mom, llc = weekdayName.toLocaleLowerCase(); + if (!this._weekdaysParse) { + this._weekdaysParse = []; + this._shortWeekdaysParse = []; + this._minWeekdaysParse = []; + + for (i = 0; i < 7; ++i) { + mom = create_utc__createUTC([2000, 1]).day(i); + this._minWeekdaysParse[i] = this.weekdaysMin(mom, '').toLocaleLowerCase(); + this._shortWeekdaysParse[i] = this.weekdaysShort(mom, '').toLocaleLowerCase(); + this._weekdaysParse[i] = this.weekdays(mom, '').toLocaleLowerCase(); + } + } + + if (strict) { + if (format === 'dddd') { + ii = indexOf.call(this._weekdaysParse, llc); + return ii !== -1 ? ii : null; + } else if (format === 'ddd') { + ii = indexOf.call(this._shortWeekdaysParse, llc); + return ii !== -1 ? ii : null; + } else { + ii = indexOf.call(this._minWeekdaysParse, llc); + return ii !== -1 ? ii : null; + } + } else { + if (format === 'dddd') { + ii = indexOf.call(this._weekdaysParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf.call(this._shortWeekdaysParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf.call(this._minWeekdaysParse, llc); + return ii !== -1 ? ii : null; + } else if (format === 'ddd') { + ii = indexOf.call(this._shortWeekdaysParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf.call(this._weekdaysParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf.call(this._minWeekdaysParse, llc); + return ii !== -1 ? ii : null; + } else { + ii = indexOf.call(this._minWeekdaysParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf.call(this._weekdaysParse, llc); + if (ii !== -1) { + return ii; + } + ii = indexOf.call(this._shortWeekdaysParse, llc); + return ii !== -1 ? ii : null; + } + } + } + + function localeWeekdaysParse (weekdayName, format, strict) { + var i, mom, regex; + + if (this._weekdaysParseExact) { + return day_of_week__handleStrictParse.call(this, weekdayName, format, strict); + } + + if (!this._weekdaysParse) { + this._weekdaysParse = []; + this._minWeekdaysParse = []; + this._shortWeekdaysParse = []; + this._fullWeekdaysParse = []; + } + + for (i = 0; i < 7; i++) { + // make the regex if we don't have it already + + mom = create_utc__createUTC([2000, 1]).day(i); + if (strict && !this._fullWeekdaysParse[i]) { + this._fullWeekdaysParse[i] = new RegExp('^' + this.weekdays(mom, '').replace('.', '\.?') + '$', 'i'); + this._shortWeekdaysParse[i] = new RegExp('^' + this.weekdaysShort(mom, '').replace('.', '\.?') + '$', 'i'); + this._minWeekdaysParse[i] = new RegExp('^' + this.weekdaysMin(mom, '').replace('.', '\.?') + '$', 'i'); + } + if (!this._weekdaysParse[i]) { + regex = '^' + this.weekdays(mom, '') + '|^' + this.weekdaysShort(mom, '') + '|^' + this.weekdaysMin(mom, ''); + this._weekdaysParse[i] = new RegExp(regex.replace('.', ''), 'i'); + } + // test the regex + if (strict && format === 'dddd' && this._fullWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (strict && format === 'ddd' && this._shortWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (strict && format === 'dd' && this._minWeekdaysParse[i].test(weekdayName)) { + return i; + } else if (!strict && this._weekdaysParse[i].test(weekdayName)) { + return i; + } + } + } + + // MOMENTS + + function getSetDayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } + var day = this._isUTC ? this._d.getUTCDay() : this._d.getDay(); + if (input != null) { + input = parseWeekday(input, this.localeData()); + return this.add(input - day, 'd'); + } else { + return day; + } + } + + function getSetLocaleDayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } + var weekday = (this.day() + 7 - this.localeData()._week.dow) % 7; + return input == null ? weekday : this.add(input - weekday, 'd'); + } + + function getSetISODayOfWeek (input) { + if (!this.isValid()) { + return input != null ? this : NaN; + } + // behaves the same as moment#day except + // as a getter, returns 7 instead of 0 (1-7 range instead of 0-6) + // as a setter, sunday should belong to the previous week. + return input == null ? this.day() || 7 : this.day(this.day() % 7 ? input : input - 7); + } + + var defaultWeekdaysRegex = matchWord; + function weekdaysRegex (isStrict) { + if (this._weekdaysParseExact) { + if (!hasOwnProp(this, '_weekdaysRegex')) { + computeWeekdaysParse.call(this); + } + if (isStrict) { + return this._weekdaysStrictRegex; + } else { + return this._weekdaysRegex; + } + } else { + return this._weekdaysStrictRegex && isStrict ? + this._weekdaysStrictRegex : this._weekdaysRegex; + } + } + + var defaultWeekdaysShortRegex = matchWord; + function weekdaysShortRegex (isStrict) { + if (this._weekdaysParseExact) { + if (!hasOwnProp(this, '_weekdaysRegex')) { + computeWeekdaysParse.call(this); + } + if (isStrict) { + return this._weekdaysShortStrictRegex; + } else { + return this._weekdaysShortRegex; + } + } else { + return this._weekdaysShortStrictRegex && isStrict ? + this._weekdaysShortStrictRegex : this._weekdaysShortRegex; + } + } + + var defaultWeekdaysMinRegex = matchWord; + function weekdaysMinRegex (isStrict) { + if (this._weekdaysParseExact) { + if (!hasOwnProp(this, '_weekdaysRegex')) { + computeWeekdaysParse.call(this); + } + if (isStrict) { + return this._weekdaysMinStrictRegex; + } else { + return this._weekdaysMinRegex; + } + } else { + return this._weekdaysMinStrictRegex && isStrict ? + this._weekdaysMinStrictRegex : this._weekdaysMinRegex; + } + } + + + function computeWeekdaysParse () { + function cmpLenRev(a, b) { + return b.length - a.length; + } + + var minPieces = [], shortPieces = [], longPieces = [], mixedPieces = [], + i, mom, minp, shortp, longp; + for (i = 0; i < 7; i++) { + // make the regex if we don't have it already + mom = create_utc__createUTC([2000, 1]).day(i); + minp = this.weekdaysMin(mom, ''); + shortp = this.weekdaysShort(mom, ''); + longp = this.weekdays(mom, ''); + minPieces.push(minp); + shortPieces.push(shortp); + longPieces.push(longp); + mixedPieces.push(minp); + mixedPieces.push(shortp); + mixedPieces.push(longp); + } + // Sorting makes sure if one weekday (or abbr) is a prefix of another it + // will match the longer piece. + minPieces.sort(cmpLenRev); + shortPieces.sort(cmpLenRev); + longPieces.sort(cmpLenRev); + mixedPieces.sort(cmpLenRev); + for (i = 0; i < 7; i++) { + shortPieces[i] = regexEscape(shortPieces[i]); + longPieces[i] = regexEscape(longPieces[i]); + mixedPieces[i] = regexEscape(mixedPieces[i]); + } + + this._weekdaysRegex = new RegExp('^(' + mixedPieces.join('|') + ')', 'i'); + this._weekdaysShortRegex = this._weekdaysRegex; + this._weekdaysMinRegex = this._weekdaysRegex; + + this._weekdaysStrictRegex = new RegExp('^(' + longPieces.join('|') + ')', 'i'); + this._weekdaysShortStrictRegex = new RegExp('^(' + shortPieces.join('|') + ')', 'i'); + this._weekdaysMinStrictRegex = new RegExp('^(' + minPieces.join('|') + ')', 'i'); + } + + // FORMATTING + + addFormatToken('DDD', ['DDDD', 3], 'DDDo', 'dayOfYear'); + + // ALIASES + + addUnitAlias('dayOfYear', 'DDD'); + + // PARSING + + addRegexToken('DDD', match1to3); + addRegexToken('DDDD', match3); + addParseToken(['DDD', 'DDDD'], function (input, array, config) { + config._dayOfYear = toInt(input); + }); + + // HELPERS + + // MOMENTS + + function getSetDayOfYear (input) { + var dayOfYear = Math.round((this.clone().startOf('day') - this.clone().startOf('year')) / 864e5) + 1; + return input == null ? dayOfYear : this.add((input - dayOfYear), 'd'); + } + + // FORMATTING + + function hFormat() { + return this.hours() % 12 || 12; + } + + function kFormat() { + return this.hours() || 24; + } + + addFormatToken('H', ['HH', 2], 0, 'hour'); + addFormatToken('h', ['hh', 2], 0, hFormat); + addFormatToken('k', ['kk', 2], 0, kFormat); + + addFormatToken('hmm', 0, 0, function () { + return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2); + }); + + addFormatToken('hmmss', 0, 0, function () { + return '' + hFormat.apply(this) + zeroFill(this.minutes(), 2) + + zeroFill(this.seconds(), 2); + }); + + addFormatToken('Hmm', 0, 0, function () { + return '' + this.hours() + zeroFill(this.minutes(), 2); + }); + + addFormatToken('Hmmss', 0, 0, function () { + return '' + this.hours() + zeroFill(this.minutes(), 2) + + zeroFill(this.seconds(), 2); + }); + + function meridiem (token, lowercase) { + addFormatToken(token, 0, 0, function () { + return this.localeData().meridiem(this.hours(), this.minutes(), lowercase); + }); + } + + meridiem('a', true); + meridiem('A', false); + + // ALIASES + + addUnitAlias('hour', 'h'); + + // PARSING + + function matchMeridiem (isStrict, locale) { + return locale._meridiemParse; + } + + addRegexToken('a', matchMeridiem); + addRegexToken('A', matchMeridiem); + addRegexToken('H', match1to2); + addRegexToken('h', match1to2); + addRegexToken('HH', match1to2, match2); + addRegexToken('hh', match1to2, match2); + + addRegexToken('hmm', match3to4); + addRegexToken('hmmss', match5to6); + addRegexToken('Hmm', match3to4); + addRegexToken('Hmmss', match5to6); + + addParseToken(['H', 'HH'], HOUR); + addParseToken(['a', 'A'], function (input, array, config) { + config._isPm = config._locale.isPM(input); + config._meridiem = input; + }); + addParseToken(['h', 'hh'], function (input, array, config) { + array[HOUR] = toInt(input); + getParsingFlags(config).bigHour = true; + }); + addParseToken('hmm', function (input, array, config) { + var pos = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos)); + array[MINUTE] = toInt(input.substr(pos)); + getParsingFlags(config).bigHour = true; + }); + addParseToken('hmmss', function (input, array, config) { + var pos1 = input.length - 4; + var pos2 = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos1)); + array[MINUTE] = toInt(input.substr(pos1, 2)); + array[SECOND] = toInt(input.substr(pos2)); + getParsingFlags(config).bigHour = true; + }); + addParseToken('Hmm', function (input, array, config) { + var pos = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos)); + array[MINUTE] = toInt(input.substr(pos)); + }); + addParseToken('Hmmss', function (input, array, config) { + var pos1 = input.length - 4; + var pos2 = input.length - 2; + array[HOUR] = toInt(input.substr(0, pos1)); + array[MINUTE] = toInt(input.substr(pos1, 2)); + array[SECOND] = toInt(input.substr(pos2)); + }); + + // LOCALES + + function localeIsPM (input) { + // IE8 Quirks Mode & IE7 Standards Mode do not allow accessing strings like arrays + // Using charAt should be more compatible. + return ((input + '').toLowerCase().charAt(0) === 'p'); + } + + var defaultLocaleMeridiemParse = /[ap]\.?m?\.?/i; + function localeMeridiem (hours, minutes, isLower) { + if (hours > 11) { + return isLower ? 'pm' : 'PM'; + } else { + return isLower ? 'am' : 'AM'; + } + } + + + // MOMENTS + + // Setting the hour should keep the time, because the user explicitly + // specified which hour he wants. So trying to maintain the same hour (in + // a new timezone) makes sense. Adding/subtracting hours does not follow + // this rule. + var getSetHour = makeGetSet('Hours', true); + + // FORMATTING + + addFormatToken('m', ['mm', 2], 0, 'minute'); + + // ALIASES + + addUnitAlias('minute', 'm'); + + // PARSING + + addRegexToken('m', match1to2); + addRegexToken('mm', match1to2, match2); + addParseToken(['m', 'mm'], MINUTE); + + // MOMENTS + + var getSetMinute = makeGetSet('Minutes', false); + + // FORMATTING + + addFormatToken('s', ['ss', 2], 0, 'second'); + + // ALIASES + + addUnitAlias('second', 's'); + + // PARSING + + addRegexToken('s', match1to2); + addRegexToken('ss', match1to2, match2); + addParseToken(['s', 'ss'], SECOND); + + // MOMENTS + + var getSetSecond = makeGetSet('Seconds', false); + + // FORMATTING + + addFormatToken('S', 0, 0, function () { + return ~~(this.millisecond() / 100); + }); + + addFormatToken(0, ['SS', 2], 0, function () { + return ~~(this.millisecond() / 10); + }); + + addFormatToken(0, ['SSS', 3], 0, 'millisecond'); + addFormatToken(0, ['SSSS', 4], 0, function () { + return this.millisecond() * 10; + }); + addFormatToken(0, ['SSSSS', 5], 0, function () { + return this.millisecond() * 100; + }); + addFormatToken(0, ['SSSSSS', 6], 0, function () { + return this.millisecond() * 1000; + }); + addFormatToken(0, ['SSSSSSS', 7], 0, function () { + return this.millisecond() * 10000; + }); + addFormatToken(0, ['SSSSSSSS', 8], 0, function () { + return this.millisecond() * 100000; + }); + addFormatToken(0, ['SSSSSSSSS', 9], 0, function () { + return this.millisecond() * 1000000; + }); + + + // ALIASES + + addUnitAlias('millisecond', 'ms'); + + // PARSING + + addRegexToken('S', match1to3, match1); + addRegexToken('SS', match1to3, match2); + addRegexToken('SSS', match1to3, match3); + + var token; + for (token = 'SSSS'; token.length <= 9; token += 'S') { + addRegexToken(token, matchUnsigned); + } + + function parseMs(input, array) { + array[MILLISECOND] = toInt(('0.' + input) * 1000); + } + + for (token = 'S'; token.length <= 9; token += 'S') { + addParseToken(token, parseMs); + } + // MOMENTS + + var getSetMillisecond = makeGetSet('Milliseconds', false); + + // FORMATTING + + addFormatToken('z', 0, 0, 'zoneAbbr'); + addFormatToken('zz', 0, 0, 'zoneName'); + + // MOMENTS + + function getZoneAbbr () { + return this._isUTC ? 'UTC' : ''; + } + + function getZoneName () { + return this._isUTC ? 'Coordinated Universal Time' : ''; + } + + var momentPrototype__proto = Moment.prototype; + + momentPrototype__proto.add = add_subtract__add; + momentPrototype__proto.calendar = moment_calendar__calendar; + momentPrototype__proto.clone = clone; + momentPrototype__proto.diff = diff; + momentPrototype__proto.endOf = endOf; + momentPrototype__proto.format = format; + momentPrototype__proto.from = from; + momentPrototype__proto.fromNow = fromNow; + momentPrototype__proto.to = to; + momentPrototype__proto.toNow = toNow; + momentPrototype__proto.get = getSet; + momentPrototype__proto.invalidAt = invalidAt; + momentPrototype__proto.isAfter = isAfter; + momentPrototype__proto.isBefore = isBefore; + momentPrototype__proto.isBetween = isBetween; + momentPrototype__proto.isSame = isSame; + momentPrototype__proto.isSameOrAfter = isSameOrAfter; + momentPrototype__proto.isSameOrBefore = isSameOrBefore; + momentPrototype__proto.isValid = moment_valid__isValid; + momentPrototype__proto.lang = lang; + momentPrototype__proto.locale = locale; + momentPrototype__proto.localeData = localeData; + momentPrototype__proto.max = prototypeMax; + momentPrototype__proto.min = prototypeMin; + momentPrototype__proto.parsingFlags = parsingFlags; + momentPrototype__proto.set = getSet; + momentPrototype__proto.startOf = startOf; + momentPrototype__proto.subtract = add_subtract__subtract; + momentPrototype__proto.toArray = toArray; + momentPrototype__proto.toObject = toObject; + momentPrototype__proto.toDate = toDate; + momentPrototype__proto.toISOString = moment_format__toISOString; + momentPrototype__proto.toJSON = toJSON; + momentPrototype__proto.toString = toString; + momentPrototype__proto.unix = unix; + momentPrototype__proto.valueOf = to_type__valueOf; + momentPrototype__proto.creationData = creationData; + + // Year + momentPrototype__proto.year = getSetYear; + momentPrototype__proto.isLeapYear = getIsLeapYear; + + // Week Year + momentPrototype__proto.weekYear = getSetWeekYear; + momentPrototype__proto.isoWeekYear = getSetISOWeekYear; + + // Quarter + momentPrototype__proto.quarter = momentPrototype__proto.quarters = getSetQuarter; + + // Month + momentPrototype__proto.month = getSetMonth; + momentPrototype__proto.daysInMonth = getDaysInMonth; + + // Week + momentPrototype__proto.week = momentPrototype__proto.weeks = getSetWeek; + momentPrototype__proto.isoWeek = momentPrototype__proto.isoWeeks = getSetISOWeek; + momentPrototype__proto.weeksInYear = getWeeksInYear; + momentPrototype__proto.isoWeeksInYear = getISOWeeksInYear; + + // Day + momentPrototype__proto.date = getSetDayOfMonth; + momentPrototype__proto.day = momentPrototype__proto.days = getSetDayOfWeek; + momentPrototype__proto.weekday = getSetLocaleDayOfWeek; + momentPrototype__proto.isoWeekday = getSetISODayOfWeek; + momentPrototype__proto.dayOfYear = getSetDayOfYear; + + // Hour + momentPrototype__proto.hour = momentPrototype__proto.hours = getSetHour; + + // Minute + momentPrototype__proto.minute = momentPrototype__proto.minutes = getSetMinute; + + // Second + momentPrototype__proto.second = momentPrototype__proto.seconds = getSetSecond; + + // Millisecond + momentPrototype__proto.millisecond = momentPrototype__proto.milliseconds = getSetMillisecond; + + // Offset + momentPrototype__proto.utcOffset = getSetOffset; + momentPrototype__proto.utc = setOffsetToUTC; + momentPrototype__proto.local = setOffsetToLocal; + momentPrototype__proto.parseZone = setOffsetToParsedOffset; + momentPrototype__proto.hasAlignedHourOffset = hasAlignedHourOffset; + momentPrototype__proto.isDST = isDaylightSavingTime; + momentPrototype__proto.isDSTShifted = isDaylightSavingTimeShifted; + momentPrototype__proto.isLocal = isLocal; + momentPrototype__proto.isUtcOffset = isUtcOffset; + momentPrototype__proto.isUtc = isUtc; + momentPrototype__proto.isUTC = isUtc; + + // Timezone + momentPrototype__proto.zoneAbbr = getZoneAbbr; + momentPrototype__proto.zoneName = getZoneName; + + // Deprecations + momentPrototype__proto.dates = deprecate('dates accessor is deprecated. Use date instead.', getSetDayOfMonth); + momentPrototype__proto.months = deprecate('months accessor is deprecated. Use month instead', getSetMonth); + momentPrototype__proto.years = deprecate('years accessor is deprecated. Use year instead', getSetYear); + momentPrototype__proto.zone = deprecate('moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779', getSetZone); + + var momentPrototype = momentPrototype__proto; + + function moment__createUnix (input) { + return local__createLocal(input * 1000); + } + + function moment__createInZone () { + return local__createLocal.apply(null, arguments).parseZone(); + } + + var defaultCalendar = { + sameDay : '[Today at] LT', + nextDay : '[Tomorrow at] LT', + nextWeek : 'dddd [at] LT', + lastDay : '[Yesterday at] LT', + lastWeek : '[Last] dddd [at] LT', + sameElse : 'L' + }; + + function locale_calendar__calendar (key, mom, now) { + var output = this._calendar[key]; + return isFunction(output) ? output.call(mom, now) : output; + } + + var defaultLongDateFormat = { + LTS : 'h:mm:ss A', + LT : 'h:mm A', + L : 'MM/DD/YYYY', + LL : 'MMMM D, YYYY', + LLL : 'MMMM D, YYYY h:mm A', + LLLL : 'dddd, MMMM D, YYYY h:mm A' + }; + + function longDateFormat (key) { + var format = this._longDateFormat[key], + formatUpper = this._longDateFormat[key.toUpperCase()]; + + if (format || !formatUpper) { + return format; + } + + this._longDateFormat[key] = formatUpper.replace(/MMMM|MM|DD|dddd/g, function (val) { + return val.slice(1); + }); + + return this._longDateFormat[key]; + } + + var defaultInvalidDate = 'Invalid date'; + + function invalidDate () { + return this._invalidDate; + } + + var defaultOrdinal = '%d'; + var defaultOrdinalParse = /\d{1,2}/; + + function ordinal (number) { + return this._ordinal.replace('%d', number); + } + + function preParsePostFormat (string) { + return string; + } + + var defaultRelativeTime = { + future : 'in %s', + past : '%s ago', + s : 'a few seconds', + m : 'a minute', + mm : '%d minutes', + h : 'an hour', + hh : '%d hours', + d : 'a day', + dd : '%d days', + M : 'a month', + MM : '%d months', + y : 'a year', + yy : '%d years' + }; + + function relative__relativeTime (number, withoutSuffix, string, isFuture) { + var output = this._relativeTime[string]; + return (isFunction(output)) ? + output(number, withoutSuffix, string, isFuture) : + output.replace(/%d/i, number); + } + + function pastFuture (diff, output) { + var format = this._relativeTime[diff > 0 ? 'future' : 'past']; + return isFunction(format) ? format(output) : format.replace(/%s/i, output); + } + + var prototype__proto = Locale.prototype; + + prototype__proto._calendar = defaultCalendar; + prototype__proto.calendar = locale_calendar__calendar; + prototype__proto._longDateFormat = defaultLongDateFormat; + prototype__proto.longDateFormat = longDateFormat; + prototype__proto._invalidDate = defaultInvalidDate; + prototype__proto.invalidDate = invalidDate; + prototype__proto._ordinal = defaultOrdinal; + prototype__proto.ordinal = ordinal; + prototype__proto._ordinalParse = defaultOrdinalParse; + prototype__proto.preparse = preParsePostFormat; + prototype__proto.postformat = preParsePostFormat; + prototype__proto._relativeTime = defaultRelativeTime; + prototype__proto.relativeTime = relative__relativeTime; + prototype__proto.pastFuture = pastFuture; + prototype__proto.set = locale_set__set; + + // Month + prototype__proto.months = localeMonths; + prototype__proto._months = defaultLocaleMonths; + prototype__proto.monthsShort = localeMonthsShort; + prototype__proto._monthsShort = defaultLocaleMonthsShort; + prototype__proto.monthsParse = localeMonthsParse; + prototype__proto._monthsRegex = defaultMonthsRegex; + prototype__proto.monthsRegex = monthsRegex; + prototype__proto._monthsShortRegex = defaultMonthsShortRegex; + prototype__proto.monthsShortRegex = monthsShortRegex; + + // Week + prototype__proto.week = localeWeek; + prototype__proto._week = defaultLocaleWeek; + prototype__proto.firstDayOfYear = localeFirstDayOfYear; + prototype__proto.firstDayOfWeek = localeFirstDayOfWeek; + + // Day of Week + prototype__proto.weekdays = localeWeekdays; + prototype__proto._weekdays = defaultLocaleWeekdays; + prototype__proto.weekdaysMin = localeWeekdaysMin; + prototype__proto._weekdaysMin = defaultLocaleWeekdaysMin; + prototype__proto.weekdaysShort = localeWeekdaysShort; + prototype__proto._weekdaysShort = defaultLocaleWeekdaysShort; + prototype__proto.weekdaysParse = localeWeekdaysParse; + + prototype__proto._weekdaysRegex = defaultWeekdaysRegex; + prototype__proto.weekdaysRegex = weekdaysRegex; + prototype__proto._weekdaysShortRegex = defaultWeekdaysShortRegex; + prototype__proto.weekdaysShortRegex = weekdaysShortRegex; + prototype__proto._weekdaysMinRegex = defaultWeekdaysMinRegex; + prototype__proto.weekdaysMinRegex = weekdaysMinRegex; + + // Hours + prototype__proto.isPM = localeIsPM; + prototype__proto._meridiemParse = defaultLocaleMeridiemParse; + prototype__proto.meridiem = localeMeridiem; + + function lists__get (format, index, field, setter) { + var locale = locale_locales__getLocale(); + var utc = create_utc__createUTC().set(setter, index); + return locale[field](utc, format); + } + + function listMonthsImpl (format, index, field) { + if (typeof format === 'number') { + index = format; + format = undefined; + } + + format = format || ''; + + if (index != null) { + return lists__get(format, index, field, 'month'); + } + + var i; + var out = []; + for (i = 0; i < 12; i++) { + out[i] = lists__get(format, i, field, 'month'); + } + return out; + } + + // () + // (5) + // (fmt, 5) + // (fmt) + // (true) + // (true, 5) + // (true, fmt, 5) + // (true, fmt) + function listWeekdaysImpl (localeSorted, format, index, field) { + if (typeof localeSorted === 'boolean') { + if (typeof format === 'number') { + index = format; + format = undefined; + } + + format = format || ''; + } else { + format = localeSorted; + index = format; + localeSorted = false; + + if (typeof format === 'number') { + index = format; + format = undefined; + } + + format = format || ''; + } + + var locale = locale_locales__getLocale(), + shift = localeSorted ? locale._week.dow : 0; + + if (index != null) { + return lists__get(format, (index + shift) % 7, field, 'day'); + } + + var i; + var out = []; + for (i = 0; i < 7; i++) { + out[i] = lists__get(format, (i + shift) % 7, field, 'day'); + } + return out; + } + + function lists__listMonths (format, index) { + return listMonthsImpl(format, index, 'months'); + } + + function lists__listMonthsShort (format, index) { + return listMonthsImpl(format, index, 'monthsShort'); + } + + function lists__listWeekdays (localeSorted, format, index) { + return listWeekdaysImpl(localeSorted, format, index, 'weekdays'); + } + + function lists__listWeekdaysShort (localeSorted, format, index) { + return listWeekdaysImpl(localeSorted, format, index, 'weekdaysShort'); + } + + function lists__listWeekdaysMin (localeSorted, format, index) { + return listWeekdaysImpl(localeSorted, format, index, 'weekdaysMin'); + } + + locale_locales__getSetGlobalLocale('en', { + ordinalParse: /\d{1,2}(th|st|nd|rd)/, + ordinal : function (number) { + var b = number % 10, + output = (toInt(number % 100 / 10) === 1) ? 'th' : + (b === 1) ? 'st' : + (b === 2) ? 'nd' : + (b === 3) ? 'rd' : 'th'; + return number + output; + } + }); + + // Side effect imports + utils_hooks__hooks.lang = deprecate('moment.lang is deprecated. Use moment.locale instead.', locale_locales__getSetGlobalLocale); + utils_hooks__hooks.langData = deprecate('moment.langData is deprecated. Use moment.localeData instead.', locale_locales__getLocale); + + var mathAbs = Math.abs; + + function duration_abs__abs () { + var data = this._data; + + this._milliseconds = mathAbs(this._milliseconds); + this._days = mathAbs(this._days); + this._months = mathAbs(this._months); + + data.milliseconds = mathAbs(data.milliseconds); + data.seconds = mathAbs(data.seconds); + data.minutes = mathAbs(data.minutes); + data.hours = mathAbs(data.hours); + data.months = mathAbs(data.months); + data.years = mathAbs(data.years); + + return this; + } + + function duration_add_subtract__addSubtract (duration, input, value, direction) { + var other = create__createDuration(input, value); + + duration._milliseconds += direction * other._milliseconds; + duration._days += direction * other._days; + duration._months += direction * other._months; + + return duration._bubble(); + } + + // supports only 2.0-style add(1, 's') or add(duration) + function duration_add_subtract__add (input, value) { + return duration_add_subtract__addSubtract(this, input, value, 1); + } + + // supports only 2.0-style subtract(1, 's') or subtract(duration) + function duration_add_subtract__subtract (input, value) { + return duration_add_subtract__addSubtract(this, input, value, -1); + } + + function absCeil (number) { + if (number < 0) { + return Math.floor(number); + } else { + return Math.ceil(number); + } + } + + function bubble () { + var milliseconds = this._milliseconds; + var days = this._days; + var months = this._months; + var data = this._data; + var seconds, minutes, hours, years, monthsFromDays; + + // if we have a mix of positive and negative values, bubble down first + // check: https://github.com/moment/moment/issues/2166 + if (!((milliseconds >= 0 && days >= 0 && months >= 0) || + (milliseconds <= 0 && days <= 0 && months <= 0))) { + milliseconds += absCeil(monthsToDays(months) + days) * 864e5; + days = 0; + months = 0; + } + + // The following code bubbles up values, see the tests for + // examples of what that means. + data.milliseconds = milliseconds % 1000; + + seconds = absFloor(milliseconds / 1000); + data.seconds = seconds % 60; + + minutes = absFloor(seconds / 60); + data.minutes = minutes % 60; + + hours = absFloor(minutes / 60); + data.hours = hours % 24; + + days += absFloor(hours / 24); + + // convert days to months + monthsFromDays = absFloor(daysToMonths(days)); + months += monthsFromDays; + days -= absCeil(monthsToDays(monthsFromDays)); + + // 12 months -> 1 year + years = absFloor(months / 12); + months %= 12; + + data.days = days; + data.months = months; + data.years = years; + + return this; + } + + function daysToMonths (days) { + // 400 years have 146097 days (taking into account leap year rules) + // 400 years have 12 months === 4800 + return days * 4800 / 146097; + } + + function monthsToDays (months) { + // the reverse of daysToMonths + return months * 146097 / 4800; + } + + function as (units) { + var days; + var months; + var milliseconds = this._milliseconds; + + units = normalizeUnits(units); + + if (units === 'month' || units === 'year') { + days = this._days + milliseconds / 864e5; + months = this._months + daysToMonths(days); + return units === 'month' ? months : months / 12; + } else { + // handle milliseconds separately because of floating point math errors (issue #1867) + days = this._days + Math.round(monthsToDays(this._months)); + switch (units) { + case 'week' : return days / 7 + milliseconds / 6048e5; + case 'day' : return days + milliseconds / 864e5; + case 'hour' : return days * 24 + milliseconds / 36e5; + case 'minute' : return days * 1440 + milliseconds / 6e4; + case 'second' : return days * 86400 + milliseconds / 1000; + // Math.floor prevents floating point math errors here + case 'millisecond': return Math.floor(days * 864e5) + milliseconds; + default: throw new Error('Unknown unit ' + units); + } + } + } + + // TODO: Use this.as('ms')? + function duration_as__valueOf () { + return ( + this._milliseconds + + this._days * 864e5 + + (this._months % 12) * 2592e6 + + toInt(this._months / 12) * 31536e6 + ); + } + + function makeAs (alias) { + return function () { + return this.as(alias); + }; + } + + var asMilliseconds = makeAs('ms'); + var asSeconds = makeAs('s'); + var asMinutes = makeAs('m'); + var asHours = makeAs('h'); + var asDays = makeAs('d'); + var asWeeks = makeAs('w'); + var asMonths = makeAs('M'); + var asYears = makeAs('y'); + + function duration_get__get (units) { + units = normalizeUnits(units); + return this[units + 's'](); + } + + function makeGetter(name) { + return function () { + return this._data[name]; + }; + } + + var milliseconds = makeGetter('milliseconds'); + var seconds = makeGetter('seconds'); + var minutes = makeGetter('minutes'); + var hours = makeGetter('hours'); + var days = makeGetter('days'); + var months = makeGetter('months'); + var years = makeGetter('years'); + + function weeks () { + return absFloor(this.days() / 7); + } + + var round = Math.round; + var thresholds = { + s: 45, // seconds to minute + m: 45, // minutes to hour + h: 22, // hours to day + d: 26, // days to month + M: 11 // months to year + }; + + // helper function for moment.fn.from, moment.fn.fromNow, and moment.duration.fn.humanize + function substituteTimeAgo(string, number, withoutSuffix, isFuture, locale) { + return locale.relativeTime(number || 1, !!withoutSuffix, string, isFuture); + } + + function duration_humanize__relativeTime (posNegDuration, withoutSuffix, locale) { + var duration = create__createDuration(posNegDuration).abs(); + var seconds = round(duration.as('s')); + var minutes = round(duration.as('m')); + var hours = round(duration.as('h')); + var days = round(duration.as('d')); + var months = round(duration.as('M')); + var years = round(duration.as('y')); + + var a = seconds < thresholds.s && ['s', seconds] || + minutes <= 1 && ['m'] || + minutes < thresholds.m && ['mm', minutes] || + hours <= 1 && ['h'] || + hours < thresholds.h && ['hh', hours] || + days <= 1 && ['d'] || + days < thresholds.d && ['dd', days] || + months <= 1 && ['M'] || + months < thresholds.M && ['MM', months] || + years <= 1 && ['y'] || ['yy', years]; + + a[2] = withoutSuffix; + a[3] = +posNegDuration > 0; + a[4] = locale; + return substituteTimeAgo.apply(null, a); + } + + // This function allows you to set a threshold for relative time strings + function duration_humanize__getSetRelativeTimeThreshold (threshold, limit) { + if (thresholds[threshold] === undefined) { + return false; + } + if (limit === undefined) { + return thresholds[threshold]; + } + thresholds[threshold] = limit; + return true; + } + + function humanize (withSuffix) { + var locale = this.localeData(); + var output = duration_humanize__relativeTime(this, !withSuffix, locale); + + if (withSuffix) { + output = locale.pastFuture(+this, output); + } + + return locale.postformat(output); + } + + var iso_string__abs = Math.abs; + + function iso_string__toISOString() { + // for ISO strings we do not use the normal bubbling rules: + // * milliseconds bubble up until they become hours + // * days do not bubble at all + // * months bubble up until they become years + // This is because there is no context-free conversion between hours and days + // (think of clock changes) + // and also not between days and months (28-31 days per month) + var seconds = iso_string__abs(this._milliseconds) / 1000; + var days = iso_string__abs(this._days); + var months = iso_string__abs(this._months); + var minutes, hours, years; + + // 3600 seconds -> 60 minutes -> 1 hour + minutes = absFloor(seconds / 60); + hours = absFloor(minutes / 60); + seconds %= 60; + minutes %= 60; + + // 12 months -> 1 year + years = absFloor(months / 12); + months %= 12; + + + // inspired by https://github.com/dordille/moment-isoduration/blob/master/moment.isoduration.js + var Y = years; + var M = months; + var D = days; + var h = hours; + var m = minutes; + var s = seconds; + var total = this.asSeconds(); + + if (!total) { + // this is the same as C#'s (Noda) and python (isodate)... + // but not other JS (goog.date) + return 'P0D'; + } + + return (total < 0 ? '-' : '') + + 'P' + + (Y ? Y + 'Y' : '') + + (M ? M + 'M' : '') + + (D ? D + 'D' : '') + + ((h || m || s) ? 'T' : '') + + (h ? h + 'H' : '') + + (m ? m + 'M' : '') + + (s ? s + 'S' : ''); + } + + var duration_prototype__proto = Duration.prototype; + + duration_prototype__proto.abs = duration_abs__abs; + duration_prototype__proto.add = duration_add_subtract__add; + duration_prototype__proto.subtract = duration_add_subtract__subtract; + duration_prototype__proto.as = as; + duration_prototype__proto.asMilliseconds = asMilliseconds; + duration_prototype__proto.asSeconds = asSeconds; + duration_prototype__proto.asMinutes = asMinutes; + duration_prototype__proto.asHours = asHours; + duration_prototype__proto.asDays = asDays; + duration_prototype__proto.asWeeks = asWeeks; + duration_prototype__proto.asMonths = asMonths; + duration_prototype__proto.asYears = asYears; + duration_prototype__proto.valueOf = duration_as__valueOf; + duration_prototype__proto._bubble = bubble; + duration_prototype__proto.get = duration_get__get; + duration_prototype__proto.milliseconds = milliseconds; + duration_prototype__proto.seconds = seconds; + duration_prototype__proto.minutes = minutes; + duration_prototype__proto.hours = hours; + duration_prototype__proto.days = days; + duration_prototype__proto.weeks = weeks; + duration_prototype__proto.months = months; + duration_prototype__proto.years = years; + duration_prototype__proto.humanize = humanize; + duration_prototype__proto.toISOString = iso_string__toISOString; + duration_prototype__proto.toString = iso_string__toISOString; + duration_prototype__proto.toJSON = iso_string__toISOString; + duration_prototype__proto.locale = locale; + duration_prototype__proto.localeData = localeData; + + // Deprecations + duration_prototype__proto.toIsoString = deprecate('toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)', iso_string__toISOString); + duration_prototype__proto.lang = lang; + + // Side effect imports + + // FORMATTING + + addFormatToken('X', 0, 0, 'unix'); + addFormatToken('x', 0, 0, 'valueOf'); + + // PARSING + + addRegexToken('x', matchSigned); + addRegexToken('X', matchTimestamp); + addParseToken('X', function (input, array, config) { + config._d = new Date(parseFloat(input, 10) * 1000); + }); + addParseToken('x', function (input, array, config) { + config._d = new Date(toInt(input)); + }); + + // Side effect imports + + + utils_hooks__hooks.version = '2.13.0'; + + setHookCallback(local__createLocal); + + utils_hooks__hooks.fn = momentPrototype; + utils_hooks__hooks.min = min; + utils_hooks__hooks.max = max; + utils_hooks__hooks.now = now; + utils_hooks__hooks.utc = create_utc__createUTC; + utils_hooks__hooks.unix = moment__createUnix; + utils_hooks__hooks.months = lists__listMonths; + utils_hooks__hooks.isDate = isDate; + utils_hooks__hooks.locale = locale_locales__getSetGlobalLocale; + utils_hooks__hooks.invalid = valid__createInvalid; + utils_hooks__hooks.duration = create__createDuration; + utils_hooks__hooks.isMoment = isMoment; + utils_hooks__hooks.weekdays = lists__listWeekdays; + utils_hooks__hooks.parseZone = moment__createInZone; + utils_hooks__hooks.localeData = locale_locales__getLocale; + utils_hooks__hooks.isDuration = isDuration; + utils_hooks__hooks.monthsShort = lists__listMonthsShort; + utils_hooks__hooks.weekdaysMin = lists__listWeekdaysMin; + utils_hooks__hooks.defineLocale = defineLocale; + utils_hooks__hooks.updateLocale = updateLocale; + utils_hooks__hooks.locales = locale_locales__listLocales; + utils_hooks__hooks.weekdaysShort = lists__listWeekdaysShort; + utils_hooks__hooks.normalizeUnits = normalizeUnits; + utils_hooks__hooks.relativeTimeThreshold = duration_humanize__getSetRelativeTimeThreshold; + utils_hooks__hooks.prototype = momentPrototype; + + var _moment = utils_hooks__hooks; + + return _moment; + +})); \ No newline at end of file diff --git a/public/vendor/daterangepicker/moment.min.js b/public/vendor/daterangepicker/moment.min.js new file mode 100755 index 000000000..d301ddbbe --- /dev/null +++ b/public/vendor/daterangepicker/moment.min.js @@ -0,0 +1,7 @@ +//! moment.js +//! version : 2.13.0 +//! authors : Tim Wood, Iskren Chernev, Moment.js contributors +//! license : MIT +//! momentjs.com +!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.moment=b()}(this,function(){"use strict";function a(){return fd.apply(null,arguments)}function b(a){fd=a}function c(a){return a instanceof Array||"[object Array]"===Object.prototype.toString.call(a)}function d(a){return a instanceof Date||"[object Date]"===Object.prototype.toString.call(a)}function e(a,b){var c,d=[];for(c=0;c0)for(c in hd)d=hd[c],e=b[d],m(e)||(a[d]=e);return a}function o(b){n(this,b),this._d=new Date(null!=b._d?b._d.getTime():NaN),id===!1&&(id=!0,a.updateOffset(this),id=!1)}function p(a){return a instanceof o||null!=a&&null!=a._isAMomentObject}function q(a){return 0>a?Math.ceil(a):Math.floor(a)}function r(a){var b=+a,c=0;return 0!==b&&isFinite(b)&&(c=q(b)),c}function s(a,b,c){var d,e=Math.min(a.length,b.length),f=Math.abs(a.length-b.length),g=0;for(d=0;e>d;d++)(c&&a[d]!==b[d]||!c&&r(a[d])!==r(b[d]))&&g++;return g+f}function t(b){a.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+b)}function u(b,c){var d=!0;return g(function(){return null!=a.deprecationHandler&&a.deprecationHandler(null,b),d&&(t(b+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),d=!1),c.apply(this,arguments)},c)}function v(b,c){null!=a.deprecationHandler&&a.deprecationHandler(b,c),jd[b]||(t(c),jd[b]=!0)}function w(a){return a instanceof Function||"[object Function]"===Object.prototype.toString.call(a)}function x(a){return"[object Object]"===Object.prototype.toString.call(a)}function y(a){var b,c;for(c in a)b=a[c],w(b)?this[c]=b:this["_"+c]=b;this._config=a,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function z(a,b){var c,d=g({},a);for(c in b)f(b,c)&&(x(a[c])&&x(b[c])?(d[c]={},g(d[c],a[c]),g(d[c],b[c])):null!=b[c]?d[c]=b[c]:delete d[c]);return d}function A(a){null!=a&&this.set(a)}function B(a){return a?a.toLowerCase().replace("_","-"):a}function C(a){for(var b,c,d,e,f=0;f0;){if(d=D(e.slice(0,b).join("-")))return d;if(c&&c.length>=b&&s(e,c,!0)>=b-1)break;b--}f++}return null}function D(a){var b=null;if(!nd[a]&&"undefined"!=typeof module&&module&&module.exports)try{b=ld._abbr,require("./locale/"+a),E(b)}catch(c){}return nd[a]}function E(a,b){var c;return a&&(c=m(b)?H(a):F(a,b),c&&(ld=c)),ld._abbr}function F(a,b){return null!==b?(b.abbr=a,null!=nd[a]?(v("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale"),b=z(nd[a]._config,b)):null!=b.parentLocale&&(null!=nd[b.parentLocale]?b=z(nd[b.parentLocale]._config,b):v("parentLocaleUndefined","specified parentLocale is not defined yet")),nd[a]=new A(b),E(a),nd[a]):(delete nd[a],null)}function G(a,b){if(null!=b){var c;null!=nd[a]&&(b=z(nd[a]._config,b)),c=new A(b),c.parentLocale=nd[a],nd[a]=c,E(a)}else null!=nd[a]&&(null!=nd[a].parentLocale?nd[a]=nd[a].parentLocale:null!=nd[a]&&delete nd[a]);return nd[a]}function H(a){var b;if(a&&a._locale&&a._locale._abbr&&(a=a._locale._abbr),!a)return ld;if(!c(a)){if(b=D(a))return b;a=[a]}return C(a)}function I(){return kd(nd)}function J(a,b){var c=a.toLowerCase();od[c]=od[c+"s"]=od[b]=a}function K(a){return"string"==typeof a?od[a]||od[a.toLowerCase()]:void 0}function L(a){var b,c,d={};for(c in a)f(a,c)&&(b=K(c),b&&(d[b]=a[c]));return d}function M(b,c){return function(d){return null!=d?(O(this,b,d),a.updateOffset(this,c),this):N(this,b)}}function N(a,b){return a.isValid()?a._d["get"+(a._isUTC?"UTC":"")+b]():NaN}function O(a,b,c){a.isValid()&&a._d["set"+(a._isUTC?"UTC":"")+b](c)}function P(a,b){var c;if("object"==typeof a)for(c in a)this.set(c,a[c]);else if(a=K(a),w(this[a]))return this[a](b);return this}function Q(a,b,c){var d=""+Math.abs(a),e=b-d.length,f=a>=0;return(f?c?"+":"":"-")+Math.pow(10,Math.max(0,e)).toString().substr(1)+d}function R(a,b,c,d){var e=d;"string"==typeof d&&(e=function(){return this[d]()}),a&&(sd[a]=e),b&&(sd[b[0]]=function(){return Q(e.apply(this,arguments),b[1],b[2])}),c&&(sd[c]=function(){return this.localeData().ordinal(e.apply(this,arguments),a)})}function S(a){return a.match(/\[[\s\S]/)?a.replace(/^\[|\]$/g,""):a.replace(/\\/g,"")}function T(a){var b,c,d=a.match(pd);for(b=0,c=d.length;c>b;b++)sd[d[b]]?d[b]=sd[d[b]]:d[b]=S(d[b]);return function(b){var e,f="";for(e=0;c>e;e++)f+=d[e]instanceof Function?d[e].call(b,a):d[e];return f}}function U(a,b){return a.isValid()?(b=V(b,a.localeData()),rd[b]=rd[b]||T(b),rd[b](a)):a.localeData().invalidDate()}function V(a,b){function c(a){return b.longDateFormat(a)||a}var d=5;for(qd.lastIndex=0;d>=0&&qd.test(a);)a=a.replace(qd,c),qd.lastIndex=0,d-=1;return a}function W(a,b,c){Kd[a]=w(b)?b:function(a,d){return a&&c?c:b}}function X(a,b){return f(Kd,a)?Kd[a](b._strict,b._locale):new RegExp(Y(a))}function Y(a){return Z(a.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,b,c,d,e){return b||c||d||e}))}function Z(a){return a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function $(a,b){var c,d=b;for("string"==typeof a&&(a=[a]),"number"==typeof b&&(d=function(a,c){c[b]=r(a)}),c=0;cd;++d)f=h([2e3,d]),this._shortMonthsParse[d]=this.monthsShort(f,"").toLocaleLowerCase(),this._longMonthsParse[d]=this.months(f,"").toLocaleLowerCase();return c?"MMM"===b?(e=md.call(this._shortMonthsParse,g),-1!==e?e:null):(e=md.call(this._longMonthsParse,g),-1!==e?e:null):"MMM"===b?(e=md.call(this._shortMonthsParse,g),-1!==e?e:(e=md.call(this._longMonthsParse,g),-1!==e?e:null)):(e=md.call(this._longMonthsParse,g),-1!==e?e:(e=md.call(this._shortMonthsParse,g),-1!==e?e:null))}function fa(a,b,c){var d,e,f;if(this._monthsParseExact)return ea.call(this,a,b,c);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),d=0;12>d;d++){if(e=h([2e3,d]),c&&!this._longMonthsParse[d]&&(this._longMonthsParse[d]=new RegExp("^"+this.months(e,"").replace(".","")+"$","i"),this._shortMonthsParse[d]=new RegExp("^"+this.monthsShort(e,"").replace(".","")+"$","i")),c||this._monthsParse[d]||(f="^"+this.months(e,"")+"|^"+this.monthsShort(e,""),this._monthsParse[d]=new RegExp(f.replace(".",""),"i")),c&&"MMMM"===b&&this._longMonthsParse[d].test(a))return d;if(c&&"MMM"===b&&this._shortMonthsParse[d].test(a))return d;if(!c&&this._monthsParse[d].test(a))return d}}function ga(a,b){var c;if(!a.isValid())return a;if("string"==typeof b)if(/^\d+$/.test(b))b=r(b);else if(b=a.localeData().monthsParse(b),"number"!=typeof b)return a;return c=Math.min(a.date(),ba(a.year(),b)),a._d["set"+(a._isUTC?"UTC":"")+"Month"](b,c),a}function ha(b){return null!=b?(ga(this,b),a.updateOffset(this,!0),this):N(this,"Month")}function ia(){return ba(this.year(),this.month())}function ja(a){return this._monthsParseExact?(f(this,"_monthsRegex")||la.call(this),a?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&a?this._monthsShortStrictRegex:this._monthsShortRegex}function ka(a){return this._monthsParseExact?(f(this,"_monthsRegex")||la.call(this),a?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&a?this._monthsStrictRegex:this._monthsRegex}function la(){function a(a,b){return b.length-a.length}var b,c,d=[],e=[],f=[];for(b=0;12>b;b++)c=h([2e3,b]),d.push(this.monthsShort(c,"")),e.push(this.months(c,"")),f.push(this.months(c,"")),f.push(this.monthsShort(c,""));for(d.sort(a),e.sort(a),f.sort(a),b=0;12>b;b++)d[b]=Z(d[b]),e[b]=Z(e[b]),f[b]=Z(f[b]);this._monthsRegex=new RegExp("^("+f.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+e.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+d.join("|")+")","i")}function ma(a){var b,c=a._a;return c&&-2===j(a).overflow&&(b=c[Nd]<0||c[Nd]>11?Nd:c[Od]<1||c[Od]>ba(c[Md],c[Nd])?Od:c[Pd]<0||c[Pd]>24||24===c[Pd]&&(0!==c[Qd]||0!==c[Rd]||0!==c[Sd])?Pd:c[Qd]<0||c[Qd]>59?Qd:c[Rd]<0||c[Rd]>59?Rd:c[Sd]<0||c[Sd]>999?Sd:-1,j(a)._overflowDayOfYear&&(Md>b||b>Od)&&(b=Od),j(a)._overflowWeeks&&-1===b&&(b=Td),j(a)._overflowWeekday&&-1===b&&(b=Ud),j(a).overflow=b),a}function na(a){var b,c,d,e,f,g,h=a._i,i=$d.exec(h)||_d.exec(h);if(i){for(j(a).iso=!0,b=0,c=be.length;c>b;b++)if(be[b][1].exec(i[1])){e=be[b][0],d=be[b][2]!==!1;break}if(null==e)return void(a._isValid=!1);if(i[3]){for(b=0,c=ce.length;c>b;b++)if(ce[b][1].exec(i[3])){f=(i[2]||" ")+ce[b][0];break}if(null==f)return void(a._isValid=!1)}if(!d&&null!=f)return void(a._isValid=!1);if(i[4]){if(!ae.exec(i[4]))return void(a._isValid=!1);g="Z"}a._f=e+(f||"")+(g||""),Ca(a)}else a._isValid=!1}function oa(b){var c=de.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(na(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}function pa(a,b,c,d,e,f,g){var h=new Date(a,b,c,d,e,f,g);return 100>a&&a>=0&&isFinite(h.getFullYear())&&h.setFullYear(a),h}function qa(a){var b=new Date(Date.UTC.apply(null,arguments));return 100>a&&a>=0&&isFinite(b.getUTCFullYear())&&b.setUTCFullYear(a),b}function ra(a){return sa(a)?366:365}function sa(a){return a%4===0&&a%100!==0||a%400===0}function ta(){return sa(this.year())}function ua(a,b,c){var d=7+b-c,e=(7+qa(a,0,d).getUTCDay()-b)%7;return-e+d-1}function va(a,b,c,d,e){var f,g,h=(7+c-d)%7,i=ua(a,d,e),j=1+7*(b-1)+h+i;return 0>=j?(f=a-1,g=ra(f)+j):j>ra(a)?(f=a+1,g=j-ra(a)):(f=a,g=j),{year:f,dayOfYear:g}}function wa(a,b,c){var d,e,f=ua(a.year(),b,c),g=Math.floor((a.dayOfYear()-f-1)/7)+1;return 1>g?(e=a.year()-1,d=g+xa(e,b,c)):g>xa(a.year(),b,c)?(d=g-xa(a.year(),b,c),e=a.year()+1):(e=a.year(),d=g),{week:d,year:e}}function xa(a,b,c){var d=ua(a,b,c),e=ua(a+1,b,c);return(ra(a)-d+e)/7}function ya(a,b,c){return null!=a?a:null!=b?b:c}function za(b){var c=new Date(a.now());return b._useUTC?[c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()]:[c.getFullYear(),c.getMonth(),c.getDate()]}function Aa(a){var b,c,d,e,f=[];if(!a._d){for(d=za(a),a._w&&null==a._a[Od]&&null==a._a[Nd]&&Ba(a),a._dayOfYear&&(e=ya(a._a[Md],d[Md]),a._dayOfYear>ra(e)&&(j(a)._overflowDayOfYear=!0),c=qa(e,0,a._dayOfYear),a._a[Nd]=c.getUTCMonth(),a._a[Od]=c.getUTCDate()),b=0;3>b&&null==a._a[b];++b)a._a[b]=f[b]=d[b];for(;7>b;b++)a._a[b]=f[b]=null==a._a[b]?2===b?1:0:a._a[b];24===a._a[Pd]&&0===a._a[Qd]&&0===a._a[Rd]&&0===a._a[Sd]&&(a._nextDay=!0,a._a[Pd]=0),a._d=(a._useUTC?qa:pa).apply(null,f),null!=a._tzm&&a._d.setUTCMinutes(a._d.getUTCMinutes()-a._tzm),a._nextDay&&(a._a[Pd]=24)}}function Ba(a){var b,c,d,e,f,g,h,i;b=a._w,null!=b.GG||null!=b.W||null!=b.E?(f=1,g=4,c=ya(b.GG,a._a[Md],wa(Ka(),1,4).year),d=ya(b.W,1),e=ya(b.E,1),(1>e||e>7)&&(i=!0)):(f=a._locale._week.dow,g=a._locale._week.doy,c=ya(b.gg,a._a[Md],wa(Ka(),f,g).year),d=ya(b.w,1),null!=b.d?(e=b.d,(0>e||e>6)&&(i=!0)):null!=b.e?(e=b.e+f,(b.e<0||b.e>6)&&(i=!0)):e=f),1>d||d>xa(c,f,g)?j(a)._overflowWeeks=!0:null!=i?j(a)._overflowWeekday=!0:(h=va(c,d,e,f,g),a._a[Md]=h.year,a._dayOfYear=h.dayOfYear)}function Ca(b){if(b._f===a.ISO_8601)return void na(b);b._a=[],j(b).empty=!0;var c,d,e,f,g,h=""+b._i,i=h.length,k=0;for(e=V(b._f,b._locale).match(pd)||[],c=0;c0&&j(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),k+=d.length),sd[f]?(d?j(b).empty=!1:j(b).unusedTokens.push(f),aa(f,d,b)):b._strict&&!d&&j(b).unusedTokens.push(f);j(b).charsLeftOver=i-k,h.length>0&&j(b).unusedInput.push(h),j(b).bigHour===!0&&b._a[Pd]<=12&&b._a[Pd]>0&&(j(b).bigHour=void 0),j(b).parsedDateParts=b._a.slice(0),j(b).meridiem=b._meridiem,b._a[Pd]=Da(b._locale,b._a[Pd],b._meridiem),Aa(b),ma(b)}function Da(a,b,c){var d;return null==c?b:null!=a.meridiemHour?a.meridiemHour(b,c):null!=a.isPM?(d=a.isPM(c),d&&12>b&&(b+=12),d||12!==b||(b=0),b):b}function Ea(a){var b,c,d,e,f;if(0===a._f.length)return j(a).invalidFormat=!0,void(a._d=new Date(NaN));for(e=0;ef)&&(d=f,c=b));g(a,c||b)}function Fa(a){if(!a._d){var b=L(a._i);a._a=e([b.year,b.month,b.day||b.date,b.hour,b.minute,b.second,b.millisecond],function(a){return a&&parseInt(a,10)}),Aa(a)}}function Ga(a){var b=new o(ma(Ha(a)));return b._nextDay&&(b.add(1,"d"),b._nextDay=void 0),b}function Ha(a){var b=a._i,e=a._f;return a._locale=a._locale||H(a._l),null===b||void 0===e&&""===b?l({nullInput:!0}):("string"==typeof b&&(a._i=b=a._locale.preparse(b)),p(b)?new o(ma(b)):(c(e)?Ea(a):e?Ca(a):d(b)?a._d=b:Ia(a),k(a)||(a._d=null),a))}function Ia(b){var f=b._i;void 0===f?b._d=new Date(a.now()):d(f)?b._d=new Date(f.valueOf()):"string"==typeof f?oa(b):c(f)?(b._a=e(f.slice(0),function(a){return parseInt(a,10)}),Aa(b)):"object"==typeof f?Fa(b):"number"==typeof f?b._d=new Date(f):a.createFromInputFallback(b)}function Ja(a,b,c,d,e){var f={};return"boolean"==typeof c&&(d=c,c=void 0),f._isAMomentObject=!0,f._useUTC=f._isUTC=e,f._l=c,f._i=a,f._f=b,f._strict=d,Ga(f)}function Ka(a,b,c,d){return Ja(a,b,c,d,!1)}function La(a,b){var d,e;if(1===b.length&&c(b[0])&&(b=b[0]),!b.length)return Ka();for(d=b[0],e=1;ea&&(a=-a,c="-"),c+Q(~~(a/60),2)+b+Q(~~a%60,2)})}function Ra(a,b){var c=(b||"").match(a)||[],d=c[c.length-1]||[],e=(d+"").match(ie)||["-",0,0],f=+(60*e[1])+r(e[2]);return"+"===e[0]?f:-f}function Sa(b,c){var e,f;return c._isUTC?(e=c.clone(),f=(p(b)||d(b)?b.valueOf():Ka(b).valueOf())-e.valueOf(),e._d.setTime(e._d.valueOf()+f),a.updateOffset(e,!1),e):Ka(b).local()}function Ta(a){return 15*-Math.round(a._d.getTimezoneOffset()/15)}function Ua(b,c){var d,e=this._offset||0;return this.isValid()?null!=b?("string"==typeof b?b=Ra(Hd,b):Math.abs(b)<16&&(b=60*b),!this._isUTC&&c&&(d=Ta(this)),this._offset=b,this._isUTC=!0,null!=d&&this.add(d,"m"),e!==b&&(!c||this._changeInProgress?jb(this,db(b-e,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,a.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?e:Ta(this):null!=b?this:NaN}function Va(a,b){return null!=a?("string"!=typeof a&&(a=-a),this.utcOffset(a,b),this):-this.utcOffset()}function Wa(a){return this.utcOffset(0,a)}function Xa(a){return this._isUTC&&(this.utcOffset(0,a),this._isUTC=!1,a&&this.subtract(Ta(this),"m")),this}function Ya(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Ra(Gd,this._i)),this}function Za(a){return this.isValid()?(a=a?Ka(a).utcOffset():0,(this.utcOffset()-a)%60===0):!1}function $a(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function _a(){if(!m(this._isDSTShifted))return this._isDSTShifted;var a={};if(n(a,this),a=Ha(a),a._a){var b=a._isUTC?h(a._a):Ka(a._a);this._isDSTShifted=this.isValid()&&s(a._a,b.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function ab(){return this.isValid()?!this._isUTC:!1}function bb(){return this.isValid()?this._isUTC:!1}function cb(){return this.isValid()?this._isUTC&&0===this._offset:!1}function db(a,b){var c,d,e,g=a,h=null;return Pa(a)?g={ms:a._milliseconds,d:a._days,M:a._months}:"number"==typeof a?(g={},b?g[b]=a:g.milliseconds=a):(h=je.exec(a))?(c="-"===h[1]?-1:1,g={y:0,d:r(h[Od])*c,h:r(h[Pd])*c,m:r(h[Qd])*c,s:r(h[Rd])*c,ms:r(h[Sd])*c}):(h=ke.exec(a))?(c="-"===h[1]?-1:1,g={y:eb(h[2],c),M:eb(h[3],c),w:eb(h[4],c),d:eb(h[5],c),h:eb(h[6],c),m:eb(h[7],c),s:eb(h[8],c)}):null==g?g={}:"object"==typeof g&&("from"in g||"to"in g)&&(e=gb(Ka(g.from),Ka(g.to)),g={},g.ms=e.milliseconds,g.M=e.months),d=new Oa(g),Pa(a)&&f(a,"_locale")&&(d._locale=a._locale),d}function eb(a,b){var c=a&&parseFloat(a.replace(",","."));return(isNaN(c)?0:c)*b}function fb(a,b){var c={milliseconds:0,months:0};return c.months=b.month()-a.month()+12*(b.year()-a.year()),a.clone().add(c.months,"M").isAfter(b)&&--c.months,c.milliseconds=+b-+a.clone().add(c.months,"M"),c}function gb(a,b){var c;return a.isValid()&&b.isValid()?(b=Sa(b,a),a.isBefore(b)?c=fb(a,b):(c=fb(b,a),c.milliseconds=-c.milliseconds,c.months=-c.months),c):{milliseconds:0,months:0}}function hb(a){return 0>a?-1*Math.round(-1*a):Math.round(a)}function ib(a,b){return function(c,d){var e,f;return null===d||isNaN(+d)||(v(b,"moment()."+b+"(period, number) is deprecated. Please use moment()."+b+"(number, period)."),f=c,c=d,d=f),c="string"==typeof c?+c:c,e=db(c,d),jb(this,e,a),this}}function jb(b,c,d,e){var f=c._milliseconds,g=hb(c._days),h=hb(c._months);b.isValid()&&(e=null==e?!0:e,f&&b._d.setTime(b._d.valueOf()+f*d),g&&O(b,"Date",N(b,"Date")+g*d),h&&ga(b,N(b,"Month")+h*d),e&&a.updateOffset(b,g||h))}function kb(a,b){var c=a||Ka(),d=Sa(c,this).startOf("day"),e=this.diff(d,"days",!0),f=-6>e?"sameElse":-1>e?"lastWeek":0>e?"lastDay":1>e?"sameDay":2>e?"nextDay":7>e?"nextWeek":"sameElse",g=b&&(w(b[f])?b[f]():b[f]);return this.format(g||this.localeData().calendar(f,this,Ka(c)))}function lb(){return new o(this)}function mb(a,b){var c=p(a)?a:Ka(a);return this.isValid()&&c.isValid()?(b=K(m(b)?"millisecond":b),"millisecond"===b?this.valueOf()>c.valueOf():c.valueOf()b-f?(c=a.clone().add(e-1,"months"),d=(b-f)/(f-c)):(c=a.clone().add(e+1,"months"),d=(b-f)/(c-f)),-(e+d)||0}function ub(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function vb(){var a=this.clone().utc();return 0f&&(b=f),Vb.call(this,a,b,c,d,e))}function Vb(a,b,c,d,e){var f=va(a,b,c,d,e),g=qa(f.year,0,f.dayOfYear);return this.year(g.getUTCFullYear()),this.month(g.getUTCMonth()),this.date(g.getUTCDate()),this}function Wb(a){return null==a?Math.ceil((this.month()+1)/3):this.month(3*(a-1)+this.month()%3)}function Xb(a){return wa(a,this._week.dow,this._week.doy).week}function Yb(){return this._week.dow}function Zb(){return this._week.doy}function $b(a){var b=this.localeData().week(this);return null==a?b:this.add(7*(a-b),"d")}function _b(a){var b=wa(this,1,4).week;return null==a?b:this.add(7*(a-b),"d")}function ac(a,b){return"string"!=typeof a?a:isNaN(a)?(a=b.weekdaysParse(a),"number"==typeof a?a:null):parseInt(a,10)}function bc(a,b){return c(this._weekdays)?this._weekdays[a.day()]:this._weekdays[this._weekdays.isFormat.test(b)?"format":"standalone"][a.day()]}function cc(a){return this._weekdaysShort[a.day()]}function dc(a){return this._weekdaysMin[a.day()]}function ec(a,b,c){var d,e,f,g=a.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],d=0;7>d;++d)f=h([2e3,1]).day(d),this._minWeekdaysParse[d]=this.weekdaysMin(f,"").toLocaleLowerCase(),this._shortWeekdaysParse[d]=this.weekdaysShort(f,"").toLocaleLowerCase(),this._weekdaysParse[d]=this.weekdays(f,"").toLocaleLowerCase();return c?"dddd"===b?(e=md.call(this._weekdaysParse,g),-1!==e?e:null):"ddd"===b?(e=md.call(this._shortWeekdaysParse,g),-1!==e?e:null):(e=md.call(this._minWeekdaysParse,g),-1!==e?e:null):"dddd"===b?(e=md.call(this._weekdaysParse,g),-1!==e?e:(e=md.call(this._shortWeekdaysParse,g),-1!==e?e:(e=md.call(this._minWeekdaysParse,g),-1!==e?e:null))):"ddd"===b?(e=md.call(this._shortWeekdaysParse,g),-1!==e?e:(e=md.call(this._weekdaysParse,g),-1!==e?e:(e=md.call(this._minWeekdaysParse,g),-1!==e?e:null))):(e=md.call(this._minWeekdaysParse,g),-1!==e?e:(e=md.call(this._weekdaysParse,g),-1!==e?e:(e=md.call(this._shortWeekdaysParse,g),-1!==e?e:null)))}function fc(a,b,c){var d,e,f;if(this._weekdaysParseExact)return ec.call(this,a,b,c);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),d=0;7>d;d++){if(e=h([2e3,1]).day(d),c&&!this._fullWeekdaysParse[d]&&(this._fullWeekdaysParse[d]=new RegExp("^"+this.weekdays(e,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[d]=new RegExp("^"+this.weekdaysShort(e,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[d]=new RegExp("^"+this.weekdaysMin(e,"").replace(".",".?")+"$","i")),this._weekdaysParse[d]||(f="^"+this.weekdays(e,"")+"|^"+this.weekdaysShort(e,"")+"|^"+this.weekdaysMin(e,""),this._weekdaysParse[d]=new RegExp(f.replace(".",""),"i")),c&&"dddd"===b&&this._fullWeekdaysParse[d].test(a))return d;if(c&&"ddd"===b&&this._shortWeekdaysParse[d].test(a))return d;if(c&&"dd"===b&&this._minWeekdaysParse[d].test(a))return d;if(!c&&this._weekdaysParse[d].test(a))return d}}function gc(a){if(!this.isValid())return null!=a?this:NaN;var b=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=a?(a=ac(a,this.localeData()),this.add(a-b,"d")):b}function hc(a){if(!this.isValid())return null!=a?this:NaN;var b=(this.day()+7-this.localeData()._week.dow)%7;return null==a?b:this.add(a-b,"d")}function ic(a){return this.isValid()?null==a?this.day()||7:this.day(this.day()%7?a:a-7):null!=a?this:NaN}function jc(a){return this._weekdaysParseExact?(f(this,"_weekdaysRegex")||mc.call(this),a?this._weekdaysStrictRegex:this._weekdaysRegex):this._weekdaysStrictRegex&&a?this._weekdaysStrictRegex:this._weekdaysRegex}function kc(a){return this._weekdaysParseExact?(f(this,"_weekdaysRegex")||mc.call(this),a?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):this._weekdaysShortStrictRegex&&a?this._weekdaysShortStrictRegex:this._weekdaysShortRegex}function lc(a){return this._weekdaysParseExact?(f(this,"_weekdaysRegex")||mc.call(this),a?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):this._weekdaysMinStrictRegex&&a?this._weekdaysMinStrictRegex:this._weekdaysMinRegex}function mc(){function a(a,b){return b.length-a.length}var b,c,d,e,f,g=[],i=[],j=[],k=[];for(b=0;7>b;b++)c=h([2e3,1]).day(b),d=this.weekdaysMin(c,""),e=this.weekdaysShort(c,""),f=this.weekdays(c,""),g.push(d),i.push(e),j.push(f),k.push(d),k.push(e),k.push(f);for(g.sort(a),i.sort(a),j.sort(a),k.sort(a),b=0;7>b;b++)i[b]=Z(i[b]),j[b]=Z(j[b]),k[b]=Z(k[b]);this._weekdaysRegex=new RegExp("^("+k.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+j.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+i.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+g.join("|")+")","i")}function nc(a){var b=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==a?b:this.add(a-b,"d")}function oc(){return this.hours()%12||12}function pc(){return this.hours()||24}function qc(a,b){R(a,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),b)})}function rc(a,b){return b._meridiemParse}function sc(a){return"p"===(a+"").toLowerCase().charAt(0)}function tc(a,b,c){return a>11?c?"pm":"PM":c?"am":"AM"}function uc(a,b){b[Sd]=r(1e3*("0."+a))}function vc(){return this._isUTC?"UTC":""}function wc(){return this._isUTC?"Coordinated Universal Time":""}function xc(a){return Ka(1e3*a)}function yc(){return Ka.apply(null,arguments).parseZone()}function zc(a,b,c){var d=this._calendar[a];return w(d)?d.call(b,c):d}function Ac(a){var b=this._longDateFormat[a],c=this._longDateFormat[a.toUpperCase()];return b||!c?b:(this._longDateFormat[a]=c.replace(/MMMM|MM|DD|dddd/g,function(a){return a.slice(1)}),this._longDateFormat[a])}function Bc(){return this._invalidDate}function Cc(a){return this._ordinal.replace("%d",a)}function Dc(a){return a}function Ec(a,b,c,d){var e=this._relativeTime[c];return w(e)?e(a,b,c,d):e.replace(/%d/i,a)}function Fc(a,b){var c=this._relativeTime[a>0?"future":"past"];return w(c)?c(b):c.replace(/%s/i,b)}function Gc(a,b,c,d){var e=H(),f=h().set(d,b);return e[c](f,a)}function Hc(a,b,c){if("number"==typeof a&&(b=a,a=void 0),a=a||"",null!=b)return Gc(a,b,c,"month");var d,e=[];for(d=0;12>d;d++)e[d]=Gc(a,d,c,"month");return e}function Ic(a,b,c,d){"boolean"==typeof a?("number"==typeof b&&(c=b,b=void 0),b=b||""):(b=a,c=b,a=!1,"number"==typeof b&&(c=b,b=void 0),b=b||"");var e=H(),f=a?e._week.dow:0;if(null!=c)return Gc(b,(c+f)%7,d,"day");var g,h=[];for(g=0;7>g;g++)h[g]=Gc(b,(g+f)%7,d,"day");return h}function Jc(a,b){return Hc(a,b,"months")}function Kc(a,b){return Hc(a,b,"monthsShort")}function Lc(a,b,c){return Ic(a,b,c,"weekdays")}function Mc(a,b,c){return Ic(a,b,c,"weekdaysShort")}function Nc(a,b,c){return Ic(a,b,c,"weekdaysMin")}function Oc(){var a=this._data;return this._milliseconds=Le(this._milliseconds),this._days=Le(this._days),this._months=Le(this._months),a.milliseconds=Le(a.milliseconds),a.seconds=Le(a.seconds),a.minutes=Le(a.minutes),a.hours=Le(a.hours),a.months=Le(a.months),a.years=Le(a.years),this}function Pc(a,b,c,d){var e=db(b,c);return a._milliseconds+=d*e._milliseconds,a._days+=d*e._days,a._months+=d*e._months,a._bubble()}function Qc(a,b){return Pc(this,a,b,1)}function Rc(a,b){return Pc(this,a,b,-1)}function Sc(a){return 0>a?Math.floor(a):Math.ceil(a)}function Tc(){var a,b,c,d,e,f=this._milliseconds,g=this._days,h=this._months,i=this._data;return f>=0&&g>=0&&h>=0||0>=f&&0>=g&&0>=h||(f+=864e5*Sc(Vc(h)+g),g=0,h=0),i.milliseconds=f%1e3,a=q(f/1e3),i.seconds=a%60,b=q(a/60),i.minutes=b%60,c=q(b/60),i.hours=c%24,g+=q(c/24),e=q(Uc(g)),h+=e,g-=Sc(Vc(e)),d=q(h/12),h%=12,i.days=g,i.months=h,i.years=d,this}function Uc(a){return 4800*a/146097}function Vc(a){return 146097*a/4800}function Wc(a){var b,c,d=this._milliseconds;if(a=K(a),"month"===a||"year"===a)return b=this._days+d/864e5,c=this._months+Uc(b),"month"===a?c:c/12;switch(b=this._days+Math.round(Vc(this._months)),a){case"week":return b/7+d/6048e5;case"day":return b+d/864e5;case"hour":return 24*b+d/36e5;case"minute":return 1440*b+d/6e4;case"second":return 86400*b+d/1e3;case"millisecond":return Math.floor(864e5*b)+d;default:throw new Error("Unknown unit "+a)}}function Xc(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*r(this._months/12)}function Yc(a){return function(){return this.as(a)}}function Zc(a){ +return a=K(a),this[a+"s"]()}function $c(a){return function(){return this._data[a]}}function _c(){return q(this.days()/7)}function ad(a,b,c,d,e){return e.relativeTime(b||1,!!c,a,d)}function bd(a,b,c){var d=db(a).abs(),e=_e(d.as("s")),f=_e(d.as("m")),g=_e(d.as("h")),h=_e(d.as("d")),i=_e(d.as("M")),j=_e(d.as("y")),k=e=f&&["m"]||f=g&&["h"]||g=h&&["d"]||h=i&&["M"]||i=j&&["y"]||["yy",j];return k[2]=b,k[3]=+a>0,k[4]=c,ad.apply(null,k)}function cd(a,b){return void 0===af[a]?!1:void 0===b?af[a]:(af[a]=b,!0)}function dd(a){var b=this.localeData(),c=bd(this,!a,b);return a&&(c=b.pastFuture(+this,c)),b.postformat(c)}function ed(){var a,b,c,d=bf(this._milliseconds)/1e3,e=bf(this._days),f=bf(this._months);a=q(d/60),b=q(a/60),d%=60,a%=60,c=q(f/12),f%=12;var g=c,h=f,i=e,j=b,k=a,l=d,m=this.asSeconds();return m?(0>m?"-":"")+"P"+(g?g+"Y":"")+(h?h+"M":"")+(i?i+"D":"")+(j||k||l?"T":"")+(j?j+"H":"")+(k?k+"M":"")+(l?l+"S":""):"P0D"}var fd,gd;gd=Array.prototype.some?Array.prototype.some:function(a){for(var b=Object(this),c=b.length>>>0,d=0;c>d;d++)if(d in b&&a.call(this,b[d],d,b))return!0;return!1};var hd=a.momentProperties=[],id=!1,jd={};a.suppressDeprecationWarnings=!1,a.deprecationHandler=null;var kd;kd=Object.keys?Object.keys:function(a){var b,c=[];for(b in a)f(a,b)&&c.push(b);return c};var ld,md,nd={},od={},pd=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,qd=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,rd={},sd={},td=/\d/,ud=/\d\d/,vd=/\d{3}/,wd=/\d{4}/,xd=/[+-]?\d{6}/,yd=/\d\d?/,zd=/\d\d\d\d?/,Ad=/\d\d\d\d\d\d?/,Bd=/\d{1,3}/,Cd=/\d{1,4}/,Dd=/[+-]?\d{1,6}/,Ed=/\d+/,Fd=/[+-]?\d+/,Gd=/Z|[+-]\d\d:?\d\d/gi,Hd=/Z|[+-]\d\d(?::?\d\d)?/gi,Id=/[+-]?\d+(\.\d{1,3})?/,Jd=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Kd={},Ld={},Md=0,Nd=1,Od=2,Pd=3,Qd=4,Rd=5,Sd=6,Td=7,Ud=8;md=Array.prototype.indexOf?Array.prototype.indexOf:function(a){var b;for(b=0;b=a?""+a:"+"+a}),R(0,["YY",2],0,function(){return this.year()%100}),R(0,["YYYY",4],0,"year"),R(0,["YYYYY",5],0,"year"),R(0,["YYYYYY",6,!0],0,"year"),J("year","y"),W("Y",Fd),W("YY",yd,ud),W("YYYY",Cd,wd),W("YYYYY",Dd,xd),W("YYYYYY",Dd,xd),$(["YYYYY","YYYYYY"],Md),$("YYYY",function(b,c){c[Md]=2===b.length?a.parseTwoDigitYear(b):r(b)}),$("YY",function(b,c){c[Md]=a.parseTwoDigitYear(b)}),$("Y",function(a,b){b[Md]=parseInt(a,10)}),a.parseTwoDigitYear=function(a){return r(a)+(r(a)>68?1900:2e3)};var ee=M("FullYear",!0);a.ISO_8601=function(){};var fe=u("moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var a=Ka.apply(null,arguments);return this.isValid()&&a.isValid()?this>a?this:a:l()}),ge=u("moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var a=Ka.apply(null,arguments);return this.isValid()&&a.isValid()?a>this?this:a:l()}),he=function(){return Date.now?Date.now():+new Date};Qa("Z",":"),Qa("ZZ",""),W("Z",Hd),W("ZZ",Hd),$(["Z","ZZ"],function(a,b,c){c._useUTC=!0,c._tzm=Ra(Hd,a)});var ie=/([\+\-]|\d\d)/gi;a.updateOffset=function(){};var je=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,ke=/^(-)?P(?:(-?[0-9,.]*)Y)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)W)?(?:(-?[0-9,.]*)D)?(?:T(?:(-?[0-9,.]*)H)?(?:(-?[0-9,.]*)M)?(?:(-?[0-9,.]*)S)?)?$/;db.fn=Oa.prototype;var le=ib(1,"add"),me=ib(-1,"subtract");a.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",a.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var ne=u("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(a){return void 0===a?this.localeData():this.locale(a)});R(0,["gg",2],0,function(){return this.weekYear()%100}),R(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Pb("gggg","weekYear"),Pb("ggggg","weekYear"),Pb("GGGG","isoWeekYear"),Pb("GGGGG","isoWeekYear"),J("weekYear","gg"),J("isoWeekYear","GG"),W("G",Fd),W("g",Fd),W("GG",yd,ud),W("gg",yd,ud),W("GGGG",Cd,wd),W("gggg",Cd,wd),W("GGGGG",Dd,xd),W("ggggg",Dd,xd),_(["gggg","ggggg","GGGG","GGGGG"],function(a,b,c,d){b[d.substr(0,2)]=r(a)}),_(["gg","GG"],function(b,c,d,e){c[e]=a.parseTwoDigitYear(b)}),R("Q",0,"Qo","quarter"),J("quarter","Q"),W("Q",td),$("Q",function(a,b){b[Nd]=3*(r(a)-1)}),R("w",["ww",2],"wo","week"),R("W",["WW",2],"Wo","isoWeek"),J("week","w"),J("isoWeek","W"),W("w",yd),W("ww",yd,ud),W("W",yd),W("WW",yd,ud),_(["w","ww","W","WW"],function(a,b,c,d){b[d.substr(0,1)]=r(a)});var oe={dow:0,doy:6};R("D",["DD",2],"Do","date"),J("date","D"),W("D",yd),W("DD",yd,ud),W("Do",function(a,b){return a?b._ordinalParse:b._ordinalParseLenient}),$(["D","DD"],Od),$("Do",function(a,b){b[Od]=r(a.match(yd)[0],10)});var pe=M("Date",!0);R("d",0,"do","day"),R("dd",0,0,function(a){return this.localeData().weekdaysMin(this,a)}),R("ddd",0,0,function(a){return this.localeData().weekdaysShort(this,a)}),R("dddd",0,0,function(a){return this.localeData().weekdays(this,a)}),R("e",0,0,"weekday"),R("E",0,0,"isoWeekday"),J("day","d"),J("weekday","e"),J("isoWeekday","E"),W("d",yd),W("e",yd),W("E",yd),W("dd",function(a,b){return b.weekdaysMinRegex(a)}),W("ddd",function(a,b){return b.weekdaysShortRegex(a)}),W("dddd",function(a,b){return b.weekdaysRegex(a)}),_(["dd","ddd","dddd"],function(a,b,c,d){var e=c._locale.weekdaysParse(a,d,c._strict);null!=e?b.d=e:j(c).invalidWeekday=a}),_(["d","e","E"],function(a,b,c,d){b[d]=r(a)});var qe="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),re="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),se="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),te=Jd,ue=Jd,ve=Jd;R("DDD",["DDDD",3],"DDDo","dayOfYear"),J("dayOfYear","DDD"),W("DDD",Bd),W("DDDD",vd),$(["DDD","DDDD"],function(a,b,c){c._dayOfYear=r(a)}),R("H",["HH",2],0,"hour"),R("h",["hh",2],0,oc),R("k",["kk",2],0,pc),R("hmm",0,0,function(){return""+oc.apply(this)+Q(this.minutes(),2)}),R("hmmss",0,0,function(){return""+oc.apply(this)+Q(this.minutes(),2)+Q(this.seconds(),2)}),R("Hmm",0,0,function(){return""+this.hours()+Q(this.minutes(),2)}),R("Hmmss",0,0,function(){return""+this.hours()+Q(this.minutes(),2)+Q(this.seconds(),2)}),qc("a",!0),qc("A",!1),J("hour","h"),W("a",rc),W("A",rc),W("H",yd),W("h",yd),W("HH",yd,ud),W("hh",yd,ud),W("hmm",zd),W("hmmss",Ad),W("Hmm",zd),W("Hmmss",Ad),$(["H","HH"],Pd),$(["a","A"],function(a,b,c){c._isPm=c._locale.isPM(a),c._meridiem=a}),$(["h","hh"],function(a,b,c){b[Pd]=r(a),j(c).bigHour=!0}),$("hmm",function(a,b,c){var d=a.length-2;b[Pd]=r(a.substr(0,d)),b[Qd]=r(a.substr(d)),j(c).bigHour=!0}),$("hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[Pd]=r(a.substr(0,d)),b[Qd]=r(a.substr(d,2)),b[Rd]=r(a.substr(e)),j(c).bigHour=!0}),$("Hmm",function(a,b,c){var d=a.length-2;b[Pd]=r(a.substr(0,d)),b[Qd]=r(a.substr(d))}),$("Hmmss",function(a,b,c){var d=a.length-4,e=a.length-2;b[Pd]=r(a.substr(0,d)),b[Qd]=r(a.substr(d,2)),b[Rd]=r(a.substr(e))});var we=/[ap]\.?m?\.?/i,xe=M("Hours",!0);R("m",["mm",2],0,"minute"),J("minute","m"),W("m",yd),W("mm",yd,ud),$(["m","mm"],Qd);var ye=M("Minutes",!1);R("s",["ss",2],0,"second"),J("second","s"),W("s",yd),W("ss",yd,ud),$(["s","ss"],Rd);var ze=M("Seconds",!1);R("S",0,0,function(){return~~(this.millisecond()/100)}),R(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),R(0,["SSS",3],0,"millisecond"),R(0,["SSSS",4],0,function(){return 10*this.millisecond()}),R(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),R(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),R(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),R(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),R(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),J("millisecond","ms"),W("S",Bd,td),W("SS",Bd,ud),W("SSS",Bd,vd);var Ae;for(Ae="SSSS";Ae.length<=9;Ae+="S")W(Ae,Ed);for(Ae="S";Ae.length<=9;Ae+="S")$(Ae,uc);var Be=M("Milliseconds",!1);R("z",0,0,"zoneAbbr"),R("zz",0,0,"zoneName");var Ce=o.prototype;Ce.add=le,Ce.calendar=kb,Ce.clone=lb,Ce.diff=sb,Ce.endOf=Eb,Ce.format=wb,Ce.from=xb,Ce.fromNow=yb,Ce.to=zb,Ce.toNow=Ab,Ce.get=P,Ce.invalidAt=Nb,Ce.isAfter=mb,Ce.isBefore=nb,Ce.isBetween=ob,Ce.isSame=pb,Ce.isSameOrAfter=qb,Ce.isSameOrBefore=rb,Ce.isValid=Lb,Ce.lang=ne,Ce.locale=Bb,Ce.localeData=Cb,Ce.max=ge,Ce.min=fe,Ce.parsingFlags=Mb,Ce.set=P,Ce.startOf=Db,Ce.subtract=me,Ce.toArray=Ib,Ce.toObject=Jb,Ce.toDate=Hb,Ce.toISOString=vb,Ce.toJSON=Kb,Ce.toString=ub,Ce.unix=Gb,Ce.valueOf=Fb,Ce.creationData=Ob,Ce.year=ee,Ce.isLeapYear=ta,Ce.weekYear=Qb,Ce.isoWeekYear=Rb,Ce.quarter=Ce.quarters=Wb,Ce.month=ha,Ce.daysInMonth=ia,Ce.week=Ce.weeks=$b,Ce.isoWeek=Ce.isoWeeks=_b,Ce.weeksInYear=Tb,Ce.isoWeeksInYear=Sb,Ce.date=pe,Ce.day=Ce.days=gc,Ce.weekday=hc,Ce.isoWeekday=ic,Ce.dayOfYear=nc,Ce.hour=Ce.hours=xe,Ce.minute=Ce.minutes=ye,Ce.second=Ce.seconds=ze,Ce.millisecond=Ce.milliseconds=Be,Ce.utcOffset=Ua,Ce.utc=Wa,Ce.local=Xa,Ce.parseZone=Ya,Ce.hasAlignedHourOffset=Za,Ce.isDST=$a,Ce.isDSTShifted=_a,Ce.isLocal=ab,Ce.isUtcOffset=bb,Ce.isUtc=cb,Ce.isUTC=cb,Ce.zoneAbbr=vc,Ce.zoneName=wc,Ce.dates=u("dates accessor is deprecated. Use date instead.",pe),Ce.months=u("months accessor is deprecated. Use month instead",ha),Ce.years=u("years accessor is deprecated. Use year instead",ee),Ce.zone=u("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",Va);var De=Ce,Ee={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},Fe={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},Ge="Invalid date",He="%d",Ie=/\d{1,2}/,Je={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Ke=A.prototype;Ke._calendar=Ee,Ke.calendar=zc,Ke._longDateFormat=Fe,Ke.longDateFormat=Ac,Ke._invalidDate=Ge,Ke.invalidDate=Bc,Ke._ordinal=He,Ke.ordinal=Cc,Ke._ordinalParse=Ie,Ke.preparse=Dc,Ke.postformat=Dc,Ke._relativeTime=Je,Ke.relativeTime=Ec,Ke.pastFuture=Fc,Ke.set=y,Ke.months=ca,Ke._months=Wd,Ke.monthsShort=da,Ke._monthsShort=Xd,Ke.monthsParse=fa,Ke._monthsRegex=Zd,Ke.monthsRegex=ka,Ke._monthsShortRegex=Yd,Ke.monthsShortRegex=ja,Ke.week=Xb,Ke._week=oe,Ke.firstDayOfYear=Zb,Ke.firstDayOfWeek=Yb,Ke.weekdays=bc,Ke._weekdays=qe,Ke.weekdaysMin=dc,Ke._weekdaysMin=se,Ke.weekdaysShort=cc,Ke._weekdaysShort=re,Ke.weekdaysParse=fc,Ke._weekdaysRegex=te,Ke.weekdaysRegex=jc,Ke._weekdaysShortRegex=ue,Ke.weekdaysShortRegex=kc,Ke._weekdaysMinRegex=ve,Ke.weekdaysMinRegex=lc,Ke.isPM=sc,Ke._meridiemParse=we,Ke.meridiem=tc,E("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(a){var b=a%10,c=1===r(a%100/10)?"th":1===b?"st":2===b?"nd":3===b?"rd":"th";return a+c}}),a.lang=u("moment.lang is deprecated. Use moment.locale instead.",E),a.langData=u("moment.langData is deprecated. Use moment.localeData instead.",H);var Le=Math.abs,Me=Yc("ms"),Ne=Yc("s"),Oe=Yc("m"),Pe=Yc("h"),Qe=Yc("d"),Re=Yc("w"),Se=Yc("M"),Te=Yc("y"),Ue=$c("milliseconds"),Ve=$c("seconds"),We=$c("minutes"),Xe=$c("hours"),Ye=$c("days"),Ze=$c("months"),$e=$c("years"),_e=Math.round,af={s:45,m:45,h:22,d:26,M:11},bf=Math.abs,cf=Oa.prototype;cf.abs=Oc,cf.add=Qc,cf.subtract=Rc,cf.as=Wc,cf.asMilliseconds=Me,cf.asSeconds=Ne,cf.asMinutes=Oe,cf.asHours=Pe,cf.asDays=Qe,cf.asWeeks=Re,cf.asMonths=Se,cf.asYears=Te,cf.valueOf=Xc,cf._bubble=Tc,cf.get=Zc,cf.milliseconds=Ue,cf.seconds=Ve,cf.minutes=We,cf.hours=Xe,cf.days=Ye,cf.weeks=_c,cf.months=Ze,cf.years=$e,cf.humanize=dd,cf.toISOString=ed,cf.toString=ed,cf.toJSON=ed,cf.locale=Bb,cf.localeData=Cb,cf.toIsoString=u("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ed),cf.lang=ne,R("X",0,0,"unix"),R("x",0,0,"valueOf"),W("x",Fd),W("X",Id),$("X",function(a,b,c){c._d=new Date(1e3*parseFloat(a,10))}),$("x",function(a,b,c){c._d=new Date(r(a))}),a.version="2.13.0",b(Ka),a.fn=De,a.min=Ma,a.max=Na,a.now=he,a.utc=h,a.unix=xc,a.months=Jc,a.isDate=d,a.locale=E,a.invalid=l,a.duration=db,a.isMoment=p,a.weekdays=Lc,a.parseZone=yc,a.localeData=H,a.isDuration=Pa,a.monthsShort=Kc,a.weekdaysMin=Nc,a.defineLocale=F,a.updateLocale=G,a.locales=I,a.weekdaysShort=Mc,a.normalizeUnits=K,a.relativeTimeThreshold=cd,a.prototype=De;var df=a;return df}); \ No newline at end of file diff --git a/public/vendor/gibber.audio.lib.js b/public/vendor/gibber.audio.lib.js new file mode 100755 index 000000000..718840bbf --- /dev/null +++ b/public/vendor/gibber.audio.lib.js @@ -0,0 +1,23144 @@ +!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Gibber=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 0) { + throw new Error('Invalid string. Length must be a multiple of 4') + } + + // the number of equal signs (place holders) + // if there are two placeholders, than the two characters before it + // represent one byte + // if there is only one, then the three characters before it represent 2 bytes + // this is just a cheap hack to not do indexOf twice + var len = b64.length + placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0 + + // base64 is 4/3 + up to two characters of the original data + arr = new Arr(b64.length * 3 / 4 - placeHolders) + + // if there are placeholders, only get up to the last complete 4 chars + l = placeHolders > 0 ? b64.length - 4 : b64.length + + var L = 0 + + function push (v) { + arr[L++] = v + } + + for (i = 0, j = 0; i < l; i += 4, j += 3) { + tmp = (decode(b64.charAt(i)) << 18) | (decode(b64.charAt(i + 1)) << 12) | (decode(b64.charAt(i + 2)) << 6) | decode(b64.charAt(i + 3)) + push((tmp & 0xFF0000) >> 16) + push((tmp & 0xFF00) >> 8) + push(tmp & 0xFF) + } + + if (placeHolders === 2) { + tmp = (decode(b64.charAt(i)) << 2) | (decode(b64.charAt(i + 1)) >> 4) + push(tmp & 0xFF) + } else if (placeHolders === 1) { + tmp = (decode(b64.charAt(i)) << 10) | (decode(b64.charAt(i + 1)) << 4) | (decode(b64.charAt(i + 2)) >> 2) + push((tmp >> 8) & 0xFF) + push(tmp & 0xFF) + } + + return arr + } + + function uint8ToBase64 (uint8) { + var i, + extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes + output = "", + temp, length + + function encode (num) { + return lookup.charAt(num) + } + + function tripletToBase64 (num) { + return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F) + } + + // go through the array every three bytes, we'll deal with trailing stuff later + for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) { + temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2]) + output += tripletToBase64(temp) + } + + // pad the end with zeros, but make sure to not forget the extra bytes + switch (extraBytes) { + case 1: + temp = uint8[uint8.length - 1] + output += encode(temp >> 2) + output += encode((temp << 4) & 0x3F) + output += '==' + break + case 2: + temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1]) + output += encode(temp >> 10) + output += encode((temp >> 4) & 0x3F) + output += encode((temp << 2) & 0x3F) + output += '=' + break + } + + return output + } + + exports.toByteArray = b64ToByteArray + exports.fromByteArray = uint8ToBase64 +}(typeof exports === 'undefined' ? (this.base64js = {}) : exports)) + +},{}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/browser-resolve/empty.js":[function(require,module,exports){ + +},{}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/buffer/index.js":[function(require,module,exports){ +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ + +var base64 = require('base64-js') +var ieee754 = require('ieee754') +var isArray = require('is-array') + +exports.Buffer = Buffer +exports.SlowBuffer = Buffer +exports.INSPECT_MAX_BYTES = 50 +Buffer.poolSize = 8192 // not used by this implementation + +var kMaxLength = 0x3fffffff + +/** + * If `Buffer.TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Use Object implementation (most compatible, even IE6) + * + * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, + * Opera 11.6+, iOS 4.2+. + * + * Note: + * + * - Implementation must support adding new properties to `Uint8Array` instances. + * Firefox 4-29 lacked support, fixed in Firefox 30+. + * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438. + * + * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function. + * + * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of + * incorrect length in some situations. + * + * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they will + * get the Object implementation, which is slower but will work correctly. + */ +Buffer.TYPED_ARRAY_SUPPORT = (function () { + try { + var buf = new ArrayBuffer(0) + var arr = new Uint8Array(buf) + arr.foo = function () { return 42 } + return 42 === arr.foo() && // typed array instances can be augmented + typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray` + new Uint8Array(1).subarray(1, 1).byteLength === 0 // ie10 has broken `subarray` + } catch (e) { + return false + } +})() + +/** + * Class: Buffer + * ============= + * + * The Buffer constructor returns instances of `Uint8Array` that are augmented + * with function properties for all the node `Buffer` API functions. We use + * `Uint8Array` so that square bracket notation works as expected -- it returns + * a single octet. + * + * By augmenting the instances, we can avoid modifying the `Uint8Array` + * prototype. + */ +function Buffer (subject, encoding, noZero) { + if (!(this instanceof Buffer)) + return new Buffer(subject, encoding, noZero) + + var type = typeof subject + + // Find the length + var length + if (type === 'number') + length = subject > 0 ? subject >>> 0 : 0 + else if (type === 'string') { + if (encoding === 'base64') + subject = base64clean(subject) + length = Buffer.byteLength(subject, encoding) + } else if (type === 'object' && subject !== null) { // assume object is array-like + if (subject.type === 'Buffer' && isArray(subject.data)) + subject = subject.data + length = +subject.length > 0 ? Math.floor(+subject.length) : 0 + } else + throw new TypeError('must start with number, buffer, array or string') + + if (this.length > kMaxLength) + throw new RangeError('Attempt to allocate Buffer larger than maximum ' + + 'size: 0x' + kMaxLength.toString(16) + ' bytes') + + var buf + if (Buffer.TYPED_ARRAY_SUPPORT) { + // Preferred: Return an augmented `Uint8Array` instance for best performance + buf = Buffer._augment(new Uint8Array(length)) + } else { + // Fallback: Return THIS instance of Buffer (created by `new`) + buf = this + buf.length = length + buf._isBuffer = true + } + + var i + if (Buffer.TYPED_ARRAY_SUPPORT && typeof subject.byteLength === 'number') { + // Speed optimization -- use set if we're copying from a typed array + buf._set(subject) + } else if (isArrayish(subject)) { + // Treat array-ish objects as a byte array + if (Buffer.isBuffer(subject)) { + for (i = 0; i < length; i++) + buf[i] = subject.readUInt8(i) + } else { + for (i = 0; i < length; i++) + buf[i] = ((subject[i] % 256) + 256) % 256 + } + } else if (type === 'string') { + buf.write(subject, 0, encoding) + } else if (type === 'number' && !Buffer.TYPED_ARRAY_SUPPORT && !noZero) { + for (i = 0; i < length; i++) { + buf[i] = 0 + } + } + + return buf +} + +Buffer.isBuffer = function (b) { + return !!(b != null && b._isBuffer) +} + +Buffer.compare = function (a, b) { + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) + throw new TypeError('Arguments must be Buffers') + + var x = a.length + var y = b.length + for (var i = 0, len = Math.min(x, y); i < len && a[i] === b[i]; i++) {} + if (i !== len) { + x = a[i] + y = b[i] + } + if (x < y) return -1 + if (y < x) return 1 + return 0 +} + +Buffer.isEncoding = function (encoding) { + switch (String(encoding).toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'binary': + case 'base64': + case 'raw': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return true + default: + return false + } +} + +Buffer.concat = function (list, totalLength) { + if (!isArray(list)) throw new TypeError('Usage: Buffer.concat(list[, length])') + + if (list.length === 0) { + return new Buffer(0) + } else if (list.length === 1) { + return list[0] + } + + var i + if (totalLength === undefined) { + totalLength = 0 + for (i = 0; i < list.length; i++) { + totalLength += list[i].length + } + } + + var buf = new Buffer(totalLength) + var pos = 0 + for (i = 0; i < list.length; i++) { + var item = list[i] + item.copy(buf, pos) + pos += item.length + } + return buf +} + +Buffer.byteLength = function (str, encoding) { + var ret + str = str + '' + switch (encoding || 'utf8') { + case 'ascii': + case 'binary': + case 'raw': + ret = str.length + break + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + ret = str.length * 2 + break + case 'hex': + ret = str.length >>> 1 + break + case 'utf8': + case 'utf-8': + ret = utf8ToBytes(str).length + break + case 'base64': + ret = base64ToBytes(str).length + break + default: + ret = str.length + } + return ret +} + +// pre-set for values that may exist in the future +Buffer.prototype.length = undefined +Buffer.prototype.parent = undefined + +// toString(encoding, start=0, end=buffer.length) +Buffer.prototype.toString = function (encoding, start, end) { + var loweredCase = false + + start = start >>> 0 + end = end === undefined || end === Infinity ? this.length : end >>> 0 + + if (!encoding) encoding = 'utf8' + if (start < 0) start = 0 + if (end > this.length) end = this.length + if (end <= start) return '' + + while (true) { + switch (encoding) { + case 'hex': + return hexSlice(this, start, end) + + case 'utf8': + case 'utf-8': + return utf8Slice(this, start, end) + + case 'ascii': + return asciiSlice(this, start, end) + + case 'binary': + return binarySlice(this, start, end) + + case 'base64': + return base64Slice(this, start, end) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return utf16leSlice(this, start, end) + + default: + if (loweredCase) + throw new TypeError('Unknown encoding: ' + encoding) + encoding = (encoding + '').toLowerCase() + loweredCase = true + } + } +} + +Buffer.prototype.equals = function (b) { + if(!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') + return Buffer.compare(this, b) === 0 +} + +Buffer.prototype.inspect = function () { + var str = '' + var max = exports.INSPECT_MAX_BYTES + if (this.length > 0) { + str = this.toString('hex', 0, max).match(/.{2}/g).join(' ') + if (this.length > max) + str += ' ... ' + } + return '' +} + +Buffer.prototype.compare = function (b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') + return Buffer.compare(this, b) +} + +// `get` will be removed in Node 0.13+ +Buffer.prototype.get = function (offset) { + console.log('.get() is deprecated. Access using array indexes instead.') + return this.readUInt8(offset) +} + +// `set` will be removed in Node 0.13+ +Buffer.prototype.set = function (v, offset) { + console.log('.set() is deprecated. Access using array indexes instead.') + return this.writeUInt8(v, offset) +} + +function hexWrite (buf, string, offset, length) { + offset = Number(offset) || 0 + var remaining = buf.length - offset + if (!length) { + length = remaining + } else { + length = Number(length) + if (length > remaining) { + length = remaining + } + } + + // must be an even number of digits + var strLen = string.length + if (strLen % 2 !== 0) throw new Error('Invalid hex string') + + if (length > strLen / 2) { + length = strLen / 2 + } + for (var i = 0; i < length; i++) { + var byte = parseInt(string.substr(i * 2, 2), 16) + if (isNaN(byte)) throw new Error('Invalid hex string') + buf[offset + i] = byte + } + return i +} + +function utf8Write (buf, string, offset, length) { + var charsWritten = blitBuffer(utf8ToBytes(string), buf, offset, length) + return charsWritten +} + +function asciiWrite (buf, string, offset, length) { + var charsWritten = blitBuffer(asciiToBytes(string), buf, offset, length) + return charsWritten +} + +function binaryWrite (buf, string, offset, length) { + return asciiWrite(buf, string, offset, length) +} + +function base64Write (buf, string, offset, length) { + var charsWritten = blitBuffer(base64ToBytes(string), buf, offset, length) + return charsWritten +} + +function utf16leWrite (buf, string, offset, length) { + var charsWritten = blitBuffer(utf16leToBytes(string), buf, offset, length, 2) + return charsWritten +} + +Buffer.prototype.write = function (string, offset, length, encoding) { + // Support both (string, offset, length, encoding) + // and the legacy (string, encoding, offset, length) + if (isFinite(offset)) { + if (!isFinite(length)) { + encoding = length + length = undefined + } + } else { // legacy + var swap = encoding + encoding = offset + offset = length + length = swap + } + + offset = Number(offset) || 0 + var remaining = this.length - offset + if (!length) { + length = remaining + } else { + length = Number(length) + if (length > remaining) { + length = remaining + } + } + encoding = String(encoding || 'utf8').toLowerCase() + + var ret + switch (encoding) { + case 'hex': + ret = hexWrite(this, string, offset, length) + break + case 'utf8': + case 'utf-8': + ret = utf8Write(this, string, offset, length) + break + case 'ascii': + ret = asciiWrite(this, string, offset, length) + break + case 'binary': + ret = binaryWrite(this, string, offset, length) + break + case 'base64': + ret = base64Write(this, string, offset, length) + break + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + ret = utf16leWrite(this, string, offset, length) + break + default: + throw new TypeError('Unknown encoding: ' + encoding) + } + return ret +} + +Buffer.prototype.toJSON = function () { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + } +} + +function base64Slice (buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf) + } else { + return base64.fromByteArray(buf.slice(start, end)) + } +} + +function utf8Slice (buf, start, end) { + var res = '' + var tmp = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; i++) { + if (buf[i] <= 0x7F) { + res += decodeUtf8Char(tmp) + String.fromCharCode(buf[i]) + tmp = '' + } else { + tmp += '%' + buf[i].toString(16) + } + } + + return res + decodeUtf8Char(tmp) +} + +function asciiSlice (buf, start, end) { + var ret = '' + end = Math.min(buf.length, end) + + for (var i = start; i < end; i++) { + ret += String.fromCharCode(buf[i]) + } + return ret +} + +function binarySlice (buf, start, end) { + return asciiSlice(buf, start, end) +} + +function hexSlice (buf, start, end) { + var len = buf.length + + if (!start || start < 0) start = 0 + if (!end || end < 0 || end > len) end = len + + var out = '' + for (var i = start; i < end; i++) { + out += toHex(buf[i]) + } + return out +} + +function utf16leSlice (buf, start, end) { + var bytes = buf.slice(start, end) + var res = '' + for (var i = 0; i < bytes.length; i += 2) { + res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256) + } + return res +} + +Buffer.prototype.slice = function (start, end) { + var len = this.length + start = ~~start + end = end === undefined ? len : ~~end + + if (start < 0) { + start += len; + if (start < 0) + start = 0 + } else if (start > len) { + start = len + } + + if (end < 0) { + end += len + if (end < 0) + end = 0 + } else if (end > len) { + end = len + } + + if (end < start) + end = start + + if (Buffer.TYPED_ARRAY_SUPPORT) { + return Buffer._augment(this.subarray(start, end)) + } else { + var sliceLen = end - start + var newBuf = new Buffer(sliceLen, undefined, true) + for (var i = 0; i < sliceLen; i++) { + newBuf[i] = this[i + start] + } + return newBuf + } +} + +/* + * Need to make sure that buffer isn't trying to write out of bounds. + */ +function checkOffset (offset, ext, length) { + if ((offset % 1) !== 0 || offset < 0) + throw new RangeError('offset is not uint') + if (offset + ext > length) + throw new RangeError('Trying to access beyond buffer length') +} + +Buffer.prototype.readUInt8 = function (offset, noAssert) { + if (!noAssert) + checkOffset(offset, 1, this.length) + return this[offset] +} + +Buffer.prototype.readUInt16LE = function (offset, noAssert) { + if (!noAssert) + checkOffset(offset, 2, this.length) + return this[offset] | (this[offset + 1] << 8) +} + +Buffer.prototype.readUInt16BE = function (offset, noAssert) { + if (!noAssert) + checkOffset(offset, 2, this.length) + return (this[offset] << 8) | this[offset + 1] +} + +Buffer.prototype.readUInt32LE = function (offset, noAssert) { + if (!noAssert) + checkOffset(offset, 4, this.length) + + return ((this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16)) + + (this[offset + 3] * 0x1000000) +} + +Buffer.prototype.readUInt32BE = function (offset, noAssert) { + if (!noAssert) + checkOffset(offset, 4, this.length) + + return (this[offset] * 0x1000000) + + ((this[offset + 1] << 16) | + (this[offset + 2] << 8) | + this[offset + 3]) +} + +Buffer.prototype.readInt8 = function (offset, noAssert) { + if (!noAssert) + checkOffset(offset, 1, this.length) + if (!(this[offset] & 0x80)) + return (this[offset]) + return ((0xff - this[offset] + 1) * -1) +} + +Buffer.prototype.readInt16LE = function (offset, noAssert) { + if (!noAssert) + checkOffset(offset, 2, this.length) + var val = this[offset] | (this[offset + 1] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} + +Buffer.prototype.readInt16BE = function (offset, noAssert) { + if (!noAssert) + checkOffset(offset, 2, this.length) + var val = this[offset + 1] | (this[offset] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} + +Buffer.prototype.readInt32LE = function (offset, noAssert) { + if (!noAssert) + checkOffset(offset, 4, this.length) + + return (this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16) | + (this[offset + 3] << 24) +} + +Buffer.prototype.readInt32BE = function (offset, noAssert) { + if (!noAssert) + checkOffset(offset, 4, this.length) + + return (this[offset] << 24) | + (this[offset + 1] << 16) | + (this[offset + 2] << 8) | + (this[offset + 3]) +} + +Buffer.prototype.readFloatLE = function (offset, noAssert) { + if (!noAssert) + checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, true, 23, 4) +} + +Buffer.prototype.readFloatBE = function (offset, noAssert) { + if (!noAssert) + checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, false, 23, 4) +} + +Buffer.prototype.readDoubleLE = function (offset, noAssert) { + if (!noAssert) + checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, true, 52, 8) +} + +Buffer.prototype.readDoubleBE = function (offset, noAssert) { + if (!noAssert) + checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, false, 52, 8) +} + +function checkInt (buf, value, offset, ext, max, min) { + if (!Buffer.isBuffer(buf)) throw new TypeError('buffer must be a Buffer instance') + if (value > max || value < min) throw new TypeError('value is out of bounds') + if (offset + ext > buf.length) throw new TypeError('index out of range') +} + +Buffer.prototype.writeUInt8 = function (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) + checkInt(this, value, offset, 1, 0xff, 0) + if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) + this[offset] = value + return offset + 1 +} + +function objectWriteUInt16 (buf, value, offset, littleEndian) { + if (value < 0) value = 0xffff + value + 1 + for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; i++) { + buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>> + (littleEndian ? i : 1 - i) * 8 + } +} + +Buffer.prototype.writeUInt16LE = function (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) + checkInt(this, value, offset, 2, 0xffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = value + this[offset + 1] = (value >>> 8) + } else objectWriteUInt16(this, value, offset, true) + return offset + 2 +} + +Buffer.prototype.writeUInt16BE = function (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) + checkInt(this, value, offset, 2, 0xffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 8) + this[offset + 1] = value + } else objectWriteUInt16(this, value, offset, false) + return offset + 2 +} + +function objectWriteUInt32 (buf, value, offset, littleEndian) { + if (value < 0) value = 0xffffffff + value + 1 + for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; i++) { + buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff + } +} + +Buffer.prototype.writeUInt32LE = function (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) + checkInt(this, value, offset, 4, 0xffffffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset + 3] = (value >>> 24) + this[offset + 2] = (value >>> 16) + this[offset + 1] = (value >>> 8) + this[offset] = value + } else objectWriteUInt32(this, value, offset, true) + return offset + 4 +} + +Buffer.prototype.writeUInt32BE = function (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) + checkInt(this, value, offset, 4, 0xffffffff, 0) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = value + } else objectWriteUInt32(this, value, offset, false) + return offset + 4 +} + +Buffer.prototype.writeInt8 = function (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) + checkInt(this, value, offset, 1, 0x7f, -0x80) + if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value) + if (value < 0) value = 0xff + value + 1 + this[offset] = value + return offset + 1 +} + +Buffer.prototype.writeInt16LE = function (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) + checkInt(this, value, offset, 2, 0x7fff, -0x8000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = value + this[offset + 1] = (value >>> 8) + } else objectWriteUInt16(this, value, offset, true) + return offset + 2 +} + +Buffer.prototype.writeInt16BE = function (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) + checkInt(this, value, offset, 2, 0x7fff, -0x8000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 8) + this[offset + 1] = value + } else objectWriteUInt16(this, value, offset, false) + return offset + 2 +} + +Buffer.prototype.writeInt32LE = function (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) + checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = value + this[offset + 1] = (value >>> 8) + this[offset + 2] = (value >>> 16) + this[offset + 3] = (value >>> 24) + } else objectWriteUInt32(this, value, offset, true) + return offset + 4 +} + +Buffer.prototype.writeInt32BE = function (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) + checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + if (value < 0) value = 0xffffffff + value + 1 + if (Buffer.TYPED_ARRAY_SUPPORT) { + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = value + } else objectWriteUInt32(this, value, offset, false) + return offset + 4 +} + +function checkIEEE754 (buf, value, offset, ext, max, min) { + if (value > max || value < min) throw new TypeError('value is out of bounds') + if (offset + ext > buf.length) throw new TypeError('index out of range') +} + +function writeFloat (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) + checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) + ieee754.write(buf, value, offset, littleEndian, 23, 4) + return offset + 4 +} + +Buffer.prototype.writeFloatLE = function (value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeFloatBE = function (value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert) +} + +function writeDouble (buf, value, offset, littleEndian, noAssert) { + if (!noAssert) + checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) + ieee754.write(buf, value, offset, littleEndian, 52, 8) + return offset + 8 +} + +Buffer.prototype.writeDoubleLE = function (value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeDoubleBE = function (value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert) +} + +// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) +Buffer.prototype.copy = function (target, target_start, start, end) { + var source = this + + if (!start) start = 0 + if (!end && end !== 0) end = this.length + if (!target_start) target_start = 0 + + // Copy 0 bytes; we're done + if (end === start) return + if (target.length === 0 || source.length === 0) return + + // Fatal error conditions + if (end < start) throw new TypeError('sourceEnd < sourceStart') + if (target_start < 0 || target_start >= target.length) + throw new TypeError('targetStart out of bounds') + if (start < 0 || start >= source.length) throw new TypeError('sourceStart out of bounds') + if (end < 0 || end > source.length) throw new TypeError('sourceEnd out of bounds') + + // Are we oob? + if (end > this.length) + end = this.length + if (target.length - target_start < end - start) + end = target.length - target_start + start + + var len = end - start + + if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) { + for (var i = 0; i < len; i++) { + target[i + target_start] = this[i + start] + } + } else { + target._set(this.subarray(start, start + len), target_start) + } +} + +// fill(value, start=0, end=buffer.length) +Buffer.prototype.fill = function (value, start, end) { + if (!value) value = 0 + if (!start) start = 0 + if (!end) end = this.length + + if (end < start) throw new TypeError('end < start') + + // Fill 0 bytes; we're done + if (end === start) return + if (this.length === 0) return + + if (start < 0 || start >= this.length) throw new TypeError('start out of bounds') + if (end < 0 || end > this.length) throw new TypeError('end out of bounds') + + var i + if (typeof value === 'number') { + for (i = start; i < end; i++) { + this[i] = value + } + } else { + var bytes = utf8ToBytes(value.toString()) + var len = bytes.length + for (i = start; i < end; i++) { + this[i] = bytes[i % len] + } + } + + return this +} + +/** + * Creates a new `ArrayBuffer` with the *copied* memory of the buffer instance. + * Added in Node 0.12. Only available in browsers that support ArrayBuffer. + */ +Buffer.prototype.toArrayBuffer = function () { + if (typeof Uint8Array !== 'undefined') { + if (Buffer.TYPED_ARRAY_SUPPORT) { + return (new Buffer(this)).buffer + } else { + var buf = new Uint8Array(this.length) + for (var i = 0, len = buf.length; i < len; i += 1) { + buf[i] = this[i] + } + return buf.buffer + } + } else { + throw new TypeError('Buffer.toArrayBuffer not supported in this browser') + } +} + +// HELPER FUNCTIONS +// ================ + +var BP = Buffer.prototype + +/** + * Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods + */ +Buffer._augment = function (arr) { + arr.constructor = Buffer + arr._isBuffer = true + + // save reference to original Uint8Array get/set methods before overwriting + arr._get = arr.get + arr._set = arr.set + + // deprecated, will be removed in node 0.13+ + arr.get = BP.get + arr.set = BP.set + + arr.write = BP.write + arr.toString = BP.toString + arr.toLocaleString = BP.toString + arr.toJSON = BP.toJSON + arr.equals = BP.equals + arr.compare = BP.compare + arr.copy = BP.copy + arr.slice = BP.slice + arr.readUInt8 = BP.readUInt8 + arr.readUInt16LE = BP.readUInt16LE + arr.readUInt16BE = BP.readUInt16BE + arr.readUInt32LE = BP.readUInt32LE + arr.readUInt32BE = BP.readUInt32BE + arr.readInt8 = BP.readInt8 + arr.readInt16LE = BP.readInt16LE + arr.readInt16BE = BP.readInt16BE + arr.readInt32LE = BP.readInt32LE + arr.readInt32BE = BP.readInt32BE + arr.readFloatLE = BP.readFloatLE + arr.readFloatBE = BP.readFloatBE + arr.readDoubleLE = BP.readDoubleLE + arr.readDoubleBE = BP.readDoubleBE + arr.writeUInt8 = BP.writeUInt8 + arr.writeUInt16LE = BP.writeUInt16LE + arr.writeUInt16BE = BP.writeUInt16BE + arr.writeUInt32LE = BP.writeUInt32LE + arr.writeUInt32BE = BP.writeUInt32BE + arr.writeInt8 = BP.writeInt8 + arr.writeInt16LE = BP.writeInt16LE + arr.writeInt16BE = BP.writeInt16BE + arr.writeInt32LE = BP.writeInt32LE + arr.writeInt32BE = BP.writeInt32BE + arr.writeFloatLE = BP.writeFloatLE + arr.writeFloatBE = BP.writeFloatBE + arr.writeDoubleLE = BP.writeDoubleLE + arr.writeDoubleBE = BP.writeDoubleBE + arr.fill = BP.fill + arr.inspect = BP.inspect + arr.toArrayBuffer = BP.toArrayBuffer + + return arr +} + +var INVALID_BASE64_RE = /[^+\/0-9A-z]/g + +function base64clean (str) { + // Node strips out invalid characters like \n and \t from the string, base64-js does not + str = stringtrim(str).replace(INVALID_BASE64_RE, '') + // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not + while (str.length % 4 !== 0) { + str = str + '=' + } + return str +} + +function stringtrim (str) { + if (str.trim) return str.trim() + return str.replace(/^\s+|\s+$/g, '') +} + +function isArrayish (subject) { + return isArray(subject) || Buffer.isBuffer(subject) || + subject && typeof subject === 'object' && + typeof subject.length === 'number' +} + +function toHex (n) { + if (n < 16) return '0' + n.toString(16) + return n.toString(16) +} + +function utf8ToBytes (str) { + var byteArray = [] + for (var i = 0; i < str.length; i++) { + var b = str.charCodeAt(i) + if (b <= 0x7F) { + byteArray.push(b) + } else { + var start = i + if (b >= 0xD800 && b <= 0xDFFF) i++ + var h = encodeURIComponent(str.slice(start, i+1)).substr(1).split('%') + for (var j = 0; j < h.length; j++) { + byteArray.push(parseInt(h[j], 16)) + } + } + } + return byteArray +} + +function asciiToBytes (str) { + var byteArray = [] + for (var i = 0; i < str.length; i++) { + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push(str.charCodeAt(i) & 0xFF) + } + return byteArray +} + +function utf16leToBytes (str) { + var c, hi, lo + var byteArray = [] + for (var i = 0; i < str.length; i++) { + c = str.charCodeAt(i) + hi = c >> 8 + lo = c % 256 + byteArray.push(lo) + byteArray.push(hi) + } + + return byteArray +} + +function base64ToBytes (str) { + return base64.toByteArray(str) +} + +function blitBuffer (src, dst, offset, length, unitSize) { + if (unitSize) length -= length % unitSize; + for (var i = 0; i < length; i++) { + if ((i + offset >= dst.length) || (i >= src.length)) + break + dst[i + offset] = src[i] + } + return i +} + +function decodeUtf8Char (str) { + try { + return decodeURIComponent(str) + } catch (err) { + return String.fromCharCode(0xFFFD) // UTF 8 invalid char + } +} + +},{"base64-js":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/base64-js/lib/b64.js","ieee754":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/buffer/node_modules/ieee754/index.js","is-array":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/buffer/node_modules/is-array/index.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/buffer/node_modules/ieee754/index.js":[function(require,module,exports){ +exports.read = function (buffer, offset, isLE, mLen, nBytes) { + var e, m + var eLen = nBytes * 8 - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var nBits = -7 + var i = isLE ? (nBytes - 1) : 0 + var d = isLE ? -1 : 1 + var s = buffer[offset + i] + + i += d + + e = s & ((1 << (-nBits)) - 1) + s >>= (-nBits) + nBits += eLen + for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + m = e & ((1 << (-nBits)) - 1) + e >>= (-nBits) + nBits += mLen + for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8) {} + + if (e === 0) { + e = 1 - eBias + } else if (e === eMax) { + return m ? NaN : ((s ? -1 : 1) * Infinity) + } else { + m = m + Math.pow(2, mLen) + e = e - eBias + } + return (s ? -1 : 1) * m * Math.pow(2, e - mLen) +} + +exports.write = function (buffer, value, offset, isLE, mLen, nBytes) { + var e, m, c + var eLen = nBytes * 8 - mLen - 1 + var eMax = (1 << eLen) - 1 + var eBias = eMax >> 1 + var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0) + var i = isLE ? 0 : (nBytes - 1) + var d = isLE ? 1 : -1 + var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0 + + value = Math.abs(value) + + if (isNaN(value) || value === Infinity) { + m = isNaN(value) ? 1 : 0 + e = eMax + } else { + e = Math.floor(Math.log(value) / Math.LN2) + if (value * (c = Math.pow(2, -e)) < 1) { + e-- + c *= 2 + } + if (e + eBias >= 1) { + value += rt / c + } else { + value += rt * Math.pow(2, 1 - eBias) + } + if (value * c >= 2) { + e++ + c /= 2 + } + + if (e + eBias >= eMax) { + m = 0 + e = eMax + } else if (e + eBias >= 1) { + m = (value * c - 1) * Math.pow(2, mLen) + e = e + eBias + } else { + m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen) + e = 0 + } + } + + for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {} + + e = (e << mLen) | m + eLen += mLen + for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {} + + buffer[offset + i - d] |= s * 128 +} + +},{}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/buffer/node_modules/is-array/index.js":[function(require,module,exports){ + +/** + * isArray + */ + +var isArray = Array.isArray; + +/** + * toString + */ + +var str = Object.prototype.toString; + +/** + * Whether or not the given `val` + * is an array. + * + * example: + * + * isArray([]); + * // > true + * isArray(arguments); + * // > false + * isArray(''); + * // > false + * + * @param {mixed} val + * @return {bool} + */ + +module.exports = isArray || function (val) { + return !! val && '[object Array]' == str.call(val); +}; + +},{}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/events/events.js":[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +function EventEmitter() { + this._events = this._events || {}; + this._maxListeners = this._maxListeners || undefined; +} +module.exports = EventEmitter; + +// Backwards-compat with node 0.10.x +EventEmitter.EventEmitter = EventEmitter; + +EventEmitter.prototype._events = undefined; +EventEmitter.prototype._maxListeners = undefined; + +// By default EventEmitters will print a warning if more than 10 listeners are +// added to it. This is a useful default which helps finding memory leaks. +EventEmitter.defaultMaxListeners = 10; + +// Obviously not all Emitters should be limited to 10. This function allows +// that to be increased. Set to zero for unlimited. +EventEmitter.prototype.setMaxListeners = function(n) { + if (!isNumber(n) || n < 0 || isNaN(n)) + throw TypeError('n must be a positive number'); + this._maxListeners = n; + return this; +}; + +EventEmitter.prototype.emit = function(type) { + var er, handler, len, args, i, listeners; + + if (!this._events) + this._events = {}; + + // If there is no 'error' event listener then throw. + if (type === 'error') { + if (!this._events.error || + (isObject(this._events.error) && !this._events.error.length)) { + er = arguments[1]; + if (er instanceof Error) { + throw er; // Unhandled 'error' event + } + throw TypeError('Uncaught, unspecified "error" event.'); + } + } + + handler = this._events[type]; + + if (isUndefined(handler)) + return false; + + if (isFunction(handler)) { + switch (arguments.length) { + // fast cases + case 1: + handler.call(this); + break; + case 2: + handler.call(this, arguments[1]); + break; + case 3: + handler.call(this, arguments[1], arguments[2]); + break; + // slower + default: + len = arguments.length; + args = new Array(len - 1); + for (i = 1; i < len; i++) + args[i - 1] = arguments[i]; + handler.apply(this, args); + } + } else if (isObject(handler)) { + len = arguments.length; + args = new Array(len - 1); + for (i = 1; i < len; i++) + args[i - 1] = arguments[i]; + + listeners = handler.slice(); + len = listeners.length; + for (i = 0; i < len; i++) + listeners[i].apply(this, args); + } + + return true; +}; + +EventEmitter.prototype.addListener = function(type, listener) { + var m; + + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + if (!this._events) + this._events = {}; + + // To avoid recursion in the case that type === "newListener"! Before + // adding it to the listeners, first emit "newListener". + if (this._events.newListener) + this.emit('newListener', type, + isFunction(listener.listener) ? + listener.listener : listener); + + if (!this._events[type]) + // Optimize the case of one listener. Don't need the extra array object. + this._events[type] = listener; + else if (isObject(this._events[type])) + // If we've already got an array, just append. + this._events[type].push(listener); + else + // Adding the second element, need to change to array. + this._events[type] = [this._events[type], listener]; + + // Check for listener leak + if (isObject(this._events[type]) && !this._events[type].warned) { + var m; + if (!isUndefined(this._maxListeners)) { + m = this._maxListeners; + } else { + m = EventEmitter.defaultMaxListeners; + } + + if (m && m > 0 && this._events[type].length > m) { + this._events[type].warned = true; + console.error('(node) warning: possible EventEmitter memory ' + + 'leak detected. %d listeners added. ' + + 'Use emitter.setMaxListeners() to increase limit.', + this._events[type].length); + if (typeof console.trace === 'function') { + // not supported in IE 10 + console.trace(); + } + } + } + + return this; +}; + +EventEmitter.prototype.on = EventEmitter.prototype.addListener; + +EventEmitter.prototype.once = function(type, listener) { + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + var fired = false; + + function g() { + this.removeListener(type, g); + + if (!fired) { + fired = true; + listener.apply(this, arguments); + } + } + + g.listener = listener; + this.on(type, g); + + return this; +}; + +// emits a 'removeListener' event iff the listener was removed +EventEmitter.prototype.removeListener = function(type, listener) { + var list, position, length, i; + + if (!isFunction(listener)) + throw TypeError('listener must be a function'); + + if (!this._events || !this._events[type]) + return this; + + list = this._events[type]; + length = list.length; + position = -1; + + if (list === listener || + (isFunction(list.listener) && list.listener === listener)) { + delete this._events[type]; + if (this._events.removeListener) + this.emit('removeListener', type, listener); + + } else if (isObject(list)) { + for (i = length; i-- > 0;) { + if (list[i] === listener || + (list[i].listener && list[i].listener === listener)) { + position = i; + break; + } + } + + if (position < 0) + return this; + + if (list.length === 1) { + list.length = 0; + delete this._events[type]; + } else { + list.splice(position, 1); + } + + if (this._events.removeListener) + this.emit('removeListener', type, listener); + } + + return this; +}; + +EventEmitter.prototype.removeAllListeners = function(type) { + var key, listeners; + + if (!this._events) + return this; + + // not listening for removeListener, no need to emit + if (!this._events.removeListener) { + if (arguments.length === 0) + this._events = {}; + else if (this._events[type]) + delete this._events[type]; + return this; + } + + // emit removeListener for all listeners on all events + if (arguments.length === 0) { + for (key in this._events) { + if (key === 'removeListener') continue; + this.removeAllListeners(key); + } + this.removeAllListeners('removeListener'); + this._events = {}; + return this; + } + + listeners = this._events[type]; + + if (isFunction(listeners)) { + this.removeListener(type, listeners); + } else { + // LIFO order + while (listeners.length) + this.removeListener(type, listeners[listeners.length - 1]); + } + delete this._events[type]; + + return this; +}; + +EventEmitter.prototype.listeners = function(type) { + var ret; + if (!this._events || !this._events[type]) + ret = []; + else if (isFunction(this._events[type])) + ret = [this._events[type]]; + else + ret = this._events[type].slice(); + return ret; +}; + +EventEmitter.listenerCount = function(emitter, type) { + var ret; + if (!emitter._events || !emitter._events[type]) + ret = 0; + else if (isFunction(emitter._events[type])) + ret = 1; + else + ret = emitter._events[type].length; + return ret; +}; + +function isFunction(arg) { + return typeof arg === 'function'; +} + +function isNumber(arg) { + return typeof arg === 'number'; +} + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} + +function isUndefined(arg) { + return arg === void 0; +} + +},{}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/http-browserify/index.js":[function(require,module,exports){ +var http = module.exports; +var EventEmitter = require('events').EventEmitter; +var Request = require('./lib/request'); +var url = require('url') + +http.request = function (params, cb) { + if (typeof params === 'string') { + params = url.parse(params) + } + if (!params) params = {}; + if (!params.host && !params.port) { + params.port = parseInt(window.location.port, 10); + } + if (!params.host && params.hostname) { + params.host = params.hostname; + } + + if (!params.protocol) { + if (params.scheme) { + params.protocol = params.scheme + ':'; + } else { + params.protocol = window.location.protocol; + } + } + + if (!params.host) { + params.host = window.location.hostname || window.location.host; + } + if (/:/.test(params.host)) { + if (!params.port) { + params.port = params.host.split(':')[1]; + } + params.host = params.host.split(':')[0]; + } + if (!params.port) params.port = params.protocol == 'https:' ? 443 : 80; + + var req = new Request(new xhrHttp, params); + if (cb) req.on('response', cb); + return req; +}; + +http.get = function (params, cb) { + params.method = 'GET'; + var req = http.request(params, cb); + req.end(); + return req; +}; + +http.Agent = function () {}; +http.Agent.defaultMaxSockets = 4; + +var xhrHttp = (function () { + if (typeof window === 'undefined') { + throw new Error('no window object present'); + } + else if (window.XMLHttpRequest) { + return window.XMLHttpRequest; + } + else if (window.ActiveXObject) { + var axs = [ + 'Msxml2.XMLHTTP.6.0', + 'Msxml2.XMLHTTP.3.0', + 'Microsoft.XMLHTTP' + ]; + for (var i = 0; i < axs.length; i++) { + try { + var ax = new(window.ActiveXObject)(axs[i]); + return function () { + if (ax) { + var ax_ = ax; + ax = null; + return ax_; + } + else { + return new(window.ActiveXObject)(axs[i]); + } + }; + } + catch (e) {} + } + throw new Error('ajax not supported in this browser') + } + else { + throw new Error('ajax not supported in this browser'); + } +})(); + +http.STATUS_CODES = { + 100 : 'Continue', + 101 : 'Switching Protocols', + 102 : 'Processing', // RFC 2518, obsoleted by RFC 4918 + 200 : 'OK', + 201 : 'Created', + 202 : 'Accepted', + 203 : 'Non-Authoritative Information', + 204 : 'No Content', + 205 : 'Reset Content', + 206 : 'Partial Content', + 207 : 'Multi-Status', // RFC 4918 + 300 : 'Multiple Choices', + 301 : 'Moved Permanently', + 302 : 'Moved Temporarily', + 303 : 'See Other', + 304 : 'Not Modified', + 305 : 'Use Proxy', + 307 : 'Temporary Redirect', + 400 : 'Bad Request', + 401 : 'Unauthorized', + 402 : 'Payment Required', + 403 : 'Forbidden', + 404 : 'Not Found', + 405 : 'Method Not Allowed', + 406 : 'Not Acceptable', + 407 : 'Proxy Authentication Required', + 408 : 'Request Time-out', + 409 : 'Conflict', + 410 : 'Gone', + 411 : 'Length Required', + 412 : 'Precondition Failed', + 413 : 'Request Entity Too Large', + 414 : 'Request-URI Too Large', + 415 : 'Unsupported Media Type', + 416 : 'Requested Range Not Satisfiable', + 417 : 'Expectation Failed', + 418 : 'I\'m a teapot', // RFC 2324 + 422 : 'Unprocessable Entity', // RFC 4918 + 423 : 'Locked', // RFC 4918 + 424 : 'Failed Dependency', // RFC 4918 + 425 : 'Unordered Collection', // RFC 4918 + 426 : 'Upgrade Required', // RFC 2817 + 428 : 'Precondition Required', // RFC 6585 + 429 : 'Too Many Requests', // RFC 6585 + 431 : 'Request Header Fields Too Large',// RFC 6585 + 500 : 'Internal Server Error', + 501 : 'Not Implemented', + 502 : 'Bad Gateway', + 503 : 'Service Unavailable', + 504 : 'Gateway Time-out', + 505 : 'HTTP Version Not Supported', + 506 : 'Variant Also Negotiates', // RFC 2295 + 507 : 'Insufficient Storage', // RFC 4918 + 509 : 'Bandwidth Limit Exceeded', + 510 : 'Not Extended', // RFC 2774 + 511 : 'Network Authentication Required' // RFC 6585 +}; +},{"./lib/request":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/http-browserify/lib/request.js","events":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/events/events.js","url":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/url/url.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/http-browserify/lib/request.js":[function(require,module,exports){ +var Stream = require('stream'); +var Response = require('./response'); +var Base64 = require('Base64'); +var inherits = require('inherits'); + +var Request = module.exports = function (xhr, params) { + var self = this; + self.writable = true; + self.xhr = xhr; + self.body = []; + + self.uri = (params.protocol || 'http:') + '//' + + params.host + + (params.port ? ':' + params.port : '') + + (params.path || '/') + ; + + if (typeof params.withCredentials === 'undefined') { + params.withCredentials = true; + } + + try { xhr.withCredentials = params.withCredentials } + catch (e) {} + + if (params.responseType) try { xhr.responseType = params.responseType } + catch (e) {} + + xhr.open( + params.method || 'GET', + self.uri, + true + ); + + xhr.onerror = function(event) { + self.emit('error', new Error('Network error')); + }; + + self._headers = {}; + + if (params.headers) { + var keys = objectKeys(params.headers); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + if (!self.isSafeRequestHeader(key)) continue; + var value = params.headers[key]; + self.setHeader(key, value); + } + } + + if (params.auth) { + //basic auth + this.setHeader('Authorization', 'Basic ' + Base64.btoa(params.auth)); + } + + var res = new Response; + res.on('close', function () { + self.emit('close'); + }); + + res.on('ready', function () { + self.emit('response', res); + }); + + res.on('error', function (err) { + self.emit('error', err); + }); + + xhr.onreadystatechange = function () { + // Fix for IE9 bug + // SCRIPT575: Could not complete the operation due to error c00c023f + // It happens when a request is aborted, calling the success callback anyway with readyState === 4 + if (xhr.__aborted) return; + res.handle(xhr); + }; +}; + +inherits(Request, Stream); + +Request.prototype.setHeader = function (key, value) { + this._headers[key.toLowerCase()] = value +}; + +Request.prototype.getHeader = function (key) { + return this._headers[key.toLowerCase()] +}; + +Request.prototype.removeHeader = function (key) { + delete this._headers[key.toLowerCase()] +}; + +Request.prototype.write = function (s) { + this.body.push(s); +}; + +Request.prototype.destroy = function (s) { + this.xhr.__aborted = true; + this.xhr.abort(); + this.emit('close'); +}; + +Request.prototype.end = function (s) { + if (s !== undefined) this.body.push(s); + + var keys = objectKeys(this._headers); + for (var i = 0; i < keys.length; i++) { + var key = keys[i]; + var value = this._headers[key]; + if (isArray(value)) { + for (var j = 0; j < value.length; j++) { + this.xhr.setRequestHeader(key, value[j]); + } + } + else this.xhr.setRequestHeader(key, value) + } + + if (this.body.length === 0) { + this.xhr.send(''); + } + else if (typeof this.body[0] === 'string') { + this.xhr.send(this.body.join('')); + } + else if (isArray(this.body[0])) { + var body = []; + for (var i = 0; i < this.body.length; i++) { + body.push.apply(body, this.body[i]); + } + this.xhr.send(body); + } + else if (/Array/.test(Object.prototype.toString.call(this.body[0]))) { + var len = 0; + for (var i = 0; i < this.body.length; i++) { + len += this.body[i].length; + } + var body = new(this.body[0].constructor)(len); + var k = 0; + + for (var i = 0; i < this.body.length; i++) { + var b = this.body[i]; + for (var j = 0; j < b.length; j++) { + body[k++] = b[j]; + } + } + this.xhr.send(body); + } + else if (isXHR2Compatible(this.body[0])) { + this.xhr.send(this.body[0]); + } + else { + var body = ''; + for (var i = 0; i < this.body.length; i++) { + body += this.body[i].toString(); + } + this.xhr.send(body); + } +}; + +// Taken from http://dxr.mozilla.org/mozilla/mozilla-central/content/base/src/nsXMLHttpRequest.cpp.html +Request.unsafeHeaders = [ + "accept-charset", + "accept-encoding", + "access-control-request-headers", + "access-control-request-method", + "connection", + "content-length", + "cookie", + "cookie2", + "content-transfer-encoding", + "date", + "expect", + "host", + "keep-alive", + "origin", + "referer", + "te", + "trailer", + "transfer-encoding", + "upgrade", + "user-agent", + "via" +]; + +Request.prototype.isSafeRequestHeader = function (headerName) { + if (!headerName) return false; + return indexOf(Request.unsafeHeaders, headerName.toLowerCase()) === -1; +}; + +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) keys.push(key); + return keys; +}; + +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; + +var indexOf = function (xs, x) { + if (xs.indexOf) return xs.indexOf(x); + for (var i = 0; i < xs.length; i++) { + if (xs[i] === x) return i; + } + return -1; +}; + +var isXHR2Compatible = function (obj) { + if (typeof Blob !== 'undefined' && obj instanceof Blob) return true; + if (typeof ArrayBuffer !== 'undefined' && obj instanceof ArrayBuffer) return true; + if (typeof FormData !== 'undefined' && obj instanceof FormData) return true; +}; + +},{"./response":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/http-browserify/lib/response.js","Base64":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/http-browserify/node_modules/Base64/base64.js","inherits":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/inherits/inherits_browser.js","stream":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/stream-browserify/index.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/http-browserify/lib/response.js":[function(require,module,exports){ +var Stream = require('stream'); +var util = require('util'); + +var Response = module.exports = function (res) { + this.offset = 0; + this.readable = true; +}; + +util.inherits(Response, Stream); + +var capable = { + streaming : true, + status2 : true +}; + +function parseHeaders (res) { + var lines = res.getAllResponseHeaders().split(/\r?\n/); + var headers = {}; + for (var i = 0; i < lines.length; i++) { + var line = lines[i]; + if (line === '') continue; + + var m = line.match(/^([^:]+):\s*(.*)/); + if (m) { + var key = m[1].toLowerCase(), value = m[2]; + + if (headers[key] !== undefined) { + + if (isArray(headers[key])) { + headers[key].push(value); + } + else { + headers[key] = [ headers[key], value ]; + } + } + else { + headers[key] = value; + } + } + else { + headers[line] = true; + } + } + return headers; +} + +Response.prototype.getResponse = function (xhr) { + var respType = String(xhr.responseType).toLowerCase(); + if (respType === 'blob') return xhr.responseBlob || xhr.response; + if (respType === 'arraybuffer') return xhr.response; + return xhr.responseText; +} + +Response.prototype.getHeader = function (key) { + return this.headers[key.toLowerCase()]; +}; + +Response.prototype.handle = function (res) { + if (res.readyState === 2 && capable.status2) { + try { + this.statusCode = res.status; + this.headers = parseHeaders(res); + } + catch (err) { + capable.status2 = false; + } + + if (capable.status2) { + this.emit('ready'); + } + } + else if (capable.streaming && res.readyState === 3) { + try { + if (!this.statusCode) { + this.statusCode = res.status; + this.headers = parseHeaders(res); + this.emit('ready'); + } + } + catch (err) {} + + try { + this._emitData(res); + } + catch (err) { + capable.streaming = false; + } + } + else if (res.readyState === 4) { + if (!this.statusCode) { + this.statusCode = res.status; + this.emit('ready'); + } + this._emitData(res); + + if (res.error) { + this.emit('error', this.getResponse(res)); + } + else this.emit('end'); + + this.emit('close'); + } +}; + +Response.prototype._emitData = function (res) { + var respBody = this.getResponse(res); + if (respBody.toString().match(/ArrayBuffer/)) { + this.emit('data', new Uint8Array(respBody, this.offset)); + this.offset = respBody.byteLength; + return; + } + if (respBody.length > this.offset) { + this.emit('data', respBody.slice(this.offset)); + this.offset = respBody.length; + } +}; + +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; + +},{"stream":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/stream-browserify/index.js","util":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/util/util.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/http-browserify/node_modules/Base64/base64.js":[function(require,module,exports){ +;(function () { + + var object = typeof exports != 'undefined' ? exports : this; // #8: web workers + var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; + + function InvalidCharacterError(message) { + this.message = message; + } + InvalidCharacterError.prototype = new Error; + InvalidCharacterError.prototype.name = 'InvalidCharacterError'; + + // encoder + // [https://gist.github.com/999166] by [https://github.com/nignag] + object.btoa || ( + object.btoa = function (input) { + for ( + // initialize result and counter + var block, charCode, idx = 0, map = chars, output = ''; + // if the next input index does not exist: + // change the mapping table to "=" + // check if d has no fractional digits + input.charAt(idx | 0) || (map = '=', idx % 1); + // "8 - idx % 1 * 8" generates the sequence 2, 4, 6, 8 + output += map.charAt(63 & block >> 8 - idx % 1 * 8) + ) { + charCode = input.charCodeAt(idx += 3/4); + if (charCode > 0xFF) { + throw new InvalidCharacterError("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range."); + } + block = block << 8 | charCode; + } + return output; + }); + + // decoder + // [https://gist.github.com/1020396] by [https://github.com/atk] + object.atob || ( + object.atob = function (input) { + input = input.replace(/=+$/, ''); + if (input.length % 4 == 1) { + throw new InvalidCharacterError("'atob' failed: The string to be decoded is not correctly encoded."); + } + for ( + // initialize result and counters + var bc = 0, bs, buffer, idx = 0, output = ''; + // get next character + buffer = input.charAt(idx++); + // character found in table? initialize bit storage and add its ascii value; + ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer, + // and if not first of each 4 characters, + // convert the first 8 bits to one ascii character + bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0 + ) { + // try to find character in table (0-63, not found => -1) + buffer = chars.indexOf(buffer); + } + return output; + }); + +}()); + +},{}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/inherits/inherits_browser.js":[function(require,module,exports){ +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } +} + +},{}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/isarray/index.js":[function(require,module,exports){ +module.exports = Array.isArray || function (arr) { + return Object.prototype.toString.call(arr) == '[object Array]'; +}; + +},{}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/process/browser.js":[function(require,module,exports){ +// shim for using process in browser + +var process = module.exports = {}; + +process.nextTick = (function () { + var canSetImmediate = typeof window !== 'undefined' + && window.setImmediate; + var canPost = typeof window !== 'undefined' + && window.postMessage && window.addEventListener + ; + + if (canSetImmediate) { + return function (f) { return window.setImmediate(f) }; + } + + if (canPost) { + var queue = []; + window.addEventListener('message', function (ev) { + var source = ev.source; + if ((source === window || source === null) && ev.data === 'process-tick') { + ev.stopPropagation(); + if (queue.length > 0) { + var fn = queue.shift(); + fn(); + } + } + }, true); + + return function nextTick(fn) { + queue.push(fn); + window.postMessage('process-tick', '*'); + }; + } + + return function nextTick(fn) { + setTimeout(fn, 0); + }; +})(); + +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +} + +// TODO(shtylman) +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; + +},{}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/punycode/punycode.js":[function(require,module,exports){ +(function (global){ +/*! http://mths.be/punycode v1.2.4 by @mathias */ +;(function(root) { + + /** Detect free variables */ + var freeExports = typeof exports == 'object' && exports; + var freeModule = typeof module == 'object' && module && + module.exports == freeExports && module; + var freeGlobal = typeof global == 'object' && global; + if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) { + root = freeGlobal; + } + + /** + * The `punycode` object. + * @name punycode + * @type Object + */ + var punycode, + + /** Highest positive signed 32-bit float value */ + maxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1 + + /** Bootstring parameters */ + base = 36, + tMin = 1, + tMax = 26, + skew = 38, + damp = 700, + initialBias = 72, + initialN = 128, // 0x80 + delimiter = '-', // '\x2D' + + /** Regular expressions */ + regexPunycode = /^xn--/, + regexNonASCII = /[^ -~]/, // unprintable ASCII chars + non-ASCII chars + regexSeparators = /\x2E|\u3002|\uFF0E|\uFF61/g, // RFC 3490 separators + + /** Error messages */ + errors = { + 'overflow': 'Overflow: input needs wider integers to process', + 'not-basic': 'Illegal input >= 0x80 (not a basic code point)', + 'invalid-input': 'Invalid input' + }, + + /** Convenience shortcuts */ + baseMinusTMin = base - tMin, + floor = Math.floor, + stringFromCharCode = String.fromCharCode, + + /** Temporary variable */ + key; + + /*--------------------------------------------------------------------------*/ + + /** + * A generic error utility function. + * @private + * @param {String} type The error type. + * @returns {Error} Throws a `RangeError` with the applicable error message. + */ + function error(type) { + throw RangeError(errors[type]); + } + + /** + * A generic `Array#map` utility function. + * @private + * @param {Array} array The array to iterate over. + * @param {Function} callback The function that gets called for every array + * item. + * @returns {Array} A new array of values returned by the callback function. + */ + function map(array, fn) { + var length = array.length; + while (length--) { + array[length] = fn(array[length]); + } + return array; + } + + /** + * A simple `Array#map`-like wrapper to work with domain name strings. + * @private + * @param {String} domain The domain name. + * @param {Function} callback The function that gets called for every + * character. + * @returns {Array} A new string of characters returned by the callback + * function. + */ + function mapDomain(string, fn) { + return map(string.split(regexSeparators), fn).join('.'); + } + + /** + * Creates an array containing the numeric code points of each Unicode + * character in the string. While JavaScript uses UCS-2 internally, + * this function will convert a pair of surrogate halves (each of which + * UCS-2 exposes as separate characters) into a single code point, + * matching UTF-16. + * @see `punycode.ucs2.encode` + * @see + * @memberOf punycode.ucs2 + * @name decode + * @param {String} string The Unicode input string (UCS-2). + * @returns {Array} The new array of code points. + */ + function ucs2decode(string) { + var output = [], + counter = 0, + length = string.length, + value, + extra; + while (counter < length) { + value = string.charCodeAt(counter++); + if (value >= 0xD800 && value <= 0xDBFF && counter < length) { + // high surrogate, and there is a next character + extra = string.charCodeAt(counter++); + if ((extra & 0xFC00) == 0xDC00) { // low surrogate + output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000); + } else { + // unmatched surrogate; only append this code unit, in case the next + // code unit is the high surrogate of a surrogate pair + output.push(value); + counter--; + } + } else { + output.push(value); + } + } + return output; + } + + /** + * Creates a string based on an array of numeric code points. + * @see `punycode.ucs2.decode` + * @memberOf punycode.ucs2 + * @name encode + * @param {Array} codePoints The array of numeric code points. + * @returns {String} The new Unicode string (UCS-2). + */ + function ucs2encode(array) { + return map(array, function(value) { + var output = ''; + if (value > 0xFFFF) { + value -= 0x10000; + output += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800); + value = 0xDC00 | value & 0x3FF; + } + output += stringFromCharCode(value); + return output; + }).join(''); + } + + /** + * Converts a basic code point into a digit/integer. + * @see `digitToBasic()` + * @private + * @param {Number} codePoint The basic numeric code point value. + * @returns {Number} The numeric value of a basic code point (for use in + * representing integers) in the range `0` to `base - 1`, or `base` if + * the code point does not represent a value. + */ + function basicToDigit(codePoint) { + if (codePoint - 48 < 10) { + return codePoint - 22; + } + if (codePoint - 65 < 26) { + return codePoint - 65; + } + if (codePoint - 97 < 26) { + return codePoint - 97; + } + return base; + } + + /** + * Converts a digit/integer into a basic code point. + * @see `basicToDigit()` + * @private + * @param {Number} digit The numeric value of a basic code point. + * @returns {Number} The basic code point whose value (when used for + * representing integers) is `digit`, which needs to be in the range + * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is + * used; else, the lowercase form is used. The behavior is undefined + * if `flag` is non-zero and `digit` has no uppercase form. + */ + function digitToBasic(digit, flag) { + // 0..25 map to ASCII a..z or A..Z + // 26..35 map to ASCII 0..9 + return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5); + } + + /** + * Bias adaptation function as per section 3.4 of RFC 3492. + * http://tools.ietf.org/html/rfc3492#section-3.4 + * @private + */ + function adapt(delta, numPoints, firstTime) { + var k = 0; + delta = firstTime ? floor(delta / damp) : delta >> 1; + delta += floor(delta / numPoints); + for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) { + delta = floor(delta / baseMinusTMin); + } + return floor(k + (baseMinusTMin + 1) * delta / (delta + skew)); + } + + /** + * Converts a Punycode string of ASCII-only symbols to a string of Unicode + * symbols. + * @memberOf punycode + * @param {String} input The Punycode string of ASCII-only symbols. + * @returns {String} The resulting string of Unicode symbols. + */ + function decode(input) { + // Don't use UCS-2 + var output = [], + inputLength = input.length, + out, + i = 0, + n = initialN, + bias = initialBias, + basic, + j, + index, + oldi, + w, + k, + digit, + t, + /** Cached calculation results */ + baseMinusT; + + // Handle the basic code points: let `basic` be the number of input code + // points before the last delimiter, or `0` if there is none, then copy + // the first basic code points to the output. + + basic = input.lastIndexOf(delimiter); + if (basic < 0) { + basic = 0; + } + + for (j = 0; j < basic; ++j) { + // if it's not a basic code point + if (input.charCodeAt(j) >= 0x80) { + error('not-basic'); + } + output.push(input.charCodeAt(j)); + } + + // Main decoding loop: start just after the last delimiter if any basic code + // points were copied; start at the beginning otherwise. + + for (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) { + + // `index` is the index of the next character to be consumed. + // Decode a generalized variable-length integer into `delta`, + // which gets added to `i`. The overflow checking is easier + // if we increase `i` as we go, then subtract off its starting + // value at the end to obtain `delta`. + for (oldi = i, w = 1, k = base; /* no condition */; k += base) { + + if (index >= inputLength) { + error('invalid-input'); + } + + digit = basicToDigit(input.charCodeAt(index++)); + + if (digit >= base || digit > floor((maxInt - i) / w)) { + error('overflow'); + } + + i += digit * w; + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + + if (digit < t) { + break; + } + + baseMinusT = base - t; + if (w > floor(maxInt / baseMinusT)) { + error('overflow'); + } + + w *= baseMinusT; + + } + + out = output.length + 1; + bias = adapt(i - oldi, out, oldi == 0); + + // `i` was supposed to wrap around from `out` to `0`, + // incrementing `n` each time, so we'll fix that now: + if (floor(i / out) > maxInt - n) { + error('overflow'); + } + + n += floor(i / out); + i %= out; + + // Insert `n` at position `i` of the output + output.splice(i++, 0, n); + + } + + return ucs2encode(output); + } + + /** + * Converts a string of Unicode symbols to a Punycode string of ASCII-only + * symbols. + * @memberOf punycode + * @param {String} input The string of Unicode symbols. + * @returns {String} The resulting Punycode string of ASCII-only symbols. + */ + function encode(input) { + var n, + delta, + handledCPCount, + basicLength, + bias, + j, + m, + q, + k, + t, + currentValue, + output = [], + /** `inputLength` will hold the number of code points in `input`. */ + inputLength, + /** Cached calculation results */ + handledCPCountPlusOne, + baseMinusT, + qMinusT; + + // Convert the input in UCS-2 to Unicode + input = ucs2decode(input); + + // Cache the length + inputLength = input.length; + + // Initialize the state + n = initialN; + delta = 0; + bias = initialBias; + + // Handle the basic code points + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue < 0x80) { + output.push(stringFromCharCode(currentValue)); + } + } + + handledCPCount = basicLength = output.length; + + // `handledCPCount` is the number of code points that have been handled; + // `basicLength` is the number of basic code points. + + // Finish the basic string - if it is not empty - with a delimiter + if (basicLength) { + output.push(delimiter); + } + + // Main encoding loop: + while (handledCPCount < inputLength) { + + // All non-basic code points < n have been handled already. Find the next + // larger one: + for (m = maxInt, j = 0; j < inputLength; ++j) { + currentValue = input[j]; + if (currentValue >= n && currentValue < m) { + m = currentValue; + } + } + + // Increase `delta` enough to advance the decoder's state to , + // but guard against overflow + handledCPCountPlusOne = handledCPCount + 1; + if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) { + error('overflow'); + } + + delta += (m - n) * handledCPCountPlusOne; + n = m; + + for (j = 0; j < inputLength; ++j) { + currentValue = input[j]; + + if (currentValue < n && ++delta > maxInt) { + error('overflow'); + } + + if (currentValue == n) { + // Represent delta as a generalized variable-length integer + for (q = delta, k = base; /* no condition */; k += base) { + t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias); + if (q < t) { + break; + } + qMinusT = q - t; + baseMinusT = base - t; + output.push( + stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)) + ); + q = floor(qMinusT / baseMinusT); + } + + output.push(stringFromCharCode(digitToBasic(q, 0))); + bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength); + delta = 0; + ++handledCPCount; + } + } + + ++delta; + ++n; + + } + return output.join(''); + } + + /** + * Converts a Punycode string representing a domain name to Unicode. Only the + * Punycoded parts of the domain name will be converted, i.e. it doesn't + * matter if you call it on a string that has already been converted to + * Unicode. + * @memberOf punycode + * @param {String} domain The Punycode domain name to convert to Unicode. + * @returns {String} The Unicode representation of the given Punycode + * string. + */ + function toUnicode(domain) { + return mapDomain(domain, function(string) { + return regexPunycode.test(string) + ? decode(string.slice(4).toLowerCase()) + : string; + }); + } + + /** + * Converts a Unicode string representing a domain name to Punycode. Only the + * non-ASCII parts of the domain name will be converted, i.e. it doesn't + * matter if you call it with a domain that's already in ASCII. + * @memberOf punycode + * @param {String} domain The domain name to convert, as a Unicode string. + * @returns {String} The Punycode representation of the given domain name. + */ + function toASCII(domain) { + return mapDomain(domain, function(string) { + return regexNonASCII.test(string) + ? 'xn--' + encode(string) + : string; + }); + } + + /*--------------------------------------------------------------------------*/ + + /** Define the public API */ + punycode = { + /** + * A string representing the current Punycode.js version number. + * @memberOf punycode + * @type String + */ + 'version': '1.2.4', + /** + * An object of methods to convert from JavaScript's internal character + * representation (UCS-2) to Unicode code points, and back. + * @see + * @memberOf punycode + * @type Object + */ + 'ucs2': { + 'decode': ucs2decode, + 'encode': ucs2encode + }, + 'decode': decode, + 'encode': encode, + 'toASCII': toASCII, + 'toUnicode': toUnicode + }; + + /** Expose `punycode` */ + // Some AMD build optimizers, like r.js, check for specific condition patterns + // like the following: + if ( + typeof define == 'function' && + typeof define.amd == 'object' && + define.amd + ) { + define('punycode', function() { + return punycode; + }); + } else if (freeExports && !freeExports.nodeType) { + if (freeModule) { // in Node.js or RingoJS v0.8.0+ + freeModule.exports = punycode; + } else { // in Narwhal or RingoJS v0.7.0- + for (key in punycode) { + punycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]); + } + } + } else { // in Rhino or a web browser + root.punycode = punycode; + } + +}(this)); + +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/querystring-es3/decode.js":[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +// If obj.hasOwnProperty has been overridden, then calling +// obj.hasOwnProperty(prop) will break. +// See: https://github.com/joyent/node/issues/1707 +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} + +module.exports = function(qs, sep, eq, options) { + sep = sep || '&'; + eq = eq || '='; + var obj = {}; + + if (typeof qs !== 'string' || qs.length === 0) { + return obj; + } + + var regexp = /\+/g; + qs = qs.split(sep); + + var maxKeys = 1000; + if (options && typeof options.maxKeys === 'number') { + maxKeys = options.maxKeys; + } + + var len = qs.length; + // maxKeys <= 0 means that we should not limit keys count + if (maxKeys > 0 && len > maxKeys) { + len = maxKeys; + } + + for (var i = 0; i < len; ++i) { + var x = qs[i].replace(regexp, '%20'), + idx = x.indexOf(eq), + kstr, vstr, k, v; + + if (idx >= 0) { + kstr = x.substr(0, idx); + vstr = x.substr(idx + 1); + } else { + kstr = x; + vstr = ''; + } + + k = decodeURIComponent(kstr); + v = decodeURIComponent(vstr); + + if (!hasOwnProperty(obj, k)) { + obj[k] = v; + } else if (isArray(obj[k])) { + obj[k].push(v); + } else { + obj[k] = [obj[k], v]; + } + } + + return obj; +}; + +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; + +},{}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/querystring-es3/encode.js":[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +'use strict'; + +var stringifyPrimitive = function(v) { + switch (typeof v) { + case 'string': + return v; + + case 'boolean': + return v ? 'true' : 'false'; + + case 'number': + return isFinite(v) ? v : ''; + + default: + return ''; + } +}; + +module.exports = function(obj, sep, eq, name) { + sep = sep || '&'; + eq = eq || '='; + if (obj === null) { + obj = undefined; + } + + if (typeof obj === 'object') { + return map(objectKeys(obj), function(k) { + var ks = encodeURIComponent(stringifyPrimitive(k)) + eq; + if (isArray(obj[k])) { + return map(obj[k], function(v) { + return ks + encodeURIComponent(stringifyPrimitive(v)); + }).join(sep); + } else { + return ks + encodeURIComponent(stringifyPrimitive(obj[k])); + } + }).join(sep); + + } + + if (!name) return ''; + return encodeURIComponent(stringifyPrimitive(name)) + eq + + encodeURIComponent(stringifyPrimitive(obj)); +}; + +var isArray = Array.isArray || function (xs) { + return Object.prototype.toString.call(xs) === '[object Array]'; +}; + +function map (xs, f) { + if (xs.map) return xs.map(f); + var res = []; + for (var i = 0; i < xs.length; i++) { + res.push(f(xs[i], i)); + } + return res; +} + +var objectKeys = Object.keys || function (obj) { + var res = []; + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) res.push(key); + } + return res; +}; + +},{}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/querystring-es3/index.js":[function(require,module,exports){ +'use strict'; + +exports.decode = exports.parse = require('./decode'); +exports.encode = exports.stringify = require('./encode'); + +},{"./decode":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/querystring-es3/decode.js","./encode":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/querystring-es3/encode.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/duplex.js":[function(require,module,exports){ +module.exports = require("./lib/_stream_duplex.js") + +},{"./lib/_stream_duplex.js":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_duplex.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_duplex.js":[function(require,module,exports){ +(function (process){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a duplex stream is just a stream that is both readable and writable. +// Since JS doesn't have multiple prototypal inheritance, this class +// prototypally inherits from Readable, and then parasitically from +// Writable. + +module.exports = Duplex; + +/**/ +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) keys.push(key); + return keys; +} +/**/ + + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +var Readable = require('./_stream_readable'); +var Writable = require('./_stream_writable'); + +util.inherits(Duplex, Readable); + +forEach(objectKeys(Writable.prototype), function(method) { + if (!Duplex.prototype[method]) + Duplex.prototype[method] = Writable.prototype[method]; +}); + +function Duplex(options) { + if (!(this instanceof Duplex)) + return new Duplex(options); + + Readable.call(this, options); + Writable.call(this, options); + + if (options && options.readable === false) + this.readable = false; + + if (options && options.writable === false) + this.writable = false; + + this.allowHalfOpen = true; + if (options && options.allowHalfOpen === false) + this.allowHalfOpen = false; + + this.once('end', onend); +} + +// the no-half-open enforcer +function onend() { + // if we allow half-open state, or if the writable side ended, + // then we're ok. + if (this.allowHalfOpen || this._writableState.ended) + return; + + // no more data can be written. + // But allow more writes to happen in this tick. + process.nextTick(this.end.bind(this)); +} + +function forEach (xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} + +}).call(this,require('_process')) +},{"./_stream_readable":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_readable.js","./_stream_writable":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_writable.js","_process":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/process/browser.js","core-util-is":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/node_modules/core-util-is/lib/util.js","inherits":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/inherits/inherits_browser.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_passthrough.js":[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// a passthrough stream. +// basically just the most minimal sort of Transform stream. +// Every written chunk gets output as-is. + +module.exports = PassThrough; + +var Transform = require('./_stream_transform'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(PassThrough, Transform); + +function PassThrough(options) { + if (!(this instanceof PassThrough)) + return new PassThrough(options); + + Transform.call(this, options); +} + +PassThrough.prototype._transform = function(chunk, encoding, cb) { + cb(null, chunk); +}; + +},{"./_stream_transform":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_transform.js","core-util-is":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/node_modules/core-util-is/lib/util.js","inherits":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/inherits/inherits_browser.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_readable.js":[function(require,module,exports){ +(function (process){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +module.exports = Readable; + +/**/ +var isArray = require('isarray'); +/**/ + + +/**/ +var Buffer = require('buffer').Buffer; +/**/ + +Readable.ReadableState = ReadableState; + +var EE = require('events').EventEmitter; + +/**/ +if (!EE.listenerCount) EE.listenerCount = function(emitter, type) { + return emitter.listeners(type).length; +}; +/**/ + +var Stream = require('stream'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +var StringDecoder; + + +/**/ +var debug = require('util'); +if (debug && debug.debuglog) { + debug = debug.debuglog('stream'); +} else { + debug = function () {}; +} +/**/ + + +util.inherits(Readable, Stream); + +function ReadableState(options, stream) { + var Duplex = require('./_stream_duplex'); + + options = options || {}; + + // the point at which it stops calling _read() to fill the buffer + // Note: 0 is a valid value, means "don't call _read preemptively ever" + var hwm = options.highWaterMark; + var defaultHwm = options.objectMode ? 16 : 16 * 1024; + this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm; + + // cast to ints. + this.highWaterMark = ~~this.highWaterMark; + + this.buffer = []; + this.length = 0; + this.pipes = null; + this.pipesCount = 0; + this.flowing = null; + this.ended = false; + this.endEmitted = false; + this.reading = false; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // whenever we return null, then we set a flag to say + // that we're awaiting a 'readable' event emission. + this.needReadable = false; + this.emittedReadable = false; + this.readableListening = false; + + + // object stream flag. Used to make read(n) ignore n and to + // make all the buffer merging and length checks go away + this.objectMode = !!options.objectMode; + + if (stream instanceof Duplex) + this.objectMode = this.objectMode || !!options.readableObjectMode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // when piping, we only care about 'readable' events that happen + // after read()ing all the bytes and not getting any pushback. + this.ranOut = false; + + // the number of writers that are awaiting a drain event in .pipe()s + this.awaitDrain = 0; + + // if true, a maybeReadMore has been scheduled + this.readingMore = false; + + this.decoder = null; + this.encoding = null; + if (options.encoding) { + if (!StringDecoder) + StringDecoder = require('string_decoder/').StringDecoder; + this.decoder = new StringDecoder(options.encoding); + this.encoding = options.encoding; + } +} + +function Readable(options) { + var Duplex = require('./_stream_duplex'); + + if (!(this instanceof Readable)) + return new Readable(options); + + this._readableState = new ReadableState(options, this); + + // legacy + this.readable = true; + + Stream.call(this); +} + +// Manually shove something into the read() buffer. +// This returns true if the highWaterMark has not been hit yet, +// similar to how Writable.write() returns true if you should +// write() some more. +Readable.prototype.push = function(chunk, encoding) { + var state = this._readableState; + + if (util.isString(chunk) && !state.objectMode) { + encoding = encoding || state.defaultEncoding; + if (encoding !== state.encoding) { + chunk = new Buffer(chunk, encoding); + encoding = ''; + } + } + + return readableAddChunk(this, state, chunk, encoding, false); +}; + +// Unshift should *always* be something directly out of read() +Readable.prototype.unshift = function(chunk) { + var state = this._readableState; + return readableAddChunk(this, state, chunk, '', true); +}; + +function readableAddChunk(stream, state, chunk, encoding, addToFront) { + var er = chunkInvalid(state, chunk); + if (er) { + stream.emit('error', er); + } else if (util.isNullOrUndefined(chunk)) { + state.reading = false; + if (!state.ended) + onEofChunk(stream, state); + } else if (state.objectMode || chunk && chunk.length > 0) { + if (state.ended && !addToFront) { + var e = new Error('stream.push() after EOF'); + stream.emit('error', e); + } else if (state.endEmitted && addToFront) { + var e = new Error('stream.unshift() after end event'); + stream.emit('error', e); + } else { + if (state.decoder && !addToFront && !encoding) + chunk = state.decoder.write(chunk); + + if (!addToFront) + state.reading = false; + + // if we want the data now, just emit it. + if (state.flowing && state.length === 0 && !state.sync) { + stream.emit('data', chunk); + stream.read(0); + } else { + // update the buffer info. + state.length += state.objectMode ? 1 : chunk.length; + if (addToFront) + state.buffer.unshift(chunk); + else + state.buffer.push(chunk); + + if (state.needReadable) + emitReadable(stream); + } + + maybeReadMore(stream, state); + } + } else if (!addToFront) { + state.reading = false; + } + + return needMoreData(state); +} + + + +// if it's past the high water mark, we can push in some more. +// Also, if we have no data yet, we can stand some +// more bytes. This is to work around cases where hwm=0, +// such as the repl. Also, if the push() triggered a +// readable event, and the user called read(largeNumber) such that +// needReadable was set, then we ought to push more, so that another +// 'readable' event will be triggered. +function needMoreData(state) { + return !state.ended && + (state.needReadable || + state.length < state.highWaterMark || + state.length === 0); +} + +// backwards compatibility. +Readable.prototype.setEncoding = function(enc) { + if (!StringDecoder) + StringDecoder = require('string_decoder/').StringDecoder; + this._readableState.decoder = new StringDecoder(enc); + this._readableState.encoding = enc; + return this; +}; + +// Don't raise the hwm > 128MB +var MAX_HWM = 0x800000; +function roundUpToNextPowerOf2(n) { + if (n >= MAX_HWM) { + n = MAX_HWM; + } else { + // Get the next highest power of 2 + n--; + for (var p = 1; p < 32; p <<= 1) n |= n >> p; + n++; + } + return n; +} + +function howMuchToRead(n, state) { + if (state.length === 0 && state.ended) + return 0; + + if (state.objectMode) + return n === 0 ? 0 : 1; + + if (isNaN(n) || util.isNull(n)) { + // only flow one buffer at a time + if (state.flowing && state.buffer.length) + return state.buffer[0].length; + else + return state.length; + } + + if (n <= 0) + return 0; + + // If we're asking for more than the target buffer level, + // then raise the water mark. Bump up to the next highest + // power of 2, to prevent increasing it excessively in tiny + // amounts. + if (n > state.highWaterMark) + state.highWaterMark = roundUpToNextPowerOf2(n); + + // don't have that much. return null, unless we've ended. + if (n > state.length) { + if (!state.ended) { + state.needReadable = true; + return 0; + } else + return state.length; + } + + return n; +} + +// you can override either this method, or the async _read(n) below. +Readable.prototype.read = function(n) { + debug('read', n); + var state = this._readableState; + var nOrig = n; + + if (!util.isNumber(n) || n > 0) + state.emittedReadable = false; + + // if we're doing read(0) to trigger a readable event, but we + // already have a bunch of data in the buffer, then just trigger + // the 'readable' event and move on. + if (n === 0 && + state.needReadable && + (state.length >= state.highWaterMark || state.ended)) { + debug('read: emitReadable', state.length, state.ended); + if (state.length === 0 && state.ended) + endReadable(this); + else + emitReadable(this); + return null; + } + + n = howMuchToRead(n, state); + + // if we've ended, and we're now clear, then finish it up. + if (n === 0 && state.ended) { + if (state.length === 0) + endReadable(this); + return null; + } + + // All the actual chunk generation logic needs to be + // *below* the call to _read. The reason is that in certain + // synthetic stream cases, such as passthrough streams, _read + // may be a completely synchronous operation which may change + // the state of the read buffer, providing enough data when + // before there was *not* enough. + // + // So, the steps are: + // 1. Figure out what the state of things will be after we do + // a read from the buffer. + // + // 2. If that resulting state will trigger a _read, then call _read. + // Note that this may be asynchronous, or synchronous. Yes, it is + // deeply ugly to write APIs this way, but that still doesn't mean + // that the Readable class should behave improperly, as streams are + // designed to be sync/async agnostic. + // Take note if the _read call is sync or async (ie, if the read call + // has returned yet), so that we know whether or not it's safe to emit + // 'readable' etc. + // + // 3. Actually pull the requested chunks out of the buffer and return. + + // if we need a readable event, then we need to do some reading. + var doRead = state.needReadable; + debug('need readable', doRead); + + // if we currently have less than the highWaterMark, then also read some + if (state.length === 0 || state.length - n < state.highWaterMark) { + doRead = true; + debug('length less than watermark', doRead); + } + + // however, if we've ended, then there's no point, and if we're already + // reading, then it's unnecessary. + if (state.ended || state.reading) { + doRead = false; + debug('reading or ended', doRead); + } + + if (doRead) { + debug('do read'); + state.reading = true; + state.sync = true; + // if the length is currently zero, then we *need* a readable event. + if (state.length === 0) + state.needReadable = true; + // call internal read method + this._read(state.highWaterMark); + state.sync = false; + } + + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (doRead && !state.reading) + n = howMuchToRead(nOrig, state); + + var ret; + if (n > 0) + ret = fromList(n, state); + else + ret = null; + + if (util.isNull(ret)) { + state.needReadable = true; + n = 0; + } + + state.length -= n; + + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (state.length === 0 && !state.ended) + state.needReadable = true; + + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended && state.length === 0) + endReadable(this); + + if (!util.isNull(ret)) + this.emit('data', ret); + + return ret; +}; + +function chunkInvalid(state, chunk) { + var er = null; + if (!util.isBuffer(chunk) && + !util.isString(chunk) && + !util.isNullOrUndefined(chunk) && + !state.objectMode) { + er = new TypeError('Invalid non-string/buffer chunk'); + } + return er; +} + + +function onEofChunk(stream, state) { + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) { + state.buffer.push(chunk); + state.length += state.objectMode ? 1 : chunk.length; + } + } + state.ended = true; + + // emit 'readable' now to make sure it gets picked up. + emitReadable(stream); +} + +// Don't emit readable right away in sync mode, because this can trigger +// another read() call => stack overflow. This way, it might trigger +// a nextTick recursion warning, but that's not so bad. +function emitReadable(stream) { + var state = stream._readableState; + state.needReadable = false; + if (!state.emittedReadable) { + debug('emitReadable', state.flowing); + state.emittedReadable = true; + if (state.sync) + process.nextTick(function() { + emitReadable_(stream); + }); + else + emitReadable_(stream); + } +} + +function emitReadable_(stream) { + debug('emit readable'); + stream.emit('readable'); + flow(stream); +} + + +// at this point, the user has presumably seen the 'readable' event, +// and called read() to consume some data. that may have triggered +// in turn another _read(n) call, in which case reading = true if +// it's in progress. +// However, if we're not ended, or reading, and the length < hwm, +// then go ahead and try to read some more preemptively. +function maybeReadMore(stream, state) { + if (!state.readingMore) { + state.readingMore = true; + process.nextTick(function() { + maybeReadMore_(stream, state); + }); + } +} + +function maybeReadMore_(stream, state) { + var len = state.length; + while (!state.reading && !state.flowing && !state.ended && + state.length < state.highWaterMark) { + debug('maybeReadMore read 0'); + stream.read(0); + if (len === state.length) + // didn't get any data, stop spinning. + break; + else + len = state.length; + } + state.readingMore = false; +} + +// abstract method. to be overridden in specific implementation classes. +// call cb(er, data) where data is <= n in length. +// for virtual (non-string, non-buffer) streams, "length" is somewhat +// arbitrary, and perhaps not very meaningful. +Readable.prototype._read = function(n) { + this.emit('error', new Error('not implemented')); +}; + +Readable.prototype.pipe = function(dest, pipeOpts) { + var src = this; + var state = this._readableState; + + switch (state.pipesCount) { + case 0: + state.pipes = dest; + break; + case 1: + state.pipes = [state.pipes, dest]; + break; + default: + state.pipes.push(dest); + break; + } + state.pipesCount += 1; + debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); + + var doEnd = (!pipeOpts || pipeOpts.end !== false) && + dest !== process.stdout && + dest !== process.stderr; + + var endFn = doEnd ? onend : cleanup; + if (state.endEmitted) + process.nextTick(endFn); + else + src.once('end', endFn); + + dest.on('unpipe', onunpipe); + function onunpipe(readable) { + debug('onunpipe'); + if (readable === src) { + cleanup(); + } + } + + function onend() { + debug('onend'); + dest.end(); + } + + // when the dest drains, it reduces the awaitDrain counter + // on the source. This would be more elegant with a .once() + // handler in flow(), but adding and removing repeatedly is + // too slow. + var ondrain = pipeOnDrain(src); + dest.on('drain', ondrain); + + function cleanup() { + debug('cleanup'); + // cleanup event handlers once the pipe is broken + dest.removeListener('close', onclose); + dest.removeListener('finish', onfinish); + dest.removeListener('drain', ondrain); + dest.removeListener('error', onerror); + dest.removeListener('unpipe', onunpipe); + src.removeListener('end', onend); + src.removeListener('end', cleanup); + src.removeListener('data', ondata); + + // if the reader is waiting for a drain event from this + // specific writer, then it would cause it to never start + // flowing again. + // So, if this is awaiting a drain, then we just call it now. + // If we don't know, then assume that we are waiting for one. + if (state.awaitDrain && + (!dest._writableState || dest._writableState.needDrain)) + ondrain(); + } + + src.on('data', ondata); + function ondata(chunk) { + debug('ondata'); + var ret = dest.write(chunk); + if (false === ret) { + debug('false write response, pause', + src._readableState.awaitDrain); + src._readableState.awaitDrain++; + src.pause(); + } + } + + // if the dest has an error, then stop piping into it. + // however, don't suppress the throwing behavior for this. + function onerror(er) { + debug('onerror', er); + unpipe(); + dest.removeListener('error', onerror); + if (EE.listenerCount(dest, 'error') === 0) + dest.emit('error', er); + } + // This is a brutally ugly hack to make sure that our error handler + // is attached before any userland ones. NEVER DO THIS. + if (!dest._events || !dest._events.error) + dest.on('error', onerror); + else if (isArray(dest._events.error)) + dest._events.error.unshift(onerror); + else + dest._events.error = [onerror, dest._events.error]; + + + + // Both close and finish should trigger unpipe, but only once. + function onclose() { + dest.removeListener('finish', onfinish); + unpipe(); + } + dest.once('close', onclose); + function onfinish() { + debug('onfinish'); + dest.removeListener('close', onclose); + unpipe(); + } + dest.once('finish', onfinish); + + function unpipe() { + debug('unpipe'); + src.unpipe(dest); + } + + // tell the dest that it's being piped to + dest.emit('pipe', src); + + // start the flow if it hasn't been started already. + if (!state.flowing) { + debug('pipe resume'); + src.resume(); + } + + return dest; +}; + +function pipeOnDrain(src) { + return function() { + var state = src._readableState; + debug('pipeOnDrain', state.awaitDrain); + if (state.awaitDrain) + state.awaitDrain--; + if (state.awaitDrain === 0 && EE.listenerCount(src, 'data')) { + state.flowing = true; + flow(src); + } + }; +} + + +Readable.prototype.unpipe = function(dest) { + var state = this._readableState; + + // if we're not piping anywhere, then do nothing. + if (state.pipesCount === 0) + return this; + + // just one destination. most common case. + if (state.pipesCount === 1) { + // passed in one, but it's not the right one. + if (dest && dest !== state.pipes) + return this; + + if (!dest) + dest = state.pipes; + + // got a match. + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + if (dest) + dest.emit('unpipe', this); + return this; + } + + // slow case. multiple pipe destinations. + + if (!dest) { + // remove all. + var dests = state.pipes; + var len = state.pipesCount; + state.pipes = null; + state.pipesCount = 0; + state.flowing = false; + + for (var i = 0; i < len; i++) + dests[i].emit('unpipe', this); + return this; + } + + // try to find the right one. + var i = indexOf(state.pipes, dest); + if (i === -1) + return this; + + state.pipes.splice(i, 1); + state.pipesCount -= 1; + if (state.pipesCount === 1) + state.pipes = state.pipes[0]; + + dest.emit('unpipe', this); + + return this; +}; + +// set up data events if they are asked for +// Ensure readable listeners eventually get something +Readable.prototype.on = function(ev, fn) { + var res = Stream.prototype.on.call(this, ev, fn); + + // If listening to data, and it has not explicitly been paused, + // then call resume to start the flow of data on the next tick. + if (ev === 'data' && false !== this._readableState.flowing) { + this.resume(); + } + + if (ev === 'readable' && this.readable) { + var state = this._readableState; + if (!state.readableListening) { + state.readableListening = true; + state.emittedReadable = false; + state.needReadable = true; + if (!state.reading) { + var self = this; + process.nextTick(function() { + debug('readable nexttick read 0'); + self.read(0); + }); + } else if (state.length) { + emitReadable(this, state); + } + } + } + + return res; +}; +Readable.prototype.addListener = Readable.prototype.on; + +// pause() and resume() are remnants of the legacy readable stream API +// If the user uses them, then switch into old mode. +Readable.prototype.resume = function() { + var state = this._readableState; + if (!state.flowing) { + debug('resume'); + state.flowing = true; + if (!state.reading) { + debug('resume read 0'); + this.read(0); + } + resume(this, state); + } + return this; +}; + +function resume(stream, state) { + if (!state.resumeScheduled) { + state.resumeScheduled = true; + process.nextTick(function() { + resume_(stream, state); + }); + } +} + +function resume_(stream, state) { + state.resumeScheduled = false; + stream.emit('resume'); + flow(stream); + if (state.flowing && !state.reading) + stream.read(0); +} + +Readable.prototype.pause = function() { + debug('call pause flowing=%j', this._readableState.flowing); + if (false !== this._readableState.flowing) { + debug('pause'); + this._readableState.flowing = false; + this.emit('pause'); + } + return this; +}; + +function flow(stream) { + var state = stream._readableState; + debug('flow', state.flowing); + if (state.flowing) { + do { + var chunk = stream.read(); + } while (null !== chunk && state.flowing); + } +} + +// wrap an old-style stream as the async data source. +// This is *not* part of the readable stream interface. +// It is an ugly unfortunate mess of history. +Readable.prototype.wrap = function(stream) { + var state = this._readableState; + var paused = false; + + var self = this; + stream.on('end', function() { + debug('wrapped end'); + if (state.decoder && !state.ended) { + var chunk = state.decoder.end(); + if (chunk && chunk.length) + self.push(chunk); + } + + self.push(null); + }); + + stream.on('data', function(chunk) { + debug('wrapped data'); + if (state.decoder) + chunk = state.decoder.write(chunk); + if (!chunk || !state.objectMode && !chunk.length) + return; + + var ret = self.push(chunk); + if (!ret) { + paused = true; + stream.pause(); + } + }); + + // proxy all the other methods. + // important when wrapping filters and duplexes. + for (var i in stream) { + if (util.isFunction(stream[i]) && util.isUndefined(this[i])) { + this[i] = function(method) { return function() { + return stream[method].apply(stream, arguments); + }}(i); + } + } + + // proxy certain important events. + var events = ['error', 'close', 'destroy', 'pause', 'resume']; + forEach(events, function(ev) { + stream.on(ev, self.emit.bind(self, ev)); + }); + + // when we try to consume some more bytes, simply unpause the + // underlying stream. + self._read = function(n) { + debug('wrapped _read', n); + if (paused) { + paused = false; + stream.resume(); + } + }; + + return self; +}; + + + +// exposed for testing purposes only. +Readable._fromList = fromList; + +// Pluck off n bytes from an array of buffers. +// Length is the combined lengths of all the buffers in the list. +function fromList(n, state) { + var list = state.buffer; + var length = state.length; + var stringMode = !!state.decoder; + var objectMode = !!state.objectMode; + var ret; + + // nothing in the list, definitely empty. + if (list.length === 0) + return null; + + if (length === 0) + ret = null; + else if (objectMode) + ret = list.shift(); + else if (!n || n >= length) { + // read it all, truncate the array. + if (stringMode) + ret = list.join(''); + else + ret = Buffer.concat(list, length); + list.length = 0; + } else { + // read just some of it. + if (n < list[0].length) { + // just take a part of the first list item. + // slice is the same for buffers and strings. + var buf = list[0]; + ret = buf.slice(0, n); + list[0] = buf.slice(n); + } else if (n === list[0].length) { + // first list is a perfect match + ret = list.shift(); + } else { + // complex case. + // we have enough to cover it, but it spans past the first buffer. + if (stringMode) + ret = ''; + else + ret = new Buffer(n); + + var c = 0; + for (var i = 0, l = list.length; i < l && c < n; i++) { + var buf = list[0]; + var cpy = Math.min(n - c, buf.length); + + if (stringMode) + ret += buf.slice(0, cpy); + else + buf.copy(ret, c, 0, cpy); + + if (cpy < buf.length) + list[0] = buf.slice(cpy); + else + list.shift(); + + c += cpy; + } + } + } + + return ret; +} + +function endReadable(stream) { + var state = stream._readableState; + + // If we get here before consuming all the bytes, then that is a + // bug in node. Should never happen. + if (state.length > 0) + throw new Error('endReadable called on non-empty stream'); + + if (!state.endEmitted) { + state.ended = true; + process.nextTick(function() { + // Check that we didn't get one last unshift. + if (!state.endEmitted && state.length === 0) { + state.endEmitted = true; + stream.readable = false; + stream.emit('end'); + } + }); + } +} + +function forEach (xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} + +function indexOf (xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} + +}).call(this,require('_process')) +},{"./_stream_duplex":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_duplex.js","_process":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/process/browser.js","buffer":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/buffer/index.js","core-util-is":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/node_modules/core-util-is/lib/util.js","events":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/events/events.js","inherits":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/inherits/inherits_browser.js","isarray":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/isarray/index.js","stream":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/stream-browserify/index.js","string_decoder/":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/node_modules/string_decoder/index.js","util":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/browser-resolve/empty.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_transform.js":[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + + +// a transform stream is a readable/writable stream where you do +// something with the data. Sometimes it's called a "filter", +// but that's not a great name for it, since that implies a thing where +// some bits pass through, and others are simply ignored. (That would +// be a valid example of a transform, of course.) +// +// While the output is causally related to the input, it's not a +// necessarily symmetric or synchronous transformation. For example, +// a zlib stream might take multiple plain-text writes(), and then +// emit a single compressed chunk some time in the future. +// +// Here's how this works: +// +// The Transform stream has all the aspects of the readable and writable +// stream classes. When you write(chunk), that calls _write(chunk,cb) +// internally, and returns false if there's a lot of pending writes +// buffered up. When you call read(), that calls _read(n) until +// there's enough pending readable data buffered up. +// +// In a transform stream, the written data is placed in a buffer. When +// _read(n) is called, it transforms the queued up data, calling the +// buffered _write cb's as it consumes chunks. If consuming a single +// written chunk would result in multiple output chunks, then the first +// outputted bit calls the readcb, and subsequent chunks just go into +// the read buffer, and will cause it to emit 'readable' if necessary. +// +// This way, back-pressure is actually determined by the reading side, +// since _read has to be called to start processing a new chunk. However, +// a pathological inflate type of transform can cause excessive buffering +// here. For example, imagine a stream where every byte of input is +// interpreted as an integer from 0-255, and then results in that many +// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in +// 1kb of data being output. In this case, you could write a very small +// amount of input, and end up with a very large amount of output. In +// such a pathological inflating mechanism, there'd be no way to tell +// the system to stop doing the transform. A single 4MB write could +// cause the system to run out of memory. +// +// However, even in such a pathological case, only a single written chunk +// would be consumed, and then the rest would wait (un-transformed) until +// the results of the previous transformed chunk were consumed. + +module.exports = Transform; + +var Duplex = require('./_stream_duplex'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +util.inherits(Transform, Duplex); + + +function TransformState(options, stream) { + this.afterTransform = function(er, data) { + return afterTransform(stream, er, data); + }; + + this.needTransform = false; + this.transforming = false; + this.writecb = null; + this.writechunk = null; +} + +function afterTransform(stream, er, data) { + var ts = stream._transformState; + ts.transforming = false; + + var cb = ts.writecb; + + if (!cb) + return stream.emit('error', new Error('no writecb in Transform class')); + + ts.writechunk = null; + ts.writecb = null; + + if (!util.isNullOrUndefined(data)) + stream.push(data); + + if (cb) + cb(er); + + var rs = stream._readableState; + rs.reading = false; + if (rs.needReadable || rs.length < rs.highWaterMark) { + stream._read(rs.highWaterMark); + } +} + + +function Transform(options) { + if (!(this instanceof Transform)) + return new Transform(options); + + Duplex.call(this, options); + + this._transformState = new TransformState(options, this); + + // when the writable side finishes, then flush out anything remaining. + var stream = this; + + // start out asking for a readable event once data is transformed. + this._readableState.needReadable = true; + + // we have implemented the _read method, and done the other things + // that Readable wants before the first _read call, so unset the + // sync guard flag. + this._readableState.sync = false; + + this.once('prefinish', function() { + if (util.isFunction(this._flush)) + this._flush(function(er) { + done(stream, er); + }); + else + done(stream); + }); +} + +Transform.prototype.push = function(chunk, encoding) { + this._transformState.needTransform = false; + return Duplex.prototype.push.call(this, chunk, encoding); +}; + +// This is the part where you do stuff! +// override this function in implementation classes. +// 'chunk' is an input chunk. +// +// Call `push(newChunk)` to pass along transformed output +// to the readable side. You may call 'push' zero or more times. +// +// Call `cb(err)` when you are done with this chunk. If you pass +// an error, then that'll put the hurt on the whole operation. If you +// never call cb(), then you'll never get another chunk. +Transform.prototype._transform = function(chunk, encoding, cb) { + throw new Error('not implemented'); +}; + +Transform.prototype._write = function(chunk, encoding, cb) { + var ts = this._transformState; + ts.writecb = cb; + ts.writechunk = chunk; + ts.writeencoding = encoding; + if (!ts.transforming) { + var rs = this._readableState; + if (ts.needTransform || + rs.needReadable || + rs.length < rs.highWaterMark) + this._read(rs.highWaterMark); + } +}; + +// Doesn't matter what the args are here. +// _transform does all the work. +// That we got here means that the readable side wants more data. +Transform.prototype._read = function(n) { + var ts = this._transformState; + + if (!util.isNull(ts.writechunk) && ts.writecb && !ts.transforming) { + ts.transforming = true; + this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); + } else { + // mark that we need a transform, so that any data that comes in + // will get processed, now that we've asked for it. + ts.needTransform = true; + } +}; + + +function done(stream, er) { + if (er) + return stream.emit('error', er); + + // if there's nothing in the write buffer, then that means + // that nothing more will ever be provided + var ws = stream._writableState; + var ts = stream._transformState; + + if (ws.length) + throw new Error('calling transform done when ws.length != 0'); + + if (ts.transforming) + throw new Error('calling transform done when still transforming'); + + return stream.push(null); +} + +},{"./_stream_duplex":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_duplex.js","core-util-is":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/node_modules/core-util-is/lib/util.js","inherits":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/inherits/inherits_browser.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_writable.js":[function(require,module,exports){ +(function (process){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// A bit simpler than readable streams. +// Implement an async ._write(chunk, cb), and it'll handle all +// the drain event emission and buffering. + +module.exports = Writable; + +/**/ +var Buffer = require('buffer').Buffer; +/**/ + +Writable.WritableState = WritableState; + + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + +var Stream = require('stream'); + +util.inherits(Writable, Stream); + +function WriteReq(chunk, encoding, cb) { + this.chunk = chunk; + this.encoding = encoding; + this.callback = cb; +} + +function WritableState(options, stream) { + var Duplex = require('./_stream_duplex'); + + options = options || {}; + + // the point at which write() starts returning false + // Note: 0 is a valid value, means that we always return false if + // the entire buffer is not flushed immediately on write() + var hwm = options.highWaterMark; + var defaultHwm = options.objectMode ? 16 : 16 * 1024; + this.highWaterMark = (hwm || hwm === 0) ? hwm : defaultHwm; + + // object stream flag to indicate whether or not this stream + // contains buffers or objects. + this.objectMode = !!options.objectMode; + + if (stream instanceof Duplex) + this.objectMode = this.objectMode || !!options.writableObjectMode; + + // cast to ints. + this.highWaterMark = ~~this.highWaterMark; + + this.needDrain = false; + // at the start of calling end() + this.ending = false; + // when end() has been called, and returned + this.ended = false; + // when 'finish' is emitted + this.finished = false; + + // should we decode strings into buffers before passing to _write? + // this is here so that some node-core streams can optimize string + // handling at a lower level. + var noDecode = options.decodeStrings === false; + this.decodeStrings = !noDecode; + + // Crypto is kind of old and crusty. Historically, its default string + // encoding is 'binary' so we have to make this configurable. + // Everything else in the universe uses 'utf8', though. + this.defaultEncoding = options.defaultEncoding || 'utf8'; + + // not an actual buffer we keep track of, but a measurement + // of how much we're waiting to get pushed to some underlying + // socket or file. + this.length = 0; + + // a flag to see when we're in the middle of a write. + this.writing = false; + + // when true all writes will be buffered until .uncork() call + this.corked = 0; + + // a flag to be able to tell if the onwrite cb is called immediately, + // or on a later tick. We set this to true at first, because any + // actions that shouldn't happen until "later" should generally also + // not happen before the first write call. + this.sync = true; + + // a flag to know if we're processing previously buffered items, which + // may call the _write() callback in the same tick, so that we don't + // end up in an overlapped onwrite situation. + this.bufferProcessing = false; + + // the callback that's passed to _write(chunk,cb) + this.onwrite = function(er) { + onwrite(stream, er); + }; + + // the callback that the user supplies to write(chunk,encoding,cb) + this.writecb = null; + + // the amount that is being written when _write is called. + this.writelen = 0; + + this.buffer = []; + + // number of pending user-supplied write callbacks + // this must be 0 before 'finish' can be emitted + this.pendingcb = 0; + + // emit prefinish if the only thing we're waiting for is _write cbs + // This is relevant for synchronous Transform streams + this.prefinished = false; + + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; +} + +function Writable(options) { + var Duplex = require('./_stream_duplex'); + + // Writable ctor is applied to Duplexes, though they're not + // instanceof Writable, they're instanceof Readable. + if (!(this instanceof Writable) && !(this instanceof Duplex)) + return new Writable(options); + + this._writableState = new WritableState(options, this); + + // legacy. + this.writable = true; + + Stream.call(this); +} + +// Otherwise people can pipe Writable streams, which is just wrong. +Writable.prototype.pipe = function() { + this.emit('error', new Error('Cannot pipe. Not readable.')); +}; + + +function writeAfterEnd(stream, state, cb) { + var er = new Error('write after end'); + // TODO: defer error events consistently everywhere, not just the cb + stream.emit('error', er); + process.nextTick(function() { + cb(er); + }); +} + +// If we get something that is not a buffer, string, null, or undefined, +// and we're not in objectMode, then that's an error. +// Otherwise stream chunks are all considered to be of length=1, and the +// watermarks determine how many objects to keep in the buffer, rather than +// how many bytes or characters. +function validChunk(stream, state, chunk, cb) { + var valid = true; + if (!util.isBuffer(chunk) && + !util.isString(chunk) && + !util.isNullOrUndefined(chunk) && + !state.objectMode) { + var er = new TypeError('Invalid non-string/buffer chunk'); + stream.emit('error', er); + process.nextTick(function() { + cb(er); + }); + valid = false; + } + return valid; +} + +Writable.prototype.write = function(chunk, encoding, cb) { + var state = this._writableState; + var ret = false; + + if (util.isFunction(encoding)) { + cb = encoding; + encoding = null; + } + + if (util.isBuffer(chunk)) + encoding = 'buffer'; + else if (!encoding) + encoding = state.defaultEncoding; + + if (!util.isFunction(cb)) + cb = function() {}; + + if (state.ended) + writeAfterEnd(this, state, cb); + else if (validChunk(this, state, chunk, cb)) { + state.pendingcb++; + ret = writeOrBuffer(this, state, chunk, encoding, cb); + } + + return ret; +}; + +Writable.prototype.cork = function() { + var state = this._writableState; + + state.corked++; +}; + +Writable.prototype.uncork = function() { + var state = this._writableState; + + if (state.corked) { + state.corked--; + + if (!state.writing && + !state.corked && + !state.finished && + !state.bufferProcessing && + state.buffer.length) + clearBuffer(this, state); + } +}; + +function decodeChunk(state, chunk, encoding) { + if (!state.objectMode && + state.decodeStrings !== false && + util.isString(chunk)) { + chunk = new Buffer(chunk, encoding); + } + return chunk; +} + +// if we're already writing something, then just put this +// in the queue, and wait our turn. Otherwise, call _write +// If we return false, then we need a drain event, so set that flag. +function writeOrBuffer(stream, state, chunk, encoding, cb) { + chunk = decodeChunk(state, chunk, encoding); + if (util.isBuffer(chunk)) + encoding = 'buffer'; + var len = state.objectMode ? 1 : chunk.length; + + state.length += len; + + var ret = state.length < state.highWaterMark; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) + state.needDrain = true; + + if (state.writing || state.corked) + state.buffer.push(new WriteReq(chunk, encoding, cb)); + else + doWrite(stream, state, false, len, chunk, encoding, cb); + + return ret; +} + +function doWrite(stream, state, writev, len, chunk, encoding, cb) { + state.writelen = len; + state.writecb = cb; + state.writing = true; + state.sync = true; + if (writev) + stream._writev(chunk, state.onwrite); + else + stream._write(chunk, encoding, state.onwrite); + state.sync = false; +} + +function onwriteError(stream, state, sync, er, cb) { + if (sync) + process.nextTick(function() { + state.pendingcb--; + cb(er); + }); + else { + state.pendingcb--; + cb(er); + } + + stream._writableState.errorEmitted = true; + stream.emit('error', er); +} + +function onwriteStateUpdate(state) { + state.writing = false; + state.writecb = null; + state.length -= state.writelen; + state.writelen = 0; +} + +function onwrite(stream, er) { + var state = stream._writableState; + var sync = state.sync; + var cb = state.writecb; + + onwriteStateUpdate(state); + + if (er) + onwriteError(stream, state, sync, er, cb); + else { + // Check if we're actually ready to finish, but don't emit yet + var finished = needFinish(stream, state); + + if (!finished && + !state.corked && + !state.bufferProcessing && + state.buffer.length) { + clearBuffer(stream, state); + } + + if (sync) { + process.nextTick(function() { + afterWrite(stream, state, finished, cb); + }); + } else { + afterWrite(stream, state, finished, cb); + } + } +} + +function afterWrite(stream, state, finished, cb) { + if (!finished) + onwriteDrain(stream, state); + state.pendingcb--; + cb(); + finishMaybe(stream, state); +} + +// Must force callback to be called on nextTick, so that we don't +// emit 'drain' before the write() consumer gets the 'false' return +// value, and has a chance to attach a 'drain' listener. +function onwriteDrain(stream, state) { + if (state.length === 0 && state.needDrain) { + state.needDrain = false; + stream.emit('drain'); + } +} + + +// if there's something in the buffer waiting, then process it +function clearBuffer(stream, state) { + state.bufferProcessing = true; + + if (stream._writev && state.buffer.length > 1) { + // Fast case, write everything using _writev() + var cbs = []; + for (var c = 0; c < state.buffer.length; c++) + cbs.push(state.buffer[c].callback); + + // count the one we are adding, as well. + // TODO(isaacs) clean this up + state.pendingcb++; + doWrite(stream, state, true, state.length, state.buffer, '', function(err) { + for (var i = 0; i < cbs.length; i++) { + state.pendingcb--; + cbs[i](err); + } + }); + + // Clear buffer + state.buffer = []; + } else { + // Slow case, write chunks one-by-one + for (var c = 0; c < state.buffer.length; c++) { + var entry = state.buffer[c]; + var chunk = entry.chunk; + var encoding = entry.encoding; + var cb = entry.callback; + var len = state.objectMode ? 1 : chunk.length; + + doWrite(stream, state, false, len, chunk, encoding, cb); + + // if we didn't call the onwrite immediately, then + // it means that we need to wait until it does. + // also, that means that the chunk and cb are currently + // being processed, so move the buffer counter past them. + if (state.writing) { + c++; + break; + } + } + + if (c < state.buffer.length) + state.buffer = state.buffer.slice(c); + else + state.buffer.length = 0; + } + + state.bufferProcessing = false; +} + +Writable.prototype._write = function(chunk, encoding, cb) { + cb(new Error('not implemented')); + +}; + +Writable.prototype._writev = null; + +Writable.prototype.end = function(chunk, encoding, cb) { + var state = this._writableState; + + if (util.isFunction(chunk)) { + cb = chunk; + chunk = null; + encoding = null; + } else if (util.isFunction(encoding)) { + cb = encoding; + encoding = null; + } + + if (!util.isNullOrUndefined(chunk)) + this.write(chunk, encoding); + + // .end() fully uncorks + if (state.corked) { + state.corked = 1; + this.uncork(); + } + + // ignore unnecessary end() calls. + if (!state.ending && !state.finished) + endWritable(this, state, cb); +}; + + +function needFinish(stream, state) { + return (state.ending && + state.length === 0 && + !state.finished && + !state.writing); +} + +function prefinish(stream, state) { + if (!state.prefinished) { + state.prefinished = true; + stream.emit('prefinish'); + } +} + +function finishMaybe(stream, state) { + var need = needFinish(stream, state); + if (need) { + if (state.pendingcb === 0) { + prefinish(stream, state); + state.finished = true; + stream.emit('finish'); + } else + prefinish(stream, state); + } + return need; +} + +function endWritable(stream, state, cb) { + state.ending = true; + finishMaybe(stream, state); + if (cb) { + if (state.finished) + process.nextTick(cb); + else + stream.once('finish', cb); + } + state.ended = true; +} + +}).call(this,require('_process')) +},{"./_stream_duplex":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_duplex.js","_process":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/process/browser.js","buffer":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/buffer/index.js","core-util-is":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/node_modules/core-util-is/lib/util.js","inherits":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/inherits/inherits_browser.js","stream":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/stream-browserify/index.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/node_modules/core-util-is/lib/util.js":[function(require,module,exports){ +(function (Buffer){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. +function isArray(ar) { + return Array.isArray(ar); +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return isObject(re) && objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return isObject(d) && objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return isObject(e) && + (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +function isBuffer(arg) { + return Buffer.isBuffer(arg); +} +exports.isBuffer = isBuffer; + +function objectToString(o) { + return Object.prototype.toString.call(o); +} +}).call(this,require("buffer").Buffer) +},{"buffer":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/buffer/index.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/node_modules/string_decoder/index.js":[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var Buffer = require('buffer').Buffer; + +var isBufferEncoding = Buffer.isEncoding + || function(encoding) { + switch (encoding && encoding.toLowerCase()) { + case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true; + default: return false; + } + } + + +function assertEncoding(encoding) { + if (encoding && !isBufferEncoding(encoding)) { + throw new Error('Unknown encoding: ' + encoding); + } +} + +// StringDecoder provides an interface for efficiently splitting a series of +// buffers into a series of JS strings without breaking apart multi-byte +// characters. CESU-8 is handled as part of the UTF-8 encoding. +// +// @TODO Handling all encodings inside a single object makes it very difficult +// to reason about this code, so it should be split up in the future. +// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code +// points as used by CESU-8. +var StringDecoder = exports.StringDecoder = function(encoding) { + this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, ''); + assertEncoding(encoding); + switch (this.encoding) { + case 'utf8': + // CESU-8 represents each of Surrogate Pair by 3-bytes + this.surrogateSize = 3; + break; + case 'ucs2': + case 'utf16le': + // UTF-16 represents each of Surrogate Pair by 2-bytes + this.surrogateSize = 2; + this.detectIncompleteChar = utf16DetectIncompleteChar; + break; + case 'base64': + // Base-64 stores 3 bytes in 4 chars, and pads the remainder. + this.surrogateSize = 3; + this.detectIncompleteChar = base64DetectIncompleteChar; + break; + default: + this.write = passThroughWrite; + return; + } + + // Enough space to store all bytes of a single character. UTF-8 needs 4 + // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate). + this.charBuffer = new Buffer(6); + // Number of bytes received for the current incomplete multi-byte character. + this.charReceived = 0; + // Number of bytes expected for the current incomplete multi-byte character. + this.charLength = 0; +}; + + +// write decodes the given buffer and returns it as JS string that is +// guaranteed to not contain any partial multi-byte characters. Any partial +// character found at the end of the buffer is buffered up, and will be +// returned when calling write again with the remaining bytes. +// +// Note: Converting a Buffer containing an orphan surrogate to a String +// currently works, but converting a String to a Buffer (via `new Buffer`, or +// Buffer#write) will replace incomplete surrogates with the unicode +// replacement character. See https://codereview.chromium.org/121173009/ . +StringDecoder.prototype.write = function(buffer) { + var charStr = ''; + // if our last write ended with an incomplete multibyte character + while (this.charLength) { + // determine how many remaining bytes this buffer has to offer for this char + var available = (buffer.length >= this.charLength - this.charReceived) ? + this.charLength - this.charReceived : + buffer.length; + + // add the new bytes to the char buffer + buffer.copy(this.charBuffer, this.charReceived, 0, available); + this.charReceived += available; + + if (this.charReceived < this.charLength) { + // still not enough chars in this buffer? wait for more ... + return ''; + } + + // remove bytes belonging to the current character from the buffer + buffer = buffer.slice(available, buffer.length); + + // get the character that was split + charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding); + + // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character + var charCode = charStr.charCodeAt(charStr.length - 1); + if (charCode >= 0xD800 && charCode <= 0xDBFF) { + this.charLength += this.surrogateSize; + charStr = ''; + continue; + } + this.charReceived = this.charLength = 0; + + // if there are no more bytes in this buffer, just emit our char + if (buffer.length === 0) { + return charStr; + } + break; + } + + // determine and set charLength / charReceived + this.detectIncompleteChar(buffer); + + var end = buffer.length; + if (this.charLength) { + // buffer the incomplete character bytes we got + buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end); + end -= this.charReceived; + } + + charStr += buffer.toString(this.encoding, 0, end); + + var end = charStr.length - 1; + var charCode = charStr.charCodeAt(end); + // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character + if (charCode >= 0xD800 && charCode <= 0xDBFF) { + var size = this.surrogateSize; + this.charLength += size; + this.charReceived += size; + this.charBuffer.copy(this.charBuffer, size, 0, size); + buffer.copy(this.charBuffer, 0, 0, size); + return charStr.substring(0, end); + } + + // or just emit the charStr + return charStr; +}; + +// detectIncompleteChar determines if there is an incomplete UTF-8 character at +// the end of the given buffer. If so, it sets this.charLength to the byte +// length that character, and sets this.charReceived to the number of bytes +// that are available for this character. +StringDecoder.prototype.detectIncompleteChar = function(buffer) { + // determine how many bytes we have to check at the end of this buffer + var i = (buffer.length >= 3) ? 3 : buffer.length; + + // Figure out if one of the last i bytes of our buffer announces an + // incomplete char. + for (; i > 0; i--) { + var c = buffer[buffer.length - i]; + + // See http://en.wikipedia.org/wiki/UTF-8#Description + + // 110XXXXX + if (i == 1 && c >> 5 == 0x06) { + this.charLength = 2; + break; + } + + // 1110XXXX + if (i <= 2 && c >> 4 == 0x0E) { + this.charLength = 3; + break; + } + + // 11110XXX + if (i <= 3 && c >> 3 == 0x1E) { + this.charLength = 4; + break; + } + } + this.charReceived = i; +}; + +StringDecoder.prototype.end = function(buffer) { + var res = ''; + if (buffer && buffer.length) + res = this.write(buffer); + + if (this.charReceived) { + var cr = this.charReceived; + var buf = this.charBuffer; + var enc = this.encoding; + res += buf.slice(0, cr).toString(enc); + } + + return res; +}; + +function passThroughWrite(buffer) { + return buffer.toString(this.encoding); +} + +function utf16DetectIncompleteChar(buffer) { + this.charReceived = buffer.length % 2; + this.charLength = this.charReceived ? 2 : 0; +} + +function base64DetectIncompleteChar(buffer) { + this.charReceived = buffer.length % 3; + this.charLength = this.charReceived ? 3 : 0; +} + +},{"buffer":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/buffer/index.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/passthrough.js":[function(require,module,exports){ +module.exports = require("./lib/_stream_passthrough.js") + +},{"./lib/_stream_passthrough.js":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_passthrough.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/readable.js":[function(require,module,exports){ +exports = module.exports = require('./lib/_stream_readable.js'); +exports.Stream = require('stream'); +exports.Readable = exports; +exports.Writable = require('./lib/_stream_writable.js'); +exports.Duplex = require('./lib/_stream_duplex.js'); +exports.Transform = require('./lib/_stream_transform.js'); +exports.PassThrough = require('./lib/_stream_passthrough.js'); + +},{"./lib/_stream_duplex.js":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_duplex.js","./lib/_stream_passthrough.js":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_passthrough.js","./lib/_stream_readable.js":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_readable.js","./lib/_stream_transform.js":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_transform.js","./lib/_stream_writable.js":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_writable.js","stream":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/stream-browserify/index.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/transform.js":[function(require,module,exports){ +module.exports = require("./lib/_stream_transform.js") + +},{"./lib/_stream_transform.js":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_transform.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/writable.js":[function(require,module,exports){ +module.exports = require("./lib/_stream_writable.js") + +},{"./lib/_stream_writable.js":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_writable.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/stream-browserify/index.js":[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +module.exports = Stream; + +var EE = require('events').EventEmitter; +var inherits = require('inherits'); + +inherits(Stream, EE); +Stream.Readable = require('readable-stream/readable.js'); +Stream.Writable = require('readable-stream/writable.js'); +Stream.Duplex = require('readable-stream/duplex.js'); +Stream.Transform = require('readable-stream/transform.js'); +Stream.PassThrough = require('readable-stream/passthrough.js'); + +// Backwards-compat with node 0.4.x +Stream.Stream = Stream; + + + +// old-style streams. Note that the pipe method (the only relevant +// part of this class) is overridden in the Readable class. + +function Stream() { + EE.call(this); +} + +Stream.prototype.pipe = function(dest, options) { + var source = this; + + function ondata(chunk) { + if (dest.writable) { + if (false === dest.write(chunk) && source.pause) { + source.pause(); + } + } + } + + source.on('data', ondata); + + function ondrain() { + if (source.readable && source.resume) { + source.resume(); + } + } + + dest.on('drain', ondrain); + + // If the 'end' option is not supplied, dest.end() will be called when + // source gets the 'end' or 'close' events. Only dest.end() once. + if (!dest._isStdio && (!options || options.end !== false)) { + source.on('end', onend); + source.on('close', onclose); + } + + var didOnEnd = false; + function onend() { + if (didOnEnd) return; + didOnEnd = true; + + dest.end(); + } + + + function onclose() { + if (didOnEnd) return; + didOnEnd = true; + + if (typeof dest.destroy === 'function') dest.destroy(); + } + + // don't leave dangling pipes when there are errors. + function onerror(er) { + cleanup(); + if (EE.listenerCount(this, 'error') === 0) { + throw er; // Unhandled stream error in pipe. + } + } + + source.on('error', onerror); + dest.on('error', onerror); + + // remove all the event listeners that were added. + function cleanup() { + source.removeListener('data', ondata); + dest.removeListener('drain', ondrain); + + source.removeListener('end', onend); + source.removeListener('close', onclose); + + source.removeListener('error', onerror); + dest.removeListener('error', onerror); + + source.removeListener('end', cleanup); + source.removeListener('close', cleanup); + + dest.removeListener('close', cleanup); + } + + source.on('end', cleanup); + source.on('close', cleanup); + + dest.on('close', cleanup); + + dest.emit('pipe', source); + + // Allow for unix-like usage: A.pipe(B).pipe(C) + return dest; +}; + +},{"events":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/events/events.js","inherits":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/inherits/inherits_browser.js","readable-stream/duplex.js":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/duplex.js","readable-stream/passthrough.js":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/passthrough.js","readable-stream/readable.js":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/readable.js","readable-stream/transform.js":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/transform.js","readable-stream/writable.js":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/readable-stream/writable.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/url/url.js":[function(require,module,exports){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var punycode = require('punycode'); + +exports.parse = urlParse; +exports.resolve = urlResolve; +exports.resolveObject = urlResolveObject; +exports.format = urlFormat; + +exports.Url = Url; + +function Url() { + this.protocol = null; + this.slashes = null; + this.auth = null; + this.host = null; + this.port = null; + this.hostname = null; + this.hash = null; + this.search = null; + this.query = null; + this.pathname = null; + this.path = null; + this.href = null; +} + +// Reference: RFC 3986, RFC 1808, RFC 2396 + +// define these here so at least they only have to be +// compiled once on the first module load. +var protocolPattern = /^([a-z0-9.+-]+:)/i, + portPattern = /:[0-9]*$/, + + // RFC 2396: characters reserved for delimiting URLs. + // We actually just auto-escape these. + delims = ['<', '>', '"', '`', ' ', '\r', '\n', '\t'], + + // RFC 2396: characters not allowed for various reasons. + unwise = ['{', '}', '|', '\\', '^', '`'].concat(delims), + + // Allowed by RFCs, but cause of XSS attacks. Always escape these. + autoEscape = ['\''].concat(unwise), + // Characters that are never ever allowed in a hostname. + // Note that any invalid chars are also handled, but these + // are the ones that are *expected* to be seen, so we fast-path + // them. + nonHostChars = ['%', '/', '?', ';', '#'].concat(autoEscape), + hostEndingChars = ['/', '?', '#'], + hostnameMaxLen = 255, + hostnamePartPattern = /^[a-z0-9A-Z_-]{0,63}$/, + hostnamePartStart = /^([a-z0-9A-Z_-]{0,63})(.*)$/, + // protocols that can allow "unsafe" and "unwise" chars. + unsafeProtocol = { + 'javascript': true, + 'javascript:': true + }, + // protocols that never have a hostname. + hostlessProtocol = { + 'javascript': true, + 'javascript:': true + }, + // protocols that always contain a // bit. + slashedProtocol = { + 'http': true, + 'https': true, + 'ftp': true, + 'gopher': true, + 'file': true, + 'http:': true, + 'https:': true, + 'ftp:': true, + 'gopher:': true, + 'file:': true + }, + querystring = require('querystring'); + +function urlParse(url, parseQueryString, slashesDenoteHost) { + if (url && isObject(url) && url instanceof Url) return url; + + var u = new Url; + u.parse(url, parseQueryString, slashesDenoteHost); + return u; +} + +Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { + if (!isString(url)) { + throw new TypeError("Parameter 'url' must be a string, not " + typeof url); + } + + var rest = url; + + // trim before proceeding. + // This is to support parse stuff like " http://foo.com \n" + rest = rest.trim(); + + var proto = protocolPattern.exec(rest); + if (proto) { + proto = proto[0]; + var lowerProto = proto.toLowerCase(); + this.protocol = lowerProto; + rest = rest.substr(proto.length); + } + + // figure out if it's got a host + // user@server is *always* interpreted as a hostname, and url + // resolution will treat //foo/bar as host=foo,path=bar because that's + // how the browser resolves relative URLs. + if (slashesDenoteHost || proto || rest.match(/^\/\/[^@\/]+@[^@\/]+/)) { + var slashes = rest.substr(0, 2) === '//'; + if (slashes && !(proto && hostlessProtocol[proto])) { + rest = rest.substr(2); + this.slashes = true; + } + } + + if (!hostlessProtocol[proto] && + (slashes || (proto && !slashedProtocol[proto]))) { + + // there's a hostname. + // the first instance of /, ?, ;, or # ends the host. + // + // If there is an @ in the hostname, then non-host chars *are* allowed + // to the left of the last @ sign, unless some host-ending character + // comes *before* the @-sign. + // URLs are obnoxious. + // + // ex: + // http://a@b@c/ => user:a@b host:c + // http://a@b?@c => user:a host:c path:/?@c + + // v0.12 TODO(isaacs): This is not quite how Chrome does things. + // Review our test case against browsers more comprehensively. + + // find the first instance of any hostEndingChars + var hostEnd = -1; + for (var i = 0; i < hostEndingChars.length; i++) { + var hec = rest.indexOf(hostEndingChars[i]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) + hostEnd = hec; + } + + // at this point, either we have an explicit point where the + // auth portion cannot go past, or the last @ char is the decider. + var auth, atSign; + if (hostEnd === -1) { + // atSign can be anywhere. + atSign = rest.lastIndexOf('@'); + } else { + // atSign must be in auth portion. + // http://a@b/c@d => host:b auth:a path:/c@d + atSign = rest.lastIndexOf('@', hostEnd); + } + + // Now we have a portion which is definitely the auth. + // Pull that off. + if (atSign !== -1) { + auth = rest.slice(0, atSign); + rest = rest.slice(atSign + 1); + this.auth = decodeURIComponent(auth); + } + + // the host is the remaining to the left of the first non-host char + hostEnd = -1; + for (var i = 0; i < nonHostChars.length; i++) { + var hec = rest.indexOf(nonHostChars[i]); + if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) + hostEnd = hec; + } + // if we still have not hit it, then the entire thing is a host. + if (hostEnd === -1) + hostEnd = rest.length; + + this.host = rest.slice(0, hostEnd); + rest = rest.slice(hostEnd); + + // pull out port. + this.parseHost(); + + // we've indicated that there is a hostname, + // so even if it's empty, it has to be present. + this.hostname = this.hostname || ''; + + // if hostname begins with [ and ends with ] + // assume that it's an IPv6 address. + var ipv6Hostname = this.hostname[0] === '[' && + this.hostname[this.hostname.length - 1] === ']'; + + // validate a little. + if (!ipv6Hostname) { + var hostparts = this.hostname.split(/\./); + for (var i = 0, l = hostparts.length; i < l; i++) { + var part = hostparts[i]; + if (!part) continue; + if (!part.match(hostnamePartPattern)) { + var newpart = ''; + for (var j = 0, k = part.length; j < k; j++) { + if (part.charCodeAt(j) > 127) { + // we replace non-ASCII char with a temporary placeholder + // we need this to make sure size of hostname is not + // broken by replacing non-ASCII by nothing + newpart += 'x'; + } else { + newpart += part[j]; + } + } + // we test again with ASCII char only + if (!newpart.match(hostnamePartPattern)) { + var validParts = hostparts.slice(0, i); + var notHost = hostparts.slice(i + 1); + var bit = part.match(hostnamePartStart); + if (bit) { + validParts.push(bit[1]); + notHost.unshift(bit[2]); + } + if (notHost.length) { + rest = '/' + notHost.join('.') + rest; + } + this.hostname = validParts.join('.'); + break; + } + } + } + } + + if (this.hostname.length > hostnameMaxLen) { + this.hostname = ''; + } else { + // hostnames are always lower case. + this.hostname = this.hostname.toLowerCase(); + } + + if (!ipv6Hostname) { + // IDNA Support: Returns a puny coded representation of "domain". + // It only converts the part of the domain name that + // has non ASCII characters. I.e. it dosent matter if + // you call it with a domain that already is in ASCII. + var domainArray = this.hostname.split('.'); + var newOut = []; + for (var i = 0; i < domainArray.length; ++i) { + var s = domainArray[i]; + newOut.push(s.match(/[^A-Za-z0-9_-]/) ? + 'xn--' + punycode.encode(s) : s); + } + this.hostname = newOut.join('.'); + } + + var p = this.port ? ':' + this.port : ''; + var h = this.hostname || ''; + this.host = h + p; + this.href += this.host; + + // strip [ and ] from the hostname + // the host field still retains them, though + if (ipv6Hostname) { + this.hostname = this.hostname.substr(1, this.hostname.length - 2); + if (rest[0] !== '/') { + rest = '/' + rest; + } + } + } + + // now rest is set to the post-host stuff. + // chop off any delim chars. + if (!unsafeProtocol[lowerProto]) { + + // First, make 100% sure that any "autoEscape" chars get + // escaped, even if encodeURIComponent doesn't think they + // need to be. + for (var i = 0, l = autoEscape.length; i < l; i++) { + var ae = autoEscape[i]; + var esc = encodeURIComponent(ae); + if (esc === ae) { + esc = escape(ae); + } + rest = rest.split(ae).join(esc); + } + } + + + // chop off from the tail first. + var hash = rest.indexOf('#'); + if (hash !== -1) { + // got a fragment string. + this.hash = rest.substr(hash); + rest = rest.slice(0, hash); + } + var qm = rest.indexOf('?'); + if (qm !== -1) { + this.search = rest.substr(qm); + this.query = rest.substr(qm + 1); + if (parseQueryString) { + this.query = querystring.parse(this.query); + } + rest = rest.slice(0, qm); + } else if (parseQueryString) { + // no query string, but parseQueryString still requested + this.search = ''; + this.query = {}; + } + if (rest) this.pathname = rest; + if (slashedProtocol[lowerProto] && + this.hostname && !this.pathname) { + this.pathname = '/'; + } + + //to support http.request + if (this.pathname || this.search) { + var p = this.pathname || ''; + var s = this.search || ''; + this.path = p + s; + } + + // finally, reconstruct the href based on what has been validated. + this.href = this.format(); + return this; +}; + +// format a parsed object into a url string +function urlFormat(obj) { + // ensure it's an object, and not a string url. + // If it's an obj, this is a no-op. + // this way, you can call url_format() on strings + // to clean up potentially wonky urls. + if (isString(obj)) obj = urlParse(obj); + if (!(obj instanceof Url)) return Url.prototype.format.call(obj); + return obj.format(); +} + +Url.prototype.format = function() { + var auth = this.auth || ''; + if (auth) { + auth = encodeURIComponent(auth); + auth = auth.replace(/%3A/i, ':'); + auth += '@'; + } + + var protocol = this.protocol || '', + pathname = this.pathname || '', + hash = this.hash || '', + host = false, + query = ''; + + if (this.host) { + host = auth + this.host; + } else if (this.hostname) { + host = auth + (this.hostname.indexOf(':') === -1 ? + this.hostname : + '[' + this.hostname + ']'); + if (this.port) { + host += ':' + this.port; + } + } + + if (this.query && + isObject(this.query) && + Object.keys(this.query).length) { + query = querystring.stringify(this.query); + } + + var search = this.search || (query && ('?' + query)) || ''; + + if (protocol && protocol.substr(-1) !== ':') protocol += ':'; + + // only the slashedProtocols get the //. Not mailto:, xmpp:, etc. + // unless they had them to begin with. + if (this.slashes || + (!protocol || slashedProtocol[protocol]) && host !== false) { + host = '//' + (host || ''); + if (pathname && pathname.charAt(0) !== '/') pathname = '/' + pathname; + } else if (!host) { + host = ''; + } + + if (hash && hash.charAt(0) !== '#') hash = '#' + hash; + if (search && search.charAt(0) !== '?') search = '?' + search; + + pathname = pathname.replace(/[?#]/g, function(match) { + return encodeURIComponent(match); + }); + search = search.replace('#', '%23'); + + return protocol + host + pathname + search + hash; +}; + +function urlResolve(source, relative) { + return urlParse(source, false, true).resolve(relative); +} + +Url.prototype.resolve = function(relative) { + return this.resolveObject(urlParse(relative, false, true)).format(); +}; + +function urlResolveObject(source, relative) { + if (!source) return relative; + return urlParse(source, false, true).resolveObject(relative); +} + +Url.prototype.resolveObject = function(relative) { + if (isString(relative)) { + var rel = new Url(); + rel.parse(relative, false, true); + relative = rel; + } + + var result = new Url(); + Object.keys(this).forEach(function(k) { + result[k] = this[k]; + }, this); + + // hash is always overridden, no matter what. + // even href="" will remove it. + result.hash = relative.hash; + + // if the relative url is empty, then there's nothing left to do here. + if (relative.href === '') { + result.href = result.format(); + return result; + } + + // hrefs like //foo/bar always cut to the protocol. + if (relative.slashes && !relative.protocol) { + // take everything except the protocol from relative + Object.keys(relative).forEach(function(k) { + if (k !== 'protocol') + result[k] = relative[k]; + }); + + //urlParse appends trailing / to urls like http://www.example.com + if (slashedProtocol[result.protocol] && + result.hostname && !result.pathname) { + result.path = result.pathname = '/'; + } + + result.href = result.format(); + return result; + } + + if (relative.protocol && relative.protocol !== result.protocol) { + // if it's a known url protocol, then changing + // the protocol does weird things + // first, if it's not file:, then we MUST have a host, + // and if there was a path + // to begin with, then we MUST have a path. + // if it is file:, then the host is dropped, + // because that's known to be hostless. + // anything else is assumed to be absolute. + if (!slashedProtocol[relative.protocol]) { + Object.keys(relative).forEach(function(k) { + result[k] = relative[k]; + }); + result.href = result.format(); + return result; + } + + result.protocol = relative.protocol; + if (!relative.host && !hostlessProtocol[relative.protocol]) { + var relPath = (relative.pathname || '').split('/'); + while (relPath.length && !(relative.host = relPath.shift())); + if (!relative.host) relative.host = ''; + if (!relative.hostname) relative.hostname = ''; + if (relPath[0] !== '') relPath.unshift(''); + if (relPath.length < 2) relPath.unshift(''); + result.pathname = relPath.join('/'); + } else { + result.pathname = relative.pathname; + } + result.search = relative.search; + result.query = relative.query; + result.host = relative.host || ''; + result.auth = relative.auth; + result.hostname = relative.hostname || relative.host; + result.port = relative.port; + // to support http.request + if (result.pathname || result.search) { + var p = result.pathname || ''; + var s = result.search || ''; + result.path = p + s; + } + result.slashes = result.slashes || relative.slashes; + result.href = result.format(); + return result; + } + + var isSourceAbs = (result.pathname && result.pathname.charAt(0) === '/'), + isRelAbs = ( + relative.host || + relative.pathname && relative.pathname.charAt(0) === '/' + ), + mustEndAbs = (isRelAbs || isSourceAbs || + (result.host && relative.pathname)), + removeAllDots = mustEndAbs, + srcPath = result.pathname && result.pathname.split('/') || [], + relPath = relative.pathname && relative.pathname.split('/') || [], + psychotic = result.protocol && !slashedProtocol[result.protocol]; + + // if the url is a non-slashed url, then relative + // links like ../.. should be able + // to crawl up to the hostname, as well. This is strange. + // result.protocol has already been set by now. + // Later on, put the first path part into the host field. + if (psychotic) { + result.hostname = ''; + result.port = null; + if (result.host) { + if (srcPath[0] === '') srcPath[0] = result.host; + else srcPath.unshift(result.host); + } + result.host = ''; + if (relative.protocol) { + relative.hostname = null; + relative.port = null; + if (relative.host) { + if (relPath[0] === '') relPath[0] = relative.host; + else relPath.unshift(relative.host); + } + relative.host = null; + } + mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === ''); + } + + if (isRelAbs) { + // it's absolute. + result.host = (relative.host || relative.host === '') ? + relative.host : result.host; + result.hostname = (relative.hostname || relative.hostname === '') ? + relative.hostname : result.hostname; + result.search = relative.search; + result.query = relative.query; + srcPath = relPath; + // fall through to the dot-handling below. + } else if (relPath.length) { + // it's relative + // throw away the existing file, and take the new path instead. + if (!srcPath) srcPath = []; + srcPath.pop(); + srcPath = srcPath.concat(relPath); + result.search = relative.search; + result.query = relative.query; + } else if (!isNullOrUndefined(relative.search)) { + // just pull out the search. + // like href='?foo'. + // Put this after the other two cases because it simplifies the booleans + if (psychotic) { + result.hostname = result.host = srcPath.shift(); + //occationaly the auth can get stuck only in host + //this especialy happens in cases like + //url.resolveObject('mailto:local1@domain1', 'local2@domain2') + var authInHost = result.host && result.host.indexOf('@') > 0 ? + result.host.split('@') : false; + if (authInHost) { + result.auth = authInHost.shift(); + result.host = result.hostname = authInHost.shift(); + } + } + result.search = relative.search; + result.query = relative.query; + //to support http.request + if (!isNull(result.pathname) || !isNull(result.search)) { + result.path = (result.pathname ? result.pathname : '') + + (result.search ? result.search : ''); + } + result.href = result.format(); + return result; + } + + if (!srcPath.length) { + // no path at all. easy. + // we've already handled the other stuff above. + result.pathname = null; + //to support http.request + if (result.search) { + result.path = '/' + result.search; + } else { + result.path = null; + } + result.href = result.format(); + return result; + } + + // if a url ENDs in . or .., then it must get a trailing slash. + // however, if it ends in anything else non-slashy, + // then it must NOT get a trailing slash. + var last = srcPath.slice(-1)[0]; + var hasTrailingSlash = ( + (result.host || relative.host) && (last === '.' || last === '..') || + last === ''); + + // strip single dots, resolve double dots to parent dir + // if the path tries to go above the root, `up` ends up > 0 + var up = 0; + for (var i = srcPath.length; i >= 0; i--) { + last = srcPath[i]; + if (last == '.') { + srcPath.splice(i, 1); + } else if (last === '..') { + srcPath.splice(i, 1); + up++; + } else if (up) { + srcPath.splice(i, 1); + up--; + } + } + + // if the path is allowed to go above the root, restore leading ..s + if (!mustEndAbs && !removeAllDots) { + for (; up--; up) { + srcPath.unshift('..'); + } + } + + if (mustEndAbs && srcPath[0] !== '' && + (!srcPath[0] || srcPath[0].charAt(0) !== '/')) { + srcPath.unshift(''); + } + + if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) { + srcPath.push(''); + } + + var isAbsolute = srcPath[0] === '' || + (srcPath[0] && srcPath[0].charAt(0) === '/'); + + // put the host back + if (psychotic) { + result.hostname = result.host = isAbsolute ? '' : + srcPath.length ? srcPath.shift() : ''; + //occationaly the auth can get stuck only in host + //this especialy happens in cases like + //url.resolveObject('mailto:local1@domain1', 'local2@domain2') + var authInHost = result.host && result.host.indexOf('@') > 0 ? + result.host.split('@') : false; + if (authInHost) { + result.auth = authInHost.shift(); + result.host = result.hostname = authInHost.shift(); + } + } + + mustEndAbs = mustEndAbs || (result.host && srcPath.length); + + if (mustEndAbs && !isAbsolute) { + srcPath.unshift(''); + } + + if (!srcPath.length) { + result.pathname = null; + result.path = null; + } else { + result.pathname = srcPath.join('/'); + } + + //to support request.http + if (!isNull(result.pathname) || !isNull(result.search)) { + result.path = (result.pathname ? result.pathname : '') + + (result.search ? result.search : ''); + } + result.auth = relative.auth || result.auth; + result.slashes = result.slashes || relative.slashes; + result.href = result.format(); + return result; +}; + +Url.prototype.parseHost = function() { + var host = this.host; + var port = portPattern.exec(host); + if (port) { + port = port[0]; + if (port !== ':') { + this.port = port.substr(1); + } + host = host.substr(0, host.length - port.length); + } + if (host) this.hostname = host; +}; + +function isString(arg) { + return typeof arg === "string"; +} + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} + +function isNull(arg) { + return arg === null; +} +function isNullOrUndefined(arg) { + return arg == null; +} + +},{"punycode":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/punycode/punycode.js","querystring":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/querystring-es3/index.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/util/support/isBufferBrowser.js":[function(require,module,exports){ +module.exports = function isBuffer(arg) { + return arg && typeof arg === 'object' + && typeof arg.copy === 'function' + && typeof arg.fill === 'function' + && typeof arg.readUInt8 === 'function'; +} +},{}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/util/util.js":[function(require,module,exports){ +(function (process,global){ +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + +var formatRegExp = /%[sdj%]/g; +exports.format = function(f) { + if (!isString(f)) { + var objects = []; + for (var i = 0; i < arguments.length; i++) { + objects.push(inspect(arguments[i])); + } + return objects.join(' '); + } + + var i = 1; + var args = arguments; + var len = args.length; + var str = String(f).replace(formatRegExp, function(x) { + if (x === '%%') return '%'; + if (i >= len) return x; + switch (x) { + case '%s': return String(args[i++]); + case '%d': return Number(args[i++]); + case '%j': + try { + return JSON.stringify(args[i++]); + } catch (_) { + return '[Circular]'; + } + default: + return x; + } + }); + for (var x = args[i]; i < len; x = args[++i]) { + if (isNull(x) || !isObject(x)) { + str += ' ' + x; + } else { + str += ' ' + inspect(x); + } + } + return str; +}; + + +// Mark that a method should not be used. +// Returns a modified function which warns once by default. +// If --no-deprecation is set, then it is a no-op. +exports.deprecate = function(fn, msg) { + // Allow for deprecating things in the process of starting up. + if (isUndefined(global.process)) { + return function() { + return exports.deprecate(fn, msg).apply(this, arguments); + }; + } + + if (process.noDeprecation === true) { + return fn; + } + + var warned = false; + function deprecated() { + if (!warned) { + if (process.throwDeprecation) { + throw new Error(msg); + } else if (process.traceDeprecation) { + console.trace(msg); + } else { + console.error(msg); + } + warned = true; + } + return fn.apply(this, arguments); + } + + return deprecated; +}; + + +var debugs = {}; +var debugEnviron; +exports.debuglog = function(set) { + if (isUndefined(debugEnviron)) + debugEnviron = process.env.NODE_DEBUG || ''; + set = set.toUpperCase(); + if (!debugs[set]) { + if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { + var pid = process.pid; + debugs[set] = function() { + var msg = exports.format.apply(exports, arguments); + console.error('%s %d: %s', set, pid, msg); + }; + } else { + debugs[set] = function() {}; + } + } + return debugs[set]; +}; + + +/** + * Echos the value of a value. Trys to print the value out + * in the best way possible given the different types. + * + * @param {Object} obj The object to print out. + * @param {Object} opts Optional options object that alters the output. + */ +/* legacy: obj, showHidden, depth, colors*/ +function inspect(obj, opts) { + // default options + var ctx = { + seen: [], + stylize: stylizeNoColor + }; + // legacy... + if (arguments.length >= 3) ctx.depth = arguments[2]; + if (arguments.length >= 4) ctx.colors = arguments[3]; + if (isBoolean(opts)) { + // legacy... + ctx.showHidden = opts; + } else if (opts) { + // got an "options" object + exports._extend(ctx, opts); + } + // set default options + if (isUndefined(ctx.showHidden)) ctx.showHidden = false; + if (isUndefined(ctx.depth)) ctx.depth = 2; + if (isUndefined(ctx.colors)) ctx.colors = false; + if (isUndefined(ctx.customInspect)) ctx.customInspect = true; + if (ctx.colors) ctx.stylize = stylizeWithColor; + return formatValue(ctx, obj, ctx.depth); +} +exports.inspect = inspect; + + +// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics +inspect.colors = { + 'bold' : [1, 22], + 'italic' : [3, 23], + 'underline' : [4, 24], + 'inverse' : [7, 27], + 'white' : [37, 39], + 'grey' : [90, 39], + 'black' : [30, 39], + 'blue' : [34, 39], + 'cyan' : [36, 39], + 'green' : [32, 39], + 'magenta' : [35, 39], + 'red' : [31, 39], + 'yellow' : [33, 39] +}; + +// Don't use 'blue' not visible on cmd.exe +inspect.styles = { + 'special': 'cyan', + 'number': 'yellow', + 'boolean': 'yellow', + 'undefined': 'grey', + 'null': 'bold', + 'string': 'green', + 'date': 'magenta', + // "name": intentionally not styling + 'regexp': 'red' +}; + + +function stylizeWithColor(str, styleType) { + var style = inspect.styles[styleType]; + + if (style) { + return '\u001b[' + inspect.colors[style][0] + 'm' + str + + '\u001b[' + inspect.colors[style][1] + 'm'; + } else { + return str; + } +} + + +function stylizeNoColor(str, styleType) { + return str; +} + + +function arrayToHash(array) { + var hash = {}; + + array.forEach(function(val, idx) { + hash[val] = true; + }); + + return hash; +} + + +function formatValue(ctx, value, recurseTimes) { + // Provide a hook for user-specified inspect functions. + // Check that value is an object with an inspect function on it + if (ctx.customInspect && + value && + isFunction(value.inspect) && + // Filter out the util module, it's inspect function is special + value.inspect !== exports.inspect && + // Also filter out any prototype objects using the circular check. + !(value.constructor && value.constructor.prototype === value)) { + var ret = value.inspect(recurseTimes, ctx); + if (!isString(ret)) { + ret = formatValue(ctx, ret, recurseTimes); + } + return ret; + } + + // Primitive types cannot have properties + var primitive = formatPrimitive(ctx, value); + if (primitive) { + return primitive; + } + + // Look up the keys of the object. + var keys = Object.keys(value); + var visibleKeys = arrayToHash(keys); + + if (ctx.showHidden) { + keys = Object.getOwnPropertyNames(value); + } + + // IE doesn't make error fields non-enumerable + // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx + if (isError(value) + && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { + return formatError(value); + } + + // Some type of object without properties can be shortcutted. + if (keys.length === 0) { + if (isFunction(value)) { + var name = value.name ? ': ' + value.name : ''; + return ctx.stylize('[Function' + name + ']', 'special'); + } + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } + if (isDate(value)) { + return ctx.stylize(Date.prototype.toString.call(value), 'date'); + } + if (isError(value)) { + return formatError(value); + } + } + + var base = '', array = false, braces = ['{', '}']; + + // Make Array say that they are Array + if (isArray(value)) { + array = true; + braces = ['[', ']']; + } + + // Make functions say that they are functions + if (isFunction(value)) { + var n = value.name ? ': ' + value.name : ''; + base = ' [Function' + n + ']'; + } + + // Make RegExps say that they are RegExps + if (isRegExp(value)) { + base = ' ' + RegExp.prototype.toString.call(value); + } + + // Make dates with properties first say the date + if (isDate(value)) { + base = ' ' + Date.prototype.toUTCString.call(value); + } + + // Make error with message first say the error + if (isError(value)) { + base = ' ' + formatError(value); + } + + if (keys.length === 0 && (!array || value.length == 0)) { + return braces[0] + base + braces[1]; + } + + if (recurseTimes < 0) { + if (isRegExp(value)) { + return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); + } else { + return ctx.stylize('[Object]', 'special'); + } + } + + ctx.seen.push(value); + + var output; + if (array) { + output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); + } else { + output = keys.map(function(key) { + return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); + }); + } + + ctx.seen.pop(); + + return reduceToSingleString(output, base, braces); +} + + +function formatPrimitive(ctx, value) { + if (isUndefined(value)) + return ctx.stylize('undefined', 'undefined'); + if (isString(value)) { + var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') + .replace(/'/g, "\\'") + .replace(/\\"/g, '"') + '\''; + return ctx.stylize(simple, 'string'); + } + if (isNumber(value)) + return ctx.stylize('' + value, 'number'); + if (isBoolean(value)) + return ctx.stylize('' + value, 'boolean'); + // For some reason typeof null is "object", so special case here. + if (isNull(value)) + return ctx.stylize('null', 'null'); +} + + +function formatError(value) { + return '[' + Error.prototype.toString.call(value) + ']'; +} + + +function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { + var output = []; + for (var i = 0, l = value.length; i < l; ++i) { + if (hasOwnProperty(value, String(i))) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + String(i), true)); + } else { + output.push(''); + } + } + keys.forEach(function(key) { + if (!key.match(/^\d+$/)) { + output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, + key, true)); + } + }); + return output; +} + + +function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { + var name, str, desc; + desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; + if (desc.get) { + if (desc.set) { + str = ctx.stylize('[Getter/Setter]', 'special'); + } else { + str = ctx.stylize('[Getter]', 'special'); + } + } else { + if (desc.set) { + str = ctx.stylize('[Setter]', 'special'); + } + } + if (!hasOwnProperty(visibleKeys, key)) { + name = '[' + key + ']'; + } + if (!str) { + if (ctx.seen.indexOf(desc.value) < 0) { + if (isNull(recurseTimes)) { + str = formatValue(ctx, desc.value, null); + } else { + str = formatValue(ctx, desc.value, recurseTimes - 1); + } + if (str.indexOf('\n') > -1) { + if (array) { + str = str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n').substr(2); + } else { + str = '\n' + str.split('\n').map(function(line) { + return ' ' + line; + }).join('\n'); + } + } + } else { + str = ctx.stylize('[Circular]', 'special'); + } + } + if (isUndefined(name)) { + if (array && key.match(/^\d+$/)) { + return str; + } + name = JSON.stringify('' + key); + if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { + name = name.substr(1, name.length - 2); + name = ctx.stylize(name, 'name'); + } else { + name = name.replace(/'/g, "\\'") + .replace(/\\"/g, '"') + .replace(/(^"|"$)/g, "'"); + name = ctx.stylize(name, 'string'); + } + } + + return name + ': ' + str; +} + + +function reduceToSingleString(output, base, braces) { + var numLinesEst = 0; + var length = output.reduce(function(prev, cur) { + numLinesEst++; + if (cur.indexOf('\n') >= 0) numLinesEst++; + return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; + }, 0); + + if (length > 60) { + return braces[0] + + (base === '' ? '' : base + '\n ') + + ' ' + + output.join(',\n ') + + ' ' + + braces[1]; + } + + return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; +} + + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. +function isArray(ar) { + return Array.isArray(ar); +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return isObject(re) && objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return isObject(d) && objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return isObject(e) && + (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +exports.isBuffer = require('./support/isBuffer'); + +function objectToString(o) { + return Object.prototype.toString.call(o); +} + + +function pad(n) { + return n < 10 ? '0' + n.toString(10) : n.toString(10); +} + + +var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', + 'Oct', 'Nov', 'Dec']; + +// 26 Feb 16:19:34 +function timestamp() { + var d = new Date(); + var time = [pad(d.getHours()), + pad(d.getMinutes()), + pad(d.getSeconds())].join(':'); + return [d.getDate(), months[d.getMonth()], time].join(' '); +} + + +// log is just a thin wrapper to console.log that prepends a timestamp +exports.log = function() { + console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); +}; + + +/** + * Inherit the prototype methods from one constructor into another. + * + * The Function.prototype.inherits from lang.js rewritten as a standalone + * function (not on Function.prototype). NOTE: If this file is to be loaded + * during bootstrapping this function needs to be rewritten using some native + * functions as prototype setup using normal JavaScript does not work as + * expected during bootstrapping (see mirror.js in r114903). + * + * @param {function} ctor Constructor function which needs to inherit the + * prototype. + * @param {function} superCtor Constructor function to inherit prototype from. + */ +exports.inherits = require('inherits'); + +exports._extend = function(origin, add) { + // Don't do anything if add isn't an object + if (!add || !isObject(add)) return origin; + + var keys = Object.keys(add); + var i = keys.length; + while (i--) { + origin[keys[i]] = add[keys[i]]; + } + return origin; +}; + +function hasOwnProperty(obj, prop) { + return Object.prototype.hasOwnProperty.call(obj, prop); +} + +}).call(this,require('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{"./support/isBuffer":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/util/support/isBufferBrowser.js","_process":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/process/browser.js","inherits":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/inherits/inherits_browser.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/gibber.core.lib/scripts/dollar.js":[function(require,module,exports){ +(function (global){ +!function() { + +"use strict" + +var hasZepto = typeof Zepto === 'function', + hasJQuery = typeof jQuery === 'function', + has$ = typeof global.$ === 'object' || typeof global.$ === 'function', + $ = null, + hasConflict = hasZepto || hasJQuery || has$, + isArray = Array.isArray, + isObject = function( obj ) { return typeof obj === 'object' }, + isPlainObject = function( obj ) { + return isObject(obj) && Object.getPrototypeOf( obj ) == Object.prototype + } + +if( !hasConflict ) { + $ = {} +}else if( hasJQuery ) { + $ = jQuery +}else if( hasZepto ) { + $ = Zepto +}else if( has$ ){ + $ = global.$ +}else{ + $ = {} +} + +// taken from Zepto: zeptojs.com +function extend(target, source, deep) { + for (var key in source) + if (deep && (isPlainObject(source[key]) || isArray(source[key]))) { + if (isPlainObject(source[key]) && !isPlainObject(target[key])) + target[key] = {} + if (isArray(source[key]) && !isArray(target[key])) + target[key] = [] + extend(target[key], source[key], deep) + } + else if (source[key] !== undefined) target[key] = source[key] +} + +if( !hasConflict ) { + // Copy all but undefined properties from one or more + // objects to the `target` object. + $.extend = function( target ){ + var deep, args = Array.prototype.slice.call(arguments, 1) + + if (typeof target === 'boolean') { + deep = target + target = args.shift() + } + args.forEach(function(arg){ extend(target, arg, deep) }) + return target + } + + $.isArray = Array.isArray + $.isPlainObject = isPlainObject + + $.type = function( val ) { + return typeof val + } +} + +var events = {} +$.subscribe = function( key, fcn ) { + if( typeof events[ key ] === 'undefined' ) { + events[ key ] = [] + } + events[ key ].push( fcn ) +} + +$.unsubscribe = function( key, fcn ) { + if( typeof events[ key ] !== 'undefined' ) { + var arr = events[ key ] + + arr.splice( arr.indexOf( fcn ), 1 ) + } +} + +$.publish = function( key, data ) { + if( typeof events[ key ] !== 'undefined' ) { + var arr = events[ key ] + for( var i = 0; i < arr.length; i++ ) { + arr[ i ]( data ) + } + } +} + +module.exports = $ + +}() +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/gibber.core.lib/scripts/euclidean.js":[function(require,module,exports){ +module.exports = function( Gibber ) { + +"use strict" + +var flatten = function(){ + var flat = []; + for (var i = 0, l = this.length; i < l; i++){ + var type = Object.prototype.toString.call(this[i]).split(' ').pop().split(']').shift().toLowerCase(); + if (type) { flat = flat.concat(/^(array|collection|arguments|object)$/.test(type) ? flatten.call(this[i]) : this[i]); } + } + return flat; +} + +var createStartingArray = function( length, ones ) { + var out = [] + for( var i = 0; i < ones; i++ ) { + out.push([1]) + } + for( var j = i; j < length; j++ ) { + out.push(0) + } + return out +} + +var printArray = function( array ) { + var str = '' + for( var i = 0; i < array.length; i++ ) { + var outerElement = array[ i ] + if( Array.isArray( outerElement ) ) { + str += '[' + for( var j = 0; j < outerElement.length; j++ ) { + str += outerElement[ j ] + } + str += '] ' + }else{ + str += outerElement + '' + } + } + + return str +} + +var arraysEqual = function(a, b) { + if (a === b) return true; + if (a == null || b == null) return false; + if (a.length != b.length) return false; + + for (var i = 0; i < a.length; ++i) { + if (a[i] !== b[i]) return false; + } + return true; +} + +var getLargestArrayCount = function( input ) { + var length = 0, count = 0 + + for( var i = 0; i < input.length; i++ ) { + if( Array.isArray( input[ i ] ) ) { + if( input[ i ].length > length ) { + length = input[ i ].length + count = 1 + }else if( input[ i ].length === length ) { + count++ + } + } + } + + return count +} + +var Euclid = function( ones,length, dur ) { + var count = 0, + out = createStartingArray( length, ones ) + + function Inner( n,k ) { + var operationCount = count++ === 0 ? k : getLargestArrayCount( out ), + moveCandidateCount = out.length - operationCount, + numberOfMoves = operationCount >= moveCandidateCount ? moveCandidateCount : operationCount + + if( numberOfMoves > 1 || count === 1 ) { + for( var i = 0; i < numberOfMoves; i++ ) { + var willBeMoved = out.pop(), isArray = Array.isArray( willBeMoved ) + out[ i ].push( willBeMoved ) + if( isArray ) { + flatten.call( out[ i ] ) + } + } + } + + if( n % k !== 0 ) { + return Inner( k, n % k ) + }else { + return flatten.call( out ) + } + } + + return calculateRhythms( Inner( length, ones ), dur ) +} +// E(5,8) = [ .25, .125, .25, .125, .25 ] +var calculateRhythms = function( values,dur ) { + var out = [] + + console.log( values, dur ) + if( typeof dur === 'undefined' ) dur = 1 / values.length + + var idx = 0, + currentDur = 0 + + while( idx < values.length ) { + idx++ + currentDur += dur + + if( values[ idx ] == 1 || idx === values.length ) { + out.push( currentDur ) + currentDur = 0 + } + } + + return out +} + +var answers = { + '1,4' : '1000', + '2,3' : '101', + '2,5' : '10100', + '3,4' : '1011', + '3,5' : '10101', + '3,7' : '1010100', + '3,8' : '10010010', + '4,7' : '1010101', + '4,9' : '101010100', + '4,11': '10010010010', + '5,6' : '101111', + '5,7' : '1011011', + '5,8' : '10110110', + '5,9' : '101010101', + '5,11': '10101010100', + '5,12': '100101001010', + '5,16': '1001001001001000', + '7,8' : '10111111', + '11,24': '100101010101001010101010' +} + +Euclid.test = function( testKey ) { + var failed = 0, passed = 0 + + if( typeof testKey !== 'string' ) { + for( var key in answers ) { + var expectedResult = answers[ key ], + result = flatten.call( Euclid.apply( null, key.split(',') ) ).join('') + + console.log( result, expectedResult ) + + if( result === expectedResult ) { + console.log("TEST PASSED", key ) + passed++ + }else{ + console.log("TEST FAILED", key ) + failed++ + } + } + console.log("*****************************TEST RESULTS - Passed: " + passed + ", Failed: " + failed ) + }else{ + var expectedResult = answers[testKey], + result = flatten.call( Euclid.apply( null, testKey.split(',') ) ).join('') + + console.log( result, expectedResult ) + + if( result == expectedResult ) { + console.log("TEST PASSED FOR", testKey) + }else{ + console.log("TEST FAILED FOR", testKey) + } + } +} + +return Euclid + +} +},{}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/gibber.core.lib/scripts/gibber.js":[function(require,module,exports){ +(function() { +//"use strict" +// can't use strict because eval is used to evaluate user code in the run method +// I should wrap this in a Function call instead... +var $ = require( './dollar' ) + +var Gibber = { + dollar: $, + Presets: {}, + scale : null, + minNoteFrequency:50, + started:false, + outputCurves : { + LINEAR:0, + LOGARITHMIC:1 + }, + Pattern: require( './pattern' ), + + export: function( target ) { + Gibber.Utilities.export( target ) + target.Pattern = Gibber.Pattern + target.Score = Gibber.Score + target.Euclid = Gibber.Euclid + + if( Gibber.Audio ) { + $.subscribe( 'audio.init', function( audio ) { + var __clear = Gibber.clear + audio.export( target ) + Gibber.clear = __clear + }) + } + + if( Gibber.Graphics ) { + Gibber.Graphics.export( target ) + } + + if( Gibber.Interface ) { + Gibber.Interface.export( target ) + } + + if( Gibber.Communication ) { + Gibber.Communication.export( target ) + } + }, + + init: function( _options, __$ ) { + if( __$ !== undefined ) $ = __$ + + if( typeof window === 'undefined' ) { // check for node.js + window = GLOBAL // is this a good idea? makes a global window available in all files required in node + document = GLOBAL.document = false + }else if( typeof GLOBAL !== 'undefined' ) { // I can't remember why I put this in there... + if( !GLOBAL.document ) document = GLOBAL.document = false + } + + var options = { + globalize: true, + canvas: null, + target: window, + graphicsMode:'3d', + callback: null + } + + if( typeof _options === 'function' ) + options.callback = _options + else if( typeof _options === 'object' ) + $.extend( options, _options ) + + Gibber.Pattern = Gibber.Pattern( Gibber ) + if( Gibber.Audio ) { + var _export = Gibber.export.bind( Gibber ) + var __clear__ = Gibber.clear + $.extend( Gibber, Gibber.Audio ) + Gibber.clear = __clear__ + + Gibber.export = _export + //Gibber.Audio.export( Gibber ) + var __save = options.callback + options.callback = function() { + //Gibber.Audio.export( Gibber ) + if( __save !== null ) __save() + } + Gibber.Audio.init( options.callback, Gibber.dollar ) + + //if( options.globalize ) { + //options.target.Master = Gibber.Audio.Master + //}else{ + + //} + _export( options.target ) + } + + if( Gibber.Graphics ) { + // this happens dynamically when a graphics object is first created to save CPU + // Gibber.Graphics.init( options.graphicsMode ) + } + + if( Gibber.Interface ) {} + + if( options.globalize ) { + Gibber.export( options.target ) + } + + options.target.$ = $ // TODO: geez louise + + Gibber.Utilities.init() + + // Gibber.isInstrument = true + }, + // interfaceIsReady : function() { + // if( !Gibber.started ) { + // if( typeof Gibber.Audio.context.currentTime !== 'undefined' ) { + // Gibber.started = true + // if( Gibber.isInstrument ) eval( loadFile.text ) + // } + // } + // }, + Modules : {}, + import : function( path, exportTo, shouldSave ) { + // XXX should be replaced with a Promise + var _done = null + console.log( 'Loading module ' + path + '...' ) + + if( path.indexOf( 'http:' ) === -1 ) { + //console.log( 'loading via post', path ) + $.post( + Gibber.Environment.SERVER_URL + '/gibber/'+path, {}, + function( d ) { + d = JSON.parse( d ) + + var f = new Function( 'return ' + d.text ) + + Gibber.Modules[ path ] = f() + + if( exportTo && Gibber.Modules[ path ] ) { + $.extend( exportTo, Gibber.Modules[ path ] ) + //Gibber.Modules[ path ] = exportTo + } + if( Gibber.Modules[ path ] ) { + if( typeof Gibber.Modules[ path ].init === 'function' ) { + Gibber.Modules[ path ].init() + } + if( typeof Gibber.Modules[ path ] === 'object' ) { + Gibber.Modules[ path ].moduleText = d.text + } + console.log( 'Module ' + path + ' is now loaded.' ) + }else{ + console.log( 'Publication ' + path + ' is loaded. It may not be a valid module.') + } + + if( _done !== null ) { _done( Gibber.Modules[ path ] ) } + + return false; + } + ) + }else{ + var script = document.createElement( 'script' ) + script.src = path + + script.onload = function () { + console.log( 'Module ' + path + ' is now loaded.' ) + if( _done !== null ) { _done() } + }; + + document.head.appendChild( script ) + } + return { done: function( fcn ) { _done = fcn } } + }, + + loadText: function( path ) { + var _done = null + console.log( 'Loading text ' + path + '....' ) + + $.post( + Gibber.Environment.SERVER_URL + '/gibber/'+path, {}, + function( d ) { + var json = JSON.parse( d ) + if( _done ) { _done( json.text ) } + } + ) + return { done: function( fcn ) { _done = fcn } } + }, + + // log: function( msg ) { + // //console.log( "LOG", typeof msg ) + // if( typeof msg !== 'undefined' ) { + // if( typeof msg !== 'function') { + // console.log( msg ) + // }else{ + // console.log( 'Function' ) + // } + // } + // }, + + scriptCallbacks: [], + + run: function( script, pos, cm ) { // called by Gibber.Environment.Keymap.modes.javascript + var _start = pos.start ? pos.start.line : pos.line, + tree + + try{ + tree = Gibber.Esprima.parse(script, { loc:true, range:true} ) + }catch(e) { + console.error( "Parse error on line " + ( _start + e.lineNumber ) + " : " + e.message.split(':')[1] ) + return + } + + // must wrap i with underscores to avoid confusion in the eval statement with commands that use proxy i + for( var __i__ = 0; __i__ < tree.body.length; __i__++ ) { + var obj = tree.body[ __i__ ], + start = { line:_start + obj.loc.start.line - 1, ch: obj.loc.start.column }, + end = { line:_start + obj.loc.end.line - 1, ch: obj.loc.end.column }, + src = cm.getRange( start, end ), + result = null + + //console.log( start, end, src ) + try{ + result = eval( src ) + if( typeof result !== 'function' ) { + log( result ) + }else{ + log( 'Function' ) + } + }catch( e ) { + console.error( "Error evaluating expression beginning on line " + (start.line + 1) + '\n' + e.message ) + } + + if( this.scriptCallbacks.length > 0 ) { + for( var ___i___ = 0; ___i___ < this.scriptCallbacks.length; ___i___++ ) { + this.scriptCallbacks[ ___i___ ]( obj, cm, pos, start, end, src, _start ) + } + } + } + }, + + processArguments: function(args, type) { + var obj + + if( args.length ) { + if( typeof args[0] === 'string' && type !== 'Drums' && type !== 'XOX' ) { + obj = Gibber.getPreset( args[0], type ) + + if( typeof args[1] == 'object' ) { + $.extend( obj, args[ 1 ] ) + } + return obj + } + return Array.prototype.slice.call(args, 0) + } + + return obj + }, + + processArguments2 : function(obj, args, type) { + if( args.length ) { + var firstArg = args[ 0 ] + + if( typeof firstArg === 'string' && type !== 'Drums' && type !== 'XOX' && type !== 'Shader' ) { + preset = Gibber.getPreset( args[0], type ) + + if( typeof args[1] === 'object' ) { + $.extend( preset, args[ 1 ] ) + } + + $.extend( obj, preset ) + + //if( obj.presetInit ) obj.presetInit() + }else if( $.isPlainObject( firstArg ) && typeof firstArg.type === 'undefined' ) { + $.extend( obj, firstArg ) + }else{ + var keys = Object.keys( obj.properties ) + + if( obj.type === 'FX' ) { + for( var i = 0; i < args.length; i++ ) { obj[ keys[ i + 1 ] ] = args[ i ] } + }else{ + for( var i = 0; i < args.length; i++ ) { obj[ keys[ i ] ] = args[ i ] } + } + + } + } + }, + + getPreset: function( presetName, ugenType ) { + var obj = {} + + if( Gibber.Presets[ ugenType ] ) { + if( Gibber.Presets[ ugenType ][ presetName ] ) { + obj = Gibber.Presets[ ugenType ][ presetName ] + }else{ + Gibber.log( ugenType + ' does not have a preset named ' + presetName + '.' ) + } + }else{ + Gibber.log( ugenType + ' does not have a preset named ' + presetName + '.' ) + } + + return obj + }, + + clear : function() { + var args = Array.prototype.slice.call( arguments, 0 ) + if( Gibber.Audio ) Gibber.Audio.clear.apply( Gibber.Audio, args ); + + if( Gibber.Graphics ) { + Gibber.Graphics.clear( Gibber.Graphics, args ) + } + + //Gibber.proxy( window, [ a ] ) + Gibber.proxy( window ) + + $.publish( '/gibber/clear', {} ) + + console.log( 'Gibber has been cleared.' ) + }, + + singleton: function( lt, target ) { + if( !target ) target = window + + if( $.isArray( lt ) ) { + for( var i = 0; i < lt.length; i++ ) { + Gibber.singleton( lt[ i ], target ) + } + return + } + + if( typeof target[ lt ] !== 'undefined' ) { //&& arguments[1].indexOf( window[ lt ] ) === -1 ) { + delete target[ lt ] + delete target[ '___' + lt ] + } + + var ltr = lt; + + Object.defineProperty( target, ltr, { + configurable: true, + get:function() { return target[ '___'+ltr] }, + set:function( newObj ) { + if( newObj ) { + if( target[ '___'+ltr ] ) { + if( typeof target[ '___'+ltr ].replaceWith === 'function' ) { + target[ '___'+ltr ].replaceWith( newObj ) + console.log( target[ '___'+ltr ].name + ' was replaced with ' + newObj.name ) + } + } + target[ '___'+ltr ] = newObj + }else{ + if( target[ '___'+ltr ] ) { + var variable = target[ '___'+ltr ] + if( variable ) { + if( typeof variable.kill === 'function' /*&& target[ '___'+ltr ].destinations.length > 0 */) { + variable.kill(); + } + } + } + } + } + }); + }, + proxy: function( target ) { + var letters = "abcdefghijklmnopqrstuvwxyz" + + for(var l = 0; l < letters.length; l++) { + + var lt = letters.charAt(l); + Gibber.singleton( lt, target ) + + } + }, + + construct: function( constructor, args ) { + function F() { + return constructor.apply( this, args ); + } + F.prototype = constructor.prototype; + return new F(); + }, + + createMappingObject : function(target, from) { + var min = typeof target.min === 'function' ? target.min() : target.min, + max = typeof target.max === 'function' ? target.max() : target.max, + _min = typeof from.min === 'function' ? from.min() : from.min, + _max = typeof from.max === 'function' ? from.max() : from.max + + if( typeof from.object === 'undefined' && from.Value) { // if using an interface object directly to map + from = from.Value + } + + if( typeof target.object[ target.Name ].mapping !== 'undefined') { + target.object[ target.Name ].mapping.replace( from.object, from.propertyName, from.Name ) + return + } + + if( typeof from.targets !== 'undefined' ) { + if( from.targets.indexOf( target ) === -1 ) from.targets.push( [target, target.Name] ) + } + + var fromTimescale = from.Name !== 'Out' ? from.timescale : 'audioOut' // check for audio Out, which is a faux property + + mapping = Gibber.mappings[ target.timescale ][ fromTimescale ]( target, from ) + + //target.object[ target.name ].toString = function() { return '> continuous mapping: ' + from.name + ' -> ' + target.name } + + Object.defineProperties( target.object[ target.Name ], { + 'min' : { + configurable:true, + get : function() { return min }, + set : function(v) { min = v; target.object[ target.Name ].mapping.outputMin = min } + }, + 'max' : { + configurable:true, + get : function() { return max }, + set : function(v) { max = v; target.object[ target.Name ].mapping.outputMax = max } + }, + }) + + target.object[ target.Name ].mappingObjects = [] + + Gibber.createProxyProperty( target.object[ target.Name ], 'min', 1, 0, { + 'min':min, 'max':max, output: target.output, + timescale: target.timescale, + dimensions:1 + }) + + Gibber.createProxyProperty( target.object[ target.Name ], 'max', 1, 0, { + 'min':min, 'max':max, output: target.output, + timescale: target.timescale, + dimensions:1 + }) + + Object.defineProperties( from.object[ from.Name ], { + 'min' : { + configurable:true, + get : function() { return _min }, + set : function(v) { _min = v; target.object[ target.Name ].mapping.inputMin = _min } + }, + 'max' : { + configurable:true, + get : function() { return _max }, + set : function(v) { _max = v; target.object[ target.Name ].mapping.inputMax = _max } + }, + }) + + target.object[ target.Name ].invert = function() { + target.object[ target.Name ].mapping.invert() + } + + if( typeof target.object.mappings === 'undefined' ) target.object.mappings = [] + + target.object.mappings.push( mapping ) + + if( typeof from.object.mappings === 'undefined' ) from.object.mappings = [] + + from.object.mappings.push( mapping ) + + Gibber.defineSequencedProperty( target.object[ target.Name ], 'invert' ) + + return mapping + }, + + defineSequencedProperty : function( obj, key, priority ) { + var fnc = obj[ key ], seqNumber, seqNumHash = {}, seqs = {} + + /* + seqNumHash is used to store a unique id number in the Seq objects seq array + that is accessed via the property name and sequence number + */ + + if( !obj.seq && Gibber.Audio ) { + obj.seq = Gibber.Audio.Seqs.Seq({ doNotStart:true, scale:obj.scale, priority:priority, target:obj }) + } + + //seqs = obj.seq.seqs + + fnc.score = function( v,d,n ) { + return function() { + fnc.seq( v,d,n ) + } + } + obj[ key +'_' ] = function() { + var args = Array.prototype.slice.call( arguments, 0 ) + + var out = function() { + fnc.apply( obj, args ) + } + + return out + } + + fnc.seq = function( _v,_d, seqNumberForKey ) { + var seq, uniqueSeqID, autofire = false + if( typeof _v === 'string' && ( obj.name === 'Drums' || obj.name === 'XOX' || obj.name === 'Ensemble' )) { + _v = _v.split('') + if( typeof _d === 'undefined' ) _d = 1 / _v.length + }else if( typeof _d === 'undefined' ) { + autofire = true + } + + if( typeof obj.seq === 'function' ) { + obj.seq = obj.object.seq // cube.position etc. TODO: Fix this hack! + } + + seqs = obj.seq.seqs + + var v = $.isArray(_v) ? _v : [_v], + d = $.isArray(_d) ? _d : typeof _d !== 'undefined' ? [_d] : null, + valuesPattern = Gibber.construct( Gibber.Pattern, v ), + durationsPattern = Gibber.construct( Gibber.Pattern, d ), + args = { + 'key': key, + values: [ valuesPattern ], + durations: d !== null ? [ durationsPattern ] : null, + target: obj, + 'priority': priority + } + + valuesPattern.patternName = key + '_values' + durationsPattern.patternName = key + '_durations' + + if( typeof seqNumberForKey === 'undefined' ) seqNumberForKey = 0 // _num++ + + if( typeof seqNumHash[ key ] === 'undefined' ) seqNumHash[ key ] = [] + + uniqueSeqID = seqNumHash[ key ][ seqNumberForKey ] //seqs[ ] + + var shouldSplice = -1 + + // // TODO: what about scheduling chords through multiple autofire note sequences? + // if( !autofire ) { // check and make sure autofire doesn't exist for this key + // for( var i = obj.seq.autofire.length - 1; i > 0; i-- ) { + // var autofireSeq = obj.seq.autofire[ i ] + // if( autofireSeq.key === key ) { + // obj.seq.autofire.splice( i, 1 ) + // break; + // } + // } + // } + //console.log( "HASH", uniqueSeqID, "numhash", seqNumHash[ key ] ) + if( typeof uniqueSeqID !== 'undefined' && typeof seqs[ uniqueSeqID ] !== 'undefined' ) { + shouldSplice = uniqueSeqID + } + + if( v.randomFlag ) { + valuesPattern.filters.push( function() { + var idx = Gibber.Utilities.rndi(0, valuesPattern.values.length - 1) + return [ valuesPattern.values[ idx ], 1, idx ] + }) + for( var i = 0; i < v.randomArgs.length; i+=2 ) { + valuesPattern.repeat( v.randomArgs[ i ], v.randomArgs[ i + 1 ] ) + } + } + + if( d !== null ) { + if( d.randomFlag ) { + durationsPattern.filters.push( function() { + var idx = Gibber.Utilities.rndi(0, durationsPattern.values.length - 1) + return [ durationsPattern.values[ idx ], 1, idx ] + }) + for( var i = 0; i < d.randomArgs.length; i+=2 ) { + durationsPattern.repeat( d.randomArgs[ i ], d.randomArgs[ i + 1 ] ) + } + } + + durationsPattern.seq = obj.seq + } + + valuesPattern.seq = obj.seq + + //console.log( "SHOULD SPLICE", shouldSplice ) + if( shouldSplice > -1 ) { + var old = autofire ? obj.seq.autofire.splice( shouldSplice, 1 )[0] : seqs.splice( shouldSplice, 1 )[ 0 ] + for( var timestamp in obj.seq.timeline ) { + var timelinePos = obj.seq.timeline[ timestamp ], + idx = timelinePos.indexOf( old ) + + if( idx > -1 ) { + timelinePos.splice( idx, 1 ) + } + } + obj.seq.add( args, shouldSplice ) + }else{ + // var old = autofire ? obj.seq.autofire.splice( shouldSplice, 1 )[0] : seqs.splice( shouldSplice, 1 )[ 0 ] + // for( var timestamp in obj.seq.timeline ) { + // var timelinePos = obj.seq.timeline[ timestamp ], + // idx = timelinePos.indexOf( old ) + // + // if( idx > -1 ) { + // timelinePos.splice( idx, 1 ) + // } + // } + obj.seq.add( args ) + uniqueSeqID = obj.seq.seqs.length - 1 + } + + if( !autofire ) + seqNumHash[ key ][ seqNumberForKey ] = uniqueSeqID + + //console.log( "HASH NUMBER", uniqueSeqID, "SEQ NUMBER", seqNumberForKey ) + fnc[ seqNumberForKey ] = {} + + Object.defineProperties( fnc[ seqNumberForKey ], { + values: { + configurable:true, + get: function() { + return valuesPattern + /* + if( d !== null ) { // then use autofire array + return obj.seq.seqs[ seqNumber ].values[0] + }else{ + return obj.seq.autofire[ seqNumber ].values[0] + }*/ + }, + set: function( val ) { + var pattern = Gibber.construct( Gibber.Pattern, val ) + + if( !Array.isArray( pattern ) ) { + pattern = [ pattern ] + } + + if( d !== null ) { + obj.seq.seqs[ uniqueSeqID ].values = pattern + }else{ + obj.seq.autofire[ uniqueSeqID ].values = pattern + } + } + }, + durations: { + configurable:true, + get: function() { + /*if( d !== null ) { // then it's not an autofire seq + return obj.seq.seqs[ seqNumber ].durations[ 0 ] + }else{ + return null + }*/ + return durationsPattern + }, + set: function( val ) { + if( !Array.isArray( val ) ) { + val = [ val ] + } + //obj.seq.seqs[ seqNumber ].durations = val //.splice( 0, 10000, v ) + var pattern = Gibber.construct( Gibber.Pattern, val ) + + if( !Array.isArray( pattern ) ) { + pattern = [ pattern ] + } + + obj.seq.seqs[ uniqueSeqID ].durations = pattern //.splice( 0, 10000, v ) + }, + }, + }) + + fnc[ seqNumberForKey ].seq = function( v, d ) { + fnc.seq( v,d,seqNumberForKey ) + } + + if( !obj.seq.isRunning ) { + obj.seq.offset = Gibber.Clock.time( obj.offset ) + obj.seq.start( true, priority ) + } + + fnc.seq.stop = function() { + var seqNumbersForKey = seqNumHash[ key ] + + for( var i = 0; i < seqNumbersForKey.length; i++ ) { + var _num = seqNumbersForKey[ i ], + _seq = seqs[ _num ] + + _seq.shouldStop = true + } + } + + fnc[ seqNumberForKey ].stop = function() { + seqs[ uniqueSeqID ].shouldStop = true + } + + // TODO: property specific stop/start/shuffle etc. for polyseq + fnc.seq.start = function() { + var seqNumbersForKey = seqNumHash[ key ] + + for( var i = 0; i < seqNumbersForKey.length; i++ ) { + var _num = seqNumbersForKey[ i ], + _seq = seqs[ _num ] + + _seq.shouldStop = false + + if( ! obj.seq.timeline[0] ) obj.seq.timeline[0] = [] + obj.seq.timeline[0].push( _seq ) + + obj.seq.nextTime = 0 + } + + if( !obj.seq.isRunning ) { + obj.seq.start( false, priority ) + } + } + + fnc[ seqNumberForKey ].start = function() { + var _seq = seqs[ uniqueSeqID ] + _seq.shouldStop = false + + obj.seq.timeline[0] = [ _seq ] + obj.seq.nextTime = 0 + + if( !obj.seq.isRunning ) { + obj.seq.start( false, priority ) + } + seqs[ uniqueSeqID ].shouldStop = false + } + + fnc.seq.repeat = function( numberOfTimes ) { + var repeatCount = 0 + + var filter = function( args, ptrn ) { + if( args[2] % (ptrn.getLength() - 1) === 0 && args[2] !== 0) { + repeatCount++ + if( repeatCount === numberOfTimes ) { + ptrn.seq.stop() + } + } + return args + } + + fnc.values.filters.push( filter ) + } + + fnc[ seqNumberForKey ].score = function( __v__, __d__ ) { + return fnc.seq.bind( obj, __v__, __d__, seqNumberForKey ) + } + + Object.defineProperties( fnc, { + values: { + configurable: true, + get: function() { return fnc[ seqNumberForKey ].values }, + set: function( val ) { return fnc[ seqNumberForKey ].values = val }, + }, + durations: { + configurable: true, + get: function() { return fnc[ seqNumberForKey ].durations }, + set: function( val ) { return fnc[ seqNumberForKey ].durations = val }, + } + }) + + // console.log( key, fnc.values, fnc.durations ) + return obj + } + }, + + defineRampedProperty : function( obj, _key ) { + var fnc = obj[ _key ], key = _key.slice(1), cancel + + fnc.ramp = function( from, to, length ) { + if( arguments.length < 2 ) { + console.err( 'ramp requires at least two arguments: target and time.' ) + return + } + + if( typeof length === 'undefined' ) { // if only to and length arguments + length = to + to = from + from = obj[ key ]() + } + + if( cancel ) cancel() + + if( typeof from !== 'object' ) { + obj[ key ] = Line( from, to, length ) + }else{ + from.retrigger( to, Gibber.Clock.time( length ) ) + } + + cancel = future( function() { + obj[ key ] = to + }, length ) + + return obj + } + }, + + createProxyMethods : function( obj, methods, priority ) { + for( var i = 0; i < methods.length; i++ ) Gibber.defineSequencedProperty( obj, methods[ i ], priority ) + }, + + defineProperty : function( obj, propertyName, shouldSeq, shouldRamp, mappingsDictionary, shouldUseMappings, priority, useOldGetter ) { + var originalValue = typeof obj[ propertyName ] === 'object' ? obj[ propertyName ].valueOf() : obj[ propertyName ], + Name = propertyName.charAt( 0 ).toUpperCase() + propertyName.slice( 1 ), + property = function( v ) { + var returnValue = property + + if( typeof v !== 'undefined' ) { + //obj[ propertyName ] = v + //property.value = v + if( property.oldSetter ) { + property.oldSetter.call( obj, v ) + }else{ + obj[ propertyName ] = v + } + + returnValue = obj + } + + return returnValue + } + + // TODO: get rid of this line + mappingsDictionary = shouldUseMappings ? mappingsDictionary || obj.mappingProperties[ propertyName ] : null + + $.extend( property, mappingsDictionary ) + + $.extend( property, { + 'propertyName': propertyName, // can't redfine 'name' on a function, unless we eval or something... + 'Name': Name, + value: originalValue, + type: 'property', + object: obj, + targets: [], + valueOf: function() { return property.value }, + toString: function() { + var output = "" + if( typeof property.value === 'object' ) { + output = property.value.toString() + }else{ + output = property.value + } + return output + }, + oldSetter: obj.__lookupSetter__( propertyName ), + oldGetter: obj.__lookupGetter__( propertyName ), + oldMappingObjectGetter: obj.__lookupGetter__( Name ), + oldMappingObjectSetter: obj.__lookupSetter__( Name ) + }) + + Object.defineProperty( obj, propertyName, { + configurable:true, + get: function(){ + // var returnValue = property + // if( useOldGetter ) { + // console.log( property.oldGetter ) + // returnValue = property.oldGetter() + // } + // else if( property.oldMappingObjectGetter ) { + // return property.oldMappingObjectGetter() + // } + // return returnValue || property + return property + }, + set: function( v ){ + if( (typeof v === 'function' || typeof v === 'object' && v.type === 'mapping') && ( v.type === 'property' || v.type === 'mapping' ) ) { + Gibber.createMappingObject( property, v ) + }else{ + if( shouldUseMappings && obj[ property.Name ] ) { + if( typeof obj[ property.Name ].mapping !== 'undefined' ) { + if( obj[ property.Name ].mapping.remove ) obj[ property.Name ].mapping.remove( true ) + } + } + + var newValue = v + + if( property.oldSetter ) { + var setterResult = property.oldSetter.call( obj, v ) + if( typeof setterResult !== 'undefined' ) { newValue = setterResult } + } + + property.value = newValue + } + + return obj + } + }) + + if( shouldSeq ) Gibber.defineSequencedProperty( obj, propertyName, priority ) + if( shouldRamp ) Gibber.defineRampedProperty( obj, propertyName ) + + // capital letter mapping sugar + if( shouldUseMappings ) { + Object.defineProperty( obj, property.Name, { + configurable: true, + get : function() { + if( typeof property.oldMappingObjectGetter === 'function' ) property.oldMappingObjectGetter() + return property + }, + set : function( v ) { + obj[ property.Name ] = v + if( typeof mapping.oldMappingObjectSetter === 'function' ) mapping.oldMappingObjectSetter( v ) + } + }) + } + }, + //obj, propertyName, shouldSeq, shouldRamp, mappingsDictionary, shouldUseMappings, priority, useOldGetter + createProxyProperty: function( obj, _key, shouldSeq, shouldRamp, dict, _useMappings, priority ) { + _useMappings = _useMappings === false ? false : true + + Gibber.defineProperty( obj, _key, shouldSeq, shouldRamp, dict, _useMappings, priority ) + if( dict && dict.perNote ) { + Gibber.defineProperty( obj, _key+'V', shouldSeq, shouldRamp, dict, _useMappings, priority ) + } + }, + + // obj, _key, shouldSeq, shouldRamp, dict, _useMappings, priority + createProxyProperties : function( obj, mappingProperties, noSeq, noRamp ) { + var shouldSeq = typeof noSeq === 'undefined' ? true : noSeq, + shouldRamp = typeof noRamp === 'undefined' ? true : noRamp + + obj.gibber = true // keyword identifying gibber object, needed for notation parser + + obj.mappingProperties = mappingProperties + obj.mappingObjects = [] + + for( var key in mappingProperties ) { + if( ! mappingProperties[ key ].doNotProxy ) { + Gibber.createProxyProperty( obj, key, shouldSeq, shouldRamp, mappingProperties[ key ] ) + } + } + }, +} + +Gibber.Utilities = require( './utilities' )( Gibber ) +// Gibber.Audio = require( 'gibber.audio.lib/scripts/gibber/audio' )( Gibber ) +// Gibber.Graphics = require( 'gibber.graphics.lib/scripts/gibber/graphics/graphics' )( Gibber ) +// Gibber.Interface = require( 'gibber.interface.lib/scripts/gibber/interface/interface' )( Gibber ) +Gibber.mappings = require( './mappings' )( Gibber ) +Gibber.Euclid = require( './euclidean' )( Gibber ) +// TODO: Make Score work without requiring audio +// Gibber.Score = require( './score' )//( Gibber ) // only initialize once Gibber.Audio.Core is loaded, otherwise problems + +module.exports = Gibber + +})() + +},{"./dollar":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/gibber.core.lib/scripts/dollar.js","./euclidean":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/gibber.core.lib/scripts/euclidean.js","./mappings":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/gibber.core.lib/scripts/mappings.js","./pattern":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/gibber.core.lib/scripts/pattern.js","./utilities":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/gibber.core.lib/scripts/utilities.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/gibber.core.lib/scripts/mappings.js":[function(require,module,exports){ +module.exports = function( Gibber ) { + var mappings = { + audio : { + graphics: function( target, from ) { + if( typeof from.object.track === 'undefined' ) from.object.track = {} + + var proxy = typeof from.object.track[ from.propertyName ] !== 'undefined' ? from.object.track[ from.propertyName ] : new Gibber.Audio.Core.Proxy2( from.object, from.propertyName ), + op = new Gibber.Audio.Core.OnePole({ a0:.005, b1:.995 }), + mapping + + from.object.track = proxy; + + mapping = target.object[ target.Name ].mapping = Gibber.Audio.Core.Binops.Map( proxy, target.min, target.max, from.min, from.max, target.output, from.wrap ) + + op.input = mapping + + target.object[ target.propertyName ] = op + + mapping.proxy = proxy + mapping.op = op + + mapping.remove = function( doNotSet ) { + if( !doNotSet ) { + target.object[ target.propertyName ] = target.object[ target.Name ].mapping.getValue() + } + + delete target.object[ target.Name ].mapping + } + + return mapping + }, + interface: function( target, from ) { + // TODO: why does the proxy track from.name instead of from.propertyName? maybe because interface elements don't get passed to mapping init? + // console.log( "Making mapping : ", from.object, from, from.propertyName, target.propertyName ) + var proxy = typeof from.track !== 'undefined' ? from.track : new Gibber.Audio.Core.Proxy2( from.object, from.propertyName ), + op = new Gibber.Audio.Core.OnePole({ a0:.005, b1:.995 }), + range = target.max - target.min, + percent = ( target.object[ target.propertyName ] - target.min ) / range, + widgetValue = from.min + ( ( from.max - from.min ) * percent ), + mapping + + if( from.object.setValue ) from.object.setValue( widgetValue ) + + from.track = proxy + + mapping = target.object[ target.Name ].mapping = Gibber.Audio.Core.Binops.Map( proxy, target.min, target.max, from.min, from.max, target.output, from.wrap ) + + op.input = mapping + target.object[ target.propertyName ] = op + + mapping.proxy = proxy + mapping.op = op + + mapping.remove = function( doNotSet ) { + if( !doNotSet ) target.object[ target.propertyName ] = mapping.getValue() + + //if( mapping.op ) mapping.op.remove() + + delete mapping + } + + if( typeof from.object.label !== 'undefined' ) { + var labelString = '' + for( var i = 0; i < from.targets.length; i++ ) { + var __target = from.targets[ i ] + labelString += __target[0].object.name + '.' + __target[1] + if( i !== from.targets.length - 1 ) labelString += ' & ' + } + from.object.label = labelString + } + + mapping.replace = function( replacementObject, key, Key ) { + proxy.setInput( replacementObject ) + if( replacementObject[ Key ].targets.indexOf( target ) === -1 ) replacementObject[ Key ].targets.push( [target, target.Name] ) + } + + return mapping + }, + audio: function( target, from ) { + var proxy, mapping + + if( typeof from.object.track !== 'undefined' ) { + proxy = from.object.track + proxy.count++ + } else { + proxy = new Gibber.Audio.Core.Proxy2( from.object, from.propertyName ) + proxy.count = 1 + } + from.object.track = proxy + + target.object[ target.propertyName ] = Gibber.Audio.Core.Binops.Map( proxy, target.min, target.max, from.min, from.max ) + + mapping = target.object[ target.Name ].mapping = target.object[ target.propertyName ] // must call getter function explicitly + + mapping.remove = function( doNotSet ) { + if( !doNotSet ) { + target.object[ target.propertyName ] = mapping.getValue() + } + + if( mapping.op ) mapping.op.remove() + + delete target.object[ target.Name ].mapping + } + + mapping.replace = function( replacementObject, key, Key ) { + var proxy = new Gibber.Audio.Core.Proxy2( replacementObject, key ) + mapping.input = proxy + if( replacementObject[ Key ].targets && replacementObject[ Key ].targets.indexOf( target ) === -1 ) { + replacementObject[ Key ].targets.push( [target, target.Name] ) + } + } + + return mapping + }, + audioOut : function( target, from ) { + var mapping + + mapping = Gibber.Audio.Core.Binops.Map( null, target.min, target.max, 0, 1, 0 ) + + target.object[ target.propertyName ] = target.object[ target.Name ].mapping = mapping + + if( typeof from.object.track !== 'undefined' ) { + mapping.follow = from.object.track + mapping.follow.count++ + } else { + mapping.follow = new Gibber.Audio.Analysis.Follow({ input:from.object, useAbsoluteValue: true }) + mapping.follow.count = 1 + } + + from.object.track = mapping.input = mapping.follow + + mapping.remove = function( doNotSet ) { + if( !doNotSet ) { + target.object[ target.propertyName ] = target.object[ target.Name ].mapping.getValue() + } + + if( mapping.bus ) + mapping.bus.disconnect() + + if( mapping.follow ) { + mapping.follow.count-- + if( mapping.follow.count === 0) { + delete from.object.track + mapping.follow.remove() + } + } + + delete target.object[ target.Name ].mapping + } + + mapping.replace = function( replacementObject, key, Key ) { + mapping.follow.input = replacementObject + if( replacementObject[ Key ].targets.indexOf( target ) === -1 ) replacementObject[ Key ].targets.push( [target, target.Name] ) + } + + var env = mapping.follow.bufferSize + Object.defineProperty( target.object[ target.Name ], 'env', { + configurable:true, + get: function() { return env }, + set: function(v) { env = Gibber.Clock.time( v ); mapping.follow.bufferSize = env; } + }) + + return mapping + } + }, + graphics: { + graphics: function( target, from ) { + // rewrite getValue function of Map object to call Map callback and then return appropriate value + var map = Gibber.Audio.Core.Binops.Map( from.object[ from.propertyName ], target.min, target.max, from.min, from.max, target.output, from.wrap ), + old = map.getValue.bind( map ), + mapping + + map.getValue = function() { + //console.log( from.propertyName, from, target.min, target.max, from.min, from.max ) + map.callback( from.object[ from.propertyName ], target.min, target.max, from.min, from.max, target.output, from.wrap ) + return old() + } + + mapping = target.object[ target.Name ].mapping = map + + if( target.object.mod ) { // second case accomodates modding individual [0][1][2] properties fo vectors + target.object.mod( target.propertyName, mapping, '=' ) + }else{ + target.modObject.mod( target.modName, mapping, '=' ) + } + + mapping.remove = function() { + if( target.object.mod ) { + target.object.removeMod( target.propertyName ) + }else{ + target.modObject.removeMod( target.modName ) + } + target.object[ target.propertyName ] = target.object[ target.Name ].mapping.getValue() + + delete target.object[ target.Name ].mapping + } + + mapping.replace = function( replacementObject, key, Key ) { mapping.input = replacementObject } + + return mapping + }, + interface: function( target, from ) { + var _map = Gibber.Audio.Core.Binops.Map( from.object[ from.propertyName ], target.min, target.max, from.min, from.max, target.output, from.wrap ), + mapping + + if( typeof from.object.functions === 'undefined' ) { + from.object.functions = {} + from.object.onvaluechange = function() { + for( var key in from.object.functions ) { + from.object.functions[ key ]() + } + } + } + + mapping = target.object[ target.Name ].mapping = _map + + target.mapping.from = from + + var fcn_name = target.propertyName + ' <- ' + from.object.propertyName + '.' + from.Name + + from.object.functions[ fcn_name ] = function() { + var val = mapping.callback( from.object[ from.propertyName ], target.min, target.max, from.min, from.max, target.output, from.wrap ) + // target.object[ target.Name ].value = val + // console.log( target.Name ) + target.object[ target.Name ].oldSetter.call( target.object[ target.Name ], val ) + } + // from.object.onvaluechange = function() { + // var val = map.callback( this[ from.propertyName ], target.min, target.max, from.min, from.max, target.output, from.wrap ) + // target.object[ target.propertyName ] = val + // } + mapping.replace = function() { + // var old = from.functions[ target.Name ] + } + + mapping.remove = function() { + console.log( "mapping removed" ) + delete from.object.functions[ fcn_name ] + } + + if( from.object.setValue ) + from.object.setValue( target.object[ target.propertyName ] ) + + // if( typeof from.object.label !== 'undefined' ) { + // from.object.label = target.object.propertyName + '.' + target.Name + // } + if( typeof from.object.label !== 'undefined' ) { + var labelString = '' + for( var i = 0; i < from.targets.length; i++ ) { + var __target = from.targets[ i ] + labelString += __target[0].object.propertyName + '.' + __target[1] + if( i !== from.targets.length - 1 ) labelString += ' & ' + } + from.object.label = labelString + } + + return mapping + }, + audio: function( target, from ) { + var mapping + + mapping = target.object[ target.Name ].mapping = Gibber.Audio.Core.Binops.Map( null, target.min, target.max, from.min, from.max, target.output, from.wrap ) + + mapping.follow = typeof from.object.track !== 'undefined' ? from.object.track : new Gibber.Audio.Core.Follow({ input:from.object[ from.propertyName ], useAbsoluteValue: false }) + + from.object.track = target.object[ target.Name ].mapping.follow + // assign input after Map ugen is created so that follow can be assigned to the mapping object + mapping.input = mapping.follow + + mapping.bus = new Gibber.Audio.Core.Bus2({ amp:0 }).connect() + + mapping.connect( mapping.bus ) + + mapping.replace = function( replacementObject, key, Key ) { + mapping.follow.input = replacementObject + if( replacementObject[ Key ].targets.indexOf( target ) === -1 ) replacementObject[ Key ].targets.push( [target, target.Name] ) + } + + var env = mapping.follow.bufferSize + Object.defineProperty( target.object[ target.Name ], 'env', { + get: function() { return env }, + set: function(v) { env = Gibber.Clock.time( v ); mapping.follow.bufferSize = env; } + }) + + if( target.object.mod ) { // second case accomodates modding individual [0][1][2] properties fo vectors + //console.log( target.object, target.object.mod ) + target.object.mod( target.propertyName, mapping, '=' ) + }else{ + target.modObject.mod( target.modName, mapping, '=' ) + } + + mapping.remove = function() { + this.bus.disconnect() + + if( this.follow ) { + this.follow.count-- + if( this.follow.count === 0) { + delete from.object.track + this.follow.remove() + } + } + + if( target.object.mod ) { + target.object.removeMod( target.propertyName ) + }else{ + target.modObject.removeMod( target.modName ) + } + + delete target.object[ target.Name ].mapping + } + + return mapping + }, + audioOut : function( target, from ) { + if( typeof target.object[ target.Name ].mapping === 'undefined') { + var mapping = target.object[ target.Name ].mapping = Gibber.Audio.Core.Binops.Map( null, target.min, target.max, 0, 1, 0 ) + if( typeof from.object.track !== 'undefined' ) { + mapping.follow = from.object.track + mapping.follow.count++ + } else { + mapping.follow = new Gibber.Audio.Core.Follow({ input:from.object }) + mapping.follow.count = 1 + } + from.object.track = mapping.follow + + var env = mapping.follow.bufferSize + Object.defineProperty( target.object[ target.Name ], 'env', { + configurable: true, + get: function() { return env }, + set: function(v) { env = Gibber.Clock.time( v ); mapping.follow.bufferSize = env; } + }) + + mapping.input = mapping.follow + mapping.bus = new Gibber.Audio.Core.Bus2({ amp:0 }).connect() + mapping.connect( mapping.bus ) + + mapping.replace = function( replacementObject, key, Key ) { + // _console.log( key, replacementObject ) + + // what if new mapping isn't audio type? + if ( replacementObject[ Key ].timescale === from.timescale ) { + var idx = mapping.follow.input[ from.Name ].targets.indexOf( target ) + if( idx >= -1 ) { + mapping.follow.input[ from.Name ].targets.splice( idx, 1 ) + } + + mapping.follow.input = replacementObject + if( replacementObject[ Key ].targets.indexOf( target ) === -1 ) replacementObject[ Key ].targets.push( [target, target.Name] ) + }else{ + mapping.bus.disconnect() + mapping.follow.remove() + Gibber.createMappingObject( target, replacementObject ) + } + + } + }else{ + mapping.replace( from.object, from.propertyName, from.Name ) + return mapping + } + + if( target.object.mod ) { // second case accomodates modding individual [0][1][2] properties of vectors + //console.log( target.object, target.object.mod ) + target.object.mod( target.propertyName, mapping, '=' ) + }else if (target.modObject) { + target.modObject.mod( target.modName, mapping, '=' ) + }else{ + !function() { + var _mapping = mapping + target.object.update = function() { + target.object[ target.propertyName ]( _mapping.getValue() ) + } + }() + //target.object.mod( target.propertyName, mapping, '=' ) + } + + //target.object[ target.Name ].mapping = mapping + + mapping.remove = function() { + this.bus.disconnect() + + if( this.follow ) { + this.follow.count-- + if( this.follow.count === 0) { + delete from.object.track + this.follow.remove() + } + } + + if( target.object.mod ) { + target.object.removeMod( target.propertyName ) + }else if( target.modObject ) { + target.modObject.removeMod( target.modName ) + }else{ + //target.object.update = function() {} + } + + target.object.mappings.splice( target.object.mappings.indexOf( mapping ), 1 ) + from.object.mappings.splice( from.object.mappings.indexOf( mapping ), 1 ) + + var targets = target.object[ target.Name ].targets, + idx = targets.indexOf( mappings ) + + if( idx !== -1 ) { + targets.splice( idx, 1 ) + } + + delete target.object[ target.Name ].mapping + } + return mapping + } + }, + notation: { + graphics: function( target, from ) { + // rewrite getValue function of Map object to call Map callback and then return appropriate value + + var map = Gibber.Audio.Core.Binops.Map( from.object[ from.propertyName ], target.min, target.max, from.min, from.max, target.output, from.wrap ), + old = map.getValue.bind( map ), + mapping + + map.getValue = function() { + map.callback( from.object[ from.propertyName ], target.min, target.max, from.min, from.max, target.output, from.wrap ) + return old() + } + + mapping = target.object[ target.Name ].mapping = map + + if( target.object.mod ) { // second case accomodates modding individual [0][1][2] properties fo vectors + target.object.mod( target.propertyName, mapping, '=' ) + }else{ + target.modObject.mod( target.modName, mapping, '=' ) + } + + mapping.remove = function() { + if( target.object.mod ) { + target.object.removeMod( target.propertyName ) + }else{ + target.modObject.removeMod( target.modName ) + } + target.object[ target.propertyName ] = target.object[ target.Name ].mapping.getValue() + + delete target.object[ target.Name ].mapping + } + + mapping.replace = function( replacementObject, key, Key ) { mapping.input = replacementObject } + + return mapping + }, + interface: function( target, from ) { + // console.log( "FROM", from.propertyName, target.min, target.max, from.min, from.max ) + var _map = Gibber.Audio.Core.Binops.Map( from.object[ from.propertyName ], target.min, target.max, from.min, from.max, target.output, from.wrap ), + mapping + + if( typeof from.object.functions === 'undefined' ) { + from.object.functions = {} + from.object.onvaluechange = function() { + for( var key in from.object.functions ) { + from.object.functions[ key ]() + } + } + } + + mapping = target.object[ target.Name ].mapping = _map + + target.mapping.from = from + + var fcn_name = target.propertyName + ' <- ' + from.object.propertyName + '.' + from.Name + + from.object.functions[ fcn_name ] = function() { + var val = mapping.callback( from.object[ from.propertyName ], target.min, target.max, from.min, from.max, target.output, from.wrap ) + // target.object[ target.Name ].value = val + // console.log( target.Name ) + target.object[ target.Name ].oldSetter.call( target.object[ target.Name ], val ) + } + // from.object.onvaluechange = function() { + // var val = map.callback( this[ from.propertyName ], target.min, target.max, from.min, from.max, target.output, from.wrap ) + // target.object[ target.propertyName ] = val + // } + mapping.replace = function() { + // var old = from.functions[ target.Name ] + } + + mapping.remove = function() { + console.log( "mapping removed" ) + delete from.object.functions[ fcn_name ] + } + + if( from.object.setValue ) + from.object.setValue( target.object[ target.propertyName ] ) + + // if( typeof from.object.label !== 'undefined' ) { + // from.object.label = target.object.propertyName + '.' + target.Name + // } + if( typeof from.object.label !== 'undefined' ) { + var labelString = '' + for( var i = 0; i < from.targets.length; i++ ) { + var __target = from.targets[ i ] + labelString += __target[0].object.propertyName + '.' + __target[1] + if( i !== from.targets.length - 1 ) labelString += ' & ' + } + from.object.label = labelString + } + + return mapping + }, + audio: function( target, from ) { + var mapping + + mapping = target.object[ target.Name ].mapping = Gibber.Audio.Core.Binops.Map( null, target.min, target.max, from.min, from.max, target.output, from.wrap ) + + if( typeof from.object.track !== 'undefined' && from.object.track.input === from.object.properties[ from.propertyName ] ) { + mapping.follow = from.object.track + mapping.follow.count++ + }else{ + mapping.follow = new Gibber.Audio.Core.Follow({ input:from.object.properties[ from.propertyName ], useAbsoluteValue: false }) + mapping.follow.count = 1 + } + + from.object.track = target.object[ target.Name ].mapping.follow + + // assign input after Map ugen is created so that follow can be assigned to the mapping object + mapping.input = mapping.follow + + mapping.bus = new Gibber.Audio.Core.Bus2({ amp:0 }).connect() + + mapping.connect( mapping.bus ) + + mapping.replace = function( replacementObject, key, Key ) { + mapping.follow.input = replacementObject + if( replacementObject[ Key ].targets.indexOf( target ) === -1 ) replacementObject[ Key ].targets.push( [target, target.Name] ) + } + + var env = mapping.follow.bufferSize + Object.defineProperty( target.object[ target.Name ], 'env', { + get: function() { return env }, + set: function(v) { env = Gibber.Clock.time( v ); mapping.follow.bufferSize = env; } + }) + + mapping.update = function() { + target.object[ target.propertyName ]( mapping.getValue() ) + } + mapping.text = target.object + + // let Notation object handle scheduling updates + Gibber.Environment.Notation.add( mapping ) + + mapping.remove = function() { + this.bus.disconnect() + + if( this.follow ) { + this.follow.count-- + if( this.follow.count === 0) { + delete from.object.track + this.follow.remove() + } + } + + Gibber.Environment.Notation.remove( mapping ) + + delete target.object[ target.Name ].mapping + } + + return mapping + }, + audioOut : function( target, from ) { + if( typeof target.object[ target.Name ].mapping === 'undefined') { + var mapping = target.object[ target.Name ].mapping = Gibber.Audio.Core.Binops.Map( null, target.min, target.max, 0, 1, 0 ) + + if( typeof from.object.track !== 'undefined' && from.object.track.input === from.object.properties[ from.propertyName ] ) { + mapping.follow = from.object.track + mapping.follow.count++ + }else{ + mapping.follow = new Gibber.Audio.Core.Follow({ input:from.object, useAbsoluteValue: true }) + mapping.follow.count = 1 + } + + from.object.track = mapping.follow + + var env = mapping.follow.bufferSize + Object.defineProperty( target.object[ target.Name ], 'env', { + configurable:true, + get: function() { return env }, + set: function(v) { env = Gibber.Clock.time( v ); mapping.follow.bufferSize = env; } + }) + + mapping.input = mapping.follow + mapping.bus = new Gibber.Audio.Core.Bus2({ amp:0 }).connect() + mapping.connect( mapping.bus ) + + mapping.replace = function( replacementObject, key, Key ) { + // what if new mapping isn't audio type? + if ( replacementObject[ Key ].timescale === from.timescale ) { + var idx = mapping.follow.input[ from.Name ].targets.indexOf( target ) + if( idx >= -1 ) { + mapping.follow.input[ from.Name ].targets.splice( idx, 1 ) + } + + mapping.follow.input = replacementObject + if( replacementObject[ Key ].targets.indexOf( target ) === -1 ) replacementObject[ Key ].targets.push( [target, target.Name] ) + }else{ + mapping.bus.disconnect() + mapping.follow.remove() + Gibber.createMappingObject( target, replacementObject ) + } + + } + }else{ + mapping.replace( from.object, from.propertyName, from.Name ) + return mapping + } + + mapping.update = function() { + target.object[ target.propertyName ]( mapping.getValue() ) + } + mapping.text = target.object + + // let Notation object handle scheduling updates + Gibber.Environment.Notation.add( mapping ) + + mapping.remove = function() { + this.bus.disconnect() + + if( this.follow ) { + this.follow.count-- + if( this.follow.count === 0) { + delete from.object.track + this.follow.remove() + } + } + + Gibber.Environment.Notation.remove( mapping ) + + delete target.object[ target.Name ].mapping + } + return mapping + } + }, + } + + return mappings +} + +module.exports.outputCurves= { + LINEAR:0, + LOGARITHMIC:1 +} +},{}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/gibber.core.lib/scripts/pattern.js":[function(require,module,exports){ +module.exports = function( Gibber ) { + +"use strict" + +var $ = require( './dollar' ) + +var PatternProto = { + concat : function( _pattern ) { this.values = this.values.concat( _pattern.values ) }, + toString: function() { return this.values.toString() }, + valueOf: function() { return this.values }, + getLength: function() { + var l + if( this.start <= this.end ) { + l = this.end - this.start + 1 + }else{ + l = this.values.length + this.end - this.start + 1 + } + return l + }, + runFilters : function( val, idx ) { + var args = [ val, 1, idx ] // 1 is phaseModifier + + for( var i = 0; i < this.filters.length; i++ ) { + args = this.filters[ i ]( args, this ) + } + + return args + }, + checkForUpdateFunction: function( name, _arguments ) { + var args = Array.prototype.slice.call( _arguments, 0 ) + + if( this.listeners[ name ] ) { + this.listeners[ name ].apply( this, args ) + }else if( Pattern.listeners[ name ] ) { + Pattern.listeners[ name ].apply( this, args ) + } + }, + _onchange : function() {}, +} + +var Pattern = function() { + if( ! ( this instanceof Pattern ) ) { + var args = Array.prototype.slice.call( arguments, 0 ) + return Gibber.construct( Pattern, args ) + } + + var fnc = function() { + var len = fnc.getLength(), + idx, val, args + + if( len === 1 ) { + idx = 0 + }else{ + idx = fnc.phase > -1 ? Math.floor( fnc.start + (fnc.phase % len ) ) : Math.floor( fnc.end + (fnc.phase % len ) ) + } + + val = fnc.values[ Math.floor( idx % fnc.values.length ) ] + args = fnc.runFilters( val, idx ) + + fnc.phase += fnc.stepSize * args[ 1 ] + val = args[ 0 ] + + // check to see if value is a function, and if so evaluate it + if( typeof val === 'function' ) { + val = val() + } + /*else if ( Array.isArray( val ) ) { + // if val is an Array, loop through array and evaluate any functions found there. TODO: IS THIS SMART? + + for( var i = 0; i < val.length; i++ ){ + if( typeof val[ i ] === 'function' ) { + val[ i ] = val[ i ]() + } + } + } + */ + + // if pattern has update function, set new value + if( fnc.update ) fnc.update.value = val + + return val + } + + $.extend( fnc, { + start : 0, + end : 0, + phase : 0, + values : Array.prototype.slice.call( arguments, 0 ), + //values : typeof arguments[0] !== 'string' || arguments.length > 1 ? Array.prototype.slice.call( arguments, 0 ) : arguments[0].split(''), + original : null, + storage : [], + stepSize : 1, + integersOnly : false, + filters : [], + onchange : null, + + range : function() { + var start, end + + if( Array.isArray( arguments[0] ) ) { + start = arguments[0][0] + end = arguments[0][1] + }else{ + start = arguments[0] + end = arguments[1] + } + + if( start < end ) { + fnc.start = start + fnc.end = end + }else{ + fnc.start = end + fnc.end = start + } + + this.checkForUpdateFunction( 'range', [ fnc ] ) + + return fnc + }, + + set: function() { + var args = Array.isArray( arguments[ 0 ] ) ? arguments[ 0 ] : arguments + + fnc.values.length = 0 + + for( var i = 0; i < args.length; i++ ) { + fnc.values.push( args[ i ] ) + } + + fnc.end = fnc.values.length - 1 + + // if( fnc.end > fnc.values.length - 1 ) { + // fnc.end = fnc.values.length - 1 + // }else if( fnc.end < ) + + fnc._onchange() + + return fnc + }, + + reverse : function() { + //fnc.values.reverse(); + var array = fnc.values, + left = null, + right = null, + length = array.length, + temporary; + + for (left = 0, right = length - 1; left < right; left += 1, right -= 1) { + temporary = array[left]; + array[left] = array[right]; + array[right] = temporary; + } + + fnc._onchange() + + return fnc; + }, + // humanize: function( randomMin, randomMax ) { + // var lastAmt = 0 + // + // for( var i = 0; i < this.filters.length; i++ ) { + // if( this.filters[ i ].humanize ) { + // lastAmt = this.filters[ i ].lastAmt + // this.filters.splice( i, 1 ) + // break; + // } + // } + // + // var filter = function( args ) { + // console.log( filter.lastAmt, args[0]) + // args[ 0 ] -= filter.lastAmt + // filter.lastAmt = Gibber.Clock.time( Gibber.Utilities.rndi( randomMin, randomMax ) ) + // + // console.log( "LA", filter.lastAmt ) + // args[0] += filter.lastAmt + // + // return args + // } + // filter.lastAmt = lastAmt + // filter.humanize = true + // + // this.filters.push( filter ) + // + // return this + // }, + repeat: function() { + var counts = {} + + for( var i = 0; i < arguments.length; i +=2 ) { + counts[ arguments[ i ] ] = { + phase: 0, + target: arguments[ i + 1 ] + } + } + + var repeating = false, repeatValue = null, repeatIndex = null + var filter = function( args ) { + var value = args[ 0 ], phaseModifier = args[ 1 ], output = args + + //console.log( args, counts ) + if( repeating === false && counts[ value ] ) { + repeating = true + repeatValue = value + repeatIndex = args[2] + } + + if( repeating === true ) { + if( counts[ repeatValue ].phase !== counts[ repeatValue ].target ) { + output[ 0 ] = repeatValue + output[ 1 ] = 0 + output[ 2 ] = repeatIndex + //[ val, 1, idx ] + counts[ repeatValue ].phase++ + }else{ + counts[ repeatValue ].phase = 0 + output[ 1 ] = 1 + if( value !== repeatValue ) { + repeating = false + }else{ + counts[ repeatValue ].phase++ + } + } + } + + return output + } + + fnc.filters.push( filter ) + + return fnc + }, + + reset : function() { fnc.values = fnc.original.slice( 0 ); fnc._onchange(); return fnc; }, + store : function() { fnc.storage[ fnc.storage.length ] = fnc.values.slice( 0 ); return fnc; }, + transpose : function( amt ) { + for( var i = 0; i < fnc.values.length; i++ ) { + var val = fnc.values[ i ] + + if( $.isArray( val ) ) { + for( var j = 0; j < val.length; j++ ) { + if( typeof val[ j ] === 'number' ) { + val[ j ] = fnc.integersOnly ? Math.round( val[ j ] + amt ) : val[ j ] + amt + } + } + }else{ + if( typeof val === 'number' ) { + fnc.values[ i ] = fnc.integersOnly ? Math.round( fnc.values[ i ] + amt ) : fnc.values[ i ] + amt + } + } + } + + fnc._onchange() + + return fnc + }, + shuffle : function() { + Gibber.Utilities.shuffle( fnc.values ) + fnc._onchange() + + return fnc + }, + scale : function( amt ) { + for( var i = 0; i < fnc.values.length; i++ ) { + var val = fnc.values[ i ] + if( $.isArray( val ) ) { + for( var j = 0; j < val.length; j++ ) { + if( typeof val[ j ] === 'number' ) { + val[ j ] = fnc.integersOnly ? Math.round( val[ j ] * amt ) : val[ j ] * amt + } + } + }else{ + if( typeof val === 'number' ) { + fnc.values[ i ] = fnc.integersOnly ? Math.round( fnc.values[ i ] * amt ) : fnc.values[ i ] * amt + } + } + } + fnc._onchange() + + return fnc + }, + + flip : function() { + var start = [], + ordered = null + + ordered = fnc.values.filter( function(elem) { + var shouldPush = start.indexOf( elem ) === -1 + if( shouldPush ) start.push( elem ) + return shouldPush + }) + + ordered = ordered.sort( function( a,b ){ return a - b } ) + + for( var i = 0; i < fnc.values.length; i++ ) { + var pos = ordered.indexOf( fnc.values[ i ] ) + fnc.values[ i ] = ordered[ ordered.length - pos - 1 ] + } + + fnc._onchange() + + return fnc + }, + + invert: function() { + var prime0 = fnc.values[ 0 ] + + for( var i = 1; i < fnc.values.length; i++ ) { + if( typeof fnc.values[ i ] === 'number' ) { + var inverse = prime0 + (prime0 - fnc.values[ i ]) + fnc.values[ i ] = inverse + } + } + + fnc._onchange() + + return fnc + }, + + switch : function( to ) { + if( fnc.storage[ to ] ) { + fnc.values = fnc.storage[ to ].slice( 0 ) + } + + fnc._onchange() + + return fnc + }, + + rotate : function( amt ) { + if( amt > 0 ) { + while( amt > 0 ) { + var end = fnc.values.pop() + fnc.values.unshift( end ) + amt-- + } + }else if( amt < 0 ) { + while( amt < 0 ) { + var begin = fnc.values.shift() + fnc.values.push( begin ) + amt++ + } + } + + fnc._onchange() + + return fnc + } + }) + + Object.defineProperty( fnc, 'size', { + get: function() { return this.values.length }, + set: function(v){ + Gibber.log( 'cannot set size of pattern; use pattern.set() to update pattern contents.' ) + } + }) + + fnc.retrograde = fnc.reverse.bind( fnc ) + + fnc.end = fnc.values.length - 1 + + fnc.original = fnc.values.slice( 0 ) + fnc.storage[ 0 ] = fnc.original.slice( 0 ) + + fnc.integersOnly = fnc.values.every( function( n ) { return n === +n && n === (n|0); }) + + var methodNames = [ + 'rotate','switch','invert','reset', 'flip', + 'transpose','reverse','shuffle','scale', + 'store', 'range', 'set' + ] + + Gibber.createProxyMethods( fnc, methodNames , true ) + + // for( var i = 0; i < methodNames.length; i++ ) { + // var name = methodNames[ i ] + // + // fnc[ name ].listeners = {} + // } + fnc.listeners = {} + + Gibber.createProxyProperties( fnc, { 'stepSize':0, 'start':0, 'end':0 }) + + // trying to figure out a way for calls like: a.note.durations.seq( [1/8,1/16], 1/2 ) ... + + // future( function() { + // fnc._seq = fnc.seq + // + // fnc.seq = function() { + // var args = Array.prototype.slice.call( arguments, 0 ) + // + // fnc.set.seq.apply( fnc, args ) + // } + // }, ms(100) ) + + + fnc.__proto__ = this.__proto__ + + return fnc +} + +Pattern.listeners = {} +Pattern.prototype = PatternProto + +return Pattern + +} + +},{"./dollar":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/gibber.core.lib/scripts/dollar.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/gibber.core.lib/scripts/utilities.js":[function(require,module,exports){ +module.exports = function( Gibber ) { + +"use strict" + +var soloGroup = [], + isSoloing = false, + $ = Gibber.dollar, + Synths = { Presets: {} }, + Gibberish = Gibber.Audio ? Gibber.Audio.Core : null ,//require( 'gibberish-dsp' ), + Clock = Gibber.Clock, + rnd = Math.random, + + Utilities = { + seq : function() { + var arg = arguments[0], + type = typeof arg, + list = [], + output = null + + if( type === 'object' ) { + if( Array.isArray( arg ) ) type = 'array' + } + + // switch( type ) { + // case 'function': + // output = arg + // break; + // case 'array': + // for( var i = 0; i < arg.length; i++ ) { + // var elem = arg[ i ] + // if( typeof ) + // } + // break; + // default: + // output = function() { return arg } + // break; + // } + + return output + }, + random : function() { + this.randomFlag = true + this.randomArgs = Array.prototype.slice.call( arguments, 0 ) + // var dict = {}, + // lastChosen = null; + // + // for(var i = 0; i < arguments.length; i+=2) { + // dict[ "" + arguments[i] ] = { repeat: arguments[i+1], count: 0 }; + // } + // + // this.pick = function() { + // var value = 0, index, lastValue; + // if(this[lastChosen]) lastValue = this[lastChosen] + // + // if(lastChosen !== null && dict[ lastValue ].count++ <= dict[ lastValue ].repeat) { + // index = lastChosen; + // if( dict[ lastValue ].count >= dict[ lastValue ].repeat) { + // dict[ lastValue ].count = 0; + // lastChosen = null; + // }; + // }else{ + // index = Utilities.rndi(0, this.length - 1); + // value = this[index]; + // if( typeof dict[ ""+value ] !== 'undefined' ) { + // dict[ ""+value ].count = 1; + // lastChosen = index; + // }else{ + // lastChosen = null; + // } + // } + + return this + }, + + random2 : function() { + var dict = {}, + lastChosen = null, + that = this; + + for(var i = 0; i < arguments.length; i+=2) { + dict[ "" + arguments[i] ] = { repeat: arguments[i+1], count: 0 }; + } + + this.pick = function() { + var value = 0, index, lastValue; + if(that[lastChosen]) lastValue = that[lastChosen] + + if(lastChosen !== null && dict[ lastValue ].count++ <= dict[ lastValue ].repeat) { + index = lastChosen; + if( dict[ lastValue ].count >= dict[ lastValue ].repeat) { + dict[ lastValue ].count = 0; + lastChosen = null; + }; + }else{ + index = Utilities.rndi(0, that.length - 1); + value = that[index]; + if( typeof dict[ ""+value ] !== 'undefined' ) { + dict[ ""+value ].count = 1; + lastChosen = index; + }else{ + lastChosen = null; + } + } + + return that[ index ]; // return index, not value as required by secondary notation stuff + } + + return this.pick + }, + + choose: function( length ) { + var output = null + + if( isNaN( length ) ) length = 1 + + if( length !== 1 ) { + var arr = [] + + for( var i = 0; i < length; i++ ) { + arr[ i ] = this[ Utilities.rndi( 0, this.length - 1 ) ] + } + + output = arr + }else{ + output = this[ Utilities.rndi( 0, this.length - 1 ) ] + } + + return output; + }, + + future : function(func, time) { + var count = 0 + + var __seq = Gibber.Audio.Seqs.Seq( + function() { + if( count === 1 ) { + func() + __seq.stop() + __seq.disconnect() + } + count++ + }, + Gibber.Audio.Clock.time( time ) + ) + + return function(){ __seq.stop(); __seq.disconnect(); } + }, + + shuffle : function( arr ) { + for(var j, x, i = arr.length; i; j = parseInt(Math.random() * i), x = arr[--i], arr[i] = arr[j], arr[j] = x); + }, + + solo : function( ugen ) { + var args = Array.prototype.slice.call( arguments, 0 ); + if( ugen ) { + if( isSoloing ) { Utilities.solo(); } // quick toggle on / off + + for( var j = 0; j < args.length; j++ ) { // check if user soloed ugen, but fx is actually feeding Master bus + var arg = args[ j ] + if( arg.fx.length > 0 ) { + args[j] = arg.fx[ arg.fx.length - 1 ] // get last fx in chain + } + } + + for(var i = 0; i < Master.inputs.length; i++) { + //console.log( i, Master.inputs[i] ) + var idx = args.indexOf( Master.inputs[i].value ), + _ugen = Master.inputs[i].value, + name = _ugen.name + + if( idx === -1 ) { + if( name !== 'polyseq' && name !== 'Seq' ) { // TODO: please, please, don't route seqs into master bus... + Master.inputs[i]._amp = Master.inputs[i].amp + Master.inputs[i].amp = 0//value = Mul( Master.inputs[i].value, 0 ) + soloGroup.push( Master.inputs[i] ); + } + } + } + isSoloing = true; + }else{ + for( var i = 0; i < soloGroup.length; i++ ) { + soloGroup[i].amp = soloGroup[i]._amp + } + soloGroup.length = 0 + isSoloing = false; + } + }, + fill : function( length, fnc ) { + if( isNaN( length ) ) length = 16 + if( typeof fnc !== 'function' ) { fnc = Rndf() } + + fnc = fnc.bind( this ) + + for( var i = 0; i < length; i++ ) { + this[ i ] = fnc() + } + + return this + }, + merge : function() { + var output = [] + for( var i = 0; i < this.length; i++ ) { + var arg = this[ i ] + if( Array.isArray( arg ) ) { + for( var j = 0; j < arg.length; j++ ) { + output.push( arg[ j ] ) + } + }else{ + output.push( arg ) + } + } + + return output + }, + weight : function() { + var weights = Array.prototype.slice.call( arguments, 0 ) + this.pick = function() { + var returnValue = this[0], + total = 0, + _rnd = Utilities.rndf(); + + for(var i = 0; i < weights.length; i++) { + total += weights[i]; + if( _rnd < total ) { + returnValue = i; + break; + } + } + return returnValue; + } + + return this + }, + gibberArray: function( arr ) { + + }, + rndf : function(min, max, number, canRepeat) { + canRepeat = typeof canRepeat === "undefined" ? true : canRepeat; + if(typeof number === "undefined" && typeof min != "object") { + if(arguments.length == 1) { + max = arguments[0]; min = 0; + }else if(arguments.length == 2) { + min = arguments[0]; + max = arguments[1]; + }else{ + min = 0; + max = 1; + } + + var diff = max - min, + r = Math.random(), + rr = diff * r + + return min + rr; + }else{ + var output = []; + var tmp = []; + if(typeof number === "undefined") { + number = max || min.length; + } + + for(var i = 0; i < number; i++) { + var num; + if(typeof arguments[0] === "object") { + num = arguments[0][rndi(0, arguments[0].length - 1)]; + }else{ + if(canRepeat) { + num = Utilities.rndf(min, max); + }else{ + num = Utilities.rndf(min, max); + while(tmp.indexOf(num) > -1) { + num = Utilities.rndf(min, max); + } + tmp.push(num); + } + } + output.push(num); + } + return output; + } + }, + + Rndf : function() { + var _min, _max, quantity, random = Math.random, canRepeat; + + if(arguments.length === 0) { + _min = 0; _max = 1; + }else if(arguments.length === 1) { + _max = arguments[0]; _min = 0; + }else if(arguments.length === 2) { + _min = arguments[0]; _max = arguments[1]; + }else if(arguments.length === 3) { + _min = arguments[0]; _max = arguments[1]; quantity = arguments[2]; + }else{ + _min = arguments[0]; _max = arguments[1]; quantity = arguments[2]; canRepeat = arguments[3]; + } + + return function() { + var value, min, max, range; + + min = typeof _min === 'function' ? _min() : _min + max = typeof _max === 'function' ? _max() : _max + + if( typeof quantity === 'undefined') { + value = Utilities.rndf( min, max ) + }else{ + value = Utilities.rndf( min, max, quantity, canRepeat ) + } + + return value; + } + }, + + rndi : function( min, max, number, canRepeat ) { + var range; + + if(arguments.length === 0) { + min = 0; max = 1; + }else if(arguments.length === 1) { + max = arguments[0]; min = 0; + }else if( arguments.length === 2 ){ + min = arguments[0]; max = arguments[1]; + }else{ + min = arguments[0]; max = arguments[1]; number = arguments[2]; canRepeat = arguments[3]; + } + + range = max - min + if( range < number ) canRepeat = true + + if( typeof number === 'undefined' ) { + range = max - min + return Math.round( min + Math.random() * range ); + }else{ + var output = []; + var tmp = []; + + for(var i = 0; i < number; i++) { + var num; + if(canRepeat) { + num = Utilities.rndi(min, max); + }else{ + num = Utilities.rndi(min, max); + while(tmp.indexOf(num) > -1) { + num = Utilities.rndi(min, max); + } + tmp.push(num); + } + output.push(num); + } + return output; + } + }, + + Rndi : function() { + var _min, _max, quantity, random = Math.random, round = Math.round, canRepeat, range; + + if(arguments.length === 0) { + _min = 0; _max = 1; + }else if(arguments.length === 1) { + _max = arguments[0]; _min = 0; + }else if(arguments.length === 2) { + _min = arguments[0]; _max = arguments[1]; + }else if(arguments.length === 3) { + _min = arguments[0]; _max = arguments[1]; quantity = arguments[2]; + }else{ + _min = arguments[0]; _max = arguments[1]; quantity = arguments[2]; canRepeat = arguments[3]; + } + + range = _max - _min + if( typeof quantity === 'number' && range < quantity ) canRepeat = true + + return function() { + var value, min, max, range; + + min = typeof _min === 'function' ? _min() : _min + max = typeof _max === 'function' ? _max() : _max + + if( typeof quantity === 'undefined') { + value = Utilities.rndi( min, max ) + }else{ + value = Utilities.rndi( min, max, quantity, canRepeat ) + } + + return value; + } + }, + export : function( target ) { + target.rndi = Utilities.rndi + target.rndf = Utilities.rndf + target.Rndi = Utilities.Rndi + target.Rndf = Utilities.Rndf + + target.future = Utilities.future + target.solo = Utilities.solo + }, + init: function() { + // window.solo = Utilities.solo + // window.future = Utilities.future // TODO: fix global reference + Array.prototype.random = Array.prototype.rnd = Utilities.random + // Array.prototype.weight = Utilities.weight + // Array.prototype.fill = Utilities.fill + // Array.prototype.choose = Utilities.choose + // // Array.prototype.Rnd = Utilities.random2 + // Array.prototype.merge = Utilities.merge + } + } + + return Utilities +} + +},{}],"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/gibberish-dsp/build/gibberish.js":[function(require,module,exports){ +(function (global){ +!function (root, factory) { + if (typeof define === "function" && define.amd) { + define([], factory); + } else if (typeof exports === "object") { + module.exports = factory(); + } else { + root.Gibberish = factory(); + } +}(this, function () { +/**#Gibberish - Miscellaneous +Gibberish is the main object used to manage the audio graph and perform codegen functions. All constructors are also inside of the Gibberish object. Gibberish can automatically generate an appropriate web audio callback for you; if you want to use this you must execute the Gibberish.init() command before creating any Gibberish ugens. + +## Example Usage## +`// make a sine wave +Gibberish.init(); +a = new Gibberish.Sine().connect();` +## Constructor +**param** *bufferSize*: Integer. Default 1024. The size of the buffer to be calculated. Since JavaScript is single-threaded, setting exceedingly large values for this will yield to stuttering in graphics and user interface performance. +- - - - +**/ +/**###Gibberish.audioFiles : property +Array. Anytime an audiofile is loaded (normally using the Sampler ugen) the resulting sample buffer is stored in this array so that it can be immediately recalled. +**/ +/**###Gibberish.callback : property +String. Whenever Gibberish performs code generation the resulting callback is stored here. +**/ +/**###Gibberish.out : property +Object. The is the 'master' bus that everything eventually gets routed to if you're using the auto-generated calback. This bus is initialized in the call to Gibberish.init. +**/ +/**###Gibberish.dirtied : property +Array. A list of objects that need to be codegen'd +**/ +/**###Gibberish.isDirty : property +Booelan. Whether or codegen should be performed. +**/ +/**###Gibberish.codeblock : property +Array. During codegen, each ugen's codeblock is inserted into this array. Once all the ugens have codegen'd, the array is concatenated to form the callback. +**/ +/**###Gibberish.upvalues : property +Array. Each ugen's callback function is stored in this array; the contents of the array become upvalues to the master callback function when it is codegen'd. +**/ +/**###Gibberish.debug : property +Boolean. Default false. When true, the callbackString is printed to the console whenever a codegen is performed +**/ +/**###Gibberish.memo : property +Object. Used in the codegen process to make sure codegen for each ugen is only performed once. +**/ + + +var Gibberish = { + memo : {}, + codeblock : [], + analysisCodeblock : [], + analysisUgens : [], + dirtied : [], + id : 0, + isDirty : false, // whether or not callback needs to codegen'd + out : null, // main output bus + debug : false, + callback : '', + audioFiles : {}, + sequencers : [], + callbackArgs : ['input'], // names of function arguments for main audio callback + callbackObjects : [], // ugen function callbacks used in main audio callback + analysisCallbackArgs : [], + analysisCallbackObjects : [], + onBlock: null, +/**###Gibberish.createCallback : method +Perform codegen on all dirty ugens and re-create the audio callback. This method is called automatically in the default Gibberish sample loop whenever Gibberish.isDirty is true. +**/ + createCallback : function() { + this.memo = {}; + + this.codeblock.length = 0; + + this.callbackArgs.length = 0; + this.callbackObjects.length = 0; + this.analysisCallbackArgs.length = 0; + + /* generate code for dirty ugens */ + /*for(var i = 0; i < this.dirtied.length; i++) { + this.dirtied[i].codegen(); + }*/ + this.dirtied.length = 0; + + this.codestring = '\t' + + this.args = ['input'] + + this.out.codegen() + + var codeblockStore = this.codeblock.slice(0) + + // we must push these here because the callback arguments are at the start of the string, + // but we have to wait to codegen the analysis ugens until after their targets have been codegen'd + if(this.analysisUgens.length > 0) { + this.analysisCodeblock.length = 0; + for(var i = 0; i < this.analysisUgens.length; i++) { + this.analysisCallbackArgs.push( this.analysisUgens[i].analysisSymbol ) + } + } + + this.args = this.args.concat( this.callbackArgs ) + + this.args = this.args.concat( this.analysisCallbackArgs ) + + /* concatenate code for all ugens */ + //this.memo = {}; + + this.codestring += codeblockStore.join('\t') //this.codeblock.join("\t"); + this.codestring += "\n\t"; + + /* analysis codeblock */ + if(this.analysisUgens.length > 0) { + this.analysisCodeblock.length = 0; + for(var i = 0; i < this.analysisUgens.length; i++) { + this.codeblock.length = 0; + this.analysisUgens[i].analysisCodegen(); + /* + if(this.codestring !== 'undefined' ) { + this.codestring += this.codeblock.join(""); + this.codestring += "\n\t"; + this.analysisCodeblock.push ( this.analysisUgens[i].analysisCodegen() ); + } + */ + } + this.codestring += this.analysisCodeblock.join('\n\t'); + this.codestring += '\n\t'; + } + this.codestring += 'return ' + this.out.variable +';\n'; + + this.callbackString = this.codestring; + if( this.debug ) console.log( this.callbackString ); + + return [this.args, this.codestring]; + }, + +/**###Gibberish.audioProcess : method +The default audio callback used in Webkit browsers. This callback starts running as soon as Gibberish.init() is called. + +param **Audio Event** : Object. The HTML5 audio event object. +**/ + audioProcess : function(e){ + var bufferL = e.outputBuffer.getChannelData(0), + bufferR = e.outputBuffer.getChannelData(1), + input = e.inputBuffer.getChannelData(0), + me = Gibberish, + callback = me.callback, + sequencers = me.sequencers, + out = Gibberish.out.callback, + objs = me.callbackObjects.slice(0), + callbackArgs, callbackBody, _callback, val + + if( me.onBlock !== null ) me.onBlock( me.context ) + + objs.unshift(0) + + for(var i = 0, _bl = e.outputBuffer.length; i < _bl; i++){ + + for(var j = 0; j < sequencers.length; j++) { sequencers[j].tick(); } + + if(me.isDirty) { + _callback = me.createCallback(); + try{ + callback = me.callback = new Function( _callback[0], _callback[1] ) + }catch( e ) { + console.error( "ERROR WITH CALLBACK : \n\n", _callback ) + } + + me.isDirty = false; + objs = me.callbackObjects.slice(0) + objs.unshift(0) + } + + //console.log( "CB", callback ) + objs[0] = input[i] + val = callback.apply( null, objs ); + + bufferL[i] = val[0]; + bufferR[i] = val[1]; + } + }, +/**###Gibberish.audioProcessFirefox : method +The default audio callback used in Firefox. This callback starts running as soon as Gibberish.init() is called. + +param **Sound Data** : Object. The buffer of audio data to be filled +**/ + audioProcessFirefox : function(soundData) { // callback for firefox + var me = Gibberish, + callback = me.callback, + sequencers = me.sequencers, + objs = me.callbackObjects.slice(0), + _callback + + objs.unshift(0) + for (var i=0, size=soundData.length; i 0) { + // Request some sound data from the callback function. + var soundData = new Float32Array(available); + readFn(soundData); + + // Writting the data. + written = audio.mozWriteAudio(soundData); + currentPosition = audio.mozCurrentSampleOffset(); + if(written < soundData.length) { + // Not all the data was written, saving the tail. + tail = soundData; + tailPosition = written; + } + currentWritePosition += written; + } + }, 100); + }, +/**###Gibberish.AudioDataDestination : method +Create a callback and start it running. Note that in iOS audio callbacks can only be created in response to user events. Thus, in iOS this method assigns an event handler to the HTML body that creates the callback as soon as the body is touched; at that point the event handler is removed. +**/ + init : function() { + // TODO: GET A BETTER TEST FOR THIS. The problem is that browserify adds a process object... not sure how robust + // testing for the presence of the version property will be + var isNode = typeof global !== 'undefined', + bufferSize = typeof arguments[0] === 'undefined' ? 1024 : arguments[0], + audioContext, + start + + if( typeof webkitAudioContext !== 'undefined' ) { + audioContext = webkitAudioContext + }else if ( typeof AudioContext !== 'undefined' ) { + audioContext = AudioContext + } + + // we will potentially delay start of audio until touch of screen for iOS devices + start = function() { + if( typeof audioContext !== 'undefined' ) { + Gibberish.context = new audioContext(); + Gibberish.node = Gibberish.context.createScriptProcessor(bufferSize, 2, 2, Gibberish.context.sampleRate); + Gibberish.node.onaudioprocess = Gibberish.audioProcess; + Gibberish.node.connect(Gibberish.context.destination); + + + + if( document && document.documentElement && 'ontouchstart' in document.documentElement ) { + window.removeEventListener('touchstart', start); + + if('ontouchstart' in document.documentElement){ // required to start audio under iOS 6 + var mySource = Gibberish.context.createBufferSource(); + mySource.connect(Gibberish.context.destination); + mySource.noteOn(0); + } + }else{ + window.removeEventListener('click', start) + } + }else{ + alert('Your browser does not support javascript audio synthesis. Please download a modern web browser that is not Internet Explorer.') + } + + Gibberish.out = new Gibberish.Bus2(); + Gibberish.out.codegen(); // make sure bus is first upvalue so that clearing works correctly + Gibberish.dirty(Gibberish.out); + + if( Gibberish.onstart ) Gibberish.onstart() + } + + + if( document && document.documentElement && 'ontouchstart' in document.documentElement ) { + window.addEventListener('touchstart', start); + }else{ + window.addEventListener('click', start ) + //start(); + } + + return this; + }, + +/**###Gibberish.makePanner : method +Create and return an object that can be used to pan a stereo source. +**/ + // makePanner : function() { + // var sin = Math.sin; + // var cos = Math.cos; + // var sqrtTwoOverTwo = Math.sqrt(2) / 2; + // + // var f = function(val, pan, array) { + // var isObject = typeof val === 'object'; + // var l = isObject ? val[0] : val; + // var r = isObject ? val[1] : val; + // + // array[0] = l * (sqrtTwoOverTwo * (cos(pan) - sin(pan)) ); + // array[1] = r * (sqrtTwoOverTwo * (cos(pan) + sin(pan)) ); + // + // return array; + // }; + // + // return f; + // }, + +makePanner : function() { + // thanks to grrrwaaa for this + // create pan curve arrays (once-only): + var panTableL = [], panTableR = []; + var sqrtTwoOverTwo = Math.sqrt(2) / 2; + + for( var i = 0; i < 1024; i++ ) { + var pan = -1 + ( i / 1024 ) * 2; + panTableL[i] = (sqrtTwoOverTwo * (Math.cos(pan) - Math.sin(pan)) ); + panTableR[i] = (sqrtTwoOverTwo * (Math.cos(pan) + Math.sin(pan)) ); + } + + return function(val, pan, output) { + var isObject = typeof val === 'object', + l = isObject ? val[0] : val, + r = isObject ? val[1] : val, + _index, index, frac, index2, val1, val2; + + _index = ((pan + 1) * 1023) / 2 + index = _index | 0 + frac = _index - index; + index = index & 1023; + index2 = index === 1023 ? 0 : index + 1; + + val1 = panTableL[index]; + val2 = panTableL[index2]; + output[0] = ( val1 + ( frac * (val2 - val1) ) ) * l; + + val1 = panTableR[index]; + val2 = panTableR[index2]; + output[1] = ( val1 + ( frac * (val2 - val1) ) ) * r; + + return output; + } +}, + // IMPORTANT: REMEMBER THIS IS OVERRIDDEN IN GIBBER + defineUgenProperty : function(key, initValue, obj) { + var prop = obj.properties[key] = { + value: initValue, + binops: [], + parent : obj, + name : key, + }; + + Object.defineProperty(obj, key, { + configurable: true, + get: function() { return prop.value }, + set: function(val) { + prop.value = val; + Gibberish.dirty(obj); + }, + }); + }, +/**###Gibberish.polyInit : method +For ugens with polyphony, add metaprogramming that passes on property changes to the 'children' of the polyphonic object. Polyphonic ugens in Gibberish are just single instances that are routed into a shared bus, along with a few special methods for voice allocation etc. + +param **Ugen** : Object. The polyphonic ugen +**/ + polyInit : function(ugen) { + ugen.mod = ugen.polyMod; + ugen.removeMod = ugen.removePolyMod; + + ugen.voicesClear = function() { + if( ugen.children.length > 0 ) { + for( var i = 0; i < ugen.children.length; i++ ) { + ugen.children[ i ].disconnect() + } + ugen.children.length = 0 + ugen.voiceCount = 0 + } + } + + for(var key in ugen.polyProperties) { + (function(_key) { + var value = ugen.polyProperties[_key]; + + Object.defineProperty(ugen, _key, { + configurable: true, + get : function() { return value; }, + set : function(val) { + value = val; + for(var i = 0; i < ugen.children.length; i++) { + ugen.children[i][_key] = value; + } + }, + }); + + })(key); + } + + var maxVoices = ugen.maxVoices + Object.defineProperty( ugen, 'maxVoices', { + get: function() { return maxVoices }, + set: function(v) { maxVoices = v; this.voicesClear(); this.initVoices() } + }) + }, + +/**###Gibberish.interpolate : method +Similiar to makePanner, this method returns a function that can be used to linearly interpolate between to values. The resulting function takes an array and a floating point position index and returns a value. +**/ + interpolate : function(arr, phase){ + var index = phase | 0, // round down + index2 = index + 1 > arr.length - 1 ? 0 : index + 1; + frac = phase - index; + + return arr[index] + frac * (arr[index2] - arr[index]); + }, + + pushUnique : function(item, array) { + var obj = item; + var shouldAdd = true; + + for(var j = 0; j < array.length; j++) { + if(obj === array[j]) { + shouldAdd = false; + break; + } + } + + if(shouldAdd) { + array.push(obj); + } + }, + + export : function(key, obj) { + for(var _key in Gibberish[key]) { + //console.log("exporting", _key, "from", key); + obj[_key] = Gibberish[key][_key]; + } + }, + +/**###Gibberish.ugen : method +Creates a prototype object that is used by all ugens. +**/ + ugen : function() { + Gibberish.extend(this, { + +/**#Ugen - Miscellaneous +The prototype object that all ugens inherit from +**/ +/**###Ugen.processProperties : method +Used to assign and process arguments passed to the constructor functions of ugens. + +param **argumentList** : Array. A list of arguments (may be a single dictionary) passed to a ugen constructor. +**/ + + processProperties : function(args){ + if(typeof arguments[0][0] === 'object' && typeof arguments[0][0].type === 'undefined' && !Array.isArray(arguments[0][0]) && arguments[0][0].name !== 'op') { + var dict = arguments[0][0]; + for(var key in dict) { + if(typeof dict[key] !== 'undefined') { + if(typeof this.properties[key] === 'object' && typeof this.properties[key].binops !== 'undefined') { + this.properties[key].value = dict[key]; + }else{ + this[key] = dict[key]; + } + } + } + }else{ + var i = 0; + for(var key in this.properties) { + if(typeof this.properties[key] === 'object' && typeof this.properties[key].binops !== 'undefined') { + if(typeof arguments[0][i] !== 'undefined'){ + this.properties[key].value = arguments[0][i++]; + } + }else{ + if(typeof arguments[0][i] !== 'undefined') { + this.properties[key] = arguments[0][i++]; + } + } + } + } + return this; + }, + + valueOf: function() { + this.codegen() + //console.log( "VALUEOF", this.variable ) + return this.variable + }, +/**###Ugen.codegen : method +Generates output code (as a string) used inside audio callback +**/ + codegen : function() { + var s = '', + v = null, + initialized = false; + + if(Gibberish.memo[this.symbol]) { + //console.log("MEMO" + this.symbol); + return Gibberish.memo[this.symbol]; + }else{ + // we generate the symbol and use it to create our codeblock, but only if the ugen doesn't already have a variable assigned. + // since the memo is cleared every time the callback is created, we need to check to see if this exists. + v = this.variable ? this.variable : Gibberish.generateSymbol('v'); + Gibberish.memo[this.symbol] = v; + this.variable = v; + } + + s += 'var ' + v + " = " + this.symbol + "("; + + for(var key in this.properties) { + var property = this.properties[key]; + var value = ''; + //if(this.name === "single_sample_delay") { console.log( "SSD PROP" + key ); } + if( Array.isArray( property.value ) ) { + if(property.value.length === 0) value = 0; // primarily for busses + + for(var i = 0; i < property.value.length; i++) { + var member = property.value[i]; + if( typeof member === 'object' ) { + value += member !== null ? member.valueOf() : 'null'; + }else{ + if(typeof property.value === 'function') { + value += property.value(); + }else{ + value += property.value; + } + } + value += i < property.value.length - 1 ? ', ' : ''; + } + + }else if( typeof property.value === 'object' ) { + if( property.value !== null) { + value = property.value.codegen ? property.value.valueOf() : property.value + } + }else if( property.name !== 'undefined'){ + if(typeof property.value === 'function') { + value = property.value(); + }else{ + value = property.value; + } + } + + + if(property.binops.length != 0) { + for( var k = 0; k < property.binops.length; k++) { + s += '(' // all leading parenthesis... + } + for(var j = 0; j < property.binops.length; j++) { + var op = property.binops[j], + val; + + if( typeof op.ugen === 'number') { + val = op.ugen; + }else{ + val = op.ugen !== null ? op.ugen.valueOf() : 'null'; + } + + if(op.binop === "=") { + s = s.replace(value, ""); + s += val; + }else if(op.binop === "++"){ + s += ' + Math.abs(' + val + ')'; + }else{ + if( j === 0) s+= value + s += " " + op.binop + " " + val + ")"; + } + + } + }else{ + s += value + } + + s += ", "; + } + + if(s.charAt(s.length - 1) === " ") + s = s.slice(0, -2); // remove trailing spaces + + s += ");\n"; + + this.codeblock = s; + + if( Gibberish.codeblock.indexOf( this.codeblock ) === -1 ) Gibberish.codeblock.push( this.codeblock ) + if( Gibberish.callbackArgs.indexOf( this.symbol ) === -1 && this.name !== 'op') { Gibberish.callbackArgs.push( this.symbol ) } + if( Gibberish.callbackObjects.indexOf( this.callback ) === -1 && this.name !== 'op' ) { Gibberish.callbackObjects.push( this.callback ) } + + this.dirty = false; + + return v; + }, + +/**###Ugen.defineUgenProperty : method +Creates getters and setters for ugen properties that automatically dirty the ugen whenever the property value is changed. + +param **key** : String. The name of a property to add getter / setters for. +param **value** : Any. The initival value to set the property to +**/ + +/**###Ugen.init : method +Initialize ugen by calling defineUgenProperty for every key in the ugen's properties dictionary, generating a unique id for the ugen and various other small tasks. +**/ + init : function() { + if(!this.initalized) { + this.symbol = Gibberish.generateSymbol(this.name); + this.codeblock = null; + this.variable = null; + } + + if(typeof this.properties === 'undefined') { + this.properties = {}; + } + + if(!this.initialized) { + this.destinations = []; + for(var key in this.properties) { + Gibberish.defineUgenProperty(key, this.properties[key], this); + } + } + + if(arguments.length > 0 && typeof arguments[0][0] === 'object' && arguments[0][0].type === 'undefined') { + var options = arguments[0][0]; + for(var key in options) { + this[key] = options[key]; + } + } + + this.initialized = true; + + return this; + }, +/**###Ugen.mod : method +Modulate a property of a ugen on a per-sample basis. + +param **key** : String. The name of the property to modulate +param **value** : Any. The object or number value to modulate the property with +param **op** : String. Default "+". The operation to perform. Can be +,-,*,/,= or ++. ++ adds and returns the absolute value. +**/ + mod : function(name, value, op) { + var property = this.properties[ name ]; + var mod = { ugen:value, binop:op }; + property.binops.push( mod ); + + Gibberish.dirty( this ); + }, +/**###Ugen.removeMod : method +Remove a modulation from a ugen. + +param **key** : String. The name of the property to remove the modulation from +param **arg** : Number or Object. Optional. This determines which modulation to remove if more than one are assigned to the property. If this argument is undefined, all modulations are removed. If the argument is a number, the number represents a modulation in the order that they were applied (an array index). If the argument is an object, it removes a modulation that +is using a matching object as the modulator. +**/ + removeMod : function(name, arg) { + if(typeof arg === 'undefined' ) { + this.properties[name].binops.length = 0; + }else if(typeof arg === 'number') { + this.properties[name].binops.splice(arg, 1); + }else if(typeof arg === 'object') { + for(var i = 0, j = this.properties[name].binops.length; i < j; i++) { + if(this.properties[name].binops[i].ugen === arg) { + this.properties[name].binops.splice(i, 1); + } + } + }; + + Gibberish.dirty( this ); + }, + +/**###Ugen.polyMod : method +Applies a modulation to all children of a polyphonic ugen + +param **key** : String. The name of the property to modulate +param **value** : Any. The object or number value to modulate the property with +param **op** : String. Default "+". The operation to perform. Can be +,-,*,/,= or ++. ++ adds and returns the absolute value. +**/ + polyMod : function(name, modulator, type) { + for(var i = 0; i < this.children.length; i++) { + this.children[i].mod(name, modulator, type); + } + Gibberish.dirty(this); + }, + +/**###Ugen.removePolyMod : method +Removes a modulation from all children of a polyphonic ugen. The arguments + +param **arg** : Number or Object. Optional. This determines which modulation to remove if more than one are assigned to the property. If this argument is undefined, all modulations are removed. If the argument is a number, the number represents a modulation in the order that they were applied (an array index). If the argument is an object, it removes a modulation that +is using a matching object as the modulator. +**/ + removePolyMod : function() { + var args = Array.prototype.slice.call(arguments, 0); + + if(arguments[0] !== "amp" && arguments[0] !== "pan") { + for(var i = 0; i < this.children.length; i++) { + this.children[i].removeMod.apply(this.children[i], args); + } + }else{ + this.removeMod.apply(this, args); + } + + Gibberish.dirty(this); + }, + + smooth : function(property, amount) { + var op = new Gibberish.OnePole(); + this.mod(property, op, "="); + }, +/**###Ugen.connect : method +Connect the output of a ugen to a bus. + +param **bus** : Bus ugen. Optional. The bus to connect the ugen to. If no argument is passed the ugen is connect to Gibberish.out. Gibberish.out is automatically created when Gibberish.init() is called and can be thought of as the master stereo output for Gibberish. +**/ + connect : function(bus, position) { + if(typeof bus === 'undefined') bus = Gibberish.out; + + if(this.destinations.indexOf(bus) === -1 ){ + bus.addConnection( this, 1, position ); + this.destinations.push( bus ); + } + return this; + }, +/**###Ugen.send : method +Send an arbitrary amount of output to a bus + +param **bus** : Bus ugen. The bus to send the ugen to. +param **amount** : Float. The amount of signal to send to the bus. +**/ + send : function(bus, amount) { + if(this.destinations.indexOf(bus) === -1 ){ + bus.addConnection( this, amount ); + this.destinations.push( bus ); + }else{ + bus.adjustSendAmount(this, amount); + } + return this; + }, +/**###Ugen.disconnect : method +Disconnect a ugen from a bus (or all busses). This stops all audio and signal processing for the ugen. + +param **bus** : Bus ugen. Optional. The bus to disconnect the ugen from. If this argument is undefined the ugen will be disconnected from all busses. +**/ + disconnect : function(bus, tempDisconnect ) { // tempDisconnect is used to do a short disconnect and reconnect + var idx + + if( !tempDisconnect ) { + /*if( this.children ) { + for(var i = 0; i < this.children.length; i++) { + this.children[i].disconnect( this ) + } + }else if( typeof this.input === 'object' ) { + this.input.disconnect( null, tempDisconnect ) + }*/ + + /*var idx = Gibberish.callbackArgs.indexOf( this.symbol ) + Gibberish.callbackArgs.splice(idx, 1) + + idx = Gibberish.callbackObjects.indexOf( this.callback ) + Gibberish.callbackObjects.splice(idx, 1)*/ + } + + if( !bus ) { + for(var i = 0; i < this.destinations.length; i++) { + this.destinations[i].removeConnection( this ); + } + this.destinations = []; + }else{ + idx = this.destinations.indexOf(bus); + if(idx > -1) { + this.destinations.splice(idx, 1); + } + bus.removeConnection( this ); + } + + Gibberish.dirty( this ) + return this; + }, + }); + }, +}; + + +Array2 = function() { + this.length = 0; +}; + +Array2.prototype = []; + +Array2.prototype.remove = function(arg, searchDeep) { // searchDeep when true removes -all- matches, when false returns first one found. + searchDeep = typeof searchDeep === 'undefined' ? true : searchDeep; + if(typeof arg === "undefined") { // clear all + for(var i = 0; i < this.length; i++) { + delete this[i]; + } + this.length = 0; + }else if(typeof arg === "number") { + this.splice(arg,1); + }else if(typeof arg === "string"){ // find named member and remove + var removeMe = []; + for(var i = 0; i < this.length; i++) { + var member = this[i]; + if(member.type === arg || member.name === arg) { + if(!searchDeep) { + this.splice(i,1); + return; + }else{ + removeMe.push(i); + } + } + } + for(var i = 0; i < removeMe.length; i++) { + this.splice( removeMe[i], 1); + } + }else if(typeof arg === "object") { + var idx = this.indexOf(arg); + while(idx > -1) { + this.splice(idx,1); + idx = this.indexOf(arg); + } + } + if(this.parent) Gibberish.dirty(this.parent); +}; + +Array2.prototype.get = function(arg) { + if(typeof arg === "number") { + return this[arg]; + }else if(typeof arg === "string"){ // find named member and remove + for(var i = 0; i < this.length; i++) { + var member = this[i]; + + if(member.name === arg) { + return member; + } + } + }else if(typeof arg === "object") { + var idx = this.indexOf(arg); + if(idx > -1) { + return this[idx]; + } + } + return null; +}; + + +Array2.prototype.replace = function(oldObj, newObj) { + newObj.parent = this; + newObj.input = oldObj.input; + + if(typeof oldObj != "number") { + var idx = this.indexOf(oldObj); + if(idx > -1) { + this.splice(idx, 1, newObj); + } + }else{ + this.splice(oldObj, 1, newObj); + } + if(this.parent) Gibberish.dirty(this.parent); +}; + +Array2.prototype.insert = function(v, pos) { + v.parent = this; + this.input = this.parent; + + if(Array.isArray(v)) { + for(var i = 0; i < v.length; i++) { + this.splice(pos + i, 0, v[i]); + } + }else{ + this.splice(pos,0,v); + } + if(this.parent) Gibberish.dirty(this.parent); +}; + +Array2.prototype.add = function() { + for(var i = 0; i < arguments.length; i++) { + arguments[i].parent = this; + arguments[i].input = this.parent; + //console.log(this.parent, this.parent.channels); + //if(typeof this.parent.channels === "number") { + //console.log("CHANGING CHANNELS"); + //arguments[i].channels = this.parent.channels; + //} + this.push(arguments[i]); + } + //console.log("ADDING ::: this.parent = ", this.parent) + if(this.parent) { + console.log("DIRTYING"); + Gibberish.dirty(this.parent); + } + +}; + +var rnd = Math.random; +Gibberish.rndf = function(min, max, number, canRepeat) { + canRepeat = typeof canRepeat === "undefined" ? true : canRepeat; + if(typeof number === "undefined" && typeof min != "object") { + if(arguments.length == 1) { + max = arguments[0]; min = 0; + }else if(arguments.length == 2) { + min = arguments[0]; + max = arguments[1]; + }else{ + min = 0; + max = 1; + } + + var diff = max - min, + r = Math.random(), + rr = diff * r + + return min + rr; + }else{ + var output = []; + var tmp = []; + if(typeof number === "undefined") { + number = max || min.length; + } + + for(var i = 0; i < number; i++) { + var num; + if(typeof arguments[0] === "object") { + num = arguments[0][rndi(0, arguments[0].length - 1)]; + }else{ + if(canRepeat) { + num = Gibberish.rndf(min, max); + }else{ + num = Gibberish.rndf(min, max); + while(tmp.indexOf(num) > -1) { + num = Gibberish.rndf(min, max); + } + tmp.push(num); + } + } + output.push(num); + } + return output; + } +}; + +Gibberish.Rndf = function() { + var _min, _max, quantity, random = Math.random, canRepeat; + + if(arguments.length === 0) { + _min = 0; _max = 1; + }else if(arguments.length === 1) { + _max = arguments[0]; _min = 0; + }else if(arguments.length === 2) { + _min = arguments[0]; _max = arguments[1]; + }else if(arguments.length === 3) { + _min = arguments[0]; _max = arguments[1]; quantity = arguments[2]; + }else{ + _min = arguments[0]; _max = arguments[1]; quantity = arguments[2]; canRepeat = arguments[3]; + } + + return function() { + var value, min, max, range; + + min = typeof _min === 'function' ? _min() : _min + max = typeof _max === 'function' ? _max() : _max + + if( typeof quantity === 'undefined') { + value = Gibberish.rndf( min, max ) + }else{ + value = Gibberish.rndf( min, max, quantity, canRepeat ) + } + + return value; + } +}; + +Gibberish.rndi = function( min, max, number, canRepeat ) { + var range; + + if(arguments.length === 0) { + min = 0; max = 1; + }else if(arguments.length === 1) { + max = arguments[0]; min = 0; + }else if( arguments.length === 2 ){ + min = arguments[0]; max = arguments[1]; + }else{ + min = arguments[0]; max = arguments[1]; number = arguments[2]; canRepeat = arguments[3]; + } + + range = max - min + if( range < number ) canRepeat = true + + if( typeof number === 'undefined' ) { + range = max - min + return Math.round( min + Math.random() * range ); + }else{ + var output = []; + var tmp = []; + + for(var i = 0; i < number; i++) { + var num; + if(canRepeat) { + num = Gibberish.rndi(min, max); + }else{ + num = Gibberish.rndi(min, max); + while(tmp.indexOf(num) > -1) { + num = Gibberish.rndi(min, max); + } + tmp.push(num); + } + output.push(num); + } + return output; + } +}; + +Gibberish.Rndi = function() { + var _min, _max, quantity, random = Math.random, round = Math.round, canRepeat, range; + + if(arguments.length === 0) { + _min = 0; _max = 1; + }else if(arguments.length === 1) { + _max = arguments[0]; _min = 0; + }else if(arguments.length === 2) { + _min = arguments[0]; _max = arguments[1]; + }else if(arguments.length === 3) { + _min = arguments[0]; _max = arguments[1]; quantity = arguments[2]; + }else{ + _min = arguments[0]; _max = arguments[1]; quantity = arguments[2]; canRepeat = arguments[3]; + } + + range = _max - _min + if( typeof quantity === 'number' && range < quantity ) canRepeat = true + + return function() { + var value, min, max, range; + + min = typeof _min === 'function' ? _min() : _min + max = typeof _max === 'function' ? _max() : _max + + if( typeof quantity === 'undefined') { + value = Gibberish.rndi( min, max ) + }else{ + value = Gibberish.rndi( min, max, quantity, canRepeat ) + } + + return value; + } +}; + +Gibberish.extend = function(destination, source) { + for (var property in source) { + var keys = property.split("."); + if(source[property] instanceof Array && source[property].length < 100) { // don't copy large array buffers + destination[property] = source[property].slice(0); + if(property === "fx") { + destination[property].parent = source[property].parent; + } + }else if (typeof source[property] === "object" && source[property] !== null && !(source[property] instanceof Float32Array) ) { + destination[property] = destination[property] || {}; + arguments.callee(destination[property], source[property]); + } else { + destination[property] = source[property]; + } + } + return destination; +}; + +Function.prototype.clone=function(){ + return eval('['+this.toString()+']')[0]; +}; + +String.prototype.format = function(i, safe, arg) { + function format() { + var str = this, + len = arguments.length + 1; + + for (i = 0; i < len; arg = arguments[i++]) { + safe = arg; //typeof arg === 'object' ? JSON.stringify(arg) : arg; + str = str.replace(RegExp('\\{' + (i - 1) + '\\}', 'g'), safe); + } + return str; + } + + format.native = String.prototype.format; + + return format; +}(); + +Gibberish.future = function(func, time) { + var seq = new Gibberish.Sequencer({ + values:[ + function(){}, + function() { + func(); + seq.stop(); + seq.disconnect(); + } + ], + durations:[ time ] + }).start() + + seq.cancel = function() { + seq.stop(); + seq.disconnect(); + } + + return seq +} +Gibberish.Proxy = function() { + var value = 0; + + Gibberish.extend(this, { + name: 'proxy', + type: 'effect', + + properties : {}, + + callback : function() { + return value; + }, + }).init(); + + this.input = arguments[0]; + + value = this.input.parent[ this.input.name ]; + delete this.input.parent[ this.input.name ]; + + this.input.parent.properties[ this.input.name ].value = this; + + Object.defineProperty( this.input.parent, this.input.name, { + get : function(){ return value; }, + set : function(_value) { value = _value; } + }); + Gibberish.dirty(this.input.parent); +}; +Gibberish.Proxy.prototype = new Gibberish.ugen(); + +Gibberish.Proxy2 = function() { + var input = arguments[0], + name = arguments[1], + phase = 0 + + Gibberish.extend( this, { + name: 'proxy2', + type: 'effect', + + properties : { }, + + callback : function() { + var v = input[ name ] + // if( phase++ % 44100 === 0 ) console.log( v, input, name) + return Array.isArray( v ) ? ( v[0] + v[1] + v[2] ) / 3 : v + }, + }).init(); + + this.getInput = function() { return input } + this.setInput = function( v ) { input = v } + this.getName = function() { return name } + this.setName = function( v ) { name = v } +}; +Gibberish.Proxy2.prototype = new Gibberish.ugen(); + +Gibberish.Proxy3 = function() { + var input = arguments[0], + name = arguments[1], + phase = 0 + + Gibberish.extend( this, { + name: 'proxy3', + type: 'effect', + + properties : { }, + + callback : function() { + var v = input[ name ] + //if( phase++ % 44100 === 0 ) console.log( v, input, name) + return v || 0 + }, + }) + + this.init(); + + this.codegen = function() { + // if(Gibberish.memo[this.symbol]) { + // return Gibberish.memo[this.symbol]; + // } + + console.log(" CALLED ") + if( ! this.variable ) this.variable = Gibberish.generateSymbol('v'); + Gibberish.callbackArgs.push( this.symbol ) + Gibberish.callbackObjects.push( this.callback ) + + this.codeblock = "var " + this.variable + " = " + this.symbol + "(" + input.properties[ name ].codegen() + ");\n" + } + +}; +Gibberish.Proxy3.prototype = new Gibberish.ugen(); +Gibberish.oscillator = function() { + this.type = 'oscillator'; + + this.oscillatorInit = function() { + this.fx = new Array2; + this.fx.parent = this; + + return this; + } +}; +Gibberish.oscillator.prototype = new Gibberish.ugen(); +Gibberish._oscillator = new Gibberish.oscillator(); + +/**#Gibberish.Table - Oscillator +An wavetable oscillator. + +## Example Usage## +`// fill the wavetable with random samples +Gibberish.init(); +a = new Gibberish.Table(); +var t = [] +for( var i = 0; i < 1024; i++ ) { t[ i ] = Gibberish.rndf(-1,1) } +a.setTable( t ) +a.connect() +` +- - - - +**/ +/**###Gibberish.Table.frequency : property +Number. From 20 - 20000 hz. +**/ +/**###Gibberish.Table.amp : property +Number. A linear value specifying relative amplitude, ostensibly from 0..1 but can be higher, or lower when used for modulation. +**/ + +Gibberish.Wavetable = function() { + var phase = 0, + table = null, + tableFreq = Gibberish.context.sampleRate / 1024, + signHistory = 0, + flip = 0; + + this.properties = { + frequency : 440, + amp : .25, + sync: 0 + }; + +/**###Gibberish.Wavetable.setTable : method +Assign an array representing one cycle of a waveform to use. + +param **table** Float32Array. Assign an array to be used as the wavetable. +**/ + this.getTable = function() { return table; } + this.setTable = function(_table) { table = _table; tableFreq = Gibberish.context.sampleRate / table.length } + + this.getTableFreq = function() { return tableFreq } + this.setTableFreq = function( v ) { tableFreq = v; } + + this.getPhase = function() { return phase } + this.setPhase = function(v) { phase = v } + +/**###Gibberish.Wavetable.callback : method +Returns a single sample of output. + +param **frequency** Number. The frequency to be used to calculate output. +param **amp** Number. The amplitude to be used to calculate output. +**/ + this.callback = function(frequency, amp, sync) { + var index, frac, index2, val1, val2, sign; + + phase += frequency / tableFreq; + while(phase >= 1024) phase -= 1024; + + index = phase | 0; + frac = phase - index; + index = index & 1023; + index2 = index === 1023 ? 0 : index + 1; + val1 = table[index]; + val2 = table[index2]; + + // sign = typeof sync == 'number' ? sync ? sync < 0 ? -1 : 1 : isNaN(sync) ? NaN : 0 : NaN; + // if( sign !== signHistory && sign !== 0) { + // flip++ + // + // if( flip === 2 ){ + // phase = 0 + // flip = 0 + // } + // //console.log( "FLIP", sign, signHistory, count, sync ) + // } + // + // if( sign !== 0 ) signHistory = sign + + return ( val1 + ( frac * (val2 - val1) ) ) * amp; + } +} +Gibberish.Wavetable.prototype = Gibberish._oscillator; + +Gibberish.Table = function( table ) { + this.__proto__ = new Gibberish.Wavetable(); + + this.name = 'table'; + + var pi_2 = Math.PI * 2 + + if( typeof table === 'undefined' ) { + table = new Float32Array(1024); + for(var i = 1024; i--;) { table[i] = Math.sin( (i / 1024) * pi_2); } + } + + this.setTable( table ); + + this.init(); + this.oscillatorInit(); + //this.processProperties( arguments ); +} + +Gibberish.asmSine = function (stdlib, foreign, heap) { + "use asm"; + + var sin = stdlib.Math.sin; + var phase = 0.0; + var out = new stdlib.Float32Array(heap); + var floor = stdlib.Math.floor; + var tableFreq = 0.0; + + function init() { + var i = 1024; + var j = 1024.0; + var test = 0.0; + for (; i = (i - 1) | 0; ) { + j = j - 1.0; + out[i >> 2] = +(sin( +(j / 1024.0) * 6.2848)); + } + tableFreq = 44100.0 / 1024.0; + } + + function gen(freq, amp, sr) { + freq = +freq; + amp = +amp; + sr = +sr; + + var index = 0.0, + index1 = 0, + index2 = 0, + frac = 0.0, + val1 = 0.0, + val2 = 0.0; + + phase = +(phase + freq / tableFreq); + if(phase >= 1024.0) phase = +(phase - 1024.0); + + index = +floor(phase); + frac = phase - index; + + index1 = (~~index); + if((index1 | 0) == (1024 | 0)) { + index2 = 0 + } else { + index2 = (index1 + 1) | 0; + } + + val1 = +out[ index1 >> 2 ]; + val2 = +out[ index2 >> 2 ]; + + return +((val1 + (frac * (val2 - val1))) * amp); + } + + function get(idx) { + idx = idx|0; + return +out[idx >> 2]; + } + + return { + init:init, + gen: gen, + get: get, + } +}; + +/* + phase += frequency / tableFreq; + while(phase >= 1024) phase -= 1024; + + index = phase | 0; + frac = phase - index; + index = index & 1023; + index2 = index === 1023 ? 0 : index + 1; + val1 = table[index]; + val2 = table[index2]; + + return ( val1 + ( frac * (val2 - val1) ) ) * amp; +*/ + + + + + +/*function gen (freq, amp, sr) { + freq = +freq; + amp = +amp; + sr = +sr; + + phase = +(phase + +(+(freq / sr) * 3.14159 * 2.0)); + + return +(+sin(phase) * amp); +}*/ +//var pi_2 = (3.14159 * 2.0); + + +Gibberish.asmSine2 = function () { + this.properties = { frequency:440.0, amp:.5, sr: Gibberish.context.sampleRate } + this.name = 'sine' + var buf = new ArrayBuffer(4096); + var asm = Gibberish.asmSine(window, null, buf); + asm.init(); + + this.getTable = function() { return buf; } + this.get = asm.get; + this.callback = asm.gen; + this.init(); + this.oscillatorInit(); + this.processProperties( arguments ); + + return this; +} +Gibberish.asmSine2.prototype = Gibberish._oscillator; +/**#Gibberish.Sine - Oscillator +A sinewave calculated on a per-sample basis. + +## Example Usage## +`// make a sine wave +Gibberish.init(); +a = new Gibberish.Sine().connect();` +- - - - +**/ +/**###Gibberish.Sine.frequency : property +Number. From 20 - 20000 hz. +**/ +/**###Gibberish.Sine.amp : property +Number. A linear value specifying relative amplitude, ostensibly from 0..1 but can be higher, or lower when used for modulation. +**/ + +Gibberish.Sine = function() { + this.__proto__ = new Gibberish.Wavetable(); + + this.name = 'sine'; + + var pi_2 = Math.PI * 2, + table = new Float32Array(1024); + + for(var i = 1024; i--;) { table[i] = Math.sin( (i / 1024) * pi_2); } + + this.setTable( table ); + + this.init( arguments ); + this.oscillatorInit(); + this.processProperties( arguments ); +}; + +/**#Gibberish.Sine2 - Oscillator +A sinewave calculated on a per-sample basis that can be panned. + +## Example Usage## +`// make a sine wave +Gibberish.init(); +a = new Gibberish.Sine2(880, .5, -.25).connect();` +- - - - +**/ +/**###Gibberish.Sine2.frequency : property +Number. From 20 - 20000 hz. +**/ +/**###Gibberish.Sine2.amp : property +Number. A linear value specifying relative amplitude, ostensibly from 0..1 but can be higher, or lower when used for modulation. +**/ +/**###Gibberish.Sine2.pan : property +Number. -1..1. The position of the sinewave in the stereo spectrum +**/ +Gibberish.Sine2 = function() { + this.__proto__ = new Gibberish.Sine(); + this.name = "sine2"; + + var sine = this.__proto__.callback, + panner = Gibberish.makePanner(), + output = [0,0]; + +/**###Gibberish.Sine2.callback : method +Returns a stereo sample of output as an array. + +param **frequency** Number. The frequency to be used to calculate output. +param **amp** Number. The amplitude to be used to calculate output. +param **pan** Number. The position in the stereo spectrum of the signal. +**/ + this.callback = function(frequency, amp, pan) { + var out = sine(frequency, amp); + output = panner(out, pan, output); + return output; + } + + this.init(); + this.oscillatorInit(); + Gibberish.defineUgenProperty('pan', 0, this); + this.processProperties(arguments); +}; + +Gibberish.Square = function() { + this.__proto__ = new Gibberish.Wavetable(); + + this.name = 'square'; + + var pi_2 = Math.PI * 2, + table = new Float32Array(1024); + + for(var i = 1024; i--;) { + table[i] = i / 1024 > .5 ? 1 : -1; + } + + this.setTable( table ); + + this.init( arguments ); + this.oscillatorInit(); + this.processProperties( arguments ); +}; + +/**#Gibberish.Saw - Oscillator +A non-bandlimited saw wave calculated on a per-sample basis. + +## Example Usage## +`// make a saw wave +Gibberish.init(); +a = new Gibberish.Saw(330, .4).connect();` +- - - - +**/ +/**###Gibberish.Saw.frequency : property +Number. From 20 - 20000 hz. +**/ +/**###Gibberish.Saw.amp : property +Number. A linear value specifying relative amplitude, ostensibly from 0..1 but can be higher, or lower when used for modulation. +**/ +Gibberish.Saw = function() { + this.__proto__ = new Gibberish.Wavetable(); + + this.name = 'saw'; + + var table = new Float32Array(1024); + + for(var i = 1024; i--;) { table[i] = (((i / 1024) / 2 + 0.25) % 0.5 - 0.25) * 4; } + + this.setTable( table ); + + this.init( arguments ); + this.oscillatorInit(); + this.processProperties( arguments ); +}; + +/**#Gibberish.Saw2 - Oscillator +A stereo, non-bandlimited saw wave calculated on a per-sample basis. + +## Example Usage## +`// make a saw wave +Gibberish.init(); +a = new Gibberish.Saw2(330, .4).connect();` +- - - - +**/ +/**###Gibberish.Saw.frequency : property +Number. From 20 - 20000 hz. +**/ +/**###Gibberish.Saw.amp : property +Number. A linear value specifying relative amplitude, ostensibly from 0..1 but can be higher, or lower when used for modulation. +**/ +Gibberish.Saw2 = function() { + this.__proto__ = new Gibberish.Saw(); + this.name = "saw2"; + + var saw = this.__proto__.callback, + panner = Gibberish.makePanner(), + output = [0,0]; + +/**###Gibberish.Saw2.callback : method +Returns a stereo sample of output as an array. + +param **frequency** Number. The frequency to be used to calculate output. +param **amp** Number. The amplitude to be used to calculate output. +param **pan** Number. The position in the stereo spectrum of the signal. +**/ + this.callback = function(frequency, amp, pan) { + var out = saw(frequency, amp); + output = panner(out, pan, output); + return output; + }; + + this.init(); + Gibberish.defineUgenProperty('pan', 0, this); + +}; + +/**#Gibberish.Triangle - Oscillator +A triangle calculated on a per-sample basis. + +## Example Usage## +`// make a triangle wave +Gibberish.init(); +a = new Gibberish.Triangle({frequency:570, amp:.35}).connect();` +- - - - +**/ +/**###Gibberish.Triangle.frequency : property +Number. From 20 - 20000 hz. +**/ +/**###Gibberish.Triangle.amp : property +Number. A linear value specifying relative amplitude, ostensibly from 0..1 but can be higher, or lower when used for modulation. +**/ + +Gibberish.Triangle = function() { + this.__proto__ = new Gibberish.Wavetable(); + + this.name = 'triangle'; + + var table = new Float32Array(1024), + abs = Math.abs; + + for(var i = 1024; i--;) { table[i] = 1 - 4 * abs(( (i / 1024) + 0.25) % 1 - 0.5); } + + this.setTable( table ); + + this.init( arguments ); + this.oscillatorInit(); + this.processProperties( arguments ); +}; + +/**#Gibberish.Triangle2 - Oscillator +A triangle calculated on a per-sample basis that can be panned. + +## Example Usage## +`Gibberish.init(); +a = new Gibberish.Triangle2(880, .5, -.25).connect();` +- - - - +**/ +/**###Gibberish.Triangle2.frequency : property +Number. From 20 - 20000 hz. +**/ +/**###Gibberish.Triangle2.amp : property +Number. A linear value specifying relative amplitude, ostensibly from 0..1 but can be higher, or lower when used for modulation. +**/ +/**###Gibberish.Triangle2.pan : property +Number. -1..1. The position of the triangle wave in the stereo spectrum +**/ + +Gibberish.Triangle2 = function() { + this.__proto__ = new Gibberish.Triangle(); + this.name = "triangle2"; + + var triangle = this.__proto__.callback, + panner = Gibberish.makePanner(), + output = [0,0]; + +/**###Gibberish.Triangle2.callback : method +Returns a stereo sample of output as an array. + +param **frequency** Number. The frequency to be used to calculate output. +param **amp** Number. The amplitude to be used to calculate output. +param **pan** Number. The position in the stereo spectrum of the signal. +**/ + this.callback = function(frequency, amp, pan) { + var out = triangle(frequency, amp); + return panner(out, pan, output); + }; + + this.init(); + this.oscillatorInit(); + Gibberish.defineUgenProperty('pan', 0, this); + this.processProperties(arguments); +}; + +/**#Gibberish.Saw3 - Oscillator +A bandlimited saw wave created using FM feedback, see http://scp.web.elte.hu/papers/synthesis1.pdf. + +## Example Usage## +`// make a saw wave +Gibberish.init(); +a = new Gibberish.Saw3(330, .4).connect();` +- - - - +**/ +/**###Gibberish.Saw3.frequency : property +Number. From 20 - 20000 hz. +**/ +/**###Gibberish.Saw3.amp : property +Number. A linear value specifying relative ampltiude, ostensibly from 0..1 but can be higher, or lower when used for modulation. +**/ + +Gibberish.Saw3 = function() { + var osc = 0, + phase = 0, + a0 = 2.5, + a1 = -1.5, + history = 0, + sin = Math.sin, + scale = 11; + pi_2 = Math.PI * 2, + flip = 0, + signHistory = 0, + ignore = false, + sr = Gibberish.context.sampleRate; + + Gibberish.extend(this, { + name: 'saw', + properties : { + frequency: 440, + amp: .15, + sync:0, + sr: Gibberish.context.sampleRate, + }, +/**###Gibberish.Saw3.callback : method +Returns a single sample of output. + +param **frequency** Number. The frequency to be used to calculate output. +param **amp** Number. The amplitude to be used to calculate output. +**/ + callback : function(frequency, amp, sync) { + var w = frequency / sr, + n = .5 - w, + scaling = scale * n * n * n * n, + DC = .376 - w * .752, + norm = 1 - 2 * w, + out = 0, + sign; + + phase += w; + phase -= phase > 1 ? 2 : 0; + + osc = (osc + sin(pi_2 * (phase + osc * scaling))) * .5; + out = a0 * osc + a1 * history; + history = osc; + out += DC; + out *= norm; + + // sign = typeof sync == 'number' ? sync ? sync < 0 ? -1 : 1 : isNaN(sync) ? NaN : 0 : NaN; + // if( sign !== signHistory && sign !== 0) { + // flip++ + // + // if( flip === 2 ){ + // phase = 0 + // flip = 0 + // } + // //console.log( "FLIP", sign, signHistory, count, sync ) + // } + // if( sign !== 0 ) signHistory = sign + + return out * amp; + } + }); + + /* + .1 : 1 1 + 0 : 0 1 // ignored + -.1 : -1 1 // flip + -.2 : -1 -1 + */ + + Object.defineProperty(this, 'scale', { + get : function() { return scale; }, + set : function(val) { scale = val; } + }); + + this.init(); + this.oscillatorInit(); + this.processProperties(arguments); +} +Gibberish.Saw3.prototype = Gibberish._oscillator; + +/**#Gibberish.PWM - Oscillator +A bandlimited pulsewidth modulation wave created using FM feedback, see http://scp.web.elte.hu/papers/synthesis1.pdf. + +## Example Usage## +`// make a pwm wave +Gibberish.init(); +a = new Gibberish.PWM(330, .4, .9).connect();` +- - - - +**/ +/**###Gibberish.PWM.frequency : property +Number. From 20 - 20000 hz. +**/ +/**###Gibberish.PWM.amp : property +Number. A linear value specifying relative ampltiude, ostensibly from 0..1 but can be higher, or lower when used for modulation. +**/ +/**###Gibberish.PWM.pulsewidth : property +Number. 0..1. The width of the waveform's duty cycle. +**/ +Gibberish.PWM = function() { + var osc = 0, + osc2= 0, + _osc= 0, + _osc2=0, + phase = 0, + a0 = 2.5, + a1 = -1.5, + history = 0, + sin = Math.sin, + scale = 11; + pi_2 = Math.PI * 2, + test = 0, + sr = Gibberish.context.sampleRate; + + Gibberish.extend(this, { + name: 'pwm', + properties : { + frequency: 440, + amp: .15, + pulsewidth: .05, + sr: Gibberish.context.sampleRate, + }, +/**###Gibberish.PWM.callback : method +Returns a single sample of output. + +param **frequency** Number. The frequency to be used to calculate output. +param **amp** Number. The amplitude to be used to calculate output. +param **pulsewidth** Number. The duty cycle of the waveform +**/ + callback : function(frequency, amp, pulsewidth) { + var w = frequency / sr, + n = .5 - w, + scaling = scale * n * n * n * n, + DC = .376 - w * .752, + norm = 1 - 2 * w, + out = 0; + + phase += w; + phase -= phase > 1 ? 2 : 0; + + osc = (osc + sin( pi_2 * (phase + osc * scaling ) ) ) * .5; + osc2 =(osc2 + sin( pi_2 * (phase + osc2 * scaling + pulsewidth) ) ) * .5; + out = osc2 - osc; + + out = a0 * out + a1 * (_osc - _osc2); + _osc = osc; + _osc2 = osc2; + + return out * norm * amp; + }, + }); + + Object.defineProperty(this, 'scale', { + get : function() { return scale; }, + set : function(val) { scale = val; } + }); + + this.init(); + this.oscillatorInit(); + this.processProperties(arguments); +}; +Gibberish.PWM.prototype = Gibberish._oscillator; + +/**#Gibberish.Noise - Oscillator +A white noise oscillator + +## Example Usage## +`// make some noise +Gibberish.init(); +a = new Gibberish.Noise(.4).connect();` +- - - - +**/ +/**###Gibberish.Noise.amp : property +Number. A linear value specifying relative amplitude, ostensibly from 0..1 but can be higher, or lower when used for modulation. +**/ +Gibberish.Noise = function() { + var rnd = Math.random; + + Gibberish.extend(this, { + name:'noise', + properties: { + amp:1, + }, + + callback : function(amp){ + return (rnd() * 2 - 1) * amp; + }, + }); + + this.init(); + this.oscillatorInit(); + this.processProperties(arguments); +}; +Gibberish.Noise.prototype = Gibberish._oscillator; + +// this file is dependent on oscillators.js + +/**#Gibberish.KarplusStrong - Physical Model +A plucked-string model. + +## Example Usage## +`Gibberish.init(); +a = new Gibberish.KarplusStrong({ damping:.6 }).connect(); +a.note(440); +` +- - - - +**/ +/**###Gibberish.KarplusStrong.blend : property +Number. 0..1. The likelihood that the sign of any given sample will be flipped. A value of 1 means there is no chance, a value of 0 means each samples sign will be flipped. This introduces noise into the model which can be used for various effects. +**/ +/**###Gibberish.KarplusStrong.damping : property +Number. 0..1. Higher amounts of damping shorten the decay of the sound generated by each note. +**/ +/**###Gibberish.KarplusStrong.amp : property +Number. A linear value specifying relative amplitude, ostensibly from 0..1 but can be higher, or lower when used for modulation. +**/ +/**###Gibberish.KarplusStrong.channels : property +Number. Default 2. If two channels, the signal may be panned. +**/ +/**###Gibberish.KarplusStrong.pan : property +Number. Default 0. The position in the stereo spectrum for the sound, from -1..1. +**/ +Gibberish.KarplusStrong = function() { + var phase = 0, + buffer = [0], + last = 0, + rnd = Math.random, + panner = Gibberish.makePanner(), + sr = Gibberish.context.sampleRate, + out = [0,0]; + + Gibberish.extend(this, { + name:"karplus_strong", + frequency : 0, + properties: { blend:1, damping:0, amp:1, channels:2, pan:0, velocity:1 }, + + note : function( frequency, velocity ) { + if( typeof frequency === 'undefined' ) return + + var _size = Math.floor(sr / frequency); + buffer.length = 0; + + for(var i = 0; i < _size; i++) { + buffer[i] = rnd() * 2 - 1; // white noise + } + + if( velocity ) this.velocity = velocity + + this.frequency = frequency; + }, + + callback : function(blend, damping, amp, channels, pan, velocity ) { + var val = buffer.shift(); + var rndValue = (rnd() > blend) ? -1 : 1; + + damping = damping > 0 ? damping : 0; + + var value = rndValue * (val + last) * (.5 - damping / 100); + + last = value; + + buffer.push(value); + + value *= amp * velocity; + return channels === 1 ? value : panner(value, pan, out); + }, + }) + .init() + .oscillatorInit() + .processProperties(arguments); +}; +Gibberish.KarplusStrong.prototype = Gibberish._oscillator; + +Gibberish.PolyKarplusStrong = function() { + this.__proto__ = new Gibberish.Bus2(); + + Gibberish.extend(this, { + name: "poly_karplus_strong", + maxVoices: 5, + voiceCount: 0, + _frequency: 0, + + polyProperties : { + blend: 1, + damping: 0, + velocity: 1 + }, + + note : function(_frequency, velocity) { + var synth = this.children[this.voiceCount++]; + if(this.voiceCount >= this.maxVoices) this.voiceCount = 0; + synth.note(_frequency, velocity); + this._frequency = _frequency; + }, + initVoices: function() { + for(var i = 0; i < this.maxVoices; i++) { + var props = { + blend: this.blend, + damping: this.damping, + channels: 2, + amp: 1, + }; + var synth = new Gibberish.KarplusStrong(props).connect(this); + + this.children.push(synth); + } + } + }); + + this.amp = 1 / this.maxVoices; + this.children = []; + + if(typeof arguments[0] === 'object') { + this.maxVoices = arguments[0].maxVoices ? arguments[0].maxVoices : this.maxVoices + } + + Gibberish.polyInit(this); + this.initVoices() + + this.processProperties(arguments); + + this.initialized = false + Gibberish._synth.oscillatorInit.call(this); + Gibberish.dirty( this ) +}; + +/**#Gibberish.Bus - Miscellaneous +Create a mono routing bus. A bus callback routes all it's inputs and scales them by the amplitude of the bus. + +For a stereo routing bus, see [Bus2](javascript:displayDocs('Gibberish.Bus2'\)) + +##Example Usage## +`a = new Gibberish.Bus(); +b = new Gibberish.Sine(440).connect(a); +c = new Gibberish.Sine(880).connect(a); +a.amp = .1; +a.connect();` + +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the bus on initialization. +**/ +/**###Gibberish.Bus.amp : property +Array. Read-only. Relative volume for the sum of all ugens connected to the bus. +**/ +Gibberish.bus = function(){ + this.type = 'bus'; + + this.inputCodegen = function() { + //console.log( this, this.value, this.value.valueOf() ) + var val = this.value.valueOf(); + var str; + + /*if( this.value.name === 'Drums' ) { + str = '[ ' + val + '[0] * ' + this.amp + ', ' + val + '[1] * ' + this.amp + ']' // works! + }else{ + str = this.amp === 1 ? val : val + ' * ' + this.amp; + }*/ + + str = val + ', ' + this.amp + this.codeblock = str; + return str; + }; + + this.addConnection = function() { + var position = arguments[2] + var arg = { + value: arguments[0], + amp: arguments[1], + codegen: this.inputCodegen, + valueOf: function() { return this.codegen() } + }; + + if( typeof position !== 'undefined' ) { + this.inputs.splice( position,0,arg ); + }else{ + this.inputs.push( arg ); + } + + Gibberish.dirty( this ); + }; + + this.removeConnection = function(ugen) { + for(var i = 0; i < this.inputs.length; i++) { + if(this.inputs[i].value === ugen) { + this.inputs.splice(i,1); + Gibberish.dirty(this); + break; + } + } + }; + + this.adjustSendAmount = function(ugen, amp) { + for(var i = 0; i < this.inputs.length; i++) { + if(this.inputs[i].value === ugen) { + this.inputs[i].amp = amp; + Gibberish.dirty(this); + break; + } + } + }; + + this.callback = function() { + var amp = arguments[arguments.length - 2]; // use arguments to accommodate arbitray number of inputs without using array + var pan = arguments[arguments.length - 1]; + + output[0] = output[1] = 0; + + for(var i = 0; i < arguments.length - 2; i+=2) { + var isObject = typeof arguments[i] === 'object', + _amp = arguments[i + 1] + + output[0] += isObject ? arguments[i][0] * _amp :arguments[i] * _amp; + output[1] += isObject ? arguments[i][1] * _amp: arguments[i] * _amp; + } + + output[0] *= amp; + output[1] *= amp; + + return panner(output, pan, output); + }; +}; + +Gibberish.bus.prototype = new Gibberish.ugen(); +Gibberish._bus = new Gibberish.bus(); + +Gibberish.Bus = function() { + Gibberish.extend(this, { + name : 'bus', + + properties : { + inputs : [], + amp : 1, + }, + + callback : function() { + var out = 0; + var length = arguments.length - 1; + var amp = arguments[length]; // use arguments to accommodate arbitray number of inputs without using array + + for(var i = 0; i < length; i++) { + out += arguments[i]; + } + out *= amp; + + return out; + }, + }); + + this.init(); + this.processProperties(arguments); + + return this; +}; +Gibberish.Bus.prototype = Gibberish._bus; + +/**#Gibberish.Bus2 - Miscellaneous +Create a stereo outing bus. A bus callback routes all it's inputs and scales them by the amplitude of the bus. + +##Example Usage## +`a = new Gibberish.Bus2(); +b = new Gibberish.Sine(440).connect(a); +c = new Gibberish.Sine(880).connect(a); + +d = new Gibberish.Sequencer({ target:a, key:'pan', values:[-.75,.75], durations:[ 22050 ] }).start(); +a.connect();` + +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the bus on initialization. +**/ +/**###Gibberish.Bus.amp : property +Array. Read-only. Relative volume for the sum of all ugens connected to the bus. +**/ +Gibberish.Bus2 = function() { + this.name = 'bus2'; + this.type = 'bus'; + + this.properties = { + inputs : [], + amp : 1, + pan : 0, + }; + + var output = [0,0], + panner = Gibberish.makePanner(), + phase = 0; + + this.callback = function() { + // use arguments to accommodate arbitray number of inputs without using array + var args = arguments, + length = args.length, + amp = args[length - 2], + pan = args[length - 1] + + output[0] = output[1] = 0; + + //if(phase++ % 44100 === 0) console.log(args) + for(var i = 0, l = length - 2; i < l; i+= 2) { + var isObject = typeof args[i] === 'object', + _amp = args[i + 1] + + output[0] += isObject ? args[i][0] * _amp || 0 : args[i] * _amp || 0; + output[1] += isObject ? args[i][1] * _amp || 0 : args[i] * _amp || 0; + } + + output[0] *= amp; + output[1] *= amp; + + return panner(output, pan, output); + }; + + this.show = function() { console.log(output, args) } + this.getOutput = function() { return output } + this.getArgs = function() { return args } + + //this.initialized = false; + this.init( arguments ); + this.processProperties( arguments ); +}; +Gibberish.Bus2.prototype = Gibberish._bus; +Gibberish.envelope = function() { + this.type = 'envelope'; +}; +Gibberish.envelope.prototype = new Gibberish.ugen(); +Gibberish._envelope = new Gibberish.envelope(); + +Gibberish.ExponentialDecay = function(){ + var pow = Math.pow, + value = 0, + phase = 0; + + Gibberish.extend(this, { + name:"ExponentialDecay", + properties: { decay:.5, length:11050 }, + + callback: function( decay, length ) { + value = pow( decay, phase ); + phase += 1 / length; + + return value; + }, + + trigger : function() { + phase = typeof arguments[0] === 'number' ? arguments[0] : 0; + }, + }) + .init() +}; +Gibberish.ExponentialDecay.prototype = Gibberish._envelope; + +Gibberish.Line = function(start, end, time, loops) { + var that = { + name: 'line', + + properties : { + start: start || 0, + end: isNaN(end) ? 1 : end, + time: time || Gibberish.context.sampleRate, + loops: loops || false, + }, + + retrigger: function( end, time ) { + phase = 0; + this.start = out + this.end = end + this.time = time + + incr = (end - out) / time + }, + + getPhase: function() { return phase }, + getIncr: function() { return incr }, + getOut: function() { return out } + }; + + var phase = 0, + incr = (end - start) / time, + out + + //console.log("INCREMENT", incr, end, start, time ) + + this.callback = function(start, end, time, loops) { + var incr = (end - start) / time + out = phase < time ? start + ( phase++ * incr) : end; + + phase = (out >= end && loops) ? 0 : phase; + + return out; + }; + + this.setPhase = function(v) { phase = v; } + + Gibberish.extend(this, that); + + this.init(); + + return this; +}; +Gibberish.Line.prototype = Gibberish._envelope; + +Gibberish.Ease = function( start, end, time, easein, loops ) { + var sqrt = Math.sqrt, out = 0, phase = 0 + + start = start || 0 + end = end || 1 + time = time || Gibberish.context.sampleRate + loops = loops || false + easein = typeof easein === 'undefined' ? 1 : easein + + var that = { + name: 'ease', + properties : {}, + retrigger: function( end, time ) { + phase = 0; + this.start = out + this.end = end + this.time = time + }, + + getPhase: function() { return phase }, + getOut: function() { return out } + }; + + this.callback = function() { + var x = phase++ / time, + y = easein ? 1 - sqrt( 1 - x * x ) : sqrt( 1 - ((1-x) * (1-x)) ) + + out = phase < time ? start + ( y * ( end - start ) ) : end + + //out = phase < time ? start + ( phase++ * incr) : end; + + phase = (out >= end && loops) ? 0 : phase; + + return out; + }; + + this.setPhase = function(v) { phase = v; } + this.setEase = function(v) { + easein = v + } + + Gibberish.extend(this, that); + + this.init(); + + return this; +}; +Gibberish.Ease.prototype = Gibberish._envelope; + +// quadratic bezier +// adapted from http://www.flong.com/texts/code/shapers_bez/ +Gibberish.Curve = function( start, end, time, a, b, fadeIn, loops ) { + var sqrt = Math.sqrt, + out = 0, + phase = 0 + + start = start || 0 + end = end || 1 + time = time || Gibberish.context.sampleRate + a = a || .940 + b = b || .260 + loops = loops || false + fadeIn = typeof fadeIn === 'undefined' ? 1 : fadeIn + + var that = { + name: 'curve', + + properties : {}, + + retrigger: function( end, time ) { + phase = 0; + this.start = out + this.end = end + this.time = time + + incr = (end - out) / time + }, + + getPhase: function() { return phase }, + getOut: function() { return out } + }; + + this.callback = function() { + var x = phase++ / time, + om2a = 1 - 2 * a, + t = ( sqrt( a*a + om2a*x ) - a ) / om2a, + y = (1-2*b) * (t*t) + (2*b) * t + + out = phase < time ? start + ( y * ( end - start ) ) : end + + if( !fadeIn ) out = 1 - out + + //out = phase < time ? start + ( phase++ * incr) : end; + + phase = (out >= end && loops) ? 0 : phase; + + return out; + }; + + this.setPhase = function(v) { phase = v; } + + Gibberish.extend(this, that); + + this.init(); + + return this; +}; +Gibberish.Curve.prototype = Gibberish._envelope; + +Gibberish.Lines = function( values, times, loops ) { + var out = values[0], + phase = 0, + valuesPhase = 1, + timesPhase = 0, + targetValue = 0, + targetTime = 0, + end = false, + incr + + + if( typeof values === 'undefined' ) values = [ 0,1 ] + if( typeof times === 'undefined' ) times = [ 44100 ] + + targetValue = values[ valuesPhase ] + targetTime = times[ 0 ] + + incr = ( targetValue - values[0] ) / targetTime + //console.log( "current", out, "target", targetValue, "incr", incr ) + + loops = loops || false + + var that = { + name: 'lines', + + properties : {}, + + retrigger: function() { + phase = 0 + out = values[0] + targetTime = times[ 0 ] + targetValue = values[ 1 ] + valuesPhase = 1 + timesPhase = 0 + incr = ( targetValue - out ) / targetTime + end = false + }, + + getPhase: function() { return phase }, + getOut: function() { return out } + }; + + that.run = that.retrigger + + this.callback = function() { + if( phase >= targetTime && !end ) { + if( valuesPhase < values.length - 1 ) { + var timeStep = times[ ++timesPhase % times.length ] + targetTime = phase + timeStep + targetValue = values[ ++valuesPhase % values.length ] + incr = ( targetValue - out ) / timeStep + }else{ + if( !loops ) { + end = true + out = values[ values.length - 1 ] + }else{ + phase = 0 + out = values[0] + targetTime = times[ 0 ] + targetValue = values[ 1 ] + valuesPhase = 1 + timesPhase = 0 + incr = ( targetValue - out ) / targetTime + } + } + }else if( !end ) { + out += incr + phase++ + } + + return out; + }; + + this.setPhase = function(v) { phase = v; } + + Gibberish.extend(this, that); + + this.init(); + + return this; +}; +Gibberish.Lines.prototype = Gibberish._envelope; + +Gibberish.AD = function(_attack, _decay) { + var phase = 0, + state = 0; + + Gibberish.extend( this,{ + name : "AD", + properties : { + attack : _attack || 10000, + decay : _decay || 10000, + }, + + run : function() { + state = 0; + phase = 0; + return this; + }, + callback : function(attack,decay) { + attack = attack < 0 ? 22050 : attack; + decay = decay < 0 ? 22050 : decay; + if(state === 0){ + var incr = 1 / attack; + phase += incr; + if(phase >=1) { + state++; + } + }else if(state === 1){ + var incr = 1 / decay; + phase -= incr; + if(phase <= 0) { + phase = 0; + state++;; + } + } + return phase; + }, + getState : function() { return state; }, + }) + .init() + .processProperties(arguments); +}; +Gibberish.AD.prototype = Gibberish._envelope; + +Gibberish.ADSR = function(attack, decay, sustain, release, attackLevel, sustainLevel, requireReleaseTrigger) { + var that = { + name: "adsr", + type: "envelope", + 'requireReleaseTrigger' : typeof requireReleaseTrigger !== 'undefined' ? requireReleaseTrigger : false, + + properties: { + attack: isNaN(attack) ? 10000 : attack, + decay: isNaN(decay) ? 10000 : decay, + sustain: isNaN(sustain) ? 22050 : sustain, + release: isNaN(release) ? 10000 : release, + attackLevel: attackLevel || 1, + sustainLevel: sustainLevel || .5, + releaseTrigger: 0, + }, + + run: function() { + this.setPhase(0); + this.setState(0); + }, + stop : function() { + this.releaseTrigger = 1 + } + }; + Gibberish.extend(this, that); + + var phase = 0, + state = 0, + rt = 0, + obj = this; + + this.callback = function(attack,decay,sustain,release,attackLevel,sustainLevel,releaseTrigger) { + var val = 0; + rt = rt === 1 ? 1 : releaseTrigger; + if(state === 0){ + val = phase / attack * attackLevel; + if(++phase / attack >= 1) { + state++; + phase = decay; + } + }else if(state === 1) { + val = phase / decay * (attackLevel - sustainLevel) + sustainLevel; + if(--phase <= 0) { + if(sustain !== null){ + state += 1; + phase = sustain; + }else{ + state += 2; + phase = release; + } + } + }else if(state === 2) { + val = sustainLevel; + if( obj.requireReleaseTrigger && rt ){ + state++; + phase = release; + obj.releaseTrigger = 0; + rt = 0; + }else if(phase-- <= 0 && !obj.requireReleaseTrigger) { + state++; + phase = release; + } + }else if(state === 3) { + phase--; + val = (phase / release) * sustainLevel; + if(phase <= 0) { + state++; + } + } + return val; + }; + this.call = function() { + return this.callback( this.attack, this.decay, this.sustain, this.release, this.attackLevel, this.sustainLevel, this.releaseTrigger ) + }; + this.getPhase = function() { return phase; }; + this.setPhase = function(newPhase) { phase = newPhase; }; + this.setState = function(newState) { state = newState; phase = 0; }; + this.getState = function() { return state; }; + + this.init(); + + return this; +}; +Gibberish.ADSR.prototype = Gibberish._envelope; + +Gibberish.ADR = function(attack, decay, release, attackLevel, releaseLevel) { + var that = { + name: "adr", + type: "envelope", + + properties: { + attack: isNaN(attack) ? 11025 : attack, + decay: isNaN(decay) ? 11025 : decay, + release: isNaN(release) ? 22050 : release, + attackLevel: attackLevel || 1, + releaseLevel: releaseLevel || .2, + }, + + run: function() { + this.setPhase(0); + this.setState(0); + }, + }; + Gibberish.extend(this, that); + + var phase = 0; + var state = 0; + + this.callback = function(attack,decay,release,attackLevel,releaseLevel) { + var val = 0; + if(state === 0){ + val = phase / attack * attackLevel; + if(++phase / attack === 1) { + state++; + phase = decay; + } + }else if(state === 1) { + val = (phase / decay) * (attackLevel - releaseLevel) + releaseLevel; + if(--phase <= 0) { + state += 1; + phase = release; + } + }else if(state === 2){ + phase--; + + val = (phase / release) * releaseLevel; + if(phase <= 0) { + state++; + } + } + return val; + }; + this.setPhase = function(newPhase) { phase = newPhase; }; + this.setState = function(newState) { state = newState; phase = 0; }; + this.getState = function() { return state; }; + + this.init(); + + return this; +}; +Gibberish.ADR.prototype = Gibberish._envelope; +/* +Analysis ugens have two callbacks, one to perform the analysis and one to output the results. +This allows the analysis to occur at the end of the callback while the outback can occur at +the beginning, in effect using a single sample delay. + +Because of the two callbacks, there are also two codegen methods. The default codegens used by +the analysis prototype object should be fine for most applications. +*/ + +Gibberish.analysis = function() { + this.type = 'analysis'; + + this.codegen = function() { + if(Gibberish.memo[this.symbol]) { + return Gibberish.memo[this.symbol]; + }else{ + var v = this.variable ? this.variable : Gibberish.generateSymbol('v'); + Gibberish.memo[this.symbol] = v; + this.variable = v; + Gibberish.callbackArgs.push( this.symbol ) + Gibberish.callbackObjects.push( this.callback ) + } + + this.codeblock = "var " + this.variable + " = " + this.symbol + "();\n"; + + if( Gibberish.codeblock.indexOf( this.codeblock ) === -1 ) Gibberish.codeblock.push( this.codeblock ) + return this.variable; + } + + this.analysisCodegen = function() { + // TODO: can this be memoized somehow? + //if(Gibberish.memo[this.analysisSymbol]) { + // return Gibberish.memo[this.analysisSymbol]; + //}else{ + // Gibberish.memo[this.symbol] = v; + // console.log( this.input ) + + var input = 0; + if(this.input.codegen){ + input = this.input.codegen() + //console.log( "PROPERTY UGEN", input) + if(input.indexOf('op') > -1) console.log("ANALYSIS BUG") + }else if( this.input.value ){ + input = typeof this.input.value.codegen !== 'undefined' ? this.input.value.codegen() : this.input.value + }else{ + input = 'null' + } + + var s = this.analysisSymbol + "(" + input + ","; + for(var key in this.properties) { + if(key !== 'input') { + s += this[key] + ","; + } + } + s = s.slice(0, -1); // remove trailing comma + s += ");"; + + this.analysisCodeblock = s; + + if( Gibberish.analysisCodeblock.indexOf( this.analysisCodeblock ) === -1 ) Gibberish.analysisCodeblock.push( this.analysisCodeblock ) + + if( Gibberish.callbackObjects.indexOf( this.analysisCallback) === -1 ) Gibberish.callbackObjects.push( this.analysisCallback ) + + //console.log( this.analysisCallback ) + + return s; + }; + + this.remove = function() { + Gibberish.analysisUgens.splice( Gibberish.analysisUgens.indexOf( this ), 1 ) + } + + this.analysisInit = function() { + this.analysisSymbol = Gibberish.generateSymbol(this.name); + Gibberish.analysisUgens.push( this ); + Gibberish.dirty(); // dirty in case analysis is not connected to graph, + }; + +}; +Gibberish.analysis.prototype = new Gibberish.ugen(); +Gibberish._analysis = new Gibberish.analysis(); + +Gibberish.Follow = function() { + this.name = 'follow'; + + this.properties = { + input : 0, + bufferSize : 4410, + mult : 1, + useAbsoluteValue:true // for amplitude following, false for other values + }; + + this.storage = []; + + var abs = Math.abs, + history = [0], + sum = 0, + index = 0, + value = 0, + phase = 0; + + this.analysisCallback = function(input, bufferSize, mult, useAbsoluteValue ) { + if( typeof input === 'object' ) input = input[0] + input[1] + + sum += useAbsoluteValue ? abs(input) : input; + sum -= history[index]; + + history[index] = useAbsoluteValue ? abs(input) : input; + + index = (index + 1) % bufferSize; + + // if history[index] isn't defined set it to 0 + // TODO: does this really need to happen here? I guess there were clicks on initialization... + history[index] = history[index] ? history[index] : 0; + value = (sum / bufferSize) * mult; + }; + + this.callback = this.getValue = function() { return value; }; + + this.init(); + this.analysisInit(); + this.processProperties( arguments ); + + var oldBufferSize = this.__lookupSetter__( 'bufferSize' ), + bs = this.bufferSize + + Object.defineProperty( this, 'bufferSize', { + get: function() { return bs }, + set: function(v) { bs = v; sum = 0; history = [0]; index = 0; } + }) + + this.getStorage = function() { return this.storage; } +}; +Gibberish.Follow.prototype = Gibberish._analysis; + +Gibberish.SingleSampleDelay = function() { + this.name = 'single_sample_delay'; + + this.properties = { + input : arguments[0] || 0, + amp : arguments[1] || 1, + }; + + var value = 0, + phase = 0; + + this.analysisCallback = function(input, amp) { + /*if(typeof input === 'object') { + value = typeof input === 'object' ? [input[0] * amp, input[1] * amp ] : input * amp; + }else{ + value = input * amp; + }*/ + value = input + //if(phase++ % 44100 === 0) console.log(value, input, amp) + }; + + this.callback = function() { + //if(phase % 44100 === 0) console.log(value) + + return value; + }; + + this.getValue = function() { return value } + this.init(); + this.analysisInit(); + this.processProperties( arguments ); + +}; +Gibberish.SingleSampleDelay.prototype = Gibberish._analysis; + +Gibberish.Record = function(_input, _size, oncomplete) { + var buffer = new Float32Array(_size), + phase = 0, + isRecording = false, + self = this; + + Gibberish.extend(this, { + name: 'record', + 'oncomplete' : oncomplete, + + properties: { + input: 0, + size: _size || 0, + }, + + analysisCallback : function(input, length) { + if(isRecording) { + buffer[phase++] = typeof input === 'object' ? input[0] + input[1] : input; + + if(phase >= length) { + isRecording = false; + self.remove(); + } + } + }, + + record : function() { + phase = 0; + isRecording = true; + return this; + }, + + getBuffer : function() { return buffer; }, + getPhase : function() { return phase; }, + + remove : function() { + if(typeof this.oncomplete !== 'undefined') this.oncomplete(); + + for(var i = 0; i < Gibberish.analysisUgens.length; i++) { + var ugen = Gibberish.analysisUgens[i]; + if(ugen === this) { + if( Gibberish.callbackArgs.indexOf( this.analysisSymbol) > -1 ) { + Gibberish.callbackArgs.splice( Gibberish.callbackArgs.indexOf( this.analysisSymbol), 1 ) + } + if( Gibberish.callbackObjects.indexOf( this.analysisCallback ) > -1 ) { + Gibberish.callbackObjects.splice( Gibberish.callbackObjects.indexOf( this.analysisCallback ), 1 ) + } + Gibberish.analysisUgens.splice(i, 1); + return; + } + } + }, + }); + // cannot be assigned within extend call + this.properties.input = _input; + + this.init(); + this.analysisInit(); + + Gibberish.dirty(); // ugen is not attached to anything else +}; +Gibberish.Record.prototype = Gibberish._analysis; +Gibberish.effect = function() { + this.type = 'effect'; +}; +Gibberish.effect.prototype = new Gibberish.ugen(); +Gibberish._effect = new Gibberish.effect(); + +/**#Gibberish.Distortion - FX +A simple waveshaping distortion that adaptively scales its gain based on the amount of distortion applied. + +## Example Usage## +`a = new Gibberish.Synth({ attack:44, decay:44100 }); +b = new Gibberish.Distortion({ input:a, amount:30 }).connect(); +a.note(440); +` +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the synth on initialization. +- - - - +**/ +/**###Gibberish.Distortion.amount : property +Number. The amount of distortion to apply. This number cannot be set lower than 2. +**/ +Gibberish.Distortion = function() { + var abs = Math.abs, + log = Math.log, + ln2 = Math.LN2; + + Gibberish.extend(this, { + name : 'distortion', + + properties : { + input : 0, + amount : 50, + }, + + callback : function(input, amount) { + var x; + amount = amount > 2 ? amount : 2; + if(typeof input === 'number') { + x = input * amount; + input = (x / (1 + abs(x))) / (log(amount) / ln2); //TODO: get rid of log / divide + }else{ + x = input[0] * amount; + input[0] = (x / (1 + abs(x))) / (log(amount) / ln2); //TODO: get rid of log / divide + x = input[1] * amount; + input[1] = (x / (1 + abs(x))) / (log(amount) / ln2); //TODO: get rid of log / divide + } + return input; + }, + }) + .init() + .processProperties(arguments); +}; +Gibberish.Distortion.prototype = Gibberish._effect; + +/**#Gibberish.Gain - FX +Amplitude attenutation / gain. + +## Example Usage## +`a = new Gibberish.Synth({ attack:44, decay:44100 }); +b = new Gibberish.Distortion({ input:a, amount:30 }) +c = new Gibberish.Gain({ input:b, amount:.5 }).connect() +` +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the synth on initialization. +- - - - +**/ +/**###Gibberish.Gain.amount : property +Number. The amount of gain to multiply the inpyt signal by. +**/ +Gibberish.Gain = function() { + + Gibberish.extend(this, { + name : 'gain', + + properties : { + input : 0, + amount : 1, + }, + + callback : function(input, amount) { + if(typeof input === 'number') { + input *= amount; + }else{ + input[0] *=amount; + input[1] *=amount; + } + return input; + }, + }) + .init() + .processProperties(arguments); + +}; +Gibberish.Gain.prototype = Gibberish._effect; + +/**#Gibberish.Delay - FX +A simple echo effect. + +## Example Usage## +`a = new Gibberish.Synth({ attack:44, decay:44100 }); +b = new Gibberish.Delay({ input:a, time:22050, feedback:.35 }).connect(); +a.note(440); +` +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the synth on initialization. +- - - - +**/ +/**###Gibberish.Delay.time : property +Number. The delay time as measured in samples +**/ +/**###Gibberish.Delay.feedback : property +Number. The amount of feedback that the delay puts into its buffers. +**/ +Gibberish.Delay = function() { + var buffers = [], + phase = 0; + + buffers.push( new Float32Array(Gibberish.context.sampleRate * 2) ); + buffers.push( new Float32Array(Gibberish.context.sampleRate * 2) ); + + Gibberish.extend(this, { + name:"delay", + properties:{ input:0, time: 22050, feedback: .5, wet:1, dry:1, rate:1 }, + + callback : function( sample, time, feedback, wet, dry, rate ) { + var channels = typeof sample === 'number' ? 1 : 2; + + var _phase = phase++ % 88200; + time = time / rate; + var delayPos = (_phase + ( time | 0 )) % 88200; + + if(channels === 1) { + buffers[0][delayPos] = sample + (buffers[0][_phase] ) * feedback; + sample = (sample * dry) + (buffers[0][_phase] * wet); + }else{ + buffers[0][delayPos] = sample[0] + buffers[0][_phase] * feedback; + sample[0] = (sample[0] * dry) + (buffers[0][_phase] * wet); + buffers[1][delayPos] = sample[1] + buffers[1][_phase] * feedback; + sample[1] = (sample[1] * dry) + (buffers[1][_phase] * wet); + } + + return sample; + }, + }); + + var time = Math.round( this.properties.time ); + Object.defineProperty(this, 'time', { + configurable: true, + get: function() { return time; }, + set: function(v) { time = Math.round(v); Gibberish.dirty( this ) } + }); + + this.init(); + this.processProperties(arguments); + +}; +Gibberish.Delay.prototype = Gibberish._effect; + +/**#Gibberish.Decimator - FX +A bit-crusher / sample rate reducer. Adapted from code / comments at http://musicdsp.org/showArchiveComment.php?ArchiveID=124 + +## Example Usage## +`a = new Gibberish.Synth({ attack:44, decay:44100 }); +b = new Gibberish.Decimator({ input:a, bitDepth:4.2, sampleRate:.33 }).connect(); +a.note(440); +` +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the synth on initialization. +- - - - +**/ +/**###Gibberish.Decimator.bitDepth : property +Float. 0..16. The number of bits the signal is truncated to. May be a floating point number. +**/ +/**###Gibberish.Decimator.sampleRate : property +Number. 0..1. The sample rate to use where 0 is 0 Hz and 1 is nyquist. +**/ +Gibberish.Decimator = function() { + var counter = 0, + hold = [], + pow = Math.pow, + floor = Math.floor; + + Gibberish.extend(this, { + name:"decimator", + properties:{ input:0, bitDepth: 16, sampleRate: 1 }, + + callback : function(sample, depth, rate) { + counter += rate; + var channels = typeof sample === 'number' ? 1 : 2; + + if(channels === 1) { + if(counter >= 1) { + var bitMult = pow( depth, 2.0 ); + hold[0] = floor( sample * bitMult ) / bitMult; + counter -= 1; + } + sample = hold[0]; + }else{ + if(counter >= 1) { + var bitMult = pow( depth, 2.0 ); + hold[0] = floor( sample[0] * bitMult ) / bitMult; + hold[1] = floor( sample[1] * bitMult ) / bitMult; + counter -= 1; + } + sample = hold; + } + + return sample; + }, + }) + .init() + .processProperties(arguments); +}; +Gibberish.Decimator.prototype = Gibberish._effect; + +/**#Gibberish.RingModulation - FX +The name says it all. This ugen also has a mix property to control the ratio of wet to dry output. + +## Example Usage## +`a = new Gibberish.Synth({ attack:44, decay:44100 }); +b = new Gibberish.RingModulation({ input:a, frequency:1000, amp:.4, mix:1 }).connect(); +a.note(440); +` +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the synth on initialization. +- - - - +**/ +/**###Gibberish.RingModulation.frequency : property +Float. The frequency of the ring modulation modulator wave. +**/ +/**###Gibberish.RingModulation.amp : property +Float. The amplitude of the ring modulation modulator wave. +**/ +/**###Gibberish.RingModulation.mix : property +Float. 0..1. The wet/dry output ratio. A value of 1 means a completely wet signal, a value of 0 means completely dry. +**/ +Gibberish.RingModulation = function() { + var sin = new Gibberish.Sine().callback, + output = [0,0]; + + Gibberish.extend( this, { + name : "ringmod", + + properties : { input:0, frequency:440, amp:.5, mix:.5 }, + + callback : function(sample, frequency, amp, mix) { + var channels = typeof sample === 'number' ? 1 : 2; + var output1 = channels === 1 ? sample : sample[0]; + + var mod = sin(frequency, amp); + + output1 = output1 * (1-mix) + (output1 * mod) * mix; + + if(channels === 2) { + var output2 = sample[1]; + output2 = output2 * (1-mix) + (output2 * mod) * mix; + + output[0] = output1; + output[1] = output2; + return output; + } + + return output1; // return mono + }, + }) + .init() + .processProperties(arguments); +}; +Gibberish.RingModulation.prototype = Gibberish._effect; + + +/**#Gibberish.DCBlock - FX +A one-pole filter for removing bias. + +## Example Usage## +` ` +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the synth on initialization. +- - - - +**/ +/**###Gibberish.DCBlock.input : property +Float. The input ugen to remove bias from. +**/ + +Gibberish.DCBlock = function() { + var x1 = 0, y1 = 0 + + Gibberish.extend(this, { + name: 'dcblock', + type: 'effect', + + properties : { + input : 0, + }, + + reset : function() { + x1 = 0; + y1 = 0; + }, + + callback : function(input) { + var y = input - x1 + y1 * .9997 + x1 = input + y1 = y + + return y; + } + }) + .init() + .processProperties(arguments); +}; +Gibberish.DCBlock.prototype = Gibberish._effect; + +/**#Gibberish.Tremolo - FX +A basic amplitude modulation effect. + +## Example Usage## +`a = new Gibberish.Synth({ attack:44, decay:44100 }).connect(); +b = new Gibberish.Tremolo({input:a, frequency:4, amp:1}); +a.note(880); +` +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the synth on initialization. +- - - - +**/ +/**###Gibberish.Tremolo.input : property +Float. The input to apply the tremolo effect to +**/ +/**###Gibberish.Tremolo.frequency : property +Float. The speed of the tremolo effect, measured in Hz +**/ +/**###Gibberish.Tremolo.amp : property +Float. The magnitude of the tremolo effect. +**/ + +Gibberish.Tremolo = function() { + var modulationCallback = new Gibberish.Sine().callback + + Gibberish.extend(this, { + name: 'tremolo', + type: 'effect', + + properties : { + input : 0, + frequency:2.5, + amp:.5, + }, + + callback : function( input, frequency, amp ) { + var channels = typeof input === 'number' ? 1 : 2, + modAmount = modulationCallback( frequency, amp ) + + if(channels === 1) { + input *= modAmount + }else{ + input[0] *= modAmount + input[1] *= modAmount + } + + return input; + } + }) + .init() + .processProperties(arguments); +}; +Gibberish.Tremolo.prototype = Gibberish._effect; + +/**#Gibberish.OnePole - FX +A one-pole filter for smoothing property values. This is particularly useful when the properties are being controlled interactively. You use the smooth method to apply the filter. + +## Example Usage## +`a = new Gibberish.Synth({ attack:44, decay:44100 }).connect(); +b = new Gibberish.OnePole({input:a.properties.frequency, a0:.0001, b1:.9999}); +b.smooth('frequency', a); +a.note(880); +a.note(440); +` +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the synth on initialization. +- - - - +**/ +/**###Gibberish.OnePole.input : property +Float. The property to smooth. You should always refer to this property through the properties dictionary of the ugen. In general it is much easier to use the smooth method of the OnePole than to set this property manually. +**/ +/**###Gibberish.OnePole.a0 : property +Float. The value the input is multiplied by. +**/ +/**###Gibberish.OnePole.b1 : property +Float. The value this pole of the filter is multiplied by. +**/ +Gibberish.OnePole = function() { + var history = 0, + phase = 0; + + Gibberish.extend(this, { + name: 'onepole', + type: 'effect', + + properties : { + input : 0, + a0 : .15, + b1 : .85, + }, + + callback : function(input, a0, b1) { + var out = input * a0 + history * b1; + history = out; + + return out; + }, + +/**###Gibberish.OnePole.smooth : method +Use this to apply the filter to a property of an object. + +param **propertyName** String. The name of the property to smooth. +param **object** Object. The object containing the property to be smoothed +**/ + smooth : function(property, obj) { + this.input = obj[ property ] + history = this.input + obj[ property ] = this + + this.obj = obj + this.property = property + + this.oldSetter = obj.__lookupSetter__( property ) + this.oldGetter = obj.__lookupGetter__( property ) + + var op = this + Object.defineProperty( obj, property, { + get : function() { return op.input }, + set : function(v) { + op.input = v + } + }) + }, + +/**###Gibberish.OnePole.remove : method +Remove OnePole from assigned ugen property. This will effectively remove the filter from the graph and return the normal target ugen property behavior. +**/ + remove : function() { + Object.defineProperty( this.obj, this.property, { + get: this.oldGetter, + set: this.oldSetter + }) + + this.obj[ this.property ] = this.input + } + }) + .init() + .processProperties(arguments); +}; +Gibberish.OnePole.prototype = Gibberish._effect; + +/**#Gibberish.Filter24 - FX +A four pole ladder filter. Adapted from Arif Ove Karlsne's 24dB ladder approximation: http://musicdsp.org/showArchiveComment.php?ArchiveID=141. + +## Example Usage## +`a = new Gibberish.Synth({ attack:44, decay:44100 }); +b = new Gibberish.Filter24({input:a, cutoff:.2, resonance:4}).connect(); +a.note(1760); +a.note(440); +a.isLowPass = false; +a.note(220); +a.note(1760); +` +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the synth on initialization. +- - - - +**/ +/**###Gibberish.Filter24.input : property +Object. The ugen that should feed the filter. +**/ +/**###Gibberish.Filter24.cutoff : property +Number. 0..1. The cutoff frequency for the synth's filter. +**/ +/**###Gibberish.Filter24.resonance : property +Number. 0..50. Values above 4.5 are likely to produce shrieking feedback. You are warned. +**/ +/**###Gibberish.Filter24.isLowPass : property +Boolean. Default true. Whether to use a low-pass or high-pass filter. +**/ +Gibberish.Filter24 = function() { + var poles = [0,0,0,0], + poles2 = [0,0,0,0], + output = [0,0], + phase = 0, + _cutoff = isNaN(arguments[0]) ? .1 : arguments[0], + _resonance = isNaN(arguments[1]) ? 3 : arguments[1] + _isLowPass = typeof arguments[2] !== 'undefined' ? arguments[2] : true; + + Gibberish.extend( this, { + name : "filter24", + + properties : { input:0, cutoff:_cutoff, resonance:_resonance, isLowPass:_isLowPass }, + + callback : function(sample, cutoff, resonance, isLowPass) { + var channels = typeof sample === 'number' ? 1 : 2; + var output1 = channels === 1 ? sample : sample[0]; + + var rezz = poles[3] * resonance; + rezz = rezz > 1 ? 1 : rezz; + + cutoff = cutoff < 0 ? 0 : cutoff; + cutoff = cutoff > 1 ? 1 : cutoff; + + output1 -= rezz; + + poles[0] = poles[0] + ((-poles[0] + output1) * cutoff); + poles[1] = poles[1] + ((-poles[1] + poles[0]) * cutoff); + poles[2] = poles[2] + ((-poles[2] + poles[1]) * cutoff); + poles[3] = poles[3] + ((-poles[3] + poles[2]) * cutoff); + + output1 = isLowPass ? poles[3] : output1 - poles[3]; + + if(channels === 2) { + var output2 = sample[1]; + + rezz = poles2[3] * resonance; + rezz = rezz > 1 ? 1 : rezz; + + output2 -= rezz; + + poles2[0] = poles2[0] + ((-poles2[0] + output2) * cutoff); + poles2[1] = poles2[1] + ((-poles2[1] + poles2[0]) * cutoff); + poles2[2] = poles2[2] + ((-poles2[2] + poles2[1]) * cutoff); + poles2[3] = poles2[3] + ((-poles2[3] + poles2[2]) * cutoff); + + output2 = isLowPass ? poles2[3] : output2 - poles2[3]; + output[0] = output1; + output[1] = output2; + + return output; + } + + return output1; // return mono + }, + }) + .init() + .processProperties(arguments); +}; +Gibberish.Filter24.prototype = Gibberish._effect; + +/**#Gibberish.SVF - FX +A two-pole state variable filter. This filter calculates coefficients on a per-sample basis, so that you can easily modulate cutoff and Q. Can switch between low-pass, high-pass, band and notch modes. + +## Example Usage## +`a = new Gibberish.Synth({ attack:44, decay:44100 }); +b = new Gibberish.SVF({input:a, cutoff:200, Q:4, mode:0}); +a.note(1760); +a.note(440); +a.mode = 2; +a.note(220); +a.note(1760); +` +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the synth on initialization. +- - - - +**/ +/**###Gibberish.SVF.input : property +Object. The ugen that should feed the filter. +**/ +/**###Gibberish.SVF.cutoff : property +Number. 0..22050. The cutoff frequency for the synth's filter. Note that unlike the Filter24, this is measured in Hz. +**/ +/**###Gibberish.SVF.resonance : property +Number. 0..50. Values above 4.5 are likely to produce shrieking feedback. You are warned. +**/ +/**###Gibberish.SVF.mode : property +Number. 0..3. 0 = lowpass, 1 = highpass, 2 = bandpass, 3 = notch. +**/ +Gibberish.SVF = function() { + var d1 = [0,0], d2 = [0,0], pi= Math.PI, out = [0,0]; + + Gibberish.extend( this, { + name:"SVF", + properties : { input:0, cutoff:440, Q:2, mode:0, sr: Gibberish.context.sampleRate }, + + callback: function(sample, frequency, Q, mode, sr) { + var channels = typeof sample === 'number' ? 1 : 2; + var output1 = channels === 1 ? sample : sample[0]; + + var f1 = 2 * pi * frequency / sr; + Q = 1 / Q; + + var l = d2[0] + f1 * d1[0]; + var h = output1 - l - Q * d1[0]; + var b = f1 * h + d1[0]; + var n = h + l; + + d1[0] = b; + d2[0] = l; + + if(mode === 0) + output1 = l; + else if(mode === 1) + output1 = h; + else if(mode === 2) + output1 = b; + else + output1 = n; + + if(channels === 2) { + var output2 = sample[1]; + var l = d2[1] + f1 * d1[1]; + var h = output2 - l - Q * d1[1]; + var b = f1 * h + d1[1]; + var n = h + l; + + d1[1] = b; + d2[1] = l; + + if(mode === 0) + output2 = l; + else if(mode === 1) + output2 = h; + else if(mode === 2) + output2 = b; + else + output2 = n; + + out[0] = output1; out[1] = output2; + }else{ + out = output1; + } + + return out; + }, + }) + .init() + .processProperties(arguments); +}; +Gibberish.SVF.prototype = Gibberish._effect; + +/**#Gibberish.Biquad - FX +A two-pole biquad filter. Currently, you must manually call calculateCoefficients every time mode, cutoff or Q changes; thus this filter isn't good for samplerate modulation. + +## Example Usage## +`a = new Gibberish.Synth({ attack:44, decay:44100 }); +b = new Gibberish.Biquad({input:a, cutoff:200, Q:4, mode:"LP"}).connect(); +a.note(1760); +a.note(440); +a.mode = "HP"; +a.note(220); +a.note(1760); +` +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the synth on initialization. +- - - - +**/ +/**###Gibberish.Biquad.input : property +Object. The ugen that should feed the filter. +**/ +/**###Gibberish.Biquad.cutoff : property +Number. 0..22050. The cutoff frequency for the synth's filter. Note that unlike the Filter24, this is measured in Hz. +**/ +/**###Gibberish.Biquad.Q : property +Number. 0..50. Values above 4.5 are likely to produce shrieking feedback. You are warned. +**/ +/**###Gibberish.Biquad.mode : property +Number. 0..3. "LP" = lowpass, "HP" = highpass, "BP" = bandpass +**/ +Gibberish.Biquad = function() { + var x1L = 0, + x2L = 0, + y1L = 0, + y2L = 0, + x1R = 0, + x2R = 0, + y1R = 0, + y2R = 0, + out = [0,0], + b0 = 0.001639, + b1 = 0.003278, + b2 = 0.001639, + a1 = -1.955777, + a2 = 0.960601, + _mode = "LP", + _cutoff = 2000, + _Q = .5, + sr = Gibberish.context.sampleRate, + _phase = 0; + + Gibberish.extend(this, { + name: "biquad", + + properties: { + input: null, + }, + + calculateCoefficients: function() { + switch (_mode) { + case "LP": + var w0 = 2 * Math.PI * _cutoff / sr, + sinw0 = Math.sin(w0), + cosw0 = Math.cos(w0), + alpha = sinw0 / (2 * _Q); + b0 = (1 - cosw0) / 2, + b1 = 1 - cosw0, + b2 = b0, + a0 = 1 + alpha, + a1 = -2 * cosw0, + a2 = 1 - alpha; + break; + case "HP": + var w0 = 2 * Math.PI * _cutoff / sr, + sinw0 = Math.sin(w0), + cosw0 = Math.cos(w0), + alpha = sinw0 / (2 * _Q); + b0 = (1 + cosw0) / 2, + b1 = -(1 + cosw0), + b2 = b0, + a0 = 1 + alpha, + a1 = -2 * cosw0, + a2 = 1 - alpha; + break; + case "BP": + var w0 = 2 * Math.PI * _cutoff / sr, + sinw0 = Math.sin(w0), + cosw0 = Math.cos(w0), + toSinh = Math.log(2) / 2 * _Q * w0 / sinw0, + alpha = sinw0 * (Math.exp(toSinh) - Math.exp(-toSinh)) / 2; + b0 = alpha, + b1 = 0, + b2 = -alpha, + a0 = 1 + alpha, + a1 = -2 * cosw0, + a2 = 1 - alpha; + break; + default: + return; + } + + b0 = b0 / a0; + b1 = b1 / a0; + b2 = b2 / a0; + a1 = a1 / a0; + a2 = a2 / a0; + + }, + + callback: function( x ) { + var channels = isNaN( x ) ? 2 : 1, + outL = 0, + outR = 0, + inL = channels === 1 ? x : x[0]; + + //if( _phase++ % 22050 === 0 ) console.log( "X IS ", typeof x ) + + outL = b0 * inL + b1 * x1L + b2 * x2L - a1 * y1L - a2 * y2L; + + x2L = x1L; + x1L = inL; + y2L = y1L; + y1L = outL; + + if(channels === 2) { + inR = x[1]; + outR = b0 * inR + b1 * x1R + b2 * x2R - a1 * y1R - a2 * y2R; + x2R = x1R; + x1R = inR; + y2R = y1R; + y1R = outR; + + out[0] = outL; + out[1] = outR; + } + return channels === 1 ? outL : out; + }, + }) + .init(); + + Object.defineProperties(this, { + mode : { + get: function() { return _mode; }, + set: function(v) { _mode = v; this.calculateCoefficients(); } + }, + cutoff : { + get: function() { return _cutoff; }, + set: function(v) { _cutoff = v; this.calculateCoefficients(); } + }, + Q : { + get: function() { return _Q; }, + set: function(v) { _Q = v; this.calculateCoefficients(); } + }, + }) + + this.processProperties(arguments); + + this.calculateCoefficients(); +}; +Gibberish.Biquad.prototype = Gibberish._effect; + +/**#Gibberish.Flanger - FX +Classic flanging effect with feedback. + +## Example Usage## +`a = new Gibberish.Synth({ attack:44, decay:44100 }); +b = new Gibberish.Flanger({input:a, rate:.5, amount:125, feedback:.5}).connect(); +a.note(440); +a.feedback = 0; +a.note(440); +a.rate = 4; +a.note(440); +` +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the synth on initialization. +- - - - +**/ +/**###Gibberish.Flanger.input : property +Object. The ugen that should feed the flagner. +**/ +/**###Gibberish.Flanger.rate : property +Number. The speed at which the delay line tap position is modulated. +**/ +/**###Gibberish.Flanger.amount : property +Number. The amount of time, in samples, that the delay line tap position varies by. +**/ +/**###Gibberish.Flanger.feedback : property +Number. The amount of output that should be fed back into the delay line +**/ +/**###Gibberish.Flanger.offset : property +Number. The base offset of the delay line tap from the current time. Large values (> 500) lead to chorusing effects. +**/ + +Gibberish.Flanger = function() { + var buffers = [ new Float32Array(88200), new Float32Array(88200) ], + bufferLength = 88200, + delayModulation = new Gibberish.Sine().callback, + interpolate = Gibberish.interpolate, + readIndex = -100, + writeIndex = 0, + phase = 0; + + Gibberish.extend(this, { + name:"flanger", + properties:{ input:0, rate:.25, feedback:0, amount:125, offset:125 }, + + callback : function(sample, delayModulationRate, feedback, delayModulationAmount, offset) { + var channels = typeof sample === 'number' ? 1 : 2; + + var delayIndex = readIndex + delayModulation( delayModulationRate, delayModulationAmount * .95 ); + + if(delayIndex > bufferLength) { + delayIndex -= bufferLength; + }else if(delayIndex < 0) { + delayIndex += bufferLength; + } + + var delayedSample = interpolate(buffers[0], delayIndex); + buffers[0][writeIndex] = channels === 1 ? sample + (delayedSample * feedback): sample[0] + (delayedSample * feedback); + + if(channels === 2) { + sample[0] += delayedSample; + + delayedSample = interpolate(buffers[1], delayIndex); + buffers[1][writeIndex] = sample[1] + (delayedSample * feedback); + + sample[1] += delayedSample; + }else{ + sample += delayedSample; + } + + if(++writeIndex >= bufferLength) writeIndex = 0; + if(++readIndex >= bufferLength) readIndex = 0; + + return sample; + }, + }) + .init() + .processProperties(arguments); + + readIndex = this.offset * -1; +}; +Gibberish.Flanger.prototype = Gibberish._effect; + +/**#Gibberish.Vibrato - FX +Delay line vibrato effect. + +## Example Usage## +`a = new Gibberish.Synth({ attack:44, decay:44100 }); +b = new Gibberish.Vibrato({input:a, rate:4, amount:125 }).connect(); +a.note(440); +a.rate = .5; +a.note(440); +` +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the synth on initialization. +- - - - +**/ +/**###Gibberish.Vibrato.input : property +Object. The ugen that should feed the vibrato. +**/ +/**###Gibberish.Vibrato.rate : property +Number. The speed at which the delay line tap position is modulated. +**/ +/**###Gibberish.Vibrato.amount : property +Number. The size of the delay line modulation; effectively the amount of vibrato to produce, +**/ +/**###Gibberish.Vibrato.offset : property +Number. The base offset of the delay line tap from the current time. +**/ +Gibberish.Vibrato = function() { + var buffers = [ new Float32Array(88200), new Float32Array(88200) ], + bufferLength = 88200, + delayModulation = new Gibberish.Sine().callback, + interpolate = Gibberish.interpolate, + readIndex = -100, + writeIndex = 0, + phase = 0; + + Gibberish.extend(this, { + name:"vibrato", + properties:{ input:0, rate:5, amount:.5, offset:125 }, + + callback : function(sample, delayModulationRate, delayModulationAmount, offset) { + var channels = typeof sample === 'number' ? 1 : 2; + + var delayIndex = readIndex + delayModulation( delayModulationRate, delayModulationAmount * offset - 1 ); + + if(delayIndex > bufferLength) { + delayIndex -= bufferLength; + }else if(delayIndex < 0) { + delayIndex += bufferLength; + } + + var delayedSample = interpolate(buffers[0], delayIndex); + buffers[0][writeIndex] = channels === 1 ? sample : sample[0]; + + if(channels === 2) { + sample[0] = delayedSample; + + delayedSample = interpolate(buffers[1], delayIndex); + buffers[1][writeIndex] = sample[1]; + + sample[1] = delayedSample; + }else{ + sample = delayedSample; + } + + if(++writeIndex >= bufferLength) writeIndex = 0; + if(++readIndex >= bufferLength) readIndex = 0; + + return sample; + }, + }) + .init() + .processProperties(arguments); + + readIndex = this.offset * -1; +}; +Gibberish.Vibrato.prototype = Gibberish._effect; + +/**#Gibberish.BufferShuffler - FX +A buffer shuffling / stuttering effect with reversing and pitch-shifting + +## Example Usage## +`a = new Gibberish.Synth({ attack:88200, decay:88200 }); +b = new Gibberish.BufferShuffler({input:a, chance:.25, amount:125, rate:44100, pitchMin:-4, pitchMax:4 }).connect(); +a.note(440); +` +##Constructor## +**param** *properties* : Object. A dictionary of property keys and values to assign to the Gibberish.BufferShuffler object +- - - - +**/ +/**###Gibberish.BufferShuffler.chance : property +Float. Range 0..1. Default .25. The likelihood that incoming audio will be shuffled. +**/ +/**###Gibberish.BufferShuffler.rate : property +Integer, in samples. Default 11025. How often Gibberish.BufferShuffler will randomly decide whether or not to shuffle. +**/ +/**###Gibberish.BufferShuffler.length : property +Integer, in samples. Default 22050. The length of time to play stuttered audio when stuttering occurs. +**/ +/**###Gibberish.BufferShuffler.reverseChance : property +Float. Range 0..1. Default .5. The likelihood that stuttered audio will be reversed +**/ +/**###Gibberish.BufferShuffler.pitchChance : property +Float. Range 0..1. Default .5. The likelihood that stuttered audio will be repitched. +**/ +/**###Gibberish.BufferShuffler.pitchMin : property +Float. Range 0..1. Default .25. The lowest playback speed used to repitch the audio +**/ +/**###Gibberish.BufferShuffler.pitchMax : property +Float. Range 0..1. Default 2. The highest playback speed used to repitch the audio. +**/ +/**###Gibberish.BufferShuffler.wet : property +Float. Range 0..1. Default 1. When shuffling, the amplitude of the wet signal +**/ +/**###Gibberish.BufferShuffler.dry : property +Float. Range 0..1. Default 0. When shuffling, the amplitude of the dry signal +**/ + +Gibberish.BufferShuffler = function() { + var buffers = [ new Float32Array(88200), new Float32Array(88200) ], + bufferLength = 88200, + readIndex = 0, + writeIndex = 0, + randomizeCheckIndex = 0, + shuffleTimeKeeper = 0, + isShuffling = 0, + random = Math.random, + fadeIndex = 0, + fadeAmount = 1, + isFadingWetIn = false, + isFadingDryIn = false, + reversed = false, + interpolate = Gibberish.interpolate, + pitchShifting = false, + speed = 1, + isBufferFull = false, + rndf = Gibberish.rndf, + _output = [0,0]; + + Gibberish.extend(this, { + name:"buffer_shuffler", + + properties: { input:0, chance:.25, rate:11025, length:22050, reverseChange:.5, pitchChance:.5, pitchMin:.25, pitchMax:2, wet:1, dry:0 }, + + callback : function(sample, chance, rate, length, reverseChance, pitchChance, pitchMin, pitchMax, wet, dry) { + var channels = typeof sample === 'number' ? 1 : 2; + + if(!isShuffling) { + buffers[0][writeIndex] = channels === 1 ? sample : sample[0]; + buffers[1][writeIndex] = channels === 1 ? sample : sample[1]; // won't be used but with one handle but probably cheaper than an if statement? + + writeIndex++ + writeIndex %= bufferLength; + + isBufferFull = writeIndex === 0 ? 1 : isBufferFull; // don't output buffered audio until a buffer is full... otherwise you just get a gap + + randomizeCheckIndex++; + + if(randomizeCheckIndex % rate == 0 && random() < chance) { + reversed = random() < reverseChance; + isShuffling = true; + if(!reversed) { + readIndex = writeIndex - length; + if(readIndex < 0) readIndex = bufferLength + readIndex; + } + pitchShifting = random() < pitchChance; + if(pitchShifting) { + speed = rndf(pitchMin, pitchMax); + } + fadeAmount = 1; + isFadingWetIn = true; + isFadingDryIn = false; + } + }else if(++shuffleTimeKeeper % (length - 400) === 0) { + isFadingWetIn = false; + isFadingDryIn = true; + fadeAmount = 1; + shuffleTimeKeeper = 0; + } + + readIndex += reversed ? speed * -1 : speed; + if(readIndex < 0) { + readIndex += bufferLength; + }else if( readIndex >= bufferLength ) { + readIndex -= bufferLength; + } + var outSampleL = interpolate(buffers[0], readIndex); + + var outL, outR, shuffle, outSampleR; + if(isFadingWetIn) { + fadeAmount -= .0025; + + shuffle = (outSampleL * (1 - fadeAmount)); + outL = channels === 1 ? shuffle + (sample * fadeAmount) : shuffle + (sample[0] * fadeAmount); + + if(channels === 2) { + outSampleR = interpolate(buffers[1], readIndex); + shuffle = (outSampleR * (1 - fadeAmount)); + outR = channels === 1 ? outL : shuffle + (sample[1] * fadeAmount); + } + + if(fadeAmount <= .0025) isFadingWetIn = false; + }else if(isFadingDryIn) { + fadeAmount -= .0025; + + shuffle = outSampleL * fadeAmount; + outL = channels === 1 ? shuffle + (sample * fadeAmount) : shuffle + (sample[0] * (1 - fadeAmount)); + + if(channels === 2) { + outSampleR = interpolate(buffers[1], readIndex); + shuffle = outSampleR * fadeAmount; + outR = shuffle + (sample[1] * (1 - fadeAmount)); + } + + if(fadeAmount <= .0025) { + isFadingDryIn = false; + isShuffling = false; + reversed = false; + speed = 1; + pitchShifting = 0; + } + }else{ + if(channels === 1) { + outL = isShuffling && isBufferFull ? (outSampleL * wet) + sample * dry : sample; + }else{ + outSampleR = interpolate(buffers[1], readIndex); + outL = isShuffling && isBufferFull ? (outSampleL * wet) + sample[0] * dry : sample[0]; + outR = isShuffling && isBufferFull ? (outSampleR * wet) + sample[1] * dry : sample[1]; + } + } + _output = [outL, outR]; + return channels === 1 ? outL : _output; + }, + }) + .init() + .processProperties(arguments); +}; +Gibberish.BufferShuffler.prototype = Gibberish._effect; + +Gibberish.AllPass = function(time, feedback) { + var index = -1, + buffer = new Float32Array(time || 500), + bufferLength = buffer.length; + + Gibberish.extend(this, { + name: "allpass", + properties: { + input : 0, + }, + callback : function(sample) { + index = ++index % bufferLength; + var bufferSample = buffer[index]; + var out = -1 * sample + bufferSample; + + buffer[index] = sample + (bufferSample * .5); + return out; + }, + }); + +}; +/* +adapted from audioLib.js, in turn adapted from Freeverb source code +this is actually a lowpass-feedback-comb filter (https://ccrma.stanford.edu/~jos/pasp/Lowpass_Feedback_Comb_Filter.html) +*/ +Gibberish.Comb = function(time) { + var buffer = new Float32Array(time || 1200), + bufferLength = buffer.length, + index = 0, + store = 0; + + Gibberish.extend(this, { + name: "comb", + properties : { + input : 0, + feedback : .84, + damping: .2, + //time: time || 1200, + }, + + /* + self.sample = self.buffer[self.index]; + self.store = self.sample * self.invDamping + self.store * self.damping; + self.buffer[self.index++] = s + self.store * self.feedback; + */ + + callback: function(sample, feedback, damping) { + var currentPos = ++index % bufferLength; + var out = buffer[currentPos]; + + store = (out * (1 - damping)) + (store * damping); + + buffer[currentPos] = sample + (store * feedback); + + return out; + }, + }); + +}; + +/**#Gibberish.Reverb - FX +based off audiolib.js reverb and freeverb + +## Example Usage## +`a = new Gibberish.Synth({ attack:88200, decay:88200 }); +b = new Gibberish.Reverb({input:a, roomSize:.5, wet:1, dry;.25}).connect(); +a.note(440); +` +##Constructor +**param** *properties* : Object. A dictionary of property keys and values to assign to the Gibberish.BufferShuffler object +**/ +/**###Gibberish.Reverb.roomSize : property +Float. 0..1. The size of the room being emulated. +**/ +/**###Gibberish.Reverb.damping : property +Float. Attenuation of high frequencies that occurs. +**/ +/**###Gibberish.Reverb.wet : property +Float. Default = .75. The amount of processed signal that is output. +**/ +/**###Gibberish.Reverb.dry : property +Float. Default = .5. The amount of dry signal that is output +**/ + +Gibberish.Reverb = function() { + var tuning = { + combCount: 8, + combTuning: [1116, 1188, 1277, 1356, 1422, 1491, 1557, 1617], + + allPassCount: 4, + allPassTuning: [556, 441, 341, 225], + allPassFeedback: 0.5, + + fixedGain: 0.015, + scaleDamping: 0.4, + + scaleRoom: 0.28, + offsetRoom: 0.7, + + stereoSpread: 23 + }, + feedback = .84, + combs = [], + apfs = [], + output = [0,0], + phase = 0; + + Gibberish.extend(this, { + name: "reverb", + + roomSize: .5, + + properties: { + input: 0, + wet: .5, + dry: .55, + roomSize: .84, + damping: .5, + }, + + callback : function(sample, wet, dry, roomSize, damping) { + var channels = typeof sample === 'object' ? 2 : 1; + + var input = channels === 1 ? sample : sample[0] + sample[1]; // converted to fake stereo + + var _out = input * .015; + var out = _out; + + for(var i = 0; i < 8; i++) { + var filt = combs[i](_out, roomSize * .98, (damping * .4)); // .98 is scaleRoom + offsetRoom, .4 is scaleDamping + out += filt; + } + + for(var i = 0; i < 4; i++) { + out = apfs[i](out); + } + + output[0] = output[1] = (input * dry) + (out * wet); + + return output; + }, + }) + .init() + .processProperties(arguments); + + this.setFeedback = function(v) { feedback = v } + + for(var i = 0; i < 8; i++){ + combs.push( new Gibberish.Comb( tuning.combTuning[i] ).callback ); + } + + for(var i = 0; i < 4; i++){ + apfs.push( new Gibberish.AllPass(tuning.allPassTuning[i], tuning.allPassFeedback ).callback ); + } + +}; +Gibberish.Reverb.prototype = Gibberish._effect; + +/**#Gibberish.StereoReverb - FX +stereo version of the reverb effect + +## Example Usage## +`a = new Gibberish.Synth({ attack:88200, decay:88200, pan:-1 }); +b = new Gibberish.StereoReverb({input:a, roomSize:.5, wet:1, dry;.25}).connect(); +a.note(440); +` +##Constructor +**param** *properties* : Object. A dictionary of property keys and values to assign to the Gibberish.BufferShuffler object +**/ +/**###Gibberish.Reverb.roomSize : property +Float. 0..1. The size of the room being emulated. +**/ +/**###Gibberish.Reverb.damping : property +Float. Attenuation of high frequencies that occurs. +**/ +/**###Gibberish.Reverb.wet : property +Float. Default = .75. The amount of processed signal that is output. +**/ +/**###Gibberish.Reverb.dry : property +Float. Default = .5. The amount of dry signal that is output +**/ +Gibberish.StereoReverb = function() { + var tuning = { + combCount: 8, + combTuning: [1116, 1188, 1277, 1356, 1422, 1491, 1557, 1617], + + allPassCount: 4, + allPassTuning: [556, 441, 341, 225], + allPassFeedback: 0.5, + + fixedGain: 0.015, + scaleDamping: 0.4, + + scaleRoom: 0.28, + offsetRoom: 0.7, + + stereoSpread: 23 + }, + feedback = .84, + combsL = [], combsR = [], + apfsL = [], apfsR = [], + output = [0,0], + phase = 0; + + Gibberish.extend(this, { + name: "reverb", + + roomSize: .5, + + properties: { + input: 0, + wet: .5, + dry: .55, + roomSize: .84, + damping: .5, + }, + + callback : function(sample, wet, dry, roomSize, damping) { + var channels = typeof sample === 'object' ? 2 : 1, + l = sample[0], + r = channels === 1 ? l : sample[1], + _outL = outL = l * .015, + _outR = outR = r * .015; + + for(var i = 0; i < 8; i++) { // parallel + outL += combsL[ i ]( _outL, roomSize * .98, (damping * .4)); // .98 is scaleRoom + offsetRoom, .4 is scaleDamping + outR += combsR[ i ]( _outR, roomSize * .98, (damping * .4)); + } + + for(var i = 0; i < 4; i++) { + outL = apfsL[ i ]( outL ); + outR = apfsR[ i ]( outR ); + } + + output[0] = (l * dry) + (outL * wet); + output[1] = (r * dry) + (outR * wet); + + return output; + }, + }) + .init() + .processProperties(arguments); + + this.setFeedback = function(v) { feedback = v } + + for(var i = 0; i < 8; i++){ + combsL.push( new Gibberish.Comb( tuning.combTuning[i] ).callback ); + combsR.push( new Gibberish.Comb( tuning.combTuning[i] ).callback ); + } + + for(var i = 0; i < 4; i++){ + apfsL.push( new Gibberish.AllPass(tuning.allPassTuning[i], tuning.allPassFeedback ).callback ); + apfsR.push( new Gibberish.AllPass(tuning.allPassTuning[i], tuning.allPassFeedback ).callback ); + } +}; +Gibberish.StereoReverb.prototype = Gibberish._effect; + +/**#Gibberish.Granulator - FX +A granulator that operates on a buffer of samples. You can get the samples from a [Sampler](javascript:displayDocs('Gibberish.Sampler'\)) +object. + +## Example Usage ## +`a = new Gibberish.Sampler('resources/trumpet.wav'); +// wait until sample is loaded to create granulator +a.onload = function() { + b = new Gibberish.Granulator({ + buffer:a.getBuffer(), + grainSize:1000, + speedMin: -2, + speedMax: 2, + }); + b.mod('position', new Gibberish.Sine(.1, .45), '+'); + b.connect(); +};` +## Constructor +**param** *propertiesList*: Object. At a minimum you should define the input to granulate. See the example. +**/ +/**###Gibberish.Granulator.speed : property +Float. The playback rate, in samples, of each grain +**/ +/**###Gibberish.Granulator.speedMin : property +Float. When set, the playback rate will vary on a per grain basis from (grain.speed + grain.speedMin) -> (grain.speed + grain.speedMax). This value should almost always be negative. +**/ +/**###Gibberish.Granulator.speedMax : property +Float. When set, the playback rate will vary on a per grain basis from (grain.speed + grain.speedMin) -> (grain.speed + grain.speedMax). +**/ +/**###Gibberish.Granulator.grainSize : property +Integer. The length, in samples, of each grain +**/ +/**###Gibberish.Granulator.position : property +Float. The center position of the grain cloud. 0 represents the start of the buffer, 1 represents the end. +**/ +/**###Gibberish.Granulator.positionMin : property +Float. The left boundary on the time axis of the grain cloud. +**/ +/**###Gibberish.Granulator.positionMax : property +Float. The right boundary on the time axis of the grain cloud. +**/ +/**###Gibberish.Granulator.buffer : property +Object. The input buffer to granulate. +**/ +/**###Gibberish.Granulator.numberOfGrains : property +Float. The number of grains in the cloud. Can currently only be set on initialization. +**/ + +Gibberish.Granulator = function(properties) { + var grains = []; + buffer = null, + interpolate = Gibberish.interpolate, + panner = Gibberish.makePanner(), + bufferLength= 0, + debug = 0, + write = 0, + self = this, + out = [0,0], + _out = [0,0], + rndf = Gibberish.rndf, + numberOfGrains = properties.numberOfGrains || 20; + + console.log( "NUMBER OF GRAINS", numberOfGrains ) + + Gibberish.extend(this, { + name: "granulator", + bufferLength: 88200, + reverse: true, + spread: .5, + + properties : { + speed: 1, + speedMin: -0, + speedMax: .0, + grainSize: 1000, + position: .5, + positionMin: 0, + positionMax: 0, + amp: .2, + fade: .1, + pan: 0, + shouldWrite: false, + }, + + setBuffer : function(b) { buffer = b; bufferLength = b.length }, + + callback : function(speed, speedMin, speedMax, grainSize, positionMin, positionMax, position, amp, fade, pan, shouldWrite) { + for(var i = 0; i < numberOfGrains; i++) { + var grain = grains[i]; + + if(grain._speed > 0) { + if(grain.pos > grain.end) { + grain.pos = (position + rndf(positionMin, positionMax)) * buffer.length; + grain.start = grain.pos; + grain.end = grain.start + grainSize; + grain._speed = speed + rndf(speedMin, speedMax); + grain._speed = grain._speed < .1 ? .1 : grain._speed; + grain._speed = grain._speed < .1 && grain._speed > 0 ? .1 : grain._speed; + grain._speed = grain._speed > -.1 && grain._speed < 0 ? -.1 : grain._speed; + grain.fadeAmount = grain._speed * (fade * grainSize); + grain.pan = rndf(self.spread * -1, self.spread); + } + + var _pos = grain.pos; + while(_pos > buffer.length) _pos -= buffer.length; + while(_pos < 0) _pos += buffer.length; + + var _val = interpolate(buffer, _pos); + + _val *= grain.pos < grain.fadeAmount + grain.start ? (grain.pos - grain.start) / grain.fadeAmount : 1; + _val *= grain.pos > (grain.end - grain.fadeAmount) ? (grain.end - grain.pos) / grain.fadeAmount : 1; + + }else { + if(grain.pos < grain.end) { + grain.pos = (position + rndf(positionMin, positionMax)) * buffer.length; + grain.start = grain.pos; + grain.end = grain.start - grainSize; + grain._speed = speed + rndf(speedMin, speedMax); + grain._speed = grain._speed < .1 && grain._speed > 0 ? .1 : grain._speed; + grain._speed = grain._speed > -.1 && grain._speed < 0 ? -.1 : grain._speed; + grain.fadeAmount = grain._speed * (fade * grainSize); + } + + var _pos = grain.pos; + while(_pos > buffer.length) _pos -= buffer.length; + while(_pos < 0) _pos += buffer.length; + + var _val = interpolate(buffer, _pos); + + _val *= grain.pos > grain.start - grain.fadeAmount ? (grain.start - grain.pos) / grain.fadeAmount : 1; + _val *= grain.pos < (grain.end + grain.fadeAmount) ? (grain.end - grain.pos) / grain.fadeAmount : 1; + } + + _out = panner(_val * amp, grain.pan, _out); + out[0] += _out[0]; + out[1] += _out[1]; + + grain.pos += grain._speed; + } + + return panner(out, pan, out); + }, + }) + .init() + .processProperties(arguments); + + + + for(var i = 0; i < numberOfGrains; i++) { + grains[i] = { + pos : self.position + Gibberish.rndf(self.positionMin, self.positionMax), + _speed : self.speed + Gibberish.rndf(self.speedMin, self.speedMax), + } + grains[i].start = grains[i].pos; + grains[i].end = grains[i].pos + self.grainSize; + grains[i].fadeAmount = grains[i]._speed * (self.fade * self.grainSize); + grains[i].pan = Gibberish.rndf(self.spread * -1, self.spread); + + console.log( "GRAIN", i, "POS", grains[i].pos, "SPEED", grains[i]._speed ) + } + + this.grains = grains + + /*if(typeof properties.input !== "undefined") { + this.shouldWrite = true; + + this.sampler = new Gibberish.Sampler(); + this.sampler.connect(); + this.sampler.record(properties.buffer, this.bufferLength); + + buffer = this.sampler.buffer; + }else*/ if(typeof properties.buffer !== 'undefined') { + buffer = properties.buffer; + bufferLength = buffer.length; + } + +}; +Gibberish.Granulator.prototype = Gibberish._effect; +Gibberish.synth = function() { + this.type = 'oscillator'; + + this.oscillatorInit = function() { + this.fx = new Array2; + this.fx.parent = this; + }; +}; +Gibberish.synth.prototype = new Gibberish.ugen(); +Gibberish._synth = new Gibberish.synth(); + +/**#Gibberish.Synth - Synth +Oscillator + attack / decay envelope. + +## Example Usage## +`Gibberish.init(); +a = new Gibberish.Synth({ attack:44, decay:44100 }).connect(); +a.note(880); +a.waveform = "Triangle"; +` +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the synth on initialization. +- - - - +**/ +/**###Gibberish.Synth.frequency : property +Number. The frequency for the carrier oscillator. This is normally set using the note method but can also be modulated. +**/ +/**###Gibberish.Synth.pulsewidth : property +Number. The duty cycle for PWM synthesis +**/ +/**###Gibberish.Synth.attack : property +Number. The length of the attack portion of the envelope in samples. Note that the synth's envelope affects both amplitude and the index of the synth. +**/ +/**###Gibberish.Synth.decay : property +Number. The length of the decay portion of the envelope in samples. Note that the synth's envelope affects both amplitude and the index of the synth. +**/ +/**###Gibberish.Synth.glide : property +Number. The synth has a one-pole filter attached to the carrier frequency. Set glide to a value between .999 and 1 to get pitch sweep between notes. +**/ +/**###Gibberish.Synth.amp : property +Number. The relative amplitude level of the synth. +**/ +/**###Gibberish.Synth.channels : property +Number. Default 2. Mono or Stereo synthesis. +**/ +/**###Gibberish.Synth.pan : property +Number. Default 0. If the synth has two channels, this determines its position in the stereo spectrum. +**/ +/**###Gibberish.Synth.waveform : property +String. The type of waveform to use. Options include 'Sine', 'Triangle', 'PWM', 'Saw' etc. +**/ + +Gibberish.Synth = function(properties) { + this.name = "synth"; + + this.properties = { + frequency:0, + pulsewidth:.5, + attack: 22050, + decay: 22050, + sustain: 22050, + release: 22050, + attackLevel: 1, + sustainLevel: .5, + releaseTrigger: 0, + glide: .15, + amp: .25, + channels: 2, + pan: 0, + velocity: 1, + sr: Gibberish.context.sampleRate, + }; +/**###Gibberish.Synth.note : method +Generate an enveloped note at the provided frequency + +param **frequency** Number. The frequency for the oscillator. +param **amp** Number. Optional. The volume to use. +**/ + this.note = function(frequency, velocity) { + if( typeof frequency === 'undefined' ) return + if( Array.isArray( arguments[0] ) ) { + var tmp = arguments[0][0] + velocity = arguments[0][1] + frequency = tmp + } + + + if( velocity !== 0 ) { + if( typeof this.frequency !== 'object' ){ + if( useADSR && frequency === lastFrequency && properties.requireReleaseTrigger ) { + this.releaseTrigger = 1; + lastFrequency = null + return; + } + + this.frequency = lastFrequency = frequency; + this.releaseTrigger = 0; + + if( typeof frequency === 'object' ) { + Gibberish.dirty( this ) + } + }else{ + this.frequency[0] = lastFrequency = frequency; + this.releaseTrigger = 0; + Gibberish.dirty(this); + } + + if( typeof velocity !== 'undefined') { + this.velocity = velocity; + } + _envelope.run(); + }else{ + this.releaseTrigger = 1; + } + }; + + properties = properties || {} + + var useADSR = typeof properties.useADSR === 'undefined' ? false : properties.useADSR, + _envelope = useADSR ? new Gibberish.ADSR() : new Gibberish.AD(), + envstate = _envelope.getState, + envelope = _envelope.callback, + _osc = new Gibberish.PWM(), + osc = _osc.callback, + lag = new Gibberish.OnePole().callback, + panner = Gibberish.makePanner(), + obj = this, + lastFrequency = 0, + phase = 0, + out = [0,0]; + + _envelope.requireReleaseTrigger = properties.requireReleaseTrigger || false; + + this.callback = function(frequency, pulsewidth, attack, decay, sustain,release,attackLevel,sustainLevel,releaseTrigger, glide, amp, channels, pan, velocity, sr) { + glide = glide >= 1 ? .99999 : glide; + frequency = lag(frequency, 1-glide, glide); + + var env, val + if( useADSR ) { + env = envelope( attack, decay, sustain, release, attackLevel, sustainLevel, releaseTrigger ); + if( releaseTrigger ) { + obj.releaseTrigger = 0 + } + + if( envstate() < 4 ) { + val = osc( frequency, 1, pulsewidth, sr ) * env * velocity * amp; + + return channels === 1 ? val : panner(val, pan, out); + }else{ + val = out[0] = out[1] = 0; + return channels === 1 ? val : out + } + }else{ + if(envstate() < 2) { + env = envelope(attack, decay); + val = osc( frequency, 1, pulsewidth, sr ) * env * velocity * amp; + + return channels === 1 ? val : panner(val, pan, out); + }else{ + val = out[0] = out[1] = 0; + return channels === 1 ? val : out + } + } + }; + + this.getEnv = function() { return _envelope; } + this.getOsc = function() { return _osc; }; + this.setOsc = function(val) { _osc = val; osc = _osc.callback }; + + var waveform = "PWM"; + Object.defineProperty(this, 'waveform', { + get : function() { return waveform; }, + set : function(val) { this.setOsc( new Gibberish[val]() ); } + }); + + this.init(); + this.oscillatorInit(); + this.processProperties(arguments); +}; +Gibberish.Synth.prototype = Gibberish._synth; + +/**#Gibberish.PolySynth - Synth +A polyphonic version of [Synth](javascript:displayDocs('Gibberish.Synth'\)). There are two additional properties for the polyphonic version of the synth. The polyphonic version consists of multiple Synths being fed into a single [Bus](javascript:displayDocs('Gibberish.Bus'\)) object. + +## Example Usage ## +`Gibberish.init(); +a = new Gibberish.PolySytn({ attack:88200, decay:88200, maxVoices:10 }).connect(); +a.note(880); +a.note(1320); +a.note(1760); +` +## Constructor +One important property to pass to the constructor is the maxVoices property, which defaults to 5. This controls how many voices are allocated to the synth and cannot be changed after initialization. + +**param** *properties*: Object. A dictionary of property values (see below) to set for the synth on initialization. +- - - - +**/ +/**###Gibberish.PolySynth.children : property +Array. Read-only. An array holding all of the child FMSynth objects. +**/ +/**###Gibberish.PolySynth.maxVoices : property +Number. The number of voices of polyphony the synth has. May only be set in initialization properties passed to constrcutor. +**/ +Gibberish.PolySynth = function() { + this.__proto__ = new Gibberish.Bus2(); + + Gibberish.extend(this, { + name: "polysynth", + maxVoices: 5, + voiceCount: 0, + frequencies: [], + _frequency: 0, + + polyProperties : { + frequency: 0, + glide: 0, + attack: 22050, + decay: 22050, + sustain:22050, + release:22050, + attackLevel: 1, + sustainLevel: .5, + pulsewidth:.5, + velocity: 1, + waveform:"PWM", + }, + +/**###Gibberish.PolySynth.note : method +Generate an enveloped note at the provided frequency using a simple voice allocation system where if all children are active, the one active the longest cancels its current note and begins playing a new one. + +param **frequency** Number. The frequency for the oscillator. +param **amp** Number. Optional. The volume to use. +**/ + note : function(_frequency, velocity) { + if( typeof _frequency === 'undefined' ) return + + var lastNoteIndex = this.frequencies.indexOf( _frequency ), + idx = lastNoteIndex > -1 ? lastNoteIndex : this.voiceCount++, + synth = this.children[ idx ]; + + synth.note( _frequency, velocity ); + + if( lastNoteIndex === -1) { + this.frequencies[ idx ] = _frequency; + this._frequency = _frequency + if(this.voiceCount >= this.maxVoices) this.voiceCount = 0; + }else{ + delete this.frequencies[ idx ] + } + this.lastChild = idx + }, + + initVoices: function() { + for(var i = 0; i < this.maxVoices; i++) { + var props = { + waveform: this.waveform, + attack: this.attack, + decay: this.decay, + sustain: this.sustain, + release: this.release, + attackLevel: this.attackLevel, + sustainLevel: this.sustainLevel, + pulsewidth: this.pulsewidth, + channels: 2, + amp: 1, + useADSR : this.useADSR || false, + requireReleaseTrigger: this.requireReleaseTrigger || false, + }, + synth = new Gibberish.Synth( props ).connect( this ); + + this.children.push(synth); + } + }, + }); + + this.amp = 1 / this.maxVoices; + + this.children = []; + + if(typeof arguments[0] === 'object') { + this.maxVoices = arguments[0].maxVoices ? arguments[0].maxVoices : this.maxVoices + this.useADSR = typeof arguments[0].useADSR !== 'undefined' ? arguments[ 0 ].useADSR : false + this.requireReleaseTrigger = typeof arguments[0].requireReleaseTrigger !== 'undefined' ? arguments[ 0 ].requireReleaseTrigger : false + } + + Gibberish.polyInit(this); + this.initVoices() + + this.processProperties(arguments); + + Gibberish._synth.oscillatorInit.call(this); +}; + +/**#Gibberish.Synth2 - Synth +Oscillator + attack / decay envelope + 24db ladder filter. Basically the same as the [Synth](javascript:displayDocs('Gibberish.Synth'\)) object but with the addition of the filter. Note that the envelope controls both the amplitude of the oscillator and the cutoff frequency of the filter. + +## Example Usage## +`Gibberish.init(); +a = new Gibberish.Synth2({ attack:44, decay:44100, cutoff:.2, resonance:4 }).connect(); +a.note(880); +` +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the synth on initialization. +- - - - +**/ +/**###Gibberish.Synth2.frequency : property +Number. The frequency for the carrier oscillator. This is normally set using the note method but can also be modulated. +**/ +/**###Gibberish.Synth2.pulsewidth : property +Number. The duty cycle for PWM synthesis +**/ +/**###Gibberish.Synth2.attack : property +Number. The length of the attack portion of the envelope in samples. Note that the synth's envelope affects both amplitude and the index of the synth. +**/ +/**###Gibberish.Synth2.decay : property +Number. The length of the decay portion of the envelope in samples. Note that the synth's envelope affects both amplitude and the index of the synth. +**/ +/**###Gibberish.Synth2.cutoff : property +Number. 0..1. The cutoff frequency for the synth's filter. +**/ +/**###Gibberish.Synth2.resonance : property +Number. 0..50. Values above 4.5 are likely to produce shrieking feedback. You are warned. +**/ +/**###Gibberish.Synth2.useLowPassFilter : property +Boolean. Default true. Whether to use a high-pass or low-pass filter. +**/ +/**###Gibberish.Synth2.glide : property +Number. The synth has a one-pole filter attached to the carrier frequency. Set glide to a value between .999 and 1 to get pitch sweep between notes. +**/ +/**###Gibberish.Synth2.amp : property +Number. The relative amplitude level of the synth. +**/ +/**###Gibberish.Synth2.channels : property +Number. Default 2. Mono or Stereo synthesis. +**/ +/**###Gibberish.Synth2.pan : property +Number. Default 0. If the synth has two channels, this determines its position in the stereo spectrum. +**/ +/**###Gibberish.Synth2.waveform : property +String. The type of waveform to use. Options include 'Sine', 'Triangle', 'PWM', 'Saw' etc. +**/ +Gibberish.Synth2 = function(properties) { + this.name = "synth2"; + + this.properties = { + frequency:0, + pulsewidth:.5, + attack: 22050, + decay: 22050, + sustain: 22050, + release: 22050, + attackLevel: 1, + sustainLevel: .5, + releaseTrigger: 0, + cutoff: .25, + resonance:3.5, + useLowPassFilter:true, + glide: .15, + amp: .25, + channels: 1, + pan: 0, + velocity: 1, + sr: Gibberish.context.sampleRate, + }; +/**###Gibberish.Synth2.note : method +Generate an enveloped note at the provided frequency + +param **frequency** Number. The frequency for the oscillator. +param **amp** Number. Optional. The volume to use. +**/ + this.note = function(frequency, velocity) { + if( typeof frequency === 'undefined' ) return + if( velocity !== 0 ) { + if(typeof this.frequency !== 'object'){ + if( useADSR && frequency === lastFrequency && properties.requireReleaseTrigger ) { + this.releaseTrigger = 1; + lastFrequency = null + return; + } + + this.frequency = lastFrequency = frequency; + this.releaseTrigger = 0; + if( typeof frequency === 'object' ) { + Gibberish.dirty( this ) + } + }else{ + this.frequency[0] = lastFrequency = frequency; + this.releaseTrigger = 0; + Gibberish.dirty(this); + } + + if( typeof velocity !== 'undefined') this.velocity = velocity; + + _envelope.run(); + }else{ + this.releaseTrigger = 1; + } + }; + + properties = properties || {} + + var useADSR = typeof properties.useADSR === 'undefined' ? false : properties.useADSR, + _envelope = useADSR ? new Gibberish.ADSR() : new Gibberish.AD(), + envstate = _envelope.getState, + envelope = _envelope.callback, + _osc = new Gibberish.PWM(), + osc = _osc.callback, + _filter = new Gibberish.Filter24(), + filter = _filter.callback, + lag = new Gibberish.OnePole().callback, + panner = Gibberish.makePanner(), + lastFrequency = 0, + obj = this, + out = [0,0]; + + _envelope.requireReleaseTrigger = properties.requireReleaseTrigger || false; + + this.callback = function(frequency, pulsewidth, attack, decay, sustain, release, attackLevel, sustainLevel, releaseTrigger, cutoff, resonance, isLowPass, glide, amp, channels, pan, velocity, sr) { + glide = glide >= 1 ? .99999 : glide; + frequency = lag(frequency, 1-glide, glide); + + var env, val + if( useADSR ) { + env = envelope( attack, decay, sustain, release, attackLevel, sustainLevel, releaseTrigger ); + if( releaseTrigger ) { + obj.releaseTrigger = 0 + } + + if( envstate() < 4 ) { + val = filter ( osc( frequency, .15, pulsewidth, sr ), cutoff * env, resonance, isLowPass ) * env * velocity * amp; + + return channels === 1 ? val : panner(val, pan, out); + }else{ + val = out[0] = out[1] = 0; + return channels === 1 ? val : out + } + }else{ + if( envstate() < 2) { + env = envelope(attack, decay); + val = filter ( osc( frequency, .15, pulsewidth, sr ), cutoff * env, resonance, isLowPass ) * env * velocity * amp; + + return channels === 1 ? val : panner(val, pan, out); + }else{ + val = out[0] = out[1] = 0; + return channels === 1 ? val : out; + } + } + }; + this.getUseADSR = function() { return useADSR; } + this.getEnv = function() { return _envelope; }; + this.getOsc = function() { return _osc; }; + this.setOsc = function(val) { _osc = val; osc = _osc.callback }; + + var waveform = "PWM"; + Object.defineProperty(this, 'waveform', { + get : function() { return waveform; }, + set : function(val) { this.setOsc( new Gibberish[val]() ); } + }); + + this.init(); + this.oscillatorInit(); + this.processProperties(arguments); +}; +Gibberish.Synth2.prototype = Gibberish._synth; + +/**#Gibberish.PolySynth2 - Synth +A polyphonic version of [Synth2](javascript:displayDocs('Gibberish.Synth2'\)). There are two additional properties for the polyphonic version of the synth. The polyphonic version consists of multiple Synths being fed into a single [Bus](javascript:displayDocs('Gibberish.Bus'\)) object. + +## Example Usage ## +`Gibberish.init(); +a = new Gibberish.PolySynth2({ attack:88200, decay:88200, maxVoices:10 }).connect(); +a.note(880); +a.note(1320); +a.note(1760); +` +## Constructor +One important property to pass to the constructor is the maxVoices property, which defaults to 5. This controls how many voices are allocated to the synth and cannot be changed after initialization. + +**param** *properties*: Object. A dictionary of property values (see below) to set for the synth on initialization. +- - - - +**/ +/**###Gibberish.PolySynth2.children : property +Array. Read-only. An array holding all of the child FMSynth objects. +**/ +/**###Gibberish.PolySynth2.maxVoices : property +Number. The number of voices of polyphony the synth has. May only be set in initialization properties passed to constrcutor. +**/ + +Gibberish.PolySynth2 = function() { + this.__proto__ = new Gibberish.Bus2(); + + Gibberish.extend(this, { + name: "polysynth2", + maxVoices: 5, + voiceCount: 0, + frequencies: [], + _frequency: 0, + + polyProperties : { + frequency: 0, + glide: 0, + attack: 22050, + decay: 22050, + sustain:22050, + release:22050, + attackLevel: 1, + sustainLevel: .5, + pulsewidth:.5, + resonance: 3.5, + cutoff:.25, + velocity:1, + useLowPassFilter:true, + waveform:"PWM", + }, + +/**###Gibberish.PolySynth2.note : method +Generate an enveloped note at the provided frequency using a simple voice allocation system where if all children are active, the one active the longest cancels its current note and begins playing a new one. + +param **frequency** Number. The frequency for the oscillator. +param **amp** Number. Optional. The volume to use. +**/ + note : function(_frequency, velocity) { + if( typeof _frequency === 'undefined' ) return + + var lastNoteIndex = this.frequencies.indexOf( _frequency ), + idx = lastNoteIndex > -1 ? lastNoteIndex : this.voiceCount++, + synth = this.children[ idx ]; + + synth.note(_frequency, velocity); + + if( lastNoteIndex === -1) { + this.frequencies[ idx ] = _frequency; + this._frequency = _frequency + if(this.voiceCount >= this.maxVoices) this.voiceCount = 0; + }else{ + delete this.frequencies[ idx ] + } + this.lastChild = idx + }, + + initVoices: function() { + this.dirty = true; + for(var i = 0; i < this.maxVoices; i++) { + var props = { + attack: this.attack, + decay: this.decay, + sustain: this.sustain, + release: this.release, + attackLevel: this.attackLevel, + sustainLevel: this.sustainLevel, + pulsewidth: this.pulsewidth, + channels: 2, + amp: 1, + useADSR: this.useADSR || false, + requireReleaseTrigger: this.requireReleaseTrigger || false, + }, + synth = new Gibberish.Synth2( props ).connect( this ); + + this.children.push(synth); + } + }, + }); + + this.amp = 1 / this.maxVoices; + + this.children = []; + + if(typeof arguments[0] === 'object') { + this.maxVoices = arguments[0].maxVoices ? arguments[0].maxVoices : this.maxVoices + this.useADSR = typeof arguments[0].useADSR !== 'undefined' ? arguments[ 0 ].useADSR : false + this.requireReleaseTrigger = typeof arguments[0].requireReleaseTrigger !== 'undefined' ? arguments[ 0 ].requireReleaseTrigger : false + } + + Gibberish.polyInit(this); + + this.initVoices() + + this.processProperties(arguments); + Gibberish._synth.oscillatorInit.call(this); +}; + +/**#Gibberish.FMSynth - Synth +Classic 2-op FM synthesis with an attached attack / decay envelope. + +## Example Usage## +`Gibberish.init(); +a = new Gibberish.FMSynth({ cmRatio:5, index:3 }).connect(); +a.note(880);` +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the synth on initialization. +- - - - +**/ +/**###Gibberish.FMSynth.frequency : property +Number. The frequency for the carrier oscillator. This is normally set using the note method but can also be modulated. +**/ +/**###Gibberish.FMSynth.cmRatio : property +Number. The carrier-to-modulation ratio. A cmRatio of 2 means that the carrier frequency will be twice the frequency of the modulator. +**/ +/**###Gibberish.FMSynth.attack : property +Number. The length of the attack portion of the envelope in samples. Note that the synth's envelope affects both amplitude and the index of the synth. +**/ +/**###Gibberish.FMSynth.decay : property +Number. The length of the decay portion of the envelope in samples. Note that the synth's envelope affects both amplitude and the index of the synth. +**/ +/**###Gibberish.FMSynth.glide : property +Number. The synth has a one-pole filter attached to the carrier frequency. Set glide to a value between .999 and 1 to get pitch sweep between notes. +**/ +/**###Gibberish.FMSynth.amp : property +Number. The relative amplitude level of the synth. +**/ +/**###Gibberish.FMSynth.channels : property +Number. Default 2. Mono or Stereo synthesis. +**/ +/**###Gibberish.FMSynth.pan : property +Number. Default 0. If the synth has two channels, this determines its position in the stereo spectrum. +**/ +Gibberish.FMSynth = function(properties) { + this.name = "fmSynth"; + + this.properties = { + frequency:0, + cmRatio: 2, + index: 5, + attack: 22050, + decay: 22050, + sustain: 22050, + release: 22050, + attackLevel: 1, + sustainLevel: .5, + releaseTrigger: 0, + glide: .15, + amp: .25, + channels: 2, + velocity: 1, + pan: 0, + }; +/**###Gibberish.FMSynth.note : method +Generate an enveloped note at the provided frequency + +param **frequency** Number. The frequency for the carrier oscillator. The modulator frequency will be calculated automatically from this value in conjunction with the synth's carrier to modulation ratio +param **amp** Number. Optional. The volume to use. +**/ + + this.note = function(frequency, velocity) { + if( typeof frequency === 'undefined' ) return + //console.log( frequency, lastFrequency, this.releaseTrigger, velocity ) + if( velocity !== 0 ) { + if(typeof this.frequency !== 'object'){ + if( useADSR && frequency === lastFrequency && properties.requireReleaseTrigger ) { + this.releaseTrigger = 1; + lastFrequency = null + return; + } + + this.frequency = lastFrequency = frequency; + this.releaseTrigger = 0; + + if( typeof frequency === 'object' ) { + Gibberish.dirty( this ); + } + }else{ + this.frequency[0] = lastFrequency = frequency; + this.releaseTrigger = 0; + Gibberish.dirty(this); + } + + if( typeof velocity !== 'undefined') this.velocity = velocity; + + _envelope.run(); + }else{ + this.releaseTrigger = 1; + } + }; + + properties = properties || {} + + var useADSR = typeof properties.useADSR === 'undefined' ? false : properties.useADSR, + _envelope = useADSR ? new Gibberish.ADSR() : new Gibberish.AD(), + envstate = _envelope.getState, + envelope = _envelope.callback, + carrier = new Gibberish.Sine().callback, + modulator = new Gibberish.Sine().callback, + lag = new Gibberish.OnePole().callback, + panner = Gibberish.makePanner(), + out = [0,0], + obj = this, + lastFrequency = 0, + phase = 0, + check = false; + + _envelope.requireReleaseTrigger = properties.requireReleaseTrigger || false; + + this.callback = function(frequency, cmRatio, index, attack, decay, sustain, release, attackLevel, sustainLevel, releaseTrigger, glide, amp, channels, velocity, pan) { + var env, val, mod + + if(glide >= 1) glide = .9999; + frequency = lag(frequency, 1-glide, glide); + + if( useADSR ) { + env = envelope( attack, decay, sustain, release, attackLevel, sustainLevel, releaseTrigger ) * velocity; + if( releaseTrigger ) { + obj.releaseTrigger = 0 + } + + if( envstate() < 4 ) { + mod = modulator(frequency * cmRatio, frequency * index) * env; + val = carrier( frequency + mod, 1 ) * env * amp; + + return channels === 1 ? val : panner(val, pan, out); + }else{ + val = out[0] = out[1] = 0; + return channels === 1 ? val : out + } + }else{ + if( envstate() < 2 ) { + env = envelope(attack, decay) * velocity; + mod = modulator(frequency * cmRatio, frequency * index) * env; + val = carrier( frequency + mod, 1 ) * env * amp; + + //if( phase++ % 44105 === 0 ) console.log( panner(val, pan, out) , channels ) + return channels === 1 ? val : panner(val, pan, out); + }else{ + val = out[0] = out[1] = 0; + return channels === 1 ? val : out; + } + } + }; + + this.init(); + this.oscillatorInit(); + this.processProperties(arguments); +}; +Gibberish.FMSynth.prototype = Gibberish._synth; +/**#Gibberish.PolyFM - Synth +A polyphonic version of [FMSynth](javascript:displayDocs('Gibberish.FMSynth'\)). There are two additional properties for the polyphonic version of the synth. The polyphonic version consists of multiple FMSynths being fed into a single [Bus](javascript:displayDocs('Gibberish.Bus'\)) object. + +## Example Usage ## +`Gibberish.init(); +a = new Gibberish.PolyFM({ cmRatio:5, index:3, attack:88200, decay:88200 }).connect(); +a.note(880); +a.note(1320); +` +## Constructor +One important property to pass to the constructor is the maxVoices property, which defaults to 5. This controls how many voices are allocated to the synth and cannot be changed after initialization. + +**param** *properties*: Object. A dictionary of property values (see below) to set for the synth on initialization. +- - - - +**/ +/**###Gibberish.PolyFM.children : property +Array. Read-only. An array holding all of the child FMSynth objects. +**/ +/**###Gibberish.PolyFM.maxVoices : property +Number. The number of voices of polyphony the synth has. May only be set in initialization properties passed to constrcutor. +**/ + + +Gibberish.PolyFM = function() { + this.__proto__ = new Gibberish.Bus2(); + + Gibberish.extend(this, { + name: "polyfm", + maxVoices: 5, + voiceCount: 0, + children: [], + frequencies: [], + _frequency: 0, + velocity: 1, + + polyProperties : { + glide: 0, + attack: 22050, + decay: 22050, + sustain:22050, + release:22050, + attackLevel: 1, + sustainLevel: .5, + index: 5, + cmRatio:2, + }, +/**###Gibberish.PolyFM.note : method +Generate an enveloped note at the provided frequency using a simple voice allocation system where if all children are active, the one active the longest cancels its current note and begins playing a new one. + +param **frequency** Number. The frequency for the carrier oscillator. The modulator frequency will be calculated automatically from this value in conjunction with the synth's +param **amp** Number. Optional. The volume to use. +**/ + note : function(_frequency, velocity ) { + if( typeof _frequency === 'undefined' ) return + + var lastNoteIndex = this.frequencies.indexOf( _frequency ), + idx = lastNoteIndex > -1 ? lastNoteIndex : this.voiceCount++, + synth = this.children[ idx ]; + + if( typeof velocity === 'undefined' ) velocity = this.velocity + + synth.note(_frequency, velocity); + + if( lastNoteIndex === -1) { + this.frequencies[ idx ] = _frequency; + this._frequency = _frequency + if(this.voiceCount >= this.maxVoices) this.voiceCount = 0; + }else{ + delete this.frequencies[ idx ] + } + }, + + initVoices : function() { + for(var i = 0; i < this.maxVoices; i++) { + var props = { + attack: this.attack, + decay: this.decay, + sustain: this.sustain, + release: this.release, + attackLevel: this.attackLevel, + sustainLevel: this.sustainLevel, + cmRatio: this.cmRatio, + index: this.index, + channels: 2, + useADSR : this.useADSR || false, + requireReleaseTrigger: this.requireReleaseTrigger || false, + amp: 1, + }; + + var synth = new Gibberish.FMSynth(props); + synth.connect(this); + + this.children.push(synth); + } + }, + }); + + this.amp = 1 / this.maxVoices; + + this.children = []; + + if(typeof arguments[0] === 'object') { + this.maxVoices = arguments[0].maxVoices ? arguments[0].maxVoices : this.maxVoices + this.useADSR = typeof arguments[0].useADSR !== 'undefined' ? arguments[ 0 ].useADSR : false + this.requireReleaseTrigger = typeof arguments[0].requireReleaseTrigger !== 'undefined' ? arguments[ 0 ].requireReleaseTrigger : false + } + + Gibberish.polyInit(this); + this.initVoices() + + this.processProperties(arguments); + Gibberish._synth.oscillatorInit.call(this); +}; + +// this file is dependent on oscillators.js + +/**#Gibberish.Sampler - Oscillator +Sample recording and playback. + +## Example Usage## +`Gibberish.init(); +a = new Gibberish.Sampler({ file:'resources/snare.wav' }).connect(); +// wait until sample has downloaded +a.note(2); +a.note(1); +a.note(-.5); +b = new Gibberish.Sampler().connect(); +b.record(a, 88200); // record two seconds of a playing +a.note(8); +// wait a bit +b.note(1);` + +## Constructor +###syntax 1 +**param** *filepath*: String. A path to the audiofile to be opened by the sampler. +###syntax 2 +**param** *properties*: Object. A dictionary of property values (see below) to set for the sampler on initialization. +- - - - +**/ +/**###Gibberish.Sampler.pitch : property +Number. The speed that the sample is played back at. A pitch of 1 means the sample plays forward at speed it was recorded at, a pitch of -4 means the sample plays backwards at 4 times the speed it was recorded at. +**/ +/**###Gibberish.Sampler.amp : property +Number. A linear value specifying relative amplitude, ostensibly from 0..1 but can be higher, or lower when used for modulation. +**/ +/**###Gibberish.Sampler.playOnLoad : property +Number. If this value is set to be non-zero, the sampler will trigger a note at the provided pitch as soon as the sample is downloaded. +**/ +/**###Gibberish.Sampler.isRecording : property +Boolean. Tells the sample to record into it's buffer. This is handled automatically by the object; there is no need to manually set this property. +**/ +/**###Gibberish.Sampler.isPlaying : property +Number. 0..1. Tells the sample to record into it's buffer. This is handled automatically by the object; there is no need to manually set this property. +**/ +/**###Gibberish.Sampler.input : property +Object. The object the sampler is tapping into and recording. +**/ +/**###Gibberish.Sampler.length : property +Number. The length of the Sampler's buffer. +**/ +/**###Gibberish.Sampler.start : property +Number. When the Sampler's note method is called, sample playback begins at this sample. +**/ +/**###Gibberish.Sampler.end : property +Number. When the Sampler's note method is called, sample playback ends at this sample. +**/ +/**###Gibberish.Sampler.loops : property +Boolean. When true, sample playback loops continuously between the start and end property values. +**/ +/**###Gibberish.Sampler.pan : property +Number. -1..1. Position of the Sampler in the stereo spectrum. +**/ + +Gibberish.Sampler = function() { + var phase = 1, + interpolate = Gibberish.interpolate, + write = 0, + panner = Gibberish.makePanner(), + debug = 0 , + shouldLoop = 0, + out = [0,0], + buffer = null, + bufferLength = 1, + self = this, + count = 0; + + Gibberish.extend(this, { + name: "sampler", + + file: null, + isLoaded: false, + playOnLoad : 0, + buffers: {}, + properties : { + pitch: 1, + amp: 1, + isRecording: false, + isPlaying : true, + input: 0, + length : 0, + start : 0, + end : 1, + loops : 0, + pan : 0, + }, + +/**###Gibberish.Sampler.onload : method +This is an event handler that is called when a sampler has finished loading an audio file. +Use this to trigger a set of events upon downloading the sample. + +param **buffer** Object. The decoded sampler buffers from the audio file +**/ + _onload : function(decoded) { + buffer = decoded.channels[0]; + bufferLength = decoded.length; + self.length = bufferLength + //self.end = bufferLength; + self.length = phase = bufferLength; + self.isPlaying = true; + + //console.log("LOADED ", self.file, bufferLength); + Gibberish.audioFiles[self.file] = buffer; + self.buffers[ self.file ] = buffer; + + if(self.onload) self.onload(); + + if(self.playOnLoad !== 0) self.note(self.playOnLoad); + + self.isLoaded = true; + }, + + switchBuffer: function( bufferID ) { // accepts either number or string + if( typeof bufferID === 'string' ) { + if( typeof this.buffers[ bufferID ] !== 'undefined' ) { + buffer = this.buffers[ bufferID ] + //bufferLength = this.end = this.length = buffer.length + bufferLength = this.length = buffer.length + } + }else if( typeof bufferID === 'number' ){ + var keys = Object.keys( this.buffers ) + if( keys.length === 0 ) return + //console.log( "KEY", keys, keys[ bufferID ], bufferID ) + buffer = this.buffers[ keys[ bufferID ] ] + bufferLength = this.length = buffer.length + //this.end( bufferLength ) + this.setPhase( 0 ) + //console.log( bufferLength, this.end, this.length ) + } + }, + + floatTo16BitPCM : function(output, offset, input){ + //console.log(output.length, offset, input.length ) + for (var i = 0; i < input.length - 1; i++, offset+=2){ + var s = Math.max(-1, Math.min(1, input[i])); + output.setInt16(offset, s < 0 ? s * 0x8000 : s * 0x7FFF, true); + } + }, + encodeWAV : function(){ + //console.log("BUFFER LENGTH" + _buffer.length); + var _buffer = this.getBuffer(), + wavBuffer = new ArrayBuffer(44 + _buffer.length * 2), + view = new DataView(wavBuffer), + sampleRate = Gibberish.context.sampleRate; + + function writeString(view, offset, string){ + for (var i = 0; i < string.length; i++){ + view.setUint8(offset + i, string.charCodeAt(i)); + } + } + + /* RIFF identifier */ + writeString(view, 0, 'RIFF'); + /* file length */ + view.setUint32(4, 32 + _buffer.length * 2, true); + /* RIFF type */ + writeString(view, 8, 'WAVE'); + /* format chunk identifier */ + writeString(view, 12, 'fmt '); + /* format chunk length */ + view.setUint32(16, 16, true); + /* sample format (raw) */ + view.setUint16(20, 1, true); + /* channel count */ + view.setUint16(22, 1, true); + /* sample rate */ + view.setUint32(24, sampleRate, true); + /* byte rate (sample rate * block align) */ + view.setUint32(28, sampleRate * 4, true); + /* block align (channel count * bytes per sample) */ + view.setUint16(32, 2, true); + /* bits per sample */ + view.setUint16(34, 16, true); + /* data chunk identifier */ + writeString(view, 36, 'data'); + /* data chunk length */ + view.setUint32(40, _buffer.length * 2, true); + + this.floatTo16BitPCM(view, 44, _buffer); + + return view; + }, +/**###Gibberish.Sampler.download : method +Download the sampler buffer as a .wav file. In conjunction with the record method, this enables the Sampler +to record and downlaod Gibberish sessions. +**/ + download : function( filename ) { // thanks to Palle and Gunnar for updates! + var blob = this.encodeWAV(); + var audioBlob = new Blob( [ blob ] ); + + // var url = window.webkitURL.createObjectURL( audioBlob ); + var url; + if (window.URL !== undefined) { + url = window.URL.createObjectURL( audioBlob ); + } else if (window.webkitURL !== undefined) { + url = window.webkitURL.createObjectURL( audioBlob ); + } else { + console.log('Method Unavailable: createObjectURL'); + return; + } + + var link = window.document.createElement('a'); + link.href = url; + if( typeof filename === 'undefined' ) { + filename = 'gibber_output.wav' + }else if( filename.indexOf('.wav') === -1 ) { + filename += '.wav' + } + + link.download = filename || 'output.wav'; + + var click = new MouseEvent('click', { + 'view': window, + 'bubbles': true, + 'cancelable': true + }); + + link.dispatchEvent(click); + }, + +/**###Gibberish.Sampler.note : method +Trigger playback of the samplers buffer + +param **pitch** Number. The speed the sample is played back at. +param **amp** Number. Optional. The volume to use. +**/ + +/**###Gibberish.Sampler.range : method +Set the start and end points in a single method call + +param **start** Number. The start point for sample playback, 0..1 +param **end** Number. The end point for sample playback, 0..1 +**/ + range: function( start, end ) { + if( Array.isArray( start ) ) { + end = start[1] + start = start[0] + } + + if( end < start ) { + var tmp = start + start = end + end = tmp + } + + this.start = start + this.end = end + }, + + note: function(pitch, amp) { + if( typeof pitch === 'undefined' ) return + + switch( typeof pitch ) { + case 'number' : + this.pitch = pitch + break; + case 'function' : + this.pitch = pitch() + break; + case 'object' : + if( Array.isArray(pitch) ) { + this.pitch = pitch[ 0 ] + }else{ + this.pitch = pitch + } + break; + } + // if(typeof this.pitch === 'number' || typeof this.pitch === 'function' ){ + // this.pitch = pitch; + // }else if(typeof this.pitch === 'object'){ + // this.pitch[0] = pitch; + // Gibberish.dirty(this); + // } + + if(typeof amp === 'number') this.amp = amp; + + if(this.function !== null) { + this.isPlaying = true; // needed to allow playback after recording + + var __pitch;// = typeof this.pitch === 'number' || typeof this.pitch === 'function' ? this.pitch : this.pitch[0]; // account for modulations + + switch( typeof this.pitch ) { + case 'number' : + __pitch = this.pitch + break; + case 'function' : + __pitch = this.pitch.getValue ? this.pitch.getValue() : this.pitch() + break; + case 'object' : + if( Array.isArray( this.pitch ) ) { + __pitch = this.pitch[ 0 ] + } else { + __pitch = this.pitch.getValue ? this.pitch.getValue() : this.pitch.input.getValue() + } + + if( typeof __pitch === 'function' ) __pitch = __pitch() + + break; + } + + // if( __pitch > 0 ) { //|| typeof __pitch === 'object' || typeof this.pitch === 'function' ) { + // phase = this.start; + // }else{ + // phase = this.end; + // } + phase = 0 + + Gibberish.dirty( this ) + + //this.pitch = __pitch; + } + }, +/**###Gibberish.Sampler.record : method +Record the output of a Gibberish ugen for a given amount of time + +param **ugen** Object. The Gibberish ugen to be recorded. +param **recordLength** Number (in samples). How long to record for. +**/ + // record : function(input, recordLength) { + // this.isRecording = true; + // + // var self = this; + // + // this.recorder = new Gibberish.Record(input, recordLength, function() { + // self.setBuffer( this.getBuffer() ); + // self.end = bufferLength = self.getBuffer().length; + // self.setPhase( self.end ) + // self.isRecording = false; + // }) + // .record(); + // + // return this; + // }, + +/**###Gibberish.Sampler.getBuffer : method +Returns a pointer to the Sampler's internal buffer. +**/ + getBuffer : function() { return buffer; }, + setBuffer : function(b) { buffer = b }, + getPhase : function() { return phase }, + setPhase : function(p) { phase = p }, + getNumberOfBuffers: function() { return Object.keys( self.buffers ).length - 1 }, + +/**###Gibberish.Sampler.callback : method +Return a single sample. It's a pretty lengthy method signature, they are all properties that have already been listed: + +_pitch, amp, isRecording, isPlaying, input, length, start, end, loops, pan +**/ + callback :function(_pitch, amp, isRecording, isPlaying, input, length, start, end, loops, pan) { + var val = 0, startInSamples = start * length, endInSamples = end * length; + phase += _pitch; + + // if( count++ % 44100 === 0 ) console.log( _pitch, startInSamples, endInSamples ) + + if( buffer !== null && isPlaying ) { + if( _pitch > 0 ) { + if( startInSamples + phase < endInSamples ) { + val = interpolate( buffer, startInSamples + phase ) + }else{ + if( loops ) phase = 0 + } + }else{ + if( endInSamples + phase > startInSamples ) { + val = interpolate( buffer, endInSamples + phase ) + }else{ + if( loops ) phase = 0 + } + } + + return panner( val * amp, pan, out ) + } + + out[0] = out[1] = val; + return out; + }, + }) + .init() + .oscillatorInit() + .processProperties(arguments); + + if(typeof arguments[0] !== "undefined") { + if(typeof arguments[0] === "string") { + this.file = arguments[0]; + this.pitch = 0; + //this.isPlaying = true; + }else if(typeof arguments[0] === "object") { + if(arguments[0].file) { + this.file = arguments[0].file; + //this.isPlaying = true; + } + } + } + + //console.log(this); + + /*var _end = 1; + Object.defineProperty(that, "end", { + get : function() { return _end; }, + set : function(val) { + if(val > 1) val = 1; + _end = val * that.bufferLength - 1; + Gibberish.dirty(that); + } + }); + var _start = 0; + Object.defineProperty(that, "start", { + get : function() { return _start; }, + set : function(val) { + if(val < 0) val = 0; + _start = val * that.bufferLength - 1; + Gibberish.dirty(that); + } + }); + var _loops = 0; + Object.defineProperty(that, "loops", { + get : function() { return _loops; }, + set : function(val) { + _loops = val; + that.function.setLoops(_loops); + } + }); + */ + + if(typeof Gibberish.audioFiles[this.file] !== "undefined") { + buffer = Gibberish.audioFiles[this.file]; + this.end = 1; + this.buffers[ this.file ] = buffer; + + this.length = phase = this.bufferLength = buffer.length; + Gibberish.dirty(this); + + if(this.onload) this.onload(); + }else if(this.file !== null){ + var xhr = new XMLHttpRequest(), initSound + + xhr.open( 'GET', this.file, true ) + xhr.responseType = 'arraybuffer' + xhr.onload = function( e ) { initSound( this.response ) } + xhr.send() + + //console.log("now loading sample", self.file ) + xhr.onerror = function( e ) { console.error( "Sampler file loading error", e )} + + initSound = function( arrayBuffer ) { + Gibberish.context.decodeAudioData(arrayBuffer, function(_buffer) { + buffer = _buffer.getChannelData(0) + // self.length = phase = self.end = bufferLength = buffer.length + self.length = phase = bufferLength = buffer.length + self.isPlaying = true; + self.buffers[ self.file ] = buffer; + + //console.log("sample loaded | ", self.file, " | length | ", bufferLength); + Gibberish.audioFiles[self.file] = buffer; + + if(self.onload) self.onload(); + + if(self.playOnLoad !== 0) self.note( self.playOnLoad ); + + self.isLoaded = true; + }, function(e) { + console.log('Error decoding file', e); + }); + } + }else if(typeof this.buffer !== 'undefined' ) { + this.isLoaded = true; + + buffer = this.buffer; + //this.end = this.bufferLength = buffer.length || 88200; + this.bufferLength = buffer.length || 88200; + + phase = this.bufferLength; + if(arguments[0] && arguments[0].loops) { + this.loops = 1; + } + Gibberish.dirty(this); + + if(this.onload) this.onload(); + } +}; +Gibberish.Sampler.prototype = Gibberish._oscillator; +Gibberish.Sampler.prototype.record = function(input, recordLength) { + this.isRecording = true; + + var self = this; + + this.recorder = new Gibberish.Record(input, recordLength, function() { + self.setBuffer( this.getBuffer() ); + bufferLength = self.getBuffer().length; + self.setPhase( self.end ) + self.isRecording = false; + }) + .record(); + + return this; +}; + +/**#Gibberish.MonoSynth - Synth +A three oscillator monosynth for bass and lead lines. You can set the octave and tuning offsets for oscillators 2 & 3. There is a 24db filter and an envelope controlling +both the amplitude and filter cutoff. +## Example Usage## +` +t = new Gibberish.Mono({ + cutoff:0, + filterMult:.5, + attack:_8, + decay:_8, + octave2:-1, + octave3:-1, + detune2:.01, + glide:_12, +}).connect(); +t.note("C3"); ` +## Constructors + param **arguments** : Object. A dictionary of property values to set upon initialization. See the properties section and the example usage section for details. +**/ +/**###Gibberish.MonoSynth.waveform : property +String. The primary oscillator to be used. Can currently be 'Sine', 'Square', 'Noise', 'Triangle' or 'Saw'. +**/ +/**###Gibberish.MonoSynth.attack : property +Integer. The length, in samples, of the attack of the amplitude envelope. +**/ +/**###Gibberish.MonoSynth.decay : property +Integer. The length, in samples, of the decay of the amplitude envelope. +**/ +/**###Gibberish.MonoSynth.amp : property +Float. The peak amplitude of the synth, usually between 0..1 +**/ +/**###Gibberish.MonoSynth.cutoff : property +Float. The frequency cutoff for the synth's filter. Range is 0..1. +**/ +/**###Gibberish.MonoSynth.filterMult : property +Float. As the envelope on the synth progress, the filter cutoff will also change by this amount * the envelope amount. +**/ +/**###Gibberish.MonoSynth.resonance : property +Float. The emphasis placed on the filters cutoff frequency. 0..50, however, GOING OVER 5 IS DANGEROUS TO YOUR EARS (ok, maybe 6 is all right...) +**/ +/**###Gibberish.MonoSynth.octave2 : property +Integer. The octave difference between oscillator 1 and oscillator 2. Can be positive (higher osc2) or negative (lower osc 2) or 0 (same octave). +**/ +/**###Gibberish.MonoSynth.detune2 : property +Float. The amount, from -1..1, the oscillator 2 is detuned. A value of -.5 means osc2 is half an octave lower than osc1. A value of .01 means osc2 is .01 octaves higher than osc1. +**/ +/**###Gibberish.MonoSynth.octave3 : property +Integer. The octave difference between oscillator 1 and oscillator 3. Can be positive (higher osc3) or negative (lower osc 3) or 0 (same octave). +**/ +/**###Gibberish.MonoSynth.detune3 : property +Float. The amount, from -1..1, the oscillator 3 is detuned. A value of -.5 means osc3 is half an octave lower than osc1. A value of .01 means osc3 is .01 octaves higher than osc1. +**/ +/**###Gibberish.MonoSynth.glide : property +Integer. The length in time, in samples, to slide in pitch from one note to the next. +**/ +Gibberish.MonoSynth = function() { + Gibberish.extend(this, { + name: 'monosynth', + + properties: { + attack: 10000, + decay: 10000, + cutoff: .2, + resonance: 2.5, + amp1: 1, + amp2: 1, + amp3: 1, + filterMult: .3, + isLowPass: true, + pulsewidth: .5, + amp: .6, + detune2: .01, + detune3: -.01, + octave2: 1, + octave3: -1, + glide: 0, + pan: 0, + velocity: 1, + frequency: 0, + channels: 2, + }, + + waveform: "Saw3", +/**###Gibberish.MonoSynth.note : method +param **note or frequency** : String or Integer. You can pass a note name, such as "A#4", or a frequency value, such as 440. +param **amp** : Optional. Float. The volume of the note, usually between 0..1. The main amp property of the Synth will also affect note amplitude. +**/ + note : function(_frequency, velocity) { + if( typeof _frequency === 'undefined' ) return + + if(typeof velocity !== 'undefined' && velocity !== 0) this.velocity = velocity; + + if( velocity !== 0 ) { + if(typeof this.frequency !== 'object'){ + + this.frequency = _frequency; + }else{ + this.frequency[0] = _frequency; + Gibberish.dirty(this); + } + + if(envstate() > 0 ) _envelope.run(); + } + }, + /* + note : function(frequency, velocity) { + if( typeof frequency === 'undefined' ) return + + if(typeof this.frequency !== 'object'){ + if( useADSR && frequency === lastFrequency && velocity === 0) { + this.releaseTrigger = 1; + lastFrequency = null + return; + } + if( velocity !== 0 ) { + this.frequency = lastFrequency = frequency; + } + this.releaseTrigger = 0; + }else{ + if( velocity !== 0 ) { + this.frequency[0] = lastFrequency = frequency; + } + this.releaseTrigger = 0; + Gibberish.dirty(this); + } + + if(typeof velocity !== 'undefined' && velocity !== 0) this.velocity = velocity; + + if( velocity !== 0 ) { _envelope.run(); } + }, + */ + }); + + var waveform = waveform1 = waveform2 = waveform3 = this.waveform; + Object.defineProperty(this, "waveform", { + get: function() { return waveform; }, + set: function(value) { + if(waveform !== value) { + waveform = value; + + osc1 = new Gibberish[ value ]().callback; + osc2 = new Gibberish[ value ]().callback; + osc3 = new Gibberish[ value ]().callback; + } + }, + }); + + Object.defineProperties( this, { + waveform1: { + get: function() { return waveform1 }, + set: function(v) { waveform1 = v; osc1 = new Gibberish[ v ]().callback; } + }, + waveform2: { + get: function() { return waveform2 }, + set: function(v) { waveform2 = v; osc2 = new Gibberish[ v ]().callback; } + }, + waveform3: { + get: function() { return waveform3 }, + set: function(v) { waveform3 = v; osc3 = new Gibberish[ v ]().callback; } + }, + }) + + + var _envelope = new Gibberish.AD(this.attack, this.decay), + envstate = _envelope.getState, + envelope = _envelope.callback, + filter = new Gibberish.Filter24().callback, + osc1 = new Gibberish[this.waveform](this.frequency, this.amp1).callback, + osc2 = new Gibberish[this.waveform](this.frequency2, this.amp2).callback, + osc3 = new Gibberish[this.waveform](this.frequency3, this.amp3).callback, + lag = new Gibberish.OnePole().callback, + panner = Gibberish.makePanner(), + out = [0,0]; + + this.envelope = _envelope + + this.callback = function(attack, decay, cutoff, resonance, amp1, amp2, amp3, filterMult, isLowPass, pulsewidth, masterAmp, detune2, detune3, octave2, octave3, glide, pan, velocity, frequency, channels) { + if(envstate() < 2) { + if(glide >= 1) glide = .9999; + frequency = lag(frequency, 1-glide, glide); + + var frequency2 = frequency; + if(octave2 > 0) { + for(var i = 0; i < octave2; i++) { + frequency2 *= 2; + } + }else if(octave2 < 0) { + for(var i = 0; i > octave2; i--) { + frequency2 /= 2; + } + } + + var frequency3 = frequency; + if(octave3 > 0) { + for(var i = 0; i < octave3; i++) { + frequency3 *= 2; + } + }else if(octave3 < 0) { + for(var i = 0; i > octave3; i--) { + frequency3 /= 2; + } + } + + frequency2 += detune2 > 0 ? ((frequency * 2) - frequency) * detune2 : (frequency - (frequency / 2)) * detune2; + frequency3 += detune3 > 0 ? ((frequency * 2) - frequency) * detune3 : (frequency - (frequency / 2)) * detune3; + + var oscValue = osc1(frequency, amp1, pulsewidth) + osc2(frequency2, amp2, pulsewidth) + osc3(frequency3, amp3, pulsewidth); + var envResult = envelope(attack, decay) * velocity; + var val = filter( oscValue, cutoff + filterMult * envResult, resonance, isLowPass, 1) * envResult; + val *= masterAmp; + out[0] = out[1] = val; + return channels === 1 ? out : panner(val, pan, out); + }else{ + out[0] = out[1] = 0; + return out; + } + }; + + this.init(); + this.oscillatorInit(); + this.processProperties(arguments); +}; +Gibberish.MonoSynth.prototype = Gibberish._synth; + +/**#Gibberish.Binops - Miscellaneous +These objects create binary operations - mathematical operations taking two arguments - and create signal processing functions using them. They are primarily used for +modulation purposes. You can export the constructors for easier use similar to the [Time](javascript:displayDocs('Gibberish.Time'\)) constructors. + +Add, Sub, Mul and Div can actually take as many arguments as you wish. For example, Add(1,2,3,4) will return an object that outputs 10. You can stack multiple oscillators this way as well. + +##Example Usage +`// This example creates a tremolo effect via amplitude modulation +Gibberish.Binops.export(); // now all constructors are also part of the window object +mod = new Gibberish.Sine(4, .25); +sin = new Gibberish.Sine( 440, add( .5, mod ) ).connect(); +` +**/ + +Gibberish.Binops = { +/**###Gibberish.Binops.export : method +Use this to export the constructor methods of Gibberish.Binops so that you can tersely refer to them. + +param **target** object, default window. The object to export the Gibberish.Binops constructors into. +**/ + export: function(target) { + Gibberish.export("Binops", target || window); + }, + + operator : function () { + var me = new Gibberish.ugen(), + op = arguments[0], + args = Array.prototype.slice.call(arguments, 1); + + me.name = 'op'; + me.properties = {}; + for(var i = 0; i < args.length; i++) { + me.properties[i] = args[i]; + } + me.init.apply( me, args ); + + me.codegen = function() { + var keys, out = "( "; + + if(typeof Gibberish.memo[this.symbol] !== 'undefined') { return Gibberish.memo[this.symbol]; } + + keys = Object.keys(this.properties); + + var shouldSkip = false; + for(var i = 0; i < keys.length; i++) { + if( shouldSkip ) { shouldSkip = false; continue; } + + var isObject = typeof this[i] === 'object'; + + var shouldPush = false; + if(isObject) { + out += this[i].codegen(); + }else{ + out += this[i]; + } + + if( ( op === '*' || op === '/' ) && this[ i + 1 ] === 1 ) { + shouldSkip = true; continue; + } + + if(i < keys.length - 1) { out += " " + op + " "; } + + //if( isObject && shouldPush ) Gibberish.codeblock.push(this[i].codeblock); + } + + out += " )"; + + this.codeblock = out; + //Gibberish.memo[this.symbol] = out; + + return out; + }; + + me.valueOf = function() { return me.codegen() } + + //me.processProperties.apply( me, args ); + + return me; + }, + +/**###Gibberish.Binops.Add : method +Create an object that sums all arguments at audio rate. The arguments may be unit generators, numbers, or any mix of the two. +**/ + Add : function() { + var args = Array.prototype.slice.call(arguments, 0); + args.unshift('+'); + + return Gibberish.Binops.operator.apply(null, args); + }, + +/**###Gibberish.Binops.Sub : method +Create an object that starts with the first argument and subtracts all subsequent arguments at audio rate. The arguments may be unit generators, numbers, or any mix of the two. +**/ + Sub : function() { + var args = Array.prototype.slice.call(arguments, 0); + args.unshift('-'); + + return Gibberish.Binops.operator.apply(null, args); + }, + +/**###Gibberish.Binops.Mul : method +Create an object that calculates the product of all arguments at audio rate. The arguments may be unit generators, numbers, or any mix of the two. +**/ + Mul : function() { + var args = Array.prototype.slice.call(arguments, 0); + args.unshift('*'); + + return Gibberish.Binops.operator.apply(null, args); + }, + +/**###Gibberish.Binops.Div : method +Create an object that takes the first argument and divides it by all subsequent arguments at audio rate. The arguments may be unit generators, numbers, or any mix of the two. +**/ + Div : function() { + var args = Array.prototype.slice.call(arguments, 0); + args.unshift('/'); + + return Gibberish.Binops.operator.apply(null, args); + }, + +/**###Gibberish.Binops.Mod : method +Create an object that takes the divides the first argument by the second and returns the remainder at audio rate. The arguments may be unit generators, numbers, or any mix of the two. +**/ + Mod : function() { + var args = Array.prototype.slice.call(arguments, 0); + args.unshift('%'); + + return Gibberish.Binops.operator.apply(null, args); + + }, + +/**###Gibberish.Binops.Abs : method +Create an object that returns the absolute value of the (single) argument. The argument may be a unit generator or number. +**/ + Abs : function() { + var args = Array.prototype.slice.call(arguments, 0), + me = { + name : 'abs', + properties : {}, + callback : Math.abs.bind( me ), + }; + me.__proto__ = new Gibberish.ugen(); + me.properties[0] = args[0]; + me.init(); + + return me; + }, +/**###Gibberish.Binops.Sqrt : method +Create an object that returns the square root of the (single) argument. The argument may be a unit generator or number. +**/ + Sqrt : function() { + var args = Array.prototype.slice.call(arguments, 0), + me = { + name : 'sqrt', + properties : {}, + callback : Math.sqrt.bind(me), + }; + me.__proto__ = new Gibberish.ugen(); + me.properties[i] = arguments[0]; + me.init(); + + return me; + }, + +/**###Gibberish.Binops.Pow : method +Create an object that returns the first argument raised to the power of the second argument. The arguments may be a unit generators or numbers. +**/ + Pow : function() { + var args = Array.prototype.slice.call(arguments, 0), + me = { + name : 'pow', + properties : {}, + callback : Math.pow.bind(me), + }; + me.__proto__ = new Gibberish.ugen(); + + for(var i = 0; i < args.length; i++) { me.properties[i] = args[i]; } + me.init(); + + console.log( me.callback ) + return me; + }, + + Clamp : function() { + var args = Array.prototype.slice.call(arguments, 0), + me = { + name : 'clamp', + properties : { input:0, min:0, max:1 }, + callback : function( input, min, max ) { + if( input < min ) { + input = min + }else if( input > max ) { + input = max + } + return input + }, + }; + me.__proto__ = new Gibberish.ugen(); + + me.init(); + me.processProperties( args ); + + return me; + }, + + Merge : function() { + var args = Array.prototype.slice.call(arguments, 0), + me = { + name : 'merge', + properties : {}, + callback : function(a) { + return a[0] + a[1]; + }, + }; + me.__proto__ = new Gibberish.ugen(); + + for(var i = 0; i < args.length; i++) { + me.properties[i] = args[i]; + } + me.init(); + + return me; + }, + + Map : function( prop, _outputMin, _outputMax, _inputMin, _inputMax, _curve, _wrap) { + var pow = Math.pow, + LINEAR = 0, + LOGARITHMIC = 1, + base = 0, + phase = 0, + _value = 0, + me = { + name : 'map', + properties : { input:prop, outputMin:_outputMin, outputMax:_outputMax, inputMin:_inputMin, inputMax:_inputMax, curve:_curve || LINEAR, wrap: _wrap || false }, + callback : function( v, v1Min, v1Max, v2Min, v2Max, curve, wrap ) { + var range1 = v1Max-v1Min, + range2 = v2Max - v2Min, + percent = (v - v2Min) / range2, + val + + if( percent > 1 ) { + percent = wrap ? percent % 1 : 1 + }else if( percent < 0 ) { + percent = wrap ? 1 + (percent % 1) : 0 + } + + val = curve === 0 ? v1Min + ( percent * range1 ) : v1Min + pow( percent, 1.5 ) * range1 + + _value = val + // if(phase++ % 22050 === 0 ) console.log( _value, percent, v ) + return val + }, + // map_22(v_28, 0, 255, -1, 1, 0, false); + getValue: function() { return _value }, + invert: function() { + var tmp = me.outputMin + me.outputMin = me.outputMax + me.outputMax = tmp + } + } + + me.__proto__ = new Gibberish.ugen() + + me.init() + + return me + }, +}; +/**#Gibberish.Time - Miscellaneous +This object is used to simplify timing in Gibberish. It contains an export function to place its methods in another object (like window) +so that you can code more tersely. The methods of the Time object translate ms, seconds and beats into samples. The default bpm is 120. + +##Example Usage +`Gibberish.Time.export(); // now all methods are also part of the window object +a = new Gibberish.Sine(440).connect(); +b = new Gibberish.Sequencer({ target:a, key:'frequency', durations:[ seconds(1), ms(500), beats( .5 ) ], values:[220,440,880] }).start() +` +**/ + +/**###Gibberish.Time.bpm : property +Number. Default 120. The beats per minute setting used whenever a call to the beats method is made. +**/ + +/**###Gibberish.Time.export : method +Use this to export the methods of Gibberish.Time so that you can tersely refer to them. + +param **target** object, default window. The object to export the Gibberish.Time methods into. +**/ + +/**###Gibberish.Time.ms : method +Convert the parameter from milliseconds to samples. + +param **ms** number. The number of milliseconds to convert. +**/ + +/**###Gibberish.Time.seconds : method +Convert the parameter from seconds to samples. + +param **seconds** number. The number of seconds to convert. +**/ + +/**###Gibberish.Time.beats : method +Return a function that converts the parameter from beats to samples. This method uses the bpm property of the Gibberish.Time object to determine the duration of a sample. +You can use the function returned by this method in a Sequencer; if Gibberish.Time.bpm is changed before the function is executed the function will use the updated value. + +param **seconds** number. The number of seconds to convert. +**/ + +Gibberish.Time = { + bpm: 120, + + export: function(target) { + Gibberish.export("Time", target || window); + }, + + ms : function(val) { + return val * Gibberish.context.sampleRate / 1000; + }, + + seconds : function(val) { + return val * Gibberish.context.sampleRate; + }, + + beats : function(val) { + return function() { + var samplesPerBeat = Gibberish.context.sampleRate / ( Gibberish.Time.bpm / 60 ) ; + return samplesPerBeat * val ; + } + }, +}; +/**#Gibberish.Sequencer - Miscellaneous +A sample-accurate sequencer that can sequence changes to properties, method calls or anonymous function calls. + +## Example Usage## +`Gibberish.init(); +a = new Gibberish.Synth({ attack:44, decay:44100 }).connect(); +b = new Gibberish.Sequencer({ target:a, key:'note', durations:[11025, 22050], values:[440, 880] }).start() +` +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the sequencer on initialization. +- - - - +**/ +/**###Gibberish.Sequencer.target : property +Object. An object for the sequencer to control. May be null if you are sequencing anonymous functions. +**/ +/**###Gibberish.Sequencer.key : property +String. The name of the method or property you would like to sequnce on the Sequencer's target object. +**/ +/**###Gibberish.Sequencer.durations : property +Array. The number of samples between each advancement of the Sequencer. Once the Sequencer arrives at the end of this list, it loops back to the beginning +**/ +/**###Gibberish.Sequencer.keysAndValues : property +Object. A dictionary holding a set of values to be sequenced. The keys of the dictionary determine which methods and properties to sequence on the Sequencer's target object and +each key has an array of values representing the sequence for that key. + +`Gibberish.init(); +a = new Gibberish.Synth({ attack:44, decay:44100 }).connect(); +b = new Gibberish.Sequencer({ target:a, durations:[11025, 22050], keysAndValues:{ 'note':[440,880], 'amp':[.2,.4] } }).start() +` +**/ + +Gibberish.Sequencer2 = function() { + var that = this, + phase = 0; + + Gibberish.extend(this, { + target : null, + key : null, + values : null, + valuesIndex : 0, + durations : null, + durationsIndex: 0, + nextTime : 0, + playOnce : false, + repeatCount : 0, + repeatTarget : null, + isConnected : true, + keysAndValues : null, + counts : {}, + properties : { rate: 1, isRunning:false, nextTime:0 }, + offset : 0, + name : 'seq', + + callback : function(rate, isRunning, nextTime) { + if(isRunning) { + if(phase >= nextTime) { + if(that.values !== null) { + if(that.target) { + var val = that.values[ that.valuesIndex++ ]; + + if(typeof val === 'function') { val = val(); } + + if(typeof that.target[that.key] === 'function') { + that.target[that.key]( val ); + }else{ + that.target[that.key] = val; + } + }else{ + if(typeof that.values[ that.valuesIndex ] === 'function') { + that.values[ that.valuesIndex++ ](); + } + } + if(that.valuesIndex >= that.values.length) that.valuesIndex = 0; + }else if(that.keysAndValues !== null) { + for(var key in that.keysAndValues) { + var index = that.counts[key]++; + var val = that.keysAndValues[key][index]; + + if(typeof val === 'function') { val = val(); } + + if(typeof that.target[key] === 'function') { + that.target[key]( val ); + }else{ + that.target[key] = val; + } + if(that.counts[key] >= that.keysAndValues[key].length) { + that.counts[key] = 0; + } + if( that.chose ) that.chose( key, index ) + } + }else if(typeof that.target[that.key] === 'function') { + that.target[that.key](); + } + + phase -= nextTime; + + if(Array.isArray(that.durations)) { + var next = that.durations[ that.durationsIndex++ ]; + that.nextTime = typeof next === 'function' ? next() : next; + if( that.chose ) that.chose( 'durations', that.durationsIndex - 1 ) + if( that.durationsIndex >= that.durations.length) { + that.durationsIndex = 0; + } + }else{ + var next = that.durations; + that.nextTime = typeof next === 'function' ? next() : next; + } + + if(that.repeatTarget) { + that.repeatCount++; + if(that.repeatCount === that.repeatTarget) { + that.isRunning = false; + that.repeatCount = 0; + } + } + + return 0; + } + + phase += rate; //that.rate; + } + return 0; + }, + +/**###Gibberish.Sequencer.start : method +Start the sequencer running. + +param **shouldKeepOffset** boolean, default false. If true, the phase of the sequencer will not be reset when calling the start method. +**/ + start : function(shouldKeepOffset) { + if(!shouldKeepOffset) { + phase = 0; + } + + this.isRunning = true; + return this; + }, + +/**###Gibberish.Sequencer.stop : method +Stop the sequencer. +**/ + stop: function() { + this.isRunning = false; + return this; + }, + +/**###Gibberish.Sequencer.repeat : method +Play the sequencer a certain number of times and then stop it. + +param **timesToRepeat** number. The number of times to repeat the sequence. +**/ + repeat : function(times) { + this.repeatTarget = times; + return this; + }, + + shuffle : function() { + for( key in this.keysAndValues ) { + this.shuffleArray( this.keysAndValues[ key ] ) + } + }, + + shuffleArray : function( arr ) { + for(var j, x, i = arr.length; i; j = parseInt(Math.random() * i), x = arr[--i], arr[i] = arr[j], arr[j] = x); + }, +/**###Gibberish.Sequencer.disconnect : method +Each sequencer object has a tick method that is called once per sample. Use the disconnect method to stop the tick method from being called. +**/ + /*disconnect : function() { + var idx = Gibberish.sequencers.indexOf( this ); + Gibberish.sequencers.splice( idx, 1 ); + this.isConnected = false; + },*/ +/**###Gibberish.Sequencer.connect : method +Each sequencer object has a tick method that is called once per sample. Use the connect method to start calling the tick method. Note that the connect +method is called automatically when the sequencer is first created; you should only need to call it again if you call the disconnect method at some point. +**/ + /*connect : function() { + if( Gibberish.sequencers.indexOf( this ) === -1 ) { + Gibberish.sequencers.push( this ); + } + Gibberish.dirty( this ) + },*/ + }); + + this.init( arguments ); + this.processProperties( arguments ); + + for(var key in this.keysAndValues) { + this.counts[key] = 0; + } + + this.oscillatorInit(); + + phase += this.offset + + this.connect(); +}; +Gibberish.Sequencer2.prototype = Gibberish._oscillator +/**#Gibberish.Sequencer - Miscellaneous +A sample-accurate sequencer that can sequence changes to properties, method calls or anonymous function calls. + +## Example Usage## +`Gibberish.init(); +a = new Gibberish.Synth({ attack:44, decay:44100 }).connect(); +b = new Gibberish.Sequencer({ target:a, key:'note', durations:[11025, 22050], values:[440, 880] }).start() +` +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the sequencer on initialization. +- - - - +**/ +/**###Gibberish.Sequencer.target : property +Object. An object for the sequencer to control. May be null if you are sequencing anonymous functions. +**/ +/**###Gibberish.Sequencer.key : property +String. The name of the method or property you would like to sequnce on the Sequencer's target object. +**/ +/**###Gibberish.Sequencer.durations : property +Array. The number of samples between each advancement of the Sequencer. Once the Sequencer arrives at the end of this list, it loops back to the beginning +**/ +/**###Gibberish.Sequencer.keysAndValues : property +Object. A dictionary holding a set of values to be sequenced. The keys of the dictionary determine which methods and properties to sequence on the Sequencer's target object and +each key has an array of values representing the sequence for that key. + +`Gibberish.init(); +a = new Gibberish.Synth({ attack:44, decay:44100 }).connect(); +b = new Gibberish.Sequencer({ target:a, durations:[11025, 22050], keysAndValues:{ 'note':[440,880], 'amp':[.2,.4] } }).start() +` +**/ + +Gibberish.Sequencer = function() { + Gibberish.extend(this, { + target : null, + key : null, + values : null, + valuesIndex : 0, + durations : null, + durationsIndex: 0, + nextTime : 0, + phase : 0, + isRunning : false, + playOnce : false, + repeatCount : 0, + repeatTarget : null, + isConnected : true, + keysAndValues : null, + counts : {}, + offset : 0, + name : 'seq', + + tick : function() { + if(this.isRunning) { + if(this.phase >= this.nextTime) { + if(this.values !== null) { + if(this.target) { + var val = this.values[ this.valuesIndex++ ]; + + if(typeof val === 'function') { + try { + val = val(); + }catch(e) { + console.error('ERROR: Can\'t execute function triggered by Sequencer:\n' + val.toString() ) + this.values.splice( this.valuesIndex - 1, 1) + this.valuesIndex--; + } + } + + if(typeof this.target[this.key] === 'function') { + this.target[this.key]( val ); + }else{ + this.target[this.key] = val; + } + }else{ + if(typeof this.values[ this.valuesIndex ] === 'function') { + try { + this.values[ this.valuesIndex++ ](); + }catch(e) { + console.error('ERROR: Can\'t execute function triggered by Sequencer:\n' + this.values[ this.valuesIndex - 1 ].toString() ) + this.values.splice( this.valuesIndex - 1, 1) + this.valuesIndex--; + } + } + } + if(this.valuesIndex >= this.values.length) this.valuesIndex = 0; + }else if(this.keysAndValues !== null) { + for(var key in this.keysAndValues) { + var index = typeof this.keysAndValues[ key ].pick === 'function' ? this.keysAndValues[ key ].pick() : this.counts[key]++; + var val = this.keysAndValues[key][index]; + + if(typeof val === 'function') { + try { + val = val(); + }catch(e) { + console.error('ERROR: Can\'t execute function triggered by Sequencer:\n' + val.toString() ) + this.keysAndValues[key].splice( index, 1) + if( typeof this.keysAndValues[ key ].pick !== 'function' ) { + this.counts[key]--; + } + } + } + + if(typeof this.target[key] === 'function') { + this.target[key]( val ); + }else{ + this.target[key] = val; + } + if(this.counts[key] >= this.keysAndValues[key].length) { + this.counts[key] = 0; + } + } + }else if(typeof this.target[this.key] === 'function') { + this.target[this.key](); + } + + this.phase -= this.nextTime; + + if(Array.isArray(this.durations)) { + var next = typeof this.durations.pick === 'function' ? this.durations[ this.durations.pick() ] : this.durations[ this.durationsIndex++ ]; + this.nextTime = typeof next === 'function' ? next() : next; + if( this.durationsIndex >= this.durations.length) { + this.durationsIndex = 0; + } + }else{ + var next = this.durations; + this.nextTime = typeof next === 'function' ? next() : next; + } + + if(this.repeatTarget) { + this.repeatCount++; + if(this.repeatCount === this.repeatTarget) { + this.isRunning = false; + this.repeatCount = 0; + } + } + + return; + } + + this.phase++ + } + }, + +/**###Gibberish.Sequencer.start : method +Start the sequencer running. + +param **shouldKeepOffset** boolean, default false. If true, the phase of the sequencer will not be reset when calling the start method. +**/ + start : function(shouldKeepOffset) { + if(!shouldKeepOffset) { + this.phase = this.offset; + } + + this.isRunning = true; + return this; + }, + +/**###Gibberish.Sequencer.stop : method +Stop the sequencer. +**/ + stop: function() { + this.isRunning = false; + return this; + }, + +/**###Gibberish.Sequencer.repeat : method +Play the sequencer a certain number of times and then stop it. + +param **timesToRepeat** number. The number of times to repeat the sequence. +**/ + repeat : function(times) { + this.repeatTarget = times; + return this; + }, + + shuffle : function() { + for( key in this.keysAndValues ) { + this.shuffleArray( this.keysAndValues[ key ] ) + } + }, + + shuffleArray : function( arr ) { + for(var j, x, i = arr.length; i; j = parseInt(Math.random() * i), x = arr[--i], arr[i] = arr[j], arr[j] = x); + }, + +/**###Gibberish.Sequencer.disconnect : method +Each sequencer object has a tick method that is called once per sample. Use the disconnect method to stop the tick method from being called. +**/ + disconnect : function() { + var idx = Gibberish.sequencers.indexOf( this ); + Gibberish.sequencers.splice( idx, 1 ); + this.isConnected = false; + }, +/**###Gibberish.Sequencer.connect : method +Each sequencer object has a tick method that is called once per sample. Use the connect method to start calling the tick method. Note that the connect +method is called automatically when the sequencer is first created; you should only need to call it again if you call the disconnect method at some point. +**/ + connect : function() { + if( Gibberish.sequencers.indexOf( this ) === -1 ) { + Gibberish.sequencers.push( this ); + } + + this.isConnected = true + + return this + }, + }); + + for(var key in arguments[0]) { + this[key] = arguments[0][key]; + } + + for(var key in this.keysAndValues) { + this.counts[key] = 0; + } + + this.connect(); + + this.phase += this.offset + + //this.init( arguments ); + //this.oscillatorInit(); + //this.processProperties( arguments ); +}; +Gibberish.Sequencer.prototype = Gibberish._oscillator +// TODO: must fix scale seq + +/* +c = new Gibberish.Synth({ pan:-1 }).connect(); +b = new Gibberish.Synth({ pan:1 }).connect(); +a = new Gibberish.PolySeq({ + seqs:[ + { key:'note', target:b, values:[440,880], durations:22050 }, + { key:'note', target:c, values:[220,1320], durations:[11025, 22050, 5512.5] }, + ] +}).start() +*/ +Gibberish.PolySeq = function() { + var that = this, + phase = 0, + sort = function(a,b) { if( a < b ) return -1; if( a > b ) return 1; return 0; } ; + + Gibberish.extend(this, { + seqs : [], + autofire : [], // seqs with no scheduling that fire everytime a scheduled seq is triggered + timeline : {}, + playOnce : false, + repeatCount : 0, + repeatTarget : null, + isConnected : false, + properties : { rate: 1, isRunning:false, nextTime:0 }, + offset : 0, + name : 'polyseq', + getPhase : function() { return phase }, + setPhase : function(v) { phase = v }, + adjustPhase : function(v) { phase += v }, + timeModifier : null, + add : function( seq, pos ) { + seq.valuesIndex = seq.durationsIndex = 0 + + if( seq.durations === null ) { + seq.autofire = true + that.autofire.push( seq ) + }else{ + if( typeof pos === 'undefined' ) { + that.seqs.push( seq ) + }else{ + that.seqs.splice( pos, 0, seq ) + } + + if( typeof that.timeline[ phase ] !== 'undefined' ) { + if( seq.priority ) { + that.timeline[ phase ].unshift( seq ) + }else{ + that.timeline[ phase ].push( seq ) + } + }else{ + that.timeline[ phase ] = [ seq ] + } + + that.nextTime = phase + } + // for Gibber... TODO: remove from Gibberish + if( that.scale && (seq.key === 'frequency' || seq.key === 'note') ) { + if( that.applyScale ) { + that.applyScale() + } + } + + seq.shouldStop = false + }, + + callback : function(rate, isRunning, nextTime) { + var newNextTime; + + if(isRunning) { + if(phase >= nextTime) { + var seqs = that.timeline[ nextTime ], + phaseDiff = phase - nextTime + + if( typeof seqs === 'undefined') return + + for( var j = 0; j < seqs.length; j++ ) { + var seq = seqs[ j ] + if( seq.shouldStop ) continue; + + var idx = seq.values.pick ? seq.values.pick() : seq.valuesIndex++ % seq.values.length + + var val = typeof seq.values === 'function' ? seq.values() : seq.values[ idx ]; + + if(typeof val === 'function') { val = val(); } // will also call anonymous function + + if( seq.target ) { + if( typeof seq.target[ seq.key ] === 'function' ) { + seq.target[ seq.key ]( val ); + }else{ + seq.target[ seq.key ] = val; + } + } + + if( that.chose ) that.chose( seq.key, idx ) + + if( Array.isArray( seq.durations ) ) { + var idx = seq.durations.pick ? seq.durations.pick() : seq.durationsIndex++, + next = typeof seq.durations === 'function' ? seq.durations() : seq.durations[ idx ] + + newNextTime = typeof next === 'function' ? next() : next; + if( typeof seq.durations !== 'function' && seq.durationsIndex >= seq.durations.length ) { + seq.durationsIndex = 0; + } + if( that.chose ) that.chose( 'durations', idx ) + }else{ + var next = typeof seq.durations === 'function' ? seq.durations() : seq.durations; + + newNextTime = typeof next === 'function' ? next() : next; + } + + var t; + + if( that.timeModifier !== null ) { + t = that.timeModifier( newNextTime ) + phase // TODO: remove Gibber link... how? + }else{ + t = newNextTime + phase + } + + t -= phaseDiff + newNextTime -= phaseDiff + + if( typeof that.timeline[ t ] === 'undefined' ) { + that.timeline[ t ] = [ seq ] + }else{ + if( seq.priority ) { + that.timeline[ t ].unshift( seq ) + }else{ + that.timeline[ t ].push( seq ) + } + } + } + + for( var j = 0, l = that.autofire.length; j < l; j++ ) { + var seq = that.autofire[ j ] + if( seq.shouldStop ) continue; + + var idx = seq.values.pick ? seq.values.pick() : seq.valuesIndex++ % seq.values.length, + val = seq.values[ idx ]; + + if(typeof val === 'function') { val = val(); } // will also call anonymous function + + if( seq.target ) { + if(typeof seq.target[ seq.key ] === 'function') { + seq.target[ seq.key ]( val ); + }else{ + seq.target[ seq.key ] = val; + } + } + + if( that.chose ) that.chose( seq.key, idx ) + } + + delete that.timeline[ nextTime ] + + var times = Object.keys( that.timeline ), + timesLength = times.length; + + if( timesLength > 1 ) { + for( var i = 0; i < timesLength; i++ ) { + times[ i ] = parseFloat( times[i] ) + } + + times = times.sort( sort ) + that.nextTime = times[0] + }else{ + that.nextTime = parseFloat( times[0] ) + } + + // if(that.repeatTarget) { + // that.repeatCount++; + // if(that.repeatCount === that.repeatTarget) { + // that.isRunning = false; + // that.repeatCount = 0; + // } + // } + } + + // TODO: If you set the phase to 0, it will be lower than nextTime for many many samples in a row, causing it to quickly skip + // through lots of key / value pairs. + + phase += rate; + } + return 0; + }, + + start : function(shouldKeepOffset, priority) { + if(!shouldKeepOffset || ! this.offset ) { + phase = 0; + this.nextTime = 0; + + this.timeline = { 0:[] } + for( var i = 0; i < this.seqs.length; i++ ) { + var _seq = this.seqs[ i ] + + _seq.valuesIndex = _seq.durationsIndex = _seq.shouldStop = 0 + + this.timeline[ 0 ].push( _seq ) + } + }else{ + phase = 0; + this.nextTime = this.offset; + + var ___key = ''+this.offset + + this.timeline = {} + this.timeline[ ___key ] = [] + + for( var i = 0; i < this.seqs.length; i++ ) { + var _seq = this.seqs[ i ] + + _seq.valuesIndex = _seq.durationsIndex = _seq.shouldStop = 0 + + this.timeline[ ___key ].push( _seq ) + } + } + + if( !this.isConnected ) { + this.connect( Gibberish.Master, priority ) + this.isConnected = true + } + + this.isRunning = true; + return this; + }, + + stop: function() { + this.isRunning = false; + + if( this.isConnected ) { + this.disconnect() + this.isConnected = false + } + return this; + }, + + repeat : function(times) { + this.repeatTarget = times; + return this; + }, + + shuffle : function( seqName ) { + if( typeof seqName !== 'undefined' ) { + for( var i = 0; i < this.seqs.length; i++ ) { + if( this.seqs[i].key === seqName ) { + this.shuffleArray( this.seqs[i].values ) + } + } + }else{ + for( var i = 0; i < this.seqs.length; i++ ) { + this.shuffleArray( this.seqs[i].values ) + } + } + }, + + shuffleArray : function( arr ) { + for(var j, x, i = arr.length; i; j = parseInt(Math.random() * i), x = arr[--i], arr[i] = arr[j], arr[j] = x); + }, + + }); + + this.init( arguments ); + this.processProperties( arguments ); + + this.oscillatorInit(); +}; +Gibberish.PolySeq.prototype = Gibberish._oscillator +var _hasInput = false; // wait until requested to ask for permissions so annoying popup doesn't appear automatically + +if( typeof navigator === 'object' ) { + navigator.getUserMedia = ( navigator.getUserMedia || + navigator.webkitGetUserMedia || + navigator.mozGetUserMedia || + navigator.msGetUserMedia ) +} + +function createInput() { + console.log("connecting audio input..."); + + navigator.getUserMedia( + {audio:true}, + function (stream) { + console.log( 'audio input connected' ) + Gibberish.mediaStreamSource = Gibberish.context.createMediaStreamSource( stream ); + Gibberish.mediaStreamSource.connect( Gibberish.node ); + _hasInput = true; + }, + function( e ) { + console.log( e ) + console.log( 'error opening audio input') + } + ) +} +/**#Gibberish.Input - Oscillator +Accept input from computer's line-in or microphone input. Use headphones and beware feedback! Reading the audio input is currently only supported by Google Chrome. + +## Example Usage## +` +Gibberish.init(); +a = new Gibberish.Input() +b = new Gibberish.Delay( a ).connect() +- - - - +**/ +/**###Gibberish.Input.amp : property +Number. A gain multiplier for the input +**/ + +Gibberish.Input = function() { + var out = [], phase = 0; + + if(!_hasInput) { + createInput(); + } + + this.type = this.name = 'input' + + this.fx = new Array2() + this.fx.parent = this + + this.properties = { + input : 'input', + amp : .5, + channels : 1, + } + + this.callback = function(input, amp, channels) { + if(channels === 1) { + out = input * amp; + }else { + out[0] = input[0] * amp; + out[1] = input[1] * amp; + } + return out; + } + + this.init( arguments ) + this.processProperties( arguments ) +}; +Gibberish.Input.prototype = new Gibberish.ugen(); +Gibberish.Kick = function() { + var trigger = false, + bpf = new Gibberish.SVF().callback, + lpf = new Gibberish.SVF().callback, + _decay = .2, + _tone = .8; + + Gibberish.extend(this, { + name: "kick", + properties: { pitch:50, __decay:20, __tone: 1000, amp:2, sr: Gibberish.context.sampleRate }, + + callback: function(pitch, decay, tone, amp, sr) { + var out = trigger ? 60 : 0; + + out = bpf( out, pitch, decay, 2, sr ); + out = lpf( out, tone, .5, 0, sr ); + + out *= amp; + + trigger = false; + + return out; + }, + + note : function(p, d, t, amp) { + if(typeof p === 'number') this.pitch = p; + if(typeof d === 'number') this.decay = d; + if(typeof t === 'number') this.tone = t; + if(typeof amp === 'number') this.amp = amp; + + trigger = true; + }, + }) + .init() + .oscillatorInit(); + + Object.defineProperties(this, { + decay :{ + get: function() { return _decay; }, + set: function(val) { _decay = val > 1 ? 1 : val; this.__decay = _decay * 100; } + }, + tone :{ + get: function() { return _tone; }, + set: function(val) { _tone = val > 1 ? 1 : val; this.__tone = 220 + val * 1400; } + }, + }); + + this.processProperties(arguments); +}; +Gibberish.Kick.prototype = Gibberish._oscillator; + +// congas are bridged t-oscillators like kick without the low-pass filter +Gibberish.Conga = function() { + var trigger = false, + bpf = new Gibberish.SVF().callback, + _decay = .5; + + Gibberish.extend(this, { + name: "conga", + properties: { pitch:190, /*__decay:50,*/ amp:2, sr:Gibberish.context.sampleRate }, + + callback: function(pitch, /*decay,*/ amp, sr) { + var out = trigger ? 60 : 0; + + out = bpf( out, pitch, 50, 2, sr ); + + out *= amp; + + trigger = false; + + return out; + }, + + note : function(p, amp) { + if(typeof p === 'number') this.pitch = p; + if(typeof amp === 'number') this.amp = amp; + + trigger = true; + }, + }) + .init() + .oscillatorInit(); + + // Object.defineProperties(this, { + // decay :{ + // get: function() { return _decay; }, + // set: function(val) { _decay = val > 1 ? 1 : val; this.__decay = _decay * 100; } + // } + // }); + // + this.processProperties(arguments); +} +Gibberish.Conga.prototype = Gibberish._oscillator; + +// clave are also bridged t-oscillators like kick without the low-pass filter +Gibberish.Clave = function() { + var trigger = false, + _bpf = new Gibberish.SVF(), + bpf = _bpf.callback, + _decay = .5; + + Gibberish.extend(this, { + name: "clave", + properties: { pitch:2500, /*__decay:50,*/ amp:1, sr:Gibberish.context.sampleRate }, + + callback: function(pitch, /*decay,*/ amp, sr) { + var out = trigger ? 2 : 0; + + out = bpf( out, pitch, 5, 2, sr ); + + out *= amp; + + trigger = false; + + return out; + }, + + note : function(p, amp) { + if(typeof p === 'number') this.pitch = p; + if(typeof amp === 'number') this.amp = amp; + + trigger = true; + }, + }) + .init() + .oscillatorInit(); + + this.bpf = _bpf; + // Object.defineProperties(this, { + // decay :{ + // get: function() { return _decay; }, + // set: function(val) { _decay = val > 1 ? 1 : val; this.__decay = _decay * 100; } + // } + // }); + // + this.processProperties(arguments); +} +Gibberish.Clave.prototype = Gibberish._oscillator; + +// tom is tbridge with lpf'd noise +Gibberish.Tom = function() { + var trigger = false, + bpf = new Gibberish.SVF().callback, + lpf = new Gibberish.SVF().callback, + _eg = new Gibberish.ExponentialDecay(), + eg = _eg.callback, + rnd = Math.random, + _decay = .2, + _tone = .8; + + Gibberish.extend(this, { + name: "tom", + properties: { pitch:80, amp:.5, sr:Gibberish.context.sampleRate }, + + callback: function(pitch, amp, sr) { + var out = trigger ? 60 : 0, + noise; + + out = bpf( out, pitch, 30, 2, sr ); + + noise = rnd() * 16 - 8 + noise = noise > 0 ? noise : 0; + + noise *= eg(.05, 11025); + + noise = lpf( noise, 120, .5, 0, sr ); + + out += noise; + out *= amp; + + trigger = false; + + return out; + }, + + note : function(p, amp) { + if(typeof p === 'number') this.pitch = p; + if(typeof amp === 'number') this.amp = amp; + + _eg.trigger(); + trigger = true; + }, + }) + .init() + .oscillatorInit(); + + _eg.trigger(1) + + this.processProperties(arguments); +} +Gibberish.Tom.prototype = Gibberish._oscillator; + +Gibberish.Clap = function() { + var _bpf = new Gibberish.Biquad(), + bpf = _bpf.callback, + _bpf2 = new Gibberish.Biquad(), + bpf2 = _bpf2.callback, + _bpf3 = new Gibberish.Biquad(), + bpf3 = _bpf3.callback, + _eg = new Gibberish.ExponentialDecay(), + eg = _eg.callback, + _eg2 = new Gibberish.ExponentialDecay(), + eg2 = _eg2.callback, + _ad = new Gibberish.Line(), + ad = _ad.callback, + _lfo = new Gibberish.Saw(), + lfo = _lfo.callback, + rnd = Math.random, + cutoff = 1000, + rez = 2.5, + env1K = .025, + env2K = .9, + env1Dur = 30 * 44.1, + env2Dur = 660, + freq = 100 + + _bpf.mode = _bpf2.mode = 'BP' + _bpf3.mode = 'BP' + _bpf3.cutoff = 2400 + + _bpf.cutoff = _bpf2.cutoff = 1000 + _bpf.Q = 2 + _bpf2.Q = 1 + + Gibberish.extend(this, { + name: "clap", + properties: { amp:.5, sr:Gibberish.context.sampleRate }, + + callback: function( amp, sr ) { + var out = 0, noiseBPF, noise, env; + + noiseBPF = rnd() * 4 - 2 //* 4 - 2 + noiseBPF = noiseBPF > 0 ? noiseBPF : 0; + + noise = rnd() * 4 - 2 //* 16 - 8 + noise = noise > 0 ? noise : 0; + + out = bpf2( bpf( noiseBPF ) ) //, cutoff, rez, 2, sr ); // mode 2 is bp + + out *= eg2( env2K, env2Dur ) + + noise = bpf3( lfo( freq, noise ) * eg( env1K, env1Dur ) )//ad( 1,0, env1Dur, false ) ); + + out += noise; + out *= amp; + + return out; + }, + + note : function( amp ) { + if(typeof amp === 'number') this.amp = amp; + + _eg2.trigger(); + _eg.trigger(); + _ad.setPhase(0); + _lfo.setPhase(0); + + }, + }) + .init() + .oscillatorInit(); + + // _eg.trigger(1) + // _eg2.trigger(1) + + this.getBPF = function() { return _bpf; } + this.getBPF2 = function() { return _bpf2; } + this.getBPF3 = function() { return _bpf3; } + this.getLine = function() { return _ad; } + + this.setEnvK = function( k1,k2,d1,d2 ) { + env1K = k1 + if( k2 ) env2K = k2 + if( d1 ) env1Dur = d1 + if( d2 ) env2Dur = d2 + } + + this.setFreq = function(v) { freq = v } + + this.setRez = function(v) { rez = v; } + this.setCutoff = function(v) { cutoff = v; } + + this.processProperties(arguments); +} +Gibberish.Clap.prototype = Gibberish._oscillator; + +// http://www.soundonsound.com/sos/Sep02/articles/synthsecrets09.asp +Gibberish.Cowbell = function() { + var _s1 = new Gibberish.Square(), + _s2 = new Gibberish.Square(), + s1 = _s1.callback, + s2 = _s2.callback, + + _bpf = new Gibberish.SVF({ mode:2 }), + bpf = _bpf.callback, + + _eg = new Gibberish.ExponentialDecay( .0025, 10500 ), + eg = _eg.callback; + + Gibberish.extend(this, { + name: "cowbell", + properties : { amp: 1, pitch: 560, bpfFreq:1000, bpfRez:3, decay:22050, decayCoeff:.0001, sr:Gibberish.context.sampleRate }, + + callback : function(amp, pitch, bpfFreq, bpfRez, decay, decayCoeff, sr) { + var val; + + val = s1( pitch, 1, 1, 0 ); + val += s2( 845, 1, 1, 0 ); + + val = bpf( val, bpfFreq, bpfRez, 2, sr ); + + val *= eg(decayCoeff, decay); + + val *= amp; + + return val; + }, + + note : function(_decay, _decay2) { + _eg.trigger() + if(_decay) + this.decay = _decay; + } + }) + .init() + .oscillatorInit() + .processProperties(arguments); + + this.bpf = _bpf; + this.eg = _eg; + + _eg.trigger(1); +}; +Gibberish.Cowbell.prototype = Gibberish._oscillator; + +Gibberish.Snare = function() { + var bpf1 = new Gibberish.SVF().callback, + bpf2 = new Gibberish.SVF().callback, + noiseHPF = new Gibberish.SVF().callback, + _eg = new Gibberish.ExponentialDecay( .0025, 11025 ), + eg = _eg.callback, + rnd = Math.random, + phase = 11025, + out = 0, + envOut = 0; + + Gibberish.extend(this, { + name: "snare", + properties: { cutoff:1000, decay:11025, tune:0, snappy:.5, amp:1, sr:Gibberish.context.sampleRate }, + + callback: function(cutoff, decay, tune, snappy, amp, sr) { + var p1, p2, noise = 0, env = 0, out = 0; + + env = eg(.0025, decay); + + if(env > .005) { + out = ( rnd() * 2 - 1 ) * env ; + out = noiseHPF( out, cutoff + tune * 1000, .5, 1, sr ); + out *= snappy; + + // rectify as per instructions found here: http://ericarcher.net/devices/tr808-clone/ + out = out > 0 ? out : 0; + + envOut = env; + + p1 = bpf1( envOut, 180 * (tune + 1), 15, 2, sr ); + p2 = bpf2( envOut, 330 * (tune + 1), 15, 2, sr ); + + out += p1; + out += p2 * .8; + out *= amp; + } + + return out; + }, + + note : function(t, amp, s, c) { + if(typeof t === 'number') this.tune = t; + if(typeof c === 'number') this.cutoff = c; + if(typeof s === 'number') this.snappy = s; + if(typeof amp === 'number') this.amp = amp; + + _eg.trigger() + }, + }) + .init() + .oscillatorInit() + .processProperties(arguments); + + _eg.trigger(1); +} +Gibberish.Snare.prototype = Gibberish._oscillator; + +Gibberish.Hat = function() { + var _s1 = new Gibberish.Square(), + _s2 = new Gibberish.Square(), + _s3 = new Gibberish.Square(), + _s4 = new Gibberish.Square(), + _s5 = new Gibberish.Square(), + _s6 = new Gibberish.Square(), + s1 = _s1.callback, + s2 = _s2.callback, + s3 = _s3.callback, + s4 = _s4.callback, + s5 = _s5.callback, + s6 = _s6.callback, + //_bpf = new Gibberish.Biquad({ mode:'BP' }), + _bpf = new Gibberish.SVF({ mode:2 }), + bpf = _bpf.callback, + _hpf = new Gibberish.Filter24(), + hpf = _hpf.callback, + _eg = new Gibberish.ExponentialDecay( .0025, 10500 ), + eg = _eg.callback, + _eg2 = new Gibberish.ExponentialDecay( .1, 7500 ), + eg2 = _eg2.callback; + + Gibberish.extend(this, { + name: "hat", + properties : { amp: 1, pitch: 325, bpfFreq:7000, bpfRez:2, hpfFreq:.975, hpfRez:0, decay:3500, decay2:3000, sr:Gibberish.context.sampleRate }, + + callback : function(amp, pitch, bpfFreq, bpfRez, hpfFreq, hpfRez, decay, decay2, sr) { + var val; + + val = s1( pitch, 1, .5, 0 ); + val += s2( pitch * 1.4471, .75, 1, 0 ); + val += s3( pitch * 1.6170, 1, 1, 0 ); + val += s4( pitch * 1.9265, 1, 1, 0 ); + val += s5( pitch * 2.5028, 1, 1, 0 ); + val += s6( pitch * 2.6637, .75, 1, 0 ); + + val = bpf( val, bpfFreq, bpfRez, 2, sr ); + + val *= eg(.001, decay); + + // rectify as per instructions found here: http://ericarcher.net/devices/tr808-clone/ + // val = val > 0 ? val : 0; + + //sample, cutoff, resonance, isLowPass, channels + val = hpf(val, hpfFreq, hpfRez, 0, 1 ); + + val *= amp; + + return val; + }, + + note : function(_decay, _decay2) { + _eg.trigger() + _eg2.trigger() + if(_decay) + this.decay = _decay; + if(_decay2) + this.decay2 = _decay2; + + } + }) + .init() + .oscillatorInit() + .processProperties(arguments); + + this.bpf = _bpf; + this.hpf = _hpf; + + _eg.trigger(1); + _eg2.trigger(1); +}; +Gibberish.Hat.prototype = Gibberish._oscillator; + +/* IMPORTANT README +* +* This class depends on having access to a folder of soundfonts that have been converted to +* binary string representations. More specifically, soundfonts designed to work with GenMIDI.js: +* +* https://github.com/gleitz/midi-js-soundfonts +* +* At some point it would be nice to make another soundfont system, as GenMIDI.js does not support +* defining loop points. +* +* By default soundfonts should be found in a folder named 'resources/soundfonts' one level above +* the location of the gibberish.js library (or gibberish.min.js). You can pass a different path +* as the second argument to the Gibberish.SoundFont constructor; the first is the name of the soundfont +* minus the "-mp3.js" extension. So, for example: +* +* b = new Gibberish.SoundFont( 'choir_aahs' ).connect() +* b.note( 'C4' ) +* +* Note that you can only use note names, not frequency values. +*/ + +(function() { + var cents = function(base, _cents) { return base * Math.pow(2,_cents/1200) }, + GenMIDI = { Soundfont: { instruments: {} } }, + SF = GenMIDI.Soundfont + + // TODO: GET RID OF THIS GLOBAL!!!! It's unfortunately in there because we're using soundfonts meant for GenMIDI.js + if( typeof window === 'object' ) + window.GenMIDI = GenMIDI + else + global.GenMIDI = GenMIDI + + var getScript = function( scriptPath, handler ) { + var oReq = new XMLHttpRequest(); + + oReq.addEventListener("load", transferComplete, false); + oReq.addEventListener("error", function(e){ console.log( "SF load error", e ) }, false); + + oReq.open( 'GET', scriptPath, true ); + oReq.send() + //console.log("COMPLETE", scriptPath, evt ) + //var script = document.createElement('script') + //script.innerHTML = evt.srcElement ? evt.srcElement.responseText : evt.target.responseText + //script.onload = handler + //script.src = scriptPath + //document.querySelector( 'head' ).appendChild( script ) + + function updateProgress (oEvent) { + if (oEvent.lengthComputable) { + var percentComplete = oEvent.loaded / oEvent.total; + number.innerHTML = Math.round( percentComplete * 100 ) + + var sizeString = new String( "" + oEvent.total ) + sizeString = sizeString[0] + '.' + sizeString[1] + ' MB' + size.innerHTML = sizeString + + Gibber.log( percentComplete, "%" ) + } else { + // Unable to compute progress information since the total size is unknown + } + } + + function transferComplete( evt ) { + var script = document.createElement('script') + script.innerText = evt.srcElement ? evt.srcElement.responseText : evt.target.responseText + //script.onload = function() { console.log('LOADED FINAL SCRIPT', handler ) } + //script.onerror = function( err ) { console.log( 'SCRIPT ERROR', err ) } + document.querySelector( 'head' ).appendChild( script ) + setTimeout( handler, 0 ) + } + } + + var Base64Binary = { + _keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", + + // will return a Uint8Array type + decodeArrayBuffer: function(input) { + var bytes = (input.length/4) * 3; + var ab = new ArrayBuffer(bytes); + this.decode(input, ab); + + return ab; + }, + + decode: function(input, arrayBuffer) { + //get last chars to see if are valid + var lkey1 = this._keyStr.indexOf(input.charAt(input.length-1)); + var lkey2 = this._keyStr.indexOf(input.charAt(input.length-2)); + + var bytes = (input.length/4) * 3; + if (lkey1 == 64) bytes--; //padding chars, so skip + if (lkey2 == 64) bytes--; //padding chars, so skip + + var uarray; + var chr1, chr2, chr3; + var enc1, enc2, enc3, enc4; + var i = 0; + var j = 0; + + if (arrayBuffer) + uarray = new Uint8Array(arrayBuffer); + else + uarray = new Uint8Array(bytes); + + input = input.replace(/[^A-Za-z0-9\+\/\=]/g, ""); + + for (i=0; i> 4); + chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); + chr3 = ((enc3 & 3) << 6) | enc4; + + uarray[i] = chr1; + if (enc3 != 64) uarray[i+1] = chr2; + if (enc4 != 64) uarray[i+2] = chr3; + } + + return uarray; + } + } + + var decodeBuffers = function( obj ) { + //console.log('DECODING BUFFERS...', obj) + var count = 0, + font = SF[ obj.instrumentFileName ] + + if( typeof SF.instruments[ obj.instrumentFileName ] === 'undefined' ) { + SF.instruments[ obj.instrumentFileName ] = {} + } + + obj.buffers = SF.instruments[ obj.instrumentFileName ] + + for( var note in font ) { + count++ + !function() { + var _note = note + + var base = font[ _note ].split(",")[1] + var arrayBuffer = Base64Binary.decodeArrayBuffer( base ); + + Gibberish.context.decodeAudioData( arrayBuffer, function( _buffer ) { + SF.instruments[ obj.instrumentFileName ][ _note ] = _buffer.getChannelData( 0 ) + count-- + if( count <= 0 ) { + console.log("Soundfont " + obj.instrumentFileName + " is loaded.") + obj.isLoaded = true + if( obj.onload ) obj.onload() + } + }, function(e) { console.log("ERROR", e.err, arguments, _note ) } ) + + }() + } + } + + Gibberish.SoundFont = function( instrumentFileName, pathToResources ) { + var that = this + Gibberish.extend(this, { + 'instrumentFileName': instrumentFileName, + name:'soundfont', + properties: { + amp:1, + pan:0 + }, + playing:[], + buffers:{}, + onload: null, + out:[0,0], + isLoaded: false, + resourcePath: pathToResources || './resources/soundfonts/', + + callback: function( amp, pan ) { + var val = 0 + for( var i = this.playing.length -1; i >= 0; i-- ) { + var note = this.playing[ i ] + + val += this.interpolate( note.buffer, note.phase ) * note.velocity + + note.phase += note.increment + if( note.phase > note.length ) { + this.playing.splice( this.playing.indexOf( note ), 1 ) + } + } + + return this.panner( val * amp, pan, this.out ); + }.bind( this ), + + note: function( name, velocity, cents ) { + if( this.isLoaded ) { + this.playing.push({ + buffer:this.buffers[ name ], + phase:0, + increment: isNaN( cents ) ? 1 : 1 + cents, + length:this.buffers[ name ].length, + velocity: isNaN( velocity ) ? 1 : velocity + }) + } + }, + interpolate: Gibberish.interpolate.bind( this ), + panner: Gibberish.makePanner() + }) + .init() + .oscillatorInit() + + if( typeof arguments[0] === 'object' && arguments[0].instrumentFileName ) { + this.instrumentFileName = arguments[0].instrumentFileName + } + + // if already loaded, or if passed a buffer to use... + var self = this + if( !SF.instruments[ this.instrumentFileName ] && typeof this.resourcePath !== 'object' ) { + console.log("Downloading soundfont: " + this.instrumentFileName ) + getScript( this.resourcePath + this.instrumentFileName + '-mp3.js', function() { decodeBuffers( self ) } ) //decodeBuffers.bind( null, this ) ) + }else{ + if( typeof pathToResources === 'object' ) { + SF[ this.instrumentFileName ] = pathToResources + decodeBuffers( this ) + }else{ + this.buffers = SF.instruments[ this.instrumentFileName ] + this.isLoaded = true + setTimeout( function() { if( this.onload ) this.onload() }.bind( this ), 0 ) + } + } + return this + } + Gibberish.SoundFont.storage = SF + Gibberish.SoundFont.prototype = Gibberish._oscillator; +})() + + +Gibberish.Vocoder = function() { + var encoders = [], decoders = [], amps = [], store = [], + abs = Math.abs, sqrt = Math.sqrt, phase = 0, output = [0,0], + encoderObjects = [], decoderObjects = [], envelopeSize = 128, + history = [], + sums = [], + env = [], + index = 0, + original_cutoffs = [ + 330, 440, 554, 880, 1100, 1660, 2220, 3140 + ], + cutoffs = [], + startFreq = arguments[3] || 330, + endFreq = arguments[4] || 3200, + numberOfBands = arguments[2] || 16, + Q = arguments[5] || .15; + + this.name = "vocoder"; + + this.properties = { + carrier: arguments[0] || null, + modulator:arguments[1] || null, + amp: 1, + pan: 0 + } + + // filter band formula adapted from https://github.com/cwilso/Vocoder/blob/master/js/vocoder.js + var totalRangeInCents = 1200 * Math.log( endFreq / startFreq ) / Math.LN2, + centsPerBand = totalRangeInCents / numberOfBands, + scale = Math.pow( 2, centsPerBand / 1200 ), // This is the scaling for successive bands + currentFreq = startFreq; + + for(var i = 0; i < numberOfBands; i++) { + encoderObjects[i] = new Gibberish.Biquad({ mode:'BP', Q:Q, cutoff:currentFreq }); + encoders[i] = encoderObjects[i].callback + decoderObjects[i] = new Gibberish.Biquad({ mode:'BP', Q:Q, cutoff:currentFreq }); + decoders[i] = decoderObjects[i].callback + + history[ i ] = [ 0 ] + sums[ i ] = 0 + env[ i ] = 0 + + currentFreq = currentFreq * scale; + } + + //console.log( numberOfBands, startFreq, endFreq, Q ) + + this.callback = function( carrier, modulator, amp, pan ) { + var historyIndex = ( index + 1 ) % envelopeSize, + modValue = typeof modulator !== 'number' ? modulator[0] + modulator[1] : modulator, + carrierValue = typeof carrier !== 'number' ? carrier[0] + carrier[1] : carrier, + encValue, out = 0 + + for(var i = 0; i < numberOfBands; i++) { + encValue = abs( encoders[ i ]( modValue ) ) + + sums[ i ] += encValue + sums[ i ] -= history[ i ][ index ] + + history[ i ][ index ] = encValue + history[ i ][ historyIndex ] = history[ i ][ historyIndex ] ? history[ i ][ historyIndex ] : 0 + + env[ i ] = sums[ i ] / envelopeSize + + out += decoders[i]( carrierValue ) * env[ i ]; + } + index = historyIndex + + output[0] = output[1] = out * amp * 16; // look, ma... 16 IS MAGIC!!! + + return output; + } + + this.getEncoders = function() { return encoderObjects } + this.getDecoders = function() { return decoderObjects } + + this.init(); + this.oscillatorInit(); + //this.processProperties(arguments); +} +Gibberish.Vocoder.prototype = Gibberish._synth +return Gibberish; +}) +}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) +},{}],"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/external/freesound2.js":[function(require,module,exports){ +(function () { + + var freesound = function () { + var authHeader = ''; + var clientId = ''; + var clientSecret = ''; + var host = 'freesound.org'; + + var uris = { + base : 'https://'+host+'/apiv2', + textSearch : '/search/text/', + contentSearch: '/search/content/', + combinedSearch : '/sounds/search/combined/', + sound : '/sounds//', + soundAnalysis : '/sounds//analysis/', + similarSounds : '/sounds//similar/', + comments : '/sounds//comments/', + download : '/sounds//download/', + upload : '/sounds/upload/', + describe : '/sounds//describe/', + pending : '/sounds/pending_uploads/', + bookmark : '/sounds//bookmark/', + rate : '/sounds//rate/', + comment : '/sounds//comment/', + authorize : '/oauth2/authorize/', + logout : '/api-auth/logout/', + logoutAuthorize : '/oauth2/logout_and_authorize/', + me : '/me/', + user : '/users//', + userSounds : '/users//sounds/', + userPacks : '/users//packs/', + userBookmarkCategories : '/users//bookmark_categories/', + userBookmarkCategorySounds : '/users//bookmark_categories//sounds/', + pack : '/packs//', + packSounds : '/packs//sounds/', + packDownload : '/packs//download/' + }; + + var makeUri = function (uri, args){ + for (var a in args) {uri = uri.replace(/<[\w_]+>/, args[a]);} + return uris.base+uri; + }; + + var makeRequest = function (uri, success, error, params, wrapper, method, data, content_type){ + if(method===undefined) method='GET'; + if(!error)error = function(e){console.log(e)}; + params = params || {}; + params['format'] = 'json'; + //params['api_key'] = '4287f0bacdcc492a8fae27fc3b228aaf'; + var fs = this; + var parse_response = function (response){ + var data = eval("(" + response + ")"); + success(wrapper?wrapper(data):data); + }; + var paramStr = ""; + for(var p in params){paramStr = paramStr+"&"+p+"="+params[p];} + if (paramStr){ + uri = uri +"?"+ paramStr; + } + + if (typeof module !== 'undefined'){ // node.js + var http = require("http"); + var options = { + host: host, + path: uri.substring(uri.indexOf("/",8),uri.length), // first '/' after 'http://' + port: '443', + method: method, + headers: {'Authorization': authHeader}, + withCredentials:false, + }; + console.log( 'http options:', options ) + var req = http.request(options,function(res){ + res.setEncoding('utf8'); + res.on('data', function (data){ + if([200,201,202].indexOf(res.statusCode)>=0) + success(wrapper?wrapper(data):data); + else + error(data); + }); + }); + req.on('error', error).end(); + } + else{ // browser + var xhr; + try {xhr = new XMLHttpRequest();} + catch (e) {xhr = new ActiveXObject('Microsoft.XMLHTTP');} + + xhr.onreadystatechange = function(){ + if (xhr.readyState === 4 && [200,201,202].indexOf(xhr.status)>=0){ + var data = eval("(" + xhr.responseText + ")"); + if(success) success(wrapper?wrapper(data):data); + } + else if (xhr.readyState === 4 && xhr.status !== 200){ + if(error) error(xhr.statusText); + } + }; + console.log( method, uri ) + xhr.open(method, uri); + xhr.setRequestHeader('Authorization',authHeader); + if(content_type!==undefined) + xhr.setRequestHeader('Content-Type',content_type); + xhr.send(data); + } + }; + var checkOauth = function(){ + if(authHeader.indexOf("Bearer")==-1) + throw("Oauth authentication required"); + }; + + var makeFD = function(obj,fd){ + if(!fd) + fd = new FormData(); + for (var prop in obj){ + fd.append(prop,obj[prop]) + } + return fd; + }; + + var search = function(options, uri, success, error,wrapper){ + if(options.analysis_file){ + makeRequest(makeUri(uri), success,error,null, wrapper, 'POST',makeFD(options)); + } + else{ + makeRequest(makeUri(uri), success,error,options, wrapper); + } + }; + + var Collection = function (jsonObject){ + var nextOrPrev = function (which,success,error){ + makeRequest(which,success,error,{}, Collection); + }; + jsonObject.nextPage = function (success,error){ + nextOrPrev(jsonObject.next,success,error); + }; + jsonObject.previousPage = function (success,error){ + nextOrPrev(jsonObject.previous,success,error); + }; + jsonObject.getItem = function (idx){ + return jsonObject.results[idx]; + } + + return jsonObject; + }; + + var SoundCollection = function(jsonObject){ + var collection = Collection(jsonObject); + collection.getSound = function (idx){ + return new SoundObject(collection.results[idx]); + }; + return collection; + }; + + var PackCollection = function(jsonObject){ + var collection = Collection(jsonObject); + collection.getPack = function (idx){ + return new PackObject(collection.results[idx]); + }; + return collection; + }; + + var SoundObject = function (jsonObject){ + jsonObject.getAnalysis = function(filter, success, error, showAll){ + var params = {all: showAll?1:0}; + makeRequest(makeUri(uris.soundAnalysis,[jsonObject.id,filter?filter:""]),success,error); + }; + + jsonObject.getSimilar = function (success, error, params){ + makeRequest(makeUri(uris.similarSounds,[jsonObject.id]),success,error, params,SoundCollection); + }; + + jsonObject.getComments = function (success, error){ + makeRequest(makeUri(uris.comments,[jsonObject.id]),success,error,{},Collection); + }; + + jsonObject.download = function (targetWindow){// can be window, new, or iframe + checkOauth(); + var uri = makeUri(uris.download,[jsonObject.id]); + targetWindow.location = uri; + }; + + jsonObject.comment = function (commentStr, success, error){ + checkOauth(); + var data = new FormData(); + data.append('comment', comment); + var uri = makeUri(uris.comment,[jsonObject.id]); + makeRequest(uri, success, error, {}, null, 'POST', data); + }; + + jsonObject.rate = function (rating, success, error){ + checkOauth(); + var data = new FormData(); + data.append('rating', rating); + var uri = makeUri(uris.rate,[jsonObject.id]); + makeRequest(uri, success, error, {}, null, 'POST', data); + }; + + jsonObject.bookmark = function (name, category,success, error){ + checkOauth(); + var data = new FormData(); + data.append('name', name); + if(category) + data.append("category",category); + var uri = makeUri(uris.bookmark,[jsonObject.id]); + makeRequest(uri, success, error, {}, null, 'POST', data); + }; + + jsonObject.edit = function (description,success, error){ + checkOauth(); + var data = makeFD(description); + var uri = makeUri(uris.edit,[jsonObject.id]); + makeRequest(uri, success, error, {}, null, 'POST', data); + }; + + return jsonObject; + }; + var UserObject = function(jsonObject){ + jsonObject.sounds = function (success, error, params){ + var uri = makeUri(uris.userSounds,[jsonObject.username]); + makeRequest(uri, success, error,params,SoundCollection); + }; + + jsonObject.packs = function (success, error){ + var uri = makeUri(uris.userPacks,[jsonObject.username]); + makeRequest(uri, success, error,{},PackCollection); + }; + + jsonObject.bookmarkCategories = function (success, error){ + var uri = makeUri(uris.userBookmarkCategories,[jsonObject.username]); + makeRequest(uri, success, error); + }; + + jsonObject.bookmarkCategorySounds = function (success, error,params){ + var uri = makeUri(uris.userBookmarkCategorySounds,[jsonObject.username]); + makeRequest(uri, success, error,params); + }; + + return jsonObject; + }; + + var PackObject = function(jsonObject){ + jsonObject.sounds = function (success, error){ + var uri = makeUri(uris.packSounds,[jsonObject.id]); + makeRequest(uri, success, error,{},SoundCollection); + }; + + jsonObject.download = function (targetWindow){// can be current or new window, or iframe + checkOauth(); + var uri = makeUri(uris.packDownload,[jsonObject.id]); + targetWindow.location = uri; + }; + return jsonObject; + }; + + return { + // authentication + setToken: function (token, type) { + authHeader = (type==='oauth' ? 'Bearer ':'Token ')+token; + }, + setClientSecrets: function(id,secret){ + clientId = id; + clientSecret = secret; + }, + + postAccessCode: function(code, success, error){ + var post_url = uris.base+"/oauth2/access_token/" + var data = new FormData(); + data.append('client_id',clientId); + data.append('client_secret',clientSecret); + data.append('code',code); + data.append('grant_type','authorization_code'); + + if (!success){ + success = function(result){ + setToken(result.access_token,'oauth'); + } + } + makeRequest(post_url, success, error, {}, null, 'POST', data); + }, + textSearch: function(query, options, success, error){ + options = options || {}; + options.query = query ? query : " "; + search(options,uris.textSearch,success,error,SoundCollection); + }, + contentSearch: function(options, success, error){ + if(!(options.target || options.analysis_file)) + throw("Missing target or analysis_file"); + search(options,uris.contentSearch,success,error,SoundCollection); + }, + combinedSearch:function(options, success, error){ + if(!(options.target || options.analysis_file || options.query)) + throw("Missing query, target or analysis_file"); + search(options,uris.contentSearch,success,error); + }, + getSound: function(soundId,success, error){ + makeRequest(makeUri(uris.sound, [soundId]), success,error,{}, SoundObject); + }, + + upload: function(audiofile,filename, description, success,error){ + checkOauth(); + var fd = new FormData(); + fd.append('audiofile', audiofile,filename); + if(description){ + fd = makeFD(description,fd); + } + makeRequest(makeUri(uris.upload), success, error, {}, null, 'POST', fd); + }, + describe: function(upload_filename , description, license, tags, success,error){ + checkOauth(); + var fd = makeFD(description); + makeRequest(makeUri(uris.upload), success, error, {}, null, 'POST', fd); + }, + + getPendingSounds: function(success,error){ + checkOauth(); + makeRequest(makeUri(uris.pending), success,error,{}); + }, + + // user resources + me: function(success,error){ + checkOauth(); + makeRequest(makeUri(uris.me), success,error); + }, + + getLoginURL: function(){ + if(clientId===undefined) throw "client_id was not set" + var login_url = makeUri(uris.authorize); + login_url += "?client_id="+clientId+"&response_type=code"; + return login_url; + }, + getLogoutURL: function(){ + var logout_url = makeUri(uris.logoutAuthorize); + logout_url += "?client_id="+clientId+"&response_type=code"; + + return logout_url; + }, + + getUser: function(username, success,error){ + makeRequest(makeUri(uris.user, [username]), success,error,{}, UserObject); + }, + + getPack: function(packId,success,error){ + makeRequest(makeUri(uris.pack, [packId]), success,error,{}, PackObject); + } + } + }; + + // compatible with CommonJS (node), AMD (requireJS) failing back to browser global + // working with node requires web-audio-api module + if (typeof module !== 'undefined') {module.exports = freesound(); } + else if (typeof define === 'function' && typeof define.amd === 'object') { define("freesound", [], freesound); } + else {this.freesound = freesound(); } +}()); + +},{"http":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/browserify/node_modules/http-browserify/index.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/external/teoria.min.js":[function(require,module,exports){ +(function(){function t(t,e){return t=r[t],e=r[e],t.distance>e.distance?e.distance+12-t.distance:e.distance-t.distance}function e(t,e,i){for(;i>0;i--)t+=e;return t}function i(t,e){if("string"!=typeof t)return null;this.name=t,this.duration=e||4,this.accidental={value:0,sign:""};var i=t.match(/^([abcdefgh])(x|#|bb|b?)(-?\d*)/i);if(i&&t===i[0]&&0!==i[3].length)this.name=i[1].toLowerCase(),this.octave=parseFloat(i[3]),0!==i[2].length&&(this.accidental.sign=i[2].toLowerCase(),this.accidental.value=y[i[2]]);else{t=t.replace(/\u2032/g,"'").replace(/\u0375/g,",");var n=t.match(/^(,*)([abcdefgh])(x|#|bb|b?)([,\']*)$/i);if(!n||5!==n.length||t!==n[0])throw Error("Invalid note format");if(""===n[1]&&""===n[4])this.octave=n[2]===n[2].toLowerCase()?3:2;else if(""!==n[1]&&""===n[4]){if(n[2]===n[2].toLowerCase())throw Error("Invalid note format. Format must respect the Helmholtz notation.");this.octave=2-n[1].length}else{if(""!==n[1]||""===n[4])throw Error("Invalid note format");if(n[4].match(/^'+$/)){if(n[2]===n[2].toUpperCase())throw Error("Invalid note format. Format must respect the Helmholtz notation");this.octave=3+n[4].length}else{if(!n[4].match(/^,+$/))throw Error("Invalid characters after note name.");if(n[2]===n[2].toLowerCase())throw Error("Invalid note format. Format must respect the Helmholtz notation");this.octave=2-n[4].length}}this.name=n[2].toLowerCase(),0!==n[3].length&&(this.accidental.sign=n[3].toLowerCase(),this.accidental.value=y[n[3]])}}function n(t,e){if(!(t instanceof i))return null;e=e||"",this.name=t.name.toUpperCase()+t.accidental.sign+e,this.root=t,this.notes=[t],this.quality="major",this.type="major";var n,r,o,s,h,m=[],u=!1,c="quality",d=!1,p=!1,v=null;for(s=0,h=e.length;h>s;s++){for(n=e[s];" "===n||"("===n||")"===n;)n=e[++s];if(!n)break;if(r=n.charCodeAt(0),o=h>=s+3?e.substr(s,3):"","quality"===c)"M"===n||("maj"===o||916===r?(this.type="major",m.push("M7"),u=!0,(e[s+3]&&"7"===e[s+3]||916===r&&"7"===e[s+1])&&s++):"m"===n||"-"===n||"min"===o?this.quality=this.type="minor":111===r||176===r||"dim"===o?(this.quality="minor",this.type="diminished"):"+"===n||"aug"===o?(this.quality="major",this.type="augmented"):216===r||248===r?(this.quality="minor",this.type="diminished",m.push("m7"),u=!0):"sus"===o?(this.quality="sus",this.type=e[s+3]&&"2"===e[s+3]?"sus2":"sus4"):"5"===n?(this.quality="power",this.type="power"):s-=1),o in l&&(s+=2),c="";else if("#"===n)d=!0;else if("b"===n)p=!0;else if("5"===n)d?(v="A5","major"===this.quality&&(this.type="augmented")):p&&(v="d5","minor"===this.quality&&(this.type="diminished")),p=d=!1;else if("6"===n)m.push("M6"),p=d=!1;else if("7"===n)"diminished"===this.type?m.push("d7"):m.push("m7"),u=!0,p=d=!1;else if("9"===n)u||m.push("m7"),p?m.push("m9"):d?m.push("A9"):m.push("M9"),p=d=!1;else{if("1"!==n)throw Error("Unexpected character: '"+n+"' in chord name");n=e[++s],"1"===n?p?m.push("d11"):d?m.push("A11"):m.push("P11"):"3"===n&&(p?m.push("m13"):d?m.push("A13"):m.push("M13")),p=d=!1}}for(var y=0,g=f[this.type].length;g>y;y++)"5"===f[this.type][y][1]&&v?this.notes.push(a.interval(this.root,v)):this.notes.push(a.interval(this.root,f[this.type][y]));for(y=0,g=m.length;g>y;y++)this.notes.push(a.interval(this.root,m[y]))}var a={},r={c:{name:"c",distance:0,index:0},d:{name:"d",distance:2,index:1},e:{name:"e",distance:4,index:2},f:{name:"f",distance:5,index:3},g:{name:"g",distance:7,index:4},a:{name:"a",distance:9,index:5},b:{name:"b",distance:11,index:6},h:{name:"h",distance:11,index:6}},o=["c","d","e","f","g","a","b"],s={.25:"longa",.5:"breve",1:"whole",2:"half",4:"quarter",8:"eighth",16:"sixteenth",32:"thirty-second",64:"sixty-fourth",128:"hundred-twenty-eighth"},h=[{name:"unison",quality:"perfect",size:0},{name:"second",quality:"minor",size:1},{name:"third",quality:"minor",size:3},{name:"fourth",quality:"perfect",size:5},{name:"fifth",quality:"perfect",size:7},{name:"sixth",quality:"minor",size:8},{name:"seventh",quality:"minor",size:10},{name:"octave",quality:"perfect",size:12},{name:"ninth",quality:"minor",size:13},{name:"tenth",quality:"minor",size:15},{name:"eleventh",quality:"perfect",size:17},{name:"twelfth",quality:"perfect",size:19},{name:"thirteenth",quality:"minor",size:20},{name:"fourteenth",quality:"minor",size:22},{name:"fifteenth",quality:"perfect",size:24}],m={unison:0,second:1,third:2,fourth:3,fifth:4,sixth:5,seventh:6,octave:7,ninth:8,tenth:9,eleventh:10,twelfth:11,thirteenth:12,fourteenth:13,fifteenth:14},l={P:"perfect",M:"major",m:"minor",A:"augmented",d:"diminished",perf:"perfect",maj:"major",min:"minor",aug:"augmented",dim:"diminished"},u={perfect:"P",major:"M",minor:"m",augmented:"A",diminished:"d"},c={P:"P",M:"m",m:"M",A:"d",d:"A"},d={perfect:["diminished","perfect","augmented"],minor:["diminished","minor","major","augmented"]},f={major:["M3","P5"],minor:["m3","P5"],augmented:["M3","A5"],diminished:["m3","d5"],sus2:["M2","P5"],sus4:["P4","P5"],power:["P5"]},p={major:"M",minor:"m",augmented:"aug",diminished:"dim",power:"5"},v={"-2":"bb","-1":"b",0:"",1:"#",2:"x"},y={bb:-2,b:-1,"#":1,x:2};i.prototype={key:function(t){return t?7*(this.octave-1)+3+Math.ceil(r[this.name].distance/2):12*(this.octave-1)+4+r[this.name].distance+this.accidental.value},fq:function(t){return t=t||440,t*Math.pow(2,(this.key()-49)/12)},scale:function(t,e){return a.scale.list(this,t,e)},interval:function(t,e){return a.interval(this,t,e)},chord:function(t){return t=t||"major",t in p&&(t=p[t]),new n(this,t)},helmholtz:function(){var t,i=3>this.octave?this.name.toUpperCase():this.name.toLowerCase();return 2>=this.octave?(t=e("",",",2-this.octave),t+i+this.accidental.sign):(t=e("","'",this.octave-3),i+this.accidental.sign+t)},scientific:function(){return this.name.toUpperCase()+this.accidental.sign+("number"==typeof this.octave?this.octave:"")},enharmonics:function(){var t=[],e=this.key(),i=this.interval("m2","up"),n=this.interval("m2","down"),a=i.key()-i.accidental.value,r=n.key()-n.accidental.value,o=e-a;return 3>o&&o>-3&&(i.accidental={value:o,sign:v[o]},t.push(i)),o=e-r,3>o&&o>-3&&(n.accidental={value:o,sign:v[o]},t.push(n)),t},valueName:function(){return s[this.duration]},toString:function(t){return t="boolean"==typeof t?t:"number"==typeof this.octave?!1:!0,this.name.toLowerCase()+this.accidental.sign+(t?"":this.octave)}},n.prototype.dominant=function(t){return t=t||"",new n(this.root.interval("P5"),t)},n.prototype.subdominant=function(t){return t=t||"",new n(this.root.interval("P4"),t)},n.prototype.parallel=function(t){if(t=t||"","triad"!==this.chordType()||"diminished"===this.quality||"augmented"===this.quality)throw Error("Only major/minor triads have parallel chords");return"major"===this.quality?new n(this.root.interval("m3","down"),"m"):new n(this.root.interval("m3","up"))},n.prototype.chordType=function(){var t,e,i;if(2===this.notes.length)return"dyad";if(3===this.notes.length){e={unison:!1,third:!1,fifth:!1};for(var n=0,r=this.notes.length;r>n;n++)t=this.root.interval(this.notes[n]),i=h[parseFloat(a.interval.invert(t.simple)[1])-1],t.name in e?e[t.name]=!0:i.name in e&&(e[i.name]=!0);return e.unison&&e.third&&e.fifth?"triad":"trichord"}if(4===this.notes.length){e={unison:!1,third:!1,fifth:!1,seventh:!1};for(var n=0,r=this.notes.length;r>n;n++)t=this.root.interval(this.notes[n]),i=h[parseFloat(a.interval.invert(t.simple)[1])-1],t.name in e?e[t.name]=!0:i.name in e&&(e[i.name]=!0);if(e.unison&&e.third&&e.fifth&&e.seventh)return"tetrad"}return"unknown"},n.prototype.toString=function(){return this.name},a.note=function(t,e){return new i(t,e)},a.note.fromKey=function(t){var e=440*Math.pow(2,(t-49)/12);return a.frequency.note(e).note},a.chord=function(t){var e;if(e=t.match(/^([abcdefgh])(x|#|bb|b?)/i),e&&e[0])return new n(new i(e[0].toLowerCase()),t.substr(e[0].length));throw Error("Invalid Chord. Couldn't find note name")},a.frequency={note:function(t,e){e=e||440;var n,a,s,h,m,l,u;return n=Math.round(49+12*((Math.log(t)-Math.log(e))/Math.log(2))),u=e*Math.pow(2,(n-49)/12),l=1200*(Math.log(t/u)/Math.log(2)),a=Math.floor((n-4)/12),s=n-12*a-4,h=r[o[Math.round(s/2)]],m=h.name,s>h.distance?m+="#":h.distance>s&&(m+="b"),{note:new i(m+(a+1)),cents:l}}},a.interval=function(t,e,n){if("string"==typeof e){"down"===n&&(e=a.interval.invert(e));var r=l[e[0]],o=parseFloat(e.substr(1));if(!r||isNaN(o)||1>o)throw Error("Invalid string-interval format");return a.interval.from(t,{quality:r,interval:h[o-1].name},n)}if(e instanceof i&&t instanceof i)return a.interval.between(t,e);throw Error("Invalid parameters")},a.interval.from=function(e,n,a){n.direction=a||n.direction||"up";var s,l,u,c,f,p;if(f=m[n.interval],p=h[f],f>7&&(f-=7),f=r[e.name].index+f,f>o.length-1&&(f-=o.length),s=o[f],-1===d[p.quality].indexOf(n.quality)||-1===d[p.quality].indexOf(p.quality))throw Error("Invalid interval quality");return l=d[p.quality].indexOf(n.quality)-d[p.quality].indexOf(p.quality),u=p.size+l-t(e.name,s),e.octave&&(c=Math.floor((e.key()-e.accidental.value+t(e.name,s)-4)/12)+1+Math.floor(m[n.interval]/7)),u+=e.accidental.value,u>=11&&(u-=12),u>-3&&3>u&&(s+=v[u]),"down"===a&&c--,new i(s+(c||""))},a.interval.between=function(t,e){var i,n,a,o,s,m,l=t.key(),c=e.key();if(i=c-l,i>24||-25>i)throw Error("Too big interval. Highest interval is a augmented fifteenth (25 semitones)");return 0>i&&(o=t,t=e,e=o),a=r[e.name].index-r[t.name].index+7*(e.octave-t.octave),n=h[a],m=d[n.quality][Math.abs(i)-n.size+1],s=u[m]+(""+Number(a+1)),{name:n.name,quality:m,direction:i>0?"up":"down",simple:s}},a.interval.invert=function(t){if(2!==t.length&&3!==t.length)return!1;var e=c[t[0]],i=2===t.length?parseFloat(t[1]):parseFloat(t.substr(1));return i>8&&(i-=7),8!==i&&1!==i&&(i=9-i),e+(""+i)},a.scale={list:function(t,e,n){var r,o,s=[],h=[];if(!(t instanceof i))return!1;if("string"==typeof e&&(e=a.scale.scales[e],!e))return!1;for(s.push(t),n&&h.push(t.name+(t.accidental.sign||"")),r=0,o=e.length;o>r;r++)s.push(a.interval(t,e[r])),n&&h.push(s[r+1].name+(s[r+1].accidental.sign||""));return n?h:s},scales:{major:["M2","M3","P4","P5","M6","M7"],ionian:["M2","M3","P4","P5","M6","M7"],dorian:["M2","m3","P4","P5","M6","m7"],phrygian:["m2","m3","P4","P5","m6","m7"],lydian:["M2","M3","A4","P5","M6","M7"],mixolydian:["M2","M3","P4","P5","M6","m7"],minor:["M2","m3","P4","P5","m6","m7"],aeolian:["M2","m3","P4","P5","m6","m7"],locrian:["m2","m3","P4","d5","m6","m7"],majorpentatonic:["M2","M3","P5","M6"],minorpentatonic:["m3","P4","P5","m7"],chromatic:["m2","M2","m3","M3","P4","A4","P5","m6","M6","m7","M7"],harmonicchromatic:["m2","M2","m3","M3","P4","A4","P5","m6","M6","m7","M7"]}},module.exports=a})(); +},{}],"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio.js":[function(require,module,exports){ +module.exports = function( Gibber ) { + +"use strict" + +var times = [], + $ = Gibber.dollar, + Gibberish = require( 'gibberish-dsp' ), + Audio + +Audio = { + initialized: false, // only run clear function if initialized + // can't name export as Gibberish has the same nameAudio + export: function( target ) { + $.extend( target, Audio.Busses ) + $.extend( target, Audio.Oscillators ) + $.extend( target, Audio.Synths ) + $.extend( target, Audio.Percussion ) + $.extend( target, Audio.Envelopes ) + $.extend( target, Audio.FX ) + $.extend( target, Audio.Seqs ) + $.extend( target, Audio.Samplers ) + + var __clear__ = target.clear + $.extend( target, Audio.PostProcessing ) + target.clear = __clear__ + + $.extend( target, Audio.Vocoder ) + + target.Theory = Audio.Theory + $.extend( target, Audio.Analysis ) + + // target.future = Gibber.Utilities.future + // target.solo = Gibber.Utilities.solo + target.Score = Audio.Score + target.Clock = Audio.Clock + target.Seq = Audio.Seqs.Seq + target.Arp = Audio.Arp // move Arp to sequencers? + target.ScaleSeq = Audio.Seqs.ScaleSeq + target.SoundFont = Audio.SoundFont + target.Speak = Audio.Speak + target.Additive = Audio.Additive + target.Ugen = Audio.Ugen + + target.Rndi = Audio.Core.Rndi + target.Rndf = Audio.Core.Rndf + target.rndi = Audio.Core.rndi + target.rndf = Audio.Core.rndf + + target.Input = Audio.Input + + target.Freesound = Audio.Freesound + target.Freesoundjs2 = Audio.Freesoundjs2 + + target.Scale = Audio.Theory.Scale + + target.Ensemble = Audio.Ensemble + + target.module = Gibber.import + // target.ms = Audio.Time.ms + // target.seconds = target.sec = Audio.Time.seconds + // target.minutes = target.min = Audio.Time.minutes + Audio.Core.Time.export( target ) + Audio.Clock.export( target ) + //target.sec = target.seconds + Audio.Core.Binops.export( target ) + + target.Master = Audio.Master + }, + init: function( callback ) { + $ = Gibber.dollar + // post-processing depends on having context instantiated + var __onstart = null + if( Audio.onstart ) __onstart = Audio.onstart + + if( !Audio.context ) { Audio.context = { sampleRate:44100 } } + + Audio.Core.onstart = function() { + Audio.Clock.start( true ) + + + if( __onstart !== null ) { __onstart() } + + Audio.Score = Audio.Score( Gibber ) + Audio.Additive = Audio.Additive( Gibber ) + Gibber.Clock = Audio.Clock + + Gibber.Theory = Audio.Theory + + Gibber.Theory.scale = Gibber.scale = Gibber.Audio.Theory.Scale( 'c4','Minor' ) + + $.extend( Gibber.Binops, Audio.Binops ) + + Audio.Master = Audio.Busses.Bus().connect( Audio.Core.out ) + + Audio.Master.type = 'Bus' + Audio.Master.name = 'Master' + + $.extend( true, Audio.Master, Audio.ugenTemplate ) + Audio.Master.fx.ugen = Audio.Master + + Audio.ugenTemplate.connect = + Audio.Core._oscillator.connect = + Audio.Core._synth.connect = + Audio.Core._effect.connect = + Audio.Core._bus.connect = + Audio.connect; + + Audio.Core.defineUgenProperty = Audio.defineUgenProperty + + Object.assign( Gibber.Presets, Audio.Synths.Presets ) + Object.assign( Gibber.Presets, Audio.Percussion.Presets ) + Object.assign( Gibber.Presets, Audio.FX.Presets ) + + + $.publish( 'audio.init', Audio ) + if( typeof callback === 'function' ) callback() + + Audio.initialized = true + } + + + Audio.Core._init() + //$.extend( Audio, Audio.Core ) + }, + + Time : { + ms: function( num ) { + return { + mode: 'absolute', + value: (Gibber.Audio.Core.context.sampleRate / 1000) * num, + valueOf: function() { return this.value } + } + }, + seconds: function( num ) { + return { + mode: 'absolute', + value: Gibber.Audio.Core.context.sampleRate * num, + valueOf: function() { return this.value } + } + }, + minutes: function( num ) { + return { + mode: 'absolute', + value: Gibber.Audio.Core.context.sampleRate * 60 * num, + valueOf: function() { return this.value } + } + } + }, + // override for Gibber.Audio.Core method + defineUgenProperty : function(key, initValue, obj) { + var isTimeProp = Audio.Clock.timeProperties.indexOf( key ) > -1, + prop = obj.properties[ key ] = { + value: isTimeProp ? Audio.Clock.time( initValue ) : initValue, + binops: [], + parent : obj, + name : key, + }, + mappingName = key.charAt(0).toUpperCase() + key.slice(1); + + Object.defineProperty(obj, key, { + configurable: true, + get: function() { return prop.value }, + set: function(val) { + if( obj[ mappingName ] && obj[ mappingName ].mapping ) { + if( obj[ mappingName ].mapping.remove ) + obj[ mappingName ].mapping.remove( true ) // pass true to avoid setting property inside of remove method + } + + // if( isTimeProp ) { + // if( typeof val === 'object' && val.mode ==='absolute' ) { // ms, seconds + // prop.value = val.value + // }else{ + // prop.value = Audio.Core.Binops.Mul( Audio.Clock.time( val ), Audio.Core.Binops.Div( 1, Audio.Clock.rate ) ) + // } + // }else{ + // prop.value = val + // } + // + prop.value = isTimeProp ? Audio.Clock.time( val ) : val + + Audio.Core.dirty( obj ) + + return prop.value + }, + }); + + obj[key] = prop.value + }, + + // override for Gibber.Audio method + polyInit : function(ugen) { + ugen.mod = ugen.polyMod; + ugen.removeMod = ugen.removePolyMod; + + for( var key in ugen.polyProperties ) { + (function( _key ) { + var value = ugen.polyProperties[ _key ], + isTimeProp = Audio.Clock.timeProperties.indexOf( _key ) > -1 + + Object.defineProperty(ugen, _key, { + get : function() { return value; }, + set : function( val ) { + for( var i = 0; i < ugen.children.length; i++ ) { + ugen.children[ i ][ _key ] = isTimeProp ? Audio.Clock.time( val ) : val; + } + }, + }); + + })( key ); + } + }, + // override for Gibber.Audio method to use master bus + connect : function( bus, position ) { + if( typeof bus === 'undefined' ) bus = Audio.Master + + if( this.destinations.indexOf( bus ) === -1 ){ + bus.addConnection( this, 1, position ) + if( position !== 0 ) { + this.destinations.push( bus ) + } + } + + return this + }, + clear: function() { + if( Audio.initialized === false ) return + // Audio.analysisUgens.length = 0 + // Audio.sequencers.length = 0 + var args = Array.prototype.slice.call( arguments, 0 ), + scaleSeqIsConnected = false + + if( Gibber.Theory.scale !== undefined ) { + scaleSeqIsConnected = Gibber.Theory.scale.seq.isConnected + } + + + for( var i = 0; i < Audio.Master.inputs.length; i++ ) { + if( args.indexOf( Audio.Master.inputs[ i ].value) === -1 ) { + Audio.Master.inputs[ i ].value.disconnect() + } + } + + Audio.Master.inputs.length = arguments.length + + if( Audio.Clock.shouldResetOnClear !== false ) { + Audio.Clock.reset() + } + + Audio.Master.fx.remove() + + Audio.Master.amp = 1 + + Audio.Core.clear() + + Audio.Clock.seq.connect() + + if( scaleSeqIsConnected ) { + Gibber.Theory.scale = Gibber.scale = Gibber.Audio.Theory.Scale( 'c4','Minor' ) + } + + Audio.Core.out.addConnection( Audio.Master, 1 ); + Audio.Master.destinations.push( Audio.Core.out ); + + console.log( 'Audio stopped.') + }, + ugenTemplate: { + sequencers : [], + mappings: [], + fx: $.extend( [], { + add: function() { + var end = this.length === 0 ? this.ugen : this[ this.length - 1 ] + end.disconnect() + for( var i = 0; i < arguments.length; i++ ) { + var fx = arguments[ i ] + fx.input = end + + end = fx + + this.push( fx ) + } + if( this.ugen !== Audio.Master ) { + end.connect() + }else{ + end.connect( Audio.Core.out ) + } + return this.ugen + }, + + remove: function() { + if( arguments.length > 0 ) { + for( var i = 0; i < arguments.length; i++ ) { + var arg = arguments[ i ]; + + if( typeof arg === 'string' ) { // if identified using the fx name + for( var j = 0; j < this.length; j++ ) { + if( this[ j ].name === arg ) { + this.remove( j ) + } + } + continue; + }else if( typeof arg === 'object' ) { + for( var j = 0; j < this.length; j++ ) { + if( this[ j ] === arg ) { + this.remove( j ) + } + } + continue; + } + + if( typeof arg === 'number' ) { // if identified via position in fx chain + var ugenToRemove = this[ arg ] + ugenToRemove.disconnect() + this.splice( arg, 1 ) + + if( typeof this[ arg ] !== 'undefined') { + + // reset input for current position in chain + var newConnectionNumber = arg - 1 + if( newConnectionNumber !== -1 ) { + this[ arg ].input = this[ newConnectionNumber ] + }else{ + this[ arg ].input = this.ugen + } + + // reset input for next position in chain, or connect to Master bus + if( typeof this[ arg + 1 ] !== 'undefined' ) { // if there is another fx ahead in chain... + this[ arg + 1 ].input = arg === 0 ? this.ugen : this[ arg ] + }else{ + if( this.ugen !== Audio.Master ) { + this.ugen.connect( Audio.Master ) + }else{ + this.ugen.connect( Audio.Core.out ) + } + } + }else{ + if( this.length > 0 ) { // if there is an fx behind in chain + this[ arg - 1 ].connect( Audio.Master ) + }else{ + if( this.ugen !== Audio.Master ) { + this.ugen.connect( Audio.Master ) // no more fx + }else{ + this.ugen.connect( Audio.Core.out ) + } + } + } + } + } + }else{ // remove all fx + if( this.length > 0) { + this[ this.length - 1 ].disconnect() + if( this.ugen !== Audio.Master ) { + this.ugen.connect( Audio.Master ) + }else{ + this.ugen.connect( Audio.Core.out ) + } + this.ugen.codegen() + this.length = 0 + }else{ + console.log( this.ugen.name + ' does not have any fx to remove. ') + } + } + }, + }), + + replaceWith: function( replacement ) { + if( replacement.connect ) { + for( var i = 0; i < this.destinations.length; i++ ) { + replacement.connect( this.destinations[i] ) + } + + for( var i = 0; i < this.sequencers.length; i++ ) { + this.sequencers[ i ].target = replacement + replacement.sequencers.push( this.sequencers[i] ) + } + + for( var i = 0; i < this.mappingObjects.length; i++ ) { + var mapping = this.mappingObjects[ i ] + + if( mapping.targets.length > 0 ) { + for( var j = 0; j < mapping.targets.length; j++ ) { + var _mapping = mapping.targets[ j ] + + if( replacement.mappingProperties[ mapping.name ] ) { + _mapping[ 0 ].mapping.replace( replacement, mapping.name, mapping.Name ) + }else{ // replacement object does not have property that was assigned to mapping + _mapping[ 0 ].mapping.remove() + } + } + } + } + } + + this.kill() + }, + + kill: function() { + var end = this.fx.length !== 0 ? this.fx[ this.fx.length - 1 ] : this + if( this.seq.isRunning ) this.seq.disconnect() + end.disconnect() + + for( var i = 0; i < this.fx.length; i++ ) { + var fx = this.fx[ i ] + if( fx.seq.isRunning ) fx.seq.disconnect() + } + + this.disconnect() + + for( var i = 0; i < this.mappings.length; i++ ) { + this.mappings[ i ].remove() + } + + if( this.clearMarks ) // check required for modulators + this.clearMarks() + + console.log( this.name + " has been terminated.") + }, + + play: function( notes, durations, repeat ) { + if( this.note ) { + this.note.seq( notes, durations ) + }else if( this.frequency ) { + this.frequency.seq( notes, durations ) + } + + return this + }, + + // stop : function() { + // if( this.seq ) this.seq.stop() + // }, + // start : function() { + // if( this.seq ) this.seq.start() + // }, + + fadeIn : function( _time, endLevel ) { + if( isNaN( endLevel ) ) { + endLevel = 1 + } + + var time = Audio.Clock.time( _time ), + decay = new Audio.Core.ExponentialDecay({ decayCoefficient:.05, length:time }), + //ramp = Mul( Sub(1,decay), endLevel ) + line = new Audio.Core.Line( 0, endLevel, time ) + + this.amp = line + + future( function() { this.amp = endLevel }.bind( this ), time) + + return this + }, + + fadeOut : function( _time ) { + var time = Audio.Clock.time( _time ), + curve = Gibber.Audio.Envelopes.Curve( 0, 1, time, .05, .95, false ) + + this.amp = Audio.Core.Binops.Mul( this.amp.oldGetter(), curve ) + + future( function() { this.amp = 0 }.bind( this ), time ) + + return this + }, + fadeOut2 : function( _time ) { + var time = Audio.Clock.time( _time ), + curve = Gibber.Audio.Envelopes.Curve( 0, 1, time, .05, .95, false ) + + this.amp = Audio.Core.Binops.Mul( this.amp.oldGetter(), curve ) + + future( function() { + this.amp = 0 + this.kill() + }.bind( this ), time ) + + return this + }, + } +} + +Audio.Core = require( 'gibberish-dsp' ) +Audio.Core._init = Audio.Core.init.bind( Audio.Core ) +delete Audio.Core.init + +Audio.Clock = require( './audio/clock' )( Gibber ) +Audio.Freesoundjs2 = require( '../external/freesound2' ) +Audio.Freesound = require( './audio/gibber_freesound2' )( Audio.Freesoundjs2 ) +Audio.Seqs = require( './audio/seq')( Gibber ) +Audio.Theory = require( './audio/theory' )( Gibber ) +Audio.FX = require( './audio/fx' )( Gibber ) +Audio.Oscillators = require( './audio/oscillators' )( Gibber ) +Audio.Synths = require( './audio/synths' )( Gibber ) +Audio.Busses = require( './audio/bus' )( Gibber ) +Audio.Analysis = require( './audio/analysis' )( Gibber ) +Audio.Envelopes = require( './audio/envelopes' )( Gibber ) +Audio.Percussion = require( './audio/drums' )( Gibber ) +Audio.Input = require( './audio/audio_input' )( Gibber ) +Audio.Samplers = require( './audio/sampler' )( Gibber ) +// Audio.Speak = require( './audio/speak' )( Gibber ) +Audio.Vocoder = require( './audio/vocoder' )( Gibber ) +Audio.PostProcessing = require( './audio/postprocessing' )( Gibber ) +Audio.Arp = require( './audio/arp' )( Gibber ) +Audio.SoundFont = require( './audio/soundfont' )( Gibber ) +Audio.Score = require( './audio/score' ) +Audio.Ensemble = require( './audio/ensemble' )( Gibber ) +Audio.Ugen = require( './audio/ugen')( Gibber ) +Audio.Additive = require( './audio/additive' ) + +return Audio + +} + +},{"../external/freesound2":"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/external/freesound2.js","./audio/additive":"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/additive.js","./audio/analysis":"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/analysis.js","./audio/arp":"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/arp.js","./audio/audio_input":"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/audio_input.js","./audio/bus":"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/bus.js","./audio/clock":"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/clock.js","./audio/drums":"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/drums.js","./audio/ensemble":"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/ensemble.js","./audio/envelopes":"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/envelopes.js","./audio/fx":"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/fx.js","./audio/gibber_freesound2":"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/gibber_freesound2.js","./audio/oscillators":"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/oscillators.js","./audio/postprocessing":"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/postprocessing.js","./audio/sampler":"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/sampler.js","./audio/score":"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/score.js","./audio/seq":"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/seq.js","./audio/soundfont":"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/soundfont.js","./audio/synths":"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/synths.js","./audio/theory":"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/theory.js","./audio/ugen":"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/ugen.js","./audio/vocoder":"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/vocoder.js","gibberish-dsp":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/gibberish-dsp/build/gibberish.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/additive.js":[function(require,module,exports){ +module.exports = function( Gibber ) { + +/* +XXX = Ugen({ + name:'Vox', + inputs:{ + frequency:{ min:50, max:3000, default:440 }, + amp: { min:0, max:1, default:.1 } + }, + callback: function( frequency, amp ) { + this.out = this.sin( this.PI2 * (this.phase++ * frequency / 44100) ) * amp + + // if stereo, make this.out an array an fill appropriately + // do not create a new array for every sample + return this.out + }, + init: function() { + this.sin = Math.sin + this.PI2 = Math.PI * 2 + this.phase = 0 + this.out = 0 + } +}) +*/ + var Additive = Gibber.Audio.Ugen({ + name:'additive', + inputs: { + frequency:{ min:50, max:3000, default:440 }, + amp: { min:0, max:1, default:.5 } + //pan: { min:0, max:1, default:-1 } + }, + callback: function( frequency, amp, pan ) { + var sines = this.sines, sine, harmonics = this.harmonics + + this.out = 0 + + for( var i = 0, l = sines.length; i < l; i++ ) { + sine = sines[ i ] + this.out += sine( frequency * sine.harmonic, sine.amp ) + // if ( phase++ % 88200 === 0 ) console.log( frequency, sine.amp, this.out ) + } + + return this.out * amp + }, + init: function() { + this.sines = [] + //this.frequency = 440 + //if( typeof this.harmonics === 'undefined' ) this.harmonics = [1,1] + + for( var i = 0, j = 0; i < this.harmonics.length / 2; i++, j+=2 ) { + var harmonicIndex = i * 2 + this.sines[ i ] = Gibber.Audio.Oscillators.Sine(440,1)._.callback + this.sines[ i ].harmonic = this.harmonics[ j ] + this.sines[ i ].amp = this.harmonics[ j + 1 ] + } + + this.out = 0 + console.log( this.sines ) + } + }) + + // return Additive + //} + + return Additive +} + +/*Sine = Ugen({ + name:'Vox', + inputs:{ + frequency:{ min:50, max:3000, default:440 }, + amp: { min:0, max:1, default:.1 } + }, + callback: function( frequency, amp ) { + this.out = this.sin( this.PI2 * (this.phase++ * frequency / 44100) ) * amp + return this.out + }, + init: function() { + this.sin = Math.sin + this.PI2 = Math.PI * 2 + this.phase = 0 + this.out = 0 + } +}) + +Sine.connect() +Sine.frequency.seq( [440,880], 1/2 ) +*/ +},{}],"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/analysis.js":[function(require,module,exports){ +module.exports = function( Gibber ) { + "use strict" + + var fft, + mappingProperties = { + value:{ min: 0, max: 255, output: LOGARITHMIC, wrap:false, timescale: 'graphics' } + }, + Gibberish = require( 'gibberish-dsp' ), + $ = Gibber.dollar, + curves = Gibber.outputCurves, + LINEAR = curves.LINEAR, + LOGARITHMIC = curves.LOGARITHMIC + + var Analysis = { + FFT : function( fftSize, updateRate ) { + if( typeof fft === 'undefined' ) { + fft = Gibberish.context.createAnalyser() + Gibberish.node.connect( fft ) + fft.fftSize = fftSize || 32 + fft.updateRate = updateRate || 40 + + fft.values = new Uint8Array( fft.frequencyBinCount ) + fft.children = [] + + for( var i = 0; i < fft.frequencyBinCount; i++ ) { + !function() { + var num = i, + child = {}, + _value = 0 + + Object.defineProperties( child, { + value: { + configurable:true, + get: function() { return _value }, + set: function(v) { _value = v } + } + }) + + Gibber.createProxyProperties( child, $.extend( {}, mappingProperties) , false ) + fft[ num ] = child + fft.children.push( child ) + + child.type = 'mapping' + child.index = num + child.min = 0; child.max = 255; // needed to map directly to children + + child.valueOf = function() { return this.value.value } + }() + } + + fft.low = { _value:0 }; fft.mid = { _value:0 }; fft.high = { _value:0 } + + var ranges = ['low','mid','high'] + + ranges.forEach( function( v ) { + fft[ v ]._value = 0 + + Object.defineProperty( fft[ v ], 'value', { + configurable:true, + get: function() { return fft[ v ]._value }, + set: function(val) { fft[ v ]._value = val } + }) + + Gibber.createProxyProperties( fft[ v ], $.extend( {}, mappingProperties) , false ) + + fft[ v ].type = 'mapping' + fft[ v ].min = 0; fft[ v ].max = 255; // needed to map directly to children + + fft[ v ].valueOf = function() { return fft[ v ].value } + }) + + + setInterval( function(){ + fft.getByteFrequencyData( fft.values ); + var lowSum = 0, midSum = 0, highSum = 0, lowCount = 0, midCount = 0, highCount = 0; + + // XXX ONLY WORKS FOR DEFAULT FFT WINDOW (32) + for( var i = 0, len = fft.values.length; i < len; i++ ) { + fft[ i ].value = fft.values[ i ] + if( i > 0 ) { + if( i < 3 ) { + lowSum += fft.values[ i ] + lowCount++ + }else if( i < 6 ) { + midSum += fft.values[ i ] + midCount++ + }else{ + highSum += fft.values[ i ] + highCount++ + } + } + } + + fft.low.value = lowSum / lowCount + fft.mid.value = midSum / midCount + fft.high.value = highSum / highCount + + }, fft.updateRate ); + }else{ + if( fftSize ) fft.fftSize = fftSize + if( updateRate ) fft.updateRate = updateRate + } + + return fft + }, + Follow : function( ugen, bufferSize ) { + var follow = new Gibberish.Follow( ugen, bufferSize ), + _mappingProperties = { value: { min: 0, max: 1, output: LOGARITHMIC, timescale: 'audio' } } + + Gibber.createProxyProperties( follow, _mappingProperties ) + + return follow + } + } + + return Analysis + //module.exports = function( __Gibber ) { if( typeof Gibber === 'undefined' ) { Gibber = __Gibber; } return Analysis } + +} + +},{"gibberish-dsp":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/gibberish-dsp/build/gibberish.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/arp.js":[function(require,module,exports){ +module.exports = function( Gibber ) { + +var theory = require('../../external/teoria.min'), + $ = Gibber.dollar, + curves = Gibber.outputCurves, + Seq = require('./seq')( Gibber ).Seq, + Arp + +Arp = function(notation, beats, pattern, mult, scale) { + var that = Seq() + + $.extend( that, { + name : "Arp", + notes : [], + pattern : pattern || "up", + notation : notation || "C4m7", + mult : mult || 1, + init : false, + speed : isNaN(beats) ? 1/4 : beats, + scale : scale || null, + + chord : function(_chord, shouldReset) { + var arr = []; + this.notation = _chord; + + if(typeof this.scale === 'undefined' || this.scale === null && typeof _chord === 'string') { + for(var i = 0; i < this.mult; i++) { + var tmp = []; + + var _root = this.notation.slice(0,1); + var _octave, _quality; + if(isNaN(this.notation.charAt(1))) { // if true, then there is a sharp or flat... + _root += this.notation.charAt(1); // ... so add it to the root name + _octave = parseInt( this.notation.slice(2,3) ); + _quality = this.notation.slice(3); + }else{ + _octave = parseInt( this.notation.slice(1,2) ); + _quality = this.notation.slice(2); + } + _octave += i; + + var _chord = theory.note(_root + _octave).chord(_quality); + for(var j = 0; j < _chord.notes.length; j++) { + var n = _chord.notes[j].fq(); + tmp[j] = n; + } + arr = arr.concat(tmp); + } + + }else{ + for(var i = 0; i < this.mult; i++) { + var tmp = []; + + for(var j = 0; j < this.notation.length; j++) { + tmp[j] = this.notation[j] + (7 * i); + } + arr = arr.concat(tmp); + } + } + this.notes = Gibber.construct( Gibber.Pattern, this.patterns[ this.pattern ]( arr ) ) + + if( this.seqs[0] ) { + this.seqs[0].values = [ this.notes ] + } + }, + + set : function(_chord, _speed, _pattern, octaveMult, shouldReset) { + this.speed = _speed || this.speed; + this.pattern = _pattern || this.pattern; + this.mult = octaveMult || this.mult; + + this.chord(_chord, shouldReset); // also sets sequence + }, + + shuffle: function() { + this.notes.shuffle() + }, + + reset: function() { + this.notes.reset() + }, + + patterns : { + up : function(array) { + return array; + }, + down : function(array) { + return array.reverse(); + }, + updown : function(array) { + var _tmp = array.slice(0); + _tmp.reverse(); + return array.concat(_tmp); + }, + updown2 : function(array) { // do not repeat highest and lowest notes + var _tmp = array.slice(0); + _tmp.pop(); + _tmp.reverse(); + _tmp.pop(); + return array.concat(_tmp); + } + } + }); + + that.seq = that + + // I have no idea why I need this + // that.__shuffle = that.shuffle + // that.shuffle = function() { + // that.__shuffle() + // } + + Gibber.createProxyMethods( that, [ 'shuffle','reset','chord' ] ) + + that.chord( that.notation ); // this sets the initial sequence + + var target = null + Object.defineProperty( that, 'target', { + get: function() { return target }, + set: function(v) { + target = v + var _seq = { + key: 'note', + 'target': target, + values: that.notes, + durations:Gibber.Clock.time( beats ) + } + that.add( _seq ) + that.start() + } + }) + + var speed = beats + Object.defineProperty( that, 'speed', { + get : function() { return speed }, + set : function( v ) { + speed = v + for( var i = 0; i < that.seqs.length; i++ ) { + that.seqs[0].durations = Gibber.Clock.time( speed ) + } + } + }) + + return that; +} + +return Arp + +} +},{"../../external/teoria.min":"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/external/teoria.min.js","./seq":"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/seq.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/audio_input.js":[function(require,module,exports){ +module.exports = function( Gibber ) { + "use strict" + + var Input = {}, + Gibberish = require( 'gibberish-dsp' ), + curves = Gibber.outputCurves, + LINEAR = curves.LINEAR, + LOGARITHMIC = curves.LOGARITHMIC, + mappingProperties = { + amp: { + min: 0, max: 1, + hardMax:2, + output: LOGARITHMIC, + timescale: 'audio', + dimensions:1 + }, + out: { + min: 0, max: 1, + output: LINEAR, + timescale: 'audio', + dimensions:1 + }, + //pan: { min: -1, max: 1, output: LINEAR, timescale: 'audio',}, + }, + name = 'Input' + + Input = function() { + var oscillator = new Gibberish.Input().connect( Gibber.Master ), + args = Array.prototype.slice.call( arguments, 0 ) + + oscillator.type = 'Gen' + $.extend( true, oscillator, Gibber.Audio.ugenTemplate ) + + oscillator.fx.ugen = oscillator + + Object.defineProperty(oscillator, '_', { + get: function() { + oscillator.kill(); + return oscillator + }, + set: function() {} + }) + + Gibber.createProxyProperties( oscillator, mappingProperties ) + + Gibber.processArguments2( oscillator, args, name ) + + oscillator.toString = function() { return '> ' + name } + + return oscillator + } + + return Input +} +},{"gibberish-dsp":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/gibberish-dsp/build/gibberish.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/bus.js":[function(require,module,exports){ +module.exports = function( Gibber ) { + "use strict" + + var $ = Gibber.dollar,//require('zepto-browserify').Zepto, + Gibberish = require( 'gibberish-dsp' ), + curves = Gibber.outputCurves, + LINEAR = curves.LINEAR, + LOGARITHMIC = curves.LOGARITHMIC + + var types = [ + [ 'Bus2', 'Bus' ], + ], + mappingProperties = { + amp: { + min: 0, max: 1, + output: LINEAR, + timescale: 'audio', + }, + pan: { + min: -.75, max: .75, + output: LINEAR, + timescale: 'audio', + }, + out: { min: 0, max: 1, output: LINEAR, timescale: 'audio', dimensions:1 }, + }, + init = false, + Busses = { + 'mappingProperties': mappingProperties, + Presets:{} + } + + for( var i = 0; i < types.length; i++ ) { + + (function() { + var type = Array.isArray( types[ i ] ) ? types[ i ][ 0 ] : types[ i ], + name = Array.isArray( types[ i ] ) ? types[ i ][ 1 ] : types[ i ] + + Busses[ name ] = function() { + var obj = Gibber.processArguments( arguments, name ) + + if( Array.isArray( obj ) ) { + obj.unshift(0) + obj = Gibber.construct( Gibberish[ type ], obj ) + }else{ + obj = new Gibberish[ type ]( obj ) + } + + if(init) { + obj.connect( Master ) + }else{ + init = true; + } + + obj.type = 'Gen' + + Object.defineProperty(obj, '_', { + get: function() { obj.kill(); return obj }, + set: function() {} + }) + + $.extend( true, obj, Gibber.Audio.ugenTemplate ) + + obj.fx.ugen = obj + + Gibber.createProxyProperties( obj, mappingProperties ) + if( obj.presetInit ) obj.presetInit() + return obj + } + })() + } + + Busses[ 'Group' ] = function() { + var obj = Gibber.processArguments( arguments, 'Bus2' ), + inputs = [] + + // if( Array.isArray( obj ) ) { + // if( obj.length > 0 ) { + // inputs = obj.slice( 0 ) + // for( var i = 0; i < inputs.length; i++ ) { + // inputs[ i ].disconnect() + // } + // } + // }else{ + // if( obj ) { + // inputs = obj.inputs || [] + // }else{ + // inputs = [] + // } + // } + + obj = new Gibberish[ 'Bus2' ]() + + if(init) { + obj.connect( Master ) + }else{ + init = true; + } + + obj.type = 'FX' + + $.extend( true, obj, Gibber.Audio.ugenTemplate ) + + obj.fx.ugen = obj + + Gibber.createProxyProperties( obj, mappingProperties ) + + $.extend( obj, { + add : function() { + for( var i = 0; i < arguments.length; i++ ) { + arguments[ i ].disconnect() + arguments[ i ].connect( obj ) + } + }, + remove : function() { + for( var i = 0; i < arguments.length; i++ ) { + arguments[ i ].disconnect( obj ) + } + }, + free : function() { + for( var i = 0; i < arguments.length; i++ ) { + arguments[ i ].disconnect( obj ) + arguments[ i ].connect() + } + } + }) + + for( var i = 0; i < arguments.length; i++ ) { + obj.add( arguments[ i ] ) + } + + return obj + } + + return Busses +} + +},{"gibberish-dsp":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/gibberish-dsp/build/gibberish.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/clock.js":[function(require,module,exports){ +!function() { + +var times = [], + $ = null, + curves = null, + LINEAR = null, + LOGARITHMIC = null, + Gibberish = require( 'gibberish-dsp' ), + Gibber + +var Clock = { + seq : null, + bpm : null, + maxMeasures: 44, + baseBPM : 120, + metronome : null, + currentBeat : 0, + beatsPerMeasure : 4, + codeToExecute : [], + signature: { lower: 4, upper: 4 }, + sequencers:[], + shouldResetOnClear:true, + timeProperties : [ 'attack', 'decay', 'sustain', 'release', 'offset', 'time' ], + phase : 0, + export: function( target ) { + target.beats = Clock.beats + target.Beats = Clock.Beats + target.measures = Clock.measures + target.Measures = Clock.Measures + }, + + processBeat : function() { + Clock.currentBeat = Clock.currentBeat >= Clock.signature.upper ? 1 : Clock.currentBeat + 1 + + if( Clock.currentBeat === 1 && Clock.codeToExecute.length > 0) { + + for( var i = 0; i < Clock.codeToExecute.length; i++ ) { + try { + if( typeof Clock.codeToExecute[ i ].function === 'function' ) { + Clock.codeToExecute[ i ].function() + }else{ + if( Gibber.Environment ) { + Gibber.Environment.modes[ Clock.codeToExecute[ i ].cm.doc.mode.name ].run( Clock.codeToExecute[i].cm.column, Clock.codeToExecute[ i ].code, Clock.codeToExecute[ i ].pos, Clock.codeToExecute[ i ].cm, false ) + }else{ + //Gibber.run( Clock.codeToExecute[ i ].code, Clock.codeToExecute[ i ].pos, Clock.codeToExecute[ i ].cm ) + eval( Clock.codeToExecute[ i ].code ) + } + } + }catch( e ) { + console.error( "FAILED TO EXECUTE CODE:", Clock.codeToExecute[ i ].code , e) + } + } + + Clock.codeToExecute.length = 0 + } + + if( Clock.metronome !== null ) { + Clock.metronome.draw( Clock.currentBeat, Clock.signature.upper ) + } + + Clock.phase += Clock.beats( 1 ) + }, + + getTimeSinceStart : function() { + return Clock.phase + Clock.seq.phase + }, + + reset : function() { + this.phase = 0 + this.currentBeat = 0 + this.rate = 1 + this.start( false ) + }, + + tap : function() { + var time = Gibber.Clock.getTimeSinceStart() + if( times[2] && time - times[2] > 88200 ) { + times.length = 0 + } + times.unshift( time ) + + while( times.length > 3 ) times.pop() + + if( times.length === 3) { + var average = ((times[0] + times[1]) - times[2] * 2) / 3., + bps = 44100 / average, + bpm = bps * 60 + + Gibber.Clock.bpm = bpm + } + }, + + start : function( shouldInit ) { + var _phase = 0 + + if( shouldInit ) { + $.extend( this, { + properties: { rate: 1 }, + name:'master_clock', + callback : function( rate ) { + _phase++ + return rate + } + }) + + this.__proto__ = new Gibberish.ugen() + this.__proto__.init.call( this ) + + var bpm = this.baseBPM + Object.defineProperty(Clock, 'bpm', { + get: function() { return bpm }, + set: function(v) { + bpm = v; + Clock.rate = bpm / Clock.baseBPM + } + }) + + Object.defineProperty(this, 'timeSignature', { + configurable:true, + get: function() { return Clock.signature.upper + '/' + Clock.signature.lower }, + set: function(v) { + var values = v.split('/') + if( values.length === 2 && ( values[0] !== Clock.signature.upper || values[1] !== Clock.signature.lower ) ) { + Clock.signature.upper = parseInt( values[0] ) + Clock.signature.lower = parseInt( values[1] ) + Clock.currentBeat = Clock.currentBeat != 1 ? 0 : 1 + } + } + }) + + Gibber.createProxyProperties( this, { + rate : { min: .1, max: 2, output: LINEAR, timescale: 'audio' }, + bpm : { min: 20, max: 200, output: LINEAR, timescale: 'audio' }, + }) + + this.setPhase = function( v ) { _phase = v } + this.getPhase = function() { return _phase } + + Clock.seq = new Gibberish.PolySeq({ + seqs : [{ + target:Clock, + values: [ Clock.processBeat.bind( Clock ) ], + durations:[ 1/4 ], + }], + rate: Clock, + }) + Gibber.Audio.Seqs.Seq.children.push( Clock.seq ) // needed for Gabber + Clock.seq.connect().start() + Clock.seq.timeModifier = Clock.time.bind( Clock ) + + }else{ + Clock.seq.setPhase(0) + Clock.seq.connect().start() + } + }, + + addMetronome: function( metronome ) { + this.metronome = metronome + this.metronome.init() + }, + + time : function(v) { + var timeInSamples, beat; + + if( v < Clock.maxMeasures ) { + timeInSamples = Clock.beats( v * Clock.signature.lower ) + }else{ + timeInSamples = v + } + return timeInSamples + }, + + Time : function(v) { + var timeFunction, beat; + + if( v < this.maxMeasures ) { + timeFunction = Clock.Beats( v * Clock.signature.lower ) + }else{ + timeFunction = Clock.Beats( v ) + } + + return timeFunction + }, + + beats : function(val) { + var sampleRate = typeof Gibberish.context !== 'undefined' ? Gibberish.context.sampleRate : 44100, + beatsPerSecond = Clock.bpm / 60, + samplesPerBeat = sampleRate / beatsPerSecond + + return samplesPerBeat * val + }, + + Beats : function(val) { + return Clock.beats.bind( null, val ) + }, + + measures: function( val ) { + return Clock.beats( val * Clock.signature.upper ) + }, + + Measures: function( val ) { + return Clock.Beats( val * Clock.signature.upper ) + } +} + +module.exports = function( __Gibber ) { + + "use strict" + Gibber = __Gibber + $ = Gibber.dollar, + curves = Gibber.outputCurves, + LINEAR = curves.LINEAR, + LOGARITHMIC = curves.LOGARITHMIC + + return Clock + +} + +}() +},{"gibberish-dsp":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/gibberish-dsp/build/gibberish.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/drums.js":[function(require,module,exports){ +module.exports = function( Gibber ) { + "use strict" + + var Percussion = { Presets:{} }, + Gibberish = require( 'gibberish-dsp' ), + $ = Gibber.dollar, + Clock = Gibber.Clock, + curves = Gibber.outputCurves, + LINEAR = curves.LINEAR, + LOGARITHMIC = curves.LOGARITHMIC, + types = [ + 'Kick', + 'Snare', + 'Hat', + 'Conga', + 'Cowbell', + 'Clave', + 'Tom', + 'Clap' + ], + _mappingProperties = { + Drums: { + pitch: { min: .25, max: 4, output: LINEAR, timescale: 'audio' }, + amp: { min: 0, max: 1, output: LOGARITHMIC,timescale: 'audio',}, + pan: { min: 0, max: 1, output: LINEAR,timescale: 'audio',}, + out: { min: 0, max: 1, output: LINEAR, timescale: 'audio', dimensions:1 }, + }, + XOX: { + //pitch: { min: .25, max: 4, output: LINEAR, timescale: 'audio' }, + amp: { min: 0, max: 1, output: LOGARITHMIC,timescale: 'audio',}, + pan: { min: 0, max: 1, output: LINEAR,timescale: 'audio',}, + out: { min: 0, max: 1, output: LINEAR, timescale: 'audio', dimensions:1 }, + }, + Kick : { + amp: { min: 0, max: 1, output: LOGARITHMIC,timescale: 'audio',}, + out: { min: 0, max: 1, output: LINEAR, timescale: 'audio', dimensions:1 }, + }, + Snare : { + amp: { min: 0, max: 1, output: LOGARITHMIC, timescale: 'audio' }, + snappy: { min: .25, max: 1.5, output: LOGARITHMIC, timescale: 'audio' }, + tune: { min: 0, max: 2, output: LOGARITHMIC, timescale: 'audio' }, + out: { min: 0, max: 1, output: LINEAR, timescale: 'audio', dimensions:1 }, + }, + Hat : { + amp: { min: 0, max: 1, output: LOGARITHMIC,timescale: 'audio',}, + out: { min: 0, max: 1, output: LINEAR, timescale: 'audio', dimensions:1 }, + }, + Conga : { + amp: { min: 0, max: 1, output: LOGARITHMIC,timescale: 'audio',}, + out: { min: 0, max: 1, output: LINEAR, timescale: 'audio', dimensions:1 }, + }, + Cowbell : { + out: { min: 0, max: 1, output: LINEAR, timescale: 'audio', dimensions:1 }, + amp: { min: 0, max: 1, output: LOGARITHMIC,timescale: 'audio',}, + }, + Clave : { + out: { min: 0, max: 1, output: LINEAR, timescale: 'audio', dimensions:1 }, + amp: { min: 0, max: 1, output: LOGARITHMIC,timescale: 'audio',}, }, + Tom : { + out: { min: 0, max: 1, output: LINEAR, timescale: 'audio', dimensions:1 }, + amp: { min: 0, max: 1, output: LOGARITHMIC,timescale: 'audio',}, + }, + Clap : { + out: { min: 0, max: 1, output: LINEAR, timescale: 'audio', dimensions:1 }, + amp: { min: 0, max: 1, output: LOGARITHMIC,timescale: 'audio',}, + }, + }; + + for( var i = 0; i < types.length; i++ ) { + + (function() { + var type = Array.isArray( types[ i ] ) ? types[ i ][ 0 ] : types[ i ], + name = Array.isArray( types[ i ] ) ? types[ i ][ 1 ] : types[ i ] + + Percussion[ name ] = function() { + var args = Array.prototype.slice.call(arguments), + obj + + if( typeof args[0] === 'object' && typeof args[0].maxVoices === 'undefined') { + args[0].maxVoices = 1 + }else if( typeof args[0] === 'undefined') { + args[0] = { maxVoices:1 } + } + + obj = Gibber.processArguments( args, name ) + + if( Array.isArray( obj ) ) { + obj = Gibber.construct( Gibberish[ type ], obj ).connect( Gibber.Master ) + }else{ + obj = new Gibberish[ type ]( obj ).connect( Gibber.Master ) + } + + obj.type = 'Gen' + + $.extend( true, obj, Gibber.Audio.ugenTemplate ) + + obj.fx.ugen = obj + + // override note method to allow note names + obj._note = obj.note.bind(obj) + obj.note = function() { + var args = Array.prototype.splice.call( arguments, 0 ) + + if( typeof args[0] === 'string' ) { + args[0] = Gibber.Theory.Teoria.note( args[0] ).fq() + } + + this._note.apply( this, args ) + } + + Gibber.createProxyProperties( obj, _mappingProperties[ name ] ) + Gibber.createProxyMethods( obj, [ 'note', 'send' ] ) + + obj.toString = function() { return '> ' + name } + + Object.defineProperty(obj, '_', { + get: function() { obj.kill(); return obj }, + set: function() {} + }) + + return obj + } + })() + + } + + Percussion[ 'Drums' ] = function(_sequence, _timeValue, _amp, _freq){ + var args = Array.prototype.slice.call(arguments), + obj = {}, + props = Gibber.processArguments( args, 'Drums' ) + + if( typeof props === 'undefined' ) props = {} + + $.extend( true, obj, props) + + if( Array.isArray( obj ) ) { + obj = Gibber.construct( Gibberish.Bus2, obj ).connect( Gibber.Master ) + }else{ + obj = new Gibberish.Bus2( obj ).connect( Gibber.Master ) + } + + obj.name = 'Drums' + obj.type = 'Gen' + obj.children = [] + + $.extend( true, obj, Gibber.Audio.ugenTemplate ) + + obj.fx.ugen = obj + + Object.defineProperty(obj, '_', { get: function() { obj.kill(); return obj }, set: function() {} }) + + obj.kit = Percussion.Drums.kits['default']; + + if(typeof arguments[0] === "object") { + if(arguments[0].kit) { + obj.kit = Percussion.Drums.kits[ arguments[ 0 ].kit ]; + arguments[0].kit = obj.kit; + } + } + + for( var key in obj.kit ) { + var drum = obj.kit[ key ], + ugen = drum.file ? { ugen: new Gibberish.Sampler({ file:drum.file, pitch:1, amp:drum.amp }), pitch:drum.pitch, amp:drum.amp } : drum + + if( ugen ) { + if( isNaN( ugen.pitch ) ) ugen.pitch = 1 + if( isNaN( ugen.pan ) ) ugen.pan = 0 + if( isNaN( ugen.amp ) ) ugen.amp = 1 + if( typeof ugen.symbol === 'undefined' ) ugen.symbol = key + + obj[ key ] = ugen + // console.log("KEY", key, ugen, drum, obj[key], obj[key].ugen ) + obj[ key ].ugen.pan = drum.pan + if( !drum.file ) drum.ugen.disconnect() // disconnect non-sampler ugens + obj[ key ].ugen.connect( obj ) + obj[ key ].fx = obj[ key ].ugen.fx + obj.children.push( obj[ key ].ugen ) + } + } + + obj.mod = obj.polyMod + obj.removeMod = obj.removePolyMod + + obj.connect(); + + Gibber.createProxyProperties( obj, _mappingProperties[ 'Drums' ] ) + + obj.note = function(nt) { + // var p = typeof obj.pitch === 'function' ? obj.pitch() : obj.pitch + var p = obj.pitch.value + + if( $.isArray( nt ) ) { + for( var i = 0; i < nt.length; i++ ) { + var note = nt[ i ] + + if( typeof note === 'string' ) { + for( var key in obj.kit ) { + if( note === obj.kit[ key ].symbol ) { + if( obj[ key ].ugen ) { + obj[ key ].ugen.note( p, obj[key].amp ); + } + //var p = p //this.pitch() + // if( this[ key ].sampler.pitch !== p ) + // this[ key ].sampler.pitch = p + break; + } + } + }else{ + var drum = obj[ Object.keys( obj.kit )[ note ] ] + drum.ugen.note( p.value, drum.ugen.amp ) + // if( drum.sampler.pitch !== p ) + // drum.sampler.pitch = p + } + } + }else{ + if( typeof nt === 'string' ) { + for( var key in obj.kit ) { + if( nt === obj.kit[ key ].symbol ) { + //console.log("PITCH", p ) + if( obj[key].file ) { + obj[ key ].ugen.note( p, obj[key].amp ); + obj[ key ].ugen.pitch = p + }else{ + obj[ key ].ugen.note( obj[ key ].pitch, obj[key].amp ); + obj[ key ].ugen.pitch = p + } + //var p = this.pitch.value //this.pitch() + // if( this[ key ].sampler.pitch !== p ) + // this[ key ].sampler.pitch = p + break; + } + } + }else{ + var keys = Object.keys( obj.kit ), + num = Math.abs( nt ), + key = keys[ num % keys.length ], + drum = obj[ key ] + + drum.ugen.note( p, drum.ugen.amp ) + + // if( drum.sampler.pitch !== p ) + // drum.sampler.pitch = p + } + } + } + + Gibber.createProxyMethods( obj, [ 'note' ] ) + + obj.pitch = 1; + + if( $.type( props[0] ) === 'object' ) { props[0] = props[0].note } + + if( typeof props !== 'undefined') { + switch( $.type( props[0] ) ) { + case 'string': + var notes = props[0], _seqs = [], _durations = [], __durations = [], seqs = notes.split('|'), timeline = {} + + for( var i = 0; i < seqs.length; i++ ) { + var seq = seqs[i], duration, hasTime = false, idx = seq.indexOf(',') + + if( idx > -1 ) { + var _value = seq.substr( 0, idx ), + duration = seq.substr( idx + 1 ) + + duration = eval(duration) + hasTime = true + seq = _value.trim().split('') + }else{ + seq = seq.trim().split('') + duration = 1 / seq.length + } + + if( seq.indexOf('.rnd(') > -1) { + // || seq.indexOf('.random(') > -1 ) { + seq = seq.split( '.rnd' )[0] + seq = seq.split('').rnd() + } + + if( typeof props[1] !== 'undefined') { + duration = props[1] + if( !Array.isArray( duration ) ) duration = [ duration ] + + var durationsPattern = Gibber.construct( Gibber.Pattern, duration ) + + if( duration.randomFlag ) { + durationsPattern.filters.push( function() { return [ durationsPattern.values[ rndi(0, durationsPattern.values.length - 1) ], 1 ] } ) + for( var i = 0; i < duration.randomArgs.length; i+=2 ) { + durationsPattern.repeat( duration.randomArgs[ i ], duration.randomArgs[ i + 1 ] ) + } + } + + duration = durationsPattern + } + + obj.note.seq( seq, [duration], i ) + //obj.note.seq( Gibber.construct( Gibber.Pattern, seq ), Gibber.construct( Gibber.Pattern, [duration] ), i ) + } + + break; + case 'object': + if( typeof props[0].note === 'string' ) props[0].note = props[0].note.split("") + props[0].target = obj + props[0].durations = props[0].durations ? Gibber.Clock.Time( props[0].durations ) : Gibber.Clock.Time( 1 / props[0].note.length ) + props[0].offset = props[0].offset ? Gibber.Clock.time( props[0].offset ) : 0 + //obj.seq = Seq( props[0] ); + + break; + + case 'function': case 'array': + var length = props[0].length || props[0].values.length, + durations = typeof arguments[1] !== 'undefined' ? arguments[1] : Gibber.Clock.Time( 1 / length ) + + if( typeof durations !== 'function' ) durations = Gibber.Clock.Time( durations ) + + obj.seq.add({ + key:'note', + values:[ props[0] ], + durations: durations, + target:obj + }) + + obj.pattern = obj.seq.seqs[ obj.seq.seqs.length - 1 ].values[ 0 ] + + break; + default: + break; + } + } + + if( typeof props === "undefined" ) props = {}; + + if( props.pitch ) obj.pitch = props.pitch; + + if( typeof props.snare !== "undefined" ) { $.extend( obj.snare.ugen, props.snare ); $.extend( obj.snare, props.snare); } + if( typeof props.kick !== "undefined" ) { $.extend( obj.kick.ugen, props.kick ); $.extend( obj.kick, props.kick); } + if( typeof props.hat !== "undefined" ) { $.extend( obj.hat.ugen, props.hat ); $.extend( obj.hat, props.hat); } + if( typeof props.openHat !== "undefined" ) { $.extend( obj.openHat.ugen, props.openHat ); $.extend( obj.openHat, props.openHat); } + + obj.amp = isNaN(_amp) ? 1 : _amp; + + if( obj.seq && obj.seq.tick ) { Gibberish.future( obj.seq.tick, 1 ) } + + obj.start = function() { obj.seq.start( true ) } + obj.stop = function() { obj.seq.stop() } + obj.shuffle = function() { obj.note.values.shuffle() } + obj.reset = function() { obj.seq.reset() } + + Gibber.createProxyMethods( obj, [ 'play','stop','shuffle','reset','start','send' ] ) + + //obj.seq.start( true ) + + Object.defineProperties( obj, { + offset: { + get: function() { return obj.seq.offset }, + set: function(v) { obj.seq.offset = Gibber.Clock.time(v)} + } + }) + + //obj.toString = function() { return 'Drums : ' + obj.seq.seqs[0].values.join('') } + + return obj + } + + Percussion[ 'EDrums' ] = function(_sequence, _timeValue, _amp, _freq){ + var args = Array.prototype.slice.call(arguments), + obj = {}, + props = Gibber.processArguments( args, 'Drums' ) + + $.extend( true, obj, props) + + if( Array.isArray( obj ) ) { + obj = Gibber.construct( Gibberish.Bus2, obj ).connect( Gibber.Master ) + }else{ + obj = new Gibberish.Bus2( obj ).connect( Gibber.Master ) + } + + obj.name = 'XOX' + obj.type = 'Gen' + obj.children = [] + + $.extend( true, obj, Gibber.Audio.ugenTemplate ) + + obj.fx.ugen = obj + + Object.defineProperty(obj, '_', { get: function() { obj.kill(); return obj }, set: function() {} }) + + obj.pitch = 1; + + /*obj.kit = Drums.kits['default']; + + if(typeof arguments[0] === "object") { + if(arguments[0].kit) { + obj.kit = Drums.kits[arguments[0].kit]; + arguments[0].kit = obj.kit; + } + }*/ + + // connect in note method + obj.kick = Gibber.Audio.Percussion.Kick().disconnect()//new Gibberish.Kick()//.connect( obj ) + obj.snare = Gibber.Audio.Percussion.Snare().disconnect()//new Gibberish.Snare()//.connect( obj ) + obj.hat = Gibber.Audio.Percussion.Hat().disconnect()//new Gibberish.Hat()//.connect( obj ) + + obj.kick.connect( obj ) + obj.snare.connect( obj ) + obj.hat.connect( obj ) + + obj.children.push( obj.kick, obj.snare, obj.hat ) + + obj.mod = obj.polyMod + obj.removeMod = obj.removePolyMod + + obj.set = function( v ) { obj.seq.note = v.split('') } + + Gibber.createProxyProperties( obj, _mappingProperties[ 'XOX' ] ) + + obj.start = function() { obj.seq.start( true ) } + obj.stop = function() { obj.seq.stop() } + obj.shuffle = function() { obj.seq.shuffle() } + obj.reset = function() { obj.seq.reset() } + + var kcd = 1, + scd = 1, + hcd = 1, + kf = null, + sf = null, + hf = null; + + obj.note = function(nt) { + switch(nt) { + case 'x': + if(kcd === 1) { + //obj.kick.connect( obj ); + kcd = 0; + } + + obj.kick.note(); + + if( kf !== null ) { + kf() + kf = null + } + + kf = Gibber.Utilities.future( function() { + //obj.kick.disconnect() + kcd = 1 + kf = null + }, obj.kick.decay * 110000 ) + + break; + + case 'o': + if(scd === 1) { + //obj.snare.connect( obj ); + scd = 0; + } + + obj.snare.note(); + + if( sf !== null ) { + sf() + sf = null + } + + sf = Gibber.Utilities.future( function() { + //obj.snare.disconnect() + scd = 1 + sf = null + }, obj.snare.decay ) + + break; + case '*': + if(hcd === 1) { + //obj.hat.connect( obj ); + hcd = 0; + } + + obj.hat.note( 5000 ); + + if( hf !== null ) { + hf() + hf = null + } + + hf = Gibber.Utilities.future( function() { + //obj.hat.disconnect() + hcd = 1 + hf = null + }, 5500 ) + + break; + + case '-': + if(hcd === 1) { + //obj.hat.connect( obj ); + hcd = 0; + } + + obj.hat.note( 30000 ); + + if( hf !== null ) { + hf() + hf = null + } + + hf = Gibber.Utilities.future( function() { + //obj.hat.disconnect() + hcd = 1 + hf = null + }, 30500 ) + + break; + } + } + + Gibber.createProxyMethods( obj, [ 'play','stop','shuffle','reset','start','send','note' ] ) + + if( typeof props !== 'undefined') { + switch( $.type( props[0] ) ) { + case 'string': + var notes = props[0], _seqs = [], _durations = [], __durations = [], seqs = notes.split('|'), timeline = {} + + for( var i = 0; i < seqs.length; i++ ) { + var seq = seqs[i], duration, hasTime = false, idx = seq.indexOf(',') + + if( idx > -1 ) { + var _value = seq.substr( 0, idx ), + duration = seq.substr( idx + 1 ) + + duration = eval(duration) + hasTime = true + seq = _value.trim().split('') + }else{ + seq = seq.trim().split('') + duration = 1 / seq.length + } + + if( seq.indexOf('.rnd(') > -1) { + // || seq.indexOf('.random(') > -1 ) { + seq = seq.split( '.rnd' )[0] + seq = seq.split('').rnd() + } + + if( typeof props[1] !== 'undefined') { + duration = props[1] + if( !Array.isArray( duration ) ) duration = [ duration ] + + var durationsPattern = Gibber.construct( Gibber.Pattern, duration ) + + if( duration.randomFlag ) { + durationsPattern.filters.push( function() { return [ durationsPattern.values[ rndi(0, durationsPattern.values.length - 1) ], 1 ] } ) + for( var i = 0; i < duration.randomArgs.length; i+=2 ) { + durationsPattern.repeat( duration.randomArgs[ i ], duration.randomArgs[ i + 1 ] ) + } + } + + duration = durationsPattern + } + + obj.note.seq( Gibber.construct( Gibber.Pattern, seq ), Gibber.construct( Gibber.Pattern, [duration] ), i ) + } + + break; + + break; + case 'object': + if( typeof props[0].note === 'string' ) props[0].note = props[0].note.split("") + props[0].target = obj + props[0].durations = props[0].durations ? Gibber.Clock.Time( props[0].durations ) : Gibber.Clock.Time( 1 / props[0].note.length ) + props[0].offset = props[0].offset ? Gibber.Clock.time( props[0].offset ) : 0 + obj.seq = Seq( props[0] ); + + break; + default: + break; + } + } + + if( typeof props === "undefined" ) props = {}; + + if( props.pitch ) obj.pitch = props.pitch; + + if( typeof props.snare !== "undefined" ) { $.extend( obj.snare.ugen, props.snare ); $.extend( obj.snare, props.snare); } + if( typeof props.kick !== "undefined" ) { $.extend( obj.kick.ugen, props.kick ); $.extend( obj.kick, props.kick); } + if( typeof props.hat !== "undefined" ) { $.extend( obj.hat.ugen, props.hat ); $.extend( obj.hat, props.hat); } + if( typeof props.openHat !== "undefined" ) { $.extend( obj.openHat.ugen, props.openHat ); $.extend( obj.openHat, props.openHat); } + + obj.amp = isNaN(_amp) ? 1 : _amp; + + if( obj.seq.tick ) { Gibberish.future( obj.seq.tick,1 ) } + + // obj.kill = function() { + // var end = this.fx.length !== 0 ? this.fx[ this.fx.length - 1 ] : this + // end.disconnect() + // + // obj.seq.kill() + // } + + obj.seq.start( true ) + + obj.toString = function() { return 'EDrums : ' + obj.seq.seqs[0].values.join('') } + + return obj + } + + // for backwards compatibility + Percussion.XOX = Percussion.EDrums + + Percussion.Drums.kits = { + original: { + kick: { file:"resources/audiofiles/kick.wav", symbol:'x', amp:1, pitch:1, pan:0 }, + snare: { file:"resources/audiofiles/snare.wav", symbol:'o', amp:1, pitch:1, pan:.15 }, + hat: { file:"resources/audiofiles/hat.wav", symbol:'*', amp:1, pitch:1, pan:-.1 }, + openHat: { file:"resources/audiofiles/openHat.wav",symbol:'-', amp:1, pitch:1, pan:-.2 }, + }, + electronic: { + kick: { file:"resources/audiofiles/electronic/kick.wav", symbol:'x', amp:1.5, pitch:1, pan:0 }, + snare: { file:"resources/audiofiles/electronic/snare.wav", symbol:'o', amp:1.5, pitch:1, pan:.15 }, + hat: { file:"resources/audiofiles/electronic/hat.wav", symbol:'*', amp:1.5, pitch:1, pan:-.1 }, + openHat: { file:"resources/audiofiles/electronic/openhat.wav", symbol:'-', amp:1.5, pitch:1, pan:-.2 }, + }, + beatbox: { + in_tss: { file:'resources/audiofiles/beatbox/^tss.wav' , symbol:'T', amp:1, pitch:1, pan: 0.1 }, + f: { file:'resources/audiofiles/beatbox/f.wav' , symbol:'f', amp:1, pitch:1, pan:-0.1 }, + h: { file:'resources/audiofiles/beatbox/h.wav' , symbol:'h', amp:1, pitch:1, pan: 0.1 }, + s: { file:'resources/audiofiles/beatbox/s.wav' , symbol:'s', amp:1, pitch:1, pan:-0.1 }, + + d: { file:'resources/audiofiles/beatbox/d.wav' , symbol:'d', amp:1, pitch:1, pan: 0.8 }, + t: { file:'resources/audiofiles/beatbox/t.wav' , symbol:'t', amp:1, pitch:1, pan: 0.4 }, + k: { file:'resources/audiofiles/beatbox/k.wav' , symbol:'k', amp:1, pitch:1, pan:-0.1 }, + in_k: { file:'resources/audiofiles/beatbox/^k.wav' , symbol:'K', amp:1, pitch:1, pan:-0.4 }, + eight: { file:'resources/audiofiles/beatbox/8.wav' , symbol:'8', amp:1, pitch:1, pan:-0.8 }, + + psh: { file:'resources/audiofiles/beatbox/psh.wav' , symbol:'p', amp:1, pitch:1, pan: 0.1 }, + in_p: { file:'resources/audiofiles/beatbox/^p.wav' , symbol:'P', amp:1, pitch:1, pan:-0.1 }, + pf: { file:'resources/audiofiles/beatbox/pf.wav' , symbol:'F', amp:1, pitch:1, pan: 0.2 }, + phs: { file:'resources/audiofiles/beatbox/phs.wav' , symbol:'H', amp:1, pitch:1, pan:-0.2 }, + + b: { file:'resources/audiofiles/beatbox/b.wav' , symbol:'b', amp:1, pitch:1, pan: 0.3 }, + dot: { file:'resources/audiofiles/beatbox/dot.wav' , symbol:'.', amp:1, pitch:1, pan: 0.0 }, + duf: { file:'resources/audiofiles/beatbox/duf.wav' , symbol:'D', amp:1, pitch:1, pan:-0.3 }, + + o: { file:'resources/audiofiles/beatbox/o.wav' , symbol:'o', amp:1, pitch:1, pan: 0.6 }, + a: { file:'resources/audiofiles/beatbox/a.wav' , symbol:'a', amp:1, pitch:1, pan: 0.8 }, + u: { file:'resources/audiofiles/beatbox/u.wav' , symbol:'u', amp:1, pitch:1, pan:-0.8 }, + + m: { file:'resources/audiofiles/beatbox/m.wav' , symbol:'m', amp:1, pitch:1, pan:-0.6 }, + n: { file:'resources/audiofiles/beatbox/n.wav' , symbol:'n', amp:1, pitch:1, pan: 0.0 }, + }, + }; + Percussion.Drums.kits.default = Percussion.Drums.kits.electronic; + + Percussion.Drums.makeKit = function( name, kit ) { + Percussion.Drums.kits[ name ] = kit + } + + Percussion.Presets.Kick = { + short: { decay:.1, amp:.75 } + } + Percussion.Presets.Snare = { + crack: { snappy:1, offset:1/4 } + } + + return Percussion + +} + +},{"gibberish-dsp":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/gibberish-dsp/build/gibberish.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/ensemble.js":[function(require,module,exports){ +module.exports = function( Gibber ) { + "use strict" + + var Gibberish = require( 'gibberish-dsp' ), + $ = Gibber.dollar, + Clock = Gibber.Clock, + curves = Gibber.outputCurves, + LINEAR = curves.LINEAR, + LOGARITHMIC = curves.LOGARITHMIC, + mappingProperties = { + amp: { + min: 0, max: 1, + output: LINEAR, + timescale: 'audio', + }, + pan: { + min: -.75, max: .75, + output: LINEAR, + timescale: 'audio', + }, + out: { min: 0, max: 1, output: LINEAR, timescale: 'audio', dimensions:1 }, + } + + var Ensemble = function( props ) { + var obj = new Gibberish.Bus2( obj ).connect( Gibber.Master ) + + obj.name = 'Ensemble' + obj.type = 'Gen' + obj.children = [] + + $.extend( true, obj, Gibber.Audio.ugenTemplate ) + + obj.fx.ugen = obj + + Object.defineProperty(obj, '_', { get: function() { obj.kill(); return obj }, set: function() {} }) + + Gibber.createProxyProperties( obj, mappingProperties ) + + for(var key in props) { + var ugenDesc = props[key], + ugen = ugenDesc.file ? { ugen: new Gibberish.Sampler({ file:ugenDesc.file, pitch:1, amp:ugenDesc.amp }), pitch:ugenDesc.pitch, amp:ugenDesc.amp } : ugenDesc + + if( ugen ) { + if( isNaN( ugen.pitch ) ) ugen.pitch = 1 + if( isNaN( ugen.pan ) ) ugen.pan = 0 + if( isNaN( ugen.amp ) ) ugen.amp = 1 + if( typeof ugen.symbol === 'undefined' ) ugen.symbol = key + + obj[key] = ugen + // console.log("KEY", key, ugen, drum, obj[key], obj[key].ugen ) + obj[key].ugen.pan = ugen.pan + if( !ugenDesc.file ) ugen.ugen.disconnect() // disconnect non-sampler ugens + obj[key].ugen.connect( obj ) + obj[key].fx = obj[key].ugen.fx + obj.children.push( obj[key].ugen ) + } + } + + obj.note = function(nt) { + // var p = typeof obj.pitch === 'function' ? obj.pitch() : obj.pitch + var p = obj.pitch + if( typeof nt === 'string' ) { + for( var key in props ) { + var ugen = props[ key ] + if( nt === ugen.symbol ) { + if( ugen.file ) { + ugen.ugen.note( p, obj[key].amp ); + }else{ + ugen.ugen.note( ugen.pitch * p, ugen.amp ); + } + + break; + } + } + }else{ + var keys = Object.keys( obj.kit ), + num = Math.abs( nt ), + key = keys[ num % keys.length ], + ugen = obj[ key ] + + ugen.ugen.note( p, ugen.ugen.amp ) + } + } + + var seqNumber + obj.play = function( pattern ) { + var notes = pattern, _seqs = [], _durations = [], __durations = [], seqs = notes.split('|'), timeline = {} + + for(var i = 0; i < obj.seq.seqs.length; i++ ) { + obj.seq.seqs[i].shouldStop = true + } + obj.seq.seqs.length = 0 + + for( var i = 0; i < seqs.length; i++ ) { + var seq = seqs[i], duration, hasTime = false, idx = seq.indexOf(',') + + if( idx > -1 ) { + var _value = seq.substr( 0, idx ), + duration = seq.substr( idx + 1 ) + + duration = eval(duration) + hasTime = true + seq = _value.trim().split('') + }else{ + seq = seq.trim().split('') + duration = 1 / seq.length + } + + if( seq.indexOf('.rnd(') > -1) {// || seq.indexOf('.random(') > -1 ) { + seq = seq.split( '.rnd' )[0] + seq = seq.split('').rnd() + } + + if( typeof arguments[1] !== 'undefined') { + duration = arguments[1] + if( !Array.isArray( duration ) ) duration = [ duration ] + + var durationsPattern = Gibber.construct( Gibber.Pattern, duration ) + + if( duration.randomFlag ) { + durationsPattern.filters.push( function() { return [ durationsPattern.values[ rndi(0, durationsPattern.values.length - 1) ], 1 ] } ) + for( var i = 0; i < duration.randomArgs.length; i+=2 ) { + durationsPattern.repeat( duration.randomArgs[ i ], duration.randomArgs[ i + 1 ] ) + } + } + + duration = durationsPattern + } + + obj.seq.add({ + key:'note', + values: Gibber.construct( Gibber.Pattern, seq ), + durations: Gibber.construct( Gibber.Pattern, [duration] ), + target:obj + }) + + seqNumber = obj.seq.seqs.length - 1 + Object.defineProperties( obj.note, { + values: { + configurable:true, + get: function() { return obj.seq.seqs[ seqNumber ].values }, + set: function( val ) { + var pattern = Gibber.construct( Gibber.Pattern, val ) + + if( !Array.isArray( pattern ) ) { + pattern = [ pattern ] + } + // if( key === 'note' && obj.seq.scale ) { + // v = makeNoteFunction( v, obj.seq ) + // } + //console.log("NEW VALUES", v ) + obj.seq.seqs[ seqNumber ].values = pattern + } + }, + durations: { + configurable:true, + get: function() { return obj.seq.seqs[ seqNumber ].durations }, + set: function( val ) { + if( !Array.isArray( val ) ) { + val = [ val ] + } + obj.seq.seqs[ seqNumber ].durations = val //.splice( 0, 10000, v ) + } + }, + }) + } + } + + obj.pitch = 1; + + obj.seq.start() + obj.connect() + + return obj + } + + return Ensemble +} +},{"gibberish-dsp":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/gibberish-dsp/build/gibberish.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/envelopes.js":[function(require,module,exports){ +module.exports = function( Gibber ) { + "use strict" + + var Envelopes = {}, + Gibberish = require( 'gibberish-dsp' ), + $ = Gibber.dollar, + Clock = Gibber.Clock, + curves = Gibber.outputCurves, + LINEAR = curves.LINEAR, + LOGARITHMIC = curves.LOGARITHMIC, + types = [ + 'Curve', + 'Line', + 'Ease', + 'Lines', + 'AD', + 'ADSR' + ], + _mappingProperties = { + Line: { + start: { + min: 0, max: 1, + output: LINEAR, + timescale: 'audio', + }, + end: { + min: 0, max: 1, + output: LINEAR, + timescale: 'audio', + }, + time: { + min: 0, max: 8, + output: LINEAR, + timescale: 'audio', + } + }, + Lines: { + time: { + min: 0, max: 8, + output: LINEAR, + timescale: 'audio', + } + }, + Ease: { + /*start: { + min: 0, max: 1, + output: LINEAR, + timescale: 'audio', + }, + end: { + min: 0, max: 1, + output: LINEAR, + timescale: 'audio', + }, + time: { + min: 0, max: 8, + output: LINEAR, + timescale: 'audio', + },*/ + }, + Curve: { + start: { + min: 0, max: 1, + output: LINEAR, + timescale: 'audio', + }, + end: { + min: 0, max: 1, + output: LINEAR, + timescale: 'audio', + }, + time: { + min: 0, max: 8, + output: LINEAR, + timescale: 'audio', + }, + a: { + min: 0, max: 1, + output: LINEAR, + timescale: 'audio', + }, + b: { + min: 0, max: 1, + output: LINEAR, + timescale: 'audio', + }, + }, + AD: { + attack: { + min: 0, max: 8, + output: LINEAR, + timescale: 'audio', + }, + decay: { + min: 0, max: 8, + output: LINEAR, + timescale: 'audio', + }, + }, + ADSR: { + attack: { + min: 0, max: 8, + output: LINEAR, + timescale: 'audio', + }, + decay: { + min: 0, max: 8, + output: LINEAR, + timescale: 'audio', + }, + sustain: { + min: 0, max: 8, + output: LINEAR, + timescale: 'audio', + }, + release: { + min: 0, max: 8, + output: LINEAR, + timescale: 'audio', + } + }, + }; + + for( var i = 0; i < types.length; i++ ) { + + (function() { + var type = Array.isArray( types[ i ] ) ? types[ i ][ 0 ] : types[ i ], + name = Array.isArray( types[ i ] ) ? types[ i ][ 1 ] : types[ i ] + + Envelopes[ name ] = function() { + var args = Array.prototype.slice.call(arguments, 0), + obj + + if( typeof args[0] !== 'object' ) { + // console.log( args[0], args[1], args[2], Gibber.Clock.time( args[2] ) ) + obj = new Gibberish[ type ]( args[0], args[1], Gibber.Clock.time( args[2] ), args[3], args[4], args[5], args[6] ) + }else if( name === 'Lines' ){ + obj = new Gibberish.Lines( args[0], args[1], args[2] ) + }else if( name === 'Ease' ){ + obj = new Gibberish.Ease( args[0], args[1], args[2], args[3], args[4] ) + }else if( name === 'Curve' ){ // not needed? + obj = new Gibberish.Curve( args[0], args[1], args[2], args[3], args[4], args[5], args[6] ) + }else{ + obj = Gibber.construct( Gibberish[ type ], args[0] ) + } + //obj.type = 'Env' + obj.name = name + + $.extend( true, obj, Gibber.Audio.ugenTemplate ) + + Gibber.createProxyProperties( obj, _mappingProperties[ name ] ) + + if( name !== 'Lines' ) Gibber.processArguments2( obj, args, obj.name ) + + if( name === '.' || name === 'ADSR' ) { + Gibber.createProxyMethods( obj, ['run'] ) + } + + console.log( name + ' is created.' ) + return obj + } + })() + } + + return Envelopes + +} + +},{"gibberish-dsp":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/gibberish-dsp/build/gibberish.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/fx.js":[function(require,module,exports){ +module.exports = function( Gibber ) { + "use strict" + + var FX = { Presets: {} }, + Gibberish = require( 'gibberish-dsp' ), + $ = Gibber.dollar, + curves = Gibber.outputCurves, + LINEAR = curves.LINEAR, + LOGARITHMIC = curves.LOGARITHMIC + + // TODO: should this be completely moved into Gibberish? Is it useful inside there instead of just using Mul? + Gibberish.Gain = function() { + Gibberish.extend(this, { + name: 'gain', + type: 'effect', + + properties : { + input : 0, + amount : 1, + }, + + callback : function(input, amount) { + if( typeof input === 'object' ) { + input[0] *= amount + input[1] *= amount + }else{ + input *= amount + } + + return input; + } + }) + .init() + .processProperties(arguments); + }; + Gibberish.Gain.prototype = Gibberish._effect; + + var types = [ + 'Reverb', + ['StereoReverb', 'StereoVerb'], + 'Delay', + 'Flanger', + 'Vibrato', + 'Distortion', + 'Biquad', + 'Gain', + 'Filter24', + [ 'RingModulation', 'RingMod' ], + [ 'BufferShuffler', 'Schizo' ], + [ 'Decimator', 'Crush' ], + 'Tremolo', + ], + _mappingProperties = { + Reverb: { + roomSize: { + min: .5, max: .995, + output: LINEAR, + timescale: 'audio', + }, + damping: { + min: 0, max: 1, + output: LINEAR, + timescale: 'audio', + }, + out: { min: 0, max: 1, output: LINEAR, timescale: 'audio', dimensions:1 }, + }, + StereoReverb: { + roomSize: { + min: .5, max: .995, + output: LINEAR, + timescale: 'audio', + }, + damping: { + min: 0, max: 1, + output: LINEAR, + timescale: 'audio', + }, + out: { min: 0, max: 1, output: LINEAR, timescale: 'audio', dimensions:1 }, + }, + Delay : { + feedback: { + min: 0, max: 1, + output: LINEAR, + timescale: 'audio', + }, + time : { + min: 50, max: 88200, // TODO: Fix... problem with loading order, should be : Gibberish.context.sampleRate * 2, + output: LINEAR, + timescale: 'audio', + }, + out: { min: 0, max: 1, output: LINEAR, timescale: 'audio', dimensions:1 }, + }, + RingMod : { + frequency : { + min: 20, max: 3000, + output: LINEAR, + timescale: 'audio', + }, + amp: { + min: 0, max: 1, + output: LINEAR, + timescale: 'audio', + }, + mix: { + min: 0, max: 1, + output: LINEAR, + timescale: 'audio', + }, + out: { min: 0, max: 1, output: LINEAR, timescale: 'audio', dimensions:1 }, + }, + Flanger : { + rate : { + min: .01, max: 20, + output: LOGARITHMIC, + timescale: 'audio', + }, + feedback: { + min: 0, max: .99, + output: LINEAR, + timescale: 'audio', + }, + amount: { + min: 25, max: 300, + output: LINEAR, + timescale: 'audio', + }, + out: { min: 0, max: 1, output: LINEAR, timescale: 'audio', dimensions:1 }, + }, + Gain : { + amount: { + min: 0, max: 1, + output: LINEAR, + timescale: 'audio', + }, + }, + Vibrato : { + rate : { + min: .2, max: 8, + output: LOGARITHMIC, + timescale: 'audio', + }, + amount: { + min: 25, max: 300, + output: LINEAR, + timescale: 'audio', + }, + feedback: { + min: .45, max: .55, + output: LINEAR, + timescale: 'audio', + }, + out: { min: 0, max: 1, output: LINEAR, timescale: 'audio', dimensions:1 }, + }, + Filter24 : { + cutoff : { + min: 0, max: .7, + output: LINEAR, + timescale: 'audio', + }, + resonance: { + min: 0, max: 5.5, + output: LINEAR, + timescale: 'audio', + }, + out: { min: 0, max: 1, output: LINEAR, timescale: 'audio', dimensions:1 }, + }, + LPF : { + cutoff : { + min: 0.05, max: .7, + output: LINEAR, + timescale: 'audio', + }, + resonance: { + min: 0, max: 5.5, + output: LINEAR, + timescale: 'audio', + }, + out: { min: 0, max: 1, output: LINEAR, timescale: 'audio', dimensions:1 }, + }, + HPF : { + cutoff : { + min: 0, max: .7, + output: LINEAR, + timescale: 'audio', + }, + resonance: { + min: 0, max: 5.5, + output: LINEAR, + timescale: 'audio', + }, + out: { min: 0, max: 1, output: LINEAR, timescale: 'audio', dimensions:1 }, + }, + Crush : { + bitDepth : { + min: 1, max: 16, + output: LINEAR, + timescale: 'audio', + }, + sampleRate: { + min: 0, max: 1, + output: LINEAR, + timescale: 'audio', + }, + amp: { + min: 0, max: 1, + output: LOGARITHMIC, + timescale: 'audio', + }, + out: { min: 0, max: 1, output: LINEAR, timescale: 'audio', dimensions:1 }, + }, + Schizo: { + amp: { + min: 0, max: 1, + output: LOGARITHMIC, + timescale: 'audio', + }, + out: { min: 0, max: 1, output: LINEAR, timescale: 'audio', dimensions:1 }, + }, + Tremolo: { + amp: { + min: 0, max: 1, + output: LOGARITHMIC, + timescale: 'audio', + }, + frequency : { + min: .05, max: 20, + output: LOGARITHMIC, + timescale: 'audio', + }, + out: { min: 0, max: 1, output: LINEAR, timescale: 'audio', dimensions:1 }, + } + }; + + for( var i = 0; i < types.length; i++ ) { + + (function() { + var type = Array.isArray( types[ i ] ) ? types[ i ][ 0 ] : types[ i ], + name = Array.isArray( types[ i ] ) ? types[ i ][ 1 ] : types[ i ] + + FX[ name ] = function() { + var args = Array.prototype.slice.call(arguments, 0), + obj + + obj = new Gibberish[ type ]() + obj.type = 'FX' + obj.name = name + + $.extend( true, obj, Gibber.Audio.ugenTemplate ) + + Gibber.createProxyProperties( obj, _mappingProperties[ name ] ) + + Gibber.createProxyMethods( obj, [ 'send' ] ) + + Gibber.processArguments2( obj, args, obj.name ) + + if( name === 'Delay' ) obj.rate = Gibber.Clock + + args.input = 0 + + obj.toString = function() { return '> ' + name } + + if( obj.presetInit ) obj.presetInit() + return obj + } + })() + } + + FX.Chorus = function( rate, feedback, amount ) { + var _rate = rate || 1, + _amount = amount || ms( 1 ), + _feedback = feedback || 0, + that = Flanger( _rate, _feedback, _amount, ms( 1 ) * 30 ) + + that.name = 'Chorus' + that.type = 'FX' + + return that + } + + FX.LPF = function( cutoff, resonance ) { + var _cutoff = isNaN(cutoff) ? .2 : cutoff, + _resonance = isNaN( resonance ) ? 3.5 : resonance, + that = Filter24( _cutoff, _resonance, true ) + + that.name = 'LPF' + that.type = 'FX' + + return that + } + + FX.HPF = function( cutoff, resonance ) { + var _cutoff = isNaN( cutoff ) ? .25 : cutoff, + _resonance = isNaN( resonance ) ? 3.5 : resonance, + that = Filter24( _cutoff, _resonance, true ) + + that.isLowPass = false + that.name = 'HPF' + that.type = 'FX' + + return that + } + + FX.Presets.Schizo = { + sane: { + chance: .1, + reverseChance: 0, + pitchChance: .5, + mix:.5, + }, + borderline: { + chance: .1, + pitchChance: .25, + reverseChance: .5, + mix: 1, + }, + paranoid: { + chance: .2, + reverseChance: .5, + pitchChance: .5, + mix: 1, + }, + }; + + FX.Presets.Reverb = { + space : { + roomSize: .99, + damping: .23, + wet: .75, + dry: .25, + }, + small : { + roomSize: .6, + damping: .75, + wet: .15, + dry: .85, + }, + medium: { + roomSize: .8, + damping: .5, + wet: .35, + dry: .65, + }, + large: { + roomSize: .85, + damping: .3, + wet: .55, + dry: .45, + } + } + + FX.Presets.StereoVerb = { + space : { + roomSize: .99, + damping: .23, + wet: .75, + dry: .25, + }, + small : { + roomSize: .6, + damping: .75, + wet: .15, + dry: .85, + }, + medium: { + roomSize: .8, + damping: .5, + wet: .35, + dry: .65, + }, + large: { + roomSize: .85, + damping: .3, + wet: .55, + dry: .45, + } + } + + FX.Presets.Crush = { + clean: { + sampleRate:1, + bitDepth:16 + }, + dirty:{ + sampleRate:.25, + bitDepth:4 + }, + filthy:{ + sampleRate:.1, + bitDepth:2.5 + } + } + + return FX +} +},{"gibberish-dsp":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/gibberish-dsp/build/gibberish.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/gibber_freesound2.js":[function(require,module,exports){ +module.exports = function( freesound ) { + freesound.setToken('6a00f80ba02b2755a044cc4ef004febfc4ccd476') + + var Freesound = function() { + var sampler = Sampler(); + + var key = arguments[0] || 96541; + var callback = null; + var filename, request; + + sampler.done = function(func) { + callback = func + } + + var onload = function(request) { + Gibber.log('Freesound file ' + filename + " loaded." ) + Gibber.Audio.Core.context.decodeAudioData(request.response, function(buffer) { + Freesound.loaded[filename] = buffer.getChannelData(0) + sampler.buffer = Freesound.loaded[filename]; + sampler.bufferLength = sampler.buffer.length; + sampler.isLoaded = true; + //sampler.end = sampler.bufferLength; + sampler.setBuffer(sampler.buffer); + sampler.setPhase(sampler.bufferLength); + sampler.filename = filename; + sampler.length = sampler.bufferLength; + //self.setPhase( self.length ) + //self.setBuffer( buffer ) + sampler.isPlaying = true; + //self.buffers[ filename ] = buffer; + Gibber.Audio.Core.audioFiles[sampler.filename] = buffer; + sampler.buffers[ sampler.filename ] = buffer; // + sampler.file = filename + sampler.send( Master, 1 ) + if (callback) { + callback() + } + }, function(e) { + console.log("Error with decoding audio data" + e.err) + }) + } + + // freesound query api http://www.freesound.org/docs/api/resources.html + if (typeof key === 'string') { + var query = key; + Gibber.log('searching freesound for ' + query) + // textSearch: function(query, options, success, error){ + // search: function(query, page, filter, sort, num_results, fields, sounds_per_page, success, error + //freesound.search(query, /*page*/ 0, 'duration:[0.0 TO 10.0]', 'rating_desc', null, null, null, + freesound.textSearch( query, { page:1 },// page:0, filter: 'duration:[0.0 TO 10.0]', sort:'rating_desc' }, + function(sounds) { + //console.log("SOUNDS", typeof sounds, sounds ) + sounds = JSON.parse( sounds ) + filename = sounds.results[0].name + var id = sounds.results[0].id + + if (typeof Freesound.loaded[filename] === 'undefined') { + + freesound.getSound( id, function( val ){ + var request = new XMLHttpRequest(), + dict = JSON.parse( val ), + path = dict.previews['preview-hq-mp3'] + + //Gibber.log("now downloading " + filename + ", " + sounds.sounds[0].duration + " seconds in length") + request.open('GET', path, true) //"?&api_key=" + freesound.apiKey, true); + request.responseType = 'arraybuffer'; + //request.withCredentials = true; + request.onload = function( v ) { + onload(request) + }; + request.send(); + + console.log( 'freesound path:', path, request ) + }, null ) + } else { + sampler.buffer = Freesound.loaded[filename]; + sampler.filename = filename; + sampler.bufferLength = sampler.buffer.length; + sampler.isLoaded = true; + sampler.end = sampler.bufferLength; + sampler.setBuffer(sampler.buffer); + sampler.setPhase(sampler.bufferLength); + + sampler.send(Master, 1) + if (callback) { + callback() + } + } + }, function() { + displayError("Error while searching...") + } + ); + } else if (typeof key === 'object') { + var query = key.query, + filter = key.filter || "", + sort = key.sort || 'rating_desc', + page = key.page || 0; + + pick = key.pick || 0 + + Gibber.log( 'Searching freesound for ' + query ) + + filter += ' duration:[0.0 TO 10.0]' + freesound.textSearch(query, null, + function( soundsJSON ) { + var soundsDict = JSON.parse( soundsJSON ) + if (soundsDict.count > 0) { + var num = 0; + + if (typeof key.pick === 'number') { + num = key.pick + } else if (typeof key.pick === 'function') { + num = key.pick(); + } else if (key.pick === 'random') { + num = rndi(0, soundsDict.results.length - 1); + } + + var result = soundsDict.results[ num ] + filename = result.name + var id = result.id + + if (typeof Freesound.loaded[filename] === 'undefined') { + if (typeof Freesound.loaded[filename] === 'undefined') { + + freesound.getSound( id, function( val ){ + var request = new XMLHttpRequest(), + dict = JSON.parse( val ), + path = dict.previews['preview-hq-mp3'] + + request.open('GET', path, true) //"?&api_key=" + freesound.apiKey, true); + request.responseType = 'arraybuffer'; + request.onload = function( v ) { + onload(request) + }; + request.send(); + }, null ) + } else { + sampler.buffer = Freesound.loaded[filename]; + sampler.filename = filename; + sampler.bufferLength = sampler.buffer.length; + sampler.isLoaded = true; + sampler.end = sampler.bufferLength; + sampler.setBuffer(sampler.buffer); + sampler.setPhase(sampler.bufferLength); + + sampler.send(Master, 1) + if (callback) { + callback() + } + } + } else { + Gibber.log('using exising loaded sample ' + filename) + sampler.buffer = Freesound.loaded[filename]; + sampler.bufferLength = sampler.buffer.length; + sampler.isLoaded = true; + sampler.end = sampler.bufferLength; + sampler.setBuffer(sampler.buffer); + sampler.setPhase(sampler.bufferLength); + + sampler.send(Master, 1) + if (callback) { + callback() + } + } + } else { + Gibber.log("No Freesound files matched your query.") + } + }, function() { + console.log("Error while searching...") + } + ); + } else if (typeof key === 'number') { + Gibber.log( 'Searching for and downloading sound #' + key + ' from Freesound...' ) + var id = filename = key + //Freesound.getSoundByID( key ) + if (typeof Freesound.loaded[filename] === 'undefined') { + + freesound.getSound( id, function( val ){ + var request = new XMLHttpRequest(), + dict = JSON.parse( val ), + path = dict.previews['preview-hq-mp3'] + + + request.open('GET', path, true) //"?&api_key=" + freesound.apiKey, true); + request.responseType = 'arraybuffer'; + + request.onload = function( v ) { + onload(request) + }; + request.send(); + }, null ) + } else { + sampler.buffer = Freesound.loaded[filename]; + sampler.filename = filename; + sampler.bufferLength = sampler.buffer.length; + sampler.isLoaded = true; + sampler.end = sampler.bufferLength; + sampler.setBuffer(sampler.buffer); + sampler.setPhase(sampler.bufferLength); + + sampler.send(Master, 1) + if (callback) { + callback() + } + } + } + return sampler; + } + Freesound.getSoundByID = function( id ){ + Gibber.log('downloading sound #' + id + ' from freesound.org') + freesound.getSound( id, + function( soundJSON ) { + var soundDict = JSON.parse( soundJSON ), + path = soundDict.previews['preview-hq-mp3'] + + filename = soundDict.name + + request = new XMLHttpRequest(); + request.open('GET', path, true); + request.responseType = 'arraybuffer'; + request.onload = function() { + onload(request) + }; + request.send(); + }, + function( err ) { console.log( 'ERROR with id', err ) } + ) + + } + Freesound.loaded = {}; + + return Freesound +} + +},{}],"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/oscillators.js":[function(require,module,exports){ +module.exports = function( Gibber ) { + "use strict" + + var $ = Gibber.dollar, + Oscillators = { Presets: {} }, + Gibberish = require( 'gibberish-dsp' ), + curves = Gibber.outputCurves, + LINEAR = curves.LINEAR, + LOGARITHMIC = curves.LOGARITHMIC + + var types = [ + 'Sine', + 'Triangle', + 'Saw', + 'Square', + 'Noise', + 'PWM', + ], + mappingProperties = { + frequency: { + min: 50, max: 3200, + hardMin:.01, hardMax:22050, + output: LOGARITHMIC, + timescale: 'audio', + dimensions:1 + }, + amp: { + min: 0, max: 1, + hardMax:2, + output: LOGARITHMIC, + timescale: 'audio', + dimensions:1 + }, + pulsewidth : { + min: 0.01, max: .99, + output: LINEAR, + timescale: 'audio', + dimensions:1 + }, + out: { + min: 0, max: 1, + output: LINEAR, + timescale: 'audio', + dimensions:1 + }, + pan: { min: -1, max: 1, output: LOGARITHMIC, timescale: 'audio',}, + note: { + min: 50, max: 3200, + hardMin:.01, hardMax:22050, + output: LOGARITHMIC, + timescale: 'audio', + doNotProxy:true + }, + } + + for( var i = 0; i < types.length; i++ ) { + !function() { + var type = Array.isArray( types[ i ] ) ? types[ i ][ 0 ] : types[ i ], + name = Array.isArray( types[ i ] ) ? types[ i ][ 1 ] : types[ i ] + + Oscillators[ name ] = function() { + var oscillator = new Gibberish[ type ]().connect( Gibber.Master ), + args = Array.prototype.slice.call( arguments, 0 ) + + oscillator.type = 'Gen' + $.extend( true, oscillator, Gibber.Audio.ugenTemplate ) + + oscillator.fx.ugen = oscillator + + Object.defineProperty(oscillator, '_', { + get: function() { + oscillator.kill(); + return oscillator + }, + set: function() {} + }) + + if( typeof oscillator.note === 'undefined' ) { + oscillator.note = function( pitch ) { + var freq = this.frequency() + if( typeof freq === 'number' || typeof freq === 'function' ) { + this.frequency = typeof pitch === 'function' ? pitch() : pitch + }else{ + freq[ 0 ] = pitch + } + } + } + + oscillator.name = name + + Gibber.createProxyProperties( oscillator, mappingProperties ) + + var proxyMethods = [ 'note','send' ] + + if( name === 'Sampler' ) { proxyMethods.push( 'pickBuffer' ) } + + Gibber.createProxyMethods( oscillator, proxyMethods ) + + Gibber.processArguments2( oscillator, args, name ) + + oscillator.toString = function() { return '> ' + name } + + return oscillator + } + }() + } + + // $script.ready('gibber', function() { + // + // }) + + Oscillators.Wavetable = function( table ) { + var oscillator = new Gibberish.Table().connect( Gibber.Master ) + if( table ) oscillator.setTable( table ) + + oscillator.type = 'Gen' + + $.extend( true, oscillator, Gibber.Audio.ugenTemplate ) + + oscillator.fx.ugen = oscillator + + Object.defineProperty(oscillator, '_', { + get: function() { + oscillator.kill(); + return oscillator + }, + set: function() {} + }) + + if( typeof oscillator.note === 'undefined' ) { + oscillator.note = function( pitch ) { + var freq = this.frequency() + if( typeof freq === 'number' || typeof freq === 'function' ) { + this.frequency = typeof pitch === 'function' ? pitch() : pitch + }else{ + freq[ 0 ] = pitch + } + } + } + + Gibber.createProxyProperties( oscillator, { + frequency: { + min: 50, max: 3200, + output: LOGARITHMIC, + timescale: 'audio', + dimensions:1 + }, + amp: { + min: 0, max: 1, + output: LOGARITHMIC, + timescale: 'audio', + dimensions:1 + }, + out: { + min: 0, max: 1, + output: LINEAR, + timescale: 'audio', + dimensions:1 + }, + }) + + Gibber.createProxyMethods( oscillator, ['note'] ) + + oscillator.toString = function() { return '> Wavetable' } + return oscillator + } + + Oscillators.Grains = function() { + var props = typeof arguments[0] === 'object' ? arguments[0] : arguments[1], + bufferLength = props.bufferLength || 88200, + a, + //a/ = Sampler().record( props.input, bufferLength ), + oscillator + + if( props.input ) { + a = Sampler().record( props.input, bufferLength ) + }else if( props.buffer ) { + bufferLength = props.buffer.length + } + + if(typeof arguments[0] === 'string') { + var preset = Gibber.Presets.Grains[ arguments[0] ] + if( typeof props !== 'undefined') $.extend( preset, props ) + oscillator = new Gibberish.Granulator( preset ) + }else{ + oscillator = new Gibberish.Granulator( props ) + } + + oscillator.loop = function(min, max, time, shouldLoop) { + var curPos = this.position + min = isNaN(min) ? .25 : min; + max = isNaN(max) ? .75 : max; + time = isNaN(time) ? Gibber.Clock.time( 1 ) : Gibber.Clock.time( time ); + + shouldLoop = typeof shouldLoop === "undefined" ? true : shouldLoop; + + this.position = new Gibberish.Line( min, max, time, shouldLoop ) + + var mappingObject = this; + if(shouldLoop === false) { + future( function() { mappingObject.position = curPos }, Gibber.Clock.time( time ) ); + } + + return oscillator + } + + if( a ){ + future( function() { + oscillator.setBuffer( a.getBuffer() ); + oscillator.connect() + oscillator.loop( 0, 1, bufferLength ); // min looping automatically + + a.disconnect() + }, bufferLength + 1) + }else{ + oscillator.connect() + oscillator.loop( 0, 1, bufferLength ); + } + + oscillator.type = 'Gen' + + $.extend( true, oscillator, Gibber.Audio.ugenTemplate ) + + oscillator.fx.ugen = oscillator + + Object.defineProperty(oscillator, '_', { + get: function() { + oscillator.disconnect(); + return oscillator + }, + set: function() {} + }) + + oscillator.toString = function() { return 'Grains' } + return oscillator + } + + Oscillators.Presets.Grains = { + tight : { + numberOfGrains : 10, + grainSize : 44 * 25, + positionMin : -.05, + positionMax : .05, + speedMin : -.1, + speedMax : .1, + shouldReverse : false, + }, + cloudy : { + numberOfGrains : 20, + positionMin : -.25, + positionMax : .25, + speedMin : -.1, + speedMax : 4, + grainSize : 44 * 100, + shouldReverse : true, + }, + flurry : { + speed:2, + speedMin:-2, + speedMax:2, + position:0, + positionMin:0, + positionMax:0, + numberOfGrains:20, + grainSize : 44 * 25, + }, + } + + return Oscillators +} + +},{"gibberish-dsp":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/gibberish-dsp/build/gibberish.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/postprocessing.js":[function(require,module,exports){ +module.exports = function( Gibber ) { + "use strict"; + var loadBuffer = function(ctx, filename, callback) { + var request = new XMLHttpRequest(); + request.open("GET", filename, true); + request.responseType = "arraybuffer"; + request.onload = function() { + Gibberish.context.decodeAudioData( request.response, function(_buffer) { + callback( _buffer ) + }) + }; + request.send(); + } + + var compressor = null, + Gibberish, + end = null, + hishelf = null, + lowshelf = null, + postgraph = null, + masterverb = null; + + var PP = Gibber.AudioPostProcessing = { + initialized: false, + getPostgraph : function() { return postgraph }, + + init : function() { + if( !this.initialized ) { + Gibberish = Gibber.Audio.Core + postgraph = [ Gibberish.node, Gibberish.context.destination ] + this.initialized = true + $.subscribe( '/gibber/clear', PP.clear.bind( this ) ) + } + }, + + clear : function() { + this.disconnectGraph() + postgraph = [ Gibberish.node, Gibberish.context.destination ] + this.connectGraph() + }, + + disconnectGraph: function() { + for( var i = 0; i < postgraph.length - 1; i++ ) { + postgraph[ i ].disconnect( postgraph[ i + 1 ] ) + } + }, + + connectGraph : function() { + for( var i = 0; i < postgraph.length - 1; i++ ) { + postgraph[ i ].connect( postgraph[ i + 1 ] ) + } + }, + + insert: function( node, position ) { + if( typeof position !== 'undefined' ) { + if( position > 0 && position < postgraph.length - 1 ) { + PP.disconnectGraph() + postgraph.splice( position, 0, node ) + }else{ + console.error( 'Invalid position for inserting into postprocessing graph: ', position ) + return + } + }else{ + PP.disconnectGraph() + postgraph.splice( 1, 0, node ) + } + + PP.connectGraph() + }, + + Compressor : function( position ) { + if( compressor === null ) { + + PP.init() + + compressor = Gibberish.context.createDynamicsCompressor() + + var _threshold = compressor.threshold, + _ratio = compressor.ratio, + _attack = compressor.attack, + _release = compressor.release + + Object.defineProperties( compressor, { + threshold: { + get: function() { return _threshold.value }, + set: function(v) { _threshold.value = v } + }, + ratio: { + get: function() { return _ratio.value }, + set: function(v) { _ratio.value = v } + }, + attack: { + get: function() { return _attack.value }, + set: function(v) { _attack.value = v } + }, + release: { + get: function() { return _release.value }, + set: function(v) { _release.value = v } + }, + }) + + PP.insert( compressor, position ) + } + + return compressor + }, + + MasterVerb: function( verb ) { + if( masterverb === null ) { + if( typeof verb === 'undefined' ) verb = 'smallPlate' + + masterverb = Gibberish.context.createConvolver(); + masterverb.impulseName = verb + + loadBuffer( Gibberish.context, 'resources/impulses/' + verb + '.wav', function( _buffer ) { + masterverb.buffer = _buffer + }) + + //postgraph[ 0 ].connect( masterverb, 2, 0 ) + //postgraph[ 0 ].connect( masterverb, 3, 1 ) + + Gibberish.reverbOut.connect( masterverb ) + + masterverb.gainNode = Gibberish.context.createGain() + + masterverb.gainNode.connect( Gibberish.context.destination ) + masterverb.connect( masterverb.gainNode ) + + Object.defineProperty( masterverb, 'gain', { + get: function() { + return masterverb.gainNode.gain.value + }, + set: function(v) { + masterverb.gainNode.gain.value = v + } + }) + + masterverb.gain = .2 + //175314__recordinghopkins__large-dark-plate-01.wav + }else if( verb !== masterverb.impulseName ) { + loadBuffer( Gibberish.context, 'resources/impulses/' + verb + '.wav', function( _buffer ) { + masterverb.impulseName = verb + masterverb.buffer = _buffer + }) + } + + return masterverb + }, + + LowShelf : function( position ) { + if( lowshelf === null ) { + lowshelf = Gibberish.context.createBiquadFilter() + + lowshelf.type = 3 // lowshelf + lowshelf.frequency.value = 220 + lowshelf.Q.value = 0 + lowshelf.gain.value = 6 + + var _gain = lowshelf.gain, + _frequency = lowshelf.frequency, + _Q = lowshelf.Q + + + Object.defineProperties( lowshelf, { + frequency: { + get: function() { return _frequency.value }, + set: function(v) { _frequency.value = v } + }, + gain: { + get: function() { return _gain.value }, + set: function(v) { _gain.value = v } + }, + Q: { + get: function() { return _Q.value }, + set: function(v) { _Q.value = v } + }, + }) + + PP.insert( lowshelf, position ) + } + + return lowshelf + }, + + HiShelf : function( position ) { + if( hishelf === null ) { + hishelf = Gibberish.context.createBiquadFilter() + + hishelf.type = 4 // hishelf + hishelf.frequency.value = 880 + hishelf.Q.value = 0 + hishelf.gain.value = 6 + + var _gain = hishelf.gain, + _frequency = hishelf.frequency, + _Q = hishelf.Q + + Object.defineProperties( hishelf, { + frequency: { + get: function() { return _frequency.value }, + set: function(v) { _frequency.value = v } + }, + gain: { + get: function() { return _gain.value }, + set: function(v) { _gain.value = v } + }, + Q: { + get: function() { return _Q.value }, + set: function(v) { _Q.value = v } + }, + }) + + PP.insert( hishelf, position ) + } + + return hishelf + }, + } + + return PP +} +},{}],"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/sampler.js":[function(require,module,exports){ +module.exports = function( Gibber ) { + "use strict" + + var Samplers = { Presets:{} }, + Gibberish = require( 'gibberish-dsp' ), + $ = Gibber.dollar, + Clock = require('./clock')( Gibber ), + curves = Gibber.outputCurves, + LINEAR = curves.LINEAR, + LOGARITHMIC = curves.LOGARITHMIC + + var mappingProperties = { + amp: { + min: 0, max: 1, + hardMax:2, + output: LOGARITHMIC, + timescale: 'audio', + dimensions:1 + }, + start: { + min: 0, max: 1, + output: LINEAR, + timescale: 'audio', + dimensions:1 + }, + end: { + min: 0, max: 1, + output: LINEAR, + timescale: 'audio', + dimensions:1 + }, + pitch: { + min: 1, max: 4, + hardMin: .01, hardMax: 20, + output: LOGARITHMIC, + timescale: 'audio', + }, + out: { + min: 0, max: 1, + output: LINEAR, + timescale: 'audio', + dimensions:1 + }, + pan: { min: -1, max: 1, output: LOGARITHMIC, timescale: 'audio',}, + note: { + min: .1, max: 4, + output: LOGARITHMIC, + timescale: 'audio', + doNotProxy:true + }, + } + + Samplers.Sampler = function() { + var args = Array.prototype.slice.call( arguments, 0 ), + file = args[0] && args[0].file ? args[0].file : undefined, + oscillator, buffer, name = 'Sampler' + + if( args[0] && args[0].buffer ) { buffer = args[0].buffer } + if( buffer ) { + oscillator = new Gibberish.Sampler({ 'buffer':buffer }).connect( Gibber.Master ) + }else{ + oscillator = new Gibberish.Sampler( file ).connect( Gibber.Master ) + } + + oscillator.type = 'Gen' + $.extend( true, oscillator, Gibber.Audio.ugenTemplate ) + + oscillator.fx.ugen = oscillator + + Object.defineProperty(oscillator, '_', { + get: function() { + oscillator.kill(); + return oscillator + }, + set: function() {} + }) + + if( typeof oscillator.note === 'undefined' ) { + oscillator.note = function( pitch ) { + var freq = this.frequency() + if( typeof freq === 'number' || typeof freq === 'function' ) { + this.frequency = typeof pitch === 'object' ? pitch.value : pitch + }else{ + freq[ 0 ] = pitch + } + } + } + + var oldStart = oscillator.__lookupSetter__('start').bind( oscillator ), + __start = 0 + + Object.defineProperty(oscillator, 'start', { + configurable: true, + get: function() { + return __start + }, + set: function(v) { + if( typeof v === 'number' ) { + // if( v <= 1 ) { + // __start = v * oscillator.length + // }else{ + // __start = v + // } + __start = v + }else{ + __start = v + } + oldStart( __start ) + // oscillator.setPhase( __start ) // TODO: HACK! Why doesn't this work automatically? + + return __start + } + }) + + var oldEnd = oscillator.__lookupSetter__('end').bind( oscillator ), + __end = 1 + Object.defineProperty(oscillator, 'end', { + configurable:true, + get: function() { + return __end + }, + set: function(v) { + if( typeof v === 'number' ) { + __end = v + }else{ + __end = v + } + oldEnd( __end ) + //oscillator.setPhase( __end ) // TODO: HACK! Why doesn't this work automatically? + + return __end + } + }) + + Gibber.createProxyProperties( oscillator, mappingProperties ) + + var proxyMethods = [ 'note', 'pickBuffer', 'switchBuffer', 'range' ] + + Gibber.createProxyMethods( oscillator, proxyMethods ) + + Gibber.processArguments2( oscillator, args, name ) + + oscillator.toString = function() { return name } + + return oscillator + } + + Gibberish.Sampler.prototype.readFile = function( file ) { + var that = this + if( file.isFile ) { + file.file( function( file ) { + that.readFile( file ) + }) + return + } + var reader = new FileReader() + + reader.readAsArrayBuffer( file ); + + reader.onload = function (event) { + Gibberish.context.decodeAudioData( reader.result, function(_buffer) { + var buffer = _buffer.getChannelData(0) + that.setBuffer( buffer ) + that.length = buffer.length + that.buffers[ file.name ] = buffer + + that.isPlaying = true; + + //console.log("LOADED", file.name, buffer.length); + Gibberish.audioFiles[ file.name ] = buffer; + + if(that.onload) that.onload(); + + if(that.playOnLoad !== 0) that.note( that.playOnLoad ); + + that.isLoaded = true; + }) + } + } + + Gibberish.Sampler.prototype.ondrop = function( files ) { + for( var i = 0; i < files.length; i++ ) { + ( function(_that) { + var file = files[ i ], + reader = new FileReader(), + that = _that, item; + + item = file.webkitGetAsEntry ? file.webkitGetAsEntry() : file + + if( item.isDirectory ) { + var dirReader = item.createReader() + dirReader.readEntries( function( entries ){ + var idx = entries.length; + while(idx--){ + _that.readFile( entries[idx] ); + } + }) + }else{ + _that.readFile( item ) + } + })( this ) + } + } + + Gibberish.Sampler.prototype.pickBuffer = function() { + this.switchBuffer( rndi( 0, this.getNumberOfBuffers() ) ) + } + + Gibberish.Sampler.prototype.record = function(input, recordLength) { + this.isRecording = true; + console.log( 'starting recording' ) + var self = this; + + this.recorder = new Gibberish.Record(input, Gibber.Clock.time( recordLength ), function() { + console.log( 'recording finished' ) + self.setBuffer( this.getBuffer() ); + self.length = self.getBuffer().length; + self.setPhase( self.length ) + self.isRecording = false; + }) + .record(); + + return this; + }; + + Gibberish.Sampler.prototype.done = function( func ) { + this.onload = func + return this + } + + Gibberish.Sampler.prototype.load = function( url ) { + var xhr = new XMLHttpRequest(), initSound + + xhr.open( 'GET', url, true ) + xhr.responseType = 'arraybuffer' + xhr.onload = function( e ) { initSound( this.response, url ) } + xhr.send() + + //console.log("now loading sample", url ) + xhr.onerror = function( e ) { console.error( "Sampler file loading error", e )} + + var self = this, buffer, bufferLength = 0, phase = 0 + + function initSound( arrayBuffer, filename ) { + Gibber.Audio.Core.context.decodeAudioData( arrayBuffer, function( _buffer ) { + var buffer = _buffer.getChannelData(0) + self.length = buffer.length + self.setPhase( self.length ) + self.setBuffer( buffer ) + self.isPlaying = true; + self.buffers[ filename ] = buffer; + self.file = filename + + //console.log("sample loaded | ", filename, " | length | ", buffer.length ); + Gibberish.audioFiles[ filename ] = buffer; + + if(self.onload) self.onload(); + + if(self.playOnLoad !== 0) self.note( self.playOnLoad ); + + self.isLoaded = true; + }, function(e) { + console.log('Error decoding file', e); + }); + }; + + return this + } + + Gibberish.Sampler.prototype.loadDir = function( dir ) { + var xhr = new XMLHttpRequest(), initSound + + xhr.open( 'GET', dir, true ) + xhr.responseType = 'html' + xhr.onload = function( e ) { loadDir( this.response, dir ) } + xhr.send() + + console.log("now loading directory", dir ) + xhr.onerror = function( e ) { console.error( "Error loading directory", e )} + + var self = this + + function loadDir( response, dir ) { + var page = $( response ), + links = $( page ).find( 'a' ) + + for( var i = 0; i < links.length; i++ ) { + var link = links[ i ], + split = link.href.split( '/' ), + url = split[ split.length - 1 ] + + if( url !== '' && url !== '.DS_Store' && url !== 'node-ecstatic' ) { + self.load( dir + '/' + url ) + } + } + }; + + return this + } + + + Samplers.Looper = function(input, length, numberOfLoops) { + var that = Bus(); + $.extend( that, { + children : [], + input : input, + length : Clock.time(length), + numberOfLoops : numberOfLoops, + pitch : 1, + currentLoop : 0, + loop : function() { + that.children[ that.currentLoop ].record( that.input, that.length ); + + var seq = { + target: that.children[ that.currentLoop ], + durations: that.length, + key:'note', + values: [ 1 ] + } + + that.seq.add( seq ) + that.seq.start() + + future(that.nextLoop, length); + + return that; + }, + nextLoop : function() { + that.children[++that.currentLoop].record(that.input, that.length); + if(that.currentLoop < that.numberOfLoops - 1) { + future(that.nextLoop, length); + } + var seq = { + target: that.children[ that.currentLoop ], + durations: that.length, + key:'note', + values: [ 1 ] + } + + that.seq.add( seq ) + }, + }) + + var __pitch = 1 + Object.defineProperty( that, 'pitch', { + configurable:true, + get: function() { + return __pitch + }, + set: function(v) { + __pitch = v + for( var i = 0; i < that.children.length; i++ ) { + that.children[ i ].pitch = __pitch + } + } + }) + + for(var i = 0; i < numberOfLoops; i++) { + that.children.push( Sampler({ pitch:that.pitch })._ ); + that.children[i].send(that, 1); + } + + Gibber.createProxyProperties( that, { pitch:mappingProperties.pitch } ) + + that.stop = function() { that.seq.stop(); } + that.play = function() { that.seq.start(); } + + return that; + } + + return Samplers +} + +},{"./clock":"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/clock.js","gibberish-dsp":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/gibberish-dsp/build/gibberish.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/score.js":[function(require,module,exports){ +/* +Score is a Seq(ish) object, with pause, start / stop, rewind, fast-forward. +It's internal phase is + +Score has start() method to start it running. next() advances to next element, +regardless of whether or not the score is running, and stats the transport running. +rewind() moves the score index to the first position. +*/ + +/* +Passed Timing Result +============= ====== +Numeric literal place function in timeline and store reference +a Function callback. register to receive and advance. must use pub/sub. +Score.wait pause until next() method is called +*/ + +module.exports = function( Gibber ) { + +"use strict" + +var Gibberish = require( 'gibberish-dsp' ), + $ = Gibber.dollar + +var ScoreProto = { + start: function() { + if( !this.codeblock ) { + this.connect() + } + this.isPaused = false + + return this + }, + stop: function() { + this.isPaused = true + return this + }, + + loop: function( loopPause ) { + this.loopPause = loopPause || 0 + this.shouldLoop = !this.shouldLoop + + return this + }, + + pause: function() { + this.isPaused = true + + return this + }, + + next: function() { + if( !this.codeblock ) { + this.connect() + } + this.isPaused = false + + return this + }, +} + +var proto = new Gibberish.ugen() + +$.extend( proto, ScoreProto ) + +var Score = function( data, opts ) { + if( ! ( this instanceof Score ) ) { + var args = Array.prototype.slice.call( arguments, 0 ) + return Gibber.construct( Score, args ) + } + + if( typeof opts === 'undefined' ) opts = {} + + this.timeline = [] + this.schedule = [] + this.shouldLoop = false + this.loopPause = 0 + + for( var i = 0; i < data.length; i+=2 ) { + this.schedule.push( data[ i ] ) + this.timeline.push( data[ i+1 ] ) + } + + var phase = 0, + index = 0, + timeline = this.timeline, + schedule = this.schedule, + self = this, + loopPauseFnc = function() { + self.nextTime = phase = 0 + index = -1 + self.timeline.pop() + } + + $.extend( this, { + properties: { rate: 1, isPaused:true, nextTime:0 }, + name:'score', + getIndex: function() { return index }, + callback : function( rate, isPaused, nextTime ) { + if( !isPaused ) { + if( phase >= nextTime && index < timeline.length ) { + + var fnc = timeline[ index ], + shouldExecute = true + + index++ + + if( index <= timeline.length - 1 ) { + var time = schedule[ index ] + + if( typeof time === 'number' && time !== Score.wait ) { + self.nextTime = phase + time + }else{ + if( time === Score.wait ) { + self.isPaused = true + }else if( time.owner instanceof Score ) { + self.isPaused = true + time.owner.oncomplete.listeners.push( self ) + // shouldExecute = false // doesn't do what I think it should do... + } + } + }else{ + if( self.shouldLoop ) { + if( timeline[ timeline.length - 1 ] !== loopPauseFnc ) { + timeline.push( loopPauseFnc ) + } + self.nextTime = phase + self.loopPause + }else{ + self.isPaused = true + } + self.oncomplete() + } + if( shouldExecute && fnc ) { + if( fnc instanceof Score ) { + if( !fnc.codeblock ) { + fnc.start() + console.log("STARTING SCORE") + }else{ + fnc.rewind().next() + //fnc.rewind().next() + //fnc() + } + }else{ + fnc() + } + } + } + phase += rate + } + return 0 + }, + rewind : function() { + phase = index = 0 + this.nextTime = this.schedule[ 0 ] + return this + }, + oncomplete: function() { + // console.log("ON COMPLETE", this.oncomplete.listeners ) + var listeners = this.oncomplete.listeners + for( var i = listeners.length - 1; i >= 0; i-- ) { + var listener = listeners[i] + if( listener instanceof Score ) { + listener.next() + } + } + } + }) + + this.oncomplete.listeners = [] + this.oncomplete.owner = this + + this.init() + + this.nextTime = this.schedule[ 0 ] + + var _rate = this.rate, + oldRate = this.__lookupSetter__( 'rate' ) + + Object.defineProperty( this, 'rate', { + get : function() { return _rate }, + set : function(v) { + _rate = Mul( Gibber.Clock, v ) + oldRate.call( this, _rate ) + } + }) + + this.rate = this.rate // trigger meta-programming tie to master clock + + Gibber.createProxyProperties( this, { + rate : { min: .1, max: 2, output: 0, timescale: 'audio' }, + }) +} + +Score.prototype = proto + +Score.wait = -987654321 +Score.combine = function() { + var score = [ 0, arguments[ 0 ] ] + + for( var i = 1; i < arguments.length; i++ ) { + var timeIndex = i * 2, + valueIndex = timeIndex + 1, + previousValueIndex = timeIndex - 1 + + score[ timeIndex ] = score[ previousValueIndex ].oncomplete + score[ valueIndex ] = arguments[ i ] + } + + return Score( score ) +} + +return Score + +} + +/* +a = Score([ + 0, console.log.bind( null, 'test1'), + seconds(.5),console.log.bind( null, 'test2'), + Score.wait, null, + seconds(.5),console.log.bind( null, 'test3'), + seconds(.5),console.log.bind( null, 'test4'), + seconds(.5),function() { a.rewind(); a.next() } +]) + +b = Score([ + 100, console.log.bind(null,"B"), + 100, console.log.bind(null,"F"), + a.oncomplete, function() { + console.log("C") + } +]) +.start() + +a.start() + +----- +a = Score([ + 0, console.log.bind( null, 'test1'), + seconds(.5),console.log.bind( null, 'test2'), + + Score.wait, null, + + seconds(.5),console.log.bind( null, 'test3'), + + seconds(.5), Score([ + 0, console.log.bind(null,"A"), + beats(2), console.log.bind(null,"B") + ]), + + Score.wait, null, + + seconds(.5),function() { a.rewind(); a.next() } +]).start() + +----- +synth = Synth('bleep') +synth2 = Synth('bleep', {maxVoices:4}) + +// you need to uncomment the line below after the kick drum comes in +// and execute it + +score.next() + +score = Score([ + 0, synth.note.score( 'c4', 1/4 ), + + measures(1), synth.note.score( ['c4','c5'], 1/8 ), + + measures(1), synth.note.score( ['c2','c3','c4','c5'], 1/16 ), + + measures(1), function() { + kick = Kick().note.seq( 55,1/4 ) + }, + + Score.wait, null, + + 0, synth2.note.score('bb4',1/4 ), + + measures(1), synth2.chord.score( [['bb4','g4']], 1/4 ), + + measures(2), synth2.chord.score( [['c5','f4']], 1/4 ), + + measures(2), function() { + synth2.chord.seq( [['eb4','bb4','d5']], 1/6 ) + synth2.note.seq.stop() + synth2.fx.add( Delay(1/9,.35) ) + + synth2.fadeOut(32) + }, + + measures(4), function() { + ks = Pluck() + .note.seq( Rndi(100,600), 1/16 ) + .blend.seq( Rndf() ) + .fx.add( Schizo('paranoid') ) + + Clock.rate = Line( 1, 1.1, 8 ) + }, + + measures(8), function() { + Master.fadeOut( 8 ) + }, + + measures(8), Gibber.clear + +]).start() + +------ + +synth = Synth('bleep') + +verse = Score([ beats(1/2), synth.note.bind( synth, 'c4' ) ]) +chorus = Score([ beats(1/2), synth.note.bind( synth, 'd4' ) ]) +bridge = Score([ beats(1/2), synth.note.bind( synth, 'e4' ) ]) + +song = Score([ + 0, verse, + verse.oncomplete, chorus, + chorus.oncomplete, verse, + verse.oncomplete, chorus, + chorus.oncomplete, bridge, + bridge.oncomplete, chorus +]) + +song.start() + +*/ +},{"gibberish-dsp":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/gibberish-dsp/build/gibberish.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/seq.js":[function(require,module,exports){ +module.exports = function( Gibber ) { + //"use strict" + + var Gibberish = require( 'gibberish-dsp' ), + $ = Gibber.dollar, + doNotSequence = [ 'durations', 'target', 'scale', 'offset', 'doNotStart', 'priority' ] + + var makeChordFunction = function( notes, obj ) { + var _note = $.extend( [], notes ), + count = 0 + + return [function() { + var idx, freq + + if( typeof _note.pick === 'function' ) { + idx = _note[ _note.pick() ] + }else if( typeof _note[ count ] === 'function') { + idx = _note[ count ]() + }else{ + idx = _note[ count++ ] + } + + if( typeof obj.scale.notes[ idx ] === 'number' ) { + freq = obj.scale.notes[ idx ] + }else{ + if( typeof idx === 'undefined' ) return // rest + try{ + freq = obj.scale.notes[ idx ].fq() + }catch(e) { + console.error( "The frequency could not be obtained from the current scale. Did you specify an invalid mode or root note?") + obj.stop() + } + } + //freq = typeof obj.scale.notes[ idx ] === 'number' ? obj.scale.notes[ idx ] : obj.scale.notes[ idx ].fq() + if( count >= _note.length ) count = 0 + + return freq + }] + } + + var Seq = function() { + var obj = {}, seq, hasScale, keyList = [] + + if( typeof arguments[0] === 'object' && ! Array.isArray( arguments[0] ) ) { + var arg = arguments[0], + durationsType = typeof arg.durations, + targetsType = typeof arg.target, + priority = arg.priority, + hasScale + + obj.target = arg.target + + if( typeof arg.scale === 'object' ) obj.scale = arg.scale + if( typeof arg.offset === 'number' ) obj.offset = Gibber.Clock.time( arg.offset ) + + // if( durationsType === 'object') { + // obj.durations = arg.durations + // }else if( durationsType !== 'undefined') { + // obj.durations = [ arg.durations ] + // }else{ } + obj.durations = arg.durations + + obj.keysAndValues = {} + obj.seqs = [] + obj.autofire = [] + + if( obj.durations ) { + if( !Array.isArray( obj.durations) ) { obj.durations = [ obj.durations ] } + + var durationsPattern = Gibber.construct( Gibber.Pattern, obj.durations ) + + if( obj.durations.randomFlag ) { + durationsPattern.filters.push( function() { + var idx = Gibber.Utilities.rndi(0, durationsPattern.values.length - 1) + return [ durationsPattern.values[ idx ], 1, idx ] + }) + for( var i = 0; i < obj.durations.randomArgs.length; i+=2 ) { + durationsPattern.repeat( obj.durations.randomArgs[ i ], obj.durations.randomArgs[ i + 1 ] ) + } + } + } + + for( var _key in arg ) { + !function() { + var key = _key + if( doNotSequence.indexOf( key ) === -1 ) { + var isArray = Array.isArray( arg[key] )// $.type( arg[ key ] ) + + var _seq = { + key: key, + target: obj.target, + durations: durationsPattern, + } + + var valuesPattern + if( isArray ) { + valuesPattern = Gibber.construct( Gibber.Pattern, arg[ key ] ) + }else if( typeof arg[ key ] !== 'undefined' ) { + valuesPattern = Gibber.construct( Gibber.Pattern, [ arg[ key ] ] )//[ arg[ key ] ] + } + + if( arg[ key ].randomFlag ) { + valuesPattern.filters.push( function() { + var idx = Gibber.Utilities.rndi(0, valuesPattern.values.length - 1) + return [ valuesPattern.values[ idx ], 1, idx ] + }) + for( var i = 0; i < arg[ key ].randomArgs.length; i+=2 ) { + valuesPattern.repeat( arg[ key ].randomArgs[ i ], arg[ key ].randomArgs[ i + 1 ] ) + } + } + + //if( key === 'note' ) { + // valuesPattern.filters.push( function() { + // var output = arguments[ 0 ][ 0 ] + // if( typeof output === 'number' && output < Gibber.minNoteFrequency ) { + // if( obj.scale ) { + // output = obj.scale.notes[ output ] + // }else{ + // output = Gibber.scale.notes[ output ] + // } + // } + + // return [ output, arguments[0][1], arguments[0][2] ] + // }) + //} + + _seq.values = valuesPattern + + _seq.stop = function() { _seq.shouldStop = true } + + // TODO: property specific stop/start/shuffle etc. for polyseq + _seq.start = function() { + _seq.shouldStop = false + seq.timeline[0] = [ _seq ] + seq.nextTime = 0 + + if( !seq.isRunning ) { + seq.start( false, priority ) + } + } + + _seq.repeat = function( numberOfTimes ) { + var repeatCount = 0 + + var filter = function( args, ptrn ) { + if( args[2] % (ptrn.getLength() - 1) === 0 && args[2] !== 0) { + repeatCount++ + if( repeatCount === numberOfTimes ) { + ptrn.seq.stop() + } + } + return args + } + + valuesPattern.filters.push( filter ) + } + + valuesPattern.seq = _seq + //durationsPattern.seq = _seq + + obj.seqs.push( _seq ) + keyList.push( key ) + } + }() + } + + if( 'scale' in obj ) { + var noteIndex = keyList.indexOf( 'note' ), + chordIndex = keyList.indexOf( 'chord' ) + + //var makeNoteFunction = function( notes, obj ) { + + // if( noteIndex > -1 ) { + // obj.seqs[ noteIndex ].values = makeNoteFunction( obj.seqs[ noteIndex ].values, obj ) + // } + + if( chordIndex > -1 ) { + var _chord = $.extend( [], obj.seqs[ chordIndex ] ), + count = 0 + + obj.seqs[ chordIndex ] = [ function() { + var idxs, chord = [] + + if( typeof _chord.pick === 'function' ) { + idxs = _chord[ _chord.pick() ] + }else if( typeof _chord[ count ] === 'function') { + idxs = _chord[ count ]() + }else{ + idxs = _chord[ count++ ] + } + + chord = obj.scale.chord( idxs ) + + if ( count >= _chord.length) count = 0 + + return chord + }] + } + } + }else if( typeof arguments[0] === 'function' || Array.isArray( arguments[0] ) ){ + obj.seqs = [{ + key:'functions', + values: Array.isArray( arguments[0] ) ? arguments[0] : [ arguments[ 0 ] ], + durations: Gibber.Clock.time( arguments[ 1 ] ) + }] + if( typeof arguments[1] === 'function' || Array.isArray( arguments[1] ) ) { + obj.seqs[0].durations = arguments[ 1 ] + } + keyList.push('functions') + } + + seq = new Gibberish.PolySeq( obj ) + seq.timeModifier = Gibber.Clock.time.bind( Gibber.Clock ) + seq.name = 'Seq' + seq.save = {} + + seq.oldShuffle = seq.shuffle + delete seq.shuffle + + seq.rate = Gibber.Clock + var oldRate = seq.__lookupSetter__( 'rate' ) + + var _rate = seq.rate + Object.defineProperty( seq, 'rate', { + get : function() { return _rate }, + set : function(v) { + _rate = Mul( Gibber.Clock, v ) + oldRate.call( seq, _rate ) + } + }) + + var nextTime = seq.nextTime, + oldNextTime = seq.__lookupSetter__('nextTime') + Object.defineProperty( seq, 'nextTime', { + get: function() { return nextTime }, + set: function(v) { nextTime = Gibber.Clock.time( v ); oldNextTime( nextTime ) } + }) + + var offset = seq.offset + Object.defineProperty( seq, 'offset', { + get: function() { return offset }, + set: function(v) { offset = v; seq.nextTime += offset } + }) + seq.nextTime += seq.offset + + for( var i = 0; i < keyList.length; i++ ) { + (function(_seq) { + var key = keyList[ i ], + _i = i + + Object.defineProperty( _seq, key, { + get: function() { return _seq.seqs[ _i ].values }, + set: function(v) { + // if( key === 'note' && _seq.scale ) { + // v = makeNoteFunction( v, _seq ) + // } + _seq.seqs[ _i ].values = v + } + }) + })(seq) + } + + var _durations = durationsPattern + Object.defineProperty( seq, 'durations', { + get: function() { return _durations }, + set: function(v) { + _durations = v + for( var i = 0; i < seq.seqs.length; i++ ) { + var _seq = seq.seqs[i] + _seq.durations = _durations + } + } + }) + + if( arguments[0] && ! arguments[0].doNotStart ) { + seq.start( true ) + } + + seq.toString = function() { return '> Seq' } + seq.gibber = true + + $.extend( seq, { + constructor: Seq, + replaceWith: function( replacement ) { this.kill() }, + kill: function() { + if( this.target && this.target.sequencers ) + this.target.sequencers.splice( this.target.sequencers.indexOf( this ), 1 ) + + console.log("SEQ KILL", this ) + this.stop().disconnect() + + Seq.children.splice( Seq.children.indexOf( this ), 1 ) + }, + applyScale : function() { + // for( var i = 0; i < this.seqs.length; i++ ) { + // var s = this.seqs[ i ] + // if( s.key === 'note' || s.key === 'frequency' ) { + // s.values = makeNoteFunction( s.values, this ) + // } + // } + }, + once : function() { + this.repeat( 1 ) + return this + }, + reset : function() { + for( var i = 0; i < this.seqs.length; i++ ) { + this.seqs[ i ].values[0].reset() + } + }, + shuffle : function() { + for( var i = 0; i < this.seqs.length; i++ ) { + this.seqs[ i ].values[0].shuffle() + } + }, + // repeat : function( numberOfTimes ) { + // var repeatCount = 0 + // + // var filter = function( args, ptrn ) { + // if( args[2] % (ptrn.getLength() - 1) === 0 && args[2] !== 0) { + // ptrn.seq.stop() + // } + // return args + // } + // + // } + }) + + Seq.children.push( seq ) + + return seq + } + + Seq.children = [] + + var ScaleSeq = function() { + var args = arguments[0], + scale + + args.root = args.root || 'c4' + args.mode = args.mode || 'aeolian' + + scale = Gibber.Theory.Scale( args.root, args.mode ) + + delete args.root; delete args.mode + + args.scale = scale + + return Seq( args ) + } + + var Seqs = { 'Seq': Seq, 'ScaleSeq':ScaleSeq } + + return Seqs +} + +},{"gibberish-dsp":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/gibberish-dsp/build/gibberish.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/soundfont.js":[function(require,module,exports){ +module.exports = function( Gibber, pathToSoundFonts ) { + var Gibberish = require( 'gibberish-dsp' ), + curves = Gibber.outputCurves, + teoria = require( './theory' )( Gibber ).Teoria, + LINEAR = curves.LINEAR, + LOGARITHMIC = curves.LOGARITHMIC, + mappingProperties = { + amp: { + min: 0, max: 1, + hardMax:2, + output: LOGARITHMIC, + timescale: 'audio', + dimensions:1 + }, + loudness: { + min: 0, max: 1, + hardMax:2, + output: LOGARITHMIC, + timescale: 'audio', + dimensions:1 + }, + pan: { + min:-1, max:1, + output: LINEAR, + timescale: 'audio', + dimensions:1 + } + }, + cents = function(base, _cents) { + return base * Math.pow(2,_cents/1200) + }, + sensibleNames; + + sensibleNames = { + piano : 'acoustic_grand_piano', + guitar: 'electric_guitar_clean', + bass : 'acoustic_bass', + organ : 'rock_organ', + brass : 'synth_brass_1', + strings:'synth_strings_1', + choir : 'choir_aahs', + } + + var SoundFont = function( soundFontName ) { + var obj, path = SoundFont.path + + if( Gibber.Environment ) { + if( Gibber.Environment.Storage.values.soundfonts ) { + if( Gibber.Environment.Storage.values.soundfonts[ soundFontName ] ) { + path = Gibber.Environment.Storage.values.soundfonts[ soundFontName ] + } + } + } + + if( sensibleNames[ soundFontName ] ) soundFontName = sensibleNames[ soundFontName ]; + + obj = new Gibberish.SoundFont( arguments[0], path ).connect( Gibber.Master ) + + $.extend( true, obj, Gibber.Audio.ugenTemplate ) + obj.fx.ugen = obj + obj.chord = Gibber.Theory.chord + + Object.defineProperty(obj, '_', { + get: function() { + obj.kill(); + return obj + }, + set: function() {} + }) + + obj.onload = function() { + + if( Gibber.Environment && Gibber.Environment.Storage.values.saveSoundFonts ) { + if( !Gibber.Environment.Storage.values.soundfonts ) { + Gibber.Environment.Storage.values.soundfonts = {} + }else{ + if( Gibber.Environment.Storage.values.soundfonts[ soundFontName] ) return + } + + Gibber.Environment.Storage.values.soundfonts[ soundFontName ] = Gibber.Audio.Core.SoundFont.storage[ soundFontName ] + + try{ + Gibber.Environment.Storage.save() + }catch(e){ + console.log("STORAGE ERROR", e ) + + if( e.name === 'QuotaExceededError' ) { + console.log('Your localStorage for Gibber has been exceeded; we can\'t save the soundfile. It is still usable.') + } + } + } + } + + obj._note = obj.note.bind( obj ) + obj.note = function( name, loudness ) { + if( typeof name === 'number' ) { + if( name < Gibber.minNoteFrequency ) { + var scale = this.scale || Gibber.scale, + note = scale.notes[ name ] + + if( this.octave && this.octave !== 0 ) { + var sign = this.octave > 0 ? 1 : 0, + num = Math.abs( this.octave ) + + for( var i = 0; i < num; i++ ) { + note *= sign ? 2 : .5 + } + } + + name = note + } + var tNote = teoria.frequency.note( name ), + noteName, _cents = 0 + + if( tNote.note.accidental.value === 1 && tNote.note.accidental.sign !== 'b' ) { + var enharmonics = tNote.note.enharmonics() + for( var i = 0; i < enharmonics.length; i++ ) { + var enharmonic = enharmonics[ i ] + if( enharmonic.accidental.sign === 'b' ) { + tNote.note = enharmonic + break; + } + } + } + + _cents = tNote.cents + + noteName = tNote.note.name.toUpperCase() + if( tNote.note.accidental.value !== 0) { + noteName += tNote.note.accidental.sign + } + noteName += tNote.note.octave + + name = noteName + }else if( typeof name !== 'string' ) { + return + } + + if( typeof loudness === 'undefined' ) loudness = this.loudness.value + + obj._note( name, loudness, cents(1, _cents) ) + } + + Gibber.createProxyProperties( obj, mappingProperties ) + Gibber.defineProperty( obj, 'loudness', true, true, { min: 0, max: 1, output: LOGARITHMIC, timescale: 'audio', perNote:true }, true, true ) + Gibber.createProxyMethods( obj, [ 'note', 'chord', 'send' ] ) + + return obj + } + + SoundFont.path = pathToSoundFonts || "../../../resources/soundfonts/" + + return SoundFont +} + +},{"./theory":"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/theory.js","gibberish-dsp":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/gibberish-dsp/build/gibberish.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/synths.js":[function(require,module,exports){ +module.exports = function( Gibber ) { + "use strict" + + function isInt(value) { return !isNaN(value) && (function(x) { return (x | 0) === x; })(parseFloat(value)) } + + var Synths = { Presets: {} }, + Gibberish = require( 'gibberish-dsp' ), + $ = Gibber.dollar, + Clock = require( './clock' )( Gibber ), + curves = Gibber.outputCurves, + LINEAR = curves.LINEAR, + LOGARITHMIC = curves.LOGARITHMIC + + var types = [ + [ 'PolySynth', 'Synth' ], + [ 'PolyFM', 'FM' ], + [ 'PolySynth2', 'Synth2' ], + [ 'MonoSynth', 'Mono' ], + [ 'PolyKarplusStrong', 'Pluck' ], + ], + _mappingProperties = { + Synth: { + note: { min: 50, max: 3200, output: LOGARITHMIC, timescale: 'audio', doNotProxy:true }, + frequency: { min: 50, max: 3200, output: LOGARITHMIC, timescale: 'audio' }, + amp: { min: 0, max: 1, output: LOGARITHMIC,timescale: 'audio',}, + pulsewidth :{ min: 0.01, max: .99, output: LINEAR, timescale: 'audio', perNote:true }, + attack: { min:Clock.maxMeasures + 1, max: 176400, output: LINEAR, timescale:'audio', perNote:true}, + decay: { min:Clock.maxMeasures + 1, max: 176400, output: LINEAR, timescale:'audio', perNote:true}, + sustain: { min:Clock.maxMeasures + 1, max: 176400, output: LINEAR, timescale:'audio', perNote:true}, + release: { min:Clock.maxMeasures + 1, max: 176400, output: LINEAR, timescale:'audio', perNote:true}, + pan: { min: -1, max: 1, output: LOGARITHMIC,timescale: 'audio', perNote:true,}, + sustainLevel: { min:.01, max: 1, output: LOGARITHMIC, timescale:'audio', perNote:true}, + out: { min: 0, max: 1, output: LINEAR, timescale: 'audio', dimensions:1 }, + }, + Synth2: { + note: { min: 50, max: 3200, output: LOGARITHMIC, timescale: 'audio', doNotProxy:true }, + frequency: { min: 50, max: 3200, output: LINEAR, timescale: 'audio' }, + amp: { min: 0, max: 1, output: LOGARITHMIC,timescale: 'audio',}, + pulsewidth :{ min: 0.01, max: .99, output: LINEAR, timescale: 'audio', perNote:true }, + attack: { min:Clock.maxMeasures + 1, max: 176400, output: LINEAR, timescale:'audio', perNote:true}, + decay: { min:Clock.maxMeasures + 1, max: 176400, output: LINEAR, timescale:'audio', perNote:true}, + sustain: { min:Clock.maxMeasures + 1, max: 176400, output: LINEAR, timescale:'audio', perNote:true}, + release: { min:Clock.maxMeasures + 1, max: 176400, output: LINEAR, timescale:'audio', perNote:true}, + sustainLevel: { min:.01, max: 1, output: LOGARITHMIC, timescale:'audio', perNote:true}, + cutoff : { min: 0, max: .7, output: LINEAR, timescale: 'audio', perNote:true }, + resonance: { min: 0, max: 5.5, output: LINEAR, timescale: 'audio', perNote:true }, + pan: { min: -1, max: 1, output: LOGARITHMIC,timescale: 'audio', perNote:true,}, + out: { min: 0, max: 1, output: LINEAR, timescale: 'audio', dimensions:1 }, + }, + Mono: { + note: { min: 50, max: 3200, output: LOGARITHMIC, timescale: 'audio', doNotProxy:true }, + frequency: { min: 50, max: 3200, output: LINEAR, timescale: 'audio' }, + amp: { min: 0, max: 1, output: LOGARITHMIC,timescale: 'audio',}, + pulsewidth :{ min: 0.01, max: .99, output: LINEAR, timescale: 'audio' }, + attack: { min:Clock.maxMeasures + 1, max: 176400, output: LOGARITHMIC, timescale:'audio'}, + decay: { min:Clock.maxMeasures + 1, max: 176400, output: LOGARITHMIC, timescale:'audio'}, + cutoff : { min: 0, max: .7, output: LINEAR, timescale: 'audio' }, + detune2: { min: 0, max: .15, output: LINEAR, timescale: 'audio' }, + detune3: { min: 0, max: .15, output: LINEAR, timescale: 'audio' }, + glide: { min:.99, max:.999995, output: LINEAR, timescale: 'audio'}, + resonance: { min: 0, max: 5.5, output: LINEAR, timescale: 'audio' }, + pan: { min: -1, max: 1, output: LOGARITHMIC,timescale: 'audio',}, + out: { min: 0, max: 1, output: LINEAR, timescale: 'audio', dimensions:1 }, + }, + FM: { + note: { min: 50, max: 3200, output: LOGARITHMIC, timescale: 'audio', doNotProxy:true }, + frequency: { min: 50, max: 3200, output: LINEAR, timescale: 'audio' }, + amp: { min: 0, max: 1, output: LOGARITHMIC,timescale: 'audio',}, + attack: { min:Clock.maxMeasures + 1, max: 176400, output: LINEAR, timescale:'audio', perNote:true}, + decay: { min:Clock.maxMeasures + 1, max: 176400, output: LINEAR, timescale:'audio', perNote:true}, + sustain: { min:Clock.maxMeasures + 1, max: 176400, output: LINEAR, timescale:'audio', perNote:true}, + release: { min:Clock.maxMeasures + 1, max: 176400, output: LINEAR, timescale:'audio', perNote:true}, + sustainLevel: { min:.01, max: 1, output: LOGARITHMIC, timescale:'audio', perNote:true}, + cmRatio : { min:.1, max:50, output:LINEAR, timescale:'audio', perNote:true }, + index: { min:.1, max:50, output:LINEAR, timescale:'audio', perNote:true }, + pan: { min: -1, max: 1, output: LOGARITHMIC,timescale: 'audio', perNote:true,}, + out: { min: 0, max: 1, output: LINEAR, timescale: 'audio', dimensions:1 }, + }, + Pluck: { + note: { min: 50, max: 3200, output: LOGARITHMIC, timescale: 'audio', doNotProxy:true }, + frequency: { min: 50, max: 3200, output: LINEAR, timescale: 'audio' }, + amp: { min: 0, max: 1, output: LOGARITHMIC,timescale: 'audio',}, + blend :{ min: 0, max: 1, output: LINEAR, timescale: 'audio', perNote:true }, + damping :{ min: 0, max: 1, output: LINEAR, timescale: 'audio', perNote:true }, + pan: { min: -1, max: 1, output: LOGARITHMIC,timescale: 'audio', perNote:true,}, + out: { min: 0, max: 1, output: LINEAR, timescale: 'audio', dimensions:1 }, + } + } + + for( var i = 0; i < types.length; i++ ) { + + (function() { + var type = Array.isArray( types[ i ] ) ? types[ i ][ 0 ] : types[ i ], + name = Array.isArray( types[ i ] ) ? types[ i ][ 1 ] : types[ i ] + + Synths[ name ] = function() { + var args = Array.prototype.slice.call( arguments, 0 ), + obj, + mv = 1, + adsr = false, + scale, + requireReleaseTrigger = false, + opts = {}, + optionsNum = typeof args[0] === 'string' ? 1 : 0 + + Gibber.processArguments2( opts, args, name ) + + for( var key in opts ) { + if( Gibber.Audio.Clock.timeProperties.indexOf( key ) > -1 ) { + opts[ key ] = Gibber.Clock.time( opts[key] ) + } + } + + obj = new Gibberish[ type ]( opts ).connect( Gibber.Master ) + obj.type = 'Gen' + + $.extend( true, obj, Gibber.Audio.ugenTemplate ) + + obj.fx.ugen = obj + + //Gibber.processArguments2( obj, args, name ) + + if( name === 'Vocoder' ) return obj + + if( name === 'Mono' ) { + obj.note = function( _frequency, amp ) { + if( typeof _frequency === 'undefined' ) return // rest + if(typeof amp !== 'undefined' && amp !== 0) this.amp = amp; + + if( amp !== 0 ) { + if(typeof this.frequency !== 'object' ){ + this.frequency = _frequency; + }else{ + if( this.frequency.type !== 'property' ) { + this.frequency[0] = _frequency; + Gibberish.dirty(this); + }else{ + this.frequency = _frequency + } + } + + this.lastFrequency = this.frequency + + if( obj.envelope.getState() > 0 ) obj.envelope.run(); + } + } + } + // override note method to allow note names + obj._note = obj.note.bind( obj ) + obj.note = function() { + var args = Array.prototype.slice.call( arguments, 0 ), + freq + + if( typeof args[0] === 'undefined' ) return + + if( Array.isArray( args[0] ) ) { + freq = args[0][0] + freq = Gibber.Theory.processFrequency( obj, freq ) + args[0][0] = freq + }else{ + args[0] = Gibber.Theory.processFrequency( obj, args[0] ) + } + + if( typeof args[1] === 'undefined' ) args[1] = this.loudness.value + + this._note.apply( this, args ) + this.processChildProperties() + + return this + } + + var propertyKeys = Object.keys( _mappingProperties[ name ] ), voiceIncr = 0 + obj.processChildProperties = function() { + for( var i = 0; i < propertyKeys.length; i++ ) { + var key = propertyKeys[ i ], name = key +'V', val + if( this[ name ] && typeof this[ name ].value !== 'undefined' ) { + if( Array.isArray( this[ name ].value ) ) { + var propIndex = voiceIncr % this[ name ].value.length + val = this[ name ].value[ propIndex ] + }else if( typeof this[ name ].value === 'function' ) { + val = this[ name ].value() + }else{ + val = this[ name ].value + } + + this.children[ this.lastChild ][ key ] = val + } + } + voiceIncr++ + } + + obj.chord = Gibber.Theory.chord.bind( obj ) + + Object.defineProperty(obj, '_', { + get: function() { obj.kill(); return obj }, + set: function() {} + }) + + //obj, _key, shouldSeq, shouldRamp, dict, _useMappings, priority + Gibber.createProxyProperties( obj, _mappingProperties[ name ] ) + Gibber.defineProperty( obj, 'loudness', true, true, { min: 0, max: 1, output: LOGARITHMIC, timescale: 'audio'}, true, true ) + + obj.trig = function() { + this.note( this.lastFrequency ) + } + + Gibber.createProxyMethods( obj, [ 'note', 'chord', 'send', 'trig' ] ) + + obj.name = name + + //Object.assign( obj, opts ) + + obj.toString = function() { return name } + + // define a continuous frequency mapping abstraction for all synths with children + if( name !== 'Mono' ) { + var __frequency = obj._frequency + Object.defineProperty( obj, 'frequency', { + configurable: true, + get: function() { return this._frequency }, + set: function(v) { + __frequency = v; + if( this.children ) { + for( var i = 0; i < this.children.length; i++ ) { + if( typeof this.children[i].frequency === 'number' ) { + this.children[i].frequency = __frequency + }else{ + this.children[i].frequency[0] = __frequency // for binops + } + } + } + } + }) + } + + var __scale = obj.scale; + + if( obj.scale ) obj.seq.scale = __scale + + Object.defineProperty(obj, 'scale', { + get: function() { return __scale }, + set: function(v) { + __scale = v; + obj.seq.scale = __scale + } + }) + + if( obj.presetInit ) obj.presetInit() + return obj + } + })() + + } + + Synths.Presets.Synth = { + short: { attack: 44, decay: 1/16, }, + bleep: { waveform:'Sine', attack:44, decay:1/16 }, + bleepEcho: { waveform:'Sine', attack:44, decay:1/16, presetInit:function() { this.fx.add( Delay(1/6,.85 ) ) } }, + cascade: { waveform:'Sine', maxVoices:10, attack:Clock.maxMeasures, decay:Clock.beats(1/32), + presetInit: function() { + this.fx.add( Gibber.Audio.FX.Delay(1/9,.2), Gibber.Audio.FX.Flanger() ) + this.pan = Sine( .25, 1 )._ + } + }, + rhodes: { waveform:'Sine', maxVoices:4, attack:44, decay:1, + presetInit: function() { this.fx.add( Gibber.Audio.FX.Tremolo(2, .2) ) }, + }, + calvin: { waveform:'PWM', maxVoices:4, amp:.075, attack:Clock.maxMeasures, decay:1/4, + presetInit: function() { this.fx.add( Gibber.Audio.FX.Delay(1/6,.5), Gibber.Audio.FX.Vibrato() ) } + }, + warble: { waveform:'Sine', attack:Clock.maxMeasures, + presetInit: function() { this.fx.add( Gibber.Audio.FX.Vibrato(2), Gibber.Audio.FX.Delay( 1/6, .75 ) ) } + }, + } + + Synths.Presets.Synth2 = { + pad2: { waveform:'Saw', maxVoices:4, attack:1.5, decay:1/2, cutoff:.3, filterMult:.35, resonance:4.5, amp:.2, + presetInit: function() { this.fx.add( Gibber.Audio.FX.Delay( 1/9, .75 ) ) } + }, + pad4: { waveform:'Saw', maxVoices:4, attack:2, decay:2, cutoff:.3, filterMult:.35, resonance:4.5, amp:.2, + presetInit: function() { this.fx.add( Gibber.Audio.FX.Delay( 1/9, .75 ) ) } + }, + } + + Synths.Presets.Mono = { + short : { attack: 44, decay: 1/16 }, + + lead : { + presetInit : function() { this.fx.add( Gibber.Audio.FX.Delay(1/4, .35), Gibber.Audio.FX.Reverb() ) }, + attack: 1/8, + decay:1/2, + octave3:0, + cutoff:.2, + filterMult:.5, + resonance:5, + isLowPass: false, + }, + + winsome : { + presetInit : function() { + this.lfo = Gibber.Audio.Oscillators.Sine( 2, .075 )._ + this.cutoff = this.lfo + this.detune2 = this.lfo + }, + attack: Clock.maxMeasures, + decay:1, + cutoff:.2, + }, + bass : { + attack: Clock.maxMeasures, + decay: 1/8 - Clock.maxMeasures, + octave: -2, + octave2 : -1, + cutoff: .5, + filterMult:.2, + resonance:1, + }, + bass2 : { + attack: Clock.maxMeasures, + decay: 1/6, + octave: -2, + octave2 : 0, + octave3 : 0, + cutoff: .5, + filterMult:.2, + resonance:1, + amp:.65 + }, + + edgy: { + presetInit: function() { + this.decay = 1/8 + this.attack = ms(1) + }, + octave: -2, + octave2 : -1, + cutoff: .5, + filterMult:.2, + resonance:1, + waveform:'PWM', + pulsewidth:.2, + detune2:0, + amp:.2, + }, + + easy : { + attack: Clock.maxMeasures, + decay:2, + octave2:0, + octave3:0, + cutoff:.3, + glide:.9995, + }, + + easyfx : { + attack: Clock.maxMeasures, + decay:2, + presetInit: function() { + this.fx.add( Gibber.Audio.FX.Delay( Clock.time(1/6), .3) ) + }, + amp:.3, + octave2:0, + octave3:0, + cutoff:.3, + glide:.9995, + }, + + dark : { + resonance:0, + attack:44, + cutoff:.075, + amp:.35, + filterMult:0 + }, + + dark2 : { + filterMult:.1, + attack: Clock.maxMeasures, + octave2:0, + octave3:0, + decay:1/4, + amp:.45, + }, + + noise: { + resonance:20, + decay:1/2, + cutoff:.3, + glide:.99995, + detune3:0, + detune2:0, + filterMult:0, + presetInit: function() { this.fx.add( Gibber.Audio.FX.Gain(.1), Gibber.Audio.FX.Delay(1/6,.35) ) } + }, + } + + Synths.Presets.FM = { + stabs:{ + maxVoices:4, + cmRatio : 1 / 1.0007, + index : 5, + attack: Clock.maxMeasures, + decay : 1/8, + amp:.1, + presetInit: function() { + this.bus = Gibber.Audio.Busses.Bus().fx.add( Gibber.Audio.FX.Delay(1/8,.75), Gibber.Audio.FX.LPF({ resonance:4 }) ) + this.bus.fx[1].cutoff = Gibber.Audio.Core.Binops.Add(.25, Gibber.Audio.Oscillators.Sine(.1,.2)._ ) + this.send( this.bus, .65 ) + }, + }, + bass : { + cmRatio:1, + index:3, + presetInit: function() { this.attack = ms(1); }, + decay:1/16, + octave:-2 + }, + glockenspiel : { + cmRatio : 3.5307, + index : 1, + attack : 44, + decay : 44100, + }, + radio : { //ljp + cmRatio : 1, + index : 40, + attack : 300 * 44.1, + decay : 500 * 44.1, + }, + noise : { //ljp + cmRatio : 0.04, + index : 1000, + attack : 1 * 44.1, + decay : 100 * 44.1, + }, + frog : { //ljp + cmRatio : 0.1, + index : 2.0, + attack : 300 * 44.1, + decay : 5 * 44.1, + }, + gong : { + cmRatio : 1.4, + index : .95, + attack : 44.1, + decay : 5000 * 44.1, + }, + drum : { + cmRatio : 1.40007, + index : 2, + attack : 44, + decay : 44100, + }, + drum2 : { + cmRatio: 1 + Math.sqrt(2), + index: .2, + attack: 44, + decay: 20 * 44.1, + }, + brass : { + maxVoices:4, + cmRatio : 1 / 1.0007, + index : 5, + attack : 4100, + decay : 1, + }, + clarinet : { + cmRatio : 3 / 2, + index : 1.5, + attack : 50 * 44.1, + decay : 200 * 44.1, + } + }; + + return Synths + +} + +},{"./clock":"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/clock.js","gibberish-dsp":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/gibberish-dsp/build/gibberish.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/theory.js":[function(require,module,exports){ +module.exports = function( Gibber ) { + "use strict" + +var teoria = require('../../external/teoria.min'), + $ = Gibber.dollar, + isInt = function(value) { return !isNaN(value) && (function(x) { return (x | 0) === x; })(parseFloat(value)) } + +var Theory = { + Teoria: teoria, + Scale : function( _root, _mode ) { + var that = { + root: typeof _root === "string" ? teoria.note(_root) : _root, + notes: [], + degree:1, + + chord : function(_notes, _offset) { + var _chord = []; + _offset = _offset || 0; + + console.log("CHORD", _notes, this ) + + for(var i = 0; i < _notes.length; i++) { + _chord.push( this.notes[ _notes[i] + _offset ] ); + } + return _chord; + }, + + create : function() { + var __root = typeof root !== 'number' ? teoria.note( root ).fq() : root, + __mode = mode + + this.notes.length = 0 + + if( Gibber.Theory.Scales[ __mode ] ) { + var scale = Gibber.Theory.Scales[ __mode ]( __root ) + scale.create( __root )// this.degree.value ) + this.notes = scale.notes + }else{ + console.log( "No scale for the mode " + mode + " exists." ) + } + }, + + set : function(__root, _mode) { + if(Array.isArray(arguments[0])) { + this.root = arguments[0][0]; + this.mode = arguments[0][1]; + }else{ + this.root = __root; + this.mode = _mode; + } + }, + }; + + var mode = _mode || 'aeolian'; + Object.defineProperty( that, 'mode', { + configurable:true, + get: function() { return mode; }, + set: function( val ) { + mode = val; + that.create(); + } + }); + + var root = _root || 440; + Object.defineProperty( that, 'root', { + get : function() { return root; }, + + set : function( val ) { + if( typeof val === 'number' ) { + root = val; + }else if ( typeof val === 'string' ) { + root = Theory.Teoria.note( val ).fq(); + }else if ( typeof val === 'object' ) { + if( val.accidental ) { + root = val.fq() + }else{ + root = Theory.Teoria.note( val.value ).fq() + } + } + + that.create() + } + }); + + // createProxyProperty: function( obj, _key, shouldSeq, shouldRamp, dict, _useMappings ) { + // obj, _key, shouldSeq, shouldRamp, dict, _useMappings, priority + + that.gibber = true // needed since createProxyProperties isn't called where this is normally set + // obj, _key, shouldSeq, shouldRamp, dict, _useMappings, priority + Gibber.createProxyProperty( that, 'root', true, false, null, false, 1 ) + Gibber.createProxyProperty( that, 'mode', true, false, null, false, 1 ) + //Gibber.defineSequencedProperty( that, 'root', 1 ) + //Gibber.defineSequencedProperty( that, 'mode', 1 ) + // Gibber.createProxyProperty( that, 'degree', true, false, null, false, 1 ) + + $.subscribe( '/gibber/clear', function() { + that.seq.isConnected = false + that.seq.isRunning = false + that.seq.destinations.length = 0 + }) + + that.create( root ) + //that.toString = function() { return 'Scale: ' + that.root() + ', ' + that.mode() } + return that; + }, + + CustomScale : function( _root, _ratios ) { + var that = { + notes : [], + degree: 1,// ___degree || 1, + ratios: _ratios || [ 1, 1.10, 1.25, 1.3333, 1.5, 1.666, 1.75 ], + + create : function( _root ) { + this.notes = []; + + var scaleRoot = typeof _root === 'number' ? _root : teoria.note( _root ).fq() ; + + for( var octave = 0; octave < 8; octave++ ) { + for( var num = 0; num < this.ratios.length; num++ ) { + var degreeNumber = num //+ _degree - 1 + var tempRoot = scaleRoot * ( 1 + Math.floor( degreeNumber / this.ratios.length ) ) + this.notes.push( tempRoot * this.ratios[ degreeNumber % this.ratios.length ] ); + } + scaleRoot *= 2; + } + + scaleRoot = typeof _root === 'number' ? _root : teoria.note( _root ).fq() ; + var negCount = 8; + for(var octave = -1; octave >= -8; octave--) { + scaleRoot /= 2; + for( var num = 0; num < this.ratios.length; num++ ) { + var noteNum = octave * this.ratios.length + num; + var degreeNumber = num //+ _degree - 1 + var tempRoot = scaleRoot * ( 1 + Math.floor( degreeNumber / this.ratios.length ) ) + this.notes[noteNum] = tempRoot * this.ratios[ degreeNumber % this.ratios.length ]; + } + } + }, + + chord : function(_notes, _offset) { + var _chord = []; + _offset = _offset || 0; + + for(var i = 0; i < _notes.length; i++) { + _chord.push( this.notes[_notes[i] + _offset] ); + } + return _chord; + } + } + + that.create( _root ); + + return that; + }, + + Scales : { + Major: function( root ) { return Theory.CustomScale( root, [1, 9/8, 5/4, 4/3, 3/2, 5/3, 15/8 ]) }, + Ionian: function( root ) { return Theory.CustomScale( root, [1, 9/8, 5/4, 4/3, 3/2, 5/3, 15/8 ]) }, + Dorian: function( root ) { return Theory.CustomScale( root, [1, 9/8, 6/5, 4/3, 3/2, 5/3, 9/5 ]) }, + Phrygian: function( root ) { return Theory.CustomScale( root, [1, 16/15, 6/5, 4/3, 3/2, 8/5, 9/5 ]) }, + Lydian: function( root ) { return Theory.CustomScale( root, [1, 9/8, 5/4, 45/32, 3/2, 5/3, 15/8 ]) }, + Mixolydian: function( root ) { return Theory.CustomScale( root, [1, 9/8, 5/4, 4/3, 3/2, 8/5, 9/5 ]) }, + Minor: function( root ) { return Theory.CustomScale( root, [1, 9/8, 6/5, 4/3, 3/2, 8/5, 9/5 ]) }, + Aeolian : function( root ) { return Theory.CustomScale( root, [1, 9/8, 6/5, 4/3, 3/2, 8/5, 9/5 ]) }, + Locrian : function( root ) { return Theory.CustomScale( root, [1, 16/15, 6/5, 4/3, 62/45, 8/5, 15/8 ]) }, + MajorPentatonic : function( root ) { return Theory.CustomScale( root, [1, 9/8, 5/4, 3/2, 5/3 ] ) }, + MinorPentatonic : function( root ) { return Theory.CustomScale( root, [1, 6/5, 4/3, 3/2, 15/8] ) }, + Chromatic: function( root ) { return Theory.CustomScale( root, [1, 16/15, 9/8, 6/5, 5/4, 4/3, 45/32, 3/2, 8/5, 5/3, 7/4, 15/8 ]) }, + // Scales contributed by Luke Taylor + // Half-Whole or Octatonic Scale + //http://en.wikipedia.org/wiki/Octatonic_scale + + HalfWhole : function(root) { return Theory.CustomScale( root, [ 1,1.059463,1.189207,1.259921,1.414214,1.498307,1.681793, 1.781797 ]); }, + + //Whole-Half or Octatonic Scale http://en.wikipedia.org/wiki/Octatonic_scale + WholeHalf : function(root) { return Theory.CustomScale( root, [ 1,1.122462,1.189207,1.334840,1.414214,1.587401,1.681793, 1.887749 ]); }, + + //Pythagorean Tuning http://en.wikipedia.org/wiki/Pythagorean_tuning + + //Chromatic scale in Pythagorean tuning + Pythagorean : function(root) { return Theory.CustomScale( root, [ 1, 256/243, 9/8, 32/27, 81/64, 4/3, 729/512, 3/2, 128/81, 27/16, 16/9, 243/128 ]); }, + + //Major Pythagorean + PythagoreanMajor : function(root) { return Theory.CustomScale( root, [ 1, 9/8, 81/64, 4/3, 3/2, 27/16, 243/128 ]); }, + + //Major Pythagorean + PythagoreanMinor : function(root) { return Theory.CustomScale( root, [ 1, 9/8, 32/27, 4/3, 3/2, 128/81, 16/9 ]); }, + + // 5-limit Just Intonation http://en.wikipedia.org/wiki/List_of_intervals_in_5-limit_just_intonation + //Chromatic scale in 5-limit just intonation + Limit5 : function(root) { return Theory.CustomScale( root, [ 1, 16/15, 9/8, 6/5, 5/4, 4/3, 45/32, 3/2, 8/5, 5/3, 9/5, 15/8 ]); }, + + //Major scale in 5-limit + Limit5Major : function(root) { return Theory.CustomScale( root, [ 1, 9/8, 5/4, 4/3, 3/2, 5/3, 15/8 ]); }, + + //Minor scale in 5-limit + Limit5Minor : function(root) { return Theory.CustomScale( root, [ 1, 9/8, 6/5, 4/3, 3/2, 8/5, 9/5 ]); }, + + // Messiaen's modes of limited transposition http://en.wikipedia.org/wiki/Modes_of_limited_transposition + Mess3 : function(root) { return Theory.CustomScale( root, [1,1.122462, 1.189207, 1.259921, 1.414214, 1.498307, 1.587401, 1.781797, 1.887749 ]) }, + Mess4 : function(root) { return Theory.CustomScale( root, [1, 1.059463, 1.122462, 1.334840, 1.414214, 1.498307, 1.587401, 1.887749 ]) }, + Mess5 : function(root) { return Theory.CustomScale( root, [1, 1.059463, 1.334840, 1.414214, 1.498307, 1.887749 ]) }, + Mess6 : function(root) { return Theory.CustomScale( root, [1, 1.122462, 1.259921, 1.334840, 1.414214, 1.587401, 1.781797, 1.887749 ]) }, + Mess7 : function(root) { return Theory.CustomScale( root, [1, 1.059463, 1.122462, 1.189207, 1.334840, 1.414214, 1.498307, 1.587401, 1.681793, 1.887749 ]) }, + + //And, a personal (anthony garcia) favorite synthetic mode, lydian flat 7: + Adams : function(root) { return Theory.CustomScale( root, [1, 1.122462, 1.259921, 1.414214, 1.498307, 1.681793, 1.781797 ]) }, + + //5 tone equal temperament //http://en.wikipedia.org/wiki/Equal_temperament#5_and_7_tone_temperaments_in_ethnomusicology + Equal5Tone : function(root) { return Theory.CustomScale( root, [ 1, 1.15, 1.32, 1.35, 1.52, 1.74 ]); }, + + //7 tone equal temperament + //http://en.wikipedia.org/wiki/Equal_temperament#5_and_7_tone_temperaments_in_ethnomusicology + Equal7Tone : function(root) { return Theory.CustomScale( root, [ 1, 1.1, 1.22, 1.35, 1.49, 1.64, 1.81 ]); }, + + Just : function(root) { return Theory.CustomScale( root, [ 1, 1.0417, 1.1250, 1.2000, 1.2500, 1.3333, 1.4063, 1.5, 1.6, 1.6667, 1.8, 1.8750] ); }, + + Shruti: function(root) { return Theory.CustomScale( root, [1,256/243,16/15,10/9,9/8,32/27,6/5,5/4,81/64,4/3,27/20,45/32,729/512,3/2,128/81,8/5,5/3,27/16,16/9,9/5,15/8,243/128,2] ); }, + }, + + processFrequency: function( obj, frequency ) { + var note = frequency + if( typeof frequency === 'string' ) { + note = Gibber.Theory.Teoria.note( frequency ).fq() + }else if( frequency < Gibber.minNoteFrequency ) { + var scale = obj.scale || Gibber.scale, + noteValue = frequency, + isNoteInteger = isInt( noteValue ), + note + + if( isNoteInteger ) { + note = scale.notes[ frequency ] + }else{ + var noteFloor = scale.notes[ Math.floor( noteValue ) ], + noteCeil = scale.notes[ Math.ceil( noteValue ) ], + float = noteValue % 1, + diff = noteCeil - noteFloor + + note = noteFloor + float * diff + } + + if( obj.octave && obj.octave !== 0 ) { + var sign = obj.octave > 0 ? 1 : 0, + num = Math.abs( obj.octave ) + + for( var i = 0; i < num; i++ ) { + note *= sign ? 2 : .5 + } + } + } + + return note + }, + + chord : function( val, volume ) { + this.notation = val; + + if( typeof this.notation === "string" ) { + var _root = this.notation.slice( 0,1 ), + _octave, + _quality; + + if( isNaN( this.notation.charAt( 1 ) ) ) { // if true, then there is a sharp or flat... + _root += this.notation.charAt( 1 ); // ... so add it to the root name + _octave = parseInt( this.notation.slice( 2,3 ) ); + _quality = this.notation.slice( 3 ); + }else{ + _octave = parseInt( this.notation.slice( 1, 2 ) ); + _quality = this.notation.slice( 2 ); + } + + var _chord = teoria.note( _root + _octave ).chord( _quality ); + for( var j = 0; j < _chord.notes.length; j++ ) { + var n = _chord.notes[ j ]; + this.note( typeof note === 'number' ? note : n.fq() ); + } + }else{ + for( var k = 0; k < this.notation.length; k++ ) { + var _note = this.scale ? this.scale.notes[ this.notation[k] ] : this.notation[ k ], + note + + switch( typeof _note ) { + case 'number': + note = _note + break; + case 'object': + if( _note.fq ) + note = _note.fq() + else + note = _note + + break; + case 'string': + note = Theory.Teoria.note( _note ).fq(); + break; + } + + this.note( note ) + } + } + + if( typeof arguments[ 1 ] !== "undefined" ) { + this.amp = arguments[ 1 ]; + } + + return this; + } + +} + +return Theory + +} + +},{"../../external/teoria.min":"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/external/teoria.min.js"}],"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/ugen.js":[function(require,module,exports){ +module.exports = function( Gibber ) { + +var Ugen = function( desc ) { + var ctor = function( props ) { + var obj = {} + $.extend( obj, { + properties: $.extend( {}, desc.inputs ), + callback: desc.callback.bind( obj ), + _init: desc.init.bind( obj ), + name: desc.name + }) + + obj.__proto__ = Gibber.Audio.Core._synth + + if( typeof props === 'object' ) { + for( var key in props ) { + obj[ key ] = props[ key ] + } + } + + var doNotCopy = ['name','inputs','callback','init'], methods = [] + + for( var key in desc ) { + if( doNotCopy.indexOf( key ) === -1 ) { + obj[ key ] = desc[ key ].bind( obj ) + methods.push( key ) + } + } + + obj.init.call( obj ) + obj.oscillatorInit.call( obj ) + + Gibber.createProxyProperties( obj, obj.properties ) + Gibber.createProxyMethods( obj, methods ) + + for( var key in desc.inputs ) { + if( typeof props === 'object' && props[ key ] ) { + obj[ key ] = props[ key ] + }else{ + obj[ key ] = desc.inputs[ key ].default + } + } + + obj._init() + + obj.connect( Gibber.Master ) + + if( arguments.length > 0 ) + Gibber.processArguments2( obj, Array.prototype.slice.call( arguments, 0), obj.name ) + + $.extend( true, obj, Gibber.Audio.ugenTemplate ) + obj.fx.ugen = obj + + return obj + } + + return ctor +} + +return Ugen + +} + +/* + +// create constructor for XXX object using ugen factory +// this code would be used by end-users to create new ugens +XXX = Ugen({ + name:'Vox', + inputs:{ + frequency:{ min:50, max:3000, default:440 }, + amp: { min:0, max:1, default:.1 } + }, + callback: function( frequency, amp ) { + this.out = this.sin( this.PI2 * (this.phase++ * frequency / 44100) ) * amp + + // if stereo, make this.out an array an fill appropriately + // do not create a new array for every sample + return this.out + }, + init: function() { + this.sin = Math.sin + this.PI2 = Math.PI * 2 + this.phase = 0 + this.out = 0 + } +}) + +// instantiate using constructor +// frequency and amp are set to arguments +a = XXX( 330, .25 ) + +// can also pass dictionary +b = XXX({ frequency:250, amp:.1 }) + +// automatic sequencing of properties +a.frequency.seq( [440,880], 1/2 ) + +*/ +},{}],"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/vocoder.js":[function(require,module,exports){ +module.exports = function( Gibber ) { + "use strict" + + var Vocoder = { Presets: {} }, + Gibberish = require( 'gibberish-dsp' ), + $ = Gibber.dollar, + Clock = require( './clock' )( Gibber ), + curves = Gibber.outputCurves, + LINEAR = curves.LINEAR, + LOGARITHMIC = curves.LOGARITHMIC, + mappingProperties = { + amp: { min: 0, max: 1, output: LOGARITHMIC,timescale: 'audio',}, + pan: { min: -1, max: 1, output: LOGARITHMIC,timescale: 'audio',}, + out: { min: 0, max: 1, output: LINEAR, timescale: 'audio', dimensions:1 }, + } + + Vocoder.Vocoder = function( carrier, modulator, numBands, startFreq, endFreq, Q ) { + var vocoder = new Gibberish.Vocoder( carrier, modulator, numBands, startFreq, endFreq, Q ).connect( Gibber.Master ) + + vocoder.type = 'Gen' + + $.extend( true, vocoder, Gibber.Audio.ugenTemplate ) + + vocoder.fx.ugen = vocoder + + return vocoder + } + + Vocoder.Robot = function( _options ) { + var carrier, modulator, options = _options || {}, robot + + robot = Gibber.Audio.Vocoder.Vocoder( null, null, options.numBands || 16 ) + + robot.disconnect() + + if( isNaN( options.maxVoices ) ) { options.maxVoices = 1 } + if( isNaN( options.resonance ) ) { options.resonance = 4 } + if( isNaN( options.attack ) ) { options.attack = ms(1) } + if( isNaN( options.decay ) ) { options.decay = measures(8) } + if( isNaN( options.pulsewidth) ) { options.pulsewidth = .05 } + + robot.carrier = Gibber.Audio.Synths.Synth2( options ) + robot.note = robot.carrier.note.bind( robot ) + robot._note = robot.carrier._note.bind( robot ) + robot.chord = robot.carrier.chord.bind( robot ) + //robot._note = robot.carrier._note.bind( robot ) + robot.carrier._ + + // in case robot.say.seq is called before module is loaded... + var storeSayValues, storeSayDurations, storeInit = false + robot.say = function( values, durations ) { + if( storeInit === false ) { + storeSayValues = values + storeSayDurations = durations + storeInit = true + } + } + + function initRobot() { + robot.modulator = Speak( options ) + robot.modulator._ + + robot.say = robot.modulator.say.bind( robot ) + Gibber.defineSequencedProperty( robot, 'say' ) + + if( storeInit ) { + robot.say.values = storeSayValues + robot.say.durations = storeSayDurations + } + + robot.connect() + } + + if( ! Gibber.Modules[ 'gibber/publications/SpeakLib' ] ) { + Gibber.import( 'gibber/publications/SpeakLib' ).done( function(speak) { + var clear = setInterval( function() { + if( typeof Speak !== 'undefined' ) { + initRobot() + clearInterval( clear ) + } + }, 250 ) + }) + }else{ + initRobot() + } + + Gibber.defineSequencedProperty( robot, 'say' ) + Gibber.defineSequencedProperty( robot, 'chord' ) + Gibber.defineSequencedProperty( robot, 'note' ) + + $.extend( true, robot, Gibber.Audio.ugenTemplate ) + + Gibber.createProxyProperties( robot, mappingProperties ) + + + return robot + } + + return Vocoder +} + +},{"./clock":"/Users/thecharlie/Documents/www/gibber.audio.lib/scripts/gibber/audio/clock.js","gibberish-dsp":"/Users/thecharlie/Documents/www/gibber.audio.lib/node_modules/gibberish-dsp/build/gibberish.js"}]},{},["./scripts/gibber/audio.lib.js"])("./scripts/gibber/audio.lib.js") +}); \ No newline at end of file diff --git a/public/vendor/gibber.audio.lib.min.js b/public/vendor/gibber.audio.lib.min.js new file mode 100755 index 000000000..402cbcbbd --- /dev/null +++ b/public/vendor/gibber.audio.lib.min.js @@ -0,0 +1,9 @@ +!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var t;"undefined"!=typeof window?t=window:"undefined"!=typeof global?t=global:"undefined"!=typeof self&&(t=self),t.Gibber=e()}}(function(){var define,module,exports;return function e(t,n,i){function r(s,a){if(!n[s]){if(!t[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);throw new Error("Cannot find module '"+s+"'")}var c=n[s]={exports:{}};t[s][0].call(c.exports,function(e){var n=t[s][1][e];return r(n?n:e)},c,c.exports,e,t,n,i)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;sn;n++){var r=Object.prototype.toString.call(this[n]).split(" ").pop().split("]").shift().toLowerCase();r&&(t=t.concat(/^(array|collection|arguments|object)$/.test(r)?e.call(this[n]):this[n]))}return t},t=function(e,t){for(var n=[],i=0;t>i;i++)n.push([1]);for(var r=i;e>r;r++)n.push(0);return n},n=function(e){for(var t=0,n=0,i=0;it?(t=e[i].length,n=1):e[i].length===t&&n++);return n},i=function(i,o,s){function a(t,i){var r=0===u++?i:n(c),o=c.length-r,s=r>=o?o:r;if(s>1||1===u)for(var l=0;s>l;l++){var f=c.pop(),h=Array.isArray(f);c[l].push(f),h&&e.call(c[l])}return t%i!==0?a(i,t%i):e.call(c)}var u=0,c=t(o,i);return r(a(o,i),s)},r=function(e,t){var n=[];console.log(e,t),"undefined"==typeof t&&(t=1/e.length);for(var i=0,r=0;i0)for(var ___i___=0;___i___-1){var y=l?e.seq.autofire.splice(m,1)[0]:o.splice(m,1)[0];for(var v in e.seq.timeline){var x=e.seq.timeline[v],w=x.indexOf(y);w>-1&&x.splice(w,1)}e.seq.add(b,m)}else e.seq.add(b),c=e.seq.seqs.length-1;return l||(r[t][u]=c),i[u]={},Object.defineProperties(i[u],{values:{configurable:!0,get:function(){return p},set:function(t){var n=Gibber.construct(Gibber.Pattern,t);Array.isArray(n)||(n=[n]),null!==h?e.seq.seqs[c].values=n:e.seq.autofire[c].values=n}},durations:{configurable:!0,get:function(){return d},set:function(t){Array.isArray(t)||(t=[t]);var n=Gibber.construct(Gibber.Pattern,t);Array.isArray(n)||(n=[n]),e.seq.seqs[c].durations=n}}}),i[u].seq=function(e,t){i.seq(e,t,u)},e.seq.isRunning||(e.seq.offset=Gibber.Clock.time(e.offset),e.seq.start(!0,n)),i.seq.stop=function(){for(var e=r[t],n=0;n=-1&&r.follow.input[i.Name].targets.splice(a,1),r.follow.input=t,-1===t[s].targets.indexOf(n)&&t[s].targets.push([n,n.Name])}else r.bus.disconnect(),r.follow.remove(),e.createMappingObject(n,t)},n.object.mod?n.object.mod(n.propertyName,r,"="):n.modObject?n.modObject.mod(n.modName,r,"="):!function(){var e=r;n.object.update=function(){n.object[n.propertyName](e.getValue())}}(),r.remove=function(){this.bus.disconnect(),this.follow&&(this.follow.count--,0===this.follow.count&&(delete i.object.track,this.follow.remove())),n.object.mod?n.object.removeMod(n.propertyName):n.modObject&&n.modObject.removeMod(n.modName),n.object.mappings.splice(n.object.mappings.indexOf(r),1),i.object.mappings.splice(i.object.mappings.indexOf(r),1);var e=n.object[n.Name].targets,o=e.indexOf(t);-1!==o&&e.splice(o,1),delete n.object[n.Name].mapping},r}},notation:{graphics:function(t,n){var i,r=e.Audio.Core.Binops.Map(n.object[n.propertyName],t.min,t.max,n.min,n.max,t.output,n.wrap),o=r.getValue.bind(r);return r.getValue=function(){return r.callback(n.object[n.propertyName],t.min,t.max,n.min,n.max,t.output,n.wrap),o()},i=t.object[t.Name].mapping=r,t.object.mod?t.object.mod(t.propertyName,i,"="):t.modObject.mod(t.modName,i,"="),i.remove=function(){t.object.mod?t.object.removeMod(t.propertyName):t.modObject.removeMod(t.modName),t.object[t.propertyName]=t.object[t.Name].mapping.getValue(),delete t.object[t.Name].mapping},i.replace=function(e){i.input=e},i},"interface":function(t,n){var i,r=e.Audio.Core.Binops.Map(n.object[n.propertyName],t.min,t.max,n.min,n.max,t.output,n.wrap);"undefined"==typeof n.object.functions&&(n.object.functions={},n.object.onvaluechange=function(){for(var e in n.object.functions)n.object.functions[e]()}),i=t.object[t.Name].mapping=r,t.mapping.from=n;var o=t.propertyName+" <- "+n.object.propertyName+"."+n.Name;if(n.object.functions[o]=function(){var e=i.callback(n.object[n.propertyName],t.min,t.max,n.min,n.max,t.output,n.wrap);t.object[t.Name].oldSetter.call(t.object[t.Name],e)},i.replace=function(){},i.remove=function(){console.log("mapping removed"),delete n.object.functions[o]},n.object.setValue&&n.object.setValue(t.object[t.propertyName]),"undefined"!=typeof n.object.label){for(var s="",a=0;a=-1&&i.follow.input[n.Name].targets.splice(a,1),i.follow.input=r,-1===r[s].targets.indexOf(t)&&r[s].targets.push([t,t.Name])}else i.bus.disconnect(),i.follow.remove(),e.createMappingObject(t,r)},i.update=function(){t.object[t.propertyName](i.getValue())},i.text=t.object,e.Environment.Notation.add(i),i.remove=function(){this.bus.disconnect(),this.follow&&(this.follow.count--,0===this.follow.count&&(delete n.object.track,this.follow.remove())),e.Environment.Notation.remove(i),delete t.object[t.Name].mapping},i}}};return t},t.exports.outputCurves={LINEAR:0,LOGARITHMIC:1}},{}],5:[function(e,t){t.exports=function(t){"use strict";var n=e("./dollar"),i={concat:function(e){this.values=this.values.concat(e.values)},toString:function(){return this.values.toString()},valueOf:function(){return this.values},getLength:function(){var e;return e=this.start<=this.end?this.end-this.start+1:this.values.length+this.end-this.start+1},runFilters:function(e,t){for(var n=[e,1,t],i=0;i-1?Math.floor(i.start+i.phase%r):Math.floor(i.end+i.phase%r),t=i.values[Math.floor(e%i.values.length)],n=i.runFilters(t,e),i.phase+=i.stepSize*n[1],t=n[0],"function"==typeof t&&(t=t()),i.update&&(i.update.value=t),t};n.extend(i,{start:0,end:0,phase:0,values:Array.prototype.slice.call(arguments,0),original:null,storage:[],stepSize:1,integersOnly:!1,filters:[],onchange:null,range:function(){var e,t;return Array.isArray(arguments[0])?(e=arguments[0][0],t=arguments[0][1]):(e=arguments[0],t=arguments[1]),t>e?(i.start=e,i.end=t):(i.start=t,i.end=e),this.checkForUpdateFunction("range",[i]),i},set:function(){var e=Array.isArray(arguments[0])?arguments[0]:arguments;i.values.length=0;for(var t=0;tn;n+=1,r-=1)e=t[n],t[n]=t[r],t[r]=e;return i._onchange(),i},repeat:function(){for(var e={},t=0;t0)for(;e>0;){var t=i.values.pop();i.values.unshift(t),e--}else if(0>e)for(;0>e;){var n=i.values.shift();i.values.push(n),e++}return i._onchange(),i}}),Object.defineProperty(i,"size",{get:function(){return this.values.length},set:function(){t.log("cannot set size of pattern; use pattern.set() to update pattern contents.")}}),i.retrograde=i.reverse.bind(i),i.end=i.values.length-1,i.original=i.values.slice(0),i.storage[0]=i.original.slice(0),i.integersOnly=i.values.every(function(e){return e===+e&&e===(0|e)});var o=["rotate","switch","invert","reset","flip","transpose","reverse","shuffle","scale","store","range","set"];return t.createProxyMethods(i,o,!0),i.listeners={},t.createProxyProperties(i,{stepSize:0,start:0,end:0}),i.__proto__=this.__proto__,i};return r.listeners={},r.prototype=i,r}},{"./dollar":1}],6:[function(e,t){t.exports=function(e){"use strict";var t=[],n=!1,i=(e.dollar,e.Audio?e.Audio.Core:null,e.Clock,Math.random,{seq:function(){var e=arguments[0],t=typeof e,n=null;return"object"===t&&Array.isArray(e)&&(t="array"),n},random:function(){return this.randomFlag=!0,this.randomArgs=Array.prototype.slice.call(arguments,0),this},random2:function(){for(var e={},t=null,n=this,r=0;r=e[o].repeat&&(e[o].count=0,t=null)):(r=i.rndi(0,n.length-1),s=n[r],"undefined"!=typeof e[""+s]?(e[""+s].count=1,t=r):t=null),n[r]},this.pick},choose:function(e){var t=null;if(isNaN(e)&&(e=1),1!==e){for(var n=[],r=0;e>r;r++)n[r]=this[i.rndi(0,this.length-1)];t=n}else t=this[i.rndi(0,this.length-1)];return t},future:function(t,n){var i=0,r=e.Audio.Seqs.Seq(function(){1===i&&(t(),r.stop(),r.disconnect()),i++},e.Audio.Clock.time(n));return function(){r.stop(),r.disconnect()}},shuffle:function(e){for(var t,n,i=e.length;i;t=parseInt(Math.random()*i),n=e[--i],e[i]=e[t],e[t]=n);},solo:function(e){var r=Array.prototype.slice.call(arguments,0); +if(e){n&&i.solo();for(var o=0;o0&&(r[o]=s.fx[s.fx.length-1])}for(var a=0;an;n++)this[n]=t();return this},merge:function(){for(var e=[],t=0;tr){t=o;break}return t},this},gibberArray:function(){},rndf:function(e,t,n,r){if(r="undefined"==typeof r?!0:r,"undefined"==typeof n&&"object"!=typeof e){1==arguments.length?(t=arguments[0],e=0):2==arguments.length?(e=arguments[0],t=arguments[1]):(e=0,t=1);var o=t-e,s=Math.random(),a=o*s;return e+a}var u=[],c=[];"undefined"==typeof n&&(n=t||e.length);for(var l=0;n>l;l++){var f;if("object"==typeof arguments[0])f=arguments[0][rndi(0,arguments[0].length-1)];else if(r)f=i.rndf(e,t);else{for(f=i.rndf(e,t);c.indexOf(f)>-1;)f=i.rndf(e,t);c.push(f)}u.push(f)}return u},Rndf:function(){{var e,t,n,r;Math.random}return 0===arguments.length?(e=0,t=1):1===arguments.length?(t=arguments[0],e=0):2===arguments.length?(e=arguments[0],t=arguments[1]):3===arguments.length?(e=arguments[0],t=arguments[1],n=arguments[2]):(e=arguments[0],t=arguments[1],n=arguments[2],r=arguments[3]),function(){var o,s,a;return s="function"==typeof e?e():e,a="function"==typeof t?t():t,o="undefined"==typeof n?i.rndf(s,a):i.rndf(s,a,n,r)}},rndi:function(e,t,n,r){var o;if(0===arguments.length?(e=0,t=1):1===arguments.length?(t=arguments[0],e=0):2===arguments.length?(e=arguments[0],t=arguments[1]):(e=arguments[0],t=arguments[1],n=arguments[2],r=arguments[3]),o=t-e,n>o&&(r=!0),"undefined"==typeof n)return o=t-e,Math.round(e+Math.random()*o);for(var s=[],a=[],u=0;n>u;u++){var c;if(r)c=i.rndi(e,t);else{for(c=i.rndi(e,t);a.indexOf(c)>-1;)c=i.rndi(e,t);a.push(c)}s.push(c)}return s},Rndi:function(){{var e,t,n,r,o;Math.random,Math.round}return 0===arguments.length?(e=0,t=1):1===arguments.length?(t=arguments[0],e=0):2===arguments.length?(e=arguments[0],t=arguments[1]):3===arguments.length?(e=arguments[0],t=arguments[1],n=arguments[2]):(e=arguments[0],t=arguments[1],n=arguments[2],r=arguments[3]),o=t-e,"number"==typeof n&&n>o&&(r=!0),function(){var o,s,a;return s="function"==typeof e?e():e,a="function"==typeof t?t():t,o="undefined"==typeof n?i.rndi(s,a):i.rndi(s,a,n,r)}},"export":function(e){e.rndi=i.rndi,e.rndf=i.rndf,e.Rndi=i.Rndi,e.Rndf=i.Rndf,e.future=i.future,e.solo=i.solo},init:function(){Array.prototype.random=Array.prototype.rnd=i.random}});return i}},{}],7:[function(_dereq_,module,exports){(function(global){!function(e,t){"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():e.Gibberish=t()}(this,function(){function createInput(){console.log("connecting audio input..."),navigator.getUserMedia({audio:!0},function(e){console.log("audio input connected"),Gibberish.mediaStreamSource=Gibberish.context.createMediaStreamSource(e),Gibberish.mediaStreamSource.connect(Gibberish.node),_hasInput=!0},function(e){console.log(e),console.log("error opening audio input")})}var Gibberish={memo:{},codeblock:[],analysisCodeblock:[],analysisUgens:[],dirtied:[],id:0,isDirty:!1,out:null,debug:!1,callback:"",audioFiles:{},sequencers:[],callbackArgs:["input"],callbackObjects:[],analysisCallbackArgs:[],analysisCallbackObjects:[],onBlock:null,createCallback:function(){this.memo={},this.codeblock.length=0,this.callbackArgs.length=0,this.callbackObjects.length=0,this.analysisCallbackArgs.length=0,this.dirtied.length=0,this.codestring=" ",this.args=["input"],this.out.codegen();var e=this.codeblock.slice(0);if(this.analysisUgens.length>0){this.analysisCodeblock.length=0;for(var t=0;t0){this.analysisCodeblock.length=0;for(var t=0;tl;l++){for(var h=0;hs;s+=2){for(var u=0;u0){var c=new Float32Array(u);t(c),e=n.mozWriteAudio(c),a=n.mozCurrentSampleOffset(),ei;i++){var r=-1+i/1024*2;e[i]=n*(Math.cos(r)-Math.sin(r)),t[i]=n*(Math.cos(r)+Math.sin(r))}return function(n,i,r){var o,s,a,u,c,l,f="object"==typeof n,h=f?n[0]:n,p=f?n[1]:n;return o=1023*(i+1)/2,s=0|o,a=o-s,s=1023&s,u=1023===s?0:s+1,c=e[s],l=e[u],r[0]=(c+a*(l-c))*h,c=t[s],l=t[u],r[1]=(c+a*(l-c))*p,r}},defineUgenProperty:function(e,t,n){var i=n.properties[e]={value:t,binops:[],parent:n,name:e};Object.defineProperty(n,e,{configurable:!0,get:function(){return i.value},set:function(e){i.value=e,Gibberish.dirty(n)}})},polyInit:function(e){e.mod=e.polyMod,e.removeMod=e.removePolyMod,e.voicesClear=function(){if(e.children.length>0){for(var t=0;te.length-1?0:n+1;return frac=t-n,e[n]+frac*(e[i]-e[n])},pushUnique:function(e,t){for(var n=e,i=!0,r=0;r0&&"object"==typeof arguments[0][0]&&"undefined"===arguments[0][0].type){var t=arguments[0][0];for(var e in t)this[e]=t[e]}return this.initialized=!0,this},mod:function(e,t,n){var i=this.properties[e],r={ugen:t,binop:n};i.binops.push(r),Gibberish.dirty(this)},removeMod:function(e,t){if("undefined"==typeof t)this.properties[e].binops.length=0;else if("number"==typeof t)this.properties[e].binops.splice(t,1);else if("object"==typeof t)for(var n=0,i=this.properties[e].binops.length;i>n;n++)this.properties[e].binops[n].ugen===t&&this.properties[e].binops.splice(n,1);Gibberish.dirty(this)},polyMod:function(e,t,n){for(var i=0;i-1&&this.destinations.splice(n,1),e.removeConnection(this);else{for(var i=0;i-1;)this.splice(o,1),o=this.indexOf(e);this.parent&&Gibberish.dirty(this.parent)},Array2.prototype.get=function(e){if("number"==typeof e)return this[e];if("string"==typeof e)for(var t=0;t-1)return this[i]}return null},Array2.prototype.replace=function(e,t){if(t.parent=this,t.input=e.input,"number"!=typeof e){var n=this.indexOf(e);n>-1&&this.splice(n,1,t)}else this.splice(e,1,t);this.parent&&Gibberish.dirty(this.parent)},Array2.prototype.insert=function(e,t){if(e.parent=this,this.input=this.parent,Array.isArray(e))for(var n=0;nc;c++){var l;if("object"==typeof arguments[0])l=arguments[0][rndi(0,arguments[0].length-1)];else if(i)l=Gibberish.rndf(e,t);else{for(l=Gibberish.rndf(e,t);u.indexOf(l)>-1;)l=Gibberish.rndf(e,t);u.push(l)}a.push(l)}return a},Gibberish.Rndf=function(){{var e,t,n,i;Math.random}return 0===arguments.length?(e=0,t=1):1===arguments.length?(t=arguments[0],e=0):2===arguments.length?(e=arguments[0],t=arguments[1]):3===arguments.length?(e=arguments[0],t=arguments[1],n=arguments[2]):(e=arguments[0],t=arguments[1],n=arguments[2],i=arguments[3]),function(){var r,o,s;return o="function"==typeof e?e():e,s="function"==typeof t?t():t,r="undefined"==typeof n?Gibberish.rndf(o,s):Gibberish.rndf(o,s,n,i)}},Gibberish.rndi=function(e,t,n,i){var r;if(0===arguments.length?(e=0,t=1):1===arguments.length?(t=arguments[0],e=0):2===arguments.length?(e=arguments[0],t=arguments[1]):(e=arguments[0],t=arguments[1],n=arguments[2],i=arguments[3]),r=t-e,n>r&&(i=!0),"undefined"==typeof n)return r=t-e,Math.round(e+Math.random()*r);for(var o=[],s=[],a=0;n>a;a++){var u;if(i)u=Gibberish.rndi(e,t);else{for(u=Gibberish.rndi(e,t);s.indexOf(u)>-1;)u=Gibberish.rndi(e,t);s.push(u)}o.push(u)}return o},Gibberish.Rndi=function(){{var e,t,n,i,r;Math.random,Math.round}return 0===arguments.length?(e=0,t=1):1===arguments.length?(t=arguments[0],e=0):2===arguments.length?(e=arguments[0],t=arguments[1]):3===arguments.length?(e=arguments[0],t=arguments[1],n=arguments[2]):(e=arguments[0],t=arguments[1],n=arguments[2],i=arguments[3]),r=t-e,"number"==typeof n&&n>r&&(i=!0),function(){var r,o,s;return o="function"==typeof e?e():e,s="function"==typeof t?t():t,r="undefined"==typeof n?Gibberish.rndi(o,s):Gibberish.rndi(o,s,n,i)}},Gibberish.extend=function(e,t){for(var n in t){{n.split(".")}t[n]instanceof Array&&t[n].length<100?(e[n]=t[n].slice(0),"fx"===n&&(e[n].parent=t[n].parent)):"object"!=typeof t[n]||null===t[n]||t[n]instanceof Float32Array?e[n]=t[n]:(e[n]=e[n]||{},arguments.callee(e[n],t[n]))}return e},Function.prototype.clone=function(){return eval("["+this.toString()+"]")[0]},String.prototype.format=function(e,t,n){function i(){var i=this,r=arguments.length+1;for(e=0;r>e;n=arguments[e++])t=n,i=i.replace(RegExp("\\{"+(e-1)+"\\}","g"),t);return i}return i.native=String.prototype.format,i}(),Gibberish.future=function(e,t){var n=new Gibberish.Sequencer({values:[function(){},function(){e(),n.stop(),n.disconnect()}],durations:[t]}).start();return n.cancel=function(){n.stop(),n.disconnect()},n},Gibberish.Proxy=function(){var e=0;Gibberish.extend(this,{name:"proxy",type:"effect",properties:{},callback:function(){return e}}).init(),this.input=arguments[0],e=this.input.parent[this.input.name],delete this.input.parent[this.input.name],this.input.parent.properties[this.input.name].value=this,Object.defineProperty(this.input.parent,this.input.name,{get:function(){return e},set:function(t){e=t}}),Gibberish.dirty(this.input.parent)},Gibberish.Proxy.prototype=new Gibberish.ugen,Gibberish.Proxy2=function(){var e=arguments[0],t=arguments[1];Gibberish.extend(this,{name:"proxy2",type:"effect",properties:{},callback:function(){var n=e[t];return Array.isArray(n)?(n[0]+n[1]+n[2])/3:n}}).init(),this.getInput=function(){return e},this.setInput=function(t){e=t},this.getName=function(){return t},this.setName=function(e){t=e}},Gibberish.Proxy2.prototype=new Gibberish.ugen,Gibberish.Proxy3=function(){var e=arguments[0],t=arguments[1];Gibberish.extend(this,{name:"proxy3",type:"effect",properties:{},callback:function(){var n=e[t];return n||0}}),this.init(),this.codegen=function(){console.log(" CALLED "),this.variable||(this.variable=Gibberish.generateSymbol("v")),Gibberish.callbackArgs.push(this.symbol),Gibberish.callbackObjects.push(this.callback),this.codeblock="var "+this.variable+" = "+this.symbol+"("+e.properties[t].codegen()+");\n"}},Gibberish.Proxy3.prototype=new Gibberish.ugen,Gibberish.oscillator=function(){this.type="oscillator",this.oscillatorInit=function(){return this.fx=new Array2,this.fx.parent=this,this}},Gibberish.oscillator.prototype=new Gibberish.ugen,Gibberish._oscillator=new Gibberish.oscillator,Gibberish.Wavetable=function(){var e=0,t=null,n=Gibberish.context.sampleRate/1024;this.properties={frequency:440,amp:.25,sync:0},this.getTable=function(){return t},this.setTable=function(e){t=e,n=Gibberish.context.sampleRate/t.length},this.getTableFreq=function(){return n},this.setTableFreq=function(e){n=e},this.getPhase=function(){return e},this.setPhase=function(t){e=t},this.callback=function(i,r){var o,s,a,u,c;for(e+=i/n;e>=1024;)e-=1024;return o=0|e,s=e-o,o=1023&o,a=1023===o?0:o+1,u=t[o],c=t[a],(u+s*(c-u))*r}},Gibberish.Wavetable.prototype=Gibberish._oscillator,Gibberish.Table=function(e){this.__proto__=new Gibberish.Wavetable,this.name="table";var t=2*Math.PI;if("undefined"==typeof e){e=new Float32Array(1024);for(var n=1024;n--;)e[n]=Math.sin(n/1024*t)}this.setTable(e),this.init(),this.oscillatorInit()},Gibberish.asmSine=function(e,t,n){"use asm";function i(){for(var e=1024,t=1024;e=e-1|0;)t-=1,u[e>>2]=+s(+(t/1024)*6.2848);l=44100/1024}function r(e,t,n){e=+e,t=+t,n=+n;var i=0,r=0,o=0,s=0,f=0,h=0;return a=+(a+e/l),a>=1024&&(a=+(a-1024)),i=+c(a),s=a-i,r=~~i,o=(r|0)==1024?0:r+1|0,f=+u[r>>2],h=+u[o>>2],+((f+s*(h-f))*t)}function o(e){return e|=0,+u[e>>2]}var s=e.Math.sin,a=0,u=new e.Float32Array(n),c=e.Math.floor,l=0;return{init:i,gen:r,get:o}},Gibberish.asmSine2=function(){this.properties={frequency:440,amp:.5,sr:Gibberish.context.sampleRate},this.name="sine";var e=new ArrayBuffer(4096),t=Gibberish.asmSine(window,null,e);return t.init(),this.getTable=function(){return e},this.get=t.get,this.callback=t.gen,this.init(),this.oscillatorInit(),this.processProperties(arguments),this},Gibberish.asmSine2.prototype=Gibberish._oscillator,Gibberish.Sine=function(){this.__proto__=new Gibberish.Wavetable,this.name="sine";for(var e=2*Math.PI,t=new Float32Array(1024),n=1024;n--;)t[n]=Math.sin(n/1024*e);this.setTable(t),this.init(arguments),this.oscillatorInit(),this.processProperties(arguments)},Gibberish.Sine2=function(){this.__proto__=new Gibberish.Sine,this.name="sine2";var e=this.__proto__.callback,t=Gibberish.makePanner(),n=[0,0];this.callback=function(i,r,o){var s=e(i,r);return n=t(s,o,n)},this.init(),this.oscillatorInit(),Gibberish.defineUgenProperty("pan",0,this),this.processProperties(arguments)},Gibberish.Square=function(){this.__proto__=new Gibberish.Wavetable,this.name="square";for(var e=(2*Math.PI,new Float32Array(1024)),t=1024;t--;)e[t]=t/1024>.5?1:-1;this.setTable(e),this.init(arguments),this.oscillatorInit(),this.processProperties(arguments)},Gibberish.Saw=function(){this.__proto__=new Gibberish.Wavetable,this.name="saw";for(var e=new Float32Array(1024),t=1024;t--;)e[t]=4*((t/1024/2+.25)%.5-.25);this.setTable(e),this.init(arguments),this.oscillatorInit(),this.processProperties(arguments)},Gibberish.Saw2=function(){this.__proto__=new Gibberish.Saw,this.name="saw2";var e=this.__proto__.callback,t=Gibberish.makePanner(),n=[0,0];this.callback=function(i,r,o){var s=e(i,r);return n=t(s,o,n)},this.init(),Gibberish.defineUgenProperty("pan",0,this)},Gibberish.Triangle=function(){this.__proto__=new Gibberish.Wavetable,this.name="triangle";for(var e=new Float32Array(1024),t=Math.abs,n=1024;n--;)e[n]=1-4*t((n/1024+.25)%1-.5);this.setTable(e),this.init(arguments),this.oscillatorInit(),this.processProperties(arguments)},Gibberish.Triangle2=function(){this.__proto__=new Gibberish.Triangle,this.name="triangle2";var e=this.__proto__.callback,t=Gibberish.makePanner(),n=[0,0];this.callback=function(i,r,o){var s=e(i,r);return t(s,o,n)},this.init(),this.oscillatorInit(),Gibberish.defineUgenProperty("pan",0,this),this.processProperties(arguments)},Gibberish.Saw3=function(){var e=0,t=0,n=2.5,i=-1.5,r=0,o=Math.sin,s=11;pi_2=2*Math.PI,flip=0,signHistory=0,ignore=!1,sr=Gibberish.context.sampleRate,Gibberish.extend(this,{name:"saw",properties:{frequency:440,amp:.15,sync:0,sr:Gibberish.context.sampleRate},callback:function(a,u){var c=a/sr,l=.5-c,f=s*l*l*l*l,h=.376-.752*c,p=1-2*c,d=0;return t+=c,t-=t>1?2:0,e=.5*(e+o(pi_2*(t+e*f))),d=n*e+i*r,r=e,d+=h,d*=p,d*u}}),Object.defineProperty(this,"scale",{get:function(){return s},set:function(e){s=e}}),this.init(),this.oscillatorInit(),this.processProperties(arguments)},Gibberish.Saw3.prototype=Gibberish._oscillator,Gibberish.PWM=function(){var e=0,t=0,n=0,i=0,r=0,o=2.5,s=-1.5,a=Math.sin,u=11;pi_2=2*Math.PI,test=0,sr=Gibberish.context.sampleRate,Gibberish.extend(this,{name:"pwm",properties:{frequency:440,amp:.15,pulsewidth:.05,sr:Gibberish.context.sampleRate},callback:function(c,l,f){var h=c/sr,p=.5-h,d=u*p*p*p*p,b=1-2*h,m=0;return r+=h,r-=r>1?2:0,e=.5*(e+a(pi_2*(r+e*d))),t=.5*(t+a(pi_2*(r+t*d+f))),m=t-e,m=o*m+s*(n-i),n=e,i=t,m*b*l}}),Object.defineProperty(this,"scale",{get:function(){return u},set:function(e){u=e}}),this.init(),this.oscillatorInit(),this.processProperties(arguments)},Gibberish.PWM.prototype=Gibberish._oscillator,Gibberish.Noise=function(){var e=Math.random;Gibberish.extend(this,{name:"noise",properties:{amp:1},callback:function(t){return(2*e()-1)*t}}),this.init(),this.oscillatorInit(),this.processProperties(arguments)},Gibberish.Noise.prototype=Gibberish._oscillator,Gibberish.KarplusStrong=function(){var e=[0],t=0,n=Math.random,i=Gibberish.makePanner(),r=Gibberish.context.sampleRate,o=[0,0];Gibberish.extend(this,{name:"karplus_strong",frequency:0,properties:{blend:1,damping:0,amp:1,channels:2,pan:0,velocity:1},note:function(t,i){if("undefined"!=typeof t){var o=Math.floor(r/t);e.length=0;for(var s=0;o>s;s++)e[s]=2*n()-1;i&&(this.velocity=i),this.frequency=t}},callback:function(r,s,a,u,c,l){var f=e.shift(),h=n()>r?-1:1;s=s>0?s:0;var p=h*(f+t)*(.5-s/100);return t=p,e.push(p),p*=a*l,1===u?p:i(p,c,o)}}).init().oscillatorInit().processProperties(arguments)},Gibberish.KarplusStrong.prototype=Gibberish._oscillator,Gibberish.PolyKarplusStrong=function(){this.__proto__=new Gibberish.Bus2,Gibberish.extend(this,{name:"poly_karplus_strong",maxVoices:5,voiceCount:0,_frequency:0,polyProperties:{blend:1,damping:0,velocity:1},note:function(e,t){var n=this.children[this.voiceCount++];this.voiceCount>=this.maxVoices&&(this.voiceCount=0),n.note(e,t),this._frequency=e},initVoices:function(){for(var e=0;ei;i++)e+=arguments[i];return e*=n}}),this.init(),this.processProperties(arguments),this},Gibberish.Bus.prototype=Gibberish._bus,Gibberish.Bus2=function(){this.name="bus2",this.type="bus",this.properties={inputs:[],amp:1,pan:0};var e=[0,0],t=Gibberish.makePanner();this.callback=function(){var n=arguments,i=n.length,r=n[i-2],o=n[i-1];e[0]=e[1]=0;for(var s=0,a=i-2;a>s;s+=2){var u="object"==typeof n[s],c=n[s+1];e[0]+=u?n[s][0]*c||0:n[s]*c||0,e[1]+=u?n[s][1]*c||0:n[s]*c||0}return e[0]*=r,e[1]*=r,t(e,o,e)},this.show=function(){console.log(e,args)},this.getOutput=function(){return e},this.getArgs=function(){return args},this.init(arguments),this.processProperties(arguments)},Gibberish.Bus2.prototype=Gibberish._bus,Gibberish.envelope=function(){this.type="envelope"},Gibberish.envelope.prototype=new Gibberish.ugen,Gibberish._envelope=new Gibberish.envelope,Gibberish.ExponentialDecay=function(){var e=Math.pow,t=0,n=0;Gibberish.extend(this,{name:"ExponentialDecay",properties:{decay:.5,length:11050},callback:function(i,r){return t=e(i,n),n+=1/r,t},trigger:function(){n="number"==typeof arguments[0]?arguments[0]:0}}).init()},Gibberish.ExponentialDecay.prototype=Gibberish._envelope,Gibberish.Line=function(e,t,n,i){var r,o={name:"line",properties:{start:e||0,end:isNaN(t)?1:t,time:n||Gibberish.context.sampleRate,loops:i||!1},retrigger:function(e,t){s=0,this.start=r,this.end=e,this.time=t,a=(e-r)/t},getPhase:function(){return s},getIncr:function(){return a},getOut:function(){return r}},s=0,a=(t-e)/n;return this.callback=function(e,t,n,i){var o=(t-e)/n;return r=n>s?e+s++*o:t,s=r>=t&&i?0:s,r},this.setPhase=function(e){s=e},Gibberish.extend(this,o),this.init(),this},Gibberish.Line.prototype=Gibberish._envelope,Gibberish.Ease=function(e,t,n,i,r){var o=Math.sqrt,s=0,a=0;e=e||0,t=t||1,n=n||Gibberish.context.sampleRate,r=r||!1,i="undefined"==typeof i?1:i;var u={name:"ease",properties:{},retrigger:function(e,t){a=0,this.start=s,this.end=e,this.time=t},getPhase:function(){return a},getOut:function(){return s}};return this.callback=function(){var u=a++/n,c=i?1-o(1-u*u):o(1-(1-u)*(1-u));return s=n>a?e+c*(t-e):t,a=s>=t&&r?0:a,s},this.setPhase=function(e){a=e},this.setEase=function(e){i=e},Gibberish.extend(this,u),this.init(),this},Gibberish.Ease.prototype=Gibberish._envelope,Gibberish.Curve=function(e,t,n,i,r,o,s){var a=Math.sqrt,u=0,c=0;e=e||0,t=t||1,n=n||Gibberish.context.sampleRate,i=i||.94,r=r||.26,s=s||!1,o="undefined"==typeof o?1:o;var l={name:"curve",properties:{},retrigger:function(e,t){c=0,this.start=u,this.end=e,this.time=t,incr=(e-u)/t},getPhase:function(){return c},getOut:function(){return u}};return this.callback=function(){var l=c++/n,f=1-2*i,h=(a(i*i+f*l)-i)/f,p=(1-2*r)*h*h+2*r*h;return u=n>c?e+p*(t-e):t,o||(u=1-u),c=u>=t&&s?0:c,u},this.setPhase=function(e){c=e},Gibberish.extend(this,l),this.init(),this},Gibberish.Curve.prototype=Gibberish._envelope,Gibberish.Lines=function(e,t,n){var i,r=e[0],o=0,s=1,a=0,u=0,c=0,l=!1;"undefined"==typeof e&&(e=[0,1]),"undefined"==typeof t&&(t=[44100]),u=e[s],c=t[0],i=(u-e[0])/c,n=n||!1;var f={name:"lines",properties:{},retrigger:function(){o=0,r=e[0],c=t[0],u=e[1],s=1,a=0,i=(u-r)/c,l=!1},getPhase:function(){return o},getOut:function(){return r}};return f.run=f.retrigger,this.callback=function(){if(o>=c&&!l)if(se?22050:e,t=0>t?22050:t,0===i){var r=1/e;n+=r,n>=1&&i++}else if(1===i){var r=1/t;n-=r,0>=n&&(n=0,i++)}return n},getState:function(){return i}}).init().processProperties(arguments)},Gibberish.AD.prototype=Gibberish._envelope,Gibberish.ADSR=function(e,t,n,i,r,o,s){var a={name:"adsr",type:"envelope",requireReleaseTrigger:"undefined"!=typeof s?s:!1,properties:{attack:isNaN(e)?1e4:e,decay:isNaN(t)?1e4:t,sustain:isNaN(n)?22050:n,release:isNaN(i)?1e4:i,attackLevel:r||1,sustainLevel:o||.5,releaseTrigger:0},run:function(){this.setPhase(0),this.setState(0)},stop:function(){this.releaseTrigger=1}};Gibberish.extend(this,a);var u=0,c=0,l=0,f=this;return this.callback=function(e,t,n,i,r,o,s){var a=0;return l=1===l?1:s,0===c?(a=u/e*r,++u/e>=1&&(c++,u=t)):1===c?(a=u/t*(r-o)+o,--u<=0&&(null!==n?(c+=1,u=n):(c+=2,u=i))):2===c?(a=o,f.requireReleaseTrigger&&l?(c++,u=i,f.releaseTrigger=0,l=0):u--<=0&&!f.requireReleaseTrigger&&(c++,u=i)):3===c&&(u--,a=u/i*o,0>=u&&c++),a},this.call=function(){return this.callback(this.attack,this.decay,this.sustain,this.release,this.attackLevel,this.sustainLevel,this.releaseTrigger) +},this.getPhase=function(){return u},this.setPhase=function(e){u=e},this.setState=function(e){c=e,u=0},this.getState=function(){return c},this.init(),this},Gibberish.ADSR.prototype=Gibberish._envelope,Gibberish.ADR=function(e,t,n,i,r){var o={name:"adr",type:"envelope",properties:{attack:isNaN(e)?11025:e,decay:isNaN(t)?11025:t,release:isNaN(n)?22050:n,attackLevel:i||1,releaseLevel:r||.2},run:function(){this.setPhase(0),this.setState(0)}};Gibberish.extend(this,o);var s=0,a=0;return this.callback=function(e,t,n,i,r){var o=0;return 0===a?(o=s/e*i,++s/e===1&&(a++,s=t)):1===a?(o=s/t*(i-r)+r,--s<=0&&(a+=1,s=n)):2===a&&(s--,o=s/n*r,0>=s&&a++),o},this.setPhase=function(e){s=e},this.setState=function(e){a=e,s=0},this.getState=function(){return a},this.init(),this},Gibberish.ADR.prototype=Gibberish._envelope,Gibberish.analysis=function(){this.type="analysis",this.codegen=function(){if(Gibberish.memo[this.symbol])return Gibberish.memo[this.symbol];var e=this.variable?this.variable:Gibberish.generateSymbol("v");return Gibberish.memo[this.symbol]=e,this.variable=e,Gibberish.callbackArgs.push(this.symbol),Gibberish.callbackObjects.push(this.callback),this.codeblock="var "+this.variable+" = "+this.symbol+"();\n",-1===Gibberish.codeblock.indexOf(this.codeblock)&&Gibberish.codeblock.push(this.codeblock),this.variable},this.analysisCodegen=function(){var e=0;this.input.codegen?(e=this.input.codegen(),e.indexOf("op")>-1&&console.log("ANALYSIS BUG")):e=this.input.value?"undefined"!=typeof this.input.value.codegen?this.input.value.codegen():this.input.value:"null";var t=this.analysisSymbol+"("+e+",";for(var n in this.properties)"input"!==n&&(t+=this[n]+",");return t=t.slice(0,-1),t+=");",this.analysisCodeblock=t,-1===Gibberish.analysisCodeblock.indexOf(this.analysisCodeblock)&&Gibberish.analysisCodeblock.push(this.analysisCodeblock),-1===Gibberish.callbackObjects.indexOf(this.analysisCallback)&&Gibberish.callbackObjects.push(this.analysisCallback),t},this.remove=function(){Gibberish.analysisUgens.splice(Gibberish.analysisUgens.indexOf(this),1)},this.analysisInit=function(){this.analysisSymbol=Gibberish.generateSymbol(this.name),Gibberish.analysisUgens.push(this),Gibberish.dirty()}},Gibberish.analysis.prototype=new Gibberish.ugen,Gibberish._analysis=new Gibberish.analysis,Gibberish.Follow=function(){this.name="follow",this.properties={input:0,bufferSize:4410,mult:1,useAbsoluteValue:!0},this.storage=[];var e=Math.abs,t=[0],n=0,i=0,r=0;this.analysisCallback=function(o,s,a,u){"object"==typeof o&&(o=o[0]+o[1]),n+=u?e(o):o,n-=t[i],t[i]=u?e(o):o,i=(i+1)%s,t[i]=t[i]?t[i]:0,r=n/s*a},this.callback=this.getValue=function(){return r},this.init(),this.analysisInit(),this.processProperties(arguments);var o=(this.__lookupSetter__("bufferSize"),this.bufferSize);Object.defineProperty(this,"bufferSize",{get:function(){return o},set:function(e){o=e,n=0,t=[0],i=0}}),this.getStorage=function(){return this.storage}},Gibberish.Follow.prototype=Gibberish._analysis,Gibberish.SingleSampleDelay=function(){this.name="single_sample_delay",this.properties={input:arguments[0]||0,amp:arguments[1]||1};var e=0;this.analysisCallback=function(t){e=t},this.callback=function(){return e},this.getValue=function(){return e},this.init(),this.analysisInit(),this.processProperties(arguments)},Gibberish.SingleSampleDelay.prototype=Gibberish._analysis,Gibberish.Record=function(e,t,n){var i=new Float32Array(t),r=0,o=!1,s=this;Gibberish.extend(this,{name:"record",oncomplete:n,properties:{input:0,size:t||0},analysisCallback:function(e,t){o&&(i[r++]="object"==typeof e?e[0]+e[1]:e,r>=t&&(o=!1,s.remove()))},record:function(){return r=0,o=!0,this},getBuffer:function(){return i},getPhase:function(){return r},remove:function(){"undefined"!=typeof this.oncomplete&&this.oncomplete();for(var e=0;e-1&&Gibberish.callbackArgs.splice(Gibberish.callbackArgs.indexOf(this.analysisSymbol),1),Gibberish.callbackObjects.indexOf(this.analysisCallback)>-1&&Gibberish.callbackObjects.splice(Gibberish.callbackObjects.indexOf(this.analysisCallback),1),Gibberish.analysisUgens.splice(e,1),void 0}}}),this.properties.input=e,this.init(),this.analysisInit(),Gibberish.dirty()},Gibberish.Record.prototype=Gibberish._analysis,Gibberish.effect=function(){this.type="effect"},Gibberish.effect.prototype=new Gibberish.ugen,Gibberish._effect=new Gibberish.effect,Gibberish.Distortion=function(){var e=Math.abs,t=Math.log,n=Math.LN2;Gibberish.extend(this,{name:"distortion",properties:{input:0,amount:50},callback:function(i,r){var o;return r=r>2?r:2,"number"==typeof i?(o=i*r,i=o/(1+e(o))/(t(r)/n)):(o=i[0]*r,i[0]=o/(1+e(o))/(t(r)/n),o=i[1]*r,i[1]=o/(1+e(o))/(t(r)/n)),i}}).init().processProperties(arguments)},Gibberish.Distortion.prototype=Gibberish._effect,Gibberish.Gain=function(){Gibberish.extend(this,{name:"gain",properties:{input:0,amount:1},callback:function(e,t){return"number"==typeof e?e*=t:(e[0]*=t,e[1]*=t),e}}).init().processProperties(arguments)},Gibberish.Gain.prototype=Gibberish._effect,Gibberish.Delay=function(){var e=[],t=0;e.push(new Float32Array(2*Gibberish.context.sampleRate)),e.push(new Float32Array(2*Gibberish.context.sampleRate)),Gibberish.extend(this,{name:"delay",properties:{input:0,time:22050,feedback:.5,wet:1,dry:1,rate:1},callback:function(n,i,r,o,s,a){var u="number"==typeof n?1:2,c=t++%88200;i/=a;var l=(c+(0|i))%88200;return 1===u?(e[0][l]=n+e[0][c]*r,n=n*s+e[0][c]*o):(e[0][l]=n[0]+e[0][c]*r,n[0]=n[0]*s+e[0][c]*o,e[1][l]=n[1]+e[1][c]*r,n[1]=n[1]*s+e[1][c]*o),n}});var n=Math.round(this.properties.time);Object.defineProperty(this,"time",{configurable:!0,get:function(){return n},set:function(e){n=Math.round(e),Gibberish.dirty(this)}}),this.init(),this.processProperties(arguments)},Gibberish.Delay.prototype=Gibberish._effect,Gibberish.Decimator=function(){var e=0,t=[],n=Math.pow,i=Math.floor;Gibberish.extend(this,{name:"decimator",properties:{input:0,bitDepth:16,sampleRate:1},callback:function(r,o,s){e+=s;var a="number"==typeof r?1:2;if(1===a){if(e>=1){var u=n(o,2);t[0]=i(r*u)/u,e-=1}r=t[0]}else{if(e>=1){var u=n(o,2);t[0]=i(r[0]*u)/u,t[1]=i(r[1]*u)/u,e-=1}r=t}return r}}).init().processProperties(arguments)},Gibberish.Decimator.prototype=Gibberish._effect,Gibberish.RingModulation=function(){var e=(new Gibberish.Sine).callback,t=[0,0];Gibberish.extend(this,{name:"ringmod",properties:{input:0,frequency:440,amp:.5,mix:.5},callback:function(n,i,r,o){var s="number"==typeof n?1:2,a=1===s?n:n[0],u=e(i,r);if(a=a*(1-o)+a*u*o,2===s){var c=n[1];return c=c*(1-o)+c*u*o,t[0]=a,t[1]=c,t}return a}}).init().processProperties(arguments)},Gibberish.RingModulation.prototype=Gibberish._effect,Gibberish.DCBlock=function(){var e=0,t=0;Gibberish.extend(this,{name:"dcblock",type:"effect",properties:{input:0},reset:function(){e=0,t=0},callback:function(n){var i=n-e+.9997*t;return e=n,t=i,i}}).init().processProperties(arguments)},Gibberish.DCBlock.prototype=Gibberish._effect,Gibberish.Tremolo=function(){var e=(new Gibberish.Sine).callback;Gibberish.extend(this,{name:"tremolo",type:"effect",properties:{input:0,frequency:2.5,amp:.5},callback:function(t,n,i){var r="number"==typeof t?1:2,o=e(n,i);return 1===r?t*=o:(t[0]*=o,t[1]*=o),t}}).init().processProperties(arguments)},Gibberish.Tremolo.prototype=Gibberish._effect,Gibberish.OnePole=function(){var e=0;Gibberish.extend(this,{name:"onepole",type:"effect",properties:{input:0,a0:.15,b1:.85},callback:function(t,n,i){var r=t*n+e*i;return e=r,r},smooth:function(t,n){this.input=n[t],e=this.input,n[t]=this,this.obj=n,this.property=t,this.oldSetter=n.__lookupSetter__(t),this.oldGetter=n.__lookupGetter__(t);var i=this;Object.defineProperty(n,t,{get:function(){return i.input},set:function(e){i.input=e}})},remove:function(){Object.defineProperty(this.obj,this.property,{get:this.oldGetter,set:this.oldSetter}),this.obj[this.property]=this.input}}).init().processProperties(arguments)},Gibberish.OnePole.prototype=Gibberish._effect,Gibberish.Filter24=function(){var e=[0,0,0,0],t=[0,0,0,0],n=[0,0],i=isNaN(arguments[0])?.1:arguments[0],r=isNaN(arguments[1])?3:arguments[1];_isLowPass="undefined"!=typeof arguments[2]?arguments[2]:!0,Gibberish.extend(this,{name:"filter24",properties:{input:0,cutoff:i,resonance:r,isLowPass:_isLowPass},callback:function(i,r,o,s){var a="number"==typeof i?1:2,u=1===a?i:i[0],c=e[3]*o;if(c=c>1?1:c,r=0>r?0:r,r=r>1?1:r,u-=c,e[0]=e[0]+(-e[0]+u)*r,e[1]=e[1]+(-e[1]+e[0])*r,e[2]=e[2]+(-e[2]+e[1])*r,e[3]=e[3]+(-e[3]+e[2])*r,u=s?e[3]:u-e[3],2===a){var l=i[1];return c=t[3]*o,c=c>1?1:c,l-=c,t[0]=t[0]+(-t[0]+l)*r,t[1]=t[1]+(-t[1]+t[0])*r,t[2]=t[2]+(-t[2]+t[1])*r,t[3]=t[3]+(-t[3]+t[2])*r,l=s?t[3]:l-t[3],n[0]=u,n[1]=l,n}return u}}).init().processProperties(arguments)},Gibberish.Filter24.prototype=Gibberish._effect,Gibberish.SVF=function(){var e=[0,0],t=[0,0],n=Math.PI,i=[0,0];Gibberish.extend(this,{name:"SVF",properties:{input:0,cutoff:440,Q:2,mode:0,sr:Gibberish.context.sampleRate},callback:function(r,o,s,a,u){var c="number"==typeof r?1:2,l=1===c?r:r[0],f=2*n*o/u;s=1/s;var h=t[0]+f*e[0],p=l-h-s*e[0],d=f*p+e[0],b=p+h;if(e[0]=d,t[0]=h,l=0===a?h:1===a?p:2===a?d:b,2===c){var m=r[1],h=t[1]+f*e[1],p=m-h-s*e[1],d=f*p+e[1],b=p+h;e[1]=d,t[1]=h,m=0===a?h:1===a?p:2===a?d:b,i[0]=l,i[1]=m}else i=l;return i}}).init().processProperties(arguments)},Gibberish.SVF.prototype=Gibberish._effect,Gibberish.Biquad=function(){var e=0,t=0,n=0,i=0,r=0,o=0,s=0,a=0,u=[0,0],c=.001639,l=.003278,f=.001639,h=-1.955777,p=.960601,d="LP",b=2e3,m=.5,g=Gibberish.context.sampleRate;Gibberish.extend(this,{name:"biquad",properties:{input:null},calculateCoefficients:function(){switch(d){case"LP":var e=2*Math.PI*b/g,t=Math.sin(e),n=Math.cos(e),i=t/(2*m);c=(1-n)/2,l=1-n,f=c,a0=1+i,h=-2*n,p=1-i;break;case"HP":var e=2*Math.PI*b/g,t=Math.sin(e),n=Math.cos(e),i=t/(2*m);c=(1+n)/2,l=-(1+n),f=c,a0=1+i,h=-2*n,p=1-i;break;case"BP":var e=2*Math.PI*b/g,t=Math.sin(e),n=Math.cos(e),r=Math.log(2)/2*m*e/t,i=t*(Math.exp(r)-Math.exp(-r))/2;c=i,l=0,f=-i,a0=1+i,h=-2*n,p=1-i;break;default:return}c/=a0,l/=a0,f/=a0,h/=a0,p/=a0},callback:function(d){var b=isNaN(d)?2:1,m=0,g=0,y=1===b?d:d[0];return m=c*y+l*e+f*t-h*n-p*i,t=e,e=y,i=n,n=m,2===b&&(inR=d[1],g=c*inR+l*r+f*o-h*s-p*a,o=r,r=inR,a=s,s=g,u[0]=m,u[1]=g),1===b?m:u}}).init(),Object.defineProperties(this,{mode:{get:function(){return d},set:function(e){d=e,this.calculateCoefficients()}},cutoff:{get:function(){return b},set:function(e){b=e,this.calculateCoefficients()}},Q:{get:function(){return m},set:function(e){m=e,this.calculateCoefficients()}}}),this.processProperties(arguments),this.calculateCoefficients()},Gibberish.Biquad.prototype=Gibberish._effect,Gibberish.Flanger=function(){var e=[new Float32Array(88200),new Float32Array(88200)],t=88200,n=(new Gibberish.Sine).callback,i=Gibberish.interpolate,r=-100,o=0;Gibberish.extend(this,{name:"flanger",properties:{input:0,rate:.25,feedback:0,amount:125,offset:125},callback:function(s,a,u,c){var l="number"==typeof s?1:2,f=r+n(a,.95*c);f>t?f-=t:0>f&&(f+=t);var h=i(e[0],f);return e[0][o]=1===l?s+h*u:s[0]+h*u,2===l?(s[0]+=h,h=i(e[1],f),e[1][o]=s[1]+h*u,s[1]+=h):s+=h,++o>=t&&(o=0),++r>=t&&(r=0),s}}).init().processProperties(arguments),r=-1*this.offset},Gibberish.Flanger.prototype=Gibberish._effect,Gibberish.Vibrato=function(){var e=[new Float32Array(88200),new Float32Array(88200)],t=88200,n=(new Gibberish.Sine).callback,i=Gibberish.interpolate,r=-100,o=0;Gibberish.extend(this,{name:"vibrato",properties:{input:0,rate:5,amount:.5,offset:125},callback:function(s,a,u,c){var l="number"==typeof s?1:2,f=r+n(a,u*c-1);f>t?f-=t:0>f&&(f+=t);var h=i(e[0],f);return e[0][o]=1===l?s:s[0],2===l?(s[0]=h,h=i(e[1],f),e[1][o]=s[1],s[1]=h):s=h,++o>=t&&(o=0),++r>=t&&(r=0),s}}).init().processProperties(arguments),r=-1*this.offset},Gibberish.Vibrato.prototype=Gibberish._effect,Gibberish.BufferShuffler=function(){var e=[new Float32Array(88200),new Float32Array(88200)],t=88200,n=0,i=0,r=0,o=0,s=0,a=Math.random,u=1,c=!1,l=!1,f=!1,h=Gibberish.interpolate,p=!1,d=1,b=!1,m=Gibberish.rndf,g=[0,0];Gibberish.extend(this,{name:"buffer_shuffler",properties:{input:0,chance:.25,rate:11025,length:22050,reverseChange:.5,pitchChance:.5,pitchMin:.25,pitchMax:2,wet:1,dry:0},callback:function(y,v,x,w,k,G,j,A,_,S){var P="number"==typeof y?1:2;s?++o%(w-400)===0&&(c=!1,l=!0,u=1,o=0):(e[0][i]=1===P?y:y[0],e[1][i]=1===P?y:y[1],i++,i%=t,b=0===i?1:b,r++,r%x==0&&a()n&&(n=t+n)),p=a()n?n+=t:n>=t&&(n-=t);var q,C,M,O,R=h(e[0],n);return c?(u-=.0025,M=R*(1-u),q=1===P?M+y*u:M+y[0]*u,2===P&&(O=h(e[1],n),M=O*(1-u),C=1===P?q:M+y[1]*u),.0025>=u&&(c=!1)):l?(u-=.0025,M=R*u,q=1===P?M+y*u:M+y[0]*(1-u),2===P&&(O=h(e[1],n),M=O*u,C=M+y[1]*(1-u)),.0025>=u&&(l=!1,s=!1,f=!1,d=1,p=0)):1===P?q=s&&b?R*_+y*S:y:(O=h(e[1],n),q=s&&b?R*_+y[0]*S:y[0],C=s&&b?O*_+y[1]*S:y[1]),g=[q,C],1===P?q:g}}).init().processProperties(arguments)},Gibberish.BufferShuffler.prototype=Gibberish._effect,Gibberish.AllPass=function(e){var t=-1,n=new Float32Array(e||500),i=n.length;Gibberish.extend(this,{name:"allpass",properties:{input:0},callback:function(e){t=++t%i;var r=n[t],o=-1*e+r;return n[t]=e+.5*r,o}})},Gibberish.Comb=function(e){var t=new Float32Array(e||1200),n=t.length,i=0,r=0;Gibberish.extend(this,{name:"comb",properties:{input:0,feedback:.84,damping:.2},callback:function(e,o,s){var a=++i%n,u=t[a];return r=u*(1-s)+r*s,t[a]=e+r*o,u}})},Gibberish.Reverb=function(){var e={combCount:8,combTuning:[1116,1188,1277,1356,1422,1491,1557,1617],allPassCount:4,allPassTuning:[556,441,341,225],allPassFeedback:.5,fixedGain:.015,scaleDamping:.4,scaleRoom:.28,offsetRoom:.7,stereoSpread:23},t=.84,n=[],i=[],r=[0,0];Gibberish.extend(this,{name:"reverb",roomSize:.5,properties:{input:0,wet:.5,dry:.55,roomSize:.84,damping:.5},callback:function(e,t,o,s,a){for(var u="object"==typeof e?2:1,c=1===u?e:e[0]+e[1],l=.015*c,f=l,h=0;8>h;h++){var p=n[h](l,.98*s,.4*a);f+=p}for(var h=0;4>h;h++)f=i[h](f);return r[0]=r[1]=c*o+f*t,r}}).init().processProperties(arguments),this.setFeedback=function(e){t=e};for(var o=0;8>o;o++)n.push(new Gibberish.Comb(e.combTuning[o]).callback);for(var o=0;4>o;o++)i.push(new Gibberish.AllPass(e.allPassTuning[o],e.allPassFeedback).callback)},Gibberish.Reverb.prototype=Gibberish._effect,Gibberish.StereoReverb=function(){var e={combCount:8,combTuning:[1116,1188,1277,1356,1422,1491,1557,1617],allPassCount:4,allPassTuning:[556,441,341,225],allPassFeedback:.5,fixedGain:.015,scaleDamping:.4,scaleRoom:.28,offsetRoom:.7,stereoSpread:23},t=.84,n=[],i=[],r=[],o=[],s=[0,0];Gibberish.extend(this,{name:"reverb",roomSize:.5,properties:{input:0,wet:.5,dry:.55,roomSize:.84,damping:.5},callback:function(e,t,a,u,c){for(var l="object"==typeof e?2:1,f=e[0],h=1===l?f:e[1],p=outL=.015*f,d=outR=.015*h,b=0;8>b;b++)outL+=n[b](p,.98*u,.4*c),outR+=i[b](d,.98*u,.4*c);for(var b=0;4>b;b++)outL=r[b](outL),outR=o[b](outR);return s[0]=f*a+outL*t,s[1]=h*a+outR*t,s}}).init().processProperties(arguments),this.setFeedback=function(e){t=e};for(var a=0;8>a;a++)n.push(new Gibberish.Comb(e.combTuning[a]).callback),i.push(new Gibberish.Comb(e.combTuning[a]).callback);for(var a=0;4>a;a++)r.push(new Gibberish.AllPass(e.allPassTuning[a],e.allPassFeedback).callback),o.push(new Gibberish.AllPass(e.allPassTuning[a],e.allPassFeedback).callback)},Gibberish.StereoReverb.prototype=Gibberish._effect,Gibberish.Granulator=function(e){var t=[];buffer=null,interpolate=Gibberish.interpolate,panner=Gibberish.makePanner(),bufferLength=0,debug=0,write=0,self=this,out=[0,0],_out=[0,0],rndf=Gibberish.rndf,numberOfGrains=e.numberOfGrains||20,console.log("NUMBER OF GRAINS",numberOfGrains),Gibberish.extend(this,{name:"granulator",bufferLength:88200,reverse:!0,spread:.5,properties:{speed:1,speedMin:-0,speedMax:0,grainSize:1e3,position:.5,positionMin:0,positionMax:0,amp:.2,fade:.1,pan:0,shouldWrite:!1},setBuffer:function(e){buffer=e,bufferLength=e.length},callback:function(e,n,i,r,o,s,a,u,c,l){for(var f=0;numberOfGrains>f;f++){var h=t[f];if(h._speed>0){h.pos>h.end&&(h.pos=(a+rndf(o,s))*buffer.length,h.start=h.pos,h.end=h.start+r,h._speed=e+rndf(n,i),h._speed=h._speed<.1?.1:h._speed,h._speed=h._speed<.1&&h._speed>0?.1:h._speed,h._speed=h._speed>-.1&&h._speed<0?-.1:h._speed,h.fadeAmount=h._speed*c*r,h.pan=rndf(-1*self.spread,self.spread));for(var p=h.pos;p>buffer.length;)p-=buffer.length;for(;0>p;)p+=buffer.length;var d=interpolate(buffer,p);d*=h.posh.end-h.fadeAmount?(h.end-h.pos)/h.fadeAmount:1}else{h.pos0?.1:h._speed,h._speed=h._speed>-.1&&h._speed<0?-.1:h._speed,h.fadeAmount=h._speed*c*r);for(var p=h.pos;p>buffer.length;)p-=buffer.length;for(;0>p;)p+=buffer.length;var d=interpolate(buffer,p);d*=h.pos>h.start-h.fadeAmount?(h.start-h.pos)/h.fadeAmount:1,d*=h.posn;n++)t[n]={pos:self.position+Gibberish.rndf(self.positionMin,self.positionMax),_speed:self.speed+Gibberish.rndf(self.speedMin,self.speedMax)},t[n].start=t[n].pos,t[n].end=t[n].pos+self.grainSize,t[n].fadeAmount=t[n]._speed*self.fade*self.grainSize,t[n].pan=Gibberish.rndf(-1*self.spread,self.spread),console.log("GRAIN",n,"POS",t[n].pos,"SPEED",t[n]._speed);this.grains=t,"undefined"!=typeof e.buffer&&(buffer=e.buffer,bufferLength=buffer.length)},Gibberish.Granulator.prototype=Gibberish._effect,Gibberish.synth=function(){this.type="oscillator",this.oscillatorInit=function(){this.fx=new Array2,this.fx.parent=this}},Gibberish.synth.prototype=new Gibberish.ugen,Gibberish._synth=new Gibberish.synth,Gibberish.Synth=function(e){this.name="synth",this.properties={frequency:0,pulsewidth:.5,attack:22050,decay:22050,sustain:22050,release:22050,attackLevel:1,sustainLevel:.5,releaseTrigger:0,glide:.15,amp:.25,channels:2,pan:0,velocity:1,sr:Gibberish.context.sampleRate},this.note=function(i,r){if("undefined"!=typeof i){if(Array.isArray(arguments[0])){var o=arguments[0][0];r=arguments[0][1],i=o}if(0!==r){if("object"!=typeof this.frequency){if(t&&i===l&&e.requireReleaseTrigger)return this.releaseTrigger=1,l=null,void 0;this.frequency=l=i,this.releaseTrigger=0,"object"==typeof i&&Gibberish.dirty(this)}else this.frequency[0]=l=i,this.releaseTrigger=0,Gibberish.dirty(this);"undefined"!=typeof r&&(this.velocity=r),n.run()}else this.releaseTrigger=1}},e=e||{};var t="undefined"==typeof e.useADSR?!1:e.useADSR,n=t?new Gibberish.ADSR:new Gibberish.AD,i=n.getState,r=n.callback,o=new Gibberish.PWM,s=o.callback,a=(new Gibberish.OnePole).callback,u=Gibberish.makePanner(),c=this,l=0,f=[0,0];n.requireReleaseTrigger=e.requireReleaseTrigger||!1,this.callback=function(e,n,o,l,h,p,d,b,m,g,y,v,x,w,k){g=g>=1?.99999:g,e=a(e,1-g,g);var G,j;return t?(G=r(o,l,h,p,d,b,m),m&&(c.releaseTrigger=0),i()<4?(j=s(e,1,n,k)*G*w*y,1===v?j:u(j,x,f)):(j=f[0]=f[1]=0,1===v?j:f)):i()<2?(G=r(o,l),j=s(e,1,n,k)*G*w*y,1===v?j:u(j,x,f)):(j=f[0]=f[1]=0,1===v?j:f)},this.getEnv=function(){return n},this.getOsc=function(){return o},this.setOsc=function(e){o=e,s=o.callback};var h="PWM";Object.defineProperty(this,"waveform",{get:function(){return h},set:function(e){this.setOsc(new Gibberish[e])}}),this.init(),this.oscillatorInit(),this.processProperties(arguments)},Gibberish.Synth.prototype=Gibberish._synth,Gibberish.PolySynth=function(){this.__proto__=new Gibberish.Bus2,Gibberish.extend(this,{name:"polysynth",maxVoices:5,voiceCount:0,frequencies:[],_frequency:0,polyProperties:{frequency:0,glide:0,attack:22050,decay:22050,sustain:22050,release:22050,attackLevel:1,sustainLevel:.5,pulsewidth:.5,velocity:1,waveform:"PWM"},note:function(e,t){if("undefined"!=typeof e){var n=this.frequencies.indexOf(e),i=n>-1?n:this.voiceCount++,r=this.children[i];r.note(e,t),-1===n?(this.frequencies[i]=e,this._frequency=e,this.voiceCount>=this.maxVoices&&(this.voiceCount=0)):delete this.frequencies[i],this.lastChild=i}},initVoices:function(){for(var e=0;e=1?.99999:w,e=c(e,1-w,w);var S,P;return t?(S=r(o,a,f,d,b,m,g),g&&(h.releaseTrigger=0),i()<4?(P=u(s(e,.15,n,_),y*S,v,x)*S*A*k,1===G?P:l(P,j,p)):(P=p[0]=p[1]=0,1===G?P:p)):i()<2?(S=r(o,a),P=u(s(e,.15,n,_),y*S,v,x)*S*A*k,1===G?P:l(P,j,p)):(P=p[0]=p[1]=0,1===G?P:p)},this.getUseADSR=function(){return t},this.getEnv=function(){return n},this.getOsc=function(){return o},this.setOsc=function(e){o=e,s=o.callback};var d="PWM";Object.defineProperty(this,"waveform",{get:function(){return d},set:function(e){this.setOsc(new Gibberish[e])}}),this.init(),this.oscillatorInit(),this.processProperties(arguments)},Gibberish.Synth2.prototype=Gibberish._synth,Gibberish.PolySynth2=function(){this.__proto__=new Gibberish.Bus2,Gibberish.extend(this,{name:"polysynth2",maxVoices:5,voiceCount:0,frequencies:[],_frequency:0,polyProperties:{frequency:0,glide:0,attack:22050,decay:22050,sustain:22050,release:22050,attackLevel:1,sustainLevel:.5,pulsewidth:.5,resonance:3.5,cutoff:.25,velocity:1,useLowPassFilter:!0,waveform:"PWM"},note:function(e,t){if("undefined"!=typeof e){var n=this.frequencies.indexOf(e),i=n>-1?n:this.voiceCount++,r=this.children[i];r.note(e,t),-1===n?(this.frequencies[i]=e,this._frequency=e,this.voiceCount>=this.maxVoices&&(this.voiceCount=0)):delete this.frequencies[i],this.lastChild=i}},initVoices:function(){this.dirty=!0;for(var e=0;e=1&&(v=.9999),e=a(e,1-v,v),t?(j=r(h,p,d,b,m,g,y)*k,y&&(l.releaseTrigger=0),i()<4?(_=s(e*n,e*f)*j,A=o(e+_,1)*j*x,1===w?A:u(A,G,c)):(A=c[0]=c[1]=0,1===w?A:c)):i()<2?(j=r(h,p)*k,_=s(e*n,e*f)*j,A=o(e+_,1)*j*x,1===w?A:u(A,G,c)):(A=c[0]=c[1]=0,1===w?A:c)},this.init(),this.oscillatorInit(),this.processProperties(arguments)},Gibberish.FMSynth.prototype=Gibberish._synth,Gibberish.PolyFM=function(){this.__proto__=new Gibberish.Bus2,Gibberish.extend(this,{name:"polyfm",maxVoices:5,voiceCount:0,children:[],frequencies:[],_frequency:0,velocity:1,polyProperties:{glide:0,attack:22050,decay:22050,sustain:22050,release:22050,attackLevel:1,sustainLevel:.5,index:5,cmRatio:2},note:function(e,t){if("undefined"!=typeof e){var n=this.frequencies.indexOf(e),i=n>-1?n:this.voiceCount++,r=this.children[i];"undefined"==typeof t&&(t=this.velocity),r.note(e,t),-1===n?(this.frequencies[i]=e,this._frequency=e,this.voiceCount>=this.maxVoices&&(this.voiceCount=0)):delete this.frequencies[i]}},initVoices:function(){for(var e=0;er?32768*r:32767*r,!0)}},encodeWAV:function(){function e(e,t,n){for(var i=0;it){var n=e;e=t,t=n}this.start=e,this.end=t},note:function(t,n){if("undefined"!=typeof t){switch(typeof t){case"number":this.pitch=t;break;case"function":this.pitch=t();break;case"object":this.pitch=Array.isArray(t)?t[0]:t}if("number"==typeof n&&(this.amp=n),null!==this.function){this.isPlaying=!0;var i;switch(typeof this.pitch){case"number":i=this.pitch;break;case"function":i=this.pitch.getValue?this.pitch.getValue():this.pitch();break;case"object":i=Array.isArray(this.pitch)?this.pitch[0]:this.pitch.getValue?this.pitch.getValue():this.pitch.input.getValue(),"function"==typeof i&&(i=i())}e=0,Gibberish.dirty(this)}}},getBuffer:function(){return r},setBuffer:function(e){r=e},getPhase:function(){return e},setPhase:function(t){e=t},getNumberOfBuffers:function(){return Object.keys(s.buffers).length-1},callback:function(o,s,a,u,c,l,f,h,p,d){var b=0,m=f*l,g=h*l;return e+=o,null!==r&&u?(o>0?g>m+e?b=t(r,m+e):p&&(e=0):g+e>m?b=t(r,g+e):p&&(e=0),n(b*s,d,i)):(i[0]=i[1]=b,i)}}).init().oscillatorInit().processProperties(arguments),"undefined"!=typeof arguments[0]&&("string"==typeof arguments[0]?(this.file=arguments[0],this.pitch=0):"object"==typeof arguments[0]&&arguments[0].file&&(this.file=arguments[0].file)),"undefined"!=typeof Gibberish.audioFiles[this.file])r=Gibberish.audioFiles[this.file],this.end=1,this.buffers[this.file]=r,this.length=e=this.bufferLength=r.length,Gibberish.dirty(this),this.onload&&this.onload();else if(null!==this.file){var a,u=new XMLHttpRequest;u.open("GET",this.file,!0),u.responseType="arraybuffer",u.onload=function(){a(this.response)},u.send(),u.onerror=function(e){console.error("Sampler file loading error",e)},a=function(t){Gibberish.context.decodeAudioData(t,function(t){r=t.getChannelData(0),s.length=e=o=r.length,s.isPlaying=!0,s.buffers[s.file]=r,Gibberish.audioFiles[s.file]=r,s.onload&&s.onload(),0!==s.playOnLoad&&s.note(s.playOnLoad),s.isLoaded=!0},function(e){console.log("Error decoding file",e)})}}else"undefined"!=typeof this.buffer&&(this.isLoaded=!0,r=this.buffer,this.bufferLength=r.length||88200,e=this.bufferLength,arguments[0]&&arguments[0].loops&&(this.loops=1),Gibberish.dirty(this),this.onload&&this.onload())},Gibberish.Sampler.prototype=Gibberish._oscillator,Gibberish.Sampler.prototype.record=function(e,t){this.isRecording=!0;var n=this;return this.recorder=new Gibberish.Record(e,t,function(){n.setBuffer(this.getBuffer()),bufferLength=n.getBuffer().length,n.setPhase(n.end),n.isRecording=!1}).record(),this},Gibberish.MonoSynth=function(){Gibberish.extend(this,{name:"monosynth",properties:{attack:1e4,decay:1e4,cutoff:.2,resonance:2.5,amp1:1,amp2:1,amp3:1,filterMult:.3,isLowPass:!0,pulsewidth:.5,amp:.6,detune2:.01,detune3:-.01,octave2:1,octave3:-1,glide:0,pan:0,velocity:1,frequency:0,channels:2},waveform:"Saw3",note:function(e,i){"undefined"!=typeof e&&("undefined"!=typeof i&&0!==i&&(this.velocity=i),0!==i&&("object"!=typeof this.frequency?this.frequency=e:(this.frequency[0]=e,Gibberish.dirty(this)),n()>0&&t.run())) +}});var e=waveform1=waveform2=waveform3=this.waveform;Object.defineProperty(this,"waveform",{get:function(){return e},set:function(t){e!==t&&(e=t,o=(new Gibberish[t]).callback,s=(new Gibberish[t]).callback,a=(new Gibberish[t]).callback)}}),Object.defineProperties(this,{waveform1:{get:function(){return waveform1},set:function(e){waveform1=e,o=(new Gibberish[e]).callback}},waveform2:{get:function(){return waveform2},set:function(e){waveform2=e,s=(new Gibberish[e]).callback}},waveform3:{get:function(){return waveform3},set:function(e){waveform3=e,a=(new Gibberish[e]).callback}}});var t=new Gibberish.AD(this.attack,this.decay),n=t.getState,i=t.callback,r=(new Gibberish.Filter24).callback,o=new Gibberish[this.waveform](this.frequency,this.amp1).callback,s=new Gibberish[this.waveform](this.frequency2,this.amp2).callback,a=new Gibberish[this.waveform](this.frequency3,this.amp3).callback,u=(new Gibberish.OnePole).callback,c=Gibberish.makePanner(),l=[0,0];this.envelope=t,this.callback=function(e,t,f,h,p,d,b,m,g,y,v,x,w,k,G,j,A,_,S,P){if(n()<2){j>=1&&(j=.9999),S=u(S,1-j,j);var q=S;if(k>0)for(var C=0;k>C;C++)q*=2;else if(0>k)for(var C=0;C>k;C--)q/=2;var M=S;if(G>0)for(var C=0;G>C;C++)M*=2;else if(0>G)for(var C=0;C>G;C--)M/=2;q+=x>0?(2*S-S)*x:(S-S/2)*x,M+=w>0?(2*S-S)*w:(S-S/2)*w;var O=o(S,p,y)+s(q,d,y)+a(M,b,y),R=i(e,t)*_,L=r(O,f+m*R,h,g,1)*R;return L*=v,l[0]=l[1]=L,1===P?l:c(L,A,l)}return l[0]=l[1]=0,l},this.init(),this.oscillatorInit(),this.processProperties(arguments)},Gibberish.MonoSynth.prototype=Gibberish._synth,Gibberish.Binops={"export":function(e){Gibberish.export("Binops",e||window)},operator:function(){var e=new Gibberish.ugen,t=arguments[0],n=Array.prototype.slice.call(arguments,1);e.name="op",e.properties={};for(var i=0;ie?e=t:e>n&&(e=n),e}};return t.__proto__=new Gibberish.ugen,t.init(),t.processProperties(e),t},Merge:function(){var e=Array.prototype.slice.call(arguments,0),t={name:"merge",properties:{},callback:function(e){return e[0]+e[1]}};t.__proto__=new Gibberish.ugen;for(var n=0;n1?h=s?h%1:1:0>h&&(h=s?1+h%1:0),u=0===o?t+h*l:t+a(h,1.5)*l,c=u,u},getValue:function(){return c},invert:function(){var e=l.outputMin;l.outputMin=l.outputMax,l.outputMax=e}};return l.__proto__=new Gibberish.ugen,l.init(),l}},Gibberish.Time={bpm:120,"export":function(e){Gibberish.export("Time",e||window)},ms:function(e){return e*Gibberish.context.sampleRate/1e3},seconds:function(e){return e*Gibberish.context.sampleRate},beats:function(e){return function(){var t=Gibberish.context.sampleRate/(Gibberish.Time.bpm/60);return t*e}}},Gibberish.Sequencer2=function(){var e=this,t=0;Gibberish.extend(this,{target:null,key:null,values:null,valuesIndex:0,durations:null,durationsIndex:0,nextTime:0,playOnce:!1,repeatCount:0,repeatTarget:null,isConnected:!0,keysAndValues:null,counts:{},properties:{rate:1,isRunning:!1,nextTime:0},offset:0,name:"seq",callback:function(n,i,r){if(i){if(t>=r){if(null!==e.values){if(e.target){var o=e.values[e.valuesIndex++];"function"==typeof o&&(o=o()),"function"==typeof e.target[e.key]?e.target[e.key](o):e.target[e.key]=o}else"function"==typeof e.values[e.valuesIndex]&&e.values[e.valuesIndex++]();e.valuesIndex>=e.values.length&&(e.valuesIndex=0)}else if(null!==e.keysAndValues)for(var s in e.keysAndValues){var a=e.counts[s]++,o=e.keysAndValues[s][a];"function"==typeof o&&(o=o()),"function"==typeof e.target[s]?e.target[s](o):e.target[s]=o,e.counts[s]>=e.keysAndValues[s].length&&(e.counts[s]=0),e.chose&&e.chose(s,a)}else"function"==typeof e.target[e.key]&&e.target[e.key]();if(t-=r,Array.isArray(e.durations)){var u=e.durations[e.durationsIndex++];e.nextTime="function"==typeof u?u():u,e.chose&&e.chose("durations",e.durationsIndex-1),e.durationsIndex>=e.durations.length&&(e.durationsIndex=0)}else{var u=e.durations;e.nextTime="function"==typeof u?u():u}return e.repeatTarget&&(e.repeatCount++,e.repeatCount===e.repeatTarget&&(e.isRunning=!1,e.repeatCount=0)),0}t+=n}return 0},start:function(e){return e||(t=0),this.isRunning=!0,this},stop:function(){return this.isRunning=!1,this},repeat:function(e){return this.repeatTarget=e,this},shuffle:function(){for(n in this.keysAndValues)this.shuffleArray(this.keysAndValues[n])},shuffleArray:function(e){for(var t,n,i=e.length;i;t=parseInt(Math.random()*i),n=e[--i],e[i]=e[t],e[t]=n);}}),this.init(arguments),this.processProperties(arguments);for(var n in this.keysAndValues)this.counts[n]=0;this.oscillatorInit(),t+=this.offset,this.connect()},Gibberish.Sequencer2.prototype=Gibberish._oscillator,Gibberish.Sequencer=function(){Gibberish.extend(this,{target:null,key:null,values:null,valuesIndex:0,durations:null,durationsIndex:0,nextTime:0,phase:0,isRunning:!1,playOnce:!1,repeatCount:0,repeatTarget:null,isConnected:!0,keysAndValues:null,counts:{},offset:0,name:"seq",tick:function(){if(this.isRunning){if(this.phase>=this.nextTime){if(null!==this.values){if(this.target){var e=this.values[this.valuesIndex++];if("function"==typeof e)try{e=e()}catch(t){console.error("ERROR: Can't execute function triggered by Sequencer:\n"+e.toString()),this.values.splice(this.valuesIndex-1,1),this.valuesIndex--}"function"==typeof this.target[this.key]?this.target[this.key](e):this.target[this.key]=e}else if("function"==typeof this.values[this.valuesIndex])try{this.values[this.valuesIndex++]()}catch(t){console.error("ERROR: Can't execute function triggered by Sequencer:\n"+this.values[this.valuesIndex-1].toString()),this.values.splice(this.valuesIndex-1,1),this.valuesIndex--}this.valuesIndex>=this.values.length&&(this.valuesIndex=0)}else if(null!==this.keysAndValues)for(var n in this.keysAndValues){var i="function"==typeof this.keysAndValues[n].pick?this.keysAndValues[n].pick():this.counts[n]++,e=this.keysAndValues[n][i];if("function"==typeof e)try{e=e()}catch(t){console.error("ERROR: Can't execute function triggered by Sequencer:\n"+e.toString()),this.keysAndValues[n].splice(i,1),"function"!=typeof this.keysAndValues[n].pick&&this.counts[n]--}"function"==typeof this.target[n]?this.target[n](e):this.target[n]=e,this.counts[n]>=this.keysAndValues[n].length&&(this.counts[n]=0)}else"function"==typeof this.target[this.key]&&this.target[this.key]();if(this.phase-=this.nextTime,Array.isArray(this.durations)){var r="function"==typeof this.durations.pick?this.durations[this.durations.pick()]:this.durations[this.durationsIndex++];this.nextTime="function"==typeof r?r():r,this.durationsIndex>=this.durations.length&&(this.durationsIndex=0)}else{var r=this.durations;this.nextTime="function"==typeof r?r():r}return this.repeatTarget&&(this.repeatCount++,this.repeatCount===this.repeatTarget&&(this.isRunning=!1,this.repeatCount=0)),void 0}this.phase++}},start:function(e){return e||(this.phase=this.offset),this.isRunning=!0,this},stop:function(){return this.isRunning=!1,this},repeat:function(e){return this.repeatTarget=e,this},shuffle:function(){for(e in this.keysAndValues)this.shuffleArray(this.keysAndValues[e])},shuffleArray:function(e){for(var t,n,i=e.length;i;t=parseInt(Math.random()*i),n=e[--i],e[i]=e[t],e[t]=n);},disconnect:function(){var e=Gibberish.sequencers.indexOf(this);Gibberish.sequencers.splice(e,1),this.isConnected=!1},connect:function(){return-1===Gibberish.sequencers.indexOf(this)&&Gibberish.sequencers.push(this),this.isConnected=!0,this}});for(var e in arguments[0])this[e]=arguments[0][e];for(var e in this.keysAndValues)this.counts[e]=0;this.connect(),this.phase+=this.offset},Gibberish.Sequencer.prototype=Gibberish._oscillator,Gibberish.PolySeq=function(){var e=this,t=0,n=function(e,t){return t>e?-1:e>t?1:0};Gibberish.extend(this,{seqs:[],autofire:[],timeline:{},playOnce:!1,repeatCount:0,repeatTarget:null,isConnected:!1,properties:{rate:1,isRunning:!1,nextTime:0},offset:0,name:"polyseq",getPhase:function(){return t},setPhase:function(e){t=e},adjustPhase:function(e){t+=e},timeModifier:null,add:function(n,i){n.valuesIndex=n.durationsIndex=0,null===n.durations?(n.autofire=!0,e.autofire.push(n)):("undefined"==typeof i?e.seqs.push(n):e.seqs.splice(i,0,n),"undefined"!=typeof e.timeline[t]?n.priority?e.timeline[t].unshift(n):e.timeline[t].push(n):e.timeline[t]=[n],e.nextTime=t),!e.scale||"frequency"!==n.key&&"note"!==n.key||e.applyScale&&e.applyScale(),n.shouldStop=!1},callback:function(i,r,o){var s;if(r){if(t>=o){var a=e.timeline[o],u=t-o;if("undefined"==typeof a)return;for(var c=0;c=l.durations.length&&(l.durationsIndex=0),e.chose&&e.chose("durations",f)}else{var p="function"==typeof l.durations?l.durations():l.durations;s="function"==typeof p?p():p}var d;d=null!==e.timeModifier?e.timeModifier(s)+t:s+t,d-=u,s-=u,"undefined"==typeof e.timeline[d]?e.timeline[d]=[l]:l.priority?e.timeline[d].unshift(l):e.timeline[d].push(l)}}for(var c=0,b=e.autofire.length;b>c;c++){var l=e.autofire[c];if(!l.shouldStop){var f=l.values.pick?l.values.pick():l.valuesIndex++%l.values.length,h=l.values[f];"function"==typeof h&&(h=h()),l.target&&("function"==typeof l.target[l.key]?l.target[l.key](h):l.target[l.key]=h),e.chose&&e.chose(l.key,f)}}delete e.timeline[o];var m=Object.keys(e.timeline),g=m.length;if(g>1){for(var y=0;g>y;y++)m[y]=parseFloat(m[y]);m=m.sort(n),e.nextTime=m[0]}else e.nextTime=parseFloat(m[0])}t+=i}return 0},start:function(e,n){if(e&&this.offset){t=0,this.nextTime=this.offset;var i=""+this.offset;this.timeline={},this.timeline[i]=[];for(var r=0;r1?1:e,this.__decay=100*i}},tone:{get:function(){return r},set:function(e){r=e>1?1:e,this.__tone=220+1400*e}}}),this.processProperties(arguments)},Gibberish.Kick.prototype=Gibberish._oscillator,Gibberish.Conga=function(){var e=!1,t=(new Gibberish.SVF).callback;Gibberish.extend(this,{name:"conga",properties:{pitch:190,amp:2,sr:Gibberish.context.sampleRate},callback:function(n,i,r){var o=e?60:0;return o=t(o,n,50,2,r),o*=i,e=!1,o},note:function(t,n){"number"==typeof t&&(this.pitch=t),"number"==typeof n&&(this.amp=n),e=!0}}).init().oscillatorInit(),this.processProperties(arguments)},Gibberish.Conga.prototype=Gibberish._oscillator,Gibberish.Clave=function(){var e=!1,t=new Gibberish.SVF,n=t.callback;Gibberish.extend(this,{name:"clave",properties:{pitch:2500,amp:1,sr:Gibberish.context.sampleRate},callback:function(t,i,r){var o=e?2:0;return o=n(o,t,5,2,r),o*=i,e=!1,o},note:function(t,n){"number"==typeof t&&(this.pitch=t),"number"==typeof n&&(this.amp=n),e=!0}}).init().oscillatorInit(),this.bpf=t,this.processProperties(arguments)},Gibberish.Clave.prototype=Gibberish._oscillator,Gibberish.Tom=function(){var e=!1,t=(new Gibberish.SVF).callback,n=(new Gibberish.SVF).callback,i=new Gibberish.ExponentialDecay,r=i.callback,o=Math.random;Gibberish.extend(this,{name:"tom",properties:{pitch:80,amp:.5,sr:Gibberish.context.sampleRate},callback:function(i,s,a){var u,c=e?60:0;return c=t(c,i,30,2,a),u=16*o()-8,u=u>0?u:0,u*=r(.05,11025),u=n(u,120,.5,0,a),c+=u,c*=s,e=!1,c},note:function(t,n){"number"==typeof t&&(this.pitch=t),"number"==typeof n&&(this.amp=n),i.trigger(),e=!0}}).init().oscillatorInit(),i.trigger(1),this.processProperties(arguments)},Gibberish.Tom.prototype=Gibberish._oscillator,Gibberish.Clap=function(){var e=new Gibberish.Biquad,t=e.callback,n=new Gibberish.Biquad,i=n.callback,r=new Gibberish.Biquad,o=r.callback,s=new Gibberish.ExponentialDecay,a=s.callback,u=new Gibberish.ExponentialDecay,c=u.callback,l=new Gibberish.Line,f=(l.callback,new Gibberish.Saw),h=f.callback,p=Math.random,d=1e3,b=2.5,m=.025,g=.9,y=1323,v=660,x=100;e.mode=n.mode="BP",r.mode="BP",r.cutoff=2400,e.cutoff=n.cutoff=1e3,e.Q=2,n.Q=1,Gibberish.extend(this,{name:"clap",properties:{amp:.5,sr:Gibberish.context.sampleRate},callback:function(e){var n,r,s=0;return n=4*p()-2,n=n>0?n:0,r=4*p()-2,r=r>0?r:0,s=i(t(n)),s*=c(g,v),r=o(h(x,r)*a(m,y)),s+=r,s*=e},note:function(e){"number"==typeof e&&(this.amp=e),u.trigger(),s.trigger(),l.setPhase(0),f.setPhase(0)}}).init().oscillatorInit(),this.getBPF=function(){return e},this.getBPF2=function(){return n},this.getBPF3=function(){return r},this.getLine=function(){return l},this.setEnvK=function(e,t,n,i){m=e,t&&(g=t),n&&(y=n),i&&(v=i)},this.setFreq=function(e){x=e},this.setRez=function(e){b=e},this.setCutoff=function(e){d=e},this.processProperties(arguments)},Gibberish.Clap.prototype=Gibberish._oscillator,Gibberish.Cowbell=function(){var e=new Gibberish.Square,t=new Gibberish.Square,n=e.callback,i=t.callback,r=new Gibberish.SVF({mode:2}),o=r.callback,s=new Gibberish.ExponentialDecay(.0025,10500),a=s.callback;Gibberish.extend(this,{name:"cowbell",properties:{amp:1,pitch:560,bpfFreq:1e3,bpfRez:3,decay:22050,decayCoeff:1e-4,sr:Gibberish.context.sampleRate},callback:function(e,t,r,s,u,c,l){var f;return f=n(t,1,1,0),f+=i(845,1,1,0),f=o(f,r,s,2,l),f*=a(c,u),f*=e},note:function(e){s.trigger(),e&&(this.decay=e)}}).init().oscillatorInit().processProperties(arguments),this.bpf=r,this.eg=s,s.trigger(1)},Gibberish.Cowbell.prototype=Gibberish._oscillator,Gibberish.Snare=function(){var e=(new Gibberish.SVF).callback,t=(new Gibberish.SVF).callback,n=(new Gibberish.SVF).callback,i=new Gibberish.ExponentialDecay(.0025,11025),r=i.callback,o=Math.random,s=0;Gibberish.extend(this,{name:"snare",properties:{cutoff:1e3,decay:11025,tune:0,snappy:.5,amp:1,sr:Gibberish.context.sampleRate},callback:function(i,a,u,c,l,f){var h,p,d=0,b=0;return d=r(.0025,a),d>.005&&(b=(2*o()-1)*d,b=n(b,i+1e3*u,.5,1,f),b*=c,b=b>0?b:0,s=d,h=e(s,180*(u+1),15,2,f),p=t(s,330*(u+1),15,2,f),b+=h,b+=.8*p,b*=l),b},note:function(e,t,n,r){"number"==typeof e&&(this.tune=e),"number"==typeof r&&(this.cutoff=r),"number"==typeof n&&(this.snappy=n),"number"==typeof t&&(this.amp=t),i.trigger()}}).init().oscillatorInit().processProperties(arguments),i.trigger(1)},Gibberish.Snare.prototype=Gibberish._oscillator,Gibberish.Hat=function(){{var e=new Gibberish.Square,t=new Gibberish.Square,n=new Gibberish.Square,i=new Gibberish.Square,r=new Gibberish.Square,o=new Gibberish.Square,s=e.callback,a=t.callback,u=n.callback,c=i.callback,l=r.callback,f=o.callback,h=new Gibberish.SVF({mode:2}),p=h.callback,d=new Gibberish.Filter24,b=d.callback,m=new Gibberish.ExponentialDecay(.0025,10500),g=m.callback,y=new Gibberish.ExponentialDecay(.1,7500);y.callback}Gibberish.extend(this,{name:"hat",properties:{amp:1,pitch:325,bpfFreq:7e3,bpfRez:2,hpfFreq:.975,hpfRez:0,decay:3500,decay2:3e3,sr:Gibberish.context.sampleRate},callback:function(e,t,n,i,r,o,h,d,m){var y;return y=s(t,1,.5,0),y+=a(1.4471*t,.75,1,0),y+=u(1.617*t,1,1,0),y+=c(1.9265*t,1,1,0),y+=l(2.5028*t,1,1,0),y+=f(2.6637*t,.75,1,0),y=p(y,n,i,2,m),y*=g(.001,h),y=b(y,r,o,0,1),y*=e},note:function(e,t){m.trigger(),y.trigger(),e&&(this.decay=e),t&&(this.decay2=t)}}).init().oscillatorInit().processProperties(arguments),this.bpf=h,this.hpf=d,m.trigger(1),y.trigger(1)},Gibberish.Hat.prototype=Gibberish._oscillator,function(){var e={Soundfont:{instruments:{}}},t=e.Soundfont;"object"==typeof window?window.GenMIDI=e:global.GenMIDI=e;var n=function(e,t){function n(e){var n=document.createElement("script");n.innerText=e.srcElement?e.srcElement.responseText:e.target.responseText,document.querySelector("head").appendChild(n),setTimeout(t,0)}var i=new XMLHttpRequest;i.addEventListener("load",n,!1),i.addEventListener("error",function(e){console.log("SF load error",e)},!1),i.open("GET",e,!0),i.send()},i={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",decodeArrayBuffer:function(e){var t=e.length/4*3,n=new ArrayBuffer(t);return this.decode(e,n),n},decode:function(e,t){var n=this._keyStr.indexOf(e.charAt(e.length-1)),i=this._keyStr.indexOf(e.charAt(e.length-2)),r=e.length/4*3;64==n&&r--,64==i&&r--;var o,s,a,u,c,l,f,h,p=0,d=0;for(o=t?new Uint8Array(t):new Uint8Array(r),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,""),p=0;r>p;p+=3)c=this._keyStr.indexOf(e.charAt(d++)),l=this._keyStr.indexOf(e.charAt(d++)),f=this._keyStr.indexOf(e.charAt(d++)),h=this._keyStr.indexOf(e.charAt(d++)),s=c<<2|l>>4,a=(15&l)<<4|f>>2,u=(3&f)<<6|h,o[p]=s,64!=f&&(o[p+1]=a),64!=h&&(o[p+2]=u);return o}},r=function(e){var n=0,r=t[e.instrumentFileName];"undefined"==typeof t.instruments[e.instrumentFileName]&&(t.instruments[e.instrumentFileName]={}),e.buffers=t.instruments[e.instrumentFileName];for(var o in r)n++,!function(){var s=o,a=r[s].split(",")[1],u=i.decodeArrayBuffer(a);Gibberish.context.decodeAudioData(u,function(i){t.instruments[e.instrumentFileName][s]=i.getChannelData(0),n--,0>=n&&(console.log("Soundfont "+e.instrumentFileName+" is loaded."),e.isLoaded=!0,e.onload&&e.onload())},function(e){console.log("ERROR",e.err,arguments,s)})}()};Gibberish.SoundFont=function(e,i){Gibberish.extend(this,{instrumentFileName:e,name:"soundfont",properties:{amp:1,pan:0},playing:[],buffers:{},onload:null,out:[0,0],isLoaded:!1,resourcePath:i||"./resources/soundfonts/",callback:function(e,t){for(var n=0,i=this.playing.length-1;i>=0;i--){var r=this.playing[i];n+=this.interpolate(r.buffer,r.phase)*r.velocity,r.phase+=r.increment,r.phase>r.length&&this.playing.splice(this.playing.indexOf(r),1)}return this.panner(n*e,t,this.out)}.bind(this),note:function(e,t,n){this.isLoaded&&this.playing.push({buffer:this.buffers[e],phase:0,increment:isNaN(n)?1:1+n,length:this.buffers[e].length,velocity:isNaN(t)?1:t})},interpolate:Gibberish.interpolate.bind(this),panner:Gibberish.makePanner()}).init().oscillatorInit(),"object"==typeof arguments[0]&&arguments[0].instrumentFileName&&(this.instrumentFileName=arguments[0].instrumentFileName);var o=this;return t.instruments[this.instrumentFileName]||"object"==typeof this.resourcePath?"object"==typeof i?(t[this.instrumentFileName]=i,r(this)):(this.buffers=t.instruments[this.instrumentFileName],this.isLoaded=!0,setTimeout(function(){this.onload&&this.onload()}.bind(this),0)):(console.log("Downloading soundfont: "+this.instrumentFileName),n(this.resourcePath+this.instrumentFileName+"-mp3.js",function(){r(o)})),this},Gibberish.SoundFont.storage=t,Gibberish.SoundFont.prototype=Gibberish._oscillator}(),Gibberish.Vocoder=function(){var e=[],t=[],n=Math.abs,i=(Math.sqrt,[0,0]),r=[],o=[],s=128,a=[],u=[],c=[],l=0,f=arguments[3]||330,h=arguments[4]||3200,p=arguments[2]||16,d=arguments[5]||.15;this.name="vocoder",this.properties={carrier:arguments[0]||null,modulator:arguments[1]||null,amp:1,pan:0};for(var b=1200*Math.log(h/f)/Math.LN2,m=b/p,g=Math.pow(2,m/1200),y=f,v=0;p>v;v++)r[v]=new Gibberish.Biquad({mode:"BP",Q:d,cutoff:y}),e[v]=r[v].callback,o[v]=new Gibberish.Biquad({mode:"BP",Q:d,cutoff:y}),t[v]=o[v].callback,a[v]=[0],u[v]=0,c[v]=0,y*=g;this.callback=function(r,o,f){for(var h,d=(l+1)%s,b="number"!=typeof o?o[0]+o[1]:o,m="number"!=typeof r?r[0]+r[1]:r,g=0,y=0;p>y;y++)h=n(e[y](b)),u[y]+=h,u[y]-=a[y][l],a[y][l]=h,a[y][d]=a[y][d]?a[y][d]:0,c[y]=u[y]/s,g+=t[y](m)*c[y];return l=d,i[0]=i[1]=g*f*16,i},this.getEncoders=function(){return r},this.getDecoders=function(){return o},this.init(),this.oscillatorInit()},Gibberish.Vocoder.prototype=Gibberish._synth,Gibberish})}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],8:[function(e,t,n){function i(e,t,n){if(!(this instanceof i))return new i(e,t,n);var r=typeof e;if("base64"===t&&"string"===r)for(e=P(e);e.length%4!==0;)e+="=";var o;if("number"===r)o=C(e);else if("string"===r)o=i.byteLength(e,t);else{if("object"!==r)throw new Error("First argument needs to be a number, array or string.");o=C(e.length)}var s;i._useTypedArrays?s=i._augment(new Uint8Array(o)):(s=this,s.length=o,s._isBuffer=!0);var a;if(i._useTypedArrays&&"number"==typeof e.byteLength)s._set(e);else if(O(e))for(a=0;o>a;a++)s[a]=i.isBuffer(e)?e.readUInt8(a):e[a];else if("string"===r)s.write(e,0,t);else if("number"===r&&!i._useTypedArrays&&!n)for(a=0;o>a;a++)s[a]=0;return s}function r(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r),r>o&&(r=o)):r=o;var s=t.length;V(s%2===0,"Invalid hex string"),r>s/2&&(r=s/2);for(var a=0;r>a;a++){var u=parseInt(t.substr(2*a,2),16);V(!isNaN(u),"Invalid hex string"),e[n+a]=u}return i._charsWritten=2*a,a}function o(e,t,n,r){var o=i._charsWritten=T(L(t),e,n,r);return o}function s(e,t,n,r){var o=i._charsWritten=T(N(t),e,n,r);return o}function a(e,t,n,i){return s(e,t,n,i)}function u(e,t,n,r){var o=i._charsWritten=T(E(t),e,n,r);return o}function c(e,t,n,r){var o=i._charsWritten=T(I(t),e,n,r);return o}function l(e,t,n){return 0===t&&n===e.length?z.fromByteArray(e):z.fromByteArray(e.slice(t,n))}function f(e,t,n){var i="",r="";n=Math.min(e.length,n);for(var o=t;n>o;o++)e[o]<=127?(i+=F(r)+String.fromCharCode(e[o]),r=""):r+="%"+e[o].toString(16);return i+F(r)}function h(e,t,n){var i="";n=Math.min(e.length,n);for(var r=t;n>r;r++)i+=String.fromCharCode(e[r]);return i}function p(e,t,n){return h(e,t,n)}function d(e,t,n){var i=e.length;(!t||0>t)&&(t=0),(!n||0>n||n>i)&&(n=i);for(var r="",o=t;n>o;o++)r+=R(e[o]);return r}function b(e,t,n){for(var i=e.slice(t,n),r="",o=0;o=r)){var o;return n?(o=e[t],r>t+1&&(o|=e[t+1]<<8)):(o=e[t]<<8,r>t+1&&(o|=e[t+1])),o}}function g(e,t,n,i){i||(V("boolean"==typeof n,"missing or invalid endian"),V(void 0!==t&&null!==t,"missing offset"),V(t+3=r)){var o;return n?(r>t+2&&(o=e[t+2]<<16),r>t+1&&(o|=e[t+1]<<8),o|=e[t],r>t+3&&(o+=e[t+3]<<24>>>0)):(r>t+1&&(o=e[t+1]<<16),r>t+2&&(o|=e[t+2]<<8),r>t+3&&(o|=e[t+3]),o+=e[t]<<24>>>0),o}}function y(e,t,n,i){i||(V("boolean"==typeof n,"missing or invalid endian"),V(void 0!==t&&null!==t,"missing offset"),V(t+1=r)){var o=m(e,t,n,!0),s=32768&o;return s?-1*(65535-o+1):o}}function v(e,t,n,i){i||(V("boolean"==typeof n,"missing or invalid endian"),V(void 0!==t&&null!==t,"missing offset"),V(t+3=r)){var o=g(e,t,n,!0),s=2147483648&o;return s?-1*(4294967295-o+1):o}}function x(e,t,n,i){return i||(V("boolean"==typeof n,"missing or invalid endian"),V(t+3=o))for(var s=0,a=Math.min(o-n,2);a>s;s++)e[n+s]=(t&255<<8*(i?s:1-s))>>>8*(i?s:1-s)}function G(e,t,n,i,r){r||(V(void 0!==t&&null!==t,"missing value"),V("boolean"==typeof i,"missing or invalid endian"),V(void 0!==n&&null!==n,"missing offset"),V(n+3=o))for(var s=0,a=Math.min(o-n,4);a>s;s++)e[n+s]=t>>>8*(i?s:3-s)&255}function j(e,t,n,i,r){r||(V(void 0!==t&&null!==t,"missing value"),V("boolean"==typeof i,"missing or invalid endian"),V(void 0!==n&&null!==n,"missing offset"),V(n+1=o||(t>=0?k(e,t,n,i,r):k(e,65535+t+1,n,i,r))}function A(e,t,n,i,r){r||(V(void 0!==t&&null!==t,"missing value"),V("boolean"==typeof i,"missing or invalid endian"),V(void 0!==n&&null!==n,"missing offset"),V(n+3=o||(t>=0?G(e,t,n,i,r):G(e,4294967295+t+1,n,i,r))}function _(e,t,n,i,r){r||(V(void 0!==t&&null!==t,"missing value"),V("boolean"==typeof i,"missing or invalid endian"),V(void 0!==n&&null!==n,"missing offset"),V(n+3=o||H.write(e,t,n,i,23,4)}function S(e,t,n,i,r){r||(V(void 0!==t&&null!==t,"missing value"),V("boolean"==typeof i,"missing or invalid endian"),V(void 0!==n&&null!==n,"missing offset"),V(n+7=o||H.write(e,t,n,i,52,8)}function P(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function q(e,t,n){return"number"!=typeof e?n:(e=~~e,e>=t?t:e>=0?e:(e+=t,e>=0?e:0))}function C(e){return e=~~Math.ceil(+e),0>e?0:e}function M(e){return(Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)})(e)}function O(e){return M(e)||i.isBuffer(e)||e&&"object"==typeof e&&"number"==typeof e.length}function R(e){return 16>e?"0"+e.toString(16):e.toString(16)}function L(e){for(var t=[],n=0;n=i)t.push(e.charCodeAt(n));else{var r=n;i>=55296&&57343>=i&&n++;for(var o=encodeURIComponent(e.slice(r,n+1)).substr(1).split("%"),s=0;s>8,i=t%256,r.push(i),r.push(n);return r}function E(e){return z.toByteArray(e)}function T(e,t,n,i){for(var r=0;i>r&&!(r+n>=t.length||r>=e.length);r++)t[r+n]=e[r];return r}function F(e){try{return decodeURIComponent(e)}catch(t){return String.fromCharCode(65533)}}function B(e,t){V("number"==typeof e,"cannot write a non-number as a number"),V(e>=0,"specified a negative value for writing an unsigned value"),V(t>=e,"value is larger than maximum value for type"),V(Math.floor(e)===e,"value has a fractional component")}function D(e,t,n){V("number"==typeof e,"cannot write a non-number as a number"),V(t>=e,"value larger than maximum allowed value"),V(e>=n,"value smaller than minimum allowed value"),V(Math.floor(e)===e,"value has a fractional component")}function U(e,t,n){V("number"==typeof e,"cannot write a non-number as a number"),V(t>=e,"value larger than maximum allowed value"),V(e>=n,"value smaller than minimum allowed value")}function V(e,t){if(!e)throw new Error(t||"Failed assertion")}var z=e("base64-js"),H=e("ieee754");n.Buffer=i,n.SlowBuffer=i,n.INSPECT_MAX_BYTES=50,i.poolSize=8192,i._useTypedArrays=function(){try{var e=new ArrayBuffer(0),t=new Uint8Array(e);return t.foo=function(){return 42},42===t.foo()&&"function"==typeof t.subarray}catch(n){return!1}}(),i.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"raw":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},i.isBuffer=function(e){return!(null===e||void 0===e||!e._isBuffer)},i.byteLength=function(e,t){var n;switch(e+="",t||"utf8"){case"hex":n=e.length/2;break;case"utf8":case"utf-8":n=L(e).length;break;case"ascii":case"binary":case"raw":n=e.length;break;case"base64":n=E(e).length;break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":n=2*e.length;break;default:throw new Error("Unknown encoding")}return n},i.concat=function(e,t){if(V(M(e),"Usage: Buffer.concat(list, [totalLength])\nlist should be an Array."),0===e.length)return new i(0);if(1===e.length)return e[0];var n;if("number"!=typeof t)for(t=0,n=0;nf&&(n=f)):n=f,i=String(i||"utf8").toLowerCase();var h;switch(i){case"hex":h=r(this,e,t,n);break;case"utf8":case"utf-8":h=o(this,e,t,n);break;case"ascii":h=s(this,e,t,n);break;case"binary":h=a(this,e,t,n);break;case"base64":h=u(this,e,t,n);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":h=c(this,e,t,n);break;default:throw new Error("Unknown encoding")}return h},i.prototype.toString=function(e,t,n){var i=this;if(e=String(e||"utf8").toLowerCase(),t=Number(t)||0,n=void 0!==n?Number(n):n=i.length,n===t)return"";var r;switch(e){case"hex":r=d(i,t,n);break;case"utf8":case"utf-8":r=f(i,t,n);break;case"ascii":r=h(i,t,n);break;case"binary":r=p(i,t,n);break;case"base64":r=l(i,t,n);break;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":r=b(i,t,n);break;default:throw new Error("Unknown encoding")}return r},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},i.prototype.copy=function(e,t,n,r){var o=this;if(n||(n=0),r||0===r||(r=this.length),t||(t=0),r!==n&&0!==e.length&&0!==o.length){V(r>=n,"sourceEnd < sourceStart"),V(t>=0&&t=0&&n=0&&r<=o.length,"sourceEnd out of bounds"),r>this.length&&(r=this.length),e.length-ts||!i._useTypedArrays)for(var a=0;s>a;a++)e[a+t]=this[a+n];else e._set(this.subarray(n,n+s),t)}},i.prototype.slice=function(e,t){var n=this.length;if(e=q(e,n,0),t=q(t,n,n),i._useTypedArrays)return i._augment(this.subarray(e,t));for(var r=t-e,o=new i(r,void 0,!0),s=0;r>s;s++)o[s]=this[s+e];return o},i.prototype.get=function(e){return console.log(".get() is deprecated. Access using array indexes instead."),this.readUInt8(e)},i.prototype.set=function(e,t){return console.log(".set() is deprecated. Access using array indexes instead."),this.writeUInt8(e,t)},i.prototype.readUInt8=function(e,t){return t||(V(void 0!==e&&null!==e,"missing offset"),V(e=this.length?void 0:this[e]},i.prototype.readUInt16LE=function(e,t){return m(this,e,!0,t)},i.prototype.readUInt16BE=function(e,t){return m(this,e,!1,t)},i.prototype.readUInt32LE=function(e,t){return g(this,e,!0,t)},i.prototype.readUInt32BE=function(e,t){return g(this,e,!1,t)},i.prototype.readInt8=function(e,t){if(t||(V(void 0!==e&&null!==e,"missing offset"),V(e=this.length)){var n=128&this[e];return n?-1*(255-this[e]+1):this[e]}},i.prototype.readInt16LE=function(e,t){return y(this,e,!0,t)},i.prototype.readInt16BE=function(e,t){return y(this,e,!1,t)},i.prototype.readInt32LE=function(e,t){return v(this,e,!0,t)},i.prototype.readInt32BE=function(e,t){return v(this,e,!1,t)},i.prototype.readFloatLE=function(e,t){return x(this,e,!0,t)},i.prototype.readFloatBE=function(e,t){return x(this,e,!1,t)},i.prototype.readDoubleLE=function(e,t){return w(this,e,!0,t)},i.prototype.readDoubleBE=function(e,t){return w(this,e,!1,t)},i.prototype.writeUInt8=function(e,t,n){n||(V(void 0!==e&&null!==e,"missing value"),V(void 0!==t&&null!==t,"missing offset"),V(t=this.length||(this[t]=e)},i.prototype.writeUInt16LE=function(e,t,n){k(this,e,t,!0,n)},i.prototype.writeUInt16BE=function(e,t,n){k(this,e,t,!1,n)},i.prototype.writeUInt32LE=function(e,t,n){G(this,e,t,!0,n)},i.prototype.writeUInt32BE=function(e,t,n){G(this,e,t,!1,n)},i.prototype.writeInt8=function(e,t,n){n||(V(void 0!==e&&null!==e,"missing value"),V(void 0!==t&&null!==t,"missing offset"),V(t=this.length||(e>=0?this.writeUInt8(e,t,n):this.writeUInt8(255+e+1,t,n))},i.prototype.writeInt16LE=function(e,t,n){j(this,e,t,!0,n)},i.prototype.writeInt16BE=function(e,t,n){j(this,e,t,!1,n)},i.prototype.writeInt32LE=function(e,t,n){A(this,e,t,!0,n)},i.prototype.writeInt32BE=function(e,t,n){A(this,e,t,!1,n)},i.prototype.writeFloatLE=function(e,t,n){_(this,e,t,!0,n)},i.prototype.writeFloatBE=function(e,t,n){_(this,e,t,!1,n)},i.prototype.writeDoubleLE=function(e,t,n){S(this,e,t,!0,n)},i.prototype.writeDoubleBE=function(e,t,n){S(this,e,t,!1,n)},i.prototype.fill=function(e,t,n){if(e||(e=0),t||(t=0),n||(n=this.length),"string"==typeof e&&(e=e.charCodeAt(0)),V("number"==typeof e&&!isNaN(e),"value is not a number"),V(n>=t,"end < start"),n!==t&&0!==this.length){V(t>=0&&t=0&&n<=this.length,"end out of bounds");for(var i=t;n>i;i++)this[i]=e}},i.prototype.inspect=function(){for(var e=[],t=this.length,i=0;t>i;i++)if(e[i]=R(this[i]),i===n.INSPECT_MAX_BYTES){e[i+1]="...";break}return""},i.prototype.toArrayBuffer=function(){if("undefined"!=typeof Uint8Array){if(i._useTypedArrays)return new i(this).buffer;for(var e=new Uint8Array(this.length),t=0,n=e.length;n>t;t+=1)e[t]=this[t];return e.buffer}throw new Error("Buffer.toArrayBuffer not supported in this browser")};var $=i.prototype;i._augment=function(e){return e._isBuffer=!0,e._get=e.get,e._set=e.set,e.get=$.get,e.set=$.set,e.write=$.write,e.toString=$.toString,e.toLocaleString=$.toString,e.toJSON=$.toJSON,e.copy=$.copy,e.slice=$.slice,e.readUInt8=$.readUInt8,e.readUInt16LE=$.readUInt16LE,e.readUInt16BE=$.readUInt16BE,e.readUInt32LE=$.readUInt32LE,e.readUInt32BE=$.readUInt32BE,e.readInt8=$.readInt8,e.readInt16LE=$.readInt16LE,e.readInt16BE=$.readInt16BE,e.readInt32LE=$.readInt32LE,e.readInt32BE=$.readInt32BE,e.readFloatLE=$.readFloatLE,e.readFloatBE=$.readFloatBE,e.readDoubleLE=$.readDoubleLE,e.readDoubleBE=$.readDoubleBE,e.writeUInt8=$.writeUInt8,e.writeUInt16LE=$.writeUInt16LE,e.writeUInt16BE=$.writeUInt16BE,e.writeUInt32LE=$.writeUInt32LE,e.writeUInt32BE=$.writeUInt32BE,e.writeInt8=$.writeInt8,e.writeInt16LE=$.writeInt16LE,e.writeInt16BE=$.writeInt16BE,e.writeInt32LE=$.writeInt32LE,e.writeInt32BE=$.writeInt32BE,e.writeFloatLE=$.writeFloatLE,e.writeFloatBE=$.writeFloatBE,e.writeDoubleLE=$.writeDoubleLE,e.writeDoubleBE=$.writeDoubleBE,e.fill=$.fill,e.inspect=$.inspect,e.toArrayBuffer=$.toArrayBuffer,e}},{"base64-js":9,ieee754:10}],9:[function(e,t,n){var i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";!function(e){"use strict";function t(e){var t=e.charCodeAt(0);return t===s||t===f?62:t===a||t===h?63:u>t?-1:u+10>t?t-u+26+26:l+26>t?t-l:c+26>t?t-c+26:void 0}function n(e){function n(e){c[f++]=e}var i,r,s,a,u,c;if(e.length%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var l=e.length;u="="===e.charAt(l-2)?2:"="===e.charAt(l-1)?1:0,c=new o(3*e.length/4-u),s=u>0?e.length-4:e.length;var f=0;for(i=0,r=0;s>i;i+=4,r+=3)a=t(e.charAt(i))<<18|t(e.charAt(i+1))<<12|t(e.charAt(i+2))<<6|t(e.charAt(i+3)),n((16711680&a)>>16),n((65280&a)>>8),n(255&a);return 2===u?(a=t(e.charAt(i))<<2|t(e.charAt(i+1))>>4,n(255&a)):1===u&&(a=t(e.charAt(i))<<10|t(e.charAt(i+1))<<4|t(e.charAt(i+2))>>2,n(a>>8&255),n(255&a)),c}function r(e){function t(e){return i.charAt(e)}function n(e){return t(e>>18&63)+t(e>>12&63)+t(e>>6&63)+t(63&e)}var r,o,s,a=e.length%3,u="";for(r=0,s=e.length-a;s>r;r+=3)o=(e[r]<<16)+(e[r+1]<<8)+e[r+2],u+=n(o);switch(a){case 1:o=e[e.length-1],u+=t(o>>2),u+=t(o<<4&63),u+="==";break;case 2:o=(e[e.length-2]<<8)+e[e.length-1],u+=t(o>>10),u+=t(o>>4&63),u+=t(o<<2&63),u+="="}return u}var o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="+".charCodeAt(0),a="/".charCodeAt(0),u="0".charCodeAt(0),c="a".charCodeAt(0),l="A".charCodeAt(0),f="-".charCodeAt(0),h="_".charCodeAt(0);e.toByteArray=n,e.fromByteArray=r}("undefined"==typeof n?this.base64js={}:n)},{}],10:[function(e,t,n){n.read=function(e,t,n,i,r){var o,s,a=8*r-i-1,u=(1<>1,l=-7,f=n?r-1:0,h=n?-1:1,p=e[t+f];for(f+=h,o=p&(1<<-l)-1,p>>=-l,l+=a;l>0;o=256*o+e[t+f],f+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=i;l>0;s=256*s+e[t+f],f+=h,l-=8);if(0===o)o=1-c;else{if(o===u)return s?0/0:1/0*(p?-1:1);s+=Math.pow(2,i),o-=c}return(p?-1:1)*s*Math.pow(2,o-i)},n.write=function(e,t,n,i,r,o){var s,a,u,c=8*o-r-1,l=(1<>1,h=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:o-1,d=i?1:-1,b=0>t||0===t&&0>1/t?1:0;for(t=Math.abs(t),isNaN(t)||1/0===t?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),t+=s+f>=1?h/u:h*Math.pow(2,1-f),t*u>=2&&(s++,u/=2),s+f>=l?(a=0,s=l):s+f>=1?(a=(t*u-1)*Math.pow(2,r),s+=f):(a=t*Math.pow(2,f-1)*Math.pow(2,r),s=0));r>=8;e[n+p]=255&a,p+=d,a/=256,r-=8);for(s=s<0;e[n+p]=255&s,p+=d,s/=256,c-=8);e[n+p-d]|=128*b}},{}],11:[function(e,t){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(e){return"function"==typeof e}function r(e){return"number"==typeof e}function o(e){return"object"==typeof e&&null!==e}function s(e){return void 0===e}t.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if(!r(e)||0>e||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,n,r,a,u,c;if(this._events||(this._events={}),"error"===e&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;throw TypeError('Uncaught, unspecified "error" event.')}if(n=this._events[e],s(n))return!1;if(i(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:for(r=arguments.length,a=new Array(r-1),u=1;r>u;u++)a[u-1]=arguments[u];n.apply(this,a)}else if(o(n)){for(r=arguments.length,a=new Array(r-1),u=1;r>u;u++)a[u-1]=arguments[u];for(c=n.slice(),r=c.length,u=0;r>u;u++)c[u].apply(this,a)}return!0},n.prototype.addListener=function(e,t){var r;if(!i(t))throw TypeError("listener must be a function");if(this._events||(this._events={}),this._events.newListener&&this.emit("newListener",e,i(t.listener)?t.listener:t),this._events[e]?o(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,o(this._events[e])&&!this._events[e].warned){var r;r=s(this._maxListeners)?n.defaultMaxListeners:this._maxListeners,r&&r>0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace())}return this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function n(){this.removeListener(e,n),r||(r=!0,t.apply(this,arguments))}if(!i(t))throw TypeError("listener must be a function");var r=!1;return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,t){var n,r,s,a;if(!i(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],s=n.length,r=-1,n===t||i(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(n)){for(a=s;a-->0;)if(n[a]===t||n[a].listener&&n[a].listener===t){r=a;break}if(0>r)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(r,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],i(n))this.removeListener(e,n);else for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){var t;return t=this._events&&this._events[e]?i(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.listenerCount=function(e,t){var n;return n=e._events&&e._events[t]?i(e._events[t])?1:e._events[t].length:0}},{}],12:[function(e,t){var n=t.exports,i=(e("events").EventEmitter,e("./lib/request")),r=e("url");n.request=function(e,t){"string"==typeof e&&(e=r.parse(e)),e||(e={}),e.host||e.port||(e.port=parseInt(window.location.port,10)),!e.host&&e.hostname&&(e.host=e.hostname),e.scheme||(e.scheme=window.location.protocol.split(":")[0]),e.host||(e.host=window.location.hostname||window.location.host),/:/.test(e.host)&&(e.port||(e.port=e.host.split(":")[1]),e.host=e.host.split(":")[0]),e.port||(e.port="https"==e.scheme?443:80);var n=new i(new o,e);return t&&n.on("response",t),n},n.get=function(e,t){e.method="GET";var i=n.request(e,t);return i.end(),i},n.Agent=function(){},n.Agent.defaultMaxSockets=4;var o=function(){if("undefined"==typeof window)throw new Error("no window object present");if(window.XMLHttpRequest)return window.XMLHttpRequest;if(window.ActiveXObject){for(var e=["Msxml2.XMLHTTP.6.0","Msxml2.XMLHTTP.3.0","Microsoft.XMLHTTP"],t=0;tthis.offset&&(this.emit("data",t.slice(this.offset)),this.offset=t.length),void 0)};var a=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{stream:23,util:32}],15:[function(e,t,n){!function(){function e(e){this.message=e}var t="undefined"!=typeof n?n:this,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e.prototype=new Error,e.prototype.name="InvalidCharacterError",t.btoa||(t.btoa=function(t){for(var n,r,o=0,s=i,a="";t.charAt(0|o)||(s="=",o%1);a+=s.charAt(63&n>>8-o%1*8)){if(r=t.charCodeAt(o+=.75),r>255)throw new e("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");n=n<<8|r}return a}),t.atob||(t.atob=function(t){if(t=t.replace(/=+$/,""),t.length%4==1)throw new e("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,o=0,s=0,a="";r=t.charAt(s++);~r&&(n=o%4?64*n+r:r,o++%4)?a+=String.fromCharCode(255&n>>(-2*o&6)):0)r=i.indexOf(r);return a})}()},{}],16:[function(e,t){t.exports="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},{}],17:[function(e,t){function n(){}var i=t.exports={};i.nextTick=function(){var e="undefined"!=typeof window&&window.setImmediate,t="undefined"!=typeof window&&window.postMessage&&window.addEventListener;if(e)return function(e){return window.setImmediate(e)};if(t){var n=[];return window.addEventListener("message",function(e){var t=e.source;if((t===window||null===t)&&"process-tick"===e.data&&(e.stopPropagation(),n.length>0)){var i=n.shift();i()}},!0),function(e){n.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),i.title="browser",i.browser=!0,i.env={},i.argv=[],i.on=n,i.addListener=n,i.once=n,i.off=n,i.removeListener=n,i.removeAllListeners=n,i.emit=n,i.binding=function(){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(){throw new Error("process.chdir is not supported")}},{}],18:[function(e,t,n){(function(e){!function(i){function r(e){throw RangeError(R[e])}function o(e,t){for(var n=e.length;n--;)e[n]=t(e[n]);return e}function s(e,t){return o(e.split(O),t).join(".")}function a(e){for(var t,n,i=[],r=0,o=e.length;o>r;)t=e.charCodeAt(r++),t>=55296&&56319>=t&&o>r?(n=e.charCodeAt(r++),56320==(64512&n)?i.push(((1023&t)<<10)+(1023&n)+65536):(i.push(t),r--)):i.push(t);return i}function u(e){return o(e,function(e){var t="";return e>65535&&(e-=65536,t+=I(e>>>10&1023|55296),e=56320|1023&e),t+=I(e)}).join("")}function c(e){return 10>e-48?e-22:26>e-65?e-65:26>e-97?e-97:k}function l(e,t){return e+22+75*(26>e)-((0!=t)<<5)}function f(e,t,n){var i=0;for(e=n?N(e/_):e>>1,e+=N(e/t);e>L*j>>1;i+=k)e=N(e/L);return N(i+(L+1)*e/(e+A))}function h(e){var t,n,i,o,s,a,l,h,p,d,b=[],m=e.length,g=0,y=P,v=S;for(n=e.lastIndexOf(q),0>n&&(n=0),i=0;n>i;++i)e.charCodeAt(i)>=128&&r("not-basic"),b.push(e.charCodeAt(i));for(o=n>0?n+1:0;m>o;){for(s=g,a=1,l=k;o>=m&&r("invalid-input"),h=c(e.charCodeAt(o++)),(h>=k||h>N((w-g)/a))&&r("overflow"),g+=h*a,p=v>=l?G:l>=v+j?j:l-v,!(p>h);l+=k)d=k-p,a>N(w/d)&&r("overflow"),a*=d;t=b.length+1,v=f(g-s,t,0==s),N(g/t)>w-y&&r("overflow"),y+=N(g/t),g%=t,b.splice(g++,0,y)}return u(b)}function p(e){var t,n,i,o,s,u,c,h,p,d,b,m,g,y,v,x=[];for(e=a(e),m=e.length,t=P,n=0,s=S,u=0;m>u;++u)b=e[u],128>b&&x.push(I(b));for(i=o=x.length,o&&x.push(q);m>i;){for(c=w,u=0;m>u;++u)b=e[u],b>=t&&c>b&&(c=b);for(g=i+1,c-t>N((w-n)/g)&&r("overflow"),n+=(c-t)*g,t=c,u=0;m>u;++u)if(b=e[u],t>b&&++n>w&&r("overflow"),b==t){for(h=n,p=k;d=s>=p?G:p>=s+j?j:p-s,!(d>h);p+=k)v=h-d,y=k-d,x.push(I(l(d+v%y,0))),h=N(v/y);x.push(I(l(h,0))),s=f(n,g,i==o),n=0,++i}++n,++t}return x.join("")}function d(e){return s(e,function(e){return C.test(e)?h(e.slice(4).toLowerCase()):e})}function b(e){return s(e,function(e){return M.test(e)?"xn--"+p(e):e})}var m="object"==typeof n&&n,g="object"==typeof t&&t&&t.exports==m&&t,y="object"==typeof e&&e;(y.global===y||y.window===y)&&(i=y);var v,x,w=2147483647,k=36,G=1,j=26,A=38,_=700,S=72,P=128,q="-",C=/^xn--/,M=/[^ -~]/,O=/\x2E|\u3002|\uFF0E|\uFF61/g,R={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},L=k-G,N=Math.floor,I=String.fromCharCode;if(v={version:"1.2.4",ucs2:{decode:a,encode:u},decode:h,encode:p,toASCII:b,toUnicode:d},"function"==typeof define&&"object"==typeof define.amd&&define.amd)define("punycode",function(){return v});else if(m&&!m.nodeType)if(g)g.exports=v;else for(x in v)v.hasOwnProperty(x)&&(m[x]=v[x]);else i.punycode=v}(this)}).call(this,"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],19:[function(e,t){"use strict";function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.exports=function(e,t,r,o){t=t||"&",r=r||"=";var s={};if("string"!=typeof e||0===e.length)return s;var a=/\+/g;e=e.split(t);var u=1e3;o&&"number"==typeof o.maxKeys&&(u=o.maxKeys);var c=e.length;u>0&&c>u&&(c=u);for(var l=0;c>l;++l){var f,h,p,d,b=e[l].replace(a,"%20"),m=b.indexOf(r);m>=0?(f=b.substr(0,m),h=b.substr(m+1)):(f=b,h=""),p=decodeURIComponent(f),d=decodeURIComponent(h),n(s,p)?i(s[p])?s[p].push(d):s[p]=[s[p],d]:s[p]=d}return s};var i=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},{}],20:[function(e,t){"use strict";function n(e,t){if(e.map)return e.map(t);for(var n=[],i=0;i0)){var i=n.shift();i()}},!0),function(e){n.push(e),window.postMessage("process-tick","*")}}return function(e){setTimeout(e,0)}}(),n.title="browser",n.browser=!0,n.env={},n.argv=[],n.binding=function(){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(){throw new Error("process.chdir is not supported")}},{}],25:[function(e,t){function n(e){return this instanceof n?(i.call(this,e),void 0):new n(e)}t.exports=n;var i=e("./transform.js"),r=e("inherits");r(n,i),n.prototype._transform=function(e,t,n){n(null,e)}},{"./transform.js":27,inherits:16}],26:[function(e,t){(function(n){function i(t){t=t||{};var n=t.highWaterMark;this.highWaterMark=n||0===n?n:16384,this.highWaterMark=~~this.highWaterMark,this.buffer=[],this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=!1,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.calledRead=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.objectMode=!!t.objectMode,this.defaultEncoding=t.defaultEncoding||"utf8",this.ranOut=!1,this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(G||(G=e("string_decoder").StringDecoder),this.decoder=new G(t.encoding),this.encoding=t.encoding)}function r(e){return this instanceof r?(this._readableState=new i(e,this),this.readable=!0,A.call(this),void 0):new r(e)}function o(e,t,n,i,r){var o=c(t,n);if(o)e.emit("error",o);else if(null===n||void 0===n)t.reading=!1,t.ended||l(e,t);else if(t.objectMode||n&&n.length>0)if(t.ended&&!r){var a=new Error("stream.push() after EOF");e.emit("error",a)}else if(t.endEmitted&&r){var a=new Error("stream.unshift() after end event");e.emit("error",a)}else!t.decoder||r||i||(n=t.decoder.write(n)),t.length+=t.objectMode?1:n.length,r?t.buffer.unshift(n):(t.reading=!1,t.buffer.push(n)),t.needReadable&&f(e),p(e,t);else r||(t.reading=!1);return s(t)}function s(e){return!e.ended&&(e.needReadable||e.length=q)e=q;else{e--;for(var t=1;32>t;t<<=1)e|=e>>t;e++}return e}function u(e,t){return 0===t.length&&t.ended?0:t.objectMode?0===e?0:1:isNaN(e)||null===e?t.flowing&&t.buffer.length?t.buffer[0].length:t.length:0>=e?0:(e>t.highWaterMark&&(t.highWaterMark=a(e)),e>t.length?t.ended?t.length:(t.needReadable=!0,0):e)}function c(e,t){var n=null;return _.isBuffer(t)||"string"==typeof t||null===t||void 0===t||e.objectMode||n||(n=new TypeError("Invalid non-string/buffer chunk")),n}function l(e,t){if(t.decoder&&!t.ended){var n=t.decoder.end();n&&n.length&&(t.buffer.push(n),t.length+=t.objectMode?1:n.length)}t.ended=!0,t.length>0?f(e):x(e)}function f(e){var t=e._readableState;t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,t.sync?S(function(){h(e)}):h(e))}function h(e){e.emit("readable")}function p(e,t){t.readingMore||(t.readingMore=!0,S(function(){d(e,t)}))}function d(e,t){for(var n=t.length;!t.reading&&!t.flowing&&!t.ended&&t.length0)return;return 0===i.pipesCount?(i.flowing=!1,j.listenerCount(e,"data")>0&&y(e),void 0):(i.ranOut=!0,void 0)}function g(){this._readableState.ranOut&&(this._readableState.ranOut=!1,m(this))}function y(e,t){var n=e._readableState;if(n.flowing)throw new Error("Cannot switch to old mode now.");var i=t||!1,r=!1;e.readable=!0,e.pipe=A.prototype.pipe,e.on=e.addListener=A.prototype.on,e.on("readable",function(){r=!0;for(var t;!i&&null!==(t=e.read());)e.emit("data",t);null===t&&(r=!1,e._readableState.needReadable=!0)}),e.pause=function(){i=!0,this.emit("pause")},e.resume=function(){i=!1,r?S(function(){e.emit("readable")}):this.read(0),this.emit("resume")},e.emit("readable")}function v(e,t){var n,i=t.buffer,r=t.length,o=!!t.decoder,s=!!t.objectMode;if(0===i.length)return null;if(0===r)n=null;else if(s)n=i.shift();else if(!e||e>=r)n=o?i.join(""):_.concat(i,r),i.length=0;else if(ec&&e>u;c++){var a=i[0],f=Math.min(e-u,a.length);o?n+=a.slice(0,f):a.copy(n,u,0,f),f0)throw new Error("endReadable called on non-empty stream");!t.endEmitted&&t.calledRead&&(t.ended=!0,S(function(){t.endEmitted||0!==t.length||(t.endEmitted=!0,e.readable=!1,e.emit("end")) +}))}function w(e,t){for(var n=0,i=e.length;i>n;n++)t(e[n],n)}function k(e,t){for(var n=0,i=e.length;i>n;n++)if(e[n]===t)return n;return-1}t.exports=r,r.ReadableState=i;var G,j=e("events").EventEmitter,A=e("./index.js"),_=e("buffer").Buffer,S=e("process/browser.js").nextTick,P=e("inherits");P(r,A),r.prototype.push=function(e,t){var n=this._readableState;return"string"!=typeof e||n.objectMode||(t=t||n.defaultEncoding,t!==n.encoding&&(e=new _(e,t),t="")),o(this,n,e,t,!1)},r.prototype.unshift=function(e){var t=this._readableState;return o(this,t,e,"",!0)},r.prototype.setEncoding=function(t){G||(G=e("string_decoder").StringDecoder),this._readableState.decoder=new G(t),this._readableState.encoding=t};var q=8388608;r.prototype.read=function(e){var t=this._readableState;t.calledRead=!0;var n=e;if(("number"!=typeof e||e>0)&&(t.emittedReadable=!1),0===e&&t.needReadable&&(t.length>=t.highWaterMark||t.ended))return f(this),null;if(e=u(e,t),0===e&&t.ended)return 0===t.length&&x(this),null;var i=t.needReadable;t.length-e<=t.highWaterMark&&(i=!0),(t.ended||t.reading)&&(i=!1),i&&(t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1),i&&!t.reading&&(e=u(n,t));var r;return r=e>0?v(e,t):null,null===r&&(t.needReadable=!0,e=0),t.length-=e,0!==t.length||t.ended||(t.needReadable=!0),t.ended&&!t.endEmitted&&0===t.length&&x(this),r},r.prototype._read=function(){this.emit("error",new Error("not implemented"))},r.prototype.pipe=function(e,t){function i(e){e===l&&o()}function r(){e.end()}function o(){e.removeListener("close",a),e.removeListener("finish",u),e.removeListener("drain",d),e.removeListener("error",s),e.removeListener("unpipe",i),l.removeListener("end",r),l.removeListener("end",o),(!e._writableState||e._writableState.needDrain)&&d()}function s(t){c(),0===y&&0===j.listenerCount(e,"error")&&e.emit("error",t)}function a(){e.removeListener("finish",u),c()}function u(){e.removeListener("close",a),c()}function c(){l.unpipe(e)}var l=this,f=this._readableState;switch(f.pipesCount){case 0:f.pipes=e;break;case 1:f.pipes=[f.pipes,e];break;default:f.pipes.push(e)}f.pipesCount+=1;var h=(!t||t.end!==!1)&&e!==n.stdout&&e!==n.stderr,p=h?r:o;f.endEmitted?S(p):l.once("end",p),e.on("unpipe",i);var d=b(l);e.on("drain",d);var y=j.listenerCount(e,"error");return e.once("error",s),e.once("close",a),e.once("finish",u),e.emit("pipe",l),f.flowing||(this.on("readable",g),f.flowing=!0,S(function(){m(l)})),e},r.prototype.unpipe=function(e){var t=this._readableState;if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes?this:(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,this.removeListener("readable",g),t.flowing=!1,e&&e.emit("unpipe",this),this);if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,this.removeListener("readable",g),t.flowing=!1;for(var r=0;i>r;r++)n[r].emit("unpipe",this);return this}var r=k(t.pipes,e);return-1===r?this:(t.pipes.splice(r,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this),this)},r.prototype.on=function(e,t){var n=A.prototype.on.call(this,e,t);if("data"!==e||this._readableState.flowing||y(this),"readable"===e&&this.readable){var i=this._readableState;i.readableListening||(i.readableListening=!0,i.emittedReadable=!1,i.needReadable=!0,i.reading?i.length&&f(this,i):this.read(0))}return n},r.prototype.addListener=r.prototype.on,r.prototype.resume=function(){y(this),this.read(0),this.emit("resume")},r.prototype.pause=function(){y(this,!0),this.emit("pause")},r.prototype.wrap=function(e){var t=this._readableState,n=!1,i=this;e.on("end",function(){if(t.decoder&&!t.ended){var e=t.decoder.end();e&&e.length&&i.push(e)}i.push(null)}),e.on("data",function(r){if(t.decoder&&(r=t.decoder.write(r)),r&&(t.objectMode||r.length)){var o=i.push(r);o||(n=!0,e.pause())}});for(var r in e)"function"==typeof e[r]&&"undefined"==typeof this[r]&&(this[r]=function(t){return function(){return e[t].apply(e,arguments)}}(r));var o=["error","close","destroy","pause","resume"];return w(o,function(t){e.on(t,function(e){return i.emit.apply(i,t,e)})}),i._read=function(){n&&(n=!1,e.resume())},i},r._fromList=v}).call(this,e("oMfpAn"))},{"./index.js":23,buffer:8,events:11,inherits:16,oMfpAn:17,"process/browser.js":24,string_decoder:29}],27:[function(e,t){function n(e,t){this.afterTransform=function(e,n){return i(t,e,n)},this.needTransform=!1,this.transforming=!1,this.writecb=null,this.writechunk=null}function i(e,t,n){var i=e._transformState;i.transforming=!1;var r=i.writecb;if(!r)return e.emit("error",new Error("no writecb in Transform class"));i.writechunk=null,i.writecb=null,null!==n&&void 0!==n&&e.push(n),r&&r(t);var o=e._readableState;o.reading=!1,(o.needReadable||o.length=this.charLength-this.charReceived?this.charLength-this.charReceived:e.length;if(e.copy(this.charBuffer,this.charReceived,n,i),this.charReceived+=i-n,n=i,this.charReceived=55296&&56319>=r)){if(this.charReceived=this.charLength=0,i==e.length)return t;e=e.slice(i,e.length);break}this.charLength+=this.surrogateSize,t=""}var o=this.detectIncompleteChar(e),s=e.length;this.charLength&&(e.copy(this.charBuffer,0,e.length-o,s),this.charReceived=o,s-=o),t+=e.toString(this.encoding,0,s);var s=t.length-1,r=t.charCodeAt(s);if(r>=55296&&56319>=r){var a=this.surrogateSize;return this.charLength+=a,this.charReceived+=a,this.charBuffer.copy(this.charBuffer,a,0,a),this.charBuffer.write(t.charAt(t.length-1),this.encoding),t.substring(0,s)}return t},u.prototype.detectIncompleteChar=function(e){for(var t=e.length>=3?3:e.length;t>0;t--){var n=e[e.length-t];if(1==t&&n>>5==6){this.charLength=2;break}if(2>=t&&n>>4==14){this.charLength=3;break}if(3>=t&&n>>3==30){this.charLength=4;break}}return t},u.prototype.end=function(e){var t="";if(e&&e.length&&(t=this.write(e)),this.charReceived){var n=this.charReceived,i=this.charBuffer,r=this.encoding;t+=i.slice(0,n).toString(r)}return t}},{buffer:8}],30:[function(e,t,n){function i(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function r(e,t,n){if(e&&c(e)&&e instanceof i)return e;var r=new i;return r.parse(e,t,n),r}function o(e){return u(e)&&(e=r(e)),e instanceof i?e.format():i.prototype.format.call(e)}function s(e,t){return r(e,!1,!0).resolve(t)}function a(e,t){return e?r(e,!1,!0).resolveObject(t):t}function u(e){return"string"==typeof e}function c(e){return"object"==typeof e&&null!==e}function l(e){return null===e}function f(e){return null==e}var h=e("punycode");n.parse=r,n.resolve=s,n.resolveObject=a,n.format=o,n.Url=i;var p=/^([a-z0-9.+-]+:)/i,d=/:[0-9]*$/,b=["<",">",'"',"`"," ","\r","\n"," "],m=["{","}","|","\\","^","`"].concat(b),g=["'"].concat(m),y=["%","/","?",";","#"].concat(g),v=["/","?","#"],x=255,w=/^[a-z0-9A-Z_-]{0,63}$/,k=/^([a-z0-9A-Z_-]{0,63})(.*)$/,G={javascript:!0,"javascript:":!0},j={javascript:!0,"javascript:":!0},A={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},_=e("querystring");i.prototype.parse=function(e,t,n){if(!u(e))throw new TypeError("Parameter 'url' must be a string, not "+typeof e);var i=e;i=i.trim();var r=p.exec(i);if(r){r=r[0];var o=r.toLowerCase();this.protocol=o,i=i.substr(r.length)}if(n||r||i.match(/^\/\/[^@\/]+@[^@\/]+/)){var s="//"===i.substr(0,2);!s||r&&j[r]||(i=i.substr(2),this.slashes=!0)}if(!j[r]&&(s||r&&!A[r])){for(var a=-1,c=0;cl)&&(a=l)}var f,d;d=-1===a?i.lastIndexOf("@"):i.lastIndexOf("@",a),-1!==d&&(f=i.slice(0,d),i=i.slice(d+1),this.auth=decodeURIComponent(f)),a=-1;for(var c=0;cl)&&(a=l)}-1===a&&(a=i.length),this.host=i.slice(0,a),i=i.slice(a),this.parseHost(),this.hostname=this.hostname||"";var b="["===this.hostname[0]&&"]"===this.hostname[this.hostname.length-1];if(!b)for(var m=this.hostname.split(/\./),c=0,S=m.length;S>c;c++){var P=m[c];if(P&&!P.match(w)){for(var q="",C=0,M=P.length;M>C;C++)q+=P.charCodeAt(C)>127?"x":P[C];if(!q.match(w)){var O=m.slice(0,c),R=m.slice(c+1),L=P.match(k);L&&(O.push(L[1]),R.unshift(L[2])),R.length&&(i="/"+R.join(".")+i),this.hostname=O.join(".");break}}}if(this.hostname=this.hostname.length>x?"":this.hostname.toLowerCase(),!b){for(var N=this.hostname.split("."),I=[],c=0;cc;c++){var B=g[c],D=encodeURIComponent(B);D===B&&(D=escape(B)),i=i.split(B).join(D)}var U=i.indexOf("#");-1!==U&&(this.hash=i.substr(U),i=i.slice(0,U));var V=i.indexOf("?");if(-1!==V?(this.search=i.substr(V),this.query=i.substr(V+1),t&&(this.query=_.parse(this.query)),i=i.slice(0,V)):t&&(this.search="",this.query={}),i&&(this.pathname=i),A[o]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var T=this.pathname||"",E=this.search||"";this.path=T+E}return this.href=this.format(),this},i.prototype.format=function(){var e=this.auth||"";e&&(e=encodeURIComponent(e),e=e.replace(/%3A/i,":"),e+="@");var t=this.protocol||"",n=this.pathname||"",i=this.hash||"",r=!1,o="";this.host?r=e+this.host:this.hostname&&(r=e+(-1===this.hostname.indexOf(":")?this.hostname:"["+this.hostname+"]"),this.port&&(r+=":"+this.port)),this.query&&c(this.query)&&Object.keys(this.query).length&&(o=_.stringify(this.query));var s=this.search||o&&"?"+o||"";return t&&":"!==t.substr(-1)&&(t+=":"),this.slashes||(!t||A[t])&&r!==!1?(r="//"+(r||""),n&&"/"!==n.charAt(0)&&(n="/"+n)):r||(r=""),i&&"#"!==i.charAt(0)&&(i="#"+i),s&&"?"!==s.charAt(0)&&(s="?"+s),n=n.replace(/[?#]/g,function(e){return encodeURIComponent(e)}),s=s.replace("#","%23"),t+r+n+s+i},i.prototype.resolve=function(e){return this.resolveObject(r(e,!1,!0)).format()},i.prototype.resolveObject=function(e){if(u(e)){var t=new i;t.parse(e,!1,!0),e=t}var n=new i;if(Object.keys(this).forEach(function(e){n[e]=this[e]},this),n.hash=e.hash,""===e.href)return n.href=n.format(),n;if(e.slashes&&!e.protocol)return Object.keys(e).forEach(function(t){"protocol"!==t&&(n[t]=e[t])}),A[n.protocol]&&n.hostname&&!n.pathname&&(n.path=n.pathname="/"),n.href=n.format(),n;if(e.protocol&&e.protocol!==n.protocol){if(!A[e.protocol])return Object.keys(e).forEach(function(t){n[t]=e[t]}),n.href=n.format(),n;if(n.protocol=e.protocol,e.host||j[e.protocol])n.pathname=e.pathname;else{for(var r=(e.pathname||"").split("/");r.length&&!(e.host=r.shift()););e.host||(e.host=""),e.hostname||(e.hostname=""),""!==r[0]&&r.unshift(""),r.length<2&&r.unshift(""),n.pathname=r.join("/")}if(n.search=e.search,n.query=e.query,n.host=e.host||"",n.auth=e.auth,n.hostname=e.hostname||e.host,n.port=e.port,n.pathname||n.search){var o=n.pathname||"",s=n.search||"";n.path=o+s}return n.slashes=n.slashes||e.slashes,n.href=n.format(),n}var a=n.pathname&&"/"===n.pathname.charAt(0),c=e.host||e.pathname&&"/"===e.pathname.charAt(0),h=c||a||n.host&&e.pathname,p=h,d=n.pathname&&n.pathname.split("/")||[],r=e.pathname&&e.pathname.split("/")||[],b=n.protocol&&!A[n.protocol];if(b&&(n.hostname="",n.port=null,n.host&&(""===d[0]?d[0]=n.host:d.unshift(n.host)),n.host="",e.protocol&&(e.hostname=null,e.port=null,e.host&&(""===r[0]?r[0]=e.host:r.unshift(e.host)),e.host=null),h=h&&(""===r[0]||""===d[0])),c)n.host=e.host||""===e.host?e.host:n.host,n.hostname=e.hostname||""===e.hostname?e.hostname:n.hostname,n.search=e.search,n.query=e.query,d=r;else if(r.length)d||(d=[]),d.pop(),d=d.concat(r),n.search=e.search,n.query=e.query;else if(!f(e.search)){if(b){n.hostname=n.host=d.shift();var m=n.host&&n.host.indexOf("@")>0?n.host.split("@"):!1;m&&(n.auth=m.shift(),n.host=n.hostname=m.shift())}return n.search=e.search,n.query=e.query,l(n.pathname)&&l(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.href=n.format(),n}if(!d.length)return n.pathname=null,n.path=n.search?"/"+n.search:null,n.href=n.format(),n;for(var g=d.slice(-1)[0],y=(n.host||e.host)&&("."===g||".."===g)||""===g,v=0,x=d.length;x>=0;x--)g=d[x],"."==g?d.splice(x,1):".."===g?(d.splice(x,1),v++):v&&(d.splice(x,1),v--);if(!h&&!p)for(;v--;v)d.unshift("..");!h||""===d[0]||d[0]&&"/"===d[0].charAt(0)||d.unshift(""),y&&"/"!==d.join("/").substr(-1)&&d.push("");var w=""===d[0]||d[0]&&"/"===d[0].charAt(0);if(b){n.hostname=n.host=w?"":d.length?d.shift():"";var m=n.host&&n.host.indexOf("@")>0?n.host.split("@"):!1;m&&(n.auth=m.shift(),n.host=n.hostname=m.shift())}return h=h||n.host&&d.length,h&&!w&&d.unshift(""),d.length?n.pathname=d.join("/"):(n.pathname=null,n.path=null),l(n.pathname)&&l(n.search)||(n.path=(n.pathname?n.pathname:"")+(n.search?n.search:"")),n.auth=e.auth||n.auth,n.slashes=n.slashes||e.slashes,n.href=n.format(),n},i.prototype.parseHost=function(){var e=this.host,t=d.exec(e);t&&(t=t[0],":"!==t&&(this.port=t.substr(1)),e=e.substr(0,e.length-t.length)),e&&(this.hostname=e)}},{punycode:18,querystring:21}],31:[function(e,t){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],32:[function(e,t,n){(function(t,i){function r(e,t){var i={seen:[],stylize:s};return arguments.length>=3&&(i.depth=arguments[2]),arguments.length>=4&&(i.colors=arguments[3]),b(t)?i.showHidden=t:t&&n._extend(i,t),w(i.showHidden)&&(i.showHidden=!1),w(i.depth)&&(i.depth=2),w(i.colors)&&(i.colors=!1),w(i.customInspect)&&(i.customInspect=!0),i.colors&&(i.stylize=o),u(i,e,i.depth)}function o(e,t){var n=r.styles[t];return n?"["+r.colors[n][0]+"m"+e+"["+r.colors[n][1]+"m":e}function s(e){return e}function a(e){var t={};return e.forEach(function(e){t[e]=!0}),t}function u(e,t,i){if(e.customInspect&&t&&_(t.inspect)&&t.inspect!==n.inspect&&(!t.constructor||t.constructor.prototype!==t)){var r=t.inspect(i,e);return v(r)||(r=u(e,r,i)),r}var o=c(e,t);if(o)return o;var s=Object.keys(t),b=a(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(t)),A(t)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return l(t);if(0===s.length){if(_(t)){var m=t.name?": "+t.name:"";return e.stylize("[Function"+m+"]","special")}if(k(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(j(t))return e.stylize(Date.prototype.toString.call(t),"date");if(A(t))return l(t)}var g="",y=!1,x=["{","}"];if(d(t)&&(y=!0,x=["[","]"]),_(t)){var w=t.name?": "+t.name:"";g=" [Function"+w+"]"}if(k(t)&&(g=" "+RegExp.prototype.toString.call(t)),j(t)&&(g=" "+Date.prototype.toUTCString.call(t)),A(t)&&(g=" "+l(t)),0===s.length&&(!y||0==t.length))return x[0]+g+x[1];if(0>i)return k(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var G;return G=y?f(e,t,i,b,s):s.map(function(n){return h(e,t,i,b,n,y)}),e.seen.pop(),p(G,g,x)}function c(e,t){if(w(t))return e.stylize("undefined","undefined");if(v(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return y(t)?e.stylize(""+t,"number"):b(t)?e.stylize(""+t,"boolean"):m(t)?e.stylize("null","null"):void 0}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function f(e,t,n,i,r){for(var o=[],s=0,a=t.length;a>s;++s)M(t,String(s))?o.push(h(e,t,n,i,String(s),!0)):o.push("");return r.forEach(function(r){r.match(/^\d+$/)||o.push(h(e,t,n,i,r,!0))}),o}function h(e,t,n,i,r,o){var s,a,c;if(c=Object.getOwnPropertyDescriptor(t,r)||{value:t[r]},c.get?a=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(a=e.stylize("[Setter]","special")),M(i,r)||(s="["+r+"]"),a||(e.seen.indexOf(c.value)<0?(a=m(n)?u(e,c.value,null):u(e,c.value,n-1),a.indexOf("\n")>-1&&(a=o?a.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n"))):a=e.stylize("[Circular]","special")),w(s)){if(o&&r.match(/^\d+$/))return a;s=JSON.stringify(""+r),s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function p(e,t,n){var i=0,r=e.reduce(function(e,t){return i++,t.indexOf("\n")>=0&&i++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return r>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}function d(e){return Array.isArray(e)}function b(e){return"boolean"==typeof e}function m(e){return null===e}function g(e){return null==e}function y(e){return"number"==typeof e}function v(e){return"string"==typeof e}function x(e){return"symbol"==typeof e}function w(e){return void 0===e}function k(e){return G(e)&&"[object RegExp]"===P(e)}function G(e){return"object"==typeof e&&null!==e}function j(e){return G(e)&&"[object Date]"===P(e)}function A(e){return G(e)&&("[object Error]"===P(e)||e instanceof Error)}function _(e){return"function"==typeof e}function S(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||"undefined"==typeof e}function P(e){return Object.prototype.toString.call(e)}function q(e){return 10>e?"0"+e.toString(10):e.toString(10)}function C(){var e=new Date,t=[q(e.getHours()),q(e.getMinutes()),q(e.getSeconds())].join(":");return[e.getDate(),N[e.getMonth()],t].join(" ")}function M(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var O=/%[sdj%]/g;n.format=function(e){if(!v(e)){for(var t=[],n=0;n=o)return e;switch(e){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch(t){return"[Circular]"}default:return e}}),a=i[n];o>n;a=i[++n])s+=m(a)||!G(a)?" "+a:" "+r(a);return s},n.deprecate=function(e,r){function o(){if(!s){if(t.throwDeprecation)throw new Error(r);t.traceDeprecation?console.trace(r):console.error(r),s=!0}return e.apply(this,arguments)}if(w(i.process))return function(){return n.deprecate(e,r).apply(this,arguments)};if(t.noDeprecation===!0)return e;var s=!1;return o};var R,L={};n.debuglog=function(e){if(w(R)&&(R=t.env.NODE_DEBUG||""),e=e.toUpperCase(),!L[e])if(new RegExp("\\b"+e+"\\b","i").test(R)){var i=t.pid;L[e]=function(){var t=n.format.apply(n,arguments);console.error("%s %d: %s",e,i,t)}}else L[e]=function(){};return L[e]},n.inspect=r,r.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},r.styles={special:"cyan",number:"yellow","boolean":"yellow",undefined:"grey","null":"bold",string:"green",date:"magenta",regexp:"red"},n.isArray=d,n.isBoolean=b,n.isNull=m,n.isNullOrUndefined=g,n.isNumber=y,n.isString=v,n.isSymbol=x,n.isUndefined=w,n.isRegExp=k,n.isObject=G,n.isDate=j,n.isError=A,n.isFunction=_,n.isPrimitive=S,n.isBuffer=e("./support/isBuffer");var N=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];n.log=function(){console.log("%s - %s",C(),n.format.apply(n,arguments))},n.inherits=e("inherits"),n._extend=function(e,t){if(!t||!G(t))return e;for(var n=Object.keys(t),i=n.length;i--;)e[n[i]]=t[n[i]];return e}}).call(this,e("oMfpAn"),"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./support/isBuffer":31,inherits:16,oMfpAn:17}],33:[function(_dereq_,module,exports){!function(){var freesound=function(){var authHeader="",clientId="",clientSecret="",host="freesound.org",uris={base:"https://"+host+"/apiv2",textSearch:"/search/text/",contentSearch:"/search/content/",combinedSearch:"/sounds/search/combined/",sound:"/sounds//",soundAnalysis:"/sounds//analysis/",similarSounds:"/sounds//similar/",comments:"/sounds//comments/",download:"/sounds//download/",upload:"/sounds/upload/",describe:"/sounds//describe/",pending:"/sounds/pending_uploads/",bookmark:"/sounds//bookmark/",rate:"/sounds//rate/",comment:"/sounds//comment/",authorize:"/oauth2/authorize/",logout:"/api-auth/logout/",logoutAuthorize:"/oauth2/logout_and_authorize/",me:"/me/",user:"/users//",userSounds:"/users//sounds/",userPacks:"/users//packs/",userBookmarkCategories:"/users//bookmark_categories/",userBookmarkCategorySounds:"/users//bookmark_categories//sounds/",pack:"/packs//",packSounds:"/packs//sounds/",packDownload:"/packs//download/"},makeUri=function(e,t){for(var n in t)e=e.replace(/<[\w_]+>/,t[n]);return uris.base+e},makeRequest=function(uri,success,error,params,wrapper,method,data,content_type){void 0===method&&(method="GET"),error||(error=function(e){console.log(e)}),params=params||{},params.format="json";var fs=this,parse_response=function(response){var data=eval("("+response+")");success(wrapper?wrapper(data):data)},paramStr="";for(var p in params)paramStr=paramStr+"&"+p+"="+params[p];if(paramStr&&(uri=uri+"?"+paramStr),"undefined"!=typeof module){var http=_dereq_("http"),options={host:host,path:uri.substring(uri.indexOf("/",8),uri.length),port:"80",method:method,headers:{Authorization:authHeader},withCredentials:!1},req=http.request(options,function(e){e.on("data",function(t){[200,201,202].indexOf(e.statusCode)>=0?success(wrapper?wrapper(t):t):error(t)})});req.on("error",error).end()}else{var xhr;try{xhr=new XMLHttpRequest}catch(e){xhr=new ActiveXObject("Microsoft.XMLHTTP")}xhr.onreadystatechange=function(){if(4===xhr.readyState&&[200,201,202].indexOf(xhr.status)>=0){var data=eval("("+xhr.responseText+")");success&&success(wrapper?wrapper(data):data)}else 4===xhr.readyState&&200!==xhr.status&&error&&error(xhr.statusText)},xhr.open(method,uri),xhr.setRequestHeader("Authorization",authHeader),void 0!==content_type&&xhr.setRequestHeader("Content-Type",content_type),xhr.send(data)}},checkOauth=function(){if(-1==authHeader.indexOf("Bearer"))throw"Oauth authentication required"},makeFD=function(e,t){t||(t=new FormData);for(var n in e)t.append(n,e[n]);return t},search=function(e,t,n,i,r){e.analysis_file?makeRequest(makeUri(t),n,i,null,r,"POST",makeFD(e)):makeRequest(makeUri(t),n,i,e,r)},Collection=function(e){var t=function(e,t,n){makeRequest(e,t,n,{},Collection)};return e.nextPage=function(n,i){t(e.next,n,i)},e.previousPage=function(n,i){t(e.previous,n,i)},e.getItem=function(t){return e.results[t]},e},SoundCollection=function(e){var t=Collection(e);return t.getSound=function(e){return new SoundObject(t.results[e])},t},PackCollection=function(e){var t=Collection(e);return t.getPack=function(e){return new PackObject(t.results[e])},t},SoundObject=function(e){return e.getAnalysis=function(t,n,i,r){makeRequest(makeUri(uris.soundAnalysis,[e.id,t?t:""]),n,i)},e.getSimilar=function(t,n,i){makeRequest(makeUri(uris.similarSounds,[e.id]),t,n,i,SoundCollection)},e.getComments=function(t,n){makeRequest(makeUri(uris.comments,[e.id]),t,n,{},Collection)},e.download=function(t){checkOauth();var n=makeUri(uris.download,[e.id]);t.location=n},e.comment=function(t,n,i){checkOauth();var r=new FormData;r.append("comment",comment);var o=makeUri(uris.comment,[e.id]);makeRequest(o,n,i,{},null,"POST",r)},e.rate=function(t,n,i){checkOauth();var r=new FormData;r.append("rating",t);var o=makeUri(uris.rate,[e.id]);makeRequest(o,n,i,{},null,"POST",r)},e.bookmark=function(t,n,i,r){checkOauth();var o=new FormData;o.append("name",t),n&&o.append("category",n);var s=makeUri(uris.bookmark,[e.id]);makeRequest(s,i,r,{},null,"POST",o)},e.edit=function(t,n,i){checkOauth();var r=makeFD(t),o=makeUri(uris.edit,[e.id]);makeRequest(o,n,i,{},null,"POST",r)},e},UserObject=function(e){return e.sounds=function(t,n,i){var r=makeUri(uris.userSounds,[e.username]);makeRequest(r,t,n,i,SoundCollection)},e.packs=function(t,n){var i=makeUri(uris.userPacks,[e.username]);makeRequest(i,t,n,{},PackCollection)},e.bookmarkCategories=function(t,n){var i=makeUri(uris.userBookmarkCategories,[e.username]);makeRequest(i,t,n)},e.bookmarkCategorySounds=function(t,n,i){var r=makeUri(uris.userBookmarkCategorySounds,[e.username]);makeRequest(r,t,n,i)},e},PackObject=function(e){return e.sounds=function(t,n){var i=makeUri(uris.packSounds,[e.id]);makeRequest(i,t,n,{},SoundCollection)},e.download=function(t){checkOauth();var n=makeUri(uris.packDownload,[e.id]);t.location=n},e};return{setToken:function(e,t){authHeader=("oauth"===t?"Bearer ":"Token ")+e},setClientSecrets:function(e,t){clientId=e,clientSecret=t},postAccessCode:function(e,t,n){var i=uris.base+"/oauth2/access_token/",r=new FormData;r.append("client_id",clientId),r.append("client_secret",clientSecret),r.append("code",e),r.append("grant_type","authorization_code"),t||(t=function(e){setToken(e.access_token,"oauth")}),makeRequest(i,t,n,{},null,"POST",r)},textSearch:function(e,t,n,i){t=t||{},t.query=e?e:" ",search(t,uris.textSearch,n,i,SoundCollection)},contentSearch:function(e,t,n){if(!e.target&&!e.analysis_file)throw"Missing target or analysis_file";search(e,uris.contentSearch,t,n,SoundCollection)},combinedSearch:function(e,t,n){if(!(e.target||e.analysis_file||e.query))throw"Missing query, target or analysis_file";search(e,uris.contentSearch,t,n)},getSound:function(e,t,n){makeRequest(makeUri(uris.sound,[e]),t,n,{},SoundObject)},upload:function(e,t,n,i,r){checkOauth();var o=new FormData;o.append("audiofile",e,t),n&&(o=makeFD(n,o)),makeRequest(makeUri(uris.upload),i,r,{},null,"POST",o)},describe:function(e,t,n,i,r,o){checkOauth();var s=makeFD(t);makeRequest(makeUri(uris.upload),r,o,{},null,"POST",s)},getPendingSounds:function(e,t){checkOauth(),makeRequest(makeUri(uris.pending),e,t,{})},me:function(e,t){checkOauth(),makeRequest(makeUri(uris.me),e,t)},getLoginURL:function(){if(void 0===clientId)throw"client_id was not set";var e=makeUri(uris.authorize);return e+="?client_id="+clientId+"&response_type=code"},getLogoutURL:function(){var e=makeUri(uris.logoutAuthorize);return e+="?client_id="+clientId+"&response_type=code"},getUser:function(e,t,n){makeRequest(makeUri(uris.user,[e]),t,n,{},UserObject) +},getPack:function(e,t,n){makeRequest(makeUri(uris.pack,[e]),t,n,{},PackObject)}}};"undefined"!=typeof module?module.exports=freesound():"function"==typeof define&&"object"==typeof define.amd?define("freesound",[],freesound):this.freesound=freesound()}()},{http:12}],34:[function(e,t){!function(){function e(e,t){return e=s[e],t=s[t],e.distance>t.distance?t.distance+12-e.distance:t.distance-e.distance}function n(e,t,n){for(;n>0;n--)e+=t;return e}function i(e,t){if("string"!=typeof e)return null;this.name=e,this.duration=t||4,this.accidental={value:0,sign:""};var n=e.match(/^([abcdefgh])(x|#|bb|b?)(-?\d*)/i);if(n&&e===n[0]&&0!==n[3].length)this.name=n[1].toLowerCase(),this.octave=parseFloat(n[3]),0!==n[2].length&&(this.accidental.sign=n[2].toLowerCase(),this.accidental.value=y[n[2]]);else{e=e.replace(/\u2032/g,"'").replace(/\u0375/g,",");var i=e.match(/^(,*)([abcdefgh])(x|#|bb|b?)([,\']*)$/i);if(!i||5!==i.length||e!==i[0])throw Error("Invalid note format");if(""===i[1]&&""===i[4])this.octave=i[2]===i[2].toLowerCase()?3:2;else if(""!==i[1]&&""===i[4]){if(i[2]===i[2].toLowerCase())throw Error("Invalid note format. Format must respect the Helmholtz notation.");this.octave=2-i[1].length}else{if(""!==i[1]||""===i[4])throw Error("Invalid note format");if(i[4].match(/^'+$/)){if(i[2]===i[2].toUpperCase())throw Error("Invalid note format. Format must respect the Helmholtz notation");this.octave=3+i[4].length}else{if(!i[4].match(/^,+$/))throw Error("Invalid characters after note name.");if(i[2]===i[2].toLowerCase())throw Error("Invalid note format. Format must respect the Helmholtz notation");this.octave=2-i[4].length}}this.name=i[2].toLowerCase(),0!==i[3].length&&(this.accidental.sign=i[3].toLowerCase(),this.accidental.value=y[i[3]])}}function r(e,t){if(!(e instanceof i))return null;t=t||"",this.name=e.name.toUpperCase()+e.accidental.sign+t,this.root=e,this.notes=[e],this.quality="major",this.type="major";var n,r,s,a,u,c=[],l=!1,h="quality",p=!1,d=!1,m=null;for(a=0,u=t.length;u>a;a++){for(n=t[a];" "===n||"("===n||")"===n;)n=t[++a];if(!n)break;if(r=n.charCodeAt(0),s=u>=a+3?t.substr(a,3):"","quality"===h)"M"===n||("maj"===s||916===r?(this.type="major",c.push("M7"),l=!0,(t[a+3]&&"7"===t[a+3]||916===r&&"7"===t[a+1])&&a++):"m"===n||"-"===n||"min"===s?this.quality=this.type="minor":111===r||176===r||"dim"===s?(this.quality="minor",this.type="diminished"):"+"===n||"aug"===s?(this.quality="major",this.type="augmented"):216===r||248===r?(this.quality="minor",this.type="diminished",c.push("m7"),l=!0):"sus"===s?(this.quality="sus",this.type=t[a+3]&&"2"===t[a+3]?"sus2":"sus4"):"5"===n?(this.quality="power",this.type="power"):a-=1),s in f&&(a+=2),h="";else if("#"===n)p=!0;else if("b"===n)d=!0;else if("5"===n)p?(m="A5","major"===this.quality&&(this.type="augmented")):d&&(m="d5","minor"===this.quality&&(this.type="diminished")),d=p=!1;else if("6"===n)c.push("M6"),d=p=!1;else if("7"===n)"diminished"===this.type?c.push("d7"):c.push("m7"),l=!0,d=p=!1;else if("9"===n)l||c.push("m7"),d?c.push("m9"):p?c.push("A9"):c.push("M9"),d=p=!1;else{if("1"!==n)throw Error("Unexpected character: '"+n+"' in chord name");n=t[++a],"1"===n?d?c.push("d11"):p?c.push("A11"):c.push("P11"):"3"===n&&(d?c.push("m13"):p?c.push("A13"):c.push("M13")),d=p=!1}}for(var g=0,y=b[this.type].length;y>g;g++)"5"===b[this.type][g][1]&&m?this.notes.push(o.interval(this.root,m)):this.notes.push(o.interval(this.root,b[this.type][g]));for(g=0,y=c.length;y>g;g++)this.notes.push(o.interval(this.root,c[g]))}var o={},s={c:{name:"c",distance:0,index:0},d:{name:"d",distance:2,index:1},e:{name:"e",distance:4,index:2},f:{name:"f",distance:5,index:3},g:{name:"g",distance:7,index:4},a:{name:"a",distance:9,index:5},b:{name:"b",distance:11,index:6},h:{name:"h",distance:11,index:6}},a=["c","d","e","f","g","a","b"],u={.25:"longa",.5:"breve",1:"whole",2:"half",4:"quarter",8:"eighth",16:"sixteenth",32:"thirty-second",64:"sixty-fourth",128:"hundred-twenty-eighth"},c=[{name:"unison",quality:"perfect",size:0},{name:"second",quality:"minor",size:1},{name:"third",quality:"minor",size:3},{name:"fourth",quality:"perfect",size:5},{name:"fifth",quality:"perfect",size:7},{name:"sixth",quality:"minor",size:8},{name:"seventh",quality:"minor",size:10},{name:"octave",quality:"perfect",size:12},{name:"ninth",quality:"minor",size:13},{name:"tenth",quality:"minor",size:15},{name:"eleventh",quality:"perfect",size:17},{name:"twelfth",quality:"perfect",size:19},{name:"thirteenth",quality:"minor",size:20},{name:"fourteenth",quality:"minor",size:22},{name:"fifteenth",quality:"perfect",size:24}],l={unison:0,second:1,third:2,fourth:3,fifth:4,sixth:5,seventh:6,octave:7,ninth:8,tenth:9,eleventh:10,twelfth:11,thirteenth:12,fourteenth:13,fifteenth:14},f={P:"perfect",M:"major",m:"minor",A:"augmented",d:"diminished",perf:"perfect",maj:"major",min:"minor",aug:"augmented",dim:"diminished"},h={perfect:"P",major:"M",minor:"m",augmented:"A",diminished:"d"},p={P:"P",M:"m",m:"M",A:"d",d:"A"},d={perfect:["diminished","perfect","augmented"],minor:["diminished","minor","major","augmented"]},b={major:["M3","P5"],minor:["m3","P5"],augmented:["M3","A5"],diminished:["m3","d5"],sus2:["M2","P5"],sus4:["P4","P5"],power:["P5"]},m={major:"M",minor:"m",augmented:"aug",diminished:"dim",power:"5"},g={"-2":"bb","-1":"b",0:"",1:"#",2:"x"},y={bb:-2,b:-1,"#":1,x:2};i.prototype={key:function(e){return e?7*(this.octave-1)+3+Math.ceil(s[this.name].distance/2):12*(this.octave-1)+4+s[this.name].distance+this.accidental.value},fq:function(e){return e=e||440,e*Math.pow(2,(this.key()-49)/12)},scale:function(e,t){return o.scale.list(this,e,t)},interval:function(e,t){return o.interval(this,e,t)},chord:function(e){return e=e||"major",e in m&&(e=m[e]),new r(this,e)},helmholtz:function(){var e,t=3>this.octave?this.name.toUpperCase():this.name.toLowerCase();return 2>=this.octave?(e=n("",",",2-this.octave),e+t+this.accidental.sign):(e=n("","'",this.octave-3),t+this.accidental.sign+e)},scientific:function(){return this.name.toUpperCase()+this.accidental.sign+("number"==typeof this.octave?this.octave:"")},enharmonics:function(){var e=[],t=this.key(),n=this.interval("m2","up"),i=this.interval("m2","down"),r=n.key()-n.accidental.value,o=i.key()-i.accidental.value,s=t-r;return 3>s&&s>-3&&(n.accidental={value:s,sign:g[s]},e.push(n)),s=t-o,3>s&&s>-3&&(i.accidental={value:s,sign:g[s]},e.push(i)),e},valueName:function(){return u[this.duration]},toString:function(e){return e="boolean"==typeof e?e:"number"==typeof this.octave?!1:!0,this.name.toLowerCase()+this.accidental.sign+(e?"":this.octave)}},r.prototype.dominant=function(e){return e=e||"",new r(this.root.interval("P5"),e)},r.prototype.subdominant=function(e){return e=e||"",new r(this.root.interval("P4"),e)},r.prototype.parallel=function(e){if(e=e||"","triad"!==this.chordType()||"diminished"===this.quality||"augmented"===this.quality)throw Error("Only major/minor triads have parallel chords");return"major"===this.quality?new r(this.root.interval("m3","down"),"m"):new r(this.root.interval("m3","up"))},r.prototype.chordType=function(){var e,t,n;if(2===this.notes.length)return"dyad";if(3===this.notes.length){t={unison:!1,third:!1,fifth:!1};for(var i=0,r=this.notes.length;r>i;i++)e=this.root.interval(this.notes[i]),n=c[parseFloat(o.interval.invert(e.simple)[1])-1],e.name in t?t[e.name]=!0:n.name in t&&(t[n.name]=!0);return t.unison&&t.third&&t.fifth?"triad":"trichord"}if(4===this.notes.length){t={unison:!1,third:!1,fifth:!1,seventh:!1};for(var i=0,r=this.notes.length;r>i;i++)e=this.root.interval(this.notes[i]),n=c[parseFloat(o.interval.invert(e.simple)[1])-1],e.name in t?t[e.name]=!0:n.name in t&&(t[n.name]=!0);if(t.unison&&t.third&&t.fifth&&t.seventh)return"tetrad"}return"unknown"},r.prototype.toString=function(){return this.name},o.note=function(e,t){return new i(e,t)},o.note.fromKey=function(e){var t=440*Math.pow(2,(e-49)/12);return o.frequency.note(t).note},o.chord=function(e){var t;if(t=e.match(/^([abcdefgh])(x|#|bb|b?)/i),t&&t[0])return new r(new i(t[0].toLowerCase()),e.substr(t[0].length));throw Error("Invalid Chord. Couldn't find note name")},o.frequency={note:function(e,t){t=t||440;var n,r,o,u,c,l,f;return n=Math.round(49+12*((Math.log(e)-Math.log(t))/Math.log(2))),f=t*Math.pow(2,(n-49)/12),l=1200*(Math.log(e/f)/Math.log(2)),r=Math.floor((n-4)/12),o=n-12*r-4,u=s[a[Math.round(o/2)]],c=u.name,o>u.distance?c+="#":u.distance>o&&(c+="b"),{note:new i(c+(r+1)),cents:l}}},o.interval=function(e,t,n){if("string"==typeof t){"down"===n&&(t=o.interval.invert(t));var r=f[t[0]],s=parseFloat(t.substr(1));if(!r||isNaN(s)||1>s)throw Error("Invalid string-interval format");return o.interval.from(e,{quality:r,interval:c[s-1].name},n)}if(t instanceof i&&e instanceof i)return o.interval.between(e,t);throw Error("Invalid parameters")},o.interval.from=function(t,n,r){n.direction=r||n.direction||"up";var o,u,f,h,p,b;if(p=l[n.interval],b=c[p],p>7&&(p-=7),p=s[t.name].index+p,p>a.length-1&&(p-=a.length),o=a[p],-1===d[b.quality].indexOf(n.quality)||-1===d[b.quality].indexOf(b.quality))throw Error("Invalid interval quality");return u=d[b.quality].indexOf(n.quality)-d[b.quality].indexOf(b.quality),f=b.size+u-e(t.name,o),t.octave&&(h=Math.floor((t.key()-t.accidental.value+e(t.name,o)-4)/12)+1+Math.floor(l[n.interval]/7)),f+=t.accidental.value,f>=11&&(f-=12),f>-3&&3>f&&(o+=g[f]),"down"===r&&h--,new i(o+(h||""))},o.interval.between=function(e,t){var n,i,r,o,a,u,l=e.key(),f=t.key();if(n=f-l,n>24||-25>n)throw Error("Too big interval. Highest interval is a augmented fifteenth (25 semitones)");return 0>n&&(o=e,e=t,t=o),r=s[t.name].index-s[e.name].index+7*(t.octave-e.octave),i=c[r],u=d[i.quality][Math.abs(n)-i.size+1],a=h[u]+(""+Number(r+1)),{name:i.name,quality:u,direction:n>0?"up":"down",simple:a}},o.interval.invert=function(e){if(2!==e.length&&3!==e.length)return!1;var t=p[e[0]],n=2===e.length?parseFloat(e[1]):parseFloat(e.substr(1));return n>8&&(n-=7),8!==n&&1!==n&&(n=9-n),t+(""+n)},o.scale={list:function(e,t,n){var r,s,a=[],u=[];if(!(e instanceof i))return!1;if("string"==typeof t&&(t=o.scale.scales[t],!t))return!1;for(a.push(e),n&&u.push(e.name+(e.accidental.sign||"")),r=0,s=t.length;s>r;r++)a.push(o.interval(e,t[r])),n&&u.push(a[r+1].name+(a[r+1].accidental.sign||""));return n?u:a},scales:{major:["M2","M3","P4","P5","M6","M7"],ionian:["M2","M3","P4","P5","M6","M7"],dorian:["M2","m3","P4","P5","M6","m7"],phrygian:["m2","m3","P4","P5","m6","m7"],lydian:["M2","M3","A4","P5","M6","M7"],mixolydian:["M2","M3","P4","P5","M6","m7"],minor:["M2","m3","P4","P5","m6","m7"],aeolian:["M2","m3","P4","P5","m6","m7"],locrian:["m2","m3","P4","d5","m6","m7"],majorpentatonic:["M2","M3","P5","M6"],minorpentatonic:["m3","P4","P5","m7"],chromatic:["m2","M2","m3","M3","P4","A4","P5","m6","M6","m7","M7"],harmonicchromatic:["m2","M2","m3","M3","P4","A4","P5","m6","M6","m7","M7"]}},t.exports=o}()},{}],35:[function(e,t){t.exports=function(t){"use strict";{var n,i=t.dollar;e("gibberish-dsp")}return n={"export":function(e){i.extend(e,n.Busses),i.extend(e,n.Oscillators),i.extend(e,n.Synths),i.extend(e,n.Percussion),i.extend(e,n.Envelopes),i.extend(e,n.FX),i.extend(e,n.Seqs),i.extend(e,n.Samplers);var r=e.clear;i.extend(e,n.PostProcessing),e.clear=r,i.extend(e,n.Vocoder),e.Theory=n.Theory,i.extend(e,n.Analysis),e.Score=n.Score,e.Clock=n.Clock,e.Seq=n.Seqs.Seq,e.Arp=n.Arp,e.ScaleSeq=n.Seqs.ScaleSeq,e.SoundFont=n.SoundFont,e.Speak=n.Speak,e.Additive=n.Additive,e.Ugen=n.Ugen,e.Rndi=n.Core.Rndi,e.Rndf=n.Core.Rndf,e.rndi=n.Core.rndi,e.rndf=n.Core.rndf,e.Input=n.Input,e.Freesound=n.Freesound,e.Freesoundjs2=n.Freesoundjs2,e.Scale=n.Theory.Scale,e.Ensemble=n.Ensemble,e.module=t.import,n.Core.Time.export(e),n.Clock.export(e),n.Core.Binops.export(e),e.Master=n.Master},init:function(e){var r=null;n.onstart&&(r=n.onstart),n.context||(n.context={sampleRate:44100}),n.Core.onstart=function(){n.Clock.start(!0),null!==r&&r(),n.Score=n.Score(t),n.Additive=n.Additive(t),t.Clock=n.Clock,t.Theory=n.Theory,t.Theory.scale=t.scale=t.Audio.Theory.Scale("c4","Minor"),i.extend(t.Binops,n.Binops),n.Master=n.Busses.Bus().connect(n.Core.out),n.Master.type="Bus",n.Master.name="Master",i.extend(!0,n.Master,n.ugenTemplate),n.Master.fx.ugen=n.Master,n.ugenTemplate.connect=n.Core._oscillator.connect=n.Core._synth.connect=n.Core._effect.connect=n.Core._bus.connect=n.connect,n.Core.defineUgenProperty=n.defineUgenProperty,i.extend(t.Presets,n.Synths.Presets),i.extend(t.Presets,n.Percussion.Presets),i.extend(t.Presets,n.FX.Presets),"function"==typeof e&&e()},n.Core._init()},Time:{ms:function(e){return{mode:"absolute",value:t.Audio.Core.context.sampleRate/1e3*e,valueOf:function(){return this.value}}},seconds:function(e){return{mode:"absolute",value:t.Audio.Core.context.sampleRate*e,valueOf:function(){return this.value}}},minutes:function(e){return{mode:"absolute",value:60*t.Audio.Core.context.sampleRate*e,valueOf:function(){return this.value}}}},defineUgenProperty:function(e,t,i){var r=n.Clock.timeProperties.indexOf(e)>-1,o=i.properties[e]={value:r?n.Clock.time(t):t,binops:[],parent:i,name:e},s=e.charAt(0).toUpperCase()+e.slice(1);Object.defineProperty(i,e,{configurable:!0,get:function(){return o.value},set:function(e){return i[s]&&i[s].mapping&&i[s].mapping.remove&&i[s].mapping.remove(!0),o.value=r?n.Clock.time(e):e,n.Core.dirty(i),o.value}}),i[e]=o.value},polyInit:function(e){e.mod=e.polyMod,e.removeMod=e.removePolyMod;for(var t in e.polyProperties)!function(t){var i=e.polyProperties[t],r=n.Clock.timeProperties.indexOf(t)>-1;Object.defineProperty(e,t,{get:function(){return i},set:function(i){for(var o=0;o0)for(var e=0;e0?this[t-1].connect(n.Master):this.ugen!==n.Master?this.ugen.connect(n.Master):this.ugen.connect(n.Core.out)}}else for(var o=0;o0?(this[this.length-1].disconnect(),this.ugen!==n.Master?this.ugen.connect(n.Master):this.ugen.connect(n.Core.out),this.ugen.codegen(),this.length=0):console.log(this.ugen.name+" does not have any fx to remove. ")}}),replaceWith:function(e){if(e.connect){for(var t=0;t0)for(var i=0;ir;r++)n=i[r],this.out+=n(e*n.harmonic,n.amp);return this.out*t},init:function(){this.sines=[];for(var t=0,n=0;ta;a++)n[a].value=n.values[a],a>0&&(3>a?(e+=n.values[a],r++):6>a?(t+=n.values[a],o++):(i+=n.values[a],s++));n.low.value=e/r,n.mid.value=t/o,n.high.value=i/s},n.updateRate)}else e&&(n.fftSize=e),s&&(n.updateRate=s);return n},Follow:function(e,n){var i=new r.Follow(e,n),o={value:{min:0,max:1,output:a,timescale:"audio"}};return t.createProxyProperties(i,o),i}};return u}},{"gibberish-dsp":7}],38:[function(e,t){t.exports=function(t){var n,i=e("../../external/teoria.min"),r=t.dollar,o=(t.outputCurves,e("./seq")(t).Seq);return n=function(e,n,s,a,u){var c=o();r.extend(c,{name:"Arp",notes:[],pattern:s||"up",notation:e||"C4m7",mult:a||1,init:!1,speed:isNaN(n)?.25:n,scale:u||null,chord:function(e){var n=[];if(this.notation=e,"undefined"==typeof this.scale||null===this.scale&&"string"==typeof e)for(var r=0;r "+u},e}}},{"gibberish-dsp":7}],40:[function(e,t){t.exports=function(t){"use strict";for(var n=t.dollar,i=e("gibberish-dsp"),r=t.outputCurves,o=r.LINEAR,s=(r.LOGARITHMIC,[["Bus2","Bus"]]),a={amp:{min:0,max:1,output:o,timescale:"audio"},pan:{min:-.75,max:.75,output:o,timescale:"audio"},out:{min:0,max:1,output:o,timescale:"audio",dimensions:1}},u=!1,c={mappingProperties:a,Presets:{}},l=0;l=Clock.signature.upper?1:Clock.currentBeat+1,1===Clock.currentBeat&&Clock.codeToExecute.length>0){for(var i=0;i88200&&(times.length=0),times.unshift(e);times.length>3;)times.pop();if(3===times.length){var t=(times[0]+times[1]-2*times[2])/3,n=44100/t,i=60*n;Gibber.Clock.bpm=i}},start:function(e){var t=0;if(e){$.extend(this,{properties:{rate:1},name:"master_clock",callback:function(e){return t++,e}}),this.__proto__=new Gibberish.ugen,this.__proto__.init.call(this);var n=this.baseBPM;Object.defineProperty(Clock,"bpm",{get:function(){return n},set:function(e){n=e,Clock.rate=n/Clock.baseBPM}}),Object.defineProperty(this,"timeSignature",{configurable:!0,get:function(){return Clock.signature.upper+"/"+Clock.signature.lower},set:function(e){var t=e.split("/");2!==t.length||t[0]===Clock.signature.upper&&t[1]===Clock.signature.lower||(Clock.signature.upper=parseInt(t[0]),Clock.signature.lower=parseInt(t[1]),Clock.currentBeat=1!=Clock.currentBeat?0:1)}}),Gibber.createProxyProperties(this,{rate:{min:.1,max:2,output:LINEAR,timescale:"audio"},bpm:{min:20,max:200,output:LINEAR,timescale:"audio"}}),this.setPhase=function(e){t=e},this.getPhase=function(){return t},Clock.seq=new Gibberish.PolySeq({seqs:[{target:Clock,values:[Clock.processBeat.bind(Clock)],durations:[.25]}],rate:Clock}),Gibber.Audio.Seqs.Seq.children.push(Clock.seq),Clock.seq.connect().start(),Clock.seq.timeModifier=Clock.time.bind(Clock)}else Clock.seq.setPhase(0),Clock.seq.connect().start()},addMetronome:function(e){this.metronome=e,this.metronome.init()},time:function(e){var t;return t=e "+t},Object.defineProperty(n,"_",{get:function(){return n.kill(),n},set:function(){}}),n}}();return Percussion.Drums=function(_sequence,_timeValue,_amp,_freq){var args=Array.prototype.slice.call(arguments),obj={},props=Gibber.processArguments(args,"Drums");"undefined"==typeof props&&(props={}),$.extend(!0,obj,props),obj=Array.isArray(obj)?Gibber.construct(Gibberish.Bus2,obj).connect(Gibber.Master):new Gibberish.Bus2(obj).connect(Gibber.Master),obj.name="Drums",obj.type="Gen",obj.children=[],$.extend(!0,obj,Gibber.Audio.ugenTemplate),obj.fx.ugen=obj,Object.defineProperty(obj,"_",{get:function(){return obj.kill(),obj},set:function(){}}),obj.kit=Percussion.Drums.kits["default"],"object"==typeof arguments[0]&&arguments[0].kit&&(obj.kit=Percussion.Drums.kits[arguments[0].kit],arguments[0].kit=obj.kit);for(var key in obj.kit){var drum=obj.kit[key],ugen=drum.file?{ugen:new Gibberish.Sampler({file:drum.file,pitch:1,amp:drum.amp}),pitch:drum.pitch,amp:drum.amp}:drum;ugen&&(isNaN(ugen.pitch)&&(ugen.pitch=1),isNaN(ugen.pan)&&(ugen.pan=0),isNaN(ugen.amp)&&(ugen.amp=1),"undefined"==typeof ugen.symbol&&(ugen.symbol=key),obj[key]=ugen,obj[key].ugen.pan=drum.pan,drum.file||drum.ugen.disconnect(),obj[key].ugen.connect(obj),obj[key].fx=obj[key].ugen.fx,obj.children.push(obj[key].ugen)) +}if(obj.mod=obj.polyMod,obj.removeMod=obj.removePolyMod,obj.connect(),Gibber.createProxyProperties(obj,_mappingProperties.Drums),obj.note=function(e){var t=obj.pitch.value;if($.isArray(e))for(var n=0;n-1){var _value=seq.substr(0,idx),duration=seq.substr(idx+1);duration=eval(duration),hasTime=!0,seq=_value.trim().split("")}else seq=seq.trim().split(""),duration=1/seq.length;if(seq.indexOf(".rnd(")>-1&&(seq=seq.split(".rnd")[0],seq=seq.split("").rnd()),"undefined"!=typeof props[1]){duration=props[1],Array.isArray(duration)||(duration=[duration]);var durationsPattern=Gibber.construct(Gibber.Pattern,duration);if(duration.randomFlag){durationsPattern.filters.push(function(){return[durationsPattern.values[rndi(0,durationsPattern.values.length-1)],1]});for(var i=0;i-1){var _value=seq.substr(0,idx),duration=seq.substr(idx+1);duration=eval(duration),hasTime=!0,seq=_value.trim().split("")}else seq=seq.trim().split(""),duration=1/seq.length;if(seq.indexOf(".rnd(")>-1&&(seq=seq.split(".rnd")[0],seq=seq.split("").rnd()),"undefined"!=typeof props[1]){duration=props[1],Array.isArray(duration)||(duration=[duration]);var durationsPattern=Gibber.construct(Gibber.Pattern,duration);if(duration.randomFlag){durationsPattern.filters.push(function(){return[durationsPattern.values[rndi(0,durationsPattern.values.length-1)],1]});for(var i=0;i-1){var _value=seq.substr(0,idx),duration=seq.substr(idx+1);duration=eval(duration),hasTime=!0,seq=_value.trim().split("")}else seq=seq.trim().split(""),duration=1/seq.length;if(seq.indexOf(".rnd(")>-1&&(seq=seq.split(".rnd")[0],seq=seq.split("").rnd()),"undefined"!=typeof arguments[1]){duration=arguments[1],Array.isArray(duration)||(duration=[duration]);var durationsPattern=Gibber.construct(Gibber.Pattern,duration);if(duration.randomFlag){durationsPattern.filters.push(function(){return[durationsPattern.values[rndi(0,durationsPattern.values.length-1)],1]});for(var i=0;i "+o},n.presetInit&&n.presetInit(),n}}();return n.Chorus=function(e,t,n){var i=e||1,r=n||ms(1),o=t||0,s=Flanger(i,o,r,30*ms(1));return s.name="Chorus",s.type="FX",s},n.LPF=function(e,t){var n=isNaN(e)?.2:e,i=isNaN(t)?3.5:t,r=Filter24(n,i,!0);return r.name="LPF",r.type="FX",r},n.HPF=function(e,t){var n=isNaN(e)?.25:e,i=isNaN(t)?3.5:t,r=Filter24(n,i,!0);return r.isLowPass=!1,r.name="HPF",r.type="FX",r},n.Presets.Schizo={sane:{chance:.1,reverseChance:0,pitchChance:.5,mix:.5},borderline:{chance:.1,pitchChance:.25,reverseChance:.5,mix:1},paranoid:{chance:.2,reverseChance:.5,pitchChance:.5,mix:1}},n.Presets.Reverb={space:{roomSize:.99,damping:.23,wet:.75,dry:.25},small:{roomSize:.6,damping:.75,wet:.15,dry:.85},medium:{roomSize:.8,damping:.5,wet:.35,dry:.65},large:{roomSize:.85,damping:.3,wet:.55,dry:.45}},n.Presets.StereoVerb={space:{roomSize:.99,damping:.23,wet:.75,dry:.25},small:{roomSize:.6,damping:.75,wet:.15,dry:.85},medium:{roomSize:.8,damping:.5,wet:.35,dry:.65},large:{roomSize:.85,damping:.3,wet:.55,dry:.45}},n.Presets.Crush={clean:{sampleRate:1,bitDepth:16},dirty:{sampleRate:.25,bitDepth:4},filthy:{sampleRate:.1,bitDepth:2.5}},n}},{"gibberish-dsp":7}],46:[function(e,t){t.exports=function(e){e.setToken("6a00f80ba02b2755a044cc4ef004febfc4ccd476");var t=function(){var n,i=Sampler(),r=arguments[0]||96541,o=null;i.done=function(e){o=e};var s=function(e){Gibber.log("Freesound file "+n+" loaded."),Gibber.Audio.Core.context.decodeAudioData(e.response,function(e){t.loaded[n]=e.getChannelData(0),i.buffer=t.loaded[n],i.bufferLength=i.buffer.length,i.isLoaded=!0,i.setBuffer(i.buffer),i.setPhase(i.bufferLength),i.filename=n,i.length=i.bufferLength,i.isPlaying=!0,Gibber.Audio.Core.audioFiles[i.filename]=e,i.buffers[i.filename]=e,i.file=n,i.send(Master,1),o&&o()},function(e){console.log("Error with decoding audio data"+e.err)})};if("string"==typeof r){var a=r;Gibber.log("searching freesound for "+a),e.textSearch(a,{page:1},function(r){r=JSON.parse(r),n=r.results[0].name;var a=r.results[0].id;"undefined"==typeof t.loaded[n]?e.getSound(a,function(e){var t=new XMLHttpRequest,n=JSON.parse(e),i=n.previews["preview-hq-mp3"];t.open("GET",i,!0),t.responseType="arraybuffer",t.onload=function(){s(t)},t.send()},null):(i.buffer=t.loaded[n],i.filename=n,i.bufferLength=i.buffer.length,i.isLoaded=!0,i.end=i.bufferLength,i.setBuffer(i.buffer),i.setPhase(i.bufferLength),i.send(Master,1),o&&o())},function(){displayError("Error while searching...")})}else if("object"==typeof r){{var a=r.query,u=r.filter||"";r.sort||"rating_desc",r.page||0}pick=r.pick||0,Gibber.log("Searching freesound for "+a),u+=" duration:[0.0 TO 10.0]",e.textSearch(a,null,function(a){var u=JSON.parse(a);if(u.count>0){var c=0;"number"==typeof r.pick?c=r.pick:"function"==typeof r.pick?c=r.pick():"random"===r.pick&&(c=rndi(0,u.results.length-1));var l=u.results[c];n=l.name;var f=l.id;"undefined"==typeof t.loaded[n]?"undefined"==typeof t.loaded[n]?e.getSound(f,function(e){var t=new XMLHttpRequest,n=JSON.parse(e),i=n.previews["preview-hq-mp3"];t.open("GET",i,!0),t.responseType="arraybuffer",t.onload=function(){s(t)},t.send()},null):(i.buffer=t.loaded[n],i.filename=n,i.bufferLength=i.buffer.length,i.isLoaded=!0,i.end=i.bufferLength,i.setBuffer(i.buffer),i.setPhase(i.bufferLength),i.send(Master,1),o&&o()):(Gibber.log("using exising loaded sample "+n),i.buffer=t.loaded[n],i.bufferLength=i.buffer.length,i.isLoaded=!0,i.end=i.bufferLength,i.setBuffer(i.buffer),i.setPhase(i.bufferLength),i.send(Master,1),o&&o())}else Gibber.log("No Freesound files matched your query.")},function(){console.log("Error while searching...")})}else if("number"==typeof r){Gibber.log("Searching for and downloading sound #"+r+" from Freesound...");var c=n=r;"undefined"==typeof t.loaded[n]?e.getSound(c,function(e){var t=new XMLHttpRequest,n=JSON.parse(e),i=n.previews["preview-hq-mp3"];t.open("GET",i,!0),t.responseType="arraybuffer",t.onload=function(){s(t)},t.send()},null):(i.buffer=t.loaded[n],i.filename=n,i.bufferLength=i.buffer.length,i.isLoaded=!0,i.end=i.bufferLength,i.setBuffer(i.buffer),i.setPhase(i.bufferLength),i.send(Master,1),o&&o())}return i};return t.getSoundByID=function(t){Gibber.log("downloading sound #"+t+" from freesound.org"),e.getSound(t,function(e){var t=JSON.parse(e),n=t.previews["preview-hq-mp3"];filename=t.name,request=new XMLHttpRequest,request.open("GET",n,!0),request.responseType="arraybuffer",request.onload=function(){onload(request)},request.send()},function(e){console.log("ERROR with id",e)})},t.loaded={},t}},{}],47:[function(e,t){t.exports=function(t){"use strict";for(var n=t.dollar,i={Presets:{}},r=e("gibberish-dsp"),o=t.outputCurves,s=o.LINEAR,a=o.LOGARITHMIC,u=["Sine","Triangle","Saw","Square","Noise","PWM"],c={frequency:{min:50,max:3200,hardMin:.01,hardMax:22050,output:a,timescale:"audio",dimensions:1},amp:{min:0,max:1,hardMax:2,output:a,timescale:"audio",dimensions:1},pulsewidth:{min:.01,max:.99,output:s,timescale:"audio",dimensions:1},out:{min:0,max:1,output:s,timescale:"audio",dimensions:1},pan:{min:-1,max:1,output:a,timescale:"audio"},note:{min:50,max:3200,hardMin:.01,hardMax:22050,output:a,timescale:"audio",doNotProxy:!0}},l=0;l "+o},i}}();return i.Wavetable=function(e){var i=(new r.Table).connect(t.Master);return e&&i.setTable(e),i.type="Gen",n.extend(!0,i,t.Audio.ugenTemplate),i.fx.ugen=i,Object.defineProperty(i,"_",{get:function(){return i.kill(),i},set:function(){}}),"undefined"==typeof i.note&&(i.note=function(e){var t=this.frequency();"number"==typeof t||"function"==typeof t?this.frequency="function"==typeof e?e():e:t[0]=e}),t.createProxyProperties(i,{frequency:{min:50,max:3200,output:a,timescale:"audio",dimensions:1},amp:{min:0,max:1,output:a,timescale:"audio",dimensions:1},out:{min:0,max:1,output:s,timescale:"audio",dimensions:1}}),t.createProxyMethods(i,["note"]),i.toString=function(){return"> Wavetable"},i},i.Grains=function(){var e,i,o="object"==typeof arguments[0]?arguments[0]:arguments[1],s=o.bufferLength||88200;if(o.input?e=Sampler().record(o.input,s):o.buffer&&(s=o.buffer.length),"string"==typeof arguments[0]){var a=t.Presets.Grains[arguments[0]];"undefined"!=typeof o&&n.extend(a,o),i=new r.Granulator(a)}else i=new r.Granulator(o);return i.loop=function(e,n,o,s){var a=this.position;e=isNaN(e)?.25:e,n=isNaN(n)?.75:n,o=isNaN(o)?t.Clock.time(1):t.Clock.time(o),s="undefined"==typeof s?!0:s,this.position=new r.Line(e,n,o,s);var u=this;return s===!1&&future(function(){u.position=a},t.Clock.time(o)),i},e?future(function(){i.setBuffer(e.getBuffer()),i.connect(),i.loop(0,1,s),e.disconnect()},s+1):(i.connect(),i.loop(0,1,s)),i.type="Gen",n.extend(!0,i,t.Audio.ugenTemplate),i.fx.ugen=i,Object.defineProperty(i,"_",{get:function(){return i.disconnect(),i},set:function(){}}),i.toString=function(){return"Grains"},i},i.Presets.Grains={tight:{numberOfGrains:10,grainSize:1100,positionMin:-.05,positionMax:.05,speedMin:-.1,speedMax:.1,shouldReverse:!1},cloudy:{numberOfGrains:20,positionMin:-.25,positionMax:.25,speedMin:-.1,speedMax:4,grainSize:4400,shouldReverse:!0},flurry:{speed:2,speedMin:-2,speedMax:2,position:0,positionMin:0,positionMax:0,numberOfGrains:20,grainSize:1100}},i}},{"gibberish-dsp":7}],48:[function(e,t){t.exports=function(e){"use strict";var t,n=function(e,n,i){var r=new XMLHttpRequest;r.open("GET",n,!0),r.responseType="arraybuffer",r.onload=function(){t.context.decodeAudioData(r.response,function(e){i(e)})},r.send()},i=null,r=null,o=null,s=null,a=null,u=e.AudioPostProcessing={initialized:!1,getPostgraph:function(){return s},init:function(){this.initialized||(t=e.Audio.Core,s=[t.node,t.context.destination],this.initialized=!0,$.subscribe("/gibber/clear",u.clear.bind(this)))},clear:function(){this.disconnectGraph(),s=[t.node,t.context.destination],this.connectGraph()},disconnectGraph:function(){for(var e=0;e0&&tu;u++)s.children.push(Sampler({pitch:s.pitch})._),s.children[u].send(s,1);return t.createProxyProperties(s,{pitch:c.pitch}),s.stop=function(){s.seq.stop()},s.play=function(){s.seq.start()},s},n}},{"./clock":41,"gibberish-dsp":7}],50:[function(e,t){t.exports=function(t){"use strict";var n=e("gibberish-dsp"),i=t.dollar,r={start:function(){return this.codeblock||this.connect(),this.isPaused=!1,this},stop:function(){return this.isPaused=!0,this},loop:function(e){return this.loopPause=e||0,this.shouldLoop=!this.shouldLoop,this},pause:function(){return this.isPaused=!0,this},next:function(){return this.codeblock||this.connect(),this.isPaused=!1,this}},o=new n.ugen;i.extend(o,r);var s=function(e,n){if(!(this instanceof s)){var r=Array.prototype.slice.call(arguments,0);return t.construct(s,r)}"undefined"==typeof n&&(n={}),this.timeline=[],this.schedule=[],this.shouldLoop=!1,this.loopPause=0;for(var o=0;o=n&&u=0;t--){var n=e[t];n instanceof s&&n.next()}}}),this.oncomplete.listeners=[],this.oncomplete.owner=this,this.init(),this.nextTime=this.schedule[0];var p=this.rate,d=this.__lookupSetter__("rate");Object.defineProperty(this,"rate",{get:function(){return p},set:function(e){p=Mul(t.Clock,e),d.call(this,p)}}),this.rate=this.rate,t.createProxyProperties(this,{rate:{min:.1,max:2,output:0,timescale:"audio"}})};return s.prototype=o,s.wait=-987654321,s.combine=function(){for(var e=[0,arguments[0]],t=1;t-1){var d=i.extend([],s.seqs[p]),b=0;s.seqs[p]=[function(){var e,t=[];return e="function"==typeof d.pick?d[d.pick()]:"function"==typeof d[b]?d[b]():d[b++],t=s.scale.chord(e),b>=d.length&&(b=0),t}]}}}e=new n.PolySeq(s),e.timeModifier=t.Clock.time.bind(t.Clock),e.name="Seq",e.save={},e.oldShuffle=e.shuffle,delete e.shuffle,e.rate=t.Clock;var m=e.__lookupSetter__("rate"),g=e.rate;Object.defineProperty(e,"rate",{get:function(){return g},set:function(n){g=Mul(t.Clock,n),m.call(e,g)}});var y=e.nextTime,v=e.__lookupSetter__("nextTime");Object.defineProperty(e,"nextTime",{get:function(){return y},set:function(e){y=t.Clock.time(e),v(y)}});var x=e.offset;Object.defineProperty(e,"offset",{get:function(){return x},set:function(t){x=t,e.nextTime+=x}}),e.nextTime+=e.offset;for(var f=0;f Seq"},e.gibber=!0,i.extend(e,{constructor:o,replaceWith:function(){this.kill()},kill:function(){this.target&&this.target.sequencers&&this.target.sequencers.splice(this.target.sequencers.indexOf(this),1),console.log("SEQ KILL",this),this.stop().disconnect(),o.children.splice(o.children.indexOf(this),1)},applyScale:function(){},once:function(){return this.repeat(1),this},reset:function(){for(var e=0;e0?1:0,u=Math.abs(this.octave),c=0;u>c;c++)o*=a?2:.5;e=o}var f,h=s.frequency.note(e),p=0;if(1===h.note.accidental.value&&"b"!==h.note.accidental.sign)for(var d=h.note.enharmonics(),c=0;c-1&&(a[c]=t.Clock.time(a[c]));if(n=new i[e](a).connect(t.Master),n.type="Gen",r.extend(!0,n,t.Audio.ugenTemplate),n.fx.ugen=n,"Vocoder"===o)return n;"Mono"===o&&(n.note=function(e,t){"undefined"!=typeof e&&("undefined"!=typeof t&&0!==t&&(this.amp=t),0!==t&&("object"!=typeof this.frequency?this.frequency=e:"property"!==this.frequency.type?(this.frequency[0]=e,i.dirty(this)):this.frequency=e,this.lastFrequency=this.frequency,n.envelope.getState()>0&&n.envelope.run()))}),n._note=n.note.bind(n),n.note=function(){var e,i=Array.prototype.slice.call(arguments,0);if("undefined"!=typeof i[0])return Array.isArray(i[0])?(e=i[0][0],e=t.Theory.processFrequency(n,e),i[0][0]=e):i[0]=t.Theory.processFrequency(n,i[0]),"undefined"==typeof i[1]&&(i[1]=this.loudness.value),this._note.apply(this,i),this.processChildProperties(),this};var f=Object.keys(l[o]),h=0;if(n.processChildProperties=function(){for(var e=0;ei;i++){for(var r=0;r=-8;i--){t/=2;for(var r=0;r0?1:0,p=Math.abs(e.octave),d=0;p>d;d++)i*=h?2:.5}return i},chord:function(e){if(this.notation=e,"string"==typeof this.notation){var t,i,r=this.notation.slice(0,1);isNaN(this.notation.charAt(1))?(r+=this.notation.charAt(1),t=parseInt(this.notation.slice(2,3)),i=this.notation.slice(3)):(t=parseInt(this.notation.slice(1,2)),i=this.notation.slice(2));for(var s=n.note(r+t).chord(i),a=0;a0&&e.processArguments2(i,Array.prototype.slice.call(arguments,0),i.name),$.extend(!0,i,e.Audio.ugenTemplate),i.fx.ugen=i,i};return n};return t}},{}],56:[function(e,t){t.exports=function(t){"use strict";var n={Presets:{}},i=e("gibberish-dsp"),r=t.dollar,o=(e("./clock")(t),t.outputCurves),s=o.LINEAR,a=o.LOGARITHMIC,u={amp:{min:0,max:1,output:a,timescale:"audio"},pan:{min:-1,max:1,output:a,timescale:"audio"},out:{min:0,max:1,output:s,timescale:"audio",dimensions:1}};return n.Vocoder=function(e,n,o,s,a,u){var c=new i.Vocoder(e,n,o,s,a,u).connect(t.Master);return c.type="Gen",r.extend(!0,c,t.Audio.ugenTemplate),c.fx.ugen=c,c},n.Robot=function(e){function n(){i.modulator=Speak(o),i.modulator._,i.say=i.modulator.say.bind(i),t.defineSequencedProperty(i,"say"),c&&(i.say.values=s,i.say.durations=a),i.connect()}var i,o=e||{};i=t.Audio.Vocoder.Vocoder(null,null,o.numBands||16),i.disconnect(),isNaN(o.maxVoices)&&(o.maxVoices=1),isNaN(o.resonance)&&(o.resonance=4),isNaN(o.attack)&&(o.attack=ms(1)),isNaN(o.decay)&&(o.decay=measures(8)),isNaN(o.pulsewidth)&&(o.pulsewidth=.05),i.carrier=t.Audio.Synths.Synth2(o),i.note=i.carrier.note.bind(i),i._note=i.carrier._note.bind(i),i.chord=i.carrier.chord.bind(i),i.carrier._;var s,a,c=!1;return i.say=function(e,t){c===!1&&(s=e,a=t,c=!0)},t.Modules["gibber/publications/SpeakLib"]?n():t.import("gibber/publications/SpeakLib").done(function(){var e=setInterval(function(){"undefined"!=typeof Speak&&(n(),clearInterval(e))},250)}),t.defineSequencedProperty(i,"say"),t.defineSequencedProperty(i,"chord"),t.defineSequencedProperty(i,"note"),r.extend(!0,i,t.Audio.ugenTemplate),t.createProxyProperties(i,u),i},n}},{"./clock":41,"gibberish-dsp":7}],57:[function(e,t){!function(){var n=e("gibber.core.lib");n.Audio=e("./audio.js")(n),t.exports=n}()},{"./audio.js":35,"gibber.core.lib":3}]},{},[57])(57)}); \ No newline at end of file diff --git a/public/vendor/hydra.js b/public/vendor/hydra.js new file mode 100644 index 000000000..cab1ea3fd --- /dev/null +++ b/public/vendor/hydra.js @@ -0,0 +1,14909 @@ +(function (f) { + if (typeof exports === "object" && typeof module !== "undefined") { + module.exports = f() + } else if (typeof define === "function" && define.amd) { + define([], f) + } else { + var g; + if (typeof window !== "undefined") { + g = window + } else if (typeof global !== "undefined") { + g = global + } else if (typeof self !== "undefined") { + g = self + } else { + g = this + } + g.Hydra = f() + } +})(function () { + var define, module, exports; + return (function () { + function r(e, n, t) { + function o(i, f) { + if (!n[i]) { + if (!e[i]) { + var c = "function" == typeof require && require; + if (!f && c) return c(i, !0); + if (u) return u(i, !0); + var a = new Error("Cannot find module '" + i + "'"); + throw a.code = "MODULE_NOT_FOUND", a + } + var p = n[i] = {exports: {}}; + e[i][0].call(p.exports, function (r) { + var n = e[i][1][r]; + return o(n || r) + }, p, p.exports, r, e, n, t) + } + return n[i].exports + } + + for (var u = "function" == typeof require && require, i = 0; i < t.length; i++) o(t[i]); + return o + } + + return r + })()({ + 1: [function (require, module, exports) { + const Output = require('./src/output.js') + const loop = require('raf-loop') + const Source = require('./src/hydra-source.js') + const GeneratorFactory = require('./src/GeneratorFactory.js') + const mouse = require('mouse-change')() + const Audio = require('./src/audio.js') + const VidRecorder = require('./src/video-recorder.js') + +// to do: add ability to pass in certain uniforms and transforms + class HydraSynth { + + constructor({ + pb = null, + width = 1280, + height = 720, + numSources = 4, + numOutputs = 4, + makeGlobal = true, + autoLoop = true, + detectAudio = true, + enableStreamCapture = true, + canvas + } = {}) { + + this.bpm = 60 + this.pb = pb + this.width = width + this.height = height + this.time = 0 + this.makeGlobal = makeGlobal + this.renderAll = false + this.detectAudio = detectAudio + + // boolean to store when to save screenshot + this.saveFrame = false + + // if stream capture is enabled, this object contains the capture stream + this.captureStream = null + + this._initCanvas(canvas) + this._initRegl() + this._initOutputs(numOutputs) + this._initSources(numSources) + this._generateGlslTransforms() + + window.screencap = () => { + this.saveFrame = true + } + + if (enableStreamCapture) { + this.captureStream = this.canvas.captureStream(25) + + // to do: enable capture stream of specific sources and outputs + window.vidRecorder = new VidRecorder(this.captureStream) + } + + if (detectAudio) this._initAudio() + //if(makeGlobal) { + window.mouse = mouse + window.time = this.time + window['render'] = this.render.bind(this) + // window.bpm = this.bpm + window.bpm = this._setBpm.bind(this) + // } + if (autoLoop) loop(this.tick.bind(this)).start() + } + + getScreenImage(callback) { + this.imageCallback = callback + this.saveFrame = true + } + + resize(width, height) { + console.log(width, height) + this.canvas.width = width + this.canvas.height = height + this.width = width + this.height = height + this.regl.poll() + this.o.forEach((output) => { + output.resize(width, height) + }) + this.s.forEach((source) => { + source.resize(width, height) + }) + } + + canvasToImage(callback) { + const a = document.createElement('a') + a.style.display = 'none' + + let d = new Date() + a.download = `hydra-${d.getFullYear()}-${d.getMonth() + 1}-${d.getDate()}-${d.getHours()}.${d.getMinutes()}.${d.getSeconds()}.png` + document.body.appendChild(a) + var self = this + this.canvas.toBlob((blob) => { + // var url = window.URL.createObjectURL(blob) + + if (self.imageCallback) { + self.imageCallback(blob) + delete self.imageCallback + } else { + a.href = URL.createObjectURL(blob) + console.log(a.href) + a.click() + } + }, 'image/png') + setTimeout(() => { + document.body.removeChild(a); + window.URL.revokeObjectURL(a.href); + }, 300); + } + + _initAudio() { + this.audio = new Audio({ + numBins: 4 + }) + if (this.makeGlobal) window.a = this.audio + } + + // create main output canvas and add to screen + _initCanvas(canvas) { + this.canvas = document.getElementById("myCanvas"); + this.width = this.canvas.width; + this.height = this.canvas.height; + + // if (canvas) { + // this.canvas = canvas + // this.width = canvas.width + // this.height = canvas.height + // } else { + // this.canvas = document.createElement('canvas') + // this.canvas.width = this.width + // this.canvas.height = this.height + // this.canvas.style.width = '100%' + // this.canvas.style.height = '100%' + // document.body.appendChild(this.canvas) + // } + } + + _initRegl() { + this.regl = require('regl')({ + canvas: this.canvas, + pixelRatio: 1, + extensions: [ + 'oes_texture_half_float', + 'oes_texture_half_float_linear' + ], + optionalExtensions: [ + 'oes_texture_float', + 'oes_texture_float_linear' + ] + }) + + // This clears the color buffer to black and the depth buffer to 1 + this.regl.clear({ + color: [0, 0, 0, 1] + }) + + this.renderAll = this.regl({ + frag: ` + precision highp float; + varying vec2 uv; + uniform sampler2D tex0; + uniform sampler2D tex1; + uniform sampler2D tex2; + uniform sampler2D tex3; + + void main () { + vec2 st = vec2(1.0 - uv.x, uv.y); + st*= vec2(2); + vec2 q = floor(st).xy*(vec2(2.0, 1.0)); + int quad = int(q.x) + int(q.y); + st.x += step(1., mod(st.y,2.0)); + st.y += step(1., mod(st.x,2.0)); + st = fract(st); + if(quad==0){ + gl_FragColor = texture2D(tex0, st); + } else if(quad==1){ + gl_FragColor = texture2D(tex1, st); + } else if (quad==2){ + gl_FragColor = texture2D(tex2, st); + } else { + gl_FragColor = texture2D(tex3, st); + } + + } + `, + vert: ` + precision highp float; + attribute vec2 position; + varying vec2 uv; + + void main () { + uv = position; + gl_Position = vec4(1.0 - 2.0 * position, 0, 1); + }`, + attributes: { + position: [ + [-2, 0], + [0, -2], + [2, 2] + ] + }, + uniforms: { + tex0: this.regl.prop('tex0'), + tex1: this.regl.prop('tex1'), + tex2: this.regl.prop('tex2'), + tex3: this.regl.prop('tex3') + }, + count: 3, + depth: {enable: false} + }) + + this.renderFbo = this.regl({ + frag: ` + precision highp float; + varying vec2 uv; + uniform vec2 resolution; + uniform sampler2D tex0; + + void main () { + gl_FragColor = texture2D(tex0, vec2(1.0 - uv.x, uv.y)); + } + `, + vert: ` + precision highp float; + attribute vec2 position; + varying vec2 uv; + + void main () { + uv = position; + gl_Position = vec4(1.0 - 2.0 * position, 0, 1); + }`, + attributes: { + position: [ + [-2, 0], + [0, -2], + [2, 2] + ] + }, + uniforms: { + tex0: this.regl.prop('tex0'), + resolution: this.regl.prop('resolution') + }, + count: 3, + depth: {enable: false} + }) + } + + _initOutputs(numOutputs) { + const self = this + this.o = (Array(numOutputs)).fill().map((el, index) => { + var o = new Output({regl: this.regl, width: this.width, height: this.height}) + o.render() + o.id = index + if (self.makeGlobal) window['o' + index] = o + return o + }) + + // set default output + this.output = this.o[0] + } + + _initSources(numSources) { + this.s = [] + for (var i = 0; i < numSources; i++) { + this.createSource() + } + } + + _setBpm(bpm) { + this.bpm = bpm + } + + createSource() { + let s = new Source({regl: this.regl, pb: this.pb, width: this.width, height: this.height}) + if (this.makeGlobal) { + window['s' + this.s.length] = s + } + this.s.push(s) + return s + } + + _generateGlslTransforms() { + const self = this + const gen = new GeneratorFactory(this.o[0]) + window.generator = gen + Object.keys(gen.functions).forEach((key) => { + self[key] = gen.functions[key] + if (self.makeGlobal === true) { + window[key] = gen.functions[key] + } + }) + } + + render(output) { + if (output) { + this.output = output + this.isRenderingAll = false + } else { + this.isRenderingAll = true + } + } + + tick(dt, uniforms) { + + // if(self.detectAudio === true) self.fft = self.audio.frequencies() + // this.regl.frame(function () { + this.time += dt * 0.001 + // console.log(this.time) + // this.regl.clear({ + // color: [0, 0, 0, 1] + // }) + window.time = this.time + if (this.detectAudio === true) this.audio.tick() + for (let i = 0; i < this.s.length; i++) { + this.s[i].tick(this.time) + } + + for (let i = 0; i < this.o.length; i++) { + // console.log('WIDTH', this.canvas.width, this.o[0].getCurrent()) + this.o[i].tick({ + time: this.time, + mouse: mouse, + bpm: this.bpm, + resolution: [this.canvas.width, this.canvas.height] + }) + } + + // console.log("looping", self.o[0].fbo) + if (this.isRenderingAll) { + this.renderAll({ + tex0: this.o[0].getCurrent(), + tex1: this.o[1].getCurrent(), + tex2: this.o[2].getCurrent(), + tex3: this.o[3].getCurrent(), + resolution: [this.canvas.width, this.canvas.height] + }) + } else { + // console.log('out', self.output.id) + this.renderFbo({ + tex0: this.output.getCurrent(), + resolution: [this.canvas.width, this.canvas.height] + }) + } + if (this.saveFrame === true) { + this.canvasToImage() + this.saveFrame = false + } + } + + + } + + module.exports = HydraSynth + + }, { + "./src/GeneratorFactory.js": 30, + "./src/audio.js": 31, + "./src/hydra-source.js": 35, + "./src/output.js": 38, + "./src/video-recorder.js": 41, + "mouse-change": 5, + "raf-loop": 8, + "regl": 10 + }], + 2: [function (require, module, exports) { + module.exports = function (cb) { + if (typeof Promise !== 'function') { + var err = new Error('Device enumeration not supported.'); + err.kind = 'METHOD_NOT_AVAILABLE'; + if (cb) { + console.warn('module now uses promise based api - callback is deprecated'); + return cb(err); + } + throw err; + } + + return new Promise(function (resolve, reject) { + var processDevices = function (devices) { + var normalizedDevices = []; + for (var i = 0; i < devices.length; i++) { + var device = devices[i]; + //make chrome values match spec + var kind = device.kind || null; + if (kind && kind.toLowerCase() === 'audio') { + kind = 'audioinput'; + } else if (kind && kind.toLowerCase() === 'video') { + kind = 'videoinput'; + } + normalizedDevices.push({ + facing: device.facing || null, + deviceId: device.id || device.deviceId || null, + label: device.label || null, + kind: kind, + groupId: device.groupId || null + }); + } + resolve(normalizedDevices); + if (cb) { + console.warn('module now uses promise based api - callback is deprecated'); + cb(null, normalizedDevices); + } + }; + + if (window.navigator && window.navigator.mediaDevices && window.navigator.mediaDevices.enumerateDevices) { + window.navigator.mediaDevices.enumerateDevices().then(processDevices); + } else if (window.MediaStreamTrack && window.MediaStreamTrack.getSources) { + window.MediaStreamTrack.getSources(processDevices); + } else { + var err = new Error('Device enumeration not supported.'); + err.kind = 'METHOD_NOT_AVAILABLE'; + reject(err); + if (cb) { + console.warn('module now uses promise based api - callback is deprecated'); + cb(err); + } + } + }); + }; + + }, {}], + 3: [function (require, module, exports) { + if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }); + }; + } else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + ctor.super_ = superCtor + var TempCtor = function () { + } + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } + } + + }, {}], + 4: [function (require, module, exports) { + !function (t, r) { + "object" == typeof exports && "object" == typeof module ? module.exports = r() : "function" == typeof define && define.amd ? define([], r) : "object" == typeof exports ? exports.Meyda = r() : t.Meyda = r() + }(this, function () { + return function (t) { + function r(n) { + if (e[n]) return e[n].exports; + var o = e[n] = {i: n, l: !1, exports: {}}; + return t[n].call(o.exports, o, o.exports, r), o.l = !0, o.exports + } + + var e = {}; + return r.m = t, r.c = e, r.i = function (t) { + return t + }, r.d = function (t, e, n) { + r.o(t, e) || Object.defineProperty(t, e, {configurable: !1, enumerable: !0, get: n}) + }, r.n = function (t) { + var e = t && t.__esModule ? function () { + return t.default + } : function () { + return t + }; + return r.d(e, "a", e), e + }, r.o = function (t, r) { + return Object.prototype.hasOwnProperty.call(t, r) + }, r.p = "", r(r.s = 23) + }([function (t, r, e) { + "use strict"; + + function n(t) { + if (Array.isArray(t)) { + for (var r = 0, e = Array(t.length); r < t.length; r++) e[r] = t[r]; + return e + } + return Array.from(t) + } + + function o(t) { + for (; t % 2 == 0 && t > 1;) t /= 2; + return 1 === t + } + + function i(t, r) { + for (var e = [], n = 0; n < Math.min(t.length, r.length); n++) e[n] = t[n] * r[n]; + return e + } + + function a(t, r) { + if ("rect" !== r) { + if ("" !== r && r || (r = "hanning"), g[r] || (g[r] = {}), !g[r][t.length]) try { + g[r][t.length] = b[r](t.length) + } catch (t) { + throw new Error("Invalid windowing function") + } + t = i(t, g[r][t.length]) + } + return t + } + + function u(t, r, e) { + for (var n = new Float32Array(t), o = 0; o < n.length; o++) n[o] = o * r / e, n[o] = 13 * Math.atan(n[o] / 1315.8) + 3.5 * Math.atan(Math.pow(n[o] / 7518, 2)); + return n + } + + function c(t) { + return Float32Array.from(t) + } + + function f(t) { + return 700 * (Math.exp(t / 1125) - 1) + } + + function l(t) { + return 1125 * Math.log(1 + t / 700) + } + + function s(t, r, e) { + for (var n = new Float32Array(t + 2), o = new Float32Array(t + 2), i = r / 2, a = l(0), u = l(i), c = u - a, s = c / (t + 1), p = Array(t + 2), m = 0; m < n.length; m++) n[m] = m * s, o[m] = f(n[m]), p[m] = Math.floor((e + 1) * o[m] / r); + for (var y = Array(t), h = 0; h < y.length; h++) { + y[h] = Array.apply(null, new Array(e / 2 + 1)).map(Number.prototype.valueOf, 0); + for (var b = p[h]; b < p[h + 1]; b++) y[h][b] = (b - p[h]) / (p[h + 1] - p[h]); + for (var g = p[h + 1]; g < p[h + 2]; g++) y[h][g] = (p[h + 2] - g) / (p[h + 2] - p[h + 1]) + } + return y + } + + function p(t, r) { + return Math.log2(16 * t / r) + } + + function m(t) { + var r = t[0].map(function () { + return 0 + }), e = t.reduce(function (t, r) { + return r.forEach(function (r, e) { + t[e] += Math.pow(r, 2) + }), t + }, r).map(Math.sqrt); + return t.map(function (t, r) { + return t.map(function (t, r) { + return t / (e[r] || 1) + }) + }) + } + + function y(t, r, e) { + var o = arguments.length > 3 && void 0 !== arguments[3] ? arguments[3] : 5, + i = arguments.length > 4 && void 0 !== arguments[4] ? arguments[4] : 2, + a = !(arguments.length > 5 && void 0 !== arguments[5]) || arguments[5], + u = arguments.length > 6 && void 0 !== arguments[6] ? arguments[6] : 440, + c = Math.floor(e / 2) + 1, f = new Array(e).fill(0).map(function (n, o) { + return t * p(r * o / e, u) + }); + f[0] = f[1] - 1.5 * t; + var l = f.slice(1).map(function (t, r) { + return Math.max(t - f[r]) + }, 1).concat([1]), s = Math.round(t / 2), y = new Array(t).fill(0).map(function (r, e) { + return f.map(function (r) { + return (10 * t + s + r - e) % t - s + }) + }), h = y.map(function (t, r) { + return t.map(function (t, e) { + return Math.exp(-.5 * Math.pow(2 * y[r][e] / l[e], 2)) + }) + }); + if (h = m(h), i) { + var b = f.map(function (r) { + return Math.exp(-.5 * Math.pow((r / t - o) / i, 2)) + }); + h = h.map(function (t) { + return t.map(function (t, r) { + return t * b[r] + }) + }) + } + return a && (h = [].concat(n(h.slice(3)), n(h.slice(0, 3)))), h.map(function (t) { + return t.slice(0, c) + }) + } + + function h(t, r, e) { + if (t.length < r) throw new Error("Buffer is too short for frame length"); + if (e < 1) throw new Error("Hop length cannot be less that 1"); + if (r < 1) throw new Error("Frame length cannot be less that 1"); + var n = 1 + Math.floor((t.length - r) / e); + return new Array(n).fill(0).map(function (n, o) { + return t.slice(o * e, o * e + r) + }) + } + + r.b = o, r.a = a, r.c = u, r.f = c, r.d = s, r.e = y, r.g = h; + var b = e(25), g = {} + }, function (t, r, e) { + "use strict"; + + function n(t, r) { + for (var e = 0, n = 0, o = 0; o < r.length; o++) e += Math.pow(o, t) * Math.abs(r[o]), n += r[o]; + return e / n + } + + r.a = n + }, function (t, r, e) { + "use strict"; + var n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { + return typeof t + } : function (t) { + return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t + }; + r.a = function (t) { + if ("object" !== n(t.ampSpectrum) || "object" !== n(t.barkScale)) throw new TypeError; + var r = new Float32Array(24), e = 0, o = t.ampSpectrum, i = new Int32Array(25); + i[0] = 0; + for (var a = t.barkScale[o.length - 1] / 24, u = 1, c = 0; c < o.length; c++) for (; t.barkScale[c] > a;) i[u++] = c, a = u * t.barkScale[o.length - 1] / 24; + i[24] = o.length - 1; + for (var f = 0; f < 24; f++) { + for (var l = 0, s = i[f]; s < i[f + 1]; s++) l += o[s]; + r[f] = Math.pow(l, .23) + } + for (var p = 0; p < r.length; p++) e += r[p]; + return {specific: r, total: e} + } + }, function (t, r, e) { + "use strict"; + var n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { + return typeof t + } : function (t) { + return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t + }; + r.a = function () { + if ("object" !== n(arguments[0].ampSpectrum)) throw new TypeError; + for (var t = new Float32Array(arguments[0].ampSpectrum.length), r = 0; r < t.length; r++) t[r] = Math.pow(arguments[0].ampSpectrum[r], 2); + return t + } + }, function (t, r, e) { + "use strict"; + Object.defineProperty(r, "__esModule", {value: !0}), e.d(r, "buffer", function () { + return v + }), e.d(r, "complexSpectrum", function () { + return w + }), e.d(r, "amplitudeSpectrum", function () { + return x + }); + var n = e(13), o = e(9), i = e(20), a = e(14), u = e(18), c = e(15), f = e(21), l = e(19), + s = e(17), p = e(22), m = e(2), y = e(12), h = e(11), b = e(10), g = e(8), S = e(3), d = e(16); + e.d(r, "rms", function () { + return n.a + }), e.d(r, "energy", function () { + return o.a + }), e.d(r, "spectralSlope", function () { + return i.a + }), e.d(r, "spectralCentroid", function () { + return a.a + }), e.d(r, "spectralRolloff", function () { + return u.a + }), e.d(r, "spectralFlatness", function () { + return c.a + }), e.d(r, "spectralSpread", function () { + return f.a + }), e.d(r, "spectralSkewness", function () { + return l.a + }), e.d(r, "spectralKurtosis", function () { + return s.a + }), e.d(r, "zcr", function () { + return p.a + }), e.d(r, "loudness", function () { + return m.a + }), e.d(r, "perceptualSpread", function () { + return y.a + }), e.d(r, "perceptualSharpness", function () { + return h.a + }), e.d(r, "powerSpectrum", function () { + return S.a + }), e.d(r, "mfcc", function () { + return b.a + }), e.d(r, "chroma", function () { + return g.a + }), e.d(r, "spectralFlux", function () { + return d.a + }); + var v = function (t) { + return t.signal + }, w = function (t) { + return t.complexSpectrum + }, x = function (t) { + return t.ampSpectrum + } + }, function (t, r) { + var e; + e = function () { + return this + }(); + try { + e = e || Function("return this")() || (0, eval)("this") + } catch (t) { + "object" == typeof window && (e = window) + } + t.exports = e + }, function (t, r, e) { + "use strict"; + Object.defineProperty(r, "__esModule", {value: !0}); + var n = e(0), o = e(4), i = e(28), a = (e.n(i), e(24)), + u = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { + return typeof t + } : function (t) { + return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t + }, c = { + audioContext: null, + spn: null, + bufferSize: 512, + sampleRate: 44100, + melBands: 26, + chromaBands: 12, + callback: null, + windowingFunction: "hanning", + featureExtractors: o, + EXTRACTION_STARTED: !1, + _featuresToExtract: [], + windowing: n.a, + _errors: { + notPow2: new Error("Meyda: Buffer size must be a power of 2, e.g. 64 or 512"), + featureUndef: new Error("Meyda: No features defined."), + invalidFeatureFmt: new Error("Meyda: Invalid feature format"), + invalidInput: new Error("Meyda: Invalid input."), + noAC: new Error("Meyda: No AudioContext specified."), + noSource: new Error("Meyda: No source node specified.") + }, + createMeydaAnalyzer: function (t) { + return new a.a(t, c) + }, + extract: function (t, r, e) { + if (!r) throw this._errors.invalidInput; + if ("object" != (void 0 === r ? "undefined" : u(r))) throw this._errors.invalidInput; + if (!t) throw this._errors.featureUndef; + if (!n.b(r.length)) throw this._errors.notPow2; + void 0 !== this.barkScale && this.barkScale.length == this.bufferSize || (this.barkScale = n.c(this.bufferSize, this.sampleRate, this.bufferSize)), void 0 !== this.melFilterBank && this.barkScale.length == this.bufferSize && this.melFilterBank.length == this.melBands || (this.melFilterBank = n.d(this.melBands, this.sampleRate, this.bufferSize)), void 0 !== this.chromaFilterBank && this.chromaFilterBank.length == this.chromaBands || (this.chromaFilterBank = n.e(this.chromaBands, this.sampleRate, this.bufferSize)), void 0 === r.buffer ? this.signal = n.f(r) : this.signal = r; + var o = f(r, this.windowingFunction, this.bufferSize); + if (this.signal = o.windowedSignal, this.complexSpectrum = o.complexSpectrum, this.ampSpectrum = o.ampSpectrum, e) { + var i = f(e, this.windowingFunction, this.bufferSize); + this.previousSignal = i.windowedSignal, this.previousComplexSpectrum = i.complexSpectrum, this.previousAmpSpectrum = i.ampSpectrum + } + if ("object" === (void 0 === t ? "undefined" : u(t))) { + for (var a = {}, c = 0; c < t.length; c++) a[t[c]] = this.featureExtractors[t[c]]({ + ampSpectrum: this.ampSpectrum, + chromaFilterBank: this.chromaFilterBank, + complexSpectrum: this.complexSpectrum, + signal: this.signal, + bufferSize: this.bufferSize, + sampleRate: this.sampleRate, + barkScale: this.barkScale, + melFilterBank: this.melFilterBank, + previousSignal: this.previousSignal, + previousAmpSpectrum: this.previousAmpSpectrum, + previousComplexSpectrum: this.previousComplexSpectrum + }); + return a + } + if ("string" == typeof t) return this.featureExtractors[t]({ + ampSpectrum: this.ampSpectrum, + chromaFilterBank: this.chromaFilterBank, + complexSpectrum: this.complexSpectrum, + signal: this.signal, + bufferSize: this.bufferSize, + sampleRate: this.sampleRate, + barkScale: this.barkScale, + melFilterBank: this.melFilterBank, + previousSignal: this.previousSignal, + previousAmpSpectrum: this.previousAmpSpectrum, + previousComplexSpectrum: this.previousComplexSpectrum + }); + throw this._errors.invalidFeatureFmt + } + }, f = function (t, r, o) { + var a = {}; + void 0 === t.buffer ? a.signal = n.f(t) : a.signal = t, a.windowedSignal = n.a(a.signal, r), a.complexSpectrum = e.i(i.fft)(a.windowedSignal), a.ampSpectrum = new Float32Array(o / 2); + for (var u = 0; u < o / 2; u++) a.ampSpectrum[u] = Math.sqrt(Math.pow(a.complexSpectrum.real[u], 2) + Math.pow(a.complexSpectrum.imag[u], 2)); + return a + }; + r.default = c, "undefined" != typeof window && (window.Meyda = c) + }, function (t, r, e) { + "use strict"; + (function (r) {/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ + function n(t, r) { + if (t === r) return 0; + for (var e = t.length, n = r.length, o = 0, i = Math.min(e, n); o < i; ++o) if (t[o] !== r[o]) { + e = t[o], n = r[o]; + break + } + return e < n ? -1 : n < e ? 1 : 0 + } + + function o(t) { + return r.Buffer && "function" == typeof r.Buffer.isBuffer ? r.Buffer.isBuffer(t) : !(null == t || !t._isBuffer) + } + + function i(t) { + return Object.prototype.toString.call(t) + } + + function a(t) { + return !o(t) && ("function" == typeof r.ArrayBuffer && ("function" == typeof ArrayBuffer.isView ? ArrayBuffer.isView(t) : !!t && (t instanceof DataView || !!(t.buffer && t.buffer instanceof ArrayBuffer)))) + } + + function u(t) { + if (v.isFunction(t)) { + if (E) return t.name; + var r = t.toString(), e = r.match(M); + return e && e[1] + } + } + + function c(t, r) { + return "string" == typeof t ? t.length < r ? t : t.slice(0, r) : t + } + + function f(t) { + if (E || !v.isFunction(t)) return v.inspect(t); + var r = u(t); + return "[Function" + (r ? ": " + r : "") + "]" + } + + function l(t) { + return c(f(t.actual), 128) + " " + t.operator + " " + c(f(t.expected), 128) + } + + function s(t, r, e, n, o) { + throw new _.AssertionError({ + message: e, + actual: t, + expected: r, + operator: n, + stackStartFunction: o + }) + } + + function p(t, r) { + t || s(t, !0, r, "==", _.ok) + } + + function m(t, r, e, u) { + if (t === r) return !0; + if (o(t) && o(r)) return 0 === n(t, r); + if (v.isDate(t) && v.isDate(r)) return t.getTime() === r.getTime(); + if (v.isRegExp(t) && v.isRegExp(r)) return t.source === r.source && t.global === r.global && t.multiline === r.multiline && t.lastIndex === r.lastIndex && t.ignoreCase === r.ignoreCase; + if (null !== t && "object" == typeof t || null !== r && "object" == typeof r) { + if (a(t) && a(r) && i(t) === i(r) && !(t instanceof Float32Array || t instanceof Float64Array)) return 0 === n(new Uint8Array(t.buffer), new Uint8Array(r.buffer)); + if (o(t) !== o(r)) return !1; + u = u || {actual: [], expected: []}; + var c = u.actual.indexOf(t); + return -1 !== c && c === u.expected.indexOf(r) || (u.actual.push(t), u.expected.push(r), h(t, r, e, u)) + } + return e ? t === r : t == r + } + + function y(t) { + return "[object Arguments]" == Object.prototype.toString.call(t) + } + + function h(t, r, e, n) { + if (null === t || void 0 === t || null === r || void 0 === r) return !1; + if (v.isPrimitive(t) || v.isPrimitive(r)) return t === r; + if (e && Object.getPrototypeOf(t) !== Object.getPrototypeOf(r)) return !1; + var o = y(t), i = y(r); + if (o && !i || !o && i) return !1; + if (o) return t = x.call(t), r = x.call(r), m(t, r, e); + var a, u, c = A(t), f = A(r); + if (c.length !== f.length) return !1; + for (c.sort(), f.sort(), u = c.length - 1; u >= 0; u--) if (c[u] !== f[u]) return !1; + for (u = c.length - 1; u >= 0; u--) if (a = c[u], !m(t[a], r[a], e, n)) return !1; + return !0 + } + + function b(t, r, e) { + m(t, r, !0) && s(t, r, e, "notDeepStrictEqual", b) + } + + function g(t, r) { + if (!t || !r) return !1; + if ("[object RegExp]" == Object.prototype.toString.call(r)) return r.test(t); + try { + if (t instanceof r) return !0 + } catch (t) { + } + return !Error.isPrototypeOf(r) && !0 === r.call({}, t) + } + + function S(t) { + var r; + try { + t() + } catch (t) { + r = t + } + return r + } + + function d(t, r, e, n) { + var o; + if ("function" != typeof r) throw new TypeError('"block" argument must be a function'); + "string" == typeof e && (n = e, e = null), o = S(r), n = (e && e.name ? " (" + e.name + ")." : ".") + (n ? " " + n : "."), t && !o && s(o, e, "Missing expected exception" + n); + var i = "string" == typeof n, a = !t && v.isError(o), u = !t && o && !e; + if ((a && i && g(o, e) || u) && s(o, e, "Got unwanted exception" + n), t && o && e && !g(o, e) || !t && o) throw o + } + + var v = e(33), w = Object.prototype.hasOwnProperty, x = Array.prototype.slice, E = function () { + return "foo" === function () { + }.name + }(), _ = t.exports = p, M = /\s*function\s+([^\(\s]*)\s*/; + _.AssertionError = function (t) { + this.name = "AssertionError", this.actual = t.actual, this.expected = t.expected, this.operator = t.operator, t.message ? (this.message = t.message, this.generatedMessage = !1) : (this.message = l(this), this.generatedMessage = !0); + var r = t.stackStartFunction || s; + if (Error.captureStackTrace) Error.captureStackTrace(this, r); else { + var e = new Error; + if (e.stack) { + var n = e.stack, o = u(r), i = n.indexOf("\n" + o); + if (i >= 0) { + var a = n.indexOf("\n", i + 1); + n = n.substring(a + 1) + } + this.stack = n + } + } + }, v.inherits(_.AssertionError, Error), _.fail = s, _.ok = p, _.equal = function (t, r, e) { + t != r && s(t, r, e, "==", _.equal) + }, _.notEqual = function (t, r, e) { + t == r && s(t, r, e, "!=", _.notEqual) + }, _.deepEqual = function (t, r, e) { + m(t, r, !1) || s(t, r, e, "deepEqual", _.deepEqual) + }, _.deepStrictEqual = function (t, r, e) { + m(t, r, !0) || s(t, r, e, "deepStrictEqual", _.deepStrictEqual) + }, _.notDeepEqual = function (t, r, e) { + m(t, r, !1) && s(t, r, e, "notDeepEqual", _.notDeepEqual) + }, _.notDeepStrictEqual = b, _.strictEqual = function (t, r, e) { + t !== r && s(t, r, e, "===", _.strictEqual) + }, _.notStrictEqual = function (t, r, e) { + t === r && s(t, r, e, "!==", _.notStrictEqual) + }, _.throws = function (t, r, e) { + d(!0, t, r, e) + }, _.doesNotThrow = function (t, r, e) { + d(!1, t, r, e) + }, _.ifError = function (t) { + if (t) throw t + }; + var A = Object.keys || function (t) { + var r = []; + for (var e in t) w.call(t, e) && r.push(e); + return r + } + }).call(r, e(5)) + }, function (t, r, e) { + "use strict"; + + function n(t) { + if (Array.isArray(t)) { + for (var r = 0, e = Array(t.length); r < t.length; r++) e[r] = t[r]; + return e + } + return Array.from(t) + } + + var o = (e(0), "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { + return typeof t + } : function (t) { + return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t + }); + r.a = function (t) { + if ("object" !== o(t.ampSpectrum)) throw new TypeError("Valid ampSpectrum is required to generate chroma"); + if ("object" !== o(t.chromaFilterBank)) throw new TypeError("Valid chromaFilterBank is required to generate chroma"); + var r = t.chromaFilterBank.map(function (r, e) { + return t.ampSpectrum.reduce(function (t, e, n) { + return t + e * r[n] + }, 0) + }), e = Math.max.apply(Math, n(r)); + return e ? r.map(function (t) { + return t / e + }) : r + } + }, function (t, r, e) { + "use strict"; + var n = e(7), + o = (e.n(n), "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { + return typeof t + } : function (t) { + return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t + }); + r.a = function () { + if ("object" !== o(arguments[0].signal)) throw new TypeError; + for (var t = 0, r = 0; r < arguments[0].signal.length; r++) t += Math.pow(Math.abs(arguments[0].signal[r]), 2); + return t + } + }, function (t, r, e) { + "use strict"; + var n = e(3), + o = (e(0), "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { + return typeof t + } : function (t) { + return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t + }), i = e(26); + r.a = function (t) { + if ("object" !== o(t.ampSpectrum)) throw new TypeError("Valid ampSpectrum is required to generate MFCC"); + if ("object" !== o(t.melFilterBank)) throw new TypeError("Valid melFilterBank is required to generate MFCC"); + for (var r = e.i(n.a)(t), a = t.melFilterBank.length, u = Array(a), c = new Float32Array(a), f = 0; f < c.length; f++) { + u[f] = new Float32Array(t.bufferSize / 2), c[f] = 0; + for (var l = 0; l < t.bufferSize / 2; l++) u[f][l] = t.melFilterBank[f][l] * r[l], c[f] += u[f][l]; + c[f] = Math.log(c[f] + 1) + } + var s = Array.prototype.slice.call(c); + return i(s).slice(0, 13) + } + }, function (t, r, e) { + "use strict"; + var n = e(2), o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { + return typeof t + } : function (t) { + return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t + }; + r.a = function () { + if ("object" !== o(arguments[0].signal)) throw new TypeError; + for (var t = e.i(n.a)(arguments[0]), r = t.specific, i = 0, a = 0; a < r.length; a++) i += a < 15 ? (a + 1) * r[a + 1] : .066 * Math.exp(.171 * (a + 1)); + return i *= .11 / t.total + } + }, function (t, r, e) { + "use strict"; + var n = e(2), o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { + return typeof t + } : function (t) { + return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t + }; + r.a = function () { + if ("object" !== o(arguments[0].signal)) throw new TypeError; + for (var t = e.i(n.a)(arguments[0]), r = 0, i = 0; i < t.specific.length; i++) t.specific[i] > r && (r = t.specific[i]); + return Math.pow((t.total - r) / t.total, 2) + } + }, function (t, r, e) { + "use strict"; + var n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { + return typeof t + } : function (t) { + return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t + }; + r.a = function (t) { + if ("object" !== n(t.signal)) throw new TypeError; + for (var r = 0, e = 0; e < t.signal.length; e++) r += Math.pow(t.signal[e], 2); + return r /= t.signal.length, r = Math.sqrt(r) + } + }, function (t, r, e) { + "use strict"; + var n = e(1), o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { + return typeof t + } : function (t) { + return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t + }; + r.a = function () { + if ("object" !== o(arguments[0].ampSpectrum)) throw new TypeError; + return e.i(n.a)(1, arguments[0].ampSpectrum) + } + }, function (t, r, e) { + "use strict"; + var n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { + return typeof t + } : function (t) { + return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t + }; + r.a = function () { + if ("object" !== n(arguments[0].ampSpectrum)) throw new TypeError; + for (var t = 0, r = 0, e = 0; e < arguments[0].ampSpectrum.length; e++) t += Math.log(arguments[0].ampSpectrum[e]), r += arguments[0].ampSpectrum[e]; + return Math.exp(t / arguments[0].ampSpectrum.length) * arguments[0].ampSpectrum.length / r + } + }, function (t, r, e) { + "use strict"; + var n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { + return typeof t + } : function (t) { + return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t + }; + r.a = function (t) { + if ("object" !== n(t.signal) || "object" != n(t.previousSignal)) throw new TypeError; + for (var r = 0, e = -t.bufferSize / 2; e < signal.length / 2 - 1; e++) x = Math.abs(t.signal[e]) - Math.abs(t.previousSignal[e]), r += (x + Math.abs(x)) / 2; + return r + } + }, function (t, r, e) { + "use strict"; + var n = e(1), o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { + return typeof t + } : function (t) { + return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t + }; + r.a = function () { + if ("object" !== o(arguments[0].ampSpectrum)) throw new TypeError; + var t = arguments[0].ampSpectrum, r = e.i(n.a)(1, t), i = e.i(n.a)(2, t), a = e.i(n.a)(3, t), + u = e.i(n.a)(4, t); + return (-3 * Math.pow(r, 4) + 6 * r * i - 4 * r * a + u) / Math.pow(Math.sqrt(i - Math.pow(r, 2)), 4) + } + }, function (t, r, e) { + "use strict"; + var n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { + return typeof t + } : function (t) { + return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t + }; + r.a = function () { + if ("object" !== n(arguments[0].ampSpectrum)) throw new TypeError; + for (var t = arguments[0].ampSpectrum, r = arguments[0].sampleRate / (2 * (t.length - 1)), e = 0, o = 0; o < t.length; o++) e += t[o]; + for (var i = .99 * e, a = t.length - 1; e > i && a >= 0;) e -= t[a], --a; + return (a + 1) * r + } + }, function (t, r, e) { + "use strict"; + var n = e(1), o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { + return typeof t + } : function (t) { + return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t + }; + r.a = function (t) { + if ("object" !== o(t.ampSpectrum)) throw new TypeError; + var r = e.i(n.a)(1, t.ampSpectrum), i = e.i(n.a)(2, t.ampSpectrum), + a = e.i(n.a)(3, t.ampSpectrum); + return (2 * Math.pow(r, 3) - 3 * r * i + a) / Math.pow(Math.sqrt(i - Math.pow(r, 2)), 3) + } + }, function (t, r, e) { + "use strict"; + var n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { + return typeof t + } : function (t) { + return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t + }; + r.a = function (t) { + if ("object" !== n(t.ampSpectrum)) throw new TypeError; + for (var r = 0, e = 0, o = new Float32Array(t.ampSpectrum.length), i = 0, a = 0, u = 0; u < t.ampSpectrum.length; u++) { + r += t.ampSpectrum[u]; + var c = u * t.sampleRate / t.bufferSize; + o[u] = c, i += c * c, e += c, a += c * t.ampSpectrum[u] + } + return (t.ampSpectrum.length * a - e * r) / (r * (i - Math.pow(e, 2))) + } + }, function (t, r, e) { + "use strict"; + var n = e(1), o = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { + return typeof t + } : function (t) { + return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t + }; + r.a = function (t) { + if ("object" !== o(t.ampSpectrum)) throw new TypeError; + return Math.sqrt(e.i(n.a)(2, t.ampSpectrum) - Math.pow(e.i(n.a)(1, t.ampSpectrum), 2)) + } + }, function (t, r, e) { + "use strict"; + var n = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (t) { + return typeof t + } : function (t) { + return t && "function" == typeof Symbol && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t + }; + r.a = function () { + if ("object" !== n(arguments[0].signal)) throw new TypeError; + for (var t = 0, r = 0; r < arguments[0].signal.length; r++) (arguments[0].signal[r] >= 0 && arguments[0].signal[r + 1] < 0 || arguments[0].signal[r] < 0 && arguments[0].signal[r + 1] >= 0) && t++; + return t + } + }, function (t, r, e) { + t.exports = e(6).default + }, function (t, r, e) { + "use strict"; + + function n(t, r) { + if (!(t instanceof r)) throw new TypeError("Cannot call a class as a function") + } + + e.d(r, "a", function () { + return u + }); + var o = e(0), i = e(4), a = function () { + function t(t, r) { + for (var e = 0; e < r.length; e++) { + var n = r[e]; + n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(t, n.key, n) + } + } + + return function (r, e, n) { + return e && t(r.prototype, e), n && t(r, n), r + } + }(), u = function () { + function t(r, e) { + var a = this; + if (n(this, t), this._m = e, !r.audioContext) throw this._m.errors.noAC; + if (r.bufferSize && !o.b(r.bufferSize)) throw this._m._errors.notPow2; + if (!r.source) throw this._m._errors.noSource; + this._m.audioContext = r.audioContext, this._m.bufferSize = r.bufferSize || this._m.bufferSize || 256, this._m.hopSize = r.hopSize || this._m.hopSize || this._m.bufferSize, this._m.sampleRate = r.sampleRate || this._m.audioContext.sampleRate || 44100, this._m.callback = r.callback, this._m.windowingFunction = r.windowingFunction || "hanning", this._m.featureExtractors = i, this._m.EXTRACTION_STARTED = r.startImmediately || !1, this._m.spn = this._m.audioContext.createScriptProcessor(this._m.bufferSize, 1, 1), this._m.spn.connect(this._m.audioContext.destination), this._m._featuresToExtract = r.featureExtractors || [], this._m.barkScale = o.c(this._m.bufferSize, this._m.sampleRate, this._m.bufferSize), this._m.melFilterBank = o.d(this._m.melBands, this._m.sampleRate, this._m.bufferSize), this._m.inputData = null, this._m.previousInputData = null, this._m.frame = null, this._m.previousFrame = null, this.setSource(r.source), this._m.spn.onaudioprocess = function (t) { + if (null !== a._m.inputData && (a._m.previousInputData = a._m.inputData), a._m.inputData = t.inputBuffer.getChannelData(0), a._m.previousInputData) { + var r = new Float32Array(a._m.previousInputData.length + a._m.inputData.length - a._m.hopSize); + r.set(a._m.previousInputData.slice(a._m.hopSize)), r.set(a._m.inputData, a._m.previousInputData.length - a._m.hopSize) + } else var r = a._m.inputData; + o.g(r, a._m.bufferSize, a._m.hopSize).forEach(function (t) { + a._m.frame = t; + var r = a._m.extract(a._m._featuresToExtract, a._m.frame, a._m.previousFrame); + "function" == typeof a._m.callback && a._m.EXTRACTION_STARTED && a._m.callback(r), a._m.previousFrame = a._m.frame + }) + } + } + + return a(t, [{ + key: "start", value: function (t) { + this._m._featuresToExtract = t || this._m._featuresToExtract, this._m.EXTRACTION_STARTED = !0 + } + }, { + key: "stop", value: function () { + this._m.EXTRACTION_STARTED = !1 + } + }, { + key: "setSource", value: function (t) { + t.connect(this._m.spn) + } + }, { + key: "get", value: function (t) { + return this._m.inputData ? this._m.extract(t || this._m._featuresToExtract, this._m.inputData, this._m.previousInputData) : null + } + }]), t + }() + }, function (t, r, e) { + "use strict"; + + function n(t) { + for (var r = new Float32Array(t), e = 2 * Math.PI / (t - 1), n = 2 * e, o = 0; o < t / 2; o++) r[o] = .42 - .5 * Math.cos(o * e) + .08 * Math.cos(o * n); + for (var i = t / 2; i > 0; i--) r[t - i] = r[i - 1]; + return r + } + + function o(t) { + for (var r = Math.PI / (t - 1), e = new Float32Array(t), n = 0; n < t; n++) e[n] = Math.sin(r * n); + return e + } + + function i(t) { + for (var r = new Float32Array(t), e = 0; e < t; e++) r[e] = .5 - .5 * Math.cos(2 * Math.PI * e / (t - 1)); + return r + } + + function a(t) { + for (var r = new Float32Array(t), e = 0; e < t; e++) r[e] = .54 - .46 * Math.cos(2 * Math.PI * (e / t - 1)); + return r + } + + Object.defineProperty(r, "__esModule", {value: !0}), r.blackman = n, r.sine = o, r.hanning = i, r.hamming = a + }, function (t, r, e) { + t.exports = e(27) + }, function (t, r) { + function e(t, r) { + var e = t.length; + return r = r || 2, cosMap && cosMap[e] || n(e), t.map(function () { + return 0 + }).map(function (n, o) { + return r * t.reduce(function (t, r, n, i) { + return t + r * cosMap[e][n + o * e] + }, 0) + }) + } + + cosMap = null; + var n = function (t) { + cosMap = cosMap || {}, cosMap[t] = new Array(t * t); + for (var r = Math.PI / t, e = 0; e < t; e++) for (var n = 0; n < t; n++) cosMap[t][n + e * t] = Math.cos(r * (n + .5) * e) + }; + t.exports = e + }, function (t, r, e) { + "use strict"; + var n = e(29), o = function (t) { + var r = {}; + void 0 === t.real || void 0 === t.imag ? r = n.constructComplexArray(t) : (r.real = t.real.slice(), r.imag = t.imag.slice()); + var e = r.real.length, o = Math.log2(e); + if (Math.round(o) != o) throw new Error("Input size must be a power of 2."); + if (r.real.length != r.imag.length) throw new Error("Real and imaginary components must have the same length."); + for (var i = n.bitReverseArray(e), a = { + real: [], + imag: [] + }, u = 0; u < e; u++) a.real[i[u]] = r.real[u], a.imag[i[u]] = r.imag[u]; + for (var c = 0; c < e; c++) r.real[c] = a.real[c], r.imag[c] = a.imag[c]; + for (var f = 1; f <= o; f++) for (var l = Math.pow(2, f), s = 0; s < l / 2; s++) for (var p = n.euler(s, l), m = 0; m < e / l; m++) { + var y = l * m + s, h = l * m + s + l / 2, b = {real: r.real[y], imag: r.imag[y]}, + g = {real: r.real[h], imag: r.imag[h]}, S = n.multiply(p, g), d = n.subtract(b, S); + r.real[h] = d.real, r.imag[h] = d.imag; + var v = n.add(S, b); + r.real[y] = v.real, r.imag[y] = v.imag + } + return r + }, i = function (t) { + if (void 0 === t.real || void 0 === t.imag) throw new Error("IFFT only accepts a complex input."); + for (var r = t.real.length, e = {real: [], imag: []}, i = 0; i < r; i++) { + var a = {real: t.real[i], imag: t.imag[i]}, u = n.conj(a); + e.real[i] = u.real, e.imag[i] = u.imag + } + var c = o(e); + return e.real = c.real.map(function (t) { + return t / r + }), e.imag = c.imag.map(function (t) { + return t / r + }), e + }; + t.exports = {fft: o, ifft: i} + }, function (t, r, e) { + "use strict"; + + function n(t) { + if (Array.isArray(t)) { + for (var r = 0, e = Array(t.length); r < t.length; r++) e[r] = t[r]; + return e + } + return Array.from(t) + } + + var o = {}, i = {}, a = function (t) { + var r = {}; + r.real = void 0 === t.real ? t.slice() : t.real.slice(); + var e = r.real.length; + return void 0 === i[e] && (i[e] = Array.apply(null, Array(e)).map(Number.prototype.valueOf, 0)), r.imag = i[e].slice(), r + }, u = function (t) { + if (void 0 === o[t]) { + for (var r = (t - 1).toString(2).length, e = "0".repeat(r), i = {}, a = 0; a < t; a++) { + var u = a.toString(2); + u = e.substr(u.length) + u, u = [].concat(n(u)).reverse().join(""), i[a] = parseInt(u, 2) + } + o[t] = i + } + return o[t] + }, c = function (t, r) { + return {real: t.real * r.real - t.imag * r.imag, imag: t.real * r.imag + t.imag * r.real} + }, f = function (t, r) { + return {real: t.real + r.real, imag: t.imag + r.imag} + }, l = function (t, r) { + return {real: t.real - r.real, imag: t.imag - r.imag} + }, s = function (t, r) { + var e = -2 * Math.PI * t / r; + return {real: Math.cos(e), imag: Math.sin(e)} + }, p = function (t) { + return t.imag *= -1, t + }; + t.exports = { + bitReverseArray: u, + multiply: c, + add: f, + subtract: l, + euler: s, + conj: p, + constructComplexArray: a + } + }, function (t, r) { + function e() { + throw new Error("setTimeout has not been defined") + } + + function n() { + throw new Error("clearTimeout has not been defined") + } + + function o(t) { + if (l === setTimeout) return setTimeout(t, 0); + if ((l === e || !l) && setTimeout) return l = setTimeout, setTimeout(t, 0); + try { + return l(t, 0) + } catch (r) { + try { + return l.call(null, t, 0) + } catch (r) { + return l.call(this, t, 0) + } + } + } + + function i(t) { + if (s === clearTimeout) return clearTimeout(t); + if ((s === n || !s) && clearTimeout) return s = clearTimeout, clearTimeout(t); + try { + return s(t) + } catch (r) { + try { + return s.call(null, t) + } catch (r) { + return s.call(this, t) + } + } + } + + function a() { + h && m && (h = !1, m.length ? y = m.concat(y) : b = -1, y.length && u()) + } + + function u() { + if (!h) { + var t = o(a); + h = !0; + for (var r = y.length; r;) { + for (m = y, y = []; ++b < r;) m && m[b].run(); + b = -1, r = y.length + } + m = null, h = !1, i(t) + } + } + + function c(t, r) { + this.fun = t, this.array = r + } + + function f() { + } + + var l, s, p = t.exports = {}; + !function () { + try { + l = "function" == typeof setTimeout ? setTimeout : e + } catch (t) { + l = e + } + try { + s = "function" == typeof clearTimeout ? clearTimeout : n + } catch (t) { + s = n + } + }(); + var m, y = [], h = !1, b = -1; + p.nextTick = function (t) { + var r = new Array(arguments.length - 1); + if (arguments.length > 1) for (var e = 1; e < arguments.length; e++) r[e - 1] = arguments[e]; + y.push(new c(t, r)), 1 !== y.length || h || o(u) + }, c.prototype.run = function () { + this.fun.apply(null, this.array) + }, p.title = "browser", p.browser = !0, p.env = {}, p.argv = [], p.version = "", p.versions = {}, p.on = f, p.addListener = f, p.once = f, p.off = f, p.removeListener = f, p.removeAllListeners = f, p.emit = f, p.prependListener = f, p.prependOnceListener = f, p.listeners = function (t) { + return [] + }, p.binding = function (t) { + throw new Error("process.binding is not supported") + }, p.cwd = function () { + return "/" + }, p.chdir = function (t) { + throw new Error("process.chdir is not supported") + }, p.umask = function () { + return 0 + } + }, function (t, r) { + "function" == typeof Object.create ? t.exports = function (t, r) { + t.super_ = r, t.prototype = Object.create(r.prototype, { + constructor: { + value: t, + enumerable: !1, + writable: !0, + configurable: !0 + } + }) + } : t.exports = function (t, r) { + t.super_ = r; + var e = function () { + }; + e.prototype = r.prototype, t.prototype = new e, t.prototype.constructor = t + } + }, function (t, r) { + t.exports = function (t) { + return t && "object" == typeof t && "function" == typeof t.copy && "function" == typeof t.fill && "function" == typeof t.readUInt8 + } + }, function (t, r, e) { + (function (t, n) { + function o(t, e) { + var n = {seen: [], stylize: a}; + return arguments.length >= 3 && (n.depth = arguments[2]), arguments.length >= 4 && (n.colors = arguments[3]), h(e) ? n.showHidden = e : e && r._extend(n, e), w(n.showHidden) && (n.showHidden = !1), w(n.depth) && (n.depth = 2), w(n.colors) && (n.colors = !1), w(n.customInspect) && (n.customInspect = !0), n.colors && (n.stylize = i), c(n, t, n.depth) + } + + function i(t, r) { + var e = o.styles[r]; + return e ? "[" + o.colors[e][0] + "m" + t + "[" + o.colors[e][1] + "m" : t + } + + function a(t, r) { + return t + } + + function u(t) { + var r = {}; + return t.forEach(function (t, e) { + r[t] = !0 + }), r + } + + function c(t, e, n) { + if (t.customInspect && e && A(e.inspect) && e.inspect !== r.inspect && (!e.constructor || e.constructor.prototype !== e)) { + var o = e.inspect(n, t); + return d(o) || (o = c(t, o, n)), o + } + var i = f(t, e); + if (i) return i; + var a = Object.keys(e), h = u(a); + if (t.showHidden && (a = Object.getOwnPropertyNames(e)), M(e) && (a.indexOf("message") >= 0 || a.indexOf("description") >= 0)) return l(e); + if (0 === a.length) { + if (A(e)) { + var b = e.name ? ": " + e.name : ""; + return t.stylize("[Function" + b + "]", "special") + } + if (x(e)) return t.stylize(RegExp.prototype.toString.call(e), "regexp"); + if (_(e)) return t.stylize(Date.prototype.toString.call(e), "date"); + if (M(e)) return l(e) + } + var g = "", S = !1, v = ["{", "}"]; + if (y(e) && (S = !0, v = ["[", "]"]), A(e)) { + g = " [Function" + (e.name ? ": " + e.name : "") + "]" + } + if (x(e) && (g = " " + RegExp.prototype.toString.call(e)), _(e) && (g = " " + Date.prototype.toUTCString.call(e)), M(e) && (g = " " + l(e)), 0 === a.length && (!S || 0 == e.length)) return v[0] + g + v[1]; + if (n < 0) return x(e) ? t.stylize(RegExp.prototype.toString.call(e), "regexp") : t.stylize("[Object]", "special"); + t.seen.push(e); + var w; + return w = S ? s(t, e, n, h, a) : a.map(function (r) { + return p(t, e, n, h, r, S) + }), t.seen.pop(), m(w, g, v) + } + + function f(t, r) { + if (w(r)) return t.stylize("undefined", "undefined"); + if (d(r)) { + var e = "'" + JSON.stringify(r).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'"; + return t.stylize(e, "string") + } + return S(r) ? t.stylize("" + r, "number") : h(r) ? t.stylize("" + r, "boolean") : b(r) ? t.stylize("null", "null") : void 0 + } + + function l(t) { + return "[" + Error.prototype.toString.call(t) + "]" + } + + function s(t, r, e, n, o) { + for (var i = [], a = 0, u = r.length; a < u; ++a) z(r, String(a)) ? i.push(p(t, r, e, n, String(a), !0)) : i.push(""); + return o.forEach(function (o) { + o.match(/^\d+$/) || i.push(p(t, r, e, n, o, !0)) + }), i + } + + function p(t, r, e, n, o, i) { + var a, u, f; + if (f = Object.getOwnPropertyDescriptor(r, o) || {value: r[o]}, f.get ? u = f.set ? t.stylize("[Getter/Setter]", "special") : t.stylize("[Getter]", "special") : f.set && (u = t.stylize("[Setter]", "special")), z(n, o) || (a = "[" + o + "]"), u || (t.seen.indexOf(f.value) < 0 ? (u = b(e) ? c(t, f.value, null) : c(t, f.value, e - 1), u.indexOf("\n") > -1 && (u = i ? u.split("\n").map(function (t) { + return " " + t + }).join("\n").substr(2) : "\n" + u.split("\n").map(function (t) { + return " " + t + }).join("\n"))) : u = t.stylize("[Circular]", "special")), w(a)) { + if (i && o.match(/^\d+$/)) return u; + a = JSON.stringify("" + o), a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (a = a.substr(1, a.length - 2), a = t.stylize(a, "name")) : (a = a.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), a = t.stylize(a, "string")) + } + return a + ": " + u + } + + function m(t, r, e) { + var n = 0; + return t.reduce(function (t, r) { + return n++, r.indexOf("\n") >= 0 && n++, t + r.replace(/\u001b\[\d\d?m/g, "").length + 1 + }, 0) > 60 ? e[0] + ("" === r ? "" : r + "\n ") + " " + t.join(",\n ") + " " + e[1] : e[0] + r + " " + t.join(", ") + " " + e[1] + } + + function y(t) { + return Array.isArray(t) + } + + function h(t) { + return "boolean" == typeof t + } + + function b(t) { + return null === t + } + + function g(t) { + return null == t + } + + function S(t) { + return "number" == typeof t + } + + function d(t) { + return "string" == typeof t + } + + function v(t) { + return "symbol" == typeof t + } + + function w(t) { + return void 0 === t + } + + function x(t) { + return E(t) && "[object RegExp]" === T(t) + } + + function E(t) { + return "object" == typeof t && null !== t + } + + function _(t) { + return E(t) && "[object Date]" === T(t) + } + + function M(t) { + return E(t) && ("[object Error]" === T(t) || t instanceof Error) + } + + function A(t) { + return "function" == typeof t + } + + function j(t) { + return null === t || "boolean" == typeof t || "number" == typeof t || "string" == typeof t || "symbol" == typeof t || void 0 === t + } + + function T(t) { + return Object.prototype.toString.call(t) + } + + function F(t) { + return t < 10 ? "0" + t.toString(10) : t.toString(10) + } + + function k() { + var t = new Date, r = [F(t.getHours()), F(t.getMinutes()), F(t.getSeconds())].join(":"); + return [t.getDate(), R[t.getMonth()], r].join(" ") + } + + function z(t, r) { + return Object.prototype.hasOwnProperty.call(t, r) + } + + var O = /%[sdj%]/g; + r.format = function (t) { + if (!d(t)) { + for (var r = [], e = 0; e < arguments.length; e++) r.push(o(arguments[e])); + return r.join(" ") + } + for (var e = 1, n = arguments, i = n.length, a = String(t).replace(O, function (t) { + if ("%%" === t) return "%"; + if (e >= i) return t; + switch (t) { + case"%s": + return String(n[e++]); + case"%d": + return Number(n[e++]); + case"%j": + try { + return JSON.stringify(n[e++]) + } catch (t) { + return "[Circular]" + } + default: + return t + } + }), u = n[e]; e < i; u = n[++e]) b(u) || !E(u) ? a += " " + u : a += " " + o(u); + return a + }, r.deprecate = function (e, o) { + function i() { + if (!a) { + if (n.throwDeprecation) throw new Error(o); + n.traceDeprecation ? console.trace(o) : console.error(o), a = !0 + } + return e.apply(this, arguments) + } + + if (w(t.process)) return function () { + return r.deprecate(e, o).apply(this, arguments) + }; + if (!0 === n.noDeprecation) return e; + var a = !1; + return i + }; + var B, D = {}; + r.debuglog = function (t) { + if (w(B) && (B = n.env.NODE_DEBUG || ""), t = t.toUpperCase(), !D[t]) if (new RegExp("\\b" + t + "\\b", "i").test(B)) { + var e = n.pid; + D[t] = function () { + var n = r.format.apply(r, arguments); + console.error("%s %d: %s", t, e, n) + } + } else D[t] = function () { + }; + return D[t] + }, r.inspect = o, o.colors = { + bold: [1, 22], + italic: [3, 23], + underline: [4, 24], + inverse: [7, 27], + white: [37, 39], + grey: [90, 39], + black: [30, 39], + blue: [34, 39], + cyan: [36, 39], + green: [32, 39], + magenta: [35, 39], + red: [31, 39], + yellow: [33, 39] + }, o.styles = { + special: "cyan", + number: "yellow", + boolean: "yellow", + undefined: "grey", + null: "bold", + string: "green", + date: "magenta", + regexp: "red" + }, r.isArray = y, r.isBoolean = h, r.isNull = b, r.isNullOrUndefined = g, r.isNumber = S, r.isString = d, r.isSymbol = v, r.isUndefined = w, r.isRegExp = x, r.isObject = E, r.isDate = _, r.isError = M, r.isFunction = A, r.isPrimitive = j, r.isBuffer = e(32); + var R = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; + r.log = function () { + console.log("%s - %s", k(), r.format.apply(r, arguments)) + }, r.inherits = e(31), r._extend = function (t, r) { + if (!r || !E(r)) return t; + for (var e = Object.keys(r), n = e.length; n--;) t[e[n]] = r[e[n]]; + return t + } + }).call(r, e(5), e(30)) + }]) + }); + + }, {}], + 5: [function (require, module, exports) { + 'use strict' + + module.exports = mouseListen + + var mouse = require('mouse-event') + + function mouseListen(element, callback) { + if (!callback) { + callback = element + element = window + } + + var buttonState = 0 + var x = 0 + var y = 0 + var mods = { + shift: false, + alt: false, + control: false, + meta: false + } + var attached = false + + function updateMods(ev) { + var changed = false + if ('altKey' in ev) { + changed = changed || ev.altKey !== mods.alt + mods.alt = !!ev.altKey + } + if ('shiftKey' in ev) { + changed = changed || ev.shiftKey !== mods.shift + mods.shift = !!ev.shiftKey + } + if ('ctrlKey' in ev) { + changed = changed || ev.ctrlKey !== mods.control + mods.control = !!ev.ctrlKey + } + if ('metaKey' in ev) { + changed = changed || ev.metaKey !== mods.meta + mods.meta = !!ev.metaKey + } + return changed + } + + function handleEvent(nextButtons, ev) { + var nextX = mouse.x(ev) + var nextY = mouse.y(ev) + if ('buttons' in ev) { + nextButtons = ev.buttons | 0 + } + if (nextButtons !== buttonState || + nextX !== x || + nextY !== y || + updateMods(ev)) { + buttonState = nextButtons | 0 + x = nextX || 0 + y = nextY || 0 + callback && callback(buttonState, x, y, mods) + } + } + + function clearState(ev) { + handleEvent(0, ev) + } + + function handleBlur() { + if (buttonState || + x || + y || + mods.shift || + mods.alt || + mods.meta || + mods.control) { + x = y = 0 + buttonState = 0 + mods.shift = mods.alt = mods.control = mods.meta = false + callback && callback(0, 0, 0, mods) + } + } + + function handleMods(ev) { + if (updateMods(ev)) { + callback && callback(buttonState, x, y, mods) + } + } + + function handleMouseMove(ev) { + if (mouse.buttons(ev) === 0) { + handleEvent(0, ev) + } else { + handleEvent(buttonState, ev) + } + } + + function handleMouseDown(ev) { + handleEvent(buttonState | mouse.buttons(ev), ev) + } + + function handleMouseUp(ev) { + handleEvent(buttonState & ~mouse.buttons(ev), ev) + } + + function attachListeners() { + if (attached) { + return + } + attached = true + + element.addEventListener('mousemove', handleMouseMove) + + element.addEventListener('mousedown', handleMouseDown) + + element.addEventListener('mouseup', handleMouseUp) + + element.addEventListener('mouseleave', clearState) + element.addEventListener('mouseenter', clearState) + element.addEventListener('mouseout', clearState) + element.addEventListener('mouseover', clearState) + + element.addEventListener('blur', handleBlur) + + element.addEventListener('keyup', handleMods) + element.addEventListener('keydown', handleMods) + element.addEventListener('keypress', handleMods) + + if (element !== window) { + window.addEventListener('blur', handleBlur) + + window.addEventListener('keyup', handleMods) + window.addEventListener('keydown', handleMods) + window.addEventListener('keypress', handleMods) + } + } + + function detachListeners() { + if (!attached) { + return + } + attached = false + + element.removeEventListener('mousemove', handleMouseMove) + + element.removeEventListener('mousedown', handleMouseDown) + + element.removeEventListener('mouseup', handleMouseUp) + + element.removeEventListener('mouseleave', clearState) + element.removeEventListener('mouseenter', clearState) + element.removeEventListener('mouseout', clearState) + element.removeEventListener('mouseover', clearState) + + element.removeEventListener('blur', handleBlur) + + element.removeEventListener('keyup', handleMods) + element.removeEventListener('keydown', handleMods) + element.removeEventListener('keypress', handleMods) + + if (element !== window) { + window.removeEventListener('blur', handleBlur) + + window.removeEventListener('keyup', handleMods) + window.removeEventListener('keydown', handleMods) + window.removeEventListener('keypress', handleMods) + } + } + + // Attach listeners + attachListeners() + + var result = { + element: element + } + + Object.defineProperties(result, { + enabled: { + get: function () { + return attached + }, + set: function (f) { + if (f) { + attachListeners() + } else { + detachListeners() + } + }, + enumerable: true + }, + buttons: { + get: function () { + return buttonState + }, + enumerable: true + }, + x: { + get: function () { + return x + }, + enumerable: true + }, + y: { + get: function () { + return y + }, + enumerable: true + }, + mods: { + get: function () { + return mods + }, + enumerable: true + } + }) + + return result + } + + }, {"mouse-event": 6}], + 6: [function (require, module, exports) { + 'use strict' + + function mouseButtons(ev) { + if (typeof ev === 'object') { + if ('buttons' in ev) { + return ev.buttons + } else if ('which' in ev) { + var b = ev.which + if (b === 2) { + return 4 + } else if (b === 3) { + return 2 + } else if (b > 0) { + return 1 << (b - 1) + } + } else if ('button' in ev) { + var b = ev.button + if (b === 1) { + return 4 + } else if (b === 2) { + return 2 + } else if (b >= 0) { + return 1 << b + } + } + } + return 0 + } + + exports.buttons = mouseButtons + + function mouseElement(ev) { + return ev.target || ev.srcElement || window + } + + exports.element = mouseElement + + function mouseRelativeX(ev) { + if (typeof ev === 'object') { + if ('offsetX' in ev) { + return ev.offsetX + } + var target = mouseElement(ev) + var bounds = target.getBoundingClientRect() + return ev.clientX - bounds.left + } + return 0 + } + + exports.x = mouseRelativeX + + function mouseRelativeY(ev) { + if (typeof ev === 'object') { + if ('offsetY' in ev) { + return ev.offsetY + } + var target = mouseElement(ev) + var bounds = target.getBoundingClientRect() + return ev.clientY - bounds.top + } + return 0 + } + + exports.y = mouseRelativeY + + }, {}], + 7: [function (require, module, exports) { + (function (process) { +// Generated by CoffeeScript 1.12.2 + (function () { + var getNanoSeconds, hrtime, loadTime, moduleLoadTime, nodeLoadTime, upTime; + + if ((typeof performance !== "undefined" && performance !== null) && performance.now) { + module.exports = function () { + return performance.now(); + }; + } else if ((typeof process !== "undefined" && process !== null) && process.hrtime) { + module.exports = function () { + return (getNanoSeconds() - nodeLoadTime) / 1e6; + }; + hrtime = process.hrtime; + getNanoSeconds = function () { + var hr; + hr = hrtime(); + return hr[0] * 1e9 + hr[1]; + }; + moduleLoadTime = getNanoSeconds(); + upTime = process.uptime() * 1e9; + nodeLoadTime = moduleLoadTime - upTime; + } else if (Date.now) { + module.exports = function () { + return Date.now() - loadTime; + }; + loadTime = Date.now(); + } else { + module.exports = function () { + return new Date().getTime() - loadTime; + }; + loadTime = new Date().getTime(); + } + + }).call(this); + + + }).call(this, require('_process')) + }, {"_process": 44}], + 8: [function (require, module, exports) { + var inherits = require('inherits') + var EventEmitter = require('events').EventEmitter + var now = require('right-now') + var raf = require('raf') + + module.exports = Engine + + function Engine(fn) { + if (!(this instanceof Engine)) + return new Engine(fn) + this.running = false + this.last = now() + this._frame = 0 + this._tick = this.tick.bind(this) + + if (fn) + this.on('tick', fn) + } + + inherits(Engine, EventEmitter) + + Engine.prototype.start = function () { + if (this.running) + return + this.running = true + this.last = now() + this._frame = raf(this._tick) + return this + } + + Engine.prototype.stop = function () { + this.running = false + if (this._frame !== 0) + raf.cancel(this._frame) + this._frame = 0 + return this + } + + Engine.prototype.tick = function () { + this._frame = raf(this._tick) + var time = now() + var dt = time - this.last + this.emit('tick', dt) + this.last = time + } + }, {"events": 43, "inherits": 3, "raf": 9, "right-now": 11}], + 9: [function (require, module, exports) { + (function (global) { + var now = require('performance-now') + , root = typeof window === 'undefined' ? global : window + , vendors = ['moz', 'webkit'] + , suffix = 'AnimationFrame' + , raf = root['request' + suffix] + , caf = root['cancel' + suffix] || root['cancelRequest' + suffix] + + for (var i = 0; !raf && i < vendors.length; i++) { + raf = root[vendors[i] + 'Request' + suffix] + caf = root[vendors[i] + 'Cancel' + suffix] + || root[vendors[i] + 'CancelRequest' + suffix] + } + +// Some versions of FF have rAF but not cAF + if (!raf || !caf) { + var last = 0 + , id = 0 + , queue = [] + , frameDuration = 1000 / 60 + + raf = function (callback) { + if (queue.length === 0) { + var _now = now() + , next = Math.max(0, frameDuration - (_now - last)) + last = next + _now + setTimeout(function () { + var cp = queue.slice(0) + // Clear queue here to prevent + // callbacks from appending listeners + // to the current frame's queue + queue.length = 0 + for (var i = 0; i < cp.length; i++) { + if (!cp[i].cancelled) { + try { + cp[i].callback(last) + } catch (e) { + setTimeout(function () { + throw e + }, 0) + } + } + } + }, Math.round(next)) + } + queue.push({ + handle: ++id, + callback: callback, + cancelled: false + }) + return id + } + + caf = function (handle) { + for (var i = 0; i < queue.length; i++) { + if (queue[i].handle === handle) { + queue[i].cancelled = true + } + } + } + } + + module.exports = function (fn) { + // Wrap in a new function to prevent + // `cancel` potentially being assigned + // to the native rAF function + return raf.call(root, fn) + } + module.exports.cancel = function () { + caf.apply(root, arguments) + } + module.exports.polyfill = function (object) { + if (!object) { + object = root; + } + object.requestAnimationFrame = raf + object.cancelAnimationFrame = caf + } + + }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) + }, {"performance-now": 7}], + 10: [function (require, module, exports) { + (function (aa, ia) { + "object" === typeof exports && "undefined" !== typeof module ? module.exports = ia() : "function" === typeof define && define.amd ? define(ia) : aa.createREGL = ia() + })(this, function () { + function aa(a, b) { + this.id = Ab++; + this.type = a; + this.data = b + } + + function ia(a) { + if (0 === a.length) return []; + var b = a.charAt(0), c = a.charAt(a.length - 1); + if (1 < a.length && b === c && ('"' === b || "'" === b)) return ['"' + a.substr(1, a.length - 2).replace(/\\/g, "\\\\").replace(/"/g, '\\"') + '"']; + if (b = /\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(a)) return ia(a.substr(0, + b.index)).concat(ia(b[1])).concat(ia(a.substr(b.index + b[0].length))); + b = a.split("."); + if (1 === b.length) return ['"' + a.replace(/\\/g, "\\\\").replace(/"/g, '\\"') + '"']; + a = []; + for (c = 0; c < b.length; ++c) a = a.concat(ia(b[c])); + return a + } + + function Za(a) { + return "[" + ia(a).join("][") + "]" + } + + function Bb() { + var a = {"": 0}, b = [""]; + return { + id: function (c) { + var e = a[c]; + if (e) return e; + e = a[c] = b.length; + b.push(c); + return e + }, str: function (a) { + return b[a] + } + } + } + + function Cb(a, b, c) { + function e() { + var b = window.innerWidth, e = window.innerHeight; + a !== document.body && + (e = a.getBoundingClientRect(), b = e.right - e.left, e = e.bottom - e.top); + g.width = c * b; + g.height = c * e; + E(g.style, {width: b + "px", height: e + "px"}) + } + + var g = document.createElement("canvas"); + E(g.style, {border: 0, margin: 0, padding: 0, top: 0, left: 0}); + a.appendChild(g); + a === document.body && (g.style.position = "absolute", E(a.style, {margin: 0, padding: 0})); + window.addEventListener("resize", e, !1); + e(); + return { + canvas: g, onDestroy: function () { + window.removeEventListener("resize", e); + a.removeChild(g) + } + } + } + + function Db(a, b) { + function c(c) { + try { + return a.getContext(c, + b) + } catch (g) { + return null + } + } + + return c("webgl") || c("experimental-webgl") || c("webgl-experimental") + } + + function $a(a) { + return "string" === typeof a ? a.split() : a + } + + function ab(a) { + return "string" === typeof a ? document.querySelector(a) : a + } + + function Eb(a) { + var b = a || {}, c, e, g, d; + a = {}; + var n = [], f = [], r = "undefined" === typeof window ? 1 : window.devicePixelRatio, q = !1, + t = function (a) { + }, m = function () { + }; + "string" === typeof b ? c = document.querySelector(b) : "object" === typeof b && ("string" === typeof b.nodeName && "function" === typeof b.appendChild && "function" === + typeof b.getBoundingClientRect ? c = b : "function" === typeof b.drawArrays || "function" === typeof b.drawElements ? (d = b, g = d.canvas) : ("gl" in b ? d = b.gl : "canvas" in b ? g = ab(b.canvas) : "container" in b && (e = ab(b.container)), "attributes" in b && (a = b.attributes), "extensions" in b && (n = $a(b.extensions)), "optionalExtensions" in b && (f = $a(b.optionalExtensions)), "onDone" in b && (t = b.onDone), "profile" in b && (q = !!b.profile), "pixelRatio" in b && (r = +b.pixelRatio))); + c && ("canvas" === c.nodeName.toLowerCase() ? g = c : e = c); + if (!d) { + if (!g) { + c = Cb(e || document.body, + t, r); + if (!c) return null; + g = c.canvas; + m = c.onDestroy + } + d = Db(g, a) + } + return d ? { + gl: d, + canvas: g, + container: e, + extensions: n, + optionalExtensions: f, + pixelRatio: r, + profile: q, + onDone: t, + onDestroy: m + } : (m(), t("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"), null) + } + + function Fb(a, b) { + function c(b) { + b = b.toLowerCase(); + var c; + try { + c = e[b] = a.getExtension(b) + } catch (g) { + } + return !!c + } + + for (var e = {}, g = 0; g < b.extensions.length; ++g) { + var d = b.extensions[g]; + if (!c(d)) return b.onDestroy(), b.onDone('"' + d + '" extension is not supported by the current WebGL context, try upgrading your system or a different browser'), + null + } + b.optionalExtensions.forEach(c); + return { + extensions: e, restore: function () { + Object.keys(e).forEach(function (a) { + if (e[a] && !c(a)) throw Error("(regl): error restoring extension " + a); + }) + } + } + } + + function J(a, b) { + for (var c = Array(a), e = 0; e < a; ++e) c[e] = b(e); + return c + } + + function bb(a) { + var b, c; + b = (65535 < a) << 4; + a >>>= b; + c = (255 < a) << 3; + a >>>= c; + b |= c; + c = (15 < a) << 2; + a >>>= c; + b |= c; + c = (3 < a) << 1; + return b | c | a >>> c >> 1 + } + + function cb() { + function a(a) { + a:{ + for (var b = 16; 268435456 >= b; b *= 16) if (a <= b) { + a = b; + break a + } + a = 0 + } + b = c[bb(a) >> 2]; + return 0 < b.length ? b.pop() : + new ArrayBuffer(a) + } + + function b(a) { + c[bb(a.byteLength) >> 2].push(a) + } + + var c = J(8, function () { + return [] + }); + return { + alloc: a, free: b, allocType: function (b, c) { + var d = null; + switch (b) { + case 5120: + d = new Int8Array(a(c), 0, c); + break; + case 5121: + d = new Uint8Array(a(c), 0, c); + break; + case 5122: + d = new Int16Array(a(2 * c), 0, c); + break; + case 5123: + d = new Uint16Array(a(2 * c), 0, c); + break; + case 5124: + d = new Int32Array(a(4 * c), 0, c); + break; + case 5125: + d = new Uint32Array(a(4 * c), 0, c); + break; + case 5126: + d = new Float32Array(a(4 * c), 0, c); + break; + default: + return null + } + return d.length !== + c ? d.subarray(0, c) : d + }, freeType: function (a) { + b(a.buffer) + } + } + } + + function ma(a) { + return !!a && "object" === typeof a && Array.isArray(a.shape) && Array.isArray(a.stride) && "number" === typeof a.offset && a.shape.length === a.stride.length && (Array.isArray(a.data) || M(a.data)) + } + + function db(a, b, c, e, g, d) { + for (var n = 0; n < b; ++n) for (var f = a[n], r = 0; r < c; ++r) for (var q = f[r], t = 0; t < e; ++t) g[d++] = q[t] + } + + function eb(a, b, c, e, g) { + for (var d = 1, n = c + 1; n < b.length; ++n) d *= b[n]; + var f = b[c]; + if (4 === b.length - c) { + var r = b[c + 1], q = b[c + 2]; + b = b[c + 3]; + for (n = 0; n < f; ++n) db(a[n], + r, q, b, e, g), g += d + } else for (n = 0; n < f; ++n) eb(a[n], b, c + 1, e, g), g += d + } + + function Ha(a) { + return Ia[Object.prototype.toString.call(a)] | 0 + } + + function fb(a, b) { + for (var c = 0; c < b.length; ++c) a[c] = b[c] + } + + function gb(a, b, c, e, g, d, n) { + for (var f = 0, r = 0; r < c; ++r) for (var q = 0; q < e; ++q) a[f++] = b[g * r + d * q + n] + } + + function Gb(a, b, c, e) { + function g(b) { + this.id = r++; + this.buffer = a.createBuffer(); + this.type = b; + this.usage = 35044; + this.byteLength = 0; + this.dimension = 1; + this.dtype = 5121; + this.persistentData = null; + c.profile && (this.stats = {size: 0}) + } + + function d(b, c, k) { + b.byteLength = + c.byteLength; + a.bufferData(b.type, c, k) + } + + function n(a, b, c, h, l, e) { + a.usage = c; + if (Array.isArray(b)) { + if (a.dtype = h || 5126, 0 < b.length) if (Array.isArray(b[0])) { + l = hb(b); + for (var v = h = 1; v < l.length; ++v) h *= l[v]; + a.dimension = h; + b = Qa(b, l, a.dtype); + d(a, b, c); + e ? a.persistentData = b : x.freeType(b) + } else "number" === typeof b[0] ? (a.dimension = l, l = x.allocType(a.dtype, b.length), fb(l, b), d(a, l, c), e ? a.persistentData = l : x.freeType(l)) : M(b[0]) && (a.dimension = b[0].length, a.dtype = h || Ha(b[0]) || 5126, b = Qa(b, [b.length, b[0].length], a.dtype), d(a, b, c), + e ? a.persistentData = b : x.freeType(b)) + } else if (M(b)) a.dtype = h || Ha(b), a.dimension = l, d(a, b, c), e && (a.persistentData = new Uint8Array(new Uint8Array(b.buffer))); else if (ma(b)) { + l = b.shape; + var g = b.stride, v = b.offset, f = 0, q = 0, r = 0, t = 0; + 1 === l.length ? (f = l[0], q = 1, r = g[0], t = 0) : 2 === l.length && (f = l[0], q = l[1], r = g[0], t = g[1]); + a.dtype = h || Ha(b.data) || 5126; + a.dimension = q; + l = x.allocType(a.dtype, f * q); + gb(l, b.data, f, q, r, t, v); + d(a, l, c); + e ? a.persistentData = l : x.freeType(l) + } + } + + function f(c) { + b.bufferCount--; + for (var d = 0; d < e.state.length; ++d) { + var k = + e.state[d]; + k.buffer === c && (a.disableVertexAttribArray(d), k.buffer = null) + } + a.deleteBuffer(c.buffer); + c.buffer = null; + delete q[c.id] + } + + var r = 0, q = {}; + g.prototype.bind = function () { + a.bindBuffer(this.type, this.buffer) + }; + g.prototype.destroy = function () { + f(this) + }; + var t = []; + c.profile && (b.getTotalBufferSize = function () { + var a = 0; + Object.keys(q).forEach(function (b) { + a += q[b].stats.size + }); + return a + }); + return { + create: function (m, e, d, h) { + function l(b) { + var m = 35044, e = null, d = 0, k = 0, g = 1; + Array.isArray(b) || M(b) || ma(b) ? e = b : "number" === typeof b ? + d = b | 0 : b && ("data" in b && (e = b.data), "usage" in b && (m = jb[b.usage]), "type" in b && (k = Ra[b.type]), "dimension" in b && (g = b.dimension | 0), "length" in b && (d = b.length | 0)); + u.bind(); + e ? n(u, e, m, k, g, h) : (d && a.bufferData(u.type, d, m), u.dtype = k || 5121, u.usage = m, u.dimension = g, u.byteLength = d); + c.profile && (u.stats.size = u.byteLength * ja[u.dtype]); + return l + } + + b.bufferCount++; + var u = new g(e); + q[u.id] = u; + d || l(m); + l._reglType = "buffer"; + l._buffer = u; + l.subdata = function (b, c) { + var m = (c || 0) | 0, e; + u.bind(); + if (M(b)) a.bufferSubData(u.type, m, b); else if (Array.isArray(b)) { + if (0 < + b.length) if ("number" === typeof b[0]) { + var d = x.allocType(u.dtype, b.length); + fb(d, b); + a.bufferSubData(u.type, m, d); + x.freeType(d) + } else if (Array.isArray(b[0]) || M(b[0])) e = hb(b), d = Qa(b, e, u.dtype), a.bufferSubData(u.type, m, d), x.freeType(d) + } else if (ma(b)) { + e = b.shape; + var h = b.stride, k = d = 0, g = 0, F = 0; + 1 === e.length ? (d = e[0], k = 1, g = h[0], F = 0) : 2 === e.length && (d = e[0], k = e[1], g = h[0], F = h[1]); + e = Array.isArray(b.data) ? u.dtype : Ha(b.data); + e = x.allocType(e, d * k); + gb(e, b.data, d, k, g, F, b.offset); + a.bufferSubData(u.type, m, e); + x.freeType(e) + } + return l + }; + c.profile && (l.stats = u.stats); + l.destroy = function () { + f(u) + }; + return l + }, createStream: function (a, b) { + var c = t.pop(); + c || (c = new g(a)); + c.bind(); + n(c, b, 35040, 0, 1, !1); + return c + }, destroyStream: function (a) { + t.push(a) + }, clear: function () { + S(q).forEach(f); + t.forEach(f) + }, getBuffer: function (a) { + return a && a._buffer instanceof g ? a._buffer : null + }, restore: function () { + S(q).forEach(function (b) { + b.buffer = a.createBuffer(); + a.bindBuffer(b.type, b.buffer); + a.bufferData(b.type, b.persistentData || b.byteLength, b.usage) + }) + }, _initBuffer: n + } + } + + function Hb(a, + b, c, e) { + function g(a) { + this.id = r++; + f[this.id] = this; + this.buffer = a; + this.primType = 4; + this.type = this.vertCount = 0 + } + + function d(e, d, g, h, l, u, v) { + e.buffer.bind(); + if (d) { + var f = v; + v || M(d) && (!ma(d) || M(d.data)) || (f = b.oes_element_index_uint ? 5125 : 5123); + c._initBuffer(e.buffer, d, g, f, 3) + } else a.bufferData(34963, u, g), e.buffer.dtype = f || 5121, e.buffer.usage = g, e.buffer.dimension = 3, e.buffer.byteLength = u; + f = v; + if (!v) { + switch (e.buffer.dtype) { + case 5121: + case 5120: + f = 5121; + break; + case 5123: + case 5122: + f = 5123; + break; + case 5125: + case 5124: + f = 5125 + } + e.buffer.dtype = + f + } + e.type = f; + d = l; + 0 > d && (d = e.buffer.byteLength, 5123 === f ? d >>= 1 : 5125 === f && (d >>= 2)); + e.vertCount = d; + d = h; + 0 > h && (d = 4, h = e.buffer.dimension, 1 === h && (d = 0), 2 === h && (d = 1), 3 === h && (d = 4)); + e.primType = d + } + + function n(a) { + e.elementsCount--; + delete f[a.id]; + a.buffer.destroy(); + a.buffer = null + } + + var f = {}, r = 0, q = {uint8: 5121, uint16: 5123}; + b.oes_element_index_uint && (q.uint32 = 5125); + g.prototype.bind = function () { + this.buffer.bind() + }; + var t = []; + return { + create: function (a, b) { + function k(a) { + if (a) if ("number" === typeof a) h(a), l.primType = 4, l.vertCount = a | 0, + l.type = 5121; else { + var b = null, c = 35044, e = -1, g = -1, f = 0, m = 0; + if (Array.isArray(a) || M(a) || ma(a)) b = a; else if ("data" in a && (b = a.data), "usage" in a && (c = jb[a.usage]), "primitive" in a && (e = Sa[a.primitive]), "count" in a && (g = a.count | 0), "type" in a && (m = q[a.type]), "length" in a) f = a.length | 0; else if (f = g, 5123 === m || 5122 === m) f *= 2; else if (5125 === m || 5124 === m) f *= 4; + d(l, b, c, e, g, f, m) + } else h(), l.primType = 4, l.vertCount = 0, l.type = 5121; + return k + } + + var h = c.create(null, 34963, !0), l = new g(h._buffer); + e.elementsCount++; + k(a); + k._reglType = "elements"; + k._elements = l; + k.subdata = function (a, b) { + h.subdata(a, b); + return k + }; + k.destroy = function () { + n(l) + }; + return k + }, createStream: function (a) { + var b = t.pop(); + b || (b = new g(c.create(null, 34963, !0, !1)._buffer)); + d(b, a, 35040, -1, -1, 0, 0); + return b + }, destroyStream: function (a) { + t.push(a) + }, getElements: function (a) { + return "function" === typeof a && a._elements instanceof g ? a._elements : null + }, clear: function () { + S(f).forEach(n) + } + } + } + + function kb(a) { + for (var b = x.allocType(5123, a.length), c = 0; c < a.length; ++c) if (isNaN(a[c])) b[c] = 65535; else if (Infinity === + a[c]) b[c] = 31744; else if (-Infinity === a[c]) b[c] = 64512; else { + lb[0] = a[c]; + var e = Ib[0], g = e >>> 31 << 15, d = (e << 1 >>> 24) - 127, e = e >> 13 & 1023; + b[c] = -24 > d ? g : -14 > d ? g + (e + 1024 >> -14 - d) : 15 < d ? g + 31744 : g + (d + 15 << 10) + e + } + return b + } + + function pa(a) { + return Array.isArray(a) || M(a) + } + + function Ea(a) { + return "[object " + a + "]" + } + + function mb(a) { + return Array.isArray(a) && (0 === a.length || "number" === typeof a[0]) + } + + function nb(a) { + return Array.isArray(a) && 0 !== a.length && pa(a[0]) ? !0 : !1 + } + + function na(a) { + return Object.prototype.toString.call(a) + } + + function Ta(a) { + if (!a) return !1; + var b = na(a); + return 0 <= Jb.indexOf(b) ? !0 : mb(a) || nb(a) || ma(a) + } + + function ob(a, b) { + 36193 === a.type ? (a.data = kb(b), x.freeType(b)) : a.data = b + } + + function Ja(a, b, c, e, g, d) { + a = "undefined" !== typeof y[a] ? y[a] : L[a] * qa[b]; + d && (a *= 6); + if (g) { + for (e = 0; 1 <= c;) e += a * c * c, c /= 2; + return e + } + return a * c * e + } + + function Kb(a, b, c, e, g, d, n) { + function f() { + this.format = this.internalformat = 6408; + this.type = 5121; + this.flipY = this.premultiplyAlpha = this.compressed = !1; + this.unpackAlignment = 1; + this.colorSpace = 37444; + this.channels = this.height = this.width = 0 + } + + function r(a, + b) { + a.internalformat = b.internalformat; + a.format = b.format; + a.type = b.type; + a.compressed = b.compressed; + a.premultiplyAlpha = b.premultiplyAlpha; + a.flipY = b.flipY; + a.unpackAlignment = b.unpackAlignment; + a.colorSpace = b.colorSpace; + a.width = b.width; + a.height = b.height; + a.channels = b.channels + } + + function q(a, b) { + if ("object" === typeof b && b) { + "premultiplyAlpha" in b && (a.premultiplyAlpha = b.premultiplyAlpha); + "flipY" in b && (a.flipY = b.flipY); + "alignment" in b && (a.unpackAlignment = b.alignment); + "colorSpace" in b && (a.colorSpace = wa[b.colorSpace]); + "type" in b && (a.type = G[b.type]); + var c = a.width, e = a.height, d = a.channels, h = !1; + "shape" in b ? (c = b.shape[0], e = b.shape[1], 3 === b.shape.length && (d = b.shape[2], h = !0)) : ("radius" in b && (c = e = b.radius), "width" in b && (c = b.width), "height" in b && (e = b.height), "channels" in b && (d = b.channels, h = !0)); + a.width = c | 0; + a.height = e | 0; + a.channels = d | 0; + c = !1; + "format" in b && (c = b.format, e = a.internalformat = U[c], a.format = Lb[e], c in G && !("type" in b) && (a.type = G[c]), c in W && (a.compressed = !0), c = !0); + !h && c ? a.channels = L[a.format] : h && !c && a.channels !== + La[a.format] && (a.format = a.internalformat = La[a.channels]) + } + } + + function t(b) { + a.pixelStorei(37440, b.flipY); + a.pixelStorei(37441, b.premultiplyAlpha); + a.pixelStorei(37443, b.colorSpace); + a.pixelStorei(3317, b.unpackAlignment) + } + + function m() { + f.call(this); + this.yOffset = this.xOffset = 0; + this.data = null; + this.needsFree = !1; + this.element = null; + this.needsCopy = !1 + } + + function C(a, b) { + var c = null; + Ta(b) ? c = b : b && (q(a, b), "x" in b && (a.xOffset = b.x | 0), "y" in b && (a.yOffset = b.y | 0), Ta(b.data) && (c = b.data)); + if (b.copy) { + var e = g.viewportWidth, d = g.viewportHeight; + a.width = a.width || e - a.xOffset; + a.height = a.height || d - a.yOffset; + a.needsCopy = !0 + } else if (!c) a.width = a.width || 1, a.height = a.height || 1, a.channels = a.channels || 4; else if (M(c)) a.channels = a.channels || 4, a.data = c, "type" in b || 5121 !== a.type || (a.type = Ia[Object.prototype.toString.call(c)] | 0); else if (mb(c)) { + a.channels = a.channels || 4; + e = c; + d = e.length; + switch (a.type) { + case 5121: + case 5123: + case 5125: + case 5126: + d = x.allocType(a.type, d); + d.set(e); + a.data = d; + break; + case 36193: + a.data = kb(e) + } + a.alignment = 1; + a.needsFree = !0 + } else if (ma(c)) { + e = + c.data; + Array.isArray(e) || 5121 !== a.type || (a.type = Ia[Object.prototype.toString.call(e)] | 0); + var d = c.shape, h = c.stride, f, l, p, w; + 3 === d.length ? (p = d[2], w = h[2]) : w = p = 1; + f = d[0]; + l = d[1]; + d = h[0]; + h = h[1]; + a.alignment = 1; + a.width = f; + a.height = l; + a.channels = p; + a.format = a.internalformat = La[p]; + a.needsFree = !0; + f = w; + c = c.offset; + p = a.width; + w = a.height; + l = a.channels; + for (var z = x.allocType(36193 === a.type ? 5126 : a.type, p * w * l), I = 0, fa = 0; fa < w; ++fa) for (var ga = 0; ga < p; ++ga) for (var xa = 0; xa < l; ++xa) z[I++] = e[d * ga + h * fa + f * xa + c]; + ob(a, z) + } else if (na(c) === + Ua || na(c) === pb) na(c) === Ua ? a.element = c : a.element = c.canvas, a.width = a.element.width, a.height = a.element.height, a.channels = 4; else if (na(c) === qb) a.element = c, a.width = c.width, a.height = c.height, a.channels = 4; else if (na(c) === rb) a.element = c, a.width = c.naturalWidth, a.height = c.naturalHeight, a.channels = 4; else if (na(c) === sb) a.element = c, a.width = c.videoWidth, a.height = c.videoHeight, a.channels = 4; else if (nb(c)) { + e = a.width || c[0].length; + d = a.height || c.length; + h = a.channels; + h = pa(c[0][0]) ? h || c[0][0].length : h || 1; + f = Ma.shape(c); + p = 1; + for (w = 0; w < f.length; ++w) p *= f[w]; + p = x.allocType(36193 === a.type ? 5126 : a.type, p); + Ma.flatten(c, f, "", p); + ob(a, p); + a.alignment = 1; + a.width = e; + a.height = d; + a.channels = h; + a.format = a.internalformat = La[h]; + a.needsFree = !0 + } + } + + function k(b, c, d, h, f) { + var g = b.element, l = b.data, k = b.internalformat, p = b.format, w = b.type, z = b.width, + I = b.height; + t(b); + g ? a.texSubImage2D(c, f, d, h, p, w, g) : b.compressed ? a.compressedTexSubImage2D(c, f, d, h, k, z, I, l) : b.needsCopy ? (e(), a.copyTexSubImage2D(c, f, d, h, b.xOffset, b.yOffset, z, I)) : a.texSubImage2D(c, f, d, h, z, + I, p, w, l) + } + + function h() { + return P.pop() || new m + } + + function l(a) { + a.needsFree && x.freeType(a.data); + m.call(a); + P.push(a) + } + + function u() { + f.call(this); + this.genMipmaps = !1; + this.mipmapHint = 4352; + this.mipmask = 0; + this.images = Array(16) + } + + function v(a, b, c) { + var d = a.images[0] = h(); + a.mipmask = 1; + d.width = a.width = b; + d.height = a.height = c; + d.channels = a.channels = 4 + } + + function N(a, b) { + var c = null; + if (Ta(b)) c = a.images[0] = h(), r(c, a), C(c, b), a.mipmask = 1; else if (q(a, b), Array.isArray(b.mipmap)) for (var d = b.mipmap, e = 0; e < d.length; ++e) c = a.images[e] = h(), + r(c, a), c.width >>= e, c.height >>= e, C(c, d[e]), a.mipmask |= 1 << e; else c = a.images[0] = h(), r(c, a), C(c, b), a.mipmask = 1; + r(a, a.images[0]) + } + + function B(b, c) { + for (var d = b.images, h = 0; h < d.length && d[h]; ++h) { + var f = d[h], g = c, l = h, k = f.element, p = f.data, w = f.internalformat, z = f.format, + I = f.type, fa = f.width, ga = f.height, xa = f.channels; + t(f); + k ? a.texImage2D(g, l, z, z, I, k) : f.compressed ? a.compressedTexImage2D(g, l, w, fa, ga, 0, p) : f.needsCopy ? (e(), a.copyTexImage2D(g, l, z, f.xOffset, f.yOffset, fa, ga, 0)) : ((f = !p) && (p = x.zero.allocType(I, fa * ga * xa)), a.texImage2D(g, + l, z, fa, ga, 0, z, I, p), f && p && x.zero.freeType(p)) + } + } + + function D() { + var a = tb.pop() || new u; + f.call(a); + for (var b = a.mipmask = 0; 16 > b; ++b) a.images[b] = null; + return a + } + + function ib(a) { + for (var b = a.images, c = 0; c < b.length; ++c) b[c] && l(b[c]), b[c] = null; + tb.push(a) + } + + function y() { + this.magFilter = this.minFilter = 9728; + this.wrapT = this.wrapS = 33071; + this.anisotropic = 1; + this.genMipmaps = !1; + this.mipmapHint = 4352 + } + + function O(a, b) { + "min" in b && (a.minFilter = Va[b.min], 0 <= Mb.indexOf(a.minFilter) && !("faces" in b) && (a.genMipmaps = !0)); + "mag" in b && (a.magFilter = + V[b.mag]); + var c = a.wrapS, d = a.wrapT; + if ("wrap" in b) { + var e = b.wrap; + "string" === typeof e ? c = d = K[e] : Array.isArray(e) && (c = K[e[0]], d = K[e[1]]) + } else "wrapS" in b && (c = K[b.wrapS]), "wrapT" in b && (d = K[b.wrapT]); + a.wrapS = c; + a.wrapT = d; + "anisotropic" in b && (a.anisotropic = b.anisotropic); + if ("mipmap" in b) { + c = !1; + switch (typeof b.mipmap) { + case "string": + a.mipmapHint = ua[b.mipmap]; + c = a.genMipmaps = !0; + break; + case "boolean": + c = a.genMipmaps = b.mipmap; + break; + case "object": + a.genMipmaps = !1, c = !0 + } + !c || "min" in b || (a.minFilter = 9984) + } + } + + function R(c, d) { + a.texParameteri(d, + 10241, c.minFilter); + a.texParameteri(d, 10240, c.magFilter); + a.texParameteri(d, 10242, c.wrapS); + a.texParameteri(d, 10243, c.wrapT); + b.ext_texture_filter_anisotropic && a.texParameteri(d, 34046, c.anisotropic); + c.genMipmaps && (a.hint(33170, c.mipmapHint), a.generateMipmap(d)) + } + + function F(b) { + f.call(this); + this.mipmask = 0; + this.internalformat = 6408; + this.id = ya++; + this.refCount = 1; + this.target = b; + this.texture = a.createTexture(); + this.unit = -1; + this.bindCount = 0; + this.texInfo = new y; + n.profile && (this.stats = {size: 0}) + } + + function T(b) { + a.activeTexture(33984); + a.bindTexture(b.target, b.texture) + } + + function Aa() { + var b = ha[0]; + b ? a.bindTexture(b.target, b.texture) : a.bindTexture(3553, null) + } + + function A(b) { + var c = b.texture, e = b.unit, h = b.target; + 0 <= e && (a.activeTexture(33984 + e), a.bindTexture(h, null), ha[e] = null); + a.deleteTexture(c); + b.texture = null; + b.params = null; + b.pixels = null; + b.refCount = 0; + delete X[b.id]; + d.textureCount-- + } + + var ua = {"don't care": 4352, "dont care": 4352, nice: 4354, fast: 4353}, + K = {repeat: 10497, clamp: 33071, mirror: 33648}, V = {nearest: 9728, linear: 9729}, Va = E({ + mipmap: 9987, "nearest mipmap nearest": 9984, + "linear mipmap nearest": 9985, "nearest mipmap linear": 9986, "linear mipmap linear": 9987 + }, V), wa = {none: 0, browser: 37444}, + G = {uint8: 5121, rgba4: 32819, rgb565: 33635, "rgb5 a1": 32820}, U = { + alpha: 6406, + luminance: 6409, + "luminance alpha": 6410, + rgb: 6407, + rgba: 6408, + rgba4: 32854, + "rgb5 a1": 32855, + rgb565: 36194 + }, W = {}; + b.ext_srgb && (U.srgb = 35904, U.srgba = 35906); + b.oes_texture_float && (G.float32 = G["float"] = 5126); + b.oes_texture_half_float && (G.float16 = G["half float"] = 36193); + b.webgl_depth_texture && (E(U, {depth: 6402, "depth stencil": 34041}), + E(G, {uint16: 5123, uint32: 5125, "depth stencil": 34042})); + b.webgl_compressed_texture_s3tc && E(W, { + "rgb s3tc dxt1": 33776, + "rgba s3tc dxt1": 33777, + "rgba s3tc dxt3": 33778, + "rgba s3tc dxt5": 33779 + }); + b.webgl_compressed_texture_atc && E(W, { + "rgb atc": 35986, + "rgba atc explicit alpha": 35987, + "rgba atc interpolated alpha": 34798 + }); + b.webgl_compressed_texture_pvrtc && E(W, { + "rgb pvrtc 4bppv1": 35840, + "rgb pvrtc 2bppv1": 35841, + "rgba pvrtc 4bppv1": 35842, + "rgba pvrtc 2bppv1": 35843 + }); + b.webgl_compressed_texture_etc1 && (W["rgb etc1"] = 36196); + var Nb = Array.prototype.slice.call(a.getParameter(34467)); + Object.keys(W).forEach(function (a) { + var b = W[a]; + 0 <= Nb.indexOf(b) && (U[a] = b) + }); + var ca = Object.keys(U); + c.textureFormats = ca; + var J = []; + Object.keys(U).forEach(function (a) { + J[U[a]] = a + }); + var da = []; + Object.keys(G).forEach(function (a) { + da[G[a]] = a + }); + var oa = []; + Object.keys(V).forEach(function (a) { + oa[V[a]] = a + }); + var za = []; + Object.keys(Va).forEach(function (a) { + za[Va[a]] = a + }); + var ka = []; + Object.keys(K).forEach(function (a) { + ka[K[a]] = a + }); + var Lb = ca.reduce(function (a, b) { + var c = + U[b]; + 6409 === c || 6406 === c || 6409 === c || 6410 === c || 6402 === c || 34041 === c ? a[c] = c : 32855 === c || 0 <= b.indexOf("rgba") ? a[c] = 6408 : a[c] = 6407; + return a + }, {}), P = [], tb = [], ya = 0, X = {}, ea = c.maxTextureUnits, ha = Array(ea).map(function () { + return null + }); + E(F.prototype, { + bind: function () { + this.bindCount += 1; + var b = this.unit; + if (0 > b) { + for (var c = 0; c < ea; ++c) { + var e = ha[c]; + if (e) { + if (0 < e.bindCount) continue; + e.unit = -1 + } + ha[c] = this; + b = c; + break + } + n.profile && d.maxTextureUnits < b + 1 && (d.maxTextureUnits = b + 1); + this.unit = b; + a.activeTexture(33984 + b); + a.bindTexture(this.target, + this.texture) + } + return b + }, unbind: function () { + --this.bindCount + }, decRef: function () { + 0 >= --this.refCount && A(this) + } + }); + n.profile && (d.getTotalTextureSize = function () { + var a = 0; + Object.keys(X).forEach(function (b) { + a += X[b].stats.size + }); + return a + }); + return { + create2D: function (b, c) { + function e(a, b) { + var c = f.texInfo; + y.call(c); + var d = D(); + "number" === typeof a ? "number" === typeof b ? v(d, a | 0, b | 0) : v(d, a | 0, a | 0) : a ? (O(c, a), N(d, a)) : v(d, 1, 1); + c.genMipmaps && (d.mipmask = (d.width << 1) - 1); + f.mipmask = d.mipmask; + r(f, d); + f.internalformat = d.internalformat; + e.width = d.width; + e.height = d.height; + T(f); + B(d, 3553); + R(c, 3553); + Aa(); + ib(d); + n.profile && (f.stats.size = Ja(f.internalformat, f.type, d.width, d.height, c.genMipmaps, !1)); + e.format = J[f.internalformat]; + e.type = da[f.type]; + e.mag = oa[c.magFilter]; + e.min = za[c.minFilter]; + e.wrapS = ka[c.wrapS]; + e.wrapT = ka[c.wrapT]; + return e + } + + var f = new F(3553); + X[f.id] = f; + d.textureCount++; + e(b, c); + e.subimage = function (a, b, c, d) { + b |= 0; + c |= 0; + d |= 0; + var p = h(); + r(p, f); + p.width = 0; + p.height = 0; + C(p, a); + p.width = p.width || (f.width >> d) - b; + p.height = p.height || (f.height >> d) - + c; + T(f); + k(p, 3553, b, c, d); + Aa(); + l(p); + return e + }; + e.resize = function (b, c) { + var d = b | 0, h = c | 0 || d; + if (d === f.width && h === f.height) return e; + e.width = f.width = d; + e.height = f.height = h; + T(f); + for (var p, w = f.channels, z = f.type, I = 0; f.mipmask >> I; ++I) { + var fa = d >> I, ga = h >> I; + if (!fa || !ga) break; + p = x.zero.allocType(z, fa * ga * w); + a.texImage2D(3553, I, f.format, fa, ga, 0, f.format, f.type, p); + p && x.zero.freeType(p) + } + Aa(); + n.profile && (f.stats.size = Ja(f.internalformat, f.type, d, h, !1, !1)); + return e + }; + e._reglType = "texture2d"; + e._texture = f; + n.profile && (e.stats = + f.stats); + e.destroy = function () { + f.decRef() + }; + return e + }, createCube: function (b, c, e, f, g, ua) { + function A(a, b, c, d, e, f) { + var H, Y = m.texInfo; + y.call(Y); + for (H = 0; 6 > H; ++H) p[H] = D(); + if ("number" === typeof a || !a) for (a = a | 0 || 1, H = 0; 6 > H; ++H) v(p[H], a, a); else if ("object" === typeof a) if (b) N(p[0], a), N(p[1], b), N(p[2], c), N(p[3], d), N(p[4], e), N(p[5], f); else if (O(Y, a), q(m, a), "faces" in a) for (a = a.faces, H = 0; 6 > H; ++H) r(p[H], m), N(p[H], a[H]); else for (H = 0; 6 > H; ++H) N(p[H], a); + r(m, p[0]); + m.mipmask = Y.genMipmaps ? (p[0].width << 1) - 1 : p[0].mipmask; + m.internalformat = + p[0].internalformat; + A.width = p[0].width; + A.height = p[0].height; + T(m); + for (H = 0; 6 > H; ++H) B(p[H], 34069 + H); + R(Y, 34067); + Aa(); + n.profile && (m.stats.size = Ja(m.internalformat, m.type, A.width, A.height, Y.genMipmaps, !0)); + A.format = J[m.internalformat]; + A.type = da[m.type]; + A.mag = oa[Y.magFilter]; + A.min = za[Y.minFilter]; + A.wrapS = ka[Y.wrapS]; + A.wrapT = ka[Y.wrapT]; + for (H = 0; 6 > H; ++H) ib(p[H]); + return A + } + + var m = new F(34067); + X[m.id] = m; + d.cubeCount++; + var p = Array(6); + A(b, c, e, f, g, ua); + A.subimage = function (a, b, c, p, d) { + c |= 0; + p |= 0; + d |= 0; + var e = h(); + r(e, m); + e.width = 0; + e.height = 0; + C(e, b); + e.width = e.width || (m.width >> d) - c; + e.height = e.height || (m.height >> d) - p; + T(m); + k(e, 34069 + a, c, p, d); + Aa(); + l(e); + return A + }; + A.resize = function (b) { + b |= 0; + if (b !== m.width) { + A.width = m.width = b; + A.height = m.height = b; + T(m); + for (var c = 0; 6 > c; ++c) for (var p = 0; m.mipmask >> p; ++p) a.texImage2D(34069 + c, p, m.format, b >> p, b >> p, 0, m.format, m.type, null); + Aa(); + n.profile && (m.stats.size = Ja(m.internalformat, m.type, A.width, A.height, !1, !0)); + return A + } + }; + A._reglType = "textureCube"; + A._texture = m; + n.profile && (A.stats = m.stats); + A.destroy = + function () { + m.decRef() + }; + return A + }, clear: function () { + for (var b = 0; b < ea; ++b) a.activeTexture(33984 + b), a.bindTexture(3553, null), ha[b] = null; + S(X).forEach(A); + d.cubeCount = 0; + d.textureCount = 0 + }, getTexture: function (a) { + return null + }, restore: function () { + for (var b = 0; b < ea; ++b) { + var c = ha[b]; + c && (c.bindCount = 0, c.unit = -1, ha[b] = null) + } + S(X).forEach(function (b) { + b.texture = a.createTexture(); + a.bindTexture(b.target, b.texture); + for (var c = 0; 32 > c; ++c) if (0 !== (b.mipmask & 1 << c)) if (3553 === b.target) a.texImage2D(3553, c, b.internalformat, b.width >> + c, b.height >> c, 0, b.internalformat, b.type, null); else for (var d = 0; 6 > d; ++d) a.texImage2D(34069 + d, c, b.internalformat, b.width >> c, b.height >> c, 0, b.internalformat, b.type, null); + R(b.texInfo, b.target) + }) + } + } + } + + function Ob(a, b, c, e, g, d) { + function n(a, b, c) { + this.target = a; + this.texture = b; + this.renderbuffer = c; + var d = a = 0; + b ? (a = b.width, d = b.height) : c && (a = c.width, d = c.height); + this.width = a; + this.height = d + } + + function f(a) { + a && (a.texture && a.texture._texture.decRef(), a.renderbuffer && a.renderbuffer._renderbuffer.decRef()) + } + + function r(a, b, c) { + a && + (a.texture ? a.texture._texture.refCount += 1 : a.renderbuffer._renderbuffer.refCount += 1) + } + + function q(b, c) { + c && (c.texture ? a.framebufferTexture2D(36160, b, c.target, c.texture._texture.texture, 0) : a.framebufferRenderbuffer(36160, b, 36161, c.renderbuffer._renderbuffer.renderbuffer)) + } + + function t(a) { + var b = 3553, c = null, d = null, e = a; + "object" === typeof a && (e = a.data, "target" in a && (b = a.target | 0)); + a = e._reglType; + "texture2d" === a ? c = e : "textureCube" === a ? c = e : "renderbuffer" === a && (d = e, b = 36161); + return new n(b, c, d) + } + + function m(a, b, c, d, + f) { + if (c) return a = e.create2D({ + width: a, + height: b, + format: d, + type: f + }), a._texture.refCount = 0, new n(3553, a, null); + a = g.create({width: a, height: b, format: d}); + a._renderbuffer.refCount = 0; + return new n(36161, null, a) + } + + function C(a) { + return a && (a.texture || a.renderbuffer) + } + + function k(a, b, c) { + a && (a.texture ? a.texture.resize(b, c) : a.renderbuffer && a.renderbuffer.resize(b, c), a.width = b, a.height = c) + } + + function h() { + this.id = O++; + R[this.id] = this; + this.framebuffer = a.createFramebuffer(); + this.height = this.width = 0; + this.colorAttachments = []; + this.depthStencilAttachment = + this.stencilAttachment = this.depthAttachment = null + } + + function l(a) { + a.colorAttachments.forEach(f); + f(a.depthAttachment); + f(a.stencilAttachment); + f(a.depthStencilAttachment) + } + + function u(b) { + a.deleteFramebuffer(b.framebuffer); + b.framebuffer = null; + d.framebufferCount--; + delete R[b.id] + } + + function v(b) { + var d; + a.bindFramebuffer(36160, b.framebuffer); + var e = b.colorAttachments; + for (d = 0; d < e.length; ++d) q(36064 + d, e[d]); + for (d = e.length; d < c.maxColorAttachments; ++d) a.framebufferTexture2D(36160, 36064 + d, 3553, null, 0); + a.framebufferTexture2D(36160, + 33306, 3553, null, 0); + a.framebufferTexture2D(36160, 36096, 3553, null, 0); + a.framebufferTexture2D(36160, 36128, 3553, null, 0); + q(36096, b.depthAttachment); + q(36128, b.stencilAttachment); + q(33306, b.depthStencilAttachment); + a.checkFramebufferStatus(36160); + a.isContextLost(); + a.bindFramebuffer(36160, B.next ? B.next.framebuffer : null); + B.cur = B.next; + a.getError() + } + + function N(a, b) { + function c(a, b) { + var d, f = 0, h = 0, g = !0, k = !0; + d = null; + var q = !0, u = "rgba", n = "uint8", N = 1, da = null, oa = null, B = null, ka = !1; + if ("number" === typeof a) f = a | 0, h = b | 0 || f; else if (a) { + "shape" in + a ? (h = a.shape, f = h[0], h = h[1]) : ("radius" in a && (f = h = a.radius), "width" in a && (f = a.width), "height" in a && (h = a.height)); + if ("color" in a || "colors" in a) d = a.color || a.colors, Array.isArray(d); + if (!d) { + "colorCount" in a && (N = a.colorCount | 0); + "colorTexture" in a && (q = !!a.colorTexture, u = "rgba4"); + if ("colorType" in a && (n = a.colorType, !q)) if ("half float" === n || "float16" === n) u = "rgba16f"; else if ("float" === n || "float32" === n) u = "rgba32f"; + "colorFormat" in a && (u = a.colorFormat, 0 <= x.indexOf(u) ? q = !0 : 0 <= D.indexOf(u) && (q = !1)) + } + if ("depthTexture" in + a || "depthStencilTexture" in a) ka = !(!a.depthTexture && !a.depthStencilTexture); + "depth" in a && ("boolean" === typeof a.depth ? g = a.depth : (da = a.depth, k = !1)); + "stencil" in a && ("boolean" === typeof a.stencil ? k = a.stencil : (oa = a.stencil, g = !1)); + "depthStencil" in a && ("boolean" === typeof a.depthStencil ? g = k = a.depthStencil : (B = a.depthStencil, k = g = !1)) + } else f = h = 1; + var F = null, y = null, E = null, T = null; + if (Array.isArray(d)) F = d.map(t); else if (d) F = [t(d)]; else for (F = Array(N), d = 0; d < N; ++d) F[d] = m(f, h, q, u, n); + f = f || F[0].width; + h = h || F[0].height; + da ? + y = t(da) : g && !k && (y = m(f, h, ka, "depth", "uint32")); + oa ? E = t(oa) : k && !g && (E = m(f, h, !1, "stencil", "uint8")); + B ? T = t(B) : !da && !oa && k && g && (T = m(f, h, ka, "depth stencil", "depth stencil")); + g = null; + for (d = 0; d < F.length; ++d) r(F[d], f, h), F[d] && F[d].texture && (k = Wa[F[d].texture._texture.format] * Na[F[d].texture._texture.type], null === g && (g = k)); + r(y, f, h); + r(E, f, h); + r(T, f, h); + l(e); + e.width = f; + e.height = h; + e.colorAttachments = F; + e.depthAttachment = y; + e.stencilAttachment = E; + e.depthStencilAttachment = T; + c.color = F.map(C); + c.depth = C(y); + c.stencil = C(E); + c.depthStencil = C(T); + c.width = e.width; + c.height = e.height; + v(e); + return c + } + + var e = new h; + d.framebufferCount++; + c(a, b); + return E(c, { + resize: function (a, b) { + var d = Math.max(a | 0, 1), f = Math.max(b | 0 || d, 1); + if (d === e.width && f === e.height) return c; + for (var h = e.colorAttachments, g = 0; g < h.length; ++g) k(h[g], d, f); + k(e.depthAttachment, d, f); + k(e.stencilAttachment, d, f); + k(e.depthStencilAttachment, d, f); + e.width = c.width = d; + e.height = c.height = f; + v(e); + return c + }, _reglType: "framebuffer", _framebuffer: e, destroy: function () { + u(e); + l(e) + }, use: function (a) { + B.setFBO({framebuffer: c}, + a) + } + }) + } + + var B = {cur: null, next: null, dirty: !1, setFBO: null}, x = ["rgba"], + D = ["rgba4", "rgb565", "rgb5 a1"]; + b.ext_srgb && D.push("srgba"); + b.ext_color_buffer_half_float && D.push("rgba16f", "rgb16f"); + b.webgl_color_buffer_float && D.push("rgba32f"); + var y = ["uint8"]; + b.oes_texture_half_float && y.push("half float", "float16"); + b.oes_texture_float && y.push("float", "float32"); + var O = 0, R = {}; + return E(B, { + getFramebuffer: function (a) { + return "function" === typeof a && "framebuffer" === a._reglType && (a = a._framebuffer, a instanceof h) ? a : null + }, create: N, + createCube: function (a) { + function b(a) { + var d, f = {color: null}, h = 0, g = null; + d = "rgba"; + var l = "uint8", m = 1; + if ("number" === typeof a) h = a | 0; else if (a) { + "shape" in a ? h = a.shape[0] : ("radius" in a && (h = a.radius | 0), "width" in a ? h = a.width | 0 : "height" in a && (h = a.height | 0)); + if ("color" in a || "colors" in a) g = a.color || a.colors, Array.isArray(g); + g || ("colorCount" in a && (m = a.colorCount | 0), "colorType" in a && (l = a.colorType), "colorFormat" in a && (d = a.colorFormat)); + "depth" in a && (f.depth = a.depth); + "stencil" in a && (f.stencil = a.stencil); + "depthStencil" in + a && (f.depthStencil = a.depthStencil) + } else h = 1; + if (g) if (Array.isArray(g)) for (a = [], d = 0; d < g.length; ++d) a[d] = g[d]; else a = [g]; else for (a = Array(m), g = { + radius: h, + format: d, + type: l + }, d = 0; d < m; ++d) a[d] = e.createCube(g); + f.color = Array(a.length); + for (d = 0; d < a.length; ++d) m = a[d], h = h || m.width, f.color[d] = { + target: 34069, + data: a[d] + }; + for (d = 0; 6 > d; ++d) { + for (m = 0; m < a.length; ++m) f.color[m].target = 34069 + d; + 0 < d && (f.depth = c[0].depth, f.stencil = c[0].stencil, f.depthStencil = c[0].depthStencil); + if (c[d]) c[d](f); else c[d] = N(f) + } + return E(b, { + width: h, + height: h, color: a + }) + } + + var c = Array(6); + b(a); + return E(b, { + faces: c, resize: function (a) { + var d = a | 0; + if (d === b.width) return b; + var e = b.color; + for (a = 0; a < e.length; ++a) e[a].resize(d); + for (a = 0; 6 > a; ++a) c[a].resize(d); + b.width = b.height = d; + return b + }, _reglType: "framebufferCube", destroy: function () { + c.forEach(function (a) { + a.destroy() + }) + } + }) + }, clear: function () { + S(R).forEach(u) + }, restore: function () { + B.cur = null; + B.next = null; + B.dirty = !0; + S(R).forEach(function (b) { + b.framebuffer = a.createFramebuffer(); + v(b) + }) + } + }) + } + + function ub() { + this.w = this.z = this.y = + this.x = this.state = 0; + this.buffer = null; + this.size = 0; + this.normalized = !1; + this.type = 5126; + this.divisor = this.stride = this.offset = 0 + } + + function Pb(a, b, c, e) { + a = c.maxAttributes; + b = Array(a); + for (c = 0; c < a; ++c) b[c] = new ub; + return {Record: ub, scope: {}, state: b} + } + + function Qb(a, b, c, e) { + function g(a, b, c, d) { + this.name = a; + this.id = b; + this.location = c; + this.info = d + } + + function d(a, b) { + for (var c = 0; c < a.length; ++c) if (a[c].id === b.id) { + a[c].location = b.location; + return + } + a.push(b) + } + + function n(c, d, e) { + e = 35632 === c ? q : t; + var f = e[d]; + if (!f) { + var g = b.str(d), f = a.createShader(c); + a.shaderSource(f, g); + a.compileShader(f); + e[d] = f + } + return f + } + + function f(a, b) { + this.id = k++; + this.fragId = a; + this.vertId = b; + this.program = null; + this.uniforms = []; + this.attributes = []; + e.profile && (this.stats = {uniformsCount: 0, attributesCount: 0}) + } + + function r(c, f) { + var m, k; + m = n(35632, c.fragId); + k = n(35633, c.vertId); + var q = c.program = a.createProgram(); + a.attachShader(q, m); + a.attachShader(q, k); + a.linkProgram(q); + var r = a.getProgramParameter(q, 35718); + e.profile && (c.stats.uniformsCount = r); + var t = c.uniforms; + for (m = 0; m < r; ++m) if (k = a.getActiveUniform(q, + m)) if (1 < k.size) for (var C = 0; C < k.size; ++C) { + var y = k.name.replace("[0]", "[" + C + "]"); + d(t, new g(y, b.id(y), a.getUniformLocation(q, y), k)) + } else d(t, new g(k.name, b.id(k.name), a.getUniformLocation(q, k.name), k)); + r = a.getProgramParameter(q, 35721); + e.profile && (c.stats.attributesCount = r); + t = c.attributes; + for (m = 0; m < r; ++m) (k = a.getActiveAttrib(q, m)) && d(t, new g(k.name, b.id(k.name), a.getAttribLocation(q, k.name), k)) + } + + var q = {}, t = {}, m = {}, C = [], k = 0; + e.profile && (c.getMaxUniformsCount = function () { + var a = 0; + C.forEach(function (b) { + b.stats.uniformsCount > + a && (a = b.stats.uniformsCount) + }); + return a + }, c.getMaxAttributesCount = function () { + var a = 0; + C.forEach(function (b) { + b.stats.attributesCount > a && (a = b.stats.attributesCount) + }); + return a + }); + return { + clear: function () { + var b = a.deleteShader.bind(a); + S(q).forEach(b); + q = {}; + S(t).forEach(b); + t = {}; + C.forEach(function (b) { + a.deleteProgram(b.program) + }); + C.length = 0; + m = {}; + c.shaderCount = 0 + }, program: function (a, b, d) { + var e = m[b]; + e || (e = m[b] = {}); + var g = e[a]; + g || (g = new f(b, a), c.shaderCount++, r(g, d), e[a] = g, C.push(g)); + return g + }, restore: function () { + q = + {}; + t = {}; + for (var a = 0; a < C.length; ++a) r(C[a]) + }, shader: n, frag: -1, vert: -1 + } + } + + function Rb(a, b, c, e, g, d, n) { + function f(d) { + var f; + f = null === b.next ? 5121 : b.next.colorAttachments[0].texture._texture.type; + var g = 0, r = 0, k = e.framebufferWidth, h = e.framebufferHeight, l = null; + M(d) ? l = d : d && (g = d.x | 0, r = d.y | 0, k = (d.width || e.framebufferWidth - g) | 0, h = (d.height || e.framebufferHeight - r) | 0, l = d.data || null); + c(); + d = k * h * 4; + l || (5121 === f ? l = new Uint8Array(d) : 5126 === f && (l = l || new Float32Array(d))); + a.pixelStorei(3333, 4); + a.readPixels(g, r, k, h, 6408, f, + l); + return l + } + + function r(a) { + var c; + b.setFBO({framebuffer: a.framebuffer}, function () { + c = f(a) + }); + return c + } + + return function (a) { + return a && "framebuffer" in a ? r(a) : f(a) + } + } + + function Ba(a) { + return Array.prototype.slice.call(a) + } + + function Ca(a) { + return Ba(a).join("") + } + + function Sb() { + function a() { + var a = [], b = []; + return E(function () { + a.push.apply(a, Ba(arguments)) + }, { + def: function () { + var d = "v" + c++; + b.push(d); + 0 < arguments.length && (a.push(d, "="), a.push.apply(a, Ba(arguments)), a.push(";")); + return d + }, toString: function () { + return Ca([0 < b.length ? + "var " + b + ";" : "", Ca(a)]) + } + }) + } + + function b() { + function b(a, e) { + d(a, e, "=", c.def(a, e), ";") + } + + var c = a(), d = a(), e = c.toString, g = d.toString; + return E(function () { + c.apply(c, Ba(arguments)) + }, { + def: c.def, entry: c, exit: d, save: b, set: function (a, d, e) { + b(a, d); + c(a, d, "=", e, ";") + }, toString: function () { + return e() + g() + } + }) + } + + var c = 0, e = [], g = [], d = a(), n = {}; + return { + global: d, link: function (a) { + for (var b = 0; b < g.length; ++b) if (g[b] === a) return e[b]; + b = "g" + c++; + e.push(b); + g.push(a); + return b + }, block: a, proc: function (a, c) { + function d() { + var a = "a" + e.length; + e.push(a); + return a + } + + var e = []; + c = c || 0; + for (var g = 0; g < c; ++g) d(); + var g = b(), C = g.toString; + return n[a] = E(g, { + arg: d, toString: function () { + return Ca(["function(", e.join(), "){", C(), "}"]) + } + }) + }, scope: b, cond: function () { + var a = Ca(arguments), c = b(), d = b(), e = c.toString, g = d.toString; + return E(c, { + then: function () { + c.apply(c, Ba(arguments)); + return this + }, "else": function () { + d.apply(d, Ba(arguments)); + return this + }, toString: function () { + var b = g(); + b && (b = "else{" + b + "}"); + return Ca(["if(", a, "){", e(), "}", b]) + } + }) + }, compile: function () { + var a = ['"use strict";', + d, "return {"]; + Object.keys(n).forEach(function (b) { + a.push('"', b, '":', n[b].toString(), ",") + }); + a.push("}"); + var b = Ca(a).replace(/;/g, ";\n").replace(/}/g, "}\n").replace(/{/g, "{\n"); + return Function.apply(null, e.concat(b)).apply(null, g) + } + } + } + + function Oa(a) { + return Array.isArray(a) || M(a) || ma(a) + } + + function vb(a) { + return a.sort(function (a, c) { + return "viewport" === a ? -1 : "viewport" === c ? 1 : a < c ? -1 : 1 + }) + } + + function Z(a, b, c, e) { + this.thisDep = a; + this.contextDep = b; + this.propDep = c; + this.append = e + } + + function va(a) { + return a && !(a.thisDep || a.contextDep || + a.propDep) + } + + function D(a) { + return new Z(!1, !1, !1, a) + } + + function P(a, b) { + var c = a.type; + return 0 === c ? (c = a.data.length, new Z(!0, 1 <= c, 2 <= c, b)) : 4 === c ? (c = a.data, new Z(c.thisDep, c.contextDep, c.propDep, b)) : new Z(3 === c, 2 === c, 1 === c, b) + } + + function Tb(a, b, c, e, g, d, n, f, r, q, t, m, C, k, h) { + function l(a) { + return a.replace(".", "_") + } + + function u(a, b, c) { + var d = l(a); + Ka.push(a); + Fa[d] = ra[d] = !!c; + sa[d] = b + } + + function v(a, b, c) { + var d = l(a); + Ka.push(a); + Array.isArray(c) ? (ra[d] = c.slice(), Fa[d] = c.slice()) : ra[d] = Fa[d] = c; + ta[d] = b + } + + function N() { + var a = Sb(), + c = a.link, d = a.global; + a.id = qa++; + a.batchId = "0"; + var e = c(na), f = a.shared = {props: "a0"}; + Object.keys(na).forEach(function (a) { + f[a] = d.def(e, ".", a) + }); + var g = a.next = {}, xa = a.current = {}; + Object.keys(ta).forEach(function (a) { + Array.isArray(ra[a]) && (g[a] = d.def(f.next, ".", a), xa[a] = d.def(f.current, ".", a)) + }); + var H = a.constants = {}; + Object.keys(aa).forEach(function (a) { + H[a] = d.def(JSON.stringify(aa[a])) + }); + a.invoke = function (b, d) { + switch (d.type) { + case 0: + var e = ["this", f.context, f.props, a.batchId]; + return b.def(c(d.data), ".call(", e.slice(0, + Math.max(d.data.length + 1, 4)), ")"); + case 1: + return b.def(f.props, d.data); + case 2: + return b.def(f.context, d.data); + case 3: + return b.def("this", d.data); + case 4: + return d.data.append(a, b), d.data.ref + } + }; + a.attribCache = {}; + var Y = {}; + a.scopeAttrib = function (a) { + a = b.id(a); + if (a in Y) return Y[a]; + var d = q.scope[a]; + d || (d = q.scope[a] = new ya); + return Y[a] = c(d) + }; + return a + } + + function B(a) { + var b = a["static"]; + a = a.dynamic; + var c; + if ("profile" in b) { + var d = !!b.profile; + c = D(function (a, b) { + return d + }); + c.enable = d + } else if ("profile" in a) { + var e = a.profile; + c = P(e, function (a, b) { + return a.invoke(b, e) + }) + } + return c + } + + function y(a, b) { + var c = a["static"], d = a.dynamic; + if ("framebuffer" in c) { + var e = c.framebuffer; + return e ? (e = f.getFramebuffer(e), D(function (a, b) { + var c = a.link(e), d = a.shared; + b.set(d.framebuffer, ".next", c); + d = d.context; + b.set(d, ".framebufferWidth", c + ".width"); + b.set(d, ".framebufferHeight", c + ".height"); + return c + })) : D(function (a, b) { + var c = a.shared; + b.set(c.framebuffer, ".next", "null"); + c = c.context; + b.set(c, ".framebufferWidth", c + ".drawingBufferWidth"); + b.set(c, ".framebufferHeight", + c + ".drawingBufferHeight"); + return "null" + }) + } + if ("framebuffer" in d) { + var g = d.framebuffer; + return P(g, function (a, b) { + var c = a.invoke(b, g), d = a.shared, e = d.framebuffer, + c = b.def(e, ".getFramebuffer(", c, ")"); + b.set(e, ".next", c); + d = d.context; + b.set(d, ".framebufferWidth", c + "?" + c + ".width:" + d + ".drawingBufferWidth"); + b.set(d, ".framebufferHeight", c + "?" + c + ".height:" + d + ".drawingBufferHeight"); + return c + }) + } + return null + } + + function x(a, b, c) { + function d(a) { + if (a in e) { + var c = e[a]; + a = !0; + var p = c.x | 0, ba = c.y | 0, g, h; + "width" in c ? g = c.width | 0 : a = !1; + "height" in c ? h = c.height | 0 : a = !1; + return new Z(!a && b && b.thisDep, !a && b && b.contextDep, !a && b && b.propDep, function (a, b) { + var d = a.shared.context, e = g; + "width" in c || (e = b.def(d, ".", "framebufferWidth", "-", p)); + var f = h; + "height" in c || (f = b.def(d, ".", "framebufferHeight", "-", ba)); + return [p, ba, e, f] + }) + } + if (a in f) { + var z = f[a]; + a = P(z, function (a, b) { + var c = a.invoke(b, z), d = a.shared.context, e = b.def(c, ".x|0"), + p = b.def(c, ".y|0"), + Y = b.def('"width" in ', c, "?", c, ".width|0:", "(", d, ".", "framebufferWidth", "-", e, ")"), + c = b.def('"height" in ', + c, "?", c, ".height|0:", "(", d, ".", "framebufferHeight", "-", p, ")"); + return [e, p, Y, c] + }); + b && (a.thisDep = a.thisDep || b.thisDep, a.contextDep = a.contextDep || b.contextDep, a.propDep = a.propDep || b.propDep); + return a + } + return b ? new Z(b.thisDep, b.contextDep, b.propDep, function (a, b) { + var c = a.shared.context; + return [0, 0, b.def(c, ".", "framebufferWidth"), b.def(c, ".", "framebufferHeight")] + }) : null + } + + var e = a["static"], f = a.dynamic; + if (a = d("viewport")) { + var g = a; + a = new Z(a.thisDep, a.contextDep, a.propDep, function (a, b) { + var c = g.append(a, b), d = a.shared.context; + b.set(d, ".viewportWidth", c[2]); + b.set(d, ".viewportHeight", c[3]); + return c + }) + } + return {viewport: a, scissor_box: d("scissor.box")} + } + + function E(a) { + function c(a) { + if (a in d) { + var p = b.id(d[a]); + a = D(function () { + return p + }); + a.id = p; + return a + } + if (a in e) { + var f = e[a]; + return P(f, function (a, b) { + var c = a.invoke(b, f); + return b.def(a.shared.strings, ".id(", c, ")") + }) + } + return null + } + + var d = a["static"], e = a.dynamic, f = c("frag"), g = c("vert"), h = null; + va(f) && va(g) ? (h = t.program(g.id, f.id), a = D(function (a, b) { + return a.link(h) + })) : a = new Z(f && f.thisDep || + g && g.thisDep, f && f.contextDep || g && g.contextDep, f && f.propDep || g && g.propDep, function (a, b) { + var c = a.shared.shader, d; + d = f ? f.append(a, b) : b.def(c, ".", "frag"); + var e; + e = g ? g.append(a, b) : b.def(c, ".", "vert"); + return b.def(c + ".program(" + e + "," + d + ")") + }); + return {frag: f, vert: g, progVar: a, program: h} + } + + function O(a, b) { + function c(a, b) { + if (a in e) { + var d = e[a] | 0; + return D(function (a, c) { + b && (a.OFFSET = d); + return d + }) + } + if (a in f) { + var p = f[a]; + return P(p, function (a, c) { + var d = a.invoke(c, p); + b && (a.OFFSET = d); + return d + }) + } + return b && g ? D(function (a, + b) { + a.OFFSET = "0"; + return 0 + }) : null + } + + var e = a["static"], f = a.dynamic, g = function () { + if ("elements" in e) { + var a = e.elements; + Oa(a) ? a = d.getElements(d.create(a, !0)) : a && (a = d.getElements(a)); + var b = D(function (b, c) { + if (a) { + var d = b.link(a); + return b.ELEMENTS = d + } + return b.ELEMENTS = null + }); + b.value = a; + return b + } + if ("elements" in f) { + var c = f.elements; + return P(c, function (a, b) { + var d = a.shared, e = d.isBufferArgs, d = d.elements, p = a.invoke(b, c), + f = b.def("null"), e = b.def(e, "(", p, ")"), + p = a.cond(e).then(f, "=", d, ".createStream(", p, ");")["else"](f, "=", + d, ".getElements(", p, ");"); + b.entry(p); + b.exit(a.cond(e).then(d, ".destroyStream(", f, ");")); + return a.ELEMENTS = f + }) + } + return null + }(), h = c("offset", !0); + return { + elements: g, primitive: function () { + if ("primitive" in e) { + var a = e.primitive; + return D(function (b, c) { + return Sa[a] + }) + } + if ("primitive" in f) { + var b = f.primitive; + return P(b, function (a, c) { + var d = a.constants.primTypes, e = a.invoke(c, b); + return c.def(d, "[", e, "]") + }) + } + return g ? va(g) ? g.value ? D(function (a, b) { + return b.def(a.ELEMENTS, ".primType") + }) : D(function () { + return 4 + }) : new Z(g.thisDep, + g.contextDep, g.propDep, function (a, b) { + var c = a.ELEMENTS; + return b.def(c, "?", c, ".primType:", 4) + }) : null + }(), count: function () { + if ("count" in e) { + var a = e.count | 0; + return D(function () { + return a + }) + } + if ("count" in f) { + var b = f.count; + return P(b, function (a, c) { + return a.invoke(c, b) + }) + } + return g ? va(g) ? g ? h ? new Z(h.thisDep, h.contextDep, h.propDep, function (a, b) { + return b.def(a.ELEMENTS, ".vertCount-", a.OFFSET) + }) : D(function (a, b) { + return b.def(a.ELEMENTS, ".vertCount") + }) : D(function () { + return -1 + }) : new Z(g.thisDep || h.thisDep, g.contextDep || + h.contextDep, g.propDep || h.propDep, function (a, b) { + var c = a.ELEMENTS; + return a.OFFSET ? b.def(c, "?", c, ".vertCount-", a.OFFSET, ":-1") : b.def(c, "?", c, ".vertCount:-1") + }) : null + }(), instances: c("instances", !1), offset: h + } + } + + function R(a, b) { + var c = a["static"], d = a.dynamic, e = {}; + Ka.forEach(function (a) { + function b(f, g) { + if (a in c) { + var w = f(c[a]); + e[p] = D(function () { + return w + }) + } else if (a in d) { + var h = d[a]; + e[p] = P(h, function (a, b) { + return g(a, b, a.invoke(b, h)) + }) + } + } + + var p = l(a); + switch (a) { + case "cull.enable": + case "blend.enable": + case "dither": + case "stencil.enable": + case "depth.enable": + case "scissor.enable": + case "polygonOffset.enable": + case "sample.alpha": + case "sample.enable": + case "depth.mask": + return b(function (a) { + return a + }, + function (a, b, c) { + return c + }); + case "depth.func": + return b(function (a) { + return Xa[a] + }, function (a, b, c) { + return b.def(a.constants.compareFuncs, "[", c, "]") + }); + case "depth.range": + return b(function (a) { + return a + }, function (a, b, c) { + a = b.def("+", c, "[0]"); + b = b.def("+", c, "[1]"); + return [a, b] + }); + case "blend.func": + return b(function (a) { + return [Ga["srcRGB" in a ? a.srcRGB : a.src], Ga["dstRGB" in a ? a.dstRGB : a.dst], Ga["srcAlpha" in a ? a.srcAlpha : a.src], Ga["dstAlpha" in a ? a.dstAlpha : a.dst]] + }, function (a, b, c) { + function d(a, e) { + return b.def('"', + a, e, '" in ', c, "?", c, ".", a, e, ":", c, ".", a) + } + + a = a.constants.blendFuncs; + var e = d("src", "RGB"), p = d("dst", "RGB"), e = b.def(a, "[", e, "]"), + f = b.def(a, "[", d("src", "Alpha"), "]"), p = b.def(a, "[", p, "]"); + a = b.def(a, "[", d("dst", "Alpha"), "]"); + return [e, p, f, a] + }); + case "blend.equation": + return b(function (a) { + if ("string" === typeof a) return [X[a], X[a]]; + if ("object" === typeof a) return [X[a.rgb], X[a.alpha]] + }, function (a, b, c) { + var d = a.constants.blendEquations, e = b.def(), p = b.def(); + a = a.cond("typeof ", c, '==="string"'); + a.then(e, "=", p, "=", d, "[", + c, "];"); + a["else"](e, "=", d, "[", c, ".rgb];", p, "=", d, "[", c, ".alpha];"); + b(a); + return [e, p] + }); + case "blend.color": + return b(function (a) { + return J(4, function (b) { + return +a[b] + }) + }, function (a, b, c) { + return J(4, function (a) { + return b.def("+", c, "[", a, "]") + }) + }); + case "stencil.mask": + return b(function (a) { + return a | 0 + }, function (a, b, c) { + return b.def(c, "|0") + }); + case "stencil.func": + return b(function (a) { + return [Xa[a.cmp || "keep"], a.ref || 0, "mask" in a ? a.mask : -1] + }, function (a, b, c) { + a = b.def('"cmp" in ', c, "?", a.constants.compareFuncs, "[", c, ".cmp]", + ":", 7680); + var d = b.def(c, ".ref|0"); + b = b.def('"mask" in ', c, "?", c, ".mask|0:-1"); + return [a, d, b] + }); + case "stencil.opFront": + case "stencil.opBack": + return b(function (b) { + return ["stencil.opBack" === a ? 1029 : 1028, Pa[b.fail || "keep"], Pa[b.zfail || "keep"], Pa[b.zpass || "keep"]] + }, function (b, c, d) { + function e(a) { + return c.def('"', a, '" in ', d, "?", p, "[", d, ".", a, "]:", 7680) + } + + var p = b.constants.stencilOps; + return ["stencil.opBack" === a ? 1029 : 1028, e("fail"), e("zfail"), e("zpass")] + }); + case "polygonOffset.offset": + return b(function (a) { + return [a.factor | + 0, a.units | 0] + }, function (a, b, c) { + a = b.def(c, ".factor|0"); + b = b.def(c, ".units|0"); + return [a, b] + }); + case "cull.face": + return b(function (a) { + var b = 0; + "front" === a ? b = 1028 : "back" === a && (b = 1029); + return b + }, function (a, b, c) { + return b.def(c, '==="front"?', 1028, ":", 1029) + }); + case "lineWidth": + return b(function (a) { + return a + }, function (a, b, c) { + return c + }); + case "frontFace": + return b(function (a) { + return wb[a] + }, function (a, b, c) { + return b.def(c + '==="cw"?2304:2305') + }); + case "colorMask": + return b(function (a) { + return a.map(function (a) { + return !!a + }) + }, + function (a, b, c) { + return J(4, function (a) { + return "!!" + c + "[" + a + "]" + }) + }); + case "sample.coverage": + return b(function (a) { + return ["value" in a ? a.value : 1, !!a.invert] + }, function (a, b, c) { + a = b.def('"value" in ', c, "?+", c, ".value:1"); + b = b.def("!!", c, ".invert"); + return [a, b] + }) + } + }); + return e + } + + function F(a, b) { + var c = a["static"], d = a.dynamic, e = {}; + Object.keys(c).forEach(function (a) { + var b = c[a], d; + if ("number" === typeof b || "boolean" === typeof b) d = D(function () { + return b + }); else if ("function" === typeof b) { + var p = b._reglType; + if ("texture2d" === p || + "textureCube" === p) d = D(function (a) { + return a.link(b) + }); else if ("framebuffer" === p || "framebufferCube" === p) d = D(function (a) { + return a.link(b.color[0]) + }) + } else pa(b) && (d = D(function (a) { + return a.global.def("[", J(b.length, function (a) { + return b[a] + }), "]") + })); + d.value = b; + e[a] = d + }); + Object.keys(d).forEach(function (a) { + var b = d[a]; + e[a] = P(b, function (a, c) { + return a.invoke(c, b) + }) + }); + return e + } + + function T(a, c) { + var d = a["static"], e = a.dynamic, f = {}; + Object.keys(d).forEach(function (a) { + var c = d[a], e = b.id(a), p = new ya; + if (Oa(c)) p.state = 1, + p.buffer = g.getBuffer(g.create(c, 34962, !1, !0)), p.type = 0; else { + var w = g.getBuffer(c); + if (w) p.state = 1, p.buffer = w, p.type = 0; else if ("constant" in c) { + var h = c.constant; + p.buffer = "null"; + p.state = 2; + "number" === typeof h ? p.x = h : Da.forEach(function (a, b) { + b < h.length && (p[a] = h[b]) + }) + } else { + var w = Oa(c.buffer) ? g.getBuffer(g.create(c.buffer, 34962, !1, !0)) : g.getBuffer(c.buffer), + k = c.offset | 0, m = c.stride | 0, I = c.size | 0, l = !!c.normalized, n = 0; + "type" in c && (n = Ra[c.type]); + c = c.divisor | 0; + p.buffer = w; + p.state = 1; + p.size = I; + p.normalized = l; + p.type = + n || w.dtype; + p.offset = k; + p.stride = m; + p.divisor = c + } + } + f[a] = D(function (a, b) { + var c = a.attribCache; + if (e in c) return c[e]; + var d = {isStream: !1}; + Object.keys(p).forEach(function (a) { + d[a] = p[a] + }); + p.buffer && (d.buffer = a.link(p.buffer), d.type = d.type || d.buffer + ".dtype"); + return c[e] = d + }) + }); + Object.keys(e).forEach(function (a) { + var b = e[a]; + f[a] = P(b, function (a, c) { + function d(a) { + c(w[a], "=", e, ".", a, "|0;") + } + + var e = a.invoke(c, b), p = a.shared, f = p.isBufferArgs, g = p.buffer, + w = {isStream: c.def(!1)}, h = new ya; + h.state = 1; + Object.keys(h).forEach(function (a) { + w[a] = + c.def("" + h[a]) + }); + var z = w.buffer, k = w.type; + c("if(", f, "(", e, ")){", w.isStream, "=true;", z, "=", g, ".createStream(", 34962, ",", e, ");", k, "=", z, ".dtype;", "}else{", z, "=", g, ".getBuffer(", e, ");", "if(", z, "){", k, "=", z, ".dtype;", '}else if("constant" in ', e, "){", w.state, "=", 2, ";", "if(typeof " + e + '.constant === "number"){', w[Da[0]], "=", e, ".constant;", Da.slice(1).map(function (a) { + return w[a] + }).join("="), "=0;", "}else{", Da.map(function (a, b) { + return w[a] + "=" + e + ".constant.length>" + b + "?" + e + ".constant[" + b + "]:0;" + }).join(""), "}}else{", + "if(", f, "(", e, ".buffer)){", z, "=", g, ".createStream(", 34962, ",", e, ".buffer);", "}else{", z, "=", g, ".getBuffer(", e, ".buffer);", "}", k, '="type" in ', e, "?", p.glTypes, "[", e, ".type]:", z, ".dtype;", w.normalized, "=!!", e, ".normalized;"); + d("size"); + d("offset"); + d("stride"); + d("divisor"); + c("}}"); + c.exit("if(", w.isStream, "){", g, ".destroyStream(", z, ");", "}"); + return w + }) + }); + return f + } + + function M(a) { + var b = a["static"], c = a.dynamic, d = {}; + Object.keys(b).forEach(function (a) { + var c = b[a]; + d[a] = D(function (a, b) { + return "number" === typeof c || + "boolean" === typeof c ? "" + c : a.link(c) + }) + }); + Object.keys(c).forEach(function (a) { + var b = c[a]; + d[a] = P(b, function (a, c) { + return a.invoke(c, b) + }) + }); + return d + } + + function A(a, b, c, d, e) { + var f = y(a, e), g = x(a, f, e), h = O(a, e), k = R(a, e), m = E(a, e), ba = g.viewport; + ba && (k.viewport = ba); + ba = l("scissor.box"); + (g = g[ba]) && (k[ba] = g); + g = 0 < Object.keys(k).length; + f = {framebuffer: f, draw: h, shader: m, state: k, dirty: g}; + f.profile = B(a, e); + f.uniforms = F(c, e); + f.attributes = T(b, e); + f.context = M(d, e); + return f + } + + function ua(a, b, c) { + var d = a.shared.context, e = a.scope(); + Object.keys(c).forEach(function (f) { + b.save(d, "." + f); + e(d, ".", f, "=", c[f].append(a, b), ";") + }); + b(e) + } + + function K(a, b, c, d) { + var e = a.shared, f = e.gl, g = e.framebuffer, h; + ha && (h = b.def(e.extensions, ".webgl_draw_buffers")); + var k = a.constants, e = k.drawBuffer, k = k.backBuffer; + a = c ? c.append(a, b) : b.def(g, ".next"); + d || b("if(", a, "!==", g, ".cur){"); + b("if(", a, "){", f, ".bindFramebuffer(", 36160, ",", a, ".framebuffer);"); + ha && b(h, ".drawBuffersWEBGL(", e, "[", a, ".colorAttachments.length]);"); + b("}else{", f, ".bindFramebuffer(", 36160, ",null);"); + ha && b(h, ".drawBuffersWEBGL(", k, ");"); + b("}", g, ".cur=", a, ";"); + d || b("}") + } + + function V(a, b, c) { + var d = a.shared, e = d.gl, f = a.current, g = a.next, h = d.current, k = d.next, + m = a.cond(h, ".dirty"); + Ka.forEach(function (b) { + b = l(b); + if (!(b in c.state)) { + var d, w; + if (b in g) { + d = g[b]; + w = f[b]; + var I = J(ra[b].length, function (a) { + return m.def(d, "[", a, "]") + }); + m(a.cond(I.map(function (a, b) { + return a + "!==" + w + "[" + b + "]" + }).join("||")).then(e, ".", ta[b], "(", I, ");", I.map(function (a, b) { + return w + "[" + b + "]=" + a + }).join(";"), ";")) + } else d = m.def(k, ".", b), I = a.cond(d, + "!==", h, ".", b), m(I), b in sa ? I(a.cond(d).then(e, ".enable(", sa[b], ");")["else"](e, ".disable(", sa[b], ");"), h, ".", b, "=", d, ";") : I(e, ".", ta[b], "(", d, ");", h, ".", b, "=", d, ";") + } + }); + 0 === Object.keys(c.state).length && m(h, ".dirty=false;"); + b(m) + } + + function Q(a, b, c, d) { + var e = a.shared, f = a.current, g = e.current, h = e.gl; + vb(Object.keys(c)).forEach(function (e) { + var k = c[e]; + if (!d || d(k)) { + var m = k.append(a, b); + if (sa[e]) { + var l = sa[e]; + va(k) ? m ? b(h, ".enable(", l, ");") : b(h, ".disable(", l, ");") : b(a.cond(m).then(h, ".enable(", l, ");")["else"](h, + ".disable(", l, ");")); + b(g, ".", e, "=", m, ";") + } else if (pa(m)) { + var n = f[e]; + b(h, ".", ta[e], "(", m, ");", m.map(function (a, b) { + return n + "[" + b + "]=" + a + }).join(";"), ";") + } else b(h, ".", ta[e], "(", m, ");", g, ".", e, "=", m, ";") + } + }) + } + + function wa(a, b) { + ea && (a.instancing = b.def(a.shared.extensions, ".angle_instanced_arrays")) + } + + function G(a, b, c, d, e) { + function f() { + return "undefined" === typeof performance ? "Date.now()" : "performance.now()" + } + + function g(a) { + t = b.def(); + a(t, "=", f(), ";"); + "string" === typeof e ? a(ba, ".count+=", e, ";") : a(ba, ".count++;"); + k && (d ? (r = b.def(), a(r, "=", q, ".getNumPendingQueries();")) : a(q, ".beginQuery(", ba, ");")) + } + + function h(a) { + a(ba, ".cpuTime+=", f(), "-", t, ";"); + k && (d ? a(q, ".pushScopeStats(", r, ",", q, ".getNumPendingQueries(),", ba, ");") : a(q, ".endQuery();")) + } + + function m(a) { + var c = b.def(n, ".profile"); + b(n, ".profile=", a, ";"); + b.exit(n, ".profile=", c, ";") + } + + var l = a.shared, ba = a.stats, n = l.current, q = l.timer; + c = c.profile; + var t, r; + if (c) { + if (va(c)) { + c.enable ? (g(b), h(b.exit), m("true")) : m("false"); + return + } + c = c.append(a, b); + m(c) + } else c = b.def(n, ".profile"); + l = a.block(); + g(l); + b("if(", c, "){", l, "}"); + a = a.block(); + h(a); + b.exit("if(", c, "){", a, "}") + } + + function U(a, b, c, d, e) { + function f(a) { + switch (a) { + case 35664: + case 35667: + case 35671: + return 2; + case 35665: + case 35668: + case 35672: + return 3; + case 35666: + case 35669: + case 35673: + return 4; + default: + return 1 + } + } + + function g(c, d, e) { + function f() { + b("if(!", z, ".buffer){", k, ".enableVertexAttribArray(", l, ");}"); + var c = e.type, g; + g = e.size ? b.def(e.size, "||", d) : d; + b("if(", z, ".type!==", c, "||", z, ".size!==", g, "||", q.map(function (a) { + return z + "." + a + "!==" + e[a] + }).join("||"), + "){", k, ".bindBuffer(", 34962, ",", I, ".buffer);", k, ".vertexAttribPointer(", [l, g, c, e.normalized, e.stride, e.offset], ");", z, ".type=", c, ";", z, ".size=", g, ";", q.map(function (a) { + return z + "." + a + "=" + e[a] + ";" + }).join(""), "}"); + ea && (c = e.divisor, b("if(", z, ".divisor!==", c, "){", a.instancing, ".vertexAttribDivisorANGLE(", [l, c], ");", z, ".divisor=", c, ";}")) + } + + function m() { + b("if(", z, ".buffer){", k, ".disableVertexAttribArray(", l, ");", "}if(", Da.map(function (a, b) { + return z + "." + a + "!==" + n[b] + }).join("||"), "){", k, ".vertexAttrib4f(", + l, ",", n, ");", Da.map(function (a, b) { + return z + "." + a + "=" + n[b] + ";" + }).join(""), "}") + } + + var k = h.gl, l = b.def(c, ".location"), z = b.def(h.attributes, "[", l, "]"); + c = e.state; + var I = e.buffer, n = [e.x, e.y, e.z, e.w], + q = ["buffer", "normalized", "offset", "stride"]; + 1 === c ? f() : 2 === c ? m() : (b("if(", c, "===", 1, "){"), f(), b("}else{"), m(), b("}")) + } + + var h = a.shared; + d.forEach(function (d) { + var h = d.name, k = c.attributes[h], m; + if (k) { + if (!e(k)) return; + m = k.append(a, b) + } else { + if (!e(xb)) return; + var l = a.scopeAttrib(h); + m = {}; + Object.keys(new ya).forEach(function (a) { + m[a] = + b.def(l, ".", a) + }) + } + g(a.link(d), f(d.info.type), m) + }) + } + + function W(a, c, d, e, f) { + for (var g = a.shared, h = g.gl, k, m = 0; m < e.length; ++m) { + var l = e[m], n = l.name, q = l.info.type, t = d.uniforms[n], l = a.link(l) + ".location", + r; + if (t) { + if (!f(t)) continue; + if (va(t)) { + n = t.value; + if (35678 === q || 35680 === q) q = a.link(n._texture || n.color[0]._texture), c(h, ".uniform1i(", l, ",", q + ".bind());"), c.exit(q, ".unbind();"); else if (35674 === q || 35675 === q || 35676 === q) n = a.global.def("new Float32Array([" + Array.prototype.slice.call(n) + "])"), t = 2, 35675 === q ? t = 3 : 35676 === + q && (t = 4), c(h, ".uniformMatrix", t, "fv(", l, ",false,", n, ");"); else { + switch (q) { + case 5126: + k = "1f"; + break; + case 35664: + k = "2f"; + break; + case 35665: + k = "3f"; + break; + case 35666: + k = "4f"; + break; + case 35670: + k = "1i"; + break; + case 5124: + k = "1i"; + break; + case 35671: + k = "2i"; + break; + case 35667: + k = "2i"; + break; + case 35672: + k = "3i"; + break; + case 35668: + k = "3i"; + break; + case 35673: + k = "4i"; + break; + case 35669: + k = "4i" + } + c(h, ".uniform", k, "(", l, ",", pa(n) ? Array.prototype.slice.call(n) : n, ");") + } + continue + } else r = t.append(a, c) + } else { + if (!f(xb)) continue; + r = c.def(g.uniforms, "[", + b.id(n), "]") + } + 35678 === q ? c("if(", r, "&&", r, '._reglType==="framebuffer"){', r, "=", r, ".color[0];", "}") : 35680 === q && c("if(", r, "&&", r, '._reglType==="framebufferCube"){', r, "=", r, ".color[0];", "}"); + n = 1; + switch (q) { + case 35678: + case 35680: + q = c.def(r, "._texture"); + c(h, ".uniform1i(", l, ",", q, ".bind());"); + c.exit(q, ".unbind();"); + continue; + case 5124: + case 35670: + k = "1i"; + break; + case 35667: + case 35671: + k = "2i"; + n = 2; + break; + case 35668: + case 35672: + k = "3i"; + n = 3; + break; + case 35669: + case 35673: + k = "4i"; + n = 4; + break; + case 5126: + k = "1f"; + break; + case 35664: + k = + "2f"; + n = 2; + break; + case 35665: + k = "3f"; + n = 3; + break; + case 35666: + k = "4f"; + n = 4; + break; + case 35674: + k = "Matrix2fv"; + break; + case 35675: + k = "Matrix3fv"; + break; + case 35676: + k = "Matrix4fv" + } + c(h, ".uniform", k, "(", l, ","); + if ("M" === k.charAt(0)) { + var l = Math.pow(q - 35674 + 2, 2), v = a.global.def("new Float32Array(", l, ")"); + c("false,(Array.isArray(", r, ")||", r, " instanceof Float32Array)?", r, ":(", J(l, function (a) { + return v + "[" + a + "]=" + r + "[" + a + "]" + }), ",", v, ")") + } else 1 < n ? c(J(n, function (a) { + return r + "[" + a + "]" + })) : c(r); + c(");") + } + } + + function S(a, b, c, d) { + function e(f) { + var g = + l[f]; + return g ? g.contextDep && d.contextDynamic || g.propDep ? g.append(a, c) : g.append(a, b) : b.def(m, ".", f) + } + + function f() { + function a() { + c(u, ".drawElementsInstancedANGLE(", [q, t, C, r + "<<((" + C + "-5121)>>1)", v], ");") + } + + function b() { + c(u, ".drawArraysInstancedANGLE(", [q, r, t, v], ");") + } + + n ? da ? a() : (c("if(", n, "){"), a(), c("}else{"), b(), c("}")) : b() + } + + function g() { + function a() { + c(k + ".drawElements(" + [q, t, C, r + "<<((" + C + "-5121)>>1)"] + ");") + } + + function b() { + c(k + ".drawArrays(" + [q, r, t] + ");") + } + + n ? da ? a() : (c("if(", n, "){"), a(), c("}else{"), b(), c("}")) : + b() + } + + var h = a.shared, k = h.gl, m = h.draw, l = d.draw, n = function () { + var e = l.elements, f = b; + if (e) { + if (e.contextDep && d.contextDynamic || e.propDep) f = c; + e = e.append(a, f) + } else e = f.def(m, ".", "elements"); + e && f("if(" + e + ")" + k + ".bindBuffer(34963," + e + ".buffer.buffer);"); + return e + }(), q = e("primitive"), r = e("offset"), t = function () { + var e = l.count, f = b; + if (e) { + if (e.contextDep && d.contextDynamic || e.propDep) f = c; + e = e.append(a, f) + } else e = f.def(m, ".", "count"); + return e + }(); + if ("number" === typeof t) { + if (0 === t) return + } else c("if(", t, "){"), c.exit("}"); + var v, + u; + ea && (v = e("instances"), u = a.instancing); + var C = n + ".type", da = l.elements && va(l.elements); + ea && ("number" !== typeof v || 0 <= v) ? "string" === typeof v ? (c("if(", v, ">0){"), f(), c("}else if(", v, "<0){"), g(), c("}")) : f() : g() + } + + function ca(a, b, c, d, e) { + b = N(); + e = b.proc("body", e); + ea && (b.instancing = e.def(b.shared.extensions, ".angle_instanced_arrays")); + a(b, e, c, d); + return b.compile().body + } + + function L(a, b, c, d) { + wa(a, b); + U(a, b, c, d.attributes, function () { + return !0 + }); + W(a, b, c, d.uniforms, function () { + return !0 + }); + S(a, b, b, c) + } + + function da(a, b) { + var c = + a.proc("draw", 1); + wa(a, c); + ua(a, c, b.context); + K(a, c, b.framebuffer); + V(a, c, b); + Q(a, c, b.state); + G(a, c, b, !1, !0); + var d = b.shader.progVar.append(a, c); + c(a.shared.gl, ".useProgram(", d, ".program);"); + if (b.shader.program) L(a, c, b, b.shader.program); else { + var e = a.global.def("{}"), f = c.def(d, ".id"), g = c.def(e, "[", f, "]"); + c(a.cond(g).then(g, ".call(this,a0);")["else"](g, "=", e, "[", f, "]=", a.link(function (c) { + return ca(L, a, b, c, 1) + }), "(", d, ");", g, ".call(this,a0);")) + } + 0 < Object.keys(b.state).length && c(a.shared.current, ".dirty=true;") + } + + function oa(a, b, c, d) { + function e() { + return !0 + } + + a.batchId = "a1"; + wa(a, b); + U(a, b, c, d.attributes, e); + W(a, b, c, d.uniforms, e); + S(a, b, b, c) + } + + function za(a, b, c, d) { + function e(a) { + return a.contextDep && g || a.propDep + } + + function f(a) { + return !e(a) + } + + wa(a, b); + var g = c.contextDep, h = b.def(), k = b.def(); + a.shared.props = k; + a.batchId = h; + var m = a.scope(), l = a.scope(); + b(m.entry, "for(", h, "=0;", h, "<", "a1", ";++", h, "){", k, "=", "a0", "[", h, "];", l, "}", m.exit); + c.needsContext && ua(a, l, c.context); + c.needsFramebuffer && K(a, l, c.framebuffer); + Q(a, l, c.state, e); + c.profile && + e(c.profile) && G(a, l, c, !1, !0); + d ? (U(a, m, c, d.attributes, f), U(a, l, c, d.attributes, e), W(a, m, c, d.uniforms, f), W(a, l, c, d.uniforms, e), S(a, m, l, c)) : (b = a.global.def("{}"), d = c.shader.progVar.append(a, l), k = l.def(d, ".id"), m = l.def(b, "[", k, "]"), l(a.shared.gl, ".useProgram(", d, ".program);", "if(!", m, "){", m, "=", b, "[", k, "]=", a.link(function (b) { + return ca(oa, a, c, b, 2) + }), "(", d, ");}", m, ".call(this,a0[", h, "],", h, ");")) + } + + function ka(a, b) { + function c(a) { + return a.contextDep && e || a.propDep + } + + var d = a.proc("batch", 2); + a.batchId = "0"; + wa(a, + d); + var e = !1, f = !0; + Object.keys(b.context).forEach(function (a) { + e = e || b.context[a].propDep + }); + e || (ua(a, d, b.context), f = !1); + var g = b.framebuffer, h = !1; + g ? (g.propDep ? e = h = !0 : g.contextDep && e && (h = !0), h || K(a, d, g)) : K(a, d, null); + b.state.viewport && b.state.viewport.propDep && (e = !0); + V(a, d, b); + Q(a, d, b.state, function (a) { + return !c(a) + }); + b.profile && c(b.profile) || G(a, d, b, !1, "a1"); + b.contextDep = e; + b.needsContext = f; + b.needsFramebuffer = h; + f = b.shader.progVar; + if (f.contextDep && e || f.propDep) za(a, d, b, null); else if (f = f.append(a, d), d(a.shared.gl, + ".useProgram(", f, ".program);"), b.shader.program) za(a, d, b, b.shader.program); else { + var g = a.global.def("{}"), h = d.def(f, ".id"), k = d.def(g, "[", h, "]"); + d(a.cond(k).then(k, ".call(this,a0,a1);")["else"](k, "=", g, "[", h, "]=", a.link(function (c) { + return ca(za, a, b, c, 2) + }), "(", f, ");", k, ".call(this,a0,a1);")) + } + 0 < Object.keys(b.state).length && d(a.shared.current, ".dirty=true;") + } + + function ia(a, c) { + function d(b) { + var g = c.shader[b]; + g && e.set(f.shader, "." + b, g.append(a, e)) + } + + var e = a.proc("scope", 3); + a.batchId = "a2"; + var f = a.shared, g = f.current; + ua(a, e, c.context); + c.framebuffer && c.framebuffer.append(a, e); + vb(Object.keys(c.state)).forEach(function (b) { + var d = c.state[b].append(a, e); + pa(d) ? d.forEach(function (c, d) { + e.set(a.next[b], "[" + d + "]", c) + }) : e.set(f.next, "." + b, d) + }); + G(a, e, c, !0, !0); + ["elements", "offset", "count", "instances", "primitive"].forEach(function (b) { + var d = c.draw[b]; + d && e.set(f.draw, "." + b, "" + d.append(a, e)) + }); + Object.keys(c.uniforms).forEach(function (d) { + e.set(f.uniforms, "[" + b.id(d) + "]", c.uniforms[d].append(a, e)) + }); + Object.keys(c.attributes).forEach(function (b) { + var d = + c.attributes[b].append(a, e), f = a.scopeAttrib(b); + Object.keys(new ya).forEach(function (a) { + e.set(f, "." + a, d[a]) + }) + }); + d("vert"); + d("frag"); + 0 < Object.keys(c.state).length && (e(g, ".dirty=true;"), e.exit(g, ".dirty=true;")); + e("a1(", a.shared.context, ",a0,", a.batchId, ");") + } + + function ma(a) { + if ("object" === typeof a && !pa(a)) { + for (var b = Object.keys(a), c = 0; c < b.length; ++c) if (la.isDynamic(a[b[c]])) return !0; + return !1 + } + } + + function ja(a, b, c) { + function d(a, b) { + g.forEach(function (c) { + var d = e[c]; + la.isDynamic(d) && (d = a.invoke(b, d), b(l, ".", + c, "=", d, ";")) + }) + } + + var e = b["static"][c]; + if (e && ma(e)) { + var f = a.global, g = Object.keys(e), h = !1, k = !1, m = !1, l = a.global.def("{}"); + g.forEach(function (b) { + var c = e[b]; + if (la.isDynamic(c)) "function" === typeof c && (c = e[b] = la.unbox(c)), b = P(c, null), h = h || b.thisDep, m = m || b.propDep, k = k || b.contextDep; else { + f(l, ".", b, "="); + switch (typeof c) { + case "number": + f(c); + break; + case "string": + f('"', c, '"'); + break; + case "object": + Array.isArray(c) && f("[", c.join(), "]"); + break; + default: + f(a.link(c)) + } + f(";") + } + }); + b.dynamic[c] = new la.DynamicVariable(4, { + thisDep: h, + contextDep: k, propDep: m, ref: l, append: d + }); + delete b["static"][c] + } + } + + var ya = q.Record, X = {add: 32774, subtract: 32778, "reverse subtract": 32779}; + c.ext_blend_minmax && (X.min = 32775, X.max = 32776); + var ea = c.angle_instanced_arrays, ha = c.webgl_draw_buffers, ra = {dirty: !0, profile: h.profile}, + Fa = {}, Ka = [], sa = {}, ta = {}; + u("dither", 3024); + u("blend.enable", 3042); + v("blend.color", "blendColor", [0, 0, 0, 0]); + v("blend.equation", "blendEquationSeparate", [32774, 32774]); + v("blend.func", "blendFuncSeparate", [1, 0, 1, 0]); + u("depth.enable", 2929, !0); + v("depth.func", "depthFunc", 513); + v("depth.range", "depthRange", [0, 1]); + v("depth.mask", "depthMask", !0); + v("colorMask", "colorMask", [!0, !0, !0, !0]); + u("cull.enable", 2884); + v("cull.face", "cullFace", 1029); + v("frontFace", "frontFace", 2305); + v("lineWidth", "lineWidth", 1); + u("polygonOffset.enable", 32823); + v("polygonOffset.offset", "polygonOffset", [0, 0]); + u("sample.alpha", 32926); + u("sample.enable", 32928); + v("sample.coverage", "sampleCoverage", [1, !1]); + u("stencil.enable", 2960); + v("stencil.mask", "stencilMask", -1); + v("stencil.func", + "stencilFunc", [519, 0, -1]); + v("stencil.opFront", "stencilOpSeparate", [1028, 7680, 7680, 7680]); + v("stencil.opBack", "stencilOpSeparate", [1029, 7680, 7680, 7680]); + u("scissor.enable", 3089); + v("scissor.box", "scissor", [0, 0, a.drawingBufferWidth, a.drawingBufferHeight]); + v("viewport", "viewport", [0, 0, a.drawingBufferWidth, a.drawingBufferHeight]); + var na = { + gl: a, + context: C, + strings: b, + next: Fa, + current: ra, + draw: m, + elements: d, + buffer: g, + shader: t, + attributes: q.state, + uniforms: r, + framebuffer: f, + extensions: c, + timer: k, + isBufferArgs: Oa + }, aa = { + primTypes: Sa, + compareFuncs: Xa, + blendFuncs: Ga, + blendEquations: X, + stencilOps: Pa, + glTypes: Ra, + orientationType: wb + }; + ha && (aa.backBuffer = [1029], aa.drawBuffer = J(e.maxDrawbuffers, function (a) { + return 0 === a ? [0] : J(a, function (a) { + return 36064 + a + }) + })); + var qa = 0; + return { + next: Fa, current: ra, procs: function () { + var a = N(), b = a.proc("poll"), c = a.proc("refresh"), d = a.block(); + b(d); + c(d); + var f = a.shared, g = f.gl, h = f.next, k = f.current; + d(k, ".dirty=false;"); + K(a, b); + K(a, c, null, !0); + var m; + ea && (m = a.link(ea)); + for (var l = 0; l < e.maxAttributes; ++l) { + var n = c.def(f.attributes, + "[", l, "]"), q = a.cond(n, ".buffer"); + q.then(g, ".enableVertexAttribArray(", l, ");", g, ".bindBuffer(", 34962, ",", n, ".buffer.buffer);", g, ".vertexAttribPointer(", l, ",", n, ".size,", n, ".type,", n, ".normalized,", n, ".stride,", n, ".offset);")["else"](g, ".disableVertexAttribArray(", l, ");", g, ".vertexAttrib4f(", l, ",", n, ".x,", n, ".y,", n, ".z,", n, ".w);", n, ".buffer=null;"); + c(q); + ea && c(m, ".vertexAttribDivisorANGLE(", l, ",", n, ".divisor);") + } + Object.keys(sa).forEach(function (e) { + var f = sa[e], m = d.def(h, ".", e), l = a.block(); + l("if(", m, "){", + g, ".enable(", f, ")}else{", g, ".disable(", f, ")}", k, ".", e, "=", m, ";"); + c(l); + b("if(", m, "!==", k, ".", e, "){", l, "}") + }); + Object.keys(ta).forEach(function (e) { + var f = ta[e], m = ra[e], l, n, q = a.block(); + q(g, ".", f, "("); + pa(m) ? (f = m.length, l = a.global.def(h, ".", e), n = a.global.def(k, ".", e), q(J(f, function (a) { + return l + "[" + a + "]" + }), ");", J(f, function (a) { + return n + "[" + a + "]=" + l + "[" + a + "];" + }).join("")), b("if(", J(f, function (a) { + return l + "[" + a + "]!==" + n + "[" + a + "]" + }).join("||"), "){", q, "}")) : (l = d.def(h, ".", e), n = d.def(k, ".", e), q(l, ");", k, ".", e, + "=", l, ";"), b("if(", l, "!==", n, "){", q, "}")); + c(q) + }); + return a.compile() + }(), compile: function (a, b, c, d, e) { + var f = N(); + f.stats = f.link(e); + Object.keys(b["static"]).forEach(function (a) { + ja(f, b, a) + }); + Ub.forEach(function (b) { + ja(f, a, b) + }); + c = A(a, b, c, d, f); + da(f, c); + ia(f, c); + ka(f, c); + return f.compile() + } + } + } + + function yb(a, b) { + for (var c = 0; c < a.length; ++c) if (a[c] === b) return c; + return -1 + } + + var E = function (a, b) { + for (var c = Object.keys(b), e = 0; e < c.length; ++e) a[c[e]] = b[c[e]]; + return a + }, Ab = 0, la = { + DynamicVariable: aa, define: function (a, b) { + return new aa(a, + Za(b + "")) + }, isDynamic: function (a) { + return "function" === typeof a && !a._reglType || a instanceof aa + }, unbox: function (a, b) { + return "function" === typeof a ? new aa(0, a) : a + }, accessor: Za + }, Ya = { + next: "function" === typeof requestAnimationFrame ? function (a) { + return requestAnimationFrame(a) + } : function (a) { + return setTimeout(a, 16) + }, cancel: "function" === typeof cancelAnimationFrame ? function (a) { + return cancelAnimationFrame(a) + } : clearTimeout + }, zb = "undefined" !== typeof performance && performance.now ? function () { + return performance.now() + } : function () { + return +new Date + }, + x = cb(); + x.zero = cb(); + var Vb = function (a, b) { + var c = 1; + b.ext_texture_filter_anisotropic && (c = a.getParameter(34047)); + var e = 1, g = 1; + b.webgl_draw_buffers && (e = a.getParameter(34852), g = a.getParameter(36063)); + var d = !!b.oes_texture_float; + if (d) { + d = a.createTexture(); + a.bindTexture(3553, d); + a.texImage2D(3553, 0, 6408, 1, 1, 0, 6408, 5126, null); + var n = a.createFramebuffer(); + a.bindFramebuffer(36160, n); + a.framebufferTexture2D(36160, 36064, 3553, d, 0); + a.bindTexture(3553, null); + if (36053 !== a.checkFramebufferStatus(36160)) d = !1; else { + a.viewport(0, + 0, 1, 1); + a.clearColor(1, 0, 0, 1); + a.clear(16384); + var f = x.allocType(5126, 4); + a.readPixels(0, 0, 1, 1, 6408, 5126, f); + a.getError() ? d = !1 : (a.deleteFramebuffer(n), a.deleteTexture(d), d = 1 === f[0]); + x.freeType(f) + } + } + f = !0; + f = a.createTexture(); + n = x.allocType(5121, 36); + a.activeTexture(33984); + a.bindTexture(34067, f); + a.texImage2D(34069, 0, 6408, 3, 3, 0, 6408, 5121, n); + x.freeType(n); + a.bindTexture(34067, null); + a.deleteTexture(f); + f = !a.getError(); + return { + colorBits: [a.getParameter(3410), a.getParameter(3411), a.getParameter(3412), a.getParameter(3413)], + depthBits: a.getParameter(3414), + stencilBits: a.getParameter(3415), + subpixelBits: a.getParameter(3408), + extensions: Object.keys(b).filter(function (a) { + return !!b[a] + }), + maxAnisotropic: c, + maxDrawbuffers: e, + maxColorAttachments: g, + pointSizeDims: a.getParameter(33901), + lineWidthDims: a.getParameter(33902), + maxViewportDims: a.getParameter(3386), + maxCombinedTextureUnits: a.getParameter(35661), + maxCubeMapSize: a.getParameter(34076), + maxRenderbufferSize: a.getParameter(34024), + maxTextureUnits: a.getParameter(34930), + maxTextureSize: a.getParameter(3379), + maxAttributes: a.getParameter(34921), + maxVertexUniforms: a.getParameter(36347), + maxVertexTextureUnits: a.getParameter(35660), + maxVaryingVectors: a.getParameter(36348), + maxFragmentUniforms: a.getParameter(36349), + glsl: a.getParameter(35724), + renderer: a.getParameter(7937), + vendor: a.getParameter(7936), + version: a.getParameter(7938), + readFloat: d, + npotTextureCube: f + } + }, M = function (a) { + return a instanceof Uint8Array || a instanceof Uint16Array || a instanceof Uint32Array || a instanceof Int8Array || a instanceof Int16Array || a instanceof + Int32Array || a instanceof Float32Array || a instanceof Float64Array || a instanceof Uint8ClampedArray + }, S = function (a) { + return Object.keys(a).map(function (b) { + return a[b] + }) + }, Ma = { + shape: function (a) { + for (var b = []; a.length; a = a[0]) b.push(a.length); + return b + }, flatten: function (a, b, c, e) { + var g = 1; + if (b.length) for (var d = 0; d < b.length; ++d) g *= b[d]; else g = 0; + c = e || x.allocType(c, g); + switch (b.length) { + case 0: + break; + case 1: + e = b[0]; + for (b = 0; b < e; ++b) c[b] = a[b]; + break; + case 2: + e = b[0]; + b = b[1]; + for (d = g = 0; d < e; ++d) for (var n = a[d], f = 0; f < b; ++f) c[g++] = + n[f]; + break; + case 3: + db(a, b[0], b[1], b[2], c, 0); + break; + default: + eb(a, b, 0, c, 0) + } + return c + } + }, Ia = { + "[object Int8Array]": 5120, + "[object Int16Array]": 5122, + "[object Int32Array]": 5124, + "[object Uint8Array]": 5121, + "[object Uint8ClampedArray]": 5121, + "[object Uint16Array]": 5123, + "[object Uint32Array]": 5125, + "[object Float32Array]": 5126, + "[object Float64Array]": 5121, + "[object ArrayBuffer]": 5121 + }, Ra = { + int8: 5120, + int16: 5122, + int32: 5124, + uint8: 5121, + uint16: 5123, + uint32: 5125, + "float": 5126, + float32: 5126 + }, jb = {dynamic: 35048, stream: 35040, "static": 35044}, + Qa = Ma.flatten, hb = Ma.shape, ja = []; + ja[5120] = 1; + ja[5122] = 2; + ja[5124] = 4; + ja[5121] = 1; + ja[5123] = 2; + ja[5125] = 4; + ja[5126] = 4; + var Sa = { + points: 0, + point: 0, + lines: 1, + line: 1, + triangles: 4, + triangle: 4, + "line loop": 2, + "line strip": 3, + "triangle strip": 5, + "triangle fan": 6 + }, lb = new Float32Array(1), Ib = new Uint32Array(lb.buffer), Mb = [9984, 9986, 9985, 9987], + La = [0, 6409, 6410, 6407, 6408], L = {}; + L[6409] = L[6406] = L[6402] = 1; + L[34041] = L[6410] = 2; + L[6407] = L[35904] = 3; + L[6408] = L[35906] = 4; + var Ua = Ea("HTMLCanvasElement"), pb = Ea("CanvasRenderingContext2D"), qb = Ea("ImageBitmap"), + rb = Ea("HTMLImageElement"), sb = Ea("HTMLVideoElement"), + Jb = Object.keys(Ia).concat([Ua, pb, qb, rb, sb]), qa = []; + qa[5121] = 1; + qa[5126] = 4; + qa[36193] = 2; + qa[5123] = 2; + qa[5125] = 4; + var y = []; + y[32854] = 2; + y[32855] = 2; + y[36194] = 2; + y[34041] = 4; + y[33776] = .5; + y[33777] = .5; + y[33778] = 1; + y[33779] = 1; + y[35986] = .5; + y[35987] = 1; + y[34798] = 1; + y[35840] = .5; + y[35841] = .25; + y[35842] = .5; + y[35843] = .25; + y[36196] = .5; + var Q = []; + Q[32854] = 2; + Q[32855] = 2; + Q[36194] = 2; + Q[33189] = 2; + Q[36168] = 1; + Q[34041] = 4; + Q[35907] = 4; + Q[34836] = 16; + Q[34842] = 8; + Q[34843] = 6; + var Wb = function (a, b, c, e, g) { + function d(a) { + this.id = + q++; + this.refCount = 1; + this.renderbuffer = a; + this.format = 32854; + this.height = this.width = 0; + g.profile && (this.stats = {size: 0}) + } + + function n(b) { + var c = b.renderbuffer; + a.bindRenderbuffer(36161, null); + a.deleteRenderbuffer(c); + b.renderbuffer = null; + b.refCount = 0; + delete t[b.id]; + e.renderbufferCount-- + } + + var f = { + rgba4: 32854, + rgb565: 36194, + "rgb5 a1": 32855, + depth: 33189, + stencil: 36168, + "depth stencil": 34041 + }; + b.ext_srgb && (f.srgba = 35907); + b.ext_color_buffer_half_float && (f.rgba16f = 34842, f.rgb16f = 34843); + b.webgl_color_buffer_float && (f.rgba32f = + 34836); + var r = []; + Object.keys(f).forEach(function (a) { + r[f[a]] = a + }); + var q = 0, t = {}; + d.prototype.decRef = function () { + 0 >= --this.refCount && n(this) + }; + g.profile && (e.getTotalRenderbufferSize = function () { + var a = 0; + Object.keys(t).forEach(function (b) { + a += t[b].stats.size + }); + return a + }); + return { + create: function (b, c) { + function k(b, c) { + var d = 0, e = 0, m = 32854; + "object" === typeof b && b ? ("shape" in b ? (e = b.shape, d = e[0] | 0, e = e[1] | 0) : ("radius" in b && (d = e = b.radius | 0), "width" in b && (d = b.width | 0), "height" in b && (e = b.height | 0)), "format" in b && (m = f[b.format])) : + "number" === typeof b ? (d = b | 0, e = "number" === typeof c ? c | 0 : d) : b || (d = e = 1); + if (d !== h.width || e !== h.height || m !== h.format) return k.width = h.width = d, k.height = h.height = e, h.format = m, a.bindRenderbuffer(36161, h.renderbuffer), a.renderbufferStorage(36161, m, d, e), g.profile && (h.stats.size = Q[h.format] * h.width * h.height), k.format = r[h.format], k + } + + var h = new d(a.createRenderbuffer()); + t[h.id] = h; + e.renderbufferCount++; + k(b, c); + k.resize = function (b, c) { + var d = b | 0, e = c | 0 || d; + if (d === h.width && e === h.height) return k; + k.width = h.width = d; + k.height = + h.height = e; + a.bindRenderbuffer(36161, h.renderbuffer); + a.renderbufferStorage(36161, h.format, d, e); + g.profile && (h.stats.size = Q[h.format] * h.width * h.height); + return k + }; + k._reglType = "renderbuffer"; + k._renderbuffer = h; + g.profile && (k.stats = h.stats); + k.destroy = function () { + h.decRef() + }; + return k + }, clear: function () { + S(t).forEach(n) + }, restore: function () { + S(t).forEach(function (b) { + b.renderbuffer = a.createRenderbuffer(); + a.bindRenderbuffer(36161, b.renderbuffer); + a.renderbufferStorage(36161, b.format, b.width, b.height) + }); + a.bindRenderbuffer(36161, + null) + } + } + }, Wa = []; + Wa[6408] = 4; + Wa[6407] = 3; + var Na = []; + Na[5121] = 1; + Na[5126] = 4; + Na[36193] = 2; + var Da = ["x", "y", "z", "w"], + Ub = "blend.func blend.equation stencil.func stencil.opFront stencil.opBack sample.coverage viewport scissor.box polygonOffset.offset".split(" "), + Ga = { + 0: 0, + 1: 1, + zero: 0, + one: 1, + "src color": 768, + "one minus src color": 769, + "src alpha": 770, + "one minus src alpha": 771, + "dst color": 774, + "one minus dst color": 775, + "dst alpha": 772, + "one minus dst alpha": 773, + "constant color": 32769, + "one minus constant color": 32770, + "constant alpha": 32771, + "one minus constant alpha": 32772, + "src alpha saturate": 776 + }, Xa = { + never: 512, + less: 513, + "<": 513, + equal: 514, + "=": 514, + "==": 514, + "===": 514, + lequal: 515, + "<=": 515, + greater: 516, + ">": 516, + notequal: 517, + "!=": 517, + "!==": 517, + gequal: 518, + ">=": 518, + always: 519 + }, Pa = { + 0: 0, + zero: 0, + keep: 7680, + replace: 7681, + increment: 7682, + decrement: 7683, + "increment wrap": 34055, + "decrement wrap": 34056, + invert: 5386 + }, wb = {cw: 2304, ccw: 2305}, xb = new Z(!1, !1, !1, function () { + }), Xb = function (a, b) { + function c() { + this.endQueryIndex = this.startQueryIndex = -1; + this.sum = 0; + this.stats = + null + } + + function e(a, b, d) { + var e = n.pop() || new c; + e.startQueryIndex = a; + e.endQueryIndex = b; + e.sum = 0; + e.stats = d; + f.push(e) + } + + if (!b.ext_disjoint_timer_query) return null; + var g = [], d = [], n = [], f = [], r = [], q = []; + return { + beginQuery: function (a) { + var c = g.pop() || b.ext_disjoint_timer_query.createQueryEXT(); + b.ext_disjoint_timer_query.beginQueryEXT(35007, c); + d.push(c); + e(d.length - 1, d.length, a) + }, endQuery: function () { + b.ext_disjoint_timer_query.endQueryEXT(35007) + }, pushScopeStats: e, update: function () { + var a, c; + a = d.length; + if (0 !== a) { + q.length = + Math.max(q.length, a + 1); + r.length = Math.max(r.length, a + 1); + r[0] = 0; + var e = q[0] = 0; + for (c = a = 0; c < d.length; ++c) { + var k = d[c]; + b.ext_disjoint_timer_query.getQueryObjectEXT(k, 34919) ? (e += b.ext_disjoint_timer_query.getQueryObjectEXT(k, 34918), g.push(k)) : d[a++] = k; + r[c + 1] = e; + q[c + 1] = a + } + d.length = a; + for (c = a = 0; c < f.length; ++c) { + var e = f[c], h = e.startQueryIndex, k = e.endQueryIndex; + e.sum += r[k] - r[h]; + h = q[h]; + k = q[k]; + k === h ? (e.stats.gpuTime += e.sum / 1E6, n.push(e)) : (e.startQueryIndex = h, e.endQueryIndex = k, f[a++] = e) + } + f.length = a + } + }, getNumPendingQueries: function () { + return d.length + }, + clear: function () { + g.push.apply(g, d); + for (var a = 0; a < g.length; a++) b.ext_disjoint_timer_query.deleteQueryEXT(g[a]); + d.length = 0; + g.length = 0 + }, restore: function () { + d.length = 0; + g.length = 0 + } + } + }; + return function (a) { + function b() { + if (0 === G.length) B && B.update(), ca = null; else { + ca = Ya.next(b); + t(); + for (var a = G.length - 1; 0 <= a; --a) { + var c = G[a]; + c && c(O, null, 0) + } + k.flush(); + B && B.update() + } + } + + function c() { + !ca && 0 < G.length && (ca = Ya.next(b)) + } + + function e() { + ca && (Ya.cancel(b), ca = null) + } + + function g(a) { + a.preventDefault(); + e(); + U.forEach(function (a) { + a() + }) + } + + function d(a) { + k.getError(); + l.restore(); + Q.restore(); + F.restore(); + A.restore(); + M.restore(); + K.restore(); + B && B.restore(); + V.procs.refresh(); + c(); + W.forEach(function (a) { + a() + }) + } + + function n(a) { + function b(a) { + var c = {}, d = {}; + Object.keys(a).forEach(function (b) { + var e = a[b]; + la.isDynamic(e) ? d[b] = la.unbox(e, b) : c[b] = e + }); + return {dynamic: d, "static": c} + } + + function c(a) { + for (; m.length < a;) m.push(null); + return m + } + + var d = b(a.context || {}), e = b(a.uniforms || {}), f = b(a.attributes || {}), + g = b(function (a) { + function b(a) { + if (a in c) { + var d = c[a]; + delete c[a]; + Object.keys(d).forEach(function (b) { + c[a + "." + b] = d[b] + }) + } + } + + var c = E({}, a); + delete c.uniforms; + delete c.attributes; + delete c.context; + "stencil" in c && c.stencil.op && (c.stencil.opBack = c.stencil.opFront = c.stencil.op, delete c.stencil.op); + b("blend"); + b("depth"); + b("cull"); + b("stencil"); + b("polygonOffset"); + b("scissor"); + b("sample"); + return c + }(a)); + a = {gpuTime: 0, cpuTime: 0, count: 0}; + var d = V.compile(g, f, e, d, a), h = d.draw, k = d.batch, l = d.scope, m = []; + return E(function (a, b) { + var d; + if ("function" === typeof a) return l.call(this, null, a, 0); + if ("function" === typeof b) if ("number" === typeof a) for (d = 0; d < a; ++d) l.call(this, null, b, d); else if (Array.isArray(a)) for (d = 0; d < a.length; ++d) l.call(this, a[d], b, d); else return l.call(this, a, b, 0); else if ("number" === typeof a) { + if (0 < a) return k.call(this, c(a | 0), a | 0) + } else if (Array.isArray(a)) { + if (a.length) return k.call(this, a, a.length) + } else return h.call(this, a) + }, {stats: a}) + } + + function f(a, b) { + var c = 0; + V.procs.poll(); + var d = b.color; + d && (k.clearColor(+d[0] || 0, +d[1] || 0, +d[2] || 0, +d[3] || 0), c |= 16384); + "depth" in b && (k.clearDepth(+b.depth), + c |= 256); + "stencil" in b && (k.clearStencil(b.stencil | 0), c |= 1024); + k.clear(c) + } + + function r(a) { + G.push(a); + c(); + return { + cancel: function () { + function b() { + var a = yb(G, b); + G[a] = G[G.length - 1]; + --G.length; + 0 >= G.length && e() + } + + var c = yb(G, a); + G[c] = b + } + } + } + + function q() { + var a = S.viewport, b = S.scissor_box; + a[0] = a[1] = b[0] = b[1] = 0; + O.viewportWidth = O.framebufferWidth = O.drawingBufferWidth = a[2] = b[2] = k.drawingBufferWidth; + O.viewportHeight = O.framebufferHeight = O.drawingBufferHeight = a[3] = b[3] = k.drawingBufferHeight + } + + function t() { + O.tick += 1; + O.time = y(); + q(); + V.procs.poll() + } + + function m() { + q(); + V.procs.refresh(); + B && B.update() + } + + function y() { + return (zb() - D) / 1E3 + } + + a = Eb(a); + if (!a) return null; + var k = a.gl, h = k.getContextAttributes(); + k.isContextLost(); + var l = Fb(k, a); + if (!l) return null; + var u = Bb(), v = { + bufferCount: 0, + elementsCount: 0, + framebufferCount: 0, + shaderCount: 0, + textureCount: 0, + cubeCount: 0, + renderbufferCount: 0, + maxTextureUnits: 0 + }, x = l.extensions, B = Xb(k, x), D = zb(), J = k.drawingBufferWidth, P = k.drawingBufferHeight, + O = { + tick: 0, + time: 0, + viewportWidth: J, + viewportHeight: P, + framebufferWidth: J, + framebufferHeight: P, + drawingBufferWidth: J, + drawingBufferHeight: P, + pixelRatio: a.pixelRatio + }, R = Vb(k, x), J = Pb(k, x, R, u), F = Gb(k, v, a, J), T = Hb(k, x, F, v), Q = Qb(k, u, v, a), + A = Kb(k, x, R, function () { + V.procs.poll() + }, O, v, a), M = Wb(k, x, R, v, a), K = Ob(k, x, R, A, M, v), + V = Tb(k, u, x, R, F, T, A, K, {}, J, Q, { + elements: null, + primitive: 4, + count: -1, + offset: 0, + instances: -1 + }, O, B, a), u = Rb(k, K, V.procs.poll, O, h, x, R), S = V.next, L = k.canvas, G = [], U = [], + W = [], Z = [a.onDestroy], ca = null; + L && (L.addEventListener("webglcontextlost", g, !1), L.addEventListener("webglcontextrestored", + d, !1)); + var aa = K.setFBO = n({framebuffer: la.define.call(null, 1, "framebuffer")}); + m(); + h = E(n, { + clear: function (a) { + if ("framebuffer" in a) if (a.framebuffer && "framebufferCube" === a.framebuffer_reglType) for (var b = 0; 6 > b; ++b) aa(E({framebuffer: a.framebuffer.faces[b]}, a), f); else aa(a, f); else f(null, a) + }, + prop: la.define.bind(null, 1), + context: la.define.bind(null, 2), + "this": la.define.bind(null, 3), + draw: n({}), + buffer: function (a) { + return F.create(a, 34962, !1, !1) + }, + elements: function (a) { + return T.create(a, !1) + }, + texture: A.create2D, + cube: A.createCube, + renderbuffer: M.create, + framebuffer: K.create, + framebufferCube: K.createCube, + attributes: h, + frame: r, + on: function (a, b) { + var c; + switch (a) { + case "frame": + return r(b); + case "lost": + c = U; + break; + case "restore": + c = W; + break; + case "destroy": + c = Z + } + c.push(b); + return { + cancel: function () { + for (var a = 0; a < c.length; ++a) if (c[a] === b) { + c[a] = c[c.length - 1]; + c.pop(); + break + } + } + } + }, + limits: R, + hasExtension: function (a) { + return 0 <= R.extensions.indexOf(a.toLowerCase()) + }, + read: u, + destroy: function () { + G.length = 0; + e(); + L && (L.removeEventListener("webglcontextlost", g), + L.removeEventListener("webglcontextrestored", d)); + Q.clear(); + K.clear(); + M.clear(); + A.clear(); + T.clear(); + F.clear(); + B && B.clear(); + Z.forEach(function (a) { + a() + }) + }, + _gl: k, + _refresh: m, + poll: function () { + t(); + B && B.update() + }, + now: y, + stats: v + }); + a.onDone(null, h); + return h + } + }); + + }, {}], + 11: [function (require, module, exports) { + (function (global) { + module.exports = + global.performance && + global.performance.now ? function now() { + return performance.now() + } : Date.now || function now() { + return +new Date + } + + }).call(this, typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) + }, {}], + 12: [function (require, module, exports) { + /* eslint-env node */ + 'use strict'; + +// SDP helpers. + var SDPUtils = {}; + +// Generate an alphanumeric identifier for cname or mids. +// TODO: use UUIDs instead? https://gist.github.com/jed/982883 + SDPUtils.generateIdentifier = function () { + return Math.random().toString(36).substr(2, 10); + }; + +// The RTCP CNAME used by all peerconnections from the same JS. + SDPUtils.localCName = SDPUtils.generateIdentifier(); + +// Splits SDP into lines, dealing with both CRLF and LF. + SDPUtils.splitLines = function (blob) { + return blob.trim().split('\n').map(function (line) { + return line.trim(); + }); + }; +// Splits SDP into sessionpart and mediasections. Ensures CRLF. + SDPUtils.splitSections = function (blob) { + var parts = blob.split('\nm='); + return parts.map(function (part, index) { + return (index > 0 ? 'm=' + part : part).trim() + '\r\n'; + }); + }; + +// returns the session description. + SDPUtils.getDescription = function (blob) { + var sections = SDPUtils.splitSections(blob); + return sections && sections[0]; + }; + +// returns the individual media sections. + SDPUtils.getMediaSections = function (blob) { + var sections = SDPUtils.splitSections(blob); + sections.shift(); + return sections; + }; + +// Returns lines that start with a certain prefix. + SDPUtils.matchPrefix = function (blob, prefix) { + return SDPUtils.splitLines(blob).filter(function (line) { + return line.indexOf(prefix) === 0; + }); + }; + +// Parses an ICE candidate line. Sample input: +// candidate:702786350 2 udp 41819902 8.8.8.8 60769 typ relay raddr 8.8.8.8 +// rport 55996" + SDPUtils.parseCandidate = function (line) { + var parts; + // Parse both variants. + if (line.indexOf('a=candidate:') === 0) { + parts = line.substring(12).split(' '); + } else { + parts = line.substring(10).split(' '); + } + + var candidate = { + foundation: parts[0], + component: parseInt(parts[1], 10), + protocol: parts[2].toLowerCase(), + priority: parseInt(parts[3], 10), + ip: parts[4], + address: parts[4], // address is an alias for ip. + port: parseInt(parts[5], 10), + // skip parts[6] == 'typ' + type: parts[7] + }; + + for (var i = 8; i < parts.length; i += 2) { + switch (parts[i]) { + case 'raddr': + candidate.relatedAddress = parts[i + 1]; + break; + case 'rport': + candidate.relatedPort = parseInt(parts[i + 1], 10); + break; + case 'tcptype': + candidate.tcpType = parts[i + 1]; + break; + case 'ufrag': + candidate.ufrag = parts[i + 1]; // for backward compability. + candidate.usernameFragment = parts[i + 1]; + break; + default: // extension handling, in particular ufrag + candidate[parts[i]] = parts[i + 1]; + break; + } + } + return candidate; + }; + +// Translates a candidate object into SDP candidate attribute. + SDPUtils.writeCandidate = function (candidate) { + var sdp = []; + sdp.push(candidate.foundation); + sdp.push(candidate.component); + sdp.push(candidate.protocol.toUpperCase()); + sdp.push(candidate.priority); + sdp.push(candidate.address || candidate.ip); + sdp.push(candidate.port); + + var type = candidate.type; + sdp.push('typ'); + sdp.push(type); + if (type !== 'host' && candidate.relatedAddress && + candidate.relatedPort) { + sdp.push('raddr'); + sdp.push(candidate.relatedAddress); + sdp.push('rport'); + sdp.push(candidate.relatedPort); + } + if (candidate.tcpType && candidate.protocol.toLowerCase() === 'tcp') { + sdp.push('tcptype'); + sdp.push(candidate.tcpType); + } + if (candidate.usernameFragment || candidate.ufrag) { + sdp.push('ufrag'); + sdp.push(candidate.usernameFragment || candidate.ufrag); + } + return 'candidate:' + sdp.join(' '); + }; + +// Parses an ice-options line, returns an array of option tags. +// a=ice-options:foo bar + SDPUtils.parseIceOptions = function (line) { + return line.substr(14).split(' '); + }; + +// Parses an rtpmap line, returns RTCRtpCoddecParameters. Sample input: +// a=rtpmap:111 opus/48000/2 + SDPUtils.parseRtpMap = function (line) { + var parts = line.substr(9).split(' '); + var parsed = { + payloadType: parseInt(parts.shift(), 10) // was: id + }; + + parts = parts[0].split('/'); + + parsed.name = parts[0]; + parsed.clockRate = parseInt(parts[1], 10); // was: clockrate + parsed.channels = parts.length === 3 ? parseInt(parts[2], 10) : 1; + // legacy alias, got renamed back to channels in ORTC. + parsed.numChannels = parsed.channels; + return parsed; + }; + +// Generate an a=rtpmap line from RTCRtpCodecCapability or +// RTCRtpCodecParameters. + SDPUtils.writeRtpMap = function (codec) { + var pt = codec.payloadType; + if (codec.preferredPayloadType !== undefined) { + pt = codec.preferredPayloadType; + } + var channels = codec.channels || codec.numChannels || 1; + return 'a=rtpmap:' + pt + ' ' + codec.name + '/' + codec.clockRate + + (channels !== 1 ? '/' + channels : '') + '\r\n'; + }; + +// Parses an a=extmap line (headerextension from RFC 5285). Sample input: +// a=extmap:2 urn:ietf:params:rtp-hdrext:toffset +// a=extmap:2/sendonly urn:ietf:params:rtp-hdrext:toffset + SDPUtils.parseExtmap = function (line) { + var parts = line.substr(9).split(' '); + return { + id: parseInt(parts[0], 10), + direction: parts[0].indexOf('/') > 0 ? parts[0].split('/')[1] : 'sendrecv', + uri: parts[1] + }; + }; + +// Generates a=extmap line from RTCRtpHeaderExtensionParameters or +// RTCRtpHeaderExtension. + SDPUtils.writeExtmap = function (headerExtension) { + return 'a=extmap:' + (headerExtension.id || headerExtension.preferredId) + + (headerExtension.direction && headerExtension.direction !== 'sendrecv' + ? '/' + headerExtension.direction + : '') + + ' ' + headerExtension.uri + '\r\n'; + }; + +// Parses an ftmp line, returns dictionary. Sample input: +// a=fmtp:96 vbr=on;cng=on +// Also deals with vbr=on; cng=on + SDPUtils.parseFmtp = function (line) { + var parsed = {}; + var kv; + var parts = line.substr(line.indexOf(' ') + 1).split(';'); + for (var j = 0; j < parts.length; j++) { + kv = parts[j].trim().split('='); + parsed[kv[0].trim()] = kv[1]; + } + return parsed; + }; + +// Generates an a=ftmp line from RTCRtpCodecCapability or RTCRtpCodecParameters. + SDPUtils.writeFmtp = function (codec) { + var line = ''; + var pt = codec.payloadType; + if (codec.preferredPayloadType !== undefined) { + pt = codec.preferredPayloadType; + } + if (codec.parameters && Object.keys(codec.parameters).length) { + var params = []; + Object.keys(codec.parameters).forEach(function (param) { + if (codec.parameters[param]) { + params.push(param + '=' + codec.parameters[param]); + } else { + params.push(param); + } + }); + line += 'a=fmtp:' + pt + ' ' + params.join(';') + '\r\n'; + } + return line; + }; + +// Parses an rtcp-fb line, returns RTCPRtcpFeedback object. Sample input: +// a=rtcp-fb:98 nack rpsi + SDPUtils.parseRtcpFb = function (line) { + var parts = line.substr(line.indexOf(' ') + 1).split(' '); + return { + type: parts.shift(), + parameter: parts.join(' ') + }; + }; +// Generate a=rtcp-fb lines from RTCRtpCodecCapability or RTCRtpCodecParameters. + SDPUtils.writeRtcpFb = function (codec) { + var lines = ''; + var pt = codec.payloadType; + if (codec.preferredPayloadType !== undefined) { + pt = codec.preferredPayloadType; + } + if (codec.rtcpFeedback && codec.rtcpFeedback.length) { + // FIXME: special handling for trr-int? + codec.rtcpFeedback.forEach(function (fb) { + lines += 'a=rtcp-fb:' + pt + ' ' + fb.type + + (fb.parameter && fb.parameter.length ? ' ' + fb.parameter : '') + + '\r\n'; + }); + } + return lines; + }; + +// Parses an RFC 5576 ssrc media attribute. Sample input: +// a=ssrc:3735928559 cname:something + SDPUtils.parseSsrcMedia = function (line) { + var sp = line.indexOf(' '); + var parts = { + ssrc: parseInt(line.substr(7, sp - 7), 10) + }; + var colon = line.indexOf(':', sp); + if (colon > -1) { + parts.attribute = line.substr(sp + 1, colon - sp - 1); + parts.value = line.substr(colon + 1); + } else { + parts.attribute = line.substr(sp + 1); + } + return parts; + }; + + SDPUtils.parseSsrcGroup = function (line) { + var parts = line.substr(13).split(' '); + return { + semantics: parts.shift(), + ssrcs: parts.map(function (ssrc) { + return parseInt(ssrc, 10); + }) + }; + }; + +// Extracts the MID (RFC 5888) from a media section. +// returns the MID or undefined if no mid line was found. + SDPUtils.getMid = function (mediaSection) { + var mid = SDPUtils.matchPrefix(mediaSection, 'a=mid:')[0]; + if (mid) { + return mid.substr(6); + } + }; + + SDPUtils.parseFingerprint = function (line) { + var parts = line.substr(14).split(' '); + return { + algorithm: parts[0].toLowerCase(), // algorithm is case-sensitive in Edge. + value: parts[1] + }; + }; + +// Extracts DTLS parameters from SDP media section or sessionpart. +// FIXME: for consistency with other functions this should only +// get the fingerprint line as input. See also getIceParameters. + SDPUtils.getDtlsParameters = function (mediaSection, sessionpart) { + var lines = SDPUtils.matchPrefix(mediaSection + sessionpart, + 'a=fingerprint:'); + // Note: a=setup line is ignored since we use the 'auto' role. + // Note2: 'algorithm' is not case sensitive except in Edge. + return { + role: 'auto', + fingerprints: lines.map(SDPUtils.parseFingerprint) + }; + }; + +// Serializes DTLS parameters to SDP. + SDPUtils.writeDtlsParameters = function (params, setupType) { + var sdp = 'a=setup:' + setupType + '\r\n'; + params.fingerprints.forEach(function (fp) { + sdp += 'a=fingerprint:' + fp.algorithm + ' ' + fp.value + '\r\n'; + }); + return sdp; + }; +// Parses ICE information from SDP media section or sessionpart. +// FIXME: for consistency with other functions this should only +// get the ice-ufrag and ice-pwd lines as input. + SDPUtils.getIceParameters = function (mediaSection, sessionpart) { + var lines = SDPUtils.splitLines(mediaSection); + // Search in session part, too. + lines = lines.concat(SDPUtils.splitLines(sessionpart)); + var iceParameters = { + usernameFragment: lines.filter(function (line) { + return line.indexOf('a=ice-ufrag:') === 0; + })[0].substr(12), + password: lines.filter(function (line) { + return line.indexOf('a=ice-pwd:') === 0; + })[0].substr(10) + }; + return iceParameters; + }; + +// Serializes ICE parameters to SDP. + SDPUtils.writeIceParameters = function (params) { + return 'a=ice-ufrag:' + params.usernameFragment + '\r\n' + + 'a=ice-pwd:' + params.password + '\r\n'; + }; + +// Parses the SDP media section and returns RTCRtpParameters. + SDPUtils.parseRtpParameters = function (mediaSection) { + var description = { + codecs: [], + headerExtensions: [], + fecMechanisms: [], + rtcp: [] + }; + var lines = SDPUtils.splitLines(mediaSection); + var mline = lines[0].split(' '); + for (var i = 3; i < mline.length; i++) { // find all codecs from mline[3..] + var pt = mline[i]; + var rtpmapline = SDPUtils.matchPrefix( + mediaSection, 'a=rtpmap:' + pt + ' ')[0]; + if (rtpmapline) { + var codec = SDPUtils.parseRtpMap(rtpmapline); + var fmtps = SDPUtils.matchPrefix( + mediaSection, 'a=fmtp:' + pt + ' '); + // Only the first a=fmtp: is considered. + codec.parameters = fmtps.length ? SDPUtils.parseFmtp(fmtps[0]) : {}; + codec.rtcpFeedback = SDPUtils.matchPrefix( + mediaSection, 'a=rtcp-fb:' + pt + ' ') + .map(SDPUtils.parseRtcpFb); + description.codecs.push(codec); + // parse FEC mechanisms from rtpmap lines. + switch (codec.name.toUpperCase()) { + case 'RED': + case 'ULPFEC': + description.fecMechanisms.push(codec.name.toUpperCase()); + break; + default: // only RED and ULPFEC are recognized as FEC mechanisms. + break; + } + } + } + SDPUtils.matchPrefix(mediaSection, 'a=extmap:').forEach(function (line) { + description.headerExtensions.push(SDPUtils.parseExtmap(line)); + }); + // FIXME: parse rtcp. + return description; + }; + +// Generates parts of the SDP media section describing the capabilities / +// parameters. + SDPUtils.writeRtpDescription = function (kind, caps) { + var sdp = ''; + + // Build the mline. + sdp += 'm=' + kind + ' '; + sdp += caps.codecs.length > 0 ? '9' : '0'; // reject if no codecs. + sdp += ' UDP/TLS/RTP/SAVPF '; + sdp += caps.codecs.map(function (codec) { + if (codec.preferredPayloadType !== undefined) { + return codec.preferredPayloadType; + } + return codec.payloadType; + }).join(' ') + '\r\n'; + + sdp += 'c=IN IP4 0.0.0.0\r\n'; + sdp += 'a=rtcp:9 IN IP4 0.0.0.0\r\n'; + + // Add a=rtpmap lines for each codec. Also fmtp and rtcp-fb. + caps.codecs.forEach(function (codec) { + sdp += SDPUtils.writeRtpMap(codec); + sdp += SDPUtils.writeFmtp(codec); + sdp += SDPUtils.writeRtcpFb(codec); + }); + var maxptime = 0; + caps.codecs.forEach(function (codec) { + if (codec.maxptime > maxptime) { + maxptime = codec.maxptime; + } + }); + if (maxptime > 0) { + sdp += 'a=maxptime:' + maxptime + '\r\n'; + } + sdp += 'a=rtcp-mux\r\n'; + + if (caps.headerExtensions) { + caps.headerExtensions.forEach(function (extension) { + sdp += SDPUtils.writeExtmap(extension); + }); + } + // FIXME: write fecMechanisms. + return sdp; + }; + +// Parses the SDP media section and returns an array of +// RTCRtpEncodingParameters. + SDPUtils.parseRtpEncodingParameters = function (mediaSection) { + var encodingParameters = []; + var description = SDPUtils.parseRtpParameters(mediaSection); + var hasRed = description.fecMechanisms.indexOf('RED') !== -1; + var hasUlpfec = description.fecMechanisms.indexOf('ULPFEC') !== -1; + + // filter a=ssrc:... cname:, ignore PlanB-msid + var ssrcs = SDPUtils.matchPrefix(mediaSection, 'a=ssrc:') + .map(function (line) { + return SDPUtils.parseSsrcMedia(line); + }) + .filter(function (parts) { + return parts.attribute === 'cname'; + }); + var primarySsrc = ssrcs.length > 0 && ssrcs[0].ssrc; + var secondarySsrc; + + var flows = SDPUtils.matchPrefix(mediaSection, 'a=ssrc-group:FID') + .map(function (line) { + var parts = line.substr(17).split(' '); + return parts.map(function (part) { + return parseInt(part, 10); + }); + }); + if (flows.length > 0 && flows[0].length > 1 && flows[0][0] === primarySsrc) { + secondarySsrc = flows[0][1]; + } + + description.codecs.forEach(function (codec) { + if (codec.name.toUpperCase() === 'RTX' && codec.parameters.apt) { + var encParam = { + ssrc: primarySsrc, + codecPayloadType: parseInt(codec.parameters.apt, 10) + }; + if (primarySsrc && secondarySsrc) { + encParam.rtx = {ssrc: secondarySsrc}; + } + encodingParameters.push(encParam); + if (hasRed) { + encParam = JSON.parse(JSON.stringify(encParam)); + encParam.fec = { + ssrc: primarySsrc, + mechanism: hasUlpfec ? 'red+ulpfec' : 'red' + }; + encodingParameters.push(encParam); + } + } + }); + if (encodingParameters.length === 0 && primarySsrc) { + encodingParameters.push({ + ssrc: primarySsrc + }); + } + + // we support both b=AS and b=TIAS but interpret AS as TIAS. + var bandwidth = SDPUtils.matchPrefix(mediaSection, 'b='); + if (bandwidth.length) { + if (bandwidth[0].indexOf('b=TIAS:') === 0) { + bandwidth = parseInt(bandwidth[0].substr(7), 10); + } else if (bandwidth[0].indexOf('b=AS:') === 0) { + // use formula from JSEP to convert b=AS to TIAS value. + bandwidth = parseInt(bandwidth[0].substr(5), 10) * 1000 * 0.95 + - (50 * 40 * 8); + } else { + bandwidth = undefined; + } + encodingParameters.forEach(function (params) { + params.maxBitrate = bandwidth; + }); + } + return encodingParameters; + }; + +// parses http://draft.ortc.org/#rtcrtcpparameters* + SDPUtils.parseRtcpParameters = function (mediaSection) { + var rtcpParameters = {}; + + // Gets the first SSRC. Note tha with RTX there might be multiple + // SSRCs. + var remoteSsrc = SDPUtils.matchPrefix(mediaSection, 'a=ssrc:') + .map(function (line) { + return SDPUtils.parseSsrcMedia(line); + }) + .filter(function (obj) { + return obj.attribute === 'cname'; + })[0]; + if (remoteSsrc) { + rtcpParameters.cname = remoteSsrc.value; + rtcpParameters.ssrc = remoteSsrc.ssrc; + } + + // Edge uses the compound attribute instead of reducedSize + // compound is !reducedSize + var rsize = SDPUtils.matchPrefix(mediaSection, 'a=rtcp-rsize'); + rtcpParameters.reducedSize = rsize.length > 0; + rtcpParameters.compound = rsize.length === 0; + + // parses the rtcp-mux attrіbute. + // Note that Edge does not support unmuxed RTCP. + var mux = SDPUtils.matchPrefix(mediaSection, 'a=rtcp-mux'); + rtcpParameters.mux = mux.length > 0; + + return rtcpParameters; + }; + +// parses either a=msid: or a=ssrc:... msid lines and returns +// the id of the MediaStream and MediaStreamTrack. + SDPUtils.parseMsid = function (mediaSection) { + var parts; + var spec = SDPUtils.matchPrefix(mediaSection, 'a=msid:'); + if (spec.length === 1) { + parts = spec[0].substr(7).split(' '); + return {stream: parts[0], track: parts[1]}; + } + var planB = SDPUtils.matchPrefix(mediaSection, 'a=ssrc:') + .map(function (line) { + return SDPUtils.parseSsrcMedia(line); + }) + .filter(function (msidParts) { + return msidParts.attribute === 'msid'; + }); + if (planB.length > 0) { + parts = planB[0].value.split(' '); + return {stream: parts[0], track: parts[1]}; + } + }; + +// Generate a session ID for SDP. +// https://tools.ietf.org/html/draft-ietf-rtcweb-jsep-20#section-5.2.1 +// recommends using a cryptographically random +ve 64-bit value +// but right now this should be acceptable and within the right range + SDPUtils.generateSessionId = function () { + return Math.random().toString().substr(2, 21); + }; + +// Write boilder plate for start of SDP +// sessId argument is optional - if not supplied it will +// be generated randomly +// sessVersion is optional and defaults to 2 +// sessUser is optional and defaults to 'thisisadapterortc' + SDPUtils.writeSessionBoilerplate = function (sessId, sessVer, sessUser) { + var sessionId; + var version = sessVer !== undefined ? sessVer : 2; + if (sessId) { + sessionId = sessId; + } else { + sessionId = SDPUtils.generateSessionId(); + } + var user = sessUser || 'thisisadapterortc'; + // FIXME: sess-id should be an NTP timestamp. + return 'v=0\r\n' + + 'o=' + user + ' ' + sessionId + ' ' + version + + ' IN IP4 127.0.0.1\r\n' + + 's=-\r\n' + + 't=0 0\r\n'; + }; + + SDPUtils.writeMediaSection = function (transceiver, caps, type, stream) { + var sdp = SDPUtils.writeRtpDescription(transceiver.kind, caps); + + // Map ICE parameters (ufrag, pwd) to SDP. + sdp += SDPUtils.writeIceParameters( + transceiver.iceGatherer.getLocalParameters()); + + // Map DTLS parameters to SDP. + sdp += SDPUtils.writeDtlsParameters( + transceiver.dtlsTransport.getLocalParameters(), + type === 'offer' ? 'actpass' : 'active'); + + sdp += 'a=mid:' + transceiver.mid + '\r\n'; + + if (transceiver.direction) { + sdp += 'a=' + transceiver.direction + '\r\n'; + } else if (transceiver.rtpSender && transceiver.rtpReceiver) { + sdp += 'a=sendrecv\r\n'; + } else if (transceiver.rtpSender) { + sdp += 'a=sendonly\r\n'; + } else if (transceiver.rtpReceiver) { + sdp += 'a=recvonly\r\n'; + } else { + sdp += 'a=inactive\r\n'; + } + + if (transceiver.rtpSender) { + // spec. + var msid = 'msid:' + stream.id + ' ' + + transceiver.rtpSender.track.id + '\r\n'; + sdp += 'a=' + msid; + + // for Chrome. + sdp += 'a=ssrc:' + transceiver.sendEncodingParameters[0].ssrc + + ' ' + msid; + if (transceiver.sendEncodingParameters[0].rtx) { + sdp += 'a=ssrc:' + transceiver.sendEncodingParameters[0].rtx.ssrc + + ' ' + msid; + sdp += 'a=ssrc-group:FID ' + + transceiver.sendEncodingParameters[0].ssrc + ' ' + + transceiver.sendEncodingParameters[0].rtx.ssrc + + '\r\n'; + } + } + // FIXME: this should be written by writeRtpDescription. + sdp += 'a=ssrc:' + transceiver.sendEncodingParameters[0].ssrc + + ' cname:' + SDPUtils.localCName + '\r\n'; + if (transceiver.rtpSender && transceiver.sendEncodingParameters[0].rtx) { + sdp += 'a=ssrc:' + transceiver.sendEncodingParameters[0].rtx.ssrc + + ' cname:' + SDPUtils.localCName + '\r\n'; + } + return sdp; + }; + +// Gets the direction from the mediaSection or the sessionpart. + SDPUtils.getDirection = function (mediaSection, sessionpart) { + // Look for sendrecv, sendonly, recvonly, inactive, default to sendrecv. + var lines = SDPUtils.splitLines(mediaSection); + for (var i = 0; i < lines.length; i++) { + switch (lines[i]) { + case 'a=sendrecv': + case 'a=sendonly': + case 'a=recvonly': + case 'a=inactive': + return lines[i].substr(2); + default: + // FIXME: What should happen here? + } + } + if (sessionpart) { + return SDPUtils.getDirection(sessionpart); + } + return 'sendrecv'; + }; + + SDPUtils.getKind = function (mediaSection) { + var lines = SDPUtils.splitLines(mediaSection); + var mline = lines[0].split(' '); + return mline[0].substr(2); + }; + + SDPUtils.isRejected = function (mediaSection) { + return mediaSection.split(' ', 2)[1] === '0'; + }; + + SDPUtils.parseMLine = function (mediaSection) { + var lines = SDPUtils.splitLines(mediaSection); + var parts = lines[0].substr(2).split(' '); + return { + kind: parts[0], + port: parseInt(parts[1], 10), + protocol: parts[2], + fmt: parts.slice(3).join(' ') + }; + }; + + SDPUtils.parseOLine = function (mediaSection) { + var line = SDPUtils.matchPrefix(mediaSection, 'o=')[0]; + var parts = line.substr(2).split(' '); + return { + username: parts[0], + sessionId: parts[1], + sessionVersion: parseInt(parts[2], 10), + netType: parts[3], + addressType: parts[4], + address: parts[5] + }; + }; + +// a very naive interpretation of a valid SDP. + SDPUtils.isValidSDP = function (blob) { + if (typeof blob !== 'string' || blob.length === 0) { + return false; + } + var lines = SDPUtils.splitLines(blob); + for (var i = 0; i < lines.length; i++) { + if (lines[i].length < 2 || lines[i].charAt(1) !== '=') { + return false; + } + // TODO: check the modifier a bit more. + } + return true; + }; + +// Expose public methods. + if (typeof module === 'object') { + module.exports = SDPUtils; + } + + }, {}], + 13: [function (require, module, exports) { + /* + * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. + */ + /* eslint-env node */ + 'use strict'; + + var SDPUtils = require('sdp'); + + function fixStatsType(stat) { + return { + inboundrtp: 'inbound-rtp', + outboundrtp: 'outbound-rtp', + candidatepair: 'candidate-pair', + localcandidate: 'local-candidate', + remotecandidate: 'remote-candidate' + }[stat.type] || stat.type; + } + + function writeMediaSection(transceiver, caps, type, stream, dtlsRole) { + var sdp = SDPUtils.writeRtpDescription(transceiver.kind, caps); + + // Map ICE parameters (ufrag, pwd) to SDP. + sdp += SDPUtils.writeIceParameters( + transceiver.iceGatherer.getLocalParameters()); + + // Map DTLS parameters to SDP. + sdp += SDPUtils.writeDtlsParameters( + transceiver.dtlsTransport.getLocalParameters(), + type === 'offer' ? 'actpass' : dtlsRole || 'active'); + + sdp += 'a=mid:' + transceiver.mid + '\r\n'; + + if (transceiver.rtpSender && transceiver.rtpReceiver) { + sdp += 'a=sendrecv\r\n'; + } else if (transceiver.rtpSender) { + sdp += 'a=sendonly\r\n'; + } else if (transceiver.rtpReceiver) { + sdp += 'a=recvonly\r\n'; + } else { + sdp += 'a=inactive\r\n'; + } + + if (transceiver.rtpSender) { + var trackId = transceiver.rtpSender._initialTrackId || + transceiver.rtpSender.track.id; + transceiver.rtpSender._initialTrackId = trackId; + // spec. + var msid = 'msid:' + (stream ? stream.id : '-') + ' ' + + trackId + '\r\n'; + sdp += 'a=' + msid; + // for Chrome. Legacy should no longer be required. + sdp += 'a=ssrc:' + transceiver.sendEncodingParameters[0].ssrc + + ' ' + msid; + + // RTX + if (transceiver.sendEncodingParameters[0].rtx) { + sdp += 'a=ssrc:' + transceiver.sendEncodingParameters[0].rtx.ssrc + + ' ' + msid; + sdp += 'a=ssrc-group:FID ' + + transceiver.sendEncodingParameters[0].ssrc + ' ' + + transceiver.sendEncodingParameters[0].rtx.ssrc + + '\r\n'; + } + } + // FIXME: this should be written by writeRtpDescription. + sdp += 'a=ssrc:' + transceiver.sendEncodingParameters[0].ssrc + + ' cname:' + SDPUtils.localCName + '\r\n'; + if (transceiver.rtpSender && transceiver.sendEncodingParameters[0].rtx) { + sdp += 'a=ssrc:' + transceiver.sendEncodingParameters[0].rtx.ssrc + + ' cname:' + SDPUtils.localCName + '\r\n'; + } + return sdp; + } + +// Edge does not like +// 1) stun: filtered after 14393 unless ?transport=udp is present +// 2) turn: that does not have all of turn:host:port?transport=udp +// 3) turn: with ipv6 addresses +// 4) turn: occurring muliple times + function filterIceServers(iceServers, edgeVersion) { + var hasTurn = false; + iceServers = JSON.parse(JSON.stringify(iceServers)); + return iceServers.filter(function (server) { + if (server && (server.urls || server.url)) { + var urls = server.urls || server.url; + if (server.url && !server.urls) { + console.warn('RTCIceServer.url is deprecated! Use urls instead.'); + } + var isString = typeof urls === 'string'; + if (isString) { + urls = [urls]; + } + urls = urls.filter(function (url) { + var validTurn = url.indexOf('turn:') === 0 && + url.indexOf('transport=udp') !== -1 && + url.indexOf('turn:[') === -1 && + !hasTurn; + + if (validTurn) { + hasTurn = true; + return true; + } + return url.indexOf('stun:') === 0 && edgeVersion >= 14393 && + url.indexOf('?transport=udp') === -1; + }); + + delete server.url; + server.urls = isString ? urls[0] : urls; + return !!urls.length; + } + }); + } + +// Determines the intersection of local and remote capabilities. + function getCommonCapabilities(localCapabilities, remoteCapabilities) { + var commonCapabilities = { + codecs: [], + headerExtensions: [], + fecMechanisms: [] + }; + + var findCodecByPayloadType = function (pt, codecs) { + pt = parseInt(pt, 10); + for (var i = 0; i < codecs.length; i++) { + if (codecs[i].payloadType === pt || + codecs[i].preferredPayloadType === pt) { + return codecs[i]; + } + } + }; + + var rtxCapabilityMatches = function (lRtx, rRtx, lCodecs, rCodecs) { + var lCodec = findCodecByPayloadType(lRtx.parameters.apt, lCodecs); + var rCodec = findCodecByPayloadType(rRtx.parameters.apt, rCodecs); + return lCodec && rCodec && + lCodec.name.toLowerCase() === rCodec.name.toLowerCase(); + }; + + localCapabilities.codecs.forEach(function (lCodec) { + for (var i = 0; i < remoteCapabilities.codecs.length; i++) { + var rCodec = remoteCapabilities.codecs[i]; + if (lCodec.name.toLowerCase() === rCodec.name.toLowerCase() && + lCodec.clockRate === rCodec.clockRate) { + if (lCodec.name.toLowerCase() === 'rtx' && + lCodec.parameters && rCodec.parameters.apt) { + // for RTX we need to find the local rtx that has a apt + // which points to the same local codec as the remote one. + if (!rtxCapabilityMatches(lCodec, rCodec, + localCapabilities.codecs, remoteCapabilities.codecs)) { + continue; + } + } + rCodec = JSON.parse(JSON.stringify(rCodec)); // deepcopy + // number of channels is the highest common number of channels + rCodec.numChannels = Math.min(lCodec.numChannels, + rCodec.numChannels); + // push rCodec so we reply with offerer payload type + commonCapabilities.codecs.push(rCodec); + + // determine common feedback mechanisms + rCodec.rtcpFeedback = rCodec.rtcpFeedback.filter(function (fb) { + for (var j = 0; j < lCodec.rtcpFeedback.length; j++) { + if (lCodec.rtcpFeedback[j].type === fb.type && + lCodec.rtcpFeedback[j].parameter === fb.parameter) { + return true; + } + } + return false; + }); + // FIXME: also need to determine .parameters + // see https://github.com/openpeer/ortc/issues/569 + break; + } + } + }); + + localCapabilities.headerExtensions.forEach(function (lHeaderExtension) { + for (var i = 0; i < remoteCapabilities.headerExtensions.length; + i++) { + var rHeaderExtension = remoteCapabilities.headerExtensions[i]; + if (lHeaderExtension.uri === rHeaderExtension.uri) { + commonCapabilities.headerExtensions.push(rHeaderExtension); + break; + } + } + }); + + // FIXME: fecMechanisms + return commonCapabilities; + } + +// is action=setLocalDescription with type allowed in signalingState + function isActionAllowedInSignalingState(action, type, signalingState) { + return { + offer: { + setLocalDescription: ['stable', 'have-local-offer'], + setRemoteDescription: ['stable', 'have-remote-offer'] + }, + answer: { + setLocalDescription: ['have-remote-offer', 'have-local-pranswer'], + setRemoteDescription: ['have-local-offer', 'have-remote-pranswer'] + } + }[type][action].indexOf(signalingState) !== -1; + } + + function maybeAddCandidate(iceTransport, candidate) { + // Edge's internal representation adds some fields therefore + // not all fieldѕ are taken into account. + var alreadyAdded = iceTransport.getRemoteCandidates() + .find(function (remoteCandidate) { + return candidate.foundation === remoteCandidate.foundation && + candidate.ip === remoteCandidate.ip && + candidate.port === remoteCandidate.port && + candidate.priority === remoteCandidate.priority && + candidate.protocol === remoteCandidate.protocol && + candidate.type === remoteCandidate.type; + }); + if (!alreadyAdded) { + iceTransport.addRemoteCandidate(candidate); + } + return !alreadyAdded; + } + + + function makeError(name, description) { + var e = new Error(description); + e.name = name; + // legacy error codes from https://heycam.github.io/webidl/#idl-DOMException-error-names + e.code = { + NotSupportedError: 9, + InvalidStateError: 11, + InvalidAccessError: 15, + TypeError: undefined, + OperationError: undefined + }[name]; + return e; + } + + module.exports = function (window, edgeVersion) { + // https://w3c.github.io/mediacapture-main/#mediastream + // Helper function to add the track to the stream and + // dispatch the event ourselves. + function addTrackToStreamAndFireEvent(track, stream) { + stream.addTrack(track); + stream.dispatchEvent(new window.MediaStreamTrackEvent('addtrack', + {track: track})); + } + + function removeTrackFromStreamAndFireEvent(track, stream) { + stream.removeTrack(track); + stream.dispatchEvent(new window.MediaStreamTrackEvent('removetrack', + {track: track})); + } + + function fireAddTrack(pc, track, receiver, streams) { + var trackEvent = new Event('track'); + trackEvent.track = track; + trackEvent.receiver = receiver; + trackEvent.transceiver = {receiver: receiver}; + trackEvent.streams = streams; + window.setTimeout(function () { + pc._dispatchEvent('track', trackEvent); + }); + } + + var RTCPeerConnection = function (config) { + var pc = this; + + var _eventTarget = document.createDocumentFragment(); + ['addEventListener', 'removeEventListener', 'dispatchEvent'] + .forEach(function (method) { + pc[method] = _eventTarget[method].bind(_eventTarget); + }); + + this.canTrickleIceCandidates = null; + + this.needNegotiation = false; + + this.localStreams = []; + this.remoteStreams = []; + + this._localDescription = null; + this._remoteDescription = null; + + this.signalingState = 'stable'; + this.iceConnectionState = 'new'; + this.connectionState = 'new'; + this.iceGatheringState = 'new'; + + config = JSON.parse(JSON.stringify(config || {})); + + this.usingBundle = config.bundlePolicy === 'max-bundle'; + if (config.rtcpMuxPolicy === 'negotiate') { + throw(makeError('NotSupportedError', + 'rtcpMuxPolicy \'negotiate\' is not supported')); + } else if (!config.rtcpMuxPolicy) { + config.rtcpMuxPolicy = 'require'; + } + + switch (config.iceTransportPolicy) { + case 'all': + case 'relay': + break; + default: + config.iceTransportPolicy = 'all'; + break; + } + + switch (config.bundlePolicy) { + case 'balanced': + case 'max-compat': + case 'max-bundle': + break; + default: + config.bundlePolicy = 'balanced'; + break; + } + + config.iceServers = filterIceServers(config.iceServers || [], edgeVersion); + + this._iceGatherers = []; + if (config.iceCandidatePoolSize) { + for (var i = config.iceCandidatePoolSize; i > 0; i--) { + this._iceGatherers.push(new window.RTCIceGatherer({ + iceServers: config.iceServers, + gatherPolicy: config.iceTransportPolicy + })); + } + } else { + config.iceCandidatePoolSize = 0; + } + + this._config = config; + + // per-track iceGathers, iceTransports, dtlsTransports, rtpSenders, ... + // everything that is needed to describe a SDP m-line. + this.transceivers = []; + + this._sdpSessionId = SDPUtils.generateSessionId(); + this._sdpSessionVersion = 0; + + this._dtlsRole = undefined; // role for a=setup to use in answers. + + this._isClosed = false; + }; + + Object.defineProperty(RTCPeerConnection.prototype, 'localDescription', { + configurable: true, + get: function () { + return this._localDescription; + } + }); + Object.defineProperty(RTCPeerConnection.prototype, 'remoteDescription', { + configurable: true, + get: function () { + return this._remoteDescription; + } + }); + + // set up event handlers on prototype + RTCPeerConnection.prototype.onicecandidate = null; + RTCPeerConnection.prototype.onaddstream = null; + RTCPeerConnection.prototype.ontrack = null; + RTCPeerConnection.prototype.onremovestream = null; + RTCPeerConnection.prototype.onsignalingstatechange = null; + RTCPeerConnection.prototype.oniceconnectionstatechange = null; + RTCPeerConnection.prototype.onconnectionstatechange = null; + RTCPeerConnection.prototype.onicegatheringstatechange = null; + RTCPeerConnection.prototype.onnegotiationneeded = null; + RTCPeerConnection.prototype.ondatachannel = null; + + RTCPeerConnection.prototype._dispatchEvent = function (name, event) { + if (this._isClosed) { + return; + } + this.dispatchEvent(event); + if (typeof this['on' + name] === 'function') { + this['on' + name](event); + } + }; + + RTCPeerConnection.prototype._emitGatheringStateChange = function () { + var event = new Event('icegatheringstatechange'); + this._dispatchEvent('icegatheringstatechange', event); + }; + + RTCPeerConnection.prototype.getConfiguration = function () { + return this._config; + }; + + RTCPeerConnection.prototype.getLocalStreams = function () { + return this.localStreams; + }; + + RTCPeerConnection.prototype.getRemoteStreams = function () { + return this.remoteStreams; + }; + + // internal helper to create a transceiver object. + // (which is not yet the same as the WebRTC 1.0 transceiver) + RTCPeerConnection.prototype._createTransceiver = function (kind, doNotAdd) { + var hasBundleTransport = this.transceivers.length > 0; + var transceiver = { + track: null, + iceGatherer: null, + iceTransport: null, + dtlsTransport: null, + localCapabilities: null, + remoteCapabilities: null, + rtpSender: null, + rtpReceiver: null, + kind: kind, + mid: null, + sendEncodingParameters: null, + recvEncodingParameters: null, + stream: null, + associatedRemoteMediaStreams: [], + wantReceive: true + }; + if (this.usingBundle && hasBundleTransport) { + transceiver.iceTransport = this.transceivers[0].iceTransport; + transceiver.dtlsTransport = this.transceivers[0].dtlsTransport; + } else { + var transports = this._createIceAndDtlsTransports(); + transceiver.iceTransport = transports.iceTransport; + transceiver.dtlsTransport = transports.dtlsTransport; + } + if (!doNotAdd) { + this.transceivers.push(transceiver); + } + return transceiver; + }; + + RTCPeerConnection.prototype.addTrack = function (track, stream) { + if (this._isClosed) { + throw makeError('InvalidStateError', + 'Attempted to call addTrack on a closed peerconnection.'); + } + + var alreadyExists = this.transceivers.find(function (s) { + return s.track === track; + }); + + if (alreadyExists) { + throw makeError('InvalidAccessError', 'Track already exists.'); + } + + var transceiver; + for (var i = 0; i < this.transceivers.length; i++) { + if (!this.transceivers[i].track && + this.transceivers[i].kind === track.kind) { + transceiver = this.transceivers[i]; + } + } + if (!transceiver) { + transceiver = this._createTransceiver(track.kind); + } + + this._maybeFireNegotiationNeeded(); + + if (this.localStreams.indexOf(stream) === -1) { + this.localStreams.push(stream); + } + + transceiver.track = track; + transceiver.stream = stream; + transceiver.rtpSender = new window.RTCRtpSender(track, + transceiver.dtlsTransport); + return transceiver.rtpSender; + }; + + RTCPeerConnection.prototype.addStream = function (stream) { + var pc = this; + if (edgeVersion >= 15025) { + stream.getTracks().forEach(function (track) { + pc.addTrack(track, stream); + }); + } else { + // Clone is necessary for local demos mostly, attaching directly + // to two different senders does not work (build 10547). + // Fixed in 15025 (or earlier) + var clonedStream = stream.clone(); + stream.getTracks().forEach(function (track, idx) { + var clonedTrack = clonedStream.getTracks()[idx]; + track.addEventListener('enabled', function (event) { + clonedTrack.enabled = event.enabled; + }); + }); + clonedStream.getTracks().forEach(function (track) { + pc.addTrack(track, clonedStream); + }); + } + }; + + RTCPeerConnection.prototype.removeTrack = function (sender) { + if (this._isClosed) { + throw makeError('InvalidStateError', + 'Attempted to call removeTrack on a closed peerconnection.'); + } + + if (!(sender instanceof window.RTCRtpSender)) { + throw new TypeError('Argument 1 of RTCPeerConnection.removeTrack ' + + 'does not implement interface RTCRtpSender.'); + } + + var transceiver = this.transceivers.find(function (t) { + return t.rtpSender === sender; + }); + + if (!transceiver) { + throw makeError('InvalidAccessError', + 'Sender was not created by this connection.'); + } + var stream = transceiver.stream; + + transceiver.rtpSender.stop(); + transceiver.rtpSender = null; + transceiver.track = null; + transceiver.stream = null; + + // remove the stream from the set of local streams + var localStreams = this.transceivers.map(function (t) { + return t.stream; + }); + if (localStreams.indexOf(stream) === -1 && + this.localStreams.indexOf(stream) > -1) { + this.localStreams.splice(this.localStreams.indexOf(stream), 1); + } + + this._maybeFireNegotiationNeeded(); + }; + + RTCPeerConnection.prototype.removeStream = function (stream) { + var pc = this; + stream.getTracks().forEach(function (track) { + var sender = pc.getSenders().find(function (s) { + return s.track === track; + }); + if (sender) { + pc.removeTrack(sender); + } + }); + }; + + RTCPeerConnection.prototype.getSenders = function () { + return this.transceivers.filter(function (transceiver) { + return !!transceiver.rtpSender; + }) + .map(function (transceiver) { + return transceiver.rtpSender; + }); + }; + + RTCPeerConnection.prototype.getReceivers = function () { + return this.transceivers.filter(function (transceiver) { + return !!transceiver.rtpReceiver; + }) + .map(function (transceiver) { + return transceiver.rtpReceiver; + }); + }; + + + RTCPeerConnection.prototype._createIceGatherer = function (sdpMLineIndex, + usingBundle) { + var pc = this; + if (usingBundle && sdpMLineIndex > 0) { + return this.transceivers[0].iceGatherer; + } else if (this._iceGatherers.length) { + return this._iceGatherers.shift(); + } + var iceGatherer = new window.RTCIceGatherer({ + iceServers: this._config.iceServers, + gatherPolicy: this._config.iceTransportPolicy + }); + Object.defineProperty(iceGatherer, 'state', + {value: 'new', writable: true} + ); + + this.transceivers[sdpMLineIndex].bufferedCandidateEvents = []; + this.transceivers[sdpMLineIndex].bufferCandidates = function (event) { + var end = !event.candidate || Object.keys(event.candidate).length === 0; + // polyfill since RTCIceGatherer.state is not implemented in + // Edge 10547 yet. + iceGatherer.state = end ? 'completed' : 'gathering'; + if (pc.transceivers[sdpMLineIndex].bufferedCandidateEvents !== null) { + pc.transceivers[sdpMLineIndex].bufferedCandidateEvents.push(event); + } + }; + iceGatherer.addEventListener('localcandidate', + this.transceivers[sdpMLineIndex].bufferCandidates); + return iceGatherer; + }; + + // start gathering from an RTCIceGatherer. + RTCPeerConnection.prototype._gather = function (mid, sdpMLineIndex) { + var pc = this; + var iceGatherer = this.transceivers[sdpMLineIndex].iceGatherer; + if (iceGatherer.onlocalcandidate) { + return; + } + var bufferedCandidateEvents = + this.transceivers[sdpMLineIndex].bufferedCandidateEvents; + this.transceivers[sdpMLineIndex].bufferedCandidateEvents = null; + iceGatherer.removeEventListener('localcandidate', + this.transceivers[sdpMLineIndex].bufferCandidates); + iceGatherer.onlocalcandidate = function (evt) { + if (pc.usingBundle && sdpMLineIndex > 0) { + // if we know that we use bundle we can drop candidates with + // ѕdpMLineIndex > 0. If we don't do this then our state gets + // confused since we dispose the extra ice gatherer. + return; + } + var event = new Event('icecandidate'); + event.candidate = {sdpMid: mid, sdpMLineIndex: sdpMLineIndex}; + + var cand = evt.candidate; + // Edge emits an empty object for RTCIceCandidateComplete‥ + var end = !cand || Object.keys(cand).length === 0; + if (end) { + // polyfill since RTCIceGatherer.state is not implemented in + // Edge 10547 yet. + if (iceGatherer.state === 'new' || iceGatherer.state === 'gathering') { + iceGatherer.state = 'completed'; + } + } else { + if (iceGatherer.state === 'new') { + iceGatherer.state = 'gathering'; + } + // RTCIceCandidate doesn't have a component, needs to be added + cand.component = 1; + // also the usernameFragment. TODO: update SDP to take both variants. + cand.ufrag = iceGatherer.getLocalParameters().usernameFragment; + + var serializedCandidate = SDPUtils.writeCandidate(cand); + event.candidate = Object.assign(event.candidate, + SDPUtils.parseCandidate(serializedCandidate)); + + event.candidate.candidate = serializedCandidate; + event.candidate.toJSON = function () { + return { + candidate: event.candidate.candidate, + sdpMid: event.candidate.sdpMid, + sdpMLineIndex: event.candidate.sdpMLineIndex, + usernameFragment: event.candidate.usernameFragment + }; + }; + } + + // update local description. + var sections = SDPUtils.getMediaSections(pc._localDescription.sdp); + if (!end) { + sections[event.candidate.sdpMLineIndex] += + 'a=' + event.candidate.candidate + '\r\n'; + } else { + sections[event.candidate.sdpMLineIndex] += + 'a=end-of-candidates\r\n'; + } + pc._localDescription.sdp = + SDPUtils.getDescription(pc._localDescription.sdp) + + sections.join(''); + var complete = pc.transceivers.every(function (transceiver) { + return transceiver.iceGatherer && + transceiver.iceGatherer.state === 'completed'; + }); + + if (pc.iceGatheringState !== 'gathering') { + pc.iceGatheringState = 'gathering'; + pc._emitGatheringStateChange(); + } + + // Emit candidate. Also emit null candidate when all gatherers are + // complete. + if (!end) { + pc._dispatchEvent('icecandidate', event); + } + if (complete) { + pc._dispatchEvent('icecandidate', new Event('icecandidate')); + pc.iceGatheringState = 'complete'; + pc._emitGatheringStateChange(); + } + }; + + // emit already gathered candidates. + window.setTimeout(function () { + bufferedCandidateEvents.forEach(function (e) { + iceGatherer.onlocalcandidate(e); + }); + }, 0); + }; + + // Create ICE transport and DTLS transport. + RTCPeerConnection.prototype._createIceAndDtlsTransports = function () { + var pc = this; + var iceTransport = new window.RTCIceTransport(null); + iceTransport.onicestatechange = function () { + pc._updateIceConnectionState(); + pc._updateConnectionState(); + }; + + var dtlsTransport = new window.RTCDtlsTransport(iceTransport); + dtlsTransport.ondtlsstatechange = function () { + pc._updateConnectionState(); + }; + dtlsTransport.onerror = function () { + // onerror does not set state to failed by itself. + Object.defineProperty(dtlsTransport, 'state', + {value: 'failed', writable: true}); + pc._updateConnectionState(); + }; + + return { + iceTransport: iceTransport, + dtlsTransport: dtlsTransport + }; + }; + + // Destroy ICE gatherer, ICE transport and DTLS transport. + // Without triggering the callbacks. + RTCPeerConnection.prototype._disposeIceAndDtlsTransports = function ( + sdpMLineIndex) { + var iceGatherer = this.transceivers[sdpMLineIndex].iceGatherer; + if (iceGatherer) { + delete iceGatherer.onlocalcandidate; + delete this.transceivers[sdpMLineIndex].iceGatherer; + } + var iceTransport = this.transceivers[sdpMLineIndex].iceTransport; + if (iceTransport) { + delete iceTransport.onicestatechange; + delete this.transceivers[sdpMLineIndex].iceTransport; + } + var dtlsTransport = this.transceivers[sdpMLineIndex].dtlsTransport; + if (dtlsTransport) { + delete dtlsTransport.ondtlsstatechange; + delete dtlsTransport.onerror; + delete this.transceivers[sdpMLineIndex].dtlsTransport; + } + }; + + // Start the RTP Sender and Receiver for a transceiver. + RTCPeerConnection.prototype._transceive = function (transceiver, + send, recv) { + var params = getCommonCapabilities(transceiver.localCapabilities, + transceiver.remoteCapabilities); + if (send && transceiver.rtpSender) { + params.encodings = transceiver.sendEncodingParameters; + params.rtcp = { + cname: SDPUtils.localCName, + compound: transceiver.rtcpParameters.compound + }; + if (transceiver.recvEncodingParameters.length) { + params.rtcp.ssrc = transceiver.recvEncodingParameters[0].ssrc; + } + transceiver.rtpSender.send(params); + } + if (recv && transceiver.rtpReceiver && params.codecs.length > 0) { + // remove RTX field in Edge 14942 + if (transceiver.kind === 'video' + && transceiver.recvEncodingParameters + && edgeVersion < 15019) { + transceiver.recvEncodingParameters.forEach(function (p) { + delete p.rtx; + }); + } + if (transceiver.recvEncodingParameters.length) { + params.encodings = transceiver.recvEncodingParameters; + } else { + params.encodings = [{}]; + } + params.rtcp = { + compound: transceiver.rtcpParameters.compound + }; + if (transceiver.rtcpParameters.cname) { + params.rtcp.cname = transceiver.rtcpParameters.cname; + } + if (transceiver.sendEncodingParameters.length) { + params.rtcp.ssrc = transceiver.sendEncodingParameters[0].ssrc; + } + transceiver.rtpReceiver.receive(params); + } + }; + + RTCPeerConnection.prototype.setLocalDescription = function (description) { + var pc = this; + + // Note: pranswer is not supported. + if (['offer', 'answer'].indexOf(description.type) === -1) { + return Promise.reject(makeError('TypeError', + 'Unsupported type "' + description.type + '"')); + } + + if (!isActionAllowedInSignalingState('setLocalDescription', + description.type, pc.signalingState) || pc._isClosed) { + return Promise.reject(makeError('InvalidStateError', + 'Can not set local ' + description.type + + ' in state ' + pc.signalingState)); + } + + var sections; + var sessionpart; + if (description.type === 'offer') { + // VERY limited support for SDP munging. Limited to: + // * changing the order of codecs + sections = SDPUtils.splitSections(description.sdp); + sessionpart = sections.shift(); + sections.forEach(function (mediaSection, sdpMLineIndex) { + var caps = SDPUtils.parseRtpParameters(mediaSection); + pc.transceivers[sdpMLineIndex].localCapabilities = caps; + }); + + pc.transceivers.forEach(function (transceiver, sdpMLineIndex) { + pc._gather(transceiver.mid, sdpMLineIndex); + }); + } else if (description.type === 'answer') { + sections = SDPUtils.splitSections(pc._remoteDescription.sdp); + sessionpart = sections.shift(); + var isIceLite = SDPUtils.matchPrefix(sessionpart, + 'a=ice-lite').length > 0; + sections.forEach(function (mediaSection, sdpMLineIndex) { + var transceiver = pc.transceivers[sdpMLineIndex]; + var iceGatherer = transceiver.iceGatherer; + var iceTransport = transceiver.iceTransport; + var dtlsTransport = transceiver.dtlsTransport; + var localCapabilities = transceiver.localCapabilities; + var remoteCapabilities = transceiver.remoteCapabilities; + + // treat bundle-only as not-rejected. + var rejected = SDPUtils.isRejected(mediaSection) && + SDPUtils.matchPrefix(mediaSection, 'a=bundle-only').length === 0; + + if (!rejected && !transceiver.rejected) { + var remoteIceParameters = SDPUtils.getIceParameters( + mediaSection, sessionpart); + var remoteDtlsParameters = SDPUtils.getDtlsParameters( + mediaSection, sessionpart); + if (isIceLite) { + remoteDtlsParameters.role = 'server'; + } + + if (!pc.usingBundle || sdpMLineIndex === 0) { + pc._gather(transceiver.mid, sdpMLineIndex); + if (iceTransport.state === 'new') { + iceTransport.start(iceGatherer, remoteIceParameters, + isIceLite ? 'controlling' : 'controlled'); + } + if (dtlsTransport.state === 'new') { + dtlsTransport.start(remoteDtlsParameters); + } + } + + // Calculate intersection of capabilities. + var params = getCommonCapabilities(localCapabilities, + remoteCapabilities); + + // Start the RTCRtpSender. The RTCRtpReceiver for this + // transceiver has already been started in setRemoteDescription. + pc._transceive(transceiver, + params.codecs.length > 0, + false); + } + }); + } + + pc._localDescription = { + type: description.type, + sdp: description.sdp + }; + if (description.type === 'offer') { + pc._updateSignalingState('have-local-offer'); + } else { + pc._updateSignalingState('stable'); + } + + return Promise.resolve(); + }; + + RTCPeerConnection.prototype.setRemoteDescription = function (description) { + var pc = this; + + // Note: pranswer is not supported. + if (['offer', 'answer'].indexOf(description.type) === -1) { + return Promise.reject(makeError('TypeError', + 'Unsupported type "' + description.type + '"')); + } + + if (!isActionAllowedInSignalingState('setRemoteDescription', + description.type, pc.signalingState) || pc._isClosed) { + return Promise.reject(makeError('InvalidStateError', + 'Can not set remote ' + description.type + + ' in state ' + pc.signalingState)); + } + + var streams = {}; + pc.remoteStreams.forEach(function (stream) { + streams[stream.id] = stream; + }); + var receiverList = []; + var sections = SDPUtils.splitSections(description.sdp); + var sessionpart = sections.shift(); + var isIceLite = SDPUtils.matchPrefix(sessionpart, + 'a=ice-lite').length > 0; + var usingBundle = SDPUtils.matchPrefix(sessionpart, + 'a=group:BUNDLE ').length > 0; + pc.usingBundle = usingBundle; + var iceOptions = SDPUtils.matchPrefix(sessionpart, + 'a=ice-options:')[0]; + if (iceOptions) { + pc.canTrickleIceCandidates = iceOptions.substr(14).split(' ') + .indexOf('trickle') >= 0; + } else { + pc.canTrickleIceCandidates = false; + } + + sections.forEach(function (mediaSection, sdpMLineIndex) { + var lines = SDPUtils.splitLines(mediaSection); + var kind = SDPUtils.getKind(mediaSection); + // treat bundle-only as not-rejected. + var rejected = SDPUtils.isRejected(mediaSection) && + SDPUtils.matchPrefix(mediaSection, 'a=bundle-only').length === 0; + var protocol = lines[0].substr(2).split(' ')[2]; + + var direction = SDPUtils.getDirection(mediaSection, sessionpart); + var remoteMsid = SDPUtils.parseMsid(mediaSection); + + var mid = SDPUtils.getMid(mediaSection) || SDPUtils.generateIdentifier(); + + // Reject datachannels which are not implemented yet. + if (rejected || (kind === 'application' && (protocol === 'DTLS/SCTP' || + protocol === 'UDP/DTLS/SCTP'))) { + // TODO: this is dangerous in the case where a non-rejected m-line + // becomes rejected. + pc.transceivers[sdpMLineIndex] = { + mid: mid, + kind: kind, + protocol: protocol, + rejected: true + }; + return; + } + + if (!rejected && pc.transceivers[sdpMLineIndex] && + pc.transceivers[sdpMLineIndex].rejected) { + // recycle a rejected transceiver. + pc.transceivers[sdpMLineIndex] = pc._createTransceiver(kind, true); + } + + var transceiver; + var iceGatherer; + var iceTransport; + var dtlsTransport; + var rtpReceiver; + var sendEncodingParameters; + var recvEncodingParameters; + var localCapabilities; + + var track; + // FIXME: ensure the mediaSection has rtcp-mux set. + var remoteCapabilities = SDPUtils.parseRtpParameters(mediaSection); + var remoteIceParameters; + var remoteDtlsParameters; + if (!rejected) { + remoteIceParameters = SDPUtils.getIceParameters(mediaSection, + sessionpart); + remoteDtlsParameters = SDPUtils.getDtlsParameters(mediaSection, + sessionpart); + remoteDtlsParameters.role = 'client'; + } + recvEncodingParameters = + SDPUtils.parseRtpEncodingParameters(mediaSection); + + var rtcpParameters = SDPUtils.parseRtcpParameters(mediaSection); + + var isComplete = SDPUtils.matchPrefix(mediaSection, + 'a=end-of-candidates', sessionpart).length > 0; + var cands = SDPUtils.matchPrefix(mediaSection, 'a=candidate:') + .map(function (cand) { + return SDPUtils.parseCandidate(cand); + }) + .filter(function (cand) { + return cand.component === 1; + }); + + // Check if we can use BUNDLE and dispose transports. + if ((description.type === 'offer' || description.type === 'answer') && + !rejected && usingBundle && sdpMLineIndex > 0 && + pc.transceivers[sdpMLineIndex]) { + pc._disposeIceAndDtlsTransports(sdpMLineIndex); + pc.transceivers[sdpMLineIndex].iceGatherer = + pc.transceivers[0].iceGatherer; + pc.transceivers[sdpMLineIndex].iceTransport = + pc.transceivers[0].iceTransport; + pc.transceivers[sdpMLineIndex].dtlsTransport = + pc.transceivers[0].dtlsTransport; + if (pc.transceivers[sdpMLineIndex].rtpSender) { + pc.transceivers[sdpMLineIndex].rtpSender.setTransport( + pc.transceivers[0].dtlsTransport); + } + if (pc.transceivers[sdpMLineIndex].rtpReceiver) { + pc.transceivers[sdpMLineIndex].rtpReceiver.setTransport( + pc.transceivers[0].dtlsTransport); + } + } + if (description.type === 'offer' && !rejected) { + transceiver = pc.transceivers[sdpMLineIndex] || + pc._createTransceiver(kind); + transceiver.mid = mid; + + if (!transceiver.iceGatherer) { + transceiver.iceGatherer = pc._createIceGatherer(sdpMLineIndex, + usingBundle); + } + + if (cands.length && transceiver.iceTransport.state === 'new') { + if (isComplete && (!usingBundle || sdpMLineIndex === 0)) { + transceiver.iceTransport.setRemoteCandidates(cands); + } else { + cands.forEach(function (candidate) { + maybeAddCandidate(transceiver.iceTransport, candidate); + }); + } + } + + localCapabilities = window.RTCRtpReceiver.getCapabilities(kind); + + // filter RTX until additional stuff needed for RTX is implemented + // in adapter.js + if (edgeVersion < 15019) { + localCapabilities.codecs = localCapabilities.codecs.filter( + function (codec) { + return codec.name !== 'rtx'; + }); + } + + sendEncodingParameters = transceiver.sendEncodingParameters || [{ + ssrc: (2 * sdpMLineIndex + 2) * 1001 + }]; + + // TODO: rewrite to use http://w3c.github.io/webrtc-pc/#set-associated-remote-streams + var isNewTrack = false; + if (direction === 'sendrecv' || direction === 'sendonly') { + isNewTrack = !transceiver.rtpReceiver; + rtpReceiver = transceiver.rtpReceiver || + new window.RTCRtpReceiver(transceiver.dtlsTransport, kind); + + if (isNewTrack) { + var stream; + track = rtpReceiver.track; + // FIXME: does not work with Plan B. + if (remoteMsid && remoteMsid.stream === '-') { + // no-op. a stream id of '-' means: no associated stream. + } else if (remoteMsid) { + if (!streams[remoteMsid.stream]) { + streams[remoteMsid.stream] = new window.MediaStream(); + Object.defineProperty(streams[remoteMsid.stream], 'id', { + get: function () { + return remoteMsid.stream; + } + }); + } + Object.defineProperty(track, 'id', { + get: function () { + return remoteMsid.track; + } + }); + stream = streams[remoteMsid.stream]; + } else { + if (!streams.default) { + streams.default = new window.MediaStream(); + } + stream = streams.default; + } + if (stream) { + addTrackToStreamAndFireEvent(track, stream); + transceiver.associatedRemoteMediaStreams.push(stream); + } + receiverList.push([track, rtpReceiver, stream]); + } + } else if (transceiver.rtpReceiver && transceiver.rtpReceiver.track) { + transceiver.associatedRemoteMediaStreams.forEach(function (s) { + var nativeTrack = s.getTracks().find(function (t) { + return t.id === transceiver.rtpReceiver.track.id; + }); + if (nativeTrack) { + removeTrackFromStreamAndFireEvent(nativeTrack, s); + } + }); + transceiver.associatedRemoteMediaStreams = []; + } + + transceiver.localCapabilities = localCapabilities; + transceiver.remoteCapabilities = remoteCapabilities; + transceiver.rtpReceiver = rtpReceiver; + transceiver.rtcpParameters = rtcpParameters; + transceiver.sendEncodingParameters = sendEncodingParameters; + transceiver.recvEncodingParameters = recvEncodingParameters; + + // Start the RTCRtpReceiver now. The RTPSender is started in + // setLocalDescription. + pc._transceive(pc.transceivers[sdpMLineIndex], + false, + isNewTrack); + } else if (description.type === 'answer' && !rejected) { + transceiver = pc.transceivers[sdpMLineIndex]; + iceGatherer = transceiver.iceGatherer; + iceTransport = transceiver.iceTransport; + dtlsTransport = transceiver.dtlsTransport; + rtpReceiver = transceiver.rtpReceiver; + sendEncodingParameters = transceiver.sendEncodingParameters; + localCapabilities = transceiver.localCapabilities; + + pc.transceivers[sdpMLineIndex].recvEncodingParameters = + recvEncodingParameters; + pc.transceivers[sdpMLineIndex].remoteCapabilities = + remoteCapabilities; + pc.transceivers[sdpMLineIndex].rtcpParameters = rtcpParameters; + + if (cands.length && iceTransport.state === 'new') { + if ((isIceLite || isComplete) && + (!usingBundle || sdpMLineIndex === 0)) { + iceTransport.setRemoteCandidates(cands); + } else { + cands.forEach(function (candidate) { + maybeAddCandidate(transceiver.iceTransport, candidate); + }); + } + } + + if (!usingBundle || sdpMLineIndex === 0) { + if (iceTransport.state === 'new') { + iceTransport.start(iceGatherer, remoteIceParameters, + 'controlling'); + } + if (dtlsTransport.state === 'new') { + dtlsTransport.start(remoteDtlsParameters); + } + } + + // If the offer contained RTX but the answer did not, + // remove RTX from sendEncodingParameters. + var commonCapabilities = getCommonCapabilities( + transceiver.localCapabilities, + transceiver.remoteCapabilities); + + var hasRtx = commonCapabilities.codecs.filter(function (c) { + return c.name.toLowerCase() === 'rtx'; + }).length; + if (!hasRtx && transceiver.sendEncodingParameters[0].rtx) { + delete transceiver.sendEncodingParameters[0].rtx; + } + + pc._transceive(transceiver, + direction === 'sendrecv' || direction === 'recvonly', + direction === 'sendrecv' || direction === 'sendonly'); + + // TODO: rewrite to use http://w3c.github.io/webrtc-pc/#set-associated-remote-streams + if (rtpReceiver && + (direction === 'sendrecv' || direction === 'sendonly')) { + track = rtpReceiver.track; + if (remoteMsid) { + if (!streams[remoteMsid.stream]) { + streams[remoteMsid.stream] = new window.MediaStream(); + } + addTrackToStreamAndFireEvent(track, streams[remoteMsid.stream]); + receiverList.push([track, rtpReceiver, streams[remoteMsid.stream]]); + } else { + if (!streams.default) { + streams.default = new window.MediaStream(); + } + addTrackToStreamAndFireEvent(track, streams.default); + receiverList.push([track, rtpReceiver, streams.default]); + } + } else { + // FIXME: actually the receiver should be created later. + delete transceiver.rtpReceiver; + } + } + }); + + if (pc._dtlsRole === undefined) { + pc._dtlsRole = description.type === 'offer' ? 'active' : 'passive'; + } + + pc._remoteDescription = { + type: description.type, + sdp: description.sdp + }; + if (description.type === 'offer') { + pc._updateSignalingState('have-remote-offer'); + } else { + pc._updateSignalingState('stable'); + } + Object.keys(streams).forEach(function (sid) { + var stream = streams[sid]; + if (stream.getTracks().length) { + if (pc.remoteStreams.indexOf(stream) === -1) { + pc.remoteStreams.push(stream); + var event = new Event('addstream'); + event.stream = stream; + window.setTimeout(function () { + pc._dispatchEvent('addstream', event); + }); + } + + receiverList.forEach(function (item) { + var track = item[0]; + var receiver = item[1]; + if (stream.id !== item[2].id) { + return; + } + fireAddTrack(pc, track, receiver, [stream]); + }); + } + }); + receiverList.forEach(function (item) { + if (item[2]) { + return; + } + fireAddTrack(pc, item[0], item[1], []); + }); + + // check whether addIceCandidate({}) was called within four seconds after + // setRemoteDescription. + window.setTimeout(function () { + if (!(pc && pc.transceivers)) { + return; + } + pc.transceivers.forEach(function (transceiver) { + if (transceiver.iceTransport && + transceiver.iceTransport.state === 'new' && + transceiver.iceTransport.getRemoteCandidates().length > 0) { + console.warn('Timeout for addRemoteCandidate. Consider sending ' + + 'an end-of-candidates notification'); + transceiver.iceTransport.addRemoteCandidate({}); + } + }); + }, 4000); + + return Promise.resolve(); + }; + + RTCPeerConnection.prototype.close = function () { + this.transceivers.forEach(function (transceiver) { + /* not yet + if (transceiver.iceGatherer) { + transceiver.iceGatherer.close(); + } + */ + if (transceiver.iceTransport) { + transceiver.iceTransport.stop(); + } + if (transceiver.dtlsTransport) { + transceiver.dtlsTransport.stop(); + } + if (transceiver.rtpSender) { + transceiver.rtpSender.stop(); + } + if (transceiver.rtpReceiver) { + transceiver.rtpReceiver.stop(); + } + }); + // FIXME: clean up tracks, local streams, remote streams, etc + this._isClosed = true; + this._updateSignalingState('closed'); + }; + + // Update the signaling state. + RTCPeerConnection.prototype._updateSignalingState = function (newState) { + this.signalingState = newState; + var event = new Event('signalingstatechange'); + this._dispatchEvent('signalingstatechange', event); + }; + + // Determine whether to fire the negotiationneeded event. + RTCPeerConnection.prototype._maybeFireNegotiationNeeded = function () { + var pc = this; + if (this.signalingState !== 'stable' || this.needNegotiation === true) { + return; + } + this.needNegotiation = true; + window.setTimeout(function () { + if (pc.needNegotiation) { + pc.needNegotiation = false; + var event = new Event('negotiationneeded'); + pc._dispatchEvent('negotiationneeded', event); + } + }, 0); + }; + + // Update the ice connection state. + RTCPeerConnection.prototype._updateIceConnectionState = function () { + var newState; + var states = { + 'new': 0, + closed: 0, + checking: 0, + connected: 0, + completed: 0, + disconnected: 0, + failed: 0 + }; + this.transceivers.forEach(function (transceiver) { + if (transceiver.iceTransport && !transceiver.rejected) { + states[transceiver.iceTransport.state]++; + } + }); + + newState = 'new'; + if (states.failed > 0) { + newState = 'failed'; + } else if (states.checking > 0) { + newState = 'checking'; + } else if (states.disconnected > 0) { + newState = 'disconnected'; + } else if (states.new > 0) { + newState = 'new'; + } else if (states.connected > 0) { + newState = 'connected'; + } else if (states.completed > 0) { + newState = 'completed'; + } + + if (newState !== this.iceConnectionState) { + this.iceConnectionState = newState; + var event = new Event('iceconnectionstatechange'); + this._dispatchEvent('iceconnectionstatechange', event); + } + }; + + // Update the connection state. + RTCPeerConnection.prototype._updateConnectionState = function () { + var newState; + var states = { + 'new': 0, + closed: 0, + connecting: 0, + connected: 0, + completed: 0, + disconnected: 0, + failed: 0 + }; + this.transceivers.forEach(function (transceiver) { + if (transceiver.iceTransport && transceiver.dtlsTransport && + !transceiver.rejected) { + states[transceiver.iceTransport.state]++; + states[transceiver.dtlsTransport.state]++; + } + }); + // ICETransport.completed and connected are the same for this purpose. + states.connected += states.completed; + + newState = 'new'; + if (states.failed > 0) { + newState = 'failed'; + } else if (states.connecting > 0) { + newState = 'connecting'; + } else if (states.disconnected > 0) { + newState = 'disconnected'; + } else if (states.new > 0) { + newState = 'new'; + } else if (states.connected > 0) { + newState = 'connected'; + } + + if (newState !== this.connectionState) { + this.connectionState = newState; + var event = new Event('connectionstatechange'); + this._dispatchEvent('connectionstatechange', event); + } + }; + + RTCPeerConnection.prototype.createOffer = function () { + var pc = this; + + if (pc._isClosed) { + return Promise.reject(makeError('InvalidStateError', + 'Can not call createOffer after close')); + } + + var numAudioTracks = pc.transceivers.filter(function (t) { + return t.kind === 'audio'; + }).length; + var numVideoTracks = pc.transceivers.filter(function (t) { + return t.kind === 'video'; + }).length; + + // Determine number of audio and video tracks we need to send/recv. + var offerOptions = arguments[0]; + if (offerOptions) { + // Reject Chrome legacy constraints. + if (offerOptions.mandatory || offerOptions.optional) { + throw new TypeError( + 'Legacy mandatory/optional constraints not supported.'); + } + if (offerOptions.offerToReceiveAudio !== undefined) { + if (offerOptions.offerToReceiveAudio === true) { + numAudioTracks = 1; + } else if (offerOptions.offerToReceiveAudio === false) { + numAudioTracks = 0; + } else { + numAudioTracks = offerOptions.offerToReceiveAudio; + } + } + if (offerOptions.offerToReceiveVideo !== undefined) { + if (offerOptions.offerToReceiveVideo === true) { + numVideoTracks = 1; + } else if (offerOptions.offerToReceiveVideo === false) { + numVideoTracks = 0; + } else { + numVideoTracks = offerOptions.offerToReceiveVideo; + } + } + } + + pc.transceivers.forEach(function (transceiver) { + if (transceiver.kind === 'audio') { + numAudioTracks--; + if (numAudioTracks < 0) { + transceiver.wantReceive = false; + } + } else if (transceiver.kind === 'video') { + numVideoTracks--; + if (numVideoTracks < 0) { + transceiver.wantReceive = false; + } + } + }); + + // Create M-lines for recvonly streams. + while (numAudioTracks > 0 || numVideoTracks > 0) { + if (numAudioTracks > 0) { + pc._createTransceiver('audio'); + numAudioTracks--; + } + if (numVideoTracks > 0) { + pc._createTransceiver('video'); + numVideoTracks--; + } + } + + var sdp = SDPUtils.writeSessionBoilerplate(pc._sdpSessionId, + pc._sdpSessionVersion++); + pc.transceivers.forEach(function (transceiver, sdpMLineIndex) { + // For each track, create an ice gatherer, ice transport, + // dtls transport, potentially rtpsender and rtpreceiver. + var track = transceiver.track; + var kind = transceiver.kind; + var mid = transceiver.mid || SDPUtils.generateIdentifier(); + transceiver.mid = mid; + + if (!transceiver.iceGatherer) { + transceiver.iceGatherer = pc._createIceGatherer(sdpMLineIndex, + pc.usingBundle); + } + + var localCapabilities = window.RTCRtpSender.getCapabilities(kind); + // filter RTX until additional stuff needed for RTX is implemented + // in adapter.js + if (edgeVersion < 15019) { + localCapabilities.codecs = localCapabilities.codecs.filter( + function (codec) { + return codec.name !== 'rtx'; + }); + } + localCapabilities.codecs.forEach(function (codec) { + // work around https://bugs.chromium.org/p/webrtc/issues/detail?id=6552 + // by adding level-asymmetry-allowed=1 + if (codec.name === 'H264' && + codec.parameters['level-asymmetry-allowed'] === undefined) { + codec.parameters['level-asymmetry-allowed'] = '1'; + } + + // for subsequent offers, we might have to re-use the payload + // type of the last offer. + if (transceiver.remoteCapabilities && + transceiver.remoteCapabilities.codecs) { + transceiver.remoteCapabilities.codecs.forEach(function (remoteCodec) { + if (codec.name.toLowerCase() === remoteCodec.name.toLowerCase() && + codec.clockRate === remoteCodec.clockRate) { + codec.preferredPayloadType = remoteCodec.payloadType; + } + }); + } + }); + localCapabilities.headerExtensions.forEach(function (hdrExt) { + var remoteExtensions = transceiver.remoteCapabilities && + transceiver.remoteCapabilities.headerExtensions || []; + remoteExtensions.forEach(function (rHdrExt) { + if (hdrExt.uri === rHdrExt.uri) { + hdrExt.id = rHdrExt.id; + } + }); + }); + + // generate an ssrc now, to be used later in rtpSender.send + var sendEncodingParameters = transceiver.sendEncodingParameters || [{ + ssrc: (2 * sdpMLineIndex + 1) * 1001 + }]; + if (track) { + // add RTX + if (edgeVersion >= 15019 && kind === 'video' && + !sendEncodingParameters[0].rtx) { + sendEncodingParameters[0].rtx = { + ssrc: sendEncodingParameters[0].ssrc + 1 + }; + } + } + + if (transceiver.wantReceive) { + transceiver.rtpReceiver = new window.RTCRtpReceiver( + transceiver.dtlsTransport, kind); + } + + transceiver.localCapabilities = localCapabilities; + transceiver.sendEncodingParameters = sendEncodingParameters; + }); + + // always offer BUNDLE and dispose on return if not supported. + if (pc._config.bundlePolicy !== 'max-compat') { + sdp += 'a=group:BUNDLE ' + pc.transceivers.map(function (t) { + return t.mid; + }).join(' ') + '\r\n'; + } + sdp += 'a=ice-options:trickle\r\n'; + + pc.transceivers.forEach(function (transceiver, sdpMLineIndex) { + sdp += writeMediaSection(transceiver, transceiver.localCapabilities, + 'offer', transceiver.stream, pc._dtlsRole); + sdp += 'a=rtcp-rsize\r\n'; + + if (transceiver.iceGatherer && pc.iceGatheringState !== 'new' && + (sdpMLineIndex === 0 || !pc.usingBundle)) { + transceiver.iceGatherer.getLocalCandidates().forEach(function (cand) { + cand.component = 1; + sdp += 'a=' + SDPUtils.writeCandidate(cand) + '\r\n'; + }); + + if (transceiver.iceGatherer.state === 'completed') { + sdp += 'a=end-of-candidates\r\n'; + } + } + }); + + var desc = new window.RTCSessionDescription({ + type: 'offer', + sdp: sdp + }); + return Promise.resolve(desc); + }; + + RTCPeerConnection.prototype.createAnswer = function () { + var pc = this; + + if (pc._isClosed) { + return Promise.reject(makeError('InvalidStateError', + 'Can not call createAnswer after close')); + } + + if (!(pc.signalingState === 'have-remote-offer' || + pc.signalingState === 'have-local-pranswer')) { + return Promise.reject(makeError('InvalidStateError', + 'Can not call createAnswer in signalingState ' + pc.signalingState)); + } + + var sdp = SDPUtils.writeSessionBoilerplate(pc._sdpSessionId, + pc._sdpSessionVersion++); + if (pc.usingBundle) { + sdp += 'a=group:BUNDLE ' + pc.transceivers.map(function (t) { + return t.mid; + }).join(' ') + '\r\n'; + } + sdp += 'a=ice-options:trickle\r\n'; + + var mediaSectionsInOffer = SDPUtils.getMediaSections( + pc._remoteDescription.sdp).length; + pc.transceivers.forEach(function (transceiver, sdpMLineIndex) { + if (sdpMLineIndex + 1 > mediaSectionsInOffer) { + return; + } + if (transceiver.rejected) { + if (transceiver.kind === 'application') { + if (transceiver.protocol === 'DTLS/SCTP') { // legacy fmt + sdp += 'm=application 0 DTLS/SCTP 5000\r\n'; + } else { + sdp += 'm=application 0 ' + transceiver.protocol + + ' webrtc-datachannel\r\n'; + } + } else if (transceiver.kind === 'audio') { + sdp += 'm=audio 0 UDP/TLS/RTP/SAVPF 0\r\n' + + 'a=rtpmap:0 PCMU/8000\r\n'; + } else if (transceiver.kind === 'video') { + sdp += 'm=video 0 UDP/TLS/RTP/SAVPF 120\r\n' + + 'a=rtpmap:120 VP8/90000\r\n'; + } + sdp += 'c=IN IP4 0.0.0.0\r\n' + + 'a=inactive\r\n' + + 'a=mid:' + transceiver.mid + '\r\n'; + return; + } + + // FIXME: look at direction. + if (transceiver.stream) { + var localTrack; + if (transceiver.kind === 'audio') { + localTrack = transceiver.stream.getAudioTracks()[0]; + } else if (transceiver.kind === 'video') { + localTrack = transceiver.stream.getVideoTracks()[0]; + } + if (localTrack) { + // add RTX + if (edgeVersion >= 15019 && transceiver.kind === 'video' && + !transceiver.sendEncodingParameters[0].rtx) { + transceiver.sendEncodingParameters[0].rtx = { + ssrc: transceiver.sendEncodingParameters[0].ssrc + 1 + }; + } + } + } + + // Calculate intersection of capabilities. + var commonCapabilities = getCommonCapabilities( + transceiver.localCapabilities, + transceiver.remoteCapabilities); + + var hasRtx = commonCapabilities.codecs.filter(function (c) { + return c.name.toLowerCase() === 'rtx'; + }).length; + if (!hasRtx && transceiver.sendEncodingParameters[0].rtx) { + delete transceiver.sendEncodingParameters[0].rtx; + } + + sdp += writeMediaSection(transceiver, commonCapabilities, + 'answer', transceiver.stream, pc._dtlsRole); + if (transceiver.rtcpParameters && + transceiver.rtcpParameters.reducedSize) { + sdp += 'a=rtcp-rsize\r\n'; + } + }); + + var desc = new window.RTCSessionDescription({ + type: 'answer', + sdp: sdp + }); + return Promise.resolve(desc); + }; + + RTCPeerConnection.prototype.addIceCandidate = function (candidate) { + var pc = this; + var sections; + if (candidate && !(candidate.sdpMLineIndex !== undefined || + candidate.sdpMid)) { + return Promise.reject(new TypeError('sdpMLineIndex or sdpMid required')); + } + + // TODO: needs to go into ops queue. + return new Promise(function (resolve, reject) { + if (!pc._remoteDescription) { + return reject(makeError('InvalidStateError', + 'Can not add ICE candidate without a remote description')); + } else if (!candidate || candidate.candidate === '') { + for (var j = 0; j < pc.transceivers.length; j++) { + if (pc.transceivers[j].rejected) { + continue; + } + pc.transceivers[j].iceTransport.addRemoteCandidate({}); + sections = SDPUtils.getMediaSections(pc._remoteDescription.sdp); + sections[j] += 'a=end-of-candidates\r\n'; + pc._remoteDescription.sdp = + SDPUtils.getDescription(pc._remoteDescription.sdp) + + sections.join(''); + if (pc.usingBundle) { + break; + } + } + } else { + var sdpMLineIndex = candidate.sdpMLineIndex; + if (candidate.sdpMid) { + for (var i = 0; i < pc.transceivers.length; i++) { + if (pc.transceivers[i].mid === candidate.sdpMid) { + sdpMLineIndex = i; + break; + } + } + } + var transceiver = pc.transceivers[sdpMLineIndex]; + if (transceiver) { + if (transceiver.rejected) { + return resolve(); + } + var cand = Object.keys(candidate.candidate).length > 0 ? + SDPUtils.parseCandidate(candidate.candidate) : {}; + // Ignore Chrome's invalid candidates since Edge does not like them. + if (cand.protocol === 'tcp' && (cand.port === 0 || cand.port === 9)) { + return resolve(); + } + // Ignore RTCP candidates, we assume RTCP-MUX. + if (cand.component && cand.component !== 1) { + return resolve(); + } + // when using bundle, avoid adding candidates to the wrong + // ice transport. And avoid adding candidates added in the SDP. + if (sdpMLineIndex === 0 || (sdpMLineIndex > 0 && + transceiver.iceTransport !== pc.transceivers[0].iceTransport)) { + if (!maybeAddCandidate(transceiver.iceTransport, cand)) { + return reject(makeError('OperationError', + 'Can not add ICE candidate')); + } + } + + // update the remoteDescription. + var candidateString = candidate.candidate.trim(); + if (candidateString.indexOf('a=') === 0) { + candidateString = candidateString.substr(2); + } + sections = SDPUtils.getMediaSections(pc._remoteDescription.sdp); + sections[sdpMLineIndex] += 'a=' + + (cand.type ? candidateString : 'end-of-candidates') + + '\r\n'; + pc._remoteDescription.sdp = + SDPUtils.getDescription(pc._remoteDescription.sdp) + + sections.join(''); + } else { + return reject(makeError('OperationError', + 'Can not add ICE candidate')); + } + } + resolve(); + }); + }; + + RTCPeerConnection.prototype.getStats = function (selector) { + if (selector && selector instanceof window.MediaStreamTrack) { + var senderOrReceiver = null; + this.transceivers.forEach(function (transceiver) { + if (transceiver.rtpSender && + transceiver.rtpSender.track === selector) { + senderOrReceiver = transceiver.rtpSender; + } else if (transceiver.rtpReceiver && + transceiver.rtpReceiver.track === selector) { + senderOrReceiver = transceiver.rtpReceiver; + } + }); + if (!senderOrReceiver) { + throw makeError('InvalidAccessError', 'Invalid selector.'); + } + return senderOrReceiver.getStats(); + } + + var promises = []; + this.transceivers.forEach(function (transceiver) { + ['rtpSender', 'rtpReceiver', 'iceGatherer', 'iceTransport', + 'dtlsTransport'].forEach(function (method) { + if (transceiver[method]) { + promises.push(transceiver[method].getStats()); + } + }); + }); + return Promise.all(promises).then(function (allStats) { + var results = new Map(); + allStats.forEach(function (stats) { + stats.forEach(function (stat) { + results.set(stat.id, stat); + }); + }); + return results; + }); + }; + + // fix low-level stat names and return Map instead of object. + var ortcObjects = ['RTCRtpSender', 'RTCRtpReceiver', 'RTCIceGatherer', + 'RTCIceTransport', 'RTCDtlsTransport']; + ortcObjects.forEach(function (ortcObjectName) { + var obj = window[ortcObjectName]; + if (obj && obj.prototype && obj.prototype.getStats) { + var nativeGetstats = obj.prototype.getStats; + obj.prototype.getStats = function () { + return nativeGetstats.apply(this) + .then(function (nativeStats) { + var mapStats = new Map(); + Object.keys(nativeStats).forEach(function (id) { + nativeStats[id].type = fixStatsType(nativeStats[id]); + mapStats.set(id, nativeStats[id]); + }); + return mapStats; + }); + }; + } + }); + + // legacy callback shims. Should be moved to adapter.js some days. + var methods = ['createOffer', 'createAnswer']; + methods.forEach(function (method) { + var nativeMethod = RTCPeerConnection.prototype[method]; + RTCPeerConnection.prototype[method] = function () { + var args = arguments; + if (typeof args[0] === 'function' || + typeof args[1] === 'function') { // legacy + return nativeMethod.apply(this, [arguments[2]]) + .then(function (description) { + if (typeof args[0] === 'function') { + args[0].apply(null, [description]); + } + }, function (error) { + if (typeof args[1] === 'function') { + args[1].apply(null, [error]); + } + }); + } + return nativeMethod.apply(this, arguments); + }; + }); + + methods = ['setLocalDescription', 'setRemoteDescription', 'addIceCandidate']; + methods.forEach(function (method) { + var nativeMethod = RTCPeerConnection.prototype[method]; + RTCPeerConnection.prototype[method] = function () { + var args = arguments; + if (typeof args[1] === 'function' || + typeof args[2] === 'function') { // legacy + return nativeMethod.apply(this, arguments) + .then(function () { + if (typeof args[1] === 'function') { + args[1].apply(null); + } + }, function (error) { + if (typeof args[2] === 'function') { + args[2].apply(null, [error]); + } + }); + } + return nativeMethod.apply(this, arguments); + }; + }); + + // getStats is special. It doesn't have a spec legacy method yet we support + // getStats(something, cb) without error callbacks. + ['getStats'].forEach(function (method) { + var nativeMethod = RTCPeerConnection.prototype[method]; + RTCPeerConnection.prototype[method] = function () { + var args = arguments; + if (typeof args[1] === 'function') { + return nativeMethod.apply(this, arguments) + .then(function () { + if (typeof args[1] === 'function') { + args[1].apply(null); + } + }); + } + return nativeMethod.apply(this, arguments); + }; + }); + + return RTCPeerConnection; + }; + + }, {"sdp": 12}], + 14: [function (require, module, exports) { + /* + * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. + */ + /* eslint-env node */ + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _adapter_factory = require('./adapter_factory.js'); + + var adapter = (0, _adapter_factory.adapterFactory)({window: window}); + exports.default = adapter; + + }, {"./adapter_factory.js": 15}], + 15: [function (require, module, exports) { + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.adapterFactory = adapterFactory; + + var _utils = require('./utils'); + + var utils = _interopRequireWildcard(_utils); + + var _chrome_shim = require('./chrome/chrome_shim'); + + var chromeShim = _interopRequireWildcard(_chrome_shim); + + var _edge_shim = require('./edge/edge_shim'); + + var edgeShim = _interopRequireWildcard(_edge_shim); + + var _firefox_shim = require('./firefox/firefox_shim'); + + var firefoxShim = _interopRequireWildcard(_firefox_shim); + + var _safari_shim = require('./safari/safari_shim'); + + var safariShim = _interopRequireWildcard(_safari_shim); + + var _common_shim = require('./common_shim'); + + var commonShim = _interopRequireWildcard(_common_shim); + + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + newObj.default = obj; + return newObj; + } + } + +// Shimming starts here. + /* + * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. + */ + function adapterFactory() { + var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, + window = _ref.window; + + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { + shimChrome: true, + shimFirefox: true, + shimEdge: true, + shimSafari: true + }; + + // Utils. + var logging = utils.log; + var browserDetails = utils.detectBrowser(window); + + var adapter = { + browserDetails: browserDetails, + commonShim: commonShim, + extractVersion: utils.extractVersion, + disableLog: utils.disableLog, + disableWarnings: utils.disableWarnings + }; + + // Shim browser if found. + switch (browserDetails.browser) { + case 'chrome': + if (!chromeShim || !chromeShim.shimPeerConnection || !options.shimChrome) { + logging('Chrome shim is not included in this adapter release.'); + return adapter; + } + logging('adapter.js shimming chrome.'); + // Export to the adapter global object visible in the browser. + adapter.browserShim = chromeShim; + + chromeShim.shimGetUserMedia(window); + chromeShim.shimMediaStream(window); + chromeShim.shimPeerConnection(window); + chromeShim.shimOnTrack(window); + chromeShim.shimAddTrackRemoveTrack(window); + chromeShim.shimGetSendersWithDtmf(window); + chromeShim.shimGetStats(window); + chromeShim.shimSenderReceiverGetStats(window); + chromeShim.fixNegotiationNeeded(window); + + commonShim.shimRTCIceCandidate(window); + commonShim.shimConnectionState(window); + commonShim.shimMaxMessageSize(window); + commonShim.shimSendThrowTypeError(window); + commonShim.removeAllowExtmapMixed(window); + break; + case 'firefox': + if (!firefoxShim || !firefoxShim.shimPeerConnection || !options.shimFirefox) { + logging('Firefox shim is not included in this adapter release.'); + return adapter; + } + logging('adapter.js shimming firefox.'); + // Export to the adapter global object visible in the browser. + adapter.browserShim = firefoxShim; + + firefoxShim.shimGetUserMedia(window); + firefoxShim.shimPeerConnection(window); + firefoxShim.shimOnTrack(window); + firefoxShim.shimRemoveStream(window); + firefoxShim.shimSenderGetStats(window); + firefoxShim.shimReceiverGetStats(window); + firefoxShim.shimRTCDataChannel(window); + + commonShim.shimRTCIceCandidate(window); + commonShim.shimConnectionState(window); + commonShim.shimMaxMessageSize(window); + commonShim.shimSendThrowTypeError(window); + break; + case 'edge': + if (!edgeShim || !edgeShim.shimPeerConnection || !options.shimEdge) { + logging('MS edge shim is not included in this adapter release.'); + return adapter; + } + logging('adapter.js shimming edge.'); + // Export to the adapter global object visible in the browser. + adapter.browserShim = edgeShim; + + edgeShim.shimGetUserMedia(window); + edgeShim.shimGetDisplayMedia(window); + edgeShim.shimPeerConnection(window); + edgeShim.shimReplaceTrack(window); + + // the edge shim implements the full RTCIceCandidate object. + + commonShim.shimMaxMessageSize(window); + commonShim.shimSendThrowTypeError(window); + break; + case 'safari': + if (!safariShim || !options.shimSafari) { + logging('Safari shim is not included in this adapter release.'); + return adapter; + } + logging('adapter.js shimming safari.'); + // Export to the adapter global object visible in the browser. + adapter.browserShim = safariShim; + + safariShim.shimRTCIceServerUrls(window); + safariShim.shimCreateOfferLegacy(window); + safariShim.shimCallbacksAPI(window); + safariShim.shimLocalStreamsAPI(window); + safariShim.shimRemoteStreamsAPI(window); + safariShim.shimTrackEventTransceiver(window); + safariShim.shimGetUserMedia(window); + + commonShim.shimRTCIceCandidate(window); + commonShim.shimMaxMessageSize(window); + commonShim.shimSendThrowTypeError(window); + commonShim.removeAllowExtmapMixed(window); + break; + default: + logging('Unsupported browser!'); + break; + } + + return adapter; + } + +// Browser shims. + + }, { + "./chrome/chrome_shim": 16, + "./common_shim": 19, + "./edge/edge_shim": 20, + "./firefox/firefox_shim": 24, + "./safari/safari_shim": 27, + "./utils": 28 + }], + 16: [function (require, module, exports) { + + /* + * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. + */ + /* eslint-env node */ + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.shimGetDisplayMedia = exports.shimGetUserMedia = undefined; + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + + var _getusermedia = require('./getusermedia'); + + Object.defineProperty(exports, 'shimGetUserMedia', { + enumerable: true, + get: function get() { + return _getusermedia.shimGetUserMedia; + } + }); + + var _getdisplaymedia = require('./getdisplaymedia'); + + Object.defineProperty(exports, 'shimGetDisplayMedia', { + enumerable: true, + get: function get() { + return _getdisplaymedia.shimGetDisplayMedia; + } + }); + exports.shimMediaStream = shimMediaStream; + exports.shimOnTrack = shimOnTrack; + exports.shimGetSendersWithDtmf = shimGetSendersWithDtmf; + exports.shimGetStats = shimGetStats; + exports.shimSenderReceiverGetStats = shimSenderReceiverGetStats; + exports.shimAddTrackRemoveTrackWithNative = shimAddTrackRemoveTrackWithNative; + exports.shimAddTrackRemoveTrack = shimAddTrackRemoveTrack; + exports.shimPeerConnection = shimPeerConnection; + exports.fixNegotiationNeeded = fixNegotiationNeeded; + + var _utils = require('../utils.js'); + + var utils = _interopRequireWildcard(_utils); + + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + newObj.default = obj; + return newObj; + } + } + + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; + } + + function shimMediaStream(window) { + window.MediaStream = window.MediaStream || window.webkitMediaStream; + } + + function shimOnTrack(window) { + if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window.RTCPeerConnection && !('ontrack' in window.RTCPeerConnection.prototype)) { + Object.defineProperty(window.RTCPeerConnection.prototype, 'ontrack', { + get: function get() { + return this._ontrack; + }, + set: function set(f) { + if (this._ontrack) { + this.removeEventListener('track', this._ontrack); + } + this.addEventListener('track', this._ontrack = f); + }, + + enumerable: true, + configurable: true + }); + var origSetRemoteDescription = window.RTCPeerConnection.prototype.setRemoteDescription; + window.RTCPeerConnection.prototype.setRemoteDescription = function setRemoteDescription() { + var _this = this; + + if (!this._ontrackpoly) { + this._ontrackpoly = function (e) { + // onaddstream does not fire when a track is added to an existing + // stream. But stream.onaddtrack is implemented so we use that. + e.stream.addEventListener('addtrack', function (te) { + var receiver = void 0; + if (window.RTCPeerConnection.prototype.getReceivers) { + receiver = _this.getReceivers().find(function (r) { + return r.track && r.track.id === te.track.id; + }); + } else { + receiver = {track: te.track}; + } + + var event = new Event('track'); + event.track = te.track; + event.receiver = receiver; + event.transceiver = {receiver: receiver}; + event.streams = [e.stream]; + _this.dispatchEvent(event); + }); + e.stream.getTracks().forEach(function (track) { + var receiver = void 0; + if (window.RTCPeerConnection.prototype.getReceivers) { + receiver = _this.getReceivers().find(function (r) { + return r.track && r.track.id === track.id; + }); + } else { + receiver = {track: track}; + } + var event = new Event('track'); + event.track = track; + event.receiver = receiver; + event.transceiver = {receiver: receiver}; + event.streams = [e.stream]; + _this.dispatchEvent(event); + }); + }; + this.addEventListener('addstream', this._ontrackpoly); + } + return origSetRemoteDescription.apply(this, arguments); + }; + } else { + // even if RTCRtpTransceiver is in window, it is only used and + // emitted in unified-plan. Unfortunately this means we need + // to unconditionally wrap the event. + utils.wrapPeerConnectionEvent(window, 'track', function (e) { + if (!e.transceiver) { + Object.defineProperty(e, 'transceiver', {value: {receiver: e.receiver}}); + } + return e; + }); + } + } + + function shimGetSendersWithDtmf(window) { + // Overrides addTrack/removeTrack, depends on shimAddTrackRemoveTrack. + if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window.RTCPeerConnection && !('getSenders' in window.RTCPeerConnection.prototype) && 'createDTMFSender' in window.RTCPeerConnection.prototype) { + var shimSenderWithDtmf = function shimSenderWithDtmf(pc, track) { + return { + track: track, + get dtmf() { + if (this._dtmf === undefined) { + if (track.kind === 'audio') { + this._dtmf = pc.createDTMFSender(track); + } else { + this._dtmf = null; + } + } + return this._dtmf; + }, + _pc: pc + }; + }; + + // augment addTrack when getSenders is not available. + if (!window.RTCPeerConnection.prototype.getSenders) { + window.RTCPeerConnection.prototype.getSenders = function getSenders() { + this._senders = this._senders || []; + return this._senders.slice(); // return a copy of the internal state. + }; + var origAddTrack = window.RTCPeerConnection.prototype.addTrack; + window.RTCPeerConnection.prototype.addTrack = function addTrack(track, stream) { + var sender = origAddTrack.apply(this, arguments); + if (!sender) { + sender = shimSenderWithDtmf(this, track); + this._senders.push(sender); + } + return sender; + }; + + var origRemoveTrack = window.RTCPeerConnection.prototype.removeTrack; + window.RTCPeerConnection.prototype.removeTrack = function removeTrack(sender) { + origRemoveTrack.apply(this, arguments); + var idx = this._senders.indexOf(sender); + if (idx !== -1) { + this._senders.splice(idx, 1); + } + }; + } + var origAddStream = window.RTCPeerConnection.prototype.addStream; + window.RTCPeerConnection.prototype.addStream = function addStream(stream) { + var _this2 = this; + + this._senders = this._senders || []; + origAddStream.apply(this, [stream]); + stream.getTracks().forEach(function (track) { + _this2._senders.push(shimSenderWithDtmf(_this2, track)); + }); + }; + + var origRemoveStream = window.RTCPeerConnection.prototype.removeStream; + window.RTCPeerConnection.prototype.removeStream = function removeStream(stream) { + var _this3 = this; + + this._senders = this._senders || []; + origRemoveStream.apply(this, [stream]); + + stream.getTracks().forEach(function (track) { + var sender = _this3._senders.find(function (s) { + return s.track === track; + }); + if (sender) { + // remove sender + _this3._senders.splice(_this3._senders.indexOf(sender), 1); + } + }); + }; + } else if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window.RTCPeerConnection && 'getSenders' in window.RTCPeerConnection.prototype && 'createDTMFSender' in window.RTCPeerConnection.prototype && window.RTCRtpSender && !('dtmf' in window.RTCRtpSender.prototype)) { + var origGetSenders = window.RTCPeerConnection.prototype.getSenders; + window.RTCPeerConnection.prototype.getSenders = function getSenders() { + var _this4 = this; + + var senders = origGetSenders.apply(this, []); + senders.forEach(function (sender) { + return sender._pc = _this4; + }); + return senders; + }; + + Object.defineProperty(window.RTCRtpSender.prototype, 'dtmf', { + get: function get() { + if (this._dtmf === undefined) { + if (this.track.kind === 'audio') { + this._dtmf = this._pc.createDTMFSender(this.track); + } else { + this._dtmf = null; + } + } + return this._dtmf; + } + }); + } + } + + function shimGetStats(window) { + if (!window.RTCPeerConnection) { + return; + } + + var origGetStats = window.RTCPeerConnection.prototype.getStats; + window.RTCPeerConnection.prototype.getStats = function getStats() { + var _this5 = this; + + var _arguments = Array.prototype.slice.call(arguments), + selector = _arguments[0], + onSucc = _arguments[1], + onErr = _arguments[2]; + + // If selector is a function then we are in the old style stats so just + // pass back the original getStats format to avoid breaking old users. + + + if (arguments.length > 0 && typeof selector === 'function') { + return origGetStats.apply(this, arguments); + } + + // When spec-style getStats is supported, return those when called with + // either no arguments or the selector argument is null. + if (origGetStats.length === 0 && (arguments.length === 0 || typeof selector !== 'function')) { + return origGetStats.apply(this, []); + } + + var fixChromeStats_ = function fixChromeStats_(response) { + var standardReport = {}; + var reports = response.result(); + reports.forEach(function (report) { + var standardStats = { + id: report.id, + timestamp: report.timestamp, + type: { + localcandidate: 'local-candidate', + remotecandidate: 'remote-candidate' + }[report.type] || report.type + }; + report.names().forEach(function (name) { + standardStats[name] = report.stat(name); + }); + standardReport[standardStats.id] = standardStats; + }); + + return standardReport; + }; + + // shim getStats with maplike support + var makeMapStats = function makeMapStats(stats) { + return new Map(Object.keys(stats).map(function (key) { + return [key, stats[key]]; + })); + }; + + if (arguments.length >= 2) { + var successCallbackWrapper_ = function successCallbackWrapper_(response) { + onSucc(makeMapStats(fixChromeStats_(response))); + }; + + return origGetStats.apply(this, [successCallbackWrapper_, selector]); + } + + // promise-support + return new Promise(function (resolve, reject) { + origGetStats.apply(_this5, [function (response) { + resolve(makeMapStats(fixChromeStats_(response))); + }, reject]); + }).then(onSucc, onErr); + }; + } + + function shimSenderReceiverGetStats(window) { + if (!((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window.RTCPeerConnection && window.RTCRtpSender && window.RTCRtpReceiver)) { + return; + } + + // shim sender stats. + if (!('getStats' in window.RTCRtpSender.prototype)) { + var origGetSenders = window.RTCPeerConnection.prototype.getSenders; + if (origGetSenders) { + window.RTCPeerConnection.prototype.getSenders = function getSenders() { + var _this6 = this; + + var senders = origGetSenders.apply(this, []); + senders.forEach(function (sender) { + return sender._pc = _this6; + }); + return senders; + }; + } + + var origAddTrack = window.RTCPeerConnection.prototype.addTrack; + if (origAddTrack) { + window.RTCPeerConnection.prototype.addTrack = function addTrack() { + var sender = origAddTrack.apply(this, arguments); + sender._pc = this; + return sender; + }; + } + window.RTCRtpSender.prototype.getStats = function getStats() { + var sender = this; + return this._pc.getStats().then(function (result) { + return ( + /* Note: this will include stats of all senders that + * send a track with the same id as sender.track as + * it is not possible to identify the RTCRtpSender. + */ + utils.filterStats(result, sender.track, true) + ); + }); + }; + } + + // shim receiver stats. + if (!('getStats' in window.RTCRtpReceiver.prototype)) { + var origGetReceivers = window.RTCPeerConnection.prototype.getReceivers; + if (origGetReceivers) { + window.RTCPeerConnection.prototype.getReceivers = function getReceivers() { + var _this7 = this; + + var receivers = origGetReceivers.apply(this, []); + receivers.forEach(function (receiver) { + return receiver._pc = _this7; + }); + return receivers; + }; + } + utils.wrapPeerConnectionEvent(window, 'track', function (e) { + e.receiver._pc = e.srcElement; + return e; + }); + window.RTCRtpReceiver.prototype.getStats = function getStats() { + var receiver = this; + return this._pc.getStats().then(function (result) { + return utils.filterStats(result, receiver.track, false); + }); + }; + } + + if (!('getStats' in window.RTCRtpSender.prototype && 'getStats' in window.RTCRtpReceiver.prototype)) { + return; + } + + // shim RTCPeerConnection.getStats(track). + var origGetStats = window.RTCPeerConnection.prototype.getStats; + window.RTCPeerConnection.prototype.getStats = function getStats() { + if (arguments.length > 0 && arguments[0] instanceof window.MediaStreamTrack) { + var track = arguments[0]; + var sender = void 0; + var receiver = void 0; + var err = void 0; + this.getSenders().forEach(function (s) { + if (s.track === track) { + if (sender) { + err = true; + } else { + sender = s; + } + } + }); + this.getReceivers().forEach(function (r) { + if (r.track === track) { + if (receiver) { + err = true; + } else { + receiver = r; + } + } + return r.track === track; + }); + if (err || sender && receiver) { + return Promise.reject(new DOMException('There are more than one sender or receiver for the track.', 'InvalidAccessError')); + } else if (sender) { + return sender.getStats(); + } else if (receiver) { + return receiver.getStats(); + } + return Promise.reject(new DOMException('There is no sender or receiver for the track.', 'InvalidAccessError')); + } + return origGetStats.apply(this, arguments); + }; + } + + function shimAddTrackRemoveTrackWithNative(window) { + // shim addTrack/removeTrack with native variants in order to make + // the interactions with legacy getLocalStreams behave as in other browsers. + // Keeps a mapping stream.id => [stream, rtpsenders...] + window.RTCPeerConnection.prototype.getLocalStreams = function getLocalStreams() { + var _this8 = this; + + this._shimmedLocalStreams = this._shimmedLocalStreams || {}; + return Object.keys(this._shimmedLocalStreams).map(function (streamId) { + return _this8._shimmedLocalStreams[streamId][0]; + }); + }; + + var origAddTrack = window.RTCPeerConnection.prototype.addTrack; + window.RTCPeerConnection.prototype.addTrack = function addTrack(track, stream) { + if (!stream) { + return origAddTrack.apply(this, arguments); + } + this._shimmedLocalStreams = this._shimmedLocalStreams || {}; + + var sender = origAddTrack.apply(this, arguments); + if (!this._shimmedLocalStreams[stream.id]) { + this._shimmedLocalStreams[stream.id] = [stream, sender]; + } else if (this._shimmedLocalStreams[stream.id].indexOf(sender) === -1) { + this._shimmedLocalStreams[stream.id].push(sender); + } + return sender; + }; + + var origAddStream = window.RTCPeerConnection.prototype.addStream; + window.RTCPeerConnection.prototype.addStream = function addStream(stream) { + var _this9 = this; + + this._shimmedLocalStreams = this._shimmedLocalStreams || {}; + + stream.getTracks().forEach(function (track) { + var alreadyExists = _this9.getSenders().find(function (s) { + return s.track === track; + }); + if (alreadyExists) { + throw new DOMException('Track already exists.', 'InvalidAccessError'); + } + }); + var existingSenders = this.getSenders(); + origAddStream.apply(this, arguments); + var newSenders = this.getSenders().filter(function (newSender) { + return existingSenders.indexOf(newSender) === -1; + }); + this._shimmedLocalStreams[stream.id] = [stream].concat(newSenders); + }; + + var origRemoveStream = window.RTCPeerConnection.prototype.removeStream; + window.RTCPeerConnection.prototype.removeStream = function removeStream(stream) { + this._shimmedLocalStreams = this._shimmedLocalStreams || {}; + delete this._shimmedLocalStreams[stream.id]; + return origRemoveStream.apply(this, arguments); + }; + + var origRemoveTrack = window.RTCPeerConnection.prototype.removeTrack; + window.RTCPeerConnection.prototype.removeTrack = function removeTrack(sender) { + var _this10 = this; + + this._shimmedLocalStreams = this._shimmedLocalStreams || {}; + if (sender) { + Object.keys(this._shimmedLocalStreams).forEach(function (streamId) { + var idx = _this10._shimmedLocalStreams[streamId].indexOf(sender); + if (idx !== -1) { + _this10._shimmedLocalStreams[streamId].splice(idx, 1); + } + if (_this10._shimmedLocalStreams[streamId].length === 1) { + delete _this10._shimmedLocalStreams[streamId]; + } + }); + } + return origRemoveTrack.apply(this, arguments); + }; + } + + function shimAddTrackRemoveTrack(window) { + if (!window.RTCPeerConnection) { + return; + } + var browserDetails = utils.detectBrowser(window); + // shim addTrack and removeTrack. + if (window.RTCPeerConnection.prototype.addTrack && browserDetails.version >= 65) { + return shimAddTrackRemoveTrackWithNative(window); + } + + // also shim pc.getLocalStreams when addTrack is shimmed + // to return the original streams. + var origGetLocalStreams = window.RTCPeerConnection.prototype.getLocalStreams; + window.RTCPeerConnection.prototype.getLocalStreams = function getLocalStreams() { + var _this11 = this; + + var nativeStreams = origGetLocalStreams.apply(this); + this._reverseStreams = this._reverseStreams || {}; + return nativeStreams.map(function (stream) { + return _this11._reverseStreams[stream.id]; + }); + }; + + var origAddStream = window.RTCPeerConnection.prototype.addStream; + window.RTCPeerConnection.prototype.addStream = function addStream(stream) { + var _this12 = this; + + this._streams = this._streams || {}; + this._reverseStreams = this._reverseStreams || {}; + + stream.getTracks().forEach(function (track) { + var alreadyExists = _this12.getSenders().find(function (s) { + return s.track === track; + }); + if (alreadyExists) { + throw new DOMException('Track already exists.', 'InvalidAccessError'); + } + }); + // Add identity mapping for consistency with addTrack. + // Unless this is being used with a stream from addTrack. + if (!this._reverseStreams[stream.id]) { + var newStream = new window.MediaStream(stream.getTracks()); + this._streams[stream.id] = newStream; + this._reverseStreams[newStream.id] = stream; + stream = newStream; + } + origAddStream.apply(this, [stream]); + }; + + var origRemoveStream = window.RTCPeerConnection.prototype.removeStream; + window.RTCPeerConnection.prototype.removeStream = function removeStream(stream) { + this._streams = this._streams || {}; + this._reverseStreams = this._reverseStreams || {}; + + origRemoveStream.apply(this, [this._streams[stream.id] || stream]); + delete this._reverseStreams[this._streams[stream.id] ? this._streams[stream.id].id : stream.id]; + delete this._streams[stream.id]; + }; + + window.RTCPeerConnection.prototype.addTrack = function addTrack(track, stream) { + var _this13 = this; + + if (this.signalingState === 'closed') { + throw new DOMException('The RTCPeerConnection\'s signalingState is \'closed\'.', 'InvalidStateError'); + } + var streams = [].slice.call(arguments, 1); + if (streams.length !== 1 || !streams[0].getTracks().find(function (t) { + return t === track; + })) { + // this is not fully correct but all we can manage without + // [[associated MediaStreams]] internal slot. + throw new DOMException('The adapter.js addTrack polyfill only supports a single ' + ' stream which is associated with the specified track.', 'NotSupportedError'); + } + + var alreadyExists = this.getSenders().find(function (s) { + return s.track === track; + }); + if (alreadyExists) { + throw new DOMException('Track already exists.', 'InvalidAccessError'); + } + + this._streams = this._streams || {}; + this._reverseStreams = this._reverseStreams || {}; + var oldStream = this._streams[stream.id]; + if (oldStream) { + // this is using odd Chrome behaviour, use with caution: + // https://bugs.chromium.org/p/webrtc/issues/detail?id=7815 + // Note: we rely on the high-level addTrack/dtmf shim to + // create the sender with a dtmf sender. + oldStream.addTrack(track); + + // Trigger ONN async. + Promise.resolve().then(function () { + _this13.dispatchEvent(new Event('negotiationneeded')); + }); + } else { + var newStream = new window.MediaStream([track]); + this._streams[stream.id] = newStream; + this._reverseStreams[newStream.id] = stream; + this.addStream(newStream); + } + return this.getSenders().find(function (s) { + return s.track === track; + }); + }; + + // replace the internal stream id with the external one and + // vice versa. + function replaceInternalStreamId(pc, description) { + var sdp = description.sdp; + Object.keys(pc._reverseStreams || []).forEach(function (internalId) { + var externalStream = pc._reverseStreams[internalId]; + var internalStream = pc._streams[externalStream.id]; + sdp = sdp.replace(new RegExp(internalStream.id, 'g'), externalStream.id); + }); + return new RTCSessionDescription({ + type: description.type, + sdp: sdp + }); + } + + function replaceExternalStreamId(pc, description) { + var sdp = description.sdp; + Object.keys(pc._reverseStreams || []).forEach(function (internalId) { + var externalStream = pc._reverseStreams[internalId]; + var internalStream = pc._streams[externalStream.id]; + sdp = sdp.replace(new RegExp(externalStream.id, 'g'), internalStream.id); + }); + return new RTCSessionDescription({ + type: description.type, + sdp: sdp + }); + } + + ['createOffer', 'createAnswer'].forEach(function (method) { + var nativeMethod = window.RTCPeerConnection.prototype[method]; + var methodObj = _defineProperty({}, method, function () { + var _this14 = this; + + var args = arguments; + var isLegacyCall = arguments.length && typeof arguments[0] === 'function'; + if (isLegacyCall) { + return nativeMethod.apply(this, [function (description) { + var desc = replaceInternalStreamId(_this14, description); + args[0].apply(null, [desc]); + }, function (err) { + if (args[1]) { + args[1].apply(null, err); + } + }, arguments[2]]); + } + return nativeMethod.apply(this, arguments).then(function (description) { + return replaceInternalStreamId(_this14, description); + }); + }); + window.RTCPeerConnection.prototype[method] = methodObj[method]; + }); + + var origSetLocalDescription = window.RTCPeerConnection.prototype.setLocalDescription; + window.RTCPeerConnection.prototype.setLocalDescription = function setLocalDescription() { + if (!arguments.length || !arguments[0].type) { + return origSetLocalDescription.apply(this, arguments); + } + arguments[0] = replaceExternalStreamId(this, arguments[0]); + return origSetLocalDescription.apply(this, arguments); + }; + + // TODO: mangle getStats: https://w3c.github.io/webrtc-stats/#dom-rtcmediastreamstats-streamidentifier + + var origLocalDescription = Object.getOwnPropertyDescriptor(window.RTCPeerConnection.prototype, 'localDescription'); + Object.defineProperty(window.RTCPeerConnection.prototype, 'localDescription', { + get: function get() { + var description = origLocalDescription.get.apply(this); + if (description.type === '') { + return description; + } + return replaceInternalStreamId(this, description); + } + }); + + window.RTCPeerConnection.prototype.removeTrack = function removeTrack(sender) { + var _this15 = this; + + if (this.signalingState === 'closed') { + throw new DOMException('The RTCPeerConnection\'s signalingState is \'closed\'.', 'InvalidStateError'); + } + // We can not yet check for sender instanceof RTCRtpSender + // since we shim RTPSender. So we check if sender._pc is set. + if (!sender._pc) { + throw new DOMException('Argument 1 of RTCPeerConnection.removeTrack ' + 'does not implement interface RTCRtpSender.', 'TypeError'); + } + var isLocal = sender._pc === this; + if (!isLocal) { + throw new DOMException('Sender was not created by this connection.', 'InvalidAccessError'); + } + + // Search for the native stream the senders track belongs to. + this._streams = this._streams || {}; + var stream = void 0; + Object.keys(this._streams).forEach(function (streamid) { + var hasTrack = _this15._streams[streamid].getTracks().find(function (track) { + return sender.track === track; + }); + if (hasTrack) { + stream = _this15._streams[streamid]; + } + }); + + if (stream) { + if (stream.getTracks().length === 1) { + // if this is the last track of the stream, remove the stream. This + // takes care of any shimmed _senders. + this.removeStream(this._reverseStreams[stream.id]); + } else { + // relying on the same odd chrome behaviour as above. + stream.removeTrack(sender.track); + } + this.dispatchEvent(new Event('negotiationneeded')); + } + }; + } + + function shimPeerConnection(window) { + var browserDetails = utils.detectBrowser(window); + + if (!window.RTCPeerConnection && window.webkitRTCPeerConnection) { + // very basic support for old versions. + window.RTCPeerConnection = window.webkitRTCPeerConnection; + } + if (!window.RTCPeerConnection) { + return; + } + + // shim implicit creation of RTCSessionDescription/RTCIceCandidate + if (browserDetails.version < 53) { + ['setLocalDescription', 'setRemoteDescription', 'addIceCandidate'].forEach(function (method) { + var nativeMethod = window.RTCPeerConnection.prototype[method]; + var methodObj = _defineProperty({}, method, function () { + arguments[0] = new (method === 'addIceCandidate' ? window.RTCIceCandidate : window.RTCSessionDescription)(arguments[0]); + return nativeMethod.apply(this, arguments); + }); + window.RTCPeerConnection.prototype[method] = methodObj[method]; + }); + } + + // support for addIceCandidate(null or undefined) + var nativeAddIceCandidate = window.RTCPeerConnection.prototype.addIceCandidate; + window.RTCPeerConnection.prototype.addIceCandidate = function addIceCandidate() { + if (!arguments[0]) { + if (arguments[1]) { + arguments[1].apply(null); + } + return Promise.resolve(); + } + // Firefox 68+ emits and processes {candidate: "", ...}, ignore + // in older versions. Native support planned for Chrome M77. + if (browserDetails.version < 78 && arguments[0] && arguments[0].candidate === '') { + return Promise.resolve(); + } + return nativeAddIceCandidate.apply(this, arguments); + }; + } + + function fixNegotiationNeeded(window) { + utils.wrapPeerConnectionEvent(window, 'negotiationneeded', function (e) { + var pc = e.target; + if (pc.signalingState !== 'stable') { + return; + } + return e; + }); + } + + }, {"../utils.js": 28, "./getdisplaymedia": 17, "./getusermedia": 18}], + 17: [function (require, module, exports) { + /* + * Copyright (c) 2018 The adapter.js project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. + */ + /* eslint-env node */ + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.shimGetDisplayMedia = shimGetDisplayMedia; + + function shimGetDisplayMedia(window, getSourceId) { + if (window.navigator.mediaDevices && 'getDisplayMedia' in window.navigator.mediaDevices) { + return; + } + if (!window.navigator.mediaDevices) { + return; + } + // getSourceId is a function that returns a promise resolving with + // the sourceId of the screen/window/tab to be shared. + if (typeof getSourceId !== 'function') { + console.error('shimGetDisplayMedia: getSourceId argument is not ' + 'a function'); + return; + } + window.navigator.mediaDevices.getDisplayMedia = function getDisplayMedia(constraints) { + return getSourceId(constraints).then(function (sourceId) { + var widthSpecified = constraints.video && constraints.video.width; + var heightSpecified = constraints.video && constraints.video.height; + var frameRateSpecified = constraints.video && constraints.video.frameRate; + constraints.video = { + mandatory: { + chromeMediaSource: 'desktop', + chromeMediaSourceId: sourceId, + maxFrameRate: frameRateSpecified || 3 + } + }; + if (widthSpecified) { + constraints.video.mandatory.maxWidth = widthSpecified; + } + if (heightSpecified) { + constraints.video.mandatory.maxHeight = heightSpecified; + } + return window.navigator.mediaDevices.getUserMedia(constraints); + }); + }; + } + + }, {}], + 18: [function (require, module, exports) { + /* + * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. + */ + /* eslint-env node */ + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + + exports.shimGetUserMedia = shimGetUserMedia; + + var _utils = require('../utils.js'); + + var utils = _interopRequireWildcard(_utils); + + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + newObj.default = obj; + return newObj; + } + } + + var logging = utils.log; + + function shimGetUserMedia(window) { + var navigator = window && window.navigator; + + if (!navigator.mediaDevices) { + return; + } + + var browserDetails = utils.detectBrowser(window); + + var constraintsToChrome_ = function constraintsToChrome_(c) { + if ((typeof c === 'undefined' ? 'undefined' : _typeof(c)) !== 'object' || c.mandatory || c.optional) { + return c; + } + var cc = {}; + Object.keys(c).forEach(function (key) { + if (key === 'require' || key === 'advanced' || key === 'mediaSource') { + return; + } + var r = _typeof(c[key]) === 'object' ? c[key] : {ideal: c[key]}; + if (r.exact !== undefined && typeof r.exact === 'number') { + r.min = r.max = r.exact; + } + var oldname_ = function oldname_(prefix, name) { + if (prefix) { + return prefix + name.charAt(0).toUpperCase() + name.slice(1); + } + return name === 'deviceId' ? 'sourceId' : name; + }; + if (r.ideal !== undefined) { + cc.optional = cc.optional || []; + var oc = {}; + if (typeof r.ideal === 'number') { + oc[oldname_('min', key)] = r.ideal; + cc.optional.push(oc); + oc = {}; + oc[oldname_('max', key)] = r.ideal; + cc.optional.push(oc); + } else { + oc[oldname_('', key)] = r.ideal; + cc.optional.push(oc); + } + } + if (r.exact !== undefined && typeof r.exact !== 'number') { + cc.mandatory = cc.mandatory || {}; + cc.mandatory[oldname_('', key)] = r.exact; + } else { + ['min', 'max'].forEach(function (mix) { + if (r[mix] !== undefined) { + cc.mandatory = cc.mandatory || {}; + cc.mandatory[oldname_(mix, key)] = r[mix]; + } + }); + } + }); + if (c.advanced) { + cc.optional = (cc.optional || []).concat(c.advanced); + } + return cc; + }; + + var shimConstraints_ = function shimConstraints_(constraints, func) { + if (browserDetails.version >= 61) { + return func(constraints); + } + constraints = JSON.parse(JSON.stringify(constraints)); + if (constraints && _typeof(constraints.audio) === 'object') { + var remap = function remap(obj, a, b) { + if (a in obj && !(b in obj)) { + obj[b] = obj[a]; + delete obj[a]; + } + }; + constraints = JSON.parse(JSON.stringify(constraints)); + remap(constraints.audio, 'autoGainControl', 'googAutoGainControl'); + remap(constraints.audio, 'noiseSuppression', 'googNoiseSuppression'); + constraints.audio = constraintsToChrome_(constraints.audio); + } + if (constraints && _typeof(constraints.video) === 'object') { + // Shim facingMode for mobile & surface pro. + var face = constraints.video.facingMode; + face = face && ((typeof face === 'undefined' ? 'undefined' : _typeof(face)) === 'object' ? face : {ideal: face}); + var getSupportedFacingModeLies = browserDetails.version < 66; + + if (face && (face.exact === 'user' || face.exact === 'environment' || face.ideal === 'user' || face.ideal === 'environment') && !(navigator.mediaDevices.getSupportedConstraints && navigator.mediaDevices.getSupportedConstraints().facingMode && !getSupportedFacingModeLies)) { + delete constraints.video.facingMode; + var matches = void 0; + if (face.exact === 'environment' || face.ideal === 'environment') { + matches = ['back', 'rear']; + } else if (face.exact === 'user' || face.ideal === 'user') { + matches = ['front']; + } + if (matches) { + // Look for matches in label, or use last cam for back (typical). + return navigator.mediaDevices.enumerateDevices().then(function (devices) { + devices = devices.filter(function (d) { + return d.kind === 'videoinput'; + }); + var dev = devices.find(function (d) { + return matches.some(function (match) { + return d.label.toLowerCase().includes(match); + }); + }); + if (!dev && devices.length && matches.includes('back')) { + dev = devices[devices.length - 1]; // more likely the back cam + } + if (dev) { + constraints.video.deviceId = face.exact ? {exact: dev.deviceId} : {ideal: dev.deviceId}; + } + constraints.video = constraintsToChrome_(constraints.video); + logging('chrome: ' + JSON.stringify(constraints)); + return func(constraints); + }); + } + } + constraints.video = constraintsToChrome_(constraints.video); + } + logging('chrome: ' + JSON.stringify(constraints)); + return func(constraints); + }; + + var shimError_ = function shimError_(e) { + if (browserDetails.version >= 64) { + return e; + } + return { + name: { + PermissionDeniedError: 'NotAllowedError', + PermissionDismissedError: 'NotAllowedError', + InvalidStateError: 'NotAllowedError', + DevicesNotFoundError: 'NotFoundError', + ConstraintNotSatisfiedError: 'OverconstrainedError', + TrackStartError: 'NotReadableError', + MediaDeviceFailedDueToShutdown: 'NotAllowedError', + MediaDeviceKillSwitchOn: 'NotAllowedError', + TabCaptureError: 'AbortError', + ScreenCaptureError: 'AbortError', + DeviceCaptureError: 'AbortError' + }[e.name] || e.name, + message: e.message, + constraint: e.constraint || e.constraintName, + toString: function toString() { + return this.name + (this.message && ': ') + this.message; + } + }; + }; + + var getUserMedia_ = function getUserMedia_(constraints, onSuccess, onError) { + shimConstraints_(constraints, function (c) { + navigator.webkitGetUserMedia(c, onSuccess, function (e) { + if (onError) { + onError(shimError_(e)); + } + }); + }); + }; + navigator.getUserMedia = getUserMedia_.bind(navigator); + + // Even though Chrome 45 has navigator.mediaDevices and a getUserMedia + // function which returns a Promise, it does not accept spec-style + // constraints. + if (navigator.mediaDevices.getUserMedia) { + var origGetUserMedia = navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices); + navigator.mediaDevices.getUserMedia = function (cs) { + return shimConstraints_(cs, function (c) { + return origGetUserMedia(c).then(function (stream) { + if (c.audio && !stream.getAudioTracks().length || c.video && !stream.getVideoTracks().length) { + stream.getTracks().forEach(function (track) { + track.stop(); + }); + throw new DOMException('', 'NotFoundError'); + } + return stream; + }, function (e) { + return Promise.reject(shimError_(e)); + }); + }); + }; + } + } + + }, {"../utils.js": 28}], + 19: [function (require, module, exports) { + /* + * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. + */ + /* eslint-env node */ + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + + exports.shimRTCIceCandidate = shimRTCIceCandidate; + exports.shimMaxMessageSize = shimMaxMessageSize; + exports.shimSendThrowTypeError = shimSendThrowTypeError; + exports.shimConnectionState = shimConnectionState; + exports.removeAllowExtmapMixed = removeAllowExtmapMixed; + + var _sdp = require('sdp'); + + var _sdp2 = _interopRequireDefault(_sdp); + + var _utils = require('./utils'); + + var utils = _interopRequireWildcard(_utils); + + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + newObj.default = obj; + return newObj; + } + } + + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; + } + + function shimRTCIceCandidate(window) { + // foundation is arbitrarily chosen as an indicator for full support for + // https://w3c.github.io/webrtc-pc/#rtcicecandidate-interface + if (!window.RTCIceCandidate || window.RTCIceCandidate && 'foundation' in window.RTCIceCandidate.prototype) { + return; + } + + var NativeRTCIceCandidate = window.RTCIceCandidate; + window.RTCIceCandidate = function RTCIceCandidate(args) { + // Remove the a= which shouldn't be part of the candidate string. + if ((typeof args === 'undefined' ? 'undefined' : _typeof(args)) === 'object' && args.candidate && args.candidate.indexOf('a=') === 0) { + args = JSON.parse(JSON.stringify(args)); + args.candidate = args.candidate.substr(2); + } + + if (args.candidate && args.candidate.length) { + // Augment the native candidate with the parsed fields. + var nativeCandidate = new NativeRTCIceCandidate(args); + var parsedCandidate = _sdp2.default.parseCandidate(args.candidate); + var augmentedCandidate = Object.assign(nativeCandidate, parsedCandidate); + + // Add a serializer that does not serialize the extra attributes. + augmentedCandidate.toJSON = function toJSON() { + return { + candidate: augmentedCandidate.candidate, + sdpMid: augmentedCandidate.sdpMid, + sdpMLineIndex: augmentedCandidate.sdpMLineIndex, + usernameFragment: augmentedCandidate.usernameFragment + }; + }; + return augmentedCandidate; + } + return new NativeRTCIceCandidate(args); + }; + window.RTCIceCandidate.prototype = NativeRTCIceCandidate.prototype; + + // Hook up the augmented candidate in onicecandidate and + // addEventListener('icecandidate', ...) + utils.wrapPeerConnectionEvent(window, 'icecandidate', function (e) { + if (e.candidate) { + Object.defineProperty(e, 'candidate', { + value: new window.RTCIceCandidate(e.candidate), + writable: 'false' + }); + } + return e; + }); + } + + function shimMaxMessageSize(window) { + if (!window.RTCPeerConnection) { + return; + } + var browserDetails = utils.detectBrowser(window); + + if (!('sctp' in window.RTCPeerConnection.prototype)) { + Object.defineProperty(window.RTCPeerConnection.prototype, 'sctp', { + get: function get() { + return typeof this._sctp === 'undefined' ? null : this._sctp; + } + }); + } + + var sctpInDescription = function sctpInDescription(description) { + if (!description || !description.sdp) { + return false; + } + var sections = _sdp2.default.splitSections(description.sdp); + sections.shift(); + return sections.some(function (mediaSection) { + var mLine = _sdp2.default.parseMLine(mediaSection); + return mLine && mLine.kind === 'application' && mLine.protocol.indexOf('SCTP') !== -1; + }); + }; + + var getRemoteFirefoxVersion = function getRemoteFirefoxVersion(description) { + // TODO: Is there a better solution for detecting Firefox? + var match = description.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/); + if (match === null || match.length < 2) { + return -1; + } + var version = parseInt(match[1], 10); + // Test for NaN (yes, this is ugly) + return version !== version ? -1 : version; + }; + + var getCanSendMaxMessageSize = function getCanSendMaxMessageSize(remoteIsFirefox) { + // Every implementation we know can send at least 64 KiB. + // Note: Although Chrome is technically able to send up to 256 KiB, the + // data does not reach the other peer reliably. + // See: https://bugs.chromium.org/p/webrtc/issues/detail?id=8419 + var canSendMaxMessageSize = 65536; + if (browserDetails.browser === 'firefox') { + if (browserDetails.version < 57) { + if (remoteIsFirefox === -1) { + // FF < 57 will send in 16 KiB chunks using the deprecated PPID + // fragmentation. + canSendMaxMessageSize = 16384; + } else { + // However, other FF (and RAWRTC) can reassemble PPID-fragmented + // messages. Thus, supporting ~2 GiB when sending. + canSendMaxMessageSize = 2147483637; + } + } else if (browserDetails.version < 60) { + // Currently, all FF >= 57 will reset the remote maximum message size + // to the default value when a data channel is created at a later + // stage. :( + // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1426831 + canSendMaxMessageSize = browserDetails.version === 57 ? 65535 : 65536; + } else { + // FF >= 60 supports sending ~2 GiB + canSendMaxMessageSize = 2147483637; + } + } + return canSendMaxMessageSize; + }; + + var getMaxMessageSize = function getMaxMessageSize(description, remoteIsFirefox) { + // Note: 65536 bytes is the default value from the SDP spec. Also, + // every implementation we know supports receiving 65536 bytes. + var maxMessageSize = 65536; + + // FF 57 has a slightly incorrect default remote max message size, so + // we need to adjust it here to avoid a failure when sending. + // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1425697 + if (browserDetails.browser === 'firefox' && browserDetails.version === 57) { + maxMessageSize = 65535; + } + + var match = _sdp2.default.matchPrefix(description.sdp, 'a=max-message-size:'); + if (match.length > 0) { + maxMessageSize = parseInt(match[0].substr(19), 10); + } else if (browserDetails.browser === 'firefox' && remoteIsFirefox !== -1) { + // If the maximum message size is not present in the remote SDP and + // both local and remote are Firefox, the remote peer can receive + // ~2 GiB. + maxMessageSize = 2147483637; + } + return maxMessageSize; + }; + + var origSetRemoteDescription = window.RTCPeerConnection.prototype.setRemoteDescription; + window.RTCPeerConnection.prototype.setRemoteDescription = function setRemoteDescription() { + this._sctp = null; + // Chrome decided to not expose .sctp in plan-b mode. + // As usual, adapter.js has to do an 'ugly worakaround' + // to cover up the mess. + if (browserDetails.browser === 'chrome' && browserDetails.version >= 76) { + var _getConfiguration = this.getConfiguration(), + sdpSemantics = _getConfiguration.sdpSemantics; + + if (sdpSemantics === 'plan-b') { + Object.defineProperty(this, 'sctp', { + get: function get() { + return typeof this._sctp === 'undefined' ? null : this._sctp; + }, + + enumerable: true, + configurable: true + }); + } + } + + if (sctpInDescription(arguments[0])) { + // Check if the remote is FF. + var isFirefox = getRemoteFirefoxVersion(arguments[0]); + + // Get the maximum message size the local peer is capable of sending + var canSendMMS = getCanSendMaxMessageSize(isFirefox); + + // Get the maximum message size of the remote peer. + var remoteMMS = getMaxMessageSize(arguments[0], isFirefox); + + // Determine final maximum message size + var maxMessageSize = void 0; + if (canSendMMS === 0 && remoteMMS === 0) { + maxMessageSize = Number.POSITIVE_INFINITY; + } else if (canSendMMS === 0 || remoteMMS === 0) { + maxMessageSize = Math.max(canSendMMS, remoteMMS); + } else { + maxMessageSize = Math.min(canSendMMS, remoteMMS); + } + + // Create a dummy RTCSctpTransport object and the 'maxMessageSize' + // attribute. + var sctp = {}; + Object.defineProperty(sctp, 'maxMessageSize', { + get: function get() { + return maxMessageSize; + } + }); + this._sctp = sctp; + } + + return origSetRemoteDescription.apply(this, arguments); + }; + } + + function shimSendThrowTypeError(window) { + if (!(window.RTCPeerConnection && 'createDataChannel' in window.RTCPeerConnection.prototype)) { + return; + } + + // Note: Although Firefox >= 57 has a native implementation, the maximum + // message size can be reset for all data channels at a later stage. + // See: https://bugzilla.mozilla.org/show_bug.cgi?id=1426831 + + function wrapDcSend(dc, pc) { + var origDataChannelSend = dc.send; + dc.send = function send() { + var data = arguments[0]; + var length = data.length || data.size || data.byteLength; + if (dc.readyState === 'open' && pc.sctp && length > pc.sctp.maxMessageSize) { + throw new TypeError('Message too large (can send a maximum of ' + pc.sctp.maxMessageSize + ' bytes)'); + } + return origDataChannelSend.apply(dc, arguments); + }; + } + + var origCreateDataChannel = window.RTCPeerConnection.prototype.createDataChannel; + window.RTCPeerConnection.prototype.createDataChannel = function createDataChannel() { + var dataChannel = origCreateDataChannel.apply(this, arguments); + wrapDcSend(dataChannel, this); + return dataChannel; + }; + utils.wrapPeerConnectionEvent(window, 'datachannel', function (e) { + wrapDcSend(e.channel, e.target); + return e; + }); + } + + /* shims RTCConnectionState by pretending it is the same as iceConnectionState. + * See https://bugs.chromium.org/p/webrtc/issues/detail?id=6145#c12 + * for why this is a valid hack in Chrome. In Firefox it is slightly incorrect + * since DTLS failures would be hidden. See + * https://bugzilla.mozilla.org/show_bug.cgi?id=1265827 + * for the Firefox tracking bug. + */ + function shimConnectionState(window) { + if (!window.RTCPeerConnection || 'connectionState' in window.RTCPeerConnection.prototype) { + return; + } + var proto = window.RTCPeerConnection.prototype; + Object.defineProperty(proto, 'connectionState', { + get: function get() { + return { + completed: 'connected', + checking: 'connecting' + }[this.iceConnectionState] || this.iceConnectionState; + }, + + enumerable: true, + configurable: true + }); + Object.defineProperty(proto, 'onconnectionstatechange', { + get: function get() { + return this._onconnectionstatechange || null; + }, + set: function set(cb) { + if (this._onconnectionstatechange) { + this.removeEventListener('connectionstatechange', this._onconnectionstatechange); + delete this._onconnectionstatechange; + } + if (cb) { + this.addEventListener('connectionstatechange', this._onconnectionstatechange = cb); + } + }, + + enumerable: true, + configurable: true + }); + + ['setLocalDescription', 'setRemoteDescription'].forEach(function (method) { + var origMethod = proto[method]; + proto[method] = function () { + if (!this._connectionstatechangepoly) { + this._connectionstatechangepoly = function (e) { + var pc = e.target; + if (pc._lastConnectionState !== pc.connectionState) { + pc._lastConnectionState = pc.connectionState; + var newEvent = new Event('connectionstatechange', e); + pc.dispatchEvent(newEvent); + } + return e; + }; + this.addEventListener('iceconnectionstatechange', this._connectionstatechangepoly); + } + return origMethod.apply(this, arguments); + }; + }); + } + + function removeAllowExtmapMixed(window) { + /* remove a=extmap-allow-mixed for Chrome < M71 */ + if (!window.RTCPeerConnection) { + return; + } + var browserDetails = utils.detectBrowser(window); + if (browserDetails.browser === 'chrome' && browserDetails.version >= 71) { + return; + } + var nativeSRD = window.RTCPeerConnection.prototype.setRemoteDescription; + window.RTCPeerConnection.prototype.setRemoteDescription = function setRemoteDescription(desc) { + if (desc && desc.sdp && desc.sdp.indexOf('\na=extmap-allow-mixed') !== -1) { + desc.sdp = desc.sdp.split('\n').filter(function (line) { + return line.trim() !== 'a=extmap-allow-mixed'; + }).join('\n'); + } + return nativeSRD.apply(this, arguments); + }; + } + + }, {"./utils": 28, "sdp": 29}], + 20: [function (require, module, exports) { + /* + * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. + */ + /* eslint-env node */ + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.shimGetDisplayMedia = exports.shimGetUserMedia = undefined; + + var _getusermedia = require('./getusermedia'); + + Object.defineProperty(exports, 'shimGetUserMedia', { + enumerable: true, + get: function get() { + return _getusermedia.shimGetUserMedia; + } + }); + + var _getdisplaymedia = require('./getdisplaymedia'); + + Object.defineProperty(exports, 'shimGetDisplayMedia', { + enumerable: true, + get: function get() { + return _getdisplaymedia.shimGetDisplayMedia; + } + }); + exports.shimPeerConnection = shimPeerConnection; + exports.shimReplaceTrack = shimReplaceTrack; + + var _utils = require('../utils'); + + var utils = _interopRequireWildcard(_utils); + + var _filtericeservers = require('./filtericeservers'); + + var _rtcpeerconnectionShim = require('rtcpeerconnection-shim'); + + var _rtcpeerconnectionShim2 = _interopRequireDefault(_rtcpeerconnectionShim); + + function _interopRequireDefault(obj) { + return obj && obj.__esModule ? obj : {default: obj}; + } + + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + newObj.default = obj; + return newObj; + } + } + + function shimPeerConnection(window) { + var browserDetails = utils.detectBrowser(window); + + if (window.RTCIceGatherer) { + if (!window.RTCIceCandidate) { + window.RTCIceCandidate = function RTCIceCandidate(args) { + return args; + }; + } + if (!window.RTCSessionDescription) { + window.RTCSessionDescription = function RTCSessionDescription(args) { + return args; + }; + } + // this adds an additional event listener to MediaStrackTrack that signals + // when a tracks enabled property was changed. Workaround for a bug in + // addStream, see below. No longer required in 15025+ + if (browserDetails.version < 15025) { + var origMSTEnabled = Object.getOwnPropertyDescriptor(window.MediaStreamTrack.prototype, 'enabled'); + Object.defineProperty(window.MediaStreamTrack.prototype, 'enabled', { + set: function set(value) { + origMSTEnabled.set.call(this, value); + var ev = new Event('enabled'); + ev.enabled = value; + this.dispatchEvent(ev); + } + }); + } + } + + // ORTC defines the DTMF sender a bit different. + // https://github.com/w3c/ortc/issues/714 + if (window.RTCRtpSender && !('dtmf' in window.RTCRtpSender.prototype)) { + Object.defineProperty(window.RTCRtpSender.prototype, 'dtmf', { + get: function get() { + if (this._dtmf === undefined) { + if (this.track.kind === 'audio') { + this._dtmf = new window.RTCDtmfSender(this); + } else if (this.track.kind === 'video') { + this._dtmf = null; + } + } + return this._dtmf; + } + }); + } + // Edge currently only implements the RTCDtmfSender, not the + // RTCDTMFSender alias. See http://draft.ortc.org/#rtcdtmfsender2* + if (window.RTCDtmfSender && !window.RTCDTMFSender) { + window.RTCDTMFSender = window.RTCDtmfSender; + } + + var RTCPeerConnectionShim = (0, _rtcpeerconnectionShim2.default)(window, browserDetails.version); + window.RTCPeerConnection = function RTCPeerConnection(config) { + if (config && config.iceServers) { + config.iceServers = (0, _filtericeservers.filterIceServers)(config.iceServers, browserDetails.version); + utils.log('ICE servers after filtering:', config.iceServers); + } + return new RTCPeerConnectionShim(config); + }; + window.RTCPeerConnection.prototype = RTCPeerConnectionShim.prototype; + } + + function shimReplaceTrack(window) { + // ORTC has replaceTrack -- https://github.com/w3c/ortc/issues/614 + if (window.RTCRtpSender && !('replaceTrack' in window.RTCRtpSender.prototype)) { + window.RTCRtpSender.prototype.replaceTrack = window.RTCRtpSender.prototype.setTrack; + } + } + + }, { + "../utils": 28, + "./filtericeservers": 21, + "./getdisplaymedia": 22, + "./getusermedia": 23, + "rtcpeerconnection-shim": 13 + }], + 21: [function (require, module, exports) { + /* + * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. + */ + /* eslint-env node */ + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.filterIceServers = filterIceServers; + + var _utils = require('../utils'); + + var utils = _interopRequireWildcard(_utils); + + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + newObj.default = obj; + return newObj; + } + } + +// Edge does not like +// 1) stun: filtered after 14393 unless ?transport=udp is present +// 2) turn: that does not have all of turn:host:port?transport=udp +// 3) turn: with ipv6 addresses +// 4) turn: occurring muliple times + function filterIceServers(iceServers, edgeVersion) { + var hasTurn = false; + iceServers = JSON.parse(JSON.stringify(iceServers)); + return iceServers.filter(function (server) { + if (server && (server.urls || server.url)) { + var urls = server.urls || server.url; + if (server.url && !server.urls) { + utils.deprecated('RTCIceServer.url', 'RTCIceServer.urls'); + } + var isString = typeof urls === 'string'; + if (isString) { + urls = [urls]; + } + urls = urls.filter(function (url) { + // filter STUN unconditionally. + if (url.indexOf('stun:') === 0) { + return false; + } + + var validTurn = url.startsWith('turn') && !url.startsWith('turn:[') && url.includes('transport=udp'); + if (validTurn && !hasTurn) { + hasTurn = true; + return true; + } + return validTurn && !hasTurn; + }); + + delete server.url; + server.urls = isString ? urls[0] : urls; + return !!urls.length; + } + }); + } + + }, {"../utils": 28}], + 22: [function (require, module, exports) { + /* + * Copyright (c) 2018 The adapter.js project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. + */ + /* eslint-env node */ + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.shimGetDisplayMedia = shimGetDisplayMedia; + + function shimGetDisplayMedia(window) { + if (!('getDisplayMedia' in window.navigator)) { + return; + } + if (!window.navigator.mediaDevices) { + return; + } + if (window.navigator.mediaDevices && 'getDisplayMedia' in window.navigator.mediaDevices) { + return; + } + window.navigator.mediaDevices.getDisplayMedia = window.navigator.getDisplayMedia.bind(window.navigator); + } + + }, {}], + 23: [function (require, module, exports) { + /* + * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. + */ + /* eslint-env node */ + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.shimGetUserMedia = shimGetUserMedia; + + function shimGetUserMedia(window) { + var navigator = window && window.navigator; + + var shimError_ = function shimError_(e) { + return { + name: {PermissionDeniedError: 'NotAllowedError'}[e.name] || e.name, + message: e.message, + constraint: e.constraint, + toString: function toString() { + return this.name; + } + }; + }; + + // getUserMedia error shim. + var origGetUserMedia = navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices); + navigator.mediaDevices.getUserMedia = function (c) { + return origGetUserMedia(c).catch(function (e) { + return Promise.reject(shimError_(e)); + }); + }; + } + + }, {}], + 24: [function (require, module, exports) { + /* + * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. + */ + /* eslint-env node */ + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.shimGetDisplayMedia = exports.shimGetUserMedia = undefined; + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + + var _getusermedia = require('./getusermedia'); + + Object.defineProperty(exports, 'shimGetUserMedia', { + enumerable: true, + get: function get() { + return _getusermedia.shimGetUserMedia; + } + }); + + var _getdisplaymedia = require('./getdisplaymedia'); + + Object.defineProperty(exports, 'shimGetDisplayMedia', { + enumerable: true, + get: function get() { + return _getdisplaymedia.shimGetDisplayMedia; + } + }); + exports.shimOnTrack = shimOnTrack; + exports.shimPeerConnection = shimPeerConnection; + exports.shimSenderGetStats = shimSenderGetStats; + exports.shimReceiverGetStats = shimReceiverGetStats; + exports.shimRemoveStream = shimRemoveStream; + exports.shimRTCDataChannel = shimRTCDataChannel; + + var _utils = require('../utils'); + + var utils = _interopRequireWildcard(_utils); + + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + newObj.default = obj; + return newObj; + } + } + + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; + } + + function shimOnTrack(window) { + if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window.RTCTrackEvent && 'receiver' in window.RTCTrackEvent.prototype && !('transceiver' in window.RTCTrackEvent.prototype)) { + Object.defineProperty(window.RTCTrackEvent.prototype, 'transceiver', { + get: function get() { + return {receiver: this.receiver}; + } + }); + } + } + + function shimPeerConnection(window) { + var browserDetails = utils.detectBrowser(window); + + if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) !== 'object' || !(window.RTCPeerConnection || window.mozRTCPeerConnection)) { + return; // probably media.peerconnection.enabled=false in about:config + } + if (!window.RTCPeerConnection && window.mozRTCPeerConnection) { + // very basic support for old versions. + window.RTCPeerConnection = window.mozRTCPeerConnection; + } + + if (browserDetails.version < 53) { + // shim away need for obsolete RTCIceCandidate/RTCSessionDescription. + ['setLocalDescription', 'setRemoteDescription', 'addIceCandidate'].forEach(function (method) { + var nativeMethod = window.RTCPeerConnection.prototype[method]; + var methodObj = _defineProperty({}, method, function () { + arguments[0] = new (method === 'addIceCandidate' ? window.RTCIceCandidate : window.RTCSessionDescription)(arguments[0]); + return nativeMethod.apply(this, arguments); + }); + window.RTCPeerConnection.prototype[method] = methodObj[method]; + }); + } + + // support for addIceCandidate(null or undefined) + var nativeAddIceCandidate = window.RTCPeerConnection.prototype.addIceCandidate; + window.RTCPeerConnection.prototype.addIceCandidate = function addIceCandidate() { + if (!arguments[0]) { + if (arguments[1]) { + arguments[1].apply(null); + } + return Promise.resolve(); + } + // Firefox 68+ emits and processes {candidate: "", ...}, ignore + // in older versions. + if (browserDetails.version < 68 && arguments[0] && arguments[0].candidate === '') { + return Promise.resolve(); + } + return nativeAddIceCandidate.apply(this, arguments); + }; + + var modernStatsTypes = { + inboundrtp: 'inbound-rtp', + outboundrtp: 'outbound-rtp', + candidatepair: 'candidate-pair', + localcandidate: 'local-candidate', + remotecandidate: 'remote-candidate' + }; + + var nativeGetStats = window.RTCPeerConnection.prototype.getStats; + window.RTCPeerConnection.prototype.getStats = function getStats() { + var _arguments = Array.prototype.slice.call(arguments), + selector = _arguments[0], + onSucc = _arguments[1], + onErr = _arguments[2]; + + return nativeGetStats.apply(this, [selector || null]).then(function (stats) { + if (browserDetails.version < 53 && !onSucc) { + // Shim only promise getStats with spec-hyphens in type names + // Leave callback version alone; misc old uses of forEach before Map + try { + stats.forEach(function (stat) { + stat.type = modernStatsTypes[stat.type] || stat.type; + }); + } catch (e) { + if (e.name !== 'TypeError') { + throw e; + } + // Avoid TypeError: "type" is read-only, in old versions. 34-43ish + stats.forEach(function (stat, i) { + stats.set(i, Object.assign({}, stat, { + type: modernStatsTypes[stat.type] || stat.type + })); + }); + } + } + return stats; + }).then(onSucc, onErr); + }; + } + + function shimSenderGetStats(window) { + if (!((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window.RTCPeerConnection && window.RTCRtpSender)) { + return; + } + if (window.RTCRtpSender && 'getStats' in window.RTCRtpSender.prototype) { + return; + } + var origGetSenders = window.RTCPeerConnection.prototype.getSenders; + if (origGetSenders) { + window.RTCPeerConnection.prototype.getSenders = function getSenders() { + var _this = this; + + var senders = origGetSenders.apply(this, []); + senders.forEach(function (sender) { + return sender._pc = _this; + }); + return senders; + }; + } + + var origAddTrack = window.RTCPeerConnection.prototype.addTrack; + if (origAddTrack) { + window.RTCPeerConnection.prototype.addTrack = function addTrack() { + var sender = origAddTrack.apply(this, arguments); + sender._pc = this; + return sender; + }; + } + window.RTCRtpSender.prototype.getStats = function getStats() { + return this.track ? this._pc.getStats(this.track) : Promise.resolve(new Map()); + }; + } + + function shimReceiverGetStats(window) { + if (!((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window.RTCPeerConnection && window.RTCRtpSender)) { + return; + } + if (window.RTCRtpSender && 'getStats' in window.RTCRtpReceiver.prototype) { + return; + } + var origGetReceivers = window.RTCPeerConnection.prototype.getReceivers; + if (origGetReceivers) { + window.RTCPeerConnection.prototype.getReceivers = function getReceivers() { + var _this2 = this; + + var receivers = origGetReceivers.apply(this, []); + receivers.forEach(function (receiver) { + return receiver._pc = _this2; + }); + return receivers; + }; + } + utils.wrapPeerConnectionEvent(window, 'track', function (e) { + e.receiver._pc = e.srcElement; + return e; + }); + window.RTCRtpReceiver.prototype.getStats = function getStats() { + return this._pc.getStats(this.track); + }; + } + + function shimRemoveStream(window) { + if (!window.RTCPeerConnection || 'removeStream' in window.RTCPeerConnection.prototype) { + return; + } + window.RTCPeerConnection.prototype.removeStream = function removeStream(stream) { + var _this3 = this; + + utils.deprecated('removeStream', 'removeTrack'); + this.getSenders().forEach(function (sender) { + if (sender.track && stream.getTracks().includes(sender.track)) { + _this3.removeTrack(sender); + } + }); + }; + } + + function shimRTCDataChannel(window) { + // rename DataChannel to RTCDataChannel (native fix in FF60): + // https://bugzilla.mozilla.org/show_bug.cgi?id=1173851 + if (window.DataChannel && !window.RTCDataChannel) { + window.RTCDataChannel = window.DataChannel; + } + } + + }, {"../utils": 28, "./getdisplaymedia": 25, "./getusermedia": 26}], + 25: [function (require, module, exports) { + /* + * Copyright (c) 2018 The adapter.js project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. + */ + /* eslint-env node */ + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.shimGetDisplayMedia = shimGetDisplayMedia; + + function shimGetDisplayMedia(window, preferredMediaSource) { + if (window.navigator.mediaDevices && 'getDisplayMedia' in window.navigator.mediaDevices) { + return; + } + if (!window.navigator.mediaDevices) { + return; + } + window.navigator.mediaDevices.getDisplayMedia = function getDisplayMedia(constraints) { + if (!(constraints && constraints.video)) { + var err = new DOMException('getDisplayMedia without video ' + 'constraints is undefined'); + err.name = 'NotFoundError'; + // from https://heycam.github.io/webidl/#idl-DOMException-error-names + err.code = 8; + return Promise.reject(err); + } + if (constraints.video === true) { + constraints.video = {mediaSource: preferredMediaSource}; + } else { + constraints.video.mediaSource = preferredMediaSource; + } + return window.navigator.mediaDevices.getUserMedia(constraints); + }; + } + + }, {}], + 26: [function (require, module, exports) { + /* + * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. + */ + /* eslint-env node */ + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + + exports.shimGetUserMedia = shimGetUserMedia; + + var _utils = require('../utils'); + + var utils = _interopRequireWildcard(_utils); + + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + newObj.default = obj; + return newObj; + } + } + + function shimGetUserMedia(window) { + var browserDetails = utils.detectBrowser(window); + var navigator = window && window.navigator; + var MediaStreamTrack = window && window.MediaStreamTrack; + + navigator.getUserMedia = function (constraints, onSuccess, onError) { + // Replace Firefox 44+'s deprecation warning with unprefixed version. + utils.deprecated('navigator.getUserMedia', 'navigator.mediaDevices.getUserMedia'); + navigator.mediaDevices.getUserMedia(constraints).then(onSuccess, onError); + }; + + if (!(browserDetails.version > 55 && 'autoGainControl' in navigator.mediaDevices.getSupportedConstraints())) { + var remap = function remap(obj, a, b) { + if (a in obj && !(b in obj)) { + obj[b] = obj[a]; + delete obj[a]; + } + }; + + var nativeGetUserMedia = navigator.mediaDevices.getUserMedia.bind(navigator.mediaDevices); + navigator.mediaDevices.getUserMedia = function (c) { + if ((typeof c === 'undefined' ? 'undefined' : _typeof(c)) === 'object' && _typeof(c.audio) === 'object') { + c = JSON.parse(JSON.stringify(c)); + remap(c.audio, 'autoGainControl', 'mozAutoGainControl'); + remap(c.audio, 'noiseSuppression', 'mozNoiseSuppression'); + } + return nativeGetUserMedia(c); + }; + + if (MediaStreamTrack && MediaStreamTrack.prototype.getSettings) { + var nativeGetSettings = MediaStreamTrack.prototype.getSettings; + MediaStreamTrack.prototype.getSettings = function () { + var obj = nativeGetSettings.apply(this, arguments); + remap(obj, 'mozAutoGainControl', 'autoGainControl'); + remap(obj, 'mozNoiseSuppression', 'noiseSuppression'); + return obj; + }; + } + + if (MediaStreamTrack && MediaStreamTrack.prototype.applyConstraints) { + var nativeApplyConstraints = MediaStreamTrack.prototype.applyConstraints; + MediaStreamTrack.prototype.applyConstraints = function (c) { + if (this.kind === 'audio' && (typeof c === 'undefined' ? 'undefined' : _typeof(c)) === 'object') { + c = JSON.parse(JSON.stringify(c)); + remap(c, 'autoGainControl', 'mozAutoGainControl'); + remap(c, 'noiseSuppression', 'mozNoiseSuppression'); + } + return nativeApplyConstraints.apply(this, [c]); + }; + } + } + } + + }, {"../utils": 28}], + 27: [function (require, module, exports) { + /* + * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. + */ + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + + exports.shimLocalStreamsAPI = shimLocalStreamsAPI; + exports.shimRemoteStreamsAPI = shimRemoteStreamsAPI; + exports.shimCallbacksAPI = shimCallbacksAPI; + exports.shimGetUserMedia = shimGetUserMedia; + exports.shimConstraints = shimConstraints; + exports.shimRTCIceServerUrls = shimRTCIceServerUrls; + exports.shimTrackEventTransceiver = shimTrackEventTransceiver; + exports.shimCreateOfferLegacy = shimCreateOfferLegacy; + + var _utils = require('../utils'); + + var utils = _interopRequireWildcard(_utils); + + function _interopRequireWildcard(obj) { + if (obj && obj.__esModule) { + return obj; + } else { + var newObj = {}; + if (obj != null) { + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; + } + } + newObj.default = obj; + return newObj; + } + } + + function shimLocalStreamsAPI(window) { + if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) !== 'object' || !window.RTCPeerConnection) { + return; + } + if (!('getLocalStreams' in window.RTCPeerConnection.prototype)) { + window.RTCPeerConnection.prototype.getLocalStreams = function getLocalStreams() { + if (!this._localStreams) { + this._localStreams = []; + } + return this._localStreams; + }; + } + if (!('addStream' in window.RTCPeerConnection.prototype)) { + var _addTrack = window.RTCPeerConnection.prototype.addTrack; + window.RTCPeerConnection.prototype.addStream = function addStream(stream) { + var _this = this; + + if (!this._localStreams) { + this._localStreams = []; + } + if (!this._localStreams.includes(stream)) { + this._localStreams.push(stream); + } + // Try to emulate Chrome's behaviour of adding in audio-video order. + // Safari orders by track id. + stream.getAudioTracks().forEach(function (track) { + return _addTrack.call(_this, track, stream); + }); + stream.getVideoTracks().forEach(function (track) { + return _addTrack.call(_this, track, stream); + }); + }; + + window.RTCPeerConnection.prototype.addTrack = function addTrack(track, stream) { + if (stream) { + if (!this._localStreams) { + this._localStreams = [stream]; + } else if (!this._localStreams.includes(stream)) { + this._localStreams.push(stream); + } + } + return _addTrack.call(this, track, stream); + }; + } + if (!('removeStream' in window.RTCPeerConnection.prototype)) { + window.RTCPeerConnection.prototype.removeStream = function removeStream(stream) { + var _this2 = this; + + if (!this._localStreams) { + this._localStreams = []; + } + var index = this._localStreams.indexOf(stream); + if (index === -1) { + return; + } + this._localStreams.splice(index, 1); + var tracks = stream.getTracks(); + this.getSenders().forEach(function (sender) { + if (tracks.includes(sender.track)) { + _this2.removeTrack(sender); + } + }); + }; + } + } + + function shimRemoteStreamsAPI(window) { + if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) !== 'object' || !window.RTCPeerConnection) { + return; + } + if (!('getRemoteStreams' in window.RTCPeerConnection.prototype)) { + window.RTCPeerConnection.prototype.getRemoteStreams = function getRemoteStreams() { + return this._remoteStreams ? this._remoteStreams : []; + }; + } + if (!('onaddstream' in window.RTCPeerConnection.prototype)) { + Object.defineProperty(window.RTCPeerConnection.prototype, 'onaddstream', { + get: function get() { + return this._onaddstream; + }, + set: function set(f) { + var _this3 = this; + + if (this._onaddstream) { + this.removeEventListener('addstream', this._onaddstream); + this.removeEventListener('track', this._onaddstreampoly); + } + this.addEventListener('addstream', this._onaddstream = f); + this.addEventListener('track', this._onaddstreampoly = function (e) { + e.streams.forEach(function (stream) { + if (!_this3._remoteStreams) { + _this3._remoteStreams = []; + } + if (_this3._remoteStreams.includes(stream)) { + return; + } + _this3._remoteStreams.push(stream); + var event = new Event('addstream'); + event.stream = stream; + _this3.dispatchEvent(event); + }); + }); + } + }); + var origSetRemoteDescription = window.RTCPeerConnection.prototype.setRemoteDescription; + window.RTCPeerConnection.prototype.setRemoteDescription = function setRemoteDescription() { + var pc = this; + if (!this._onaddstreampoly) { + this.addEventListener('track', this._onaddstreampoly = function (e) { + e.streams.forEach(function (stream) { + if (!pc._remoteStreams) { + pc._remoteStreams = []; + } + if (pc._remoteStreams.indexOf(stream) >= 0) { + return; + } + pc._remoteStreams.push(stream); + var event = new Event('addstream'); + event.stream = stream; + pc.dispatchEvent(event); + }); + }); + } + return origSetRemoteDescription.apply(pc, arguments); + }; + } + } + + function shimCallbacksAPI(window) { + if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) !== 'object' || !window.RTCPeerConnection) { + return; + } + var prototype = window.RTCPeerConnection.prototype; + var origCreateOffer = prototype.createOffer; + var origCreateAnswer = prototype.createAnswer; + var setLocalDescription = prototype.setLocalDescription; + var setRemoteDescription = prototype.setRemoteDescription; + var addIceCandidate = prototype.addIceCandidate; + + prototype.createOffer = function createOffer(successCallback, failureCallback) { + var options = arguments.length >= 2 ? arguments[2] : arguments[0]; + var promise = origCreateOffer.apply(this, [options]); + if (!failureCallback) { + return promise; + } + promise.then(successCallback, failureCallback); + return Promise.resolve(); + }; + + prototype.createAnswer = function createAnswer(successCallback, failureCallback) { + var options = arguments.length >= 2 ? arguments[2] : arguments[0]; + var promise = origCreateAnswer.apply(this, [options]); + if (!failureCallback) { + return promise; + } + promise.then(successCallback, failureCallback); + return Promise.resolve(); + }; + + var withCallback = function withCallback(description, successCallback, failureCallback) { + var promise = setLocalDescription.apply(this, [description]); + if (!failureCallback) { + return promise; + } + promise.then(successCallback, failureCallback); + return Promise.resolve(); + }; + prototype.setLocalDescription = withCallback; + + withCallback = function withCallback(description, successCallback, failureCallback) { + var promise = setRemoteDescription.apply(this, [description]); + if (!failureCallback) { + return promise; + } + promise.then(successCallback, failureCallback); + return Promise.resolve(); + }; + prototype.setRemoteDescription = withCallback; + + withCallback = function withCallback(candidate, successCallback, failureCallback) { + var promise = addIceCandidate.apply(this, [candidate]); + if (!failureCallback) { + return promise; + } + promise.then(successCallback, failureCallback); + return Promise.resolve(); + }; + prototype.addIceCandidate = withCallback; + } + + function shimGetUserMedia(window) { + var navigator = window && window.navigator; + + if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) { + // shim not needed in Safari 12.1 + var mediaDevices = navigator.mediaDevices; + var _getUserMedia = mediaDevices.getUserMedia.bind(mediaDevices); + navigator.mediaDevices.getUserMedia = function (constraints) { + return _getUserMedia(shimConstraints(constraints)); + }; + } + + if (!navigator.getUserMedia && navigator.mediaDevices && navigator.mediaDevices.getUserMedia) { + navigator.getUserMedia = function getUserMedia(constraints, cb, errcb) { + navigator.mediaDevices.getUserMedia(constraints).then(cb, errcb); + }.bind(navigator); + } + } + + function shimConstraints(constraints) { + if (constraints && constraints.video !== undefined) { + return Object.assign({}, constraints, {video: utils.compactObject(constraints.video)}); + } + + return constraints; + } + + function shimRTCIceServerUrls(window) { + // migrate from non-spec RTCIceServer.url to RTCIceServer.urls + var OrigPeerConnection = window.RTCPeerConnection; + window.RTCPeerConnection = function RTCPeerConnection(pcConfig, pcConstraints) { + if (pcConfig && pcConfig.iceServers) { + var newIceServers = []; + for (var i = 0; i < pcConfig.iceServers.length; i++) { + var server = pcConfig.iceServers[i]; + if (!server.hasOwnProperty('urls') && server.hasOwnProperty('url')) { + utils.deprecated('RTCIceServer.url', 'RTCIceServer.urls'); + server = JSON.parse(JSON.stringify(server)); + server.urls = server.url; + delete server.url; + newIceServers.push(server); + } else { + newIceServers.push(pcConfig.iceServers[i]); + } + } + pcConfig.iceServers = newIceServers; + } + return new OrigPeerConnection(pcConfig, pcConstraints); + }; + window.RTCPeerConnection.prototype = OrigPeerConnection.prototype; + // wrap static methods. Currently just generateCertificate. + if ('generateCertificate' in window.RTCPeerConnection) { + Object.defineProperty(window.RTCPeerConnection, 'generateCertificate', { + get: function get() { + return OrigPeerConnection.generateCertificate; + } + }); + } + } + + function shimTrackEventTransceiver(window) { + // Add event.transceiver member over deprecated event.receiver + if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && window.RTCTrackEvent && 'receiver' in window.RTCTrackEvent.prototype && !('transceiver' in window.RTCTrackEvent.prototype)) { + Object.defineProperty(window.RTCTrackEvent.prototype, 'transceiver', { + get: function get() { + return {receiver: this.receiver}; + } + }); + } + } + + function shimCreateOfferLegacy(window) { + var origCreateOffer = window.RTCPeerConnection.prototype.createOffer; + window.RTCPeerConnection.prototype.createOffer = function createOffer(offerOptions) { + if (offerOptions) { + if (typeof offerOptions.offerToReceiveAudio !== 'undefined') { + // support bit values + offerOptions.offerToReceiveAudio = !!offerOptions.offerToReceiveAudio; + } + var audioTransceiver = this.getTransceivers().find(function (transceiver) { + return transceiver.receiver.track.kind === 'audio'; + }); + if (offerOptions.offerToReceiveAudio === false && audioTransceiver) { + if (audioTransceiver.direction === 'sendrecv') { + if (audioTransceiver.setDirection) { + audioTransceiver.setDirection('sendonly'); + } else { + audioTransceiver.direction = 'sendonly'; + } + } else if (audioTransceiver.direction === 'recvonly') { + if (audioTransceiver.setDirection) { + audioTransceiver.setDirection('inactive'); + } else { + audioTransceiver.direction = 'inactive'; + } + } + } else if (offerOptions.offerToReceiveAudio === true && !audioTransceiver) { + this.addTransceiver('audio'); + } + + if (typeof offerOptions.offerToReceiveVideo !== 'undefined') { + // support bit values + offerOptions.offerToReceiveVideo = !!offerOptions.offerToReceiveVideo; + } + var videoTransceiver = this.getTransceivers().find(function (transceiver) { + return transceiver.receiver.track.kind === 'video'; + }); + if (offerOptions.offerToReceiveVideo === false && videoTransceiver) { + if (videoTransceiver.direction === 'sendrecv') { + if (videoTransceiver.setDirection) { + videoTransceiver.setDirection('sendonly'); + } else { + videoTransceiver.direction = 'sendonly'; + } + } else if (videoTransceiver.direction === 'recvonly') { + if (videoTransceiver.setDirection) { + videoTransceiver.setDirection('inactive'); + } else { + videoTransceiver.direction = 'inactive'; + } + } + } else if (offerOptions.offerToReceiveVideo === true && !videoTransceiver) { + this.addTransceiver('video'); + } + } + return origCreateOffer.apply(this, arguments); + }; + } + + }, {"../utils": 28}], + 28: [function (require, module, exports) { + /* + * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. + * + * Use of this source code is governed by a BSD-style license + * that can be found in the LICENSE file in the root of the source + * tree. + */ + /* eslint-env node */ + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { + return typeof obj; + } : function (obj) { + return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; + }; + + exports.extractVersion = extractVersion; + exports.wrapPeerConnectionEvent = wrapPeerConnectionEvent; + exports.disableLog = disableLog; + exports.disableWarnings = disableWarnings; + exports.log = log; + exports.deprecated = deprecated; + exports.detectBrowser = detectBrowser; + exports.compactObject = compactObject; + exports.walkStats = walkStats; + exports.filterStats = filterStats; + + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value: value, + enumerable: true, + configurable: true, + writable: true + }); + } else { + obj[key] = value; + } + return obj; + } + + var logDisabled_ = true; + var deprecationWarnings_ = true; + + /** + * Extract browser version out of the provided user agent string. + * + * @param {!string} uastring userAgent string. + * @param {!string} expr Regular expression used as match criteria. + * @param {!number} pos position in the version string to be returned. + * @return {!number} browser version. + */ + function extractVersion(uastring, expr, pos) { + var match = uastring.match(expr); + return match && match.length >= pos && parseInt(match[pos], 10); + } + +// Wraps the peerconnection event eventNameToWrap in a function +// which returns the modified event object (or false to prevent +// the event). + function wrapPeerConnectionEvent(window, eventNameToWrap, wrapper) { + if (!window.RTCPeerConnection) { + return; + } + var proto = window.RTCPeerConnection.prototype; + var nativeAddEventListener = proto.addEventListener; + proto.addEventListener = function (nativeEventName, cb) { + if (nativeEventName !== eventNameToWrap) { + return nativeAddEventListener.apply(this, arguments); + } + var wrappedCallback = function wrappedCallback(e) { + var modifiedEvent = wrapper(e); + if (modifiedEvent) { + cb(modifiedEvent); + } + }; + this._eventMap = this._eventMap || {}; + this._eventMap[cb] = wrappedCallback; + return nativeAddEventListener.apply(this, [nativeEventName, wrappedCallback]); + }; + + var nativeRemoveEventListener = proto.removeEventListener; + proto.removeEventListener = function (nativeEventName, cb) { + if (nativeEventName !== eventNameToWrap || !this._eventMap || !this._eventMap[cb]) { + return nativeRemoveEventListener.apply(this, arguments); + } + var unwrappedCb = this._eventMap[cb]; + delete this._eventMap[cb]; + return nativeRemoveEventListener.apply(this, [nativeEventName, unwrappedCb]); + }; + + Object.defineProperty(proto, 'on' + eventNameToWrap, { + get: function get() { + return this['_on' + eventNameToWrap]; + }, + set: function set(cb) { + if (this['_on' + eventNameToWrap]) { + this.removeEventListener(eventNameToWrap, this['_on' + eventNameToWrap]); + delete this['_on' + eventNameToWrap]; + } + if (cb) { + this.addEventListener(eventNameToWrap, this['_on' + eventNameToWrap] = cb); + } + }, + + enumerable: true, + configurable: true + }); + } + + function disableLog(bool) { + if (typeof bool !== 'boolean') { + return new Error('Argument type: ' + (typeof bool === 'undefined' ? 'undefined' : _typeof(bool)) + '. Please use a boolean.'); + } + logDisabled_ = bool; + return bool ? 'adapter.js logging disabled' : 'adapter.js logging enabled'; + } + + /** + * Disable or enable deprecation warnings + * @param {!boolean} bool set to true to disable warnings. + */ + function disableWarnings(bool) { + if (typeof bool !== 'boolean') { + return new Error('Argument type: ' + (typeof bool === 'undefined' ? 'undefined' : _typeof(bool)) + '. Please use a boolean.'); + } + deprecationWarnings_ = !bool; + return 'adapter.js deprecation warnings ' + (bool ? 'disabled' : 'enabled'); + } + + function log() { + if ((typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object') { + if (logDisabled_) { + return; + } + if (typeof console !== 'undefined' && typeof console.log === 'function') { + console.log.apply(console, arguments); + } + } + } + + /** + * Shows a deprecation warning suggesting the modern and spec-compatible API. + */ + function deprecated(oldMethod, newMethod) { + if (!deprecationWarnings_) { + return; + } + console.warn(oldMethod + ' is deprecated, please use ' + newMethod + ' instead.'); + } + + /** + * Browser detector. + * + * @return {object} result containing browser and version + * properties. + */ + function detectBrowser(window) { + var navigator = window.navigator; + + // Returned result object. + + var result = {browser: null, version: null}; + + // Fail early if it's not a browser + if (typeof window === 'undefined' || !window.navigator) { + result.browser = 'Not a browser.'; + return result; + } + + if (navigator.mozGetUserMedia) { + // Firefox. + result.browser = 'firefox'; + result.version = extractVersion(navigator.userAgent, /Firefox\/(\d+)\./, 1); + } else if (navigator.webkitGetUserMedia || window.isSecureContext === false && window.webkitRTCPeerConnection && !window.RTCIceGatherer) { + // Chrome, Chromium, Webview, Opera. + // Version matches Chrome/WebRTC version. + // Chrome 74 removed webkitGetUserMedia on http as well so we need the + // more complicated fallback to webkitRTCPeerConnection. + result.browser = 'chrome'; + result.version = extractVersion(navigator.userAgent, /Chrom(e|ium)\/(\d+)\./, 2); + } else if (navigator.mediaDevices && navigator.userAgent.match(/Edge\/(\d+).(\d+)$/)) { + // Edge. + result.browser = 'edge'; + result.version = extractVersion(navigator.userAgent, /Edge\/(\d+).(\d+)$/, 2); + } else if (window.RTCPeerConnection && navigator.userAgent.match(/AppleWebKit\/(\d+)\./)) { + // Safari. + result.browser = 'safari'; + result.version = extractVersion(navigator.userAgent, /AppleWebKit\/(\d+)\./, 1); + result.supportsUnifiedPlan = window.RTCRtpTransceiver && 'currentDirection' in window.RTCRtpTransceiver.prototype; + } else { + // Default fallthrough: not supported. + result.browser = 'Not a supported browser.'; + return result; + } + + return result; + } + + /** + * Checks if something is an object. + * + * @param {*} val The something you want to check. + * @return true if val is an object, false otherwise. + */ + function isObject(val) { + return Object.prototype.toString.call(val) === '[object Object]'; + } + + /** + * Remove all empty objects and undefined values + * from a nested object -- an enhanced and vanilla version + * of Lodash's `compact`. + */ + function compactObject(data) { + if (!isObject(data)) { + return data; + } + + return Object.keys(data).reduce(function (accumulator, key) { + var isObj = isObject(data[key]); + var value = isObj ? compactObject(data[key]) : data[key]; + var isEmptyObject = isObj && !Object.keys(value).length; + if (value === undefined || isEmptyObject) { + return accumulator; + } + return Object.assign(accumulator, _defineProperty({}, key, value)); + }, {}); + } + + /* iterates the stats graph recursively. */ + function walkStats(stats, base, resultSet) { + if (!base || resultSet.has(base.id)) { + return; + } + resultSet.set(base.id, base); + Object.keys(base).forEach(function (name) { + if (name.endsWith('Id')) { + walkStats(stats, stats.get(base[name]), resultSet); + } else if (name.endsWith('Ids')) { + base[name].forEach(function (id) { + walkStats(stats, stats.get(id), resultSet); + }); + } + }); + } + + /* filter getStats for a sender/receiver track. */ + function filterStats(result, track, outbound) { + var streamStatsType = outbound ? 'outbound-rtp' : 'inbound-rtp'; + var filteredResult = new Map(); + if (track === null) { + return filteredResult; + } + var trackStats = []; + result.forEach(function (value) { + if (value.type === 'track' && value.trackIdentifier === track.id) { + trackStats.push(value); + } + }); + trackStats.forEach(function (trackStat) { + result.forEach(function (stats) { + if (stats.type === streamStatsType && stats.trackId === trackStat.id) { + walkStats(result, stats, filteredResult); + } + }); + }); + return filteredResult; + } + + }, {}], + 29: [function (require, module, exports) { + arguments[4][12][0].apply(exports, arguments) + }, {"dup": 12}], + 30: [function (require, module, exports) { + /* globals tex */ + const glslTransforms = require('./composable-glsl-functions.js') + +// in progress: implementing multiple renderpasses within a single +// function string + const renderPassFunctions = require('./renderpass-functions.js') + + const counter = require('./counter.js') + const shaderManager = require('./shaderManager.js') + + var Generator = function (param) { + return Object.create(Generator.prototype) + } + +// Functions that return a new transformation function based on the existing function chain as well +// as the new function passed in. + const compositionFunctions = { + coord: existingF => newF => x => existingF(newF(x)), // coord transforms added onto beginning of existing function chain + color: existingF => newF => x => newF(existingF(x)), // color transforms added onto end of existing function chain + combine: existingF1 => existingF2 => newF => x => newF(existingF1(x))(existingF2(x)), // + combineCoord: existingF1 => existingF2 => newF => x => existingF1(newF(x)(existingF2(x))) + } +// gl_FragColor = osc(modulate(osc(rotate(st, 10., 0.), 32., 0.1, 0.), st, 0.5), 199., 0.1, 0.); + +// hydra code: osc().rotate().color().repeat().out() +// pseudo shader code: gl_FragColor = color(osc(rotate(repeat()))) + +// hydra code: osc().rotate().add(s0).repeat().out() +// gl_FragColor = osc(rotate(repeat())) + tex(repeat()) + +// Parses javascript args to use in glsl + function generateGlsl(inputs) { + var str = '' + inputs.forEach((input) => { + str += ', ' + input.name + }) + return str + } + +// timing function that accepts a sequence of values as an array + const seq = (arr = []) => ({time, bpm}) => { + let speed = arr.speed ? arr.speed : 1 + return arr[Math.floor(time * speed * (bpm / 60) % (arr.length))] + } +// when possible, reformats arguments to be the correct type +// creates unique names for variables requiring a uniform to be passed in (i.e. a texture) +// returns an object that contains the type and value of each argument +// to do: add much more type checking, validation, and transformation to this part + function formatArguments(userArgs, defaultArgs) { + return defaultArgs.map((input, index) => { + var typedArg = {} + + // if there is a user input at a certain index, create a uniform for this variable so that the value is passed in on each render pass + // to do (possibly): check whether this is a function in order to only use uniforms when needed + + counter.increment() + typedArg.name = input.name + counter.get() + typedArg.isUniform = true + + if (userArgs.length > index) { + // console.log("arg", userArgs[index]) + typedArg.value = userArgs[index] + // if argument passed in contains transform property, i.e. is of type generator, do not add uniform + if (userArgs[index].transform) typedArg.isUniform = false + + if (typeof userArgs[index] === 'function') { + typedArg.value = (context, props, batchId) => { + try { + return userArgs[index](props) + } catch (e) { + console.log('ERROR', e) + return input.default + } + } + } else if (userArgs[index].constructor === Array) { + // console.log("is Array") + typedArg.value = (context, props, batchId) => seq(userArgs[index])(props) + } + } else { + // use default value for argument + typedArg.value = input.default + } + // if input is a texture, set unique name for uniform + if (input.type === 'texture') { + // typedArg.tex = typedArg.value + var x = typedArg.value + typedArg.value = () => (x.getTexture()) + } else { + // if passing in a texture reference, when function asks for vec4, convert to vec4 + if (typedArg.value.getTexture && input.type === 'vec4') { + var x1 = typedArg.value + typedArg.value = src(x1) + typedArg.isUniform = false + } + } + typedArg.type = input.type + return typedArg + }) + } + + + var GeneratorFactory = function (defaultOutput) { + + let self = this + self.functions = {} + + + window.frag = shaderManager(defaultOutput) + + // extend Array prototype + Array.prototype.fast = function (speed) { + this.speed = speed + return this + } + + Object.keys(glslTransforms).forEach((method) => { + const transform = glslTransforms[method] + + // if type is a source, create a new global generator function that inherits from Generator object + if (transform.type === 'src') { + self.functions[method] = (...args) => { + var obj = Object.create(Generator.prototype) + obj.name = method + const inputs = formatArguments(args, transform.inputs) + obj.transform = (x) => { + var glslString = `${method}(${x}` + glslString += generateGlsl(inputs) + glslString += ')' + return glslString + } + obj.defaultOutput = defaultOutput + obj.uniforms = [] + inputs.forEach((input, index) => { + if (input.isUniform) { + obj.uniforms.push(input) + } + }) + + obj.passes = [] + let pass = { + transform: (x) => { + var glslString = `${method}(${x}` + glslString += generateGlsl(inputs) + glslString += ')' + return glslString + }, + uniforms: [] + } + inputs.forEach((input, index) => { + if (input.isUniform) { + pass.uniforms.push(input) + } + }) + obj.passes.push(pass) + return obj + } + } else { + Generator.prototype[method] = function (...args) { + const inputs = formatArguments(args, transform.inputs) + + if (transform.type === 'combine' || transform.type === 'combineCoord') { + // composition function to be executed when all transforms have been added + // c0 and c1 are two inputs.. (explain more) + var f = (c0) => (c1) => { + var glslString = `${method}(${c0}, ${c1}` + glslString += generateGlsl(inputs.slice(1)) + glslString += ')' + return glslString + } + this.transform = compositionFunctions[glslTransforms[method].type](this.transform)(inputs[0].value.transform)(f) + + this.uniforms = this.uniforms.concat(inputs[0].value.uniforms) + + var pass = this.passes[this.passes.length - 1] + pass.transform = this.transform + pass.uniform + this.uniform + } else { + var f1 = (x) => { + var glslString = `${method}(${x}` + glslString += generateGlsl(inputs) + glslString += ')' + return glslString + } + this.transform = compositionFunctions[glslTransforms[method].type](this.transform)(f1) + this.passes[this.passes.length - 1].transform = this.transform + } + + inputs.forEach((input, index) => { + if (input.isUniform) { + this.uniforms.push(input) + } + }) + this.passes[this.passes.length - 1].uniforms = this.uniforms + return this + } + } + }) + } + +// +// iterate through transform types and create a function for each +// + Generator.prototype.compile = function (pass) { +// console.log("compiling", pass) + var frag = ` + precision highp float; + ${pass.uniforms.map((uniform) => { + let type = '' + switch (uniform.type) { + case 'float': + type = 'float' + break + case 'texture': + type = 'sampler2D' + break + } + return ` + uniform ${type} ${uniform.name};` + }).join('')} + uniform float time; + uniform vec2 resolution; + varying vec2 uv; + + ${Object.values(glslTransforms).map((transform) => { + // console.log(transform.glsl) + return ` + ${transform.glsl} + ` + }).join('')} + + void main () { + vec4 c = vec4(1, 0, 0, 1); + //vec2 st = uv; + vec2 st = gl_FragCoord.xy/resolution.xy; + gl_FragColor = ${pass.transform('st')}; + } + ` + return frag + } + + +// creates a fragment shader from an object containing uniforms and a snippet of +// fragment shader code + Generator.prototype.compileRenderPass = function (pass) { + var frag = ` + precision highp float; + ${pass.uniforms.map((uniform) => { + let type = '' + switch (uniform.type) { + case 'float': + type = 'float' + break + case 'texture': + type = 'sampler2D' + break + } + return ` + uniform ${type} ${uniform.name};` + }).join('')} + uniform float time; + uniform vec2 resolution; + uniform sampler2D prevBuffer; + varying vec2 uv; + + ${Object.values(renderPassFunctions).filter(transform => transform.type === 'renderpass_util') + .map((transform) => { + // console.log(transform.glsl) + return ` + ${transform.glsl} + ` + }).join('')} + + ${pass.glsl} + ` + return frag + } + + + Generator.prototype.glsl = function (_output) { + var output = _output || this.defaultOutput + + var passes = this.passes.map((pass) => { + var uniforms = {} + pass.uniforms.forEach((uniform) => { + uniforms[uniform.name] = uniform.value + }) + if (pass.hasOwnProperty('transform')) { + // console.log(" rendering pass", pass) + + return { + frag: this.compile(pass), + uniforms: Object.assign(output.uniforms, uniforms) + } + } else { + // console.log(" not rendering pass", pass) + return { + frag: pass.frag, + uniforms: Object.assign(output.uniforms, uniforms) + } + } + }) + return passes + } + + + Generator.prototype.out = function (_output) { +// console.log('UNIFORMS', this.uniforms, output) + var output = _output || this.defaultOutput + + output.renderPasses(this.glsl(output)) + + } + + module.exports = GeneratorFactory + + }, { + "./composable-glsl-functions.js": 32, + "./counter.js": 33, + "./renderpass-functions.js": 39, + "./shaderManager.js": 40 + }], + 31: [function (require, module, exports) { + const Meyda = require('meyda') + + class Audio { + constructor({ + numBins = 4, + cutoff = 2, + smooth = 0.4, + max = 15, + scale = 10, + isDrawing = false + }) { + this.vol = 0 + this.scale = scale + this.max = max + this.cutoff = cutoff + this.smooth = smooth + this.setBins(numBins) + + // beat detection from: https://github.com/therewasaguy/p5-music-viz/blob/gh-pages/demos/01d_beat_detect_amplitude/sketch.js + this.beat = { + holdFrames: 20, + threshold: 40, + _cutoff: 0, // adaptive based on sound state + decay: 0.98, + _framesSinceBeat: 0 // keeps track of frames + } + + this.onBeat = () => { + console.log("beat") + } + + this.canvas = document.createElement('canvas') + this.canvas.width = 100 + this.canvas.height = 80 + this.canvas.style.width = "100px" + this.canvas.style.height = "80px" + this.canvas.style.position = 'absolute' + this.canvas.style.right = '0px' + this.canvas.style.bottom = '0px' + document.body.appendChild(this.canvas) + + this.isDrawing = isDrawing + this.ctx = this.canvas.getContext('2d') + this.ctx.fillStyle = "#DFFFFF" + this.ctx.strokeStyle = "#0ff" + this.ctx.lineWidth = 0.5 + + // window.navigator.mediaDevices.getUserMedia({video: false, audio: true}) + // .then((stream) => { + // console.log('got mic stream', stream) + // this.stream = stream + // this.context = new AudioContext() + // // this.context = new AudioContext() + // let audio_stream = this.context.createMediaStreamSource(stream) + // + // console.log(this.context) + // this.meyda = Meyda.createMeydaAnalyzer({ + // audioContext: this.context, + // source: audio_stream, + // featureExtractors: [ + // 'loudness', + // // 'perceptualSpread', + // // 'perceptualSharpness', + // // 'spectralCentroid' + // ] + // }) + // }) + // .catch((err) => console.log('ERROR', err)) + } + + detectBeat(level) { + //console.log(level, this.beat._cutoff) + if (level > this.beat._cutoff && level > this.beat.threshold) { + this.onBeat() + this.beat._cutoff = level * 1.2 + this.beat._framesSinceBeat = 0 + } else { + if (this.beat._framesSinceBeat <= this.beat.holdFrames) { + this.beat._framesSinceBeat++; + } else { + this.beat._cutoff *= this.beat.decay + this.beat._cutoff = Math.max(this.beat._cutoff, this.beat.threshold); + } + } + } + + tick() { + if (this.meyda) { + var features = this.meyda.get() + if (features && features !== null) { + this.vol = features.loudness.total + this.detectBeat(this.vol) + // reduce loudness array to number of bins + const reducer = (accumulator, currentValue) => accumulator + currentValue; + let spacing = Math.floor(features.loudness.specific.length / this.bins.length) + this.prevBins = this.bins.slice(0) + this.bins = this.bins.map((bin, index) => { + return features.loudness.specific.slice(index * spacing, (index + 1) * spacing).reduce(reducer) + }).map((bin, index) => { + // map to specified range + + // return (bin * (1.0 - this.smooth) + this.prevBins[index] * this.smooth) + return (bin * (1.0 - this.settings[index].smooth) + this.prevBins[index] * this.settings[index].smooth) + }) + // var y = this.canvas.height - scale*this.settings[index].cutoff + // this.ctx.beginPath() + // this.ctx.moveTo(index*spacing, y) + // this.ctx.lineTo((index+1)*spacing, y) + // this.ctx.stroke() + // + // var yMax = this.canvas.height - scale*(this.settings[index].scale + this.settings[index].cutoff) + this.fft = this.bins.map((bin, index) => ( + // Math.max(0, (bin - this.cutoff) / (this.max - this.cutoff)) + Math.max(0, (bin - this.settings[index].cutoff) / this.settings[index].scale) + )) + if (this.isDrawing) this.draw() + } + } + } + + setCutoff(cutoff) { + this.cutoff = cutoff + this.settings = this.settings.map((el) => { + el.cutoff = cutoff + return el + }) + } + + setSmooth(smooth) { + this.smooth = smooth + this.settings = this.settings.map((el) => { + el.smooth = smooth + return el + }) + } + + setBins(numBins) { + this.bins = Array(numBins).fill(0) + this.prevBins = Array(numBins).fill(0) + this.fft = Array(numBins).fill(0) + this.settings = Array(numBins).fill(0).map(() => ({ + cutoff: this.cutoff, + scale: this.scale, + smooth: this.smooth + })) + // to do: what to do in non-global mode? + this.bins.forEach((bin, index) => { + window['a' + index] = (scale = 1, offset = 0) => () => (a.fft[index] * scale + offset) + }) + console.log(this.settings) + } + + setScale(scale) { + this.scale = scale + this.settings = this.settings.map((el) => { + el.scale = scale + return el + }) + } + + setMax(max) { + this.max = max + console.log('set max is deprecated') + } + + hide() { + this.isDrawing = false + this.canvas.style.display = 'none' + } + + show() { + this.isDrawing = true + this.canvas.style.display = 'block' + + } + + draw() { + this.ctx.clearRect(0, 0, this.canvas.width, this.canvas.height) + var spacing = this.canvas.width / this.bins.length + var scale = this.canvas.height / (this.max * 2) + // console.log(this.bins) + this.bins.forEach((bin, index) => { + + var height = bin * scale + + this.ctx.fillRect(index * spacing, this.canvas.height - height, spacing, height) + + // console.log(this.settings[index]) + var y = this.canvas.height - scale * this.settings[index].cutoff + this.ctx.beginPath() + this.ctx.moveTo(index * spacing, y) + this.ctx.lineTo((index + 1) * spacing, y) + this.ctx.stroke() + + var yMax = this.canvas.height - scale * (this.settings[index].scale + this.settings[index].cutoff) + this.ctx.beginPath() + this.ctx.moveTo(index * spacing, yMax) + this.ctx.lineTo((index + 1) * spacing, yMax) + this.ctx.stroke() + }) + + + /*var y = this.canvas.height - scale*this.cutoff + this.ctx.beginPath() + this.ctx.moveTo(0, y) + this.ctx.lineTo(this.canvas.width, y) + this.ctx.stroke() + + var yMax = this.canvas.height - scale*this.max + this.ctx.beginPath() + this.ctx.moveTo(0, yMax) + this.ctx.lineTo(this.canvas.width, yMax) + this.ctx.stroke()*/ + } + } + + module.exports = Audio + + }, {"meyda": 4}], + 32: [function (require, module, exports) { +// to add: ripple: https://www.shadertoy.com/view/4djGzz +// mask +// convolution +// basic sdf shapes +// repeat +// iq color palletes + + module.exports = { + + _noise: { + type: 'util', + glsl: ` + // Simplex 3D Noise + // by Ian McEwan, Ashima Arts + vec4 permute(vec4 x){return mod(((x*34.0)+1.0)*x, 289.0);} +vec4 taylorInvSqrt(vec4 r){return 1.79284291400159 - 0.85373472095314 * r;} + +float _noise(vec3 v){ + const vec2 C = vec2(1.0/6.0, 1.0/3.0) ; + const vec4 D = vec4(0.0, 0.5, 1.0, 2.0); + +// First corner + vec3 i = floor(v + dot(v, C.yyy) ); + vec3 x0 = v - i + dot(i, C.xxx) ; + +// Other corners + vec3 g = step(x0.yzx, x0.xyz); + vec3 l = 1.0 - g; + vec3 i1 = min( g.xyz, l.zxy ); + vec3 i2 = max( g.xyz, l.zxy ); + + // x0 = x0 - 0. + 0.0 * C + vec3 x1 = x0 - i1 + 1.0 * C.xxx; + vec3 x2 = x0 - i2 + 2.0 * C.xxx; + vec3 x3 = x0 - 1. + 3.0 * C.xxx; + +// Permutations + i = mod(i, 289.0 ); + vec4 p = permute( permute( permute( + i.z + vec4(0.0, i1.z, i2.z, 1.0 )) + + i.y + vec4(0.0, i1.y, i2.y, 1.0 )) + + i.x + vec4(0.0, i1.x, i2.x, 1.0 )); + +// Gradients +// ( N*N points uniformly over a square, mapped onto an octahedron.) + float n_ = 1.0/7.0; // N=7 + vec3 ns = n_ * D.wyz - D.xzx; + + vec4 j = p - 49.0 * floor(p * ns.z *ns.z); // mod(p,N*N) + + vec4 x_ = floor(j * ns.z); + vec4 y_ = floor(j - 7.0 * x_ ); // mod(j,N) + + vec4 x = x_ *ns.x + ns.yyyy; + vec4 y = y_ *ns.x + ns.yyyy; + vec4 h = 1.0 - abs(x) - abs(y); + + vec4 b0 = vec4( x.xy, y.xy ); + vec4 b1 = vec4( x.zw, y.zw ); + + vec4 s0 = floor(b0)*2.0 + 1.0; + vec4 s1 = floor(b1)*2.0 + 1.0; + vec4 sh = -step(h, vec4(0.0)); + + vec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ; + vec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ; + + vec3 p0 = vec3(a0.xy,h.x); + vec3 p1 = vec3(a0.zw,h.y); + vec3 p2 = vec3(a1.xy,h.z); + vec3 p3 = vec3(a1.zw,h.w); + +//Normalise gradients + vec4 norm = taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3))); + p0 *= norm.x; + p1 *= norm.y; + p2 *= norm.z; + p3 *= norm.w; + +// Mix final noise value + vec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0); + m = m * m; + return 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1), + dot(p2,x2), dot(p3,x3) ) ); +} + ` + }, + noise: { + type: 'src', + inputs: [ + { + type: 'float', + name: 'scale', + default: 10 + }, + { + type: 'float', + name: 'offset', + default: 0.1 + } + ], + glsl: `vec4 noise(vec2 st, float scale, float offset){ + return vec4(vec3(_noise(vec3(st*scale, offset*time))), 1.0); + }` + }, + voronoi: { + type: 'src', + inputs: [ + { + type: 'float', + name: 'scale', + default: 5 + }, + { + type: 'float', + name: 'speed', + default: 0.3 + }, + { + type: 'float', + name: 'blending', + default: 0.3 + } + ], + notes: 'from https://thebookofshaders.com/edit.php#12/vorono-01.frag, https://www.shadertoy.com/view/ldB3zc', + glsl: `vec4 voronoi(vec2 st, float scale, float speed, float blending) { + vec3 color = vec3(.0); + + // Scale + st *= scale; + + // Tile the space + vec2 i_st = floor(st); + vec2 f_st = fract(st); + + float m_dist = 10.; // minimun distance + vec2 m_point; // minimum point + + for (int j=-1; j<=1; j++ ) { + for (int i=-1; i<=1; i++ ) { + vec2 neighbor = vec2(float(i),float(j)); + vec2 p = i_st + neighbor; + vec2 point = fract(sin(vec2(dot(p,vec2(127.1,311.7)),dot(p,vec2(269.5,183.3))))*43758.5453); + point = 0.5 + 0.5*sin(time*speed + 6.2831*point); + vec2 diff = neighbor + point - f_st; + float dist = length(diff); + + if( dist < m_dist ) { + m_dist = dist; + m_point = point; + } + } + } + + // Assign a color using the closest point position + color += dot(m_point,vec2(.3,.6)); + color *= 1.0 - blending*m_dist; + return vec4(color, 1.0); + }` + }, + osc: { + type: 'src', + inputs: [ + { + name: 'frequency', + type: 'float', + default: 60.0 + }, + { + name: 'sync', + type: 'float', + default: 0.1 + }, + { + name: 'offset', + type: 'float', + default: 0.0 + } + ], + glsl: `vec4 osc(vec2 _st, float freq, float sync, float offset){ + vec2 st = _st; + float r = sin((st.x-offset/freq+time*sync)*freq)*0.5 + 0.5; + float g = sin((st.x+time*sync)*freq)*0.5 + 0.5; + float b = sin((st.x+offset/freq+time*sync)*freq)*0.5 + 0.5; + return vec4(r, g, b, 1.0); + }` + }, + shape: { + type: 'src', + inputs: [ + { + name: 'sides', + type: 'float', + default: 3.0 + }, + { + name: 'radius', + type: 'float', + default: 0.3 + }, + { + name: 'smoothing', + type: 'float', + default: 0.01 + } + ], + glsl: `vec4 shape(vec2 _st, float sides, float radius, float smoothing){ + vec2 st = _st * 2. - 1.; + // Angle and radius from the current pixel + float a = atan(st.x,st.y)+3.1416; + float r = (2.*3.1416)/sides; + float d = cos(floor(.5+a/r)*r-a)*length(st); + return vec4(vec3(1.0-smoothstep(radius,radius + smoothing,d)), 1.0); + }` + }, + gradient: { + type: 'src', + inputs: [ + { + name: 'speed', + type: 'float', + default: 0.0 + } + ], + glsl: `vec4 gradient(vec2 _st, float speed) { + return vec4(_st, sin(time*speed), 1.0); + } + ` + }, + src: { + type: 'src', + inputs: [ + { + name: 'tex', + type: 'texture' + } + ], + glsl: `vec4 src(vec2 _st, sampler2D _tex){ + // vec2 uv = gl_FragCoord.xy/vec2(1280., 720.); + return texture2D(_tex, fract(_st)); + }` + }, + solid: { + type: 'src', + inputs: [ + { + name: 'r', + type: 'float', + default: 0.0 + }, + { + name: 'g', + type: 'float', + default: 0.0 + }, + { + name: 'b', + type: 'float', + default: 0.0 + }, + { + name: 'a', + type: 'float', + default: 1.0 + } + ], + notes: '', + glsl: `vec4 solid(vec2 uv, float _r, float _g, float _b, float _a){ + return vec4(_r, _g, _b, _a); + }` + }, + rotate: { + type: 'coord', + inputs: [ + { + name: 'angle', + type: 'float', + default: 10.0 + }, { + name: 'speed', + type: 'float', + default: 0.0 + } + ], + glsl: `vec2 rotate(vec2 st, float _angle, float speed){ + vec2 xy = st - vec2(0.5); + float angle = _angle + speed *time; + xy = mat2(cos(angle),-sin(angle), sin(angle),cos(angle))*xy; + xy += 0.5; + return xy; + }` + }, + scale: { + type: 'coord', + inputs: [ + { + name: 'amount', + type: 'float', + default: 1.5 + }, + { + name: 'xMult', + type: 'float', + default: 1.0 + }, + { + name: 'yMult', + type: 'float', + default: 1.0 + }, + { + name: 'offsetX', + type: 'float', + default: 0.5 + }, + { + name: 'offsetY', + type: 'float', + default: 0.5 + } + ], + glsl: `vec2 scale(vec2 st, float amount, float xMult, float yMult, float offsetX, float offsetY){ + vec2 xy = st - vec2(offsetX, offsetY); + xy*=(1.0/vec2(amount*xMult, amount*yMult)); + xy+=vec2(offsetX, offsetY); + return xy; + } + ` + }, + pixelate: { + type: 'coord', + inputs: [ + { + name: 'pixelX', + type: 'float', + default: 20 + }, { + name: 'pixelY', + type: 'float', + default: 20 + } + ], + glsl: `vec2 pixelate(vec2 st, float pixelX, float pixelY){ + vec2 xy = vec2(pixelX, pixelY); + return (floor(st * xy) + 0.5)/xy; + }` + }, + posterize: { + type: 'color', + inputs: [ + { + name: 'bins', + type: 'float', + default: 3.0 + }, + { + name: 'gamma', + type: 'float', + default: 0.6 + } + ], + glsl: `vec4 posterize(vec4 c, float bins, float gamma){ + vec4 c2 = pow(c, vec4(gamma)); + c2 *= vec4(bins); + c2 = floor(c2); + c2/= vec4(bins); + c2 = pow(c2, vec4(1.0/gamma)); + return vec4(c2.xyz, c.a); + }` + }, + shift: { + type: 'color', + inputs: [ + { + name: 'r', + type: 'float', + default: 0.5 + }, + { + name: 'g', + type: 'float', + default: 0.0 + }, + { + name: 'b', + type: 'float', + default: 0.0 + }, + { + name: 'a', + type: 'float', + default: 0.0 + } + ], + glsl: `vec4 shift(vec4 c, float r, float g, float b, float a){ + vec4 c2 = vec4(c); + c2.r = fract(c2.r + r); + c2.g = fract(c2.g + g); + c2.b = fract(c2.b + b); + c2.a = fract(c2.a + a); + return vec4(c2.rgba); + } + ` + }, + repeat: { + type: 'coord', + inputs: [ + { + name: 'repeatX', + type: 'float', + default: 3.0 + }, + { + name: 'repeatY', + type: 'float', + default: 3.0 + }, + { + name: 'offsetX', + type: 'float', + default: 0.0 + }, + { + name: 'offsetY', + type: 'float', + default: 0.0 + } + ], + glsl: `vec2 repeat(vec2 _st, float repeatX, float repeatY, float offsetX, float offsetY){ + vec2 st = _st * vec2(repeatX, repeatY); + st.x += step(1., mod(st.y,2.0)) * offsetX; + st.y += step(1., mod(st.x,2.0)) * offsetY; + return fract(st); + }` + }, + modulateRepeat: { + type: 'combineCoord', + inputs: [ + { + name: 'color', + type: 'vec4' + }, + { + name: 'repeatX', + type: 'float', + default: 3.0 + }, + { + name: 'repeatY', + type: 'float', + default: 3.0 + }, + { + name: 'offsetX', + type: 'float', + default: 0.5 + }, + { + name: 'offsetY', + type: 'float', + default: 0.5 + } + ], + glsl: `vec2 modulateRepeat(vec2 _st, vec4 c1, float repeatX, float repeatY, float offsetX, float offsetY){ + vec2 st = _st * vec2(repeatX, repeatY); + st.x += step(1., mod(st.y,2.0)) + c1.r * offsetX; + st.y += step(1., mod(st.x,2.0)) + c1.g * offsetY; + return fract(st); + }` + }, + repeatX: { + type: 'coord', + inputs: [ + { + name: 'reps', + type: 'float', + default: 3.0 + }, { + name: 'offset', + type: 'float', + default: 0.0 + } + ], + glsl: `vec2 repeatX(vec2 _st, float reps, float offset){ + vec2 st = _st * vec2(reps, 1.0); + // float f = mod(_st.y,2.0); + + st.y += step(1., mod(st.x,2.0))* offset; + return fract(st); + }` + }, + modulateRepeatX: { + type: 'combineCoord', + inputs: [ + { + name: 'color', + type: 'vec4' + }, + { + name: 'reps', + type: 'float', + default: 3.0 + }, + { + name: 'offset', + type: 'float', + default: 0.5 + } + ], + glsl: `vec2 modulateRepeatX(vec2 _st, vec4 c1, float reps, float offset){ + vec2 st = _st * vec2(reps, 1.0); + // float f = mod(_st.y,2.0); + st.y += step(1., mod(st.x,2.0)) + c1.r * offset; + + return fract(st); + }` + }, + repeatY: { + type: 'coord', + inputs: [ + { + name: 'reps', + type: 'float', + default: 3.0 + }, { + name: 'offset', + type: 'float', + default: 0.0 + } + ], + glsl: `vec2 repeatY(vec2 _st, float reps, float offset){ + vec2 st = _st * vec2(1.0, reps); + // float f = mod(_st.y,2.0); + st.x += step(1., mod(st.y,2.0))* offset; + return fract(st); + }` + }, + modulateRepeatY: { + type: 'combineCoord', + inputs: [ + { + name: 'color', + type: 'vec4' + }, + { + name: 'reps', + type: 'float', + default: 3.0 + }, + { + name: 'offset', + type: 'float', + default: 0.5 + } + ], + glsl: `vec2 modulateRepeatY(vec2 _st, vec4 c1, float reps, float offset){ + vec2 st = _st * vec2(reps, 1.0); + // float f = mod(_st.y,2.0); + st.x += step(1., mod(st.y,2.0)) + c1.r * offset; + return fract(st); + }` + }, + kaleid: { + type: 'coord', + inputs: [ + { + name: 'nSides', + type: 'float', + default: 4.0 + } + ], + glsl: `vec2 kaleid(vec2 st, float nSides){ + st -= 0.5; + float r = length(st); + float a = atan(st.y, st.x); + float pi = 2.*3.1416; + a = mod(a,pi/nSides); + a = abs(a-pi/nSides/2.); + return r*vec2(cos(a), sin(a)); + }` + }, + modulateKaleid: { + type: 'combineCoord', + inputs: [ + { + name: 'color', + type: 'vec4' + }, + { + name: 'nSides', + type: 'float', + default: 4.0 + } + ], + glsl: `vec2 modulateKaleid(vec2 st, vec4 c1, float nSides){ + st -= 0.5; + float r = length(st); + float a = atan(st.y, st.x); + float pi = 2.*3.1416; + a = mod(a,pi/nSides); + a = abs(a-pi/nSides/2.); + return (c1.r+r)*vec2(cos(a), sin(a)); + }` + }, + scrollX: { + type: 'coord', + inputs: [ + { + name: 'scrollX', + type: 'float', + default: 0.5 + }, + { + name: 'speed', + type: 'float', + default: 0.0 + } + ], + glsl: `vec2 scrollX(vec2 st, float amount, float speed){ + st.x += amount + time*speed; + return fract(st); + }` + }, + modulateScrollX: { + type: 'combineCoord', + inputs: [ + { + name: 'color', + type: 'vec4' + }, + { + name: 'scrollX', + type: 'float', + default: 0.5 + }, + { + name: 'speed', + type: 'float', + default: 0.0 + } + ], + glsl: `vec2 modulateScrollX(vec2 st, vec4 c1, float amount, float speed){ + st.x += c1.r*amount + time*speed; + return fract(st); + }` + }, + scrollY: { + type: 'coord', + inputs: [ + { + name: 'scrollY', + type: 'float', + default: 0.5 + }, + { + name: 'speed', + type: 'float', + default: 0.0 + } + ], + glsl: `vec2 scrollY(vec2 st, float amount, float speed){ + st.y += amount + time*speed; + return fract(st); + }` + }, + modulateScrollY: { + type: 'combineCoord', + inputs: [ + { + name: 'color', + type: 'vec4' + }, + { + name: 'scrollY', + type: 'float', + default: 0.5 + }, + { + name: 'speed', + type: 'float', + default: 0.0 + } + ], + glsl: `vec2 modulateScrollY(vec2 st, vec4 c1, float amount, float speed){ + st.y += c1.r*amount + time*speed; + return fract(st); + }` + }, + add: { + type: 'combine', + inputs: [ + { + name: 'color', + type: 'vec4' + }, + { + name: 'amount', + type: 'float', + default: 0.5 + } + ], + glsl: `vec4 add(vec4 c0, vec4 c1, float amount){ + return (c0+c1)*amount + c0*(1.0-amount); + }` + }, + layer: { + type: 'combine', + inputs: [ + { + name: 'color', + type: 'vec4' + } + ], + glsl: `vec4 layer(vec4 c0, vec4 c1){ + return vec4(mix(c0.rgb, c1.rgb, c1.a), c0.a+c1.a); + } + ` + }, + blend: { + type: 'combine', + inputs: [ + { + name: 'color', + type: 'vec4' + }, + { + name: 'amount', + type: 'float', + default: 0.5 + } + ], + glsl: `vec4 blend(vec4 c0, vec4 c1, float amount){ + return c0*(1.0-amount)+c1*amount; + }` + }, + mult: { + type: 'combine', + inputs: [ + { + name: 'color', + type: 'vec4' + }, + { + name: 'amount', + type: 'float', + default: 1.0 + } + ], + glsl: `vec4 mult(vec4 c0, vec4 c1, float amount){ + return c0*(1.0-amount)+(c0*c1)*amount; + }` + }, + + diff: { + type: 'combine', + inputs: [ + { + name: 'color', + type: 'vec4' + } + ], + glsl: `vec4 diff(vec4 c0, vec4 c1){ + return vec4(abs(c0.rgb-c1.rgb), max(c0.a, c1.a)); + } + ` + }, + + modulate: { + type: 'combineCoord', + inputs: [ + { + name: 'color', + type: 'vec4' + }, + { + name: 'amount', + type: 'float', + default: 0.1 + } + ], + glsl: `vec2 modulate(vec2 st, vec4 c1, float amount){ + // return fract(st+(c1.xy-0.5)*amount); + return st + c1.xy*amount; + }` + }, + modulateScale: { + type: 'combineCoord', + inputs: [ + { + name: 'color', + type: 'vec4' + }, + { + name: 'multiple', + type: 'float', + default: 1.0 + }, + { + name: 'offset', + type: 'float', + default: 1.0 + } + ], + glsl: `vec2 modulateScale(vec2 st, vec4 c1, float multiple, float offset){ + vec2 xy = st - vec2(0.5); + xy*=(1.0/vec2(offset + multiple*c1.r, offset + multiple*c1.g)); + xy+=vec2(0.5); + return xy; + }` + }, + modulatePixelate: { + type: 'combineCoord', + inputs: [ + { + name: 'color', + type: 'vec4' + }, + { + name: 'multiple', + type: 'float', + default: 10.0 + }, + { + name: 'offset', + type: 'float', + default: 3.0 + } + ], + glsl: `vec2 modulatePixelate(vec2 st, vec4 c1, float multiple, float offset){ + vec2 xy = vec2(offset + c1.x*multiple, offset + c1.y*multiple); + return (floor(st * xy) + 0.5)/xy; + }` + }, + modulateRotate: { + type: 'combineCoord', + inputs: [ + { + name: 'color', + type: 'vec4' + }, + { + name: 'multiple', + type: 'float', + default: 1.0 + }, + { + name: 'offset', + type: 'float', + default: 0.0 + } + ], + glsl: `vec2 modulateRotate(vec2 st, vec4 c1, float multiple, float offset){ + vec2 xy = st - vec2(0.5); + float angle = offset + c1.x * multiple; + xy = mat2(cos(angle),-sin(angle), sin(angle),cos(angle))*xy; + xy += 0.5; + return xy; + }` + }, + modulateHue: { + type: 'combineCoord', + notes: 'changes coordinates based on hue of second input. Based on: https://www.shadertoy.com/view/XtcSWM', + inputs: [ + { + name: 'color', + type: 'vec4' + }, + { + name: 'amount', + type: 'float', + default: 1.0 + } + ], + glsl: `vec2 modulateHue(vec2 st, vec4 c1, float amount){ + + return st + (vec2(c1.g - c1.r, c1.b - c1.g) * amount * 1.0/resolution.xy); + }` + }, + invert: { + type: 'color', + inputs: [ + { + name: 'amount', + type: 'float', + default: 1.0 + } + ], + glsl: `vec4 invert(vec4 c0, float amount){ + return vec4((1.0-c0.rgb)*amount + c0.rgb*(1.0-amount), c0.a); + }` + }, + contrast: { + type: 'color', + inputs: [ + { + name: 'amount', + type: 'float', + default: 1.6 + } + ], + glsl: `vec4 contrast(vec4 c0, float amount) { + vec4 c = (c0-vec4(0.5))*vec4(amount) + vec4(0.5); + return vec4(c.rgb, c0.a); + } + ` + }, + brightness: { + type: 'color', + inputs: [ + { + name: 'amount', + type: 'float', + default: 0.4 + } + ], + glsl: `vec4 brightness(vec4 c0, float amount){ + return vec4(c0.rgb + vec3(amount), c0.a); + } + ` + }, + luminance: { + type: 'util', + glsl: `float luminance(vec3 rgb){ + const vec3 W = vec3(0.2125, 0.7154, 0.0721); + return dot(rgb, W); + }` + }, + mask: { + type: 'combine', + inputs: [ + { + name: 'color', + type: 'vec4' + } + ], + glsl: `vec4 mask(vec4 c0, vec4 c1){ + float a = luminance(c1.rgb); + return vec4(c0.rgb*a, a); + }` + }, + luma: { + type: 'color', + inputs: [ + { + name: 'threshold', + type: 'float', + default: 0.5 + }, + { + name: 'tolerance', + type: 'float', + default: 0.1 + } + ], + glsl: `vec4 luma(vec4 c0, float threshold, float tolerance){ + float a = smoothstep(threshold-tolerance, threshold+tolerance, luminance(c0.rgb)); + return vec4(c0.rgb*a, a); + }` + }, + thresh: { + type: 'color', + inputs: [ + { + name: 'threshold', + type: 'float', + default: 0.5 + }, { + name: 'tolerance', + type: 'float', + default: 0.04 + } + ], + glsl: `vec4 thresh(vec4 c0, float threshold, float tolerance){ + return vec4(vec3(smoothstep(threshold-tolerance, threshold+tolerance, luminance(c0.rgb))), c0.a); + }` + }, + color: { + type: 'color', + inputs: [ + { + name: 'r', + type: 'float', + default: 1.0 + }, + { + name: 'g', + type: 'float', + default: 1.0 + }, + { + name: 'b', + type: 'float', + default: 1.0 + }, + { + name: 'a', + type: 'float', + default: 1.0 + } + ], + notes: 'https://www.youtube.com/watch?v=FpOEtm9aX0M', + glsl: `vec4 color(vec4 c0, float _r, float _g, float _b, float _a){ + vec4 c = vec4(_r, _g, _b, _a); + vec4 pos = step(0.0, c); // detect whether negative + + // if > 0, return r * c0 + // if < 0 return (1.0-r) * c0 + return vec4(mix((1.0-c0)*abs(c), c*c0, pos)); + }` + }, + _rgbToHsv: { + type: 'util', + glsl: `vec3 _rgbToHsv(vec3 c){ + vec4 K = vec4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0); + vec4 p = mix(vec4(c.bg, K.wz), vec4(c.gb, K.xy), step(c.b, c.g)); + vec4 q = mix(vec4(p.xyw, c.r), vec4(c.r, p.yzx), step(p.x, c.r)); + + float d = q.x - min(q.w, q.y); + float e = 1.0e-10; + return vec3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x); + }` + }, + _hsvToRgb: { + type: 'util', + glsl: `vec3 _hsvToRgb(vec3 c){ + vec4 K = vec4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0); + vec3 p = abs(fract(c.xxx + K.xyz) * 6.0 - K.www); + return c.z * mix(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y); + }` + }, + saturate: { + type: 'color', + inputs: [ + { + name: 'amount', + type: 'float', + default: 2.0 + } + ], + glsl: `vec4 saturate(vec4 c0, float amount){ + const vec3 W = vec3(0.2125, 0.7154, 0.0721); + vec3 intensity = vec3(dot(c0.rgb, W)); + return vec4(mix(intensity, c0.rgb, amount), c0.a); + }` + }, + hue: { + type: 'color', + inputs: [ + { + name: 'hue', + type: 'float', + default: 0.4 + } + ], + glsl: `vec4 hue(vec4 c0, float hue){ + vec3 c = _rgbToHsv(c0.rgb); + c.r += hue; + // c.r = fract(c.r); + return vec4(_hsvToRgb(c), c0.a); + }` + }, + colorama: { + type: 'color', + inputs: [ + { + name: 'amount', + type: 'float', + default: 0.005 + } + ], + glsl: `vec4 colorama(vec4 c0, float amount){ + vec3 c = _rgbToHsv(c0.rgb); + c += vec3(amount); + c = _hsvToRgb(c); + c = fract(c); + return vec4(c, c0.a); + }` + } + } + + }, {}], + 33: [function (require, module, exports) { +// singleton class that generates ids to use has unique variable names for variables +// counter.js + + let value = 0 + + module.exports = { + increment: () => value++, + get: () => value + } + + }, {}], + 34: [function (require, module, exports) { + module.exports = { + src: { + transformType: 'color', + isSource: true, + inputs: [{ + name: 'src', + type: 'image' + }], + fragBody: ` + c = texture2D(<0>, st); + ` + }, + invert: { + transformType: 'color', + fragBody: ` + c = 1.0-c; + c = vec4(c.xyz, 1.0); + ` + }, + osc: { + transformType: 'color', + isSource: true, + inputs: [ + { + name: 'frequency', + type: 'float', + default: 60 + }, + { + name: 'sync', + type: 'float', + default: 0.1 + }, + { + name: 'offset', + type: 'float', + default: 0.0 + } + ], + fragBody: ` + float r<0> = sin((st.x-<2>/100.+time*<1>)*<0>)*0.5 + 0.5; + float g<0> = sin((st.x+time*<1>)*<0>)*0.5 + 0.5; + float b<0> = sin((st.x+<2>/100.+time*<1>)*<0>)*0.5 + 0.5; + c = vec4(r<0>, g<0>, b<0>, 1.0); + ` + }, + blend: { + transformType: 'color', + inputs: [ + { + name: 'src', + type: 'image' + }, + { + name: 'blendAmount', + type: 'float', + default: 0.4 + } + ], + fragBody: ` + c*=(1.0-<1>); + c+= texture2D(<0>, uv)*<1>; + ` + }, + mult: { + transformType: 'color', + inputs: [ + { + name: 'src', + type: 'image' + }, + { + name: 'amount', + type: 'float', + default: 1.0 + } + ], + fragBody: ` + vec4 c<1> = c*(texture2D(<0>, uv)); + c*=(1.0-<1>); + c+= c<1>*<1>; + ` + }, + add: { + transformType: 'color', + inputs: [ + { + name: 'src', + type: 'image' + } + ], + fragBody: ` + c += texture2D(<0>, uv); + ` + }, + diff: { + transformType: 'color', + inputs: [ + { + name: 'src', + type: 'image' + } + ], + fragBody: ` + c -= texture2D(<0>, uv); + c = vec4(abs(c).xyz, 1.0); + ` + }, + scale: { + transformType: 'coord', + inputs: [ + { + name: 'scaleAmount', + type: 'float', + default: 1.5 + } + ], + fragBody: ` + st = vec2(1.0/<0>)*st; + ` + }, + pixelate: { + transformType: 'coord', + inputs: [ + { + name: 'pixelX', + type: 'float', + default: 20 + }, { + name: 'pixelY', + type: 'float', + default: 20 + } + ], + fragBody: ` + st *= vec2(<0>, <1>); + st = floor(st) + 0.5; + st /= vec2(<0>, <1>); + ` + }, + contrast: { + transformType: 'color', + inputs: [ + { + name: 'contrast', + type: 'float', + default: 1.6 + } + ], + fragBody: ` + c = (c-vec4(0.5))*<0> + vec4(0.5); + c = vec4(c.xyz, 1.0); + ` + }, + kaleid: { + transformType: 'coord', + inputs: [ + { + name: 'nSides', + type: 'float', + default: 4.0 + } + ], + fragBody: ` + st -= 0.5; + float r<0> = length(st); + float a<0> = atan(st.y, st.x); + float pi<0> = 2.*3.1416; + a<0> = mod(a<0>, pi<0>/<0>); + a<0> = abs(a<0>-pi<0>/<0>/2.); + st = r<0>*vec2(cos(a<0>), sin(a<0>)); + ` + }, + brightness: { + transformType: 'color', + inputs: [ + { + name: 'brightness', + type: 'float', + default: 0.4 + } + ], + fragBody: ` + c = vec4(c.xyz + vec3(<0>), 1.0); + ` + }, + posterize: { + transformType: 'color', + inputs: [ + { + name: 'bins', + type: 'float', + default: 3.0 + }, + { + name: 'gamma', + type: 'float', + default: 0.6 + } + ], + fragBody: ` + c = pow(c, vec4(<1>)); + c*=vec4(<0>); + c = floor(c); + c/=vec4(<0>); + c = pow(c, vec4(1.0/<1>)); + c = vec4(c.xyz, 1.0); + ` + }, + modulate: { + transformType: 'coord', + inputs: [ + { + name: 'src', + type: 'image' + }, + { + name: 'amount', + type: 'float', + default: 0.1 + } + ], + fragBody: ` + st += texture2D(<0>, uv).xy*<1>; + ` + }, + + color: { + transformType: 'color', + inputs: [{ + name: 'color', + type: 'color', + default: [1.0, 0.5, 0.0] + }], + fragBody: ` + c.rgb = c.rgb*<0>; + c = vec4(c.rgb, 1.0); + ` + }, + gradient: { + transformType: 'color', + isSource: true, + fragBody: ` + c = vec4(st, sin(time), 1.0); + ` + }, + scrollX: { + transformType: 'coord', + inputs: [ + { + name: 'scrollX', + type: 'float', + default: 0.5 + }, + { + name: 'speed', + type: 'float', + default: 0.0 + } + ], + fragBody: ` + st.x += <0> + time*<1>; + st = fract(st); + ` + }, + repeatX: { + transformType: 'coord', + inputs: [ + { + name: 'repeatX', + type: 'float', + default: 3.0 + }, { + name: 'offsetX', + type: 'float', + default: 0.0 + } + ], + fragBody: ` + st*= vec2(<0>, 1.0); + st.x += step(1., mod(st.y,2.0)) * <1>; + st = fract(st); + ` + }, + repeatY: { + transformType: 'coord', + inputs: [ + { + name: 'repeatY', + type: 'float', + default: 3.0 + }, { + name: 'offsetY', + type: 'float', + default: 0.0 + } + ], + fragBody: ` + st*= vec2(1.0, <0>); + st.y += step(1., mod(st.x,2.0)) * <1>; + st = fract(st); + ` + }, + repeat: { + transformType: 'coord', + inputs: [ + { + name: 'repeatX', + type: 'float', + default: 3.0 + }, + { + name: 'repeatY', + type: 'float', + default: 3.0 + }, + { + name: 'offsetX', + type: 'float', + default: 0.0 + }, + { + name: 'offsetY', + type: 'float', + default: 0.0 + } + ], + fragBody: ` + st*= vec2(<0>, <1>); + st.x += step(1., mod(st.y,2.0)) * <2>; + st.y += step(1., mod(st.x,2.0)) * <3>; + st = fract(st); + ` + }, + rotate: { + transformType: 'coord', + inputs: [ + { + name: 'angle', + type: 'float', + default: 10.0 + }, { + name: 'speed', + type: 'float', + default: 0.0 + } + ], + fragBody: ` + st -= vec2(0.5); + float angle<0> = <0> + <1>*time; + st = mat2(cos(angle<0>),-sin(angle<0>), sin(angle<0>),cos(angle<0>))*st; + st += vec2(0.5); + ` + } + } + + }, {}], + 35: [function (require, module, exports) { + const Webcam = require('./webcam.js') + const Screen = require('./lib/screenmedia.js') + + class HydraSource { + + constructor(opts) { + this.regl = opts.regl + this.src = null + this.dynamic = true + this.width = opts.width + this.height = opts.height + this.tex = this.regl.texture({ + shape: [opts.width, opts.height] + }) + this.pb = opts.pb + } + + init(opts) { + if (opts.src) { + this.src = opts.src + this.tex = this.regl.texture(this.src) + } + if (opts.dynamic) this.dynamic = opts.dynamic + } + + initCam(index) { + const self = this + Webcam(index).then((response) => { + self.src = response.video + self.tex = self.regl.texture(self.src) + }) + } + + initStream(streamName) { + console.log("initing stream!", streamName) + let self = this + if (streamName && this.pb) { + this.pb.initSource(streamName) + + this.pb.on("got video", function (nick, video) { + if (nick === streamName) { + self.src = video + self.tex = self.regl.texture(self.src) + } + }) + + } + } + + initScreen() { + const self = this + Screen().then(function (response) { + self.src = response.video + self.tex = self.regl.texture(self.src) + // console.log("received screen input") + }) + } + + resize(width, height) { + this.width = width + this.height = height + } + + clear() { + this.src = null + this.tex = this.regl.texture({ + shape: [this.width, this.height] + }) + } + + tick(time) { + + if (this.src !== null && this.dynamic === true) { + if (this.src.videoWidth && this.src.videoWidth !== this.tex.width) { + this.tex.resize(this.src.videoWidth, this.src.videoHeight) + } + this.tex.subimage(this.src) + //this.tex = this.regl.texture(this.src) + } + } + + getTexture() { + return this.tex + } + } + + module.exports = HydraSource + + }, {"./lib/screenmedia.js": 37, "./webcam.js": 42}], + 36: [function (require, module, exports) { + var adapter = require('webrtc-adapter'); +// to do: clean up this code +// cache for constraints and callback + var cache = {}; + + module.exports = function (constraints, cb) { + var hasConstraints = arguments.length === 2; + var callback = hasConstraints ? cb : constraints; + var error; + + if (typeof window === 'undefined' || window.location.protocol === 'http:') { + error = new Error('NavigatorUserMediaError'); + error.name = 'HTTPS_REQUIRED'; + return callback(error); + } + + if (window.navigator.userAgent.match('Chrome')) { + + var chromever = parseInt(window.navigator.userAgent.match(/Chrome\/(.*) /)[1], 10); + var maxver = 33; + + // check whether running in electron + if (window && window.process && window.process.type) { + constraints = (hasConstraints && constraints) || { + audio: false, video: { + mandatory: { + chromeMediaSource: 'desktop', + maxWidth: window.screen.width, + maxHeight: window.screen.height, + maxFrameRate: 3 + } + } + }; + + + console.log("running in electron", constraints) + // constraints.video.mandatory.chromeMediaSourceId = data.sourceId; + window.navigator.mediaDevices.getUserMedia(constraints).then(function (stream) { + callback(null, stream); + }).catch(function (err) { + callback(err); + }) + } else { + var isCef = !window.chrome.webstore; + // "known" crash in chrome 34 and 35 on linux + if (window.navigator.userAgent.match('Linux')) maxver = 35; + + // check that the extension is installed by looking for a + // sessionStorage variable that contains the extension id + // this has to be set after installation unless the contest + // script does that + if (sessionStorage.getScreenMediaJSExtensionId) { + chrome.runtime.sendMessage(sessionStorage.getScreenMediaJSExtensionId, + {type: 'getScreen', id: 1}, null, + function (data) { + console.log("getting screen", data) + if (!data || data.sourceId === '') { // user canceled + var error = new Error('NavigatorUserMediaError'); + error.name = 'NotAllowedError'; + callback(error); + } else { + constraints = (hasConstraints && constraints) || { + audio: false, video: { + mandatory: { + chromeMediaSource: 'desktop', + maxWidth: window.screen.width, + maxHeight: window.screen.height, + maxFrameRate: 3 + } + } + }; + + + console.log("constriants", constraints) + constraints.video.mandatory.chromeMediaSourceId = data.sourceId; + window.navigator.mediaDevices.getUserMedia(constraints).then(function (stream) { + callback(null, stream); + }).catch(function (err) { + callback(err); + }); + } + } + ); + } else if (window.cefGetScreenMedia) { + //window.cefGetScreenMedia is experimental - may be removed without notice + window.cefGetScreenMedia(function (sourceId) { + if (!sourceId) { + var error = new Error('cefGetScreenMediaError'); + error.name = 'CEF_GETSCREENMEDIA_CANCELED'; + callback(error); + } else { + constraints = (hasConstraints && constraints) || { + audio: false, video: { + mandatory: { + chromeMediaSource: 'desktop', + maxWidth: window.screen.width, + maxHeight: window.screen.height, + maxFrameRate: 3 + }, + optional: [ + {googLeakyBucket: true}, + {googTemporalLayeredScreencast: true} + ] + } + }; + constraints.video.mandatory.chromeMediaSourceId = sourceId; + window.navigator.mediaDevices.getUserMedia(constraints).then(function (stream) { + callback(null, stream); + }).catch(function (err) { + callback(err); + }); + } + }); + } else if (isCef || (chromever >= 26 && chromever <= maxver)) { + // chrome 26 - chrome 33 way to do it -- requires bad chrome://flags + // note: this is basically in maintenance mode and will go away soon + constraints = (hasConstraints && constraints) || { + video: { + mandatory: { + googLeakyBucket: true, + maxWidth: window.screen.width, + maxHeight: window.screen.height, + maxFrameRate: 3, + chromeMediaSource: 'screen' + } + } + }; + window.navigator.mediaDevices.getUserMedia(constraints).then(function (stream) { + callback(null, stream); + }).catch(function (err) { + callback(err); + }); + } else { + // chrome 34+ way requiring an extension + var pending = window.setTimeout(function () { + error = new Error('NavigatorUserMediaError'); + error.name = 'EXTENSION_UNAVAILABLE'; + return callback(error); + }, 1000); + cache[pending] = [callback, hasConstraints ? constraints : null]; + window.postMessage({type: 'getScreen', id: pending}, '*'); + } + } + } else if (window.navigator.userAgent.match('Firefox')) { + var ffver = parseInt(window.navigator.userAgent.match(/Firefox\/(.*)/)[1], 10); + if (ffver >= 33) { + constraints = (hasConstraints && constraints) || { + video: { + mozMediaSource: 'window', + mediaSource: 'window' + } + }; + window.navigator.mediaDevices.getUserMedia(constraints).then(function (stream) { + callback(null, stream); + var lastTime = stream.currentTime; + var polly = window.setInterval(function () { + if (!stream) window.clearInterval(polly); + if (stream.currentTime == lastTime) { + window.clearInterval(polly); + if (stream.onended) { + stream.onended(); + } + } + lastTime = stream.currentTime; + }, 500); + }).catch(function (err) { + callback(err); + }); + } else { + error = new Error('NavigatorUserMediaError'); + error.name = 'EXTENSION_UNAVAILABLE'; // does not make much sense but... + } + } + }; + + typeof window !== 'undefined' && window.addEventListener('message', function (event) { + if (event.origin != window.location.origin) { + return; + } + if (event.data.type == 'gotScreen' && cache[event.data.id]) { + alert("got screen!") + var data = cache[event.data.id]; + var constraints = data[1]; + var callback = data[0]; + delete cache[event.data.id]; + + if (event.data.sourceId === '') { // user canceled + var error = new Error('NavigatorUserMediaError'); + error.name = 'NotAllowedError'; + callback(error); + } else { + constraints = constraints || { + audio: false, video: { + mandatory: { + chromeMediaSource: 'desktop', + maxWidth: window.screen.width, + maxHeight: window.screen.height, + maxFrameRate: 3 + }, + optional: [ + {googLeakyBucket: true}, + {googTemporalLayeredScreencast: true} + ] + } + }; + constraints.video.mandatory.chromeMediaSourceId = event.data.sourceId; + window.navigator.mediaDevices.getUserMedia(constraints).then(function (stream) { + callback(null, stream); + }).catch(function (err) { + callback(err); + }); + } + } else if (event.data.type == 'getScreenPending') { + window.clearTimeout(event.data.id); + } + }); + + }, {"webrtc-adapter": 14}], + 37: [function (require, module, exports) { + const getScreenMedia = require('./getscreenmedia.js') + + module.exports = function (options) { + //const regl = options.regl + + // mandatory: { + // chromeMediaSource: 'desktop', + // maxWidth: 640, + // maxHeight: 480 + // } + return new Promise(function (resolve, reject) { + getScreenMedia({ + audio: false, video: { + mandatory: { + chromeMediaSource: 'desktop' + } + } + }, function (err, stream) { + if (err) { + console.log('error getting screen media', err) + reject(err) + } else { + console.log("got stream", stream) + const video = document.createElement('video') + //video.src = window.URL.createObjectURL(stream) + video.srcObject = stream + // document.body.appendChild(video) + video.addEventListener('loadedmetadata', () => { + video.play() + // const webcam = regl.texture(video) + //regl.frame(() => webcam.subimage(video)) + resolve({video: video}) + }) + //resolve() + } + }) + }) + + } + + }, {"./getscreenmedia.js": 36}], + 38: [function (require, module, exports) { + const transforms = require('./glsl-transforms.js') + + var Output = function (opts) { + this.regl = opts.regl + this.positionBuffer = this.regl.buffer([ + [-2, 0], + [0, -2], + [2, 2] + ]) + + this.clear() + this.pingPongIndex = 0 + + // for each output, create two fbos to use for ping ponging + this.fbos = (Array(2)).fill().map(() => this.regl.framebuffer({ + color: this.regl.texture({ + width: opts.width, + height: opts.height, + format: 'rgba' + }), + depthStencil: false + })) + + // array containing render passes + this.passes = [] + // console.log("position", this.positionBuffer) + } + + Output.prototype.resize = function (width, height) { + this.fbos.forEach((fbo) => { + fbo.resize(width, height) + }) + } + +// Object.keys(transforms).forEach((method) => { +// Output.prototype[method] = function (...args) { +// // console.log("applying", method, transforms[method]) +// this.applyTransform(transforms[method], args) +// +// return this +// } +// }) + + Output.prototype.getCurrent = function () { + // console.log("get current",this.pingPongIndex ) + return this.fbos[this.pingPongIndex] + } + + Output.prototype.getTexture = function () { +// return this.fbos[!this.pingPongIndex] + var index = this.pingPongIndex ? 0 : 1 + // console.log("get texture",index) + return this.fbos[index] + } + + Output.prototype.clear = function () { + this.transformIndex = 0 + this.fragHeader = ` + precision highp float; + + uniform float time; + varying vec2 uv; + ` + this.fragBody = `` + // + // uniform vec4 color; + // void main () { + // gl_FragColor = color; + // }` + this.vert = ` + precision highp float; + attribute vec2 position; + varying vec2 uv; + + void main () { + uv = position; + gl_Position = vec4(2.0 * position - 1.0, 0, 1); + }` + this.attributes = { + position: this.positionBuffer + } + this.uniforms = { + time: this.regl.prop('time'), + resolution: this.regl.prop('resolution') + } +// this.compileFragShader() + + this.frag = ` + ${this.fragHeader} + + void main () { + vec4 c = vec4(0, 0, 0, 0); + vec2 st = uv; + ${this.fragBody} + gl_FragColor = c; + } + ` + return this + } + + +// Output.prototype.compileFragShader = function () { +// var frag = ` +// ${this.fragHeader} +// +// void main () { +// vec4 c = vec4(0, 0, 0, 0); +// vec2 st = uv; +// ${this.fragBody} +// gl_FragColor = c; +// } +// ` +// // console.log("FRAG", frag) +// this.frag = frag +// } + + Output.prototype.render = function () { + this.draw = this.regl({ + frag: this.frag, + vert: this.vert, + attributes: this.attributes, + uniforms: this.uniforms, + count: 3, + framebuffer: () => { + this.pingPongIndex = this.pingPongIndex ? 0 : 1 + return this.fbos[this.pingPongIndex] + } + }) + } + + Output.prototype.renderPasses = function (passes) { + var self = this +// console.log("passes", passes) + this.passes = passes.map((pass, passIndex) => { + + // console.log("get texture",index) + var uniforms = Object.assign(pass.uniforms, { + prevBuffer: () => { + var index = this.pingPongIndex ? 0 : 1 + // console.log('pass index', passIndex, 'fbo index', index) + return this.fbos[this.pingPongIndex ? 0 : 1] + } + }) + + return { + draw: self.regl({ + frag: pass.frag, + vert: self.vert, + attributes: self.attributes, + uniforms: uniforms, + count: 3, + framebuffer: () => { + + self.pingPongIndex = self.pingPongIndex ? 0 : 1 + // console.log('pass index', passIndex, 'render index', self.pingPongIndex) + return self.fbos[self.pingPongIndex] + } + }) + } + }) + } + + Output.prototype.tick = function (props) { +// this.draw(props) + this.passes.forEach((pass) => pass.draw(props)) + } + + module.exports = Output + + }, {"./glsl-transforms.js": 34}], + 39: [function (require, module, exports) { +// to add: ripple: https://www.shadertoy.com/view/4djGzz +// mask +// convolution +// basic sdf shapes +// repeat +// iq color palletes + + module.exports = { + _convolution: { + type: 'renderpass_util', + glsl: ` + float kernel [9]; + + vec4 _convolution (vec2 uv, float[9] _kernel, float kernelWeight) { + vec2 st = uv/resolution.xy; + vec2 onePixel = vec2(4.0, 4.0) / resolution.xy; + // vec2 onePixel = vec2(1.0, 1.0); + vec4 colorSum = + texture2D(prevBuffer, st + onePixel * vec2(-1, -1)) * _kernel[0] + + texture2D(prevBuffer, st + onePixel * vec2( 0, -1)) * _kernel[1] + + texture2D(prevBuffer, st + onePixel * vec2( 1, -1)) * _kernel[2] + + texture2D(prevBuffer, st + onePixel * vec2(-1, 0)) * _kernel[3] + + texture2D(prevBuffer, st + onePixel * vec2( 0, 0)) * _kernel[4] + + texture2D(prevBuffer, st + onePixel * vec2( 1, 0)) * _kernel[5] + + texture2D(prevBuffer, st + onePixel * vec2(-1, 1)) * _kernel[6] + + texture2D(prevBuffer, st + onePixel * vec2( 0, 1)) * _kernel[7] + + texture2D(prevBuffer, st + onePixel * vec2( 1, 1)) * _kernel[8] ; + colorSum /= kernelWeight; + return colorSum; + } + ` + }, + rgbShift: { + type: 'renderpass', + glsl: ` + + void main() { + vec2 p = st; + vec4 shift = vec4(-0.01, 0.02, 0.03, -0.04); + vec2 rs = vec2(shift.x,-shift.y); + vec2 gs = vec2(shift.y,-shift.z); + vec2 bs = vec2(shift.z,-shift.x); + + float r = texture2D(prevBuffer, p+rs, 0.0).x; + float g = texture2D(prevBuffer, p+gs, 0.0).y; + float b = texture2D(prevBuffer, p+bs, 0.0).z; + } + ` + }, + edges: { + type: 'renderpass', + glsl: ` + void main () { + // kernel[0] = -0.125; kernel[1] = -0.125; kernel[2] = -0.125; + // kernel[3] = -0.125; kernel[4] = 1.0; kernel[5] = -0.125; + // kernel[6] = -0.125; kernel[7] = -0.125; kernel[8] = -0.125; + +// blur + kernel[0] = 0.0; kernel[1] = 1.0; kernel[2] = 0.0; + kernel[3] = 1.0; kernel[4] = 1.0; kernel[5] = 1.0; + kernel[6] = 0.0; kernel[7] = 1.0; kernel[8] = 0.0; + + kernel[0] = 5.0; kernel[1] = -0.0; kernel[2] = -0.0; + kernel[3] = 0.0; kernel[4] = 0.0; kernel[5] = 0.0; + kernel[6] = -0.0; kernel[7] = -0.0; kernel[8] = -5.0; + + vec4 sum = _convolution( gl_FragCoord.xy, kernel, 10.0); + gl_FragColor = clamp(sum , vec4(0.0), vec4(1.0)); + // vec2 st = gl_FragCoord.xy/resolution.xy; + // vec4 col = texture2D(prevBuffer, fract(st)); + // gl_FragColor = vec4(st, 1.0, 1.0); + } + ` + } + } + + }, {}], + 40: [function (require, module, exports) { +// to do: +// 1. how to handle multi-pass renders +// 2. how to handle vertex shaders + + module.exports = function (defaultOutput) { + + var Frag = function (shaderString) { + var obj = Object.create(Frag.prototype) + obj.shaderString = ` + void main () { + vec2 st = gl_FragCoord.xy/resolution.xy; + gl_FragColor = vec4(st, 1.0, 1.0); + } + ` + if (shaderString) obj.shaderString = shaderString + return obj + } + + Frag.prototype.compile = function () { + var frag = ` + precision highp float; + uniform float time; + uniform vec2 resolution; + varying vec2 uv; + + ${this.shaderString} + ` + return frag + } + + Frag.prototype.out = function (_output) { + var output = _output || defaultOutput + var frag = this.compile() + output.frag = frag + var pass = { + frag: frag, + uniforms: output.uniforms + } + console.log('rendering', pass) + var passes = [] + passes.push(pass) + output.renderPasses([pass]) + // var uniformObj = {} + // this.uniforms.forEach((uniform) => { uniformObj[uniform.name] = uniform.value }) + // output.uniforms = Object.assign(output.uniforms, uniformObj) + output.render() + } + + return Frag + } + + }, {}], + 41: [function (require, module, exports) { + class VideoRecorder { + constructor(stream) { + this.mediaSource = new MediaSource() + this.stream = stream + + // testing using a recording as input + this.output = document.createElement('video') + this.output.autoplay = true + this.output.loop = true + + let self = this + this.mediaSource.addEventListener('sourceopen', () => { + console.log('MediaSource opened'); + self.sourceBuffer = self.mediaSource.addSourceBuffer('video/webm; codecs="vp8"'); + console.log('Source buffer: ', sourceBuffer); + }) + } + + start() { + // let options = {mimeType: 'video/webm'}; + +// let options = {mimeType: 'video/webm;codecs=h264'}; + let options = {mimeType: 'video/webm;codecs=vp9'}; + + this.recordedBlobs = [] + try { + this.mediaRecorder = new MediaRecorder(this.stream, options) + } catch (e0) { + console.log('Unable to create MediaRecorder with options Object: ', e0) + try { + options = {mimeType: 'video/webm,codecs=vp9'} + this.mediaRecorder = new MediaRecorder(this.stream, options) + } catch (e1) { + console.log('Unable to create MediaRecorder with options Object: ', e1) + try { + options = 'video/vp8' // Chrome 47 + this.mediaRecorder = new MediaRecorder(this.stream, options) + } catch (e2) { + alert('MediaRecorder is not supported by this browser.\n\n' + + 'Try Firefox 29 or later, or Chrome 47 or later, ' + + 'with Enable experimental Web Platform features enabled from chrome://flags.') + console.error('Exception while creating MediaRecorder:', e2) + return + } + } + } + console.log('Created MediaRecorder', this.mediaRecorder, 'with options', options); + this.mediaRecorder.onstop = this._handleStop.bind(this) + this.mediaRecorder.ondataavailable = this._handleDataAvailable.bind(this) + this.mediaRecorder.start(100) // collect 100ms of data + console.log('MediaRecorder started', this.mediaRecorder) + } + + + stop() { + this.mediaRecorder.stop() + } + + _handleStop() { + //const superBuffer = new Blob(recordedBlobs, {type: 'video/webm'}) + // const blob = new Blob(this.recordedBlobs, {type: 'video/webm;codecs=h264'}) + const blob = new Blob(this.recordedBlobs, {type: this.mediaRecorder.mimeType}) + const url = window.URL.createObjectURL(blob) + this.output.src = url + + const a = document.createElement('a') + a.style.display = 'none' + a.href = url + let d = new Date() + a.download = `hydra-${d.getFullYear()}-${d.getMonth() + 1}-${d.getDate()}-${d.getHours()}.${d.getMinutes()}.${d.getSeconds()}.webm` + document.body.appendChild(a) + a.click() + setTimeout(() => { + document.body.removeChild(a); + window.URL.revokeObjectURL(url); + }, 300); + } + + _handleDataAvailable(event) { + if (event.data && event.data.size > 0) { + this.recordedBlobs.push(event.data); + } + } + } + + module.exports = VideoRecorder + + }, {}], + 42: [function (require, module, exports) { + const enumerateDevices = require('enumerate-devices') + + module.exports = function (deviceId) { + return enumerateDevices() + .then(devices => devices.filter(devices => devices.kind === 'videoinput')) + .then(cameras => { + let constraints = {audio: false, video: true} + if (cameras[deviceId]) { + constraints['video'] = { + deviceId: {exact: cameras[deviceId].deviceId} + } + } + console.log(cameras) + return window.navigator.mediaDevices.getUserMedia(constraints) + }) + .then(stream => { + const video = document.createElement('video') + // video.src = window.URL.createObjectURL(stream) + video.srcObject = stream + return new Promise((resolve, reject) => { + video.addEventListener('loadedmetadata', () => { + video.play().then(() => resolve({video: video})) + }) + }) + }) + .catch(console.log.bind(console)) + } + + }, {"enumerate-devices": 2}], + 43: [function (require, module, exports) { +// Copyright Joyent, Inc. and other Node contributors. +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the +// "Software"), to deal in the Software without restriction, including +// without limitation the rights to use, copy, modify, merge, publish, +// distribute, sublicense, and/or sell copies of the Software, and to permit +// persons to whom the Software is furnished to do so, subject to the +// following conditions: +// +// The above copyright notice and this permission notice shall be included +// in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +// USE OR OTHER DEALINGS IN THE SOFTWARE. + + var objectCreate = Object.create || objectCreatePolyfill + var objectKeys = Object.keys || objectKeysPolyfill + var bind = Function.prototype.bind || functionBindPolyfill + + function EventEmitter() { + if (!this._events || !Object.prototype.hasOwnProperty.call(this, '_events')) { + this._events = objectCreate(null); + this._eventsCount = 0; + } + + this._maxListeners = this._maxListeners || undefined; + } + + module.exports = EventEmitter; + +// Backwards-compat with node 0.10.x + EventEmitter.EventEmitter = EventEmitter; + + EventEmitter.prototype._events = undefined; + EventEmitter.prototype._maxListeners = undefined; + +// By default EventEmitters will print a warning if more than 10 listeners are +// added to it. This is a useful default which helps finding memory leaks. + var defaultMaxListeners = 10; + + var hasDefineProperty; + try { + var o = {}; + if (Object.defineProperty) Object.defineProperty(o, 'x', {value: 0}); + hasDefineProperty = o.x === 0; + } catch (err) { + hasDefineProperty = false + } + if (hasDefineProperty) { + Object.defineProperty(EventEmitter, 'defaultMaxListeners', { + enumerable: true, + get: function () { + return defaultMaxListeners; + }, + set: function (arg) { + // check whether the input is a positive number (whose value is zero or + // greater and not a NaN). + if (typeof arg !== 'number' || arg < 0 || arg !== arg) + throw new TypeError('"defaultMaxListeners" must be a positive number'); + defaultMaxListeners = arg; + } + }); + } else { + EventEmitter.defaultMaxListeners = defaultMaxListeners; + } + +// Obviously not all Emitters should be limited to 10. This function allows +// that to be increased. Set to zero for unlimited. + EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { + if (typeof n !== 'number' || n < 0 || isNaN(n)) + throw new TypeError('"n" argument must be a positive number'); + this._maxListeners = n; + return this; + }; + + function $getMaxListeners(that) { + if (that._maxListeners === undefined) + return EventEmitter.defaultMaxListeners; + return that._maxListeners; + } + + EventEmitter.prototype.getMaxListeners = function getMaxListeners() { + return $getMaxListeners(this); + }; + +// These standalone emit* functions are used to optimize calling of event +// handlers for fast cases because emit() itself often has a variable number of +// arguments and can be deoptimized because of that. These functions always have +// the same number of arguments and thus do not get deoptimized, so the code +// inside them can execute faster. + function emitNone(handler, isFn, self) { + if (isFn) + handler.call(self); + else { + var len = handler.length; + var listeners = arrayClone(handler, len); + for (var i = 0; i < len; ++i) + listeners[i].call(self); + } + } + + function emitOne(handler, isFn, self, arg1) { + if (isFn) + handler.call(self, arg1); + else { + var len = handler.length; + var listeners = arrayClone(handler, len); + for (var i = 0; i < len; ++i) + listeners[i].call(self, arg1); + } + } + + function emitTwo(handler, isFn, self, arg1, arg2) { + if (isFn) + handler.call(self, arg1, arg2); + else { + var len = handler.length; + var listeners = arrayClone(handler, len); + for (var i = 0; i < len; ++i) + listeners[i].call(self, arg1, arg2); + } + } + + function emitThree(handler, isFn, self, arg1, arg2, arg3) { + if (isFn) + handler.call(self, arg1, arg2, arg3); + else { + var len = handler.length; + var listeners = arrayClone(handler, len); + for (var i = 0; i < len; ++i) + listeners[i].call(self, arg1, arg2, arg3); + } + } + + function emitMany(handler, isFn, self, args) { + if (isFn) + handler.apply(self, args); + else { + var len = handler.length; + var listeners = arrayClone(handler, len); + for (var i = 0; i < len; ++i) + listeners[i].apply(self, args); + } + } + + EventEmitter.prototype.emit = function emit(type) { + var er, handler, len, args, i, events; + var doError = (type === 'error'); + + events = this._events; + if (events) + doError = (doError && events.error == null); + else if (!doError) + return false; + + // If there is no 'error' event listener then throw. + if (doError) { + if (arguments.length > 1) + er = arguments[1]; + if (er instanceof Error) { + throw er; // Unhandled 'error' event + } else { + // At least give some kind of context to the user + var err = new Error('Unhandled "error" event. (' + er + ')'); + err.context = er; + throw err; + } + return false; + } + + handler = events[type]; + + if (!handler) + return false; + + var isFn = typeof handler === 'function'; + len = arguments.length; + switch (len) { + // fast cases + case 1: + emitNone(handler, isFn, this); + break; + case 2: + emitOne(handler, isFn, this, arguments[1]); + break; + case 3: + emitTwo(handler, isFn, this, arguments[1], arguments[2]); + break; + case 4: + emitThree(handler, isFn, this, arguments[1], arguments[2], arguments[3]); + break; + // slower + default: + args = new Array(len - 1); + for (i = 1; i < len; i++) + args[i - 1] = arguments[i]; + emitMany(handler, isFn, this, args); + } + + return true; + }; + + function _addListener(target, type, listener, prepend) { + var m; + var events; + var existing; + + if (typeof listener !== 'function') + throw new TypeError('"listener" argument must be a function'); + + events = target._events; + if (!events) { + events = target._events = objectCreate(null); + target._eventsCount = 0; + } else { + // To avoid recursion in the case that type === "newListener"! Before + // adding it to the listeners, first emit "newListener". + if (events.newListener) { + target.emit('newListener', type, + listener.listener ? listener.listener : listener); + + // Re-assign `events` because a newListener handler could have caused the + // this._events to be assigned to a new object + events = target._events; + } + existing = events[type]; + } + + if (!existing) { + // Optimize the case of one listener. Don't need the extra array object. + existing = events[type] = listener; + ++target._eventsCount; + } else { + if (typeof existing === 'function') { + // Adding the second element, need to change to array. + existing = events[type] = + prepend ? [listener, existing] : [existing, listener]; + } else { + // If we've already got an array, just append. + if (prepend) { + existing.unshift(listener); + } else { + existing.push(listener); + } + } + + // Check for listener leak + if (!existing.warned) { + m = $getMaxListeners(target); + if (m && m > 0 && existing.length > m) { + existing.warned = true; + var w = new Error('Possible EventEmitter memory leak detected. ' + + existing.length + ' "' + String(type) + '" listeners ' + + 'added. Use emitter.setMaxListeners() to ' + + 'increase limit.'); + w.name = 'MaxListenersExceededWarning'; + w.emitter = target; + w.type = type; + w.count = existing.length; + if (typeof console === 'object' && console.warn) { + console.warn('%s: %s', w.name, w.message); + } + } + } + } + + return target; + } + + EventEmitter.prototype.addListener = function addListener(type, listener) { + return _addListener(this, type, listener, false); + }; + + EventEmitter.prototype.on = EventEmitter.prototype.addListener; + + EventEmitter.prototype.prependListener = + function prependListener(type, listener) { + return _addListener(this, type, listener, true); + }; + + function onceWrapper() { + if (!this.fired) { + this.target.removeListener(this.type, this.wrapFn); + this.fired = true; + switch (arguments.length) { + case 0: + return this.listener.call(this.target); + case 1: + return this.listener.call(this.target, arguments[0]); + case 2: + return this.listener.call(this.target, arguments[0], arguments[1]); + case 3: + return this.listener.call(this.target, arguments[0], arguments[1], + arguments[2]); + default: + var args = new Array(arguments.length); + for (var i = 0; i < args.length; ++i) + args[i] = arguments[i]; + this.listener.apply(this.target, args); + } + } + } + + function _onceWrap(target, type, listener) { + var state = {fired: false, wrapFn: undefined, target: target, type: type, listener: listener}; + var wrapped = bind.call(onceWrapper, state); + wrapped.listener = listener; + state.wrapFn = wrapped; + return wrapped; + } + + EventEmitter.prototype.once = function once(type, listener) { + if (typeof listener !== 'function') + throw new TypeError('"listener" argument must be a function'); + this.on(type, _onceWrap(this, type, listener)); + return this; + }; + + EventEmitter.prototype.prependOnceListener = + function prependOnceListener(type, listener) { + if (typeof listener !== 'function') + throw new TypeError('"listener" argument must be a function'); + this.prependListener(type, _onceWrap(this, type, listener)); + return this; + }; + +// Emits a 'removeListener' event if and only if the listener was removed. + EventEmitter.prototype.removeListener = + function removeListener(type, listener) { + var list, events, position, i, originalListener; + + if (typeof listener !== 'function') + throw new TypeError('"listener" argument must be a function'); + + events = this._events; + if (!events) + return this; + + list = events[type]; + if (!list) + return this; + + if (list === listener || list.listener === listener) { + if (--this._eventsCount === 0) + this._events = objectCreate(null); + else { + delete events[type]; + if (events.removeListener) + this.emit('removeListener', type, list.listener || listener); + } + } else if (typeof list !== 'function') { + position = -1; + + for (i = list.length - 1; i >= 0; i--) { + if (list[i] === listener || list[i].listener === listener) { + originalListener = list[i].listener; + position = i; + break; + } + } + + if (position < 0) + return this; + + if (position === 0) + list.shift(); + else + spliceOne(list, position); + + if (list.length === 1) + events[type] = list[0]; + + if (events.removeListener) + this.emit('removeListener', type, originalListener || listener); + } + + return this; + }; + + EventEmitter.prototype.removeAllListeners = + function removeAllListeners(type) { + var listeners, events, i; + + events = this._events; + if (!events) + return this; + + // not listening for removeListener, no need to emit + if (!events.removeListener) { + if (arguments.length === 0) { + this._events = objectCreate(null); + this._eventsCount = 0; + } else if (events[type]) { + if (--this._eventsCount === 0) + this._events = objectCreate(null); + else + delete events[type]; + } + return this; + } + + // emit removeListener for all listeners on all events + if (arguments.length === 0) { + var keys = objectKeys(events); + var key; + for (i = 0; i < keys.length; ++i) { + key = keys[i]; + if (key === 'removeListener') continue; + this.removeAllListeners(key); + } + this.removeAllListeners('removeListener'); + this._events = objectCreate(null); + this._eventsCount = 0; + return this; + } + + listeners = events[type]; + + if (typeof listeners === 'function') { + this.removeListener(type, listeners); + } else if (listeners) { + // LIFO order + for (i = listeners.length - 1; i >= 0; i--) { + this.removeListener(type, listeners[i]); + } + } + + return this; + }; + + function _listeners(target, type, unwrap) { + var events = target._events; + + if (!events) + return []; + + var evlistener = events[type]; + if (!evlistener) + return []; + + if (typeof evlistener === 'function') + return unwrap ? [evlistener.listener || evlistener] : [evlistener]; + + return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length); + } + + EventEmitter.prototype.listeners = function listeners(type) { + return _listeners(this, type, true); + }; + + EventEmitter.prototype.rawListeners = function rawListeners(type) { + return _listeners(this, type, false); + }; + + EventEmitter.listenerCount = function (emitter, type) { + if (typeof emitter.listenerCount === 'function') { + return emitter.listenerCount(type); + } else { + return listenerCount.call(emitter, type); + } + }; + + EventEmitter.prototype.listenerCount = listenerCount; + + function listenerCount(type) { + var events = this._events; + + if (events) { + var evlistener = events[type]; + + if (typeof evlistener === 'function') { + return 1; + } else if (evlistener) { + return evlistener.length; + } + } + + return 0; + } + + EventEmitter.prototype.eventNames = function eventNames() { + return this._eventsCount > 0 ? Reflect.ownKeys(this._events) : []; + }; + +// About 1.5x faster than the two-arg version of Array#splice(). + function spliceOne(list, index) { + for (var i = index, k = i + 1, n = list.length; k < n; i += 1, k += 1) + list[i] = list[k]; + list.pop(); + } + + function arrayClone(arr, n) { + var copy = new Array(n); + for (var i = 0; i < n; ++i) + copy[i] = arr[i]; + return copy; + } + + function unwrapListeners(arr) { + var ret = new Array(arr.length); + for (var i = 0; i < ret.length; ++i) { + ret[i] = arr[i].listener || arr[i]; + } + return ret; + } + + function objectCreatePolyfill(proto) { + var F = function () { + }; + F.prototype = proto; + return new F; + } + + function objectKeysPolyfill(obj) { + var keys = []; + for (var k in obj) if (Object.prototype.hasOwnProperty.call(obj, k)) { + keys.push(k); + } + return k; + } + + function functionBindPolyfill(context) { + var fn = this; + return function () { + return fn.apply(context, arguments); + }; + } + + }, {}], + 44: [function (require, module, exports) { +// shim for using process in browser + var process = module.exports = {}; + +// cached from whatever global is present so that test runners that stub it +// don't break things. But we need to wrap it in a try catch in case it is +// wrapped in strict mode code which doesn't define any globals. It's inside a +// function because try/catches deoptimize in certain engines. + + var cachedSetTimeout; + var cachedClearTimeout; + + function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); + } + + function defaultClearTimeout() { + throw new Error('clearTimeout has not been defined'); + } + + (function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } + }()) + + function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch (e) { + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch (e) { + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + + + } + + function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e) { + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e) { + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + + + } + + var queue = []; + var draining = false; + var currentQueue; + var queueIndex = -1; + + function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } + } + + function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while (len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); + } + + process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } + }; + +// v8 likes predictible objects + function Item(fun, array) { + this.fun = fun; + this.array = array; + } + + Item.prototype.run = function () { + this.fun.apply(null, this.array); + }; + process.title = 'browser'; + process.browser = true; + process.env = {}; + process.argv = []; + process.version = ''; // empty string to avoid regexp issues + process.versions = {}; + + function noop() { + } + + process.on = noop; + process.addListener = noop; + process.once = noop; + process.off = noop; + process.removeListener = noop; + process.removeAllListeners = noop; + process.emit = noop; + process.prependListener = noop; + process.prependOnceListener = noop; + + process.listeners = function (name) { + return [] + } + + process.binding = function (name) { + throw new Error('process.binding is not supported'); + }; + + process.cwd = function () { + return '/' + }; + process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); + }; + process.umask = function () { + return 0; + }; + + }, {}] + }, {}, [1])(1) +}); diff --git a/public/vendor/interface.js b/public/vendor/interface.js new file mode 100755 index 000000000..69b264098 --- /dev/null +++ b/public/vendor/interface.js @@ -0,0 +1,13529 @@ +!function(e){if("object"==typeof exports)module.exports=e();else if("function"==typeof define&&define.amd)define(e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Interface=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o -1; + })(), + + keyCodeToChar : {8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause/Break",20:"Caps Lock",27:"Esc",32:"Space",33:"Page Up",34:"Page Down",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",45:"Insert",46:"Delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",91:"Windows",93:"Right Click",96:"Numpad 0",97:"Numpad 1",98:"Numpad 2",99:"Numpad 3",100:"Numpad 4",101:"Numpad 5",102:"Numpad 6",103:"Numpad 7",104:"Numpad 8",105:"Numpad 9",106:"Numpad *",107:"Numpad +",109:"Numpad -",110:"Numpad .",111:"Numpad /",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"Num Lock",145:"Scroll Lock",182:"My Computer",183:"My Calculator",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"}, + + panels : [], + mouseDown : false, + useTouch : 'ontouchstart' in document.documentElement, + widgets : [], +}; + +Interface.Presets = { + dictionary : typeof localStorage.interfacejs === 'undefined' ? {} : JSON.parse( localStorage.interfacejs ), + + save : function(name) { + var preset = []; + for(var h = 0; h < Interface.panels.length; h++) { + var panel = Interface.panels[h]; + preset[h] = []; + for(var i = 0; i < panel.children.length; i++) { + var widget = panel.children[i]; + if(typeof widget.children === 'object') { + var children = []; + for(var j = 0; j < widget.children.length; j++) { + children[j] = widget.children[j].value; + } + preset[h][i] = children; + }else{ + preset[h][i] = widget.value; + } + } + this.dictionary[ name ] = preset; + localStorage.interfacejs = JSON.stringify( this.dictionary ); + } + }, + + load : function(name) { + var preset = this.dictionary[ name ]; + for(var h = 0; h < Interface.panels.length; h++) { + var panel = Interface.panels[h]; + for(var i = 0; i < panel.children.length; i++) { + var widget = panel.children[i]; + if(typeof widget.children === 'object') { + for(var j = 0; j < widget.children.length; j++) { + widget.children[j].setValue( preset[h][i][j] ); + } + }else{ + widget.setValue( preset[h][i] ); + } + } + } + }, + + list : function() { + return Object.keys( this.dictionary ); + }, +}; + +/**#Interface.Panel - Widget +A panel is a container for on-screen widgets. There can be multiple panels in a HTML page. Panels are the starting point for event processing in Interface.js. +**/ + +/**###Interface.Panel.children : property +Array. An array of all widgets displayed in the panel +**/ + +/**###Interface.Panel.shouldDraw : property +Boolean. Whenever the panel refreshes itself it will redraw widgets found in this array. +**/ + +/**###Interface.Panel.fps : property +Number. The number of times the panel should refresh itself per second. +**/ + +/**###Interface.Panel.useRelativeSizesAndPositions : property +Boolean. This determines whether widgets in the panel uses sizes/positions relative to the size of the panel or use absolute pixel coordinates. +**/ + +/**###Interface.Panel.container : property +HTMLElement. The HTMLElement (such as a div tag) containing the Panel. +**/ + +/**###Interface.Panel.canvas : property +HTMLElement. The canvas element that the Panel draws onto. This element is created when the panel is initialized. +**/ + +/**###Interface.Panel.touchEvent : method +The starting point for on-screen all touch event handling in a Panel. This method distributes events to all child widgets. + +param **event** HTML Touch Event Object. +**/ + +/**###Interface.Panel.mouseEvent : method +The starting point for on-screen all mouse event handling in a Panel. This method distributes events to all child widgets. + +param **event** HTML Mouse Event Object. +**/ + +/**###Interface.Panel.init : method +Initialization method called automatically when panel is instantiated. +**/ + +/**###Interface.Panel.x : property +Number. The x position of the panel in absolute coordinates relative to the window. +**/ +/**###Interface.Panel.y : property +Number. The y position of the panel in absolute coordinates relative to the window. +**/ +/**###Interface.Panel.width : property +Number. The width of the panel in pixels +**/ +/**###Interface.Panel.width : property +Number. The height of the panel in pixels +**/ + +/**###Interface.Panel.draw : method +This method tells all 'dirty' widgets stored in the shouldDraw property to draw themselves. +**/ +/**###Interface.Panel.refresh : method +Clear the entire panel and then tell all widgets to draw themselves. +**/ + +/**###Interface.Panel.add : method +Add a new widget to the panel + +param **widget** Object. The widget to be added. Motion widgets do not need to be added to the Panel +**/ + +/**###Interface.Panel.setBackgroundColor : method +Set the background color the panel using a css color value. + +param **cssColor** String. Any valid css color, such as 'red', '#f00', or 'rgb(255,0,0)'. +**/ + +/**###Interface.Panel.background : property +String. The default background color for all widgets in the panel. THIS IS NOT THE BACKGROUND COLOR FOR THE PANEL. Any valid css color, such as 'red', '#f00', or 'rgb(255,0,0)' can be assigned to this property. +**/ +/**###Interface.Panel.fill : property +String. The default fill color for all widgets in the panel. Any valid css color, such as 'red', '#f00', or 'rgb(255,0,0)' can be assigned to this property. +**/ +/**###Interface.Panel.stroke : property +String. The default stroke color for all widgets in the panel. Any valid css color, such as 'red', '#f00', or 'rgb(255,0,0)' can be assigned to this property. +**/ +Interface.Panel = function() { + var self = this, + _container = arguments.length >= 1 ? arguments[0].container : undefined; + + Interface.extend(this, { + type: 'Panel', + active: true, + children: [], + shouldDraw : [], + fps : 30, + useRelativeSizesAndPositions : true, + labelSize: '12px', + font:'normal 12px Helvetica', + serializeMe: ['fps', 'useRelativeSizesAndPositions', 'labelSize', 'font', 'background', 'fill', 'stroke', 'backgroundColor'], + + container: (function() { + if(typeof _container === 'undefined') { + $('body').css({ + margin : 0, + padding: 0, + }); + + var d = $('
    '); + d.css({ + width:$(window).width(), + height:$(window).height(), + display:'block', + margin:0, + padding:0, + position:'absolute', + left:0, + top:0 + }); + + $('body').append(d); + + return d; + }else{ + return _container; + } + })(), + + canvas: document.createElement('canvas'), + + touchEvent : function(event) { + if(self.active) { + if( typeof event.changedTouches === 'undefined' && event.originalEvent ) { + event.changedTouches = event.originalEvent.changedTouches + } + for (var j = 0; j < event.changedTouches.length; j++){ + var touch = event.changedTouches.item(j); + + for(var i = 0; i < self.children.length; i++) { + touch.x = touch.pageX - self.x; + touch.y = touch.pageY - self.y; + touch.type = event.type; + self.children[i].touchEvent(touch); + } + //var breakCheck = this.events[event.type].call(this, touch); + + //if(breakCheck) break; + } + event.preventDefault(); // HTML Elements must simulate touch events in their touchEvent method + } + }, + + mouseEvent : function(e) { + if(self.active) { + if(e.type === 'mousedown') { + Interface.mouseDown = true; + }else if(e.type === 'mouseup') { + Interface.mouseDown = false; + } + + var event = { + x : e.offsetX || (e.pageX - self.x), // pageX and pageY is for firefox compatibility + y : e.offsetY || (e.pageY - self.y), + type: e.type, + } + //console.log("MOUSE", event, self.y, e.pageY, e.layerY, e.clientY, e ); + + for(var i = 0; i < self.children.length; i++) { + self.children[i].mouseEvent(event); + } + } + }, + + init : function() { + var offset = $(this.container).offset(); + this.width = $(this.container).width(); + this.height = $(this.container).height(); + this.x = offset.left; + this.y = offset.top; + + if( isNaN(this.x) ) this.x = 0; + if( isNaN(this.y) ) this.y = 0; + + $(this.canvas).attr({ + 'width': this.width, + 'height': this.height, + }); + + $(this.container).css({ 'user-select': 'none', '-webkit-user-select': 'none'}); + + $(this.container).append(this.canvas); + + this.ctx = this.canvas.getContext( '2d' ); + this.ctx.translate(0.5, 0.5); + this.ctx.lineWidth = 1; + + if(Interface.useTouch) { + $(this.container).on( 'touchstart', this.touchEvent ); + $(this.container).on( 'touchmove', this.touchEvent ); + $(this.container).on( 'touchend', this.touchEvent ); + }else{ + $(this.container).on( 'mousedown', this.mouseEvent ); + $(this.container).on( 'mousemove', this.mouseEvent ); + $(this.container).on( 'mouseup', this.mouseEvent ); + } + + $( this.container ).css({ outline: 'none' }) + $( this.container ).attr( 'tabindex', 5 ) + $( this.container ).on( 'keydown', this.keydown.bind( this ) ) + $( this.container ).on( 'keyup', this.keyup.bind( this ) ) + }, + + keydown: function(e) { + for( var i = 0; i < this.children.length; i++ ) { + if( this.children[i].onkeydown ) this.children[i].onkeydown(e) + } + }, + + keyup: function(e) { + for( var i = 0; i < this.children.length; i++ ) { + if( this.children[i].onkeyup ) this.children[i].onkeyup(e) + } + }, + + draw : function() { + if(this.active) { + for(var i = 0; i < this.shouldDraw.length; i++) { + this.shouldDraw[i].draw(); + } + this.shouldDraw.length = 0; + } + $.publish('/draw') + }, + + getWidgetWithName: function( name ) { + for(var i = 0; i < this.children.length; i++) { + if( this.children[i].name === name) { + return this.children[i]; + } + } + }, + + redoBoundaries : function() { + var offset = $(this.container).offset(); + this.width = $(this.container).width(); + this.height = $(this.container).height(); + this.x = offset.left; + this.y = offset.top; + + if( isNaN(this.x) ) this.x = 0; + if( isNaN(this.y) ) this.y = 0; + + $(this.canvas).attr({ + 'width': this.width, + 'height': this.height, + }); + + this.ctx.translate(0.5, 0.5); + this.ctx.lineWidth = 1; + + this.refresh(); + }, + + refresh: function() { + if(this.active) { + this.ctx.clearRect(0,0,this.canvas.width, this.canvas.height); + for(var i = 0; i < this.children.length; i++) { + this.children[i].draw(); + } + } + }, + + add: function() { + for(var i = 0; i < arguments.length; i++) { + var widget = arguments[i]; + + widget.panel = this; + widget.canvas = this.canvas; + widget.container = this.container; + widget.ctx = this.ctx; + + this.children.push( widget ); + if(widget._init && !widget.added) widget._init(); + + if(widget.oninit && !widget.added) widget.oninit(); + + widget.draw(); + widget.added = true; + + if(typeof widget.add === 'function') widget.add(); + } + }, + + clear : function() { + this.ctx.clearRect( 0,0,this.width,this.height ); + this.children.length = 0; + }, + remove: function(widget) { + this.ctx.clearRect( widget._x(), widget._y(), widget._width(), widget._height() ); + + if(typeof widget.children !== 'undefined' && widget.type !== "XY") { + for(var i = 0; i < widget.children.length; i++) { + this.children.splice( this.children.indexOf( widget.children[i] ), 1 ); + Interface.widgets.splice( Interface.widgets.indexOf( widget.children[i] ), 1 ); + } + }else{ + if(this.children.indexOf( widget ) > -1) { + this.children.splice( this.children.indexOf( widget ), 1 ); + Interface.widgets.splice( Interface.widgets.indexOf( widget ), 1 ); + if(typeof widget.remove === 'function') widget.remove(); + } + } + }, + }); + + if(typeof arguments[0] !== 'undefined') Interface.extend(this, arguments[0]); + if(this.backgroundColor) this.setBackgroundColor( this.backgroundColor ); + + this.init(); + + this.timer = setInterval( function() { self.draw(); }, Math.round(1000 / this.fps) ); + + var childBackground ='#000', + childFill = '#666', + childStroke = '#999', + background = 'transparent', + self = this, + useRelativeSizesAndPositions = this.useRelativeSizesAndPositions; + + Object.defineProperties(this, { + 'useRelativeSizesAndPositions' : { + get: function() { return useRelativeSizesAndPositions; }, + set: function(val) { + if(val !== useRelativeSizesAndPositions) { + useRelativeSizesAndPositions = val; + if(val === false) { + for(var i = 0; i < this.children.length; i++) { + var child = this.children[i]; + child.bounds = [ + Math.round( child.x * this.width ), + Math.round( child.y * this.height ), + Math.round( child.width * this.width ), + Math.round( child.height * this.height ), + ]; + } + }else{ + for(var i = 0; i < this.children.length; i++) { + var child = this.children[i]; + child.bounds = [ + child.x / this.width, + child.y / this.height, + child.width / this.width, + child.height / this.height, + ]; + } + } + } + this.refresh(); + }, + }, + 'background': { + get: function() { return background; }, + set: function(val) { + background = val; + $(this.container).css({ backgroundColor:background }); + }, + }, + 'childBackground': { + get: function() { return childBackground; }, + set: function(val) { + childBackground = val; + self.refresh(); + }, + }, + 'childStroke': { + get: function() { return childStroke; }, + set: function(val) { + childStroke = val; + self.refresh(); + }, + }, + 'childFill': { + get: function() { return childFill; }, + set: function(val) { + childFill = val; + self.refresh(); + }, + } + }); + if(arguments[0]) { + if(arguments[0].childBackground) this.childBackground = arguments[0].childBackground; + if(arguments[0].childFill) this.childFill = arguments[0].childFill; + if(arguments[0].childStroke) this.childStroke = arguments[0].childStroke; + } + Interface.panels.push( this ); +}; + +var convertMouseEvent = function(eventName) { + switch(eventName) { + case 'mousedown': + return 'touchmousedown'; + case 'mousemove': + return 'touchmousemove'; + case 'mouseup': + return 'touchmouseup'; + default: + return eventName; + } +}; + +var convertTouchEvent = function(eventName) { + switch(eventName) { + case 'touchstart': + return 'touchmousedown'; + case 'touchmove': + return 'touchmousemove'; + case 'touchend': + return 'touchmouseup'; + default: + return eventName; + } +}; + +/**#Interface.Widget - Widget +The prototype object for all Interface.js widgets. These methods and properties are inherited by all widgets. +**/ + +/**###Interface.Widget.x : property +Number. The horizontal position of the widget inside of its parent panel. By default, this position is determined relative to the size of the widget's containing panel, but absolute values can also be used if the panel's useRelativeSizesAndPositions property is set to false. +**/ +/**###Interface.Widget.y : property +Number. The vertical position of the widget inside of its parent panel. By default, this position is determined relative to the size of the widget's containing panel, but absolute values can also be used if the panel's useRelativeSizesAndPositions property is set to false. +**/ +/**###Interface.Widget.width : property +Number. The width of the widget. By default, this is determined relative to the size of the widget's containing panel, but absolute values can also be used if the panel's useRelativeSizesAndPositions property is set to false. +**/ +/**###Interface.Widget.height : property +Number. The width of the widget. By default, this is determined relative to the size of the widget's containing panel, but absolute values can also be used if the panel's useRelativeSizesAndPositions property is set to false. +**/ +/**###Interface.Widget.bounds : property +Array. A shorthand to set x,y,width and height simultaneously upon initialization. By default, these values are determined relative to the size of the widget's containing panel, but absolute values can also be used if the panel's useRelativeSizesAndPositions property is set to false. +**/ +/**###Interface.Widget.min : property +Number. Default 0. The minimum value the widget should output. +**/ +/**###Interface.Widget.max : property +Number. Default 1. The maximum value the widget should output. +**/ +/**###Interface.Widget.ontouchstart : method +Function. A user defined event handler for whenever a touch begins over a widget. +**/ +/**###Interface.Widget.ontouchmove : method +Function. A user defined event handler for whenever a touch moves over a widget. +**/ +/**###Interface.Widget.ontouchend : method +Function. A user defined event handler for whenever a touch ends. +**/ +/**###Interface.Widget.onmousedown : method +Function. A user defined event handler for whenever a mouse press occurs over a widget. +**/ +/**###Interface.Widget.onmousemove : method +Function. A user defined event handler for whenever a mouse moves over a widget while its button is pressed. +**/ +/**###Interface.Widget.onmouseup : method +Function. A user defined event handler for whenever a mouse press ends. +**/ +/**###Interface.Widget.ontouchmousedown : method +Function. A user defined event handler for whenever a mouse press or touch occurs over a widget. +**/ +/**###Interface.Widget.ontouchmousemove : method +Function. A user defined event handler for whenever a mouse or touch moves over a widget. +**/ +/**###Interface.Widget.ontouchmouseup : method +Function. A user defined event handler for whenever a mouse press ends or a touch leaves the screen. +**/ + +/**###Interface.Widget.init : method +This method is called as soon as widgets are created. It copies properties passed in the constructor to the widget and also copies some default property values. + +param **options** Object. A dictionary of options for the widget to be initilized with. +**/ +/**###Interface.Widget.refresh : method +Tell the widget to redraw itself. This method adds the widget to the shouldDraw array of the parent panel. +**/ +/**###Interface.Widget.setValue : method +Programmatically change the value of the widget. You can optionally not have the widget redraw itself when calling this method. + +param **value** Number or String. The new value for the widget. +param **doNotDraw** Optional, default false. Whether or not the widget should redraw itself. +**/ +/**###Interface.Widget.hitTest : method +Given an HTML touch or mouse event, determine if the event overlaps a graphical widget. + +param **event** HTMLEvent. The touch or mouse event to check +**/ +/**###Interface.Widget.hitTest : method +Given an HTML touch or mouse event, determine if the event overlaps a graphical widget. + +param **event** HTMLEvent. The touch or mouse event to check +**/ +/**###Interface.Widget.draw : method +Tell the widget to draw itself. This method must be overridden by every graphical widget. +**/ +/**###Interface.Widget.mouseEvent : method +The default mouse event handler for the widget. This method also calls any user defined mouse event handlers. This method should probably never be called manually, but you might want to override it. + +param **event** HTMLEvent. The mouse event to process +**/ +/**###Interface.Widget.mouseEvent : method +The default touch event handler for the widget. This method also calls any user defined touch event handlers. This method should probably never be called manually, but you might want to override it. + +param **event** HTMLEvent. The touch event to process +**/ +/**###Interface.Widget.sendTargetMessage : method +If the widget has a target and key property, set the key property or call the key method on the target using the widgets current value. +**/ +/**###Interface.Widget._background : method +returns Color. If the widget has a background color specified, return that, otherwise return the background color of the widget's parent panel. +**/ +/**###Interface.Widget._stroke : method +returns Color. If the widget has a stroke color specified, return that, otherwise return the stroke color of the widget's parent panel. +**/ +/**###Interface.Widget._fill : method +returns Color. If the widget has a fill color specified, return that, otherwise return the fill color of the widget's parent panel. +**/ + +/**###Interface.Widget._x : method +returns Number. Return the widget's x position as a pixel value relative to the position of the panel. Note that this method will always return the pixel value, even if the panel uses relative values to determine sizes and positions. +**/ +/**###Interface.Widget._y : method +returns Number. Return the widget's y position as a pixel value relative to the position of the panel. Note that this method will always return the pixel value, even if the panel uses relative values to determine sizes and positions. +**/ +/**###Interface.Widget._width : method +returns Number. Return the widget's width. Note that this method will always return a size in pixels, even if the panel uses relative values to determine sizes and positions. +**/ +/**###Interface.Widget._height : method +returns Number. Return the widget's height. Note that this method will always return a size in pixels, even if the panel uses relative values to determine sizes and positions. +**/ +var __widgetCount = 0; +var widgetDefaults = { + hasFocus : false, + requiresFocus : true, + min : 0, + max : 1, + value : 0, + lastValue : null, + name : null, + events : { + ontouchstart : null, + ontouchmove : null, + ontouchend : null, + onmousedown : null, + onmousemove : null, + onmouseup : null, + ontouchmousedown : null, + ontouchmousemove : null, + ontouchmouseup : null, + onvaluechange : null, + onboundschange : null, + }, +} +Interface.Widget = { + init : function( options ) { + this.added = false; + Interface.extend( this, widgetDefaults); + if( typeof options === 'undefined' ) options = {} + + this.name = options.name || this.type + "_" + __widgetCount++; + this.target = "OSC"; + this.key = "/" + this.name; + + Interface.extend( this, options); + + if(this.bounds) { + this.x = options.bounds[0]; + this.y = options.bounds[1]; + this.width = options.bounds[2]; + this.height = options.bounds[3]; + } + + if(this.colors) { + this.background = options.colors[0]; + this.fill = options.colors[1]; + this.stroke = options.colors[2]; + } + + this.focusedTouches = []; + + if(this.value) this.setValue(this.value, true); + + var bounds = this.bounds || [this.x, this.y, this.width, this.height], + x = this.x, y = this.y, width = this.width, height = this.height, value = this.value; + + Object.defineProperties(this, { + bounds : { + configurable: true, + get : function() { return bounds; }, + set : function(_bounds) { + bounds = _bounds; this.x = bounds[0]; this.y = bounds[1]; this.width = bounds[2]; this.height = bounds[3]; + if( this.onboundschange ) this.onboundschange() + } + }, + x : { + configurable: true, + get : function() { return x; }, + set : function(val) { this.clear(); x = val; if( this.onboundschange ) this.onboundschange(); this.refresh(); }, + }, + y : { + configurable: true, + get : function() { return y; }, + set : function(val) { this.clear(); y = val; if( this.onboundschange ) this.onboundschange(); this.refresh(); }, + }, + width : { + configurable: true, + get : function() { return width; }, + set : function(val) { this.clear(); width = val; if( this.onboundschange ) this.onboundschange(); this.refresh(); }, + }, + height : { + configurable: true, + get : function() { return height; }, + set : function(val) { this.clear(); height = val; if( this.onboundschange ) this.onboundschange(); this.refresh(); }, + }, + /*value : { + configurable: true, + get : function() { return value; }, + set : function(val) { if(value !== val) { value = val; this.refresh(); } }, + },*/ + }); + + Interface.widgets.push( this ); + }, + + clear : function() { + if( this.panel ) { // must check in case widget is Acc or Gyro + this.panel.ctx.clearRect( this._x(), this._y(), this._width(), this._height() ); + } + }, + + refresh : function() { + if(this.panel && this.panel.shouldDraw.indexOf(this) === -1) { + this.panel.shouldDraw.push(this); + } + }, + + setValue : function(value, doNotDraw) { + var r = this.max - this.min, + v = value; + + this.value = value; + + if(this.min !== 0 || this.max !== 1) { + v -= this.min; + this._value = v / r; + }else{ + this._value = this.value; + } + + if(!doNotDraw) this.refresh(); + }, + + hitTest : function(e) { + if(e.x >= this._x() && e.x <= this._x() + this._width()) { + if(e.y >= this._y() && e.y <= this._y() + this._height()) { + return true; + } + } + + return false; + }, + + mouseEvent : function(e) { + var isHit = this.hitTest(e); + var touchMouseName = convertMouseEvent(e.type); + + if(isHit || this.hasFocus || !this.requiresFocus) { + if(e.type === 'mousedown') this.hasFocus = true; + + if(this[e.type]) this[e.type](e, isHit); // normal event + + if(this['on'+e.type]) this['on'+e.type](e, isHit); // user defined event + if(this['on'+touchMouseName]) this['on'+touchMouseName](e, isHit); // user defined event + } + if(e.type === 'mouseup') this.hasFocus = false; + }, + + touchEvent : function(touch) { // event type is stored in touch by Panel + var isHit = this.hitTest(touch); + var touchMouseName = convertTouchEvent(touch.type); + if(isHit || this.hasFocus || !this.requiresFocus) { + if(touch.type === 'touchstart') { + this.focusedTouches.push(touch); + this.hasFocus = true; + } + if(this[touch.type]) + this[touch.type](touch, isHit); // normal event + + if(this['on'+touch.type]) this['on'+touch.type](touch, isHit); // user defined event + if(this['on'+touchMouseName]) this['on'+touchMouseName](touch, isHit); // user defined event + } + if(touch.type === 'touchend') { + for(var i = 0; i < this.focusedTouches.length; i++) { + if(this.focusedTouches[i].id === touch.id) { + this.focusedTouches.splice(i, 1); + if(this.focusedTouches.length === 0) this.hasFocus = false; + break; + } + } + } + }, + + draw : function() {}, + + sendTargetMessage : function() { + if(this.target && this.key) { + if(this.target === "OSC") { + if(Interface.OSC) { + if(typeof this.values === 'undefined') { + var tt = typeof this.value === 'string' ? 's' : 'f'; + Interface.OSC.send(this.key, tt, [ this.value ] ); + }else{ + if(typeof this.sendValues === 'undefined') { + var tt = ''; + for(var i = 0; i < this.values.length; i++) { + tt += typeof this.value === 'string' ? 's' : 'f'; + } + Interface.OSC.send( this.key, tt, this.values ); + }else{ + this.sendValues(); + } + } + } + }else if(this.target === "MIDI") { + if(Interface.MIDI && typeof this.values === 'undefined') { + Interface.MIDI.send( this.key[0],this.key[1],this.key[2], this.value ) + } + }else if( this.target === 'WebSocket' ){ + var msg = { + type : "socket", + address: this.key, + } + var values + + if( Interface.Socket ) { + if(typeof this.values === 'undefined') { + values = [ this.value ] + }else{ + if(typeof this.sendValues === 'undefined') { + values = [ this.values ] + }else{ + this.sendValues() + return + } + } + msg.parameters = values + Interface.Socket.send( JSON.stringify( msg ) ); + } + + }else{ + if(typeof this.target[this.key] === 'function') { + this.target[this.key]( this.values || this.value ); + }else{ + this.target[this.key] = this.values || this.value; + } + } + } + }, + + _background : function() { return this.background || this.panel.childBackground; }, + _stroke : function() { return this.stroke || this.panel.childStroke; }, + _fill : function() { return this.fill || this.panel.childFill; }, + + _x : function() { return this.panel.useRelativeSizesAndPositions ? Math.floor(this.x * this.panel.width) : this.x; }, + _y : function() { return this.panel.useRelativeSizesAndPositions ? Math.floor(this.y * this.panel.height) : this.y; }, + _width : function() { return this.panel.useRelativeSizesAndPositions ? Math.floor(this.width * this.panel.width) : this.width; }, + _height : function() { return this.panel.useRelativeSizesAndPositions ? Math.floor(this.height * this.panel.height) : this.height; }, + + _font : function() { + var font = this.font || this.panel.font; + + return font; + }, + label:null, + + _serializeMe : [ + "background", "stroke", "fill", "x", "y", "width", "height", "value", + "label", "onmousedown", "onmousemove", "onmouseup", "ontouchmousedown", "ontouchmousemove", "ontouchmouseup", + "ontouchstart", "ontouchmove", "ontouchend", "onvaluechange", "name", "type", "target", "key" + ], +}; + + +Interface.HBox = function() { + var me = this + Interface.extend(this, { + type : 'HBox', + + children: [], + proxyPanel : { active:true, x:0, y:0, width:1, height:1, shouldDraw:[], useRelativeSizesAndPositions:true }, // needed for absolute widths / heights which are set in _init call + + add: function() { + for( var i = 0; i < arguments.length; i++ ) { + var child = arguments[ i ] + if( this.children.indexOf( child ) === -1 ) this.children.push( child ) + child.panel = this.proxyPanel + child.ctx = this.panel.ctx + } + + this.layout() + this.draw() + }, + + layout : function() { + var w = (this.width / this.children.length) / this.width, + _widthUsed = 0; + + for( var i = 0; i < this.children.length; i++ ) { + var child = this.children[ i ] + + child.x = _widthUsed + this.x + child.y = this.y * (1 / this.height) + + child.width = w + child.height = 1 + + _widthUsed += w + } + return this + }, + + draw: function() { + this.proxyPanel.width = this._width() + this.proxyPanel.height = this._height() + + for( var i = 0; i < this.children.length; i++ ) { + this.children[ i ].draw() + } + }, + + refresh: function() { + for( var i = 0; i < this.proxyPanel.shouldDraw.length; i++ ) { + this.proxyPanel.shouldDraw[ i ].draw() + } + this.proxyPanel.shouldDraw.length = 0 + }, + + mouseEvent: function(e){ + // e.x -= this._x() + // e.y -= this._y() + for( var i = 0; i < this.children.length; i++ ) { + var child = this.children[ i ] + + this.children[ i ].mouseEvent( e ) + } + }, + + touchEvent: function(e){ + // e.x -= this._x() + // e.y -= this._y() + for( var i = 0; i < this.children.length; i++ ) { + var child = this.children[ i ] + + this.children[ i ].touchEvent( e ) + } + }, + + _init: function() { + this.useRelativeSizesAndPositions = this.panel.useRelativeSizesAndPositions + this.proxyPanel.width = this._width() + this.proxyPanel.height = this._height() + this.proxyPanel.__proto__ = this.panel + + $.subscribe('/draw', this.refresh.bind( this ) ) + + Object.defineProperties(this, { + bounds : { + configurable: true, + get : function() { return bounds; }, + set : function(_bounds) { + bounds = _bounds; this.x = bounds[0]; this.y = bounds[1]; this.width = bounds[2]; this.height = bounds[3]; + this.layout() + this.draw() + } + }, + }) + } + }) + .init( arguments[0] ) +}; +Interface.HBox.prototype = Interface.Widget; + +Interface.VBox = function() { + Interface.extend(this, { + type : 'VBox', + + children: [], + proxyPanel : { active:true, x:0, y:0, width:1, height:1, shouldDraw:[], useRelativeSizesAndPositions:true }, // needed for absolute widths / heights which are set in _init call + + add: function() { + for( var i = 0; i < arguments.length; i++ ) { + var child = arguments[ i ] + this.children.push( child ) + child.panel = this.proxyPanel + child.ctx = this.panel.ctx + } + + this.layout() + this.draw() + }, + + layout : function() { + var h = this.height / this.children.length, + _heightUsed = 0; + + for( var i = 0; i < this.children.length; i++ ) { + var child = this.children[ i ] + + child.x = this.x + child.y = (this.y + _heightUsed ) * (1 / this.height) + // + child.width = 1 + child.height = h * ( 1/this.height) + + _heightUsed += h + } + + return this + }, + + draw: function() { + this.proxyPanel.width = this._width() + this.proxyPanel.height = this._height() + + for( var i = 0; i < this.children.length; i++ ) { + this.children[ i ].draw() + } + }, + + refresh: function() { + for( var i = 0; i < this.proxyPanel.shouldDraw.length; i++ ) { + this.proxyPanel.shouldDraw[ i ].draw() + } + this.proxyPanel.shouldDraw.length = 0 + }, + + mouseEvent: function(e){ + // e.x -= this._x() + // e.y -= this._y() + for( var i = 0; i < this.children.length; i++ ) { + var child = this.children[ i ] + + this.children[ i ].mouseEvent( e ) + } + }, + + touchEvent: function(e){ + e.x -= this._x() + e.y -= this._y() + for( var i = 0; i < this.children.length; i++ ) { + var child = this.children[ i ] + + this.children[ i ].touchEvent( e ) + } + }, + + _init: function() { + this.useRelativeSizesAndPositions = this.panel.useRelativeSizesAndPositions + this.proxyPanel.width = this._width() + this.proxyPanel.height = this._height() + this.proxyPanel.__proto__ = this.panel + + $.subscribe('/draw', this.refresh.bind( this ) ) + + Object.defineProperties(this, { + bounds : { + configurable: true, + get : function() { return bounds; }, + set : function(_bounds) { + bounds = _bounds; this.x = bounds[0]; this.y = bounds[1]; this.width = bounds[2]; this.height = bounds[3]; + this.layout() + this.draw() + } + }, + }) + } + }) + .init( arguments[0] ) +}; +Interface.VBox.prototype = Interface.Widget; + +/**#Interface.Image - Widget +A image drawn to the camera + +## Example Usage## +`a = new Interface.Image({ bounds:[0,0,.5,.5], file:'./test1.png' }); +panel = new Interface.Panel(); +panel.add(a); +` +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the slider on initialization. +- - - - +**/ + +Interface.Image = function() { + Interface.extend(this, { + type : 'Image', + image: null, + path: null, + _image: null, // for buffering images while loading + load : function( path ) { + this.path = path + this._image = new Image(); + this._image.src = this.path + this._image.onload = function() { + this.image = this._image + this.ctx.drawImage( this.image, this._x(), this._y() ); + }.bind( this ); + }, + _init: function() { + if( this.path ) { + this.load( this.path ) + } + }, + draw: function() { + if( this.image ) + this.ctx.drawImage( this.image, this._x(), this._y() ); + } + }).init( arguments[0] ) +} +Interface.Image.prototype = Interface.Widget; + +/**###Interface.Slider.load : method +String. Load a image at the provided path. +**/ + +/**#Interface.Slider - Widget +A vertical or horizontal slider. + +## Example Usage## +`a = new Interface.Slider({ bounds:[0,0,1,.2], isVertical:false }); +panel = new Interface.Panel(); +panel.add(a); +` +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the slider on initialization. +- - - - +**/ +/**###Interface.Slider.isVertical : property +Boolean. Whether or not the slider draws itself vertically or horizontally. Note this does not affect the boundaries of the slider, just the orientation of the slider's movement. +**/ + +Interface.Slider = function() { + Interface.extend(this, { + type : 'Slider', + isVertical : true, + serializeMe : ["isVertical"], + + draw : function() { + var x = this._x(), + y = this._y(), + width = this._width(), + height= this._height(); + + this.ctx.fillStyle = this._background(); + this.ctx.fillRect( x, y, width, height ); + + this.ctx.fillStyle = this._fill(); + + if(this.isVertical) { + this.ctx.fillRect( x, y + height - this._value * height, width, this._value * height); + }else{ + this.ctx.fillRect( x, y, width * this._value, height); + } + + if(this.label) { + this.ctx.fillStyle = this._stroke(); + this.ctx.textBaseline = 'middle'; + this.ctx.textAlign = 'center'; + this.ctx.font = this._font(); + this.ctx.fillText(this.label, x + width / 2, y + height / 2); + } + + this.ctx.strokeStyle = this._stroke(); + this.ctx.strokeRect( x, y, width, height ); + }, + + changeValue : function( xOffset, yOffset ) { + if(this.hasFocus || !this.requiresFocus) { + + this._value = this.isVertical ? 1 - (yOffset / this._height()) : xOffset / this._width(); + + if(this._value < 0) { + this._value = 0; + // this.hasFocus = false; + }else if(this._value > 1) { + this._value = 1; + // this.hasFocus = false; + } + + this.value = this.min + (this.max - this.min) * this._value; + + if(this.value !== this.lastValue) { + this.sendTargetMessage(); + if(this.onvaluechange) this.onvaluechange(); + this.refresh(); + this.lastValue = this.value; + } + } + }, + + mousedown : function(e, hit) { if(hit && Interface.mouseDown) this.changeValue( e.x - this._x(), e.y - this._y() ); }, + mousemove : function(e, hit) { if(hit && Interface.mouseDown) this.changeValue( e.x - this._x(), e.y - this._y() ); }, + mouseup : function(e, hit) { if(hit && Interface.mouseDown) this.changeValue( e.x - this._x(), e.y - this._y() ); }, + + touchstart : function(e, hit) { if(hit) this.changeValue( e.x - this._x(), e.y - this._y() ); }, + touchmove : function(e, hit) { if(hit) this.changeValue( e.x - this._x(), e.y - this._y() ); }, + touchend : function(e, hit) { if(hit) this.changeValue( e.x - this._x(), e.y - this._y() ); }, + }) + .init( arguments[0] ); +}; +Interface.Slider.prototype = Interface.Widget; + +/**#Interface.Crossfader - Widget +A horizontal crossfader. + +## Example Usage## +`a = new Interface.Crossfader({ bounds:[0,0,1,.2], crossfaderWidth:20 }); +panel = new Interface.Panel(); +panel.add(a); +` +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the crossfader on initialization. +- - - - +**/ +/**###Interface.Crossfader.crossfaderWidth : property +Boolean. The width of the rectangle indicating the current position of the crossfader, in pixel values. TODO: use relative values when used by the panel. +**/ +Interface.Crossfader = function() { + Interface.extend(this, { + type : 'Crossfader', + crossfaderWidth: 30, + serializeMe : ["crossfaderWidth"], + isVertical: false, + + _value : .5, + + draw : function() { + var x = this._x(), + y = this._y(), + width = this._width(), + height= this._height(); + + this.ctx.fillStyle = this._background(); + this.ctx.fillRect( x, y, width, height ); + + this.ctx.fillStyle = this._fill(); + if( this.isVertical ) { + this.ctx.fillRect( x, y + ( height - this.crossfaderWidth) * this._value, width, this.crossfaderWidth ); + }else{ + this.ctx.fillRect( x + (width - this.crossfaderWidth) * this._value, y, this.crossfaderWidth, height); + } + + if(this.label) { + this.ctx.fillStyle = this._stroke(); + this.ctx.textBaseline = 'middle'; + this.ctx.textAlign = 'center'; + this.ctx.font = this._font(); + this.ctx.fillText(this.label, x + width / 2, y + height / 2); + } + + this.ctx.strokeStyle = this._stroke(); + + this.ctx.strokeRect( x, y, width, height ); + }, + + changeValue : function( xOffset, yOffset ) { + if(this.hasFocus || !this.requiresFocus) { + if( this.isVertical ) { + this._value = yOffset / this._height(); + }else{ + this._value = xOffset / this._width(); + } + + if(this._value < 0) { + this._value = 0; + //this.hasFocus = false; + }else if(this._value > 1) { + this._value = 1; + //this.hasFocus = false; + } + + this.value = this.min + (this.max - this.min) * this._value; + + if( this.isVertical ) this.value *= -1 + + if(this.value !== this.lastValue) { + this.sendTargetMessage(); + if(this.onvaluechange) this.onvaluechange(); + this.refresh(); + this.lastValue = this.value; + } + } + }, + + mousedown : function(e) { this.changeValue( e.x - this._x(), e.y - this._y() ); }, + mousemove : function(e) { this.changeValue( e.x - this._x(), e.y - this._y() ); }, + mouseup : function(e) { this.changeValue( e.x - this._x(), e.y - this._y() ); }, + + touchstart : function(e, hit) { if(hit) this.changeValue( e.x - this._x(), e.y - this._y() ); }, + touchmove : function(e, hit) { if(hit) this.changeValue( e.x - this._x(), e.y - this._y() ); }, + touchend : function(e, hit) { if(hit) this.changeValue( e.x - this._x(), e.y - this._y() ); }, + }) + .init( arguments[0] ); +}; +Interface.Crossfader.prototype = Interface.Widget; + +/**#Interface.Button - Widget +A button with a variety of on/off modes + +## Example Usage## +`a = new Interface.Button({ bounds:[0,0,.25,.25], mode:'contact', label:'test' }); +panel = new Interface.Panel(); +panel.add(a); +` +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the button on initialization. +- - - - +**/ +/**###Interface.Button.mode : property +String. Can be 'toggle', 'momentary' or 'contact'. In toggle mode, the button turns on when it is pressed and off when it is pressed again. In momentary mode, the button turns on when pressed and off when released. In contact mode, the button briefly flashes when pressed and sends its value. +**/ +/**###Interface.Button.label : property +String. A text label to print in the center of the button. +**/ +Interface.Button = function() { + Interface.extend(this, { + type : 'Button', + _value: 0, + serializeMe : ["mode", "label"], + + mode : 'toggle', + isMouseOver : false, + isTouchOver : false, + label : null, + requiresFocus : false, + + draw : function() { + var x = this._x(), + y = this._y(), + width = this._width(), + height= this._height(); + + if(this._value) { + this.ctx.fillStyle = this._fill(); + }else{ + this.ctx.fillStyle = this._background(); + } + this.ctx.fillRect( x, y, width, height ); + + if(this.label !== null) { + this.ctx.fillStyle = this._stroke(); + this.ctx.textBaseline = 'middle'; + this.ctx.textAlign = 'center'; + this.ctx.font = this._font(); + this.ctx.fillText(this.label, x + width / 2, y + height / 2); + } + + this.ctx.strokeStyle = this._stroke(); + this.ctx.strokeRect( x, y, width, height ); + }, + + changeValue : function( xOffset, yOffset ) { + if(this.hasFocus || !this.requiresFocus) { + this._value = !this._value; + + this.value = this._value ? this.max : this.min; + + if(this.value !== this.lastValue || this.mode === 'contact') { + this.sendTargetMessage(); + if(this.onvaluechange) this.onvaluechange(); + this.draw(); + this.lastValue = this.value; + } + } + }, + setValue : function(value, doNotDraw) { + var r = this.max - this.min, + v = value; + + this.value = value; + + if(this.min !== 0 || this.max !== 1) { + v -= this.min; + this._value = v / r; + }else{ + this._value = this.value; + } + this.lastValue = this.value; + if(!doNotDraw && this.mode !== 'contact') this.refresh(); + }, + + mousedown : function(e, hit) { + if(hit && Interface.mouseDown) { + this.isMouseOver = true; + this.changeValue(); + if(this.mode === 'contact') { + var self = this; + setTimeout( function() { self._value = 0; self.draw(); }, 75); + } + } + }, + mousemove : function(e, hit) { + if(!this.requiresFocus && hit && Interface.mouseDown && !this.isMouseOver) { + this.isMouseOver = true; + if(this.mode !== 'contact') { + this.changeValue();// e.x - this.x, e.y - this.y ); + }else{ + this._value = 1; + this.draw(); + var self = this; + setTimeout( function() { self._value = 0; self.draw(); }, 75); + } + }else if(!hit && this.isMouseOver) { + console.log( 'moved off!' ) + this.isMouseOver = false; + } + }, + mouseup : function(e) { + if(this.mode === 'momentary') { + this.changeValue();// e.x - this.x, e.y - this.y ); + this.isMouseOver = false; + } + }, + + touchstart : function(e, hit) { + if(hit) { + this.isTouchOver = true; + this.changeValue(); + if(this.mode === 'contact') { + var self = this; + setTimeout( function() { self._value = 0; self.draw(); }, 75); + } + } + }, + touchmove : function(e, hit) { + if(!this.requiresFocus && hit && !this.isTouchOver) { + this.isTouchOver = true; + if(this.mode !== 'contact') { + this.changeValue();// e.x - this.x, e.y - this.y ); + + }else{ + this._value = 1; + this.draw(); + var self = this; + setTimeout( function() { self._value = 0; self.draw(); }, 75); + } + }else if(!hit && this.isTouchOver) { + this.isTouchOver = false; + } + }, + touchend : function(e) { + this.isTouchOver = false; + if(this.mode === 'momentary') + this.changeValue();// e.x - this.x, e.y - this.y ); + }, + }) + .init( arguments[0] ); +}; +Interface.Button.prototype = Interface.Widget; + + +/**#Interface.ButtonV - Widget +A button with a customizable shape and variety of on/off modes + +*contributed by Jonathan Simozar + +## Example Usage## +`a = new Interface.ButtonV({ + bounds:[.25,0,.125,.8], + points: [{x:1,y:0},{x:.5,y:0},{x:.5,y:.5},{x:0,y:.5},{x:0,y:1},{x:1,y:1},{x:1,y:0}], + mode:'contact', + label:'test', + textLocation : {x:.5, y:.75}, +}); + +panel = new Interface.Panel(); + +panel.add(a); +` + +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the button on initialization. +- - - - +**/ +/**###Interface.ButtonV.points : property +Array. A set of coordinates used to customize the button shape. The coordinates are connected in the order of the indices. The first and last point must be the same. +**/ + +/**###Interface.ButtonV.mode : property +String. Can be 'toggle', 'momentary' or 'contact'. In toggle mode, the button turns on when it is pressed and off when it is pressed again. In momentary mode, the button turns on when pressed and off when released. In contact mode, the button briefly flashes when pressed and sends its value. +**/ + +/**###Interface.ButtonV.label : property +String. A text label to print at the textLocation coordinates of the button. +**/ + +/**###Interface.ButtonV.textLocation : property +Set. A set of x and y coordinates which position the the label within the bounds. +**/ + +Interface.ButtonV = function() { + Interface.extend(this, { + type : 'ButtonV', + _value: 0, + serializeMe : ["mode", "label"], + + mode : 'toggle', + isMouseOver : false, + isTouchOver : false, + label : null, + points : [{x : 0, y : 0}, {x : 0, y : 1}, {x : 1,y : 1}, {x : 1, y : 0}, {x : 0, y : 0}], + textLocation : {x:.5, y:.5}, + + draw : function() { + var x = this._x(), + y = this._y(), + i = 0, + width = this._width(), + height= this._height(); + + + + if(this._value) { + this.ctx.fillStyle = this._fill(); + }else{ + this.ctx.fillStyle = this._background(); + } + + this.ctx.beginPath(); + this.ctx.strokeStyle = this._stroke(); + + + for (i; i < this.points.length; i++) { + if (i === 0) { + this.ctx.moveTo(x + this.points[i].x*width, y + this.points[i].y*height); + } + else + this.ctx.lineTo(x + this.points[i].x*width, y + this.points[i].y*height); + } //this.points[i].x is how to reference points.x + this.ctx.lineTo(x + this.points[0].x*width, y + this.points[0].y*height); + this.ctx.closePath(); + this.ctx.fill(); + this.ctx.stroke(); + + + if(this.label !== null) { + this.ctx.fillStyle = this._stroke(); + this.ctx.textBaseline = 'middle'; + this.ctx.textAlign = 'center'; + this.ctx.font = this._font(); + this.ctx.fillText(this.label, x + width*this.textLocation.x, y + height*this.textLocation.y); + } + + }, + + changeValue : function( xOffset, yOffset ) { + if(this.hasFocus || !this.requiresFocus) { + this._value = !this._value; + + this.value = this._value ? this.max : this.min; + + if(this.value !== this.lastValue || this.mode === 'contact') { + this.sendTargetMessage(); + if(this.onvaluechange) this.onvaluechange(); + this.draw(); + this.lastValue = this.value; + } + } + }, + + hitTest : function(e) { + var w = this._width(), + h = this._height(), + x = this._x(), + y = this._y(); + if(e.x >= x && e.x <= x + w) { + if(e.y >= y && e.y <= y + h) { + var i = 0, + p = this.points, + sides = 0; + + for (i; i < p.length - 1; i++) { + if(p[i+1].x > p[i].x) { + if((p[i].x * w + x) <= e.x && e.x < (p[i+1].x * w + x)) { + var yval = (p[i+1].y - p[i].y)/(p[i+1].x - p[i].x) * h/w * (e.x - p[i].x * w + x) + p[i].y * h + y; + if(yval - e.y < 0) + sides++; + } + } + else if (p[i+1].x < p[i].x) { + if(p[i].x * w + x >= e.x && e.x > p[i+1].x * w + x) { + var yval = (p[i+1].y - p[i].y)/(p[i+1].x - p[i].x) * h/w * (e.x - p[i].x * w + x) + p[i].y * h + y; + if(yval - e.y < 0) + sides++; + } + } + } + if (sides % 2 == 1) + return true; + } + } + return false; + }, + + + setValue : function(value, doNotDraw) { + var r = this.max - this.min, + v = value; + + this.value = value; + + if(this.min !== 0 || this.max !== 1) { + v -= this.min; + this._value = v / r; + }else{ + this._value = this.value; + } + this.lastValue = this.value; + if(!doNotDraw && this.mode !== 'contact') this.refresh(); + }, + + mousedown : function(e, hit) { + if(hit && Interface.mouseDown) { + this.isMouseOver = true; + this.changeValue(); + if(this.mode === 'contact') { + var self = this; + setTimeout( function() { self._value = 0; self.draw(); }, 75); + } + } + }, + mousemove : function(e, hit) { + if(!this.requiresFocus && hit && Interface.mouseDown && !this.isMouseOver) { + this.isMouseOver = true; + if(this.mode !== 'contact') { + this.changeValue();// e.x - this.x, e.y - this.y ); + }else{ + this._value = 1; + this.draw(); + var self = this; + setTimeout( function() { self._value = 0; self.draw(); }, 75); + } + }else if(!hit && this.isMouseOver) { + this.isMouseOver = false; + if(this.mode !== 'contact') { + this.changeValue();// e.x - this.x, e.y - this.y ); + }else{ + this._value = 1; + this.draw(); + var self = this; + setTimeout( function() { self._value = 0; self.draw(); }, 75); + } + } + }, + mouseup : function(e) { + if(this.mode === 'momentary') { + if( this.requiresFocus || ( !this.requiresFocus && this.isMouseOver) ) { + this.isMouseOver = false; + this.changeValue(); + } + } + }, + + touchstart : function(e, hit) { + if(hit) { + this.isTouchOver = true; + this.changeValue(); + if(this.mode === 'contact') { + var self = this; + setTimeout( function() { self._value = 0; self.draw(); }, 75); + } + } + }, + touchmove : function(e, hit) { + if(!this.requiresFocus && hit && !this.isTouchOver) { + this.isTouchOver = true; + if(this.mode !== 'contact') { + this.changeValue();// e.x - this.x, e.y - this.y ); + }else{ + this._value = 1; + this.draw(); + var self = this; + setTimeout( function() { self._value = 0; self.draw(); }, 75); + } + }else if(!hit && this.isTouchOver) { + this.isTouchOver = false; + if(this.mode !== 'contact') { + this.changeValue();// e.x - this.x, e.y - this.y ); + }else{ + this._value = 1; + this.draw(); + var self = this; + setTimeout( function() { self._value = 0; self.draw(); }, 75); + } + }else if(!hit && this.isTouchOver) { + this.isTouchOver = false; + } + }, + touchend : function(e) { + if( this.momentary && this.requiresFocus || ( !this.requiresFocus && this.isTouchOver) ) { + this.changeValue(); + } + this.isTouchOver = false; + }, + }) + .init( arguments[0] ); +}; +Interface.ButtonV.prototype = Interface.Widget; + + +/**#Interface.Piano - Widget +A piano with adjustable ranges of pitches + +*contributed by Jonathan Simozar, with modifications by thecharlie + +## Example Usage## +`var c = new Interface.Piano({ + bounds:[0,0,.8,.5], + startletter : "C", + startoctave : 3, + endletter : "C", + endoctave : 5, + noteLabels : true, + target: synth, + onvaluechange : function() {this.target.note (this.frequency, this.value)}, +}); +panel = new Interface.Panel(); +panel.add(a); +` + +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the piano on initialization. +- - - - +**/ + + +/**###Interface.Piano.onvaluechange : method +The event handler fired whenever a piano update is received. Used to fire the the event handler for when a button update is recieved. +**/ + + +/**###Interface.Piano.endoctave : property +Number. A number corresponding to the ending octave of the last note in the desired range. +**/ + +/**###Interface.Piano.startletter : property +String. A letter corresponding to the starting pitch for the desired range. To start on an accidental use sharps, not flats. For example, C#. +**/ + +/**###Interface.Piano.startoctave : property +Number. A number corresponding to the starting octave of the first note in the desired range. +**/ + +/**###Interface.Piano.endletter : property +String. A letter corresponding to the ending pitch for the desired range. To end on an accidental use sharps, not flats. For example, C#. +**/ + +/**###Interface.Piano.endoctave : property +Number. A number corresponding to the ending octave of the last note in the desired range. +**/ + +/**###Interface.Piano.noteLabels : property +Boolean. A boolean corresponding to showing the note labels when true and hiding the note labels when false. +**/ + +/**###Interface.Piano.target : property +Object. The instrument used to make sound on each key. +**/ + + + +Interface.Piano = function() { + Interface.extend(this, { + type : 'Piano', + _value: 0, + serializeMe : ['mode', 'label'], + mode : 'toggle', + isMouseOver : false, + isTouchOver : false, + label : null, + startletter : 'C', + startoctave : 3, + endletter : 'C', + endoctave : 5, + target : null, + noteLabels : false, + _initialized : false, + keyMap: [ 'Z','S','X','D','C','V','G','B','H','N','J','M',','], + children: [], + play: function( noteNum, duration ) { + if( isNaN(duration) ) { + duration = 4410 + } + if( typeof Gibber !== 'undefined' ) { duration = Gibber.Clock.time( duration ) } + + var child = this.children[ noteNum ] + if( child ) { + child.changeValue() + future( function() { if( child._value == 1 ) child.changeValue() }, duration ) + } + }, + onkeyup: function( e ) { + var c = Interface.keyCodeToChar[ e.keyCode ], + keyNum = this.keyMap.indexOf( c ), + child = this.children[ keyNum ] + + if( typeof child !== 'undefined' && child._value == 1 ) { + child.changeValue() + } + }, + onkeydown: function( e ) { + var c = Interface.keyCodeToChar[ e.keyCode ], + keyNum = this.keyMap.indexOf( c ), + child = this.children[ keyNum ] + + if( typeof child !== 'undefined' && child._value == 0 ) { + child.changeValue() + } + }, + //Math.pow(2,(startnote + 12*octave - 49)/12)*261.626 + //onvaluechange : function() { this.values = [this.frequency,this.value] }, + onvaluechange : function() { this.values = [Math.pow(2,(this.startnote + 12*this.octave - 49)/12)*261.626,this.value] }, + onboundschange: function() { if( this._initialized) this.placeKeys() }, + + draw : function() { + for( var i = 0; i < this.children.length; i++ ) { this.children[i].refresh() } + return this + }, + + placeKeys: function() { + var x = this._x(), + y = this._y(), + width = this._width(), + height = this._height(), + octave = this.startoctave, + startnote = 0, + endnote = 0, + keylabel = ["0","C","C#/Db","D","D#/Eb","E","F","F#/Gb","G","G#/Ab","A","A#/Bb","B"], + keyid = ["0","C","C#","D","D#","E","F","F#","G","G#","A","A#","B"], + keynid = [0, 1, 2, 2, 3, 3, 4, 5, 5, 6, 6, 7, 7], + notes = ( endnote + this.endoctave * 12) - (startnote + this.startoctave * 12) + 1, + dist = ( keynid[ endnote ] + this.endoctave * 7 ) - ( keynid[ startnote ] + this.startoctave * 7 ) + 1, + j = 0; + + if( this._initialized ) { + this.clear() + for( var i = this.children.length - 1; i >= 0; i-- ) { + var key = this.children.pop() + this.panel.remove( key ) + } + } + + for (var i = 1; i < 13; i++) { + if ( this.startletter === keyid[ i ] ) startnote = i; + if ( this.endletter === keyid[ i ] ) endnote = i; + } + + if ( [ 2,4,7,9,11 ].indexOf( endnote ) > -1 ) dist--; + + for (var i = 0; i < notes - 1; i++ ) { + var points, textLocation, bg, fg, bounds, label + + switch( startnote ) { + case 1: + points = [{x:0,y:0},{x:.6,y:0},{x:.6,y:.625},{x:1,y:.625},{x:1,y:1},{x:0,y:1},{x:0,y:0}] // left + bg = this._fill() + textLocation = { x:.5, y:.75 } + fg = this._background() + bounds = [ j/dist*this.width + this.x, this.y, this.width/dist, this.height ] + label = this.noteLabels ? keylabel[startnote] + octave : null + break; + case 2: + points = [{x:.1,y:0},{x:.7,y:0},{x:.7,y:1},{x:.1,y:1},{x:.1,y:0}] //black + textLocation = { x:.3925, y:.5 } + bg = this._background() + fg = this._fill() + bounds = [(j-.5)/dist *this.width + this.x, this.y,this.width/dist,.625*this.height] + label = this.noteLabels ? keylabel[startnote] : null + break; + case 3: + points = [{x:.2,y:0},{x:.8,y:0},{x:.8,y:.625},{x:1,y:.625},{x:1,y:1},{x:0,y:1},{x:0,y:.625},{x:.2,y:.625},{x:.2,y:0}] // mid + textLocation = { x:.5, y:.75 } + bg = this._fill() + fg = this._background() + bounds = [j/dist*this.width + this.x,this.y,this.width/dist,this.height] + label = this.noteLabels ? keylabel[startnote] : null + break; + case 4: + points = [{x:.3,y:0},{x:.9,y:0},{x:.9,y:1},{x:.3,y:1},{x:.3,y:0}], //black + textLocation = {x:.6075, y:.5} + bg = this._background() + fg = this._fill() + bounds = [(j-.5)/dist *this.width + this.x, this.y,this.width/dist,.625*this.height] + label = this.noteLabels ? keylabel[startnote] : null + break; + case 5: + points = [{x:1,y:0},{x:.4,y:0},{x:.4,y:.625},{x:0,y:.625},{x:0,y:1},{x:1,y:1},{x:1,y:0}] //right + textLocation = {x:.5, y:.75} + bg = this._fill() + fg = this._background() + bounds = [j/dist*this.width+ this.x,this.y,this.width/dist,this.height] + label = this.noteLabels ? keylabel[startnote] : null + break; + case 6: + points = [{x:0,y:0},{x:0.57142857,y:0},{x:0.57142857,y:.625},{x:1,y:.625},{x:1,y:1},{x:0,y:1},{x:0,y:0}] //left + textLocation = {x:.5, y:.75} + bg = this._fill() + fg = this._background() + bounds = [j/dist*this.width+ this.x,this.y,this.width/dist,this.height] + label = this.noteLabels ? keylabel[startnote] : null + break; + case 7: + points = [{x:0.07142857,y:0},{x:0.64285714,y:0},{x:0.64285714,y:1},{x:0.07142857,y:1},{x:0.07142857,y:0}] //black + textLocation = {x:.3925, y:.5} + bg = this._background() + fg = this._fill() + bounds = [(j-.5)/dist*this.width + this.x, this.y,this.width/dist,.625*this.height] + label = this.noteLabels ? keylabel[startnote] : null + break; + case 8: + points = [{x:0.14285714,y:0},{x:0.71428571,y:0},{x:0.71428571,y:.625},{x:1,y:.625},{x:1,y:1},{x:0,y:1},{x:0,y:.625},{x:0.14285714,y:.625},{x:0.14285714,y:0}], //middle + textLocation = {x:.5, y:.75} + bg = this._fill() + fg = this._background() + bounds = [j/dist*this.width + this.x,this.y,this.width/dist,this.height] + label = this.noteLabels ? keylabel[startnote] : null + break; + case 9: + points = [{x:0.21428571,y:0},{x:0.78571428,y:0},{x:0.78571428,y:1},{x:0.21428571,y:1},{x:0.21428571,y:0}] //black + bg = this._background() + fg = this._fill() + bounds = [(j-.5)/dist*this.width + this.x, this.y,this.width/dist,.625*this.height] + label = this.noteLabels ? keylabel[startnote] : null + break; + case 10: + points = [{x:0.28571428,y:0},{x:0.85714285,y:0},{x:0.85714285,y:.625},{x:1,y:.625},{x:1,y:1},{x:0,y:1},{x:0,y:.625},{x:0.28571428,y:.625},{x:0.28571428,y:0}], //middle + bg = this._fill() + fg = this._background() + textLocation = {x:.5, y:.75} + bounds = [j/dist*this.width + this.x,this.y,this.width/dist,this.height] + label = this.noteLabels ? keylabel[startnote] : null + break; + case 11: + points = [{x:0.35714285,y:0},{x:0.92857142,y:0},{x:0.92857142,y:1},{x:0.35714285,y:1},{x:0.35714285,y:0}], //black + bg = this._background() + fg = this._fill() + textLocation = {x:.6075, y:.5} + bounds = [(j-.5)/dist*this.width + this.x, this.y,this.width/dist,.625*this.height] + label = this.noteLabels ? keylabel[startnote] : null + break; + case 12: + points = [{x:1,y:0},{x:0.42857142,y:0},{x:0.42857142,y:.625},{x:0,y:.625},{x:0,y:1},{x:1,y:1},{x:1,y:0}] //right + bg = this._fill() + fg = this._background() + textLocation = {x:.5, y:.75} + bounds = [j/dist*this.width+ this.x,this.y,this.width/dist,this.height] + label = this.noteLabels ? keylabel[startnote] : null + break; + } + + + var _key = new Interface.ButtonV({ + points: points, + textLocation : textLocation, + target : this.target, + onvaluechange: this.onvaluechange, + 'startnote':startnote, + 'octave':octave, + frequency: Math.pow(2,(startnote + 12*octave - 49)/12)*261.626, + background: bg, + fill: fg, + stroke: this._stroke(), + bounds: bounds, + label: label, + requiresFocus : false, + mode:'momentary', + }); + + if ( [ 2,4,7,9,11 ].indexOf( startnote ) === -1 ) j++; + + this.children.push(_key) + this.panel.add(_key); + + startnote++; + + if (startnote > 12) { + startnote = 1; + octave++; + } + } + if (startnote == 2 || startnote == 4 || startnote == 7 || startnote == 9 || startnote == 11) + var pkeys = new Interface.ButtonV({ + points: [{x:.166,y:0},{x:.5,y:0},{x:.5,y:1},{x:.166,y:1},{x:.166,y:0}], //black + target : this.target, + onvaluechange: this.onvaluechange, + background: this._background(), + 'startnote':startnote, + 'octave':octave, + frequency: Math.pow(2,(startnote + 12*octave - 49)/12)*261.626, + bounds:[(j-.5)/dist*this.width + this.x, this.y,this.width/dist,.625*this.height], + label: this.noteLabels ? keylabel[startnote] : null, + stroke: this._stroke(), + requiresFocus : false, + mode:'momentary' + }); + else if (startnote == 1) + var pkeys = new Interface.ButtonV({ + textLocation : {x:.5, y:.75}, + target : this.target, + onvaluechange: this.onvaluechange, + 'startnote':startnote, + 'octave':octave, + frequency: Math.pow(2,(startnote + 12*octave - 49)/12)*261.626, + background: this._fill(), + fill: this._background(), + stroke: this._stroke(), + bounds:[j/dist*this.width + this.x,this.y,this.width/dist,this.height], + label: this.noteLabels ? keylabel[startnote] + octave : null, + requiresFocus : false, + mode:'momentary' + }); + else if (startnote == 4) + var pkeys = new Interface.ButtonV({ + textLocation : {x:.5, y:.75}, + target : this.target, + onvaluechange: this.onvaluechange, + 'startnote':startnote, + 'octave':octave, + frequency: Math.pow(2,(startnote + 12*octave - 49)/12)*261.626, + background: this._fill(), + fill: this._background(), + stroke: this._stroke(), + bounds:[j/dist*this.width + this.x,this.y,this.width/dist,this.height], + label: this.noteLabels ? keylabel[startnote] : null, + requiresFocus : false, + mode:'momentary' + }); + else + var pkeys = new Interface.ButtonV({ + points: [{x:1,y:0},{x:.33,y:0},{x:.33,y:.625},{x:0,y:.625},{x:0,y:1},{x:1,y:1},{x:1,y:0}], //right + textLocation : {x:.5, y:.75}, + target : this.target, + onvaluechange: this.onvaluechange, + 'startnote':startnote, + 'octave':octave, + frequency: Math.pow(2,(startnote + 12*octave - 49)/12)*261.626, + background: this._fill(), + fill: this._background(), + stroke: this._stroke(), + bounds:[j/dist*this.width + this.x,this.y,this.width/dist,this.height], + label: this.noteLabels ? keylabel[startnote] : null, + requiresFocus : false, + mode:'momentary' + }); + + this.children.push(pkeys) + this.panel.add(pkeys); + + this._initialized = true + }, + _init : function() { + this.placeKeys() + } + }) + .init( arguments[0] ); +}; +Interface.Piano.prototype = Interface.Widget; + + + +/**#Interface.Knob - Widget +A virtual knob. + +## Example Usage## +`a = new Interface.Knob({ x:.1, y:.1, radius:.3 }); +panel = new Interface.Panel(); +panel.add(a); +` +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the knob on initialization. +- - - - +**/ +/**###Interface.Knob.radius : property +Number. The size of the Knob. +**/ +/**###Interface.Knob.knobBuffer : property +Number. The size of the space in the middle of the knob. +**/ +/**###Interface.Knob.centerZero : property +Number. If true, the knob is centered at zero. Useful for panning knobs. +**/ +/**###Interface.Knob.usesRotation : property +Number. If true, the knob value is determined by the slope of the touch or mouse event in relation to the knob. When false, the user simply presses the knob and moves their finger/mouse up and down to change its value. +**/ + +Interface.Knob = function() { + Interface.extend(this, { + type : 'Knob', + _value: 0, + serializeMe : ["usesRotation", "knobBuffer"], + knobBuffer:3, + lastPosition: 0, + usesRotation: true, + + draw : function() { + var x = this._x(), + y = this._y(), + width = this._width(), + height= this._height(), + radius = width / 2; + + this.ctx.clearRect(x, y, radius * 2,radius * 2); + this.ctx.strokeStyle = this._stroke(); + + this.ctx.fillStyle = this._background(); // draw background of widget first + + var angle0 = Math.PI * .6; + var angle1 = Math.PI * .4; + + this.ctx.beginPath(); + + this.ctx.arc(x + radius, y + radius, radius - this.knobBuffer, angle0, angle1, false); + this.ctx.arc(x + radius, y + radius, (radius - this.knobBuffer) * .3 , angle1, angle0, true); + this.ctx.closePath(); + this.ctx.fill(); + + this.ctx.fillStyle = this._fill(); // now draw foreground... + + if(this.centerZero) { + var angle3 = Math.PI * 1.5; + var angle4; + if(this._value >= .5) { + angle4 = Math.PI * (1.5 + (this._value - .5) * 1.8); // from 1.5 to 2.4 + }else{ + angle4 = Math.PI * (1.5 - ((1 - this._value * 2) * .9)); // from 1.5 to .6 + } + if(this._value > Math.PI * 1.8) this._value -= Math.PI * 1.8; // wrap around + + this.ctx.beginPath(); + this.ctx.arc(x + radius, y + radius, radius - this.knobBuffer, angle3, angle4, (this._value < .5)); + this.ctx.arc(x + radius, y + radius, (radius - this.knobBuffer) * 0.3, angle4, angle3, (this._value > .5)); + this.ctx.closePath(); + + // if(this._value > .495 && this._value < .505) { // draw circle if centered? + // this.ctx.beginPath(); + // this.ctx.arc(this.x + radius , this.y + radius, (radius - this.knobBuffer) * .3, 0, Math.PI*2, true); + // this.ctx.closePath(); + // } + this.ctx.fill(); + } else { + if(!this.isInverted) { + var angle2 = Math.PI * .6 + this._value * 1.8 * Math.PI; + if(angle2 > 2 * Math.PI) angle2 -= 2 * Math.PI; + }else{ + var angle2 = Math.PI * (0.4 - (1.8 * this._value)); + } + + this.ctx.beginPath(); + + if(!this.isInverted) { + this.ctx.arc(x + radius, y + radius, radius - this.knobBuffer, angle0, angle2, false); + this.ctx.arc(x + radius, y + radius, (radius - this.knobBuffer) * .3, angle2, angle0, true); + } else { + this.ctx.arc(x + radius, y + radius, radius - this.knobBuffer, angle1, angle2 ,true); + this.ctx.arc(x + radius, y + radius, (radius - this.knobBuffer) * .3, angle2, angle1, false); + } + this.ctx.closePath(); + this.ctx.fill(); + } + + this.ctx.beginPath(); + this.ctx.arc(x + radius, y + radius, radius - this.knobBuffer, angle0, angle1, false); + this.ctx.arc(x + radius, y + radius, (radius - this.knobBuffer) * .3 , angle1, angle0, true); + this.ctx.closePath(); + + this.ctx.stroke(); + + if(this.label !== null) { + this.ctx.fillStyle = this._stroke(); + this.ctx.textBaseline = 'middle'; + this.ctx.textAlign = 'center'; + this.ctx.font = this._font(); + this.ctx.fillText(this.label, x + radius, y + radius * 2.25); + } + }, + + setValue : function(value, doNotDraw) { + var r = this.max - this.min, + v = value; + + this.lastValue = this.value; + + this.value = value; + + if(this.min !== 0 || this.max !== 1) { + v -= this.min; + this._value = v / r; + }else{ + this._value = this.value; + } + + if(this.value !== this.lastValue) { + this.sendTargetMessage(); + if(this.onvaluechange) this.onvaluechange(); + this.refresh(); + this.lastValue = this.value; + } + + if(!doNotDraw) this.refresh(); + }, + + changeValue : function( xOffset, yOffset ) { + if(this.hasFocus || !this.requiresFocus) { + var radius = this._width() / 2; + this.lastValue = this.value; + + if(!this.usesRotation) { + if (this.lastPosition != -1) { + this._value -= (yOffset - this.lastPosition) / (radius * 2); + } + }else{ + var xdiff = radius - xOffset; + var ydiff = radius - yOffset; + var angle = Math.PI + Math.atan2(ydiff, xdiff); + this._value = ((angle + (Math.PI * 1.5)) % (Math.PI * 2)) / (Math.PI * 2); + + if(this.lastRotationValue > .8 && this._value < .2) { + this._value = 1; + }else if(this.lastRotationValue < .2 && this._value > .8) { + this._value = 0; + } + } + + if (this._value > 1) this._value = 1; + if (this._value < 0) this._value = 0; + + this.lastRotationValue = this._value; + this.lastPosition = yOffset; + + var range = this.max - this.min; + this.value = this.min + this._value * range; + + if(this.value !== this.lastValue) { + this.sendTargetMessage(); + if(this.onvaluechange) this.onvaluechange(); + this.refresh(); + this.lastValue = this.value; + } + } + }, + + hitTest : function(e) { + if( e.x >= this._x() && e.x < this._x() + this._width() ) { + if( e.y >= this._y() && e.y < this._y() + this._width() ) { + return true; + } + } + + return false; + }, + + mousedown : function(e) { + this.lastPosition = e.y - this._y(); + this.changeValue( e.x - this._x(), e.y - this._y() ); + }, + mousemove : function(e) { this.changeValue( e.x - this._x(), e.y - this._y() ); }, + mouseup : function(e) {}, + + touchstart : function(e) { + this.lastPosition = e.y - this._y(); + this.changeValue( e.x - this._x(), e.y - this._y() ); + }, + touchmove : function(e) { this.changeValue( e.x - this._x(), e.y - this._y() ); }, + touchend : function(e) {}, + + _init : function() { + var width = this.width, + height = this.height; + Object.defineProperty(this, 'width', { + configurable: true, + get : function() { return width; }, + set : function(_width) { this.clear(); width = height = _width; this.refresh(); } + }); + Object.defineProperty(this, 'height', { + configurable: true, + get : function() { return height; }, + set : function(_height) { height = _height; } + }); + }, + }) + .init( arguments[0] ); +}; +Interface.Knob.prototype = Interface.Widget; + +function sign(n) { + if(n < 0) return -1; + return 1; +} +/**#Interface.XY - Widget +A multitouch XY controller with optional built-in physics. + +## Example Usage## +`a = new Interface.XY({ x:0, y:0, numChildren:2 }); +panel = new Interface.Panel(); +panel.add(a); +` +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the XY on initialization. +- - - - +**/ +/**###Interface.XY.childWidth : property +Number. The size of the children, currently in pixels. TODO: use relative values when the panel is using relative sizes and positions. +**/ +/**###Interface.XY.usePhysics : property +Boolean. Wheter or not the physics engine should be turned on. +**/ +/**###Interface.XY.friction : property +Number. Default .9. The amount of friction in the physics system. High values mean children will decelerate quicker. +**/ +/**###Interface.XY.maxVelocity : property +Number. Default 10. The maximum velocity for each child. +**/ +/**###Interface.XY.detectCollisions : property +Boolean. Default true. When true, children bounce off one another. +**/ +/**###Interface.XY.values : property +Array. An array of objects taking the form {x,y} that store the x and y positions of every child. So, to get the x position of child #0: myXY.values[0].x +**/ +/**###Interface.XY.children : property +Array. An array of objects representing the various children of the widget. +**/ +/**###Interface.XY.animate : method +This is called to run the physics engine, draw widgets with updated positions, change values of widgets and call appropriate event handlers. +**/ + +Interface.XY = function() { + var self = this, + posDiff = {x:0, y:0}, + velDiff = {x:0, y:0}, + normal = {x:0, y:0}, + cDot = 0; + + Interface.extend(this, { + type : 'XY', + _value : 0, + serializeMe : ["childWidth", "childHeight", "numChildren", "usePhysics", "values", "friction", "maxVelocity", "detectCollisions", "fps", "childIds"], + childWidth : 25, + childHeight : 25, + children : [], + childIds : [], // optional names of children + values : [], // objects containing x and y values + _values : [], // serialized floats alternating between x and y + numChildren : 1, + usePhysics : true, + friction : .9, + activeTouch : null, + maxVelocity : 10, + detectCollisions : true, + touchCount : 0, + timer : null, + fps : 30, + outputInitialValues: true, + + rainbow: function() { + //console.log("RAINBOW", this.children.length); + for(var i = 0; i < this.children.length; i++) { + var child = this.children[i]; + child.fill = Interface.XY.colors[i % Interface.XY.colors.length]; //'rgba('+Math.round(Math.random()*255)+','+Math.round(Math.random()*255)+','+Math.round(Math.random()*255)+',.2)'; + //console.log("YUM", child.fill) + } + //this.refresh() + }, + remove: function() { this.stopAnimation(); Interface.widgets.splice( Interface.widgets.indexOf( this ), 1 ); }, + add : function() { if(this.usePhysics) this.startAnimation(); }, + startAnimation : function() { + if(this.timer === null) { + this.timer = setInterval( function() { self.refresh(); }, (1 / this.fps) * 1000); + } + }, + stopAnimation : function() { clearInterval(this.timer); this.timer = null; }, + + animate : function() { + var x = this._x(), + y = this._y(), + width = this._width(), + height = this._height(), + shouldrunvaluechange = false; + + for(var i = 0; i < this.children.length; i++) { + var moveX = moveY = false, + child = this.children[i]; + + if(child.x + child.vx < width && child.x + child.vx > 0) { + child.x += child.vx; + }else{ + if(child.x + child.vx >= width && child.vx > 0 ) { + child.vx *= -1; + }else if(child.x + child.vx <= 0 && child.vx < 0) { + child.vx *= -1; + }else{ + child.x += child.vx; + } + } + + if(child.y + child.vy < height && child.y + child.vy > 0) { + child.y += child.vy; + }else{ + if(child.y + child.vy >= height && child.vy > 0 ) { + child.vy *= -1; + }else if(child.y + child.vy <= 0 && child.vy < 0) { + child.vy *= -1; + }else{ + child.y += child.vy; + } + } + + child.vx *= this.friction; + child.vy *= this.friction; + + var newValueX = child.x / width; + var newValueY = child.y / height; + + var range = this.max - this.min; + if(this.values[child.id].x !== newValueX || this.values[child.id].y !== newValueY) { + this.values[child.id].x = this.min + range * newValueX; + this.values[child.id].y = this.min + range * newValueY; + shouldrunvaluechange = true; + } + + if(this.detectCollisions) { + if(!child.collideFlag) { + this.collisionTest(child); + }else{ + child.collideFlag = false; + } + } + + child.vx = Math.abs(child.vx) > this.maxVelocity ? this.maxVelocity * sign(child.vx) : child.vx; + child.vy = Math.abs(child.vy) > this.maxVelocity ? this.maxVelocity * sign(child.vy): child.vy; + } + if(shouldrunvaluechange) { + this.sendTargetMessage(); + + if(this.onvaluechange) { + this.onvaluechange(); + } + } + }, + + // MultiXY sends out all child values in serialized xy pairs + sendValues : function() { + var tt = ''; + this._values.length = 0; + for(var i = 0; i < this.values.length; i++) { + tt += 'ff'; + this._values.push( this.values[i].x ); + this._values.push( this.values[i].y ); + } + if(this.target === "OSC") { + if(Interface.OSC) { + Interface.OSC.send( this.key, tt, this._values ); + } + }else if( this.target === 'WebSocket' ) { + if( Interface.Socket ) { + Interface.Socket.send( JSON.stringify({ address:this.key, parameters: this._values }) ) + } + } + }, + + collisionTest : function(c1) { + var cw2 = (this.childWidth * 2) * (this.childWidth * 2); + for(var i = 0; i < this.children.length; i++) { + var c2 = this.children[i]; + if(c1.id !== c2.id) { + var distance = Math.pow(c1.x - c2.x, 2) + Math.pow(c1.y - c2.y, 2); + + if(distance < cw2) { // avoid square root by raising the distance check + this.collide(c1, c2) + } + } + } + }, + + collide : function(c1,c2) { + // posDiff, velDiff and normal are upvalues for gc performance + posDiff.x = c1.x - c2.x; + posDiff.y = c1.y - c2.y; + velDiff.x = c1.vx - c2.vx; + velDiff.y = c1.vy - c2.vy; + + cDot = Math.sqrt( Math.pow(posDiff.x, 2) + Math.pow(posDiff.y, 2) ); + + normal.x = posDiff.x / cDot; + normal.y = posDiff.y / cDot; + + var d = (normal.x * velDiff.x) + (normal.y * velDiff.y); + c2.vx = c1.vx + d * normal.x; + c2.vy = c1.vy + d * normal.y; + c1.vx = c2.vx - d * normal.x; + c1.vy = c2.vy - d * normal.y; + + c2.x -= normal.x; + c2.y -= normal.y; + c1.x += normal.x; + c1.y += normal.y; + + c1.vx = Math.abs(c1.vx) > this.maxVelocity ? this.maxVelocity * sign(c1.vx) : c1.vx; + c1.vy = Math.abs(c1.vy) > this.maxVelocity ? this.maxVelocity * sign(c1.vy) : c1.vy; + c2.vx = Math.abs(c2.vx) > this.maxVelocity ? this.maxVelocity * sign(c2.vx) : c2.vx; + c2.vy = Math.abs(c2.vy) > this.maxVelocity ? this.maxVelocity * sign(c2.vy) : c2.vy; + + c1.collideFlag = true; + c2.collideFlag = true; + }, + + draw : function() { + var x = this._x(), + y = this._y(), + width = this._width(), + height= this._height(); + + if(this.usePhysics) this.animate(); + + this.ctx.fillStyle = this._background(); + //this.ctx.fillRect( this.x, this.y, this.width, this.height ); + + this.ctx.strokeStyle = this._stroke(); + //this.ctx.strokeRect( this.x, this.y, this.width, this.height ); + + this.ctx.save(); + + this.ctx.beginPath(); + + this.ctx.moveTo(x, y); + this.ctx.lineTo(x + width, y); + this.ctx.lineTo(x + width, y + height); + this.ctx.lineTo(x, y + height); + this.ctx.lineTo(x, y); + this.ctx.fill(); + this.ctx.stroke(); + + this.ctx.clip(); + + this.ctx.fillStyle = this._fill(); + + for(var i = 0; i < this.children.length; i++) { + var child = this.children[i]; + this.ctx.lineWidth = 2 + this.ctx.fillStyle = child.fill || this._fill(); + + this.ctx.beginPath(); + + this.ctx.arc(x + child.x, y + child.y, this.childWidth, 0, Math.PI*2, true); + + this.ctx.closePath(); + + this.ctx.fill(); + this.ctx.stroke(); + //this.ctx.fillRect( this.x + child.x, this.y + child.y, this.childWidth, this.childHeight); + this.ctx.textBaseline = 'middle'; + this.ctx.textAlign = 'center'; + this.ctx.fillStyle = this._stroke(); + this.ctx.font = this._font(); + this.ctx.fillText(child.name, x + child.x, y + child.y); + } + + this.ctx.closePath(); + this.ctx.restore(); + }, + + changeValue : function( touch, xOffset, yOffset ) { + if(this.hasFocus || !this.requiresFocus) { + touch.x = xOffset; + if(touch.x < 0 ) touch.x = 0; + if(touch.x > this._width()) touch.x = this._width(); + + touch.y = yOffset;// - this.half; + if(touch.y < 0) touch.y = 0; + if(touch.y > this._height()) touch.y = this._height(); + this.values[touch.id].x = xOffset / this._width(); + this.values[touch.id].y = yOffset / this._height(); + + if(this.onvaluechange) this.onvaluechange(); + + if(!this.usePhysics) { + this.sendTargetMessage(); + this.refresh(); + } + } + }, + + // pass an (optional) array of ids to use instead of the + // sequential automatic numbering + makeChildren : function(ids) { + for(var i = 0; i < this.numChildren; i++) { + var x = Math.random() * this._width(), + y = Math.random() * this._height(), + id = ids[i] || i; + + this.children.push({ id:i, name:id, x:x, y:y, vx:0, vy:0, collideFlag:false, isActive:false, lastPosition:null, }); + this.values.push({ x:null, y:null }); + } + }, + + touchEvent : function(touch) { + var isHit = this.hitTest(touch); + var touchMouseName = convertTouchEvent(touch.type); + + if(isHit) { + if(touch.type === 'touchstart') { + this.hasFocus = true; + this.touchCount++; + this.trackTouch(touch.x - this._x(), touch.y - this._y(), touch); + }else{ + if(this[touch.type]) + this[touch.type](touch, isHit, touch.childID); // normal event + } + + if(this['on'+touch.type]) this['on'+touch.type](touch, isHit, touch.childId); // user defined event + if(this['on'+touchMouseName]) this['on'+touchMouseName](touch, isHit); // user defined event + + }else if(touch.type === 'touchend'){ + this.touchCount--; + if(this.touchCount === 0) { + this.hasFocus = false; + }else if(this.touchCount < 0 ) { + this.touchCount = 0; + } + this.touchend(touch) + if(this['on'+touch.type]) this['on'+touch.type](touch, isHit, touch.childId); // user defined event + if(this['on'+touchMouseName]) this['on'+touchMouseName](touch, isHit); // user defined event + } + }, + + trackMouse : function(xPos, yPos, id) { + var closestDiff = 10000, + touchFound = null, + touchNum = null; + + for(var i = 0; i < this.children.length; i++) { + var touch = this.children[i], + xdiff = Math.abs(touch.x - xPos), + ydiff = Math.abs(touch.y - yPos); + + if(xdiff + ydiff < closestDiff) { + closestDiff = xdiff + ydiff; + + touchFound = touch; + touchNum = i; + } + } + + touchFound.isActive = true; + touchFound.vx = 0; + touchFound.vy = 0; + + if(touchFound != null) { + this.changeValue(touchFound, xPos, yPos); + } + + this.activeTouch = touchFound; + this.activeTouch.lastTouch = null; + + this.lastTouched = touchFound; + }, + + mousedown : function(e) { + if(this.hitTest(e)) { + this.trackMouse(e.x - this._x(), e.y - this._y()); + } + }, + mousemove : function(e) { + if(this.hitTest(e) && this.activeTouch !== null) { + if(this.activeTouch.lastTouch === null) { + this.activeTouch.lastTouch = {x:e.x - this._x(), y:e.y - this._y()}; + }else{ + var now = {x:e.x - this._x(), y:e.y - this._y()}; + this.activeTouch.velocity = {x:now.x - this.activeTouch.lastTouch.x, y:now.y - this.activeTouch.lastTouch.y }; + this.activeTouch.lastTouch = now; + } + + this.changeValue(this.activeTouch, e.x - this._x(), e.y - this._y()); + } + }, + mouseup : function(e) { + if(this.activeTouch !== null) { + this.activeTouch.vx = this.activeTouch.velocity.x; + this.activeTouch.vy = this.activeTouch.velocity.y; + this.activeTouch.lastTouch = null; + this.activeTouch = null; + } + for(var i = 0; i < this.children.length; i++) { + this.children[i].isActive = false; + } + }, + + trackTouch : function(xPos, yPos, _touch) { + var closestDiff = 10000; + var touchFound = null; + var touchNum = null; + + for(var i = 0; i < this.children.length; i++) { + var touch = this.children[i]; + var xdiff = Math.abs(touch.x - xPos); + var ydiff = Math.abs(touch.y - yPos); + + if(xdiff + ydiff < closestDiff && !touch.isActive) { + closestDiff = xdiff + ydiff; + touchFound = touch; + touchNum = i; + } + } + + touchFound.isActive = true; + touchFound.vx = 0; + touchFound.vy = 0; + touchFound.identifier = _touch.identifier; + touchFound.childID = touchNum; + + if(touchFound != null) + this.changeValue(touchFound, xPos, yPos); + + this.lastTouched = touchFound; + return touchFound.childID; + }, + touchstart : function(touch) { + // if(this.hitTest(touch)) { + // this.trackTouch(touch.x - this.x, touch.y - this.y, touch); + // } + }, + touchmove : function(touch) { + for(var t = 0; t < this.children.length; t++) { + _t = this.children[t]; + if(touch.identifier === _t.identifier) { + this.changeValue(_t, touch.x - this._x(), touch.y - this._y()); + + var now = {x:touch.x - this._x(), y:touch.y - this._y()}; + + if(_t.lastPosition !== null) { + _t.velocity = {x:now.x - _t.lastPosition.x, y:now.y - _t.lastPosition.y }; + } + _t.lastPosition = now; + } + } + }, + touchend : function(touch) { + var found = false; + var tu = null; + for(var t = 0; t < this.children.length; t++) { + var _t = this.children[t]; + + if(touch.identifier === _t.identifier) { + if( _t.velocity ) { + _t.vx = _t.velocity.x; + _t.vy = _t.velocity.y; + } + + _t.lastPosition = null; + _t.isActive = false; + + + found = true; + tu = t.childID; + } + } + if(found) { this.touchUp = tu; } + //if(!found) console.log("NOT FOUND", touch.identifier); + }, + + _init : function() { + this.makeChildren(this.childIds); + if( this.outputInitialValues ) { + this.sendTargetMessage(); + } + }, + }) + .init( arguments[0] ); + + this.requiresFocus = false; // is a widget default... must set after init. + this.half = this.childWidth / 2; + + var numChildren = this.numChildren; + Object.defineProperty(this, 'numChildren', { + get : function() { return numChildren; }, + set : function(_numChildren) { + var temp = _numChildren; + while(_numChildren > numChildren) { + this.children.push({ id:this.children.length, x:Math.random() * this._width(), y:Math.random() * this._height(), vx:0, vy:0, collideFlag:false, isActive:false, lastPosition:null, }); + this.values.push({ x:null, y: null}); + numChildren++; + } + + while(_numChildren < numChildren) { + this.chidren.pop(); + this.values.pop(); + numChildren--; + } + this.refresh(); + numChildren = _numChildren; + } + }); +}; + +Interface.XY.prototype = Interface.Widget; +Interface.XY.colors = [ + 'rgba(255,0,0,.35)', + 'rgba(0,255,0,.35)', + 'rgba(0,0,255,.35)', + 'rgba(0,255,255,.35)', + 'rgba(255,0,255,.35)', + 'rgba(255,255,0,.35)', +]; +/**#Interface.Menu - Widget +A multi-option dropdown menu. +## Example Usage## +`a = new Interface.Menu({x:0, y:0, options:['red', 'yellow', 'green'] }); +a.onvaluechange = function() { b.background = this.value; } +b = new Interface.Slider({x:.5, y:.5, width:.2, height:.3}); +panel = new Interface.Panel(); +panel.add(a,b); +` +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the menu on initialization. +- - - - +**/ +/**###Interface.Menu.options : property +Array. A list of values found in the menu. +**/ +/**###Interface.Menu.css : property +Object. A dictionary of css keys / values to be applied to the menu. +**/ +/**###Interface.Menu.onvaluechange : method +The event handler fired whenever the selected menu option changes. + +param **newValue** Number or String. The new menu value. +param **oldValue** Number or String. The previous menu value. +**/ +Interface.Menu = function() { + Interface.extend(this, { + type : 'Menu', + _value: 0, + serializeMe : ["options", "fontSize"], + options: [], + fontSize:15, + touchEvent: function(e) { // we have to simulate this since the actual event was cancelled to avoid scrolling behavior + if(this.hitTest(e)) { + e.stopPropagation(); + /*var evt = document.createEvent('TouchEvent'); + evt.initUIEvent('touchstart', true, true); + + evt.view = window; + evt.screenX = e.screenX; + evt.screenY = e.screenY; + evt.clientX = e.clientX; + evt.clientY = e.clientY; + evt.bubbles = false; + evt.view = window; + evt.altKey = false; + evt.ctrlKey = false; + evt.shiftKey = false; + evt.metaKey = false; + + this.element.dispatchEvent(evt);*/ + } + }, + _init : function() { + this.element = $(" tag. +## Example Usage## +`a = new Interface.TextField({x:0, y:0, width:.5, height:.5, value:'starting value', onvaluechange: function() { alert( this.value ); } }); +panel = new Interface.Panel(); +panel.add(a); +` +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the textfield on initialization. +- - - - +**/ +/**###Interface.TextField.fontSize : property +Number. The size in pixels for the font used in the text field +**/ +/**###Interface.TextField.css : property +Object. Extra css that you would like to apply to the input element +**/ +Interface.TextField = function() { + Interface.extend(this, { + type : 'TextField', + serializeMe : ["fontSize"], + fontSize: 15, + touchEvent: function(e) { // we have to simulate this since the actual event was cancelled to avoid scrolling behavior + if(this.hitTest(e)) { + var evt = document.createEvent('TouchEvent'); + evt.initUIEvent('touchstart', true, true); + + evt.view = window; + evt.screenX = e.screenX; + evt.screenY = e.screenY; + evt.clientX = e.clientX; + evt.clientY = e.clientY; + evt.bubbles = false; + evt.view = window; + evt.altKey = false; + evt.ctrlKey = false; + evt.shiftKey = false; + evt.metaKey = false; + + this.element.dispatchEvent(evt); + } + }, + _init : function() { + this.element = $(""); + + if(this.value !== 0) { + this.element.val( this.value ); + } + this.element.css({ + position:'absolute', + backgroundColor:this._background(), + color:this._fill(), + left: this._x() + this.panel.x, + top: this._y() + this.panel.y, + width: this._width(), + height: this._height(), + fontSize: this.fontSize, + display:'block', + border: '1px solid ' + this._stroke(), + }); + + if(this.css) this.element.css( this.css ); + + var self = this; + this.element.change( + function(obj) { + var oldValue = self.value; + self.value = self.element.val(); + self.sendTargetMessage(); + self.onvaluechange(self.value, oldValue); + } + ); + + $(this.container).append(this.element); + }, + }) + .init( arguments[0] ); +}; +Interface.TextField.prototype = Interface.Widget; + +/**#Interface.MultiSlider - Widget +Multiple vertical sliders that share the same event handlers and colors. When a MultiSlider sends OSC, it comes in the form of an integer (representing the +number of the slide moved) and a float (representing the value of the slider moved). Any onvaluechange method attached to the MultiSlider widget should have a +similar signature; see the example below. +## Example Usage## +`b = new Interface.Label({ bounds:[.5,.5,.5,.5], size:12 }); +a = new Interface.MultiSlider({ + bounds:[0,0,.5,.5], + fill:'red', + count:8, + onvaluechange : function( sliderNumber, sliderValue) { b.setValue('number : ' + sliderNumber + ', value : ' + sliderValue) }, +}); +panel = new Interface.Panel(); +panel.add(a,b); +` +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the multislider on initialization. +- - - - +**/ +/**###Interface.MultiSlider.count : property +Number. The number of sliders in the widget +**/ +Interface.MultiSlider = function() { + Interface.extend(this, { + type : 'MultiSlider', + isVertical : true, + serializeMe : ["isVertical", "count", "values"], + values: [], + _values: [], + count:16, + + draw : function() { + var x = this._x(), + y = this._y(), + width = this._width(), + height= this._height(), + sliderWidth = width / this.count; + + this.ctx.fillStyle = this._background(); + this.ctx.fillRect( x, y, width, height ); + + this.ctx.fillStyle = this._fill(); + this.ctx.strokeStyle = this._stroke(); + + for(var i = 0; i < this.count; i++) { + var sliderX = i * sliderWidth + x; + + this.ctx.fillRect( sliderX, y + height - this._values[i] * height, sliderWidth, this._values[i] * height); + this.ctx.strokeRect( sliderX, y, sliderWidth, height ); + } + }, + setValue : function( sliderNum, value ) { + this.values[ sliderNum ] = value + this._values[ sliderNum ] = value + this.refresh() + }, + resetValues : function() { + for( var i = 0; i < this.count; i++ ) { + this.values[ i ] = this.min + (this.max - this.min) * this._values[ i ]; + + if(this.target !== "OSC") { + this.sendTargetMessage(); + }else{ + if(Interface.OSC) + Interface.OSC.send( this.key, 'if', [ sliderHit, this.values[ sliderHit ] ] ); + } + if(this.onvaluechange) this.onvaluechange(sliderHit, this.values[ sliderHit ]); + } + + this.refresh(); + }, + changeValue : function( xOffset, yOffset ) { + if(this.hasFocus || !this.requiresFocus) { + var width = this._width(), + sliderWidth = width / this.count, + sliderHit = Math.floor( xOffset / sliderWidth ) + _value = 0; + + _value = 1 - ( yOffset / this._height() ); + + if(_value < 0) { + _value = 0; + // this.hasFocus = false; + }else if(_value > 1) { + _value = 1; + // this.hasFocus = false; + } + + this.values[ sliderHit ] = this.min + (this.max - this.min) * _value; + this._values[ sliderHit ] = _value; + + if(this.target !== "OSC") { + this.sendTargetMessage(); + }else{ + if(Interface.OSC) + Interface.OSC.send( this.key, 'if', [ sliderHit, this.values[ sliderHit ] ] ); + } + if(this.onvaluechange) this.onvaluechange(sliderHit, this.values[ sliderHit ]); + this.refresh(); + //this.lastValue = this.value; + //} + } + }, + + mousedown : function(e, hit) { if(hit && Interface.mouseDown) this.changeValue( e.x - this._x(), e.y - this._y() ); }, + mousemove : function(e, hit) { if(hit && Interface.mouseDown) this.changeValue( e.x - this._x(), e.y - this._y() ); }, + mouseup : function(e, hit) { if(hit && Interface.mouseDown) this.changeValue( e.x - this._x(), e.y - this._y() ); }, + + touchstart : function(e, hit) { if(hit) this.changeValue( e.x - this._x(), e.y - this._y() ); }, + touchmove : function(e, hit) { if(hit) this.changeValue( e.x - this._x(), e.y - this._y() ); }, + touchend : function(e, hit) { if(hit) this.changeValue( e.x - this._x(), e.y - this._y() ); }, + onvaluechange : function(id, value) {}, + }) + .init( arguments[0] ); + + var x = this.x, + y = this.y, + width = this.width, + height = this.height, + bounds = [x,y,width,height], + count = this.count; + + delete this.bounds; + + Object.defineProperties(this, { + x : { + get : function() { return x; }, + set: function(_x) { x = _x; this.refresh(); } + }, + y : { + get : function() { return y; }, + set: function(_y) { y = _y; this.refresh(); } + }, + width : { + get : function() { return width; }, + set: function(_width) { width = _width; this.refresh(); } + }, + height : { + get : function() { return height; }, + set: function(_height) { height = _height; this.refresh(); } + }, + bounds : { + get : function() { return bounds; }, + set : function(_bounds) { bounds = _bounds; x = bounds[0]; y = bounds[1]; width = bounds[2]; height = bounds[3]; this.refresh(); } + }, + count : { + get : function() { return count; }, + set : function(_count) { count = _count; this.refresh(); }, + } + }) +}; +Interface.MultiSlider.prototype = Interface.Widget; + +/**#Interface.MultiButton - Widget +Multiple buttons that share the same event handlers and colors. When a MultiButton sends OSC, it comes in the form of three integers representing the row of the button +pressed, the column of the button pressed, and the button's value. Any onvaluechange method attached to the MultiButton widget should have a +similar signature; see the example below. +## Example Usage## +`b = new Interface.Label({ bounds:[.5,.5,.5,.5], size:12 }); +a = new Interface.MultiButton({ + bounds:[0,0,.5,.5], + fill:'white', + rows: 4, + columns: 4, + onvaluechange : function( row, column, value) { b.setValue('row : ' + row + ', column : ' + column + ', value : ' + value) }, +}); +panel = new Interface.Panel(); +panel.add(a,b); +` +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the multibutton on initialization. +- - - - +**/ +/**###Interface.MultiButton.rows : property +Number. The number of rows of buttons in the widgets. When combined with the columns property this determines the overall number of buttons in the widget. +**/ +/**###Interface.MultiButton.columns : property +Number. The number of columns of buttons in the widgets. When combined with the rows property this determines the overall number of buttons in the widget. +**/ +/**###Interface.MultiButton.mode : property +String. Can be 'toggle', 'momentary' or 'contact'. In toggle mode, the button turns on when it is pressed and off when it is pressed again. In momentary mode, the button turns on when pressed and off when released. In contact mode, the button briefly flashes when pressed and sends its value. +**/ +Interface.MultiButton = function() { + Interface.extend(this, { + type : 'MultiButton', + mode : 'toggle', + serializeMe : ["mode", "rows", "columns", "requiresFocus"], + rows: 8, + values: [], + _values: [], + lastValues: [], + mouseOver : null, + columns: 8, + + draw : function() { + var x = this._x(), + y = this._y(), + width = this._width(), + height= this._height(), + childWidth = width / this.columns, + childHeight = height / this.rows; + + this.ctx.strokeStyle = this._stroke(); + + for(var i = 0; i < this.rows; i++) { + for(var j = 0; j < this.columns; j++) { + var _x = x + j * childWidth, + _y = y + i * childHeight, + btn = i * this.columns + j; + + if(this._values[ btn ]) { + this.ctx.fillStyle = this._fill(); + }else{ + this.ctx.fillStyle = this._background(); + } + this.ctx.fillRect( _x, _y, childWidth, childHeight ); + this.ctx.strokeRect( _x, _y, childWidth, childHeight ); + } + } + }, + + setValue : function( row, col, value ) { + var btnNum = row * this.columns + col + + this._values[ btnNum ] = this.values[ btnNum ] = this.lastValues[ btnNum ] = value + this.draw() + }, + + changeValue : function( xOffset, yOffset ) { + if(this.hasFocus || !this.requiresFocus) { + var width = this._width(), + height = this._height(), + buttonWidth = width / this.columns, + columnHit = Math.floor( xOffset / buttonWidth ), + buttonHeight = height / this.rows, + rowHit = Math.floor( yOffset / buttonHeight), + buttonHit = (rowHit * this.columns) + columnHit, + _value = 0; + + + if( buttonHit !== this.mouseOver ) { + this._values[ buttonHit ] = !this._values[ buttonHit ]; + + this.values[ buttonHit ] = this._values[ buttonHit ] ? this.max : this.min; + + if(this.values[ buttonHit ] !== this.lastValues[ buttonHit ] || this.mode === 'contact') { + if(this.target !== "OSC") { + this.sendTargetMessage(); + }else{ + if(Interface.OSC) + Interface.OSC.send( this.key, 'iif', [ rowHit, columnHit, this.values[ buttonHit ] ] ); + } + + if(this.onvaluechange) this.onvaluechange( rowHit, columnHit, this.values[ buttonHit ]); + + this.draw(); + this.lastValues[ buttonHit ] = this.values[ buttonHit ]; + + if(this.mode === 'contact') { + var self = this; + setTimeout( function() { self._values[ buttonHit ] = 0; self.draw(); }, 75); + } + } + + this.mouseOver = buttonHit; + } + } + }, + + mousedown : function(e, hit) { + if(hit && Interface.mouseDown) { + this.changeValue( e.x - this._x(), e.y - this._y() ); + } + }, + mousemove : function(e, hit) { + if(hit && Interface.mouseDown) { + this.changeValue( e.x - this._x(), e.y - this._y() ); + } + }, + mouseup : function(e, hit) { + if(hit && Interface.mouseDown) this.changeValue( e.x - this._x(), e.y - this._y() ); + this.mouseOver = null; + }, + + touchstart : function(e, hit) { if(hit) this.changeValue( e.x - this._x(), e.y - this._y() ); }, + touchmove : function(e, hit) { if(hit) this.changeValue( e.x - this._x(), e.y - this._y() ); }, + touchend : function(e, hit) { if(hit) this.changeValue( e.x - this._x(), e.y - this._y() ); }, + }) + .init( arguments[0] ); + + this.requiresFocus = false; + var x = this.x, + y = this.y, + width = this.width, + height = this.height, + bounds = [x,y,width,height], + rows = this.rows, + columns = this.columns; + + delete this.bounds; + + Object.defineProperties(this, { + x : { + get : function() { return x; }, + set: function(_x) { x = _x; this.refresh(); } + }, + y : { + get : function() { return y; }, + set: function(_y) { y = _y; this.refresh(); } + }, + width : { + get : function() { return width; }, + set: function(_width) { width = _width; this.refresh(); } + }, + height : { + get : function() { return height; }, + set: function(_height) { height = _height; this.refresh(); } + }, + bounds : { + get : function() { return bounds; }, + set : function(_bounds) { bounds = _bounds; x = bounds[0]; y = bounds[1]; width = bounds[2]; height = bounds[3]; this.refresh(); } + }, + rows : { + get : function() { return rows; }, + set : function(_rows) { rows = _rows; this.refresh(); }, + }, + columns : { + get : function() { return columns; }, + set : function(_columns) { columns = _columns; this.refresh(); }, + }, + }); +}; +Interface.MultiButton.prototype = Interface.Widget; + +/**#Interface.Accelerometer - Widget +Access to the Accelerometer. Unlike the Orientation widget, this is only found on mobile devices. + +## Example Usage## +`var a = new Interface.Panel(); +var accelerometer = new Interface.Accelerometer({ + onvaluechange : function(_x,_y,_z) { + x.setValue(_x); + y.setValue(_y); + z.setValue(_z); + } +}).start(); +var x = new Interface.Slider({ + label: 'x', + bounds:[.05,.05,.2,.9] +}); +var y = new Interface.Slider({ + label: 'y', + bounds:[.25,.05,.2,.9] +}); +var z = new Interface.Slider({ + label: 'z', + bounds:[.45,.05,.2,.9] +}); + +a.background = 'black'; +a.add(x,y,z); +` +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the accelerometer on initialization. +- - - - +**/ +/**###Interface.Accelerometer.x : property +Number. A read-only property that gives the current accleration on the x-axis +**/ +/**###Interface.Accelerometer.y : property +Number. A read-only property that gives the current accleration on the y-axis +**/ +/**###Interface.Accelerometer.z : property +Number. A read-only property that gives the current accleration on the z-axis +**/ +/**###Interface.Accelerometer.start : method +Starts emitting values from the Accelerometer measurements +**/ +/**###Interface.Accelerometer.stop : method +Stop emitting values from the Accelerometer measurements +**/ +/**###Interface.Accelerometer.onvaluechange : method +The event handler fired whenever an accelerometer update is received + +param **x** Number. The x-acceleration of the sensor +param **y** Number. The y-acceleration of the sensor +param **x** Number. The z-acceleration of the sensor +**/ +Interface.Accelerometer = function() { + var self = this, + metersPerSecondSquared = 9.80665; + + Interface.extend(this, { + type:"Accelerometer", + + serializeMe : ["delay"], + delay : 100, // measured in ms + min: 0, + max: 1, + values : [0,0,0], + + update : function(event) { + var acceleration = event.acceleration; + self.x = self.values[0] = self.min + ((((0 - self.hardwareMin) + acceleration.x) / self.hardwareRange ) * self.max); + self.y = self.values[1] = self.min + ((((0 - self.hardwareMin) + acceleration.y) / self.hardwareRange ) * self.max); + self.z = self.values[2] = self.min + ((((0 - self.hardwareMin) + acceleration.z) / self.hardwareRange ) * self.max); + + if(typeof self.onvaluechange !== 'undefined') { + self.onvaluechange(self.x, self.y, self.z); + } + + self.sendTargetMessage(); + }, + start : function() { + window.addEventListener('devicemotion', this.update, true); + return this; + }, + stop : function() { + window.removeEventListener('devicemotion', this.update); + return this; + }, + }) + .init( arguments[0] ); + + if(!Interface.isAndroid) { + this.hardwareMin = -2.307 * metersPerSecondSquared; // as found here: http://www.iphonedevsdk.com/forum/iphone-sdk-development/4822-maximum-accelerometer-reading.html + this.hardwareMax = 2.307 * metersPerSecondSquared; // -1 to 1 works much better for devices without gyros to measure tilt, -2 to 2 much better to measure force + }else{ + this.hardwareMin = metersPerSecondSquared; + this.hardwareMax = metersPerSecondSquared; + } + + this.hardwareRange = this.hardwareMax - this.hardwareMin; +}; +Interface.Accelerometer.prototype = Interface.Widget; + +/**#Interface.Orientation - Widget +Access to the device's Orientation. This is only found on mobile devices, with the exception of Google Chrome, which provides pitch and roll. + +## Example Usage## +`var a = new Interface.Panel() + +var orientation = new Interface.Orientation({ + onvaluechange : function(_pitch, _roll, _yaw, _heading) { + pitch.setValue(_pitch); + roll.setValue(_roll); + yaw.setValue(_yaw); + } +}); +var pitch = new Interface.Slider({ + label: 'pitch', + bounds:[.05,.05,.2,.9] +}); +var roll = new Interface.Slider({ + label: 'roll', + bounds:[.25,.05,.2,.9] +}); +var yaw = new Interface.Slider({ + label: 'yaw', + bounds:[.45,.05,.2,.9] +}); + +a.add(pitch, roll, yaw); +` +## Constructor +**param** *properties*: Object. A dictionary of property values (see below) to set for the orientation on initialization. +- - - - +**/ +/**###Interface.Orientation.pitch : property +Number. A read-only property that gives the current orientation on the x-axis +**/ +/**###Interface.Orientation.roll : property +Number. A read-only property that gives the current orientation on the y-axis +**/ +/**###Interface.Orientation.yaw : property +Number. A read-only property that gives the current orientation on the z-axis +**/ +/**###Interface.Orientation.start : method +Starts emitting values from the Orientation measurements +**/ +/**###Interface.Orientation.stop : method +Stop emitting values from the Orientation measurements +**/ +/**###Interface.Orientation.onvaluechange : method +The event handler fired whenever an orientation update is received + +param **pitch** Number. The pitch of the sensor +param **roll** Number. The roll of the sensor +param **yaw** Number. The yaw of the sensor +param **heading** Number. The heading of the sensor, this corresponds to the compass direction detected. +**/ +Interface.Orientation = function() { + var _self = this; + + Interface.extend(this, { + type:"Orientation", + serializeMe : ["delay"], + delay : 100, // measured in ms + values : [0,0,0], + update : function(orientation) { + _self.roll = _self.values[0] = _self.min + ((90 + orientation.gamma) / 180 ) * _self.max ; + _self.pitch = _self.values[1] = _self.min + ((180 + orientation.beta) / 360 ) * _self.max ; + _self.yaw = _self.values[2] = _self.min + (orientation.alpha / 360 ) * _self.max ; + + if( !isNaN(orientation.webkitCompassHeading) ) { + _self.heading = _self.min + ((orientation.webkitCompassHeading / 360 ) * _self.max ); + } + + _self.sendTargetMessage(); + + if(typeof _self.onvaluechange !== 'undefined') { + _self.onvaluechange(_self.pitch, _self.roll, _self.yaw, _self.heading); + } + }, + start : function() { + window.addEventListener('deviceorientation', function (event) { + _self.update(event); + }, true); + return this; + }, + stop : function() { + window.removeEventListener('deviceorientation'); + }, + }) + .init( arguments[0] ); +}; +Interface.Orientation.prototype = Interface.Widget; + +Interface.Range = function() { + Interface.extend(this, { + type:"Range", + serializeMe : ["handleSize"], + handleSize: 20, + values:[0,1], + _values:[0,1], + draw : function() { + var x = this._x(), + y = this._y(), + width = this._width(), + height= this._height(); + + this.ctx.fillStyle = this._background(); + this.ctx.clearRect(x, y, width, height); + + var rightHandlePos = x + (this._values[1] * width) - this.handleSize; + var leftHandlePos = x + this._values[0] * width; + + this.ctx.fillStyle = this._background(); + this.ctx.fillRect(x, y, width, height); + + this.ctx.fillStyle = this._fill(); + this.ctx.fillRect(leftHandlePos, y, rightHandlePos - leftHandlePos, height); + + this.ctx.fillStyle = this._stroke(); + this.ctx.fillRect(leftHandlePos, y, this.handleSize, height); + + //this.ctx.fillStyle = "rgba(0,255,0,.25)"; + this.ctx.fillRect(rightHandlePos, y, this.handleSize, height); + + this.ctx.strokeStyle = this._stroke(); + this.ctx.strokeRect(x, y, width, height); + }, + changeValue : function( xOffset, yOffset ) { + if(this.hasFocus || !this.requiresFocus) { + var value = this.isVertical ? 1 - (yOffset / this._height()) : xOffset / this._width(); + + if(value < 0) { + value = 0; + }else if(value > 1) { + value = 1; + } + + var range = this.max - this.min + if(Math.abs( value - this._values[0]) < Math.abs( value - this._values[1])) { + this._values[0] = value; + this.values[0] = this.min + range * value; + }else{ + this._values[1] = value; + this.values[1] = this.min + range * value; + } + + this.refresh(); + + if(this.values[0] !== this.lastLeftValue || this.values[1] !== this.lastRightValue) { + if(this.onvaluechange) this.onvaluechange(this.values[0], this.values[1]); + this.refresh(); + this.lastLeftValue = this.values[0]; + this.lastRightValue = this.values[1]; + this.sendTargetMessage(); + } + } + }, + + mousedown : function(e, hit) { if(hit && Interface.mouseDown) this.changeValue( e.x - this._x(), e.y - this._y() ); }, + mousemove : function(e, hit) { if(hit && Interface.mouseDown) this.changeValue( e.x - this._x(), e.y - this._y() ); }, + mouseup : function(e, hit) { if(hit && Interface.mouseDown) this.changeValue( e.x - this._x(), e.y - this._y() ); }, + + touchstart : function(e, hit) { if(hit) this.changeValue( e.x - this._x(), e.y - this._y() ); }, + touchmove : function(e, hit) { if(hit) this.changeValue( e.x - this._x(), e.y - this._y() ); }, + touchend : function(e, hit) { if(hit) this.changeValue( e.x - this._x(), e.y - this._y() ); }, + }) + .init( arguments[0] ); +} +Interface.Range.prototype = Interface.Widget; + +Interface.Paint = function() { + Interface.extend( this, { + lines: [], + startTime: 0, + isAnimating: false, + animationPoint: 0, + timer: null, + shouldLoop: true, + prevTimestamp:null, + values:[0,0], + draw : function() { + var x = this._x(), + y = this._y(), + width = this._width(), + height= this._height(); + + this.ctx.fillStyle = this._background(); + //this.ctx.fillRect( this.x, this.y, this.width, this.height ); + + this.ctx.strokeStyle = this._stroke(); + //this.ctx.strokeRect( this.x, this.y, this.width, this.height ); + + this.ctx.save(); + + this.ctx.beginPath(); + + this.ctx.moveTo(x, y); + this.ctx.lineTo(x + width, y); + this.ctx.lineTo(x + width, y + height); + this.ctx.lineTo(x, y + height); + this.ctx.lineTo(x, y); + this.ctx.fill(); + this.ctx.stroke(); + + this.ctx.clip(); + + this.ctx.fillStyle = this._fill(); + + if( this.lines.length >= 1 ) { + this.ctx.lineWidth = 8 + for( var i = 0; i < this.lines.length; i++ ) { + var points = this.lines[ i ] + + if( points.length >= 2 ) { + this.ctx.moveTo( points[0].x * width, points[0].y * height ) + + this.ctx.beginPath() + + for ( var j = 1; j < points.length - 2; j++ ) { + var xc = ( points[ j ].x + points[ j + 1 ].x ) / 2 + var yc = ( points[ j ].y + points[ j + 1 ].y ) / 2 + this.ctx.quadraticCurveTo( points[ j ].x * width, points[ j ].y * height, xc * width, yc * height ) + } + + this.ctx.stroke() + //this.ctx.closePath(); + } + } + } + + this.ctx.restore(); + }, + + /* + touchEvent : function(touch) { + var isHit = this.hitTest(touch); + var touchMouseName = convertTouchEvent(touch.type); + + if(isHit) { + if(touch.type === 'touchstart') { + this.hasFocus = true; + this.touchCount++; + this.trackTouch(touch.x - this._x(), touch.y - this._y(), touch); + }else{ + if(this[touch.type]) + this[touch.type](touch, isHit, touch.childID); // normal event + } + + if(this['on'+touch.type]) this['on'+touch.type](touch, isHit, touch.childId); // user defined event + if(this['on'+touchMouseName]) this['on'+touchMouseName](touch, isHit); // user defined event + + }else if(touch.type === 'touchend'){ + this.touchCount--; + if(this.touchCount === 0) { + this.hasFocus = false; + }else if(this.touchCount < 0 ) { + this.touchCount = 0; + } + this.touchend(touch) + if(this['on'+touch.type]) this['on'+touch.type](touch, isHit, touch.childId); // user defined event + if(this['on'+touchMouseName]) this['on'+touchMouseName](touch, isHit); // user defined event + } + }, + + trackMouse : function(xPos, yPos, id) {}, + */ + animate : function(co) { + var me = this; + + if( this.isAnimating === false ) return + //console.log( this.lineNo, this._lines.length, this.speedMod ) + var line = this.lines[ 0 ] + + // if( typeof this.line === 'undefined' ) { + // this.context.fillStyle = '#fff' + // this.context.fillRect( 0, 0, this.canvas[0].width, this.canvas[0].height ) + // this.lineNo = this.pointNo = this.lines.length = 0 + // if( this.shouldLoop ) setTimeout( function() { me.drawBackground(); me.animate() }, this.endTime ) + // return + // } + var point = line[ this.animationPoint ], + nextPoint = line[ this.animationPoint + 1 ] + + //console.log( point, nextPoint ) + + if( this.animationPoint >= line.length - 1 ) { + if( this.shouldLoop ) { + this.animationPoint = 0 + this.draw() + //var time = this.shouldLoop ? this.endTime : (this.point.timestamp - this.prevTimestamp) + this.timeout = setTimeout( function() { me.animate() }, 5 ) + return + }else{ + this.ctx.fillStyle = this._background() + this.ctx.fillRect( 0, 0, this._width(), this._height() ) + if( this.speedMod !== 0 ) return + } + } + + this.ctx.save(); + this.ctx.strokeStyle = '#f00' + this.ctx.lineWidth = 8 + + this.ctx.beginPath() + + this.ctx.moveTo( point.x * this._width(), point.y * this._height() ) + // var xc = ( point.x + nextPoint.x ) / 2 + // var yc = ( point.y + nextPoint.y ) / 2 + // this.ctx.quadraticCurveTo( nextPoint.x * this._width(), nextPoint.y * this._height(), xc * this._width(), yc * this._height() ) + this.ctx.lineTo( nextPoint.x * this._width(), nextPoint.y * this._height() ) + + this.ctx.stroke() + this.ctx.restore() + + this.timeout = setTimeout( function() { me.animate() }, point.timestamp - this.prevTimestamp ) + this.prevTimestamp = point.timestamp + + this.animationPoint++ + + this.values = [ point.x, point.y ] + this.sendTargetMessage() + }, + + startAnimation: function() { + var self = this + + this.animate() + }, + stopAnimation: function() { + if( this.timer ) { + clearInterval( this.timer ) + } + }, + mousedown : function(e) { + if(this.hitTest(e)) { + + this.lines = [] + this.animationPoint = 0 + + if( this.lines.length === 0 ) { + this.startTime = Date.now() + }else{ + // if( this.lines[ this.lines.length - 1 ].length < 2 ) { + // this.lines.pop() + // } + } + + this.lines.push( [] ) + this.isDrawing = true; + this.isAnimating = false; + } + }, + mousemove : function(e) { + if(this.hitTest(e) && this.activeTouch !== null) { + //ctx.fillStyle = '#000' + + //if( e.pageX > canvas.width ) isDrawing = false + if( this.isDrawing ) { + var points = this.lines[ this.lines.length - 1 ] + if( points ) { + points.push({ x:e.x / this._width(), y:e.y / this._height(), timestamp: Date.now() - this.startTime }) + this.draw() + } + } + } + }, + mouseup : function(e) { + this.isDrawing = false + if( this.lines.length > 0 ) { + this.isAnimating = true; + this.animate() + } + }, + touchstart : function(touch) { + if(this.hitTest(touch)) { + this.lines = [] + this.animationPoint = 0 + + if( this.lines.length === 0 ) { + this.startTime = Date.now() + } + + this.lines.push( [] ) + this.isDrawing = true; + this.isAnimating = false; + } + + this.activeTouch = touch + }, + + touchmove : function(touch) { + if(this.hitTest(touch) && this.activeTouch !== null) { + if( this.isDrawing ) { + var points = this.lines[ this.lines.length - 1 ] + if( points ) { + points.push({ x:touch.x / this._width(), y:touch.y / this._height(), timestamp: Date.now() - this.startTime }) + this.draw() + } + } + } + }, + + touchend : function(touch) { + this.isDrawing = false + if( this.lines.length > 0 ) { + this.isAnimating = true; + this.animate() + } + }, + }) + .init( arguments[0] ); +} +Interface.Paint.prototype = Interface.Widget; + +Interface.Patchbay = function() { + Interface.extend(this, { + type:"Patchbay", + points: [], + minWidth:80, + cableWidth:5, + start:null, + over:null, + connections:[], + rowLength:null, + selectedConnection: null, + patchOutlineWidth:3, + + draw : function() { + var x = this._x(), y = this._y(), width = this._width(), height = this._height(), + length = this.points.length + + this.ctx.fillStyle = this._background(); + this.ctx.strokeStyle = this._stroke(); + this.ctx.clearRect(x, y, width, height); + + this.layout() + this.drawSegments() + this.drawPatchPoints() + this.drawConnections() + //this.drawLabels() + }, + + layout: function() { + var x = this._x(), y = this._y(), width = this._width(), height = this._height() + + this.rows = 1 + + this.patchWidth = width / this.points.length + + if( this.patchWidth < this.minWidth ) { + this.patchWidth = this.minWidth + } + + this.rows = Math.ceil( (this.patchWidth * this.points.length) / width ) + + this.patchHeight = height / this.rows + + + this.columns = Math.floor( width / this.patchWidth ) + }, + + drawSegments : function() { + var x = this._x(), y = this._y(), width = this._width(), height = this._height(), + length = this.points.length + + this.ctx.fillStyle = this._fill(); + + var totalWidth = 0, row = 1 + + //console.log("SEGMENT, START:", this.start, 'OVER:', this.over ) + for( var i = 0; i < this.points.length; i++ ) { + if( this.start === i ) { + this.ctx.fillStyle = "#777" + this.ctx.fillRect(x + totalWidth, y + (this.patchHeight * (row-1)), this.patchWidth, this.patchHeight ); + }else if( this.over === i ) { + this.ctx.fillStyle = "#744" + this.ctx.fillRect(x + totalWidth, y + (this.patchHeight * (row-1)), this.patchWidth, this.patchHeight ); + } + + this.ctx.fillStyle = this._stroke() + this.ctx.textBaseline = 'middle' + this.ctx.textAlign = 'center' + this.ctx.font = this._font() + this.ctx.font = 'normal 12px Helvetica' + + if( typeof this.points[i].name !== 'undefined' ) { + this.ctx.fillText( this.points[ i ].name , totalWidth + this.patchWidth / 2, y + ((row-1) * this.patchHeight + .1 * this.patchHeight) ) + } + + if( typeof this.points[i].name2 !== 'undefined' ) { + this.ctx.fillText( this.points[ i ].name2 , totalWidth + this.patchWidth / 2, y + ((row-1) * this.patchHeight + .9 * this.patchHeight) ) + } + + totalWidth += this.patchWidth + + this.points[ i ].row = row + + if( totalWidth + this.patchWidth > width ) { + totalWidth = 0 + row++ + } + } + }, + + drawPatchPoints : function() { + var x = this._x(), y = this._y(), width = this._width(), height = this._height(), + length = this.points.length + + this.ctx.fillStyle = this._background(); + + var totalWidth = 0, row = 1 + for( var i = 0; i < this.points.length; i++ ) { + //this.ctx.fillRect(totalWidth, y, patchWidth, patchHeight); + this.ctx.beginPath() + this.ctx.arc( totalWidth + this.patchWidth / 2, y + this.patchHeight / 2 + (this.patchHeight * (row-1)), this.patchWidth/4, 0, Math.PI*2, true); + this.ctx.closePath() + + this.ctx.fill() + + this.ctx.lineWidth = this.patchOutlineWidth + this.ctx.stroke() + + this.points[i].row = row + + this.ctx.lineWidth = 1 + this.ctx.strokeRect(totalWidth, y + (this.patchHeight * (row-1)), this.patchWidth, this.patchHeight ); + + totalWidth += this.patchWidth + if( totalWidth + this.patchWidth > width ) { + totalWidth = 0 + row++ + } + } + + //console.log("TOTAL ROWS = ", row ) + }, + + drawConnections : function() { + var x = this._x(), y = this._y(), width = this._width(), height = this._height() + + this.ctx.lineWidth = this.cableWidth + + for( var i = 0; i < this.connections.length; i++ ) { + var connection = this.connections[ i ], + origin = this.connections[ i ][ 0 ], + destination = this.connections[ i ][ 1 ], + startX = x + this.patchWidth * (origin % this.columns) + this.patchWidth / 2, + startY = y + (this.patchHeight / 2) + (this.patchHeight * Math.floor(origin / this.columns) ), + endX = x + this.patchWidth * (destination % this.columns) + this.patchWidth / 2, + endY = y + (this.patchHeight / 2) + (this.patchHeight * Math.floor(destination / this.columns) ), + ctrl1X = startX, + ctrl1Y = startY + this.patchHeight * .5, + ctrl2X = endX, + ctrl2Y = endY + this.patchHeight * .5 + + //console.log( "ORIGIN", this.points[origin].row, "DESTINATION", this.points[destination].row ) + if( connection.selected ) { + this.ctx.strokeStyle = '#0f0' + }else{ + var grd = this.ctx.createLinearGradient(startX, startY, endX, endY); + + grd.addColorStop( 0.000, 'rgba(64, 64, 64, 1.000)' ) + grd.addColorStop( 1.000, 'rgba(204, 204, 204, 1.000)' ) + + + this.ctx.strokeStyle = grd + } + + this.ctx.beginPath(); + this.ctx.moveTo( startX, startY ) + this.ctx.bezierCurveTo( ctrl1X, ctrl1Y, ctrl2X, ctrl2Y, endX, endY ); + this.ctx.stroke() + + connection.edge = [startX, startY, ctrl1X, ctrl1Y, ctrl2X, ctrl2Y, endX, endY] + } + }, + + _init : function() { + var x = this._x(), + y = this._y(), + width = this._width(), + height= this._height() + + this.patchWidth = width / this.points.length + this.patchHeight = height + this.rows = 1 + }, + + createConnection : function( connection ) { + var start = this.points[ connection[0] ], + end = this.points[ connection[1] ] + + if( end.output !== false ) { + this.connections.push( connection ) + + if( this.onconnection ) { + this.onconnection( start, end ) + } + } + }, + + changeValue : function( xOffset, yOffset ) { }, + + hitTestEdges: function(e) { + var hit = false, + x = e.x - this._x(), + y = e.y - this._y() + + for( var i = 0; i < this.connections.length; i++ ) { + var edge = this.connections[ i ].edge + + this.ctx.beginPath() + this.ctx.moveTo( edge[0], edge[1] ) + this.ctx.bezierCurveTo( edge[2], edge[3], edge[4], edge[5], edge[6], edge[7] ); + if( this.ctx.isPointInStroke( x,y ) ) { + this.connections.forEach( function( elem, index, array ){ + elem.selected = false + }) + + this.connections[ i ].selected = true + this.selectedConnection = this.connections[ i ] + + hit = true + + break; + } + } + + return hit + }, + + mousedown : function(e, hit) { + if( hit && Interface.mouseDown ) { + if( !this.hitTestEdges( e ) ) { + //this.start = Math.floor( ( e.x - this._x() / this._width() / this.rows ) / ( this._width() / this.points.length / this.rows ) ) + var _x = Math.floor( ( e.x - this._x() / this._width() ) / ( this._width() / this.columns ) ), + _y = Math.floor( ( e.y - this._y() / this._height()) / ( this._height() / this.rows ) ) + + this.start = _y * this.columns + _x + + if( this.selectedConnection !== null ) { + this.selectedConnection.selected = false + this.selectedConnection = null + } + } + + this.draw() + } + }, + mousemove : function(e, hit) { + if( hit && Interface.mouseDown ) { + var _x = Math.floor( ( e.x - this._x() / this._width() ) / ( this._width() / this.columns) ), + _y = Math.floor( ( e.y - this._y() / this._height()) / ( this._height() / this.rows ) ) + + var prevOver = this.over + this.over = _y * this.columns + _x + + if( this.over !== prevOver ) { + this.draw() + } + } + }, + mouseup : function(e, hit) { + if( hit ) { + var _x = Math.floor( ( e.x - this._x() / this._width() ) / ( this._width() / this.columns ) ), + _y = Math.floor( ( e.y - this._y() / this._height()) / ( this._height() / this.rows ) ), + over = _y * this.columns + _x + + // var over = Math.floor( ( e.x - this._x() / this._width() / this.rows ) / ( this._width() / this.points.length / this.rows ) ) + + if( this.start !== over && this.start !== null ) { + var connection = [ this.start, over ], + isFound = false + + for( var i = 0; i < this.connections.length; i++ ) { + if( this.connections[i][0] === connection[0] && this.connections[i][1] === connection[1] ) { + isFound = true + } + } + + if( !isFound ) this.createConnection( connection ) + } + } + + this.over = null + this.start = null + this.draw() + }, + + onkeydown: function(e) { + var key = Interface.keyCodeToChar[ e.keyCode ] + + if( key === 'Delete' || key === 'Backspace' ) { + if( this.selectedConnection !== null ) { + this.deleteConnection( this.selectedConnection ) + e.preventDefault() + } + } + }, + + deleteConnection: function( connection ) { + this.connections.splice( this.connections.indexOf( connection ), 1 ) + + if( this.ondisconnection ) { this.ondisconnection( this.points[ connection[0] ], this.points[ connection[1] ] ) } + + this.draw() + }, + + touchstart : function(e, hit) { if(hit) this.changeValue( e.x - this._x(), e.y - this._y() ); }, + touchmove : function(e, hit) { if(hit) this.changeValue( e.x - this._x(), e.y - this._y() ); }, + touchend : function(e, hit) { if(hit) this.changeValue( e.x - this._x(), e.y - this._y() ); }, + }) + .init( arguments[0] ); +} + +Interface.Patchbay.prototype = Interface.Widget; + +Interface.defineChildProperties = function(widget, properties) { + for(var j = 0; j < properties.length; j++) { + (function() { + var key = properties[j]; + var val = widget[key] + Object.defineProperty(widget, key, { + get: function() { return val; }, + set: function(_val) { + val = _val; + for(var i = 0; i < widget.children.length; i++) { + widget.children[i][key] = val; + } + } + }); + })(); + } +}; + +(function ($) { + var cache = {}; + + $.publish = function(/* String */topic, /* Array? */args){ + if(typeof cache[topic] === 'object') { + cache[topic].forEach(function(property){ + property.apply($, args || []); + }); + } + }; + + $.subscribe = function(/* String */topic, /* Function */callback){ + if(!cache[topic]){ + cache[topic] = []; + } + cache[topic].push(callback); + return [topic, callback]; // Array + }; + + $.unsubscribe = function(/* Array */handle){ + var t = handle[0]; + cache[t] && $.each(cache[t], function(idx){ + if(this == handle[1]){ + cache[t].splice(idx, 1); + } + }); + }; + +})($); + +module.exports = Interface + +}() + +},{"jquery":2}],2:[function(_dereq_,module,exports){ +/*! + * jQuery JavaScript Library v2.1.4 + * http://jquery.com/ + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * + * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2015-04-28T16:01Z + */ + +(function( global, factory ) { + + if ( typeof module === "object" && typeof module.exports === "object" ) { + // For CommonJS and CommonJS-like environments where a proper `window` + // is present, execute the factory and get jQuery. + // For environments that do not have a `window` with a `document` + // (such as Node.js), expose a factory as module.exports. + // This accentuates the need for the creation of a real `window`. + // e.g. var jQuery = require("jquery")(window); + // See ticket #14549 for more info. + module.exports = global.document ? + factory( global, true ) : + function( w ) { + if ( !w.document ) { + throw new Error( "jQuery requires a window with a document" ); + } + return factory( w ); + }; + } else { + factory( global ); + } + +// Pass this if window is not defined yet +}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { + +// Support: Firefox 18+ +// Can't be in strict mode, several libs including ASP.NET trace +// the stack via arguments.caller.callee and Firefox dies if +// you try to trace through "use strict" call chains. (#13335) +// + +var arr = []; + +var slice = arr.slice; + +var concat = arr.concat; + +var push = arr.push; + +var indexOf = arr.indexOf; + +var class2type = {}; + +var toString = class2type.toString; + +var hasOwn = class2type.hasOwnProperty; + +var support = {}; + + + +var + // Use the correct document accordingly with window argument (sandbox) + document = window.document, + + version = "2.1.4", + + // Define a local copy of jQuery + jQuery = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + // Need init if jQuery is called (just allow error to be thrown if not included) + return new jQuery.fn.init( selector, context ); + }, + + // Support: Android<4.1 + // Make sure we trim BOM and NBSP + rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, + + // Matches dashed string for camelizing + rmsPrefix = /^-ms-/, + rdashAlpha = /-([\da-z])/gi, + + // Used by jQuery.camelCase as callback to replace() + fcamelCase = function( all, letter ) { + return letter.toUpperCase(); + }; + +jQuery.fn = jQuery.prototype = { + // The current version of jQuery being used + jquery: version, + + constructor: jQuery, + + // Start with an empty selector + selector: "", + + // The default length of a jQuery object is 0 + length: 0, + + toArray: function() { + return slice.call( this ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num != null ? + + // Return just the one element from the set + ( num < 0 ? this[ num + this.length ] : this[ num ] ) : + + // Return all the elements in a clean array + slice.call( this ); + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems ) { + + // Build a new jQuery matched element set + var ret = jQuery.merge( this.constructor(), elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + ret.context = this.context; + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + return jQuery.each( this, callback, args ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map(this, function( elem, i ) { + return callback.call( elem, i, elem ); + })); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ) ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + eq: function( i ) { + var len = this.length, + j = +i + ( i < 0 ? len : 0 ); + return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); + }, + + end: function() { + return this.prevObject || this.constructor(null); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: arr.sort, + splice: arr.splice +}; + +jQuery.extend = jQuery.fn.extend = function() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[0] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + + // Skip the boolean and the target + target = arguments[ i ] || {}; + i++; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction(target) ) { + target = {}; + } + + // Extend jQuery itself if only one argument is passed + if ( i === length ) { + target = this; + i--; + } + + for ( ; i < length; i++ ) { + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) { + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { + if ( copyIsArray ) { + copyIsArray = false; + clone = src && jQuery.isArray(src) ? src : []; + + } else { + clone = src && jQuery.isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend({ + // Unique for each copy of jQuery on the page + expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), + + // Assume jQuery is ready without the ready module + isReady: true, + + error: function( msg ) { + throw new Error( msg ); + }, + + noop: function() {}, + + isFunction: function( obj ) { + return jQuery.type(obj) === "function"; + }, + + isArray: Array.isArray, + + isWindow: function( obj ) { + return obj != null && obj === obj.window; + }, + + isNumeric: function( obj ) { + // parseFloat NaNs numeric-cast false positives (null|true|false|"") + // ...but misinterprets leading-number strings, particularly hex literals ("0x...") + // subtraction forces infinities to NaN + // adding 1 corrects loss of precision from parseFloat (#15100) + return !jQuery.isArray( obj ) && (obj - parseFloat( obj ) + 1) >= 0; + }, + + isPlainObject: function( obj ) { + // Not plain objects: + // - Any object or value whose internal [[Class]] property is not "[object Object]" + // - DOM nodes + // - window + if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { + return false; + } + + if ( obj.constructor && + !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) { + return false; + } + + // If the function hasn't returned already, we're confident that + // |obj| is a plain object, created by {} or constructed with new Object + return true; + }, + + isEmptyObject: function( obj ) { + var name; + for ( name in obj ) { + return false; + } + return true; + }, + + type: function( obj ) { + if ( obj == null ) { + return obj + ""; + } + // Support: Android<4.0, iOS<6 (functionish RegExp) + return typeof obj === "object" || typeof obj === "function" ? + class2type[ toString.call(obj) ] || "object" : + typeof obj; + }, + + // Evaluates a script in a global context + globalEval: function( code ) { + var script, + indirect = eval; + + code = jQuery.trim( code ); + + if ( code ) { + // If the code includes a valid, prologue position + // strict mode pragma, execute code by injecting a + // script tag into the document. + if ( code.indexOf("use strict") === 1 ) { + script = document.createElement("script"); + script.text = code; + document.head.appendChild( script ).parentNode.removeChild( script ); + } else { + // Otherwise, avoid the DOM node creation, insertion + // and removal by using an indirect global eval + indirect( code ); + } + } + }, + + // Convert dashed to camelCase; used by the css and data modules + // Support: IE9-11+ + // Microsoft forgot to hump their vendor prefix (#9572) + camelCase: function( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); + }, + + // args is for internal usage only + each: function( obj, callback, args ) { + var value, + i = 0, + length = obj.length, + isArray = isArraylike( obj ); + + if ( args ) { + if ( isArray ) { + for ( ; i < length; i++ ) { + value = callback.apply( obj[ i ], args ); + + if ( value === false ) { + break; + } + } + } else { + for ( i in obj ) { + value = callback.apply( obj[ i ], args ); + + if ( value === false ) { + break; + } + } + } + + // A special, fast, case for the most common use of each + } else { + if ( isArray ) { + for ( ; i < length; i++ ) { + value = callback.call( obj[ i ], i, obj[ i ] ); + + if ( value === false ) { + break; + } + } + } else { + for ( i in obj ) { + value = callback.call( obj[ i ], i, obj[ i ] ); + + if ( value === false ) { + break; + } + } + } + } + + return obj; + }, + + // Support: Android<4.1 + trim: function( text ) { + return text == null ? + "" : + ( text + "" ).replace( rtrim, "" ); + }, + + // results is for internal usage only + makeArray: function( arr, results ) { + var ret = results || []; + + if ( arr != null ) { + if ( isArraylike( Object(arr) ) ) { + jQuery.merge( ret, + typeof arr === "string" ? + [ arr ] : arr + ); + } else { + push.call( ret, arr ); + } + } + + return ret; + }, + + inArray: function( elem, arr, i ) { + return arr == null ? -1 : indexOf.call( arr, elem, i ); + }, + + merge: function( first, second ) { + var len = +second.length, + j = 0, + i = first.length; + + for ( ; j < len; j++ ) { + first[ i++ ] = second[ j ]; + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, invert ) { + var callbackInverse, + matches = [], + i = 0, + length = elems.length, + callbackExpect = !invert; + + // Go through the array, only saving the items + // that pass the validator function + for ( ; i < length; i++ ) { + callbackInverse = !callback( elems[ i ], i ); + if ( callbackInverse !== callbackExpect ) { + matches.push( elems[ i ] ); + } + } + + return matches; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var value, + i = 0, + length = elems.length, + isArray = isArraylike( elems ), + ret = []; + + // Go through the array, translating each of the items to their new values + if ( isArray ) { + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + + // Go through every key on the object, + } else { + for ( i in elems ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + } + + // Flatten any nested arrays + return concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // Bind a function to a context, optionally partially applying any + // arguments. + proxy: function( fn, context ) { + var tmp, args, proxy; + + if ( typeof context === "string" ) { + tmp = fn[ context ]; + context = fn; + fn = tmp; + } + + // Quick check to determine if target is callable, in the spec + // this throws a TypeError, but we will just return undefined. + if ( !jQuery.isFunction( fn ) ) { + return undefined; + } + + // Simulated bind + args = slice.call( arguments, 2 ); + proxy = function() { + return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); + }; + + // Set the guid of unique handler to the same of original handler, so it can be removed + proxy.guid = fn.guid = fn.guid || jQuery.guid++; + + return proxy; + }, + + now: Date.now, + + // jQuery.support is not used in Core but other projects attach their + // properties to it so it needs to exist. + support: support +}); + +// Populate the class2type map +jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +}); + +function isArraylike( obj ) { + + // Support: iOS 8.2 (not reproducible in simulator) + // `in` check used to prevent JIT error (gh-2145) + // hasOwn isn't used here due to false negatives + // regarding Nodelist length in IE + var length = "length" in obj && obj.length, + type = jQuery.type( obj ); + + if ( type === "function" || jQuery.isWindow( obj ) ) { + return false; + } + + if ( obj.nodeType === 1 && length ) { + return true; + } + + return type === "array" || length === 0 || + typeof length === "number" && length > 0 && ( length - 1 ) in obj; +} +var Sizzle = +/*! + * Sizzle CSS Selector Engine v2.2.0-pre + * http://sizzlejs.com/ + * + * Copyright 2008, 2014 jQuery Foundation, Inc. and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2014-12-16 + */ +(function( window ) { + +var i, + support, + Expr, + getText, + isXML, + tokenize, + compile, + select, + outermostContext, + sortInput, + hasDuplicate, + + // Local document vars + setDocument, + document, + docElem, + documentIsHTML, + rbuggyQSA, + rbuggyMatches, + matches, + contains, + + // Instance-specific data + expando = "sizzle" + 1 * new Date(), + preferredDoc = window.document, + dirruns = 0, + done = 0, + classCache = createCache(), + tokenCache = createCache(), + compilerCache = createCache(), + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + } + return 0; + }, + + // General-purpose constants + MAX_NEGATIVE = 1 << 31, + + // Instance methods + hasOwn = ({}).hasOwnProperty, + arr = [], + pop = arr.pop, + push_native = arr.push, + push = arr.push, + slice = arr.slice, + // Use a stripped-down indexOf as it's faster than native + // http://jsperf.com/thor-indexof-vs-for/5 + indexOf = function( list, elem ) { + var i = 0, + len = list.length; + for ( ; i < len; i++ ) { + if ( list[i] === elem ) { + return i; + } + } + return -1; + }, + + booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", + + // Regular expressions + + // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace + whitespace = "[\\x20\\t\\r\\n\\f]", + // http://www.w3.org/TR/css3-syntax/#characters + characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", + + // Loosely modeled on CSS identifier characters + // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors + // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier + identifier = characterEncoding.replace( "w", "w#" ), + + // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors + attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace + + // Operator (capture 2) + "*([*^$|!~]?=)" + whitespace + + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]" + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace + + "*\\]", + + pseudos = ":(" + characterEncoding + ")(?:\\((" + + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: + // 1. quoted (capture 3; capture 4 or capture 5) + "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + + // 2. simple (capture 6) + "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + + // 3. anything else (capture 2) + ".*" + + ")\\)|)", + + // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter + rwhitespace = new RegExp( whitespace + "+", "g" ), + rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), + + rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), + rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), + + rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), + + rpseudo = new RegExp( pseudos ), + ridentifier = new RegExp( "^" + identifier + "$" ), + + matchExpr = { + "ID": new RegExp( "^#(" + characterEncoding + ")" ), + "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), + "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), + "ATTR": new RegExp( "^" + attributes ), + "PSEUDO": new RegExp( "^" + pseudos ), + "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), + "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), + // For use in libraries implementing .is() + // We use this for POS matching in `select` + "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) + }, + + rinputs = /^(?:input|select|textarea|button)$/i, + rheader = /^h\d$/i, + + rnative = /^[^{]+\{\s*\[native \w/, + + // Easily-parseable/retrievable ID or TAG or CLASS selectors + rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, + + rsibling = /[+~]/, + rescape = /'|\\/g, + + // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters + runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), + funescape = function( _, escaped, escapedWhitespace ) { + var high = "0x" + escaped - 0x10000; + // NaN means non-codepoint + // Support: Firefox<24 + // Workaround erroneous numeric interpretation of +"0x" + return high !== high || escapedWhitespace ? + escaped : + high < 0 ? + // BMP codepoint + String.fromCharCode( high + 0x10000 ) : + // Supplemental Plane codepoint (surrogate pair) + String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); + }, + + // Used for iframes + // See setDocument() + // Removing the function wrapper causes a "Permission Denied" + // error in IE + unloadHandler = function() { + setDocument(); + }; + +// Optimize for push.apply( _, NodeList ) +try { + push.apply( + (arr = slice.call( preferredDoc.childNodes )), + preferredDoc.childNodes + ); + // Support: Android<4.0 + // Detect silently failing push.apply + arr[ preferredDoc.childNodes.length ].nodeType; +} catch ( e ) { + push = { apply: arr.length ? + + // Leverage slice if possible + function( target, els ) { + push_native.apply( target, slice.call(els) ); + } : + + // Support: IE<9 + // Otherwise append directly + function( target, els ) { + var j = target.length, + i = 0; + // Can't trust NodeList.length + while ( (target[j++] = els[i++]) ) {} + target.length = j - 1; + } + }; +} + +function Sizzle( selector, context, results, seed ) { + var match, elem, m, nodeType, + // QSA vars + i, groups, old, nid, newContext, newSelector; + + if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { + setDocument( context ); + } + + context = context || document; + results = results || []; + nodeType = context.nodeType; + + if ( typeof selector !== "string" || !selector || + nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { + + return results; + } + + if ( !seed && documentIsHTML ) { + + // Try to shortcut find operations when possible (e.g., not under DocumentFragment) + if ( nodeType !== 11 && (match = rquickExpr.exec( selector )) ) { + // Speed-up: Sizzle("#ID") + if ( (m = match[1]) ) { + if ( nodeType === 9 ) { + elem = context.getElementById( m ); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document (jQuery #6963) + if ( elem && elem.parentNode ) { + // Handle the case where IE, Opera, and Webkit return items + // by name instead of ID + if ( elem.id === m ) { + results.push( elem ); + return results; + } + } else { + return results; + } + } else { + // Context is not a document + if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && + contains( context, elem ) && elem.id === m ) { + results.push( elem ); + return results; + } + } + + // Speed-up: Sizzle("TAG") + } else if ( match[2] ) { + push.apply( results, context.getElementsByTagName( selector ) ); + return results; + + // Speed-up: Sizzle(".CLASS") + } else if ( (m = match[3]) && support.getElementsByClassName ) { + push.apply( results, context.getElementsByClassName( m ) ); + return results; + } + } + + // QSA path + if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { + nid = old = expando; + newContext = context; + newSelector = nodeType !== 1 && selector; + + // qSA works strangely on Element-rooted queries + // We can work around this by specifying an extra ID on the root + // and working up from there (Thanks to Andrew Dupont for the technique) + // IE 8 doesn't work on object elements + if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { + groups = tokenize( selector ); + + if ( (old = context.getAttribute("id")) ) { + nid = old.replace( rescape, "\\$&" ); + } else { + context.setAttribute( "id", nid ); + } + nid = "[id='" + nid + "'] "; + + i = groups.length; + while ( i-- ) { + groups[i] = nid + toSelector( groups[i] ); + } + newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context; + newSelector = groups.join(","); + } + + if ( newSelector ) { + try { + push.apply( results, + newContext.querySelectorAll( newSelector ) + ); + return results; + } catch(qsaError) { + } finally { + if ( !old ) { + context.removeAttribute("id"); + } + } + } + } + } + + // All others + return select( selector.replace( rtrim, "$1" ), context, results, seed ); +} + +/** + * Create key-value caches of limited size + * @returns {Function(string, Object)} Returns the Object data after storing it on itself with + * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) + * deleting the oldest entry + */ +function createCache() { + var keys = []; + + function cache( key, value ) { + // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) + if ( keys.push( key + " " ) > Expr.cacheLength ) { + // Only keep the most recent entries + delete cache[ keys.shift() ]; + } + return (cache[ key + " " ] = value); + } + return cache; +} + +/** + * Mark a function for special use by Sizzle + * @param {Function} fn The function to mark + */ +function markFunction( fn ) { + fn[ expando ] = true; + return fn; +} + +/** + * Support testing using an element + * @param {Function} fn Passed the created div and expects a boolean result + */ +function assert( fn ) { + var div = document.createElement("div"); + + try { + return !!fn( div ); + } catch (e) { + return false; + } finally { + // Remove from its parent by default + if ( div.parentNode ) { + div.parentNode.removeChild( div ); + } + // release memory in IE + div = null; + } +} + +/** + * Adds the same handler for all of the specified attrs + * @param {String} attrs Pipe-separated list of attributes + * @param {Function} handler The method that will be applied + */ +function addHandle( attrs, handler ) { + var arr = attrs.split("|"), + i = attrs.length; + + while ( i-- ) { + Expr.attrHandle[ arr[i] ] = handler; + } +} + +/** + * Checks document order of two siblings + * @param {Element} a + * @param {Element} b + * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b + */ +function siblingCheck( a, b ) { + var cur = b && a, + diff = cur && a.nodeType === 1 && b.nodeType === 1 && + ( ~b.sourceIndex || MAX_NEGATIVE ) - + ( ~a.sourceIndex || MAX_NEGATIVE ); + + // Use IE sourceIndex if available on both nodes + if ( diff ) { + return diff; + } + + // Check if b follows a + if ( cur ) { + while ( (cur = cur.nextSibling) ) { + if ( cur === b ) { + return -1; + } + } + } + + return a ? 1 : -1; +} + +/** + * Returns a function to use in pseudos for input types + * @param {String} type + */ +function createInputPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for buttons + * @param {String} type + */ +function createButtonPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for positionals + * @param {Function} fn + */ +function createPositionalPseudo( fn ) { + return markFunction(function( argument ) { + argument = +argument; + return markFunction(function( seed, matches ) { + var j, + matchIndexes = fn( [], seed.length, argument ), + i = matchIndexes.length; + + // Match elements found at the specified indexes + while ( i-- ) { + if ( seed[ (j = matchIndexes[i]) ] ) { + seed[j] = !(matches[j] = seed[j]); + } + } + }); + }); +} + +/** + * Checks a node for validity as a Sizzle context + * @param {Element|Object=} context + * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value + */ +function testContext( context ) { + return context && typeof context.getElementsByTagName !== "undefined" && context; +} + +// Expose support vars for convenience +support = Sizzle.support = {}; + +/** + * Detects XML nodes + * @param {Element|Object} elem An element or a document + * @returns {Boolean} True iff elem is a non-HTML XML node + */ +isXML = Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = elem && (elem.ownerDocument || elem).documentElement; + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +/** + * Sets document-related variables once based on the current document + * @param {Element|Object} [doc] An element or document object to use to set the document + * @returns {Object} Returns the current document + */ +setDocument = Sizzle.setDocument = function( node ) { + var hasCompare, parent, + doc = node ? node.ownerDocument || node : preferredDoc; + + // If no document and documentElement is available, return + if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { + return document; + } + + // Set our document + document = doc; + docElem = doc.documentElement; + parent = doc.defaultView; + + // Support: IE>8 + // If iframe document is assigned to "document" variable and if iframe has been reloaded, + // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 + // IE6-8 do not support the defaultView property so parent will be undefined + if ( parent && parent !== parent.top ) { + // IE11 does not have attachEvent, so all must suffer + if ( parent.addEventListener ) { + parent.addEventListener( "unload", unloadHandler, false ); + } else if ( parent.attachEvent ) { + parent.attachEvent( "onunload", unloadHandler ); + } + } + + /* Support tests + ---------------------------------------------------------------------- */ + documentIsHTML = !isXML( doc ); + + /* Attributes + ---------------------------------------------------------------------- */ + + // Support: IE<8 + // Verify that getAttribute really returns attributes and not properties + // (excepting IE8 booleans) + support.attributes = assert(function( div ) { + div.className = "i"; + return !div.getAttribute("className"); + }); + + /* getElement(s)By* + ---------------------------------------------------------------------- */ + + // Check if getElementsByTagName("*") returns only elements + support.getElementsByTagName = assert(function( div ) { + div.appendChild( doc.createComment("") ); + return !div.getElementsByTagName("*").length; + }); + + // Support: IE<9 + support.getElementsByClassName = rnative.test( doc.getElementsByClassName ); + + // Support: IE<10 + // Check if getElementById returns elements by name + // The broken getElementById methods don't pick up programatically-set names, + // so use a roundabout getElementsByName test + support.getById = assert(function( div ) { + docElem.appendChild( div ).id = expando; + return !doc.getElementsByName || !doc.getElementsByName( expando ).length; + }); + + // ID find and filter + if ( support.getById ) { + Expr.find["ID"] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var m = context.getElementById( id ); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + return m && m.parentNode ? [ m ] : []; + } + }; + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + return elem.getAttribute("id") === attrId; + }; + }; + } else { + // Support: IE6/7 + // getElementById is not reliable as a find shortcut + delete Expr.find["ID"]; + + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id"); + return node && node.value === attrId; + }; + }; + } + + // Tag + Expr.find["TAG"] = support.getElementsByTagName ? + function( tag, context ) { + if ( typeof context.getElementsByTagName !== "undefined" ) { + return context.getElementsByTagName( tag ); + + // DocumentFragment nodes don't have gEBTN + } else if ( support.qsa ) { + return context.querySelectorAll( tag ); + } + } : + + function( tag, context ) { + var elem, + tmp = [], + i = 0, + // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too + results = context.getElementsByTagName( tag ); + + // Filter out possible comments + if ( tag === "*" ) { + while ( (elem = results[i++]) ) { + if ( elem.nodeType === 1 ) { + tmp.push( elem ); + } + } + + return tmp; + } + return results; + }; + + // Class + Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { + if ( documentIsHTML ) { + return context.getElementsByClassName( className ); + } + }; + + /* QSA/matchesSelector + ---------------------------------------------------------------------- */ + + // QSA and matchesSelector support + + // matchesSelector(:active) reports false when true (IE9/Opera 11.5) + rbuggyMatches = []; + + // qSa(:focus) reports false when true (Chrome 21) + // We allow this because of a bug in IE8/9 that throws an error + // whenever `document.activeElement` is accessed on an iframe + // So, we allow :focus to pass through QSA all the time to avoid the IE error + // See http://bugs.jquery.com/ticket/13378 + rbuggyQSA = []; + + if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { + // Build QSA regex + // Regex strategy adopted from Diego Perini + assert(function( div ) { + // Select is set to empty string on purpose + // This is to test IE's treatment of not explicitly + // setting a boolean content attribute, + // since its presence should be enough + // http://bugs.jquery.com/ticket/12359 + docElem.appendChild( div ).innerHTML = "" + + ""; + + // Support: IE8, Opera 11-12.16 + // Nothing should be selected when empty strings follow ^= or $= or *= + // The test attribute must be unknown in Opera but "safe" for WinRT + // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section + if ( div.querySelectorAll("[msallowcapture^='']").length ) { + rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); + } + + // Support: IE8 + // Boolean attributes and "value" are not treated correctly + if ( !div.querySelectorAll("[selected]").length ) { + rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); + } + + // Support: Chrome<29, Android<4.2+, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.7+ + if ( !div.querySelectorAll( "[id~=" + expando + "-]" ).length ) { + rbuggyQSA.push("~="); + } + + // Webkit/Opera - :checked should return selected option elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // IE8 throws error here and will not see later tests + if ( !div.querySelectorAll(":checked").length ) { + rbuggyQSA.push(":checked"); + } + + // Support: Safari 8+, iOS 8+ + // https://bugs.webkit.org/show_bug.cgi?id=136851 + // In-page `selector#id sibing-combinator selector` fails + if ( !div.querySelectorAll( "a#" + expando + "+*" ).length ) { + rbuggyQSA.push(".#.+[+~]"); + } + }); + + assert(function( div ) { + // Support: Windows 8 Native Apps + // The type and name attributes are restricted during .innerHTML assignment + var input = doc.createElement("input"); + input.setAttribute( "type", "hidden" ); + div.appendChild( input ).setAttribute( "name", "D" ); + + // Support: IE8 + // Enforce case-sensitivity of name attribute + if ( div.querySelectorAll("[name=d]").length ) { + rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); + } + + // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) + // IE8 throws error here and will not see later tests + if ( !div.querySelectorAll(":enabled").length ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Opera 10-11 does not throw on post-comma invalid pseudos + div.querySelectorAll("*,:x"); + rbuggyQSA.push(",.*:"); + }); + } + + if ( (support.matchesSelector = rnative.test( (matches = docElem.matches || + docElem.webkitMatchesSelector || + docElem.mozMatchesSelector || + docElem.oMatchesSelector || + docElem.msMatchesSelector) )) ) { + + assert(function( div ) { + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9) + support.disconnectedMatch = matches.call( div, "div" ); + + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( div, "[s!='']:x" ); + rbuggyMatches.push( "!=", pseudos ); + }); + } + + rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); + rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); + + /* Contains + ---------------------------------------------------------------------- */ + hasCompare = rnative.test( docElem.compareDocumentPosition ); + + // Element contains another + // Purposefully does not implement inclusive descendent + // As in, an element does not contain itself + contains = hasCompare || rnative.test( docElem.contains ) ? + function( a, b ) { + var adown = a.nodeType === 9 ? a.documentElement : a, + bup = b && b.parentNode; + return a === bup || !!( bup && bup.nodeType === 1 && ( + adown.contains ? + adown.contains( bup ) : + a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 + )); + } : + function( a, b ) { + if ( b ) { + while ( (b = b.parentNode) ) { + if ( b === a ) { + return true; + } + } + } + return false; + }; + + /* Sorting + ---------------------------------------------------------------------- */ + + // Document order sorting + sortOrder = hasCompare ? + function( a, b ) { + + // Flag for duplicate removal + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + // Sort on method existence if only one input has compareDocumentPosition + var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; + if ( compare ) { + return compare; + } + + // Calculate position if both inputs belong to the same document + compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? + a.compareDocumentPosition( b ) : + + // Otherwise we know they are disconnected + 1; + + // Disconnected nodes + if ( compare & 1 || + (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { + + // Choose the first element that is related to our preferred document + if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { + return -1; + } + if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { + return 1; + } + + // Maintain original order + return sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + } + + return compare & 4 ? -1 : 1; + } : + function( a, b ) { + // Exit early if the nodes are identical + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + var cur, + i = 0, + aup = a.parentNode, + bup = b.parentNode, + ap = [ a ], + bp = [ b ]; + + // Parentless nodes are either documents or disconnected + if ( !aup || !bup ) { + return a === doc ? -1 : + b === doc ? 1 : + aup ? -1 : + bup ? 1 : + sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + + // If the nodes are siblings, we can do a quick check + } else if ( aup === bup ) { + return siblingCheck( a, b ); + } + + // Otherwise we need full lists of their ancestors for comparison + cur = a; + while ( (cur = cur.parentNode) ) { + ap.unshift( cur ); + } + cur = b; + while ( (cur = cur.parentNode) ) { + bp.unshift( cur ); + } + + // Walk down the tree looking for a discrepancy + while ( ap[i] === bp[i] ) { + i++; + } + + return i ? + // Do a sibling check if the nodes have a common ancestor + siblingCheck( ap[i], bp[i] ) : + + // Otherwise nodes in our document sort first + ap[i] === preferredDoc ? -1 : + bp[i] === preferredDoc ? 1 : + 0; + }; + + return doc; +}; + +Sizzle.matches = function( expr, elements ) { + return Sizzle( expr, null, null, elements ); +}; + +Sizzle.matchesSelector = function( elem, expr ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + // Make sure that attribute selectors are quoted + expr = expr.replace( rattributeQuotes, "='$1']" ); + + if ( support.matchesSelector && documentIsHTML && + ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && + ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { + + try { + var ret = matches.call( elem, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || support.disconnectedMatch || + // As well, disconnected nodes are said to be in a document + // fragment in IE 9 + elem.document && elem.document.nodeType !== 11 ) { + return ret; + } + } catch (e) {} + } + + return Sizzle( expr, document, null, [ elem ] ).length > 0; +}; + +Sizzle.contains = function( context, elem ) { + // Set document vars if needed + if ( ( context.ownerDocument || context ) !== document ) { + setDocument( context ); + } + return contains( context, elem ); +}; + +Sizzle.attr = function( elem, name ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + var fn = Expr.attrHandle[ name.toLowerCase() ], + // Don't get fooled by Object.prototype properties (jQuery #13807) + val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? + fn( elem, name, !documentIsHTML ) : + undefined; + + return val !== undefined ? + val : + support.attributes || !documentIsHTML ? + elem.getAttribute( name ) : + (val = elem.getAttributeNode(name)) && val.specified ? + val.value : + null; +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +/** + * Document sorting and removing duplicates + * @param {ArrayLike} results + */ +Sizzle.uniqueSort = function( results ) { + var elem, + duplicates = [], + j = 0, + i = 0; + + // Unless we *know* we can detect duplicates, assume their presence + hasDuplicate = !support.detectDuplicates; + sortInput = !support.sortStable && results.slice( 0 ); + results.sort( sortOrder ); + + if ( hasDuplicate ) { + while ( (elem = results[i++]) ) { + if ( elem === results[ i ] ) { + j = duplicates.push( i ); + } + } + while ( j-- ) { + results.splice( duplicates[ j ], 1 ); + } + } + + // Clear input after sorting to release objects + // See https://github.com/jquery/sizzle/pull/225 + sortInput = null; + + return results; +}; + +/** + * Utility function for retrieving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +getText = Sizzle.getText = function( elem ) { + var node, + ret = "", + i = 0, + nodeType = elem.nodeType; + + if ( !nodeType ) { + // If no nodeType, this is expected to be an array + while ( (node = elem[i++]) ) { + // Do not traverse comment nodes + ret += getText( node ); + } + } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { + // Use textContent for elements + // innerText usage removed for consistency of new lines (jQuery #11153) + if ( typeof elem.textContent === "string" ) { + return elem.textContent; + } else { + // Traverse its children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + // Do not include comment or processing instruction nodes + + return ret; +}; + +Expr = Sizzle.selectors = { + + // Can be adjusted by the user + cacheLength: 50, + + createPseudo: markFunction, + + match: matchExpr, + + attrHandle: {}, + + find: {}, + + relative: { + ">": { dir: "parentNode", first: true }, + " ": { dir: "parentNode" }, + "+": { dir: "previousSibling", first: true }, + "~": { dir: "previousSibling" } + }, + + preFilter: { + "ATTR": function( match ) { + match[1] = match[1].replace( runescape, funescape ); + + // Move the given value to match[3] whether quoted or unquoted + match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape ); + + if ( match[2] === "~=" ) { + match[3] = " " + match[3] + " "; + } + + return match.slice( 0, 4 ); + }, + + "CHILD": function( match ) { + /* matches from matchExpr["CHILD"] + 1 type (only|nth|...) + 2 what (child|of-type) + 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) + 4 xn-component of xn+y argument ([+-]?\d*n|) + 5 sign of xn-component + 6 x of xn-component + 7 sign of y-component + 8 y of y-component + */ + match[1] = match[1].toLowerCase(); + + if ( match[1].slice( 0, 3 ) === "nth" ) { + // nth-* requires argument + if ( !match[3] ) { + Sizzle.error( match[0] ); + } + + // numeric x and y parameters for Expr.filter.CHILD + // remember that false/true cast respectively to 0/1 + match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); + match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); + + // other types prohibit arguments + } else if ( match[3] ) { + Sizzle.error( match[0] ); + } + + return match; + }, + + "PSEUDO": function( match ) { + var excess, + unquoted = !match[6] && match[2]; + + if ( matchExpr["CHILD"].test( match[0] ) ) { + return null; + } + + // Accept quoted arguments as-is + if ( match[3] ) { + match[2] = match[4] || match[5] || ""; + + // Strip excess characters from unquoted arguments + } else if ( unquoted && rpseudo.test( unquoted ) && + // Get excess from tokenize (recursively) + (excess = tokenize( unquoted, true )) && + // advance to the next closing parenthesis + (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { + + // excess is a negative index + match[0] = match[0].slice( 0, excess ); + match[2] = unquoted.slice( 0, excess ); + } + + // Return only captures needed by the pseudo filter method (type and argument) + return match.slice( 0, 3 ); + } + }, + + filter: { + + "TAG": function( nodeNameSelector ) { + var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); + return nodeNameSelector === "*" ? + function() { return true; } : + function( elem ) { + return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; + }; + }, + + "CLASS": function( className ) { + var pattern = classCache[ className + " " ]; + + return pattern || + (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && + classCache( className, function( elem ) { + return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== "undefined" && elem.getAttribute("class") || "" ); + }); + }, + + "ATTR": function( name, operator, check ) { + return function( elem ) { + var result = Sizzle.attr( elem, name ); + + if ( result == null ) { + return operator === "!="; + } + if ( !operator ) { + return true; + } + + result += ""; + + return operator === "=" ? result === check : + operator === "!=" ? result !== check : + operator === "^=" ? check && result.indexOf( check ) === 0 : + operator === "*=" ? check && result.indexOf( check ) > -1 : + operator === "$=" ? check && result.slice( -check.length ) === check : + operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : + operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : + false; + }; + }, + + "CHILD": function( type, what, argument, first, last ) { + var simple = type.slice( 0, 3 ) !== "nth", + forward = type.slice( -4 ) !== "last", + ofType = what === "of-type"; + + return first === 1 && last === 0 ? + + // Shortcut for :nth-*(n) + function( elem ) { + return !!elem.parentNode; + } : + + function( elem, context, xml ) { + var cache, outerCache, node, diff, nodeIndex, start, + dir = simple !== forward ? "nextSibling" : "previousSibling", + parent = elem.parentNode, + name = ofType && elem.nodeName.toLowerCase(), + useCache = !xml && !ofType; + + if ( parent ) { + + // :(first|last|only)-(child|of-type) + if ( simple ) { + while ( dir ) { + node = elem; + while ( (node = node[ dir ]) ) { + if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { + return false; + } + } + // Reverse direction for :only-* (if we haven't yet done so) + start = dir = type === "only" && !start && "nextSibling"; + } + return true; + } + + start = [ forward ? parent.firstChild : parent.lastChild ]; + + // non-xml :nth-child(...) stores cache data on `parent` + if ( forward && useCache ) { + // Seek `elem` from a previously-cached index + outerCache = parent[ expando ] || (parent[ expando ] = {}); + cache = outerCache[ type ] || []; + nodeIndex = cache[0] === dirruns && cache[1]; + diff = cache[0] === dirruns && cache[2]; + node = nodeIndex && parent.childNodes[ nodeIndex ]; + + while ( (node = ++nodeIndex && node && node[ dir ] || + + // Fallback to seeking `elem` from the start + (diff = nodeIndex = 0) || start.pop()) ) { + + // When found, cache indexes on `parent` and break + if ( node.nodeType === 1 && ++diff && node === elem ) { + outerCache[ type ] = [ dirruns, nodeIndex, diff ]; + break; + } + } + + // Use previously-cached element index if available + } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { + diff = cache[1]; + + // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) + } else { + // Use the same loop as above to seek `elem` from the start + while ( (node = ++nodeIndex && node && node[ dir ] || + (diff = nodeIndex = 0) || start.pop()) ) { + + if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { + // Cache the index of each encountered element + if ( useCache ) { + (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; + } + + if ( node === elem ) { + break; + } + } + } + } + + // Incorporate the offset, then check against cycle size + diff -= last; + return diff === first || ( diff % first === 0 && diff / first >= 0 ); + } + }; + }, + + "PSEUDO": function( pseudo, argument ) { + // pseudo-class names are case-insensitive + // http://www.w3.org/TR/selectors/#pseudo-classes + // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters + // Remember that setFilters inherits from pseudos + var args, + fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || + Sizzle.error( "unsupported pseudo: " + pseudo ); + + // The user may use createPseudo to indicate that + // arguments are needed to create the filter function + // just as Sizzle does + if ( fn[ expando ] ) { + return fn( argument ); + } + + // But maintain support for old signatures + if ( fn.length > 1 ) { + args = [ pseudo, pseudo, "", argument ]; + return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? + markFunction(function( seed, matches ) { + var idx, + matched = fn( seed, argument ), + i = matched.length; + while ( i-- ) { + idx = indexOf( seed, matched[i] ); + seed[ idx ] = !( matches[ idx ] = matched[i] ); + } + }) : + function( elem ) { + return fn( elem, 0, args ); + }; + } + + return fn; + } + }, + + pseudos: { + // Potentially complex pseudos + "not": markFunction(function( selector ) { + // Trim the selector passed to compile + // to avoid treating leading and trailing + // spaces as combinators + var input = [], + results = [], + matcher = compile( selector.replace( rtrim, "$1" ) ); + + return matcher[ expando ] ? + markFunction(function( seed, matches, context, xml ) { + var elem, + unmatched = matcher( seed, null, xml, [] ), + i = seed.length; + + // Match elements unmatched by `matcher` + while ( i-- ) { + if ( (elem = unmatched[i]) ) { + seed[i] = !(matches[i] = elem); + } + } + }) : + function( elem, context, xml ) { + input[0] = elem; + matcher( input, null, xml, results ); + // Don't keep the element (issue #299) + input[0] = null; + return !results.pop(); + }; + }), + + "has": markFunction(function( selector ) { + return function( elem ) { + return Sizzle( selector, elem ).length > 0; + }; + }), + + "contains": markFunction(function( text ) { + text = text.replace( runescape, funescape ); + return function( elem ) { + return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; + }; + }), + + // "Whether an element is represented by a :lang() selector + // is based solely on the element's language value + // being equal to the identifier C, + // or beginning with the identifier C immediately followed by "-". + // The matching of C against the element's language value is performed case-insensitively. + // The identifier C does not have to be a valid language name." + // http://www.w3.org/TR/selectors/#lang-pseudo + "lang": markFunction( function( lang ) { + // lang value must be a valid identifier + if ( !ridentifier.test(lang || "") ) { + Sizzle.error( "unsupported lang: " + lang ); + } + lang = lang.replace( runescape, funescape ).toLowerCase(); + return function( elem ) { + var elemLang; + do { + if ( (elemLang = documentIsHTML ? + elem.lang : + elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { + + elemLang = elemLang.toLowerCase(); + return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; + } + } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); + return false; + }; + }), + + // Miscellaneous + "target": function( elem ) { + var hash = window.location && window.location.hash; + return hash && hash.slice( 1 ) === elem.id; + }, + + "root": function( elem ) { + return elem === docElem; + }, + + "focus": function( elem ) { + return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); + }, + + // Boolean properties + "enabled": function( elem ) { + return elem.disabled === false; + }, + + "disabled": function( elem ) { + return elem.disabled === true; + }, + + "checked": function( elem ) { + // In CSS3, :checked should return both checked and selected elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + var nodeName = elem.nodeName.toLowerCase(); + return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); + }, + + "selected": function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + // Contents + "empty": function( elem ) { + // http://www.w3.org/TR/selectors/#empty-pseudo + // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), + // but not by others (comment: 8; processing instruction: 7; etc.) + // nodeType < 6 works because attributes (2) do not appear as children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + if ( elem.nodeType < 6 ) { + return false; + } + } + return true; + }, + + "parent": function( elem ) { + return !Expr.pseudos["empty"]( elem ); + }, + + // Element/input types + "header": function( elem ) { + return rheader.test( elem.nodeName ); + }, + + "input": function( elem ) { + return rinputs.test( elem.nodeName ); + }, + + "button": function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === "button" || name === "button"; + }, + + "text": function( elem ) { + var attr; + return elem.nodeName.toLowerCase() === "input" && + elem.type === "text" && + + // Support: IE<8 + // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" + ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); + }, + + // Position-in-collection + "first": createPositionalPseudo(function() { + return [ 0 ]; + }), + + "last": createPositionalPseudo(function( matchIndexes, length ) { + return [ length - 1 ]; + }), + + "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { + return [ argument < 0 ? argument + length : argument ]; + }), + + "even": createPositionalPseudo(function( matchIndexes, length ) { + var i = 0; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "odd": createPositionalPseudo(function( matchIndexes, length ) { + var i = 1; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; --i >= 0; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; ++i < length; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }) + } +}; + +Expr.pseudos["nth"] = Expr.pseudos["eq"]; + +// Add button/input type pseudos +for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { + Expr.pseudos[ i ] = createInputPseudo( i ); +} +for ( i in { submit: true, reset: true } ) { + Expr.pseudos[ i ] = createButtonPseudo( i ); +} + +// Easy API for creating new setFilters +function setFilters() {} +setFilters.prototype = Expr.filters = Expr.pseudos; +Expr.setFilters = new setFilters(); + +tokenize = Sizzle.tokenize = function( selector, parseOnly ) { + var matched, match, tokens, type, + soFar, groups, preFilters, + cached = tokenCache[ selector + " " ]; + + if ( cached ) { + return parseOnly ? 0 : cached.slice( 0 ); + } + + soFar = selector; + groups = []; + preFilters = Expr.preFilter; + + while ( soFar ) { + + // Comma and first run + if ( !matched || (match = rcomma.exec( soFar )) ) { + if ( match ) { + // Don't consume trailing commas as valid + soFar = soFar.slice( match[0].length ) || soFar; + } + groups.push( (tokens = []) ); + } + + matched = false; + + // Combinators + if ( (match = rcombinators.exec( soFar )) ) { + matched = match.shift(); + tokens.push({ + value: matched, + // Cast descendant combinators to space + type: match[0].replace( rtrim, " " ) + }); + soFar = soFar.slice( matched.length ); + } + + // Filters + for ( type in Expr.filter ) { + if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || + (match = preFilters[ type ]( match ))) ) { + matched = match.shift(); + tokens.push({ + value: matched, + type: type, + matches: match + }); + soFar = soFar.slice( matched.length ); + } + } + + if ( !matched ) { + break; + } + } + + // Return the length of the invalid excess + // if we're just parsing + // Otherwise, throw an error or return tokens + return parseOnly ? + soFar.length : + soFar ? + Sizzle.error( selector ) : + // Cache the tokens + tokenCache( selector, groups ).slice( 0 ); +}; + +function toSelector( tokens ) { + var i = 0, + len = tokens.length, + selector = ""; + for ( ; i < len; i++ ) { + selector += tokens[i].value; + } + return selector; +} + +function addCombinator( matcher, combinator, base ) { + var dir = combinator.dir, + checkNonElements = base && dir === "parentNode", + doneName = done++; + + return combinator.first ? + // Check against closest ancestor/preceding element + function( elem, context, xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + return matcher( elem, context, xml ); + } + } + } : + + // Check against all ancestor/preceding elements + function( elem, context, xml ) { + var oldCache, outerCache, + newCache = [ dirruns, doneName ]; + + // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching + if ( xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + if ( matcher( elem, context, xml ) ) { + return true; + } + } + } + } else { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + outerCache = elem[ expando ] || (elem[ expando ] = {}); + if ( (oldCache = outerCache[ dir ]) && + oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { + + // Assign to newCache so results back-propagate to previous elements + return (newCache[ 2 ] = oldCache[ 2 ]); + } else { + // Reuse newcache so results back-propagate to previous elements + outerCache[ dir ] = newCache; + + // A match means we're done; a fail means we have to keep checking + if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { + return true; + } + } + } + } + } + }; +} + +function elementMatcher( matchers ) { + return matchers.length > 1 ? + function( elem, context, xml ) { + var i = matchers.length; + while ( i-- ) { + if ( !matchers[i]( elem, context, xml ) ) { + return false; + } + } + return true; + } : + matchers[0]; +} + +function multipleContexts( selector, contexts, results ) { + var i = 0, + len = contexts.length; + for ( ; i < len; i++ ) { + Sizzle( selector, contexts[i], results ); + } + return results; +} + +function condense( unmatched, map, filter, context, xml ) { + var elem, + newUnmatched = [], + i = 0, + len = unmatched.length, + mapped = map != null; + + for ( ; i < len; i++ ) { + if ( (elem = unmatched[i]) ) { + if ( !filter || filter( elem, context, xml ) ) { + newUnmatched.push( elem ); + if ( mapped ) { + map.push( i ); + } + } + } + } + + return newUnmatched; +} + +function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { + if ( postFilter && !postFilter[ expando ] ) { + postFilter = setMatcher( postFilter ); + } + if ( postFinder && !postFinder[ expando ] ) { + postFinder = setMatcher( postFinder, postSelector ); + } + return markFunction(function( seed, results, context, xml ) { + var temp, i, elem, + preMap = [], + postMap = [], + preexisting = results.length, + + // Get initial elements from seed or context + elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), + + // Prefilter to get matcher input, preserving a map for seed-results synchronization + matcherIn = preFilter && ( seed || !selector ) ? + condense( elems, preMap, preFilter, context, xml ) : + elems, + + matcherOut = matcher ? + // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, + postFinder || ( seed ? preFilter : preexisting || postFilter ) ? + + // ...intermediate processing is necessary + [] : + + // ...otherwise use results directly + results : + matcherIn; + + // Find primary matches + if ( matcher ) { + matcher( matcherIn, matcherOut, context, xml ); + } + + // Apply postFilter + if ( postFilter ) { + temp = condense( matcherOut, postMap ); + postFilter( temp, [], context, xml ); + + // Un-match failing elements by moving them back to matcherIn + i = temp.length; + while ( i-- ) { + if ( (elem = temp[i]) ) { + matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); + } + } + } + + if ( seed ) { + if ( postFinder || preFilter ) { + if ( postFinder ) { + // Get the final matcherOut by condensing this intermediate into postFinder contexts + temp = []; + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) ) { + // Restore matcherIn since elem is not yet a final match + temp.push( (matcherIn[i] = elem) ); + } + } + postFinder( null, (matcherOut = []), temp, xml ); + } + + // Move matched elements from seed to results to keep them synchronized + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) && + (temp = postFinder ? indexOf( seed, elem ) : preMap[i]) > -1 ) { + + seed[temp] = !(results[temp] = elem); + } + } + } + + // Add elements to results, through postFinder if defined + } else { + matcherOut = condense( + matcherOut === results ? + matcherOut.splice( preexisting, matcherOut.length ) : + matcherOut + ); + if ( postFinder ) { + postFinder( null, results, matcherOut, xml ); + } else { + push.apply( results, matcherOut ); + } + } + }); +} + +function matcherFromTokens( tokens ) { + var checkContext, matcher, j, + len = tokens.length, + leadingRelative = Expr.relative[ tokens[0].type ], + implicitRelative = leadingRelative || Expr.relative[" "], + i = leadingRelative ? 1 : 0, + + // The foundational matcher ensures that elements are reachable from top-level context(s) + matchContext = addCombinator( function( elem ) { + return elem === checkContext; + }, implicitRelative, true ), + matchAnyContext = addCombinator( function( elem ) { + return indexOf( checkContext, elem ) > -1; + }, implicitRelative, true ), + matchers = [ function( elem, context, xml ) { + var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( + (checkContext = context).nodeType ? + matchContext( elem, context, xml ) : + matchAnyContext( elem, context, xml ) ); + // Avoid hanging onto element (issue #299) + checkContext = null; + return ret; + } ]; + + for ( ; i < len; i++ ) { + if ( (matcher = Expr.relative[ tokens[i].type ]) ) { + matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; + } else { + matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); + + // Return special upon seeing a positional matcher + if ( matcher[ expando ] ) { + // Find the next relative operator (if any) for proper handling + j = ++i; + for ( ; j < len; j++ ) { + if ( Expr.relative[ tokens[j].type ] ) { + break; + } + } + return setMatcher( + i > 1 && elementMatcher( matchers ), + i > 1 && toSelector( + // If the preceding token was a descendant combinator, insert an implicit any-element `*` + tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) + ).replace( rtrim, "$1" ), + matcher, + i < j && matcherFromTokens( tokens.slice( i, j ) ), + j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), + j < len && toSelector( tokens ) + ); + } + matchers.push( matcher ); + } + } + + return elementMatcher( matchers ); +} + +function matcherFromGroupMatchers( elementMatchers, setMatchers ) { + var bySet = setMatchers.length > 0, + byElement = elementMatchers.length > 0, + superMatcher = function( seed, context, xml, results, outermost ) { + var elem, j, matcher, + matchedCount = 0, + i = "0", + unmatched = seed && [], + setMatched = [], + contextBackup = outermostContext, + // We must always have either seed elements or outermost context + elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), + // Use integer dirruns iff this is the outermost matcher + dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), + len = elems.length; + + if ( outermost ) { + outermostContext = context !== document && context; + } + + // Add elements passing elementMatchers directly to results + // Keep `i` a string if there are no elements so `matchedCount` will be "00" below + // Support: IE<9, Safari + // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id + for ( ; i !== len && (elem = elems[i]) != null; i++ ) { + if ( byElement && elem ) { + j = 0; + while ( (matcher = elementMatchers[j++]) ) { + if ( matcher( elem, context, xml ) ) { + results.push( elem ); + break; + } + } + if ( outermost ) { + dirruns = dirrunsUnique; + } + } + + // Track unmatched elements for set filters + if ( bySet ) { + // They will have gone through all possible matchers + if ( (elem = !matcher && elem) ) { + matchedCount--; + } + + // Lengthen the array for every element, matched or not + if ( seed ) { + unmatched.push( elem ); + } + } + } + + // Apply set filters to unmatched elements + matchedCount += i; + if ( bySet && i !== matchedCount ) { + j = 0; + while ( (matcher = setMatchers[j++]) ) { + matcher( unmatched, setMatched, context, xml ); + } + + if ( seed ) { + // Reintegrate element matches to eliminate the need for sorting + if ( matchedCount > 0 ) { + while ( i-- ) { + if ( !(unmatched[i] || setMatched[i]) ) { + setMatched[i] = pop.call( results ); + } + } + } + + // Discard index placeholder values to get only actual matches + setMatched = condense( setMatched ); + } + + // Add matches to results + push.apply( results, setMatched ); + + // Seedless set matches succeeding multiple successful matchers stipulate sorting + if ( outermost && !seed && setMatched.length > 0 && + ( matchedCount + setMatchers.length ) > 1 ) { + + Sizzle.uniqueSort( results ); + } + } + + // Override manipulation of globals by nested matchers + if ( outermost ) { + dirruns = dirrunsUnique; + outermostContext = contextBackup; + } + + return unmatched; + }; + + return bySet ? + markFunction( superMatcher ) : + superMatcher; +} + +compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { + var i, + setMatchers = [], + elementMatchers = [], + cached = compilerCache[ selector + " " ]; + + if ( !cached ) { + // Generate a function of recursive functions that can be used to check each element + if ( !match ) { + match = tokenize( selector ); + } + i = match.length; + while ( i-- ) { + cached = matcherFromTokens( match[i] ); + if ( cached[ expando ] ) { + setMatchers.push( cached ); + } else { + elementMatchers.push( cached ); + } + } + + // Cache the compiled function + cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); + + // Save selector and tokenization + cached.selector = selector; + } + return cached; +}; + +/** + * A low-level selection function that works with Sizzle's compiled + * selector functions + * @param {String|Function} selector A selector or a pre-compiled + * selector function built with Sizzle.compile + * @param {Element} context + * @param {Array} [results] + * @param {Array} [seed] A set of elements to match against + */ +select = Sizzle.select = function( selector, context, results, seed ) { + var i, tokens, token, type, find, + compiled = typeof selector === "function" && selector, + match = !seed && tokenize( (selector = compiled.selector || selector) ); + + results = results || []; + + // Try to minimize operations if there is no seed and only one group + if ( match.length === 1 ) { + + // Take a shortcut and set the context if the root selector is an ID + tokens = match[0] = match[0].slice( 0 ); + if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && + support.getById && context.nodeType === 9 && documentIsHTML && + Expr.relative[ tokens[1].type ] ) { + + context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; + if ( !context ) { + return results; + + // Precompiled matchers will still verify ancestry, so step up a level + } else if ( compiled ) { + context = context.parentNode; + } + + selector = selector.slice( tokens.shift().value.length ); + } + + // Fetch a seed set for right-to-left matching + i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; + while ( i-- ) { + token = tokens[i]; + + // Abort if we hit a combinator + if ( Expr.relative[ (type = token.type) ] ) { + break; + } + if ( (find = Expr.find[ type ]) ) { + // Search, expanding context for leading sibling combinators + if ( (seed = find( + token.matches[0].replace( runescape, funescape ), + rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context + )) ) { + + // If seed is empty or no tokens remain, we can return early + tokens.splice( i, 1 ); + selector = seed.length && toSelector( tokens ); + if ( !selector ) { + push.apply( results, seed ); + return results; + } + + break; + } + } + } + } + + // Compile and execute a filtering function if one is not provided + // Provide `match` to avoid retokenization if we modified the selector above + ( compiled || compile( selector, match ) )( + seed, + context, + !documentIsHTML, + results, + rsibling.test( selector ) && testContext( context.parentNode ) || context + ); + return results; +}; + +// One-time assignments + +// Sort stability +support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; + +// Support: Chrome 14-35+ +// Always assume duplicates if they aren't passed to the comparison function +support.detectDuplicates = !!hasDuplicate; + +// Initialize against the default document +setDocument(); + +// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) +// Detached nodes confoundingly follow *each other* +support.sortDetached = assert(function( div1 ) { + // Should return 1, but returns 4 (following) + return div1.compareDocumentPosition( document.createElement("div") ) & 1; +}); + +// Support: IE<8 +// Prevent attribute/property "interpolation" +// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx +if ( !assert(function( div ) { + div.innerHTML = ""; + return div.firstChild.getAttribute("href") === "#" ; +}) ) { + addHandle( "type|href|height|width", function( elem, name, isXML ) { + if ( !isXML ) { + return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); + } + }); +} + +// Support: IE<9 +// Use defaultValue in place of getAttribute("value") +if ( !support.attributes || !assert(function( div ) { + div.innerHTML = ""; + div.firstChild.setAttribute( "value", "" ); + return div.firstChild.getAttribute( "value" ) === ""; +}) ) { + addHandle( "value", function( elem, name, isXML ) { + if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { + return elem.defaultValue; + } + }); +} + +// Support: IE<9 +// Use getAttributeNode to fetch booleans when getAttribute lies +if ( !assert(function( div ) { + return div.getAttribute("disabled") == null; +}) ) { + addHandle( booleans, function( elem, name, isXML ) { + var val; + if ( !isXML ) { + return elem[ name ] === true ? name.toLowerCase() : + (val = elem.getAttributeNode( name )) && val.specified ? + val.value : + null; + } + }); +} + +return Sizzle; + +})( window ); + + + +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; +jQuery.expr[":"] = jQuery.expr.pseudos; +jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; + + + +var rneedsContext = jQuery.expr.match.needsContext; + +var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/); + + + +var risSimple = /^.[^:#\[\.,]*$/; + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, not ) { + if ( jQuery.isFunction( qualifier ) ) { + return jQuery.grep( elements, function( elem, i ) { + /* jshint -W018 */ + return !!qualifier.call( elem, i, elem ) !== not; + }); + + } + + if ( qualifier.nodeType ) { + return jQuery.grep( elements, function( elem ) { + return ( elem === qualifier ) !== not; + }); + + } + + if ( typeof qualifier === "string" ) { + if ( risSimple.test( qualifier ) ) { + return jQuery.filter( qualifier, elements, not ); + } + + qualifier = jQuery.filter( qualifier, elements ); + } + + return jQuery.grep( elements, function( elem ) { + return ( indexOf.call( qualifier, elem ) >= 0 ) !== not; + }); +} + +jQuery.filter = function( expr, elems, not ) { + var elem = elems[ 0 ]; + + if ( not ) { + expr = ":not(" + expr + ")"; + } + + return elems.length === 1 && elem.nodeType === 1 ? + jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : + jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { + return elem.nodeType === 1; + })); +}; + +jQuery.fn.extend({ + find: function( selector ) { + var i, + len = this.length, + ret = [], + self = this; + + if ( typeof selector !== "string" ) { + return this.pushStack( jQuery( selector ).filter(function() { + for ( i = 0; i < len; i++ ) { + if ( jQuery.contains( self[ i ], this ) ) { + return true; + } + } + }) ); + } + + for ( i = 0; i < len; i++ ) { + jQuery.find( selector, self[ i ], ret ); + } + + // Needed because $( selector, context ) becomes $( context ).find( selector ) + ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); + ret.selector = this.selector ? this.selector + " " + selector : selector; + return ret; + }, + filter: function( selector ) { + return this.pushStack( winnow(this, selector || [], false) ); + }, + not: function( selector ) { + return this.pushStack( winnow(this, selector || [], true) ); + }, + is: function( selector ) { + return !!winnow( + this, + + // If this is a positional/relative selector, check membership in the returned set + // so $("p:first").is("p:last") won't return true for a doc with two "p". + typeof selector === "string" && rneedsContext.test( selector ) ? + jQuery( selector ) : + selector || [], + false + ).length; + } +}); + + +// Initialize a jQuery object + + +// A central reference to the root jQuery(document) +var rootjQuery, + + // A simple way to check for HTML strings + // Prioritize #id over to avoid XSS via location.hash (#9521) + // Strict HTML recognition (#11290: must start with <) + rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, + + init = jQuery.fn.init = function( selector, context ) { + var match, elem; + + // HANDLE: $(""), $(null), $(undefined), $(false) + if ( !selector ) { + return this; + } + + // Handle HTML strings + if ( typeof selector === "string" ) { + if ( selector[0] === "<" && selector[ selector.length - 1 ] === ">" && selector.length >= 3 ) { + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = rquickExpr.exec( selector ); + } + + // Match html or make sure no context is specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) { + context = context instanceof jQuery ? context[0] : context; + + // Option to run scripts is true for back-compat + // Intentionally let the error be thrown if parseHTML is not present + jQuery.merge( this, jQuery.parseHTML( + match[1], + context && context.nodeType ? context.ownerDocument || context : document, + true + ) ); + + // HANDLE: $(html, props) + if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { + for ( match in context ) { + // Properties of context are called as methods if possible + if ( jQuery.isFunction( this[ match ] ) ) { + this[ match ]( context[ match ] ); + + // ...and otherwise set as attributes + } else { + this.attr( match, context[ match ] ); + } + } + } + + return this; + + // HANDLE: $(#id) + } else { + elem = document.getElementById( match[2] ); + + // Support: Blackberry 4.6 + // gEBID returns nodes no longer in the document (#6963) + if ( elem && elem.parentNode ) { + // Inject the element directly into the jQuery object + this.length = 1; + this[0] = elem; + } + + this.context = document; + this.selector = selector; + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return ( context || rootjQuery ).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(DOMElement) + } else if ( selector.nodeType ) { + this.context = this[0] = selector; + this.length = 1; + return this; + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return typeof rootjQuery.ready !== "undefined" ? + rootjQuery.ready( selector ) : + // Execute immediately if ready is not present + selector( jQuery ); + } + + if ( selector.selector !== undefined ) { + this.selector = selector.selector; + this.context = selector.context; + } + + return jQuery.makeArray( selector, this ); + }; + +// Give the init function the jQuery prototype for later instantiation +init.prototype = jQuery.fn; + +// Initialize central reference +rootjQuery = jQuery( document ); + + +var rparentsprev = /^(?:parents|prev(?:Until|All))/, + // Methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.extend({ + dir: function( elem, dir, until ) { + var matched = [], + truncate = until !== undefined; + + while ( (elem = elem[ dir ]) && elem.nodeType !== 9 ) { + if ( elem.nodeType === 1 ) { + if ( truncate && jQuery( elem ).is( until ) ) { + break; + } + matched.push( elem ); + } + } + return matched; + }, + + sibling: function( n, elem ) { + var matched = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + matched.push( n ); + } + } + + return matched; + } +}); + +jQuery.fn.extend({ + has: function( target ) { + var targets = jQuery( target, this ), + l = targets.length; + + return this.filter(function() { + var i = 0; + for ( ; i < l; i++ ) { + if ( jQuery.contains( this, targets[i] ) ) { + return true; + } + } + }); + }, + + closest: function( selectors, context ) { + var cur, + i = 0, + l = this.length, + matched = [], + pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? + jQuery( selectors, context || this.context ) : + 0; + + for ( ; i < l; i++ ) { + for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { + // Always skip document fragments + if ( cur.nodeType < 11 && (pos ? + pos.index(cur) > -1 : + + // Don't pass non-elements to Sizzle + cur.nodeType === 1 && + jQuery.find.matchesSelector(cur, selectors)) ) { + + matched.push( cur ); + break; + } + } + } + + return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched ); + }, + + // Determine the position of an element within the set + index: function( elem ) { + + // No argument, return index in parent + if ( !elem ) { + return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; + } + + // Index in selector + if ( typeof elem === "string" ) { + return indexOf.call( jQuery( elem ), this[ 0 ] ); + } + + // Locate the position of the desired element + return indexOf.call( this, + + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[ 0 ] : elem + ); + }, + + add: function( selector, context ) { + return this.pushStack( + jQuery.unique( + jQuery.merge( this.get(), jQuery( selector, context ) ) + ) + ); + }, + + addBack: function( selector ) { + return this.add( selector == null ? + this.prevObject : this.prevObject.filter(selector) + ); + } +}); + +function sibling( cur, dir ) { + while ( (cur = cur[dir]) && cur.nodeType !== 1 ) {} + return cur; +} + +jQuery.each({ + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return jQuery.dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return jQuery.dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return sibling( elem, "nextSibling" ); + }, + prev: function( elem ) { + return sibling( elem, "previousSibling" ); + }, + nextAll: function( elem ) { + return jQuery.dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return jQuery.dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return jQuery.dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return jQuery.dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); + }, + children: function( elem ) { + return jQuery.sibling( elem.firstChild ); + }, + contents: function( elem ) { + return elem.contentDocument || jQuery.merge( [], elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var matched = jQuery.map( this, fn, until ); + + if ( name.slice( -5 ) !== "Until" ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + matched = jQuery.filter( selector, matched ); + } + + if ( this.length > 1 ) { + // Remove duplicates + if ( !guaranteedUnique[ name ] ) { + jQuery.unique( matched ); + } + + // Reverse order for parents* and prev-derivatives + if ( rparentsprev.test( name ) ) { + matched.reverse(); + } + } + + return this.pushStack( matched ); + }; +}); +var rnotwhite = (/\S+/g); + + + +// String to Object options format cache +var optionsCache = {}; + +// Convert String-formatted options into Object-formatted ones and store in cache +function createOptions( options ) { + var object = optionsCache[ options ] = {}; + jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { + object[ flag ] = true; + }); + return object; +} + +/* + * Create a callback list using the following parameters: + * + * options: an optional list of space-separated options that will change how + * the callback list behaves or a more traditional option object + * + * By default a callback list will act like an event callback list and can be + * "fired" multiple times. + * + * Possible options: + * + * once: will ensure the callback list can only be fired once (like a Deferred) + * + * memory: will keep track of previous values and will call any callback added + * after the list has been fired right away with the latest "memorized" + * values (like a Deferred) + * + * unique: will ensure a callback can only be added once (no duplicate in the list) + * + * stopOnFalse: interrupt callings when a callback returns false + * + */ +jQuery.Callbacks = function( options ) { + + // Convert options from String-formatted to Object-formatted if needed + // (we check in cache first) + options = typeof options === "string" ? + ( optionsCache[ options ] || createOptions( options ) ) : + jQuery.extend( {}, options ); + + var // Last fire value (for non-forgettable lists) + memory, + // Flag to know if list was already fired + fired, + // Flag to know if list is currently firing + firing, + // First callback to fire (used internally by add and fireWith) + firingStart, + // End of the loop when firing + firingLength, + // Index of currently firing callback (modified by remove if needed) + firingIndex, + // Actual callback list + list = [], + // Stack of fire calls for repeatable lists + stack = !options.once && [], + // Fire callbacks + fire = function( data ) { + memory = options.memory && data; + fired = true; + firingIndex = firingStart || 0; + firingStart = 0; + firingLength = list.length; + firing = true; + for ( ; list && firingIndex < firingLength; firingIndex++ ) { + if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { + memory = false; // To prevent further calls using add + break; + } + } + firing = false; + if ( list ) { + if ( stack ) { + if ( stack.length ) { + fire( stack.shift() ); + } + } else if ( memory ) { + list = []; + } else { + self.disable(); + } + } + }, + // Actual Callbacks object + self = { + // Add a callback or a collection of callbacks to the list + add: function() { + if ( list ) { + // First, we save the current length + var start = list.length; + (function add( args ) { + jQuery.each( args, function( _, arg ) { + var type = jQuery.type( arg ); + if ( type === "function" ) { + if ( !options.unique || !self.has( arg ) ) { + list.push( arg ); + } + } else if ( arg && arg.length && type !== "string" ) { + // Inspect recursively + add( arg ); + } + }); + })( arguments ); + // Do we need to add the callbacks to the + // current firing batch? + if ( firing ) { + firingLength = list.length; + // With memory, if we're not firing then + // we should call right away + } else if ( memory ) { + firingStart = start; + fire( memory ); + } + } + return this; + }, + // Remove a callback from the list + remove: function() { + if ( list ) { + jQuery.each( arguments, function( _, arg ) { + var index; + while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { + list.splice( index, 1 ); + // Handle firing indexes + if ( firing ) { + if ( index <= firingLength ) { + firingLength--; + } + if ( index <= firingIndex ) { + firingIndex--; + } + } + } + }); + } + return this; + }, + // Check if a given callback is in the list. + // If no argument is given, return whether or not list has callbacks attached. + has: function( fn ) { + return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); + }, + // Remove all callbacks from the list + empty: function() { + list = []; + firingLength = 0; + return this; + }, + // Have the list do nothing anymore + disable: function() { + list = stack = memory = undefined; + return this; + }, + // Is it disabled? + disabled: function() { + return !list; + }, + // Lock the list in its current state + lock: function() { + stack = undefined; + if ( !memory ) { + self.disable(); + } + return this; + }, + // Is it locked? + locked: function() { + return !stack; + }, + // Call all callbacks with the given context and arguments + fireWith: function( context, args ) { + if ( list && ( !fired || stack ) ) { + args = args || []; + args = [ context, args.slice ? args.slice() : args ]; + if ( firing ) { + stack.push( args ); + } else { + fire( args ); + } + } + return this; + }, + // Call all the callbacks with the given arguments + fire: function() { + self.fireWith( this, arguments ); + return this; + }, + // To know if the callbacks have already been called at least once + fired: function() { + return !!fired; + } + }; + + return self; +}; + + +jQuery.extend({ + + Deferred: function( func ) { + var tuples = [ + // action, add listener, listener list, final state + [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], + [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], + [ "notify", "progress", jQuery.Callbacks("memory") ] + ], + state = "pending", + promise = { + state: function() { + return state; + }, + always: function() { + deferred.done( arguments ).fail( arguments ); + return this; + }, + then: function( /* fnDone, fnFail, fnProgress */ ) { + var fns = arguments; + return jQuery.Deferred(function( newDefer ) { + jQuery.each( tuples, function( i, tuple ) { + var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; + // deferred[ done | fail | progress ] for forwarding actions to newDefer + deferred[ tuple[1] ](function() { + var returned = fn && fn.apply( this, arguments ); + if ( returned && jQuery.isFunction( returned.promise ) ) { + returned.promise() + .done( newDefer.resolve ) + .fail( newDefer.reject ) + .progress( newDefer.notify ); + } else { + newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); + } + }); + }); + fns = null; + }).promise(); + }, + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + return obj != null ? jQuery.extend( obj, promise ) : promise; + } + }, + deferred = {}; + + // Keep pipe for back-compat + promise.pipe = promise.then; + + // Add list-specific methods + jQuery.each( tuples, function( i, tuple ) { + var list = tuple[ 2 ], + stateString = tuple[ 3 ]; + + // promise[ done | fail | progress ] = list.add + promise[ tuple[1] ] = list.add; + + // Handle state + if ( stateString ) { + list.add(function() { + // state = [ resolved | rejected ] + state = stateString; + + // [ reject_list | resolve_list ].disable; progress_list.lock + }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); + } + + // deferred[ resolve | reject | notify ] + deferred[ tuple[0] ] = function() { + deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); + return this; + }; + deferred[ tuple[0] + "With" ] = list.fireWith; + }); + + // Make the deferred a promise + promise.promise( deferred ); + + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + + // All done! + return deferred; + }, + + // Deferred helper + when: function( subordinate /* , ..., subordinateN */ ) { + var i = 0, + resolveValues = slice.call( arguments ), + length = resolveValues.length, + + // the count of uncompleted subordinates + remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, + + // the master Deferred. If resolveValues consist of only a single Deferred, just use that. + deferred = remaining === 1 ? subordinate : jQuery.Deferred(), + + // Update function for both resolve and progress values + updateFunc = function( i, contexts, values ) { + return function( value ) { + contexts[ i ] = this; + values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; + if ( values === progressValues ) { + deferred.notifyWith( contexts, values ); + } else if ( !( --remaining ) ) { + deferred.resolveWith( contexts, values ); + } + }; + }, + + progressValues, progressContexts, resolveContexts; + + // Add listeners to Deferred subordinates; treat others as resolved + if ( length > 1 ) { + progressValues = new Array( length ); + progressContexts = new Array( length ); + resolveContexts = new Array( length ); + for ( ; i < length; i++ ) { + if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { + resolveValues[ i ].promise() + .done( updateFunc( i, resolveContexts, resolveValues ) ) + .fail( deferred.reject ) + .progress( updateFunc( i, progressContexts, progressValues ) ); + } else { + --remaining; + } + } + } + + // If we're not waiting on anything, resolve the master + if ( !remaining ) { + deferred.resolveWith( resolveContexts, resolveValues ); + } + + return deferred.promise(); + } +}); + + +// The deferred used on DOM ready +var readyList; + +jQuery.fn.ready = function( fn ) { + // Add the callback + jQuery.ready.promise().done( fn ); + + return this; +}; + +jQuery.extend({ + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Hold (or release) the ready event + holdReady: function( hold ) { + if ( hold ) { + jQuery.readyWait++; + } else { + jQuery.ready( true ); + } + }, + + // Handle when the DOM is ready + ready: function( wait ) { + + // Abort if there are pending holds or we're already ready + if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { + return; + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.resolveWith( document, [ jQuery ] ); + + // Trigger any bound ready events + if ( jQuery.fn.triggerHandler ) { + jQuery( document ).triggerHandler( "ready" ); + jQuery( document ).off( "ready" ); + } + } +}); + +/** + * The ready event handler and self cleanup method + */ +function completed() { + document.removeEventListener( "DOMContentLoaded", completed, false ); + window.removeEventListener( "load", completed, false ); + jQuery.ready(); +} + +jQuery.ready.promise = function( obj ) { + if ( !readyList ) { + + readyList = jQuery.Deferred(); + + // Catch cases where $(document).ready() is called after the browser event has already occurred. + // We once tried to use readyState "interactive" here, but it caused issues like the one + // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 + if ( document.readyState === "complete" ) { + // Handle it asynchronously to allow scripts the opportunity to delay ready + setTimeout( jQuery.ready ); + + } else { + + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", completed, false ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", completed, false ); + } + } + return readyList.promise( obj ); +}; + +// Kick off the DOM ready check even if the user does not +jQuery.ready.promise(); + + + + +// Multifunctional method to get and set values of a collection +// The value/s can optionally be executed if it's a function +var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) { + var i = 0, + len = elems.length, + bulk = key == null; + + // Sets many values + if ( jQuery.type( key ) === "object" ) { + chainable = true; + for ( i in key ) { + jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); + } + + // Sets one value + } else if ( value !== undefined ) { + chainable = true; + + if ( !jQuery.isFunction( value ) ) { + raw = true; + } + + if ( bulk ) { + // Bulk operations run against the entire set + if ( raw ) { + fn.call( elems, value ); + fn = null; + + // ...except when executing function values + } else { + bulk = fn; + fn = function( elem, key, value ) { + return bulk.call( jQuery( elem ), value ); + }; + } + } + + if ( fn ) { + for ( ; i < len; i++ ) { + fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); + } + } + } + + return chainable ? + elems : + + // Gets + bulk ? + fn.call( elems ) : + len ? fn( elems[0], key ) : emptyGet; +}; + + +/** + * Determines whether an object can have data + */ +jQuery.acceptData = function( owner ) { + // Accepts only: + // - Node + // - Node.ELEMENT_NODE + // - Node.DOCUMENT_NODE + // - Object + // - Any + /* jshint -W018 */ + return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); +}; + + +function Data() { + // Support: Android<4, + // Old WebKit does not have Object.preventExtensions/freeze method, + // return new empty object instead with no [[set]] accessor + Object.defineProperty( this.cache = {}, 0, { + get: function() { + return {}; + } + }); + + this.expando = jQuery.expando + Data.uid++; +} + +Data.uid = 1; +Data.accepts = jQuery.acceptData; + +Data.prototype = { + key: function( owner ) { + // We can accept data for non-element nodes in modern browsers, + // but we should not, see #8335. + // Always return the key for a frozen object. + if ( !Data.accepts( owner ) ) { + return 0; + } + + var descriptor = {}, + // Check if the owner object already has a cache key + unlock = owner[ this.expando ]; + + // If not, create one + if ( !unlock ) { + unlock = Data.uid++; + + // Secure it in a non-enumerable, non-writable property + try { + descriptor[ this.expando ] = { value: unlock }; + Object.defineProperties( owner, descriptor ); + + // Support: Android<4 + // Fallback to a less secure definition + } catch ( e ) { + descriptor[ this.expando ] = unlock; + jQuery.extend( owner, descriptor ); + } + } + + // Ensure the cache object + if ( !this.cache[ unlock ] ) { + this.cache[ unlock ] = {}; + } + + return unlock; + }, + set: function( owner, data, value ) { + var prop, + // There may be an unlock assigned to this node, + // if there is no entry for this "owner", create one inline + // and set the unlock as though an owner entry had always existed + unlock = this.key( owner ), + cache = this.cache[ unlock ]; + + // Handle: [ owner, key, value ] args + if ( typeof data === "string" ) { + cache[ data ] = value; + + // Handle: [ owner, { properties } ] args + } else { + // Fresh assignments by object are shallow copied + if ( jQuery.isEmptyObject( cache ) ) { + jQuery.extend( this.cache[ unlock ], data ); + // Otherwise, copy the properties one-by-one to the cache object + } else { + for ( prop in data ) { + cache[ prop ] = data[ prop ]; + } + } + } + return cache; + }, + get: function( owner, key ) { + // Either a valid cache is found, or will be created. + // New caches will be created and the unlock returned, + // allowing direct access to the newly created + // empty data object. A valid owner object must be provided. + var cache = this.cache[ this.key( owner ) ]; + + return key === undefined ? + cache : cache[ key ]; + }, + access: function( owner, key, value ) { + var stored; + // In cases where either: + // + // 1. No key was specified + // 2. A string key was specified, but no value provided + // + // Take the "read" path and allow the get method to determine + // which value to return, respectively either: + // + // 1. The entire cache object + // 2. The data stored at the key + // + if ( key === undefined || + ((key && typeof key === "string") && value === undefined) ) { + + stored = this.get( owner, key ); + + return stored !== undefined ? + stored : this.get( owner, jQuery.camelCase(key) ); + } + + // [*]When the key is not a string, or both a key and value + // are specified, set or extend (existing objects) with either: + // + // 1. An object of properties + // 2. A key and value + // + this.set( owner, key, value ); + + // Since the "set" path can have two possible entry points + // return the expected data based on which path was taken[*] + return value !== undefined ? value : key; + }, + remove: function( owner, key ) { + var i, name, camel, + unlock = this.key( owner ), + cache = this.cache[ unlock ]; + + if ( key === undefined ) { + this.cache[ unlock ] = {}; + + } else { + // Support array or space separated string of keys + if ( jQuery.isArray( key ) ) { + // If "name" is an array of keys... + // When data is initially created, via ("key", "val") signature, + // keys will be converted to camelCase. + // Since there is no way to tell _how_ a key was added, remove + // both plain key and camelCase key. #12786 + // This will only penalize the array argument path. + name = key.concat( key.map( jQuery.camelCase ) ); + } else { + camel = jQuery.camelCase( key ); + // Try the string as a key before any manipulation + if ( key in cache ) { + name = [ key, camel ]; + } else { + // If a key with the spaces exists, use it. + // Otherwise, create an array by matching non-whitespace + name = camel; + name = name in cache ? + [ name ] : ( name.match( rnotwhite ) || [] ); + } + } + + i = name.length; + while ( i-- ) { + delete cache[ name[ i ] ]; + } + } + }, + hasData: function( owner ) { + return !jQuery.isEmptyObject( + this.cache[ owner[ this.expando ] ] || {} + ); + }, + discard: function( owner ) { + if ( owner[ this.expando ] ) { + delete this.cache[ owner[ this.expando ] ]; + } + } +}; +var data_priv = new Data(); + +var data_user = new Data(); + + + +// Implementation Summary +// +// 1. Enforce API surface and semantic compatibility with 1.9.x branch +// 2. Improve the module's maintainability by reducing the storage +// paths to a single mechanism. +// 3. Use the same single mechanism to support "private" and "user" data. +// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) +// 5. Avoid exposing implementation details on user objects (eg. expando properties) +// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 + +var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, + rmultiDash = /([A-Z])/g; + +function dataAttr( elem, key, data ) { + var name; + + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = data === "true" ? true : + data === "false" ? false : + data === "null" ? null : + // Only convert to a number if it doesn't change the string + +data + "" === data ? +data : + rbrace.test( data ) ? jQuery.parseJSON( data ) : + data; + } catch( e ) {} + + // Make sure we set the data so it isn't changed later + data_user.set( elem, key, data ); + } else { + data = undefined; + } + } + return data; +} + +jQuery.extend({ + hasData: function( elem ) { + return data_user.hasData( elem ) || data_priv.hasData( elem ); + }, + + data: function( elem, name, data ) { + return data_user.access( elem, name, data ); + }, + + removeData: function( elem, name ) { + data_user.remove( elem, name ); + }, + + // TODO: Now that all calls to _data and _removeData have been replaced + // with direct calls to data_priv methods, these can be deprecated. + _data: function( elem, name, data ) { + return data_priv.access( elem, name, data ); + }, + + _removeData: function( elem, name ) { + data_priv.remove( elem, name ); + } +}); + +jQuery.fn.extend({ + data: function( key, value ) { + var i, name, data, + elem = this[ 0 ], + attrs = elem && elem.attributes; + + // Gets all values + if ( key === undefined ) { + if ( this.length ) { + data = data_user.get( elem ); + + if ( elem.nodeType === 1 && !data_priv.get( elem, "hasDataAttrs" ) ) { + i = attrs.length; + while ( i-- ) { + + // Support: IE11+ + // The attrs elements can be null (#14894) + if ( attrs[ i ] ) { + name = attrs[ i ].name; + if ( name.indexOf( "data-" ) === 0 ) { + name = jQuery.camelCase( name.slice(5) ); + dataAttr( elem, name, data[ name ] ); + } + } + } + data_priv.set( elem, "hasDataAttrs", true ); + } + } + + return data; + } + + // Sets multiple values + if ( typeof key === "object" ) { + return this.each(function() { + data_user.set( this, key ); + }); + } + + return access( this, function( value ) { + var data, + camelKey = jQuery.camelCase( key ); + + // The calling jQuery object (element matches) is not empty + // (and therefore has an element appears at this[ 0 ]) and the + // `value` parameter was not undefined. An empty jQuery object + // will result in `undefined` for elem = this[ 0 ] which will + // throw an exception if an attempt to read a data cache is made. + if ( elem && value === undefined ) { + // Attempt to get data from the cache + // with the key as-is + data = data_user.get( elem, key ); + if ( data !== undefined ) { + return data; + } + + // Attempt to get data from the cache + // with the key camelized + data = data_user.get( elem, camelKey ); + if ( data !== undefined ) { + return data; + } + + // Attempt to "discover" the data in + // HTML5 custom data-* attrs + data = dataAttr( elem, camelKey, undefined ); + if ( data !== undefined ) { + return data; + } + + // We tried really hard, but the data doesn't exist. + return; + } + + // Set the data... + this.each(function() { + // First, attempt to store a copy or reference of any + // data that might've been store with a camelCased key. + var data = data_user.get( this, camelKey ); + + // For HTML5 data-* attribute interop, we have to + // store property names with dashes in a camelCase form. + // This might not apply to all properties...* + data_user.set( this, camelKey, value ); + + // *... In the case of properties that might _actually_ + // have dashes, we need to also store a copy of that + // unchanged property. + if ( key.indexOf("-") !== -1 && data !== undefined ) { + data_user.set( this, key, value ); + } + }); + }, null, value, arguments.length > 1, null, true ); + }, + + removeData: function( key ) { + return this.each(function() { + data_user.remove( this, key ); + }); + } +}); + + +jQuery.extend({ + queue: function( elem, type, data ) { + var queue; + + if ( elem ) { + type = ( type || "fx" ) + "queue"; + queue = data_priv.get( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !queue || jQuery.isArray( data ) ) { + queue = data_priv.access( elem, type, jQuery.makeArray(data) ); + } else { + queue.push( data ); + } + } + return queue || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + startLength = queue.length, + fn = queue.shift(), + hooks = jQuery._queueHooks( elem, type ), + next = function() { + jQuery.dequeue( elem, type ); + }; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + startLength--; + } + + if ( fn ) { + + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift( "inprogress" ); + } + + // Clear up the last queue stop function + delete hooks.stop; + fn.call( elem, next, hooks ); + } + + if ( !startLength && hooks ) { + hooks.empty.fire(); + } + }, + + // Not public - generate a queueHooks object, or return the current one + _queueHooks: function( elem, type ) { + var key = type + "queueHooks"; + return data_priv.get( elem, key ) || data_priv.access( elem, key, { + empty: jQuery.Callbacks("once memory").add(function() { + data_priv.remove( elem, [ type + "queue", key ] ); + }) + }); + } +}); + +jQuery.fn.extend({ + queue: function( type, data ) { + var setter = 2; + + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + setter--; + } + + if ( arguments.length < setter ) { + return jQuery.queue( this[0], type ); + } + + return data === undefined ? + this : + this.each(function() { + var queue = jQuery.queue( this, type, data ); + + // Ensure a hooks for this queue + jQuery._queueHooks( this, type ); + + if ( type === "fx" && queue[0] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + }); + }, + dequeue: function( type ) { + return this.each(function() { + jQuery.dequeue( this, type ); + }); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, obj ) { + var tmp, + count = 1, + defer = jQuery.Deferred(), + elements = this, + i = this.length, + resolve = function() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + }; + + if ( typeof type !== "string" ) { + obj = type; + type = undefined; + } + type = type || "fx"; + + while ( i-- ) { + tmp = data_priv.get( elements[ i ], type + "queueHooks" ); + if ( tmp && tmp.empty ) { + count++; + tmp.empty.add( resolve ); + } + } + resolve(); + return defer.promise( obj ); + } +}); +var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source; + +var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; + +var isHidden = function( elem, el ) { + // isHidden might be called from jQuery#filter function; + // in that case, element will be second argument + elem = el || elem; + return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); + }; + +var rcheckableType = (/^(?:checkbox|radio)$/i); + + + +(function() { + var fragment = document.createDocumentFragment(), + div = fragment.appendChild( document.createElement( "div" ) ), + input = document.createElement( "input" ); + + // Support: Safari<=5.1 + // Check state lost if the name is set (#11217) + // Support: Windows Web Apps (WWA) + // `name` and `type` must use .setAttribute for WWA (#14901) + input.setAttribute( "type", "radio" ); + input.setAttribute( "checked", "checked" ); + input.setAttribute( "name", "t" ); + + div.appendChild( input ); + + // Support: Safari<=5.1, Android<4.2 + // Older WebKit doesn't clone checked state correctly in fragments + support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Support: IE<=11+ + // Make sure textarea (and checkbox) defaultValue is properly cloned + div.innerHTML = ""; + support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; +})(); +var strundefined = typeof undefined; + + + +support.focusinBubbles = "onfocusin" in window; + + +var + rkeyEvent = /^key/, + rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/, + rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, + rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; + +function returnTrue() { + return true; +} + +function returnFalse() { + return false; +} + +function safeActiveElement() { + try { + return document.activeElement; + } catch ( err ) { } +} + +/* + * Helper functions for managing events -- not part of the public interface. + * Props to Dean Edwards' addEvent library for many of the ideas. + */ +jQuery.event = { + + global: {}, + + add: function( elem, types, handler, data, selector ) { + + var handleObjIn, eventHandle, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = data_priv.get( elem ); + + // Don't attach events to noData or text/comment nodes (but allow plain objects) + if ( !elemData ) { + return; + } + + // Caller can pass in an object of custom data in lieu of the handler + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + selector = handleObjIn.selector; + } + + // Make sure that the handler has a unique ID, used to find/remove it later + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure and main handler, if this is the first + if ( !(events = elemData.events) ) { + events = elemData.events = {}; + } + if ( !(eventHandle = elemData.handle) ) { + eventHandle = elemData.handle = function( e ) { + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== strundefined && jQuery.event.triggered !== e.type ? + jQuery.event.dispatch.apply( elem, arguments ) : undefined; + }; + } + + // Handle multiple events separated by a space + types = ( types || "" ).match( rnotwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[t] ) || []; + type = origType = tmp[1]; + namespaces = ( tmp[2] || "" ).split( "." ).sort(); + + // There *must* be a type, no attaching namespace-only handlers + if ( !type ) { + continue; + } + + // If event changes its type, use the special event handlers for the changed type + special = jQuery.event.special[ type ] || {}; + + // If selector defined, determine special event api type, otherwise given type + type = ( selector ? special.delegateType : special.bindType ) || type; + + // Update special based on newly reset type + special = jQuery.event.special[ type ] || {}; + + // handleObj is passed to all event handlers + handleObj = jQuery.extend({ + type: type, + origType: origType, + data: data, + handler: handler, + guid: handler.guid, + selector: selector, + needsContext: selector && jQuery.expr.match.needsContext.test( selector ), + namespace: namespaces.join(".") + }, handleObjIn ); + + // Init the event handler queue if we're the first + if ( !(handlers = events[ type ]) ) { + handlers = events[ type ] = []; + handlers.delegateCount = 0; + + // Only use addEventListener if the special events handler returns false + if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle, false ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add to the element's handler list, delegates in front + if ( selector ) { + handlers.splice( handlers.delegateCount++, 0, handleObj ); + } else { + handlers.push( handleObj ); + } + + // Keep track of which events have ever been used, for event optimization + jQuery.event.global[ type ] = true; + } + + }, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, selector, mappedTypes ) { + + var j, origCount, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = data_priv.hasData( elem ) && data_priv.get( elem ); + + if ( !elemData || !(events = elemData.events) ) { + return; + } + + // Once for each type.namespace in types; type may be omitted + types = ( types || "" ).match( rnotwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[t] ) || []; + type = origType = tmp[1]; + namespaces = ( tmp[2] || "" ).split( "." ).sort(); + + // Unbind all events (on this namespace, if provided) for the element + if ( !type ) { + for ( type in events ) { + jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); + } + continue; + } + + special = jQuery.event.special[ type ] || {}; + type = ( selector ? special.delegateType : special.bindType ) || type; + handlers = events[ type ] || []; + tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); + + // Remove matching events + origCount = j = handlers.length; + while ( j-- ) { + handleObj = handlers[ j ]; + + if ( ( mappedTypes || origType === handleObj.origType ) && + ( !handler || handler.guid === handleObj.guid ) && + ( !tmp || tmp.test( handleObj.namespace ) ) && + ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { + handlers.splice( j, 1 ); + + if ( handleObj.selector ) { + handlers.delegateCount--; + } + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + } + + // Remove generic event handler if we removed something and no more handlers exist + // (avoids potential for endless recursion during removal of special event handlers) + if ( origCount && !handlers.length ) { + if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { + jQuery.removeEvent( elem, type, elemData.handle ); + } + + delete events[ type ]; + } + } + + // Remove the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + delete elemData.handle; + data_priv.remove( elem, "events" ); + } + }, + + trigger: function( event, data, elem, onlyHandlers ) { + + var i, cur, tmp, bubbleType, ontype, handle, special, + eventPath = [ elem || document ], + type = hasOwn.call( event, "type" ) ? event.type : event, + namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; + + cur = tmp = elem = elem || document; + + // Don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // focus/blur morphs to focusin/out; ensure we're not firing them right now + if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { + return; + } + + if ( type.indexOf(".") >= 0 ) { + // Namespaced trigger; create a regexp to match event type in handle() + namespaces = type.split("."); + type = namespaces.shift(); + namespaces.sort(); + } + ontype = type.indexOf(":") < 0 && "on" + type; + + // Caller can pass in a jQuery.Event object, Object, or just an event type string + event = event[ jQuery.expando ] ? + event : + new jQuery.Event( type, typeof event === "object" && event ); + + // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) + event.isTrigger = onlyHandlers ? 2 : 3; + event.namespace = namespaces.join("."); + event.namespace_re = event.namespace ? + new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : + null; + + // Clean up the event in case it is being reused + event.result = undefined; + if ( !event.target ) { + event.target = elem; + } + + // Clone any incoming data and prepend the event, creating the handler arg list + data = data == null ? + [ event ] : + jQuery.makeArray( data, [ event ] ); + + // Allow special events to draw outside the lines + special = jQuery.event.special[ type ] || {}; + if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { + return; + } + + // Determine event propagation path in advance, per W3C events spec (#9951) + // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) + if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { + + bubbleType = special.delegateType || type; + if ( !rfocusMorph.test( bubbleType + type ) ) { + cur = cur.parentNode; + } + for ( ; cur; cur = cur.parentNode ) { + eventPath.push( cur ); + tmp = cur; + } + + // Only add window if we got to document (e.g., not plain obj or detached DOM) + if ( tmp === (elem.ownerDocument || document) ) { + eventPath.push( tmp.defaultView || tmp.parentWindow || window ); + } + } + + // Fire handlers on the event path + i = 0; + while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { + + event.type = i > 1 ? + bubbleType : + special.bindType || type; + + // jQuery handler + handle = ( data_priv.get( cur, "events" ) || {} )[ event.type ] && data_priv.get( cur, "handle" ); + if ( handle ) { + handle.apply( cur, data ); + } + + // Native handler + handle = ontype && cur[ ontype ]; + if ( handle && handle.apply && jQuery.acceptData( cur ) ) { + event.result = handle.apply( cur, data ); + if ( event.result === false ) { + event.preventDefault(); + } + } + } + event.type = type; + + // If nobody prevented the default action, do it now + if ( !onlyHandlers && !event.isDefaultPrevented() ) { + + if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && + jQuery.acceptData( elem ) ) { + + // Call a native DOM method on the target with the same name name as the event. + // Don't do default actions on window, that's where global variables be (#6170) + if ( ontype && jQuery.isFunction( elem[ type ] ) && !jQuery.isWindow( elem ) ) { + + // Don't re-trigger an onFOO event when we call its FOO() method + tmp = elem[ ontype ]; + + if ( tmp ) { + elem[ ontype ] = null; + } + + // Prevent re-triggering of the same event, since we already bubbled it above + jQuery.event.triggered = type; + elem[ type ](); + jQuery.event.triggered = undefined; + + if ( tmp ) { + elem[ ontype ] = tmp; + } + } + } + } + + return event.result; + }, + + dispatch: function( event ) { + + // Make a writable jQuery.Event from the native event object + event = jQuery.event.fix( event ); + + var i, j, ret, matched, handleObj, + handlerQueue = [], + args = slice.call( arguments ), + handlers = ( data_priv.get( this, "events" ) || {} )[ event.type ] || [], + special = jQuery.event.special[ event.type ] || {}; + + // Use the fix-ed jQuery.Event rather than the (read-only) native event + args[0] = event; + event.delegateTarget = this; + + // Call the preDispatch hook for the mapped type, and let it bail if desired + if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { + return; + } + + // Determine handlers + handlerQueue = jQuery.event.handlers.call( this, event, handlers ); + + // Run delegates first; they may want to stop propagation beneath us + i = 0; + while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { + event.currentTarget = matched.elem; + + j = 0; + while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { + + // Triggered event must either 1) have no namespace, or 2) have namespace(s) + // a subset or equal to those in the bound event (both can have no namespace). + if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { + + event.handleObj = handleObj; + event.data = handleObj.data; + + ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) + .apply( matched.elem, args ); + + if ( ret !== undefined ) { + if ( (event.result = ret) === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + } + } + } + + // Call the postDispatch hook for the mapped type + if ( special.postDispatch ) { + special.postDispatch.call( this, event ); + } + + return event.result; + }, + + handlers: function( event, handlers ) { + var i, matches, sel, handleObj, + handlerQueue = [], + delegateCount = handlers.delegateCount, + cur = event.target; + + // Find delegate handlers + // Black-hole SVG instance trees (#13180) + // Avoid non-left-click bubbling in Firefox (#3861) + if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { + + for ( ; cur !== this; cur = cur.parentNode || this ) { + + // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) + if ( cur.disabled !== true || event.type !== "click" ) { + matches = []; + for ( i = 0; i < delegateCount; i++ ) { + handleObj = handlers[ i ]; + + // Don't conflict with Object.prototype properties (#13203) + sel = handleObj.selector + " "; + + if ( matches[ sel ] === undefined ) { + matches[ sel ] = handleObj.needsContext ? + jQuery( sel, this ).index( cur ) >= 0 : + jQuery.find( sel, this, null, [ cur ] ).length; + } + if ( matches[ sel ] ) { + matches.push( handleObj ); + } + } + if ( matches.length ) { + handlerQueue.push({ elem: cur, handlers: matches }); + } + } + } + } + + // Add the remaining (directly-bound) handlers + if ( delegateCount < handlers.length ) { + handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); + } + + return handlerQueue; + }, + + // Includes some event props shared by KeyEvent and MouseEvent + props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), + + fixHooks: {}, + + keyHooks: { + props: "char charCode key keyCode".split(" "), + filter: function( event, original ) { + + // Add which for key events + if ( event.which == null ) { + event.which = original.charCode != null ? original.charCode : original.keyCode; + } + + return event; + } + }, + + mouseHooks: { + props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "), + filter: function( event, original ) { + var eventDoc, doc, body, + button = original.button; + + // Calculate pageX/Y if missing and clientX/Y available + if ( event.pageX == null && original.clientX != null ) { + eventDoc = event.target.ownerDocument || document; + doc = eventDoc.documentElement; + body = eventDoc.body; + + event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); + event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + // Note: button is not normalized, so don't use it + if ( !event.which && button !== undefined ) { + event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); + } + + return event; + } + }, + + fix: function( event ) { + if ( event[ jQuery.expando ] ) { + return event; + } + + // Create a writable copy of the event object and normalize some properties + var i, prop, copy, + type = event.type, + originalEvent = event, + fixHook = this.fixHooks[ type ]; + + if ( !fixHook ) { + this.fixHooks[ type ] = fixHook = + rmouseEvent.test( type ) ? this.mouseHooks : + rkeyEvent.test( type ) ? this.keyHooks : + {}; + } + copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; + + event = new jQuery.Event( originalEvent ); + + i = copy.length; + while ( i-- ) { + prop = copy[ i ]; + event[ prop ] = originalEvent[ prop ]; + } + + // Support: Cordova 2.5 (WebKit) (#13255) + // All events should have a target; Cordova deviceready doesn't + if ( !event.target ) { + event.target = document; + } + + // Support: Safari 6.0+, Chrome<28 + // Target should not be a text node (#504, #13143) + if ( event.target.nodeType === 3 ) { + event.target = event.target.parentNode; + } + + return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; + }, + + special: { + load: { + // Prevent triggered image.load events from bubbling to window.load + noBubble: true + }, + focus: { + // Fire native event if possible so blur/focus sequence is correct + trigger: function() { + if ( this !== safeActiveElement() && this.focus ) { + this.focus(); + return false; + } + }, + delegateType: "focusin" + }, + blur: { + trigger: function() { + if ( this === safeActiveElement() && this.blur ) { + this.blur(); + return false; + } + }, + delegateType: "focusout" + }, + click: { + // For checkbox, fire native event so checked state will be right + trigger: function() { + if ( this.type === "checkbox" && this.click && jQuery.nodeName( this, "input" ) ) { + this.click(); + return false; + } + }, + + // For cross-browser consistency, don't fire native .click() on links + _default: function( event ) { + return jQuery.nodeName( event.target, "a" ); + } + }, + + beforeunload: { + postDispatch: function( event ) { + + // Support: Firefox 20+ + // Firefox doesn't alert if the returnValue field is not set. + if ( event.result !== undefined && event.originalEvent ) { + event.originalEvent.returnValue = event.result; + } + } + } + }, + + simulate: function( type, elem, event, bubble ) { + // Piggyback on a donor event to simulate a different one. + // Fake originalEvent to avoid donor's stopPropagation, but if the + // simulated event prevents default then we do the same on the donor. + var e = jQuery.extend( + new jQuery.Event(), + event, + { + type: type, + isSimulated: true, + originalEvent: {} + } + ); + if ( bubble ) { + jQuery.event.trigger( e, null, elem ); + } else { + jQuery.event.dispatch.call( elem, e ); + } + if ( e.isDefaultPrevented() ) { + event.preventDefault(); + } + } +}; + +jQuery.removeEvent = function( elem, type, handle ) { + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle, false ); + } +}; + +jQuery.Event = function( src, props ) { + // Allow instantiation without the 'new' keyword + if ( !(this instanceof jQuery.Event) ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = src.defaultPrevented || + src.defaultPrevented === undefined && + // Support: Android<4.0 + src.returnValue === false ? + returnTrue : + returnFalse; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || jQuery.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse, + + preventDefault: function() { + var e = this.originalEvent; + + this.isDefaultPrevented = returnTrue; + + if ( e && e.preventDefault ) { + e.preventDefault(); + } + }, + stopPropagation: function() { + var e = this.originalEvent; + + this.isPropagationStopped = returnTrue; + + if ( e && e.stopPropagation ) { + e.stopPropagation(); + } + }, + stopImmediatePropagation: function() { + var e = this.originalEvent; + + this.isImmediatePropagationStopped = returnTrue; + + if ( e && e.stopImmediatePropagation ) { + e.stopImmediatePropagation(); + } + + this.stopPropagation(); + } +}; + +// Create mouseenter/leave events using mouseover/out and event-time checks +// Support: Chrome 15+ +jQuery.each({ + mouseenter: "mouseover", + mouseleave: "mouseout", + pointerenter: "pointerover", + pointerleave: "pointerout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + delegateType: fix, + bindType: fix, + + handle: function( event ) { + var ret, + target = this, + related = event.relatedTarget, + handleObj = event.handleObj; + + // For mousenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || (related !== target && !jQuery.contains( target, related )) ) { + event.type = handleObj.origType; + ret = handleObj.handler.apply( this, arguments ); + event.type = fix; + } + return ret; + } + }; +}); + +// Support: Firefox, Chrome, Safari +// Create "bubbling" focus and blur events +if ( !support.focusinBubbles ) { + jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { + + // Attach a single capturing handler on the document while someone wants focusin/focusout + var handler = function( event ) { + jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); + }; + + jQuery.event.special[ fix ] = { + setup: function() { + var doc = this.ownerDocument || this, + attaches = data_priv.access( doc, fix ); + + if ( !attaches ) { + doc.addEventListener( orig, handler, true ); + } + data_priv.access( doc, fix, ( attaches || 0 ) + 1 ); + }, + teardown: function() { + var doc = this.ownerDocument || this, + attaches = data_priv.access( doc, fix ) - 1; + + if ( !attaches ) { + doc.removeEventListener( orig, handler, true ); + data_priv.remove( doc, fix ); + + } else { + data_priv.access( doc, fix, attaches ); + } + } + }; + }); +} + +jQuery.fn.extend({ + + on: function( types, selector, data, fn, /*INTERNAL*/ one ) { + var origFn, type; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { + // ( types-Object, data ) + data = data || selector; + selector = undefined; + } + for ( type in types ) { + this.on( type, selector, data, types[ type ], one ); + } + return this; + } + + if ( data == null && fn == null ) { + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return this; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return this.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + }); + }, + one: function( types, selector, data, fn ) { + return this.on( types, selector, data, fn, 1 ); + }, + off: function( types, selector, fn ) { + var handleObj, type; + if ( types && types.preventDefault && types.handleObj ) { + // ( event ) dispatched jQuery.Event + handleObj = types.handleObj; + jQuery( types.delegateTarget ).off( + handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, + handleObj.selector, + handleObj.handler + ); + return this; + } + if ( typeof types === "object" ) { + // ( types-object [, selector] ) + for ( type in types ) { + this.off( type, selector, types[ type ] ); + } + return this; + } + if ( selector === false || typeof selector === "function" ) { + // ( types [, fn] ) + fn = selector; + selector = undefined; + } + if ( fn === false ) { + fn = returnFalse; + } + return this.each(function() { + jQuery.event.remove( this, types, fn, selector ); + }); + }, + + trigger: function( type, data ) { + return this.each(function() { + jQuery.event.trigger( type, data, this ); + }); + }, + triggerHandler: function( type, data ) { + var elem = this[0]; + if ( elem ) { + return jQuery.event.trigger( type, data, elem, true ); + } + } +}); + + +var + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, + rtagName = /<([\w:]+)/, + rhtml = /<|&#?\w+;/, + rnoInnerhtml = /<(?:script|style|link)/i, + // checked="checked" or checked + rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, + rscriptType = /^$|\/(?:java|ecma)script/i, + rscriptTypeMasked = /^true\/(.*)/, + rcleanScript = /^\s*\s*$/g, + + // We have to close these tags to support XHTML (#13200) + wrapMap = { + + // Support: IE9 + option: [ 1, "" ], + + thead: [ 1, "", "
    " ], + col: [ 2, "", "
    " ], + tr: [ 2, "", "
    " ], + td: [ 3, "", "
    " ], + + _default: [ 0, "", "" ] + }; + +// Support: IE9 +wrapMap.optgroup = wrapMap.option; + +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +// Support: 1.x compatibility +// Manipulating tables requires a tbody +function manipulationTarget( elem, content ) { + return jQuery.nodeName( elem, "table" ) && + jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? + + elem.getElementsByTagName("tbody")[0] || + elem.appendChild( elem.ownerDocument.createElement("tbody") ) : + elem; +} + +// Replace/restore the type attribute of script elements for safe DOM manipulation +function disableScript( elem ) { + elem.type = (elem.getAttribute("type") !== null) + "/" + elem.type; + return elem; +} +function restoreScript( elem ) { + var match = rscriptTypeMasked.exec( elem.type ); + + if ( match ) { + elem.type = match[ 1 ]; + } else { + elem.removeAttribute("type"); + } + + return elem; +} + +// Mark scripts as having already been evaluated +function setGlobalEval( elems, refElements ) { + var i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + data_priv.set( + elems[ i ], "globalEval", !refElements || data_priv.get( refElements[ i ], "globalEval" ) + ); + } +} + +function cloneCopyEvent( src, dest ) { + var i, l, type, pdataOld, pdataCur, udataOld, udataCur, events; + + if ( dest.nodeType !== 1 ) { + return; + } + + // 1. Copy private data: events, handlers, etc. + if ( data_priv.hasData( src ) ) { + pdataOld = data_priv.access( src ); + pdataCur = data_priv.set( dest, pdataOld ); + events = pdataOld.events; + + if ( events ) { + delete pdataCur.handle; + pdataCur.events = {}; + + for ( type in events ) { + for ( i = 0, l = events[ type ].length; i < l; i++ ) { + jQuery.event.add( dest, type, events[ type ][ i ] ); + } + } + } + } + + // 2. Copy user data + if ( data_user.hasData( src ) ) { + udataOld = data_user.access( src ); + udataCur = jQuery.extend( {}, udataOld ); + + data_user.set( dest, udataCur ); + } +} + +function getAll( context, tag ) { + var ret = context.getElementsByTagName ? context.getElementsByTagName( tag || "*" ) : + context.querySelectorAll ? context.querySelectorAll( tag || "*" ) : + []; + + return tag === undefined || tag && jQuery.nodeName( context, tag ) ? + jQuery.merge( [ context ], ret ) : + ret; +} + +// Fix IE bugs, see support tests +function fixInput( src, dest ) { + var nodeName = dest.nodeName.toLowerCase(); + + // Fails to persist the checked state of a cloned checkbox or radio button. + if ( nodeName === "input" && rcheckableType.test( src.type ) ) { + dest.checked = src.checked; + + // Fails to return the selected option to the default selected state when cloning options + } else if ( nodeName === "input" || nodeName === "textarea" ) { + dest.defaultValue = src.defaultValue; + } +} + +jQuery.extend({ + clone: function( elem, dataAndEvents, deepDataAndEvents ) { + var i, l, srcElements, destElements, + clone = elem.cloneNode( true ), + inPage = jQuery.contains( elem.ownerDocument, elem ); + + // Fix IE cloning issues + if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && + !jQuery.isXMLDoc( elem ) ) { + + // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 + destElements = getAll( clone ); + srcElements = getAll( elem ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + fixInput( srcElements[ i ], destElements[ i ] ); + } + } + + // Copy the events from the original to the clone + if ( dataAndEvents ) { + if ( deepDataAndEvents ) { + srcElements = srcElements || getAll( elem ); + destElements = destElements || getAll( clone ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + cloneCopyEvent( srcElements[ i ], destElements[ i ] ); + } + } else { + cloneCopyEvent( elem, clone ); + } + } + + // Preserve script evaluation history + destElements = getAll( clone, "script" ); + if ( destElements.length > 0 ) { + setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); + } + + // Return the cloned set + return clone; + }, + + buildFragment: function( elems, context, scripts, selection ) { + var elem, tmp, tag, wrap, contains, j, + fragment = context.createDocumentFragment(), + nodes = [], + i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + elem = elems[ i ]; + + if ( elem || elem === 0 ) { + + // Add nodes directly + if ( jQuery.type( elem ) === "object" ) { + // Support: QtWebKit, PhantomJS + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); + + // Convert non-html into a text node + } else if ( !rhtml.test( elem ) ) { + nodes.push( context.createTextNode( elem ) ); + + // Convert html into DOM nodes + } else { + tmp = tmp || fragment.appendChild( context.createElement("div") ); + + // Deserialize a standard representation + tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); + wrap = wrapMap[ tag ] || wrapMap._default; + tmp.innerHTML = wrap[ 1 ] + elem.replace( rxhtmlTag, "<$1>" ) + wrap[ 2 ]; + + // Descend through wrappers to the right content + j = wrap[ 0 ]; + while ( j-- ) { + tmp = tmp.lastChild; + } + + // Support: QtWebKit, PhantomJS + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, tmp.childNodes ); + + // Remember the top-level container + tmp = fragment.firstChild; + + // Ensure the created nodes are orphaned (#12392) + tmp.textContent = ""; + } + } + } + + // Remove wrapper from fragment + fragment.textContent = ""; + + i = 0; + while ( (elem = nodes[ i++ ]) ) { + + // #4087 - If origin and destination elements are the same, and this is + // that element, do not do anything + if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { + continue; + } + + contains = jQuery.contains( elem.ownerDocument, elem ); + + // Append to fragment + tmp = getAll( fragment.appendChild( elem ), "script" ); + + // Preserve script evaluation history + if ( contains ) { + setGlobalEval( tmp ); + } + + // Capture executables + if ( scripts ) { + j = 0; + while ( (elem = tmp[ j++ ]) ) { + if ( rscriptType.test( elem.type || "" ) ) { + scripts.push( elem ); + } + } + } + } + + return fragment; + }, + + cleanData: function( elems ) { + var data, elem, type, key, + special = jQuery.event.special, + i = 0; + + for ( ; (elem = elems[ i ]) !== undefined; i++ ) { + if ( jQuery.acceptData( elem ) ) { + key = elem[ data_priv.expando ]; + + if ( key && (data = data_priv.cache[ key ]) ) { + if ( data.events ) { + for ( type in data.events ) { + if ( special[ type ] ) { + jQuery.event.remove( elem, type ); + + // This is a shortcut to avoid jQuery.event.remove's overhead + } else { + jQuery.removeEvent( elem, type, data.handle ); + } + } + } + if ( data_priv.cache[ key ] ) { + // Discard any remaining `private` data + delete data_priv.cache[ key ]; + } + } + } + // Discard any remaining `user` data + delete data_user.cache[ elem[ data_user.expando ] ]; + } + } +}); + +jQuery.fn.extend({ + text: function( value ) { + return access( this, function( value ) { + return value === undefined ? + jQuery.text( this ) : + this.empty().each(function() { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + this.textContent = value; + } + }); + }, null, value, arguments.length ); + }, + + append: function() { + return this.domManip( arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.appendChild( elem ); + } + }); + }, + + prepend: function() { + return this.domManip( arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.insertBefore( elem, target.firstChild ); + } + }); + }, + + before: function() { + return this.domManip( arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this ); + } + }); + }, + + after: function() { + return this.domManip( arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this.nextSibling ); + } + }); + }, + + remove: function( selector, keepData /* Internal Use Only */ ) { + var elem, + elems = selector ? jQuery.filter( selector, this ) : this, + i = 0; + + for ( ; (elem = elems[i]) != null; i++ ) { + if ( !keepData && elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem ) ); + } + + if ( elem.parentNode ) { + if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { + setGlobalEval( getAll( elem, "script" ) ); + } + elem.parentNode.removeChild( elem ); + } + } + + return this; + }, + + empty: function() { + var elem, + i = 0; + + for ( ; (elem = this[i]) != null; i++ ) { + if ( elem.nodeType === 1 ) { + + // Prevent memory leaks + jQuery.cleanData( getAll( elem, false ) ); + + // Remove any remaining nodes + elem.textContent = ""; + } + } + + return this; + }, + + clone: function( dataAndEvents, deepDataAndEvents ) { + dataAndEvents = dataAndEvents == null ? false : dataAndEvents; + deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; + + return this.map(function() { + return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); + }); + }, + + html: function( value ) { + return access( this, function( value ) { + var elem = this[ 0 ] || {}, + i = 0, + l = this.length; + + if ( value === undefined && elem.nodeType === 1 ) { + return elem.innerHTML; + } + + // See if we can take a shortcut and just use innerHTML + if ( typeof value === "string" && !rnoInnerhtml.test( value ) && + !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { + + value = value.replace( rxhtmlTag, "<$1>" ); + + try { + for ( ; i < l; i++ ) { + elem = this[ i ] || {}; + + // Remove element nodes and prevent memory leaks + if ( elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem, false ) ); + elem.innerHTML = value; + } + } + + elem = 0; + + // If using innerHTML throws an exception, use the fallback method + } catch( e ) {} + } + + if ( elem ) { + this.empty().append( value ); + } + }, null, value, arguments.length ); + }, + + replaceWith: function() { + var arg = arguments[ 0 ]; + + // Make the changes, replacing each context element with the new content + this.domManip( arguments, function( elem ) { + arg = this.parentNode; + + jQuery.cleanData( getAll( this ) ); + + if ( arg ) { + arg.replaceChild( elem, this ); + } + }); + + // Force removal if there was no new content (e.g., from empty arguments) + return arg && (arg.length || arg.nodeType) ? this : this.remove(); + }, + + detach: function( selector ) { + return this.remove( selector, true ); + }, + + domManip: function( args, callback ) { + + // Flatten any nested arrays + args = concat.apply( [], args ); + + var fragment, first, scripts, hasScripts, node, doc, + i = 0, + l = this.length, + set = this, + iNoClone = l - 1, + value = args[ 0 ], + isFunction = jQuery.isFunction( value ); + + // We can't cloneNode fragments that contain checked, in WebKit + if ( isFunction || + ( l > 1 && typeof value === "string" && + !support.checkClone && rchecked.test( value ) ) ) { + return this.each(function( index ) { + var self = set.eq( index ); + if ( isFunction ) { + args[ 0 ] = value.call( this, index, self.html() ); + } + self.domManip( args, callback ); + }); + } + + if ( l ) { + fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); + first = fragment.firstChild; + + if ( fragment.childNodes.length === 1 ) { + fragment = first; + } + + if ( first ) { + scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); + hasScripts = scripts.length; + + // Use the original fragment for the last item instead of the first because it can end up + // being emptied incorrectly in certain situations (#8070). + for ( ; i < l; i++ ) { + node = fragment; + + if ( i !== iNoClone ) { + node = jQuery.clone( node, true, true ); + + // Keep references to cloned scripts for later restoration + if ( hasScripts ) { + // Support: QtWebKit + // jQuery.merge because push.apply(_, arraylike) throws + jQuery.merge( scripts, getAll( node, "script" ) ); + } + } + + callback.call( this[ i ], node, i ); + } + + if ( hasScripts ) { + doc = scripts[ scripts.length - 1 ].ownerDocument; + + // Reenable scripts + jQuery.map( scripts, restoreScript ); + + // Evaluate executable scripts on first document insertion + for ( i = 0; i < hasScripts; i++ ) { + node = scripts[ i ]; + if ( rscriptType.test( node.type || "" ) && + !data_priv.access( node, "globalEval" ) && jQuery.contains( doc, node ) ) { + + if ( node.src ) { + // Optional AJAX dependency, but won't run scripts if not present + if ( jQuery._evalUrl ) { + jQuery._evalUrl( node.src ); + } + } else { + jQuery.globalEval( node.textContent.replace( rcleanScript, "" ) ); + } + } + } + } + } + } + + return this; + } +}); + +jQuery.each({ + appendTo: "append", + prependTo: "prepend", + insertBefore: "before", + insertAfter: "after", + replaceAll: "replaceWith" +}, function( name, original ) { + jQuery.fn[ name ] = function( selector ) { + var elems, + ret = [], + insert = jQuery( selector ), + last = insert.length - 1, + i = 0; + + for ( ; i <= last; i++ ) { + elems = i === last ? this : this.clone( true ); + jQuery( insert[ i ] )[ original ]( elems ); + + // Support: QtWebKit + // .get() because push.apply(_, arraylike) throws + push.apply( ret, elems.get() ); + } + + return this.pushStack( ret ); + }; +}); + + +var iframe, + elemdisplay = {}; + +/** + * Retrieve the actual display of a element + * @param {String} name nodeName of the element + * @param {Object} doc Document object + */ +// Called only from within defaultDisplay +function actualDisplay( name, doc ) { + var style, + elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), + + // getDefaultComputedStyle might be reliably used only on attached element + display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ? + + // Use of this method is a temporary fix (more like optimization) until something better comes along, + // since it was removed from specification and supported only in FF + style.display : jQuery.css( elem[ 0 ], "display" ); + + // We don't have any data stored on the element, + // so use "detach" method as fast way to get rid of the element + elem.detach(); + + return display; +} + +/** + * Try to determine the default display value of an element + * @param {String} nodeName + */ +function defaultDisplay( nodeName ) { + var doc = document, + display = elemdisplay[ nodeName ]; + + if ( !display ) { + display = actualDisplay( nodeName, doc ); + + // If the simple way fails, read from inside an iframe + if ( display === "none" || !display ) { + + // Use the already-created iframe if possible + iframe = (iframe || jQuery( "